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

    This file was auto-generated by the Introjucer!

    It contains the basic framework code for a JUCE plugin processor.

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

#include "PluginProcessor.h"
#include "PluginEditor.h"
#include <random>

using namespace gin;

//==============================================================================
KeyboardAudioProcessor::KeyboardAudioProcessor()
{
}

KeyboardAudioProcessor::~KeyboardAudioProcessor()
{
}

//==============================================================================
void KeyboardAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
{
}

void KeyboardAudioProcessor::releaseResources()
{
}

void KeyboardAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midi)
{
    controllerState.processBuffer (midi);
    keyboardState.processNextMidiBuffer (midi, 0, buffer.getNumSamples(), true);
}

//==============================================================================
bool KeyboardAudioProcessor::hasEditor() const
{
    return true;
}

AudioProcessorEditor* KeyboardAudioProcessor::createEditor()
{
    editor = new KeyboardAudioProcessorEditor (*this);
    return editor;
}

//==============================================================================
// This creates new instances of the plugin..
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
{
    return new KeyboardAudioProcessor();
}
