add fade in/out logic to toggle_workstation_to_onyx()

This commit is contained in:
Onyx and Iris 2025-03-26 02:58:36 +00:00
parent 8fd35408d5
commit ed890ab9e7
3 changed files with 16 additions and 2 deletions

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.5'
__version__ = '1.0.6'

View File

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

View File

@ -94,7 +94,6 @@ exclude = [
"venv",
]
# Same as Black.
line-length = 120
indent-width = 4