mirror of
https://github.com/onyx-and-iris/vmr-http.git
synced 2026-04-06 18:09:11 +00:00
Compare commits
No commits in common. "main" and "v0.6.0" have entirely different histories.
175
API_EXAMPLES.md
175
API_EXAMPLES.md
@ -1,175 +0,0 @@
|
||||
# API Usage
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- The FastAPI server must be running (default: http://localhost:8000)
|
||||
|
||||
---
|
||||
|
||||
## App Router
|
||||
|
||||
### */health*
|
||||
|
||||
```console
|
||||
curl -X 'GET' \
|
||||
'http://127.0.0.1:8000/health' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Strip Router
|
||||
|
||||
### */strip/{index}*
|
||||
|
||||
> Get single parameter
|
||||
|
||||
```console
|
||||
curl -X 'GET' \
|
||||
'http://127.0.0.1:8000/strip/0/gain' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
> Set single parameter
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/strip/0' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"mute": true,
|
||||
}'
|
||||
```
|
||||
|
||||
> Set multiple parameters
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/strip/0' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"gain": -36.8,
|
||||
"mute": true,
|
||||
"mono": false,
|
||||
"solo": true,
|
||||
"A1": true,
|
||||
"A2": false,
|
||||
"A3": true,
|
||||
"B1": false,
|
||||
"B2": true,
|
||||
}'
|
||||
```
|
||||
|
||||
## Strip Gate Router
|
||||
|
||||
### */strip/{index}/gate*
|
||||
|
||||
> Get single parameter
|
||||
|
||||
```console
|
||||
curl -X 'GET' \
|
||||
'http://127.0.0.1:8000/strip/0/gate/knob' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
> Set multiple parameters
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/strip/0/gate' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"threshold": -28.7,
|
||||
"damping": -60,
|
||||
"attack": 2
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Bus Router
|
||||
|
||||
### */bus/{index}*
|
||||
|
||||
> Get single parameter
|
||||
|
||||
```console
|
||||
curl -X 'GET' \
|
||||
'http://127.0.0.1:8000/bus/0/mono' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
> Set single parameter
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/bus/0' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"gain": -32.8,
|
||||
}'
|
||||
```
|
||||
|
||||
> Set multiple parameters
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/bus/0' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"gain": -18.7,
|
||||
"mute": false,
|
||||
"mono": 1
|
||||
}'
|
||||
```
|
||||
|
||||
## Bus EQ Channel Cell Router
|
||||
|
||||
### */bus/{index}/eq/channel/{channel_index}/cell/{cell_index}*
|
||||
|
||||
> Get single parameter
|
||||
|
||||
```console
|
||||
curl -X 'GET' \
|
||||
'http://127.0.0.1:8000/bus/0/eq/channel/0/cell/0/type' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
> Set single parameter
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/bus/0/eq/channel/0/cell/0' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"q": 9.5
|
||||
}'
|
||||
```
|
||||
|
||||
> Set multiple parameters
|
||||
|
||||
```console
|
||||
curl -X 'PATCH' \
|
||||
'http://127.0.0.1:8000/bus/0/eq/channel/0/cell/0' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"on": true,
|
||||
"type": 4,
|
||||
"f": 538.2,
|
||||
"gain": -0.6,
|
||||
"q": 9.5
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## More
|
||||
|
||||
For a full list of endpoints and schemas, see the [Swagger UI](http://localhost:8000/docs) or [ReDoc](http://localhost:8000/redoc).
|
||||
@ -19,9 +19,7 @@ uvicorn vmr_http:app
|
||||
|
||||
## Documentation
|
||||
|
||||
For a few examples see [API_EXAMPLES](./API_EXAMPLES.md).
|
||||
|
||||
For an exhaustive list of the endpoints FastAPI generates [automatic docs][auto-docs], simply launch the server and then visit:
|
||||
FastAPI generates [automatic docs][auto-docs], simply launch the server and then visit:
|
||||
|
||||
*Swagger UI*
|
||||
- http://localhost:8000/docs
|
||||
@ -33,6 +31,6 @@ For an exhaustive list of the endpoints FastAPI generates [automatic docs][auto-
|
||||
|
||||
## License
|
||||
|
||||
`vmr-http` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
||||
`vban-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
||||
|
||||
[auto-docs]: https://fastapi.tiangolo.com/features/#automatic-docs
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "vmr-http"
|
||||
version = "0.7.2"
|
||||
version = "0.6.0"
|
||||
description = "HTTP API for controlling Voicemeeter"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||
|
||||
@ -8,15 +8,15 @@ from pydantic import BaseModel, Field
|
||||
class EQParams(BaseModel):
|
||||
"""Parameters for an equalizer."""
|
||||
|
||||
on: Optional[bool] = Field(None, description='Whether the equalizer is enabled or not.')
|
||||
ab: Optional[bool] = Field(None, description='Whether the equalizer is in mode A/B.')
|
||||
on: Optional[bool] = Field(description='Whether the equalizer is enabled or not.')
|
||||
ab: Optional[bool] = Field(description='Whether the equalizer is in mode A/B.')
|
||||
|
||||
|
||||
class EQChannelCellParams(BaseModel):
|
||||
"""Parameters for an equalizer channel."""
|
||||
|
||||
on: Optional[bool] = Field(None, description='Whether the equalizer channel is enabled or not.')
|
||||
type: Optional[int] = Field(None, ge=0, le=6, description='Type of the equalizer channel.')
|
||||
f: Optional[float] = Field(None, ge=20.0, le=20000.0, description='Frequency of the equalizer channel.')
|
||||
gain: Optional[float] = Field(None, ge=-36.0, le=18.0, description='Gain of the equalizer channel.')
|
||||
q: Optional[float] = Field(None, ge=0.3, le=100.0, description='Q factor of the equalizer channel.')
|
||||
on: Optional[bool] = Field(description='Whether the equalizer channel is enabled or not.')
|
||||
type: Optional[int] = Field(ge=0, le=6, description='Type of the equalizer channel.')
|
||||
f: Optional[float] = Field(ge=20.0, le=20000.0, description='Frequency of the equalizer channel.')
|
||||
gain: Optional[float] = Field(ge=-36.0, le=18.0, description='Gain of the equalizer channel.')
|
||||
q: Optional[float] = Field(ge=0.3, le=100.0, description='Q factor of the equalizer channel.')
|
||||
|
||||
@ -15,7 +15,7 @@ router.include_router(eq.create_router(eq_kind='bus'), prefix='/eq', tags=['bus
|
||||
|
||||
@router.patch('', tags=['bus'])
|
||||
@router.put('', tags=['bus'])
|
||||
def update_bus_params(index: int, params: BusParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_bus_params(index: int, params: BusParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Update one or more parameters for the specified bus index."""
|
||||
bus = voicemeeter.bus[index]
|
||||
updated = {}
|
||||
@ -26,19 +26,19 @@ def update_bus_params(index: int, params: BusParams, voicemeeter=Depends(get_voi
|
||||
|
||||
|
||||
@router.get('/gain', tags=['bus'])
|
||||
def get_gain(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_gain(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gain value for the specified bus index."""
|
||||
return {'gain': voicemeeter.bus[index].gain}
|
||||
|
||||
|
||||
@router.get('/mute', tags=['bus'])
|
||||
def get_mute(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_mute(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current mute status for the specified bus index."""
|
||||
return {'mute': voicemeeter.bus[index].mute}
|
||||
|
||||
|
||||
@router.get('/mono', tags=['bus'])
|
||||
def get_mono(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_mono(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current mono status for the specified bus index."""
|
||||
opts = ['Off', 'On', 'Stereo Reverse']
|
||||
return {'mono': opts[voicemeeter.bus[index].mono]}
|
||||
|
||||
@ -25,7 +25,7 @@ _reversed_busmodes = {v: k for k, v in _readable_busmodes.items()}
|
||||
|
||||
@router.patch('')
|
||||
@router.put('')
|
||||
def update_bus_mode(index: int, mode: str = Body(..., embed=True), voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_bus_mode(index: int, mode: str = Body(..., embed=True), voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Update the bus mode for the specified bus index."""
|
||||
if mode not in _reversed_busmodes:
|
||||
raise HTTPException(
|
||||
@ -36,6 +36,6 @@ def update_bus_mode(index: int, mode: str = Body(..., embed=True), voicemeeter=D
|
||||
|
||||
|
||||
@router.get('')
|
||||
def get_bus_mode(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_bus_mode(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current bus mode for the specified bus index."""
|
||||
return {'mode': _readable_busmodes.get(voicemeeter.bus[index].mode.get(), 'Unknown')}
|
||||
|
||||
@ -21,7 +21,7 @@ def create_router(eq_kind: str) -> APIRouter:
|
||||
|
||||
@cell_router.patch('')
|
||||
@cell_router.put('')
|
||||
def update_eq_channel_cell_params(
|
||||
async def update_eq_channel_cell_params(
|
||||
index: int,
|
||||
channel_index: int,
|
||||
cell_index: int,
|
||||
@ -37,35 +37,35 @@ def create_router(eq_kind: str) -> APIRouter:
|
||||
return updated
|
||||
|
||||
@cell_router.get('/on')
|
||||
def get_eq_channel_cell_on(
|
||||
async def get_eq_channel_cell_on(
|
||||
index: int, channel_index: int, cell_index: int, voicemeeter=Depends(get_voicemeeter_client)
|
||||
):
|
||||
"""Get the current on status for the specified eq channel cell."""
|
||||
return {'on': target_cls(voicemeeter, index).eq.channel[channel_index].cell[cell_index].on}
|
||||
|
||||
@cell_router.get('/type')
|
||||
def get_eq_channel_cell_type(
|
||||
async def get_eq_channel_cell_type(
|
||||
index: int, channel_index: int, cell_index: int, voicemeeter=Depends(get_voicemeeter_client)
|
||||
):
|
||||
"""Get the current type for the specified eq channel cell."""
|
||||
return {'type': target_cls(voicemeeter, index).eq.channel[channel_index].cell[cell_index].type}
|
||||
|
||||
@cell_router.get('/f')
|
||||
def get_eq_channel_cell_f(
|
||||
async def get_eq_channel_cell_f(
|
||||
index: int, channel_index: int, cell_index: int, voicemeeter=Depends(get_voicemeeter_client)
|
||||
):
|
||||
"""Get the current f value for the specified eq channel cell."""
|
||||
return {'f': target_cls(voicemeeter, index).eq.channel[channel_index].cell[cell_index].f}
|
||||
|
||||
@cell_router.get('/gain')
|
||||
def get_eq_channel_cell_gain(
|
||||
async def get_eq_channel_cell_gain(
|
||||
index: int, channel_index: int, cell_index: int, voicemeeter=Depends(get_voicemeeter_client)
|
||||
):
|
||||
"""Get the current gain value for the specified eq channel cell."""
|
||||
return {'gain': target_cls(voicemeeter, index).eq.channel[channel_index].cell[cell_index].gain}
|
||||
|
||||
@cell_router.get('/q')
|
||||
def get_eq_channel_cell_q(
|
||||
async def get_eq_channel_cell_q(
|
||||
index: int, channel_index: int, cell_index: int, voicemeeter=Depends(get_voicemeeter_client)
|
||||
):
|
||||
"""Get the current q value for the specified eq channel cell."""
|
||||
@ -76,7 +76,7 @@ def create_router(eq_kind: str) -> APIRouter:
|
||||
|
||||
@router.patch('')
|
||||
@router.put('')
|
||||
def update_eq_params(index: int, params: EQParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_eq_params(index: int, params: EQParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Update one or more equalizer parameters for the specified index."""
|
||||
eq = target_cls(voicemeeter, index).eq
|
||||
updated = {}
|
||||
@ -86,12 +86,12 @@ def create_router(eq_kind: str) -> APIRouter:
|
||||
return updated
|
||||
|
||||
@router.get('/on')
|
||||
def get_eq_on(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_eq_on(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current equalizer on status for the specified index."""
|
||||
return {'on': target_cls(voicemeeter, index).eq.on}
|
||||
|
||||
@router.get('/ab')
|
||||
def get_eq_ab(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_eq_ab(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current equalizer A/B status for the specified index."""
|
||||
return {'ab': target_cls(voicemeeter, index).eq.ab}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ router = APIRouter()
|
||||
|
||||
@router.patch('')
|
||||
@router.put('')
|
||||
def update_strip_comp_params(index: int, params: StripCompParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_strip_comp_params(index: int, params: StripCompParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Update one or more compressor parameters for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
updated = {}
|
||||
@ -21,63 +21,7 @@ def update_strip_comp_params(index: int, params: StripCompParams, voicemeeter=De
|
||||
|
||||
|
||||
@router.get('/knob')
|
||||
def get_strip_comp_knob(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_strip_comp_knob(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor knob value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'knob': strip_comp.knob}
|
||||
|
||||
|
||||
@router.get('/gainin')
|
||||
def get_strip_comp_gainin(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor gain in value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'gainin': strip_comp.gainin}
|
||||
|
||||
|
||||
@router.get('/ratio')
|
||||
def get_strip_comp_ratio(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor ratio value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'ratio': strip_comp.ratio}
|
||||
|
||||
|
||||
@router.get('/threshold')
|
||||
def get_strip_comp_threshold(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor threshold value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'threshold': strip_comp.threshold}
|
||||
|
||||
|
||||
@router.get('/attack')
|
||||
def get_strip_comp_attack(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor attack value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'attack': strip_comp.attack}
|
||||
|
||||
|
||||
@router.get('/release')
|
||||
def get_strip_comp_release(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor release value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'release': strip_comp.release}
|
||||
|
||||
|
||||
@router.get('/knee')
|
||||
def get_strip_comp_knee(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor knee value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'knee': strip_comp.knee}
|
||||
|
||||
|
||||
@router.get('/gainout')
|
||||
def get_strip_comp_gainout(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor gain out value for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'gainout': strip_comp.gainout}
|
||||
|
||||
|
||||
@router.get('/makeup')
|
||||
def get_strip_comp_makeup(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current compressor makeup status for the specified strip index."""
|
||||
strip_comp = voicemeeter.strip[index].comp
|
||||
return {'makeup': strip_comp.makeup}
|
||||
|
||||
@ -10,7 +10,9 @@ router = APIRouter()
|
||||
|
||||
@router.patch('')
|
||||
@router.put('')
|
||||
def update_strip_denoiser_params(index: int, params: StripDenoiserParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_strip_denoiser_params(
|
||||
index: int, params: StripDenoiserParams, voicemeeter=Depends(get_voicemeeter_client)
|
||||
):
|
||||
"""Update one or more denoiser parameters for the specified strip index."""
|
||||
strip_denoiser = voicemeeter.strip[index].denoiser
|
||||
updated = {}
|
||||
@ -21,7 +23,7 @@ def update_strip_denoiser_params(index: int, params: StripDenoiserParams, voicem
|
||||
|
||||
|
||||
@router.get('/knob')
|
||||
def get_strip_denoiser_knob(
|
||||
async def get_strip_denoiser_knob(
|
||||
index: int,
|
||||
voicemeeter=Depends(get_voicemeeter_client),
|
||||
):
|
||||
|
||||
@ -9,7 +9,7 @@ router = APIRouter()
|
||||
|
||||
@router.patch('')
|
||||
@router.put('')
|
||||
def update_strip_comp_params(
|
||||
async def update_strip_comp_params(
|
||||
index: int,
|
||||
gainlayer_index: int,
|
||||
level: float = Body(..., ge=-60.0, le=12.0, embed=True),
|
||||
@ -22,6 +22,6 @@ def update_strip_comp_params(
|
||||
|
||||
|
||||
@router.get('/level')
|
||||
def get_strip_gain_layer_level(index: int, gainlayer_index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_strip_gain_layer_level(index: int, gainlayer_index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gain layer level for the specified strip index."""
|
||||
return {'gain_layer': {'level': voicemeeter.strip[index].gainlayer[gainlayer_index].gain}}
|
||||
|
||||
@ -10,7 +10,7 @@ router = APIRouter()
|
||||
|
||||
@router.patch('')
|
||||
@router.put('')
|
||||
def update_strip_gate_params(index: int, params: StripGateParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_strip_gate_params(index: int, params: StripGateParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Update one or more gate parameters for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
updated = {}
|
||||
@ -21,49 +21,7 @@ def update_strip_gate_params(index: int, params: StripGateParams, voicemeeter=De
|
||||
|
||||
|
||||
@router.get('/knob')
|
||||
def get_strip_gate_knob(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_strip_gate_knob(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate knob value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'knob': strip_gate.knob}
|
||||
|
||||
|
||||
@router.get('/threshold')
|
||||
def get_strip_gate_threshold(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate threshold value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'threshold': strip_gate.threshold}
|
||||
|
||||
|
||||
@router.get('/damping')
|
||||
def get_strip_gate_damping(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate damping value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'damping': strip_gate.damping}
|
||||
|
||||
|
||||
@router.get('/bpsidechain')
|
||||
def get_strip_gate_bpsidechain(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate sidechain value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'bpsidechain': strip_gate.bpsidechain}
|
||||
|
||||
|
||||
@router.get('/attack')
|
||||
def get_strip_gate_attack(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate attack value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'attack': strip_gate.attack}
|
||||
|
||||
|
||||
@router.get('/hold')
|
||||
def get_strip_gate_hold(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate hold value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'hold': strip_gate.hold}
|
||||
|
||||
|
||||
@router.get('/release')
|
||||
def get_strip_gate_release(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gate release value for the specified strip index."""
|
||||
strip_gate = voicemeeter.strip[index].gate
|
||||
return {'release': strip_gate.release}
|
||||
|
||||
@ -18,7 +18,7 @@ router.include_router(eq.create_router(eq_kind='strip'), prefix='/eq', tags=['st
|
||||
|
||||
@router.patch('', tags=['strip'])
|
||||
@router.put('', tags=['strip'])
|
||||
def update_strip_params(index: int, params: StripParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def update_strip_params(index: int, params: StripParams, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Update one or more parameters for the specified strip index."""
|
||||
strip = voicemeeter.strip[index]
|
||||
updated = {}
|
||||
@ -29,72 +29,72 @@ def update_strip_params(index: int, params: StripParams, voicemeeter=Depends(get
|
||||
|
||||
|
||||
@router.get('/gain', tags=['strip'])
|
||||
def get_gain(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_gain(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current gain value for the specified strip index."""
|
||||
return {'gain': voicemeeter.strip[index].gain}
|
||||
|
||||
|
||||
@router.get('/mute', tags=['strip'])
|
||||
def get_mute(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_mute(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current mute status for the specified strip index."""
|
||||
return {'mute': voicemeeter.strip[index].mute}
|
||||
|
||||
|
||||
@router.get('/mono', tags=['strip'])
|
||||
def get_mono(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_mono(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current mono status for the specified strip index."""
|
||||
return {'mono': voicemeeter.strip[index].mono}
|
||||
|
||||
|
||||
@router.get('/solo', tags=['strip'])
|
||||
def get_solo(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_solo(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current solo status for the specified strip index."""
|
||||
return {'solo': voicemeeter.strip[index].solo}
|
||||
|
||||
|
||||
@router.get('/A1', tags=['strip'])
|
||||
def get_A1(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_A1(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current A1 output status for the specified strip index."""
|
||||
return {'A1': voicemeeter.strip[index].A1}
|
||||
|
||||
|
||||
@router.get('/A2', tags=['strip'])
|
||||
def get_A2(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_A2(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current A2 output status for the specified strip index."""
|
||||
return {'A2': voicemeeter.strip[index].A2}
|
||||
|
||||
|
||||
@router.get('/A3', tags=['strip'])
|
||||
def get_A3(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_A3(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current A3 output status for the specified strip index."""
|
||||
return {'A3': voicemeeter.strip[index].A3}
|
||||
|
||||
|
||||
@router.get('/A4', tags=['strip'])
|
||||
def get_A4(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_A4(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current A4 output status for the specified strip index."""
|
||||
return {'A4': voicemeeter.strip[index].A4}
|
||||
|
||||
|
||||
@router.get('/A5', tags=['strip'])
|
||||
def get_A5(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_A5(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current A5 output status for the specified strip index."""
|
||||
return {'A5': voicemeeter.strip[index].A5}
|
||||
|
||||
|
||||
@router.get('/B1', tags=['strip'])
|
||||
def get_B1(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_B1(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current B1 output status for the specified strip index."""
|
||||
return {'B1': voicemeeter.strip[index].B1}
|
||||
|
||||
|
||||
@router.get('/B2', tags=['strip'])
|
||||
def get_B2(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_B2(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current B2 output status for the specified strip index."""
|
||||
return {'B2': voicemeeter.strip[index].B2}
|
||||
|
||||
|
||||
@router.get('/B3', tags=['strip'])
|
||||
def get_B3(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
async def get_B3(index: int, voicemeeter=Depends(get_voicemeeter_client)):
|
||||
"""Get the current B3 output status for the specified strip index."""
|
||||
return {'B3': voicemeeter.strip[index].B3}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user