2018-02-27 08:17:12 +08:00
|
|
|
/*
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
This file was auto-generated!
|
|
|
|
|
|
|
|
It contains the basic framework code for a JUCE plugin processor.
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../JuceLibraryCode/JuceHeader.h"
|
2018-02-27 08:25:20 +08:00
|
|
|
#include "FluidSynthModel.h"
|
2018-03-19 07:35:29 +08:00
|
|
|
#include "StateChangeSubscriber.h"
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
using namespace std;
|
2018-02-27 08:17:12 +08:00
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/**
|
|
|
|
*/
|
2018-02-27 08:39:50 +08:00
|
|
|
class JuicySFAudioProcessor : public AudioProcessor
|
2018-02-27 08:17:12 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
//==============================================================================
|
2018-02-27 08:39:50 +08:00
|
|
|
JuicySFAudioProcessor();
|
|
|
|
~JuicySFAudioProcessor();
|
2018-02-27 08:17:12 +08:00
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
void prepareToPlay (double sampleRate, int samplesPerBlock) override;
|
|
|
|
void releaseResources() override;
|
|
|
|
|
|
|
|
#ifndef JucePlugin_PreferredChannelConfigurations
|
|
|
|
bool isBusesLayoutSupported (const BusesLayout& layouts) const override;
|
|
|
|
#endif
|
|
|
|
|
2018-02-27 08:25:20 +08:00
|
|
|
void processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages) override;
|
2018-02-27 08:17:12 +08:00
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
AudioProcessorEditor* createEditor() override;
|
|
|
|
bool hasEditor() const override;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
const String getName() const override;
|
|
|
|
|
|
|
|
bool acceptsMidi() const override;
|
|
|
|
bool producesMidi() const override;
|
|
|
|
double getTailLengthSeconds() const override;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
int getNumPrograms() override;
|
|
|
|
int getCurrentProgram() override;
|
|
|
|
void setCurrentProgram (int index) override;
|
|
|
|
const String getProgramName (int index) override;
|
|
|
|
void changeProgramName (int index, const String& newName) override;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
void getStateInformation (MemoryBlock& destData) override;
|
|
|
|
void setStateInformation (const void* data, int sizeInBytes) override;
|
|
|
|
|
2018-02-27 08:25:20 +08:00
|
|
|
bool supportsDoublePrecisionProcessing() const override;
|
|
|
|
|
|
|
|
FluidSynthModel* getFluidSynthModel();
|
|
|
|
|
|
|
|
MidiKeyboardState keyboardState;
|
|
|
|
|
2018-04-10 07:11:22 +08:00
|
|
|
// void subscribeToStateChanges(StateChangeSubscriber* subscriber);
|
|
|
|
// void unsubscribeFromStateChanges(StateChangeSubscriber* subscriber);
|
|
|
|
|
|
|
|
int lastUIWidth, lastUIHeight;
|
|
|
|
String soundFontPath;
|
2018-02-27 08:25:20 +08:00
|
|
|
|
2018-02-27 08:17:12 +08:00
|
|
|
private:
|
2018-02-27 08:25:20 +08:00
|
|
|
void initialiseSynth();
|
|
|
|
|
|
|
|
FluidSynthModel fluidSynthModel;
|
|
|
|
fluid_synth_t* fluidSynth;
|
|
|
|
Synthesiser synth;
|
|
|
|
|
2018-04-10 07:11:22 +08:00
|
|
|
// list<StateChangeSubscriber*> stateChangeSubscribers;
|
2018-02-27 08:25:20 +08:00
|
|
|
|
2018-03-19 07:35:29 +08:00
|
|
|
static BusesProperties getBusesProperties();
|
2018-02-27 08:25:20 +08:00
|
|
|
|
|
|
|
// Model* model;
|
2018-02-27 08:17:12 +08:00
|
|
|
//==============================================================================
|
2018-02-27 08:39:50 +08:00
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuicySFAudioProcessor)
|
2018-02-27 08:17:12 +08:00
|
|
|
};
|