%
% 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(echo '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;'|bash -f -s);

Answer=Make(disconnect);
Cancel=Exit

% Auto-mute:
(InCall)=\
	Macro(DEFAULT_TOGGLE_MUTE);\
	Exec(kdialog --msgbox "$(CallId)");\
	Make(remote,off);
	
(EndCall)=\
	Make(remote,on);\
	Macro(DEFAULT_TOGGLE_MUTE);

* *=Exec(F="$HOME/.anyRemote/anyrem.hlp";echo "1 - Vol-" > $F;echo "2 - Mute/Unmute" >> $F;echo "3 - Vol+" >> $F;kdialog -passivepopup "`cat $F`" 7' |bash -f -s)

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

[End]

