Ignore:
Timestamp:
Aug 12, 2010, 9:27:43 PM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
master, debian, mac, no-cups
Children:
79fac02
Parents:
22be2fa
git-author:
Jessica B. Hamrick <jhamrick@…> (08/12/10 21:27:43)
git-committer:
Jessica B. Hamrick <jhamrick@…> (08/12/10 21:27:43)
Message:

Fix the gutenbach backend, such that it updates
/var/run/gutenbach/status with the currently playing song.
gutenbach-remctl needs this file to exist so that it can respond to
the status get command (and, thus, gutenbach-web needs it, since it
uses the command to display the current status).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach

    rb58aada r4e5ee08  
    116116  print(ZEPH "Playback aborted.\n");
    117117  close(ZEPH);
     118
     119  open(STATUS, ">", "/var/run/gutenbach/status");
     120  print(STATUS, "");
     121  close(STATUS);
    118122  die;
    119123}
     
    130134my ($newpath);
    131135
     136open(STATUS, ">", "/var/run/gutenbach/status");
     137
    132138if ($magic) {
    133139  # $magic means that Image::ExifTool was able to identify the type of file
    134140  printf(ZEPHYR "%s file %s\n", $magic, $arguments{"job-title"});
     141  printf(STATUS "%s file %s\n", $magic, $arguments{"job-title"});
    135142  $status .= sprintf(" Filetype: %s.", $magic);
    136143  $status .= sprintf(" Filename: %s.", $arguments{"job-title"});
     
    138145  if (exists $fileinfo->{'Title'}) {
    139146    printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
     147    #printf(STATUS "%s\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
    140148    $status .= sprintf(" Title: %s.", $fileinfo->{'Title'});
    141149  }
     
    143151    if (exists $fileinfo->{$key}) {
    144152      printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
     153      printf(STATUS "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
    145154      $status .= sprintf(" %s: %s\n", $key, $fileinfo->{$key});
    146155    }
     
    200209
    201210close(ZEPHYR);
     211close(STATUS);
    202212print CUPS "NOTICE: $status\n";
    203213play_mplayer_audio($filepath, \%arguments);
     
    329339      print ZEPHYR "Playback completed successfully.\n";
    330340      close(ZEPHYR);
     341      open(STATUS, ">", "/var/run/gutenbach/status");
     342      print(STATUS, "");
     343      close(STATUS);
    331344    }
    332345    close(MP3STATUS) || print ZEPHYR "mplayer exited $?\n";
Note: See TracChangeset for help on using the changeset viewer.