From ed890ab9e70fc2693006344e35b9a493308f48c9 Mon Sep 17 00:00:00 2001 From: Onyx and Iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Wed, 26 Mar 2025 02:58:36 +0000 Subject: [PATCH] add fade in/out logic to toggle_workstation_to_onyx() --- duckypad_twitch/__about__.py | 2 +- duckypad_twitch/audio.py | 15 +++++++++++++++ pyproject.toml | 1 - 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/duckypad_twitch/__about__.py b/duckypad_twitch/__about__.py index f6318b1..1670c05 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.5' +__version__ = '1.0.6' diff --git a/duckypad_twitch/audio.py b/duckypad_twitch/audio.py index 3f2bbf0..b7e3105 100644 --- a/duckypad_twitch/audio.py +++ b/duckypad_twitch/audio.py @@ -1,6 +1,7 @@ import logging from enum import IntEnum +import time import vban_cmd from . import configuration @@ -140,8 +141,22 @@ class Audio(ILayer): vban.vban.instream[0].on = True self.vm.strip[5].gain = -6 self.vm.vban.outstream[2].on = True + + # Fade out the workstation + current_fader = self.mixer.lr.mix.fader + while current_fader > -90: + current_fader -= 1 + self.mixer.lr.mix.fader = current_fader + time.sleep(0.05) else: with vban_cmd.api('potato', outbound=True, **onyx_conn) as vban: vban.vban.instream[0].on = False self.vm.strip[5].gain = 0 self.vm.vban.outstream[2].on = False + + # Fade in the workstation + current_fader = self.mixer.lr.mix.fader + while current_fader < -36: + current_fader += 1 + self.mixer.lr.mix.fader = current_fader + time.sleep(0.05) diff --git a/pyproject.toml b/pyproject.toml index ec9e7b9..cf40891 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,6 @@ exclude = [ "venv", ] -# Same as Black. line-length = 120 indent-width = 4