Audio::Daemon::MPG321

Audio::Daemon::MPG321 is a song queue daemon for Audio::Play::MPG321.
Download

Audio::Daemon::MPG321 Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Da-Breegster
  • Publisher web site:
  • http://search.cpan.org/~breegster/Audio-Daemon-MPG321-0.002/lib/Audio/Daemon/MPG321.pm

Audio::Daemon::MPG321 Tags


Audio::Daemon::MPG321 Description

Audio::Daemon::MPG321 is a song queue daemon for Audio::Play::MPG321. Audio::Daemon::MPG321 is a song queue daemon for Audio::Play::MPG321.SYNOPSISuse Audio::Daemon::MPG321; my $player = new Audio::Daemon::MPG321 ("/home/dabreegster/foo.mp3", "/home/dabreegster/bar.mp3");$SIG{CHLD} = 'IGNORE'; $player->add("/home/dabreegster/blah.mp3");while (1) { until ($player->{player}->state() == 0) { $player->{player}->poll(); select(undef, undef, undef, 1.0); } $player->{pointer}++; unless ($player->{queue}->) { exit 0; } else { $player->load(); } }This daemonizes Audio::Play::MPG321, or at least gives it the ability to manage a song queue. You can build a simple queue of songs and move between them.Note the infinite loop in the synopsis. You must put this in your program or the queue won't work!All it does is keep Audio::Play::MPG321's knowledge of the state of the player fresh and continously tests to see if one song is over so the next can be loaded. The code is kept out of the module itself because this process must be done, one way or the other, and forking in the module itself is very messy.The example loop will work fine and you may modify it any way you like to incoorporate it into your frontend, as long as you poll the player, test to see if the song is finished yet, and load the next song in the queue (If there is one!) when it is time to do so.Requirements:· Perl Requirements: · Perl


Audio::Daemon::MPG321 Related Software