mirror of
https://github.com/onyx-and-iris/voicemeeter-compact.git
synced 2026-04-08 17:03:32 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b6e1f61a4 | ||
|
|
3f306ddf62 | ||
|
|
732368a65b | ||
|
|
d7df79b798 | ||
|
|
0906f3343b | ||
|
|
294dfe7d03 | ||
|
|
4db7be172b | ||
|
|
35775f5024 | ||
|
|
d4b2b90fc0 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
# quick test
|
||||
z_*.py
|
||||
quick.py
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
||||
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- [ ] Add support for forest theme (should be coming soon)
|
||||
|
||||
## [1.6.0] - 2022-09-29
|
||||
|
||||
### Added
|
||||
|
||||
- Logging module used in place of print statements across the interface.
|
||||
|
||||
## [1.5.1] - 2022-09-16
|
||||
|
||||
### Added
|
||||
@@ -20,8 +26,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- sv_ttk updated to v2.0.
|
||||
- event toggles used to pause updates when dragging sliders.
|
||||
|
||||
### Removed
|
||||
|
||||
## [1.4.2] - 2022-09-03
|
||||
|
||||
### Added
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
# kind = 'banana'
|
||||
# ip = '<ip address 1>'
|
||||
# streamname = 'Command1'
|
||||
# port = 6990
|
||||
# port = 6980
|
||||
|
||||
# [connection-2]
|
||||
# kind = 'potato'
|
||||
# ip = '<ip address 2>'
|
||||
# streamname = 'Command1'
|
||||
# port = 6990
|
||||
# port = 6980
|
||||
|
||||
10
poetry.lock
generated
10
poetry.lock
generated
@@ -1,10 +1,10 @@
|
||||
[[package]]
|
||||
name = "black"
|
||||
version = "22.8.0"
|
||||
version = "22.10.0"
|
||||
description = "The uncompromising code formatter."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6.2"
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
click = ">=8.0.0"
|
||||
@@ -84,7 +84,7 @@ python-versions = ">=3.7"
|
||||
|
||||
[[package]]
|
||||
name = "vban-cmd"
|
||||
version = "1.4.3"
|
||||
version = "1.8.1"
|
||||
description = "Python interface for the VBAN RT Packet Service (Sendtext)"
|
||||
category = "main"
|
||||
optional = false
|
||||
@@ -95,7 +95,7 @@ tomli = {version = ">=2.0.1,<3.0.0", markers = "python_version < \"3.11\""}
|
||||
|
||||
[[package]]
|
||||
name = "voicemeeter-api"
|
||||
version = "0.7.0"
|
||||
version = "0.8.4"
|
||||
description = "A Python wrapper for the Voiceemeter API"
|
||||
category = "main"
|
||||
optional = false
|
||||
@@ -107,7 +107,7 @@ tomli = {version = ">=2.0.1,<3.0.0", markers = "python_version < \"3.11\""}
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "df755b86361b6c58978bcdc7875d8d8e5f4d554d13b189823347d64994ba1507"
|
||||
content-hash = "ba702e1c74c507e75070c2c58bffe5a7787d1dfa1b4ff7b5cedce7374871f7db"
|
||||
|
||||
[metadata.files]
|
||||
black = []
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "voicemeeter-compact"
|
||||
version = "1.5.2"
|
||||
version = "1.6.5"
|
||||
description = "A Compact Voicemeeter Remote App"
|
||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||
license = "MIT"
|
||||
@@ -16,8 +16,8 @@ include = ["vmcompact/img/cat.ico"]
|
||||
python = "^3.10"
|
||||
sv-ttk = "^2.0"
|
||||
tomli = { version = "^2.0.1", python = "<3.11" }
|
||||
voicemeeter-api = "^0.7.0"
|
||||
vban-cmd = "^1.4.3"
|
||||
voicemeeter-api = "^0.8.4"
|
||||
vban-cmd = "^1.8.1"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
black = {version = "^22.6.0", allow-prereleases = true}
|
||||
|
||||
@@ -34,7 +34,8 @@ class App(tk.Tk):
|
||||
super().__init__()
|
||||
|
||||
self._vmr = vmr
|
||||
self._vmr.event.add("ldirty")
|
||||
self._vmr.event.ldirty = True
|
||||
self._vmr.event.remove(["mdirty", "midi"])
|
||||
icon_path = Path(__file__).parent.resolve() / "img" / "cat.ico"
|
||||
if icon_path.is_file():
|
||||
self.iconbitmap(str(icon_path))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import abc
|
||||
import logging
|
||||
import tkinter as tk
|
||||
from functools import partial
|
||||
from tkinter import ttk
|
||||
@@ -27,6 +28,8 @@ class AbstractBuilder(abc.ABC):
|
||||
class MainFrameBuilder(AbstractBuilder):
|
||||
"""Responsible for building the frames that sit directly on the mainframe"""
|
||||
|
||||
logger = logging.getLogger("builders.mainframebuilder")
|
||||
|
||||
def __init__(self, app):
|
||||
self.kind = app.kind
|
||||
self.app = app
|
||||
@@ -39,24 +42,26 @@ class MainFrameBuilder(AbstractBuilder):
|
||||
if _configuration.themes_enabled:
|
||||
if sv_ttk.get_theme() not in ("light", "dark"):
|
||||
sv_ttk.set_theme(_configuration.theme_mode)
|
||||
print(f"Sunvalley {sv_ttk.get_theme().capitalize()} Theme applied")
|
||||
|
||||
self.app.target.event.remove("mdirty")
|
||||
self.app.target.event.remove("midi")
|
||||
self.logger.info(
|
||||
f"Sunvalley {sv_ttk.get_theme().capitalize()} Theme applied"
|
||||
)
|
||||
|
||||
def create_channelframe(self, type_):
|
||||
if type_ == "strip":
|
||||
self.app.strip_frame = _make_channelframe(self.app, type_)
|
||||
else:
|
||||
self.app.bus_frame = _make_channelframe(self.app, type_)
|
||||
self.logger.info(f"Finished building channelframe type {type_}")
|
||||
|
||||
def create_separator(self):
|
||||
self.app.sep = ttk.Separator(self.app, orient="vertical")
|
||||
self.app.sep.grid(row=0, column=1, sticky=(tk.N, tk.S))
|
||||
self.app.columnconfigure(1, minsize=15)
|
||||
self.logger.info(f"Finished building separator")
|
||||
|
||||
def create_navframe(self):
|
||||
self.app.nav_frame = Navigation(self.app)
|
||||
self.logger.info(f"Finished building navframe")
|
||||
|
||||
def create_configframe(self, type_, index, id):
|
||||
if type_ == "strip":
|
||||
@@ -102,6 +107,7 @@ class MainFrameBuilder(AbstractBuilder):
|
||||
)
|
||||
for _, frame in enumerate(self.app.bus_frame.labelframes)
|
||||
]
|
||||
self.logger.info(f"Finished building configframe for {type_}[{index}]")
|
||||
self.app.after(5, self.reset_config_frames)
|
||||
|
||||
def reset_config_frames(self):
|
||||
@@ -114,6 +120,7 @@ class MainFrameBuilder(AbstractBuilder):
|
||||
def create_banner(self):
|
||||
self.app.banner = Banner(self.app)
|
||||
self.app.banner.grid(row=4, column=0, columnspan=3)
|
||||
self.logger.info(f"Finished building banner")
|
||||
|
||||
def teardown(self):
|
||||
pass
|
||||
@@ -219,7 +226,7 @@ class ChannelLabelFrameBuilder(AbstractBuilder):
|
||||
"""Adds a progress bar widget to a single label frame"""
|
||||
self.labelframe.pb = ttk.Progressbar(
|
||||
self.labelframe,
|
||||
maximum=100,
|
||||
maximum=72,
|
||||
orient="vertical",
|
||||
mode="determinate",
|
||||
variable=self.labelframe.level,
|
||||
|
||||
@@ -186,7 +186,7 @@ class Strip(ChannelLabelFrame):
|
||||
if self.target.levels.is_updated:
|
||||
val = max(self.target.levels.prefader)
|
||||
self.level.set(
|
||||
(0 if self.mute.get() else 100 + val - 18 + self.gain.get())
|
||||
(0 if self.mute.get() else 72 + val - 12 + self.gain.get())
|
||||
)
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ class Bus(ChannelLabelFrame):
|
||||
if self.index < self.parent.parent.kind.num_bus:
|
||||
if self.target.levels.is_updated or self.level.get() != -118:
|
||||
val = max(self.target.levels.all)
|
||||
self.level.set((0 if self.mute.get() else 100 + val - 18))
|
||||
self.level.set((0 if self.mute.get() else 72 + val - 12))
|
||||
|
||||
|
||||
class ChannelFrame(ttk.Frame):
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
@@ -5,6 +6,8 @@ try:
|
||||
except ModuleNotFoundError:
|
||||
import tomli as tomllib
|
||||
|
||||
LOGGER = logging.getLogger("configurations")
|
||||
|
||||
configuration = {}
|
||||
|
||||
config_path = [Path.cwd() / "configs"]
|
||||
@@ -21,7 +24,7 @@ for path in config_path:
|
||||
print(f"Invalid TOML config: configs/{filename.stem}")
|
||||
|
||||
for name, cfg in configs.items():
|
||||
print(f"Loaded configuration configs/{name}")
|
||||
LOGGER.info(f"Loaded configuration configs/{name}")
|
||||
configuration[name] = cfg
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -158,7 +158,7 @@ class GainLayer(ttk.LabelFrame):
|
||||
(
|
||||
0
|
||||
if self.parent.target.strip[self.index].mute or not self.on.get()
|
||||
else 100 + val - 18 + self.gain.get()
|
||||
else 72 + val - 12 + self.gain.get()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import tkinter as tk
|
||||
import webbrowser
|
||||
from functools import partial
|
||||
@@ -5,11 +6,14 @@ from tkinter import messagebox, ttk
|
||||
|
||||
import sv_ttk
|
||||
import vban_cmd
|
||||
from vban_cmd.error import VBANCMDError
|
||||
|
||||
from .data import _base_values, _configuration, get_configuration, kind_get
|
||||
|
||||
|
||||
class Menus(tk.Menu):
|
||||
logger = logging.getLogger("menu.menus")
|
||||
|
||||
def __init__(self, parent, vmr):
|
||||
super().__init__()
|
||||
self.parent = parent
|
||||
@@ -267,6 +271,9 @@ class Menus(tk.Menu):
|
||||
for menu in self.menu_layout.winfo_children()
|
||||
if isinstance(menu, tk.Menu)
|
||||
]
|
||||
self.logger.info(
|
||||
f"Finished loading theme Sunvalley {sv_ttk.get_theme().capitalize()} theme"
|
||||
)
|
||||
|
||||
def menu_teardown(self, i):
|
||||
# remove config load menus
|
||||
@@ -303,15 +310,18 @@ class Menus(tk.Menu):
|
||||
self.vban = vban_cmd.api(kind_id, **opts)
|
||||
# login to vban interface
|
||||
try:
|
||||
self.logger.info(f"Attempting vban connection to {opts.get('ip')}")
|
||||
self.vban.login()
|
||||
except TimeoutError as e:
|
||||
messagebox.showerror(
|
||||
"Connection Error", f"Unable to establish connection with {opts['ip']}"
|
||||
)
|
||||
except VBANCMDError as e:
|
||||
self.vban.logout()
|
||||
msg = (str(e), f"Please check your connection settings")
|
||||
messagebox.showerror("Connection Error", "\n".join(msg))
|
||||
msg = (str(e), f"resuming local connection")
|
||||
self.logger.error(", ".join(msg))
|
||||
self.after(1, self.enable_vban_menus)
|
||||
return
|
||||
self.menu_teardown(i)
|
||||
self.vban.event.add("ldirty")
|
||||
self.vban.event.ldirty = True
|
||||
# destroy the current App frames
|
||||
self.parent._destroy_top_level_frames()
|
||||
_base_values.vban_connected = True
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
|
||||
@@ -7,6 +8,8 @@ from .gainlayer import SubMixFrame
|
||||
|
||||
|
||||
class Navigation(ttk.Frame):
|
||||
logger = logging.getLogger("navigation.navigation")
|
||||
|
||||
def __init__(self, parent):
|
||||
super().__init__(parent)
|
||||
self.parent = parent
|
||||
@@ -26,6 +29,9 @@ class Navigation(ttk.Frame):
|
||||
def show_submix(self):
|
||||
if self.submix.get():
|
||||
self.parent.submix_frame = SubMixFrame(self.parent)
|
||||
self.logger.info(
|
||||
f"Finished building submixframe for submix {_configuration.submixes}"
|
||||
)
|
||||
else:
|
||||
if _configuration.extends_horizontal:
|
||||
self.parent.submix_frame.teardown()
|
||||
@@ -39,6 +45,9 @@ class Navigation(ttk.Frame):
|
||||
self.parent.bus_frame.grid()
|
||||
else:
|
||||
self.parent.rowconfigure(2, weight=0, minsize=0)
|
||||
self.logger.info(
|
||||
f"Finished tearing down submixframe for submix {_configuration.submixes}"
|
||||
)
|
||||
|
||||
if not _configuration.themes_enabled:
|
||||
self.styletable.configure(
|
||||
|
||||
Reference in New Issue
Block a user