# Example Use case verb section for HiFi music e.g. MP3 playback
# By Joe Blogs <joe@blogs.com>

SectionVerb {
  	
	# enable and disable sequences are compulsory
  	EnableSequence [
		
		#set the cdev for the following cset ops.
		cdev "hw:AudioPCI"
		cset "name='PCM Volume' 5,5"

		# run this command when we are finished
		exec "ls -l"
	]

	DisableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Volume' 15,15"
	]

	# Optional QoS and ALSA PCMs
	TQ HiFi
	CapturePCM "hw:0,0"
	PlaybackPCM "hw:0,0"
}

SectionDevice."Headphones".0 {
	
	EnableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Capture Switch' 1,1"
	]

	DisableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Capture Switch' 0,0"
	]

	# the hardware volume controls for this device
	PlaybackVolume "name='Master Playback Volume',index=2"
	PlaybackSwitch "name='Master Playback Switch',index=2"
}

SectionDevice."Headset".0 {
	Comment "Blah Blah"
	EnableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Capture Route' 1,1,1,1"
	]

	DisableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Capture Route' 0,0,0,0"
	]

	# the hardware volume controls for this device
	PlaybackVolume "name='Master Playback Volume',index=2"
	PlaybackSwitch "name='Master Playback Switch',index=2"
}

SectionModifier."PlayTone".0 {
	Comment "Play tone to handset during music playback"
	SupportedDevice [
		"Headset.0"
	]

	EnableSequence [
		cdev "hw:AudioPCI"
		cset "name='Master Mono Playback Switch' 1"
		exec "echo pt headset"
	]

	DisableSequence [
		cdev "hw:AudioPCI"
		cset "name='Master Mono Playback Switch' 0"
	]

	# the PCM source for this modifier
	CapturePCM "hw:0,2"

	# the hardware volume controls for this device
	PlaybackVolume "name='Master Playback Volume',index=2"
	PlaybackSwitch "name='Master Playback Switch',index=2"
}

SectionDevice."Headset".1 {
	
	EnableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Capture Route' 1,1,1,1"
	]

	DisableSequence [
		cdev "hw:AudioPCI"
		cset "name='PCM Capture Route' 0,0,0,0"
	]

	PlaybackVolume "name='Master Playback Volume',index=2"
	PlaybackSwitch "name='Master Playback Switch',index=2"
}

SectionModifier."PlayTone".1 {
	Comment "Play tone to headphones and ahndset during music playback"
	SupportedDevice [
		"Headphones.0"
	]

	EnableSequence [
		cdev "hw:AudioPCI"
		cset "name='Master Mono Playback Volume' 2"
		exec "echo pt headphones"
	]

	DisableSequence [
		cdev "hw:AudioPCI"
		cset "name='Master Mono Playback Volume' 0"
	]

	PlaybackPCM "hw:0,2"
	PlaybackVolume "name='Master Playback Volume',index=2"
	PlaybackSwitch "name='Master Playback Switch',index=2"
}

