Using getReaderPointer instead of getSampleData which is deprecated


In plugin processor a process block which takes a buffer, I would like to get the sample data however the method has been deprecated, when I try to use getReaderPointer i get an error.

// this code is from Joshua D. Reiss and Andrew P. McPherson
void WahwahAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
    // Helpful information about this block of samples:
    const int numInputChannels = getNumInputChannels();     // How many input channels for our effect?
    const int numOutputChannels = getNumOutputChannels();   // How many output channels for our effect?
    const int numSamples = buffer.getNumSamples();          // How many samples in the buffer for this block?
    int channel;

  // Go through each channel of audio that's passed in

    for (channel = 0; channel < jmin(numInputChannels, numWahFilters_); ++channel)
        // channelData is an array of length numSamples which contains the audio for one channel
        // getSampleData deprecated - use getReadPointer
  	float* channelData = buffer.getReadPointer(channel);
        // Run the samples through the IIR filter whose coefficients define the parametric
        // equaliser. See juce_IIRFilter.cpp for the implementation.
        wahFilters_[channel]->processSamples(channelData, numSamples);
    // Go through the remaining channels. In case we have more outputs
    // than inputs, or there aren't enough filters, we'll clear any
    // remaining output channels (which could otherwise contain garbage)
    while(channel < numOutputChannels)
        buffer.clear (channel++, 0, buffer.getNumSamples());


getReadPointer() returns const samples, use getWritePointer() instead