| @@ -136,7 +136,8 @@ const char* const CARLA_BRIDGE_MSG_HIDE_GUI = "CarlaBridgeHideGUI"; //!< Plu | |||
| const char* const CARLA_BRIDGE_MSG_SAVED = "CarlaBridgeSaved"; //!< Plugin -> Host call, tells host state is saved | |||
| const char* const CARLA_BRIDGE_MSG_SAVE_NOW = "CarlaBridgeSaveNow"; //!< Host -> Plugin call, tells plugin to save state now | |||
| const char* const CARLA_BRIDGE_MSG_SET_CHUNK = "CarlaBridgeSetChunk"; //!< Host -> Plugin call, tells plugin to set chunk in file \a value | |||
| const char* const CARLA_BRIDGE_MSG_SET_CUSTOM = "CarlaBridgeSetCustom"; //!< Host -> Plugin call, tells plugin to set a custom data set using \a value ("type·key·rvalue").\n If \a type is 'chunk' or 'binary' \a rvalue refers to chunk file. | |||
| const char* const CARLA_BRIDGE_MSG_SET_CUSTOM = "CarlaBridgeSetCustom"; //!< Host -> Plugin call, tells plugin to set a custom data set using \a value ("type·key·rvalue"). | |||
| //If \a type is 'chunk' or 'binary' \a rvalue refers to chunk file. | |||
| /**@}*/ | |||
| #endif | |||
| @@ -598,7 +599,7 @@ enum CallbackType { | |||
| CALLBACK_NSM_SAVE = 29, | |||
| /*! | |||
| * An error occurred, show last error to user. | |||
| * An error occurred, show \a valueStr as an error to user. | |||
| */ | |||
| CALLBACK_ERROR = 30, | |||
| @@ -695,6 +695,12 @@ public: | |||
| */ | |||
| virtual void idle(); | |||
| /*! | |||
| * Give the event loop to the engine.\n | |||
| * The function will complete when the last plugin UI is closed. | |||
| */ | |||
| virtual void exec(); | |||
| /*! | |||
| * Check if engine is running. | |||
| */ | |||
| @@ -27,6 +27,14 @@ | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| // Engine Helpers | |||
| DGL::App* getEngineApp(CarlaEngine* const engine) | |||
| { | |||
| return CarlaEngineProtectedData::getApp(engine); | |||
| } | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| // Carla Engine port (Abstract) | |||
| @@ -465,38 +473,35 @@ CarlaEngine* CarlaEngine::newDriverByName(const char* const driverName) | |||
| #ifdef WANT_JACK | |||
| if (std::strcmp(driverName, "JACK") == 0) | |||
| return newJack(); | |||
| #else | |||
| if (false) | |||
| pass(); | |||
| #endif | |||
| #ifdef WANT_RTAUDIO | |||
| # ifdef __LINUX_ALSA__ | |||
| else if (std::strcmp(driverName, "ALSA") == 0) | |||
| if (std::strcmp(driverName, "ALSA") == 0) | |||
| return newRtAudio(RTAUDIO_LINUX_ALSA); | |||
| # endif | |||
| # ifdef __LINUX_PULSE__ | |||
| else if (std::strcmp(driverName, "PulseAudio") == 0) | |||
| if (std::strcmp(driverName, "PulseAudio") == 0) | |||
| return newRtAudio(RTAUDIO_LINUX_PULSE); | |||
| # endif | |||
| # ifdef __LINUX_OSS__ | |||
| else if (std::strcmp(driverName, "OSS") == 0) | |||
| if (std::strcmp(driverName, "OSS") == 0) | |||
| return newRtAudio(RTAUDIO_LINUX_OSS); | |||
| # endif | |||
| # ifdef __UNIX_JACK__ | |||
| else if (std::strcmp(driverName, "JACK (RtAudio)") == 0) | |||
| if (std::strncmp(driverName, "JACK ", 5) == 0) | |||
| return newRtAudio(RTAUDIO_UNIX_JACK); | |||
| # endif | |||
| # ifdef __MACOSX_CORE__ | |||
| else if (std::strcmp(driverName, "CoreAudio") == 0) | |||
| if (std::strcmp(driverName, "CoreAudio") == 0) | |||
| return newRtAudio(RTAUDIO_MACOSX_CORE); | |||
| # endif | |||
| # ifdef __WINDOWS_ASIO__ | |||
| else if (std::strcmp(driverName, "ASIO") == 0) | |||
| if (std::strcmp(driverName, "ASIO") == 0) | |||
| return newRtAudio(RTAUDIO_WINDOWS_ASIO); | |||
| # endif | |||
| # ifdef __WINDOWS_DS__ | |||
| else if (std::strcmp(driverName, "DirectSound") == 0) | |||
| if (std::strcmp(driverName, "DirectSound") == 0) | |||
| return newRtAudio(RTAUDIO_WINDOWS_DS); | |||
| # endif | |||
| #endif | |||
| @@ -631,24 +636,20 @@ void CarlaEngine::idle() | |||
| CARLA_ASSERT(kData->plugins != nullptr); | |||
| CARLA_ASSERT(isRunning()); | |||
| #if 0 | |||
| for (auto it = kData->plugins.begin(); it.valid(); it.next()) | |||
| { | |||
| CarlaPlugin* const plugin = (*it).plugin; | |||
| CARLA_ASSERT(plugin != nullptr); | |||
| if (plugin && plugin->enabled()) | |||
| plugin->idleGui(); | |||
| } | |||
| #endif | |||
| for (unsigned int i=0; i < kData->curPluginCount; i++) | |||
| { | |||
| CarlaPlugin* const plugin = kData->plugins[i].plugin; | |||
| if (plugin && plugin->enabled()) | |||
| if (plugin != nullptr && plugin->enabled()) | |||
| plugin->idleGui(); | |||
| } | |||
| kData->app.idle(); | |||
| } | |||
| void CarlaEngine::exec() | |||
| { | |||
| kData->app.exec(); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| @@ -1,36 +1,57 @@ | |||
| # QtCreator project file | |||
| QT = core | |||
| CONFIG = debug | |||
| CONFIG += link_pkgconfig shared qt warn_on | |||
| DEFINES = DEBUG | |||
| DEFINES += QTCREATOR_TEST | |||
| TARGET = CarlaEngine | |||
| TEMPLATE = lib | |||
| VERSION = 1.0 | |||
| # ------------------------------------------------------- | |||
| CONFIG = debug | |||
| CONFIG += link_pkgconfig shared warn_on | |||
| DEFINES = DEBUG | |||
| DEFINES += QTCREATOR_TEST | |||
| # Shared | |||
| DEFINES += WANT_NATIVE | |||
| DEFINES += WANT_LADSPA | |||
| DEFINES += WANT_DSSI | |||
| DEFINES += WANT_LV2 | |||
| DEFINES += WANT_VST | |||
| DEFINES += WANT_PLUGIN | |||
| DEFINES += WANT_RTAUDIO | |||
| DEFINES += WANT_JACK | |||
| DEFINES += WANT_JACK_LATENCY | |||
| DEFINES += WANT_JACK_PORT_RENAME | |||
| DEFINES += WANT_FLUIDSYNTH | |||
| DEFINES += WANT_LINUXSAMPLER | |||
| DEFINES += WANT_AUDIOFILE | |||
| DEFINES += WANT_ZYNADDSUBFX | |||
| PKGCONFIG = gl | |||
| # Engine | |||
| PKGCONFIG += liblo QtCore | |||
| # RtAudio | |||
| DEFINES += HAVE_GETTIMEOFDAY | |||
| DEFINES += __RTAUDIO_DEBUG__ __RTMIDI_DEBUG__ | |||
| # ALSA | |||
| DEFINES += __LINUX_ALSA__ __LINUX_ALSASEQ__ | |||
| PKGCONFIG += alsa | |||
| # JACK | |||
| DEFINES += CARLA_ENGINE_JACK | |||
| DEFINES += __UNIX_JACK__ | |||
| DEFINES += __UNIX_JACK__ | |||
| PKGCONFIG += jack | |||
| # RtAudio/RtMidi | |||
| DEFINES += CARLA_ENGINE_RTAUDIO HAVE_GETTIMEOFDAY | |||
| DEFINES += __RTAUDIO_DEBUG__ __RTMIDI_DEBUG__ | |||
| DEFINES += __LINUX_ALSA__ __LINUX_ALSASEQ__ | |||
| DEFINES += __LINUX_PULSE__ | |||
| # PulseAudio | |||
| DEFINES += __LINUX_PULSE__ | |||
| PKGCONFIG += libpulse-simple | |||
| # DISTRHO Plugin | |||
| DEFINES += CARLA_ENGINE_PLUGIN | |||
| DEFINES += DISTRHO_PLUGIN_TARGET_STANDALONE | |||
| DEFINES += DISTRHO_PLUGIN_TARGET_VST | |||
| # Misc | |||
| DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | |||
| DEFINES += WANT_JACK WANT_PLUGIN WANT_RTAUDIO | |||
| PKGCONFIG = liblo jack alsa libpulse-simple | |||
| TARGET = carla_engine | |||
| TEMPLATE = lib | |||
| VERSION = 0.5.0 | |||
| # ------------------------------------------------------- | |||
| SOURCES = \ | |||
| CarlaEngine.cpp \ | |||
| @@ -65,9 +86,10 @@ HEADERS += \ | |||
| HEADERS += \ | |||
| distrho/DistrhoPluginInfo.h | |||
| INCLUDEPATH = . .. \ | |||
| INCLUDEPATH = . .. plugin \ | |||
| ../../includes \ | |||
| ../../libs \ | |||
| ../../libs/distrho \ | |||
| ../../utils | |||
| # RtAudio/RtMidi | |||
| @@ -75,7 +97,4 @@ INCLUDEPATH += rtaudio-4.0.11 rtmidi-2.0.1 | |||
| SOURCES += rtaudio-4.0.11/RtAudio.cpp | |||
| SOURCES += rtmidi-2.0.1/RtMidi.cpp | |||
| # Plugin | |||
| INCLUDEPATH += plugin ../../libs/distrho-plugin-toolkit | |||
| QMAKE_CXXFLAGS += -std=c++0x | |||
| @@ -24,6 +24,8 @@ | |||
| #include "CarlaPlugin.hpp" | |||
| #include "RtList.hpp" | |||
| #include "dgl/App.hpp" | |||
| #ifndef BUILD_BRIDGE | |||
| # include <QtCore/QProcessEnvironment> | |||
| #endif | |||
| @@ -107,15 +109,19 @@ struct EnginePluginData { | |||
| float insPeak[CarlaEngine::MAX_PEAKS]; | |||
| float outsPeak[CarlaEngine::MAX_PEAKS]; | |||
| #ifndef QTCREATOR_TEST | |||
| EnginePluginData() | |||
| : plugin(nullptr), | |||
| insPeak{0.0f}, | |||
| outsPeak{0.0f} {} | |||
| #endif | |||
| }; | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| struct CarlaEngineProtectedData { | |||
| DGL::App app; | |||
| CarlaEngineOsc osc; | |||
| CarlaEngineThread thread; | |||
| @@ -168,9 +174,6 @@ struct CarlaEngineProtectedData { | |||
| frame(0) {} | |||
| } time; | |||
| //RtList<EnginePluginData>::Pool pluginsPool; | |||
| //RtList<EnginePluginData> plugins; | |||
| EnginePluginData* plugins; | |||
| CarlaEngineProtectedData(CarlaEngine* const engine) | |||
| @@ -181,8 +184,6 @@ struct CarlaEngineProtectedData { | |||
| callbackPtr(nullptr), | |||
| aboutToClose(false), | |||
| curPluginCount(0), | |||
| //pluginsPool(1, 999), | |||
| //plugins(&pluginsPool) | |||
| maxPluginNumber(0), | |||
| plugins(nullptr) {} | |||
| @@ -195,10 +196,10 @@ struct CarlaEngineProtectedData { | |||
| CarlaEngineProtectedData(CarlaEngineProtectedData&) = delete; | |||
| CarlaEngineProtectedData(const CarlaEngineProtectedData&) = delete; | |||
| //static RtList<EnginePluginData>::Itenerator pluginsBegin(CarlaEngine* const engine) | |||
| //{ | |||
| // return engine->kData->plugins.begin(); | |||
| //} | |||
| static DGL::App* getApp(CarlaEngine* const engine) | |||
| { | |||
| return &engine->kData->app; | |||
| } | |||
| }; | |||
| CARLA_BACKEND_END_NAMESPACE | |||
| @@ -32,7 +32,7 @@ CARLA_BACKEND_START_NAMESPACE | |||
| #endif | |||
| // ------------------------------------------------------------------- | |||
| // Helpers, defined in CarlaPlugin.cpp | |||
| // Plugin Helpers, defined in CarlaPlugin.cpp | |||
| extern CarlaEngine* CarlaPluginGetEngine(CarlaPlugin* const plugin); | |||
| extern CarlaEngineAudioPort* CarlaPluginGetAudioInPort(CarlaPlugin* const plugin, uint32_t index); | |||
| @@ -499,8 +499,10 @@ public: | |||
| #ifdef BUILD_BRIDGE | |||
| fHasQuit(false) | |||
| #else | |||
| # ifndef QTCREATOR_TEST | |||
| fRackPorts{nullptr}, | |||
| fLastGroupId(0), | |||
| # endif | |||
| fLastPortId(0), | |||
| fLastConnectionId(0) | |||
| #endif | |||
| @@ -594,7 +596,7 @@ public: | |||
| #ifdef WANT_JACK_PORT_RENAME | |||
| if (jack_set_port_rename_callback) | |||
| jack_set_port_rename_callback(fClient, carla_jack_port_rename_callback, this); | |||
| jack_set_port_rename_callback(fClient, carla_jack_port_rename_callback, this); | |||
| #endif | |||
| if (fOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) | |||
| @@ -46,7 +46,15 @@ RtMidi::Api getMatchedAudioMidiAPi(const RtAudio::Api rtApi) | |||
| return RtMidi::LINUX_ALSA; | |||
| case RtAudio::UNIX_JACK: | |||
| #if defined(CARLA_OS_WIN) | |||
| return RtMidi::WINDOWS_MM; | |||
| #elif defined(CARLA_OS_MAC) | |||
| return RtMidi::MACOSX_CORE; | |||
| #elif defined(CARLA_OS_LINUX) | |||
| return RtMidi::LINUX_ALSA; | |||
| #else | |||
| return RtMidi::UNIX_JACK; | |||
| #endif | |||
| case RtAudio::MACOSX_CORE: | |||
| return RtMidi::MACOSX_CORE; | |||
| @@ -77,8 +85,8 @@ public: | |||
| fAudioInBuf2(nullptr), | |||
| fAudioOutBuf1(nullptr), | |||
| fAudioOutBuf2(nullptr), | |||
| fMidiIn(getMatchedAudioMidiAPi(api), "CarlaIn"), | |||
| fMidiOut(getMatchedAudioMidiAPi(api), "CarlaOut") | |||
| fMidiIn(getMatchedAudioMidiAPi(api), "Carla"), | |||
| fMidiOut(getMatchedAudioMidiAPi(api), "Carla") | |||
| { | |||
| carla_debug("CarlaEngineRtAudio::CarlaEngineRtAudio(%i)", api); | |||
| @@ -646,7 +654,15 @@ const char* CarlaEngine::getRtAudioApiName(const unsigned int index) | |||
| case RtAudio::LINUX_OSS: | |||
| return "OSS"; | |||
| case RtAudio::UNIX_JACK: | |||
| return "JACK (RtAudio)"; | |||
| #if defined(CARLA_OS_WIN) | |||
| return "JACK with WinMM"; | |||
| #elif defined(CARLA_OS_MAC) | |||
| return "JACK with CoreMidi"; | |||
| #elif defined(CARLA_OS_LINUX) | |||
| return "JACK with ALSA-MIDI"; | |||
| #else | |||
| return "JACK (RtAudio)"; | |||
| #endif | |||
| case RtAudio::MACOSX_CORE: | |||
| return "CoreAudio"; | |||
| case RtAudio::WINDOWS_ASIO: | |||
| @@ -19,9 +19,10 @@ | |||
| #include "CarlaLibUtils.hpp" | |||
| #include "CarlaMIDI.h" | |||
| #include "dgl/App.hpp" | |||
| #include <QtCore/QFile> | |||
| #include <QtCore/QTextStream> | |||
| #include <QtGui/QCloseEvent> | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| @@ -34,7 +35,7 @@ static const MidiProgramData kMidiProgramDataNull; | |||
| static const CustomData kCustomDataNull; | |||
| // ------------------------------------------------------------------- | |||
| // Helpers | |||
| // Plugin Helpers | |||
| CarlaEngine* CarlaPluginGetEngine(CarlaPlugin* const plugin) | |||
| { | |||
| @@ -1972,19 +1973,13 @@ CarlaPlugin::ScopedProcessLocker::~ScopedProcessLocker() | |||
| // CarlaPluginGUI | |||
| CarlaPluginGUI::CarlaPluginGUI(DGL::App* const app, Callback* const callback) | |||
| //CarlaPluginGUI::CarlaPluginGUI(QWidget* const parent, Callback* const callback) | |||
| : DGL::Window(app), | |||
| kCallback(callback)/*, | |||
| fContainer(this)*/ | |||
| kCallback(callback) | |||
| { | |||
| carla_debug("CarlaPluginGUI::CarlaPluginGUI(%p, %p)", app, callback); | |||
| CARLA_ASSERT(app != nullptr); | |||
| CARLA_ASSERT(callback != nullptr); | |||
| //setCentralWidget(&fContainer); | |||
| //adjustSize(); | |||
| //QMainWindow::setVisible(false); | |||
| hide(); | |||
| } | |||
| @@ -1993,14 +1988,6 @@ CarlaPluginGUI::~CarlaPluginGUI() | |||
| carla_debug("CarlaPluginGUI::~CarlaPluginGUI()"); | |||
| } | |||
| #if 0 | |||
| WId CarlaPluginGUI::getWinId() const | |||
| { | |||
| carla_debug("CarlaPluginGUI::getWinId()"); | |||
| return fContainer.winId(); | |||
| } | |||
| #endif | |||
| // void CarlaPluginGUI::closeEvent(QCloseEvent* const event) | |||
| // { | |||
| // carla_debug("CarlaPluginGUI::closeEvent(%p)", event); | |||
| @@ -1,37 +1,49 @@ | |||
| # QtCreator project file | |||
| QT = core gui | |||
| TARGET = CarlaPlugin | |||
| TEMPLATE = lib | |||
| VERSION = 1.0 | |||
| CONFIG = debug | |||
| CONFIG += link_pkgconfig shared qt warn_on | |||
| # ------------------------------------------------------- | |||
| DEFINES = DEBUG | |||
| DEFINES += QTCREATOR_TEST | |||
| CONFIG = debug | |||
| CONFIG += link_pkgconfig shared warn_on | |||
| # Plugins | |||
| DEFINES += WANT_LADSPA WANT_DSSI | |||
| # WANT_LV2 WANT_VST | |||
| DEFINES = DEBUG | |||
| DEFINES += QTCREATOR_TEST | |||
| # Samplers | |||
| DEFINES += WANT_FLUIDSYNTH | |||
| # WANT_LINUXSAMPLER | |||
| # Shared | |||
| DEFINES += WANT_NATIVE | |||
| DEFINES += WANT_LADSPA | |||
| DEFINES += WANT_DSSI | |||
| DEFINES += WANT_LV2 | |||
| DEFINES += WANT_VST | |||
| DEFINES += WANT_PLUGIN | |||
| DEFINES += WANT_RTAUDIO | |||
| DEFINES += WANT_JACK | |||
| DEFINES += WANT_JACK_LATENCY | |||
| DEFINES += WANT_JACK_PORT_RENAME | |||
| DEFINES += WANT_FLUIDSYNTH | |||
| DEFINES += WANT_LINUXSAMPLER | |||
| DEFINES += WANT_AUDIOFILE | |||
| DEFINES += WANT_ZYNADDSUBFX | |||
| PKGCONFIG = gl | |||
| # ZynAddSubFX | |||
| DEFINES += WANT_ZYNADDSUBFX | |||
| # Plugin | |||
| PKGCONFIG += liblo QtCore | |||
| # Misc | |||
| DEFINES += WANT_SUIL | |||
| # FluidSynth | |||
| PKGCONFIG += fluidsynth linuxsampler | |||
| PKGCONFIG = liblo suil-0 fluidsynth linuxsampler | |||
| # LinuxSampler | |||
| PKGCONFIG += linuxsampler | |||
| TARGET = CarlaPlugin | |||
| TEMPLATE = lib | |||
| VERSION = 0.5.0 | |||
| # ------------------------------------------------------- | |||
| SOURCES = \ | |||
| CarlaPlugin.cpp \ | |||
| CarlaPluginThread.cpp \ | |||
| CarlaBridge.cpp \ | |||
| BridgePlugin.cpp \ | |||
| NativePlugin.cpp \ | |||
| LadspaPlugin.cpp \ | |||
| DssiPlugin.cpp \ | |||
| @@ -63,6 +75,7 @@ HEADERS += \ | |||
| INCLUDEPATH = . .. \ | |||
| ../../includes \ | |||
| ../../libs \ | |||
| ../../libs/distrho \ | |||
| ../../utils | |||
| QMAKE_CXXFLAGS += -std=c++0x | |||
| @@ -28,19 +28,8 @@ | |||
| #include "CarlaMIDI.h" | |||
| #include "RtList.hpp" | |||
| #include "dgl/App.hpp" | |||
| #include "dgl/Window.hpp" | |||
| //#include <QtGui/QMainWindow> | |||
| //#ifdef Q_WS_X11 | |||
| //# include <QtGui/QX11EmbedContainer> | |||
| //typedef QX11EmbedContainer GuiContainer; | |||
| //#else | |||
| //# include <QtGui/QWidget> | |||
| //typedef QWidget GuiContainer; | |||
| //#endif | |||
| #define CARLA_DECLARE_NON_COPY_STRUCT(structName) \ | |||
| structName(structName&) = delete; \ | |||
| structName(const structName&) = delete; | |||
| @@ -397,7 +386,7 @@ struct ExternalMidiNote { | |||
| // ----------------------------------------------------------------------- | |||
| class CarlaPluginGUI : public DGL::Window//QMainWindow | |||
| class CarlaPluginGUI : public DGL::Window | |||
| { | |||
| public: | |||
| class Callback | |||
| @@ -408,28 +397,28 @@ public: | |||
| }; | |||
| CarlaPluginGUI(DGL::App* const app, Callback* const callback); | |||
| //CarlaPluginGUI(QWidget* const parent, Callback* const callback); | |||
| ~CarlaPluginGUI(); | |||
| //WId getWinId() const; | |||
| //protected: | |||
| //void closeEvent(QCloseEvent* const event); | |||
| private: | |||
| Callback* const kCallback; | |||
| //GuiContainer fContainer; | |||
| CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPluginGUI) | |||
| }; | |||
| // ----------------------------------------------------------------------- | |||
| // Engine Helpers, defined in CarlaEngine.cpp | |||
| extern DGL::App* getEngineApp(CarlaEngine* const engine); | |||
| // ----------------------------------------------------------------------- | |||
| struct CarlaPluginProtectedData { | |||
| CarlaEngine* const engine; | |||
| CarlaEngineClient* client; | |||
| CarlaPluginGUI* gui; | |||
| DGL::App app; | |||
| bool active; | |||
| bool activeBefore; | |||
| @@ -582,7 +571,7 @@ struct CarlaPluginProtectedData { | |||
| if (gui != nullptr) | |||
| return; | |||
| gui = new CarlaPluginGUI(&app, callback); | |||
| gui = new CarlaPluginGUI(getEngineApp(engine), callback); | |||
| } | |||
| void destroyUiIfNeeded() | |||
| @@ -1934,12 +1934,14 @@ public: | |||
| public: | |||
| ScopedInitializer() | |||
| { | |||
| initDescriptors(); | |||
| #ifndef BUILD_BRIDGE | |||
| carla_register_all_plugins(); | |||
| #endif | |||
| } | |||
| ~ScopedInitializer() | |||
| { | |||
| clearDescriptors(); | |||
| sPluginDescriptors.clear(); | |||
| } | |||
| }; | |||
| @@ -1966,39 +1968,6 @@ private: | |||
| // ------------------------------------------------------------------- | |||
| static void initDescriptors() | |||
| { | |||
| #ifndef BUILD_BRIDGE | |||
| carla_register_native_plugin_bypass(); | |||
| carla_register_native_plugin_midiSequencer(); | |||
| carla_register_native_plugin_midiSplit(); | |||
| carla_register_native_plugin_midiThrough(); | |||
| carla_register_native_plugin_midiTranspose(); | |||
| carla_register_native_plugin_nekofilter(); | |||
| # ifdef WANT_OPENGL | |||
| carla_register_native_plugin_3BandEQ(); | |||
| carla_register_native_plugin_3BandSplitter(); | |||
| carla_register_native_plugin_PingPongPan(); | |||
| # endif | |||
| carla_register_native_plugin_Notes(); | |||
| # ifdef WANT_AUDIOFILE | |||
| carla_register_native_plugin_audiofile(); | |||
| # endif | |||
| # ifdef WANT_ZYNADDSUBFX | |||
| carla_register_native_plugin_zynaddsubfx(); | |||
| # endif | |||
| #endif | |||
| } | |||
| static void clearDescriptors() | |||
| { | |||
| sPluginDescriptors.clear(); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| #define handlePtr ((NativePlugin*)handle) | |||
| static uint32_t carla_host_get_buffer_size(HostHandle handle) | |||
| @@ -21,9 +21,9 @@ | |||
| #include "CarlaVstUtils.hpp" | |||
| #ifdef Q_WS_X11 | |||
| # include <QtGui/QX11Info> | |||
| #endif | |||
| //#ifdef Q_WS_X11 | |||
| //# include <QtGui/QX11Info> | |||
| //#endif | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| @@ -403,8 +403,6 @@ public: | |||
| void idleGui() | |||
| { | |||
| kData->app.idle(); | |||
| #ifdef VESTIGE_HEADER | |||
| if (fEffect != nullptr /*&& effect->ptr1*/) | |||
| #else | |||
| @@ -24,17 +24,11 @@ | |||
| #include "CarlaEngine.hpp" | |||
| #include "CarlaPlugin.hpp" | |||
| //#include <set> | |||
| #include "dgl/App.hpp" | |||
| #include <QtCore/QDir> | |||
| #include <QtCore/QFile> | |||
| #include <QtCore/QTextStream> | |||
| //#include <QtXml/QDomDocument> | |||
| #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |||
| # include <QtWidgets/QApplication> | |||
| #else | |||
| # include <QtGui/QApplication> | |||
| #endif | |||
| #ifdef CARLA_OS_UNIX | |||
| # include <signal.h> | |||
| @@ -113,17 +107,13 @@ CARLA_BRIDGE_START_NAMESPACE | |||
| // ------------------------------------------------------------------------- | |||
| class CarlaPluginClient : public CarlaBridgeClient, | |||
| public QObject | |||
| class CarlaPluginClient : public CarlaBridgeClient | |||
| { | |||
| public: | |||
| CarlaPluginClient(const char* const name) | |||
| : CarlaBridgeClient(nullptr), | |||
| QObject(nullptr), | |||
| fEngine(nullptr), | |||
| fPlugin(nullptr), | |||
| fClosed(false), | |||
| fTimerId(0) | |||
| fPlugin(nullptr) | |||
| { | |||
| carla_debug("CarlaPluginClient::CarlaPluginClient()"); | |||
| @@ -134,20 +124,14 @@ public: | |||
| ~CarlaPluginClient() | |||
| { | |||
| carla_debug("CarlaPluginClient::~CarlaPluginClient()"); | |||
| CARLA_ASSERT(fTimerId == 0); | |||
| carla_set_engine_about_to_close(); | |||
| carla_engine_close(); | |||
| } | |||
| void ready() | |||
| { | |||
| CARLA_ASSERT(fTimerId == 0); | |||
| fEngine = carla_get_standalone_engine(); | |||
| fPlugin = fEngine->getPlugin(0); | |||
| fTimerId = startTimer(50); | |||
| } | |||
| void idle() | |||
| @@ -162,22 +146,14 @@ public: | |||
| // TODO | |||
| gSaveNow = false; | |||
| } | |||
| } | |||
| if (gCloseNow) | |||
| void exec() | |||
| { | |||
| while (! gCloseNow) | |||
| { | |||
| //close(); | |||
| if (fTimerId != 0) | |||
| { | |||
| killTimer(fTimerId); | |||
| fTimerId = 0; | |||
| } | |||
| if (QApplication* const app = qApp) | |||
| { | |||
| if (! app->closingDown()) | |||
| app->quit(); | |||
| } | |||
| idle(); | |||
| carla_msleep(50); | |||
| } | |||
| } | |||
| @@ -326,18 +302,22 @@ protected: | |||
| { | |||
| CARLA_BACKEND_USE_NAMESPACE; | |||
| // TODO | |||
| switch (action) | |||
| { | |||
| case CALLBACK_SHOW_GUI: | |||
| if (value1 != 1 && ! isOscControlRegistered()) | |||
| gCloseNow = true; | |||
| break; | |||
| default: // TODO | |||
| (void)value2; | |||
| (void)value3; | |||
| (void)valueStr; | |||
| default: | |||
| break; | |||
| } | |||
| return; | |||
| (void)value2; | |||
| (void)value3; | |||
| (void)valueStr; | |||
| } | |||
| private: | |||
| @@ -345,17 +325,6 @@ private: | |||
| CarlaBackend::CarlaPlugin* fPlugin; | |||
| bool fClosed; | |||
| int fTimerId; | |||
| void timerEvent(QTimerEvent* const event) | |||
| { | |||
| if (event->timerId() == fTimerId) | |||
| { | |||
| idle(); | |||
| } | |||
| QObject::timerEvent(event); | |||
| } | |||
| static void callback(void* ptr, CarlaBackend::CallbackType action, unsigned int pluginId, int value1, int value2, float value3, const char* valueStr) | |||
| { | |||
| @@ -502,9 +471,6 @@ int main(int argc, char* argv[]) | |||
| return 1; | |||
| } | |||
| QApplication app(argc, argv, true); | |||
| app.setQuitOnLastWindowClosed(false); | |||
| // Init Plugin client | |||
| CarlaPluginClient client(name ? name : label); | |||
| @@ -521,7 +487,7 @@ int main(int argc, char* argv[]) | |||
| extraStuff = CarlaBackend::findDSSIGUI(filename, label); | |||
| // Init plugin | |||
| int ret; | |||
| int ret = 0; | |||
| if (carla_add_plugin(CarlaBackend::BINARY_NATIVE, itype, filename, name, label, extraStuff)) | |||
| { | |||
| @@ -537,8 +503,7 @@ int main(int argc, char* argv[]) | |||
| } | |||
| client.ready(); | |||
| ret = app.exec(); | |||
| client.exec(); | |||
| carla_remove_plugin(0); | |||
| } | |||
| @@ -33,14 +33,15 @@ endif | |||
| # -------------------------------------------------------------- | |||
| # Plugin bridges | |||
| BUILD_PLUGIN_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_PLUGIN -DBRIDGE_PLUGIN | |||
| BUILD_PLUGIN_FLAGS += -DWANT_JACK -I../backend/engine -I../backend/plugin -I../libs -I../libs/distrho | |||
| BUILD_PLUGIN_FLAGS += $(shell pkg-config --cflags jack gl) $(QT_UI_FLAGS) | |||
| BUILD_PLUGIN_FLAGS = $(BUILD_CXX_FLAGS) | |||
| BUILD_PLUGIN_FLAGS += -DBUILD_BRIDGE_PLUGIN -DBRIDGE_PLUGIN -DWANT_JACK | |||
| BUILD_PLUGIN_FLAGS += -I../backend/engine -I../backend/plugin -I../libs -I../libs/distrho | |||
| BUILD_PLUGIN_FLAGS += $(shell pkg-config --cflags gl) | |||
| LINK_PLUGIN_FLAGS = $(LINK_FLAGS) | |||
| LINK_PLUGIN_FLAGS += $(QT_UI_LIBS) $(shell pkg-config --libs gl) | |||
| LINK_PLUGIN_FLAGS += $(shell pkg-config --libs gl) | |||
| NATIVE_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) | |||
| NATIVE_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) $(shell pkg-config --cflags jack) | |||
| NATIVE_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(shell pkg-config --libs jack) -ldl | |||
| ifeq ($(HAVE_SUIL),true) | |||
| @@ -39,12 +39,6 @@ | |||
| # define CARLA_OS_UNIX | |||
| #endif | |||
| #ifdef CARLA_OS_WIN | |||
| # define OS_SEP '\\' | |||
| #else | |||
| # define OS_SEP '/' | |||
| #endif | |||
| // Check for C++11 support | |||
| #if defined(HAVE_CPP11_SUPPORT) | |||
| # define CARLA_PROPER_CPP11_SUPPORT | |||
| @@ -137,4 +131,11 @@ | |||
| # endif | |||
| #endif | |||
| // Define OS_SEP | |||
| #ifdef CARLA_OS_WIN | |||
| # define OS_SEP '\\' | |||
| #else | |||
| # define OS_SEP '/' | |||
| #endif | |||
| #endif // __CARLA_DEFINES_HPP__ | |||
| @@ -300,7 +300,7 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||
| * @type: the type of the struct this is embedded in. | |||
| * @member: the name of the list_struct within the struct. | |||
| */ | |||
| #ifdef __GNUC__ | |||
| #if defined(__GNUC__) && ! defined(QTCREATOR_TEST) | |||
| # define list_entry(ptr, type, member) \ | |||
| container_of(ptr, type, member) | |||
| #else | |||