Browse Source

Make CarlaNative.h process function backwards compatible

tags/v2.1-rc1
falkTX 4 years ago
parent
commit
691deb66bd
25 changed files with 49 additions and 33 deletions
  1. +3
    -2
      source/backend/engine/CarlaEngineNative.cpp
  2. +3
    -3
      source/backend/plugin/CarlaPluginNative.cpp
  3. +3
    -1
      source/includes/CarlaNative.h
  4. +3
    -2
      source/includes/CarlaNative.hpp
  5. +2
    -2
      source/includes/CarlaNativePrograms.hpp
  6. +2
    -2
      source/modules/distrho/DistrhoPlugin.hpp
  7. +2
    -2
      source/modules/distrho/src/DistrhoPluginCarla.cpp
  8. +2
    -2
      source/modules/distrho/src/DistrhoPluginInternal.hpp
  9. +1
    -1
      source/native-plugins/audio-file.cpp
  10. +2
    -1
      source/native-plugins/audio-gain.c
  11. +1
    -1
      source/native-plugins/bigmeter.cpp
  12. +2
    -1
      source/native-plugins/bypass.c
  13. +2
    -1
      source/native-plugins/lfo.c
  14. +2
    -1
      source/native-plugins/midi-channel-ab.c
  15. +2
    -1
      source/native-plugins/midi-channel-filter.c
  16. +2
    -1
      source/native-plugins/midi-channelize.c
  17. +1
    -1
      source/native-plugins/midi-file.cpp
  18. +2
    -1
      source/native-plugins/midi-gain.c
  19. +2
    -1
      source/native-plugins/midi-join.c
  20. +1
    -1
      source/native-plugins/midi-pattern.cpp
  21. +2
    -1
      source/native-plugins/midi-split.c
  22. +2
    -1
      source/native-plugins/midi-through.c
  23. +2
    -1
      source/native-plugins/midi-to-cv.c
  24. +2
    -1
      source/native-plugins/midi-transpose.c
  25. +1
    -1
      source/native-plugins/notes.cpp

+ 3
- 2
source/backend/engine/CarlaEngineNative.cpp View File

@@ -1080,7 +1080,7 @@ protected:
//runPendingRtEvents();
}

