{
open: boolean,
@@ -189,7 +194,43 @@ export const MidiBindingDialog =
let item = v.value;
- let plugin = this.model.getUiPlugin(item.uri);
+ let isSplit = item.uri === "uri://two-play/pipedal/pedalboard#Split";
+ let plugin : UiPlugin | null = this.model.getUiPlugin(item.uri);
+ if (plugin === null && isSplit)
+ {
+ plugin = makeSplitUiPlugin();
+ let splitType = item.getControlValue("splitType");
+ not_null(plugin.getControl("splitType")).not_on_gui = true;
+ switch (splitType)
+ {
+ case 0: // A/B
+ not_null(plugin.getControl("select")).not_on_gui = false;
+ not_null(plugin.getControl("mix")).not_on_gui = true;
+ not_null(plugin.getControl("volL")).not_on_gui = true;
+ not_null(plugin.getControl("panL")).not_on_gui = true;
+ not_null(plugin.getControl("volR")).not_on_gui = true;
+ not_null(plugin.getControl("panR")).not_on_gui = true;
+ break;
+ case 1: //mixer
+ not_null(plugin.getControl("select")).not_on_gui = true;
+ not_null(plugin.getControl("mix")).not_on_gui = false;
+ not_null(plugin.getControl("volL")).not_on_gui = true;
+ not_null(plugin.getControl("panL")).not_on_gui = true;
+ not_null(plugin.getControl("volR")).not_on_gui = true;
+ not_null(plugin.getControl("panR")).not_on_gui = true;
+ break;
+ case 2: // L/R
+ not_null(plugin.getControl("select")).not_on_gui = true;
+ not_null(plugin.getControl("mix")).not_on_gui = true;
+ not_null(plugin.getControl("volL")).not_on_gui = false;
+ not_null(plugin.getControl("panL")).not_on_gui = false;
+ not_null(plugin.getControl("volR")).not_on_gui = false;
+ not_null(plugin.getControl("panR")).not_on_gui = false;
+ break;
+ }
+
+ // xxx
+ }
if (plugin) {
result.push(
@@ -200,29 +241,33 @@ export const MidiBindingDialog =
);
- result.push(
-
- |
-
- Bypass
-
- |
-
- {
- if (instanceId === -2)
- {
- this.cancelListenForControl();
- } else {
- this.handleListenForControl(instanceId, symbol, listenForControl);
- }
- }}
- listen={item.instanceId === this.state.listenInstanceId && this.state.listenSymbol === "__bypass"}
- onChange={(instanceId: number, newItem: MidiBinding) => this.handleItemChanged(instanceId, newItem)}
- />
- |
-
- );
+ if (!isSplit)
+ {
+ result.push(
+
+ |
+
+ Bypass
+
+ |
+
+ {
+ if (instanceId === -2)
+ {
+ this.cancelListenForControl();
+ } else {
+ this.handleListenForControl(instanceId, symbol, listenForControl);
+ }
+ }}
+ listen={item.instanceId === this.state.listenInstanceId && this.state.listenSymbol === "__bypass"}
+ onChange={(instanceId: number, newItem: MidiBinding) => this.handleItemChanged(instanceId, newItem)}
+ />
+ |
+
+ );
+ }
for (let i = 0; i < plugin.controls.length; ++i) {
let control = plugin.controls[i];
@@ -244,6 +289,7 @@ export const MidiBindingDialog =
{
diff --git a/react/src/PedalboardView.tsx b/react/src/PedalboardView.tsx
index c5014bc..33971b4 100644
--- a/react/src/PedalboardView.tsx
+++ b/react/src/PedalboardView.tsx
@@ -367,12 +367,14 @@ const PedalboardView =
frameRef: React.RefObject;
scrollRef: React.RefObject;
-
+ private bgColor: string;
constructor(props: PedalboardProps) {
super(props);
this.model = PiPedalModelFactory.getInstance();
+ this.bgColor = props.theme.palette.background.default
+
if (!props.selectedId) props.selectedId = -1;
this.state = {
pedalboard: this.model.pedalboard.get(),
@@ -692,6 +694,7 @@ const PedalboardView =
let y_ = item.bounds.y + CELL_HEIGHT / 2;
let numberOfOutputs = item.numberOfOutputs;
let color = enabled ? ENABLED_CONNECTOR_COLOR : DISABLED_CONNECTOR_COLOR;
+ let stereoCenterColor = this.bgColor;
let svgPath = new SvgPathBuilder().moveTo(x_, y_).lineTo(x_ + CELL_WIDTH, y_).toString();
if (numberOfOutputs === 2) {
@@ -699,7 +702,7 @@ const PedalboardView =
));
output.push((
-
+
));
} else if (numberOfOutputs === 1) {
output.push((
@@ -727,14 +730,14 @@ const PedalboardView =
if (item.numberOfInputs === 2 && item.topChildren[0].numberOfInputs === 2) {
output.push(());
- output.push(());
+ output.push(());
} else if (item.numberOfInputs !== 0 && item.topChildren[0].numberOfInputs !== 0) {
output.push(());
}
if (item.numberOfInputs === 2 && item.bottomChildren[0].numberOfInputs === 2) {
output.push(());
- output.push(());
+ output.push(());
} else if (item.numberOfInputs !== 0 && item.bottomChildren[0].numberOfInputs !== 0) {
output.push(());
@@ -824,7 +827,7 @@ const PedalboardView =
));
output.push((
-
+
));
} else if (!firstPathAbsent) {
output.push((
@@ -836,7 +839,7 @@ const PedalboardView =
));
output.push((
-
+
));
} else if (!secondPathAbsent) {
output.push((
@@ -868,12 +871,12 @@ const PedalboardView =
// draw stereo inner lines.
if (firstPathStereo) {
output.push((
-
+
));
}
if (secondPathStereo) {
output.push((
-
+
));
}
@@ -885,7 +888,7 @@ const PedalboardView =
));
output.push((
-
+
));
@@ -958,7 +961,7 @@ const PedalboardView =
let outputs: ReactNode[] = [];
this.renderConnectors(outputs, layoutChain, true, false);
return (
-
+
|