mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2026-04-06 23:43:30 +00:00
Compare commits
2 Commits
v2.7.2
...
add-button
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d5c611ed8 | |||
| 46e7ffe478 |
@@ -380,12 +380,13 @@ The following properties are available.
|
||||
- `state`: boolean
|
||||
- `stateonly`: boolean
|
||||
- `trigger`: boolean
|
||||
- `color`: int, from 0 to 8
|
||||
|
||||
example:
|
||||
|
||||
```python
|
||||
vm.button[37].state = True
|
||||
vm.button[55].trigger = False
|
||||
vm.button[4].color = 1
|
||||
```
|
||||
|
||||
### Recorder
|
||||
|
||||
@@ -23,6 +23,7 @@ class Adapter(IRemote):
|
||||
def output(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
def identifier(self):
|
||||
pass
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ class IRemote(metaclass=ABCMeta):
|
||||
cmd += (f".{param}",)
|
||||
return "".join(cmd)
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def identifier(self):
|
||||
pass
|
||||
|
||||
@@ -12,9 +12,6 @@ ButtonModes = IntEnum(
|
||||
class Adapter(IRemote):
|
||||
"""Adapter to the common interface."""
|
||||
|
||||
def identifier(self):
|
||||
pass
|
||||
|
||||
def getter(self, mode):
|
||||
self.logger.debug(f"getter: button[{self.index}].{ButtonModes(mode).name}")
|
||||
return self._remote.get_buttonstatus(self.index, mode)
|
||||
@@ -26,7 +23,21 @@ class Adapter(IRemote):
|
||||
self._remote.set_buttonstatus(self.index, val, mode)
|
||||
|
||||
|
||||
class MacroButton(Adapter):
|
||||
class MacroButtonColorMixin(IRemote):
|
||||
@property
|
||||
def identifier(self):
|
||||
return f"command.button[{self.index}]"
|
||||
|
||||
@property
|
||||
def color(self) -> int:
|
||||
return int(IRemote.getter(self, "color"))
|
||||
|
||||
@color.setter
|
||||
def color(self, val: int):
|
||||
IRemote.setter(self, "color", val)
|
||||
|
||||
|
||||
class MacroButton(Adapter, MacroButtonColorMixin):
|
||||
"""Defines concrete implementation for macrobutton"""
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user