UPDATE:
I now recoded a much simpler version of my plugin from scratch. I kept the processBlock as simple as possible. Still the same error. My plugin compiles just fine though…
If someone still is interested, here is the guts of my processing code:
class TremoloAudioProcessor : public AudioProcessor
{
//standard JUCE code
private:
//==============================================================================
void filterKernel();
AudioParameterFloat *parameterRate;
AudioParameterFloat *parameterDepth;
enum {waveArraySize = 2000};
float sineArray[waveArraySize];
float *waveArrayPtr;
float currentScale;
float nextScale;
long numProcessedSamples;
enum {sampleLimit = (int)10E6};
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TremoloAudioProcessor)
};
TremoloAudioProcessor::TremoloAudioProcessor()
{
//AudioParameterFloat (ParameterID, Name, min, max, default)
addParameter(parameterRate = new AudioParameterFloat( “rate”,
paramName_Tremolo_Rate,
minimumValue_Tremolo_Rate,
maximumValue_Tremolo_Rate,
defaultValue_Tremolo_Rate));
addParameter(parameterDepth = new AudioParameterFloat( "depth",
paramName_Tremolo_Depth,
minimumValue_Tremolo_Depth,
maximumValue_Tremolo_Depth,
defaultValue_Tremolo_Depth));
filterKernel();
numProcessedSamples = 0;
currentScale = 0.0;
}
void TremoloAudioProcessor::filterKernel (void)
{
//create the wavetable for a sinewave LFO
for (int i = 0; i < waveArraySize; ++i) {
double radians = i * 2.0 * M_PI / waveArraySize;
sineArray[i] = (sin(radians) + 1.0) * 0.5; //the sine function shall range from 0 to 1
}
}
void TremoloAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
int testVar;
const int totalNumInputChannels = getTotalNumInputChannels();
const int totalNumOutputChannels = getTotalNumOutputChannels();
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
for (int sampleIndex = 0; sampleIndex < buffer.getNumSamples(); ++sampleIndex) {
for (int channelIndex = 0; channelIndex < totalNumInputChannels; ++channelIndex) {
float* channelData = buffer.getWritePointer (channelIndex, sampleIndex);
*channelData = 0.0;
channelData++;
testVar = testVar+1;
}
}
}
When I try to print testVar in the processBlock method I’ll get this error. Only the second time I read the value of this variable. The error again goes like this:
JUCE v4.2.3
JUCE v4.2.3
(lldb) p testVar
(int) $0 = 28672
(lldb) c
Process 996 resuming
(lldb) p testVar
error: field ‘holder’ declared with incompatible types in different translation units (‘SharedRef’ (aka ‘juce::ReferenceCountedObjectPtr<juce::WeakReference<juce::Component, juce::ReferenceCountedObject>::SharedPointer>’) vs. ‘SharedRef’ (aka ‘juce::ReferenceCountedObjectPtr<juce::WeakReference<juce::Component, juce::ReferenceCountedObject>::SharedPointer>’))
note: declared here with type ‘SharedRef’ (aka ‘juce::ReferenceCountedObjectPtr<juce::WeakReference<juce::Component, juce::ReferenceCountedObject>::SharedPointer>’)
error: 1 errors parsing expression
Maybe it has something to do with the host application, that was provided by JUCE for debugging…