This commit is contained in:
Joey Yakimowich-Payne 2026-01-31 11:21:28 -07:00
commit 9d57ba5d25
9 changed files with 235 additions and 19 deletions

View file

@ -1,6 +1,6 @@
# Warppipe Configuration Schema
# Warp Pipe Configuration Schema
Warppipe uses JSON for configuration persistence. The config file stores virtual nodes and routing rules using stable identifiers (names, not serial IDs).
Warp Pipe uses JSON for configuration persistence. The config file stores virtual nodes, routing rules, saved links, and per-node volume/mute using stable identifiers (names, not serial IDs).
## Schema Version 1
@ -14,7 +14,9 @@ Warppipe uses JSON for configuration persistence. The config file stores virtual
"rate": 48000,
"channels": 2,
"loopback": false,
"target_node": ""
"target_node": "",
"volume": 1.0,
"mute": false
},
{
"name": "warppipe-mic-source",
@ -50,6 +52,14 @@ Warppipe uses JSON for configuration persistence. The config file stores virtual
},
"target_node": "alsa_output.usb-headset"
}
],
"links": [
{
"out_node": "Firefox",
"out_port": "output_FL",
"in_node": "warppipe-gaming-sink",
"in_port": "input_FL"
}
]
}
```
@ -64,6 +74,8 @@ Warppipe uses JSON for configuration persistence. The config file stores virtual
- `channels` (integer, default 2): Channel count
- `loopback` (boolean, default false): Whether node forwards to a target
- `target_node` (string, optional): Required when loopback is true
- `volume` (number, default 1.0): Stored node volume (0.0 - 1.5)
- `mute` (boolean, default false): Stored node mute state
### route_rules
@ -72,15 +84,27 @@ Rules match ephemeral audio sources to target sinks by stable application metada
- `match.application_name` (string): Match PW_KEY_APP_NAME
- `match.process_binary` (string): Match PW_KEY_APP_PROCESS_BINARY
- `match.media_role` (string): Match PW_KEY_MEDIA_ROLE
- `id` (integer, optional): Auto-saved rule id (ignored on load)
- `target_node` (string, required): Destination node name
All non-empty match fields must match (AND logic). At least one match field must be non-empty.
### links
Saved links are recreated by matching node and port names when both endpoints appear.
- `out_node` (string, required): Output node name
- `out_port` (string, required): Output port name
- `in_node` (string, required): Input node name
- `in_port` (string, required): Input port name
## Persistence Behavior
- **Auto-save**: When `ConnectionOptions::config_path` is set, config is saved after:
- Virtual node created/removed
- Routing rule added/removed
- `SetNodeVolume` updates
- `CreateLink`/`RemoveLink` updates
- **Load on startup**: When `config_path` is set and the file exists, it is loaded during `Client::Create()` after connection is established.