mirror of
https://github.com/onyx-and-iris/voicemeeter-compact.git
synced 2024-11-24 13:50:54 +00:00
now using event toggles when dragging sliders
patch bump
This commit is contained in:
parent
d08299a88d
commit
2c290e2632
16
CHANGELOG.md
16
CHANGELOG.md
@ -9,11 +9,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- [ ] Add support for forest theme (should be coming soon)
|
- [ ] Add support for forest theme (should be coming soon)
|
||||||
|
|
||||||
## [1.4.0] - 2022-09-03
|
## [1.5.1] - 2022-09-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- 1.5.1 binary to releases
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- sv_ttk updated to v2.0.
|
||||||
|
- event toggles used to pause updates when dragging sliders.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
## [1.4.2] - 2022-09-03
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- tomli/tomllib compatibility layer to support python 3.10
|
- tomli/tomllib compatibility layer to support python 3.10
|
||||||
|
- 1.4.2 binary to releases
|
||||||
|
|
||||||
## [1.3.0] - 2022-07-14
|
## [1.3.0] - 2022-07-14
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "voicemeeter-compact"
|
name = "voicemeeter-compact"
|
||||||
version = "1.5.0"
|
version = "1.5.1"
|
||||||
description = "A Compact Voicemeeter Remote App"
|
description = "A Compact Voicemeeter Remote App"
|
||||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -93,8 +93,7 @@ class App(tk.Tk):
|
|||||||
def on_update(self, subject):
|
def on_update(self, subject):
|
||||||
"""called whenever notified of update"""
|
"""called whenever notified of update"""
|
||||||
|
|
||||||
if not _base_values.in_scale_button_1:
|
if subject == "pdirty" and _base_values.run_update:
|
||||||
if subject == "pdirty":
|
|
||||||
self.after(1, self.subject.notify, "pdirty")
|
self.after(1, self.subject.notify, "pdirty")
|
||||||
elif subject == "ldirty" and not _base_values.dragging:
|
elif subject == "ldirty" and not _base_values.dragging:
|
||||||
self.after(1, self.subject.notify, "ldirty")
|
self.after(1, self.subject.notify, "ldirty")
|
||||||
@ -118,16 +117,14 @@ class App(tk.Tk):
|
|||||||
def dragging(self, event, *args):
|
def dragging(self, event, *args):
|
||||||
if event.widget is self:
|
if event.widget is self:
|
||||||
if self.drag_id == "":
|
if self.drag_id == "":
|
||||||
_base_values.in_scale_button_1 = True
|
|
||||||
_base_values.dragging = True
|
_base_values.dragging = True
|
||||||
else:
|
else:
|
||||||
self.after_cancel(self.drag_id)
|
self.after_cancel(self.drag_id)
|
||||||
self.drag_id = self.after(100, self.stop_drag)
|
self.drag_id = self.after(100, self.stop_drag)
|
||||||
|
|
||||||
def stop_drag(self):
|
def stop_drag(self):
|
||||||
_base_values.dragging = False
|
|
||||||
_base_values.in_scale_button_1 = False
|
|
||||||
self.drag_id = ""
|
self.drag_id = ""
|
||||||
|
_base_values.dragging = False
|
||||||
|
|
||||||
|
|
||||||
_apps = {kind.name: App.make(kind) for kind in _kinds_all}
|
_apps = {kind.name: App.make(kind) for kind in _kinds_all}
|
||||||
|
@ -41,6 +41,9 @@ class MainFrameBuilder(AbstractBuilder):
|
|||||||
sv_ttk.set_theme(_configuration.theme_mode)
|
sv_ttk.set_theme(_configuration.theme_mode)
|
||||||
print(f"Sunvalley {sv_ttk.get_theme().capitalize()} Theme applied")
|
print(f"Sunvalley {sv_ttk.get_theme().capitalize()} Theme applied")
|
||||||
|
|
||||||
|
self.app.target.event.remove("mdirty")
|
||||||
|
self.app.target.event.remove("midi")
|
||||||
|
|
||||||
def create_channelframe(self, type_):
|
def create_channelframe(self, type_):
|
||||||
if type_ == "strip":
|
if type_ == "strip":
|
||||||
self.app.strip_frame = _make_channelframe(self.app, type_)
|
self.app.strip_frame = _make_channelframe(self.app, type_)
|
||||||
|
@ -64,15 +64,29 @@ class ChannelLabelFrame(ttk.LabelFrame):
|
|||||||
def reset_gain(self, *args):
|
def reset_gain(self, *args):
|
||||||
self.setter("gain", 0)
|
self.setter("gain", 0)
|
||||||
self.gain.set(0)
|
self.gain.set(0)
|
||||||
|
self.gainlabel.set(self.gain.get())
|
||||||
|
|
||||||
def scale_press(self, *args):
|
def scale_press(self, *args):
|
||||||
_base_values.in_scale_button_1 = True
|
self.after(1, self.remove_events)
|
||||||
|
|
||||||
|
def remove_events(self):
|
||||||
|
self.parent.target.event.remove("pdirty")
|
||||||
|
self.parent.target.event.remove("ldirty")
|
||||||
|
|
||||||
def scale_release(self, *args):
|
def scale_release(self, *args):
|
||||||
_base_values.in_scale_button_1 = False
|
_base_values.run_update = False
|
||||||
|
self.after(1, self.add_events)
|
||||||
|
|
||||||
|
def add_events(self):
|
||||||
|
self.parent.target.event.add("pdirty")
|
||||||
|
self.parent.target.event.add("ldirty")
|
||||||
|
self.after(500, self.resume_updates)
|
||||||
|
|
||||||
|
def resume_updates(self):
|
||||||
|
_base_values.run_update = True
|
||||||
|
|
||||||
def _on_mousewheel(self, event):
|
def _on_mousewheel(self, event):
|
||||||
_base_values.in_scale_button_1 = True
|
_base_values.run_update = False
|
||||||
self.gain.set(
|
self.gain.set(
|
||||||
self.gain.get()
|
self.gain.get()
|
||||||
+ (
|
+ (
|
||||||
@ -86,7 +100,7 @@ class ChannelLabelFrame(ttk.LabelFrame):
|
|||||||
elif self.gain.get() < -60:
|
elif self.gain.get() < -60:
|
||||||
self.gain.set(-60)
|
self.gain.set(-60)
|
||||||
self.setter("gain", self.gain.get())
|
self.setter("gain", self.gain.get())
|
||||||
_base_values.in_scale_button_1 = False
|
self.after(1, self.resume_updates)
|
||||||
|
|
||||||
def open_config(self):
|
def open_config(self):
|
||||||
if self.conf.get():
|
if self.conf.get():
|
||||||
|
@ -37,10 +37,23 @@ class Config(ttk.Frame):
|
|||||||
setattr(self.target, param, value)
|
setattr(self.target, param, value)
|
||||||
|
|
||||||
def scale_press(self, *args):
|
def scale_press(self, *args):
|
||||||
_base_values.in_scale_button_1 = True
|
self.after(1, self.remove_events)
|
||||||
|
|
||||||
|
def remove_events(self):
|
||||||
|
self.parent.target.event.remove("pdirty")
|
||||||
|
self.parent.target.event.remove("ldirty")
|
||||||
|
|
||||||
def scale_release(self, *args):
|
def scale_release(self, *args):
|
||||||
_base_values.in_scale_button_1 = False
|
_base_values.run_update = False
|
||||||
|
self.after(1, self.add_events)
|
||||||
|
|
||||||
|
def add_events(self):
|
||||||
|
self.parent.target.event.add("pdirty")
|
||||||
|
self.parent.target.event.add("ldirty")
|
||||||
|
self.after(350, self.resume_updates)
|
||||||
|
|
||||||
|
def resume_updates(self):
|
||||||
|
_base_values.run_update = True
|
||||||
|
|
||||||
def scale_enter(self, param, *args):
|
def scale_enter(self, param, *args):
|
||||||
val = self.slider_vars[self.slider_params.index(param)].get()
|
val = self.slider_vars[self.slider_params.index(param)].get()
|
||||||
|
@ -45,8 +45,8 @@ class Configurations(metaclass=SingletonMeta):
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class BaseValues(metaclass=SingletonMeta):
|
class BaseValues(metaclass=SingletonMeta):
|
||||||
# are we dragging a scale with mouse 1
|
# pause updates after releasing scale
|
||||||
in_scale_button_1: bool = False
|
run_update: bool = True
|
||||||
# are we dragging main window with mouse 1
|
# are we dragging main window with mouse 1
|
||||||
dragging: bool = False
|
dragging: bool = False
|
||||||
# a vban connection established
|
# a vban connection established
|
||||||
|
@ -52,7 +52,7 @@ class GainLayer(ttk.LabelFrame):
|
|||||||
def reset_gain(self, *args):
|
def reset_gain(self, *args):
|
||||||
self.setter("gain", 0)
|
self.setter("gain", 0)
|
||||||
self.gain.set(0)
|
self.gain.set(0)
|
||||||
self.gainlabel.set(0)
|
self.gainlabel.set(self.gain.get())
|
||||||
|
|
||||||
def scale_callback(self, *args):
|
def scale_callback(self, *args):
|
||||||
"""callback function for scale widget"""
|
"""callback function for scale widget"""
|
||||||
@ -61,12 +61,26 @@ class GainLayer(ttk.LabelFrame):
|
|||||||
self.gainlabel.set(round(self.gain.get(), 1))
|
self.gainlabel.set(round(self.gain.get(), 1))
|
||||||
|
|
||||||
def scale_press(self, *args):
|
def scale_press(self, *args):
|
||||||
_base_values.in_scale_button_1 = True
|
self.after(1, self.remove_events)
|
||||||
|
|
||||||
|
def remove_events(self):
|
||||||
|
self.parent.target.event.remove("pdirty")
|
||||||
|
self.parent.target.event.remove("ldirty")
|
||||||
|
|
||||||
def scale_release(self, *args):
|
def scale_release(self, *args):
|
||||||
_base_values.in_scale_button_1 = False
|
_base_values.run_update = False
|
||||||
|
self.after(1, self.add_events)
|
||||||
|
|
||||||
|
def add_events(self):
|
||||||
|
self.parent.target.event.add("pdirty")
|
||||||
|
self.parent.target.event.add("ldirty")
|
||||||
|
self.after(500, self.resume_updates)
|
||||||
|
|
||||||
|
def resume_updates(self):
|
||||||
|
_base_values.run_update = True
|
||||||
|
|
||||||
def _on_mousewheel(self, event):
|
def _on_mousewheel(self, event):
|
||||||
|
_base_values.run_update = False
|
||||||
self.gain.set(
|
self.gain.set(
|
||||||
self.gain.get()
|
self.gain.get()
|
||||||
+ (
|
+ (
|
||||||
@ -80,6 +94,7 @@ class GainLayer(ttk.LabelFrame):
|
|||||||
elif self.gain.get() < -60:
|
elif self.gain.get() < -60:
|
||||||
self.gain.set(-60)
|
self.gain.set(-60)
|
||||||
self.setter("gain", self.gain.get())
|
self.setter("gain", self.gain.get())
|
||||||
|
self.after(1, self.resume_updates)
|
||||||
|
|
||||||
def set_on(self):
|
def set_on(self):
|
||||||
"""enables a gainlayer. sets its button colour"""
|
"""enables a gainlayer. sets its button colour"""
|
||||||
|
Loading…
Reference in New Issue
Block a user