Skip to content

Commit

Permalink
Publish licenses to website.
Browse files Browse the repository at this point in the history
  • Loading branch information
rerdavies committed Apr 17, 2023
1 parent 776930f commit e2b62da
Show file tree
Hide file tree
Showing 17 changed files with 273 additions and 174 deletions.
8 changes: 7 additions & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/react-dom": "^17.0.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-remark": "^2.1.0",
"react-scripts": "5.0.0",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6",
Expand All @@ -33,7 +34,12 @@
"extends": [
"react-app",
"react-app/jest"
]
],
"rules": {
"eqeqeq": 2,
"no-unused-expressions": 2,
"@typescript-eslint/no-unused-vars": 2
}
},
"browserslist": {
"production": [
Expand Down
Binary file added react/public/img/cc-by.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion react/src/FilePropertyControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const FilePropertyControl =
<Typography variant="caption" display="block" noWrap style={{
width: "100%",
textAlign: "start"
}}> {fileProperty.name}</Typography>
}}> {fileProperty.label}</Typography>
</div>
{/* CONTROL SECTION */}

Expand Down
9 changes: 6 additions & 3 deletions react/src/FilePropertyDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,12 @@ export default class FilePropertyDialog extends ResizeResponsiveComponent<FilePr
return hasSelection;
}

onSelect(selectedFile: string) {
onSelectValue(selectedFile: string) {
this.setState({ selectedFile: selectedFile, hasSelection: this.isFileInList(this.state.files, selectedFile) })
}
onDoubleClickValue(selectedFile: string) {
this.props.onOk(this.props.fileProperty,selectedFile);
}

handleDelete() {
this.setState({openConfirmDeleteDialog: true});
Expand Down Expand Up @@ -216,7 +219,7 @@ export default class FilePropertyDialog extends ResizeResponsiveComponent<FilePr
>
<ArrowBackIcon fontSize="small" style={{ opacity: "0.6" }} />
</IconButton>
<Typography display="inline" >{this.props.fileProperty.name}</Typography>
<Typography display="inline" >{this.props.fileProperty.label}</Typography>
</div>
</DialogTitle>
<div style={{ flex: "0 0 auto", height: "1px", background: "rgba(0,0,0,0.2" }}>&nbsp;</div>
Expand All @@ -230,7 +233,7 @@ export default class FilePropertyDialog extends ResizeResponsiveComponent<FilePr
return (
<ButtonBase key={this.mapKey++}
style={{ width: "320px", flex: "0 0 48px", position: "relative" }}
onClick={() => this.onSelect(value)}
onClick={() => this.onSelectValue(value)} onDoubleClick={()=> {this.onDoubleClickValue(value);}}
>
<div style={{ position: "absolute", background: selectBg, width: "100%", height: "100%", borderRadius: 4 }} />
<div style={{ display: "flex", flexFlow: "row nowrap", justifyContent: "start", alignItems: "center", width: "100%", height: "100%" }}>
Expand Down
13 changes: 8 additions & 5 deletions react/src/LoadPluginDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,29 +432,32 @@ export const LoadPluginDialog =
if (!uiPlugin) {
return (<Fragment />);
} else {
let stereoIndicator = this.stereo_indicator(uiPlugin)
let stereoIndicator = "\u00A0" + this.stereo_indicator(uiPlugin)
if (uiPlugin.author_name !== "") {
if (uiPlugin.author_homepage !== "") {
return (<Fragment>
<div style={{flex: "0 1 auto"}}>
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin.name + ",\u00A0"}</Typography>
</div>
<div style={{flex: "0 1 auto"}}>
<a href={uiPlugin.author_homepage} target="_blank" >
<a href={uiPlugin.author_homepage} target="_blank" rel="noopener noreferrer" >
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin.author_name}</Typography>
</a>
</div>
<div style={{flex: "0 0 auto"}}>
<Typography variant='body2' color="textSecondary" noWrap>{stereoIndicator}</Typography>
</div>
</Fragment>);

} else {
return (<Fragment>
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin.name + ", " + uiPlugin.author_name}</Typography>
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin.name + ", " + uiPlugin.author_name + stereoIndicator}</Typography>
</Fragment>);
}
}
return (
<Fragment>
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin?.name ?? ""}</Typography>
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin?.name ?? "" + stereoIndicator}</Typography>
</Fragment>);

}
Expand Down Expand Up @@ -545,7 +548,7 @@ export const LoadPluginDialog =
break;
}
}
if (position != -1) {
if (position !== -1) {
element.scrollToItem({ rowIndex: Math.floor(position / this.state.grid_cell_columns) });
}
}
Expand Down
29 changes: 24 additions & 5 deletions react/src/Lv2Plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


import {PiPedalArgumentError} from "./PiPedalError";

import Units from './Units';

