Audio-MikMod
view release on metacpan or search on metacpan
README
test.pl
typemap
demo/2ND_PM.S3M
demo/Pixmaps.pm
demo/fx1.wav
demo/mikmod.xpm
demo/player
demo/player-gtk-fork
demo/player-gtk-ipc
demo/player-gtk-thread
The Gtk based player was based on code originally in the gtkmikmod package.
demo/player-gtk-fork :
Perl-GTK based player, uses fork to control the update loop.
Works fairly well, some buginess with pause/unpause.
demo/player-gtk-ipc :
Perl-GTK based player, uses IPC::ShareLite to control the
pause/unpause loop. Still forks update loop.
demo/player-gtk-thread :
Perl-GTK based player, uses Thread for update loop.
Works very well, one thread, so no locking.
-D
daniel-cpan-mikmod@electricrain.com
demo/player-gtk-fork view on Meta::CPAN
use strict;
use ExtUtils::testlib;
use Audio::MikMod qw(:MikMod :Player);
use Gtk;
use Pixmaps;
use Time::HiRes qw(usleep);
use constant TRUE => 1;
use constant FALSE => 0;
# A threaded version might come in the future,
# but for now fork() will have to do.
$SIG{'HUP'} = \&_real_pause;
$SIG{'USR1'} = \&_real_back;
$SIG{'USR2'} = \&_real_forward;
$SIG{'KILL'} = \&_exit;
$SIG{'INT'} = \&_exit;
$SIG{'ALRM'} = \&_exit;
my ($song_loaded,$song_playing,$song_paused) = (0,0,0);
my ($songfile,$songpath,$player_busy);
demo/player-gtk-ipc view on Meta::CPAN
use Audio::MikMod qw(:MikMod :Player);
use Gtk;
use Pixmaps;
use Event qw(loop unloop);
use IPC::ShareLite;
use Time::HiRes qw(usleep);
use constant TRUE => 1;
use constant FALSE => 0;
# A threaded version might come in the future,
# but for now fork() will have to do.
$SIG{'HUP'} = \&_real_pause;
$SIG{'USR1'} = \&_real_back;
$SIG{'USR2'} = \&_real_forward;
$SIG{'KILL'} = \&_exit;
$SIG{'INT'} = \&_exit;
$SIG{'ALRM'} = \&_exit;
my $song_paused = IPC::ShareLite->new(
'-key' => 1971,
demo/player-gtk-ipc view on Meta::CPAN
#$song_playing = 0;
#Player_Stop();
}
sub _stop {
print "In _stop()\n";
$song_paused->store(0);
$song_playing = 0;
usleep(1) while $player_busy;
Player_Stop();
# pthread_join(decode_thread, NULL);
kill 9, $child;
waitpid $child, 0;
}
#sub _pause { kill 'HUP', $child }
sub _pause {
if ($song_paused->fetch) {
$song_paused->store(0);
} else {
$song_paused->store(1);
demo/player-gtk-thread view on Meta::CPAN
#!/usr/bin/perl -w
# $Id: player-gtk-thread,v 1.1 1999/07/29 18:43:42 daniel Exp $
use strict;
use ExtUtils::testlib;
use Audio::MikMod qw(:MikMod :Player);
use Gtk;
use Pixmaps;
use Thread;
use Time::HiRes qw(usleep);
use constant TRUE => 1;
use constant FALSE => 0;
( run in 0.691 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )