Dark Moded interrim checkin.

This commit is contained in:
Robin Davies
2023-06-28 04:48:35 -04:00
parent 2319c30649
commit e33e61e37a
62 changed files with 1568 additions and 128 deletions
+18 -17
View File
@@ -26,13 +26,14 @@ import { PiPedalModel, PiPedalModelFactory } from './PiPedalModel';
import { PluginType } from './Lv2Plugin';
import ButtonBase from '@mui/material/ButtonBase';
import Typography from '@mui/material/Typography';
import { SelectIcon } from './PluginIcon';
import PluginIcon, {SelectIconUri} from './PluginIcon';
import { SelectHoverBackground } from './SelectHoverBackground';
import SvgPathBuilder from './SvgPathBuilder';
import Draggable from './Draggable'
import Rect from './Rect';
import {PiPedalStateError} from './PiPedalError';
import Utility from './Utility'
import Utility from './Utility';
import {
Pedalboard, PedalboardItem, PedalboardSplitItem, SplitType
} from './Pedalboard';
@@ -237,6 +238,7 @@ class PedalLayout {
static Start(): PedalLayout {
let t: PedalLayout = new PedalLayout();
t.uri = START_PEDALBOARD_ITEM_URI;
t.pluginType = PluginType.Terminal;
t.iconUrl = TERMINAL_ICON_URL;
t.numberOfInputs = 0;
t.numberOfOutputs = 2;
@@ -244,7 +246,7 @@ class PedalLayout {
}
static End(): PedalLayout {
let t: PedalLayout = new PedalLayout();
t.pluginType = PluginType.UtilityPlugin;
t.pluginType = PluginType.Terminal;
t.uri = END_PEDALBOARD_ITEM_URI;
t.iconUrl = TERMINAL_ICON_URL;
t.numberOfInputs = 2;
@@ -272,7 +274,7 @@ class PedalLayout {
} else if (pedalItem.isEmpty()) {
this.pluginType = PluginType.UtilityPlugin;
this.pluginType = PluginType.None;
this.iconUrl = EMPTY_ICON_URL;
this.numberOfInputs = 2;
this.numberOfOutputs = 2;
@@ -293,13 +295,13 @@ class PedalLayout {
let uiPlugin = model.getUiPlugin(pedalItem.uri);
if (uiPlugin != null) {
this.pluginType = uiPlugin.plugin_type;
this.iconUrl = SelectIcon(uiPlugin.plugin_type,uiPlugin.uri);
this.iconUrl = SelectIconUri(uiPlugin.plugin_type);
this.name = uiPlugin.name;
this.numberOfInputs = Math.max(uiPlugin.audio_inputs,2);
this.numberOfOutputs = Math.max(uiPlugin.audio_outputs,2);
} else {
// default to empty plugin.
this.pluginType = PluginType.UtilityPlugin;
this.pluginType = PluginType.ErrorPlugin;
this.name = pedalItem.pluginName??"#error";
this.iconUrl = ERROR_ICON_URL;
this.numberOfInputs = 2;
@@ -525,22 +527,22 @@ const PedalboardView =
}
}
getSplitterIcon(layoutItem: PedalLayout) {
getSplitterIcon(layoutItem: PedalLayout): PluginType {
if (layoutItem.pedalItem === undefined) {
throw new Error("Invalid splitter");
}
let split = layoutItem.pedalItem as PedalboardSplitItem;
if (split.getSplitType() === SplitType.Ab) {
if (split.isASelected()) {
return "img/fx_split_a.svg";
return PluginType.SplitA;
} else {
return "img/fx_split_b.svg";
return PluginType.SplitB;
}
} else if (split.getSplitType() === SplitType.Mix) {
return "img/fx_dial.svg";
return PluginType.SplitMix; //"img/fx_dial.svg";
} else {
return "img/fx_lr.svg";
return PluginType.SplitLR; //"img/fx_lr.svg";
}
}
@@ -903,7 +905,7 @@ const PedalboardView =
throw new PiPedalStateError("scroll container not found.");
}
pedalButton(instanceId: number, iconUrl: string, draggable: boolean, enabled: boolean,hasBorder: boolean = true): ReactNode {
pedalButton(instanceId: number, iconType: PluginType, draggable: boolean, enabled: boolean,hasBorder: boolean = true): ReactNode {
let classes = this.props.classes;
return (
<div className={hasBorder? classes.iconFrame : classes.borderlessIconFrame} onContextMenu={(e) => { e.preventDefault(); }}>
@@ -917,8 +919,7 @@ const PedalboardView =
<Draggable draggable={draggable} getScrollContainer={() => this.getScrollContainer()}
onDragEnd={(x, y) => { this.onDragEnd(instanceId, x, y) }}
>
<img src={iconUrl} className={classes.pedalIcon} alt="Pedal" draggable={false}
style={{opacity: enabled? 0.99: 0.6}} />
<PluginIcon pluginType={iconType} size={24} opacity={enabled? 0.99:0.6} />
</Draggable>
</SelectHoverBackground>
</ButtonBase>
@@ -982,7 +983,7 @@ const PedalboardView =
result.push(<div key={this.renderKey++} className={classes.splitItem} style={{ left: item.bounds.x, top: item.bounds.y, width: item.bounds.width }} >
<div className={classes.splitStart} >
{this.pedalButton(START_CONTROL, item.iconUrl, false,true,false)}
{this.pedalButton(START_CONTROL, item.pluginType,false,true,false)}
</div>
</div>);
break;
@@ -990,7 +991,7 @@ const PedalboardView =
result.push(<div key={this.renderKey++} className={classes.splitItem} style={{ left: item.bounds.x, top: item.bounds.y, width: item.bounds.width }} >
<div className={classes.splitStart} >
{this.pedalButton(END_CONTROL, item.iconUrl, false,true,false)}
{this.pedalButton(END_CONTROL, item.pluginType, false,true,false)}
</div>
</div>);
break;
@@ -1015,7 +1016,7 @@ const PedalboardView =
</div>
)
result.push(<div key={this.renderKey++} className={classes.pedalItem} style={{ left: item.bounds.x, top: item.bounds.y }} >
{this.pedalButton(item.pedalItem?.instanceId ?? -1, item.iconUrl, !item.isEmpty(), item.pedalItem?.isEnabled ?? false)}
{this.pedalButton(item.pedalItem?.instanceId ?? -1, item.pluginType, !item.isEmpty(), item.pedalItem?.isEnabled ?? false)}
</div>);