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

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

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'|bash -f -s
GuiAppIcon=gmusicbrowser.png
GuiAppType=Application
GuiAppProtocols=AT
GuiAppDesc=An open-source jukebox for large collections of mp3/ogg/flac/mpc files, written in perl.

[Protocol]=AT

(Init)=\
	Include($(CfgDir)/Utils/aliases-at.cfg);\
	Macro(SETUP_DEFAULT_MIXER);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(CHECK_RFCOMM_DEVICE);

(Connect)=Make(mode,gmusicbrowser);

[Mode]=gmusicbrowser : default_player_at

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

%1=Exec(gmusicbrowser -cmd DecVolume);
%2=Exec(gmusicbrowser -cmd TogMute); -- this do not works
%3=Exec(gmusicbrowser -cmd IncVolume);

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

[ModeEnd]

[End]
