Browse Source

Fix C++98 build

Signed-off-by: falkTX <falktx@falktx.com>
pull/321/head
falkTX 3 years ago
parent
commit
3576108dfd
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 45 additions and 14 deletions
  1. +29
    -8
      distrho/src/jackbridge/NativeBridge.hpp
  2. +16
    -6
      distrho/src/jackbridge/SDL2Bridge.hpp

+ 29
- 8
distrho/src/jackbridge/NativeBridge.hpp View File

@@ -25,14 +25,14 @@ using DISTRHO_NAMESPACE::HeapRingBuffer;


struct NativeBridge { struct NativeBridge {
// Current status information // Current status information
uint bufferSize = 0;
uint sampleRate = 0;
uint bufferSize;
uint sampleRate;


// Port caching information // Port caching information
uint numAudioIns = 0;
uint numAudioOuts = 0;
uint numMidiIns = 0;
uint numMidiOuts = 0;
uint numAudioIns;
uint numAudioOuts;
uint numMidiIns;
uint numMidiOuts;


// JACK callbacks // JACK callbacks
JackProcessCallback jackProcessCallback = nullptr; JackProcessCallback jackProcessCallback = nullptr;
@@ -50,8 +50,8 @@ struct NativeBridge {
kPortMaskOutputMIDI = kPortMaskOutput|kPortMaskMIDI, kPortMaskOutputMIDI = kPortMaskOutput|kPortMaskMIDI,
}; };
#if DISTRHO_PLUGIN_NUM_INPUTS+DISTRHO_PLUGIN_NUM_OUTPUTS > 0 #if DISTRHO_PLUGIN_NUM_INPUTS+DISTRHO_PLUGIN_NUM_OUTPUTS > 0
float* audioBuffers[DISTRHO_PLUGIN_NUM_INPUTS + DISTRHO_PLUGIN_NUM_OUTPUTS] = {};
float* audioBufferStorage = nullptr;
float* audioBuffers[DISTRHO_PLUGIN_NUM_INPUTS + DISTRHO_PLUGIN_NUM_OUTPUTS];
float* audioBufferStorage;
#endif #endif
#if DISTRHO_PLUGIN_WANT_MIDI_INPUT #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
static constexpr const uint32_t kMaxMIDIInputMessageSize = 3; static constexpr const uint32_t kMaxMIDIInputMessageSize = 3;
@@ -63,6 +63,27 @@ struct NativeBridge {
HeapRingBuffer midiOutBuffer; HeapRingBuffer midiOutBuffer;
#endif #endif


NativeBridge()
: bufferSize(0),
sampleRate(0),
numAudioIns(0),
numAudioOuts(0),
numMidiIns(0),
numMidiOuts(0),
jackProcessCallback(nullptr),
bufferSizeCallback(nullptr),
jackProcessArg(nullptr),
jackBufferSizeArg(nullptr),
#if DISTRHO_PLUGIN_NUM_INPUTS+DISTRHO_PLUGIN_NUM_OUTPUTS > 0
audioBuffers(),
audioBufferStorage(nullptr)
#endif
{
#if DISTRHO_PLUGIN_NUM_INPUTS+DISTRHO_PLUGIN_NUM_OUTPUTS > 0
std::memset(audioBuffers, 0, sizeof(audioBuffers));
#endif
}

virtual ~NativeBridge() {} virtual ~NativeBridge() {}
virtual bool open(const char* const clientName) = 0; virtual bool open(const char* const clientName) = 0;
virtual bool close() = 0; virtual bool close() = 0;


+ 16
- 6
distrho/src/jackbridge/SDL2Bridge.hpp View File

@@ -26,12 +26,22 @@
#endif #endif


struct SDL2Bridge : NativeBridge { struct SDL2Bridge : NativeBridge {
#if DISTRHO_PLUGIN_NUM_INPUTS > 0
SDL_AudioDeviceID captureDeviceId = 0;
#endif
#if DISTRHO_PLUGIN_NUM_OUTPUTS > 0
SDL_AudioDeviceID playbackDeviceId = 0;
#endif
#if DISTRHO_PLUGIN_NUM_INPUTS > 0
SDL_AudioDeviceID captureDeviceId;
#endif
#if DISTRHO_PLUGIN_NUM_OUTPUTS > 0
SDL_AudioDeviceID playbackDeviceId;
#endif

SDL2Bridge()
: NativeBridge()
#if DISTRHO_PLUGIN_NUM_INPUTS > 0
, captureDeviceId(0)
#endif
#if DISTRHO_PLUGIN_NUM_OUTPUTS > 0
, playbackDeviceId(0)
#endif
{}


bool open(const char* const clientName) override bool open(const char* const clientName) override
{ {


Loading…
Cancel
Save