Автор Тема: xmms to xchat  (Прочетена 1627 пъти)

ubuntulinux

  • Участници
  • ***
  • Публикации: 7
    • Профил
xmms to xchat
« -: Dec 11, 2005, 02:28 »
Здравейте!
Опитвам се да "изпратя" информацията от 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 script v1.07 by APz", "1.07", "", "");
IRC::print("XMMS remote control script v1.07 loaded - type /xmmsctl for help.");

##############################################################################
# XMMS remote control script v1.06 by APz (http://flipperit.net/apz/)        #
#                                                                            #
# This script 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 си ми изкарва коя песен свири в момента...странно  '<img'>
Активен

Нямам си подпис

FuckMyFucker

  • Напреднали
  • *****
  • Публикации: 92
    • Профил
xmms to xchat
« Отговор #1 -: Dec 13, 2005, 22:53 »
Аз ползвам този пльгин и нямам проблем с него.А и.. случайно да не би да си пропуснал да дадеш "Enabled" на SongChange пльгина "Enabled" ?
Активен

  • Гост
xmms to xchat
« Отговор #2 -: Dec 14, 2005, 01:50 »
Не плугинът е Enabled ама пак не бачка..както и да е аз си намерих друг
 '<img'>
Активен

Подобни теми
Заглавие Започната от Отговора Прегледи Последна публикация
Плъгин за Xchat - IRC
Настройка на програми
KacaroV 2 1840 Последна публикация Oct 01, 2005, 19:17
от exabyte
XChat IRC
Настройка на програми
corvus 2 1579 Последна публикация Dec 28, 2005, 13:43
от empty
Xchat
Настройка на програми
linuxlame 5 1965 Последна публикация Jan 28, 2006, 10:56
от
Xchat
Настройка на програми
MarineForce 12 3942 Последна публикация Aug 16, 2010, 14:08
от chen_dzen
Проблем при инсталиране на xchat
Настройка на програми
diavolo_vam 2 1550 Последна публикация Apr 08, 2006, 23:06
от GoodT