1+ Define.HasSpeaker ""
2+
13If.amute {
24 Condition {
35 Type ControlExists
@@ -22,12 +24,51 @@ If.master {
2224If.speaker {
2325 Condition {
2426 Type ControlExists
25- Control "name='Speaker Playback Volume'"
27+ Control "name='Speaker Playback Switch'"
28+ }
29+ True {
30+ Define.HasSpeaker "switch"
31+ BootSequence [
32+ cset "name='Speaker Playback Switch' off"
33+ ]
34+ If.v {
35+ Condition {
36+ Type ControlExists
37+ Control "name='Speaker Playback Volume'"
38+ }
39+ True {
40+ Define.HasSpeaker "volume"
41+ BootSequence [
42+ cset "name='Speaker Playback Volume' 60%"
43+ ]
44+ }
45+ }
46+ }
47+ }
48+
49+ If.bass-speaker {
50+ Condition {
51+ Type ControlExists
52+ Control "name='Bass Speaker Playback Switch'"
53+ }
54+ True {
55+ Define.HasBassSpeaker "switch"
56+ BootSequence [
57+ cset "name='Bass Speaker Playback Switch' off"
58+ ]
59+ If.v {
60+ Condition {
61+ Type ControlExists
62+ Control "name='Bass Speaker Playback Volume'"
63+ }
64+ True {
65+ Define.HasBassSpeaker "volume"
66+ BootSequence [
67+ cset "name='Bass Speaker Playback Volume' 60%"
68+ ]
69+ }
70+ }
2671 }
27- True.BootSequence [
28- cset "name='Speaker Playback Volume' 60%"
29- cset "name='Speaker Playback Switch' off"
30- ]
3172}
3273
3374If.headphone {
@@ -50,3 +91,92 @@ If.capture {
5091 cset "name='Capture Volume' 60%"
5192 ]
5293}
94+
95+ #
96+ # Bass (four) Speakers
97+ #
98+
99+ Define.Speaker4chBass ""
100+
101+ If.bass-spk-switch {
102+ Condition {
103+ Type String
104+ Empty "${var:HasBassSpeaker}"
105+ }
106+ False {
107+ Include.ctl-remap.File "/lib/ctl-remap.conf"
108+
109+ LibraryConfig.remap.Config {
110+ ctl.default.sync {
111+ speaker_bass_sync_switch {
112+ switch "name='Speaker 4ch SyncSw Playback Switch'"
113+ controls [
114+ "name='Speaker Playback Switch'"
115+ "name='Bass Speaker Playback Switch'"
116+ ]
117+ }
118+ }
119+ ctl.default.map {
120+ "name='Speaker 4ch Playback Switch'" {
121+ "name='Speaker Playback Switch'" { vindex.0 0 vindex.1 1 }
122+ "name='Bass Speaker Playback Switch'" { vindex.2 0 vindex.3 1 }
123+ }
124+ }
125+ }
126+
127+ Define.Speaker4chBass "y"
128+ Define.SpeakerSyncVol ""
129+
130+ If.vol {
131+ Condition {
132+ Type String
133+ Haystack "${var:HasSpeaker}"
134+ Needle "volume"
135+ }
136+ True {
137+ Define.SpeakerSyncVol "y"
138+ If.bass-vol {
139+ Condition {
140+ Type String
141+ Heystack "${var:HasBassSpeaker}"
142+ Needle "volume"
143+ }
144+ False.LibraryConfig.remap.Config {
145+ # remap may be better
146+ ctl.default.sync {
147+ speaker_bass_sync_volume {
148+ switch "name='Speaker 4ch SyncVol Playback Switch'"
149+ controls [
150+ "name='Speaker Playback Volume'"
151+ ]
152+ }
153+ }
154+ ctl.default.map {
155+ # FIXME
156+ "name='Speaker 4ch Playback Volume'" {
157+ "name='Speaker Playback Volume'" { vindex.0 0 vindex.1 1 vindex.2 0 vindex.3 1 }
158+ }
159+ }
160+ }
161+ True.LibraryConfig.remap.Config {
162+ ctl.default.sync {
163+ speaker_bass_sync_volume {
164+ switch "name='Speaker 4ch SyncVol Playback Switch'"
165+ controls [
166+ "name='Speaker Playback Volume'"
167+ "name='Bass Speaker Playback Volume'"
168+ ]
169+ }
170+ }
171+ ctl.default.map {
172+ "name='Speaker 4ch Playback Volume'" {
173+ "name='Speaker Playback Volume'" { vindex.0 0 vindex.1 1 }
174+ "name='Bass Speaker Playback Volume'" { vindex.2 0 vindex.3 1 }
175+ }
176+ }
177+ }
178+ }
179+ }
180+ }
181+ }
182+ }
0 commit comments