factorise watch level

factorise watch level
This commit is contained in:
onyx-and-iris 2022-04-14 17:41:46 +01:00
parent 26832b3cb9
commit 1d29e5113c
2 changed files with 2 additions and 43 deletions

View File

@ -216,24 +216,7 @@ class Strip(Channel):
and _base_vals.strip_level_array_size
== len(self._parent._parent.comp_strip)
):
if self.index <= self._parent.phys_in and any(
self._parent._parent.comp_strip[
self.level_offset : self.level_offset + 1
]
):
vals = (
self.convert_level(
self._parent._parent.strip_levels[self.level_offset]
),
self.convert_level(
self._parent._parent.strip_levels[self.level_offset + 1]
),
)
peak = vals[0] if vals[0] > vals[1] else vals[1]
self.level.set(
(0 if self.mute.get() else 100 + (peak - 18) + self.gain.get())
)
elif any(
if any(
self._parent._parent.comp_strip[
self.level_offset : self.level_offset + 1
]

View File

@ -171,31 +171,7 @@ class GainLayer(ttk.LabelFrame):
and _base_vals.strip_level_array_size
== len(self._parent._parent.comp_strip)
):
if self.index <= self._parent.phys_in and any(
self._parent._parent.comp_strip[
self.level_offset : self.level_offset + 1
]
):
vals = (
self.convert_level(
self._parent._parent.strip_levels[self.level_offset]
),
self.convert_level(
self._parent._parent.strip_levels[self.level_offset + 1]
),
)
peak = vals[0] if vals[0] > vals[1] else vals[1]
self.level.set(
(
0
if self._parent._parent.channel_frame.strips[
self.index
].mute.get()
or not self.on.get()
else 100 + (peak - 18) + self.gain.get()
)
)
elif any(
if any(
self._parent._parent.comp_strip[
self.level_offset : self.level_offset + 1
]