mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2025-04-03 20:33:44 +01:00
Compare commits
4 Commits
103355d265
...
708a7e6d8e
Author | SHA1 | Date | |
---|---|---|---|
708a7e6d8e | |||
409d2deea9 | |||
0ee3a223ec | |||
6bfd18c1ac |
@ -14,19 +14,20 @@ class App:
|
||||
self.vm.observer.add(self.on_midi)
|
||||
|
||||
def on_midi(self):
|
||||
self.get_info()
|
||||
self.on_midi_press()
|
||||
if self.get_info() == self.MIDI_BUTTON:
|
||||
self.on_midi_press()
|
||||
|
||||
def get_info(self):
|
||||
current = self.vm.midi.current
|
||||
print(f"Value of midi button {current} is {self.vm.midi.get(current)}")
|
||||
return current
|
||||
|
||||
def on_midi_press(self):
|
||||
"""if strip 3 level max > -40 and midi button 48 is pressed, then set trigger for macrobutton 0"""
|
||||
"""if midi button 48 is pressed and strip 3 level max > -40, then set trigger for macrobutton 0"""
|
||||
|
||||
if (
|
||||
max(self.vm.strip[3].levels.postfader) > -40
|
||||
and self.vm.midi.get(self.MIDI_BUTTON) == 127
|
||||
self.vm.midi.get(self.MIDI_BUTTON) == 127
|
||||
and max(self.vm.strip[3].levels.postfader) > -40
|
||||
):
|
||||
print(
|
||||
f"Strip 3 level max is greater than -40 and midi button {self.MIDI_BUTTON} is pressed"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "voicemeeter-api"
|
||||
version = "2.4.3"
|
||||
version = "2.4.4"
|
||||
description = "A Python wrapper for the Voiceemeter API"
|
||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||
license = "MIT"
|
||||
|
@ -33,8 +33,7 @@ class Remote(CBindings):
|
||||
{k: kwargs.pop(k) for k in ("pdirty", "mdirty", "midi", "ldirty")}
|
||||
)
|
||||
self.gui = VmGui()
|
||||
self.stop_event = threading.Event()
|
||||
self.stop_event.clear()
|
||||
self.stop_event = None
|
||||
self.logger = logger.getChild(self.__class__.__name__)
|
||||
|
||||
for attr, val in kwargs.items():
|
||||
@ -57,6 +56,8 @@ class Remote(CBindings):
|
||||
self.event.info()
|
||||
|
||||
self.logger.debug("initiating events thread")
|
||||
self.stop_event = threading.Event()
|
||||
self.stop_event.clear()
|
||||
queue = Queue()
|
||||
self.updater = Updater(self, queue)
|
||||
self.updater.start()
|
||||
@ -64,7 +65,7 @@ class Remote(CBindings):
|
||||
self.producer.start()
|
||||
|
||||
def stopped(self):
|
||||
return self.stop_event.is_set()
|
||||
return self.stop_event is None or self.stop_event.is_set()
|
||||
|
||||
def login(self) -> None:
|
||||
"""Login to the API, initialize dirty parameters"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user