diff options
author | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:44 +0000 |
---|---|---|
committer | psyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet> | 2016-08-10 15:28:44 +0000 |
commit | 4532b85063b141de0682d1897f6003e2cb39d460 (patch) | |
tree | 4978813fa7130e0ef2b330ba51174891f0bf40b1 /bin/psycamp | |
parent | 082ab94da559e9a5ebe7819bf613c9c7d0cb71c8 (diff) | |
download | perlpsyc-4532b85063b141de0682d1897f6003e2cb39d460.tar.gz perlpsyc-4532b85063b141de0682d1897f6003e2cb39d460.zip |
psycamp: read out song titles after playing them
Diffstat (limited to 'bin/psycamp')
-rwxr-xr-x | bin/psycamp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/bin/psycamp b/bin/psycamp index e472d00..778b979 100755 --- a/bin/psycamp +++ b/bin/psycamp | |||
@@ -154,7 +154,7 @@ my $screen = 0; | |||
154 | 154 | ||
155 | MAIN: { | 155 | MAIN: { |
156 | if ($#ARGV >= 0) { | 156 | if ($#ARGV >= 0) { |
157 | getopt('bMnsS'); | 157 | getopt('AbMnsS'); |
158 | } | 158 | } |
159 | $nick = $opt_n | 159 | $nick = $opt_n |
160 | || $ENV{'PSYCNICK'} | 160 | || $ENV{'PSYCNICK'} |
@@ -238,6 +238,12 @@ X | |||
238 | Cannot find ffmpeg. Will not know duration and bitrates of some tracks. | 238 | Cannot find ffmpeg. Will not know duration and bitrates of some tracks. |
239 | 239 | ||
240 | X | 240 | X |
241 | if ($opt_A or $opt_V) { | ||
242 | print STDERR <<X unless $has_espeak = &which('espeak'); | ||
243 | Cannot find espeak. Cannot make spoken announcements. | ||
244 | |||
245 | X | ||
246 | } | ||
241 | &enqueue(@ARGV); | 247 | &enqueue(@ARGV); |
242 | if ($NS) { # global var for number of enqueued tracks | 248 | if ($NS) { # global var for number of enqueued tracks |
243 | do { | 249 | do { |
@@ -511,8 +517,17 @@ sub open { | |||
511 | } | 517 | } |
512 | sub next { | 518 | sub next { |
513 | my $a = shift; | 519 | my $a = shift; |
520 | &sys($has_espeak, '-v', 'en-romanian', '-p', 33, '-k', 44, $opt_A) | ||
521 | if $has_espeak and $opt_A and $CurrentFile; | ||
514 | &fade(43, $a) if $a and $VOL > 50; | 522 | &fade(43, $a) if $a and $VOL > 50; |
515 | my $n = $file[$order[++$CS]]; # || $file[$CS]; | 523 | my $n = $file[$order[++$CS]]; # || $file[$CS]; |
524 | if ($has_espeak and $opt_V and $CurrentFile) { | ||
525 | # $CurrentFile =~ m!/([^/]+)$!; | ||
526 | my $f = $1 || $CurrentFile; | ||
527 | &sys($has_espeak, '-v', 'en-german-5', '-p', 87, '-s', 203, $f); | ||
528 | } | ||
529 | &sys($has_espeak, '-v', 'en-romanian', '-p', 23, '-s', 87, '-k', 87, 'bullshit') | ||
530 | if $has_espeak and $opt_A; | ||
516 | &exit(0) if !$n or ($n eq '') or !$NS or $CS >= $NS; | 531 | &exit(0) if !$n or ($n eq '') or !$NS or $CS >= $NS; |
517 | # return &next(0) if $opt_S and $n =~ /\b$KEEP\b/oi; | 532 | # return &next(0) if $opt_S and $n =~ /\b$KEEP\b/oi; |
518 | &open( $n ); | 533 | &open( $n ); |
@@ -867,6 +882,10 @@ sub which { | |||
867 | /^(\S+)\s*$/; | 882 | /^(\S+)\s*$/; |
868 | return $1; | 883 | return $1; |
869 | } | 884 | } |
885 | sub sys { | ||
886 | print BLUE, join(' ', @_), RESET, "\n" if $opt_v; | ||
887 | return system(@_); | ||
888 | } | ||
870 | 889 | ||
871 | sub sorttracks { | 890 | sub sorttracks { |
872 | my $style = shift; | 891 | my $style = shift; |
@@ -1065,7 +1084,7 @@ sub ginparse { | |||
1065 | } | 1084 | } |
1066 | return 0; | 1085 | return 0; |
1067 | } | 1086 | } |
1068 | if ($opt_V or DEBUG & 512) { | 1087 | if ($opt_W or DEBUG & 512) { |
1069 | #{ !X | 1088 | #{ !X |
1070 | return if / supported but disabled$/; | 1089 | return if / supported but disabled$/; |
1071 | return if /^(Configuration: --|CommandLine:|get_path)/; | 1090 | return if /^(Configuration: --|CommandLine:|get_path)/; |
@@ -1424,8 +1443,9 @@ __END__ | |||
1424 | =head1 SYNOPSIS | 1443 | =head1 SYNOPSIS |
1425 | 1444 | ||
1426 | psycamp [<flags>] [-b <uniform>] [-n <nick>] [-s <sort-algorithm>] | 1445 | psycamp [<flags>] [-b <uniform>] [-n <nick>] [-s <sort-algorithm>] |
1427 | [-M <UNI>] [-S <screen>] [<media-files|directories>] | 1446 | [-M <UNI>] [-S <screen>] [-A <text>] [<media-files|directories>] |
1428 | 1447 | ||
1448 | [-A]nnounce a message between each track using 'espeak' | ||
1429 | [-b]ind PSYC uniform and accept commands from both PSYC and stdin | 1449 | [-b]ind PSYC uniform and accept commands from both PSYC and stdin |
1430 | [-M] sends currently playing title to a monitoring entity via PSYC | 1450 | [-M] sends currently playing title to a monitoring entity via PSYC |
1431 | [-n]ickname to use for monitoring, otherwise a default will be used | 1451 | [-n]ickname to use for monitoring, otherwise a default will be used |
@@ -1436,13 +1456,15 @@ __END__ | |||
1436 | [-H] shows an explanation what this tool is good for, try it! | 1456 | [-H] shows an explanation what this tool is good for, try it! |
1437 | [-r]andomize using a smart shuffle algorithm, much better than "-s r" | 1457 | [-r]andomize using a smart shuffle algorithm, much better than "-s r" |
1438 | [-v]erbose: shows some extra output | 1458 | [-v]erbose: shows some extra output |
1459 | [-W]atch verbose messages from backend | ||
1439 | [-q]uiet: shows close to no output | 1460 | [-q]uiet: shows close to no output |
1440 | [-c]alculate cumulative duration of selections | 1461 | [-c]alculate cumulative duration of selections |
1441 | [-L]oad the tracks in the playlist only if they really exist | 1462 | [-L]oad the tracks in the playlist only if they really exist |
1442 | [-x] will terminate perl and exec mplayer, use when short on memory | 1463 | [-x] will terminate perl and exec mplayer, use when short on memory |
1443 | [-j]ump to end of track: a way to scan through a playlist | 1464 | [-j]ump to end of track: a way to scan through a playlist |
1444 | [-d]elete files after playing if the path contains the word '$VOLATILE'. | 1465 | [-d]elete files after playing if the path contains the word '$VOLATILE' |
1445 | [-D]elete files after playing unless the path contains the word '$KEEP'. | 1466 | [-D]elete files after playing unless the path contains the word '$KEEP' |
1467 | [-V]oice each file name after playing it | ||
1446 | 1468 | ||
1447 | Without arguments, psycamp resumes from last run's playlist. | 1469 | Without arguments, psycamp resumes from last run's playlist. |
1448 | 1470 | ||