#!/usr/bin/perl #$Id: cursong 20 2003-01-16 00:20:06Z steve $ #use strict; use Xmms::Remote (); use Getopt::Std; my $search = "netsearch"; getopts("hr:N:sfS:"); usage() if $opt_h; my $session = 0; $session = $opt_N if $opt_N ne ""; my $offset = 0; $offset = $opt_r if $opt_r; my $remote = Xmms::Remote->new($session); if ($remote->is_running) { my $title = $remote->get_playlist_title($remote->get_playlist_pos + $offset); $title =~ /^(?:(?:(.+)\:)?(.+)\s*-\s*)?(.+?)$/; my $auth = $1; my $album = $2; my $song = $3; # print "auth: $auth\nalbum: $album\nsong: $song\n"; if($opt_s){ open OUT, "|say"; print OUT "$auth, $album, $song\n"; close OUT; }elsif($opt_f){ print $remote->get_playlist_file($remote->get_playlist_pos + $offset)."\n"; }elsif( $opt_S ne "" ){ system "$search -$opt_S $song"; }else{ print "$title\n"; } } sub usage{ die< USAGE }