%
% anyremote configuration file for sound management with amixer.
% prerequisites: amixer utility; example is for soundcard #0
%

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

GuiAppName=Sound volume test
GuiAppType=Example
GuiAppBinary=true
GuiAppProtocols=AT
GuiAppDesc=Sound volume control

% 1 - increase sound volume
% 2 - mute/unmute
% 3 - increase sound volume

[Protocol]=AT

(Init)=\
	Include($(CfgDir)/Utils/aliases-at.cfg);\
	Make(var,TwoWayComm,by_value,false);\
	Macro(SETUP_DEFAULT_MIXER);\
	Macro(CHECK_RFCOMM_DEVICE);\
	Exec(TEST=`amixer  -c $(MixerCard) sget Master,0`;U=`echo $TEST|grep "Usage: amixer" |wc -l`;if [ "x$U" != "x0" ]; then $(CfgDir)/Utils/message.sh "ERROR: You have to correct example according to Your system configuration !"; fi);

Answer=\
	Make(disconnect);

Cancel=\
	Make(exit);

% Auto-mute:
InCall($$)=\
	Macro(DEFAULT_TOGGLE_MUTE);\
	Exec($(CfgDir)/Utils/message.sh "$(Param)");\
	Make(remote,off);
	
EndCall($$)=\
	Make(remote,on);\
	Macro(DEFAULT_TOGGLE_MUTE);

* *=Exec(F="$(TmpDir)/anyrem.hlp";echo "1 - Vol-" > $F;echo "2 - Mute/Unmute" >> $F;echo "3 - Vol+" >> $F;$(CfgDir)/Utils/message.sh "`cat $F`")

1=Macro(DEFAULT_VOLUME_DOWN)
2=Macro(DEFAULT_TOGGLE_MUTE)
3=Macro(DEFAULT_VOLUME_UP)

[End]

