rename streamlabs_controller to streamlabs

This commit is contained in:
Onyx and Iris 2025-01-20 16:57:48 +00:00
parent dc25ef96a3
commit 0af0625fed
5 changed files with 18 additions and 18 deletions

View File

@ -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)

View File

@ -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'

View File

@ -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):

View File

@ -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.')

View File

@ -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)