If.jelboz {
	Condition {
		Type RegexMatch
		Regex "^(Jelboz|Jelboz360|Shuboz)$"
		String "${sys:devices/virtual/dmi/id/product_name}"
	}
	True.Define.volume 3
	False.Define.volume 2
}

SectionVerb {
	EnableSequence [
		cset "name='Headphone Jack Switch' off"
		cset "name='HPOL Playback Switch' off"
		cset "name='HPOR Playback Switch' off"
		cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0"
		cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0"
		cset "name='Stereo1 ADC L Mux' 0"
		cset "name='STO1 ADC Capture Switch' on"
		cset "name='RECMIX1L CBJ Switch' 1"
		cset "name='IF1 01 ADC Swap Mux' 2"
		cset "name='CBJ Boost Volume' ${var:volume}"
		cset "name='Stereo1 ADC L1 Mux' 1"
		cset "name='Stereo1 ADC R1 Mux' 1"
		cset "name='Stereo1 ADC MIXL ADC2 Switch' 0"
		cset "name='Stereo1 ADC MIXR ADC2 Switch' 0"
		cset "name='Stereo1 ADC MIXL ADC1 Switch' 1"
		cset "name='Stereo1 ADC MIXR ADC1 Switch' 1"
	]
}

SectionDevice."Speaker" {
	Comment "Speaker"
	Value {
		PlaybackPCM "hw:${CardId},1"
		PlaybackPriority 200
	}
	EnableSequence [
		cset "name='Spk Switch' on"
	]
	DisableSequence [
		cset "name='Spk Switch' off"
	]
}

SectionDevice."Headphones" {
	Comment "Headphones"
	Value {
		PlaybackPCM "hw:${CardId},0"
		PlaybackPriority 300
		PlaybackMixerElem "DAC1"
		JackControl "Headphone Jack"
	}
	EnableSequence [
		cset "name='Headphone Jack Switch' on"
		cset "name='HPOL Playback Switch' 1"
		cset "name='HPOR Playback Switch' 1"
	]
	DisableSequence [
		cset "name='Headphone Jack Switch' off"
		cset "name='HPOL Playback Switch' 0"
		cset "name='HPOR Playback Switch' 0"
	]
}

If.1mic {
	Condition {
		Type String
		Empty "${var:1mic}"
	}
	True {
		SectionDevice."Mic1" {
			Comment "Front Microphone"
			ConflictingDevice [
				"Mic2"
			]
			Value {
				CapturePCM "hw:${CardId},2"
				CapturePriority 200
			}
			EnableSequence [
				cset "name='Dmic Mux' Front Mic"
			]
		}

		SectionDevice."Mic2" {
			Comment "Rear Microphone"
			ConflictingDevice [
				"Mic1"
			]
			Value {
				CapturePCM "hw:${CardId},2"
				CapturePriority 100
			}
			EnableSequence [
				cset "name='Dmic Mux' Rear Mic"
			]
		}

		SectionDevice."Mic3" {
			Comment "Microphone"
			Value {
				CapturePCM "hw:${CardId},0"
				CapturePriority 300
				CaptureMixerElem "Headset Mic"
				JackControl "Headset Mic Jack"
			}
			EnableSequence [
				cset "name='Headset Mic Switch' on"
			]
			DisableSequence [
				cset "name='Headset Mic Switch' off"
			]
		}
	}
	False {
		SectionDevice."Mic1" {
			Comment "Internal Microphone"
			Value {
				CapturePCM "hw:${CardId},2"
				CapturePriority 200
			}
			EnableSequence [
				cset "name='Dmic Mux' Front Mic"
			]
		}

		SectionDevice."Mic2" {
			Comment "Microphone"
			Value {
				CapturePCM "hw:${CardId},0"
				CapturePriority 300
				CaptureMixerElem "Headset Mic"
				JackControl "Headset Mic Jack"
			}
			EnableSequence [
				cset "name='Headset Mic Switch' on"
			]
			DisableSequence [
				cset "name='Headset Mic Switch' off"
			]
		}
	}
}
