changes to observers thread.

minor version bump
This commit is contained in:
onyx-and-iris 2022-06-20 00:06:03 +01:00
parent 56d26d6bde
commit d951c5efce
3 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "voicemeeter-api"
version = "0.1.8"
version = "0.1.9"
description = "A Python wrapper for the Voiceemeter API"
authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT"

View File

@ -50,15 +50,7 @@ class Remote(CBindings):
if self.ldirty:
self._strip_levels = self.strip_buf
self._bus_levels = self.bus_buf
self.subject.notify(
"ldirty",
(
self._strip_levels,
self._strip_comp,
self._bus_levels,
self._bus_comp,
),
)
self.subject.notify("ldirty")
time.sleep(self.ratelimit)
def login(self) -> NoReturn:
@ -228,6 +220,14 @@ class Remote(CBindings):
self.vm_get_level(ct.c_long(type_), ct.c_long(index), ct.byref(val))
return val.value
@property
def strip_levels(self):
return self._strip_levels
@property
def bus_levels(self):
return self._bus_levels
@script
def sendtext(self, script: str):
"""Sets many parameters from a script"""

View File

@ -12,10 +12,10 @@ class Subject:
return self._observers
def notify(self, modifier=None, data=None):
def notify(self, modifier=None):
"""run callbacks on update"""
[o.on_update(modifier, data) for o in self._observers]
[o.on_update(modifier) for o in self._observers]
def add(self, observer):
"""adds an observer to _observers"""