void process(const float** const inBuffer, float** const outBuffer, const uint32_t frames,
void process(const float* const* const inBuffer, float** const outBuffer, const uint32_t frames,
const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount)
{
if (frames > pData->bufferSize)
@@ -1577,8 +1577,9 @@ public:
handlePtr->deactivate();
}

// FIXME for v3.0, use const for the input buffer
static void _process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, const uint32_t frames,
float** inBuffer, float** outBuffer, const uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
handlePtr->process(inBuffer, outBuffer, frames, midiEvents, midiEventCount);


+ 3
- 3
source/backend/plugin/CarlaPluginNative.cpp View File

@@ -2283,18 +2283,18 @@ public:
if (fHandle2 == nullptr)
{
fDescriptor->process(fHandle,
const_cast<const float**>(fAudioAndCvInBuffers), fAudioAndCvOutBuffers, frames,
fAudioAndCvInBuffers, fAudioAndCvOutBuffers, frames,
fMidiInEvents, fMidiEventInCount);
}
else
{
fDescriptor->process(fHandle,
(fAudioAndCvInBuffers != nullptr) ? const_cast<const float**>(&fAudioAndCvInBuffers[0]) : nullptr,
(fAudioAndCvInBuffers != nullptr) ? &fAudioAndCvInBuffers[0] : nullptr,
(fAudioAndCvOutBuffers != nullptr) ? &fAudioAndCvOutBuffers[0] : nullptr,
frames, fMidiInEvents, fMidiEventInCount);

fDescriptor->process(fHandle2,
(fAudioAndCvInBuffers != nullptr) ? const_cast<const float**>(&fAudioAndCvInBuffers[1]) : nullptr,
(fAudioAndCvInBuffers != nullptr) ? &fAudioAndCvInBuffers[1] : nullptr,
(fAudioAndCvOutBuffers != nullptr) ? &fAudioAndCvOutBuffers[1] : nullptr,
frames, fMidiInEvents, fMidiEventInCount);
}


+ 3
- 1
source/includes/CarlaNative.h View File

@@ -263,8 +263,10 @@ typedef struct _NativePluginDescriptor {

void (*activate)(NativePluginHandle handle);
void (*deactivate)(NativePluginHandle handle);

// FIXME for v3.0, use const for the input buffer
void (*process)(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount);

char* (*get_state)(NativePluginHandle handle);


+ 3
- 2
source/includes/CarlaNative.hpp View File

@@ -318,7 +318,7 @@ protected:

virtual void deactivate() {}

virtual void process(const float** inBuffer, float** outBuffer, uint32_t frames,
virtual void process(const float* const* inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount) = 0;

// -------------------------------------------------------------------
@@ -500,8 +500,9 @@ public:
handlePtr->deactivate();
}

// FIXME for v3.0, use const for the input buffer
static void _process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, const uint32_t frames,
float** inBuffer, float** outBuffer, const uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
handlePtr->process(inBuffer, outBuffer, frames, midiEvents, midiEventCount);


+ 2
- 2
source/includes/CarlaNativePrograms.hpp View File

@@ -102,7 +102,7 @@ protected:
// New Plugin program calls

virtual void setStateFromFile(const char* filename) = 0;
virtual void process2(const float** inBuffer, float** outBuffer, uint32_t frames,
virtual void process2(const float* const* inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount) = 0;

// -------------------------------------------------------------------
@@ -158,7 +158,7 @@ protected:
// -------------------------------------------------------------------
// Plugin process calls

void process(const float** const inBuffer, float** const outBuffer, uint32_t frames,
void process(const float* const* const inBuffer, float** const outBuffer, uint32_t frames,
const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override
{
const CarlaMutexTryLocker cmtl(fProgramChangeMutex, isOffline());


+ 2
- 2
source/modules/distrho/DistrhoPlugin.hpp View File

@@ -845,14 +845,14 @@ protected:
Run/process function for plugins with MIDI input.
@note Some parameters might be null if there are no audio inputs/outputs or MIDI events.
*/
virtual void run(const float** inputs, float** outputs, uint32_t frames,
virtual void run(const float* const* inputs, float** outputs, uint32_t frames,
const MidiEvent* midiEvents, uint32_t midiEventCount) = 0;
#else
/**
Run/process function for plugins without MIDI input.
@note Some parameters might be null if there are no audio inputs or outputs.
*/
virtual void run(const float** inputs, float** outputs, uint32_t frames) = 0;
virtual void run(const float* const* inputs, float** outputs, uint32_t frames) = 0;
#endif

/* --------------------------------------------------------------------------------------------------------


+ 2
- 2
source/modules/distrho/src/DistrhoPluginCarla.cpp View File

@@ -364,7 +364,7 @@ protected:
}

#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
void process(const float** const inBuffer, float** const outBuffer, const uint32_t frames,
void process(const float* const* const inBuffer, float** const outBuffer, const uint32_t frames,
const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override
{
MidiEvent realMidiEvents[midiEventCount];
@@ -389,7 +389,7 @@ protected:
fPlugin.run(inBuffer, outBuffer, frames, realMidiEvents, midiEventCount);
}
#else
void process(const float** const inBuffer, float** const outBuffer, const uint32_t frames,
void process(const float* const* const inBuffer, float** const outBuffer, const uint32_t frames,
const NativeMidiEvent* const, const uint32_t) override
{
fPlugin.run(inBuffer, outBuffer, frames);


+ 2
- 2
source/modules/distrho/src/DistrhoPluginInternal.hpp View File

@@ -552,7 +552,7 @@ public:
}

#if DISTRHO_PLUGIN_WANT_MIDI_INPUT
void run(const float** const inputs, float** const outputs, const uint32_t frames,
void run(const float* const* const inputs, float** const outputs, const uint32_t frames,
const MidiEvent* const midiEvents, const uint32_t midiEventCount)
{
DISTRHO_SAFE_ASSERT_RETURN(fData != nullptr,);
@@ -569,7 +569,7 @@ public:
fData->isProcessing = false;
}
#else
void run(const float** const inputs, float** const outputs, const uint32_t frames)
void run(const float* const* const inputs, float** const outputs, const uint32_t frames)
{
DISTRHO_SAFE_ASSERT_RETURN(fData != nullptr,);
DISTRHO_SAFE_ASSERT_RETURN(fPlugin != nullptr,);


+ 1
- 1
source/native-plugins/audio-file.cpp View File

@@ -153,7 +153,7 @@ protected:
// -------------------------------------------------------------------
// Plugin process calls

void process2(const float**, float** const outBuffer, const uint32_t frames,
void process2(const float* const*, float** const outBuffer, const uint32_t frames,
const NativeMidiEvent*, uint32_t) override
{
const NativeTimeInfo* const timePos(getTimeInfo());


+ 2
- 1
source/native-plugins/audio-gain.c View File

@@ -201,8 +201,9 @@ void handle_audio_buffers(const float* inBuffer, float* outBuffer, Filter* const
filter->z1 = z1;
}

// FIXME for v3.0, use const for the input buffer
static void audiogain_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const float gain = handlePtr->gain;


+ 1
- 1
source/native-plugins/bigmeter.cpp View File

@@ -155,7 +155,7 @@ protected:
fOutRight = 0.0f;
}

void process(const float** inputs, float**, const uint32_t frames,
void process(const float* const* inputs, float**, const uint32_t frames,
const NativeMidiEvent* const, const uint32_t) override
{
fOutLeft = carla_findMaxNormalizedFloat(inputs[0], frames);


+ 2
- 1
source/native-plugins/bypass.c View File

@@ -30,8 +30,9 @@ static NativePluginHandle bypass_instantiate(const NativeHostDescriptor* host)
(void)host;
}

// FIXME for v3.0, use const for the input buffer
static void bypass_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
if (outBuffer[0] != inBuffer[0])


+ 2
- 1
source/native-plugins/lfo.c View File

@@ -205,8 +205,9 @@ static void lfo_set_parameter_value(NativePluginHandle handle, uint32_t index, f
}
}

// FIXME for v3.0, use const for the input buffer
static void lfo_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 2
- 1
source/native-plugins/midi-channel-ab.c View File

@@ -106,8 +106,9 @@ static void midichanab_set_parameter_value(NativePluginHandle handle, uint32_t i
handlePtr->channels[index] = (value >= 0.5f);
}

// FIXME for v3.0, use const for the input buffer
static void midichanab_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 2
- 1
source/native-plugins/midi-channel-filter.c View File

@@ -106,8 +106,9 @@ static void midichanfilter_set_parameter_value(NativePluginHandle handle, uint32
handlePtr->channels[index] = (value >= 0.5f);
}

// FIXME for v3.0, use const for the input buffer
static void midichanfilter_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 2
- 1
source/native-plugins/midi-channelize.c View File

@@ -113,8 +113,9 @@ static void midichannelize_set_parameter_value(NativePluginHandle handle, uint32
}
}

// FIXME for v3.0, use const for the input buffer
static void midichannelize_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 1
- 1
source/native-plugins/midi-file.cpp View File

@@ -68,7 +68,7 @@ protected:
// -------------------------------------------------------------------
// Plugin process calls

void process2(const float**, float**, const uint32_t frames, const NativeMidiEvent* const, const uint32_t) override
void process2(const float* const*, float**, const uint32_t frames, const NativeMidiEvent* const, const uint32_t) override
{
const NativeTimeInfo* const timePos(getTimeInfo());



+ 2
- 1
source/native-plugins/midi-gain.c View File

@@ -168,8 +168,9 @@ static void midigain_set_parameter_value(NativePluginHandle handle, uint32_t ind
}
}

// FIXME for v3.0, use const for the input buffer
static void midigain_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 2
- 1
source/native-plugins/midi-join.c View File

@@ -47,8 +47,9 @@ static void midijoin_cleanup(NativePluginHandle handle)
free(handlePtr);
}

// FIXME for v3.0, use const for the input buffer
static void midijoin_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 1
- 1
source/native-plugins/midi-pattern.cpp View File

@@ -200,7 +200,7 @@ protected:
// -------------------------------------------------------------------
// Plugin process calls

void process(const float**, float**, const uint32_t frames,
void process(const float* const*, float**, const uint32_t frames,
const NativeMidiEvent* /*midiEvents*/, uint32_t /*midiEventCount*/) override
{
if (const NativeTimeInfo* const timeInfo = getTimeInfo())


+ 2
- 1
source/native-plugins/midi-split.c View File

@@ -46,8 +46,9 @@ static void midisplit_cleanup(NativePluginHandle handle)
free(handlePtr);
}

// FIXME for v3.0, use const for the input buffer
static void midisplit_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 2
- 1
source/native-plugins/midi-through.c View File

@@ -46,8 +46,9 @@ static void midithrough_cleanup(NativePluginHandle handle)
free(handlePtr);
}

// FIXME for v3.0, use const for the input buffer
static void midithrough_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 2
- 1
source/native-plugins/midi-to-cv.c View File

@@ -205,8 +205,9 @@ static void midi2cv_activate(NativePluginHandle handle)
panic(handlePtr);
}

// FIXME for v3.0, use const for the input buffer
static void midi2cv_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
float* const pitch = outBuffer[0];


+ 2
- 1
source/native-plugins/midi-transpose.c View File

@@ -130,8 +130,9 @@ static void miditranspose_set_parameter_value(NativePluginHandle handle, uint32_
}
}

// FIXME for v3.0, use const for the input buffer
static void miditranspose_process(NativePluginHandle handle,
const float** inBuffer, float** outBuffer, uint32_t frames,
float** inBuffer, float** outBuffer, uint32_t frames,
const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
{
const NativeHostDescriptor* const host = handlePtr->host;


+ 1
- 1
source/native-plugins/notes.cpp View File

@@ -83,7 +83,7 @@ protected:
// -------------------------------------------------------------------
// Plugin process calls

void process(const float**, float**, const uint32_t, const NativeMidiEvent* const, const uint32_t) override
void process(const float* const*, float**, const uint32_t, const NativeMidiEvent* const, const uint32_t) override
{
}



Loading…
Cancel
Save