Changeset 80bbeea for gutenbach/debian/lib/gutenbach-filter
- Timestamp:
- Jun 24, 2010, 1:27:27 AM (14 years ago)
- Branches:
- master, debian, mac, no-cups, nodebathena, web
- Children:
- a33a064
- Parents:
- d988d9d
- git-author:
- Jessica B. Hamrick <jhamrick@…> (12/13/09 00:48:24)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (06/24/10 01:27:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gutenbach/debian/lib/gutenbach-filter
rd988d9d r80bbeea 23 23 use IPC::Open2; 24 24 25 my $zephyr_class = "sipb-test"; 25 my $zephyr_class = `hostname`; 26 chomp($zephyr_class); 26 27 my $host = `hostname`; 28 chomp($host); 27 29 my $queue = "gutenbach"; 28 30 29 31 # Configuration 30 my $config_file = "/usr/lib/gutenbach/ gutenbach-filter-config.pl";32 my $config_file = "/usr/lib/gutenbach/config/gutenbach-filter-config.pl"; 31 33 if (-r $config_file) { 32 34 # Inline the configuration file … … 93 95 printf(STDERR Dumper(\%opts)); 94 96 97 print(STDERR '/usr/bin/zwrite -d -n -c '.$zephyr_class.' -i '.$queue.'@'.$host.' -s "Gutenbach Music Spooler"'); 98 95 99 # Status messages at start of playback 96 open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i ' . 97 $queue.'@'.$host.' -s "SIPB LPR music spooler"'); 100 open(ZEPHYR, '|/usr/bin/zwrite -d -n -c '.$zephyr_class.' -i '.$queue.'@'.$host.' -s "Gutenbach Music Spooler"'); 98 101 99 102 # For the Now Playing remctl command 100 103 open(STATUS, '>', '/var/run/gutenbach/status') or die("Can't open status file /var/run/gutenbach/status"); 101 104 102 # For the Now Playing local command103 open(CURRENT, '>', '/var/run/gutenbach/current') or die("Can't open status file /var/run/sipbp3/current");104 105 105 106 print(ZEPHYR "$opts{'n'}\@$opts{'H'} is playing:\n"); 106 107 print(STATUS "User: $opts{'n'}\@$opts{'H'}\n"); 107 print(CURRENT "$opts{'n'}\@$opts{'H'} is playing:\n");108 108 109 109 # SIGHUP handler … … 112 112 open(STA, '>', '/var/run/gutenbach/status'); 113 113 close(STA); 114 open(ZEPH, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i '. 115 $queue.'@'.$host.' -s "SIPB LPR music spooler"'); 114 open(ZEPH, '|/usr/bin//zwrite -d -n -c '.$zephyr_class.' -i '.$queue.'@'.$host.' -s "Gutenbach Music Spooler"'); 116 115 print(ZEPH "Playback aborted.\n"); 117 116 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);121 117 die; 122 118 } … … 132 128 if ($magic) { 133 129 printf(ZEPHYR "%s file %s\n", $magic, $opts{'J'}); 134 printf(CURRENT "%s file %s\n", $magic, $opts{'J'});135 130 printf(STATUS "Filetype: %s\n", $magic); 136 131 printf(STATUS "Filename: %s\n", $opts{'J'}); 137 132 if (exists $fileinfo->{'Title'}) { 138 133 printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'}; 139 printf(CURRENT "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};140 134 printf(STATUS "Title: %s\n", $fileinfo->{'Title'}); 141 135 } … … 143 137 if (exists $fileinfo->{$key}) { 144 138 printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key}; 145 printf(CURRENT "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};146 139 printf(STATUS "%s: %s\n", $key, $fileinfo->{$key}); 147 140 } … … 160 153 $title = ""; 161 154 print ZEPHYR "YouTube video $filepath\n$title"; 162 print CURRENT "YouTube video $filepath\n$title";163 155 print STATUS "YouTube video $filepath\n$title"; 164 156 $filepath = <$out>; … … 168 160 print STDERR "Resolved external reference to $filepath\n"; 169 161 printf(ZEPHYR "%s\n", $filepath); 170 printf(CURRENT "%s\n", $filepath);171 162 printf(STATUS "External: %s\n", $filepath); 172 163 } … … 175 166 split_playlist($filepath, \%opts); 176 167 close(ZEPHYR); 177 close(CURRENT);178 168 close(STATUS); 179 169 exit 0; … … 183 173 #printf(ZEPHYR "Job priority %s\n", $opts{'C'}) if ($opts{'C'} && ($opts{'C'} ne 'A')); 184 174 close(ZEPHYR); 185 close(CURRENT);186 175 close(STATUS); 187 176 play_mplayer_audio($filepath, \%opts); … … 280 269 281 270 # Prepare to write status: 282 open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c '.$zephyr_class.' -i ' . 283 $queue.'@'.$host.' -s "SIPB LPR music spooler"'); 271 open(ZEPHYR, '|/usr/bin//zwrite -d -n -c '.$zephyr_class.' -i '.$queue.'\@'.$host.' -s "Gutenbach Music Spooler"'); 284 272 285 273 # fork for mpg123
Note: See TracChangeset
for help on using the changeset viewer.