App-rmcd
view release on metacpan or search on metacpan
open(my $fh, '>', $fifo) or croak("Cant open $fifo: $!");
print $fh "$command", @args, "\n";
close($fh);
}
sub info {
my $np = now_playing($log, 'identify');
if(! -t STDOUT) {
printf("mplayer: %s (%s)\n", $np->{file}, $np->{bitrate} / 1000);
return;
}
for my $wanted(qw(
artist album title
genre year bitrate
channels chapters
format
file
)) {
printf("%8s: %s\n", ucfirst($wanted), $np->{$wanted})
if exists($np->{$wanted});
}
return;
}
sub list_channels {
for my $id(sort(keys(%channels))) {
printf "%s: %s\n", $id, $channels{$id};
}
}
sub usage {
pod2usage(verbose => 1) and exit;
}
__END__
=pod
=head1 NAME
rmcd - Remotely control a daemonized Mplayer process
=head1 SYNOPSIS
rmcd [OPTION]... [FILE/URI]
=head1 DESCRIPTION
B<rmcd> is a mplayer daemon/client - it daemonizes itself, playing
music/movies/radio stations and waiting for input through the named pipe.
You can send commands, load and play new content whenever you like.
You can run rmcd on one computer and remotely control it on another, fully
transparent. It only cares for the presence of the named pipe.
You can also setup mplayer to stream the content to you, creating a solution
similar to MPD and their builti-in httpd streaming (except MPD does not support
video streaming).
rmcd features a built-in, user configurable, web radio management system,
functionality for copying the current track to your portable mp3 player or
wherever you prefer, favorizing of tracks and loading of the same, now playing
information for both local files and streams, along with other nifty stuff.
=head1 OPTIONS
-l, --load play FILE(s)/URI or radio station (see -chanlist)
-r, --shuffle shuffle the playlist before adding it
--repeat turn repeat ON
-pl, --playlist show the current playlist
-c, --cmd send COMMAND to a running process (see shortcuts)
-cl, --clist show a list of commands that are supported
-i, --info show now playing information
-n, --next next in playlist
-p, --prev previous in playlist
-t, --toggle toggle playback
-s, --stop stop playback
-f, --fullscreen toggle fullscreen
-k, --kill kill the running process
-h, --help show the help and exit
-m, --man show the documentation and exit
-v, --version show version info and exit
=head1 ENVIRONMENT
The configuration file should be placed in $XDG_CONFIG_HOME/rmcd/rmcd.conf
=head1 AUTHOR
Magnus Woldrich
CPAN ID: WOLDRICH
m@japh.se
http://japh.se
=head1 CONTRIBUTORS
None required yet.
=head1 COPYRIGHT
Copyright 2010, 2011 the B<rmcd> L</AUTHOR> and L</CONTRIBUTORS> as listed
above.
=head1 LICENSE
This application is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
=head1 SEE ALSO
L<rmcd.conf(1)>
B<Radio Playing Daemon> L<http://github.com/trapd00r/RPD/>
L<Mplayer::NowPlaying> L<http://github.com/trapd00r/Mplayer-NowPlaying/>
( run in 1.010 second using v1.01-cache-2.11-cpan-39bf76dae61 )