Audio::Radio::XM::PCR - Perl extension for the XM PCR Radio


Audio-Radio-XM-PCR documentation  | view source Contained in the Audio-Radio-XM-PCR distribution.

Index


NAME

Top

Audio::Radio::XM::PCR - Perl extension for the XM PCR Radio

SYNOPSIS

Top






  use Audio::Radio::XM::PCR;
  my $radio = new Audio::Radio::XM::PCR;

  $radio->open;

  # Basic
  $radio->tune(8);  

  # Listen For a while
  sleep(900);

  # Advanced 
  $radio->set_trigger('artist_title_changed', \&print_info);

  # Run for an hour
  my $time = time;
  my $end_time = $time + 3600;

  while (1) {
    my $now = time;
    if ($now > $end_time) {
      last;
    }
    $radio->monitor;
  } 

  $radio->close;

  sub print_info {
    my $channel = $radio->{'current_channel'};
    my $artist = $radio->{'channels'}->{$channel}->{'artist'};
    my $title  = $radio->{'channels'}->{$channel}->{'title'};
    my $length = $radio->{'channels'}->{$channel}->{'remaining'};
    my $minutes = int $length/60;
    my $seconds = $length % 60;
    print "$channel $artist - $title - $minutes:$seconds";
  }




DESCRIPTION

Top

The XM PCR Radio is a USB serial device.

TODO

Top

Fully documented. There are methods to get back the signal strength, etc. - But they're not documented

BUGS

Top

Weirdness - After running for a long time, I'm seeing some undefined string errors.

SEE ALSO

Top

We use the following modules: Device::SerialPort - Unix/Linux Win32::SerialPort - Windows

AUTHOR

Top

Peter Bowen, <peter-radio@bowenfamily.org>

Special thanks to others who figured out the protocol. I'm definately standing on the shoulders of giants.

COPYRIGHT AND LICENSE

Top


Audio-Radio-XM-PCR documentation  | view source Contained in the Audio-Radio-XM-PCR distribution.