mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2024-11-15 16:40:46 +00:00
rework the login timer loop.
patch bump
This commit is contained in:
parent
b360545aa6
commit
54dfa372b1
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "voicemeeter-api"
|
||||
version = "2.5.0"
|
||||
version = "2.5.1"
|
||||
description = "A Python wrapper for the Voiceemeter API"
|
||||
authors = ["onyx-and-iris <code@onyxandiris.online>"]
|
||||
license = "MIT"
|
||||
|
@ -75,20 +75,23 @@ class Remote(CBindings):
|
||||
"Voicemeeter engine running but GUI not launched. Launching the GUI now."
|
||||
)
|
||||
self.run_voicemeeter(self.kind.name)
|
||||
|
||||
err = None
|
||||
start = time.time()
|
||||
while True:
|
||||
while time.time() < start + self.timeout:
|
||||
try:
|
||||
time.sleep(0.1) # ensure at least 0.1 delay before clearing dirty
|
||||
self.logger.info(
|
||||
f"{type(self).__name__}: Successfully logged into {self} version {self.version}"
|
||||
)
|
||||
elapsed = time.time() - start
|
||||
self.logger.debug(f"login time: {round(elapsed, 2)}")
|
||||
self.logger.debug(f"login time: {round(time.time() - start, 2)}")
|
||||
err = None
|
||||
break
|
||||
except CAPIError:
|
||||
if time.time() > start + self.timeout:
|
||||
raise VMError("Timeout logging into the api")
|
||||
except CAPIError as e:
|
||||
err = e
|
||||
continue
|
||||
if err:
|
||||
raise VMError("Timeout logging into the api")
|
||||
self.clear_dirty()
|
||||
|
||||
def run_voicemeeter(self, kind_id: str) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user