|
@@ -16,7 +16,12 @@ def boundary_connection(
|
|
|
capture_symbol = source_path.rsplit("/", 1)[-1]
|
|
capture_symbol = source_path.rsplit("/", 1)[-1]
|
|
|
capture_port = capture_ports.get(capture_symbol)
|
|
capture_port = capture_ports.get(capture_symbol)
|
|
|
if capture_port:
|
|
if capture_port:
|
|
|
- host_port = resolve_host_port(port_to)
|
|
|
|
|
|
|
+ host_port = resolve_pedalboard_port(
|
|
|
|
|
+ port_to, lambda candidate: (
|
|
|
|
|
+ resolve_host_port(candidate)
|
|
|
|
|
+ or resolve_host_port("/graph/" + candidate.removeprefix("/graph/"))
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
if host_port:
|
|
if host_port:
|
|
|
return capture_port, host_port
|
|
return capture_port, host_port
|
|
|
return None
|
|
return None
|
|
@@ -25,7 +30,12 @@ def boundary_connection(
|
|
|
playback_symbol = destination_path.rsplit("/", 1)[-1]
|
|
playback_symbol = destination_path.rsplit("/", 1)[-1]
|
|
|
playback_port = playback_ports.get(playback_symbol)
|
|
playback_port = playback_ports.get(playback_symbol)
|
|
|
if playback_port:
|
|
if playback_port:
|
|
|
- host_port = resolve_host_port(port_from)
|
|
|
|
|
|
|
+ host_port = resolve_pedalboard_port(
|
|
|
|
|
+ port_from, lambda candidate: (
|
|
|
|
|
+ resolve_host_port(candidate)
|
|
|
|
|
+ or resolve_host_port("/graph/" + candidate.removeprefix("/graph/"))
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
if host_port:
|
|
if host_port:
|
|
|
return host_port, playback_port
|
|
return host_port, playback_port
|
|
|
return None
|
|
return None
|
|
@@ -60,6 +70,8 @@ def resolve_pedalboard_port(port, resolve_host_port):
|
|
|
"rigforge_voice_reverb": {
|
|
"rigforge_voice_reverb": {
|
|
|
"input_l": "lv2_audio_in_1",
|
|
"input_l": "lv2_audio_in_1",
|
|
|
"output_l": "lv2_audio_out_1",
|
|
"output_l": "lv2_audio_out_1",
|
|
|
|
|
+ "input_r": "lv2_audio_in_2",
|
|
|
|
|
+ "output_r": "lv2_audio_out_2",
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
resolved_symbol = effect_ports.get(instance, {}).get(symbol)
|
|
resolved_symbol = effect_ports.get(instance, {}).get(symbol)
|
|
@@ -71,7 +83,10 @@ def is_rigforge_managed_boundary_port(port):
|
|
|
graph_path = port.removeprefix("/graph/")
|
|
graph_path = port.removeprefix("/graph/")
|
|
|
if "/" in graph_path:
|
|
if "/" in graph_path:
|
|
|
return False
|
|
return False
|
|
|
- return graph_path.startswith("capture_") or graph_path.startswith("playback_")
|
|
|
|
|
|
|
+ return graph_path in {
|
|
|
|
|
+ *(f"capture_{index}" for index in range(1, 5)),
|
|
|
|
|
+ *(f"playback_{index}" for index in range(1, 5)),
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
def pedalboard_connection(
|
|
def pedalboard_connection(
|
|
@@ -101,12 +116,39 @@ def pedalboard_connection(
|
|
|
or is_rigforge_managed_boundary_port(port_to)
|
|
or is_rigforge_managed_boundary_port(port_to)
|
|
|
)
|
|
)
|
|
|
pipewire_link = boundary_connection(
|
|
pipewire_link = boundary_connection(
|
|
|
- port_from,
|
|
|
|
|
- port_to,
|
|
|
|
|
- captures,
|
|
|
|
|
- playbacks,
|
|
|
|
|
- lambda port: resolve_pedalboard_port(port, resolve_host_port),
|
|
|
|
|
|
|
+ port_from, port_to, captures, playbacks, resolve_host_port
|
|
|
)
|
|
)
|
|
|
|
|
+ if pipewire_link is None and boundary_endpoint:
|
|
|
|
|
+ pipewire_link = boundary_connection(
|
|
|
|
|
+ port_from,
|
|
|
|
|
+ port_to,
|
|
|
|
|
+ captures,
|
|
|
|
|
+ playbacks,
|
|
|
|
|
+ lambda port: (
|
|
|
|
|
+ resolve_pedalboard_port(port, resolve_host_port)
|
|
|
|
|
+ or resolve_host_port("/graph/" + port.removeprefix("/graph/"))
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ if (
|
|
|
|
|
+ pipewire_link is None
|
|
|
|
|
+ and source_path in captures
|
|
|
|
|
+ and is_rigforge_managed_boundary_port(port_from)
|
|
|
|
|
+ and destination_path.startswith("rigforge_")
|
|
|
|
|
+ ):
|
|
|
|
|
+ pipewire_link = (
|
|
|
|
|
+ captures[source_path],
|
|
|
|
|
+ resolve_pedalboard_port(port_to, resolve_host_port),
|
|
|
|
|
+ )
|
|
|
|
|
+ if (
|
|
|
|
|
+ pipewire_link is None
|
|
|
|
|
+ and destination_path in playbacks
|
|
|
|
|
+ and is_rigforge_managed_boundary_port(port_to)
|
|
|
|
|
+ and source_path.startswith("rigforge_")
|
|
|
|
|
+ ):
|
|
|
|
|
+ pipewire_link = (
|
|
|
|
|
+ resolve_pedalboard_port(port_from, resolve_host_port),
|
|
|
|
|
+ playbacks[destination_path],
|
|
|
|
|
+ )
|
|
|
if pipewire_link is not None:
|
|
if pipewire_link is not None:
|
|
|
return "pipewire", pipewire_link
|
|
return "pipewire", pipewire_link
|
|
|
if boundary_endpoint:
|
|
if boundary_endpoint:
|