@@ -302,7 +302,7 @@ Plugin Name | |||
<item> | |||
<widget class="QCheckBox" name="ch_force_stereo"> | |||
<property name="text"> | |||
<string>Force stereo</string> | |||
<string>Force stereo (needs restart)</string> | |||
</property> | |||
</widget> | |||
</item> | |||
@@ -426,23 +426,14 @@ public: | |||
* | |||
* \see id() | |||
*/ | |||
void setId(const unsigned int id) | |||
{ | |||
fId = id; | |||
} | |||
void setId(const unsigned int id); | |||
/*! | |||
* Set a plugin's option. | |||
* | |||
* \see options() | |||
*/ | |||
void setOption(const unsigned int option, const bool yesNo) | |||
{ | |||
if (yesNo) | |||
fOptions |= option; | |||
else | |||
fOptions &= ~option; | |||
} | |||
void setOption(const unsigned int option, const bool yesNo); | |||
/*! | |||
* Enable or disable the plugin according to \a yesNo. | |||
@@ -452,10 +443,7 @@ public: | |||
* | |||
* \see enabled() | |||
*/ | |||
void setEnabled(const bool yesNo) | |||
{ | |||
fEnabled = yesNo; | |||
} | |||
void setEnabled(const bool yesNo); | |||
/*! | |||
* Set plugin as active according to \a active. | |||
@@ -681,11 +669,6 @@ public: | |||
*/ | |||
virtual void sampleRateChanged(const double newSampleRate); | |||
/*! | |||
* Initialize all RT buffers of the plugin. | |||
*/ | |||
virtual void initBuffers(); | |||
/*! | |||
* TODO. | |||
*/ | |||
@@ -696,6 +679,19 @@ public: | |||
*/ | |||
void unlock(); | |||
// ------------------------------------------------------------------- | |||
// Plugin buffers | |||
/*! | |||
* Initialize all RT buffers of the plugin. | |||
*/ | |||
virtual void initBuffers(); | |||
/*! | |||
* Delete and clear all RT buffers. | |||
*/ | |||
virtual void clearBuffers(); | |||
// ------------------------------------------------------------------- | |||
// OSC stuff | |||
@@ -22,6 +22,7 @@ | |||
#include <QtCore/QFile> | |||
#include <QtCore/QTextStream> | |||
#include <QtCore/QSettings> | |||
CARLA_BACKEND_START_NAMESPACE | |||
@@ -146,6 +147,86 @@ const char* CarlaPluginProtectedData::libError(const char* const filename) | |||
return lib_error(filename); | |||
} | |||
// ------------------------------------------------------------------- | |||
// Settings functions | |||
void CarlaPluginProtectedData::saveSetting(const unsigned int option, const bool yesNo) | |||
{ | |||
QSettings settings("falkTX", "CarlaPluginSettings"); | |||
settings.beginGroup((const char*)idStr); | |||
switch (option) | |||
{ | |||
case PLUGIN_OPTION_FIXED_BUFFER: | |||
settings.setValue("FixedBuffer", yesNo); | |||
break; | |||
case PLUGIN_OPTION_FORCE_STEREO: | |||
settings.setValue("ForceStereo", yesNo); | |||
break; | |||
case PLUGIN_OPTION_MAP_PROGRAM_CHANGES: | |||
settings.setValue("MapProgramChanges", yesNo); | |||
break; | |||
case PLUGIN_OPTION_USE_CHUNKS: | |||
settings.setValue("UseChunks", yesNo); | |||
break; | |||
case PLUGIN_OPTION_SEND_CONTROL_CHANGES: | |||
settings.setValue("SendControlChanges", yesNo); | |||
break; | |||
case PLUGIN_OPTION_SEND_CHANNEL_PRESSURE: | |||
settings.setValue("SendChannelPressure", yesNo); | |||
break; | |||
case PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH: | |||
settings.setValue("SendNoteAftertouch", yesNo); | |||
break; | |||
case PLUGIN_OPTION_SEND_PITCHBEND: | |||
settings.setValue("SendPitchbend", yesNo); | |||
break; | |||
case PLUGIN_OPTION_SEND_ALL_SOUND_OFF: | |||
settings.setValue("SendAllSoundOff", yesNo); | |||
break; | |||
default: | |||
break; | |||
} | |||
settings.endGroup(); | |||
} | |||
unsigned int CarlaPluginProtectedData::loadSettings(const unsigned int options, const unsigned int availOptions) | |||
{ | |||
QSettings settings("falkTX", "CarlaPluginSettings"); | |||
settings.beginGroup((const char*)idStr); | |||
unsigned int newOptions = 0x0; | |||
#define CHECK_AND_SET_OPTION(STR, BIT) \ | |||
if ((availOptions & BIT) != 0 || BIT == PLUGIN_OPTION_FORCE_STEREO) \ | |||
{ \ | |||
if (settings.contains(STR)) \ | |||
{ \ | |||
if (settings.value(STR, bool(options & BIT)).toBool()) \ | |||
newOptions |= BIT; \ | |||
} \ | |||
else if (options & BIT) \ | |||
newOptions |= BIT; \ | |||
} | |||
CHECK_AND_SET_OPTION("FixedBuffer", PLUGIN_OPTION_FIXED_BUFFER); | |||
CHECK_AND_SET_OPTION("ForceStereo", PLUGIN_OPTION_FORCE_STEREO); | |||
CHECK_AND_SET_OPTION("MapProgramChanges", PLUGIN_OPTION_MAP_PROGRAM_CHANGES); | |||
CHECK_AND_SET_OPTION("UseChunks", PLUGIN_OPTION_USE_CHUNKS); | |||
CHECK_AND_SET_OPTION("SendControlChanges", PLUGIN_OPTION_SEND_CONTROL_CHANGES); | |||
CHECK_AND_SET_OPTION("SendChannelPressure", PLUGIN_OPTION_SEND_CHANNEL_PRESSURE); | |||
CHECK_AND_SET_OPTION("SendNoteAftertouch", PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH); | |||
CHECK_AND_SET_OPTION("SendPitchbend", PLUGIN_OPTION_SEND_PITCHBEND); | |||
CHECK_AND_SET_OPTION("SendAllSoundOff", PLUGIN_OPTION_SEND_ALL_SOUND_OFF); | |||
#undef CHECK_AND_SET_OPTION | |||
settings.endGroup(); | |||
return newOptions; | |||
} | |||
// ------------------------------------------------------------------- | |||
// Plugin Helpers | |||
@@ -199,9 +280,6 @@ CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const unsigned int id) | |||
CARLA_ASSERT(id == 0); | |||
break; | |||
} | |||
if (engine->getOptions().forceStereo) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
} | |||
CarlaPlugin::~CarlaPlugin() | |||
@@ -900,6 +978,31 @@ bool CarlaPlugin::loadStateFromFile(const char* const filename) | |||
// ------------------------------------------------------------------- | |||
// Set data (internal stuff) | |||
void CarlaPlugin::setId(const unsigned int id) | |||
{ | |||
fId = id; | |||
} | |||
void CarlaPlugin::setOption(const unsigned int option, const bool yesNo) | |||
{ | |||
CARLA_ASSERT(availableOptions() & option); | |||
if (yesNo) | |||
fOptions |= option; | |||
else | |||
fOptions &= ~option; | |||
kData->saveSetting(option, yesNo); | |||
} | |||
void CarlaPlugin::setEnabled(const bool yesNo) | |||
{ | |||
fEnabled = yesNo; | |||
} | |||
// ------------------------------------------------------------------- | |||
// Set data (internal stuff) | |||
void CarlaPlugin::setActive(const bool active, const bool sendOsc, const bool sendCallback) | |||
{ | |||
if (kData->active == active) | |||
@@ -1432,13 +1535,6 @@ void CarlaPlugin::sampleRateChanged(const double) | |||
{ | |||
} | |||
void CarlaPlugin::initBuffers() | |||
{ | |||
kData->audioIn.initBuffers(kData->engine); | |||
kData->audioOut.initBuffers(kData->engine); | |||
kData->event.initBuffers(kData->engine); | |||
} | |||
bool CarlaPlugin::tryLock() | |||
{ | |||
return kData->masterMutex.tryLock(); | |||
@@ -1449,6 +1545,21 @@ void CarlaPlugin::unlock() | |||
kData->masterMutex.unlock(); | |||
} | |||
// ------------------------------------------------------------------- | |||
// Plugin buffers | |||
void CarlaPlugin::initBuffers() | |||
{ | |||
kData->audioIn.initBuffers(kData->engine); | |||
kData->audioOut.initBuffers(kData->engine); | |||
kData->event.initBuffers(kData->engine); | |||
} | |||
void CarlaPlugin::clearBuffers() | |||
{ | |||
kData->clearBuffers(); | |||
} | |||
// ------------------------------------------------------------------- | |||
// OSC stuff | |||
@@ -396,6 +396,7 @@ struct CarlaPluginProtectedData { | |||
// misc | |||
int8_t ctrlChannel; | |||
unsigned int extraHints; | |||
CarlaString idStr; | |||
// latency | |||
uint32_t latency; | |||
@@ -654,6 +655,12 @@ struct CarlaPluginProtectedData { | |||
void* libSymbol(const char* const symbol); | |||
const char* libError(const char* const filename); | |||
// ------------------------------------------------------------------- | |||
// Settings functions, see CarlaPlugin.cpp | |||
void saveSetting(const unsigned int option, const bool yesNo); | |||
unsigned int loadSettings(const unsigned int options, const unsigned int availOptions); | |||
// ------------------------------------------------------------------- | |||
// Static helper functions | |||
@@ -39,7 +39,8 @@ public: | |||
fDssiDescriptor(nullptr), | |||
fAudioInBuffers(nullptr), | |||
fAudioOutBuffers(nullptr), | |||
fParamBuffers(nullptr) | |||
fParamBuffers(nullptr), | |||
fLastChunk(nullptr) | |||
{ | |||
carla_debug("DssiPlugin::DssiPlugin(%p, %i)", engine, id); | |||
@@ -90,6 +91,12 @@ public: | |||
fDssiDescriptor = nullptr; | |||
} | |||
if (fLastChunk != nullptr) | |||
{ | |||
std::free(fLastChunk); | |||
fLastChunk = nullptr; | |||
} | |||
clearBuffers(); | |||
} | |||
@@ -145,10 +152,8 @@ public: | |||
#ifdef __USE_GNU | |||
const bool isDssiVst = fFilename.contains("dssi-vst", true); | |||
const bool isZASX = fFilename.contains("zynaddsubfx", true); | |||
#else | |||
const bool isDssiVst = fFilename.contains("dssi-vst"); | |||
const bool isZASX = fFilename.contains("zynaddsubfx"); | |||
#endif | |||
unsigned int options = 0x0; | |||
@@ -164,15 +169,16 @@ public: | |||
{ | |||
if (kData->engine->getProccessMode() != PROCESS_MODE_CONTINUOUS_RACK) | |||
{ | |||
if (kData->audioIn.count <= 1 && kData->audioOut.count <= 1 && (kData->audioIn.count != 0 || kData->audioOut.count != 0)) | |||
if (fOptions & PLUGIN_OPTION_FORCE_STEREO) | |||
options |= PLUGIN_OPTION_FORCE_STEREO; | |||
else if (kData->audioIn.count <= 1 && kData->audioOut.count <= 1 && (kData->audioIn.count != 0 || kData->audioOut.count != 0)) | |||
options |= PLUGIN_OPTION_FORCE_STEREO; | |||
} | |||
if (! isZASX) | |||
options |= PLUGIN_OPTION_FIXED_BUFFER; | |||
options |= PLUGIN_OPTION_FIXED_BUFFER; | |||
} | |||
if (kData->extraHints & PLUGIN_HINT_HAS_MIDI_IN) | |||
if (fDssiDescriptor->run_synth != nullptr || fDssiDescriptor->run_multiple_synths != nullptr) | |||
{ | |||
options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
@@ -310,12 +316,22 @@ public: | |||
if (fDssiDescriptor->set_custom_data == nullptr) | |||
return; | |||
// FIXME | |||
fChunk = QByteArray::fromBase64(QByteArray(stringData)); | |||
//fChunk.toBase64(); | |||
if (fLastChunk != nullptr) | |||
{ | |||
std::free(fLastChunk); | |||
fLastChunk = nullptr; | |||
} | |||
const size_t size(CarlaString(stringData).exportAsBase64Binary(&fLastChunk)); | |||
const ScopedSingleProcessLocker spl(this, true); | |||
fDssiDescriptor->set_custom_data(fHandle, fChunk.data(), (unsigned long)fChunk.size()); | |||
CARLA_ASSERT(size > 0); | |||
CARLA_ASSERT(fLastChunk != nullptr); | |||
if (size > 0 && fLastChunk != nullptr) | |||
{ | |||
const ScopedSingleProcessLocker spl(this, true); | |||
fDssiDescriptor->set_custom_data(fHandle, fLastChunk, static_cast<unsigned long>(size)); | |||
} | |||
} | |||
void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) | |||
@@ -706,7 +722,7 @@ public: | |||
portName += ":"; | |||
} | |||
portName += "event-in"; | |||
portName += "events-in"; | |||
portName.truncate(portNameSize); | |||
kData->event.portIn = (CarlaEngineEventPort*)kData->client->addPort(kEnginePortTypeEvent, portName, true); | |||
@@ -722,21 +738,19 @@ public: | |||
portName += ":"; | |||
} | |||
portName += "event-out"; | |||
portName += "events-out"; | |||
portName.truncate(portNameSize); | |||
kData->event.portOut = (CarlaEngineEventPort*)kData->client->addPort(kEnginePortTypeEvent, portName, false); | |||
} | |||
if (forcedStereoIn || forcedStereoOut) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
else | |||
fOptions &= ~PLUGIN_OPTION_FORCE_STEREO; | |||
// plugin hints | |||
const bool hasGUI = (fHints & PLUGIN_HAS_GUI); | |||
#ifdef __USE_GNU | |||
const bool isDssiVst = fFilename.contains("dssi-vst", true); | |||
const bool isZASX = fFilename.contains("zynaddsubfx", true); | |||
#else | |||
const bool isDssiVst = fFilename.contains("dssi-vst"); | |||
const bool isZASX = fFilename.contains("zynaddsubfx"); | |||
#endif | |||
const bool hasGUI = (fHints & PLUGIN_HAS_GUI); | |||
fHints = 0x0; | |||
@@ -764,34 +778,6 @@ public: | |||
if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0)) | |||
kData->extraHints |= PLUGIN_HINT_CAN_RUN_RACK; | |||
// plugin options | |||
fOptions = 0x0; | |||
fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
if (forcedStereoIn || forcedStereoOut) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
if (isDssiVst) | |||
{ | |||
fOptions |= PLUGIN_OPTION_FIXED_BUFFER; | |||
if (kData->engine->getOptions().useDssiVstChunks && fDssiDescriptor->get_custom_data != nullptr && fDssiDescriptor->set_custom_data != nullptr) | |||
fOptions |= PLUGIN_OPTION_USE_CHUNKS; | |||
} | |||
else if (isZASX) | |||
{ | |||
fOptions |= PLUGIN_OPTION_FIXED_BUFFER; | |||
} | |||
if (mIns > 0) | |||
{ | |||
fOptions |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
fOptions |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
fOptions |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
fOptions |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
} | |||
// check latency | |||
if (fHints & PLUGIN_CAN_DRYWET) | |||
{ | |||
@@ -845,6 +831,9 @@ public: | |||
bufferSizeChanged(kData->engine->getBufferSize()); | |||
reloadPrograms(true); | |||
if (kData->active) | |||
activate(); | |||
carla_debug("DssiPlugin::reload() - end"); | |||
} | |||
@@ -988,7 +977,7 @@ public: | |||
unsigned long midiEventCount = 0; | |||
// -------------------------------------------------------------------------------------------------------- | |||
// Check if not active before | |||
// Check if needs reset | |||
if (kData->needsReset) | |||
{ | |||
@@ -1592,6 +1581,7 @@ public: | |||
void bufferSizeChanged(const uint32_t newBufferSize) | |||
{ | |||
CARLA_ASSERT_INT(newBufferSize > 0, newBufferSize); | |||
carla_debug("DssiPlugin::bufferSizeChanged(%i) - start", newBufferSize); | |||
for (uint32_t i=0; i < kData->audioIn.count; ++i) | |||
@@ -1648,6 +1638,17 @@ public: | |||
carla_debug("DssiPlugin::bufferSizeChanged(%i) - start", newBufferSize); | |||
} | |||
void sampleRateChanged(const double newSampleRate) | |||
{ | |||
CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); | |||
carla_debug("DssiPlugin::sampleRateChanged(%i) - start", newSampleRate); | |||
// TODO | |||
(void)newSampleRate; | |||
carla_debug("DssiPlugin::sampleRateChanged(%i) - end", newSampleRate); | |||
} | |||
// ------------------------------------------------------------------- | |||
// Post-poned events | |||
@@ -1760,7 +1761,7 @@ public: | |||
fParamBuffers = nullptr; | |||
} | |||
kData->clearBuffers(); | |||
CarlaPlugin::clearBuffers(); | |||
carla_debug("DssiPlugin::clearBuffers() - end"); | |||
} | |||
@@ -1880,8 +1881,47 @@ public: | |||
fHints |= PLUGIN_HAS_GUI; | |||
} | |||
// TODO - load settings for options: | |||
//fOptions & PLUGIN_OPTION_FORCE_STEREO | |||
// --------------------------------------------------------------- | |||
// load plugin settings | |||
{ | |||
#ifdef __USE_GNU | |||
const bool isDssiVst = fFilename.contains("dssi-vst", true); | |||
#else | |||
const bool isDssiVst = fFilename.contains("dssi-vst"); | |||
#endif | |||
// set default options | |||
fOptions = 0x0; | |||
fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
if (kData->engine->getOptions().forceStereo) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
if (isDssiVst) | |||
{ | |||
fOptions |= PLUGIN_OPTION_FIXED_BUFFER; | |||
if (kData->engine->getOptions().useDssiVstChunks && fDssiDescriptor->get_custom_data != nullptr && fDssiDescriptor->set_custom_data != nullptr) | |||
fOptions |= PLUGIN_OPTION_USE_CHUNKS; | |||
} | |||
if (fDssiDescriptor->run_synth != nullptr || fDssiDescriptor->run_multiple_synths != nullptr) | |||
{ | |||
fOptions |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
fOptions |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
fOptions |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
fOptions |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
} | |||
// load settings | |||
kData->idStr = "DSSI/"; | |||
kData->idStr += std::strrchr(filename, OS_SEP)+1; | |||
kData->idStr += "/"; | |||
kData->idStr += label; | |||
fOptions = kData->loadSettings(fOptions, availableOptions()); | |||
} | |||
return true; | |||
} | |||
@@ -1892,11 +1932,11 @@ private: | |||
const LADSPA_Descriptor* fDescriptor; | |||
const DSSI_Descriptor* fDssiDescriptor; | |||
float** fAudioInBuffers; | |||
float** fAudioOutBuffers; | |||
float* fParamBuffers; | |||
float** fAudioInBuffers; | |||
float** fAudioOutBuffers; | |||
float* fParamBuffers; | |||
uint8_t* fLastChunk; | |||
snd_seq_event_t fMidiEvents[MAX_MIDI_EVENTS]; | |||
QByteArray fChunk; | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DssiPlugin) | |||
}; | |||
@@ -170,7 +170,9 @@ public: | |||
if (kData->engine->getProccessMode() != PROCESS_MODE_CONTINUOUS_RACK) | |||
{ | |||
if (kData->audioIn.count <= 1 && kData->audioOut.count <= 1 && (kData->audioIn.count != 0 || kData->audioOut.count != 0)) | |||
if (fOptions & PLUGIN_OPTION_FORCE_STEREO) | |||
options |= PLUGIN_OPTION_FORCE_STEREO; | |||
else if (kData->audioIn.count <= 1 && kData->audioOut.count <= 1 && (kData->audioIn.count != 0 || kData->audioOut.count != 0)) | |||
options |= PLUGIN_OPTION_FORCE_STEREO; | |||
} | |||
@@ -710,6 +712,11 @@ public: | |||
kData->event.portOut = (CarlaEngineEventPort*)kData->client->addPort(kEnginePortTypeEvent, portName, false); | |||
} | |||
if (forcedStereoIn || forcedStereoOut) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
else | |||
fOptions &= ~PLUGIN_OPTION_FORCE_STEREO; | |||
// plugin hints | |||
fHints = 0x0; | |||
@@ -728,12 +735,6 @@ public: | |||
if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0)) | |||
kData->extraHints |= PLUGIN_HINT_CAN_RUN_RACK; | |||
// plugin options | |||
fOptions = 0x0; | |||
if (forcedStereoIn || forcedStereoOut) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
// check latency | |||
if (fHints & PLUGIN_CAN_DRYWET) | |||
{ | |||
@@ -1212,6 +1213,7 @@ public: | |||
void bufferSizeChanged(const uint32_t newBufferSize) | |||
{ | |||
CARLA_ASSERT_INT(newBufferSize > 0, newBufferSize); | |||
carla_debug("LadspaPlugin::bufferSizeChanged(%i) - start", newBufferSize); | |||
for (uint32_t i=0; i < kData->audioIn.count; ++i) | |||
@@ -1268,8 +1270,19 @@ public: | |||
carla_debug("LadspaPlugin::bufferSizeChanged(%i) - end", newBufferSize); | |||
} | |||
void sampleRateChanged(const double newSampleRate) | |||
{ | |||
CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); | |||
carla_debug("LadspaPlugin::sampleRateChanged(%i) - start", newSampleRate); | |||
// TODO | |||
(void)newSampleRate; | |||
carla_debug("LadspaPlugin::sampleRateChanged(%i) - end", newSampleRate); | |||
} | |||
// ------------------------------------------------------------------- | |||
// Cleanup | |||
// Plugin buffers | |||
void clearBuffers() | |||
{ | |||
@@ -1311,7 +1324,7 @@ public: | |||
fParamBuffers = nullptr; | |||
} | |||
kData->clearBuffers(); | |||
CarlaPlugin::clearBuffers(); | |||
carla_debug("LadspaPlugin::clearBuffers() - end"); | |||
} | |||
@@ -1426,8 +1439,25 @@ public: | |||
return false; | |||
} | |||
// TODO - load settings for options: | |||
//fOptions & PLUGIN_OPTION_FORCE_STEREO | |||
// --------------------------------------------------------------- | |||
// load plugin settings | |||
{ | |||
// set default options | |||
fOptions = 0x0; | |||
if (kData->engine->getOptions().forceStereo) | |||
fOptions |= PLUGIN_OPTION_FORCE_STEREO; | |||
// load settings | |||
kData->idStr = "LADSPA/"; | |||
kData->idStr += std::strrchr(filename, OS_SEP)+1; | |||
kData->idStr += "/"; | |||
kData->idStr += CarlaString(uniqueId()); | |||
kData->idStr += "/"; | |||
kData->idStr += label; | |||
fOptions = kData->loadSettings(fOptions, availableOptions()); | |||
} | |||
return true; | |||
} | |||
@@ -54,7 +54,7 @@ debug: | |||
# -------------------------------------------------------------- | |||
%.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp CarlaPluginGui.hpp CarlaPluginInternal.hpp CarlaPluginThread.hpp moc_CarlaPluginGui.cpp | |||
%.cpp.o: %.cpp ../CarlaBackend.hpp ../CarlaEngine.hpp ../CarlaPlugin.hpp CarlaPluginGui.hpp CarlaPluginInternal.hpp CarlaPluginThread.hpp | |||
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
moc_%.cpp: %.hpp | |||
@@ -760,9 +760,9 @@ const CarlaPluginInfo* carla_get_plugin_info(unsigned int pluginId) | |||
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) | |||
{ | |||
char strBufLabel[STR_MAX] = { 0 }; | |||
char strBufMaker[STR_MAX] = { 0 }; | |||
char strBufCopyright[STR_MAX] = { 0 }; | |||
char strBufLabel[STR_MAX+1] = { '\0' }; | |||
char strBufMaker[STR_MAX+1] = { '\0' }; | |||
char strBufCopyright[STR_MAX+1] = { '\0' }; | |||
info.type = plugin->type(); | |||
info.category = plugin->category(); | |||
@@ -906,9 +906,9 @@ const CarlaParameterInfo* carla_get_parameter_info(unsigned int pluginId, uint32 | |||
{ | |||
if (parameterId < plugin->parameterCount()) | |||
{ | |||
char strBufName[STR_MAX] = { 0 }; | |||
char strBufSymbol[STR_MAX] = { 0 }; | |||
char strBufUnit[STR_MAX] = { 0 }; | |||
char strBufName[STR_MAX+1] = { '\0' }; | |||
char strBufSymbol[STR_MAX+1] = { '\0' }; | |||
char strBufUnit[STR_MAX+1] = { '\0' }; | |||
info.scalePointCount = plugin->parameterScalePointCount(parameterId); | |||
@@ -957,7 +957,7 @@ const CarlaScalePointInfo* carla_get_parameter_scalepoint_info(unsigned int plug | |||
{ | |||
if (scalePointId < plugin->parameterScalePointCount(parameterId)) | |||
{ | |||
char strBufLabel[STR_MAX] = { 0 }; | |||
char strBufLabel[STR_MAX+1] = { '\0' }; | |||
info.value = plugin->getParameterScalePointValue(parameterId, scalePointId); | |||
@@ -1181,8 +1181,8 @@ const char* carla_get_parameter_text(unsigned int pluginId, uint32_t parameterId | |||
if (standalone.engine == nullptr) | |||
return nullptr; | |||
static char textBuf[STR_MAX]; | |||
carla_zeroMem(textBuf, sizeof(char)*STR_MAX); | |||
static char textBuf[STR_MAX+1]; | |||
carla_fill<char>(textBuf, STR_MAX+1, '\0'); | |||
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) | |||
{ | |||
@@ -1208,8 +1208,8 @@ const char* carla_get_program_name(unsigned int pluginId, uint32_t programId) | |||
if (standalone.engine == nullptr) | |||
return nullptr; | |||
static char programName[STR_MAX]; | |||
carla_zeroMem(programName, sizeof(char)*STR_MAX); | |||
static char programName[STR_MAX+1]; | |||
carla_fill<char>(programName, STR_MAX+1, '\0'); | |||
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) | |||
{ | |||
@@ -1236,8 +1236,8 @@ const char* carla_get_midi_program_name(unsigned int pluginId, uint32_t midiProg | |||
if (standalone.engine == nullptr) | |||
return nullptr; | |||
static char midiProgramName[STR_MAX]; | |||
carla_zeroMem(midiProgramName, sizeof(char)*STR_MAX); | |||
static char midiProgramName[STR_MAX+1]; | |||
carla_fill<char>(midiProgramName, STR_MAX+1, '\0'); | |||
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) | |||
{ | |||
@@ -1264,8 +1264,8 @@ const char* carla_get_real_plugin_name(unsigned int pluginId) | |||
if (standalone.engine == nullptr) | |||
return nullptr; | |||
static char realPluginName[STR_MAX]; | |||
carla_zeroMem(realPluginName, sizeof(char)*STR_MAX); | |||
static char realPluginName[STR_MAX+1]; | |||
carla_fill<char>(realPluginName, STR_MAX+1, '\0'); | |||
if (CarlaPlugin* const plugin = standalone.engine->getPlugin(pluginId)) | |||
{ | |||
@@ -1071,7 +1071,7 @@ void do_vst_check(void* const libHandle, const bool init) | |||
return; | |||
} | |||
char strBuf[STR_MAX] = { 0 }; | |||
char strBuf[STR_MAX+1] = { 0 }; | |||
CarlaString cName; | |||
CarlaString cProduct; | |||
CarlaString cVendor; | |||
@@ -1100,14 +1100,14 @@ void do_vst_check(void* const libHandle, const bool init) | |||
return; | |||
} | |||
carla_zeroMem(strBuf, sizeof(char)*STR_MAX); | |||
carla_fill<char>(strBuf, STR_MAX+1, '\0'); | |||
if (effect->dispatcher(effect, effGetVendorString, 0, 0, strBuf, 0.0f) == 1) | |||
cVendor = strBuf; | |||
while (gVstCurrentUniqueId != 0) | |||
{ | |||
carla_zeroMem(strBuf, sizeof(char)*STR_MAX); | |||
carla_fill<char>(strBuf, STR_MAX+1, '\0'); | |||
if (effect->dispatcher(effect, effGetProductString, 0, 0, strBuf, 0.0f) == 1) | |||
cProduct = strBuf; | |||
@@ -1276,7 +1276,7 @@ void do_vst_check(void* const libHandle, const bool init) | |||
if (vstCategory == kPlugCategShell) | |||
{ | |||
carla_zeroMem(strBuf, sizeof(char)*STR_MAX); | |||
carla_fill<char>(strBuf, STR_MAX+1, '\0'); | |||
if ((gVstCurrentUniqueId = effect->dispatcher(effect, effShellGetNextPlugin, 0, 0, strBuf, 0.0f)) != 0) | |||
cName = strBuf; | |||