diff --git a/source/backend/CarlaBackend.hpp b/source/backend/CarlaBackend.hpp index 11226f210..933880189 100644 --- a/source/backend/CarlaBackend.hpp +++ b/source/backend/CarlaBackend.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_BACKEND_HPP__ -#define __CARLA_BACKEND_HPP__ +#ifndef CARLA_BACKEND_HPP_INCLUDED +#define CARLA_BACKEND_HPP_INCLUDED #include "CarlaDefines.hpp" @@ -39,13 +39,12 @@ CARLA_BACKEND_START_NAMESPACE * * The Carla Backend API.\n * This is the base definitions for everything in the Carla code. - * * @{ */ -const unsigned int MAX_DEFAULT_PLUGINS = 99; //!< Maximum default number of loadable plugins -const unsigned int MAX_RACK_PLUGINS = 16; //!< Maximum number of loadable plugins in rack mode -const unsigned int MAX_PATCHBAY_PLUGINS = 255; //!< Maximum number of loadable plugins in patchbay mode +const unsigned int MAX_DEFAULT_PLUGINS = 99; //!< Maximum default number of loadable plugins. +const unsigned int MAX_RACK_PLUGINS = 16; //!< Maximum number of loadable plugins in rack mode. +const unsigned int MAX_PATCHBAY_PLUGINS = 255; //!< Maximum number of loadable plugins in patchbay mode. const unsigned int MAX_DEFAULT_PARAMETERS = 200; //!< Maximum default number of parameters allowed.\see OPTION_MAX_PARAMETERS /*! @@ -55,16 +54,15 @@ const unsigned int MAX_DEFAULT_PARAMETERS = 200; //!< Maximum default number of * \see CarlaPlugin::hints() * @{ */ -const unsigned int PLUGIN_IS_BRIDGE = 0x001; //!< Plugin is a bridge (ie, BridgePlugin). This hint is required because "bridge" itself is not a plugin type. +const unsigned int PLUGIN_IS_BRIDGE = 0x001; //!< Plugin is a bridge. This hint is required because "bridge" itself is not a plugin type. const unsigned int PLUGIN_IS_RTSAFE = 0x002; //!< Plugin is hard real-time safe. const unsigned int PLUGIN_IS_SYNTH = 0x004; //!< Plugin is a synthesizer (produces sound). const unsigned int PLUGIN_HAS_GUI = 0x010; //!< Plugin has its own custom GUI. -const unsigned int PLUGIN_HAS_GUI_AS_FILE = 0x020; //!< Plugin has custom GUI as a single file. -const unsigned int PLUGIN_HAS_SINGLE_THREAD = 0x040; //!< Plugin needs a single thread for both DSP and UI events. -const unsigned int PLUGIN_CAN_DRYWET = 0x100; //!< Plugin can make use of Dry/Wet controls. -const unsigned int PLUGIN_CAN_VOLUME = 0x200; //!< Plugin can make use of Volume controls. -const unsigned int PLUGIN_CAN_BALANCE = 0x400; //!< Plugin can make use of Left & Right Balance controls. -const unsigned int PLUGIN_CAN_PANNING = 0x800; //!< Plugin can make use of Panning controls. +const unsigned int PLUGIN_HAS_SINGLE_THREAD = 0x020; //!< Plugin has a single thread for all UI events (not thread-safe). +const unsigned int PLUGIN_CAN_DRYWET = 0x100; //!< Plugin can use internal Dry/Wet control. +const unsigned int PLUGIN_CAN_VOLUME = 0x200; //!< Plugin can use internal Volume control. +const unsigned int PLUGIN_CAN_BALANCE = 0x400; //!< Plugin can use internal Left & Right Balance controls. +const unsigned int PLUGIN_CAN_PANNING = 0x800; //!< Plugin can use internal Panning control. /**@}*/ /*! @@ -74,15 +72,15 @@ const unsigned int PLUGIN_CAN_PANNING = 0x800; //!< Plugin can make use of * \see CarlaPlugin::availableOptions() and CarlaPlugin::options() * @{ */ -const unsigned int PLUGIN_OPTION_FIXED_BUFFER = 0x001; //!< Use a constant, fixed-size audio buffer -const unsigned int PLUGIN_OPTION_FORCE_STEREO = 0x002; //!< Force mono plugin as stereo -const unsigned int PLUGIN_OPTION_MAP_PROGRAM_CHANGES = 0x004; //!< Map MIDI-Programs to plugin programs -const unsigned int PLUGIN_OPTION_USE_CHUNKS = 0x008; //!< Use chunks to save data -const unsigned int PLUGIN_OPTION_SEND_CONTROL_CHANGES = 0x010; //!< Send MIDI CC events -const unsigned int PLUGIN_OPTION_SEND_CHANNEL_PRESSURE = 0x020; //!< Send MIDI channel pressure events -const unsigned int PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH = 0x040; //!< Send MIDI note aftertouch events -const unsigned int PLUGIN_OPTION_SEND_PITCHBEND = 0x080; //!< Send MIDI pitchbend events -const unsigned int PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100; //!< Send MIDI all sounds/notes off events, single-note offs otherwise +const unsigned int PLUGIN_OPTION_FIXED_BUFFER = 0x001; //!< Use a constant/fixed-size audio buffer. +const unsigned int PLUGIN_OPTION_FORCE_STEREO = 0x002; //!< Force mono plugin as stereo. +const unsigned int PLUGIN_OPTION_MAP_PROGRAM_CHANGES = 0x004; //!< Map MIDI-Programs to plugin programs. +const unsigned int PLUGIN_OPTION_USE_CHUNKS = 0x008; //!< Use chunks to save&restore data. +const unsigned int PLUGIN_OPTION_SEND_CONTROL_CHANGES = 0x010; //!< Send MIDI control change events. +const unsigned int PLUGIN_OPTION_SEND_CHANNEL_PRESSURE = 0x020; //!< Send MIDI channel pressure events. +const unsigned int PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH = 0x040; //!< Send MIDI note aftertouch events. +const unsigned int PLUGIN_OPTION_SEND_PITCHBEND = 0x080; //!< Send MIDI pitchbend events. +const unsigned int PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100; //!< Send MIDI all-sounds/notes-off events, single note-offs otherwise. /**@}*/ /*! @@ -94,11 +92,11 @@ const unsigned int PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100; //!< Send MIDI a */ const unsigned int PARAMETER_IS_BOOLEAN = 0x001; //!< Parameter value is a boolean (always at minimum or maximum values). const unsigned int PARAMETER_IS_INTEGER = 0x002; //!< Parameter value is an integer. -const unsigned int PARAMETER_IS_LOGARITHMIC = 0x004; //!< Parameter is logarithmic. -const unsigned int PARAMETER_IS_ENABLED = 0x008; //!< Parameter is enabled and will be shown in the host built-in editor. -const unsigned int PARAMETER_IS_AUTOMABLE = 0x010; //!< Parameter is automable (realtime safe) -const unsigned int PARAMETER_IS_READ_ONLY = 0x020; //!< Parameter is read-only -const unsigned int PARAMETER_USES_SAMPLERATE = 0x040; //!< Parameter needs sample rate to work (value and ranges are multiplied by SR, and must be divided by SR on save). +const unsigned int PARAMETER_IS_LOGARITHMIC = 0x004; //!< Parameter values are logarithmic. +const unsigned int PARAMETER_IS_ENABLED = 0x008; //!< Parameter is enabled (can be changed). +const unsigned int PARAMETER_IS_AUTOMABLE = 0x010; //!< Parameter is automable (realtime safe). +const unsigned int PARAMETER_IS_READ_ONLY = 0x020; //!< Parameter is read-only. +const unsigned int PARAMETER_USES_SAMPLERATE = 0x040; //!< Parameter needs Sample-Rate to work (value and ranges are multiplied by SR, and must be divided by SR on save). const unsigned int PARAMETER_USES_SCALEPOINTS = 0x080; //!< Parameter uses scalepoints to define internal values in a meaningful way. const unsigned int PARAMETER_USES_CUSTOM_TEXT = 0x100; //!< Parameter uses custom text for displaying its value.\see CarlaPlugin::getParameterText() /**@}*/ @@ -106,15 +104,14 @@ const unsigned int PARAMETER_USES_CUSTOM_TEXT = 0x100; //!< Parameter uses custo /*! * @defgroup CustomDataTypes Custom Data types * - * The type defines how the \param value in CustomData is stored. - * - * Types are valid URIs.\n - * Any non-string, non-simple type (not integral) is saved in a base64 encoded format. + * The type defines how the \param value in the CustomData struct is stored.\n + * Types are valid URIs. Any non-string or non-simple type (not integral) is saved in a base64 encoded format. + * \see CustomData * @{ */ -const char* const CUSTOM_DATA_INVALID = nullptr; //!< Null or Invalid data. -const char* const CUSTOM_DATA_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"; //!< Carla Chunk URI -const char* const CUSTOM_DATA_STRING = "http://kxstudio.sf.net/ns/carla/string"; //!< Carla String URI +const char* const CUSTOM_DATA_INVALID = nullptr; //!< Null or invalid data. +const char* const CUSTOM_DATA_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"; //!< Carla chunk URI. +const char* const CUSTOM_DATA_STRING = "http://kxstudio.sf.net/ns/carla/string"; //!< Carla string URI. /**@}*/ /*! @@ -143,25 +140,25 @@ enum BinaryType { }; /*! - * All the available plugin types, as provided by subclasses of CarlaPlugin.\n + * All the available plugin types, provided by subclasses of CarlaPlugin.\n * Some plugin classes might provide more than 1 plugin type. */ enum PluginType { - PLUGIN_NONE = 0, //!< Null plugin type - PLUGIN_INTERNAL = 1, //!< Internal plugin - PLUGIN_LADSPA = 2, //!< LADSPA plugin - PLUGIN_DSSI = 3, //!< DSSI plugin - PLUGIN_LV2 = 4, //!< LV2 plugin - PLUGIN_VST = 5, //!< VST1/2 plugin - PLUGIN_VST3 = 6, //!< VST3 plugin - PLUGIN_GIG = 7, //!< GIG sound kit - PLUGIN_SF2 = 8, //!< SF2 sound kit (aka SoundFont) - PLUGIN_SFZ = 9 //!< SFZ sound kit + PLUGIN_NONE = 0, //!< Null plugin type. + PLUGIN_INTERNAL = 1, //!< Internal plugin. + PLUGIN_LADSPA = 2, //!< LADSPA plugin. + PLUGIN_DSSI = 3, //!< DSSI plugin. + PLUGIN_LV2 = 4, //!< LV2 plugin. + PLUGIN_VST = 5, //!< VST1/2 plugin. + PLUGIN_VST3 = 6, //!< VST3 plugin. + PLUGIN_GIG = 7, //!< GIG sound kit. + PLUGIN_SF2 = 8, //!< SF2 sound kit (aka SoundFont). + PLUGIN_SFZ = 9 //!< SFZ sound kit. }; /*! * Plugin category, describing the funtionality of a plugin.\n - * When a plugin fails to tell his own category, one is atributted to it based on its name. + * When a plugin fails to tell its own category, one is atributted to it based on its name. */ enum PluginCategory { PLUGIN_CATEGORY_NONE = 0, //!< Null plugin category. @@ -202,8 +199,8 @@ enum InternalParametersIndex { PARAMETER_BALANCE_LEFT = -5, //!< Stereo Balance-Left parameter, range -1.0...1.0; default is -1.0. PARAMETER_BALANCE_RIGHT = -6, //!< Stereo Balance-Right parameter, range -1.0...1.0; default is 1.0. PARAMETER_PANNING = -7, //!< Mono Panning parameter, range -1.0...1.0; default is 0.0. - PARAMETER_CTRL_CHANNEL = -8, //!< MIDI Control channel - PARAMETER_MAX = -9 //!< Max value, defined for convenience + PARAMETER_CTRL_CHANNEL = -8, //!< MIDI Control channel, range -1...15 (-1 = off). + PARAMETER_MAX = -9 //!< Max value, defined for convenience. }; /*! @@ -213,25 +210,26 @@ enum PatchbayIconType { PATCHBAY_ICON_APPLICATION = 0, //!< Generic application icon. PATCHBAY_ICON_HARDWARE = 1, //!< Hardware icon. PATCHBAY_ICON_CARLA = 2, //!< Carla icon. - PATCHBAY_ICON_DISTRHO = 3, //!< DISTRHO icon + PATCHBAY_ICON_DISTRHO = 3, //!< DISTRHO icon. PATCHBAY_ICON_FILE = 4, //!< File icon. PATCHBAY_ICON_PLUGIN = 5 //!< Plugin icon. }; /*! - * Options used in the CarlaEngine::setOption() and set_option() calls.\n + * Options used in the CarlaEngine::setOption() calls.\n * All options except paths must be set before initiliazing or after closing the engine. */ enum OptionsType { /*! - * Try to set the current process name. + * Set the current process name.\n + * This is a convenience option, as Python lacks this functionality. * \note Not available on all platforms. */ OPTION_PROCESS_NAME = 0, /*! * Set the engine processing mode.\n - * Default is PROCESS_MODE_CONTINUOUS_RACK. + * Default is PROCESS_MODE_MULTIPLE_CLIENTS on Linux and PROCESS_MODE_CONTINUOUS_RACK for all other OSes. * \see ProcessMode */ OPTION_PROCESS_MODE = 1, @@ -246,6 +244,7 @@ enum OptionsType { /*! * Force mono plugins as stereo, by running 2 instances at the same time. * \note Not supported by all plugins. + * \see PLUGIN_OPTION_FORCE_STEREO */ OPTION_FORCE_STEREO = 3, @@ -265,6 +264,7 @@ enum OptionsType { /*! * Use (unofficial) dssi-vst chunks feature.\n * Default is no. + * \see PLUGIN_OPTION_USE_CHUNKS */ OPTION_USE_DSSI_VST_CHUNKS = 6, #endif @@ -276,22 +276,22 @@ enum OptionsType { OPTION_MAX_PARAMETERS = 7, /*! - * Timeout value in ms for how much to wait for OSC-Bridges to respond.\n + * Timeout value in ms for how much to wait for UI-Bridges to respond.\n * Default is 4000 (4 secs). */ - OPTION_OSC_UI_TIMEOUT = 8, + OPTION_UI_BRIDGES_TIMEOUT = 8, /*! * JACK auto-connect to hardware ports. */ OPTION_JACK_AUTOCONNECT = 9, +#ifdef WANT_RTAUDIO /*! - * JACK Transport master. + * RtAudio number of periods. */ - OPTION_JACK_TIMEMASTER = 10, + OPTION_RTAUDIO_NUMBER_PERIODS = 10, -#ifdef WANT_RTAUDIO /*! * RtAudio buffer size. */ @@ -415,8 +415,7 @@ enum OptionsType { /*! * Opcodes sent from the engine callback to the GUI, as defined by CallbackFunc. - * - * \see CarlaEngine::setCallback() and set_callback_function() + * \see CarlaEngine::setCallback() */ enum CallbackType { /*! @@ -438,21 +437,19 @@ enum CallbackType { /*! * A plugin has been renamed. - * \param valueStr New name + * \param valueStr New plugin name */ CALLBACK_PLUGIN_RENAMED = 3, /*! * A parameter value has been changed. - * * \param value1 Parameter index - * \param value3 Value + * \param value3 Parameter value */ CALLBACK_PARAMETER_VALUE_CHANGED = 4, /*! * A parameter default has changed. - * * \param value1 Parameter index * \param value3 New default value */ @@ -460,7 +457,6 @@ enum CallbackType { /*! * A parameter's MIDI channel has been changed. - * * \param value1 Parameter index * \param value2 MIDI channel */ @@ -468,7 +464,6 @@ enum CallbackType { /*! * A parameter's MIDI CC has been changed. - * * \param value1 Parameter index * \param value2 MIDI CC */ @@ -476,14 +471,12 @@ enum CallbackType { /*! * The current program has has been changed. - * * \param value1 Program index */ CALLBACK_PROGRAM_CHANGED = 8, /*! * The current MIDI program has been changed. - * * \param value1 MIDI bank * \param value2 MIDI program */ @@ -491,7 +484,6 @@ enum CallbackType { /*! * A note has been pressed. - * * \param value1 Channel * \param value2 Note * \param value3 Velocity @@ -500,7 +492,6 @@ enum CallbackType { /*! * A note has been released. - * * \param value1 Channel * \param value2 Note */ @@ -508,7 +499,6 @@ enum CallbackType { /*! * The plugin's custom GUI state has changed. - * * \param value1 State, as follows:\n * 0: GUI has been closed or hidden\n * 1: GUI has been shown\n @@ -542,32 +532,29 @@ enum CallbackType { CALLBACK_RELOAD_ALL = 17, /*! - * Canvas client added - * + * Canvas client added. * \param value1 Client Id - * \param value2 Client Icon + * \param value2 Client icon * \param valueStr Client name */ CALLBACK_PATCHBAY_CLIENT_ADDED = 18, /*! - * Canvas client removed - * - * \param value1 Client Id + * Canvas client removed. + * \param value1 Client Id + * \param valueStr Client name */ CALLBACK_PATCHBAY_CLIENT_REMOVED = 19, /*! - * Canvas client renamed - * + * Canvas client renamed. * \param value1 Client Id * \param valueStr New client name */ CALLBACK_PATCHBAY_CLIENT_RENAMED = 20, /*! - * Canvas port added - * + * Canvas port added. * \param value1 Client Id * \param value2 Port Id * \param value3 Port flags @@ -576,41 +563,40 @@ enum CallbackType { CALLBACK_PATCHBAY_PORT_ADDED = 21, /*! - * Canvas port remvoed - * - * \param value1 Port Id + * Canvas port removed. + * \param value1 Client Id + * \param value2 Port Id + * \param valueStr Port name */ CALLBACK_PATCHBAY_PORT_REMOVED = 22, /*! - * Canvas port renamed - * - * \param value1 Port Id + * Canvas port renamed. + * \param value1 Client Id + * \param value2 Port Id * \param valueStr New port name */ CALLBACK_PATCHBAY_PORT_RENAMED = 23, /*! - * Canvas port connection added - * + * Canvas port connection added. * \param value1 Output port Id * \param value2 Input port Id */ CALLBACK_PATCHBAY_CONNECTION_ADDED = 24, /*! - * Canvas port connection removed - * + * Canvas port connection removed. * \param value1 Output port Id * \param value2 Input port Id */ CALLBACK_PATCHBAY_CONNECTION_REMOVED = 25, /*! - * Canvas client icon changed - * - * \param value1 Client Id - * \param value2 Client Icon + * Canvas client icon changed. + * \param value1 Client Id + * \param value2 New client icon + * \param valueStr Client name */ CALLBACK_PATCHBAY_ICON_CHANGED = 26, @@ -626,7 +612,6 @@ enum CallbackType { /*! * Engine process mode changed. - * * \param value1 New process mode * \see ProcessMode */ @@ -665,12 +650,11 @@ enum CallbackType { /*! * Engine process mode. - * * \see OPTION_PROCESS_MODE */ enum ProcessMode { - 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_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. PROCESS_MODE_PATCHBAY = 3, //!< Single client, 'patchbay' mode. PROCESS_MODE_BRIDGE = 4 //!< Special mode, used in plugin-bridges only. @@ -681,20 +665,19 @@ enum ProcessMode { */ enum TransportMode { 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 + 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. TRANSPORT_MODE_BRIDGE = 3 //!< Special mode, used in plugin-bridges only. }; /*! - * Callback function the engine will call when something interesting happens. - * - * \see CallbackType and set_callback_function() + * Callback function the engine will use when something interesting happens. + * \see CallbackType */ typedef void (*CallbackFunc)(void* ptr, CallbackType action, unsigned int pluginId, int value1, int value2, float value3, const char* valueStr); /*! - * Parameter data + * Parameter data. */ struct ParameterData { ParameterType type; @@ -716,7 +699,7 @@ struct ParameterData { }; /*! - * Parameter ranges + * Parameter ranges. */ struct ParameterRanges { float def; @@ -749,7 +732,7 @@ struct ParameterRanges { value = max; } - float fixValue(const float& value) const + float getFixedValue(const float& value) const { if (value < min) return min; @@ -758,7 +741,7 @@ struct ParameterRanges { return value; } - float normalizeValue(const float& value) const + float getNormalizedValue(const float& value) const { float newValue = (value - min) / (max - min); @@ -770,14 +753,14 @@ struct ParameterRanges { return newValue; } - float unnormalizeValue(const float& value) const + float getUnnormalizedValue(const float& value) const { return value * (max - min) + min; } }; /*! - * MIDI Program data + * MIDI Program data. */ struct MidiProgramData { uint32_t bank; @@ -793,9 +776,8 @@ struct MidiProgramData { }; /*! - * Custom data, saving key:value 'dictionaries'.\n + * Custom data, for saving key:value 'dictionaries'.\n * \a type is an URI which defines the \a value type. - * * \see CustomDataTypes */ struct CustomData { @@ -819,4 +801,4 @@ class CarlaPlugin; CARLA_BACKEND_END_NAMESPACE -#endif // __CARLA_BACKEND_HPP__ +#endif // CARLA_BACKEND_HPP_INCLUDED diff --git a/source/backend/CarlaEngine.hpp b/source/backend/CarlaEngine.hpp index 105a121e3..f1f16f332 100644 --- a/source/backend/CarlaEngine.hpp +++ b/source/backend/CarlaEngine.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_ENGINE_HPP__ -#define __CARLA_ENGINE_HPP__ +#ifndef CARLA_ENGINE_HPP_INCLUDED +#define CARLA_ENGINE_HPP_INCLUDED #include "CarlaBackend.hpp" #include "CarlaMIDI.h" @@ -279,12 +279,12 @@ struct EngineOptions { #ifndef DOXYGEN EngineOptions() -# if defined(CARLA_OS_WIN) || defined(CARLA_OS_MAC) - : processMode(PROCESS_MODE_CONTINUOUS_RACK), - transportMode(TRANSPORT_MODE_INTERNAL), -# else +# if defined(CARLA_OS_LINUX) : processMode(PROCESS_MODE_MULTIPLE_CLIENTS), transportMode(TRANSPORT_MODE_JACK), +# else + : processMode(PROCESS_MODE_CONTINUOUS_RACK), + transportMode(TRANSPORT_MODE_INTERNAL), # endif forceStereo(false), preferPluginBridges(false), @@ -1230,4 +1230,4 @@ private: CARLA_BACKEND_END_NAMESPACE -#endif // __CARLA_ENGINE_HPP__ +#endif // CARLA_ENGINE_HPP_INCLUDED diff --git a/source/backend/CarlaNative.h b/source/backend/CarlaNative.h index ae1faf416..2e08e4022 100644 --- a/source/backend/CarlaNative.h +++ b/source/backend/CarlaNative.h @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_NATIVE_H__ -#define __CARLA_NATIVE_H__ +#ifndef CARLA_NATIVE_H_INCLUDED +#define CARLA_NATIVE_H_INCLUDED #ifdef __cplusplus extern "C" { @@ -296,4 +296,4 @@ void carla_register_native_plugin_zynaddsubfx(); } // extern "C" #endif -#endif // __CARLA_NATIVE_H__ +#endif // CARLA_NATIVE_H_INCLUDED diff --git a/source/backend/CarlaNative.hpp b/source/backend/CarlaNative.hpp index 1aa2fdec7..56657d3f9 100644 --- a/source/backend/CarlaNative.hpp +++ b/source/backend/CarlaNative.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_NATIVE_HPP__ -#define __CARLA_NATIVE_HPP__ +#ifndef CARLA_NATIVE_HPP_INCLUDED +#define CARLA_NATIVE_HPP_INCLUDED #include "CarlaNative.h" #include "CarlaMIDI.h" @@ -514,4 +514,4 @@ public: ClassName::_set_state, \ ClassName::_dispatcher -#endif // __CARLA_NATIVE_HPP__ +#endif // CARLA_NATIVE_HPP_INCLUDED diff --git a/source/backend/CarlaPlugin.hpp b/source/backend/CarlaPlugin.hpp index bd988cf56..743a26828 100644 --- a/source/backend/CarlaPlugin.hpp +++ b/source/backend/CarlaPlugin.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_PLUGIN_HPP__ -#define __CARLA_PLUGIN_HPP__ +#ifndef CARLA_PLUGIN_HPP_INCLUDED +#define CARLA_PLUGIN_HPP_INCLUDED #include "CarlaBackend.hpp" #include "CarlaString.hpp" @@ -898,4 +898,4 @@ private: CARLA_BACKEND_END_NAMESPACE -#endif // __CARLA_PLUGIN_HPP__ +#endif // CARLA_PLUGIN_HPP_INCLUDED diff --git a/source/backend/CarlaStandalone.hpp b/source/backend/CarlaStandalone.hpp index 6958cfc05..65a24bcb0 100644 --- a/source/backend/CarlaStandalone.hpp +++ b/source/backend/CarlaStandalone.hpp @@ -12,14 +12,13 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_STANDALONE_HPP__ -#define __CARLA_STANDALONE_HPP__ +#ifndef CARLA_STANDALONE_HPP_INCLUDED +#define CARLA_STANDALONE_HPP_INCLUDED #include "CarlaBackend.hpp" -#include "CarlaJuceUtils.hpp" /*! * @defgroup CarlaStandaloneAPI Carla Standalone API @@ -106,8 +105,6 @@ struct CarlaPluginInfo { copyright = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(CarlaPluginInfo) #endif }; @@ -143,8 +140,6 @@ struct CarlaNativePluginInfo { label(nullptr), maker(nullptr), copyright(nullptr) {} - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(CarlaNativePluginInfo) #endif }; @@ -164,8 +159,6 @@ struct CarlaPortCountInfo { : ins(0), outs(0), total(0) {} - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(CarlaPortCountInfo) #endif }; @@ -204,8 +197,6 @@ struct CarlaParameterInfo { unit = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(CarlaParameterInfo) #endif }; @@ -230,8 +221,6 @@ struct CarlaScalePointInfo { label = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(CarlaScalePointInfo) #endif }; @@ -254,8 +243,6 @@ struct CarlaTransportInfo { bar(0), beat(0), bpm(0.0) {} - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(CarlaTransportInfo) #endif }; diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index f3542bb9d..77507c07b 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -836,7 +836,7 @@ public: else groupIcon = PATCHBAY_ICON_APPLICATION; - callback(CALLBACK_PATCHBAY_ICON_CHANGED, 0, groupId, groupIcon, 0.0f, nullptr); + callback(CALLBACK_PATCHBAY_ICON_CHANGED, 0, groupId, groupIcon, 0.0f, groupName); jackbridge_free(data); } @@ -1467,7 +1467,7 @@ protected: GroupNameToId groupNameId(id, name); fUsedGroupNames.removeAll(groupNameId); - callback(CALLBACK_PATCHBAY_CLIENT_REMOVED, 0, id, 0, 0.0f, nullptr); + callback(CALLBACK_PATCHBAY_CLIENT_REMOVED, 0, id, 0, 0.0f, name); } void handleJackPortRegistrationCallback(const jack_port_id_t port, const bool reg) @@ -1543,7 +1543,7 @@ protected: PortNameToId portNameId(groupId, portId, portName, fullPortName); fUsedPortNames.removeOne(portNameId); - callback(CALLBACK_PATCHBAY_PORT_REMOVED, 0, portId, 0, 0.0f, fullPortName); + callback(CALLBACK_PATCHBAY_PORT_REMOVED, 0, groupId, portId, 0.0f, portName); } } @@ -1643,7 +1643,7 @@ protected: { CARLA_ASSERT(portNameId.groupId == groupId); portNameId.rename(portName, newName); - callback(CALLBACK_PATCHBAY_PORT_RENAMED, 0, portNameId.portId, 0, 0.0f, newName); + callback(CALLBACK_PATCHBAY_PORT_RENAMED, 0, groupId, portNameId.portId, 0.0f, newName); break; } } diff --git a/source/carla.py b/source/carla.py index f23b0ed22..fe3aebd02 100755 --- a/source/carla.py +++ b/source/carla.py @@ -82,12 +82,12 @@ elif MACOS: else: CARLA_DEFAULT_AUDIO_DRIVER = "JACK" -if WINDOWS or MACOS: - CARLA_DEFAULT_PROCESS_MODE = PROCESS_MODE_CONTINUOUS_RACK - CARLA_DEFAULT_TRANSPORT_MODE = TRANSPORT_MODE_INTERNAL -else: +if LINUX: CARLA_DEFAULT_PROCESS_MODE = PROCESS_MODE_MULTIPLE_CLIENTS CARLA_DEFAULT_TRANSPORT_MODE = TRANSPORT_MODE_JACK +else: + CARLA_DEFAULT_PROCESS_MODE = PROCESS_MODE_CONTINUOUS_RACK + CARLA_DEFAULT_TRANSPORT_MODE = TRANSPORT_MODE_INTERNAL BUFFER_SIZES = (16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192) SAMPLE_RATES = (22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000) diff --git a/source/carla_backend.py b/source/carla_backend.py index 1e6a3ea26..f343ab579 100644 --- a/source/carla_backend.py +++ b/source/carla_backend.py @@ -97,8 +97,7 @@ PLUGIN_IS_BRIDGE = 0x001 PLUGIN_IS_RTSAFE = 0x002 PLUGIN_IS_SYNTH = 0x004 PLUGIN_HAS_GUI = 0x010 -PLUGIN_HAS_GUI_AS_FILE = 0x020 -PLUGIN_HAS_SINGLE_THREAD = 0x040 +PLUGIN_HAS_SINGLE_THREAD = 0x020 PLUGIN_CAN_DRYWET = 0x100 PLUGIN_CAN_VOLUME = 0x200 PLUGIN_CAN_BALANCE = 0x400 @@ -206,9 +205,9 @@ OPTION_PREFER_PLUGIN_BRIDGES = 4 OPTION_PREFER_UI_BRIDGES = 5 OPTION_USE_DSSI_VST_CHUNKS = 6 OPTION_MAX_PARAMETERS = 7 -OPTION_OSC_UI_TIMEOUT = 8 +OPTION_UI_BRIDGES_TIMEOUT = 8 OPTION_JACK_AUTOCONNECT = 9 -OPTION_JACK_TIMEMASTER = 10 +OPTION_RTAUDIO_NUMBER_PERIODS = 10 OPTION_RTAUDIO_BUFFER_SIZE = 11 OPTION_RTAUDIO_SAMPLE_RATE = 12 OPTION_RTAUDIO_DEVICE = 13 diff --git a/source/carla_shared.py b/source/carla_shared.py index 3df1c220c..7bafcf560 100644 --- a/source/carla_shared.py +++ b/source/carla_shared.py @@ -142,7 +142,7 @@ Carla.host = None Carla.gui = None Carla.isControl = False Carla.isLocal = True -Carla.processMode = PROCESS_MODE_CONTINUOUS_RACK +Carla.processMode = PROCESS_MODE_MULTIPLE_CLIENTS if LINUX else PROCESS_MODE_CONTINUOUS_RACK Carla.maxParameters = MAX_DEFAULT_PARAMETERS # ------------------------------------------------------------------------------------------------------------ diff --git a/source/includes/CarlaDefines.hpp b/source/includes/CarlaDefines.hpp index bc097e1ed..b41293385 100644 --- a/source/includes/CarlaDefines.hpp +++ b/source/includes/CarlaDefines.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_DEFINES_HPP__ -#define __CARLA_DEFINES_HPP__ +#ifndef CARLA_DEFINES_HPP_INCLUDED +#define CARLA_DEFINES_HPP_INCLUDED // Check OS #if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) @@ -43,9 +43,9 @@ #if defined(HAVE_CPP11_SUPPORT) # define CARLA_PROPER_CPP11_SUPPORT #elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) -# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 # define CARLA_PROPER_CPP11_SUPPORT -# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407 +# if (__GNUC__ * 100 + __GNUC_MINOR__) < 407 # define override // gcc4.7+ only # endif # endif @@ -110,9 +110,13 @@ #endif // Define CARLA_SAFE_ASSERT* -#define CARLA_SAFE_ASSERT(cond) ((!(cond)) ? carla_assert(#cond, __FILE__, __LINE__) : pass()) -#define CARLA_SAFE_ASSERT_INT(cond, value) ((!(cond)) ? carla_assert_int(#cond, __FILE__, __LINE__, value) : pass()) -#define CARLA_SAFE_ASSERT_INT2(cond, v1, v2) ((!(cond)) ? carla_assert_int2(#cond, __FILE__, __LINE__, v1, v2) : pass()) +#define CARLA_SAFE_ASSERT(COND) if (COND) pass(); else carla_assert (#COND, __FILE__, __LINE__); +#define CARLA_SAFE_ASSERT_INT(COND, VALUE) if (COND) pass(); else carla_assert_int (#COND, __FILE__, __LINE__, VALUE); +#define CARLA_SAFE_ASSERT_INT2(COND, V1, V2) if (COND) pass(); else carla_assert_int2(#COND, __FILE__, __LINE__, V1, V2); + +// Define CARLA_SAFE_ASSERT_RETURN* +#define CARLA_SAFE_ASSERT_RETURN(COND) if (COND) pass(); else { carla_assert(#COND, __FILE__, __LINE__); return; } +#define CARLA_SAFE_ASSERT_RETURN(COND, RET) if (COND) pass(); else { carla_assert(#COND, __FILE__, __LINE__); return RET; } // Define CARLA_ASSERT* #if defined(CARLA_NO_ASSERTS) @@ -147,4 +151,4 @@ # define OS_SEP '/' #endif -#endif // __CARLA_DEFINES_HPP__ +#endif // CARLA_DEFINES_HPP_INCLUDED diff --git a/source/includes/CarlaMIDI.h b/source/includes/CarlaMIDI.h index ee4591385..8476227fb 100644 --- a/source/includes/CarlaMIDI.h +++ b/source/includes/CarlaMIDI.h @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef __CARLA_MIDI_H__ -#define __CARLA_MIDI_H__ +#ifndef CARLA_MIDI_H_INCLUDED +#define CARLA_MIDI_H_INCLUDED #define MAX_MIDI_CHANNELS 16 #define MAX_MIDI_NOTE 128 @@ -141,4 +141,4 @@ #define MIDI_IS_CONTROL_EFFECT_CONTROL_1(control) ((control) == MIDI_CONTROL_EFFECT_CONTROL_1 || (control) == MIDI_CONTROL_EFFECT_CONTROL_1__LSB) #define MIDI_IS_CONTROL_EFFECT_CONTROL_2(control) ((control) == MIDI_CONTROL_EFFECT_CONTROL_2 || (control) == MIDI_CONTROL_EFFECT_CONTROL_2__LSB) -#endif // __CARLA_MIDI_H__ +#endif // CARLA_MIDI_H_INCLUDED diff --git a/source/includes/ladspa_rdf.hpp b/source/includes/ladspa_rdf.hpp index 6713c7353..0db0e4c24 100644 --- a/source/includes/ladspa_rdf.hpp +++ b/source/includes/ladspa_rdf.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef LADSPA_RDF_INCLUDED -#define LADSPA_RDF_INCLUDED +#ifndef LADSPA_RDF_HPP_INCLUDED +#define LADSPA_RDF_HPP_INCLUDED // Base Types typedef float LADSPA_Data; @@ -169,7 +169,7 @@ struct LADSPA_RDF_Port { } }; -// Plugin +// Plugin Descriptor struct LADSPA_RDF_Descriptor { LADSPA_PluginType Type; unsigned long UniqueID; @@ -207,4 +207,4 @@ struct LADSPA_RDF_Descriptor { } }; -#endif // LADSPA_RDF_INCLUDED +#endif // LADSPA_RDF_HPP_INCLUDED diff --git a/source/includes/lv2_rdf.hpp b/source/includes/lv2_rdf.hpp index 18400ba98..18c1bdf17 100644 --- a/source/includes/lv2_rdf.hpp +++ b/source/includes/lv2_rdf.hpp @@ -12,11 +12,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * For a full copy of the GNU General Public License see the GPL.txt file + * For a full copy of the GNU General Public License see the doc/GPL.txt file */ -#ifndef LV2_RDF_INCLUDED -#define LV2_RDF_INCLUDED +#ifndef LV2_RDF_HPP_INCLUDED +#define LV2_RDF_HPP_INCLUDED #ifdef CARLA_PROPER_CPP11_SUPPORT # include @@ -298,8 +298,6 @@ struct LV2_RDF_PortMidiMap { LV2_RDF_PortMidiMap() : Type(0), Number(0) {} - - CARLA_LEAK_DETECTOR(LV2_RDF_PortMidiMap) }; // Port Points @@ -314,8 +312,6 @@ struct LV2_RDF_PortPoints { Default(0.0f), Minimum(0.0f), Maximum(1.0f) {} - - CARLA_LEAK_DETECTOR(LV2_RDF_PortPoints) }; // Port Unit @@ -351,8 +347,6 @@ struct LV2_RDF_PortUnit { Symbol = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_PortUnit) }; // Port Scale Point @@ -372,8 +366,6 @@ struct LV2_RDF_PortScalePoint { Label = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_PortScalePoint) }; // Port @@ -418,8 +410,6 @@ struct LV2_RDF_Port { ScalePoints = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Port) }; // Preset @@ -444,8 +434,6 @@ struct LV2_RDF_Preset { Label = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Preset) }; // Feature @@ -465,8 +453,6 @@ struct LV2_RDF_Feature { URI = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Feature) }; // UI @@ -520,11 +506,9 @@ struct LV2_RDF_UI { Extensions = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_UI) }; -// Plugin +// Plugin Descriptor struct LV2_RDF_Descriptor { LV2_Property Type[2]; LV2_URI URI; @@ -574,7 +558,7 @@ struct LV2_RDF_Descriptor { UICount(0), UIs(nullptr) { -#ifdef CARLA_PROPER_CPP11_SUPPORT +#ifndef CARLA_PROPER_CPP11_SUPPORT Type[0] = Type[1] = 0x0; #endif } @@ -637,8 +621,6 @@ struct LV2_RDF_Descriptor { UIs = nullptr; } } - - CARLA_DECLARE_NON_COPY_STRUCT_WITH_LEAK_DETECTOR(LV2_RDF_Descriptor) }; -#endif // LV2_RDF_INCLUDED +#endif // LV2_RDF_HPP_INCLUDED