From 6d4d290e9eb176cd3673e2a0816b123b063268f3 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Mon, 16 May 2022 00:28:01 +0100 Subject: [PATCH] run a level update if value > 0 << race condition. patch bump --- setup.py | 2 +- vmcompact/channels.py | 18 ++++++++++++++---- vmcompact/gainlayer.py | 9 +++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 91222ce..e0d303d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh: setuptools.setup( name="vmcompact", - version="1.2.4", + version="1.2.5", author="Onyx and Iris", author_email="code@onyxandiris.online", description="Compact Tkinter Voicemeeter Remote App", diff --git a/vmcompact/channels.py b/vmcompact/channels.py index c7c4c62..1aa3ce3 100644 --- a/vmcompact/channels.py +++ b/vmcompact/channels.py @@ -168,8 +168,13 @@ class Strip(ChannelLabelFrame): Checks offset against expected level array size to avoid a race condition """ if self.level_offset + 1 < len(self.parent.parent.strip_levels): - if any( - self.parent.parent.strip_comp[self.level_offset : self.level_offset + 1] + if ( + any( + self.parent.parent.strip_comp[ + self.level_offset : self.level_offset + 1 + ] + ) + or self.level.get() > 0 ): val = self.convert_level( max( @@ -204,8 +209,13 @@ class Bus(ChannelLabelFrame): def upd_levels(self): if self.level_offset + 1 < len(self.parent.parent.bus_levels): - if any( - self.parent.parent.bus_comp[self.level_offset : self.level_offset + 1] + if ( + any( + self.parent.parent.bus_comp[ + self.level_offset : self.level_offset + 1 + ] + ) + or self.level.get() > 0 ): val = self.convert_level( max( diff --git a/vmcompact/gainlayer.py b/vmcompact/gainlayer.py index 26e6872..2d1e60d 100644 --- a/vmcompact/gainlayer.py +++ b/vmcompact/gainlayer.py @@ -139,8 +139,13 @@ class GainLayer(ttk.LabelFrame): Checks offset against expected level array size to avoid a race condition """ if self.level_offset + 1 < len(self.parent.parent.strip_levels): - if any( - self.parent.parent.strip_comp[self.level_offset : self.level_offset + 1] + if ( + any( + self.parent.parent.strip_comp[ + self.level_offset : self.level_offset + 1 + ] + ) + or self.level.get() > 0 ): val = self.convert_level( max(