Port from CRT to Vite

This commit is contained in:
Robin E. R. Davies
2025-02-19 08:58:15 -05:00
parent 830352ff69
commit d78d78026c
313 changed files with 10653 additions and 5396 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ enable_testing()
add_subdirectory("PiPedalCommon")
add_subdirectory("react")
add_subdirectory("vite")
add_subdirectory("src")
-24
View File
@@ -1,24 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
/package-lock.json
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-208
View File
@@ -1,208 +0,0 @@
find_program(NPM_COMMAND npm)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(BUILD_REACT "echo")
set(BUILD_REACT_ARGS Skipping react debug build)
else()
set(BUILD_REACT npm)
set(BUILD_REACT_ARGS run build)
endif()
set (BUILD_DIRECTORY ${PROJECT_SOURCE_DIR}/build/react/build)
add_custom_command(
OUTPUT ${BUILD_DIRECTORY}/index.html
COMMAND ${BUILD_REACT}
ARGS ${BUILD_REACT_ARGS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/react
DEPENDS
src/PiPedalError.tsx
src/OldDeleteIcon.tsx
src/MaterialColors.tsx
src/Pedalboard.tsx
src/SystemMidiBindingView.tsx
src/GovernorSettings.tsx
src/ObservableProperty.tsx
src/SnapshotEditor.tsx
src/SelectMidiChannelsDialog.tsx
src/AlsaMidiDeviceInfo.tsx
src/WifiDirectConfigSettings.tsx
src/WifiConfigSettings.tsx
src/SnapshotButton.tsx
src/WindowScale.tsx
src/JsonAtom.tsx
src/PiPedalSocket.tsx
src/TemporaryDrawer.tsx
src/DarkMode.tsx
src/MidiBindingsDialog.tsx
src/MidiBinding.tsx
src/SnapshotDialog.tsx
src/SettingsDialog.tsx
src/PedalboardView.tsx
src/reportWebVitals.ts
src/OptionsDialog.tsx
src/SelectChannelsDialog.tsx
src/PluginPresetSelector.tsx
src/VuMeter.tsx
src/ToobFrequencyResponseView.tsx
src/SystemMidiBindingsDialog.tsx
src/FullScreenIME.tsx
src/App.tsx
src/ToobInputStageView.tsx
src/XxxSnippet.tsx
src/JackServerSettings.tsx
src/ToobWaveShapeView.tsx
src/ToobPowerStage2View.tsx
src/PluginPreset.tsx
src/logo.svg
src/Banks.tsx
src/NoChangePassword.tsx
src/SearchFilter.tsx
src/FilePropertyDirectorySelectDialog.tsx
src/GxTunerView.tsx
src/UpdateDialog.tsx
src/svg/file_download_black_24dp.svg
src/svg/fx_filter.svg
src/svg/fx_pitch.svg
src/svg/fx_distortion.svg
src/svg/fx_split_b.svg
src/svg/fx_chorus.svg
src/svg/fx_limiter.svg
src/svg/fx_phaser.svg
src/svg/snapshot_0.svg
src/svg/snapshot_3.svg
src/svg/file_upload_black_24dp.svg
src/svg/ic_bank.svg
src/svg/fx_function.svg
src/svg/fx_dial.svg
src/svg/ic_settings.svg
src/svg/fx_split_a.svg
src/svg/fx_empty.svg
src/svg/fx_amplifier.svg
src/svg/fx_spectral.svg
src/svg/fx_eq.svg
src/svg/ic_edit_banks.svg
src/svg/ic_help_outline.svg
src/svg/ic_save_bank_as.svg
src/svg/ic_pluginpreset2.svg
src/svg/fx_flanger2.svg
src/svg/snapshot_6.svg
src/svg/fx_lr.svg
src/svg/fx_generator.svg
src/svg/snapshot_1.svg
src/svg/fx_reverb.svg
src/svg/fx_plugin.svg
src/svg/snapshot_4.svg
src/svg/drive_file_rename_outline_black_24dp.svg
src/svg/snapshot_2.svg
src/svg/fx_instrument.svg
src/svg/fx_modulator.svg
src/svg/fx_error.svg
src/svg/fx_simulator.svg
src/svg/fx_filter_hp.svg
src/svg/fx_compressor.svg
src/svg/fx_gate.svg
src/svg/fx_terminal.svg
src/svg/ic_midi.svg
src/svg/fx_oscillator.svg
src/svg/fx_analyzer.svg
src/svg/fx_flanger.svg
src/svg/old_delete_outline_24dp.svg
src/svg/ic_presets.svg
src/svg/fx_delay.svg
src/svg/fx_parametric_eq.svg
src/svg/fx_spatial.svg
src/svg/fx_converter.svg
src/svg/fx_constant.svg
src/svg/snapshot_5.svg
src/svg/ic_pluginpreset.svg
src/svg/fx_mixer.svg
src/svg/fx_utility.svg
src/Updater.tsx
src/UploadPresetDialog.tsx
src/RadioSelectDialog.tsx
src/setupTests.ts
src/ToobCabSimView.tsx
src/RenameDialog.tsx
src/SplitControlView.tsx
src/SelectHoverBackground.tsx
src/IControlViewFactory.tsx
src/OkCancelDialog.tsx
src/BankDialog.tsx
src/PluginPresetsDialog.tsx
src/App.test.tsx
src/ControlViewFactory.tsx
src/DraggableGrid.tsx
src/ZoomedDial.tsx
src/index.css
src/Pedal.tsx
src/Draggable.tsx
src/PluginIcon.tsx
src/react-app-env.d.ts
src/TextFieldEx.tsx
src/FilePropertyDialog.tsx
src/FilePropertyDirectoryTree.tsx
src/StringBuilder.tsx
src/MainPage.tsx
src/PluginInfoDialog.tsx
src/AppThemed.tsx
src/Lv2Plugin.tsx
src/ToobSpectrumResponseView.tsx
src/PerformanceView.tsx
src/JackServerSettingsDialog.tsx
src/Utility.tsx
src/JackStatusView.tsx
src/ToobSpectrumAnalyzerView.tsx
src/SvgPathBuilder.tsx
src/PresetSelector.tsx
src/PresetDialog.tsx
src/WifiChannel.tsx
src/AboutDialog.tsx
src/GxTunerControl.tsx
src/VirtualKeyboardHandler.tsx
src/PluginControl.tsx
src/LoadPluginDialog.tsx
src/ZoomedUiControl.tsx
src/AlsaDeviceInfo.tsx
src/ToobToneStackView.tsx
src/UploadFileDialog.tsx
src/PluginOutputControl.tsx
src/SelectThemeDialog.tsx
src/Rect.tsx
src/AppThemed.css
src/ColorDropdownButton.tsx
src/AndroidHost.tsx
src/SnapshotPanel.tsx
src/ToobMLView.tsx
src/WifiConfigDialog.tsx
src/Rectangle.tsx
src/SnapshotColors.tsx
src/PiPedalModel.tsx
src/ObservableEvent.tsx
src/JackHostStatus.tsx
src/index.tsx
src/FilePropertyControl.tsx
src/WifiDirectConfigDialog.tsx
src/MidiBindingView.tsx
src/PluginControlView.tsx
src/SplitUiControls.tsx
src/PluginClass.tsx
src/DialogEx.tsx
src/Jack.tsx
src/ResizeResponsiveComponent.tsx
src/NumericInput.tsx
src/SnapshotPropertiesDialog.tsx
src/SearchControl.tsx
src/Units.tsx
)
add_custom_target (
ReactBuild ALL
DEPENDS ${BUILD_DIRECTORY}/index.html
)
-69
View File
@@ -1,69 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2024 Robin E. R. Davies
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import * as React from 'react';
import { Theme } from '@mui/material/styles';
import { WithStyles } from '@mui/styles';
import createStyles from '@mui/styles/createStyles';
import withStyles from '@mui/styles/withStyles';
const styles = (theme: Theme) => createStyles({
frame: {
position: "relative",
margin: "12px"
}
});
export interface MiniSpinnerProps extends WithStyles<typeof styles> {
theme: Theme
}
export interface MiniSpinnerProps {
size?: number;
};
const MiniSpinner = withStyles(styles)((props: MiniSpinnerProps) => {
const { classes } = props;
let size: number = 24;
if (props.size)
{
size = props.size;
}
let thickness = 3;
let r = size-thickness/2;
return (
<div style={{width:size, height: size}}>
<svg viewBox={ (size/2) + " " + (size/2) + " " + size + " " + size}> width={size} height={size}
<circle
cx="0" cy="0" r={r} fill="none" stroke={props.theme.palette.primary.main} strokeWidth={thickness}
/>
</svg>
</div>
);
});
-46
View File
@@ -1,46 +0,0 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
-1
View File
@@ -1 +0,0 @@
npm run build
-64
View File
@@ -1,64 +0,0 @@
{
"name": "pipedal",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.4.1",
"@mui/material": "^5.4.1",
"@mui/styles": "^5.4.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^26.0.23",
"@types/node": "^12.20.15",
"@types/react": "^17.0.11",
"@types/react-dom": "^17.0.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-remark": "^2.1.0",
"react-scripts": "^5.0.1",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6",
"typescript": "^4.3.4",
"web-vitals": "^1.1.2",
"@babel/plugin-proposal-private-property-in-object": "^7.2.11"
},
"scripts": {
"start": "react-scripts start",
"build": "BUILD_PATH='../build/react/build' react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
],
"rules": {
"eqeqeq": 2,
"no-unused-expressions": 2,
"@typescript-eslint/no-unused-vars": 2
}
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

-28
View File
@@ -1,28 +0,0 @@
found 8 vulnerabilities (4 moderate, 4 high)
run `npm audit fix` to fix them, or `npm audit` for details
Created git commit.
Success! Created my-app at /home/patch/src/piddle/react/my-app
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you canât go back!
We suggest that you begin by typing:
cd my-app
npm start
Happy hacking!
-298
View File
@@ -1,298 +0,0 @@
import React, { SyntheticEvent, Component } from 'react';
import IconButton from '@mui/material/IconButton';
import Typography from '@mui/material/Typography';
import { PiPedalModel, PiPedalModelFactory, State } from './PiPedalModel';
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import Divider from '@mui/material/Divider';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import JackHostStatus from './JackHostStatus';
import { PiPedalError } from './PiPedalError';
import DialogEx from './DialogEx';
import createStyles from '@mui/styles/createStyles';
import { Theme } from '@mui/material/styles';
import { withStyles, WithStyles } from '@mui/styles';
import Slide, { SlideProps } from '@mui/material/Slide';
interface AboutDialogProps extends WithStyles<typeof styles> {
open: boolean;
onClose: () => void;
};
interface AboutDialogState {
jackStatus?: JackHostStatus;
openSourceNotices: string;
};
const styles = (theme: Theme) => createStyles({
dialogAppBar: {
position: 'relative',
top: 0, left: 0
},
dialogTitle: {
marginLeft: theme.spacing(2),
flex: 1,
},
sectionHead: {
marginLeft: 24,
marginRight: 24,
marginTop: 16,
paddingBottom: 12
},
textBlock: {
marginLeft: 24,
marginRight: 24,
marginTop: 16,
paddingBottom: 0,
opacity: 0.95
},
textBlockIndented: {
marginLeft: 40,
marginRight: 24,
marginTop: 16,
paddingBottom: 0,
opacity: 0.95
},
setting: {
minHeight: 64,
width: "100%",
textAlign: "left",
paddingLeft: 22,
paddingRight: 22
},
primaryItem: {
},
secondaryItem: {
},
can_select: {
userSelect: "text",
cursor: "text"
},
no_select: {
userSelect: "none",
cursor: "text"
}
});
const Transition = React.forwardRef(function Transition(
props: SlideProps, ref: React.Ref<unknown>
) {
return (<Slide direction="up" ref={ref} {...props} />);
});
const AboutDialog = withStyles(styles, { withTheme: true })(
class extends Component<AboutDialogProps, AboutDialogState> {
model: PiPedalModel;
refNotices: React.RefObject<HTMLDivElement>;
constructor(props: AboutDialogProps) {
super(props);
this.model = PiPedalModelFactory.getInstance();
this.refNotices = React.createRef();
this.handleDialogClose = this.handleDialogClose.bind(this);
this.state = {
jackStatus: undefined,
openSourceNotices: ""
};
}
mounted: boolean = false;
subscribed: boolean = false;
tick() {
if (this.model.state.get() === State.Ready) {
this.model.getJackStatus()
.then(jackStatus => {
this.setState({ jackStatus: jackStatus });
})
.catch(error => { /* ignore*/ });
}
}
timerHandle?: NodeJS.Timeout;
updateNotifications() {
let subscribed = this.mounted && this.props.open;
if (subscribed !== this.subscribed) {
if (subscribed) {
this.timerHandle = setInterval(() => this.tick(), 1000);
} else {
if (this.timerHandle) {
clearInterval(this.timerHandle);
this.timerHandle = undefined;
}
}
this.subscribed = subscribed;
}
}
startFossRequest() {
if (this.state.openSourceNotices === "") {
fetch("var/notices.txt")
.then((request) => {
if (!request.ok) {
throw new PiPedalError("notices request failed.");
}
return request.text();
})
.then((text) => {
if (this.mounted) {
this.setState({ openSourceNotices: text });
}
})
.catch((err) => {
// ok in debug builds. File doesn't get placed until install time.
console.log("Failed to fetch open-source notices. " + err.toString());
});
}
}
componentDidMount() {
super.componentDidMount?.();
this.mounted = true;
this.updateNotifications();
this.startFossRequest();
}
componentWillUnmount() {
super.componentWillUnmount?.();
this.mounted = false;
this.updateNotifications();
}
componentDidUpdate(prevProps: Readonly<AboutDialogProps>, prevState: Readonly<AboutDialogState>, snapshot: any): void {
super.componentDidUpdate?.(prevProps, prevState, snapshot);
this.updateNotifications();
}
handleDialogClose(e: SyntheticEvent) {
this.props.onClose();
}
render() {
let classes = this.props.classes;
let addressKey = 0;
let serverVersion = this.model.serverVersion?.serverVersion ?? "";
let nPos = serverVersion.indexOf(' ');
if (nPos !== -1) {
serverVersion = serverVersion.substring(nPos + 1);
}
return (
<DialogEx tag="about" fullScreen open={this.props.open}
onClose={() => { this.props.onClose() }} TransitionComponent={Transition}
onEnterKey={() => { this.props.onClose() }}
style={{ userSelect: "none" }}
>
<div style={{ display: "flex", flexDirection: "column", flexWrap: "nowrap", width: "100%", height: "100%", overflow: "hidden" }}>
<div style={{ flex: "0 0 auto" }}>
<AppBar className={classes.dialogAppBar} >
<Toolbar>
<IconButton edge="start" color="inherit" onClick={this.handleDialogClose} aria-label="back"
>
<ArrowBackIcon />
</IconButton>
<Typography noWrap variant="h6" className={classes.dialogTitle}>
About
</Typography>
</Toolbar>
</AppBar>
</div>
<div style={{
flex: "1 1 auto", position: "relative", overflow: "hidden",
overflowX: "hidden", overflowY: "auto", userSelect: "text"
}}
>
<div id="debug_info" className={classes.can_select} style={{ margin: 24 }}>
<div style={{ display: "flex", flexFlow: "row nowrap" }}>
<Typography noWrap display="block" variant="h6" color="textPrimary" style={{flexGrow: 1, flexShrink: 1}}>
PiPedal <span style={{ fontSize: "0.7em" }}>
{serverVersion
+ (this.model.serverVersion?.debug ? " (Debug)" : "")}
</span>
</Typography>
</div>
<Typography noWrap display="block" variant="body2" style={{ marginBottom: 12 }} >
Copyright &#169; 2022-2024 Robin Davies.
</Typography>
{this.model.isAndroidHosted() && (
<Typography noWrap display="block" variant="body2" style={{ marginBottom: 0 }} >
{this.model.getAndroidHostVersion()}
</Typography>
)}
{this.model.isAndroidHosted() && (
<Typography noWrap display="block" variant="body2" style={{ marginBottom: 12 }} >
Copyright &#169; 2022-2024 Robin Davies.
</Typography>
)}
<Divider />
<Typography noWrap display="block" variant="caption" >
ADDRESSES
</Typography>
<div style={{ marginBottom: 16 }}>
{
this.model.serverVersion?.webAddresses.map((address) =>
(
<Typography key={addressKey++} display="block" variant="body2" style={{ marginBottom: 0, marginLeft: 24 }} >
{address}
</Typography>
))
}
</div>
<Divider />
<Typography noWrap display="block" variant="caption" >
SERVER OS
</Typography>
<div style={{ marginBottom: 16 }}>
<Typography display="block" variant="body2" style={{ marginBottom: 0, marginLeft: 24 }} >
{this.model.serverVersion?.osVersion ?? ""}
</Typography>
</div>
</div><div>
<Divider />
<Typography display="block" variant="caption" >
LEGAL NOTICES
</Typography>
<div dangerouslySetInnerHTML={{ __html: this.state.openSourceNotices }} style={{ fontSize: "0.8em", maxWidth: 400 }}>
</div>
</div>
</div>
</div>
</DialogEx >
);
}
}
);
export default AboutDialog;
-9
View File
@@ -1,9 +0,0 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
File diff suppressed because it is too large Load Diff
-135
View File
@@ -1,135 +0,0 @@
// Copyright (c) 2022 Robin Davies
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import React from 'react';
import Button from '@mui/material/Button';
import DialogEx from './DialogEx';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import Typography from '@mui/material/Typography';
import ResizeResponsiveComponent from './ResizeResponsiveComponent';
import Divider from '@mui/material/Divider';
//import TextFieldEx from './TextFieldEx';
export interface ChannelBindingHelpDialogProps {
open: boolean,
onClose: () => void,
};
export interface ChannelBindingHelpDialogState {
fullScreen: boolean;
};
export default class ChannelBindingHelpDialog extends ResizeResponsiveComponent<ChannelBindingHelpDialogProps, ChannelBindingHelpDialogState> {
refText: React.RefObject<HTMLInputElement>;
constructor(props: ChannelBindingHelpDialogProps) {
super(props);
this.state = {
fullScreen: false
};
this.refText = React.createRef<HTMLInputElement>();
}
mounted: boolean = false;
onWindowSizeChanged(width: number, height: number): void
{
this.setState({fullScreen: height < 200})
}
componentDidMount()
{
super.componentDidMount();
this.mounted = true;
}
componentWillUnmount()
{
super.componentWillUnmount();
this.mounted = false;
}
componentDidUpdate()
{
}
render() {
let props = this.props;
let { open, onClose } = props;
const handleClose = () => {
onClose();
};
return (
<DialogEx tag="bindingHelp" open={open} fullWidth maxWidth="sm"
onClose={handleClose}
aria-labelledby="Rename-dialog-title"
style={{userSelect: "none"}}
fullwidth
onEnterKey={()=>{}}
>
<DialogContent style={{minHeight: 96}}>
<Typography variant="h5" style={{marginBottom: 8}}>
MIDI Control Binding Priority
</Typography>
<div style={{fontSize: "0.9em", lineHeight: "18pt" }}>
<p style={{lineHeight: "1.4em"}}>MIDI Channel Filters determine which MIDI messages get sent to a plugin that accepts MIDI messages. Note that the
MIDI Channel Filters do NOT affect system MIDI bindings or control bindings.
</p>
<p>
MIDI message processing occurs in the following order
</p>
<ul>
<li>If the message is a Program Change message, the message is first offered to any MIDI plugins in the currently loaded preset (Message Filters permitting).
The message is sent to each MIDI plugin in the current preset that wants it. If any MIDI plugin accepts the program change,
no futher processing occurs. Specifically, the program change will not change the currently selected PiPedal preset.
<br/>
</li>
<li>
If the message is a Program Change message, and no MIDI plugin has accepted the message, PiPedal selects the PiPedal preset that corresponds
to the requested program.
<br/>
</li>
<li>
The message is then checked to see if it has been bound to a Pipedal feature using the System Midi Bindings settings. If it has,
Pipedal processes the message, and it is not forwarded to MIDI plugins.
<br/>
</li>
<li>
Otherwise, the message is sent to each MIDI plugin in the currently loaded Pipedal preset (channel filters permitting).)
<br/>
</li>
</ul>
</div>
</DialogContent>
<Divider/>
<DialogActions style={{flexShrink: 1}}>
<Button onClick={handleClose} variant="dialogPrimary" >
OK
</Button>
</DialogActions>
</DialogEx>
);
}
}
-218
View File
@@ -1,218 +0,0 @@
// Copyright (c) 2022 Robin Davies
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import React from 'react';
import Dialog, {DialogProps} from '@mui/material/Dialog';
interface DialogExProps extends DialogProps {
tag: string;
fullwidth?: boolean;
onEnterKey: () => void;
}
interface DialogExState {
}
export interface IDialogStackable {
getTag: ()=> string;
isOpen: ()=> boolean;
onDialogStackClose(): void;
}
class DialogStackEntry {
constructor(dialog: IDialogStackable)
{
this.tag = dialog.getTag();
this.dialog = dialog;
}
tag: string;
dialog: IDialogStackable;
};
let dialogStack: DialogStackEntry[] = [];
export function popDialogStack(): void {
if (dialogStack.length !== 0)
{
dialogStack.splice(dialogStack.length-1,1);
}
}
export function pushDialogStack(dialog: IDialogStackable): void {
dialogStack.push(new DialogStackEntry(dialog));
}
export interface DialogStackState{
tag: String;
previousState: DialogStackState | null;
};
// Close all dialogs higher in the dialog stack than "tag".
export function removeDialogStackEntriesAbove(tag: string)
{
for (let i = dialogStack.length-1; i >= 0; --i)
{
let entry = dialogStack[i];
if (entry.dialog.getTag() === tag)
{
return;
}
popDialogStack();
if (entry.dialog.isOpen())
{
entry.dialog.onDialogStackClose();
}
}
}
class DialogEx extends React.Component<DialogExProps,DialogExState> implements IDialogStackable {
constructor(props: DialogExProps)
{
super(props);
this.state = {
};
this.handlePopState = this.handlePopState.bind(this);
}
mounted: boolean = false;
hasHooks: boolean = false;
stateWasPopped: boolean = false;
getTag() {
return this.props.tag;
}
isOpen(): boolean {
return this.props.open;
}
onDialogStackClose() {
this.props.onClose?.({},"backdropClick");
}
handlePopState(ev: PopStateEvent): any
{
let evTag: DialogStackState | null = ev.state as DialogStackState | null;
if (evTag && evTag.tag === this.props.tag) {
removeDialogStackEntriesAbove(this.props.tag);
if (!this.stateWasPopped)
{
this.stateWasPopped = true;
popDialogStack();
if (this.props.open) {
this.props.onClose?.(ev,"backdropClick");
}
}
window.history.replaceState(evTag.previousState,"",window.location.href);
window.removeEventListener("popstate",this.handlePopState);
if (window.location.hash === "#menu") // The menu popstate is next?
{
window.history.back(); // then clear off the menu popstate too.
}
ev.stopPropagation();
}
}
updateHooks() : void {
let wantHooks = this.mounted && this.props.open;
if (wantHooks !== this.hasHooks)
{
this.hasHooks = wantHooks;
if (this.hasHooks)
{
this.stateWasPopped = false;
window.addEventListener("popstate",this.handlePopState);
pushDialogStack(this);
let dialogStackState: DialogStackState = {tag: this.props.tag,previousState: window.history.state as DialogStackState | null};
window.history.replaceState(dialogStackState,"",window.location.href);
window.history.pushState(
null,
"",
"#" + this.props.tag
);
} else {
if (!this.stateWasPopped)
{
window.history.back();
}
}
}
}
componentDidMount()
{
super.componentDidMount?.();
this.mounted = true;
this.updateHooks();
}
componentWillUnmount()
{
super.componentWillUnmount?.();
this.mounted = false;
this.updateHooks();
}
componentDidUpdate()
{
this.updateHooks();
}
myOnClose(event:{}, reason: "backdropClick" | "escapeKeyDown")
{
if (this.props.onClose) this.props.onClose(event,reason);
}
onEnterKey() {
if (this.props.onEnterKey)
{
this.props.onEnterKey();
}
}
onKeyDown(evt: React.KeyboardEvent<HTMLDivElement>)
{
if (evt.key === 'Enter')
{
this.onEnterKey();
}
evt.stopPropagation();
}
render() {
let { tag,onClose,...extra} = this.props;
return (
<Dialog fullWidth={this.props.fullWidth??false}
maxWidth={this.props.fullWidth ? false: undefined} {...extra}
onClose={(event,reason)=>{ this.myOnClose(event,reason);}}
onKeyDown={(evt)=>{ this.onKeyDown(evt); }}
>
{this.props.children}
</Dialog>
);
}
};
export default DialogEx;
-265
View File
@@ -1,265 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2023 Robin E. R. Davies
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React, { Component, SyntheticEvent } from 'react';
import { Theme } from '@mui/material/styles';
import { WithStyles } from '@mui/styles';
import createStyles from '@mui/styles/createStyles';
import withStyles from '@mui/styles/withStyles';
import { UiFileProperty } from './Lv2Plugin';
import Typography from '@mui/material/Typography';
import { PiPedalModel, PiPedalModelFactory, ListenHandle,State} from './PiPedalModel';
import ButtonBase from '@mui/material/ButtonBase'
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
import {PedalboardItem} from './Pedalboard';
import {isDarkMode} from './DarkMode';
import Tooltip from "@mui/material/Tooltip"
export const StandardItemSize = { width: 80, height: 140 }
const styles = (theme: Theme) => createStyles({
frame: {
position: "relative",
margin: "12px"
},
switchTrack: {
height: '100%',
width: '100%',
borderRadius: 14 / 2,
zIndex: -1,
transition: theme.transitions.create(['opacity', 'background-color'], {
duration: theme.transitions.duration.shortest
}),
backgroundColor: theme.palette.secondary.main,
opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
},
controlFrame: {
display: "flex", flexDirection: "column", alignItems: "start", justifyContent: "space-between", height: 116
},
displayValue: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 4,
textAlign: "center",
background: theme.mainBackground,
color: theme.palette.text.secondary,
// zIndex: -1,
},
titleSection: {
flex: "0 0 auto", alignSelf:"stretch", marginBottom: 8, marginLeft: 8, marginRight: 0
},
midSection: {
flex: "1 1 1", display: "flex",flexFlow: "column nowrap",alignContent: "center",justifyContent: "center"
},
editSection: {
flex: "0 0 0", position: "relative", width: 60, height: 28,minHeight: 28
}
});
export interface FilePropertyControlProps extends WithStyles<typeof styles> {
fileProperty: UiFileProperty;
pedalboardItem: PedalboardItem;
onFileClick: (fileProperty: UiFileProperty, value: string) => void;
theme: Theme;
}
type FilePropertyControlState = {
error: boolean;
hasValue: boolean;
value: string;
};
const FilePropertyControl =
withStyles(styles, { withTheme: true })(
class extends Component<FilePropertyControlProps, FilePropertyControlState>
{
model: PiPedalModel;
constructor(props: FilePropertyControlProps) {
super(props);
this.state = {
error: false,
hasValue: false,
value: "",
};
this.model = PiPedalModelFactory.getInstance();
this.onStateChanged = this.onStateChanged.bind(this);
}
onStateChanged(state: State) {
if (this.mounted)
{
if (state === State.Ready) {
this.subscribeToPatchProperty();
}
}
}
private propertyGetHandle?: ListenHandle;
monitorPropertyHandle?: ListenHandle;
subscribeToPatchProperty() {
// this.propertyGetHandle = this.model.listenForAtomOutput(this.props.instanceId,(instanceId,atomOutput)=>{
// // PARSE THE OBJECT!
// // this.setState({value: atomOutput?.value as string});
// });
this.unsubscribeToPatchProperty();
this.monitorPropertyHandle = this.model.monitorPatchProperty(this.props.pedalboardItem.instanceId,
this.props.fileProperty.patchProperty,
(instanceId,property,propertyValue) => {
if (propertyValue.otype_ === "Path")
{
this.setState({value: propertyValue.value as string,hasValue: true});
}
}
);
}
unsubscribeToPatchProperty() {
if (this.monitorPropertyHandle !== undefined)
{
this.model.cancelMonitorPatchProperty(this.monitorPropertyHandle);
this.monitorPropertyHandle = undefined;
}
}
private mounted: boolean = false;
componentDidMount() {
this.model.state.addOnChangedHandler(this.onStateChanged);
this.mounted = true;
this.subscribeToPatchProperty();
}
componentWillUnmount() {
this.unsubscribeToPatchProperty();
this.mounted = false;
this.model.state.removeOnChangedHandler(this.onStateChanged);
}
componentDidUpdate(prevProps: Readonly<FilePropertyControlProps>, prevState: Readonly<FilePropertyControlState>, snapshot?: any): void {
if (prevProps.fileProperty.patchProperty !== this.props.fileProperty.patchProperty
|| prevProps.pedalboardItem.instanceId !== this.props.pedalboardItem.instanceId
|| prevProps.pedalboardItem.stateUpdateCount !== this.props.pedalboardItem.stateUpdateCount
) {
this.unsubscribeToPatchProperty();
this.subscribeToPatchProperty();
}
}
inputChanged: boolean = false;
onDrag(e: SyntheticEvent) {
e.preventDefault();
}
onFileClick() {
this.props.onFileClick(this.props.fileProperty, this.state.value);
}
private fileNameOnly(path: string): string {
let slashPos = path.lastIndexOf('/');
if (slashPos < 0) {
slashPos = 0;
} else {
++slashPos;
}
let extPos = path.lastIndexOf('.');
if (extPos < 0 || extPos < slashPos) {
extPos = path.length;
}
return path.substring(slashPos, extPos);
}
render() {
//let classes = this.props.classes;
let fileProperty = this.props.fileProperty;
let classes = this.props.classes;
let value = "\u00A0";
if (this.state.hasValue)
{
if (this.state.value.length === 0)
{
value = "<none>";
} else {
value = this.fileNameOnly(this.state.value);
}
}
let item_width = 264;
return (
<div className={classes.controlFrame}
style={{ width: item_width }}>
{/* TITLE SECTION */}
<div className={classes.titleSection}
>
<Tooltip title={fileProperty.label} placement="top-start" arrow
enterDelay={1000} enterNextDelay={1000}
>
<Typography variant="caption" display="block" noWrap style={{
width: "100%",
textAlign: "start"
}}> {fileProperty.label}</Typography>
</Tooltip>
</div>
{/* CONTROL SECTION */}
<div className={classes.midSection} style={{ width: "100%", paddingLeft: 8 }}>
<ButtonBase style={{ width: "100%", borderRadius: "4px 4px 0px 0px", overflow: "hidden" }} onClick={() => { this.onFileClick() }} >
<div style={{ width: "100%", background:
isDarkMode()? "rgba(255,255,255,0.03)": "rgba(0,0,0,0.07)",
borderRadius: "4px 4px 0px 0px" }}>
<div style={{ display: "flex", alignItems: "center", flexFlow: "row nowrap" }}>
<Typography noWrap={true} style={{ flex: "1 1 100%", textAlign: "start", verticalAlign: "center", paddingTop: 4, paddingBottom: 4, paddingLeft: 4 }}
variant='caption'
>{value}</Typography>
<MoreHorizIcon style={{ flex: "0 0 auto", width: "16px", height: "16px", verticalAlign: "center", opacity: 0.5, marginRight: 4 }} />
</div>
<div style={{ height: "1px", width: "100%", background: this.props.theme.palette.text.secondary }}>&nbsp;</div>
</div>
</ButtonBase>
</div>
{/* LABEL/EDIT SECTION*/}
<div className={classes.editSection} >
</div>
</div >
);
}
}
);
export default FilePropertyControl;
File diff suppressed because it is too large Load Diff
-362
View File
@@ -1,362 +0,0 @@
// Copyright (c) 2024 Robin Davies
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import { WithStyles } from '@mui/styles';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import CloseIcon from '@mui/icons-material/Close';
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import CssBaseline from '@mui/material/CssBaseline';
import createStyles from '@mui/styles/createStyles';
import withStyles from '@mui/styles/withStyles';
import IconButton from '@mui/material/IconButton';
import FullscreenIcon from '@mui/icons-material/Fullscreen';
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
import ResizeResponsiveComponent from './ResizeResponsiveComponent';
import { PiPedalModelFactory, PiPedalModel, State, ZoomedControlInfo } from './PiPedalModel';
import ZoomedUiControl from './ZoomedUiControl'
import MainPage from './MainPage';
import JackStatusView from './JackStatusView';
import { Theme } from '@mui/material/styles';
import { isDarkMode } from './DarkMode';
import Typography from '@mui/material/Typography';
import TextField from '@mui/material/TextField';
import { Snapshot } from './Pedalboard';
import ColorDropdownButton, { DropdownAlignment } from './ColorDropdownButton';
import { getBackgroundColor } from './MaterialColors';
const selectColor = isDarkMode() ? "#888" : "#FFFFFF";
const appStyles = (theme: Theme) => createStyles({
"&": { // :root
colorScheme: (isDarkMode() ? "dark" : "light")
},
mainFrame: {
overflow: "hidden",
display: "flex",
flexFlow: "column",
marginTop: 8,
flex: "1 1 100%"
},
heroContent: {
backgroundColor: theme.mainBackground,
position: "relative",
height: "100%",
width: "100%"
},
shadowCatcher: {
backgroundColor: theme.mainBackground
},
select: { // fu fu fu.Overrides for white selector on dark background.
'&:before': {
borderColor: selectColor,
},
'&:after': {
borderColor: selectColor,
},
'&:hover:not(.Mui-disabled):before': {
borderColor: selectColor,
}
},
select_icon: {
fill: selectColor,
}
});
function supportsFullScreen(): boolean {
let doc: any = window.document;
let docEl: any = doc.documentElement;
var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
return (!!requestFullScreen);
}
function setFullScreen(value: boolean) {
let doc: any = window.document;
let docEl: any = doc.documentElement;
var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen;
if (!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) {
requestFullScreen.call(docEl);
}
else {
cancelFullScreen.call(doc);
}
}
type SnapshotEditorState = {
zoomedControlInfo: ZoomedControlInfo | undefined;
zoomedControlOpen: boolean;
canFullScreen: boolean;
isFullScreen: boolean;
isDebug: boolean;
collapseLabel: boolean;
showStatusMonitor: boolean;
name: string,
color: string
};
interface SnapshotEditorProps extends WithStyles<typeof appStyles> {
onClose: () => void;
onOk: (snapshotIndex: number, name: string, color: string, newSnapshots: (Snapshot | null)[]) => void;
snapshotIndex: number;
}
const SnapshotEditor = withStyles(appStyles)(class extends ResizeResponsiveComponent<SnapshotEditorProps, SnapshotEditorState> {
// Before the component mounts, we initialise our state
model_: PiPedalModel;
getCollapseLabel() {
return this.windowSize.width < 500;
}
constructor(props: SnapshotEditorProps) {
super(props);
this.model_ = PiPedalModelFactory.getInstance();
this.model_.zoomedUiControl.addOnChangedHandler(
() => {
this.setState({
zoomedControlOpen: this.model_.zoomedUiControl.get() !== undefined,
zoomedControlInfo: this.model_.zoomedUiControl.get()
});
}
);
let snapshot = this.model_.pedalboard.get().snapshots[this.props.snapshotIndex] ?? new Snapshot();
this.state = {
zoomedControlOpen: false,
zoomedControlInfo: this.model_.zoomedUiControl.get(),
canFullScreen: supportsFullScreen() && !this.model_.isAndroidHosted(),
isFullScreen: !!document.fullscreenElement,
showStatusMonitor: this.model_.showStatusMonitor.get(),
isDebug: true,
name: snapshot.name,
color: snapshot.color,
collapseLabel: this.getCollapseLabel()
};
this.showStatusMonitorHandler = this.showStatusMonitorHandler.bind(this);
}
showStatusMonitorHandler() {
this.setState({
showStatusMonitor: this.model_.showStatusMonitor.get()
});
}
toggleFullScreen(): void {
setFullScreen(this.state.isFullScreen);
this.setState({ isFullScreen: !this.state.isFullScreen });
}
componentDidMount() {
super.componentDidMount();
this.model_.showStatusMonitor.addOnChangedHandler(this.showStatusMonitorHandler);
}
updateOverscroll(): void {
if (this.model_.serverVersion) {
// no pull-down refresh on android devices once we're ready (unless we're debug)
let preventOverscroll =
this.model_.state.get() === State.Ready
&& !this.model_.debug;
let overscrollBehavior = preventOverscroll ? "none" : "auto";
document.body.style.overscrollBehavior = overscrollBehavior;
}
}
componentDidUpdate() {
}
componentWillUnmount() {
super.componentWillUnmount();
this.model_.banks.removeOnChangedHandler(this.showStatusMonitorHandler);
}
onWindowSizeChanged(width: number, height: number): void {
super.onWindowSizeChanged(width, height);
this.setState({
collapseLabel: this.getCollapseLabel()
});
}
handleOk() {
let currentPedalboard = this.model_.pedalboard.get();
let selectedSnapshot = this.props.snapshotIndex;
let currentSnapshot: Snapshot | null = currentPedalboard.snapshots[selectedSnapshot];
if (!currentSnapshot)
{
this.props.onClose();
return;
}
let changed = this.state.name !== currentSnapshot.name
|| this.state.color !== currentSnapshot.color
|| currentSnapshot.isModified;
if (!changed)
{
this.props.onClose();
return;
}
let newSnapshots = Snapshot.cloneSnapshots(currentPedalboard.snapshots);
let newSnapshot = this.model_.pedalboard.get().makeSnapshot();
newSnapshot.name = this.state.name;
newSnapshot.color = this.state.color;
newSnapshots[selectedSnapshot] = newSnapshot;
this.model_.setSnapshots(newSnapshots, selectedSnapshot);
this.props.onOk(selectedSnapshot, this.state.name, this.state.color, newSnapshots);
}
render() {
const { classes } = this.props;
return (
<div
className={classes.shadowCatcher}
style={{
position: "absolute", top: 0, left: 0, right: 0, bottom: 0,
colorScheme: isDarkMode() ? "dark" : "light", // affects scrollbar color
minHeight: 345, minWidth: 390,
userSelect: "none",
display: "flex", flexDirection: "column", flexWrap: "nowrap",
overscrollBehavior: this.state.isDebug ? "auto" : "none"
}}
onContextMenu={(e) => {
if (!this.model_.debug) {
e.preventDefault(); e.stopPropagation();
}
}}
>
<CssBaseline />
<AppBar position="static" sx={{ bgcolor: isDarkMode() ? getBackgroundColor("purple") : "#200040" }} >
<Toolbar variant="dense" >
<IconButton
edge="start"
aria-label="menu"
color="inherit"
onClick={() => { this.handleOk(); }}
size="large">
<ArrowBackIcon />
</IconButton>
{!this.state.collapseLabel && (
<Typography style={{ flex: "0 1 auto", opacity: 0.66 }}
variant="body1" noWrap
>
{'Snapshot ' + (this.props.snapshotIndex + 1)}
</Typography>
)}
<div style={{ flex: "1 1 auto", display: "flex", flexFlow: "column nowrap", marginRight: 8 }}>
<TextField
sx={{
input: { color: 'white' },
'& .MuiInput-underline:before': { borderBottomColor: '#FFFFFFC0' },
'& .MuiInput-underline:hover:before': { borderBottomColor: '#FFFFFFE0' },
'& .MuiInput-underline:after': { borderBottomColor: '#FFFFFF' }
}}
variant="standard"
style={{ flex: "1 1 auto", marginLeft: 16, maxWidth: 500, color: "white" }}
value={this.state.name}
onChange={(ev) => {
this.setState({ name: ev.target.value });
}}
/>
</div>
<ColorDropdownButton
currentColor={this.state.color}
dropdownAlignment={DropdownAlignment.SW}
onColorChange={(newColor) => {
this.setState({ color: newColor });
}} />
{this.state.canFullScreen &&
<IconButton
aria-label="full-screen"
onClick={() => { this.toggleFullScreen(); }}
color="inherit"
size="medium">
{this.state.isFullScreen ? (
<FullscreenExitIcon style={{ opacity: 0.75 }} />
) : (
<FullscreenIcon style={{ opacity: 0.75 }} />
)}
</IconButton>
}
<IconButton
aria-label="cancel"
onClick={() => { this.props.onClose(); }}
color="inherit"
size="medium">
<CloseIcon />
</IconButton>
</Toolbar>
</AppBar>
<main className={classes.mainFrame} >
<div style={{
overflow: "hidden",
flex: "1 1 auto"
}} >
<div className={classes.heroContent}>
<MainPage hasTinyToolBar={false} enableStructureEditing={false} />
</div>
</div>
</main>
<ZoomedUiControl
dialogOpen={this.state.zoomedControlOpen}
controlInfo={this.state.zoomedControlInfo}
onDialogClose={() => { this.setState({ zoomedControlOpen: false }); }}
onDialogClosed={() => { this.model_.zoomedUiControl.set(undefined); }
}
/>
{ this.state.showStatusMonitor && (<JackStatusView />)}
</div >
);
}
}
);
export default SnapshotEditor;
-60
View File
@@ -1,60 +0,0 @@
// Copyright (c) 2022 Robin Davies
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import React from 'react';
import { Theme } from '@mui/material/styles';
import { WithStyles } from '@mui/styles';
import withStyles from '@mui/styles/withStyles';
import createStyles from '@mui/styles/createStyles';
const styles = (theme: Theme) => createStyles({
});
interface XxxProps extends WithStyles<typeof styles> {
theme: Theme,
}
interface XxxState {
}
const Xxx = withStyles(styles, { withTheme: true })(
class extends React.Component<XxxProps, XxxState> {
constructor(props: XxxProps)
{
super(props);
this.state = {
};
}
render() {
return (
<div/>
);
}
}
);
export default Xxx;
-13
View File
@@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
-17
View File
@@ -1,17 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
-15
View File
@@ -1,15 +0,0 @@
import { ReportHandler } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;
-5
View File
@@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
-1
View File
@@ -1 +0,0 @@
npm start
-178
View File
@@ -1,178 +0,0 @@
src/PiPedalError.tsx
src/OldDeleteIcon.tsx
src/MaterialColors.tsx
src/Pedalboard.tsx
src/SystemMidiBindingView.tsx
src/GovernorSettings.tsx
src/ObservableProperty.tsx
src/SnapshotEditor.tsx
src/SelectMidiChannelsDialog.tsx
src/AlsaMidiDeviceInfo.tsx
src/WifiDirectConfigSettings.tsx
src/WifiConfigSettings.tsx
src/SnapshotButton.tsx
src/WindowScale.tsx
src/JsonAtom.tsx
src/PiPedalSocket.tsx
src/TemporaryDrawer.tsx
src/DarkMode.tsx
src/MidiBindingsDialog.tsx
src/MidiBinding.tsx
src/SnapshotDialog.tsx
src/SettingsDialog.tsx
src/PedalboardView.tsx
src/reportWebVitals.ts
src/OptionsDialog.tsx
src/SelectChannelsDialog.tsx
src/PluginPresetSelector.tsx
src/VuMeter.tsx
src/ToobFrequencyResponseView.tsx
src/SystemMidiBindingsDialog.tsx
src/FullScreenIME.tsx
src/App.tsx
src/ToobInputStageView.tsx
src/XxxSnippet.tsx
src/JackServerSettings.tsx
src/ToobWaveShapeView.tsx
src/ToobPowerStage2View.tsx
src/PluginPreset.tsx
src/logo.svg
src/Banks.tsx
src/NoChangePassword.tsx
src/SearchFilter.tsx
src/FilePropertyDirectorySelectDialog.tsx
src/GxTunerView.tsx
src/UpdateDialog.tsx
src/svg/file_download_black_24dp.svg
src/svg/fx_filter.svg
src/svg/fx_pitch.svg
src/svg/fx_distortion.svg
src/svg/fx_split_b.svg
src/svg/fx_chorus.svg
src/svg/fx_limiter.svg
src/svg/fx_phaser.svg
src/svg/snapshot_0.svg
src/svg/snapshot_3.svg
src/svg/file_upload_black_24dp.svg
src/svg/ic_bank.svg
src/svg/fx_function.svg
src/svg/fx_dial.svg
src/svg/ic_settings.svg
src/svg/fx_split_a.svg
src/svg/fx_empty.svg
src/svg/fx_amplifier.svg
src/svg/fx_spectral.svg
src/svg/fx_eq.svg
src/svg/ic_edit_banks.svg
src/svg/ic_help_outline.svg
src/svg/ic_save_bank_as.svg
src/svg/ic_pluginpreset2.svg
src/svg/fx_flanger2.svg
src/svg/snapshot_6.svg
src/svg/fx_lr.svg
src/svg/fx_generator.svg
src/svg/snapshot_1.svg
src/svg/fx_reverb.svg
src/svg/fx_plugin.svg
src/svg/snapshot_4.svg
src/svg/drive_file_rename_outline_black_24dp.svg
src/svg/snapshot_2.svg
src/svg/fx_instrument.svg
src/svg/fx_modulator.svg
src/svg/fx_error.svg
src/svg/fx_simulator.svg
src/svg/fx_filter_hp.svg
src/svg/fx_compressor.svg
src/svg/fx_gate.svg
src/svg/fx_terminal.svg
src/svg/ic_midi.svg
src/svg/fx_oscillator.svg
src/svg/fx_analyzer.svg
src/svg/fx_flanger.svg
src/svg/old_delete_outline_24dp.svg
src/svg/ic_presets.svg
src/svg/fx_delay.svg
src/svg/fx_parametric_eq.svg
src/svg/fx_spatial.svg
src/svg/fx_converter.svg
src/svg/fx_constant.svg
src/svg/snapshot_5.svg
src/svg/ic_pluginpreset.svg
src/svg/fx_mixer.svg
src/svg/fx_utility.svg
src/Updater.tsx
src/UploadPresetDialog.tsx
src/RadioSelectDialog.tsx
src/setupTests.ts
src/ToobCabSimView.tsx
src/RenameDialog.tsx
src/SplitControlView.tsx
src/SelectHoverBackground.tsx
src/IControlViewFactory.tsx
src/OkCancelDialog.tsx
src/BankDialog.tsx
src/PluginPresetsDialog.tsx
src/App.test.tsx
src/ControlViewFactory.tsx
src/DraggableGrid.tsx
src/ZoomedDial.tsx
src/index.css
src/Pedal.tsx
src/Draggable.tsx
src/PluginIcon.tsx
src/react-app-env.d.ts
src/TextFieldEx.tsx
src/FilePropertyDialog.tsx
src/FilePropertyDirectoryTree.tsx
src/StringBuilder.tsx
src/MainPage.tsx
src/PluginInfoDialog.tsx
src/AppThemed.tsx
src/Lv2Plugin.tsx
src/ToobSpectrumResponseView.tsx
src/PerformanceView.tsx
src/JackServerSettingsDialog.tsx
src/Utility.tsx
src/JackStatusView.tsx
src/ToobSpectrumAnalyzerView.tsx
src/SvgPathBuilder.tsx
src/PresetSelector.tsx
src/PresetDialog.tsx
src/WifiChannel.tsx
src/AboutDialog.tsx
src/GxTunerControl.tsx
src/VirtualKeyboardHandler.tsx
src/PluginControl.tsx
src/LoadPluginDialog.tsx
src/ZoomedUiControl.tsx
src/AlsaDeviceInfo.tsx
src/ToobToneStackView.tsx
src/UploadFileDialog.tsx
src/PluginOutputControl.tsx
src/SelectThemeDialog.tsx
src/Rect.tsx
src/AppThemed.css
src/ColorDropdownButton.tsx
src/AndroidHost.tsx
src/SnapshotPanel.tsx
src/ToobMLView.tsx
src/WifiConfigDialog.tsx
src/Rectangle.tsx
src/SnapshotColors.tsx
src/PiPedalModel.tsx
src/ObservableEvent.tsx
src/JackHostStatus.tsx
src/index.tsx
src/FilePropertyControl.tsx
src/WifiDirectConfigDialog.tsx
src/MidiBindingView.tsx
src/PluginControlView.tsx
src/SplitUiControls.tsx
src/PluginClass.tsx
src/DialogEx.tsx
src/Jack.tsx
src/ResizeResponsiveComponent.tsx
src/NumericInput.tsx
src/SnapshotPropertiesDialog.tsx
src/SearchControl.tsx
src/Units.tsx
-27
View File
@@ -1,27 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext",
"es2020"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}
+24
View File
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+312
View File
@@ -0,0 +1,312 @@
find_program(NPM_COMMAND npm)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(BUILD_REACT "echo")
set(BUILD_REACT_ARGS Skipping react debug build)
else()
set(BUILD_REACT npm)
set(BUILD_REACT_ARGS run build)
endif()
set (BUILD_DIRECTORY ${PROJECT_SOURCE_DIR}/dist)
add_custom_command(
OUTPUT ${BUILD_DIRECTORY}/index.html
COMMAND ${BUILD_REACT}
ARGS ${BUILD_REACT_ARGS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vite
DEPENDS
# find public src *.json *.ts -type f >/tmp/tmp.txt
public/vite.svg
public/robots.txt
public/css/roboto.css
public/iso_codes.json
public/serve.json
public/var/current_pedalboard.json
public/var/config.json
public/var/uiplugins.json
public/var/plugin_classes.json
public/logo512.png
public/img/fx_delay.svg
public/img/fx_error.svg
public/img/fx_parametric_eq.svg
public/img/fx_simulator.svg
public/img/fx_lr.svg
public/img/fx_plugin.svg
public/img/fx_flanger2.svg
public/img/fx_phaser.svg
public/img/ic_bank.svg
public/img/ic_drawer.svg
public/img/Pi-Logo-3.png
public/img/fx_constant.svg
public/img/ic_drawer_2.png
public/img/Pi-Logo-3.svg
public/img/fx_split_a.svg
public/img/fx_chorus.svg
public/img/fx_split_b.svg
public/img/fx_terminal.svg
public/img/fx_spectral.svg
public/img/settings_black_24dp.svg
public/img/fx_analyzer.svg
public/img/fx_oscillator.svg
public/img/fx_generator.svg
public/img/edit_banks.svg
public/img/delete_outline_black_24dp.svg
public/img/old_delete_outline_white_24dp.svg
public/img/fx_converter.svg
public/img/settings_white_24dp.svg
public/img/ic_drawer_2.svg
public/img/vst.png
public/img/edit_banks_white.svg
public/img/fx_pitch.svg
public/img/fx_spatial.svg
public/img/old_delete_outline_black_24dp.svg
public/img/fx_limiter.svg
public/img/vst.svg
public/img/ic_navigate_before.svg
public/img/cc-by.png
public/img/fx_gate.svg
public/img/ic_presets.svg
public/img/fx_modulator.svg
public/img/fx_filter_hp.svg
public/img/VST_Logo_Steinberg.png
public/img/fx_dial.svg
public/img/VST_Logo_Steinberg.ico
public/img/cx_mono.svg
public/img/ic_navigate_next.svg
public/img/fx_instrument.svg
public/img/fx_flanger.svg
public/img/fx_empty.svg
public/img/fx_mixer.svg
public/img/cx_stereo.svg
public/img/ic_logo.svg
public/img/fx_compressor.svg
public/img/fx_amplifier.svg
public/img/fx_filter.svg
public/img/fx_eq.svg
public/img/fx_utility.svg
public/img/fx_function.svg
public/img/fx_reverb.svg
public/img/fx_distortion.svg
public/img/ic_presets_white.svg
public/manifest.json
public/logo192.png
public/sample_lv2_plugins.json
public/fonts/Roboto-Thin.woff2
public/fonts/LICENSE.txt
public/fonts/Roboto-Italic.woff2
public/fonts/Roboto-BoldItalic.woff2
public/fonts/Roboto-Black.woff2
public/fonts/Roboto-ThinItalic.woff2
public/fonts/Roboto-BlackItalic.woff2
public/fonts/Roboto-MediumItalic.woff2
public/fonts/Roboto-Medium.woff2
public/fonts/Roboto-LightItalic.woff2
public/fonts/Roboto-Regular.woff2
public/fonts/Roboto-Bold.woff2
public/fonts/Roboto-Light.woff2
public/favicon.ico
public/index.html
src/main.tsx
src/index.css
src/assets/react.svg
src/vite-env.d.ts
src/App.tsx
src/pipedal/MainPage.tsx
src/pipedal/ColorDropdownButton.tsx
src/pipedal/AppThemed.tsx
src/pipedal/ModFileTypes.tsx
src/pipedal/ChannelBindingsHelpDialog.tsx
src/pipedal/SplitUiControls.tsx
src/pipedal/RadioSelectDialog.tsx
src/pipedal/Pedal.tsx
src/pipedal/WindowScale.tsx
src/pipedal/MidiChannelBindingDialog.tsx
src/pipedal/BankDialog.tsx
src/pipedal/IControlViewFactory.tsx
src/pipedal/Pedalboard.tsx
src/pipedal/Lv2Plugin.tsx
src/pipedal/WifiConfigDialog.tsx
src/pipedal/GxTunerControl.tsx
src/pipedal/ControlTooltip.tsx
src/pipedal/StringBuilder.tsx
src/pipedal/UploadFileDialog.tsx
src/pipedal/FilePropertyDirectorySelectDialog.tsx
src/pipedal/ObservableProperty.tsx
src/pipedal/OldDeleteIcon.tsx
src/pipedal/OkCancelDialog.tsx
src/pipedal/PluginControl.tsx
src/pipedal/WifiDirectConfigSettings.tsx
src/pipedal/FullScreenIME.tsx
src/pipedal/WifiConfigSettings.tsx
src/pipedal/JackServerSettingsDialog.tsx
src/pipedal/Utility.tsx
src/pipedal/SelectChannelsDialog.tsx
src/pipedal/AlsaDeviceInfo.tsx
src/pipedal/LoadPluginDialog.tsx
src/pipedal/PiPedalModel.tsx
src/pipedal/SelectThemeDialog.tsx
src/pipedal/ResizeResponsiveComponent.tsx
src/pipedal/FilePropertyControl.tsx
src/pipedal/NumericInput.tsx
src/pipedal/MidiBinding.tsx
src/pipedal/GovernorSettings.tsx
src/pipedal/SnapshotPanel.tsx
src/pipedal/PedalboardView.tsx
src/pipedal/ToobSpectrumAnalyzerView.tsx
src/pipedal/ToobMLView.tsx
src/pipedal/MaterialColors.tsx
src/pipedal/ZoomedUiControl.tsx
src/pipedal/TemporaryDrawer.tsx
src/pipedal/WifiChannel.tsx
src/pipedal/MidiChannelBinding.tsx
src/pipedal/SystemMidiBindingView.tsx
src/pipedal/SelectMidiChannelsDialog.tsx
src/pipedal/Banks.tsx
src/pipedal/SelectHoverBackground.tsx
src/pipedal/ToobWaveShapeView.tsx
src/pipedal/PluginPresetSelector.tsx
src/pipedal/PluginOutputControl.tsx
src/pipedal/Rect.tsx
src/pipedal/JackStatusView.tsx
src/pipedal/JackHostStatus.tsx
src/pipedal/PluginClass.tsx
src/pipedal/VuMeter.tsx
src/pipedal/svg/fx_delay.svg
src/pipedal/svg/fx_error.svg
src/pipedal/svg/old_delete_outline_24dp.svg
src/pipedal/svg/drive_file_rename_outline_black_24dp.svg
src/pipedal/svg/fx_parametric_eq.svg
src/pipedal/svg/fx_simulator.svg
src/pipedal/svg/fx_lr.svg
src/pipedal/svg/fx_plugin.svg
src/pipedal/svg/fx_flanger2.svg
src/pipedal/svg/fx_phaser.svg
src/pipedal/svg/ic_bank.svg
src/pipedal/svg/fx_constant.svg
src/pipedal/svg/snapshot_3.svg
src/pipedal/svg/snapshot_0.svg
src/pipedal/svg/fx_split_a.svg
src/pipedal/svg/fx_chorus.svg
src/pipedal/svg/fx_split_b.svg
src/pipedal/svg/fx_terminal.svg
src/pipedal/svg/ic_save_bank_as.svg
src/pipedal/svg/fx_spectral.svg
src/pipedal/svg/ic_settings.svg
src/pipedal/svg/ic_pluginpreset2.svg
src/pipedal/svg/fx_analyzer.svg
src/pipedal/svg/fx_oscillator.svg
src/pipedal/svg/fx_generator.svg
src/pipedal/svg/snapshot_2.svg
src/pipedal/svg/fx_converter.svg
src/pipedal/svg/ic_midi.svg
src/pipedal/svg/fx_pitch.svg
src/pipedal/svg/fx_spatial.svg
src/pipedal/svg/fx_limiter.svg
src/pipedal/svg/fx_gate.svg
src/pipedal/svg/ic_presets.svg
src/pipedal/svg/snapshot_5.svg
src/pipedal/svg/fx_modulator.svg
src/pipedal/svg/snapshot_6.svg
src/pipedal/svg/fx_filter_hp.svg
src/pipedal/svg/fx_dial.svg
src/pipedal/svg/ic_pluginpreset.svg
src/pipedal/svg/fx_instrument.svg
src/pipedal/svg/fx_flanger.svg
src/pipedal/svg/file_download_black_24dp.svg
src/pipedal/svg/snapshot_1.svg
src/pipedal/svg/fx_empty.svg
src/pipedal/svg/fx_mixer.svg
src/pipedal/svg/ic_edit_banks.svg
src/pipedal/svg/file_upload_black_24dp.svg
src/pipedal/svg/fx_compressor.svg
src/pipedal/svg/fx_amplifier.svg
src/pipedal/svg/fx_filter.svg
src/pipedal/svg/fx_eq.svg
src/pipedal/svg/fx_utility.svg
src/pipedal/svg/fx_function.svg
src/pipedal/svg/snapshot_4.svg
src/pipedal/svg/fx_reverb.svg
src/pipedal/svg/fx_distortion.svg
src/pipedal/svg/ic_help_outline.svg
src/pipedal/AppThemed.css
src/pipedal/AboutDialog.tsx
src/pipedal/SettingsDialog.tsx
src/pipedal/PluginControlView.tsx
src/pipedal/VirtualKeyboardHandler.tsx
src/pipedal/react-app-env.d.ts
src/pipedal/DialogEx.tsx
src/pipedal/ToobInputStageView.tsx
src/pipedal/UpdateDialog.tsx
src/pipedal/UploadPresetDialog.tsx
src/pipedal/SnapshotButton.tsx
src/pipedal/GxTunerView.tsx
src/pipedal/SnapshotColors.tsx
src/pipedal/MidiChannelBindingControl.tsx
src/pipedal/DarkMode.tsx
src/pipedal/PluginInfoDialog.tsx
src/pipedal/ToobCabSimView.tsx
src/pipedal/Jack.tsx
src/pipedal/SnapshotEditor.tsx
src/pipedal/ControlViewFactory.tsx
src/pipedal/MidiBindingsDialog.tsx
src/pipedal/SplitControlView.tsx
src/pipedal/PiPedalError.tsx
src/pipedal/XxxSnippet.tsx
src/pipedal/SearchControl.tsx
src/pipedal/PluginPreset.tsx
src/pipedal/AlsaMidiDeviceInfo.tsx
src/pipedal/PiPedalSocket.tsx
src/pipedal/NoChangePassword.tsx
src/pipedal/App.tsx
src/pipedal/ObservableEvent.tsx
src/pipedal/JackServerSettings.tsx
src/pipedal/SnapshotPropertiesDialog.tsx
src/pipedal/TextFieldEx.tsx
src/pipedal/FilePropertyDialog.tsx
src/pipedal/PresetDialog.tsx
src/pipedal/SearchFilter.tsx
src/pipedal/Units.tsx
src/pipedal/AndroidHost.tsx
src/pipedal/ToobPowerStage2View.tsx
src/pipedal/Rectangle.tsx
src/pipedal/PluginPresetsDialog.tsx
src/pipedal/FilePropertyDirectoryTree.tsx
src/pipedal/RenameDialog.tsx
src/pipedal/PerformanceView.tsx
src/pipedal/ToobFrequencyResponseView.tsx
src/pipedal/MidiBindingView.tsx
src/pipedal/SnapshotDialog.tsx
src/pipedal/PluginIcon.tsx
src/pipedal/JsonAtom.tsx
src/pipedal/ToobToneStackView.tsx
src/pipedal/logo.svg
src/pipedal/ToobSpectrumResponseView.tsx
src/pipedal/ZoomedDial.tsx
src/pipedal/Draggable.tsx
src/pipedal/DraggableGrid.tsx
src/pipedal/WifiDirectConfigDialog.tsx
src/pipedal/SvgPathBuilder.tsx
src/pipedal/PresetSelector.tsx
src/pipedal/SystemMidiBindingsDialog.tsx
src/pipedal/OptionsDialog.tsx
src/pipedal/Updater.tsx
src/App.css
package.json
package-lock.json
tsconfig.app.json
tsconfig.json
tsconfig.node.json
vite.config.ts
)
add_custom_target (
ReactBuild ALL
DEPENDS ${BUILD_DIRECTORY}/index.html
)
+50
View File
@@ -0,0 +1,50 @@
# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level `parserOptions` property like this:
```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
```js
// eslint.config.js
import react from 'eslint-plugin-react'
export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
+28
View File
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['dist', 'build'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
+110
View File
@@ -0,0 +1,110 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<meta name="color-scheme" content="dark light"/> <!-- uses media queries in web views. -->
<meta name="description" content="PiPedal Guitar Stomp Box for Raspberry Pi" />
<link rel="stylesheet" href="/css/roboto.css" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<style>
BODY {
background: #D0D0D0;
}
</style>
<style id="bgStyle">
BODY {
background: #333; overscroll-behavior: "none"
}
</style>
<script>
const androidHosted = !!(window.AndroidHost);
var colorScheme = localStorage.getItem("colorScheme");
if (androidHosted)
{
var hostColorScheme = window.AndroidHost.getThemePreference();
switch (hostColorScheme)
{
case 0:
colorScheme = "Light";
break;
case 1:
colorScheme = "Dark";
break;
case 2:
{
// use the host's interpretation of the current system night mode.
colorScheme = window.AndroidHost.isDarkTheme() ? "Dark": "Light";
}
break;
}
}
if (!colorScheme)
{
colorScheme = "Dark";
}
var darkMode = false;
var useSystem = false;
var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
switch (colorScheme) {
case null:
default:
darkMode = false;
break;
case "Light":
darkMode = false;
break;
case "Dark":
darkMode = true;
break;
case "System":
useSystem = true;
break;
}
if (useSystem) {
darkMode = prefersDark;
}
if (!darkMode) {
let bgStyle = document.getElementById("bgStyle");
if (bgStyle) {
// disable the style block.
bgStyle.setAttribute('media', "max-width: 1px");
}
}
function removeHashOnLoad() {
if (window.location.hash) {
// Store the hash value (without the '#' symbol)
var hash = window.location.hash.substring(1);
// Replace the current URL without the hash
var newUrl = window.location.href.replace(window.location.hash, '');
// Use HTML5 history API to change the URL without reloading the page
history.replaceState(null, document.title, newUrl);
}
}
// Run the function when the window loads
window.addEventListener('load', removeHashOnLoad);
</script>
<title>PiPedal</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+5152
View File
File diff suppressed because it is too large Load Diff
+41
View File
@@ -0,0 +1,41 @@
{
"name": "pipedal",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@fontsource/roboto": "^5.1.1",
"@mui/icons-material": "^6.4.4",
"@mui/material": "^6.4.4",
"@mui/styles": "^6.4.4",
"@types/react-window": "^1.8.8",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-remark": "^2.1.0",
"react-virtualized-auto-sizer": "^1.0.25",
"react-window": "^1.8.11",
"tss-react": "^4.9.15"
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.19.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.18",
"globals": "^15.14.0",
"typescript": "~5.7.2",
"typescript-eslint": "^8.22.0",
"vite": "^6.1.0",
"vite-plugin-svgr": "^4.3.0"
}
}

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Before

Width:  |  Height:  |  Size: 248 KiB

After

Width:  |  Height:  |  Size: 248 KiB

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 563 B

Before

Width:  |  Height:  |  Size: 568 B

After

Width:  |  Height:  |  Size: 568 B

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 857 B

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 477 B

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before

Width:  |  Height:  |  Size: 954 B

After

Width:  |  Height:  |  Size: 954 B

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before

Width:  |  Height:  |  Size: 982 B

After

Width:  |  Height:  |  Size: 982 B

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 755 B

After

Width:  |  Height:  |  Size: 755 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 939 B

After

Width:  |  Height:  |  Size: 939 B

Before

Width:  |  Height:  |  Size: 870 KiB

After

Width:  |  Height:  |  Size: 870 KiB

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

Some files were not shown because too many files have changed in this diff Show More