Changeset b5d15a0 for gutenbach


Ignore:
Timestamp:
Feb 26, 2009, 12:38:42 AM (16 years ago)
Author:
Edward Z. Yang <edwardzyang@…>
Branches:
master, debian, mac, no-cups, nodebathena, web
Children:
f014bc4
Parents:
3a900ef
git-author:
Edward Z. Yang <edwardzyang@…> (02/26/09 00:38:42)
git-committer:
Edward Z. Yang <edwardzyang@…> (02/26/09 00:38:42)
Message:

Implement status file for remctl.
Signed-off-by: Edward Z. Yang <edwardzyang@…>

File:
1 edited

Legend:

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

    r3a900ef rb5d15a0  
    9696print(ZEPHYR "$opts{'n'}\@$opts{'H'} is playing:\n");
    9797
     98# For the Now Playing remctl command
     99open(STATUS, '>', '/var/run/sipbmp3/status') or die("Can't open status file /var/run/sipbmp3/status");
     100
    98101# So, the file we're currently processing is "-d/-e".
    99102
     
    105108if ($magic) {
    106109    printf(ZEPHYR "%s file %s\n", $magic, $opts{'J'});
    107     printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
     110    printf(STATUS "Filetype: %s\n", $magic);
     111    printf(STATUS "Filename: %s\n", $opts{'J'});
     112    if (exists $fileinfo->{'Title'}) {
     113        printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
     114        printf(STATUS "Title: %s\n", $fileinfo->{'Title'});
     115    }
    108116    foreach my $key (qw/Artist Album AlbumArtist/) {
    109         printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
     117        if (exists $fileinfo->{$key}) {
     118            printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
     119            printf(STATUS "%s: %s\n", $key, $fileinfo->{$key});
     120        }
    110121    }
    111122    my $tempdir = tempdir();
     
    119130    print STDERR "Resolved external reference to $filepath\n";
    120131    printf(ZEPHYR "%s\n", $filepath);
    121     close(ZEPHYR);
     132    printf(STATUS "External: %s\n", $filepath);
    122133}
    123134elsif (-T $filepath) {
    124135    split_playlist($filepath, \%opts);
    125136    close(ZEPHYR);
     137    close(STATUS);
    126138    exit 0;
    127139}
     
    130142#printf(ZEPHYR "Job priority %s\n", $opts{'C'}) if ($opts{'C'} && ($opts{'C'} ne 'A'));
    131143close(ZEPHYR);
     144close(STATUS);
    132145play_mplayer_audio($filepath, \%opts);
    133146
     
    246259       
    247260        close(ZEPHYR);
     261        open(STATUS, '>', '/var/run/sipbmp3/status');
     262        close(STATUS);
    248263    }
    249264  else { # child
Note: See TracChangeset for help on using the changeset viewer.