/*
  ==============================================================================

   This file is part of the JUCE framework examples.
   Copyright (c) Raw Material Software Limited

   The code included in this file is provided under the terms of the ISC license
   http://www.isc.org/downloads/software-support-policy/isc-license. Permission
   to use, copy, modify, and/or distribute this software for any purpose with or
   without fee is hereby granted provided that the above copyright notice and
   this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
   REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
   AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
   INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
   LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
   PERFORMANCE OF THIS SOFTWARE.

  ==============================================================================
*/

import "@fontsource/roboto/300.css";
import "@fontsource/roboto/400.css";
import "@fontsource/roboto/500.css";
import "@fontsource/roboto/700.css";

import Container from "@mui/material/Container";
import * as Juce from "juce-framework-frontend";
import JuceSlider from "./Components/JuceSlider.js";
import JuceCheckbox from "./Components/JuceCheckbox.js";
import MidiNoteInfo from "./Components/MidiNoteInfo.js";
import { controlParameterIndexAnnotation } from "./types/JuceTypes.js";

import { React } from "react";

import "./App.css";

function App() {
  const controlParameterIndexUpdater = new Juce.ControlParameterIndexUpdater(
    controlParameterIndexAnnotation
  );

  document.addEventListener("mousemove", (event) => {
    controlParameterIndexUpdater.handleMouseMove(event);
  });

  return (
    <div>
      <Container>
        <JuceSlider identifier="harmonyMix" title="Mix" />
        <JuceSlider identifier="formantPreserve" title="Formant" />
        <JuceCheckbox identifier="autoTuneEnabled" />
        <JuceSlider identifier="autoTuneSpeed" title="Auto Tune Speed" />
        <JuceSlider identifier="autoTuneDepth" title="Auto Tune Depth" />
        <JuceSlider identifier="portTime" title="Portamento Speed" />

        <JuceCheckbox identifier="freezeEnabled" />
        <JuceSlider identifier="freezePitch" title="Freeze Pitch" />
        <JuceSlider identifier="freezeVolume" title="Freeze Volume" />
      </Container>
      <MidiNoteInfo />
    </div>
  );
}

export default App;
