Split control double-tap for default value.
This commit is contained in:
@@ -1138,18 +1138,20 @@ export function makeSplitUiPlugin(): UiPlugin {
|
||||
has_midi_output: 0,
|
||||
description: "",
|
||||
controls: [
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "splitType",
|
||||
name: "Type",
|
||||
index: 0,
|
||||
is_input: true,
|
||||
min_value: 0.0,
|
||||
max_value: 2.0,
|
||||
default_value: 0.0,
|
||||
|
||||
enumeration_property: true,
|
||||
scale_points: [
|
||||
new ScalePoint().deserialize({ value: 0, label: "A/B" }),
|
||||
new ScalePoint().deserialize({ value: 1, label: "mix" }),
|
||||
new ScalePoint().deserialize({ value: 1, label: "L/R" }),
|
||||
new ScalePoint().deserialize({ value: 1, label: "Mix" }),
|
||||
new ScalePoint().deserialize({ value: 2, label: "L/R" }),
|
||||
],
|
||||
is_bypass: false,
|
||||
is_program_controller: false,
|
||||
@@ -1157,18 +1159,22 @@ export function makeSplitUiPlugin(): UiPlugin {
|
||||
connection_optional: false,
|
||||
|
||||
}),
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "select",
|
||||
name: "Select",
|
||||
index: 1,
|
||||
is_input: true,
|
||||
min_value: 0.0,
|
||||
max_value: 1.0,
|
||||
default_value: 0.0,
|
||||
|
||||
enumeration_property: true,
|
||||
scale_points: [
|
||||
new ScalePoint().deserialize({ value: 0, label: "A" }),
|
||||
new ScalePoint().deserialize({ value: 1, label: "B" }),
|
||||
],
|
||||
controlType: ControlType.ABSwitch,
|
||||
|
||||
is_bypass: false,
|
||||
is_program_controller: false,
|
||||
custom_units: "",
|
||||
@@ -1176,65 +1182,74 @@ export function makeSplitUiPlugin(): UiPlugin {
|
||||
|
||||
}),
|
||||
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "mix",
|
||||
name: "Mix",
|
||||
index: 2,
|
||||
is_input: true,
|
||||
min_value: -1.0,
|
||||
max_value: 1.0,
|
||||
default_value: 0.0,
|
||||
controlType: ControlType.Dial,
|
||||
is_bypass: false,
|
||||
is_program_controller: false,
|
||||
custom_units: "",
|
||||
connection_optional: false,
|
||||
|
||||
}),
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "panL",
|
||||
name: "Pan Top",
|
||||
index: 3,
|
||||
is_input: true,
|
||||
min_value: -1.0,
|
||||
max_value: 1.0,
|
||||
default_value: 0.0,
|
||||
controlType: ControlType.Dial,
|
||||
is_bypass: false,
|
||||
is_program_controller: false,
|
||||
custom_units: "",
|
||||
connection_optional: false,
|
||||
|
||||
}),
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "volL",
|
||||
name: "Vol Top",
|
||||
index: 4,
|
||||
is_input: true,
|
||||
min_value: -60.0,
|
||||
max_value: 12.0,
|
||||
default_value: 0.0,
|
||||
is_bypass: false,
|
||||
controlType: ControlType.Dial,
|
||||
is_program_controller: false,
|
||||
custom_units: "",
|
||||
connection_optional: false,
|
||||
|
||||
}),
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "panR",
|
||||
name: "Pan Bottom",
|
||||
index: 5,
|
||||
is_input: true,
|
||||
min_value: -1.0,
|
||||
max_value: 1.0,
|
||||
default_value: 0.0,
|
||||
controlType: ControlType.Dial,
|
||||
is_bypass: false,
|
||||
is_program_controller: false,
|
||||
custom_units: "",
|
||||
connection_optional: false,
|
||||
|
||||
}),
|
||||
new UiControl().applyProperties({
|
||||
new UiControl().deserialize({
|
||||
symbol: "volR",
|
||||
name: "Vol Bottom",
|
||||
index: 6,
|
||||
is_input: true,
|
||||
min_value: -60.0,
|
||||
max_value: 12.0,
|
||||
default_value: 0.0,
|
||||
controlType: ControlType.Dial,
|
||||
is_bypass: false,
|
||||
is_program_controller: false,
|
||||
custom_units: "",
|
||||
|
||||
@@ -686,9 +686,9 @@ export class Pedalboard implements Deserializable<Pedalboard> {
|
||||
new ControlValue(PedalboardSplitItem.SELECT_KEY,0),
|
||||
new ControlValue(PedalboardSplitItem.MIX_KEY,0),
|
||||
new ControlValue(PedalboardSplitItem.PANL_KEY,0),
|
||||
new ControlValue(PedalboardSplitItem.VOLL_KEY,-3),
|
||||
new ControlValue(PedalboardSplitItem.VOLL_KEY,0),
|
||||
new ControlValue(PedalboardSplitItem.PANR_KEY,0),
|
||||
new ControlValue(PedalboardSplitItem.VOLR_KEY,-3)
|
||||
new ControlValue(PedalboardSplitItem.VOLR_KEY,0)
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -1721,11 +1721,19 @@ export class PiPedalModel //implements PiPedalModel
|
||||
if (pedalboard === undefined) throw new PiPedalStateError("Pedalboard not ready.");
|
||||
let newPedalboard = pedalboard.clone();
|
||||
|
||||
let item = newPedalboard.getItem(instanceId);
|
||||
let item: PedalboardItem = newPedalboard.getItem(instanceId);
|
||||
|
||||
let changed = value !== item.isEnabled;
|
||||
if (changed) {
|
||||
item.isEnabled = value;
|
||||
let pluginInfo: UiPlugin | null = this.getUiPlugin(item.uri);
|
||||
if (pluginInfo !== null) {
|
||||
for (let uiControl of pluginInfo.controls) {
|
||||
if (uiControl.is_bypass) {
|
||||
this._setPedalboardControlValue(instanceId, uiControl.symbol, value ? 0.0 : 1.0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setModelPedalboard(newPedalboard);
|
||||
if (notifyServer) {
|
||||
let body: PedalboardItemEnableBody = {
|
||||
|
||||
@@ -27,6 +27,7 @@ export const SplitTypeControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.TYPE_KEY,
|
||||
name: "Type",
|
||||
index: 0,
|
||||
is_input: true,
|
||||
min_value: 0,
|
||||
max_value: 2,
|
||||
default_value: 0,
|
||||
@@ -53,6 +54,8 @@ export const SplitAbControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.SELECT_KEY,
|
||||
name: "Select",
|
||||
index: 1,
|
||||
is_input: true,
|
||||
|
||||
min_value: 0,
|
||||
max_value: 1,
|
||||
default_value: 0,
|
||||
@@ -78,6 +81,7 @@ export const SplitMixControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.MIX_KEY,
|
||||
name: "Mix",
|
||||
index: 2,
|
||||
is_input: true,
|
||||
min_value: -1,
|
||||
max_value: 1,
|
||||
default_value: 0,
|
||||
@@ -99,6 +103,7 @@ export const SplitPanLeftControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.PANL_KEY,
|
||||
name: "Pan Top",
|
||||
index: 3,
|
||||
is_input: true,
|
||||
min_value: -1,
|
||||
max_value: 1,
|
||||
default_value: 0,
|
||||
@@ -119,9 +124,10 @@ export const SplitVolLeftControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.VOLL_KEY,
|
||||
name: "Vol Top",
|
||||
index: 4,
|
||||
is_input: true,
|
||||
min_value: -60,
|
||||
max_value: 12,
|
||||
default_value: -3,
|
||||
default_value: 0,
|
||||
range_steps: 0,
|
||||
is_logarithmic: false,
|
||||
display_priority: -1,
|
||||
@@ -146,6 +152,7 @@ export const SplitPanRightControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.PANR_KEY,
|
||||
name: "Pan Bottom",
|
||||
index: 5,
|
||||
is_input: true,
|
||||
min_value: -1,
|
||||
max_value: 1,
|
||||
default_value: 0,
|
||||
@@ -166,9 +173,10 @@ export const SplitVolRightControl: UiControl = new UiControl().deserialize({
|
||||
symbol: PedalboardSplitItem.VOLR_KEY,
|
||||
name: "Vol Bottom",
|
||||
index: 6,
|
||||
is_input: true,
|
||||
min_value: -60,
|
||||
max_value: 12,
|
||||
default_value: -3,
|
||||
default_value: 0,
|
||||
range_steps: 0,
|
||||
is_logarithmic: false,
|
||||
display_priority: -1,
|
||||
|
||||
Reference in New Issue
Block a user