From a13ccd2c572b5dd5502461ec1a0ac90836bde4b8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Mon, 16 May 2022 22:20:05 +0100 Subject: [PATCH] fix bug setting default submix fix bug setting default submix --- setup.py | 2 +- vmcompact/banner.py | 6 +++--- vmcompact/data.py | 14 +++++++------- vmcompact/gainlayer.py | 2 +- vmcompact/menu.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/setup.py b/setup.py index e0d303d..4360aef 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.5", + version="1.2.6", author="Onyx and Iris", author_email="code@onyxandiris.online", description="Compact Tkinter Voicemeeter Remote App", diff --git a/vmcompact/banner.py b/vmcompact/banner.py index 8da4376..67febbb 100644 --- a/vmcompact/banner.py +++ b/vmcompact/banner.py @@ -1,7 +1,7 @@ import tkinter as tk from tkinter import ttk -from .data import _base_values +from .data import _base_values, _configuration class Banner(ttk.Frame): @@ -9,7 +9,7 @@ class Banner(ttk.Frame): super().__init__() self.parent = parent self.submix = tk.StringVar() - self.submix.set(self.target.bus[_base_values.submixes].label) + self.submix.set(self.target.bus[_configuration.submixes].label) self.label = ttk.Label( self, @@ -30,6 +30,6 @@ class Banner(ttk.Frame): def upd_submix_step(self): if not _base_values.dragging: - self.submix.set(self.target.bus[_base_values.submixes].label) + self.submix.set(self.target.bus[_configuration.submixes].label) self.label["text"] = f"SUBMIX: {self.submix.get().upper()}" self.after(100, self.upd_submix_step) diff --git a/vmcompact/data.py b/vmcompact/data.py index 5739757..41b87ed 100644 --- a/vmcompact/data.py +++ b/vmcompact/data.py @@ -18,11 +18,6 @@ class SingletonMeta(type): @dataclass class Configurations(metaclass=SingletonMeta): - # width of a single labelframe - level_width: int = configuration["channel"]["width"] - # height of a single labelframe - level_height: int = configuration["channel"]["height"] - # is the gui extended extended: bool = configuration["extends"]["extended"] # direction the gui extends @@ -33,6 +28,13 @@ class Configurations(metaclass=SingletonMeta): theme_mode: str = configuration["theme"]["mode"] # size of mousewheel scroll step mwscroll_step: int = configuration["mwscroll_step"]["size"] + # bus assigned as current submix + submixes: int = configuration["submixes"]["default"] + + # width of a single labelframe + level_width: int = configuration["channel"]["width"] + # height of a single labelframe + level_height: int = configuration["channel"]["height"] @property def profile(self): @@ -48,8 +50,6 @@ class BaseValues(metaclass=SingletonMeta): dragging: bool = False # a vban connection established vban_connected: bool = False - # bus assigned as current submix - submixes: int = 0 # pdirty delay pdelay: int = 5 # ldirty delay diff --git a/vmcompact/gainlayer.py b/vmcompact/gainlayer.py index 2d1e60d..caf1695 100644 --- a/vmcompact/gainlayer.py +++ b/vmcompact/gainlayer.py @@ -200,7 +200,7 @@ class SubMixFrame(ttk.Frame): ) self.gainlayers = [ - GainLayer(self, index, _base_values.submixes) for index in range(8) + GainLayer(self, index, _configuration.submixes) for index in range(8) ] for i, labelframe in enumerate(self.labelframes): labelframe.grid(row=0, column=i) diff --git a/vmcompact/menu.py b/vmcompact/menu.py index 808e23d..8be3bea 100644 --- a/vmcompact/menu.py +++ b/vmcompact/menu.py @@ -115,7 +115,7 @@ class Menus(tk.Menu): ) for i in range(8) ] - self._selected_bus[_base_values.submixes].set(True) + self._selected_bus[_configuration.submixes].set(True) if self.parent.kind.name != "Potato": self.menu_layout.entryconfig(0, state="disabled") # layout/extends @@ -233,8 +233,8 @@ class Menus(tk.Menu): self.menu_extends.entryconfig(0, state="normal") def set_submix(self, i): - if _base_values.submixes != i: - _base_values.submixes = i + if _configuration.submixes != i: + _configuration.submixes = i if self.parent.submix_frame is not None: self.parent.submix_frame.teardown() self.parent.nav_frame.show_submix()