@@ -260,6 +260,7 @@ struct CARLA_API EngineOptions { | |||||
Wine() noexcept; | Wine() noexcept; | ||||
~Wine() noexcept; | ~Wine() noexcept; | ||||
CARLA_DECLARE_NON_COPY_STRUCT(Wine) | |||||
} wine; | } wine; | ||||
#ifndef DOXYGEN | #ifndef DOXYGEN | ||||
@@ -215,7 +215,8 @@ EngineOptions::EngineOptions() noexcept | |||||
binaryDir(nullptr), | binaryDir(nullptr), | ||||
resourceDir(nullptr), | resourceDir(nullptr), | ||||
preventBadBehaviour(false), | preventBadBehaviour(false), | ||||
frontendWinId(0) {} | |||||
frontendWinId(0), | |||||
wine() {} | |||||
EngineOptions::~EngineOptions() noexcept | EngineOptions::~EngineOptions() noexcept | ||||
{ | { | ||||
@@ -975,10 +975,8 @@ void RackGraph::processHelper(CarlaEngine::ProtectedData* const data, const floa | |||||
EngineInternalGraph::EngineInternalGraph(CarlaEngine* const engine) noexcept | EngineInternalGraph::EngineInternalGraph(CarlaEngine* const engine) noexcept | ||||
: fIsReady(false), | : fIsReady(false), | ||||
kEngine(engine) | |||||
{ | |||||
fRack = nullptr; | |||||
} | |||||
fRack(nullptr), | |||||
kEngine(engine) {} | |||||
EngineInternalGraph::~EngineInternalGraph() noexcept | EngineInternalGraph::~EngineInternalGraph() noexcept | ||||
{ | { | ||||
@@ -59,7 +59,7 @@ void EngineInternalEvents::clear() noexcept | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// InternalTime | // InternalTime | ||||
static const float kTicksPerBeat = 1920.0f; | |||||
static const double kTicksPerBeat = 1920.0; | |||||
#if defined(HAVE_HYLIA) && !defined(BUILD_BRIDGE) | #if defined(HAVE_HYLIA) && !defined(BUILD_BRIDGE) | ||||
static uint32_t calculate_link_latency(const double bufferSize, const double sampleRate) noexcept | static uint32_t calculate_link_latency(const double bufferSize, const double sampleRate) noexcept | ||||
@@ -81,6 +81,9 @@ EngineInternalTime::EngineInternalTime(EngineTimeInfo& ti, const EngineTransport | |||||
tick(0.0), | tick(0.0), | ||||
needsReset(false), | needsReset(false), | ||||
nextFrame(0), | nextFrame(0), | ||||
#ifndef BUILD_BRIDGE | |||||
hylia(), | |||||
#endif | |||||
timeInfo(ti), | timeInfo(ti), | ||||
transportMode(tm) {} | transportMode(tm) {} | ||||
@@ -197,7 +200,7 @@ void EngineInternalTime::fillEngineTimeInfo(const uint32_t newFrames) noexcept | |||||
else | else | ||||
#endif | #endif | ||||
{ | { | ||||
const double min = timeInfo.frame / (sampleRate * 60.0); | |||||
const double min = static_cast<double>(timeInfo.frame) / (sampleRate * 60.0); | |||||
abs_tick = min * beatsPerMinute * kTicksPerBeat; | abs_tick = min * beatsPerMinute * kTicksPerBeat; | ||||
abs_beat = abs_tick / kTicksPerBeat; | abs_beat = abs_tick / kTicksPerBeat; | ||||
needsReset = false; | needsReset = false; | ||||
@@ -228,7 +231,7 @@ void EngineInternalTime::fillEngineTimeInfo(const uint32_t newFrames) noexcept | |||||
} | } | ||||
} | } | ||||
timeInfo.bbt.beatsPerBar = beatsPerBar; | |||||
timeInfo.bbt.beatsPerBar = static_cast<float>(beatsPerBar); | |||||
timeInfo.bbt.beatsPerMinute = beatsPerMinute; | timeInfo.bbt.beatsPerMinute = beatsPerMinute; | ||||
timeInfo.bbt.tick = (int32_t)(ticktmp + 0.5); | timeInfo.bbt.tick = (int32_t)(ticktmp + 0.5); | ||||
tick = ticktmp; | tick = ticktmp; | ||||
@@ -302,7 +305,7 @@ void EngineInternalTime::fillJackTimeInfo(jack_position_t* const pos, const uint | |||||
} | } | ||||
} | } | ||||
pos->beats_per_bar = beatsPerBar; | |||||
pos->beats_per_bar = static_cast<float>(beatsPerBar); | |||||
pos->beats_per_minute = beatsPerMinute; | pos->beats_per_minute = beatsPerMinute; | ||||
pos->tick = (int32_t)(ticktmp + 0.5); | pos->tick = (int32_t)(ticktmp + 0.5); | ||||
tick = ticktmp; | tick = ticktmp; | ||||
@@ -318,12 +321,12 @@ void EngineInternalTime::preProcess(const uint32_t numFrames) | |||||
const double new_bpb = hylia.timeInfo.beatsPerBar; | const double new_bpb = hylia.timeInfo.beatsPerBar; | ||||
const double new_bpm = hylia.timeInfo.beatsPerMinute; | const double new_bpm = hylia.timeInfo.beatsPerMinute; | ||||
if (new_bpb >= 1.0 && beatsPerBar != new_bpb) | |||||
if (new_bpb >= 1.0 && carla_isNotEqual(beatsPerBar, new_bpb)) | |||||
{ | { | ||||
beatsPerBar = new_bpb; | beatsPerBar = new_bpb; | ||||
needsReset = true; | needsReset = true; | ||||
} | } | ||||
if (new_bpm > 0.0 && beatsPerMinute != new_bpm) | |||||
if (new_bpm > 0.0 && carla_isNotEqual(beatsPerMinute, new_bpm)) | |||||
{ | { | ||||
beatsPerMinute = new_bpm; | beatsPerMinute = new_bpm; | ||||
needsReset = true; | needsReset = true; | ||||
@@ -341,13 +344,14 @@ void EngineInternalTime::preProcess(const uint32_t numFrames) | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
EngineInternalTime::Hylia::Hylia() | EngineInternalTime::Hylia::Hylia() | ||||
: enabled(false), | : enabled(false), | ||||
# ifdef HAVE_HYLIA | |||||
instance(hylia_create()) | |||||
# else | |||||
instance(nullptr) | |||||
# endif | |||||
instance(nullptr), | |||||
timeInfo() | |||||
{ | { | ||||
carla_zeroStruct(timeInfo); | carla_zeroStruct(timeInfo); | ||||
# ifdef HAVE_HYLIA | |||||
instance = hylia_create(); | |||||
# endif | |||||
} | } | ||||
EngineInternalTime::Hylia::~Hylia() | EngineInternalTime::Hylia::~Hylia() | ||||
@@ -122,8 +122,10 @@ private: | |||||
bool enabled; | bool enabled; | ||||
hylia_t* instance; | hylia_t* instance; | ||||
hylia_time_info_t timeInfo; | hylia_time_info_t timeInfo; | ||||
Hylia(); | Hylia(); | ||||
~Hylia(); | ~Hylia(); | ||||
CARLA_DECLARE_NON_COPY_STRUCT(Hylia) | |||||
} hylia; | } hylia; | ||||
#endif | #endif | ||||
@@ -132,7 +132,7 @@ public: | |||||
} | } | ||||
if (! kIsInput) | if (! kIsInput) | ||||
carla_zeroFloats(fBuffer, static_cast<int>(bufferSize)); | |||||
carla_zeroFloats(fBuffer, bufferSize); | |||||
} | } | ||||
void invalidate() noexcept | void invalidate() noexcept | ||||
@@ -224,7 +224,7 @@ public: | |||||
} | } | ||||
if (! kIsInput) | if (! kIsInput) | ||||
carla_zeroFloats(fBuffer, static_cast<int>(bufferSize)); | |||||
carla_zeroFloats(fBuffer, bufferSize); | |||||
} | } | ||||
void invalidate() noexcept | void invalidate() noexcept | ||||
@@ -90,6 +90,7 @@ public: | |||||
fBinary(), | fBinary(), | ||||
fLabel(), | fLabel(), | ||||
fShmIds(), | fShmIds(), | ||||
fWinePrefix(), | |||||
fProcess() {} | fProcess() {} | ||||
void setData(const char* const winePrefix, | void setData(const char* const winePrefix, | ||||
@@ -328,10 +329,10 @@ private: | |||||
CarlaEngine* const kEngine; | CarlaEngine* const kEngine; | ||||
CarlaPlugin* const kPlugin; | CarlaPlugin* const kPlugin; | ||||
String fWinePrefix; | |||||
String fBinary; | String fBinary; | ||||
String fLabel; | String fLabel; | ||||
String fShmIds; | String fShmIds; | ||||
String fWinePrefix; | |||||
ScopedPointer<ChildProcess> fProcess; | ScopedPointer<ChildProcess> fProcess; | ||||
@@ -360,6 +361,7 @@ public: | |||||
fShmRtClientControl(), | fShmRtClientControl(), | ||||
fShmNonRtClientControl(), | fShmNonRtClientControl(), | ||||
fShmNonRtServerControl(), | fShmNonRtServerControl(), | ||||
fWinePrefix(), | |||||
fInfo(), | fInfo(), | ||||
fUniqueId(0), | fUniqueId(0), | ||||
fLatency(0), | fLatency(0), | ||||
@@ -1318,6 +1320,9 @@ public: | |||||
read += kBridgeBaseMidiOutHeaderSize + size; | read += kBridgeBaseMidiOutHeaderSize + size; | ||||
} | } | ||||
// TODO | |||||
(void)port; | |||||
} // End of Control and MIDI Output | } // End of Control and MIDI Output | ||||
} | } | ||||
@@ -1408,10 +1408,16 @@ public: | |||||
carla_zeroFloats(fAudio16Buffers[i], frames); | carla_zeroFloats(fAudio16Buffers[i], frames); | ||||
// FIXME use '32' or '16' instead of outs | // FIXME use '32' or '16' instead of outs | ||||
fluid_synth_process(fSynth, frames, 0, nullptr, static_cast<int>(pData->audioOut.count), fAudio16Buffers); | |||||
fluid_synth_process(fSynth, static_cast<int>(frames), | |||||
0, nullptr, | |||||
static_cast<int>(pData->audioOut.count), fAudio16Buffers); | |||||
} | } | ||||
else | else | ||||
fluid_synth_write_float(fSynth, frames, outBuffer[0] + timeOffset, 0, 1, outBuffer[1] + timeOffset, 0, 1); | |||||
{ | |||||
fluid_synth_write_float(fSynth, static_cast<int>(frames), | |||||
outBuffer[0] + timeOffset, 0, 1, | |||||
outBuffer[1] + timeOffset, 0, 1); | |||||
} | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
// -------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------- | ||||
@@ -467,7 +467,7 @@ void CarlaPlugin::ProtectedData::Latency::recreateBuffers(const uint32_t newChan | |||||
{ | { | ||||
const uint32_t diff = frames - oldFrames; | const uint32_t diff = frames - oldFrames; | ||||
carla_zeroFloats(buffers[i], diff); | carla_zeroFloats(buffers[i], diff); | ||||
carla_copyFloats(buffers[i] + diff, oldBuffers[i], static_cast<int>(oldFrames)); | |||||
carla_copyFloats(buffers[i] + diff, oldBuffers[i], oldFrames); | |||||
} | } | ||||
} | } | ||||
else | else | ||||
@@ -452,7 +452,7 @@ public: | |||||
CarlaString portName; | CarlaString portName; | ||||
// Audio Ins | // Audio Ins | ||||
for (uint32_t j=0; j < fInfo.aIns; ++j) | |||||
for (uint8_t j=0; j < fInfo.aIns; ++j) | |||||
{ | { | ||||
portName.clear(); | portName.clear(); | ||||
@@ -479,7 +479,7 @@ public: | |||||
} | } | ||||
// Audio Outs | // Audio Outs | ||||
for (uint32_t j=0; j < fInfo.aOuts; ++j) | |||||
for (uint8_t j=0; j < fInfo.aOuts; ++j) | |||||
{ | { | ||||
portName.clear(); | portName.clear(); | ||||
@@ -871,6 +871,9 @@ public: | |||||
read += kBridgeBaseMidiOutHeaderSize + size; | read += kBridgeBaseMidiOutHeaderSize + size; | ||||
} | } | ||||
// TODO | |||||
(void)port; | |||||
} // End of Control and MIDI Output | } // End of Control and MIDI Output | ||||
} | } | ||||
@@ -1219,10 +1222,10 @@ public: | |||||
CARLA_SAFE_ASSERT_RETURN(label[i] >= '0' && label[i] < '0'+0x4f, false); | CARLA_SAFE_ASSERT_RETURN(label[i] >= '0' && label[i] < '0'+0x4f, false); | ||||
} | } | ||||
fInfo.aIns = label[0] - '0'; | |||||
fInfo.aOuts = label[1] - '0'; | |||||
fInfo.mIns = carla_minPositive(label[2] - '0', 1); | |||||
fInfo.mOuts = carla_minPositive(label[3] - '0', 1); | |||||
fInfo.aIns = static_cast<uint8_t>(label[0] - '0'); | |||||
fInfo.aOuts = static_cast<uint8_t>(label[1] - '0'); | |||||
fInfo.mIns = static_cast<uint8_t>(carla_minPositive(label[2] - '0', 1)); | |||||
fInfo.mOuts = static_cast<uint8_t>(carla_minPositive(label[3] - '0', 1)); | |||||
fInfo.setupLabel = label; | fInfo.setupLabel = label; | ||||
@@ -1339,8 +1342,8 @@ private: | |||||
BridgeNonRtServerControl fShmNonRtServerControl; | BridgeNonRtServerControl fShmNonRtServerControl; | ||||
struct Info { | struct Info { | ||||
uint32_t aIns, aOuts; | |||||
uint32_t mIns, mOuts; | |||||
uint8_t aIns, aOuts; | |||||
uint8_t mIns, mOuts; | |||||
uint optionsAvailable; | uint optionsAvailable; | ||||
CarlaString setupLabel; | CarlaString setupLabel; | ||||
std::vector<uint8_t> chunk; | std::vector<uint8_t> chunk; | ||||
@@ -1377,7 +1380,7 @@ private: | |||||
void resizeAudioPool(const uint32_t bufferSize) | void resizeAudioPool(const uint32_t bufferSize) | ||||
{ | { | ||||
fShmAudioPool.resize(bufferSize, fInfo.aIns+fInfo.aOuts, 0); | |||||
fShmAudioPool.resize(bufferSize, static_cast<uint32_t>(fInfo.aIns+fInfo.aOuts), 0); | |||||
fShmRtClientControl.writeOpcode(kPluginBridgeRtClientSetAudioPool); | fShmRtClientControl.writeOpcode(kPluginBridgeRtClientSetAudioPool); | ||||
fShmRtClientControl.writeULong(static_cast<uint64_t>(fShmAudioPool.dataSize)); | fShmRtClientControl.writeULong(static_cast<uint64_t>(fShmAudioPool.dataSize)); | ||||
@@ -1263,7 +1263,7 @@ public: | |||||
if (latframes <= frames) | if (latframes <= frames) | ||||
{ | { | ||||
for (uint32_t i=0; i < pData->audioIn.count; ++i) | for (uint32_t i=0; i < pData->audioIn.count; ++i) | ||||
carla_copyFloats(pData->latency.buffers[i], audioIn[i]+(frames-latframes), static_cast<int>(latframes)); | |||||
carla_copyFloats(pData->latency.buffers[i], audioIn[i]+(frames-latframes), latframes); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -4537,8 +4537,10 @@ public: | |||||
LV2_Inline_Display_Image_Surface* renderInlineDisplay(int width, int height) | LV2_Inline_Display_Image_Surface* renderInlineDisplay(int width, int height) | ||||
{ | { | ||||
CARLA_SAFE_ASSERT_RETURN(fExt.inlineDisplay != nullptr && fExt.inlineDisplay->render != nullptr, nullptr); | CARLA_SAFE_ASSERT_RETURN(fExt.inlineDisplay != nullptr && fExt.inlineDisplay->render != nullptr, nullptr); | ||||
CARLA_SAFE_ASSERT_RETURN(width > 0, nullptr); | |||||
CARLA_SAFE_ASSERT_RETURN(height > 0, nullptr); | |||||
return fExt.inlineDisplay->render(fHandle, width, height); | |||||
return fExt.inlineDisplay->render(fHandle, static_cast<uint32_t>(width), static_cast<uint32_t>(height)); | |||||
} | } | ||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
@@ -6314,6 +6316,9 @@ CarlaPlugin* CarlaPlugin::newLV2(const Initializer& init) | |||||
return plugin; | return plugin; | ||||
} | } | ||||
// used in CarlaStandalone.cpp | |||||
void* carla_render_inline_display_lv2(CarlaPlugin* plugin, int width, int height); | |||||
void* carla_render_inline_display_lv2(CarlaPlugin* plugin, int width, int height) | void* carla_render_inline_display_lv2(CarlaPlugin* plugin, int width, int height) | ||||
{ | { | ||||
CarlaPluginLV2* const lv2Plugin = (CarlaPluginLV2*)plugin; | CarlaPluginLV2* const lv2Plugin = (CarlaPluginLV2*)plugin; | ||||
@@ -30,18 +30,49 @@ | |||||
#include "AppConfig.h" | #include "AppConfig.h" | ||||
#include "juce_core/juce_core.h" | #include "juce_core/juce_core.h" | ||||
// --------------------------------------------------------------------------------------------------------------------- | |||||
// -Weffc++ compat ext widget | |||||
extern "C" { | |||||
typedef struct _LV2_External_UI_Widget_Compat { | |||||
void (*run )(struct _LV2_External_UI_Widget_Compat*); | |||||
void (*show)(struct _LV2_External_UI_Widget_Compat*); | |||||
void (*hide)(struct _LV2_External_UI_Widget_Compat*); | |||||
_LV2_External_UI_Widget_Compat() noexcept | |||||
: run(nullptr), show(nullptr), hide(nullptr) {} | |||||
} LV2_External_UI_Widget_Compat; | |||||
} | |||||
// --------------------------------------------------------------------------------------------------------------------- | // --------------------------------------------------------------------------------------------------------------------- | ||||
CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Weffc++" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Weffc++" | |||||
#endif | |||||
class CarlaEngineLV2Single : public CarlaEngine, | class CarlaEngineLV2Single : public CarlaEngine, | ||||
public LV2_External_UI_Widget | |||||
public LV2_External_UI_Widget_Compat | |||||
{ | { | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
public: | public: | ||||
CarlaEngineLV2Single(const uint32_t bufferSize, const double sampleRate, const char* const bundlePath, const LV2_URID_Map* uridMap) | CarlaEngineLV2Single(const uint32_t bufferSize, const double sampleRate, const char* const bundlePath, const LV2_URID_Map* uridMap) | ||||
: fPlugin(nullptr), | : fPlugin(nullptr), | ||||
fIsActive(false), | fIsActive(false), | ||||
fIsOffline(false) | |||||
fIsOffline(false), | |||||
fPorts(), | |||||
fUI() | |||||
{ | { | ||||
run = extui_run; | run = extui_run; | ||||
show = extui_show; | show = extui_show; | ||||
@@ -326,8 +357,11 @@ protected: | |||||
switch (action) | switch (action) | ||||
{ | { | ||||
case ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED: | case ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED: | ||||
CARLA_SAFE_ASSERT_RETURN(value1 >= 0,); | |||||
if (fUI.writeFunction != nullptr && fUI.controller != nullptr && fUI.visible) | if (fUI.writeFunction != nullptr && fUI.controller != nullptr && fUI.visible) | ||||
fUI.writeFunction(fUI.controller, value1+fPorts.indexOffset, sizeof(float), 0, &value3); | |||||
fUI.writeFunction(fUI.controller, | |||||
static_cast<uint32_t>(value1)+fPorts.indexOffset, | |||||
sizeof(float), 0, &value3); | |||||
break; | break; | ||||
case ENGINE_CALLBACK_UI_STATE_CHANGED: | case ENGINE_CALLBACK_UI_STATE_CHANGED: | ||||
@@ -524,7 +558,6 @@ private: | |||||
} | } | ||||
CARLA_DECLARE_NON_COPY_STRUCT(Ports); | CARLA_DECLARE_NON_COPY_STRUCT(Ports); | ||||
} fPorts; | } fPorts; | ||||
struct UI { | struct UI { | ||||
@@ -538,25 +571,26 @@ private: | |||||
: writeFunction(nullptr), | : writeFunction(nullptr), | ||||
controller(nullptr), | controller(nullptr), | ||||
host(nullptr), | host(nullptr), | ||||
name(), | |||||
visible(false) {} | visible(false) {} | ||||
CARLA_DECLARE_NON_COPY_STRUCT(UI) | |||||
} fUI; | } fUI; | ||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
#define handlePtr ((CarlaEngineLV2Single*)handle) | #define handlePtr ((CarlaEngineLV2Single*)handle) | ||||
static void extui_run(LV2_External_UI_Widget* handle) | |||||
static void extui_run(LV2_External_UI_Widget_Compat* handle) | |||||
{ | { | ||||
handlePtr->handleUiRun(); | handlePtr->handleUiRun(); | ||||
} | } | ||||
static void extui_show(LV2_External_UI_Widget* handle) | |||||
static void extui_show(LV2_External_UI_Widget_Compat* handle) | |||||
{ | { | ||||
handlePtr->handleUiShow(); | handlePtr->handleUiShow(); | ||||
} | } | ||||
static void extui_hide(LV2_External_UI_Widget* handle) | |||||
static void extui_hide(LV2_External_UI_Widget_Compat* handle) | |||||
{ | { | ||||
handlePtr->handleUiHide(); | handlePtr->handleUiHide(); | ||||
} | } | ||||
@@ -57,6 +57,8 @@ protected: | |||||
private: | private: | ||||
Callback* const fCallback; | Callback* const fCallback; | ||||
CARLA_DECLARE_NON_COPY_CLASS(CarlaJackRealtimeThread) | |||||
}; | }; | ||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
@@ -82,6 +84,8 @@ protected: | |||||
private: | private: | ||||
Callback* const fCallback; | Callback* const fCallback; | ||||
CARLA_DECLARE_NON_COPY_CLASS(CarlaJackNonRealtimeThread) | |||||
}; | }; | ||||
static int carla_interposed_callback(int, void*); | static int carla_interposed_callback(int, void*); | ||||
@@ -97,6 +101,11 @@ public: | |||||
CarlaJackAppClient() | CarlaJackAppClient() | ||||
: fServer(this), | : fServer(this), | ||||
fClients(), | |||||
fShmAudioPool(), | |||||
fShmRtClientControl(), | |||||
fShmNonRtClientControl(), | |||||
fShmNonRtServerControl(), | |||||
fAudioPoolCopy(nullptr), | fAudioPoolCopy(nullptr), | ||||
fAudioTmpBuf(nullptr), | fAudioTmpBuf(nullptr), | ||||
fDummyMidiInBuffer(true, "ignored"), | fDummyMidiInBuffer(true, "ignored"), | ||||
@@ -141,10 +150,10 @@ public: | |||||
fBaseNameNonRtClientControl[6] = '\0'; | fBaseNameNonRtClientControl[6] = '\0'; | ||||
fBaseNameNonRtServerControl[6] = '\0'; | fBaseNameNonRtServerControl[6] = '\0'; | ||||
fServer.numAudioIns = libjackSetup[0] - '0'; | |||||
fServer.numAudioOuts = libjackSetup[1] - '0'; | |||||
fServer.numMidiIns = libjackSetup[2] - '0'; | |||||
fServer.numMidiOuts = libjackSetup[3] - '0'; | |||||
fServer.numAudioIns = static_cast<uint8_t>(libjackSetup[0] - '0'); | |||||
fServer.numAudioOuts = static_cast<uint8_t>(libjackSetup[1] - '0'); | |||||
fServer.numMidiIns = static_cast<uint8_t>(libjackSetup[2] - '0'); | |||||
fServer.numMidiOuts = static_cast<uint8_t>(libjackSetup[3] - '0'); | |||||
fSessionManager = libjackSetup[4] - '0'; | fSessionManager = libjackSetup[4] - '0'; | ||||
fSetupHints = libjackSetup[5] - '0'; | fSetupHints = libjackSetup[5] - '0'; | ||||
@@ -483,25 +492,24 @@ bool CarlaJackAppClient::handleRtData() | |||||
} | } | ||||
break; | break; | ||||
case kPluginBridgeRtClientSetSampleRate: | |||||
if (const double newSampleRate = fShmRtClientControl.readDouble()) | |||||
case kPluginBridgeRtClientSetSampleRate: { | |||||
const double newSampleRate = fShmRtClientControl.readDouble(); | |||||
if (carla_isNotZero(newSampleRate) && carla_isNotEqual(fServer.sampleRate, newSampleRate)) | |||||
{ | { | ||||
if (fServer.sampleRate != newSampleRate) | |||||
{ | |||||
const CarlaMutexLocker cml(fRealtimeThreadMutex); | |||||
const CarlaMutexLocker cml(fRealtimeThreadMutex); | |||||
fServer.sampleRate = newSampleRate; | |||||
fServer.sampleRate = newSampleRate; | |||||
for (LinkedList<JackClientState*>::Itenerator it = fClients.begin2(); it.valid(); it.next()) | |||||
{ | |||||
JackClientState* const jclient(it.getValue(nullptr)); | |||||
CARLA_SAFE_ASSERT_CONTINUE(jclient != nullptr); | |||||
for (LinkedList<JackClientState*>::Itenerator it = fClients.begin2(); it.valid(); it.next()) | |||||
{ | |||||
JackClientState* const jclient(it.getValue(nullptr)); | |||||
CARLA_SAFE_ASSERT_CONTINUE(jclient != nullptr); | |||||
jclient->sampleRateCb(fServer.sampleRate, jclient->sampleRateCbPtr); | |||||
} | |||||
jclient->sampleRateCb(static_cast<uint32_t>(fServer.sampleRate), jclient->sampleRateCbPtr); | |||||
} | } | ||||
} | } | ||||
break; | |||||
} break; | |||||
case kPluginBridgeRtClientSetOnline: | case kPluginBridgeRtClientSetOnline: | ||||
// TODO inform changes | // TODO inform changes | ||||
@@ -627,9 +635,9 @@ bool CarlaJackAppClient::handleRtData() | |||||
// set audio inputs | // set audio inputs | ||||
i = 0; | i = 0; | ||||
for (LinkedList<JackPortState*>::Itenerator it = jclient->audioIns.begin2(); it.valid(); it.next()) | |||||
for (LinkedList<JackPortState*>::Itenerator it2 = jclient->audioIns.begin2(); it2.valid(); it2.next()) | |||||
{ | { | ||||
JackPortState* const jport = it.getValue(nullptr); | |||||
JackPortState* const jport = it2.getValue(nullptr); | |||||
CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | ||||
if (i++ < fServer.numAudioIns) | if (i++ < fServer.numAudioIns) | ||||
@@ -660,9 +668,9 @@ bool CarlaJackAppClient::handleRtData() | |||||
// set audio ouputs | // set audio ouputs | ||||
i = 0; | i = 0; | ||||
for (LinkedList<JackPortState*>::Itenerator it = jclient->audioOuts.begin2(); it.valid(); it.next()) | |||||
for (LinkedList<JackPortState*>::Itenerator it2 = jclient->audioOuts.begin2(); it2.valid(); it2.next()) | |||||
{ | { | ||||
JackPortState* const jport = it.getValue(nullptr); | |||||
JackPortState* const jport = it2.getValue(nullptr); | |||||
CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | ||||
if (i++ < fServer.numAudioOuts) | if (i++ < fServer.numAudioOuts) | ||||
@@ -685,9 +693,9 @@ bool CarlaJackAppClient::handleRtData() | |||||
// set midi inputs | // set midi inputs | ||||
i = 0; | i = 0; | ||||
for (LinkedList<JackPortState*>::Itenerator it = jclient->midiIns.begin2(); it.valid(); it.next()) | |||||
for (LinkedList<JackPortState*>::Itenerator it2 = jclient->midiIns.begin2(); it2.valid(); it2.next()) | |||||
{ | { | ||||
JackPortState* const jport = it.getValue(nullptr); | |||||
JackPortState* const jport = it2.getValue(nullptr); | |||||
CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | ||||
if (i++ < fServer.numMidiIns) | if (i++ < fServer.numMidiIns) | ||||
@@ -698,9 +706,9 @@ bool CarlaJackAppClient::handleRtData() | |||||
// set midi outputs | // set midi outputs | ||||
i = 0; | i = 0; | ||||
for (LinkedList<JackPortState*>::Itenerator it = jclient->midiOuts.begin2(); it.valid(); it.next()) | |||||
for (LinkedList<JackPortState*>::Itenerator it2 = jclient->midiOuts.begin2(); it2.valid(); it2.next()) | |||||
{ | { | ||||
JackPortState* const jport = it.getValue(nullptr); | |||||
JackPortState* const jport = it2.getValue(nullptr); | |||||
CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | CARLA_SAFE_ASSERT_CONTINUE(jport != nullptr); | ||||
if (i++ < fServer.numMidiOuts) | if (i++ < fServer.numMidiOuts) | ||||
@@ -739,9 +747,9 @@ bool CarlaJackAppClient::handleRtData() | |||||
if (jclient->audioOuts.count() == 1 && fServer.numAudioOuts > 1) | if (jclient->audioOuts.count() == 1 && fServer.numAudioOuts > 1) | ||||
{ | { | ||||
for (uint8_t i=1; i<fServer.numAudioOuts; ++i) | |||||
for (uint8_t j=1; j<fServer.numAudioOuts; ++j) | |||||
{ | { | ||||
carla_copyFloats(fdataRealOuts+(fServer.bufferSize*i), | |||||
carla_copyFloats(fdataRealOuts+(fServer.bufferSize*j), | |||||
fdataCopyOuts, | fdataCopyOuts, | ||||
fServer.bufferSize); | fServer.bufferSize); | ||||
} | } | ||||
@@ -1051,7 +1059,7 @@ void CarlaJackAppClient::runNonRealtimeThread() | |||||
} | } | ||||
else if (JackClientState* const jclient = fClients.getLast(nullptr)) | else if (JackClientState* const jclient = fClients.getLast(nullptr)) | ||||
{ | { | ||||
const CarlaMutexLocker cms(jclient->mutex); | |||||
const CarlaMutexLocker cms2(jclient->mutex); | |||||
activated = jclient->activated; | activated = jclient->activated; | ||||
} | } | ||||
else | else | ||||
@@ -91,6 +91,8 @@ struct JackMidiPortBuffer { | |||||
delete[] events; | delete[] events; | ||||
delete[] bufferPool; | delete[] bufferPool; | ||||
} | } | ||||
CARLA_DECLARE_NON_COPY_STRUCT(JackMidiPortBuffer) | |||||
}; | }; | ||||
struct JackPortState { | struct JackPortState { | ||||
@@ -112,7 +114,8 @@ struct JackPortState { | |||||
flags(0), | flags(0), | ||||
isMidi(false), | isMidi(false), | ||||
isSystem(false), | isSystem(false), | ||||
isConnected(false) {} | |||||
isConnected(false), | |||||
unused(false) {} | |||||
JackPortState(const char* const cn, const char* const pn, const uint i, const uint f, | JackPortState(const char* const cn, const char* const pn, const uint i, const uint f, | ||||
const bool midi, const bool sys, const bool con) | const bool midi, const bool sys, const bool con) | ||||
@@ -123,7 +126,8 @@ struct JackPortState { | |||||
flags(f), | flags(f), | ||||
isMidi(midi), | isMidi(midi), | ||||
isSystem(sys), | isSystem(sys), | ||||
isConnected(con) | |||||
isConnected(con), | |||||
unused(false) | |||||
{ | { | ||||
char strBuf[STR_MAX+1]; | char strBuf[STR_MAX+1]; | ||||
snprintf(strBuf, STR_MAX, "%s:%s", cn, pn); | snprintf(strBuf, STR_MAX, "%s:%s", cn, pn); | ||||
@@ -137,6 +141,8 @@ struct JackPortState { | |||||
free(name); | free(name); | ||||
free(fullname); | free(fullname); | ||||
} | } | ||||
CARLA_DECLARE_NON_COPY_STRUCT(JackPortState) | |||||
}; | }; | ||||
struct JackClientState { | struct JackClientState { | ||||
@@ -176,6 +182,7 @@ struct JackClientState { | |||||
JackClientState(const JackServerState& s, const char* const n) | JackClientState(const JackServerState& s, const char* const n) | ||||
: server(s), | : server(s), | ||||
mutex(), | |||||
activated(false), | activated(false), | ||||
deactivated(false), | deactivated(false), | ||||
name(strdup(n)), | name(strdup(n)), | ||||
@@ -232,6 +239,8 @@ struct JackClientState { | |||||
audioIns.clear(); | audioIns.clear(); | ||||
audioOuts.clear(); | audioOuts.clear(); | ||||
} | } | ||||
CARLA_DECLARE_NON_COPY_STRUCT(JackClientState) | |||||
}; | }; | ||||
struct JackServerState { | struct JackServerState { | ||||
@@ -256,10 +265,13 @@ struct JackServerState { | |||||
numAudioOuts(0), | numAudioOuts(0), | ||||
numMidiIns(0), | numMidiIns(0), | ||||
numMidiOuts(0), | numMidiOuts(0), | ||||
playing(false) | |||||
playing(false), | |||||
position() | |||||
{ | { | ||||
carla_zeroStruct(position); | carla_zeroStruct(position); | ||||
} | } | ||||
CARLA_DECLARE_NON_COPY_STRUCT(JackServerState) | |||||
}; | }; | ||||
CARLA_BACKEND_END_NAMESPACE | CARLA_BACKEND_END_NAMESPACE | ||||
@@ -85,12 +85,12 @@ jack_port_t* jack_port_by_name(jack_client_t* client, const char* name) | |||||
const int commonFlags = JackPortIsPhysical|JackPortIsTerminal; | const int commonFlags = JackPortIsPhysical|JackPortIsTerminal; | ||||
static const JackPortState capturePorts[] = { | static const JackPortState capturePorts[] = { | ||||
JackPortState("system", "capture_1", 0, JackPortIsOutput|commonFlags, false, true, jserver.numAudioIns > 0), | |||||
JackPortState("system", "capture_2", 1, JackPortIsOutput|commonFlags, false, true, jserver.numAudioIns > 1), | |||||
{ "system", "capture_1", 0, JackPortIsOutput|commonFlags, false, true, jserver.numAudioIns > 0 }, | |||||
{ "system", "capture_2", 1, JackPortIsOutput|commonFlags, false, true, jserver.numAudioIns > 1 }, | |||||
}; | }; | ||||
static const JackPortState playbackPorts[] = { | static const JackPortState playbackPorts[] = { | ||||
JackPortState("system", "playback_1", 3, JackPortIsInput|commonFlags, false, true, jserver.numAudioOuts > 0), | |||||
JackPortState("system", "playback_2", 4, JackPortIsInput|commonFlags, false, true, jserver.numAudioOuts > 1), | |||||
{ "system", "playback_1", 3, JackPortIsInput|commonFlags, false, true, jserver.numAudioOuts > 0 }, | |||||
{ "system", "playback_2", 4, JackPortIsInput|commonFlags, false, true, jserver.numAudioOuts > 1 }, | |||||
}; | }; | ||||
if (std::strncmp(name, "system:", 7) == 0) | if (std::strncmp(name, "system:", 7) == 0) | ||||
@@ -18,6 +18,19 @@ | |||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
#include "CarlaMathUtils.hpp" | #include "CarlaMathUtils.hpp" | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Weffc++" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Weffc++" | |||||
# pragma GCC diagnostic ignored "-Wconversion" | |||||
# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" | |||||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
#endif | |||||
#include "Misc/Allocator.h" | |||||
#include "Effects/Alienwah.h" | #include "Effects/Alienwah.h" | ||||
#include "Effects/Chorus.h" | #include "Effects/Chorus.h" | ||||
#include "Effects/Distorsion.h" | #include "Effects/Distorsion.h" | ||||
@@ -25,13 +38,17 @@ | |||||
#include "Effects/Echo.h" | #include "Effects/Echo.h" | ||||
#include "Effects/Phaser.h" | #include "Effects/Phaser.h" | ||||
#include "Effects/Reverb.h" | #include "Effects/Reverb.h" | ||||
#include "Misc/Allocator.h" | |||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
#include "AppConfig.h" | #include "AppConfig.h" | ||||
#include "juce_core/juce_core.h" | #include "juce_core/juce_core.h" | ||||
using juce::roundToIntAccurate; | using juce::roundToIntAccurate; | ||||
using juce::SharedResourcePointer; | |||||
using namespace zyncarla; | using namespace zyncarla; | ||||
@@ -53,7 +70,8 @@ protected: | |||||
fFilterParams(nullptr), | fFilterParams(nullptr), | ||||
fEffect(nullptr), | fEffect(nullptr), | ||||
efxoutl(nullptr), | efxoutl(nullptr), | ||||
efxoutr(nullptr) | |||||
efxoutr(nullptr), | |||||
fAllocator() | |||||
{ | { | ||||
efxoutl = new float[fBufferSize]; | efxoutl = new float[fBufferSize]; | ||||
efxoutr = new float[fBufferSize]; | efxoutr = new float[fBufferSize]; | ||||
@@ -120,7 +138,7 @@ protected: | |||||
void setMidiProgram(const uint8_t, const uint32_t, const uint32_t program) final | void setMidiProgram(const uint8_t, const uint32_t, const uint32_t program) final | ||||
{ | { | ||||
fNextProgram = program; | |||||
fNextProgram = static_cast<int32_t>(program); | |||||
} | } | ||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
@@ -197,7 +215,7 @@ protected: | |||||
void sampleRateChanged(const double sampleRate) final | void sampleRateChanged(const double sampleRate) final | ||||
{ | { | ||||
if (fSampleRate == sampleRate) | |||||
if (carla_isEqual(fSampleRate, sampleRate)) | |||||
return; | return; | ||||
fSampleRate = sampleRate; | fSampleRate = sampleRate; | ||||
@@ -217,7 +235,7 @@ protected: | |||||
delete fEffect; | delete fEffect; | ||||
} | } | ||||
EffectParams pars(fAllocator.getObject(), false, efxoutl, efxoutr, 0, | |||||
EffectParams pars(fAllocator, false, efxoutl, efxoutr, 0, | |||||
static_cast<uint>(fSampleRate), static_cast<int>(fBufferSize), &fFilterParams); | static_cast<uint>(fSampleRate), static_cast<int>(fBufferSize), &fFilterParams); | ||||
fEffect = new ZynFX(pars); | fEffect = new ZynFX(pars); | ||||
@@ -257,8 +275,7 @@ protected: | |||||
float* efxoutl; | float* efxoutl; | ||||
float* efxoutr; | float* efxoutr; | ||||
// FIXME - is this thread-safe? | |||||
SharedResourcePointer<AllocatorClass> fAllocator; | |||||
AllocatorClass fAllocator; | |||||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAbstractPlugin) | CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FxAbstractPlugin) | ||||
}; | }; | ||||
@@ -23,14 +23,32 @@ | |||||
#include "CarlaMathUtils.hpp" | #include "CarlaMathUtils.hpp" | ||||
#include "distrho/extra/ScopedPointer.hpp" | #include "distrho/extra/ScopedPointer.hpp" | ||||
#include <ctime> | |||||
#include <set> | |||||
#include <string> | |||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Weffc++" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Weffc++" | |||||
# pragma GCC diagnostic ignored "-Wconversion" | |||||
# pragma GCC diagnostic ignored "-Wnon-virtual-dtor" | |||||
// # pragma GCC diagnostic ignored "-Wsign-conversion" | |||||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
#endif | |||||
#include "Misc/Master.h" | #include "Misc/Master.h" | ||||
#include "Misc/MiddleWare.h" | #include "Misc/MiddleWare.h" | ||||
#include "Misc/Part.h" | #include "Misc/Part.h" | ||||
#include "Misc/Util.h" | #include "Misc/Util.h" | ||||
#include <ctime> | |||||
#include <set> | |||||
#include <string> | |||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
#include "AppConfig.h" | #include "AppConfig.h" | ||||
#include "juce_core/juce_core.h" | #include "juce_core/juce_core.h" | ||||
@@ -83,7 +101,7 @@ public: | |||||
// refresh banks | // refresh banks | ||||
master.bank.rescanforbanks(); | master.bank.rescanforbanks(); | ||||
for (std::size_t i=0, size=master.bank.banks.size(); i<size; ++i) | |||||
for (std::uint32_t i=0, size=static_cast<uint32_t>(master.bank.banks.size()); i<size; ++i) | |||||
{ | { | ||||
const std::string dir(master.bank.banks[i].dir); | const std::string dir(master.bank.banks[i].dir); | ||||
@@ -99,7 +117,7 @@ public: | |||||
if (instrument.name.empty() || instrument.name[0] == ' ') | if (instrument.name.empty() || instrument.name[0] == ' ') | ||||
continue; | continue; | ||||
programs.push_back(new ProgramInfo(i+1, ninstrument, instrument.name.c_str(), instrument.filename.c_str())); | |||||
programs.push_back(new ProgramInfo(i+1U, ninstrument, instrument.name.c_str(), instrument.filename.c_str())); | |||||
} | } | ||||
} | } | ||||
@@ -293,6 +311,7 @@ public: | |||||
fMiddleWare(nullptr), | fMiddleWare(nullptr), | ||||
fMaster(nullptr), | fMaster(nullptr), | ||||
fSynth(), | fSynth(), | ||||
fConfig(), | |||||
fDefaultState(nullptr), | fDefaultState(nullptr), | ||||
fMutex(), | fMutex(), | ||||
fMiddleWareThread(new MiddleWareThread()) | fMiddleWareThread(new MiddleWareThread()) | ||||
@@ -986,29 +1005,34 @@ private: | |||||
++msgtmp; | ++msgtmp; | ||||
} | } | ||||
const int partn = std::atoi(partnstr); | |||||
const int ipartn = std::atoi(partnstr); | |||||
CARLA_SAFE_ASSERT_RETURN(ipartn >= 0,); | |||||
const uint partn = static_cast<uint>(ipartn); | |||||
++msgtmp; | ++msgtmp; | ||||
/**/ if (std::strcmp(msgtmp, "Penabled") == 0) | /**/ if (std::strcmp(msgtmp, "Penabled") == 0) | ||||
{ | { | ||||
const int index = kParamPart01Enabled+partn; | |||||
const bool enbl = rtosc_argument(msg,0).T; | |||||
const uint index = kParamPart01Enabled+partn; | |||||
const bool enable = rtosc_argument(msg,0).T; | |||||
fParameters[index] = enbl ? 1.0f : 0.0f; | |||||
uiParameterChanged(kParamPart01Enabled+partn, enbl ? 1.0f : 0.0f); | |||||
fParameters[index] = enable ? 1.0f : 0.0f; | |||||
uiParameterChanged(kParamPart01Enabled+partn, enable ? 1.0f : 0.0f); | |||||
} | } | ||||
else if (std::strcmp(msgtmp, "Pvolume") == 0) | else if (std::strcmp(msgtmp, "Pvolume") == 0) | ||||
{ | { | ||||
const int index = kParamPart01Volume+partn; | |||||
const int value = rtosc_argument(msg,0).i; | |||||
const uint index = kParamPart01Volume+partn; | |||||
const int ivalue = rtosc_argument(msg,0).i; | |||||
const float value = static_cast<float>(ivalue); | |||||
fParameters[index] = value; | fParameters[index] = value; | ||||
uiParameterChanged(kParamPart01Volume+partn, value); | uiParameterChanged(kParamPart01Volume+partn, value); | ||||
} | } | ||||
else if (std::strcmp(msgtmp, "Ppanning") == 0) | else if (std::strcmp(msgtmp, "Ppanning") == 0) | ||||
{ | { | ||||
const int index = kParamPart01Panning+partn; | |||||
const int value = rtosc_argument(msg,0).i; | |||||
const uint index = kParamPart01Panning+partn; | |||||
const int ivalue = rtosc_argument(msg,0).i; | |||||
const float value = static_cast<float>(ivalue); | |||||
fParameters[index] = value; | fParameters[index] = value; | ||||
uiParameterChanged(kParamPart01Panning+partn, value); | uiParameterChanged(kParamPart01Panning+partn, value); | ||||
@@ -25,6 +25,7 @@ | |||||
CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
static inline | |||||
bool runMainLoopOnce() | bool runMainLoopOnce() | ||||
{ | { | ||||
#if defined(CARLA_OS_WIN) | #if defined(CARLA_OS_WIN) | ||||
@@ -230,6 +230,26 @@ float carla_findMaxNormalizedFloat(float floats[], const std::size_t count) | |||||
return maxf2; | return maxf2; | ||||
} | } | ||||
/* | |||||
* Multiply an array with a fixed value, float-specific version. | |||||
*/ | |||||
static inline | |||||
void carla_multiply(float data[], const float& multiplier, const std::size_t count) noexcept | |||||
{ | |||||
CARLA_SAFE_ASSERT_RETURN(data != nullptr,); | |||||
CARLA_SAFE_ASSERT_RETURN(count > 0,); | |||||
if (carla_isZero(multiplier)) | |||||
{ | |||||
std::memset(data, 0, count*sizeof(float)); | |||||
} | |||||
else | |||||
{ | |||||
for (std::size_t i=0; i<count; ++i) | |||||
*data++ *= multiplier; | |||||
} | |||||
} | |||||
// -------------------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------------------- | ||||
// Missing functions in old OSX versions. | // Missing functions in old OSX versions. | ||||