: Applications
: xmms to xchat
: ubuntulinux

ubuntulinux 12 2005, 02:20
!
"" XMMS XCHAT- :
:


1. xmmsrcs.pl /.xchat2
2. xmms , Preferences -> "Efect/General Plugins"
3. "Song Change" Configure
4. ,

Song Change:
echo "%s" > /tmp/xmms_playing

Playlint end:
echo "Nothing" > /tmp/xmms_playing

5. xChat xmmsrcs.pl
6. /xmmsctl .


/play /stop . /psong : "ubuntulinux slush : (/)" ... XMMS- config libsong_change.so 2 3 ... .. ;(
xmmsrcs.pl


IRC::register ("XMMS remote control ###### v1.07 by APz", "1.07", "", "");
IRC::print("XMMS remote control ###### v1.07 loaded - type /xmmsctl for help.");

##############################################################################
# XMMS remote control ###### v1.06 by APz (http://flipperit.net/apz/) #
# #
# This ###### adds commands to for controlling XMMS from X-Chat. #
# Put this into ~/.xchat/ for autostart #
# #
# This version is dependant on xmmsinfopipe plugin. #
# #
# You may bug me at [EMAIL=apz@flipperit.net]apz@flipperit.net[/EMAIL] #
# Greez to #mokia & #pinball crew :) #
##############################################################################
#
# Configuration:
#
$infopipefile='/tmp/xmms_playing';
# Change only if you've modified infopipe's output path
#
# Here's the song variables with an example of their output.
# $status_playlist_length => 453
# $status_playlist_playing => 203
# $status_song_position => 03:32
# $status_song_length => 06:40 / stream
# $status_song_name => Sing with Fabio - I love manboobs
# $status_song_file => /home/fabio/mp3/I_love_manboobs.mp3
# Note that the channel command REQUIRES either /say or /me to work.
#
sub formats {
# set here the format for /song-command (local only)
$localformat="$status_song_name ($status_song_position/$status_song_length)";
# and here's the format for /psong-command (public display)
$channelformat="/me slusha : $status_song_name ($status_song_position/$status_song_length)";
}
##############################################################################


IRC::add_command_handler("play", "do_play");
IRC::add_command_handler("pause", "do_pause");
IRC::add_command_handler("stop", "do_stop");
IRC::add_command_handler("next", "do_next");
IRC::add_command_handler("prev", "do_prev");
IRC::add_command_handler("song", "do_song");
IRC::add_command_handler("psong", "do_psong");
IRC::add_command_handler("enque", "do_enque");
IRC::add_command_handler("xmmsctl", "do_help");

sub do_play
{
system("xmms -p &");
return(1);
}

sub do_pause
{
system("xmms -u &");
return(1);
}

sub do_stop
{
system("xmms -s &");
return(1);
}

sub do_next
{
system("xmms -f &");
return(1);
}

sub do_prev
{
system("xmms -r &");
return(1);
}

sub do_enque
{
my $song=shift(@_);
system("xmms -e \"$song\" &");
return(1);
}

sub getinfo {
open($playing, $infopipefile) or IRC::print("xmms infopipe not running!");
while(<$playing>) {
@status=split(": ",$_);
if ($status[0] eq "Tunes in playlist") { $status_playlist_length=$status[1]; }
if ($status[0] eq "Currently playing") { $status_playlist_playing=$status[1]; }
if ($status[0] eq "Position") { $status_song_position=$status[1]; }
if ($status[0] eq "Time") { $status_song_length=$status[1]; }
if ($status[0] eq "Title") { $status_song_name=$status[1]; }
if ($status[0] eq "File") { $status_song_file=$status[1]; }
}
chomp($status_playlist_length);
chomp($status_playlist_playing);
chomp($status_song_position);
chomp($status_song_length);
chomp($status_song_name);
chomp($status_song_file);
close($playing);
# are we playing a stream?
if ($status_song_length eq "0:00") {
$status_song_length="stream";
}
&formats;
}


sub do_song
{
getinfo;
IRC::print("$localformat");
return(1);
}

sub do_psong
{
getinfo;
IRC::command("$channelformat");
return(1);
}

sub do_help
{
IRC::print("Available commands for controlling XMMS:");
IRC::print("Standard commands: /play, /pause, /stop, /prev, /next, /enque [filename with path]");
IRC::print("Extended commands: /song - Prints the name of the currently played song");
IRC::print(" /psong - Prints the name of the currently played song to the channel");
return(1);
}


cat /tmp/xmms_playing ...

Powered by ikonforums 1.0.0 © 2006 ikonforums