Compare commits

..

6 Commits

6 changed files with 27 additions and 9 deletions

View File

@ -11,6 +11,17 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
- [x] - [x]
## [2.6.0] - 2024-06-29
### Added
- bits kwarg for overriding the type of GUI that is launched on startup.
- Defaults to 64, set it to either 32 or 64.
### Fixed
- {Remote}.run_voicemeeter() now launches x64 bit GUI's for all kinds if Python detects a 64 bit system.
## [2.5.0] - 2023-10-27 ## [2.5.0] - 2023-10-27
### Fixed ### Fixed

View File

@ -814,6 +814,7 @@ You may pass the following optional keyword arguments:
- `midi`: boolean=False, midi updates - `midi`: boolean=False, midi updates
- `ldirty`: boolean=False, level updates - `ldirty`: boolean=False, level updates
- `timeout`: float=2.0, maximum time to wait for a successful login in seconds - `timeout`: float=2.0, maximum time to wait for a successful login in seconds
- `bits`: int=64, (may be one of 32 or 64), overrides the type of Voicemeeter GUI {Remote}.run_voicemeeter() will launch
Access to lower level Getters and Setters are provided with these functions: Access to lower level Getters and Setters are provided with these functions:

View File

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

@ -115,6 +115,7 @@ class FactoryBase(Remote):
"midi": False, "midi": False,
"ldirty": False, "ldirty": False,
"timeout": 2, "timeout": 2,
"bits": 64,
} }
if "subs" in kwargs: if "subs" in kwargs:
defaultkwargs |= kwargs.pop("subs") # for backwards compatibility defaultkwargs |= kwargs.pop("subs") # for backwards compatibility

View File

@ -5,7 +5,7 @@ from pathlib import Path
from .error import InstallError from .error import InstallError
bits = 64 if ct.sizeof(ct.c_voidp) == 8 else 32 BITS = 64 if ct.sizeof(ct.c_void_p) == 8 else 32
if platform.system() != "Windows": if platform.system() != "Windows":
raise InstallError("Only Windows OS supported") raise InstallError("Only Windows OS supported")
@ -17,7 +17,7 @@ REG_KEY = "\\".join(
None, None,
( (
"SOFTWARE", "SOFTWARE",
"WOW6432Node" if bits == 64 else "", "WOW6432Node" if BITS == 64 else "",
"Microsoft", "Microsoft",
"Windows", "Windows",
"CurrentVersion", "CurrentVersion",
@ -39,7 +39,7 @@ try:
except FileNotFoundError as e: except FileNotFoundError as e:
raise InstallError("Unable to fetch DLL path from the registry") from e raise InstallError("Unable to fetch DLL path from the registry") from e
DLL_NAME = f'VoicemeeterRemote{"64" if bits == 64 else ""}.dll' DLL_NAME = f'VoicemeeterRemote{"64" if BITS == 64 else ""}.dll'
dll_path = vm_parent.joinpath(DLL_NAME) dll_path = vm_parent.joinpath(DLL_NAME)
if not dll_path.is_file(): if not dll_path.is_file():

View File

@ -9,7 +9,7 @@ from typing import Iterable, Optional, Union
from .cbindings import CBindings from .cbindings import CBindings
from .error import CAPIError, VMError from .error import CAPIError, VMError
from .event import Event from .event import Event
from .inst import bits from .inst import BITS
from .kinds import KindId from .kinds import KindId
from .misc import Midi, VmGui from .misc import Midi, VmGui
from .subject import Subject from .subject import Subject
@ -39,6 +39,12 @@ class Remote(CBindings):
for attr, val in kwargs.items(): for attr, val in kwargs.items():
setattr(self, attr, val) setattr(self, attr, val)
if self.bits not in (32, 64):
self.logger.warning(
f"kwarg bits got {self.bits}, expected either 32 or 64, defaulting to 64"
)
self.bits = 64
def __enter__(self): def __enter__(self):
"""setup procedures""" """setup procedures"""
self.login() self.login()
@ -80,10 +86,9 @@ class Remote(CBindings):
def run_voicemeeter(self, kind_id: str) -> None: def run_voicemeeter(self, kind_id: str) -> None:
if kind_id not in (kind.name.lower() for kind in KindId): if kind_id not in (kind.name.lower() for kind in KindId):
raise VMError(f"Unexpected Voicemeeter type: '{kind_id}'") raise VMError(f"Unexpected Voicemeeter type: '{kind_id}'")
if kind_id == "potato" and bits == 64:
value = KindId[kind_id.upper()].value + 3
else:
value = KindId[kind_id.upper()].value value = KindId[kind_id.upper()].value
if BITS == 64 and self.bits == 64:
value += 3
self.call(self.bind_run_voicemeeter, value) self.call(self.bind_run_voicemeeter, value)
@property @property