|
|
@@ -23,7 +23,7 @@ |
|
|
|
#include "rtaudio/RtAudio.h" |
|
|
|
#include "rtmidi/RtMidi.h" |
|
|
|
|
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
# include "juce_audio_basics.h" |
|
|
|
using juce::FloatVectorOperations; |
|
|
|
#endif |
|
|
@@ -839,8 +839,10 @@ protected: |
|
|
|
{ |
|
|
|
if (fAudioCountOut > 0 && fAudioIsReady) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::clear(outsPtr, nframes*fAudioCountOut); |
|
|
|
#else |
|
|
|
carla_zeroFloat(outsPtr, nframes*fAudioCountOut); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
@@ -862,19 +864,28 @@ protected: |
|
|
|
{ |
|
|
|
for (unsigned int i=0; i < fAudioCountIn; ++i) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::copy(fAudioBufIn[i], insPtr+(nframes*i), nframes); |
|
|
|
#else |
|
|
|
carla_copyFloat(fAudioBufIn[i], insPtr+(nframes*i), nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
// initialize audio output |
|
|
|
for (unsigned int i=0; i < fAudioCountOut; ++i) |
|
|
|
FloatVectorOperations::clear(fAudioBufOut[i], nframes); |
|
|
|
|
|
|
|
FloatVectorOperations::clear(fAudioBufRackOut[0], nframes); |
|
|
|
FloatVectorOperations::clear(fAudioBufRackOut[1], nframes); |
|
|
|
#else |
|
|
|
// initialize audio output |
|
|
|
for (unsigned int i=0; i < fAudioCountOut; ++i) |
|
|
|
carla_zeroFloat(fAudioBufOut[i], nframes); |
|
|
|
|
|
|
|
carla_zeroFloat(fAudioBufRackOut[0], nframes); |
|
|
|
carla_zeroFloat(fAudioBufRackOut[1], nframes); |
|
|
|
#endif |
|
|
|
|
|
|
|
// initialize input events |
|
|
@@ -916,8 +927,10 @@ protected: |
|
|
|
// connect input buffers |
|
|
|
if (fConnectedAudioIns[0].count() == 0) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::clear(fAudioBufRackIn[0], nframes); |
|
|
|
#else |
|
|
|
carla_zeroFloat(fAudioBufRackIn[0], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else |
|
|
@@ -931,31 +944,39 @@ protected: |
|
|
|
|
|
|
|
if (first) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::copy(fAudioBufRackIn[0], fAudioBufIn[port], nframes); |
|
|
|
#else |
|
|
|
carla_copyFloat(fAudioBufRackIn[0], fAudioBufIn[port], nframes); |
|
|
|
#endif |
|
|
|
first = false; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::add(fAudioBufRackIn[0], fAudioBufIn[port], nframes); |
|
|
|
#else |
|
|
|
carla_addFloat(fAudioBufRackIn[0], fAudioBufIn[port], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (first) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::clear(fAudioBufRackIn[0], nframes); |
|
|
|
#else |
|
|
|
carla_zeroFloat(fAudioBufRackIn[0], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (fConnectedAudioIns[1].count() == 0) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::clear(fAudioBufRackIn[1], nframes); |
|
|
|
#else |
|
|
|
carla_zeroFloat(fAudioBufRackIn[1], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
else |
|
|
@@ -969,23 +990,29 @@ protected: |
|
|
|
|
|
|
|
if (first) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::copy(fAudioBufRackIn[1], fAudioBufIn[port], nframes); |
|
|
|
#else |
|
|
|
carla_copyFloat(fAudioBufRackIn[1], fAudioBufIn[port], nframes); |
|
|
|
#endif |
|
|
|
first = false; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::add(fAudioBufRackIn[1], fAudioBufIn[port], nframes); |
|
|
|
#else |
|
|
|
carla_addFloat(fAudioBufRackIn[1], fAudioBufIn[port], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (first) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::clear(fAudioBufRackIn[1], nframes); |
|
|
|
#else |
|
|
|
carla_zeroFloat(fAudioBufRackIn[1], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
@@ -1001,8 +1028,10 @@ protected: |
|
|
|
const uint& port(*it); |
|
|
|
CARLA_ASSERT(port < fAudioCountOut); |
|
|
|
|
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::add(fAudioBufOut[port], fAudioBufRackOut[0], nframes); |
|
|
|
#else |
|
|
|
carla_addFloat(fAudioBufOut[port], fAudioBufRackOut[0], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
@@ -1014,8 +1043,10 @@ protected: |
|
|
|
const uint& port(*it); |
|
|
|
CARLA_ASSERT(port < fAudioCountOut); |
|
|
|
|
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::add(fAudioBufOut[port], fAudioBufRackOut[1], nframes); |
|
|
|
#else |
|
|
|
carla_addFloat(fAudioBufOut[port], fAudioBufRackOut[1], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
@@ -1037,8 +1068,10 @@ protected: |
|
|
|
{ |
|
|
|
for (unsigned int i=0; i < fAudioCountOut; ++i) |
|
|
|
{ |
|
|
|
#ifdef USE_JUCE |
|
|
|
#ifdef HAVE_JUCE |
|
|
|
FloatVectorOperations::copy(outsPtr+(nframes*i), fAudioBufOut[i], nframes); |
|
|
|
#else |
|
|
|
carla_copyFloat(outsPtr+(nframes*i), fAudioBufOut[i], nframes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|