Updated Open Sound Control API (markdown)

BHBN
2024-03-12 19:55:17 +01:00
parent 634869ab45
commit bed85dea3a

@@ -21,19 +21,40 @@ If the address pattern cannot be treated successfully, a warning messaged appear
## Several ways to identify the source target
To target the source currently active, use the target `current` ([see next section](https://github.com/brunoherbelin/vimix/wiki/Open-Sound-Control-API/#the-current-target)).
To target a source by name, use the exact string of characters (case sensitive).
To target a source by `#` + index, use its position (index) in the left source panel (starting at #0).
NB: If the name or the index are not valid, the call is ignored (an error message is logged).
To target a source by `#` + index, use its position (index) in the left source panel (starting at #0).
To target the source currently active, use the target `current` ([see below](https://github.com/brunoherbelin/vimix/wiki/Open-Sound-Control-API/#the-current-target)).
_NB: If the name or the index are not valid, the call is ignored (an error message is logged)._
> Examples;
> `/vimix/SrcName/alpha f 1.0` sets alpha of the source named 'SrcName' to 100% opacity
> `/vimix/#1/alpha f 1.0` sets alpha of the source at index #1 to 100% opacity
> `/vimix/current/alpha f 1.0` sets alpha of the current source to 100% opacity
**Dynamic targeting and naming**
To use a temporary alias to target a source, define the `alias` as follows
> Examples;
> `/vimix/#0/alias s vivi` ; defines the alias `vivi` to target the source `#0`,
> Afterwards, the target `vivi` will be accepted as alias:
> `/vimix/vivi/alpha f 0` will change alpha of source `#0`.
>
> _The alias is valid until vimix is closed, the session loaded notwithstanding_
To rename a source to be able to use a new name as target,
> Examples;
> `/vimix/#0/rename s vivi` ; renames the source `#0` as `vivi`
> Afterwards, the target `vivi` will be accepted as a normal source name.
> `/vimix/vivi/alpha f 0` will change alpha of source `#0` (now named `vivi`)
>
> _The source will be saved with this new name when saving the Session_
## Attributes to control a source
When the target is able to identify a source by its name, by its index, or as the `current` active source, the following attributes are used to modify it.
When the target is able to identify a source by its name, by its index, as an alias, or as the `current` active source, the following attributes are used to modify it.
_NB: only latest version of *vimix* supports all attributes._
**`play` : Set source to Play**