2023-09-23 22:55:58 +01:00
|
|
|
import time
|
|
|
|
|
|
|
|
import globalPluginHandler
|
|
|
|
|
2023-09-27 18:38:13 +01:00
|
|
|
from . import config, util
|
2023-09-23 22:55:58 +01:00
|
|
|
from .commands import CommandsMixin
|
|
|
|
from .controller import Controller
|
|
|
|
from .kinds import KindId, request_kind_map
|
|
|
|
|
|
|
|
|
|
|
|
class GlobalPlugin(globalPluginHandler.GlobalPlugin, CommandsMixin):
|
2023-09-27 18:38:13 +01:00
|
|
|
__kind_id = config.get("voicemeeter", "potato")
|
|
|
|
__gestures = util._make_gestures(__kind_id)
|
2023-09-23 22:55:58 +01:00
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.controller = Controller()
|
|
|
|
if self.controller.login() == 1:
|
|
|
|
self.controller.run_voicemeeter(KindId[self.__kind_id.upper()])
|
|
|
|
time.sleep(1)
|
2023-09-27 18:38:13 +01:00
|
|
|
self.kind = request_kind_map(self.__kind_id)
|
2023-09-23 22:55:58 +01:00
|
|
|
|
|
|
|
def terminate(self, *args, **kwargs):
|
|
|
|
super().terminate(*args, **kwargs)
|
|
|
|
self.controller.logout()
|