changes to progressbar level udpates

This commit is contained in:
onyx-and-iris 2022-10-05 23:03:27 +01:00
parent 4db7be172b
commit 294dfe7d03
3 changed files with 27 additions and 11 deletions

View File

@ -226,7 +226,7 @@ class ChannelLabelFrameBuilder(AbstractBuilder):
"""Adds a progress bar widget to a single label frame""" """Adds a progress bar widget to a single label frame"""
self.labelframe.pb = ttk.Progressbar( self.labelframe.pb = ttk.Progressbar(
self.labelframe, self.labelframe,
maximum=100, maximum=72,
orient="vertical", orient="vertical",
mode="determinate", mode="determinate",
variable=self.labelframe.level, variable=self.labelframe.level,

View File

@ -185,8 +185,13 @@ class Strip(ChannelLabelFrame):
if self.index < self.parent.parent.kind.num_strip: if self.index < self.parent.parent.kind.num_strip:
if self.target.levels.is_updated: if self.target.levels.is_updated:
val = max(self.target.levels.prefader) val = max(self.target.levels.prefader)
if _base_values.vban_connected:
self.level.set( self.level.set(
(0 if self.mute.get() else 100 + val - 18 + self.gain.get()) (0 if self.mute.get() else 72 + val - 12 + self.gain.get())
)
else:
self.level.set(
(0 if self.mute.get() else 72 + val + self.gain.get())
) )
@ -208,7 +213,7 @@ class Bus(ChannelLabelFrame):
if self.index < self.parent.parent.kind.num_bus: if self.index < self.parent.parent.kind.num_bus:
if self.target.levels.is_updated or self.level.get() != -118: if self.target.levels.is_updated or self.level.get() != -118:
val = max(self.target.levels.all) val = max(self.target.levels.all)
self.level.set((0 if self.mute.get() else 100 + val - 18)) self.level.set((0 if self.mute.get() else 72 + val))
class ChannelFrame(ttk.Frame): class ChannelFrame(ttk.Frame):

View File

@ -154,11 +154,22 @@ class GainLayer(ttk.LabelFrame):
if self.parent.target.strip[self.index].levels.is_updated: if self.parent.target.strip[self.index].levels.is_updated:
val = max(self.parent.target.strip[self.index].levels.prefader) val = max(self.parent.target.strip[self.index].levels.prefader)
if _base_values.vban_connected:
self.level.set( self.level.set(
( (
0 0
if self.parent.target.strip[self.index].mute or not self.on.get() if self.parent.target.strip[self.index].mute
else 100 + val - 18 + self.gain.get() or not self.on.get()
else 72 + val - 12 + self.gain.get()
)
)
else:
self.level.set(
(
0
if self.parent.target.strip[self.index].mute
or not self.on.get()
else 72 + val + self.gain.get()
) )
) )