// 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 React from 'react'; import { Component } from 'react'; import { Theme } from '@mui/material/styles'; import WithStyles, {withTheme} from './WithStyles'; import { withStyles } from "tss-react/mui"; import { PiPedalModel, PiPedalModelFactory } from './PiPedalModel'; import { pluginControlStyles } from './PluginControl'; import MidiChannelBinding from './MidiChannelBinding'; import ToolTipEx from './ToolTipEx'; import Typography from '@mui/material/Typography'; import Divider from '@mui/material/Divider'; import ButtonBase from '@mui/material/ButtonBase'; import MidiIcon from './svg/ic_midi.svg?react'; import MidiChannelBindingDialog from './MidiChannelBindingDialog'; export const StandardItemSize = { width: 80, height: 140 } export interface MidiChannelBindingControlProps extends WithStyles { midiChannelBinding: MidiChannelBinding theme: Theme; onChange: (result: MidiChannelBinding) => void; } type MidiChannelBindingControlState = { dialogOpen: boolean; }; const MidiChannelBindingControl = withTheme( withStyles( class extends Component { model: PiPedalModel; constructor(props: MidiChannelBindingControlProps) { super(props); this.state = { dialogOpen: false }; this.model = PiPedalModelFactory.getInstance(); } render() { const classes = withStyles.getClasses(this.props); let item_width = 80; return (
{/* TITLE SECTION */}
title Controls which MIDI messages get forward to the instrument. )} > MIDI
{/* CONTROL SECTION */}
{ this.setState({dialogOpen: true}); }} sx={{ ':hover': { bgcolor: 'action.hover', // theme.palette.primary.main color: 'white', }, }} >
OMNI
{this.state.dialogOpen&&( { this.setState({dialogOpen: false});}} onChanged={(midiChannelBinding: MidiChannelBinding)=> {}} midiDevices={[]} /> )}
); } }, pluginControlStyles )); export default MidiChannelBindingControl;