Syntax 6

Define.ProfileName ""
Define.MixerRemap ""
Define.SplitPCMPeriodTime 10000		# 10ms

If.env1 {
	Condition {
		Type String
		Empty "$${env:UCM_USB_PERIOD_TIME}"
	}
	False.Define.SplitPCMPeriodTime "${env:UCM_USB_PERIOD_TIME}"
}

If.linked {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		# Aorus Master Front Headphone 0414:a000
		Regex "USB0414:a000"
	}
	True.Define.ProfileName "../common/linked"
}

If.realtek-alc1220-vb {

	Condition {
		Type RegexMatch
		String "${CardComponents}"
		# 0414:a002 Gigabyte TRX40 Aorus Pro WiFi
		# 0414:a00d Gigabyte TRX40 Aorus Pro WiFi Rev 1.2
		# 0b05:1917 ASUS ROG Strix
		# 0b05:1918 ASUS PRIME TRX40 PRO-S
		# 0db0:0d64 MSI TRX40 Creator
		# 0db0:543d MSI TRX40
		# 26ce:0a01 Asrock TRX40 Creator
		Regex "USB((0414:a00[2d])|(0b05:191[78])|(0db0:(0d64|543d))|(26ce:0a01))"
	}
	True.Define.ProfileName "Realtek/ALC1220-VB-Desktop"
}

If.realtek-alc4080 {

	Condition {
		Type RegexMatch
		String "${CardComponents}"
		# 0414:a00e Gigabyte Z590 Aorus Pro AX
		# 0414:a010 Gigabyte Z590 Vision G Intel
		# 0414:a011 Gigabyte Z690 AORUS ULTRA
		# 0414:a012 Gigabyte Z690 AERO G DDR4
		# 0414:a014 Gigabyte Z690I AORUS ULTRA DDR4
		# 0b05:1984 ASUS Pro WS WRX80E-SAGE SE WIFI
		# 0b05:1996 ASUS on multiple boards (including ASUS ROG Maximus XIII)
		# 0b05:1999 ASUS ROG Strix Z590-A Gaming WiFi
		# 0b05:1a16 ASUS ROG Strix B660-F Gaming WiFi
		# 0b05:1a20 ASUS ROG STRIX Z690-I Gaming Wifi
		# 0b05:1a27 ALC4082 on ASUS ROG Maximus Z690 Hero
		# 0b05:1a52 ASUS ROG Strix X670E-F & Z790-E Gaming Wifi
		# 0b05:1a53 ALC4082 on ASUS ROG Crosshair X670E Extreme
		# 0b05:1a5c ASUS ROG Strix B650E-I Gaming WiFi
		# 0db0:005a MSI MPG Z690 CARBON WIFI
		# 0db0:151f MSI X570S EDGE MAX WIFI
		# 0db0:1feb MSI Edge Wifi Z690
		# 0db0:3130 MSI PRO X670-P WIFI
		# 0db0:36e7 MSI MAG B650I Edge WiFi
		# 0db0:419c MSI MPG X570S Carbon Max Wifi
		# 0db0:422d MSI Mag B650 Tomahawk Wifi
		# 0db0:4240 MSI MAG Z590 Tomahawk Wifi
		# 0db0:62a4 MSI MPG Z790I Edge WiFi
		# 0db0:6c09 MSI MPG Z790 Carbon Wifi
		# 0db0:6cc9 MSI MPG Z590 Gaming Plus
		# 0db0:7696 MSI MAG B650M Mortar Wifi
		# 0db0:82c7 MSI MEG Z690I Unify
		# 0db0:8af7 MSI MPG Z590 Gaming Force
		# 0db0:961e MSI MEG X670E ACE
		# 0db0:a073 MSI MAG X570S Torpedo Max
		# 0db0:a47c MSI MEG X570S Ace Max
		# 0db0:a74b MSI MPG Z790 Edge Wifi
		# 0db0:b202 MSI MAG Z690 Tomahawk Wifi
		# 0db0:d1d7 MSI PRO Z790-A WIFI
		# 0db0:d6e7 MSI MPG X670E Carbon Wifi
		# 26ce:0a06 ASRock X670E/Z790 Taichi
		# 26ce:0a08 ASRock Z790 PG-ITX/TB4
		Regex "USB((0414:a0(0e|1[0124]))|(0b05:(19(84|9[69])|1a(16|2[07]|5[23c])))|(0db0:(005a|151f|1feb|3130|36e7|419c|422d|4240|62a4|6c[0c]9|7696|82c7|8af7|961e|a073|a47c|a74b|b202|d1d7|d6e7))|(26ce:0a0[68]))"
	}
	True.Define.ProfileName "Realtek/ALC4080"
}

If.gigabyte-aorus-main {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB0414:a001"
	}
	True.Define.ProfileName "Gigabyte/Aorus-Master-Main-Audio"
}

