Peter A. Bowen > Audio-Radio-XM-PCR > Audio::Radio::XM::PCR

Download:
Audio-Radio-XM-PCR-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

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

SYNOPSIS ^

  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 ^

The XM PCR Radio is a USB serial device.

TODO ^

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

BUGS ^

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

SEE ALSO ^

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

AUTHOR ^

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 ^

Copyright (C) 2004 by Peter Bowen

XM, XM Direct, and PCR are trademarks of XM Sattelite Radio. Windows is a trademark of Microsoft Corp.

Use of this library may be limited by the XM Service and Subscription Terms availalble at http://www.xmradio.com/get_xm/customer_service.html.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: