| @@ -21,8 +21,10 @@ | |||
| #include "CarlaDefines.hpp" | |||
| #ifdef CARLA_PROPER_CPP11_SUPPORT | |||
| # define SIZE_INT : int | |||
| # include <cstdint> | |||
| #else | |||
| # define SIZE_INT | |||
| # include <stdint.h> | |||
| #endif | |||
| @@ -131,7 +133,7 @@ const unsigned int PATCHBAY_PORT_IS_PARAMETER = 0x200; //!< Patchbay port is of | |||
| /*! | |||
| * The binary type of a plugin. | |||
| */ | |||
| enum BinaryType : int { | |||
| enum BinaryType SIZE_INT { | |||
| BINARY_NONE = 0, //!< Null binary type. | |||
| BINARY_POSIX32 = 1, //!< POSIX 32bit. | |||
| BINARY_POSIX64 = 2, //!< POSIX 64bit. | |||
| @@ -144,7 +146,7 @@ enum BinaryType : int { | |||
| * All the available plugin types, provided by subclasses of CarlaPlugin.\n | |||
| * Some plugin classes might provide more than 1 plugin type. | |||
| */ | |||
| enum PluginType : int { | |||
| enum PluginType SIZE_INT { | |||
| PLUGIN_NONE = 0, //!< Null plugin type. | |||
| PLUGIN_INTERNAL = 1, //!< Internal plugin. | |||
| PLUGIN_LADSPA = 2, //!< LADSPA plugin. | |||
| @@ -162,7 +164,7 @@ enum PluginType : int { | |||
| * Plugin category, describing the funtionality of a plugin.\n | |||
| * When a plugin fails to tell its own category, one is atributted to it based on its name. | |||
| */ | |||
| enum PluginCategory : int { | |||
| enum PluginCategory SIZE_INT { | |||
| PLUGIN_CATEGORY_NONE = 0, //!< Null plugin category. | |||
| PLUGIN_CATEGORY_SYNTH = 1, //!< A synthesizer or generator. | |||
| PLUGIN_CATEGORY_DELAY = 2, //!< A delay or reverberator. | |||
| @@ -177,7 +179,7 @@ enum PluginCategory : int { | |||
| /*! | |||
| * Plugin parameter type. | |||
| */ | |||
| enum ParameterType : int { | |||
| enum ParameterType SIZE_INT { | |||
| PARAMETER_UNKNOWN = 0, //!< Null parameter type. | |||
| PARAMETER_INPUT = 1, //!< Input parameter. | |||
| PARAMETER_OUTPUT = 2, //!< Ouput parameter. | |||
| @@ -193,7 +195,7 @@ enum ParameterType : int { | |||
| * Internal parameter indexes.\n | |||
| * These are special parameters used internally, plugins do not know about their existence. | |||
| */ | |||
| enum InternalParametersIndex : int { | |||
| enum InternalParametersIndex SIZE_INT { | |||
| PARAMETER_NULL = -1, //!< Null parameter. | |||
| PARAMETER_ACTIVE = -2, //!< Active parameter, can only be 'true' or 'false'; default is 'false'. | |||
| PARAMETER_DRYWET = -3, //!< Dry/Wet parameter, range 0.0...1.0; default is 1.0. | |||
| @@ -208,7 +210,7 @@ enum InternalParametersIndex : int { | |||
| /*! | |||
| * The icon of a patchbay client/group. | |||
| */ | |||
| enum PatchbayIconType : int { | |||
| enum PatchbayIconType SIZE_INT { | |||
| PATCHBAY_ICON_APPLICATION = 0, //!< Generic application icon. | |||
| PATCHBAY_ICON_HARDWARE = 1, //!< Hardware icon. | |||
| PATCHBAY_ICON_CARLA = 2, //!< Carla icon. | |||
| @@ -221,7 +223,7 @@ enum PatchbayIconType : int { | |||
| * Options used in the CarlaEngine::setOption() calls.\n | |||
| * All options except paths must be set before initiliazing or after closing the engine. | |||
| */ | |||
| enum OptionsType : int { | |||
| enum OptionsType SIZE_INT { | |||
| /*! | |||
| * Set the current process name.\n | |||
| * This is a convenience option, as Python lacks this functionality. | |||
| @@ -414,7 +416,7 @@ enum OptionsType : int { | |||
| * Opcodes sent from the engine callback to the GUI, as defined by CallbackFunc. | |||
| * \see CarlaEngine::setCallback() | |||
| */ | |||
| enum CallbackType : int { | |||
| enum CallbackType SIZE_INT { | |||
| /*! | |||
| * Debug.\n | |||
| * This opcode is undefined and used only for testing purposes. | |||
| @@ -660,7 +662,7 @@ enum CallbackType : int { | |||
| * Engine process mode. | |||
| * \see OPTION_PROCESS_MODE | |||
| */ | |||
| enum ProcessMode : int { | |||
| enum ProcessMode SIZE_INT { | |||
| PROCESS_MODE_SINGLE_CLIENT = 0, //!< Single client mode (dynamic input/outputs as needed by plugins). | |||
| PROCESS_MODE_MULTIPLE_CLIENTS = 1, //!< Multiple client mode (1 master client + 1 client per plugin). | |||
| PROCESS_MODE_CONTINUOUS_RACK = 2, //!< Single client, 'rack' mode. Processes plugins in order of Id, with forced stereo. | |||
| @@ -671,7 +673,7 @@ enum ProcessMode : int { | |||
| /*! | |||
| * All the available transport modes | |||
| */ | |||
| enum TransportMode : int { | |||
| enum TransportMode SIZE_INT { | |||
| TRANSPORT_MODE_INTERNAL = 0, //!< Internal transport mode. | |||
| TRANSPORT_MODE_JACK = 1, //!< Transport from JACK, only available if driver name is "JACK". | |||
| TRANSPORT_MODE_PLUGIN = 2, //!< Transport from host, used when Carla is a plugin. | |||
| @@ -825,4 +827,6 @@ class CarlaPlugin; | |||
| CARLA_BACKEND_END_NAMESPACE | |||
| #undef SIZE_INT | |||
| #endif // CARLA_BACKEND_HPP_INCLUDED | |||
| @@ -24,13 +24,13 @@ ifeq ($(HAVE_PULSEAUDIO),true) | |||
| BUILD_CXX_FLAGS += $(shell pkg-config --cflags libpulse-simple) -D__LINUX_PULSE__ | |||
| endif | |||
| ifeq ($(MACOS),true) | |||
| BUILD_CXX_FLAGS += -D__MACOSX_CORE__ | |||
| endif | |||
| # ifeq ($(MACOS),true) | |||
| # BUILD_CXX_FLAGS += -D__MACOSX_CORE__ | |||
| # endif | |||
| ifeq ($(WIN32),true) | |||
| BUILD_CXX_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_MM__ | |||
| endif | |||
| # ifeq ($(WIN32),true) | |||
| # BUILD_CXX_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_MM__ | |||
| # endif | |||
| # -------------------------------------------------------------- | |||
| @@ -50,14 +50,13 @@ OBJS += \ | |||
| rtaudio-4.0.12/RtAudio.cpp.o \ | |||
| rtmidi-2.0.1/RtMidi.cpp.o | |||
| ifeq ($(WIN32),true) | |||
| OBJS += \ | |||
| rtaudio-4.0.12/include/asio.cpp.o \ | |||
| rtaudio-4.0.12/include/asiodrivers.cpp.o \ | |||
| rtaudio-4.0.12/include/asiolist.cpp.o \ | |||
| rtaudio-4.0.12/include/iasiothiscallresolver.cpp.o | |||
| endif | |||
| # ifeq ($(WIN32),true) | |||
| # OBJS += \ | |||
| # rtaudio-4.0.12/include/asio.cpp.o \ | |||
| # rtaudio-4.0.12/include/asiodrivers.cpp.o \ | |||
| # rtaudio-4.0.12/include/asiolist.cpp.o \ | |||
| # rtaudio-4.0.12/include/iasiothiscallresolver.cpp.o | |||
| # endif | |||
| TARGET = ../libcarla_engine.a | |||
| TARGETp = ../libcarla_engine_plugin.a | |||
| @@ -2272,7 +2272,7 @@ public: | |||
| #if defined(Q_WS_X11) | |||
| CarlaString uiBridgeBinary(engineOptions.bridge_vstX11); | |||
| #elif defined(CARLA_OS_MAC) | |||
| CarlaString uiBridgeBinary(engineOptions.bridge_vstCocoa); | |||
| CarlaString uiBridgeBinary(engineOptions.bridge_vstMac); | |||
| #elif defined(CARLA_OS_WIN) | |||
| CarlaString uiBridgeBinary(engineOptions.bridge_vstHWND); | |||
| #else | |||
| @@ -16,6 +16,16 @@ BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo) | |||
| LINK_FLAGS += $(shell pkg-config --libs liblo) | |||
| LINK_FLAGS += -lpthread | |||
| # -------------------------------------------------------------- | |||
| # Juce | |||
| LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS) | |||
| LINK_FLAGS += $(JUCE_CORE_LIBS) | |||
| LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) | |||
| LINK_FLAGS += $(JUCE_EVENTS_LIBS) | |||
| LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) | |||
| LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) | |||
| # -------------------------------------------------------------- | |||
| # Engine | |||
| @@ -36,24 +46,14 @@ endif | |||
| ifeq ($(HAVE_LINUXSAMPLER),true) | |||
| LINK_FLAGS += $(shell pkg-config --libs linuxsampler) | |||
| ifeq ($(WIN32),true) | |||
| LINK_FLAGS += lrpcrt4 | |||
| endif | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Native | |||
| ifeq ($(WIN32),true) | |||
| W32_LIBS = -lcomdlg32 -ldsound -lgdi32 -limm32 -lole32 -luuid -lwinmm -lwinspool -lws2_32 | |||
| ifeq ($(HAVE_LINUXSAMPLER),true) | |||
| W32_LIBS += -lrpcrt4 | |||
| endif | |||
| else | |||
| ifeq ($(MACOS),true) | |||
| DGL_LIBS = -framework Cocoa | |||
| else | |||
| DGL_LIBS = -lX11 | |||
| endif | |||
| endif | |||
| ifeq ($(HAVE_AF_DEPS),true) | |||
| LINK_FLAGS += $(shell pkg-config --libs sndfile) | |||
| ifeq ($(HAVE_FFMPEG),true) | |||
| @@ -66,7 +66,7 @@ LINK_FLAGS += $(shell pkg-config --libs smf) | |||
| endif | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| LINK_FLAGS += $(shell pkg-config --libs gl) $(DGL_LIBS) | |||
| LINK_FLAGS += $(shell pkg-config --libs gl) | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| @@ -76,13 +76,6 @@ LINK_FLAGS += $(shell pkg-config --libs ntk_images ntk) | |||
| endif | |||
| endif | |||
| EXTRA_LIBS = -ldl -lfreetype -lXext | |||
| LINK_FLAGS += $(EXTRA_LIBS) | |||
| ifneq ($(MACOS),true) | |||
| EXTRA_LIBS += -lrt | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| LIBS = ../libcarla_engine.a | |||
| @@ -56,16 +56,17 @@ WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(EXTRA_LIBS) -mwindows -lwinspool -lole3 | |||
| # -------------------------------------------------------------- | |||
| # Plugin bridges (Native) | |||
| ifeq ($(MACOS),true) | |||
| DGL_LIBS = -framework Cocoa | |||
| else | |||
| DGL_LIBS = -lX11 | |||
| endif | |||
| NATIVE_BUILD_FLAGS = $(POSIX_BUILD_FLAGS) | |||
| NATIVE_BUILD_FLAGS += -DWANT_NATIVE | |||
| NATIVE_LINK_FLAGS = $(POSIX_LINK_FLAGS) | |||
| NATIVE_LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS) | |||
| NATIVE_LINK_FLAGS += $(JUCE_CORE_LIBS) | |||
| NATIVE_LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) | |||
| NATIVE_LINK_FLAGS += $(JUCE_EVENTS_LIBS) | |||
| NATIVE_LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) | |||
| NATIVE_LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) | |||
| ifeq ($(HAVE_FLUIDSYNTH),true) | |||
| NATIVE_BUILD_FLAGS += -DWANT_FLUIDSYNTH | |||
| NATIVE_BUILD_FLAGS += $(shell pkg-config --cflags fluidsynth) | |||
| @@ -94,14 +95,14 @@ endif | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| NATIVE_BUILD_FLAGS += -DWANT_OPENGL | |||
| NATIVE_LINK_FLAGS += $(shell pkg-config --libs gl) $(DGL_LIBS) | |||
| NATIVE_LINK_FLAGS += $(shell pkg-config --libs gl) | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| NATIVE_BUILD_FLAGS += -DWANT_ZYNADDSUBFX | |||
| NATIVE_LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml zlib) | |||
| ifeq ($(HAVE_ZYN_UI_DEPS),true) | |||
| NATIVE_LINK_FLAGS += $(shell pkg-config --libs ntk ntk_images) | |||
| NATIVE_LINK_FLAGS += $(shell pkg-config --libs ntk_images ntk) | |||
| endif | |||
| endif | |||
| @@ -385,11 +386,12 @@ OBJS_NATIVE += \ | |||
| # libs | |||
| OBJS_NATIVE += \ | |||
| ../modules/carla_native.a \ | |||
| ../modules/dgl.a \ | |||
| ../modules/juce_audio_basics.a \ | |||
| ../modules/juce_core.a \ | |||
| ../modules/juce_data_structures.a \ | |||
| ../modules/juce_events.a \ | |||
| ../modules/juce_graphics.a \ | |||
| ../modules/juce_gui_basics.a \ | |||
| ../modules/rtmempool.a | |||
| ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
| @@ -397,6 +399,11 @@ OBJS_NATIVE += \ | |||
| ../modules/lilv.a | |||
| endif | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| OBJS_NATIVE += \ | |||
| ../modules/dgl.a | |||
| endif | |||
| carla-bridge-native: $(FILES) $(OBJS_NATIVE) | |||
| $(CXX) $(OBJS_NATIVE) $(NATIVE_LINK_FLAGS) -o $@ | |||
| @@ -60,7 +60,7 @@ | |||
| #ifndef CARLA_PROPER_CPP11_SUPPORT | |||
| # define override | |||
| # define final | |||
| # define noexcept | |||
| # define noexcept throw() | |||
| # define nullptr (0) | |||
| #endif | |||
| @@ -217,6 +217,9 @@ midi-sequencer.cpp.o: midi-sequencer.cpp midi-base.hpp $(CXXDEPS) | |||
| nekofilter.c.o: nekofilter.c nekofilter/*.c nekofilter/*.h $(CDEPS) | |||
| $(CC) $< $(BUILD_C_FLAGS) -c -o $@ | |||
| vex-%.cpp.o: vex-%.cpp | |||
| $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
| zynaddsubfx-ui.cpp.o: zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP) | |||
| $(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@ | |||
| @@ -234,9 +237,6 @@ zynaddsubfx/UI/%.h: zynaddsubfx/UI/%.fl | |||
| %.c.o: %.c | |||
| $(CC) $< $(BUILD_C_FLAGS) -c -o $@ | |||
| # %.cpp.o: %.cpp | |||
| # $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
| moc_%.cpp: %.hpp | |||
| $(MOC) $< -DMOC_PARSING -o $@ | |||
| @@ -41,6 +41,21 @@ START_NAMESPACE_DISTRHO | |||
| // ----------------------------------------------------------------------- | |||
| // Carla UI | |||
| #ifdef DISTRHO_UI_OPENGL | |||
| # if ! DISTRHO_PLUGIN_WANT_STATE | |||
| static const setStateFunc setStateCallback = nullptr; | |||
| # endif | |||
| # if ! DISTRHO_PLUGIN_IS_SYNTH | |||
| static const sendNoteFunc sendNoteCallback = nullptr; | |||
| # endif | |||
| #else | |||
| static const editParamFunc editParameterCallback = nullptr; | |||
| static const setParamFunc setParameterCallback = nullptr; | |||
| static const setStateFunc setStateCallback = nullptr; | |||
| static const sendNoteFunc sendNoteCallback = nullptr; | |||
| static const uiResizeFunc uiResizeCallback = nullptr; | |||
| #endif | |||
| #ifdef DISTRHO_UI_EXTERNAL | |||
| class UICarla : public CarlaPipeServer | |||
| #else | |||
| @@ -271,8 +286,6 @@ private: | |||
| { | |||
| handlePtr->handleSetState(key, value); | |||
| } | |||
| #else | |||
| static constexpr setStateFunc setStateCallback = nullptr; | |||
| #endif | |||
| #if DISTRHO_PLUGIN_IS_SYNTH | |||
| @@ -280,8 +293,6 @@ private: | |||
| { | |||
| handlePtr->handleSendNote(onOff, channel, note, velocity); | |||
| } | |||
| #else | |||
| static constexpr sendNoteFunc sendNoteCallback = nullptr; | |||
| #endif | |||
| static void uiResizeCallback(void* ptr, unsigned int width, unsigned int height) | |||
| @@ -290,12 +301,6 @@ private: | |||
| } | |||
| #undef handlePtr | |||
| #else | |||
| static constexpr editParamFunc editParameterCallback = nullptr; | |||
| static constexpr setParamFunc setParameterCallback = nullptr; | |||
| static constexpr setStateFunc setStateCallback = nullptr; | |||
| static constexpr sendNoteFunc sendNoteCallback = nullptr; | |||
| static constexpr uiResizeFunc uiResizeCallback = nullptr; | |||
| #endif | |||
| CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UICarla) | |||
| @@ -55,9 +55,11 @@ public: | |||
| bool isResizable() const noexcept; | |||
| void setResizable(bool yesNo); | |||
| #ifndef DGL_OS_MAC | |||
| int getWidth() const noexcept; | |||
| int getHeight() const noexcept; | |||
| Size<int> getSize() const noexcept; | |||
| #endif | |||
| void setSize(unsigned int width, unsigned int height); | |||
| void setTitle(const char* title); | |||
| @@ -245,8 +245,10 @@ public: | |||
| fVisible = yesNo; | |||
| #ifndef DGL_OS_MAC | |||
| if (yesNo && fFirstInit) | |||
| setSize(fView->width, fView->height, true); | |||
| #endif | |||
| #if DGL_OS_WINDOWS | |||
| if (yesNo) | |||
| @@ -299,11 +301,14 @@ public: | |||
| fResizable = yesNo; | |||
| #ifndef DGL_OS_MAC | |||
| setSize(fView->width, fView->height, true); | |||
| #endif | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| #ifndef DGL_OS_MAC | |||
| int getWidth() const noexcept | |||
| { | |||
| return fView->width; | |||
| @@ -318,6 +323,7 @@ public: | |||
| { | |||
| return Size<int>(fView->width, fView->height); | |||
| } | |||
| #endif | |||
| void setSize(unsigned int width, unsigned int height, const bool forced = false) | |||
| { | |||
| @@ -326,11 +332,13 @@ public: | |||
| if (height == 0) | |||
| height = 1; | |||
| #ifndef DGL_OS_MAC | |||
| fView->width = width; | |||
| fView->height = height; | |||
| if (fView->width == (int)width && fView->height == (int)height && ! forced) | |||
| return; | |||
| #endif | |||
| #if DGL_OS_WINDOWS | |||
| int winFlags = WS_POPUPWINDOW | WS_CAPTION; | |||
| @@ -735,6 +743,7 @@ void Window::setResizable(bool yesNo) | |||
| pData->setResizable(yesNo); | |||
| } | |||
| #ifndef DGL_OS_MAC | |||
| int Window::getWidth() const noexcept | |||
| { | |||
| return pData->getWidth(); | |||
| @@ -749,6 +758,7 @@ Size<int> Window::getSize() const noexcept | |||
| { | |||
| return pData->getSize(); | |||
| } | |||
| #endif | |||
| void Window::setSize(unsigned int width, unsigned int height) | |||
| { | |||
| @@ -96,7 +96,7 @@ | |||
| #ifndef PROPER_CPP11_SUPPORT | |||
| # define override | |||
| # define noexcept | |||
| # define noexcept throw() | |||
| # define nullptr (0) | |||
| #endif | |||
| @@ -30,6 +30,7 @@ | |||
| #include <clocale> | |||
| #include <fcntl.h> | |||
| #include <signal.h> | |||
| #include <sys/wait.h> | |||
| // ----------------------------------------------------------------------- | |||