| @@ -256,9 +256,9 @@ struct EngineOptions { | |||||
| forceStereo(false), | forceStereo(false), | ||||
| preferPluginBridges(false), | preferPluginBridges(false), | ||||
| preferUiBridges(true), | preferUiBridges(true), | ||||
| #ifdef WANT_DSSI | |||||
| #ifdef WANT_DSSI | |||||
| useDssiVstChunks(false), | useDssiVstChunks(false), | ||||
| #endif | |||||
| #endif | |||||
| maxParameters(MAX_DEFAULT_PARAMETERS), | maxParameters(MAX_DEFAULT_PARAMETERS), | ||||
| oscUiTimeout(4000), | oscUiTimeout(4000), | ||||
| preferredBufferSize(512), | preferredBufferSize(512), | ||||
| @@ -704,6 +704,21 @@ public: | |||||
| // m_carlaPlugins[id] = plugin; | // m_carlaPlugins[id] = plugin; | ||||
| //} | //} | ||||
| // ------------------------------------------------------------------- | |||||
| // Project management | |||||
| /*! | |||||
| * Load \a filename session. | |||||
| * \note Already loaded plugins are not removed, but added afterwards.\n | |||||
| * Call removeAllPlugins() first if needed. | |||||
| */ | |||||
| void loadProject(const char* const filename); | |||||
| /*! | |||||
| * Save current session to \a filename. | |||||
| */ | |||||
| void saveProject(const char* const filename); | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Information (base) | // Information (base) | ||||
| @@ -22,6 +22,9 @@ | |||||
| #include "carla_native.h" | #include "carla_native.h" | ||||
| #include "carla_utils.hpp" | #include "carla_utils.hpp" | ||||
| // FIXME | |||||
| #include "carla_state_utils.hpp" | |||||
| // Avoid including extra libs here | // Avoid including extra libs here | ||||
| struct LADSPA_RDF_Descriptor; | struct LADSPA_RDF_Descriptor; | ||||
| typedef void* lo_address; | typedef void* lo_address; | ||||
| @@ -372,6 +375,21 @@ public: | |||||
| */ | */ | ||||
| void getParameterCountInfo(uint32_t* const ins, uint32_t* const outs, uint32_t* const total); | void getParameterCountInfo(uint32_t* const ins, uint32_t* const outs, uint32_t* const total); | ||||
| /*! | |||||
| * Get the plugin's save state.\n | |||||
| * The plugin will automatically call prepareForSave() as needed. | |||||
| * | |||||
| * \see loadSaveState() | |||||
| */ | |||||
| virtual const SaveState& getSaveState(); | |||||
| /*! | |||||
| * Get the plugin's save state. | |||||
| * | |||||
| * \see getSaveState() | |||||
| */ | |||||
| virtual void loadSaveState(const SaveState& saveState); | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Set data (internal stuff) | // Set data (internal stuff) | ||||
| @@ -19,6 +19,9 @@ | |||||
| #include "carla_backend_utils.hpp" | #include "carla_backend_utils.hpp" | ||||
| #include "carla_midi.h" | #include "carla_midi.h" | ||||
| #include <QtCore/QFile> | |||||
| #include <QtCore/QTextStream> | |||||
| CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -914,7 +917,7 @@ void CarlaEngine::removeAllPlugins() | |||||
| fData->curPluginCount = 0; | fData->curPluginCount = 0; | ||||
| fData->maxPluginNumber = 0; | fData->maxPluginNumber = 0; | ||||
| for (unsigned short i=0; i < oldCount; i++) | |||||
| for (unsigned int i=0; i < oldCount; i++) | |||||
| { | { | ||||
| CarlaPlugin* const plugin = fData->plugins[i].plugin; | CarlaPlugin* const plugin = fData->plugins[i].plugin; | ||||
| @@ -945,6 +948,49 @@ void CarlaEngine::__bridgePluginRegister(const unsigned short id, CarlaPlugin* c | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| // Information (base) | // Information (base) | ||||
| void CarlaEngine::loadProject(const char* const filename) | |||||
| { | |||||
| CARLA_ASSERT(filename != nullptr); | |||||
| //QFile file(filename); | |||||
| //if (! file.open(QIODevice::WriteOnly | QIODevice::Text)) | |||||
| // return; | |||||
| //getSaveStateDictFromXML | |||||
| } | |||||
| void CarlaEngine::saveProject(const char* const filename) | |||||
| { | |||||
| CARLA_ASSERT(filename != nullptr); | |||||
| QFile file(filename); | |||||
| file.open(QIODevice::WriteOnly | QIODevice::Text); | |||||
| QTextStream out(&file); | |||||
| out << "<?xml version='1.0' encoding='UTF-8'?>\n"; | |||||
| out << "<!DOCTYPE CARLA-PRESET>\n"; | |||||
| out << "<CARLA-PRESET VERSION='0.5.0'>\n"; | |||||
| for (unsigned int i=0; i < fData->curPluginCount; i++) | |||||
| { | |||||
| CarlaPlugin* const plugin = fData->plugins[i].plugin; | |||||
| if (plugin != nullptr && plugin->enabled()) | |||||
| { | |||||
| const SaveState& saveState = plugin->getSaveState(); | |||||
| // TODO | |||||
| } | |||||
| } | |||||
| out << "</CARLA-PRESET>\n"; | |||||
| file.close(); | |||||
| } | |||||
| // ----------------------------------------------------------------------- | |||||
| // Information (base) | |||||
| float CarlaEngine::getInputPeak(const unsigned int pluginId, const unsigned short id) const | float CarlaEngine::getInputPeak(const unsigned int pluginId, const unsigned short id) const | ||||
| { | { | ||||
| CARLA_ASSERT(pluginId < fData->curPluginCount); | CARLA_ASSERT(pluginId < fData->curPluginCount); | ||||
| @@ -1202,7 +1248,7 @@ void CarlaEngine::bufferSizeChanged(const uint32_t newBufferSize) | |||||
| for (unsigned int i=0; i < fData->curPluginCount; i++) | for (unsigned int i=0; i < fData->curPluginCount; i++) | ||||
| { | { | ||||
| CarlaPlugin* const plugin = getPluginUnchecked(i); | |||||
| CarlaPlugin* const plugin = fData->plugins[i].plugin; | |||||
| if (plugin != nullptr && plugin->enabled()) | if (plugin != nullptr && plugin->enabled()) | ||||
| plugin->bufferSizeChanged(newBufferSize); | plugin->bufferSizeChanged(newBufferSize); | ||||
| @@ -1215,7 +1261,7 @@ void CarlaEngine::sampleRateChanged(const double newSampleRate) | |||||
| for (unsigned int i=0; i < fData->curPluginCount; i++) | for (unsigned int i=0; i < fData->curPluginCount; i++) | ||||
| { | { | ||||
| CarlaPlugin* const plugin = getPluginUnchecked(i); | |||||
| CarlaPlugin* const plugin = fData->plugins[i].plugin; | |||||
| if (plugin != nullptr && plugin->enabled()) | if (plugin != nullptr && plugin->enabled()) | ||||
| plugin->sampleRateChanged(newSampleRate); | plugin->sampleRateChanged(newSampleRate); | ||||
| @@ -369,6 +369,20 @@ void CarlaPlugin::getParameterCountInfo(uint32_t* const ins, uint32_t* const out | |||||
| } | } | ||||
| } | } | ||||
| const SaveState& CarlaPlugin::getSaveState() | |||||
| { | |||||
| static SaveState saveState; | |||||
| // TODO | |||||
| return saveState; | |||||
| } | |||||
| void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| { | |||||
| // TODO | |||||
| Q_UNUSED(saveState); | |||||
| } | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Set data (internal stuff) | // Set data (internal stuff) | ||||
| @@ -282,7 +282,7 @@ void carla_engine_idle() | |||||
| { | { | ||||
| CARLA_ASSERT(standalone.engine != nullptr); | CARLA_ASSERT(standalone.engine != nullptr); | ||||
| if (standalone.engine) | |||||
| if (standalone.engine != nullptr) | |||||
| standalone.engine->idle(); | standalone.engine->idle(); | ||||
| } | } | ||||
| @@ -290,7 +290,7 @@ bool carla_is_engine_running() | |||||
| { | { | ||||
| qDebug("carla_is_engine_running()"); | qDebug("carla_is_engine_running()"); | ||||
| return standalone.engine != nullptr && standalone.engine->isRunning(); | |||||
| return (standalone.engine != nullptr && standalone.engine->isRunning()); | |||||
| } | } | ||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -299,12 +299,18 @@ bool carla_load_project(const char* filename) | |||||
| { | { | ||||
| CARLA_ASSERT(standalone.engine != nullptr); | CARLA_ASSERT(standalone.engine != nullptr); | ||||
| CARLA_ASSERT(filename != nullptr); | CARLA_ASSERT(filename != nullptr); | ||||
| if (standalone.engine != nullptr) | |||||
| standalone.engine->loadProject(filename); | |||||
| } | } | ||||
| bool carla_save_project(const char* filename) | bool carla_save_project(const char* filename) | ||||
| { | { | ||||
| CARLA_ASSERT(standalone.engine != nullptr); | CARLA_ASSERT(standalone.engine != nullptr); | ||||
| CARLA_ASSERT(filename != nullptr); | CARLA_ASSERT(filename != nullptr); | ||||
| if (standalone.engine != nullptr) | |||||
| standalone.engine->saveProject(filename); | |||||
| } | } | ||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -333,7 +339,7 @@ bool carla_remove_plugin(unsigned int pluginId) | |||||
| return false; | return false; | ||||
| } | } | ||||
| CARLA_EXPORT void carla_remove_all_plugins() | |||||
| void carla_remove_all_plugins() | |||||
| { | { | ||||
| qDebug("carla_remove_all_plugins()"); | qDebug("carla_remove_all_plugins()"); | ||||
| CARLA_ASSERT(standalone.engine != nullptr); | CARLA_ASSERT(standalone.engine != nullptr); | ||||
| @@ -1,10 +1,6 @@ | |||||
| # QtCreator project file | |||||
| # QtCreator project file | |||||
| contains(QT_VERSION, ^5.*) { | |||||
| QT = core widgets xml | |||||
| } else { | |||||
| QT = core gui xml | QT = core gui xml | ||||
| } | |||||
| CONFIG = debug link_pkgconfig qt warn_on | CONFIG = debug link_pkgconfig qt warn_on | ||||
| PKGCONFIG = jack liblo | PKGCONFIG = jack liblo | ||||
| @@ -13,29 +9,36 @@ TARGET = carla-bridge-qtcreator | |||||
| TEMPLATE = app | TEMPLATE = app | ||||
| VERSION = 0.5.0 | VERSION = 0.5.0 | ||||
| SOURCES = \ | |||||
| # ----------------------------------------------------------- | |||||
| SOURCES = \ | |||||
| ../carla_bridge_client.cpp \ | ../carla_bridge_client.cpp \ | ||||
| ../carla_bridge_osc.cpp \ | ../carla_bridge_osc.cpp \ | ||||
| ../carla_bridge_toolkit.cpp \ | ../carla_bridge_toolkit.cpp \ | ||||
| ../carla_bridge_plugin.cpp | ../carla_bridge_plugin.cpp | ||||
| HEADERS = \ | |||||
| HEADERS = \ | |||||
| ../carla_bridge.hpp \ | ../carla_bridge.hpp \ | ||||
| ../carla_bridge_client.hpp \ | ../carla_bridge_client.hpp \ | ||||
| ../carla_bridge_osc.hpp \ | ../carla_bridge_osc.hpp \ | ||||
| ../carla_bridge_toolkit.hpp \ | |||||
| ../carla_bridge_toolkit.hpp | |||||
| # ----------------------------------------------------------- | |||||
| # carla-engine | # carla-engine | ||||
| SOURCES += \ | SOURCES += \ | ||||
| ../../backend/engine/carla_engine.cpp \ | ../../backend/engine/carla_engine.cpp \ | ||||
| ../../backend/engine/carla_engine_osc.cpp \ | ../../backend/engine/carla_engine_osc.cpp \ | ||||
| ../../backend/engine/carla_engine_thread.cpp \ | ../../backend/engine/carla_engine_thread.cpp \ | ||||
| ../../backend/engine/jack.cpp | |||||
| ../../backend/engine/jack.cpp \ | |||||
| ../../backend/engine/plugin.cpp \ | |||||
| ../../backend/engine/rtaudio.cpp | |||||
| # carla-plugin | # carla-plugin | ||||
| SOURCES += \ | SOURCES += \ | ||||
| ../../backend/plugin/carla_plugin.cpp \ | ../../backend/plugin/carla_plugin.cpp \ | ||||
| ../../backend/plugin/carla_plugin_thread.cpp \ | ../../backend/plugin/carla_plugin_thread.cpp \ | ||||
| ../../backend/plugin/native.cpp \ | |||||
| ../../backend/plugin/ladspa.cpp \ | ../../backend/plugin/ladspa.cpp \ | ||||
| ../../backend/plugin/dssi.cpp \ | ../../backend/plugin/dssi.cpp \ | ||||
| ../../backend/plugin/lv2.cpp \ | ../../backend/plugin/lv2.cpp \ | ||||
| @@ -43,9 +46,11 @@ SOURCES += \ | |||||
| ../../backend/plugin/fluidsynth.cpp \ | ../../backend/plugin/fluidsynth.cpp \ | ||||
| ../../backend/plugin/linuxsampler.cpp | ../../backend/plugin/linuxsampler.cpp | ||||
| # carla-utils | |||||
| # carla-standalone | |||||
| SOURCES += \ | SOURCES += \ | ||||
| ../../backend/utils/Shared.cpp | |||||
| ../../backend/standalone/carla_standalone.cpp | |||||
| # ----------------------------------------------------------- | |||||
| # common | # common | ||||
| HEADERS += \ | HEADERS += \ | ||||
| @@ -56,18 +61,18 @@ HEADERS += \ | |||||
| ../../backend/carla_plugin.hpp \ | ../../backend/carla_plugin.hpp \ | ||||
| ../../backend/carla_standalone.hpp | ../../backend/carla_standalone.hpp | ||||
| # engine | |||||
| HEADERS += \ | HEADERS += \ | ||||
| ../../backend/engine/carla_engine_internal.hpp \ | ../../backend/engine/carla_engine_internal.hpp \ | ||||
| ../../backend/engine/carla_engine_osc.hpp \ | ../../backend/engine/carla_engine_osc.hpp \ | ||||
| ../../backend/engine/carla_engine_thread.hpp \ | ../../backend/engine/carla_engine_thread.hpp \ | ||||
| ../../backend/engine/plugin/DistrhoPluginInfo.h | |||||
| # plugin | |||||
| HEADERS += \ | HEADERS += \ | ||||
| ../../backend/plugin/carla_plugin_internal.hpp \ | ../../backend/plugin/carla_plugin_internal.hpp \ | ||||
| ../../backend/plugin/carla_plugin_thread.hpp | ../../backend/plugin/carla_plugin_thread.hpp | ||||
| HEADERS += \ | |||||
| ../../backend/utils/Shared.hpp | |||||
| # includes | # includes | ||||
| HEADERS += \ | HEADERS += \ | ||||
| ../../includes/carla_defines.hpp \ | ../../includes/carla_defines.hpp \ | ||||
| @@ -77,13 +82,15 @@ HEADERS += \ | |||||
| # utils | # utils | ||||
| HEADERS += \ | HEADERS += \ | ||||
| ../../utils/carla_backend_utils.hpp\ | |||||
| ../../utils/carla_backend_utils.hpp \ | |||||
| ../../utils/carla_juce_utils.hpp \ | ../../utils/carla_juce_utils.hpp \ | ||||
| ../../utils/carla_ladspa_utils.hpp \ | ../../utils/carla_ladspa_utils.hpp \ | ||||
| ../../utils/carla_lib_utils.hpp \ | ../../utils/carla_lib_utils.hpp \ | ||||
| ../../utils/carla_lv2_utils.hpp \ | ../../utils/carla_lv2_utils.hpp \ | ||||
| ../../utils/carla_osc_utils.hpp \ | ../../utils/carla_osc_utils.hpp \ | ||||
| ../../utils/carla_state_utils.hpp \ | |||||
| ../../utils/carla_vst_utils.hpp \ | ../../utils/carla_vst_utils.hpp \ | ||||
| ../../utils/carla_utils.hpp \ | |||||
| ../../utils/lv2_atom_queue.hpp \ | ../../utils/lv2_atom_queue.hpp \ | ||||
| ../../utils/rt_list.hpp | ../../utils/rt_list.hpp | ||||
| @@ -96,6 +103,8 @@ INCLUDEPATH = .. \ | |||||
| ../../libs \ | ../../libs \ | ||||
| ../../utils | ../../utils | ||||
| # ----------------------------------------------------------- | |||||
| DEFINES = QTCREATOR_TEST | DEFINES = QTCREATOR_TEST | ||||
| DEFINES += DEBUG | DEFINES += DEBUG | ||||
| #DEFINES += VESTIGE_HEADER | #DEFINES += VESTIGE_HEADER | ||||
| @@ -747,6 +747,8 @@ class CarlaMainW(QMainWindow): | |||||
| self.fPluginCount = 0 | self.fPluginCount = 0 | ||||
| Carla.host.remove_all_plugins() | |||||
| @pyqtSlot() | @pyqtSlot() | ||||
| def slot_fileNew(self): | def slot_fileNew(self): | ||||
| self.removeAllPlugins() | self.removeAllPlugins() | ||||
| @@ -1,17 +1,13 @@ | |||||
| # QtCreator project file | |||||
| # QtCreator project file | |||||
| QT = core | QT = core | ||||
| win { | |||||
| CONFIG = release | |||||
| } else { | |||||
| CONFIG = debug | |||||
| } | |||||
| CONFIG += link_pkgconfig qt warn_on | |||||
| CONFIG = debug link_pkgconfig qt warn_on | |||||
| DEFINES = DEBUG | DEFINES = DEBUG | ||||
| DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | ||||
| DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER | DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER | ||||
| PKGCONFIG = fluidsynth linuxsampler | PKGCONFIG = fluidsynth linuxsampler | ||||
| TARGET = carla-discovery-qtcreator | TARGET = carla-discovery-qtcreator | ||||