Changeset 2e8b589 for gutenbach/debian/lib/gutenbach-filter
- Timestamp:
- Jun 24, 2010, 1:27:07 AM (14 years ago)
- Branches:
- master, debian, mac, no-cups, nodebathena, web
- Children:
- d988d9d
- Parents:
- e5529cd
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/12/09 18:08:33)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (06/24/10 01:27:07)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
gutenbach/debian/lib/gutenbach-filter
rf1ba976 r2e8b589 2 2 # Play the data on STDIN as an audio file 3 3 # 4 # $Id: sipbmp3-filter,v 1.26 2009/02/20 00:27:17 geofft Exp root $5 # $Source: /usr/local/bin/RCS/ sipbmp3-filter,v $4 # $Id: gutenbach-filter,v 1.26 2009/02/20 00:27:17 geofft Exp root $ 5 # $Source: /usr/local/bin/RCS/gutenbach-filter,v $ 6 6 # 7 7 # TODO … … 25 25 my $zephyr_class = "sipb-test"; 26 26 my $host = `hostname`; 27 my $queue = " sipbmp3";27 my $queue = "gutenbach"; 28 28 29 29 # Configuration 30 my $config_file = "/ etc/sipbmp3-filter-config.pl";30 my $config_file = "/usr/lib/gutenbach/gutenbach-filter-config.pl"; 31 31 if (-r $config_file) { 32 32 # Inline the configuration file … … 40 40 41 41 close(STDERR); 42 open(STDERR, ">>", "/tmp/ sipbmp3.log") or warn "Couldn't open log: $!";42 open(STDERR, ">>", "/tmp/gutenbach.log") or warn "Couldn't open log: $!"; 43 43 44 44 $ENV{"TERM"}="vt100"; … … 98 98 99 99 # For the Now Playing remctl command 100 open(STATUS, '>', '/var/run/sipbmp3/status') or die("Can't open status file /var/run/sipbmp3/status"); 100 open(STATUS, '>', '/var/run/gutenbach/status') or die("Can't open status file /var/run/gutenbach/status"); 101 102 # For the Now Playing local command 103 open(CURRENT, '>', '/var/run/gutenbach/current') or die("Can't open status file /var/run/sipbp3/current"); 101 104 102 105 print(ZEPHYR "$opts{'n'}\@$opts{'H'} is playing:\n"); 103 106 print(STATUS "User: $opts{'n'}\@$opts{'H'}\n"); 107 print(CURRENT "$opts{'n'}\@$opts{'H'} is playing:\n"); 104 108 105 109 # SIGHUP handler 106 110 sub clear_status { 107 111 # Possible race condition if the previous status is still going 108 open(STA, '>', '/var/run/ sipbmp3/status');112 open(STA, '>', '/var/run/gutenbach/status'); 109 113 close(STA); 110 114 open(ZEPH, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i '. … … 112 116 print(ZEPH "Playback aborted.\n"); 113 117 close(ZEPH); 118 open(CURRENT, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i '. 119 $queue.'@'.$host.' -s "SIPB LPR music spooler"'); 120 close(CURRENT); 114 121 die; 115 122 } … … 125 132 if ($magic) { 126 133 printf(ZEPHYR "%s file %s\n", $magic, $opts{'J'}); 134 printf(CURRENT "%s file %s\n", $magic, $opts{'J'}); 127 135 printf(STATUS "Filetype: %s\n", $magic); 128 136 printf(STATUS "Filename: %s\n", $opts{'J'}); 129 137 if (exists $fileinfo->{'Title'}) { 130 138 printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'}; 139 printf(CURRENT "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'}; 131 140 printf(STATUS "Title: %s\n", $fileinfo->{'Title'}); 132 141 } … … 134 143 if (exists $fileinfo->{$key}) { 135 144 printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key}; 145 printf(CURRENT "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key}; 136 146 printf(STATUS "%s: %s\n", $key, $fileinfo->{$key}); 137 147 } … … 150 160 $title = ""; 151 161 print ZEPHYR "YouTube video $filepath\n$title"; 162 print CURRENT "YouTube video $filepath\n$title"; 152 163 print STATUS "YouTube video $filepath\n$title"; 153 164 $filepath = <$out>; … … 157 168 print STDERR "Resolved external reference to $filepath\n"; 158 169 printf(ZEPHYR "%s\n", $filepath); 170 printf(CURRENT "%s\n", $filepath); 159 171 printf(STATUS "External: %s\n", $filepath); 160 172 } … … 163 175 split_playlist($filepath, \%opts); 164 176 close(ZEPHYR); 177 close(CURRENT); 165 178 close(STATUS); 166 179 exit 0; … … 170 183 #printf(ZEPHYR "Job priority %s\n", $opts{'C'}) if ($opts{'C'} && ($opts{'C'} ne 'A')); 171 184 close(ZEPHYR); 185 close(CURRENT); 172 186 close(STATUS); 173 187 play_mplayer_audio($filepath, \%opts); … … 291 305 292 306 close(ZEPHYR); 293 open(STATUS, '>', '/var/run/ sipbmp3/status');307 open(STATUS, '>', '/var/run/gutenbach/status'); 294 308 close(STATUS); 295 309 }
Note: See TracChangeset
for help on using the changeset viewer.