Compare commits

..

No commits in common. "c1e23ab250a75ea5ae5fba8411756b131d2907fe" and "3036cdff2f7574ac98809f2c7be2831a64096f37" have entirely different histories.

5 changed files with 17 additions and 20 deletions

View File

@ -11,7 +11,7 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
- [x] - [x]
## [2.1.1] - 2023-07-01 ## [2.1.0] - 2023-07-01
### Added ### Added
@ -24,10 +24,6 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
- Recorder.loop removed from documentation - Recorder.loop removed from documentation
### Changed
- When out of bounds values are passed, log warnings instead of raising Errors. See [Issue #6][Issue 6].
## [2.0.0] - 2023-06-25 ## [2.0.0] - 2023-06-25
Where possible I've attempted to make the changes backwards compatible. The breaking changes affect two higher classes, Strip and Bus, as well as the behaviour of events. All other changes are additive or QOL aimed at giving more options to the developer. For example, every low-level CAPI call is now logged and error raised on Exception, you can now register callback functions as well as observer classes, extra examples to demonstrate different use cases etc. Where possible I've attempted to make the changes backwards compatible. The breaking changes affect two higher classes, Strip and Bus, as well as the behaviour of events. All other changes are additive or QOL aimed at giving more options to the developer. For example, every low-level CAPI call is now logged and error raised on Exception, you can now register callback functions as well as observer classes, extra examples to demonstrate different use cases etc.
@ -380,4 +376,3 @@ I will move this commit to a separate branch in preparation for version 2.0.
- project packaged with poetry and added to pypi. - project packaged with poetry and added to pypi.
[issue 4]: https://github.com/onyx-and-iris/voicemeeter-api-python/issues/4 [issue 4]: https://github.com/onyx-and-iris/voicemeeter-api-python/issues/4
[Issue 6]: https://github.com/onyx-and-iris/voicemeeter-api-python/issues/6

View File

@ -405,7 +405,7 @@ The following methods are available
The following properties are available The following properties are available
- `A1 - A5`: boolean - `A1 - A5`: boolean
- `B1 - B3`: boolean - `B1 - A3`: boolean
- `samplerate`: int, (22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000) - `samplerate`: int, (22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000)
- `bitresolution`: int, (8, 16, 24, 32) - `bitresolution`: int, (8, 16, 24, 32)
- `channel`: int, from 1 to 8 - `channel`: int, from 1 to 8
@ -629,9 +629,7 @@ vm.option.sr = 48000
The following methods are available: The following methods are available:
- `buffer(driver, buf)` : Set buffer size for particular audio driver. - `buffer(driver, buffer)` : Set buffer size for particular audio driver.
- buf: int, from 128 to 2048
- driver:str, ("mme", "wdm", "ks", "asio")
example: example:
@ -639,6 +637,10 @@ example:
vm.option.buffer("wdm", 512) vm.option.buffer("wdm", 512)
``` ```
driver defined as one of ("mme", "wdm", "ks", "asio")
buffer, from 128 to 2048
##### delay[i] ##### delay[i]
- `get()`: int - `get()`: int

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "voicemeeter-api" name = "voicemeeter-api"
version = "2.1.1" version = "2.0.2"
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

@ -1,5 +1,6 @@
from typing import Optional from typing import Optional
from .error import VMError
from .iremote import IRemote from .iremote import IRemote
from .kinds import kinds_all from .kinds import kinds_all
@ -195,7 +196,7 @@ class Option(IRemote):
def sr(self, val: int): def sr(self, val: int):
opts = (44100, 48000, 88200, 96000, 176400, 192000) opts = (44100, 48000, 88200, 96000, 176400, 192000)
if val not in opts: if val not in opts:
self.logger.warning(f"sr got: {val} but expected a value in {opts}") raise VMError(f"Expected one of: {opts}")
self.setter("sr", val) self.setter("sr", val)
@property @property

View File

@ -1,5 +1,6 @@
from abc import abstractmethod from abc import abstractmethod
from .error import VMError
from .iremote import IRemote from .iremote import IRemote
@ -49,9 +50,7 @@ class VbanStream(IRemote):
@port.setter @port.setter
def port(self, val: int): def port(self, val: int):
if not 1024 <= val <= 65535: if not 1024 <= val <= 65535:
self.logger.warning( raise VMError("Expected value from 1024 to 65535")
f"port got: {val} but expected a value from 1024 to 65535"
)
self.setter("port", val) self.setter("port", val)
@property @property
@ -62,7 +61,7 @@ class VbanStream(IRemote):
def sr(self, val: int): def sr(self, val: int):
opts = (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000) opts = (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
if val not in opts: if val not in opts:
self.logger.warning(f"sr got: {val} but expected a value in {opts}") raise VMError(f"Expected one of: {opts}")
self.setter("sr", val) self.setter("sr", val)
@property @property
@ -72,7 +71,7 @@ class VbanStream(IRemote):
@channel.setter @channel.setter
def channel(self, val: int): def channel(self, val: int):
if not 1 <= val <= 8: if not 1 <= val <= 8:
self.logger.warning(f"channel got: {val} but expected a value from 1 to 8") raise VMError("Expected value from 1 to 8")
self.setter("channel", val) self.setter("channel", val)
@property @property
@ -82,7 +81,7 @@ class VbanStream(IRemote):
@bit.setter @bit.setter
def bit(self, val: int): def bit(self, val: int):
if val not in (16, 24): if val not in (16, 24):
self.logger.warning(f"bit got: {val} but expected value 16 or 24") raise VMError("Expected value 16 or 24")
self.setter("bit", 1 if (val == 16) else 2) self.setter("bit", 1 if (val == 16) else 2)
@property @property
@ -92,7 +91,7 @@ class VbanStream(IRemote):
@quality.setter @quality.setter
def quality(self, val: int): def quality(self, val: int):
if not 0 <= val <= 4: if not 0 <= val <= 4:
self.logger.warning(f"quality got: {val} but expected a value from 0 to 4") raise VMError("Expected value from 0 to 4")
self.setter("quality", val) self.setter("quality", val)
@property @property
@ -102,7 +101,7 @@ class VbanStream(IRemote):
@route.setter @route.setter
def route(self, val: int): def route(self, val: int):
if not 0 <= val <= 8: if not 0 <= val <= 8:
self.logger.warning(f"route got: {val} but expected a value from 0 to 8") raise VMError("Expected value from 0 to 8")
self.setter("route", val) self.setter("route", val)