Initial commit
[juce-lv2.git] / demo / Source / PluginProcessor.h
blob46d7d6bb20f517e9ab8e4b3313cab2da1a622eea
1 /*
2 ==============================================================================
4 This file was auto-generated by the Jucer!
6 It contains the basic startup code for a Juce application.
8 ==============================================================================
9 */
11 #ifndef __PLUGINPROCESSOR_H_526ED7A9__
12 #define __PLUGINPROCESSOR_H_526ED7A9__
14 #include "../JuceLibraryCode/JuceHeader.h"
15 #include "../JuceLibraryCode/JucePluginCharacteristics.h"
18 //==============================================================================
19 /**
21 class JuceDemoPluginAudioProcessor : public AudioProcessor
23 public:
24 //==============================================================================
25 JuceDemoPluginAudioProcessor();
26 ~JuceDemoPluginAudioProcessor();
28 //==============================================================================
29 void prepareToPlay (double sampleRate, int samplesPerBlock);
30 void releaseResources();
31 void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages);
32 void reset();
34 //==============================================================================
35 bool hasEditor() const { return true; }
36 AudioProcessorEditor* createEditor();
38 //==============================================================================
39 const String getName() const { return JucePlugin_Name; }
41 int getNumParameters();
42 float getParameter (int index);
43 void setParameter (int index, float newValue);
44 const String getParameterName (int index);
45 const String getParameterText (int index);
47 const String getInputChannelName (int channelIndex) const;
48 const String getOutputChannelName (int channelIndex) const;
49 bool isInputChannelStereoPair (int index) const;
50 bool isOutputChannelStereoPair (int index) const;
52 bool acceptsMidi() const;
53 bool producesMidi() const;
55 //==============================================================================
56 int getNumPrograms() { return 0; }
57 int getCurrentProgram() { return 0; }
58 void setCurrentProgram (int /*index*/) { }
59 const String getProgramName (int /*index*/) { return String::empty; }
60 void changeProgramName (int /*index*/, const String& /*newName*/) { }
62 //==============================================================================
63 void getStateInformation (MemoryBlock& destData);
64 void setStateInformation (const void* data, int sizeInBytes);
66 //==============================================================================
67 // These properties are public so that our editor component can access them
68 // A bit of a hacky way to do it, but it's only a demo! Obviously in your own
69 // code you'll do this much more neatly..
71 // this is kept up to date with the midi messages that arrive, and the UI component
72 // registers with it so it can represent the incoming messages
73 MidiKeyboardState keyboardState;
75 // this keeps a copy of the last set of time info that was acquired during an audio
76 // callback - the UI component will read this and display it.
77 AudioPlayHead::CurrentPositionInfo lastPosInfo;
79 // these are used to persist the UI's size - the values are stored along with the
80 // filter's other parameters, and the UI component will update them when it gets
81 // resized.
82 int lastUIWidth, lastUIHeight;
84 //==============================================================================
85 enum Parameters
87 gainParam = 0,
88 delayParam,
90 totalNumParams
93 float gain, delay;
95 private:
96 //==============================================================================
97 AudioSampleBuffer delayBuffer;
98 int delayPosition;
100 // the synth!
101 Synthesiser synth;
103 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceDemoPluginAudioProcessor);
106 #endif // __PLUGINPROCESSOR_H_526ED7A9__