interface Deserializable<T> {
Expand Down Expand Up @@ -83,6 +83,7 @@ export class Port implements Deserializable<Port> {

export class PortGroup {
deserialize(input: any): PortGroup {
this.uri = input.uri;
this.symbol = input.symbol;
this.name = input.name;
this.parent_group = input.parent_group;
Expand All @@ -99,6 +100,7 @@ export class PortGroup {
return result;
}

uri: string = "";
symbol: string = "";
name: string = "";
parent_group: string = "";
Expand Down Expand Up @@ -151,10 +153,12 @@ export class UiPropertyNotification {
export class PiPedalFileProperty {
deserialize(input: any): PiPedalFileProperty
{
this.name = input.name;
this.label = input.label;
this.fileTypes = PiPedalFileType.deserialize_array(input.fileTypes);
this.patchProperty = input.patchProperty;
this.directory = input.directory;
this.index = input.index;
this.portGroup = input.portGroup;
return this;
}
static deserialize_array(input: any): PiPedalFileProperty[]
Expand Down Expand Up @@ -198,10 +202,12 @@ export class PiPedalFileProperty {
return false;
}

name: string = "";
label: string = "";
fileTypes: PiPedalFileType[] = [];
patchProperty: string = "";
directory: string = "";
index: number = -1;
portGroup: string = "";

};
export class Lv2Plugin implements Deserializable<Lv2Plugin> {
Expand Down Expand Up @@ -635,9 +641,22 @@ export class UiPlugin implements Deserializable<UiPlugin> {
}
}
return undefined;
}

getPortGroupByUri(uri: string) :PortGroup | null
{
for (let i = 0; i < this.port_groups.length; ++i)
{
let port_group = this.port_groups[i];
if (port_group.uri === uri)
{
return port_group;
}
}
return null;

}
getPortGroup(symbol: string): PortGroup
getPortGroupBySymbol(symbol: string): PortGroup | null
{
for (let i = 0; i < this.port_groups.length; ++i)
{
Expand All @@ -647,7 +666,7 @@ export class UiPlugin implements Deserializable<UiPlugin> {
return port_group;
}
}
throw new PiPedalArgumentError("Port group not found.");
return null;
}

uri: string = "";
Expand Down
4 changes: 2 additions & 2 deletions react/src/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import PluginInfoDialog from './PluginInfoDialog';
import { GetControlView } from './ControlViewFactory';
import MidiBindingsDialog from './MidiBindingsDialog';
import PluginPresetSelector from './PluginPresetSelector';
import SaveIconOutline from '@mui/icons-material/Save';



const SPLIT_CONTROLBAR_THRESHHOLD = 650;
Expand Down Expand Up @@ -194,7 +194,7 @@ export const MainPage =
}
onPedalboardChanged(value: Pedalboard) {
let selectedItem = -1;
if (this.state.selectedPedal == Pedalboard.START_CONTROL || this.state.selectedPedal == Pedalboard.END_CONTROL) {
if (this.state.selectedPedal === Pedalboard.START_CONTROL || this.state.selectedPedal === Pedalboard.END_CONTROL) {
selectedItem = this.state.selectedPedal;
} else if (value.hasItem(this.state.selectedPedal)) {
selectedItem = this.state.selectedPedal;
Expand Down
1 change: 1 addition & 0 deletions react/src/PedalboardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const TERMINAL_ICON_URL = "img/fx_terminal.svg";

function CalculateConnection(numberOfInputs: number, numberOfOutputs: number)
{

let result = Math.min(numberOfInputs, numberOfOutputs);
if (result > 2) result = 2;
return result;
Expand Down
11 changes: 5 additions & 6 deletions react/src/PiPedalModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import GovernorSettings from './GovernorSettings';
import WifiChannel from './WifiChannel';
import AlsaDeviceInfo from './AlsaDeviceInfo';
import { AndroidHostInterface, FakeAndroidHost } from './AndroidHost';
import Xxx from './XxxSnippet';


export enum State {
Expand Down Expand Up @@ -1176,7 +1175,7 @@ export class PiPedalModel //implements PiPedalModel
let changed: boolean = false;

let pedalboard = this.pedalboard.get();
if (pedalboard.input_volume_db != volume_db)
if (pedalboard.input_volume_db !== volume_db)
{
let newPedalboard = pedalboard.clone();
newPedalboard.input_volume_db = volume_db;
Expand Down Expand Up @@ -1207,7 +1206,7 @@ export class PiPedalModel //implements PiPedalModel
let changed: boolean = false;

let pedalboard = this.pedalboard.get();
if (pedalboard.output_volume_db != volume_db)
if (pedalboard.output_volume_db !== volume_db)
{
let newPedalboard = pedalboard.clone();
newPedalboard.output_volume_db = volume_db;
Expand All @@ -1234,7 +1233,7 @@ export class PiPedalModel //implements PiPedalModel
if (pedalboard === undefined) throw new PiPedalStateError("Pedalboard not ready.");
let newPedalboard = pedalboard.clone();

if (instanceId === Pedalboard.START_CONTROL && key == "volume_db")
if (instanceId === Pedalboard.START_CONTROL && key === "volume_db")
{
this._setInputVolume(value,notifyServer);
return;
Expand Down Expand Up @@ -1371,7 +1370,7 @@ export class PiPedalModel //implements PiPedalModel
// mouse is down. Don't update EVERYBODY, but we must change
// the control on the running audio plugin.
// TODO: respect "expensive" port attribute.
if (instanceId === Pedalboard.START_CONTROL && key == "volume_db")
if (instanceId === Pedalboard.START_CONTROL && key === "volume_db")
{
this.previewInputVolume(value);
return;
Expand All @@ -1391,7 +1390,7 @@ export class PiPedalModel //implements PiPedalModel
this.updateVst3State(newPedalboard);

let result = newPedalboard.deleteItem(instanceId);
if (result != null) {
if (result !== null) {
this.pedalboard.set(newPedalboard);
this.updateServerPedalboard();
}
Expand Down
Loading

0 comments on commit e2b62da

Please sign in to comment.