diff --git a/pyproject.toml b/pyproject.toml index 7859055..267eae6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "voicemeeter-compact" -version = "1.9.2" +version = "1.9.3" description = "A Compact Voicemeeter Remote App" authors = ["onyx-and-iris "] license = "MIT" diff --git a/vmcompact/app.py b/vmcompact/app.py index 0f6228b..1cc3644 100644 --- a/vmcompact/app.py +++ b/vmcompact/app.py @@ -42,13 +42,13 @@ class App(tk.Tk): self.logger = logger.getChild(self.__class__.__name__) self._vmr = vmr self._vmr.event.add(["pdirty", "ldirty"]) - self.after(12000 if self._vmr.gui.launched_by_api else 1, self.start_updates) + self.subject = Subject() + self.start_updates() self._vmr.init_thread() icon_path = Path(__file__).parent.resolve() / "img" / "cat.ico" if icon_path.is_file(): self.iconbitmap(str(icon_path)) self.minsize(275, False) - self.subject = Subject() self._configs = None self.protocol("WM_DELETE_WINDOW", self.on_close_window) self.menu = self["menu"] = Menus(self, vmr) @@ -148,10 +148,15 @@ class App(tk.Tk): return self._configs def start_updates(self): - self.logger.debug("updates started") - _base_values.run_update = True + def init(): + self.logger.debug("updates started") + _base_values.run_update = True + if self._vmr.gui.launched_by_api: - self.on_pdirty() + self.subject.notify("pdirty") + self.after(12000, init) + else: + init() def healthcheck_step(self): if not _base_values.vban_connected: diff --git a/vmcompact/menu.py b/vmcompact/menu.py index 36d6564..b91e13e 100644 --- a/vmcompact/menu.py +++ b/vmcompact/menu.py @@ -4,10 +4,11 @@ import webbrowser from functools import partial from tkinter import messagebox -import sv_ttk import vban_cmd from vban_cmd.error import VBANCMDConnectionError +import sv_ttk + from .data import _base_values, _configuration, get_configuration, kind_get logger = logging.getLogger(__name__) @@ -238,10 +239,14 @@ class Menus(tk.Menu): def load_custom_profile(self, profile): self.logger.info(f"loading user profile {profile}") self.target.apply(profile) + if not _base_values.run_update: + self.parent.subject.notify("pdirty") def load_profile(self, profile): self.logger.info(f"loading user profile {profile}") self.target.apply_config(profile) + if not _base_values.run_update: + self.parent.subject.notify("pdirty") def load_defaults(self): msg = (