diff --git a/CHANGELOG.md b/CHANGELOG.md index fd21c75..619c1ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,16 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass - [x] +## [2.1.0] - 2023-07-05 + +### Added + +- `sendtext_only` kwarg let's you disable incoming rt packets. Essentially the interface will work only in one direction (out). + +This is useful if you are only interested in sending script commands out to voicemeeter but don't need to receive parameter states. + +By default sendtext_only is False. + ## [2.0.0] - 2023-06-25 This update introduces some breaking changes: diff --git a/README.md b/README.md index 56f6bf9..532b9aa 100644 --- a/README.md +++ b/README.md @@ -458,8 +458,10 @@ You may pass the following optional keyword arguments: - `ip`: str, ip or hostname of remote machine - `streamname`: str, name of the stream to connect to. - `port`: int=6980, vban udp port of remote machine. -- `pdirty`: parameter updates -- `ldirty`: level updates +- `pdirty`: boolean=False, parameter updates +- `ldirty`: boolean=False, level updates +- `timeout`: int=5, amount of time (seconds) you will wait for subscription response +- `sendtext_only`: boolean=False, set `True` if you are only interested in sending script commands (no rt packets will be received) #### `vban.pdirty` @@ -477,9 +479,13 @@ Sends a script block as a string request, for example: vban.sendtext("Strip[0].Mute=1;Bus[0].Mono=1") ``` +note. if you are ONLY interested in sending script commands you may set sendtext_only kwarg to True + #### `vban.public_packet` -Returns a `VbanRtPacket`. Designed to be used internally by the interface but available for parsing through this read only property object. States not guaranteed to be current (requires use of dirty parameters to confirm). +Returns a `VbanRtPacket`. Designed to be used internally by the interface but available for parsing through this read only property object. + +States not guaranteed to be current (requires use of dirty parameters to confirm). ### `Errors` diff --git a/pyproject.toml b/pyproject.toml index bb09474..1278719 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vban-cmd" -version = "2.0.0" +version = "2.1.0" description = "Python interface for the VBAN RT Packet Service (Sendtext)" authors = ["onyx-and-iris "] license = "MIT" diff --git a/vban_cmd/factory.py b/vban_cmd/factory.py index 9f7a6d5..832aac7 100644 --- a/vban_cmd/factory.py +++ b/vban_cmd/factory.py @@ -71,6 +71,7 @@ class FactoryBase(VbanCmd): "channel": 0, "ratelimit": 0.01, "timeout": 5, + "sendtext_only": False, "sync": False, "pdirty": False, "ldirty": False, diff --git a/vban_cmd/vbancmd.py b/vban_cmd/vbancmd.py index 9cfed9d..6945a8a 100644 --- a/vban_cmd/vbancmd.py +++ b/vban_cmd/vbancmd.py @@ -85,18 +85,19 @@ class VbanCmd(metaclass=ABCMeta): return self def login(self): - """Starts the subscriber and updater threads""" - self.running = True - self.event.info() + """Starts the subscriber and updater threads (unless sendtext_only mode)""" + if not self.sendtext_only: + self.running = True + self.event.info() - self.subscriber = Subscriber(self) - self.subscriber.start() + self.subscriber = Subscriber(self) + self.subscriber.start() - queue = Queue() - self.updater = Updater(self, queue) - self.updater.start() - self.producer = Producer(self, queue) - self.producer.start() + queue = Queue() + self.updater = Updater(self, queue) + self.updater.start() + self.producer = Producer(self, queue) + self.producer.start() self.logger.info(f"{type(self).__name__}: Successfully logged into {self}")