fix bug causing delay in updates

patch bump
This commit is contained in:
onyx-and-iris 2022-07-07 00:48:15 +01:00
parent 86b7fb5d32
commit 444d26a869
3 changed files with 32 additions and 29 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# quick test
quick.py
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "vban-cmd" name = "vban-cmd"
version = "1.1.0" version = "1.1.1"
description = "Python interface for the VBAN RT Packet Service (Sendtext)" description = "Python interface for the VBAN RT Packet Service (Sendtext)"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

@ -90,8 +90,6 @@ class VbanCmd(metaclass=ABCMeta):
if len(data) > HEADER_SIZE: if len(data) > HEADER_SIZE:
# check if packet is of type VBAN # check if packet is of type VBAN
if self.expected_packet.header == data[: HEADER_SIZE - 4]: if self.expected_packet.header == data[: HEADER_SIZE - 4]:
# check if packet is of type vmrt_data
if int.from_bytes(data[4:5]) == int(0x60):
return VBAN_VMRT_Packet_Data( return VBAN_VMRT_Packet_Data(
_voicemeeterType=data[28:29], _voicemeeterType=data[28:29],
_reserved=data[29:30], _reserved=data[29:30],
@ -166,7 +164,7 @@ class VbanCmd(metaclass=ABCMeta):
@property @property
def pdirty(self): def pdirty(self):
"""True iff a parameter has changed""" """True iff a parameter has changed"""
return self._pp.pdirty(self.public_packet) return self._pdirty
@property @property
def ldirty(self): def ldirty(self):
@ -200,9 +198,11 @@ class VbanCmd(metaclass=ABCMeta):
start = time.time() start = time.time()
self._pp = self._get_rt() self._pp = self._get_rt()
self._strip_buf, self._bus_buf = self._get_levels(self._pp) self._strip_buf, self._bus_buf = self._get_levels(self._pp)
self._pdirty = self._pp.pdirty(self.public_packet)
if self.pdirty: if self.public_packet != self._pp:
self._public_packet = self._pp self._public_packet = self._pp
if self.pdirty:
self.subject.notify("pdirty") self.subject.notify("pdirty")
if self.ldirty: if self.ldirty:
self.cache["strip_level"] = tuple(self._strip_buf) self.cache["strip_level"] = tuple(self._strip_buf)