@@ -251,6 +251,7 @@ class Application {
251251 setupDriverDeviceEvents ( )
252252 }
253253
254+ private static var ignoreNextDriverMuteEvent = false
254255 private static func setupDriverDeviceEvents ( ) {
255256 AudioDeviceEvents . on ( . volumeChanged, onDevice: Driver . device!) {
256257 if ignoreNextVolumeEvent {
@@ -264,11 +265,17 @@ class Application {
264265 return
265266 }
266267 let gain = Double ( Driver . device!. virtualMasterVolume ( direction: . playback) !)
268+ Console . log ( gain)
267269 if ( gain <= 1 && gain != Application . store. state. effects. volume. gain) {
268270 Application . dispatchAction ( VolumeAction . setGain ( gain, false ) )
269271 }
270272 }
273+
271274 AudioDeviceEvents . on ( . muteChanged, onDevice: Driver . device!) {
275+ if ( ignoreNextDriverMuteEvent) {
276+ ignoreNextDriverMuteEvent = false
277+ return
278+ }
272279 Application . dispatchAction ( VolumeAction . setMuted ( Driver . device!. mute) )
273280 }
274281 }
@@ -395,6 +402,12 @@ class Application {
395402
396403 static var overrideNextVolumeEvent = false
397404 static func volumeChangeButtonPressed ( direction: VolumeChangeDirection , quarterStep: Bool = false ) {
405+ if direction == . UP {
406+ ignoreNextDriverMuteEvent = true
407+ Utilities . delay ( 100 ) {
408+ ignoreNextDriverMuteEvent = false
409+ }
410+ }
398411 let gain = volume. gain
399412 if ( gain >= 1 ) {
400413 if direction == . DOWN {
@@ -426,6 +439,10 @@ class Application {
426439 }
427440 }
428441
442+ static func muteButtonPressed ( ) {
443+ ignoreNextDriverMuteEvent = false
444+ }
445+
429446 private static func killEngine ( ) {
430447 engine = nil
431448 }
0 commit comments