2013-09-04 13:37:36 +00:00
|
|
|
/*
|
|
|
|
==============================================================================
|
|
|
|
|
2013-11-13 09:15:17 +00:00
|
|
|
This file was initially auto-generated by the Introjucer.
|
|
|
|
Now it is safe to edit.
|
2013-09-04 13:37:36 +00:00
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLUGINPROCESSOR_H_INCLUDED
|
|
|
|
#define PLUGINPROCESSOR_H_INCLUDED
|
|
|
|
|
|
|
|
#include "../JuceLibraryCode/JuceHeader.h"
|
2013-09-04 14:19:22 +00:00
|
|
|
#include "hiopl.h"
|
2013-09-09 16:14:43 +00:00
|
|
|
#include "FloatParameter.h"
|
2013-09-04 13:37:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class JuceOplvstiAudioProcessor : public AudioProcessor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//==============================================================================
|
|
|
|
JuceOplvstiAudioProcessor();
|
2013-09-14 16:06:45 +00:00
|
|
|
void initPrograms();
|
2013-09-04 13:37:36 +00:00
|
|
|
~JuceOplvstiAudioProcessor();
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
void prepareToPlay (double sampleRate, int samplesPerBlock);
|
|
|
|
void releaseResources();
|
|
|
|
|
|
|
|
void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages);
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
AudioProcessorEditor* createEditor();
|
|
|
|
bool hasEditor() const;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
const String getName() const;
|
|
|
|
|
2013-11-13 09:15:17 +00:00
|
|
|
static const int JuceOplvstiAudioProcessor::MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024;
|
|
|
|
|
|
|
|
int getNumParameters();
|
2013-09-04 13:37:36 +00:00
|
|
|
|
|
|
|
float getParameter (int index);
|
|
|
|
void setParameter (int index, float newValue);
|
2013-09-12 15:21:30 +00:00
|
|
|
void setEnumParameter (String name, int newValue);
|
|
|
|
void setIntParameter (String name, int newValue);
|
2013-09-29 04:25:37 +00:00
|
|
|
int getIntParameter (String name);
|
|
|
|
int getEnumParameter (String name);
|
2013-11-13 09:15:17 +00:00
|
|
|
void loadInstrumentFromFile(String filename);
|
|
|
|
void setParametersByRegister(int register_base, int op, uint8 value);
|
2013-09-04 13:37:36 +00:00
|
|
|
|
2013-11-13 15:18:47 +00:00
|
|
|
void updateGuiIfPresent();
|
|
|
|
|
2013-09-04 13:37:36 +00:00
|
|
|
const String getParameterName (int index);
|
|
|
|
const String getParameterText (int index);
|
|
|
|
|
|
|
|
const String getInputChannelName (int channelIndex) const;
|
|
|
|
const String getOutputChannelName (int channelIndex) const;
|
|
|
|
bool isInputChannelStereoPair (int index) const;
|
|
|
|
bool isOutputChannelStereoPair (int index) const;
|
|
|
|
|
|
|
|
bool acceptsMidi() const;
|
|
|
|
bool producesMidi() const;
|
|
|
|
bool silenceInProducesSilenceOut() const;
|
|
|
|
double getTailLengthSeconds() const;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
int getNumPrograms();
|
|
|
|
int getCurrentProgram();
|
|
|
|
void setCurrentProgram (int index);
|
|
|
|
const String getProgramName (int index);
|
|
|
|
void changeProgramName (int index, const String& newName);
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
void getStateInformation (MemoryBlock& destData);
|
|
|
|
void setStateInformation (const void* data, int sizeInBytes);
|
|
|
|
|
|
|
|
private:
|
2013-09-04 14:19:22 +00:00
|
|
|
Hiopl *Opl;
|
2013-09-09 16:14:43 +00:00
|
|
|
std::vector<FloatParameter*> params;
|
2013-09-12 15:21:30 +00:00
|
|
|
std::map<String, int> paramIdxByName;
|
2013-09-13 17:13:18 +00:00
|
|
|
std::map<String, std::vector<float>> programs;
|
|
|
|
std::vector<String> program_order;
|
|
|
|
int i_program;
|
2013-09-22 11:10:28 +00:00
|
|
|
bool velocity;
|
2013-09-13 17:40:28 +00:00
|
|
|
static const int NO_NOTE=-1;
|
|
|
|
int active_notes[Hiopl::CHANNELS+1]; // keyed by channel
|
2013-09-04 14:19:22 +00:00
|
|
|
|
2013-09-04 13:37:36 +00:00
|
|
|
//==============================================================================
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceOplvstiAudioProcessor)
|
|
|
|
};
|
|
|
|
#endif // PLUGINPROCESSOR_H_INCLUDED
|