If.steinberg-ur24c {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB0499:174d"
	}
	True.Define.ProfileName "Steinberg/UR24C"
}

If.steinberg-ur44 {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		Regex "USB0499:17[03]0"
	}
	True.Define.ProfileName "Steinberg/UR44"
}

If.sony-inzone-h9-h7 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB054c:0e53"
	}
	True.Define.ProfileName "Sony/Inzone-H9-H7"
}

If.roland-bridgecast {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB0582:02b7"
	}
	True.Define.ProfileName "Roland/BridgeCast"
}

If.motu-m24 {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		Regex "USB07fd:000[8b]"
	}
	True.If.M4 {
		Condition {
			Type String
			Haystack "${CardLongName}"
			Needle "MOTU M4"
		}
		True.Define.ProfileName "MOTU/M4"
		False.Define.ProfileName "MOTU/M2"
	}
}

If.dell-wd15 {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		Regex "USB0bda:40(14|2e)"
	}
	True.Define.ProfileName "Dell/WD15-Dock"
}

If.dell-desktop-front {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB0bda:4c54"
	}
	True.Define.ProfileName "Dell/Desktop-Front"
}

If.dell-desktop-rear {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB0bda:4c55"
	}
	True.Define.ProfileName "Dell/Desktop-Rear"
}

If.mbox3 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB0dba:5000"
	}
	True.Define.ProfileName "Digidesign/Digidesign-Mbox-3"
}

If.goxlr {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		Regex "USB1220:8fe[04]"
	}
	True.Define.ProfileName "GoXLR/GoXLR"
}

If.focusrite-scarlett-2i {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		# 8006 2i2 1st Gen
		# 800a 2i4 1st Gen
		# 801c Solo 1st Gen
		# 8200 2i4 2nd Gen
		# 8202 2i2 2nd Gen
		# 8205 Solo 2nd Gen
		# 8210 2i2 3rd Gen
		# 8211 Solo 3rd Gen
		Regex "USB1235:8(0(0[6a]|1c)|2(0[025]|1[01]))"
	}
	True.Define {
		ProfileName "Focusrite/Scarlett-2i"
	}
}

If.behringer-umc202hd {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB1397:0507"
	}
	True.Define {
		ProfileName "Behringer/UMC202HD"
		MixerRemap yes
	}
}

If.behringer-umc204hd {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB1397:0508"
	}
	True.Define {
		ProfileName "Behringer/UMC204HD"
		MixerRemap yes
	}
}

If.behringer-Flow8-Streaming {
	Condition {
	Type String
	Haystack "${CardComponents}"
		Needle "USB1397:050d"
	}
	True.Define.ProfileName "Behringer/Flow8-Streaming"
}

If.behringer-Flow8-Recording {
	Condition {
	Type String
	Haystack "${CardComponents}"
		Needle "USB1397:050c"
	}
	True.Define.ProfileName "Behringer/Flow8-Recording"
}

If.Rane-SL-1 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB13e5:0001"
	}
	True.Define.ProfileName "Rane/SL-1"
}

If.lenovo-p620-rear {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB17aa:1046"
	}
	True.Define.ProfileName "Lenovo/ThinkStation-P620-Rear"
}

If.lenovo-p620-main {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB17aa:104d"
	}
	True.Define.ProfileName "Lenovo/ThinkStation-P620-Main"
}

If.kontrolz1 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB17cc:1210"
	}
	True.Define.ProfileName "NativeInstruments/Traktor-Kontrol-Z1"
}

If.minifuse4 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB1c75:af70"
	}
	True.Define.ProfileName "Arturia/Minifuse-4"
}

If.minifuse12 {
	Condition {
		Type RegexMatch
		String "${CardComponents}"
		Regex "USB1c75:af[89]0"
	}
	True.Define.ProfileName "Arturia/Minifuse-12"
}

If.id4-0003 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB2708:0003"
	}
	True.Define.ProfileName "Audient/Audient-iD4-0003"
}

If.id4-0009 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB2708:0009"
	}
	True.Define.ProfileName "Audient/Audient-iD4-0009"
}

If.ua-volt2 {
	Condition {
		Type String
		Haystack "${CardComponents}"
		Needle "USB2b5a:0021"
	}
	True.Define {
		ProfileName "UniversalAudio/Volt2"
	}
}

If.mixremap {
	Condition {
		Type String
		Empty "${var:MixerRemap}"
	}
	False {
		Include.card-init.File "/lib/card-init.conf"
		Include.ctl-remap.File "/lib/ctl-remap.conf"
	}
}

If.inc {
	Condition {
		Type String
		Empty "${var:ProfileName}"
	}
	True.Error "UCM is not supported for this USB device (${CardLongName} @ ${CardComponents})"
	False.Include.prof.File "/USB-Audio/${var:ProfileName}.conf"
}
