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] [tool.poetry]
name = "voicemeeter-api" name = "voicemeeter-api"
version = "0.1.8" version = "0.1.9"
description = "A Python wrapper for the Voiceemeter API" description = "A Python wrapper for the Voiceemeter API"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

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

View File

@ -12,10 +12,10 @@ class Subject:
return self._observers return self._observers
def notify(self, modifier=None, data=None): def notify(self, modifier=None):
"""run callbacks on update""" """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): def add(self, observer):
"""adds an observer to _observers""" """adds an observer to _observers"""