mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2024-11-22 18:00:50 +00:00
hardware outs cache implemented
This commit is contained in:
parent
749406afec
commit
5995ecbb4a
@ -1,5 +1,5 @@
|
|||||||
def _make_hardware_outs_cache(vm) -> dict:
|
def _make_hardware_outs_cache(vm) -> dict:
|
||||||
pass
|
return {**{f"HARDWARE OUT||A{i + 1}": vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
||||||
|
|
||||||
|
|
||||||
def _make_output_cache(vm) -> dict:
|
def _make_output_cache(vm) -> dict:
|
||||||
|
@ -39,6 +39,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.kind = self.vm.kind
|
self.kind = self.vm.kind
|
||||||
self.logger = logger.getChild(type(self).__name__)
|
self.logger = logger.getChild(type(self).__name__)
|
||||||
self.cache = {
|
self.cache = {
|
||||||
|
"hw_outs": _make_hardware_outs_cache(self.vm),
|
||||||
"outputs": _make_output_cache(self.vm),
|
"outputs": _make_output_cache(self.vm),
|
||||||
"busmode": _make_bus_mode_cache(self.vm),
|
"busmode": _make_bus_mode_cache(self.vm),
|
||||||
"labels": _make_label_cache(self.vm),
|
"labels": _make_label_cache(self.vm),
|
||||||
@ -91,6 +92,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
|
|
||||||
def on_pdirty(self):
|
def on_pdirty(self):
|
||||||
self.cache = {
|
self.cache = {
|
||||||
|
"hw_outs": _make_hardware_outs_cache(self.vm),
|
||||||
"outputs": _make_output_cache(self.vm),
|
"outputs": _make_output_cache(self.vm),
|
||||||
"busmode": _make_bus_mode_cache(self.vm),
|
"busmode": _make_bus_mode_cache(self.vm),
|
||||||
"labels": _make_label_cache(self.vm),
|
"labels": _make_label_cache(self.vm),
|
||||||
@ -382,7 +384,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
f"HARDWARE OUT {key} set {phonetic.get(driver, driver)} {device_name}",
|
f"HARDWARE OUT {key} set {phonetic.get(driver, driver)} {device_name}",
|
||||||
)
|
)
|
||||||
case [["HARDWARE", "OUT"], [key], ["FOCUS", "IN"]]:
|
case [["HARDWARE", "OUT"], [key], ["FOCUS", "IN"]]:
|
||||||
self.nvda.speak(f"HARDWARE OUT {key} {self.vm.bus[int(key[-1]) - 1].device.name}")
|
self.nvda.speak(f"HARDWARE OUT {key} {self.cache['hw_outs'][f'HARDWARE OUT||{key}']}")
|
||||||
case [["HARDWARE", "OUT"], [key], ["KEY", "SPACE" | "ENTER"]]:
|
case [["HARDWARE", "OUT"], [key], ["KEY", "SPACE" | "ENTER"]]:
|
||||||
open_context_menu_for_buttonmenu(self, f"HARDWARE OUT||{key}")
|
open_context_menu_for_buttonmenu(self, f"HARDWARE OUT||{key}")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user