From 0af0625fed87bc2b9ec57658b40e37b4a30cb15f Mon Sep 17 00:00:00 2001 From: Onyx and Iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:57:48 +0000 Subject: [PATCH] rename streamlabs_controller to streamlabs --- __main__.py | 8 ++++---- duckypad_twitch/__about__.py | 2 +- duckypad_twitch/duckypad.py | 4 ++-- duckypad_twitch/scene.py | 16 ++++++++-------- duckypad_twitch/util.py | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/__main__.py b/__main__.py index 630cf38..1d0ae34 100644 --- a/__main__.py +++ b/__main__.py @@ -39,10 +39,10 @@ def register_hotkeys(duckypad): keyboard.add_hotkey('ctrl+alt+F18', duckypad.obsws.toggle_stream) def streamlabs_controller_hotkeys(): - keyboard.add_hotkey('ctrl+F22', duckypad.streamlabs_controller.begin_stream) - keyboard.add_hotkey('ctrl+F23', duckypad.streamlabs_controller.end_stream) - keyboard.add_hotkey('ctrl+alt+F23', duckypad.streamlabs_controller.launch, args=(10,)) - keyboard.add_hotkey('ctrl+alt+F24', duckypad.streamlabs_controller.shutdown) + keyboard.add_hotkey('ctrl+F22', duckypad.streamlabs.begin_stream) + keyboard.add_hotkey('ctrl+F23', duckypad.streamlabs.end_stream) + keyboard.add_hotkey('ctrl+alt+F23', duckypad.streamlabs.launch, args=(10,)) + keyboard.add_hotkey('ctrl+alt+F24', duckypad.streamlabs.shutdown) def duckypad_hotkeys(): keyboard.add_hotkey('ctrl+F21', duckypad.reset) diff --git a/duckypad_twitch/__about__.py b/duckypad_twitch/__about__.py index 18a032f..f6318b1 100644 --- a/duckypad_twitch/__about__.py +++ b/duckypad_twitch/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2023-present onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> # # SPDX-License-Identifier: MIT -__version__ = '1.0.4' +__version__ = '1.0.5' diff --git a/duckypad_twitch/duckypad.py b/duckypad_twitch/duckypad.py index 94395f8..ee4a9b7 100644 --- a/duckypad_twitch/duckypad.py +++ b/duckypad_twitch/duckypad.py @@ -21,13 +21,13 @@ class DuckyPad: self.audio = Audio(self, vm=self.vm, mixer=self.mixer) self.scene = Scene(self, vm=self.vm) self.obsws = OBSWS(self) - self.streamlabs_controller = StreamlabsController(self) + self.streamlabs = StreamlabsController(self) def __enter__(self): return self def __exit__(self, exc_value, exc_type, traceback): - self.streamlabs_controller.conn.disconnect() + self.streamlabs.disconnect() self.obsws.disconnect() def reset(self): diff --git a/duckypad_twitch/scene.py b/duckypad_twitch/scene.py index d99ed98..39ba229 100644 --- a/duckypad_twitch/scene.py +++ b/duckypad_twitch/scene.py @@ -32,49 +32,49 @@ class Scene(ILayer): self._state = SceneState() def onyx_only(self): - if self._duckypad.streamlabs_controller.switch_scene('onyx_only'): + if self._duckypad.streamlabs.switch_scene('onyx_only'): self.vm.strip[2].mute = False self.vm.strip[3].mute = True self.logger.info('Only Onyx Scene enabled, Iris game pc muted') def iris_only(self): - if self._duckypad.streamlabs_controller.switch_scene('iris_only'): + if self._duckypad.streamlabs.switch_scene('iris_only'): self.vm.strip[2].mute = True self.vm.strip[3].mute = False self.logger.info('Only Iris Scene enabled, Onyx game pc muted') def dual_scene(self): - if self._duckypad.streamlabs_controller.switch_scene('dual_scene'): + if self._duckypad.streamlabs.switch_scene('dual_scene'): self.vm.strip[2].apply({'mute': False, 'gain': 0}) self.vm.strip[3].apply({'A5': True, 'mute': False, 'gain': 0}) self.logger.info('Dual Scene enabled') def onyx_big(self): - if self._duckypad.streamlabs_controller.switch_scene('onyx_big'): + if self._duckypad.streamlabs.switch_scene('onyx_big'): self.vm.strip[2].apply({'mute': False, 'gain': 0}) self.vm.strip[3].apply({'mute': False, 'gain': -3}) self.logger.info('Onyx Big scene enabled') def iris_big(self): - if self._duckypad.streamlabs_controller.switch_scene('iris_big'): + if self._duckypad.streamlabs.switch_scene('iris_big'): self.vm.strip[2].apply({'mute': False, 'gain': -3}) self.vm.strip[3].apply({'mute': False, 'gain': 0}) self.logger.info('Iris Big enabled') def start(self): - if self._duckypad.streamlabs_controller.switch_scene('start'): + if self._duckypad.streamlabs.switch_scene('start'): self.vm.strip[2].mute = True self.vm.strip[3].mute = True self.logger.info('Start scene enabled.. ready to go live!') def brb(self): - if self._duckypad.streamlabs_controller.switch_scene('brb'): + if self._duckypad.streamlabs.switch_scene('brb'): self.vm.strip[2].mute = True self.vm.strip[3].mute = True self.logger.info('BRB: game pcs muted') def end(self): - if self._duckypad.streamlabs_controller.switch_scene('end'): + if self._duckypad.streamlabs.switch_scene('end'): self.vm.strip[2].mute = True self.vm.strip[3].mute = True self.logger.info('End scene enabled.') diff --git a/duckypad_twitch/util.py b/duckypad_twitch/util.py index 60563f0..eba4792 100644 --- a/duckypad_twitch/util.py +++ b/duckypad_twitch/util.py @@ -5,14 +5,14 @@ def ensure_sl(func): """ensure a streamlabs websocket connection has been established""" def wrapper(self, *args): - if self._duckypad.streamlabs_controller.conn.ws is None: + if self._duckypad.streamlabs.conn.ws is None: try: try: self.connect() except AttributeError: - self._duckypad.streamlabs_controller.connect() + self._duckypad.streamlabs.connect() except slobs_websocket.exceptions.ConnectionFailure: - self._duckypad.streamlabs_controller.conn.ws = None + self._duckypad.streamlabs.conn.ws = None return return func(self, *args)