2
0
Fork 0
OPL/Source/PluginProcessor.h

110 lines
3.8 KiB
C
Raw Normal View History

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 <deque>
2013-09-04 13:37:36 +00:00
#include "../JuceLibraryCode/JuceHeader.h"
#include "hiopl.h"
#include "FloatParameter.h"
2013-09-04 13:37:36 +00:00
//==============================================================================
class AdlibBlasterAudioProcessor : public AudioProcessor
2013-09-04 13:37:36 +00:00
{
public:
//==============================================================================
AdlibBlasterAudioProcessor();
void initPrograms();
void applyPitchBend();
~AdlibBlasterAudioProcessor();
2013-09-04 13:37:36 +00:00
//==============================================================================
void prepareToPlay (double sampleRate, int samplesPerBlock);
void releaseResources();
void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages);
//==============================================================================
AudioProcessorEditor* createEditor();
bool hasEditor() const;
//==============================================================================
const String getName() const;
static const int MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024;
2013-11-13 09:15:17 +00:00
int getNumParameters();
2013-09-04 13:37:36 +00:00
float getParameter (int index);
void setParameter (int index, float newValue);
void setEnumParameter (String name, int newValue);
void setIntParameter (String name, int newValue);
int getIntParameter (String name);
int getEnumParameter (String name);
2017-03-04 03:44:56 +00:00
bool getBoolParameter(String name);
2013-11-13 09:15:17 +00:00
void loadInstrumentFromFile(String filename);
void saveInstrumentToFile(String filename);
2013-11-13 09:15:17 +00:00
void setParametersByRegister(int register_base, int op, uint8 value);
2013-09-04 13:37:36 +00:00
void disableChannel(const int idx);
void enableChannel(const int idx);
void toggleChannel(const int idx);
bool isChannelEnabled(const int idx) const;
size_t nChannelsEnabled();
const char* getChannelEnvelopeStage(int idx) const;
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:
Hiopl *Opl;
std::vector<FloatParameter*> params;
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;
bool velocity;
2013-09-13 17:40:28 +00:00
static const int NO_NOTE=-1;
static const char *PROGRAM_INDEX;
int active_notes[Hiopl::CHANNELS + 1]; // keyed by 1-based channel index
bool channel_enabled[Hiopl::CHANNELS + 1]; // keyed by 1-based channel index
std::deque<int> available_channels; // most recently freed at end
std::deque<int> used_channels; // most recently used at end
float currentScaledBend;
2013-09-04 13:37:36 +00:00
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AdlibBlasterAudioProcessor)
2013-09-04 13:37:36 +00:00
};
#endif // PLUGINPROCESSOR_H_INCLUDED