Add TAL-Reverb-II plugin to test
[juce-lv2.git] / tal-reverb-2-juce / src / TalCore.h
blobc399787be5fc13e28317e264dc47e672f8b49cb2
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-7 by Raw Material Software ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the
10 GNU General Public License, as published by the Free Software Foundation;
11 either version 2 of the License, or (at your option) any later version.
13 JUCE is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with JUCE; if not, visit www.gnu.org/licenses or write to the
20 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21 Boston, MA 02111-1307 USA
23 ------------------------------------------------------------------------------
25 If you'd like to release a closed-source product which uses JUCE, commercial
26 licenses are also available: visit www.rawmaterialsoftware.com/juce for
27 more information.
29 ==============================================================================
32 #ifndef TALCORE_H
33 #define TALCORE_H
35 #include "./engine/ReverbEngine.h"
36 #include "./engine/Params.h"
37 #include "TalPreset.h"
39 //==============================================================================
40 /**
41 A simple plugin filter that just applies a gain change to the audio
42 passing through it.
46 class TalCore : public AudioProcessor,
47 public ChangeBroadcaster
49 public:
50 //==============================================================================
51 TalCore();
52 ~TalCore();
54 bool hasEditor() const { return true; }
56 //==============================================================================
57 void prepareToPlay (double sampleRate, int samplesPerBlock);
58 void releaseResources();
60 void processBlock (AudioSampleBuffer& buffer,
61 MidiBuffer& midiMessages);
63 //==============================================================================
64 AudioProcessorEditor* createEditor();
66 //==============================================================================
67 const String getName() const;
69 int getNumParameters();
71 float getParameter (int index);
72 void setParameter (int index, float newValue);
74 const String getParameterName (int index);
75 const String getParameterText (int index);
77 const String getInputChannelName (const int channelIndex) const;
78 const String getOutputChannelName (const int channelIndex) const;
79 bool isInputChannelStereoPair (int index) const;
80 bool isOutputChannelStereoPair (int index) const;
82 bool acceptsMidi() const;
83 bool producesMidi() const;
85 //==============================================================================
86 int getNumPrograms();
87 int getCurrentProgram();
88 void setCurrentProgram (int index);
89 const String getProgramName (int index);
90 void changeProgramName (int index, const String& newName);
92 //==============================================================================
93 void getStateInformation (MemoryBlock& destData);
94 void setStateInformation (const void* data, int sizeInBytes);
96 void handleController (const int controllerNumber,
97 const int controllerValue);
99 void processMidiPerSample (MidiBuffer::Iterator *midiIterator,
100 MidiMessage controllerMidiMessage, int samplePos);
103 //==============================================================================
104 // These properties are public so that our editor component can access them
105 // - a bit of a hacky way to do it, but it's only a demo!
107 // this is kept up to date with the midi messages that arrive, and the UI component
108 // registers with it so it can represent the incoming messages
109 // MidiKeyboardState keyboardState;
111 // this keeps a copy of the last set of time info that was acquired during an audio
112 // callback - the UI component will read this and display it.
113 // AudioPlayHead::CurrentPositionInfo lastPosInfo;
115 // these are used to persist the UI's size - the values are stored along with the
116 // filter's other parameters, and the UI component will update them when it gets
117 // resized.
118 //int lastUIWidth, lastUIHeight;
120 //==============================================================================
121 juce_UseDebuggingNewOperator
123 private:
125 float *params;
126 ReverbEngine *engine;
127 float sampleRate;
129 TalPreset **talPresets;
130 int curProgram;
132 // Midi values
133 int midiEventPos;
134 bool hasMoreMidiMessages;
136 int lastMovedController;
138 #endif