diff --git a/duckypad_twitch/audio.py b/duckypad_twitch/audio.py index 3895e2b..bf39058 100644 --- a/duckypad_twitch/audio.py +++ b/duckypad_twitch/audio.py @@ -22,6 +22,7 @@ class Audio(ILayer): super().__init__(duckypad) for attr, val in kwargs.items(): setattr(self, attr, val) + self.vm.observer.add(self.on_mdirty) self.reset_states() @@ -42,6 +43,12 @@ class Audio(ILayer): for button in Buttons: self.vm.button[button].stateonly = getattr(AudioState, button.name) + def on_mdirty(self): + """Handle Voicemeeter dirty event""" + self.logger.debug('Voicemeeter state changed (mdirty event)') + for button in Buttons: + setattr(self.state, button.name, self.vm.button[button].stateonly) + def mute_mics(self): self.state.mute_mics = not self.state.mute_mics if self.state.mute_mics: diff --git a/duckypad_twitch/macros/main.py b/duckypad_twitch/macros/main.py index cf6ac68..be9780d 100644 --- a/duckypad_twitch/macros/main.py +++ b/duckypad_twitch/macros/main.py @@ -58,7 +58,7 @@ def run(): xair_config = configuration.get('xair') with ( - voicemeeterlib.api('potato') as vm, + voicemeeterlib.api('potato', mdirty=True) as vm, xair_api.connect('MR18', **xair_config) as mixer, duckypad_twitch.connect(vm=vm, mixer=mixer) as duckypad, ):