Changeset 3a900ef for gutenbach/debian


Ignore:
Timestamp:
Feb 25, 2009, 11:10:33 PM (16 years ago)
Author:
Edward Z. Yang <edwardzyang@…>
Branches:
master, debian, mac, no-cups, nodebathena, web
Children:
b5d15a0
Parents:
40b4488
git-author:
Edward Z. Yang <edwardzyang@…> (02/25/09 18:05:49)
git-committer:
Edward Z. Yang <edwardzyang@…> (02/25/09 23:10:33)
Message:

Rewrite to use a config file for Zephyr.

Signed-off-by: Edward Z. Yang <edwardzyang@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gutenbach/debian/lib/sipbmp3-filter

    r6d813c3 r3a900ef  
    2121use LWP::UserAgent;
    2222use Data::Dumper;
     23
     24my $zephyr_class = "sipb-auto";
     25my $host = "zsr";
     26
     27# Configuration
     28my $config_file = "/etc/sipbmp3-filter-config.pl";
     29if (-r $config_file) {
     30    # Inline the configuration file
     31    local $/;
     32    my $fh;
     33    open $fh, $config_file;
     34    eval <$fh>;
     35}
    2336
    2437my $ua = new LWP::UserAgent;
     
    7992
    8093# Status messages at start of playback
    81 open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c sipb-auto -i ' .
    82   'sipbmp3@zsr -s "SIPB LPR music spooler"');
     94open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i ' .
     95  'sipbmp3@'.$host.' -s "SIPB LPR music spooler"');
    8396print(ZEPHYR "$opts{'n'}\@$opts{'H'} is playing:\n");
    8497
     
    208221
    209222    # Prepare to write status:
    210     open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c sipb-auto -i ' .
    211          'sipbmp3@zsr -s "SIPB LPR music spooler"');
     223    open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c '.$zephyr_class.' -i ' .
     224         'sipbmp3@'.$host.' -s "SIPB LPR music spooler"');
    212225   
    213226    # fork for mpg123
Note: See TracChangeset for help on using the changeset viewer.