commit - 9fb9424225a739a0fbbfec5d31f21458126fd9c2
commit + 63dcef309e50e44d3faa5ce537d8f2935ff9ea67
blob - 93a9ebb51a9db6ab915e348b3cd948d44c561711
blob + 372c9f2e5995a46a6da87fee718697f30e14931a
--- contrib/amused-monitor
+++ contrib/amused-monitor
my $time_cur;
my $time_dur;
my $status;
-my $repeat;
+my $mode;
my $last_lines;
}
sub status {
- my ($pos, $dur, $repeat);
+ my ($pos, $dur, $mode);
open (my $fh, "-|", "amused", "status", "-f",
- "status,time:raw,repeat:oneline");
+ "status,time:raw,mode:oneline");
my $status = <$fh>;
chomp $status;
while (<$fh>) {
chomp;
$pos = s/position //r if m/^position /;
$dur = s/duration //r if m/^duration /;
- $repeat = $_ if m/^repeat/;
+ $mode = $_ if m/^repeat/;
}
close($fh);
- return ($status, $pos, $dur, $repeat);
+ return ($status, $pos, $dur, $mode);
}
sub showtime {
addstring $post;
}
-sub show_repeat {
- my ($y, $x, $repeat) = @_;
- my ($pre, $c, $post) = center($repeat, ' ');
+sub show_mode {
+ my ($y, $x, $mode) = @_;
+ my ($pre, $c, $post) = center($mode, ' ');
addstring $y, $x, $pre;
addstring $c;
addstring $post;
offsets $LINES - 4, 0, $playlist_cur, $playlist_max;
progress $LINES - 3, 0, $time_cur, $time_dur;
show_status $LINES - 2, 0, $status;
- show_repeat $LINES - 1, 0, $repeat;
+ show_mode $LINES - 1, 0, $mode;
refresh;
}
}
sub getstatus {
- ($status, $time_cur, $time_dur, $repeat) = status;
+ ($status, $time_cur, $time_dur, $mode) = status;
}
sub save {
if $status =~ m/^playing/;
}
- ($status, $time_cur, $time_dur, $repeat) = status
- unless $tick++ % 8;
+ getstatus unless $tick++ % 8;
hinput if $poll->events(\*STDIN) & POLLIN;
hevent $monitor if $poll->events($monitor) & POLLIN;