fix bug setting default submix

fix bug setting default submix
This commit is contained in:
onyx-and-iris 2022-05-16 22:20:05 +01:00
parent 6d4d290e9e
commit a13ccd2c57
5 changed files with 15 additions and 15 deletions

View File

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup( setuptools.setup(
name="vmcompact", name="vmcompact",
version="1.2.5", version="1.2.6",
author="Onyx and Iris", author="Onyx and Iris",
author_email="code@onyxandiris.online", author_email="code@onyxandiris.online",
description="Compact Tkinter Voicemeeter Remote App", description="Compact Tkinter Voicemeeter Remote App",

View File

@ -1,7 +1,7 @@
import tkinter as tk import tkinter as tk
from tkinter import ttk from tkinter import ttk
from .data import _base_values from .data import _base_values, _configuration
class Banner(ttk.Frame): class Banner(ttk.Frame):
@ -9,7 +9,7 @@ class Banner(ttk.Frame):
super().__init__() super().__init__()
self.parent = parent self.parent = parent
self.submix = tk.StringVar() 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.label = ttk.Label(
self, self,
@ -30,6 +30,6 @@ class Banner(ttk.Frame):
def upd_submix_step(self): def upd_submix_step(self):
if not _base_values.dragging: 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.label["text"] = f"SUBMIX: {self.submix.get().upper()}"
self.after(100, self.upd_submix_step) self.after(100, self.upd_submix_step)

View File

@ -18,11 +18,6 @@ class SingletonMeta(type):
@dataclass @dataclass
class Configurations(metaclass=SingletonMeta): 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 # is the gui extended
extended: bool = configuration["extends"]["extended"] extended: bool = configuration["extends"]["extended"]
# direction the gui extends # direction the gui extends
@ -33,6 +28,13 @@ class Configurations(metaclass=SingletonMeta):
theme_mode: str = configuration["theme"]["mode"] theme_mode: str = configuration["theme"]["mode"]
# size of mousewheel scroll step # size of mousewheel scroll step
mwscroll_step: int = configuration["mwscroll_step"]["size"] 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 @property
def profile(self): def profile(self):
@ -48,8 +50,6 @@ class BaseValues(metaclass=SingletonMeta):
dragging: bool = False dragging: bool = False
# a vban connection established # a vban connection established
vban_connected: bool = False vban_connected: bool = False
# bus assigned as current submix
submixes: int = 0
# pdirty delay # pdirty delay
pdelay: int = 5 pdelay: int = 5
# ldirty delay # ldirty delay

View File

@ -200,7 +200,7 @@ class SubMixFrame(ttk.Frame):
) )
self.gainlayers = [ 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): for i, labelframe in enumerate(self.labelframes):
labelframe.grid(row=0, column=i) labelframe.grid(row=0, column=i)

View File

@ -115,7 +115,7 @@ class Menus(tk.Menu):
) )
for i in range(8) 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": if self.parent.kind.name != "Potato":
self.menu_layout.entryconfig(0, state="disabled") self.menu_layout.entryconfig(0, state="disabled")
# layout/extends # layout/extends
@ -233,8 +233,8 @@ class Menus(tk.Menu):
self.menu_extends.entryconfig(0, state="normal") self.menu_extends.entryconfig(0, state="normal")
def set_submix(self, i): def set_submix(self, i):
if _base_values.submixes != i: if _configuration.submixes != i:
_base_values.submixes = i _configuration.submixes = i
if self.parent.submix_frame is not None: if self.parent.submix_frame is not None:
self.parent.submix_frame.teardown() self.parent.submix_frame.teardown()
self.parent.nav_frame.show_submix() self.parent.nav_frame.show_submix()