import React from 'react'; import Dialog from '@mui/material/Dialog'; import DialogTitle from '@mui/material/DialogTitle'; import DialogContent from '@mui/material/DialogContent'; import DialogActions from '@mui/material/DialogActions'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import { PiPedalModel, PiPedalModelFactory } from './PiPedalModel'; import DialogEx from './DialogEx'; import Link from '@mui/material/Link'; import Toolbar from '@mui/material/Toolbar'; import IconButtonEx from './IconButtonEx'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; export interface Tone3000DialogProps { open: boolean; onClose: () => void; } function Tone3000Dialog(props: Tone3000DialogProps) { const { open, onClose } = props; const model: PiPedalModel = PiPedalModelFactory.getInstance(); let [openAuthDialog, setOpenAuthDialog] = React.useState(!model.hasTone3000Auth.get()); React.useEffect(()=> { let authListener = (value: boolean) => { setOpenAuthDialog(!value); } model.hasTone3000Auth.addOnChangedHandler(authListener); return () => { model.hasTone3000Auth.removeOnChangedHandler(authListener); } }); function RedirectUrl() { let baseUrl = new URL(window.location.href); let result = "http://" + baseUrl.hostname + ":" + baseUrl.port + "/"; return result; } function AuthUrl() { //return "https://www.tone3000.com/api/v1/auth?redirect_url=" + encodeURIComponent(RedirectUrl()) + "&opt_only=true"; return "https://www.tone3000.com/api/v1/auth?redirect_url=" + encodeURIComponent(RedirectUrl()) + "&otp_only=true"; } return ( { onClose(); }} onClose={() => { onClose(); }} aria-labelledby="tone3000-dialog-title" aria-describedby="tone3000-dialog-description" > { onClose(); }} > TONE3000 Models This is a placeholder for the Tone 3000 dialog. { openAuthDialog && ( { onClose(); }} > TONE3000 Authorization
The TONE3000 website provides an online library of models for use with TooB Neural Amp Modeller. You can download models from the TONE3000 website onto your local machine and then upload them to PiPedal; or, more conveniently, you can browse the TONE3000 model database directly, and download models directly to the PiPedal server from the TONE3000 model database in a single step. In order to access the TONE3000 database, you must first obtain an access token from the TONE3000 website. Clicking on the button will take you to an external website in order to complete the authorization process. Privacy statement: PiPedal will only have access to your authorization token which does not contain personally identifying information, and which is stored locally on your PiPedal server. Please refer to the TONE3000 privacy policy for information on how your data is used by TONE3000.
)}
); } export default Tone3000Dialog;