mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-04-19 05:23:29 +00:00
Compare commits
4 Commits
add-event-
...
eed036ca03
| Author | SHA1 | Date | |
|---|---|---|---|
| eed036ca03 | |||
| 55211b9b19 | |||
| 4af7c0f694 | |||
| f082fa8ac5 |
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "vban-cmd"
|
name = "vban-cmd"
|
||||||
version = "2.4.3"
|
version = "2.4.4"
|
||||||
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"
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ class VbanRtPacketHeader:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class RequestHeader:
|
class RequestHeader:
|
||||||
"""Represents the header of an REQUEST RT PACKET"""
|
"""Represents the header of a REQUEST RT PACKET"""
|
||||||
|
|
||||||
name: str
|
name: str
|
||||||
bps_index: int
|
bps_index: int
|
||||||
|
|||||||
@@ -172,32 +172,24 @@ class VbanMidiOutstream(VbanOutstream):
|
|||||||
def _make_stream_pair(remote, kind):
|
def _make_stream_pair(remote, kind):
|
||||||
num_instream, num_outstream, num_midi, num_text = kind.vban
|
num_instream, num_outstream, num_midi, num_text = kind.vban
|
||||||
|
|
||||||
def _generate_streams(i, dir):
|
def _make_cls(i, dir):
|
||||||
"""generator function for creating instream/outstream tuples"""
|
match dir:
|
||||||
if dir == "in":
|
case "in":
|
||||||
if i < num_instream:
|
if i < num_instream:
|
||||||
yield VbanAudioInstream
|
return VbanAudioInstream(remote, i)
|
||||||
elif i < num_instream + num_midi:
|
elif i < num_instream + num_midi:
|
||||||
yield VbanMidiInstream
|
return VbanMidiInstream(remote, i)
|
||||||
else:
|
|
||||||
yield VbanTextInstream
|
|
||||||
else:
|
else:
|
||||||
|
return VbanTextInstream(remote, i)
|
||||||
|
case "out":
|
||||||
if i < num_outstream:
|
if i < num_outstream:
|
||||||
yield VbanAudioOutstream
|
return VbanAudioOutstream(remote, i)
|
||||||
else:
|
else:
|
||||||
yield VbanMidiOutstream
|
return VbanMidiOutstream(remote, i)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
tuple(
|
tuple(_make_cls(i, "in") for i in range(num_instream + num_midi + num_text)),
|
||||||
cls(remote, i)
|
tuple(_make_cls(i, "out") for i in range(num_outstream + num_midi)),
|
||||||
for i in range(num_instream + num_midi + num_text)
|
|
||||||
for cls in _generate_streams(i, "in")
|
|
||||||
),
|
|
||||||
tuple(
|
|
||||||
cls(remote, i)
|
|
||||||
for i in range(num_outstream + num_midi)
|
|
||||||
for cls in _generate_streams(i, "out")
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class VbanCmd(metaclass=ABCMeta):
|
|||||||
self._pdirty = False
|
self._pdirty = False
|
||||||
self._ldirty = False
|
self._ldirty = False
|
||||||
self._script = str()
|
self._script = str()
|
||||||
|
self.stop_event = None
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
@@ -109,7 +110,7 @@ class VbanCmd(metaclass=ABCMeta):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def stopped(self):
|
def stopped(self):
|
||||||
return self.stop_event.is_set()
|
return self.stop_event is None or self.stop_event.is_set()
|
||||||
|
|
||||||
def _set_rt(self, cmd: str, val: Union[str, float]):
|
def _set_rt(self, cmd: str, val: Union[str, float]):
|
||||||
"""Sends a string request command over a network."""
|
"""Sends a string request command over a network."""
|
||||||
|
|||||||
Reference in New Issue
Block a user