Changeset d1a3d62


Ignore:
Timestamp:
Jun 24, 2010, 1:49:52 AM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
nodebathena
Children:
5a05bf2
Parents:
56954d4
git-author:
Kyle C. Brogle <broglek@…> (06/10/10 15:12:26)
git-committer:
Jessica B. Hamrick <jhamrick@…> (06/24/10 01:49:52)
Message:

Removed dependancies on debathena packages
Moved gutenbach filter to gutenbach.old
Removed all zephyr-related code from filter for non-debathena version

Location:
debian
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • debian/control

    r56954d4 rd1a3d62  
    99Architecture: all
    1010Pre-Depends: debconf
    11 Depends: ${shlibs:Depends}, ${misc:Depends}, mplayer, libimage-exiftool-perl, cups, debathena-cupsys-config, sysv-rc, adduser, debathena-zephyr-config, libzephyr4-krb5, alsa-base
     11Depends: ${shlibs:Depends}, ${misc:Depends}, mplayer, libimage-exiftool-perl, cups, sysv-rc, adduser, alsa-base
    1212Conflicts: pulseaudio
    1313Provides: pulseaudio
  • debian/lib/gutenbach

    r0237078 rd1a3d62  
    9494printf(STDERR "Got \%arguments: %s\n", Dumper(\%arguments));
    9595
    96 # Open up a zwrite command to announce the current track.
    97 my @zwrite_command = (qw(/usr/bin/zwrite -d -n -c), $zephyr_class, "-i", $queue.'@'.$host, "-s", "Gutenbach Music Spooler");
    98 
    99 print STDERR "Invoking @zwrite_command\n";
    100 open(ZEPHYR, "|-", @zwrite_command) or die "Couldn't launch zwrite: $!";
     96
    10197
    10298my $status;
    10399if (exists($arguments{"options"}{"job-originating-host-name"})) {
    104     print(ZEPHYR $arguments{"user"},"\@",$arguments{"options"}{"job-originating-host-name"}," is playing:\n");
     100   
    105101    $status = "User: ".$arguments{"user"}."\@".$arguments{"options"}{"job-originating-host-name"};
    106102} else {
    107     print(ZEPHYR $arguments{"user"}," is playing:\n");
     103   
    108104    $status = "User: ".$arguments{"user"};
    109105}
     
    112108sub clear_status {
    113109  kill 15, $pid if $pid;
    114   my @zwrite_command = (qw(/usr/bin/zwrite -d -n -c), $zephyr_class, "-i", $queue.'@'.$host, "-s", "Gutenbach Music Spooler");
    115   open(ZEPH, "|-", @zwrite_command);
    116   print(ZEPH "Playback aborted.\n");
    117   close(ZEPH);
    118110  die;
    119111}
     
    131123if ($magic) {
    132124  # $magic means that Image::ExifTool was able to identify the type of file
    133   printf(ZEPHYR "%s file %s\n", $magic, $arguments{"job-title"});
    134125  $status .= sprintf(" Filetype: %s.", $magic);
    135126  $status .= sprintf(" Filename: %s.", $arguments{"job-title"});
    136127
    137128  if (exists $fileinfo->{'Title'}) {
    138     printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
     129   
    139130    $status .= sprintf(" Title: %s.", $fileinfo->{'Title'});
    140131  }
    141132  foreach my $key (qw/Artist Album AlbumArtist/) {
    142133    if (exists $fileinfo->{$key}) {
    143       printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
     134     
    144135      $status .= sprintf(" %s: %s\n", $key, $fileinfo->{$key});
    145136    }
     
    167158    # Read the title (currently not doing so because youtube-dl doesn't know how to get the title.
    168159    my $title = ""; # <YTDL>
    169     # Print the title to zephyr and the status string.
    170     print ZEPHYR "YouTube video $filepath\n$title";
     160    # Print the title to the status string.
     161   
    171162    $status .= " YouTube video $filepath. $title.";
    172163    # youtube-dl prints the URL of the flash video, which we pass to mplayer as a filename.
     
    175166  } else { # Doesn't appear to be a YouTube URL.
    176167    print STDERR "Resolved external reference to $filepath\n";
    177     printf(ZEPHYR "%s\n", $filepath);
     168   
    178169    $status .= sprintf(" External: %s\n", $filepath);
    179170  }
     
    181172elsif (-T $filepath) { # If the file appears to be a text file, treat it as a playlist.
    182173  split_playlist($filepath, \%arguments);
    183   close(ZEPHYR);
     174 
    184175  # See http://www.cups.org/documentation.php/api-filter.html#MESSAGES
    185176  print CUPS "NOTICE: $status\n";
     
    187178}
    188179
    189 close(ZEPHYR);
     180
    190181print CUPS "NOTICE: $status\n";
    191182play_mplayer_audio($filepath, \%arguments);
     
    223214    elsif ($contenttype eq "audio/x-scpls") { $format="SHOUTCAST" }
    224215    else {
    225       print ZEPHYR
    226         "Unknown Content-Type $contenttype for URI $uri\n";
     216   
    227217    }
    228218  } else { # Unable to match the URL regex
    229     print ZEPHYR "Couldn't read URI for external reference\n";
     219   
    230220    # Return the existing path, in the hopes that mplayer knows what to do with it.
    231221    return $filepath;
     
    233223
    234224  if ($format eq "SHOUTCAST") {
    235     print ZEPHYR "Shoutcast playlist...\n";
     225   
    236226    return get_shoutcast($uri);
    237227  } elsif ($format eq "MP3") {
    238228  } elsif ($format eq "OGG") {
    239229  } else {
    240     print ZEPHYR "Unrecognized stream format: $format\n";
     230   
    241231  }
    242232  return $uri;
     
    259249    }
    260250  }
    261   printf(ZEPHYR "Playlist containing %d valid entries, split into separate jobs.\n", $i);
     251 
    262252}
    263253
     
    282272  my $server = int(rand scalar(@uris));
    283273  # print the name of the stream if available
    284   print ZEPHYR "$titles[$server]\n";
     274 
    285275  return $uris[$server];
    286276}
     
    289279  my ($filepath, $opts) = @_;
    290280
    291   # Open up a zwrite command to show the mplayer output
    292   my @zwrite_command = (qw(/usr/bin/zwrite -d -n -c), $zephyr_class, "-i", $queue.'@'.$host, "-s", "Gutenbach Music Spooler");
    293 
    294   print STDERR "Invoking (from play_mplayer_audio): @zwrite_command\n";
    295281
    296282  # fork for mplayer
    297283  $pid = open(MP3STATUS, "-|");
    298284  unless (defined $pid) {
    299     open(ZEPHYR, "|-", @zwrite_command) or die "Couldn't launch zwrite: $!";
    300     print ZEPHYR "Couldn't fork: $!\n";
    301     close(ZEPHYR);
    302285    return;
    303286  }
     
    306289    # Check if there were any errors
    307290    if ($_ = <MP3STATUS>) {
    308       open(ZEPHYR, "|-", @zwrite_command) or die "Couldn't launch zwrite: $!";
    309       print ZEPHYR "Playback completed with the following errors:\n";
     291     
    310292      while (<MP3STATUS>) {
    311         print ZEPHYR $_;
     293       
    312294      }
    313       close(ZEPHYR);
     295     
    314296    } else {
    315       open(ZEPHYR, "|-", @zwrite_command) or die "Couldn't launch zwrite: $!";
    316       print ZEPHYR "Playback completed successfully.\n";
    317       close(ZEPHYR);
    318     }
    319     close(MP3STATUS) || print ZEPHYR "mplayer exited $?\n";
     297     
     298    }
     299    close(MP3STATUS);
    320300  }
    321301  else { # child
Note: See TracChangeset for help on using the changeset viewer.