%
% anyremote configuration file for Gmusicbrowser (http://squentin.free.fr/gmusicbrowser/gmusicbrowser.html) 
% management (Server-mode)
%
% prerequisites: amixer/pactl utility
%

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

GuiAppName=Gmusicbrowser
GuiAppBinary=gmusicbrowser
GuiAppRun=echo 'P=`ps -ef|grep gmusicbrowser|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then echo NOK; else echo OK; fi'|sh -s
GuiAppIcon=gmusicbrowser.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=An open-source jukebox for large collections of mp3/ogg/flac/mpc files, written in perl.

[Protocol]=Server

(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Macro(SETUP_DEFAULT_MIXER);\
	Make(var,player_name,by_value,Gmusicbrowser);\
	Include($(CfgDir)/Utils/aliases-server-player.cfg);\
	Make(var,gmusicbrowser_opt,R=`gmusicbrowser -h|grep -- -remotecmd`;if [ "x$R" = "x" ]; then echo "-cmd"; else echo "-remotecmd"; fi);

(Connect)=\
	Make(mode,gmusicbrowser);

[Mode]=gmusicbrowser : default_player

% (EnterMode) by Utils/aliases-server-player.cfg

% Volume control and 0-9,*,# assignments by Utils/aliases-server-player.cfg
%1=Exec(gmusicbrowser $(gmusicbrowser_opt) DecVolume);
%2=Exec(gmusicbrowser $(gmusicbrowser_opt) TogMute); -- this do not works
%3=Exec(gmusicbrowser $(gmusicbrowser_opt) IncVolume);

PLAY =Exec(gmusicbrowser $(gmusicbrowser_opt) PlayPause);
RWD  =Exec(gmusicbrowser $(gmusicbrowser_opt) "Rewind 10")
FF   =Exec(gmusicbrowser $(gmusicbrowser_opt) "Forward 10")
PREV =Exec(gmusicbrowser $(gmusicbrowser_opt) PrevSongInPlaylist)
STOP =Exec(gmusicbrowser $(gmusicbrowser_opt) Stop);
NEXT =Exec(gmusicbrowser $(gmusicbrowser_opt) NextSongInPlaylist)
PAUSE=Exec(gmusicbrowser $(gmusicbrowser_opt) PlayPause);

RUN_IF_NEED=Exec(P=`ps -ef|grep gmusicbrowser|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then gmusicbrowser& fi)
RUN_OR_QUIT=Exec(P=`ps -ef|grep gmusicbrowser|grep -v grep|grep -v anyremote|grep -v nedit`; if [ "x$P" = "x" ]; then gmusicbrowser & else gmusicbrowser $(gmusicbrowser_opt) Quit; fi);
QUIT=Exec(gmusicbrowser $(gmusicbrowser_opt) Quit)

[ModeEnd]

[End]
