mirror of
https://github.com/onyx-and-iris/duckypad-twitch.git
synced 2026-04-08 20:23:30 +00:00
rename streamlabs_controller to streamlabs
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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.')
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user