import React, { SyntheticEvent, Component } from 'react'; import IconButtonEx from './IconButtonEx'; 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 Slide, { SlideProps } from '@mui/material/Slide'; interface AboutDialogProps { open: boolean; onClose: () => void; }; interface AboutDialogState { jackStatus?: JackHostStatus; openSourceNotices: string; }; const Transition = React.forwardRef(function Transition( props: SlideProps, ref: React.Ref ) { return (); }); const AboutDialog = class extends Component { model: PiPedalModel; refNotices: React.RefObject; 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?: number; 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, prevState: Readonly, snapshot: any): void { super.componentDidUpdate?.(prevProps, prevState, snapshot); this.updateNotifications(); } handleDialogClose(_e: SyntheticEvent) { this.props.onClose(); } render() { let addressKey = 0; let serverVersion = this.model.serverVersion?.serverVersion ?? ""; let nPos = serverVersion.indexOf(' '); if (nPos !== -1) { serverVersion = serverVersion.substring(nPos + 1); } return ( { this.props.onClose() }} TransitionComponent={Transition} onEnterKey={() => { this.props.onClose() }} style={{ userSelect: "none" }} >
About
OP-Pedal {serverVersion + (this.model.serverVersion?.debug ? " (Debug)" : "")}
Copyright © Robin Davies. {this.model.isAndroidHosted() && ( {this.model.getAndroidHostVersion()} )} {this.model.isAndroidHosted() && ( Copyright © Robin Davies. )} ADDRESSES
{ this.model.serverVersion?.webAddresses.map((address) => ( {address} )) }
SERVER OS
{this.model.serverVersion?.osVersion ?? ""}
T3K LICENSED FILES The following files are provided under a T3K license. Under an arrangement with Tone3000.com, permission has been granted to Robin Davies to distribute these files ONLY with PiPedal.
  • "default_presets/V3 Factory Presets.piBank" (contains compressed versions of the protected files).
  • The installed file "/etc/pipedal/config/default_presets/presets/V3 Factory Presets.piBank"
  • Files installed in "/var/pipedal/audio_uploads/NeuralAmpModels/Factory Models/"
  • Files installed in "/var/pipedal/audio_uploads/IRs/Factory IRs/"
Please contact the original authors for permission if you would like to distribute these files for other purposes, or if you would like to distribute these files in a forked version of PiPedal. T3K License Users may download and use the data file in software and publish the resulting outputs without royalties or restrictions. However, they may not upload, republish, or distribute the data file without the author's permission. Original Authors LEGAL NOTICES
); } }; export default AboutDialog;