mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Replaced AudioSampleBuffer::getSampleData with getReadPointer/getWritePointer methods (the old method is still available but deprecated). Apart from making code more explanatory and improving constness, these work with a new flag that keeps track of whether the buffer is clear, so that some operations can be elided when the data is known to be empty.
This commit is contained in:
parent
86d6018fb3
commit
fa21d2ac02
41 changed files with 373 additions and 194 deletions
|
|
@ -154,12 +154,12 @@ void SamplerVoice::renderNextBlock (AudioSampleBuffer& outputBuffer, int startSa
|
|||
{
|
||||
if (const SamplerSound* const playingSound = static_cast <SamplerSound*> (getCurrentlyPlayingSound().get()))
|
||||
{
|
||||
const float* const inL = playingSound->data->getSampleData (0, 0);
|
||||
const float* const inL = playingSound->data->getReadPointer (0);
|
||||
const float* const inR = playingSound->data->getNumChannels() > 1
|
||||
? playingSound->data->getSampleData (1, 0) : nullptr;
|
||||
? playingSound->data->getReadPointer (1) : nullptr;
|
||||
|
||||
float* outL = outputBuffer.getSampleData (0, startSample);
|
||||
float* outR = outputBuffer.getNumChannels() > 1 ? outputBuffer.getSampleData (1, startSample) : nullptr;
|
||||
float* outL = outputBuffer.getWritePointer (0, startSample);
|
||||
float* outR = outputBuffer.getNumChannels() > 1 ? outputBuffer.getWritePointer (1, startSample) : nullptr;
|
||||
|
||||
while (--numSamples >= 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue