%
% anyremote configuration file for rhythmbox  management (Server-mode Bemused emulation)
% Prerequisites: amixer/pactl utility, Bemused client installed on cell phone
%

% STATUS stable
% XTEST no
% SOUND mixer
% ENV no

GuiAppName=Rhythmbox
GuiAppBinary=rhythmbox
GuiAppRun= A=`ps -ef|grep rhythmbox|grep -v grep`; if [ "x$A" = "x" ]; then echo NOK; else echo OK; fi
GuiAppIcon=rhythmbox.png
GuiAppType=Application
GuiAppProtocols=Bemused
GuiAppDesc=Rhythmbox - The music management application for GNOME

[Protocol]=Bemused

(Init)=\
	Include($(CfgDir)/Utils/aliases-bemused.cfg);\
	Macro(BEMUSED_SETUP);\
	Macro(SETUP_DEFAULT_MIXER);
	
(Connect)=\
	Make(mode,rhythmbox);

[Mode]=rhythmbox

(EnterMode)=\
	Exec(P=`ps -ef|grep rhythmbox|grep -v grep`; if [ "x$P" = "x" ]; then rhythmbox & fi);

EXIT=Exec(rhythmbox-client --no-start --quit)
FFWD=Exec(python -c "import dbus;import sys;import os;session_bus = dbus.SessionBus();pp = session_bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player');player = dbus.Interface(pp, 'org.gnome.Rhythmbox.Player');ts=player.getElapsed()+10;player.setElapsed(ts)")
INF2=Send(string,INF2ACK);Send(bytes,128,0,0,0,128,0,0,0,1,0,0);\
	ExecAndSend(string,rhythmbox-client --no-start  --print-playing);Send(bytes,0,0)
INFO=Send(string,INFOACK);Send(bytes,128,0,0,0,128,0,0,0,1,0,0);\
	ExecAndSend(string,rhythmbox-client --no-start  --print-playing)
NEXT=Exec(rhythmbox-client --no-start --next)
PAUS=Exec(rhythmbox-client --no-start --play-pause)
PLAY=Exec(rhythmbox-client --no-start --play-pause)
PREV=Exec(rhythmbox-client --no-start --previous)
RWND=Exec(python -c "import dbus;import sys;import os;session_bus = dbus.SessionBus();pp = session_bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player');player = dbus.Interface(pp, 'org.gnome.Rhythmbox.Player');ts=player.getElapsed()-10;player.setElapsed(ts)")
STOP=Exec(rhythmbox-client --no-start --play-pause)
VOLM($$)=Make(var,default_mixer_value,by_value,$(Param)%);Macro(DEFAULT_VOLUME_SET)

GVOL=Macro(DEFAULT_GVOL);
FADE=Macro(DEFAULT_FADE);
PLEN=Macro(DEFAULT_PLEN);
PLST=Macro(DEFAULT_PLST);

%REPT=Exec()
%SHFL=Exec()
%SEEK=
%SLCT=

[ModeEnd]

[End]
