App-rmcd
view release on metacpan or search on metacpan
sub show_playlist {
my $current_file = (map { $_->{file} } now_playing($log, 'identify'))[0];
open(my $fh, '<', $temp_playlist) or die("Can not open $temp_playlist: $!");
chomp(my @list = <$fh>);
close($fh);
for(@list) {
if($_ eq $current_file) {
$_ =~ m{.+/(.+)$};
printf("%s\n", $1 ? bold($1) : bold($_));
}
else {
$_ =~ m{.+/(.+)$};
printf("%s\n", ($1) ? $1 : $_);
}
}
open(my $fh, '<', $rmcd_state) or die("Can not open $rmcd_state: $!");
chomp(my $state = <$fh>);
close($fh);
($opt_shuffle) = $state =~ m/Random: (\d+)/;
($opt_repeat) = $state =~ m/Repeat: (\d+)/;
printf("\nRandom: %s Repeat: %s\n",
$opt_shuffle ? bold(fg('blue4', 'On')) : 'Off',
$opt_repeat ? bold(fg('blue4', 'On')) : 'Off',
);
return;
}
sub fileexist {
if(!-p $fifo) {
require POSIX;
print $fifo, "\n\n";
POSIX::mkfifo($fifo, 0666) or croak("Cant mkfifo $fifo: $!");
( run in 0.725 second using v1.01-cache-2.11-cpan-5dc5da66d9d )