aboutsummaryrefslogtreecommitdiff
path: root/bin/psycamp
diff options
context:
space:
mode:
authorpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>2016-08-10 15:28:31 +0000
committerpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>2016-08-10 15:28:31 +0000
commit1cafa39e70732f861317b771545ae6c8d6c22a1b (patch)
tree73dc487f6009d74f9a6b98934cd82b038b39bc6b /bin/psycamp
parente4d52f68672e14f8210ce3a2e73242f8a0ae2581 (diff)
downloadperlpsyc-1cafa39e70732f861317b771545ae6c8d6c22a1b.tar.gz
perlpsyc-1cafa39e70732f861317b771545ae6c8d6c22a1b.zip
psycamp: activate video support
Diffstat (limited to 'bin/psycamp')
-rw-r--r--[-rwxr-xr-x]bin/psycamp40
1 files changed, 22 insertions, 18 deletions
diff --git a/bin/psycamp b/bin/psycamp
index ed4ee52..05f936a 100755..100644
--- a/bin/psycamp
+++ b/bin/psycamp
@@ -67,8 +67,10 @@ $UNI = 'psyc://127.0.0.1:1144d/';
67# when running rxaudio, psycamp can only handle .mp3 and .sdj 67# when running rxaudio, psycamp can only handle .mp3 and .sdj
68# "part" and "dl" are the temporary filenames of some download tools 68# "part" and "dl" are the temporary filenames of some download tools
69$FILETYPES = 69$FILETYPES =
70#% "(mp3|sdj|part|dl)"; #? X 70#% "(mp3|sdj|part|dl)"; #? X
71 "(mp\\d|sdj|part|dl|flac|wav|aif|aiff|ogg|m4a|aac|opus|au)"; #? !X 71 "(mp\\d|sdj|part|dl|flac|wav|aif|aiff|ogg|m4a|aac|opus|au" #? !X
72# whereas mplayer can also handle video
73 . "|webm|mkv|mov|wmv|avi|asf|flv|vob|ogv|qt|yuv|rm|m\dv|mp\w|mpeg|3gp|3g2|mxf|f4\w)"; #? !X
72# 74#
73# 'makenoise' had support for these formats: 75# 'makenoise' had support for these formats:
74# "(sea|mod|gz|lha|Z|lzh|zip|s3m)"; # |med|mmd0)"; 76# "(sea|mod|gz|lha|Z|lzh|zip|s3m)"; # |med|mmd0)";
@@ -96,7 +98,7 @@ $KEEP = 'LOCAL';
96# 16: debug PSYC transactions 98# 16: debug PSYC transactions
97# 32: weird things that shouldn't happen 99# 32: weird things that shouldn't happen
98# 64: show server pid 100# 64: show server pid
99# 128: show songs of same size when using -s S 101# 128: show tracks of same size when using -s S
100# 256: show all output from media engine 102# 256: show all output from media engine
101# 512: watch only engine parse 103# 512: watch only engine parse
102# 1024: watch timer events (timeout simulation) 104# 1024: watch timer events (timeout simulation)
@@ -237,9 +239,9 @@ Cannot find ffmpeg. Will not know duration and bitrates of some tracks.
237 239
238X 240X
239 &enqueue(@ARGV); 241 &enqueue(@ARGV);
240 if ($NS) { # global var for number of enqueued songs 242 if ($NS) { # global var for number of enqueued tracks
241 do { 243 do {
242 @order = $opt_r ? &randomize : &sortsongs($opt_s); 244 @order = $opt_r ? &randomize : &sorttracks($opt_s);
243 print STDERR "\r[order] ", join(' ', @order), "\n\n" if DEBUG & 8; 245 print STDERR "\r[order] ", join(' ', @order), "\n\n" if DEBUG & 8;
244 foreach my $i (@order) { 246 foreach my $i (@order) {
245 unless ($i) { 247 unless ($i) {
@@ -513,9 +515,9 @@ sub next {
513#% &gin('play'); #? X 515#% &gin('play'); #? X
514 if ($opt_M) { 516 if ($opt_M) {
515 undef $!; 517 undef $!;
516 $rc = sendmsg ($opt_M, '_notice_play_music_title', 518 $rc = sendmsg ($opt_M, '_notice_play_media_title',
517 "[_nick] is listening to: [_music_title]", 519 "[_nick] is listening to: [_media_title]",
518 { _nick => $nick, _music_title => $n 520 { _nick => $nick, _media_title => $n
519 } ); 521 } );
520 die "sendmsg $rc: $!" if $!; 522 die "sendmsg $rc: $!" if $!;
521 print STDERR BOLD, YELLOW, "sent to $opt_M!\n", RESET if DEBUG & 16; 523 print STDERR BOLD, YELLOW, "sent to $opt_M!\n", RESET if DEBUG & 16;
@@ -551,7 +553,7 @@ X
551 $any++; 553 $any++;
552 printf "%2d.%9d %s\n", $i, $s, $f; 554 printf "%2d.%9d %s\n", $i, $s, $f;
553 } 555 }
554 print $any ? "\n" : "<no more songs in playlist>\n\n"; 556 print $any ? "\n" : "<no more tracks in playlist>\n\n";
555 print &sep('-'); 557 print &sep('-');
556 &printinfo; 558 &printinfo;
557 next; 559 next;
@@ -573,7 +575,7 @@ X
573 #{ O 575 #{ O
574 if ( $ALLOW_DELETE_KEY ) { 576 if ( $ALLOW_DELETE_KEY ) {
575 if ( /^T(T?)\s*$/ ) { 577 if ( /^T(T?)\s*$/ ) {
576 # 'T' deletes song and remembers it in the index of trash music 578 # 'T' deletes song and remembers it in the index of trash media
577 if (open(HATE, ">>", HATEINDEX)) { 579 if (open(HATE, ">>", HATEINDEX)) {
578 printf HATE "%10d %5s %3s\t%s\r\n", 580 printf HATE "%10d %5s %3s\t%s\r\n",
579 $CurrentSize, $I{duration}, $I{bitrate}, $CurrentFile; 581 $CurrentSize, $I{duration}, $I{bitrate}, $CurrentFile;
@@ -600,7 +602,7 @@ X
600 next; 602 next;
601 } 603 }
602 } 604 }
603 if ( /^(J|U|K|E|M|X|C|S|R)(\w?)\s*$/ ) { 605 if ( /^(J|U|K|E|M|V|X|C|S|R)(\w?)\s*$/ ) {
604 my $r = $2; 606 my $r = $2;
605 if ($r and $r ne $1) { 607 if ($r and $r ne $1) {
606 print BOLD, RED, ">> command $1$r not defined\n", RESET; 608 print BOLD, RED, ">> command $1$r not defined\n", RESET;
@@ -612,12 +614,13 @@ X
612 $1 eq 'K' ? 'KEEP' : 614 $1 eq 'K' ? 'KEEP' :
613 $1 eq 'E' ? 'EDITABLE' : 615 $1 eq 'E' ? 'EDITABLE' :
614 $1 eq 'M' ? 'REMASTER' : 616 $1 eq 'M' ? 'REMASTER' :
617 $1 eq 'V' ? 'VOLATILE' :
615 $1 eq 'X' ? 'EXPORT' : 618 $1 eq 'X' ? 'EXPORT' :
616 $1 eq 'C' ? 'CRITICIZE' : 619 $1 eq 'C' ? 'CRITICIZE' :
617 $1 eq 'S' ? 'SECONDARY' : 'REPERTOIRE'; 620 $1 eq 'S' ? 'SECONDARY' : 'REPERTOIRE';
618 my $f = $CurrentFile; 621 my $f = $CurrentFile;
619 $f = $ENV{PWD}. '/'. $f unless $f =~ m!^/!; 622 $f = $ENV{PWD}. '/'. $f unless $f =~ m!^/!;
620 unless ($f =~ s:\b(SHARE|T|COMPLETE|KEEP|EDITABLE|SECONDARY|REPERTOIRE|NEW|SEEK|TODO|USE|DEEJAY|REMASTER|INCOMING)\b:$t:i) 623 unless ($f =~ s:\b(SHARE|T|COMPLETE|KEEP|EDITABLE|SECONDARY|REPERTOIRE|NEW|SEEK|TODO|USE|DEEJAY|REMASTER|INCOMING|VOLATILE)\b:$t:i)
621 { 624 {
622 print BOLD, RED, ">> not applicable for $f\n", RESET; 625 print BOLD, RED, ">> not applicable for $f\n", RESET;
623 next; 626 next;
@@ -834,7 +837,7 @@ sub which {
834 return $1; 837 return $1;
835} 838}
836 839
837sub sortsongs { 840sub sorttracks {
838 my $style = shift; 841 my $style = shift;
839 return (1 .. $NS) unless $style; 842 return (1 .. $NS) unless $style;
840 my @order; 843 my @order;
@@ -882,7 +885,7 @@ Same file size $B:
882 $file[$b] 885 $file[$b]
883X 886X
884 # we could also be calling cmp, but then we 887 # we could also be calling cmp, but then we
885 # are doing a different job than playing music 888 # are doing a different job than playing media
886 } 889 }
887 return $A <=> $B; 890 return $A <=> $B;
888 } else { 891 } else {
@@ -960,7 +963,7 @@ sub enqueue {
960 &wanted; 963 &wanted;
961 } 964 }
962 if (my $new = $NS - $saveNS) { 965 if (my $new = $NS - $saveNS) {
963 &progress($new, ' songs found'); 966 &progress($new, ' tracks found');
964 print "\n"; 967 print "\n";
965 } 968 }
966} 969}
@@ -1257,7 +1260,7 @@ sub exit {
1257} 1260}
1258 1261
1259sub load { 1262sub load {
1260 my $songs = $opt_L? 'songs': 'entries'; 1263 my $tracks = $opt_L? 'tracks': 'entries';
1261 local *L; 1264 local *L;
1262 return unless open (L, $playlist); 1265 return unless open (L, $playlist);
1263 for ($NS=0; <L>;) { 1266 for ($NS=0; <L>;) {
@@ -1270,7 +1273,7 @@ sub load {
1270 $file[$NS++] = $_; 1273 $file[$NS++] = $_;
1271 } 1274 }
1272 close L; 1275 close L;
1273 print YELLOW, "\rLoaded $NS $songs from $playlist \n\n", RESET 1276 print YELLOW, "\rLoaded $NS $tracks from $playlist \n\n", RESET
1274 unless $opt_q; 1277 unless $opt_q;
1275} 1278}
1276sub save { 1279sub save {
@@ -1309,7 +1312,7 @@ files: (o)pen <file> immediately load this new song
1309 <file> a filename by itself will first fade current song 1312 <file> a filename by itself will first fade current song
1310 (l)ist [<dir>] simply calls 'ls' 1313 (l)ist [<dir>] simply calls 'ls'
1311 (n)ext next file from playlist 1314 (n)ext next file from playlist
1312 '?' show a list of the next 9 songs in the queue 1315 '?' show a list of the next 9 tracks in the queue
1313 (w)rite or (e)dit playlist 1316 (w)rite or (e)dit playlist
1314 e(x)it exit without updating playlist 1317 e(x)it exit without updating playlist
1315 1318
@@ -1339,6 +1342,7 @@ the following uppercase commands:
1339 X = send to EXPORT 1342 X = send to EXPORT
1340 S = send to SECONDARY 1343 S = send to SECONDARY
1341 R = send to REPERTOIRE 1344 R = send to REPERTOIRE
1345 V = send to VOLATILE
1342 1346
1343If you prefer to execute the command *after* having finished playing it, 1347If you prefer to execute the command *after* having finished playing it,
1344you can schedule the move for later by doubling the command letter. So 1348you can schedule the move for later by doubling the command letter. So