mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2026-04-09 08:43:29 +00:00
Compare commits
10 Commits
e21a458c6f
...
add-to-bus
| Author | SHA1 | Date | |
|---|---|---|---|
| 714d2fc972 | |||
| c797912458 | |||
|
|
f702b4feb3 | ||
|
|
f8f10e358f | ||
| f7abc5248b | |||
| fec4315be2 | |||
| a3e3db3c37 | |||
| 3e201443e0 | |||
| 868017c79f | |||
| 795296d71e |
14
.gitignore
vendored
14
.gitignore
vendored
@@ -128,10 +128,12 @@ dmypy.json
|
|||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
# test/config
|
# test reports
|
||||||
quick.py
|
tests/reports/
|
||||||
config.toml
|
!tests/reports/badge-*.svg
|
||||||
vm-api.log
|
|
||||||
logging.json
|
|
||||||
|
|
||||||
.vscode/
|
# test/config
|
||||||
|
test-*.py
|
||||||
|
config.toml
|
||||||
|
|
||||||
|
.vscode/
|
||||||
|
|||||||
7
.pre-commit-config.yaml
Normal file
7
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.3.0
|
||||||
|
hooks:
|
||||||
|
- id: check-yaml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
[](https://github.com/onyx-and-iris/voicemeeter-api-python/blob/dev/LICENSE)
|
[](https://github.com/onyx-and-iris/voicemeeter-api-python/blob/dev/LICENSE)
|
||||||
[](https://python-poetry.org/)
|
[](https://python-poetry.org/)
|
||||||
[](https://github.com/astral-sh/ruff)
|
[](https://github.com/astral-sh/ruff)
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
# Python Wrapper for Voicemeeter API
|
# Python Wrapper for Voicemeeter API
|
||||||
|
|
||||||
@@ -882,4 +882,4 @@ poetry poe test-potato
|
|||||||
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
|
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
|
||||||
|
|
||||||
|
|
||||||
[Voicemeeter Remote Header]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemote.h
|
[Voicemeeter Remote Header]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemote.h
|
||||||
|
|||||||
9
examples/eq_edit/README.md
Normal file
9
examples/eq_edit/README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
## About
|
||||||
|
|
||||||
|
The purpose of this script is to demonstratehow to utilize the channels and cells that are available as part of the EQ. It should take audio playing in the second virtual strip and then apply a LGF on the first physical at 500 Hz.
|
||||||
|
|
||||||
|
## Use
|
||||||
|
|
||||||
|
Configured for banana version.
|
||||||
|
|
||||||
|
Make sure you are playing audio into the second virtual strip and out of the first physical bus, both channels are unmuted and that you aren't monitoring another mixbus. Then run the script.
|
||||||
21
examples/eq_edit/__main__.py
Normal file
21
examples/eq_edit/__main__.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import time
|
||||||
|
|
||||||
|
import voicemeeterlib
|
||||||
|
|
||||||
|
def main():
|
||||||
|
KIND_ID = 'banana'
|
||||||
|
|
||||||
|
with voicemeeterlib.api(KIND_ID) as vm:
|
||||||
|
vm.bus[0].eq.on = True
|
||||||
|
vm.bus[0].eq.channel[0].cell[0].on = True
|
||||||
|
vm.bus[0].eq.channel[0].cell[0].f = 500
|
||||||
|
vm.bus[0].eq.channel[0].cell[0].type = 3 # Should correspond to LPF
|
||||||
|
|
||||||
|
time.sleep(3)
|
||||||
|
vm.bus[0].eq.on = False
|
||||||
|
vm.bus[0].eq.channel[0].cell[0].on = False
|
||||||
|
vm.bus[0].eq.channel[0].cell[0].f = 50
|
||||||
|
vm.bus[0].eq.channel[0].cell[0].type = 0
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
8
examples/events/README.md
Normal file
8
examples/events/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Events
|
||||||
|
|
||||||
|
If you want to receive updates on certain events there are two routes you can take:
|
||||||
|
|
||||||
|
- Register a class that implements an `on_update(self, event) -> None` method on the `{Remote}.subject` class.
|
||||||
|
- Register callback functions/methods on the `{Remote}.subject` class, one for each type of update.
|
||||||
|
|
||||||
|
Included are examples of both approaches.
|
||||||
@@ -41,39 +41,8 @@ test-basic.script = "scripts:test_basic"
|
|||||||
test-banana.script = "scripts:test_banana"
|
test-banana.script = "scripts:test_banana"
|
||||||
test-potato.script = "scripts:test_potato"
|
test-potato.script = "scripts:test_potato"
|
||||||
test-all.script = "scripts:test_all"
|
test-all.script = "scripts:test_all"
|
||||||
|
generate-badges.script = "scripts:generate_badges"
|
||||||
|
|
||||||
[tool.tox]
|
|
||||||
legacy_tox_ini = """
|
|
||||||
[tox]
|
|
||||||
envlist = py310,py311,py312,py313
|
|
||||||
|
|
||||||
[testenv]
|
|
||||||
passenv = *
|
|
||||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
|
||||||
allowlist_externals = poetry
|
|
||||||
commands_pre =
|
|
||||||
poetry install --no-interaction --no-root
|
|
||||||
commands =
|
|
||||||
poetry run pytest tests
|
|
||||||
|
|
||||||
[testenv:dsl]
|
|
||||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
|
||||||
allowlist_externals = poetry
|
|
||||||
deps = pyparsing
|
|
||||||
commands_pre =
|
|
||||||
poetry install --no-interaction --no-root --without dev
|
|
||||||
commands =
|
|
||||||
poetry run python examples/dsl
|
|
||||||
|
|
||||||
[testenv:obs]
|
|
||||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
|
||||||
allowlist_externals = poetry
|
|
||||||
deps = obsws-python
|
|
||||||
commands_pre =
|
|
||||||
poetry install --no-interaction --no-root --without dev
|
|
||||||
commands =
|
|
||||||
poetry run python examples/obs
|
|
||||||
"""
|
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
exclude = [
|
exclude = [
|
||||||
|
|||||||
11
scripts.py
11
scripts.py
@@ -9,7 +9,7 @@ def ex_dsl():
|
|||||||
|
|
||||||
|
|
||||||
def ex_callbacks():
|
def ex_callbacks():
|
||||||
scriptpath = Path.cwd() / 'examples' / 'callbacks' / '.'
|
scriptpath = Path.cwd() / 'examples' / 'events' / 'callbacks' / '.'
|
||||||
subprocess.run([sys.executable, str(scriptpath)])
|
subprocess.run([sys.executable, str(scriptpath)])
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ def ex_obs():
|
|||||||
|
|
||||||
|
|
||||||
def ex_observer():
|
def ex_observer():
|
||||||
scriptpath = Path.cwd() / 'examples' / 'observer' / '.'
|
scriptpath = Path.cwd() / 'examples' / 'events' / 'observer' / '.'
|
||||||
subprocess.run([sys.executable, str(scriptpath)])
|
subprocess.run([sys.executable, str(scriptpath)])
|
||||||
|
|
||||||
|
|
||||||
@@ -53,3 +53,10 @@ def test_all():
|
|||||||
steps = [test_basic, test_banana, test_potato]
|
steps = [test_basic, test_banana, test_potato]
|
||||||
for step in steps:
|
for step in steps:
|
||||||
step()
|
step()
|
||||||
|
|
||||||
|
|
||||||
|
def generate_badges():
|
||||||
|
for kind in ['basic', 'banana', 'potato']:
|
||||||
|
subprocess.run(
|
||||||
|
['tox', 'r', '-e', 'genbadge'], env=os.environ.copy() | {'KIND': kind}
|
||||||
|
)
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
Function RunTests {
|
|
||||||
$coverage = "./tests/pytest_coverage.log"
|
|
||||||
$run_tests = "pytest --run-slow -v --capture=tee-sys --junitxml=./tests/.coverage.xml"
|
|
||||||
$match_pattern = "^=|^\s*$|^Running|^Using|^plugins|^collecting|^tests"
|
|
||||||
|
|
||||||
if ( Test-Path $coverage ) { Clear-Content $coverage }
|
|
||||||
|
|
||||||
ForEach ($line in $(Invoke-Expression $run_tests)) {
|
|
||||||
If ( $line -Match $match_pattern ) {
|
|
||||||
if ( $line -Match "^Running tests for kind \[(\w+)\]" ) { $kind = $Matches[1] }
|
|
||||||
$line | Tee-Object -FilePath $coverage -Append
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Write-Output "$(Get-TimeStamp)" | Out-File $coverage -Append
|
|
||||||
|
|
||||||
Invoke-Expression "genbadge tests -t 90 -i ./tests/.coverage.xml -o ./tests/$kind.svg"
|
|
||||||
}
|
|
||||||
|
|
||||||
Function Get-TimeStamp {
|
|
||||||
|
|
||||||
return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($MyInvocation.InvocationName -ne ".") {
|
|
||||||
Invoke-Expression ".\.venv\Scripts\Activate.ps1"
|
|
||||||
|
|
||||||
@("potato") | ForEach-Object {
|
|
||||||
$env:KIND = $_
|
|
||||||
RunTests
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Invoke-Expression "deactivate"
|
|
||||||
}
|
|
||||||
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="68" height="20" role="img" aria-label="tests: 159"><title>tests: 159</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="68" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="31" height="20" fill="#4c1"/><rect width="68" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">tests</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">tests</text><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">159</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="210">159</text></g></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="68" height="20" role="img" aria-label="tests: 158"><title>tests: 158</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="68" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="31" height="20" fill="#4c1"/><rect width="68" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">tests</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">tests</text><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">158</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="210">158</text></g></svg>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="68" height="20" role="img" aria-label="tests: 116"><title>tests: 116</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="68" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="31" height="20" fill="#4c1"/><rect width="68" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">tests</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">tests</text><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">116</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="210">116</text></g></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="68" height="20" role="img" aria-label="tests: 115"><title>tests: 115</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="68" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="31" height="20" fill="#4c1"/><rect width="68" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">tests</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">tests</text><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">115</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="210">115</text></g></svg>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="68" height="20" role="img" aria-label="tests: 184"><title>tests: 184</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="68" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="31" height="20" fill="#4c1"/><rect width="68" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">tests</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">tests</text><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">184</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="210">184</text></g></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="68" height="20" role="img" aria-label="tests: 183"><title>tests: 183</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="68" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="37" height="20" fill="#555"/><rect x="37" width="31" height="20" fill="#4c1"/><rect width="68" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="270">tests</text><text x="195" y="140" transform="scale(.1)" fill="#fff" textLength="270">tests</text><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">183</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="210">183</text></g></svg>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
42
tox.ini
Normal file
42
tox.ini
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
[tox]
|
||||||
|
envlist = py310,py311,py312,py313
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
passenv = *
|
||||||
|
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||||
|
allowlist_externals = poetry
|
||||||
|
commands_pre =
|
||||||
|
poetry install --no-interaction --no-root
|
||||||
|
commands =
|
||||||
|
poetry run pytest tests
|
||||||
|
|
||||||
|
[testenv:genbadge]
|
||||||
|
passenv = *
|
||||||
|
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||||
|
allowlist_externals = poetry
|
||||||
|
deps =
|
||||||
|
genbadge[all]
|
||||||
|
pytest-html
|
||||||
|
commands_pre =
|
||||||
|
poetry install --no-interaction --no-root
|
||||||
|
commands =
|
||||||
|
poetry run pytest --capture=tee-sys --junitxml=./tests/reports/junit-${KIND}.xml --html=./tests/reports/${KIND}.html tests
|
||||||
|
poetry run genbadge tests -t 90 -i ./tests/reports/junit-${KIND}.xml -o ./tests/reports/badge-${KIND}.svg
|
||||||
|
|
||||||
|
[testenv:dsl]
|
||||||
|
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||||
|
allowlist_externals = poetry
|
||||||
|
deps = pyparsing
|
||||||
|
commands_pre =
|
||||||
|
poetry install --no-interaction --no-root --without dev
|
||||||
|
commands =
|
||||||
|
poetry run python examples/dsl
|
||||||
|
|
||||||
|
[testenv:obs]
|
||||||
|
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||||
|
allowlist_externals = poetry
|
||||||
|
deps = obsws-python
|
||||||
|
commands_pre =
|
||||||
|
poetry install --no-interaction --no-root --without dev
|
||||||
|
commands =
|
||||||
|
poetry run python examples/obs
|
||||||
@@ -88,6 +88,24 @@ class Bus(IRemote):
|
|||||||
|
|
||||||
|
|
||||||
class BusEQ(IRemote):
|
class BusEQ(IRemote):
|
||||||
|
@classmethod
|
||||||
|
def make(cls, remote, i):
|
||||||
|
"""
|
||||||
|
Factory method for BusEQ.
|
||||||
|
|
||||||
|
Returns a BusEQ class.
|
||||||
|
"""
|
||||||
|
kls = (cls,)
|
||||||
|
return type(
|
||||||
|
'BusEQ',
|
||||||
|
kls,
|
||||||
|
{
|
||||||
|
'channel': tuple(
|
||||||
|
BusEQCh.make(remote, i, j) for j in range(remote.kind.channels)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def identifier(self) -> str:
|
def identifier(self) -> str:
|
||||||
return f'Bus[{self.index}].eq'
|
return f'Bus[{self.index}].eq'
|
||||||
@@ -109,6 +127,85 @@ class BusEQ(IRemote):
|
|||||||
self.setter('ab', 1 if val else 0)
|
self.setter('ab', 1 if val else 0)
|
||||||
|
|
||||||
|
|
||||||
|
class BusEQCh(IRemote):
|
||||||
|
@classmethod
|
||||||
|
def make(cls, remote, i, j):
|
||||||
|
"""
|
||||||
|
Factory method for Bus EQ channel.
|
||||||
|
|
||||||
|
Returns a BusEQCh class.
|
||||||
|
"""
|
||||||
|
kls = (cls,)
|
||||||
|
return type(
|
||||||
|
'BusEQCh',
|
||||||
|
kls,
|
||||||
|
{
|
||||||
|
'cell': tuple(
|
||||||
|
BusEQChCell(remote, i, j, k) for k in range(remote.kind.cells)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
def __init__(self, remote, i, j):
|
||||||
|
super().__init__(remote, i)
|
||||||
|
self.channel_index = j
|
||||||
|
|
||||||
|
@property
|
||||||
|
def identifier(self) -> str:
|
||||||
|
return f'Bus[{self.index}].eq.channel[{self.channel_index}]'
|
||||||
|
|
||||||
|
|
||||||
|
class BusEQChCell(IRemote):
|
||||||
|
def __init__(self, remote, i, j, k):
|
||||||
|
super().__init__(remote, i)
|
||||||
|
self.channel_index = j
|
||||||
|
self.cell_index = k
|
||||||
|
|
||||||
|
@property
|
||||||
|
def identifier(self) -> str:
|
||||||
|
return f'Bus[{self.index}].eq.channel[{self.channel_index}].cell[{self.cell_index}]'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def on(self) -> bool:
|
||||||
|
return self.getter('on') == 1
|
||||||
|
|
||||||
|
@on.setter
|
||||||
|
def on(self, val: bool):
|
||||||
|
self.setter('on', 1 if val else 0)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def type(self) -> int:
|
||||||
|
return int(self.getter('type'))
|
||||||
|
|
||||||
|
@type.setter
|
||||||
|
def type(self, val: int):
|
||||||
|
self.setter('type', val)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def f(self) -> float:
|
||||||
|
return round(self.getter('f'), 1)
|
||||||
|
|
||||||
|
@f.setter
|
||||||
|
def f(self, val: float):
|
||||||
|
self.setter('f', val)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gain(self) -> float:
|
||||||
|
return round(self.getter('gain'), 1)
|
||||||
|
|
||||||
|
@gain.setter
|
||||||
|
def gain(self, val: float):
|
||||||
|
self.setter('gain', val)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def q(self) -> float:
|
||||||
|
return round(self.getter('q'), 1)
|
||||||
|
|
||||||
|
@q.setter
|
||||||
|
def q(self, val: float):
|
||||||
|
self.setter('q', val)
|
||||||
|
|
||||||
|
|
||||||
class PhysicalBus(Bus):
|
class PhysicalBus(Bus):
|
||||||
@classmethod
|
@classmethod
|
||||||
def make(cls, remote, i, kind):
|
def make(cls, remote, i, kind):
|
||||||
@@ -321,7 +418,7 @@ def bus_factory(is_phys_bus, remote, i) -> Union[PhysicalBus, VirtualBus]:
|
|||||||
{
|
{
|
||||||
'levels': BusLevel(remote, i),
|
'levels': BusLevel(remote, i),
|
||||||
'mode': BUSMODEMIXIN_cls(remote, i),
|
'mode': BUSMODEMIXIN_cls(remote, i),
|
||||||
'eq': BusEQ(remote, i),
|
'eq': BusEQ.make(remote, i),
|
||||||
},
|
},
|
||||||
)(remote, i)
|
)(remote, i)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class KindMapClass(metaclass=SingletonType):
|
|||||||
asio: tuple
|
asio: tuple
|
||||||
insert: int
|
insert: int
|
||||||
composite: int
|
composite: int
|
||||||
|
channels: int
|
||||||
|
cells: int
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def phys_in(self) -> int:
|
def phys_in(self) -> int:
|
||||||
@@ -76,6 +78,8 @@ class BasicMap(KindMapClass):
|
|||||||
asio: tuple = (0, 0)
|
asio: tuple = (0, 0)
|
||||||
insert: int = 0
|
insert: int = 0
|
||||||
composite: int = 0
|
composite: int = 0
|
||||||
|
channels: int = 0
|
||||||
|
cells: int = 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
@@ -86,6 +90,8 @@ class BananaMap(KindMapClass):
|
|||||||
asio: tuple = (6, 8)
|
asio: tuple = (6, 8)
|
||||||
insert: int = 22
|
insert: int = 22
|
||||||
composite: int = 8
|
composite: int = 8
|
||||||
|
channels: int = 9
|
||||||
|
cells: int = 6
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
@@ -96,6 +102,8 @@ class PotatoMap(KindMapClass):
|
|||||||
asio: tuple = (10, 8)
|
asio: tuple = (10, 8)
|
||||||
insert: int = 34
|
insert: int = 34
|
||||||
composite: int = 8
|
composite: int = 8
|
||||||
|
channels: int = 9
|
||||||
|
cells: int = 6
|
||||||
|
|
||||||
|
|
||||||
def kind_factory(kind_id):
|
def kind_factory(kind_id):
|
||||||
|
|||||||
Reference in New Issue
Block a user