Changeset 7e27cc3


Ignore:
Timestamp:
Oct 4, 2008, 3:50:26 AM (16 years ago)
Author:
root <root>
Branches:
master, debian, mac, no-cups, nodebathena, web
Children:
4cc6b4d
Parents:
c711ed9
git-author:
root <root> (10/04/08 03:50:26)
git-committer:
root <root> (10/04/08 03:50:26)
Message:

from quentin: split_playlist

File:
1 edited

Legend:

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

    rc711ed9 r7e27cc3  
    22# Play the data on STDIN as an audio file
    33#
    4 # $Id: sipbmp3-filter,v 1.18 2008-09-28 23:36:26 geofft Exp $
     4# $Id: sipbmp3-filter,v 1.19 2008-10-04 07:50:26 root Exp $
    55# $Source: /tmp/tmp.UFBNno9997/RCS/sipbmp3-filter,v $
    66#
     
    8282    }
    8383}
     84elsif ($opts{'C'} eq 'Z') {
     85    $filepath = resolve_external_reference($filepath, \%opts);
     86}
    8487elsif (-T $filepath) {
    85     $filepath = resolve_external_reference($filepath, \%opts);
    86 }
     88    split_playlist($filepath, \%opts);
     89    close(ZEPHYR);
     90    exit 0;
     91}
     92#printf(STDERR Dumper(\%opts));
     93#printf(STDERR "Job priority %s\n", $opts{'C'}) if $opts{'C'} eq 'Z';
     94#printf(ZEPHYR "Job priority %s\n", $opts{'C'}) if ($opts{'C'} && ($opts{'C'} ne 'A'));
    8795close(ZEPHYR);
    8896play_mplayer_audio($filepath, \%opts);
     
    129137}
    130138
     139sub split_playlist {
     140    my ($file, $opts) = @_;
     141
     142    my $i = 0;
     143   
     144    while (<STDIN>) {
     145        chomp;
     146        if (/^([^#]\S+)/) {
     147            printf (STDERR "Found line: %s\n", $_);
     148            open(LPR, "|-", qw/mit-lpr -Psipbmp3@localhost -CZ/, '-J'.$opts->{J});
     149            print LPR $1;
     150            close(LPR);
     151        $i++;
     152        }
     153    }
     154    printf(ZEPHYR "Playlist containing %d valid entries, split into separate jobs.\n", $i);
     155}
     156
    131157# Process a Shoutcast playlist
    132158# get_shoutcast(URI)
Note: See TracChangeset for help on using the changeset viewer.