| @@ -106,11 +106,11 @@ endif | |||||
| ifeq ($(TESTBUILD),true) | ifeq ($(TESTBUILD),true) | ||||
| BASE_FLAGS += -Werror -Wcast-qual -Wconversion -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wundef -Wwrite-strings | BASE_FLAGS += -Werror -Wcast-qual -Wconversion -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wundef -Wwrite-strings | ||||
| BASE_FLAGS += -Wcast-align -Wfloat-equal -Wpointer-arith -Wstrict-overflow=5 -Waggregate-return -Wabi -Winit-self -Wuninitialized -Wold-style-definition | |||||
| BASE_FLAGS += -Wfloat-equal -Wpointer-arith -Wstrict-overflow=5 -Waggregate-return -Wabi -Winit-self -Wuninitialized -Wold-style-definition | |||||
| BASE_FLAGS += -Wdocumentation -Wdocumentation-unknown-command | BASE_FLAGS += -Wdocumentation -Wdocumentation-unknown-command | ||||
| # BASE_FLAGS += -Weverything | # BASE_FLAGS += -Weverything | ||||
| ifneq ($(CC),clang) | ifneq ($(CC),clang) | ||||
| BASE_FLAGS += -Wunsafe-loop-optimizations | |||||
| BASE_FLAGS += -Wcast-align -Wunsafe-loop-optimizations | |||||
| endif | endif | ||||
| ifneq ($(MACOS),true) | ifneq ($(MACOS),true) | ||||
| BASE_FLAGS += -Wmissing-declarations -Wsign-conversion | BASE_FLAGS += -Wmissing-declarations -Wsign-conversion | ||||
| @@ -49,7 +49,7 @@ using CarlaBackend::CarlaPlugin; | |||||
| * | * | ||||
| * This API makes it possible to use the Carla Backend in a standalone host application.. | * This API makes it possible to use the Carla Backend in a standalone host application.. | ||||
| * | * | ||||
| * None of the returned values in this API calls need to be deleted or free'd.\n | |||||
| * None of the returned values in this API calls need to be deleted or free'd. | |||||
| * When a function fails (returns false or NULL), use carla_get_last_error() to find out what went wrong. | * When a function fails (returns false or NULL), use carla_get_last_error() to find out what went wrong. | ||||
| * @{ | * @{ | ||||
| */ | */ | ||||
| @@ -85,20 +85,20 @@ typedef struct _CarlaPluginInfo { | |||||
| uint optionsAvailable; | uint optionsAvailable; | ||||
| /*! | /*! | ||||
| * Plugin options currently enabled.\n | |||||
| * Plugin options currently enabled. | |||||
| * Some options are enabled but not available, which means they will always be on. | * Some options are enabled but not available, which means they will always be on. | ||||
| * @see PluginOptions | * @see PluginOptions | ||||
| */ | */ | ||||
| uint optionsEnabled; | uint optionsEnabled; | ||||
| /*! | /*! | ||||
| * Plugin filename.\n | |||||
| * Plugin filename. | |||||
| * This can be the plugin binary or resource file. | * This can be the plugin binary or resource file. | ||||
| */ | */ | ||||
| const char* filename; | const char* filename; | ||||
| /*! | /*! | ||||
| * Plugin name.\n | |||||
| * Plugin name. | |||||
| * This name is unique within a Carla instance. | * This name is unique within a Carla instance. | ||||
| * @see carla_get_real_plugin_name() | * @see carla_get_real_plugin_name() | ||||
| */ | */ | ||||
| @@ -120,13 +120,13 @@ typedef struct _CarlaPluginInfo { | |||||
| const char* copyright; | const char* copyright; | ||||
| /*! | /*! | ||||
| * Icon name for this plugin, in lowercase.\n | |||||
| * Icon name for this plugin, in lowercase. | |||||
| * Default is "plugin". | * Default is "plugin". | ||||
| */ | */ | ||||
| const char* iconName; | const char* iconName; | ||||
| /*! | /*! | ||||
| * Plugin unique Id.\n | |||||
| * Plugin unique Id. | |||||
| * This Id is dependant on the plugin type and may sometimes be 0. | * This Id is dependant on the plugin type and may sometimes be 0. | ||||
| */ | */ | ||||
| int64_t uniqueId; | int64_t uniqueId; | ||||
| @@ -348,13 +348,13 @@ typedef struct _CarlaTransportInfo { | |||||
| * Carla Host API (C functions) */ | * Carla Host API (C functions) */ | ||||
| /*! | /*! | ||||
| * Get the complete license text of used third-party code and features.\n | |||||
| * Get the complete license text of used third-party code and features. | |||||
| * Returned string is in basic html format. | * Returned string is in basic html format. | ||||
| */ | */ | ||||
| CARLA_EXPORT const char* carla_get_complete_license_text(); | CARLA_EXPORT const char* carla_get_complete_license_text(); | ||||
| /*! | /*! | ||||
| * Get all the supported file extensions in carla_load_file().\n | |||||
| * Get all the supported file extensions in carla_load_file(). | |||||
| * Returned string uses this syntax: | * Returned string uses this syntax: | ||||
| * @code | * @code | ||||
| * "*.ext1;*.ext2;*.ext3" | * "*.ext1;*.ext2;*.ext3" | ||||
| @@ -408,7 +408,7 @@ CARLA_EXPORT const CarlaEngine* carla_get_engine(); | |||||
| #endif | #endif | ||||
| /*! | /*! | ||||
| * Initialize the engine.\n | |||||
| * Initialize the engine. | |||||
| * Make sure to call carla_engine_idle() at regular intervals afterwards. | * Make sure to call carla_engine_idle() at regular intervals afterwards. | ||||
| * @param driverName Driver to use | * @param driverName Driver to use | ||||
| * @param clientName Engine master client name | * @param clientName Engine master client name | ||||
| @@ -418,23 +418,19 @@ CARLA_EXPORT bool carla_engine_init(const char* driverName, const char* clientNa | |||||
| #ifdef BUILD_BRIDGE | #ifdef BUILD_BRIDGE | ||||
| /*! | /*! | ||||
| * Initialize the engine in bridged mode. | * Initialize the engine in bridged mode. | ||||
| * @param audioBaseName Shared memory key for audio pool | |||||
| * @param controlBaseName Shared memory key for control messages | |||||
| * @param timeBaseName Shared memory key for time info | |||||
| * @param clientName Engine master client name | |||||
| */ | */ | ||||
| CARLA_EXPORT bool carla_engine_init_bridge(const char audioBaseName[6+1], const char rtBaseName[6+1], const char nonRtBaseName[6+1], const char* clientName); | CARLA_EXPORT bool carla_engine_init_bridge(const char audioBaseName[6+1], const char rtBaseName[6+1], const char nonRtBaseName[6+1], const char* clientName); | ||||
| #endif | #endif | ||||
| /*! | /*! | ||||
| * Close the engine.\n | |||||
| * This function always closes the engine even if it returns false.\n | |||||
| * Close the engine. | |||||
| * This function always closes the engine even if it returns false. | |||||
| * In other words, even when something goes wrong when closing the engine it still be closed nonetheless. | * In other words, even when something goes wrong when closing the engine it still be closed nonetheless. | ||||
| */ | */ | ||||
| CARLA_EXPORT bool carla_engine_close(); | CARLA_EXPORT bool carla_engine_close(); | ||||
| /*! | /*! | ||||
| * Idle the engine.\n | |||||
| * Idle the engine. | |||||
| * Do not call this if the engine is not running. | * Do not call this if the engine is not running. | ||||
| */ | */ | ||||
| CARLA_EXPORT void carla_engine_idle(); | CARLA_EXPORT void carla_engine_idle(); | ||||
| @@ -445,7 +441,7 @@ CARLA_EXPORT void carla_engine_idle(); | |||||
| CARLA_EXPORT bool carla_is_engine_running(); | CARLA_EXPORT bool carla_is_engine_running(); | ||||
| /*! | /*! | ||||
| * Tell the engine it's about to close.\n | |||||
| * Tell the engine it's about to close. | |||||
| * This is used to prevent the engine thread(s) from reactivating. | * This is used to prevent the engine thread(s) from reactivating. | ||||
| */ | */ | ||||
| CARLA_EXPORT void carla_set_engine_about_to_close(); | CARLA_EXPORT void carla_set_engine_about_to_close(); | ||||
| @@ -475,24 +471,21 @@ CARLA_EXPORT void carla_set_engine_option(EngineOption option, int value, const | |||||
| CARLA_EXPORT void carla_set_file_callback(FileCallbackFunc func, void* ptr); | CARLA_EXPORT void carla_set_file_callback(FileCallbackFunc func, void* ptr); | ||||
| /*! | /*! | ||||
| * Load a file of any type.\n | |||||
| * Load a file of any type. | |||||
| * This will try to load a generic file as a plugin, | * This will try to load a generic file as a plugin, | ||||
| * either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI). | * either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI). | ||||
| * @param Filename Filename | |||||
| * @see carla_get_supported_file_extensions() | * @see carla_get_supported_file_extensions() | ||||
| */ | */ | ||||
| CARLA_EXPORT bool carla_load_file(const char* filename); | CARLA_EXPORT bool carla_load_file(const char* filename); | ||||
| /*! | /*! | ||||
| * Load a Carla project file. | * Load a Carla project file. | ||||
| * @param Filename Filename | |||||
| * @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed. | * @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed. | ||||
| */ | */ | ||||
| CARLA_EXPORT bool carla_load_project(const char* filename); | CARLA_EXPORT bool carla_load_project(const char* filename); | ||||
| /*! | /*! | ||||
| * Save current project to a file. | * Save current project to a file. | ||||
| * @param Filename Filename | |||||
| */ | */ | ||||
| CARLA_EXPORT bool carla_save_project(const char* filename); | CARLA_EXPORT bool carla_save_project(const char* filename); | ||||
| @@ -531,7 +524,6 @@ CARLA_EXPORT void carla_transport_pause(); | |||||
| /*! | /*! | ||||
| * Relocate the engine transport to a specific frame. | * Relocate the engine transport to a specific frame. | ||||
| * @param frames Frame to relocate to. | |||||
| */ | */ | ||||
| CARLA_EXPORT void carla_transport_relocate(uint64_t frame); | CARLA_EXPORT void carla_transport_relocate(uint64_t frame); | ||||
| @@ -547,7 +539,7 @@ CARLA_EXPORT const CarlaTransportInfo* carla_get_transport_info(); | |||||
| #endif | #endif | ||||
| /*! | /*! | ||||
| * Add a new plugin.\n | |||||
| * Add a new plugin. | |||||
| * If you don't know the binary type use the BINARY_NATIVE macro. | * If you don't know the binary type use the BINARY_NATIVE macro. | ||||
| * @param btype Binary type | * @param btype Binary type | ||||
| * @param ptype Plugin type | * @param ptype Plugin type | ||||
| @@ -572,7 +564,7 @@ CARLA_EXPORT bool carla_remove_all_plugins(); | |||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| /*! | /*! | ||||
| * Rename a plugin.\n | |||||
| * Rename a plugin. | |||||
| * Returns the new name, or NULL if the operation failed. | * Returns the new name, or NULL if the operation failed. | ||||
| * @param pluginId Plugin to rename | * @param pluginId Plugin to rename | ||||
| * @param newName New plugin name | * @param newName New plugin name | ||||
| @@ -586,7 +578,7 @@ CARLA_EXPORT const char* carla_rename_plugin(uint pluginId, const char* newName) | |||||
| CARLA_EXPORT bool carla_clone_plugin(uint pluginId); | CARLA_EXPORT bool carla_clone_plugin(uint pluginId); | ||||
| /*! | /*! | ||||
| * Prepare replace of a plugin.\n | |||||
| * Prepare replace of a plugin. | |||||
| * The next call to carla_add_plugin() will use this id, replacing the current plugin. | * The next call to carla_add_plugin() will use this id, replacing the current plugin. | ||||
| * @param pluginId Plugin to replace | * @param pluginId Plugin to replace | ||||
| * @note This function requires carla_add_plugin() to be called afterwards *as soon as possible*. | * @note This function requires carla_add_plugin() to be called afterwards *as soon as possible*. | ||||
| @@ -749,7 +741,7 @@ CARLA_EXPORT const char* carla_get_program_name(uint pluginId, uint32_t programI | |||||
| CARLA_EXPORT const char* carla_get_midi_program_name(uint pluginId, uint32_t midiProgramId); | CARLA_EXPORT const char* carla_get_midi_program_name(uint pluginId, uint32_t midiProgramId); | ||||
| /*! | /*! | ||||
| * Get a plugin's real name.\n | |||||
| * Get a plugin's real name. | |||||
| * This is the name the plugin uses to identify itself; may not be unique. | * This is the name the plugin uses to identify itself; may not be unique. | ||||
| * @param pluginId Plugin | * @param pluginId Plugin | ||||
| */ | */ | ||||
| @@ -914,14 +906,14 @@ CARLA_EXPORT void carla_set_custom_data(uint pluginId, const char* type, const c | |||||
| /*! | /*! | ||||
| * Set a plugin's chunk data. | * Set a plugin's chunk data. | ||||
| * @param pluginId Plugin | |||||
| * @param value New value | |||||
| * @param pluginId Plugin | |||||
| * @param chunkData New chunk data | |||||
| * @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data() | * @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data() | ||||
| */ | */ | ||||
| CARLA_EXPORT void carla_set_chunk_data(uint pluginId, const char* chunkData); | CARLA_EXPORT void carla_set_chunk_data(uint pluginId, const char* chunkData); | ||||
| /*! | /*! | ||||
| * Tell a plugin to prepare for save.\n | |||||
| * Tell a plugin to prepare for save. | |||||
| * This should be called before saving custom data sets. | * This should be called before saving custom data sets. | ||||
| * @param pluginId Plugin | * @param pluginId Plugin | ||||
| */ | */ | ||||
| @@ -941,7 +933,7 @@ CARLA_EXPORT void carla_randomize_parameters(uint pluginId); | |||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| /*! | /*! | ||||
| * Send a single note of a plugin.\n | |||||
| * Send a single note of a plugin. | |||||
| * If velocity is 0, note-off is sent; note-on otherwise. | * If velocity is 0, note-off is sent; note-on otherwise. | ||||
| * @param pluginId Plugin | * @param pluginId Plugin | ||||
| * @param channel Note channel | * @param channel Note channel | ||||
| @@ -57,11 +57,11 @@ struct StateSave; | |||||
| /*! | /*! | ||||
| * Carla Backend base plugin class | * Carla Backend base plugin class | ||||
| * | * | ||||
| * This is the base class for all available plugin types available in Carla Backend.\n | |||||
| * All virtual calls are implemented in this class as fallback (except reload and process),\n | |||||
| * This is the base class for all available plugin types available in Carla Backend. | |||||
| * All virtual calls are implemented in this class as fallback (except reload and process), | |||||
| * so it's safe to only override needed calls. | * so it's safe to only override needed calls. | ||||
| * | * | ||||
| * \see PluginType | |||||
| * @see PluginType | |||||
| */ | */ | ||||
| class CarlaPlugin | class CarlaPlugin | ||||
| { | { | ||||
| @@ -69,8 +69,8 @@ protected: | |||||
| /*! | /*! | ||||
| * This is the constructor of the base plugin class. | * This is the constructor of the base plugin class. | ||||
| * | * | ||||
| * \param engine The engine which this plugin belongs to, must not be null | |||||
| * \param id The 'id' of this plugin, must be between 0 and CarlaEngine::maxPluginNumber() | |||||
| * @param engine The engine which this plugin belongs to, must not be null | |||||
| * @param id The 'id' of this plugin, must be between 0 and CarlaEngine::maxPluginNumber() | |||||
| */ | */ | ||||
| CarlaPlugin(CarlaEngine* const engine, const uint id); | CarlaPlugin(CarlaEngine* const engine, const uint id); | ||||
| @@ -86,54 +86,54 @@ public: | |||||
| /*! | /*! | ||||
| * Get the plugin's type (a subclass of CarlaPlugin). | * Get the plugin's type (a subclass of CarlaPlugin). | ||||
| * | * | ||||
| * \note Plugin bridges will return their respective plugin type, there is no plugin type such as "bridge".\n | |||||
| * @note Plugin bridges will return their respective plugin type, there is no plugin type such as "bridge". | |||||
| * To check if a plugin is a bridge use: | * To check if a plugin is a bridge use: | ||||
| * \code | |||||
| * @code | |||||
| * if (getHints() & PLUGIN_IS_BRIDGE) | * if (getHints() & PLUGIN_IS_BRIDGE) | ||||
| * ... | * ... | ||||
| * \endcode | |||||
| * @endcode | |||||
| */ | */ | ||||
| virtual PluginType getType() const noexcept = 0; | virtual PluginType getType() const noexcept = 0; | ||||
| /*! | /*! | ||||
| * Get the plugin's id (as passed in the constructor). | * Get the plugin's id (as passed in the constructor). | ||||
| * | * | ||||
| * \see setId() | |||||
| * @see setId() | |||||
| */ | */ | ||||
| uint getId() const noexcept; | uint getId() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the plugin's hints. | * Get the plugin's hints. | ||||
| * | * | ||||
| * \see PluginHints | |||||
| * @see PluginHints | |||||
| */ | */ | ||||
| uint getHints() const noexcept; | uint getHints() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the plugin's options (currently in use). | * Get the plugin's options (currently in use). | ||||
| * | * | ||||
| * \see PluginOptions, getAvailableOptions() and setOption() | |||||
| * @see PluginOptions, getAvailableOptions() and setOption() | |||||
| */ | */ | ||||
| uint getOptionsEnabled() const noexcept; | uint getOptionsEnabled() const noexcept; | ||||
| /*! | /*! | ||||
| * Check if the plugin is enabled.\n | |||||
| * Check if the plugin is enabled. | |||||
| * When a plugin is disabled, it will never be processed or managed in any way. | * When a plugin is disabled, it will never be processed or managed in any way. | ||||
| * | * | ||||
| * \see setEnabled() | |||||
| * @see setEnabled() | |||||
| */ | */ | ||||
| bool isEnabled() const noexcept; | bool isEnabled() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the plugin's internal name.\n | |||||
| * Get the plugin's internal name. | |||||
| * This name is unique within all plugins in an engine. | * This name is unique within all plugins in an engine. | ||||
| * | * | ||||
| * \see getRealName() and setName() | |||||
| * @see getRealName() and setName() | |||||
| */ | */ | ||||
| const char* getName() const noexcept; | const char* getName() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the currently loaded DLL filename for this plugin.\n | |||||
| * Get the currently loaded DLL filename for this plugin. | |||||
| * (Sound kits return their exact filename). | * (Sound kits return their exact filename). | ||||
| */ | */ | ||||
| const char* getFilename() const noexcept; | const char* getFilename() const noexcept; | ||||
| @@ -149,7 +149,7 @@ public: | |||||
| virtual PluginCategory getCategory() const noexcept; | virtual PluginCategory getCategory() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the plugin's native unique Id.\n | |||||
| * Get the plugin's native unique Id. | |||||
| * May return 0 on plugin types that don't support Ids. | * May return 0 on plugin types that don't support Ids. | ||||
| */ | */ | ||||
| virtual int64_t getUniqueId() const noexcept; | virtual int64_t getUniqueId() const noexcept; | ||||
| @@ -183,13 +183,13 @@ public: | |||||
| virtual uint32_t getMidiOutCount() const noexcept; | virtual uint32_t getMidiOutCount() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the number of parameters.\n | |||||
| * Get the number of parameters. | |||||
| * To know the number of parameter inputs and outputs separately use getParameterCountInfo() instead. | * To know the number of parameter inputs and outputs separately use getParameterCountInfo() instead. | ||||
| */ | */ | ||||
| uint32_t getParameterCount() const noexcept; | uint32_t getParameterCount() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the number of scalepoints for parameter \a parameterId. | |||||
| * Get the number of scalepoints for parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual uint32_t getParameterScalePointCount(const uint32_t parameterId) const noexcept; | virtual uint32_t getParameterScalePointCount(const uint32_t parameterId) const noexcept; | ||||
| @@ -214,54 +214,54 @@ public: | |||||
| /*! | /*! | ||||
| * Get the current program number (-1 if unset). | * Get the current program number (-1 if unset). | ||||
| * | * | ||||
| * \see setProgram() | |||||
| * @see setProgram() | |||||
| */ | */ | ||||
| int32_t getCurrentProgram() const noexcept; | int32_t getCurrentProgram() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the current MIDI program number (-1 if unset). | * Get the current MIDI program number (-1 if unset). | ||||
| * | * | ||||
| * \see setMidiProgram() | |||||
| * \see setMidiProgramById() | |||||
| * @see setMidiProgram() | |||||
| * @see setMidiProgramById() | |||||
| */ | */ | ||||
| int32_t getCurrentMidiProgram() const noexcept; | int32_t getCurrentMidiProgram() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the parameter data of \a parameterId. | |||||
| * Get the parameter data of @a parameterId. | |||||
| */ | */ | ||||
| const ParameterData& getParameterData(const uint32_t parameterId) const noexcept; | const ParameterData& getParameterData(const uint32_t parameterId) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the parameter ranges of \a parameterId. | |||||
| * Get the parameter ranges of @a parameterId. | |||||
| */ | */ | ||||
| const ParameterRanges& getParameterRanges(const uint32_t parameterId) const noexcept; | const ParameterRanges& getParameterRanges(const uint32_t parameterId) const noexcept; | ||||
| /*! | /*! | ||||
| * Check if parameter \a parameterId is of output type. | |||||
| * Check if parameter @a parameterId is of output type. | |||||
| */ | */ | ||||
| bool isParameterOutput(const uint32_t parameterId) const noexcept; | bool isParameterOutput(const uint32_t parameterId) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the MIDI program at \a index. | |||||
| * Get the MIDI program at @a index. | |||||
| * | * | ||||
| * \see getMidiProgramName() | |||||
| * @see getMidiProgramName() | |||||
| */ | */ | ||||
| const MidiProgramData& getMidiProgramData(const uint32_t index) const noexcept; | const MidiProgramData& getMidiProgramData(const uint32_t index) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the custom data set at \a index. | |||||
| * Get the custom data set at @a index. | |||||
| * | * | ||||
| * \see getCustomDataCount() and setCustomData() | |||||
| * @see getCustomDataCount() and setCustomData() | |||||
| */ | */ | ||||
| const CustomData& getCustomData(const uint32_t index) const noexcept; | const CustomData& getCustomData(const uint32_t index) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the complete plugin chunk data into \a dataPtr. | |||||
| * Get the complete plugin chunk data into @a dataPtr. | |||||
| * | * | ||||
| * \note Make sure to verify the plugin supports chunks before calling this function! | |||||
| * @note Make sure to verify the plugin supports chunks before calling this function! | |||||
| * \return The size of the chunk or 0 if invalid. | * \return The size of the chunk or 0 if invalid. | ||||
| * | * | ||||
| * \see setChunkData() | |||||
| * @see setChunkData() | |||||
| */ | */ | ||||
| virtual std::size_t getChunkData(void** const dataPtr) noexcept; | virtual std::size_t getChunkData(void** const dataPtr) noexcept; | ||||
| @@ -271,17 +271,17 @@ public: | |||||
| /*! | /*! | ||||
| * Get the plugin available options. | * Get the plugin available options. | ||||
| * | * | ||||
| * \see PluginOptions, getOptions() and setOption() | |||||
| * @see PluginOptions, getOptions() and setOption() | |||||
| */ | */ | ||||
| virtual uint getOptionsAvailable() const noexcept; | virtual uint getOptionsAvailable() const noexcept; | ||||
| /*! | /*! | ||||
| * Get the current parameter value of \a parameterId. | |||||
| * Get the current parameter value of @a parameterId. | |||||
| */ | */ | ||||
| virtual float getParameterValue(const uint32_t parameterId) const noexcept; | virtual float getParameterValue(const uint32_t parameterId) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the scalepoint \a scalePointId value of the parameter \a parameterId. | |||||
| * Get the scalepoint @a scalePointId value of the parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual float getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) const noexcept; | virtual float getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) const noexcept; | ||||
| @@ -303,61 +303,61 @@ public: | |||||
| /*! | /*! | ||||
| * Get the plugin's (real) name. | * Get the plugin's (real) name. | ||||
| * | * | ||||
| * \see getName() and setName() | |||||
| * @see getName() and setName() | |||||
| */ | */ | ||||
| virtual void getRealName(char* const strBuf) const noexcept; | virtual void getRealName(char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the name of the parameter \a parameterId. | |||||
| * Get the name of the parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual void getParameterName(const uint32_t parameterId, char* const strBuf) const noexcept; | virtual void getParameterName(const uint32_t parameterId, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the symbol of the parameter \a parameterId. | |||||
| * Get the symbol of the parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual void getParameterSymbol(const uint32_t parameterId, char* const strBuf) const noexcept; | virtual void getParameterSymbol(const uint32_t parameterId, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the custom text of the parameter \a parameterId. | |||||
| * Get the custom text of the parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual void getParameterText(const uint32_t parameterId, char* const strBuf) const noexcept; | virtual void getParameterText(const uint32_t parameterId, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the unit of the parameter \a parameterId. | |||||
| * Get the unit of the parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual void getParameterUnit(const uint32_t parameterId, char* const strBuf) const noexcept; | virtual void getParameterUnit(const uint32_t parameterId, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the scalepoint \a scalePointId label of the parameter \a parameterId. | |||||
| * Get the scalepoint @a scalePointId label of the parameter @a parameterId. | |||||
| */ | */ | ||||
| virtual void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) const noexcept; | virtual void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the current parameter value of \a parameterId. | |||||
| * \a parameterId can be negative to allow internal parameters. | |||||
| * \see InternalParametersIndex | |||||
| * Get the current parameter value of @a parameterId. | |||||
| * @a parameterId can be negative to allow internal parameters. | |||||
| * @see InternalParametersIndex | |||||
| */ | */ | ||||
| float getInternalParameterValue(const int32_t parameterId) const noexcept; | float getInternalParameterValue(const int32_t parameterId) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the name of the program at \a index. | |||||
| * Get the name of the program at @a index. | |||||
| */ | */ | ||||
| void getProgramName(const uint32_t index, char* const strBuf) const noexcept; | void getProgramName(const uint32_t index, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get the name of the MIDI program at \a index. | |||||
| * Get the name of the MIDI program at @a index. | |||||
| * | * | ||||
| * \see getMidiProgramInfo() | |||||
| * @see getMidiProgramInfo() | |||||
| */ | */ | ||||
| void getMidiProgramName(const uint32_t index, char* const strBuf) const noexcept; | void getMidiProgramName(const uint32_t index, char* const strBuf) const noexcept; | ||||
| /*! | /*! | ||||
| * Get information about the plugin's parameter count.\n | |||||
| * This is used to check how many input, output and total parameters are available.\n | |||||
| * Get information about the plugin's parameter count. | |||||
| * This is used to check how many input, output and total parameters are available. | |||||
| * | * | ||||
| * \note Some parameters might not be input or output (ie, invalid). | |||||
| * @note Some parameters might not be input or output (ie, invalid). | |||||
| * | * | ||||
| * \see getParameterCount() | |||||
| * @see getParameterCount() | |||||
| */ | */ | ||||
| void getParameterCountInfo(uint32_t& ins, uint32_t& outs) const noexcept; | void getParameterCountInfo(uint32_t& ins, uint32_t& outs) const noexcept; | ||||
| @@ -380,31 +380,31 @@ public: | |||||
| virtual void randomizeParameters() noexcept; | virtual void randomizeParameters() noexcept; | ||||
| /*! | /*! | ||||
| * Get the plugin's save state.\n | |||||
| * Get the plugin's save state. | |||||
| * The plugin will automatically call prepareForSave() as needed. | * The plugin will automatically call prepareForSave() as needed. | ||||
| * | * | ||||
| * \see loadStateSave() | |||||
| * @see loadStateSave() | |||||
| */ | */ | ||||
| const StateSave& getStateSave(); | const StateSave& getStateSave(); | ||||
| /*! | /*! | ||||
| * Get the plugin's save state. | * Get the plugin's save state. | ||||
| * | * | ||||
| * \see getStateSave() | |||||
| * @see getStateSave() | |||||
| */ | */ | ||||
| void loadStateSave(const StateSave& stateSave); | void loadStateSave(const StateSave& stateSave); | ||||
| /*! | /*! | ||||
| * Save the current plugin state to \a filename. | |||||
| * Save the current plugin state to @a filename. | |||||
| * | * | ||||
| * \see loadStateFromFile() | |||||
| * @see loadStateFromFile() | |||||
| */ | */ | ||||
| bool saveStateToFile(const char* const filename); | bool saveStateToFile(const char* const filename); | ||||
| /*! | /*! | ||||
| * Save the plugin state from \a filename. | |||||
| * Save the plugin state from @a filename. | |||||
| * | * | ||||
| * \see saveStateToFile() | |||||
| * @see saveStateToFile() | |||||
| */ | */ | ||||
| bool loadStateFromFile(const char* const filename); | bool loadStateFromFile(const char* const filename); | ||||
| @@ -412,91 +412,91 @@ public: | |||||
| // Set data (internal stuff) | // Set data (internal stuff) | ||||
| /*! | /*! | ||||
| * Set the plugin's id to \a newId. | |||||
| * Set the plugin's id to @a newId. | |||||
| * | * | ||||
| * \see getId() | |||||
| * @see getId() | |||||
| */ | */ | ||||
| void setId(const uint newId) noexcept; | void setId(const uint newId) noexcept; | ||||
| /*! | /*! | ||||
| * Set the plugin's name to \a newName. | |||||
| * Set the plugin's name to @a newName. | |||||
| * | * | ||||
| * \see getName() and getRealName() | |||||
| * @see getName() and getRealName() | |||||
| */ | */ | ||||
| virtual void setName(const char* const newName); | virtual void setName(const char* const newName); | ||||
| /*! | /*! | ||||
| * Set a plugin's option. | * Set a plugin's option. | ||||
| * | * | ||||
| * \see getOptions() and getAvailableOptions() | |||||
| * @see getOptions() and getAvailableOptions() | |||||
| */ | */ | ||||
| virtual void setOption(const uint option, const bool yesNo, const bool sendCallback); | virtual void setOption(const uint option, const bool yesNo, const bool sendCallback); | ||||
| /*! | /*! | ||||
| * Enable or disable the plugin according to \a yesNo. \n | |||||
| * Enable or disable the plugin according to @a yesNo. | |||||
| * When a plugin is disabled, it will never be processed or managed in any way. | * When a plugin is disabled, it will never be processed or managed in any way. | ||||
| * | * | ||||
| * \see isEnabled() | |||||
| * @see isEnabled() | |||||
| */ | */ | ||||
| void setEnabled(const bool yesNo) noexcept; | void setEnabled(const bool yesNo) noexcept; | ||||
| /*! | /*! | ||||
| * Set plugin as active according to \a active. | |||||
| * Set plugin as active according to @a active. | |||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| */ | */ | ||||
| void setActive(const bool active, const bool sendOsc, const bool sendCallback) noexcept; | void setActive(const bool active, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| /*! | /*! | ||||
| * Set the plugin's dry/wet signal value to \a value.\n | |||||
| * \a value must be between 0.0 and 1.0. | |||||
| * Set the plugin's dry/wet signal value to @a value. | |||||
| * @a value must be between 0.0 and 1.0. | |||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| */ | */ | ||||
| void setDryWet(const float value, const bool sendOsc, const bool sendCallback) noexcept; | void setDryWet(const float value, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set the plugin's output volume to \a value.\n | |||||
| * \a value must be between 0.0 and 1.27. | |||||
| * Set the plugin's output volume to @a value. | |||||
| * @a value must be between 0.0 and 1.27. | |||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| */ | */ | ||||
| void setVolume(const float value, const bool sendOsc, const bool sendCallback) noexcept; | void setVolume(const float value, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set the plugin's output left balance value to \a value.\n | |||||
| * \a value must be between -1.0 and 1.0. | |||||
| * Set the plugin's output left balance value to @a value. | |||||
| * @a value must be between -1.0 and 1.0. | |||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| * | * | ||||
| * \note Pure-Stereo plugins only! | |||||
| * @note Pure-Stereo plugins only! | |||||
| */ | */ | ||||
| void setBalanceLeft(const float value, const bool sendOsc, const bool sendCallback) noexcept; | void setBalanceLeft(const float value, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set the plugin's output right balance value to \a value.\n | |||||
| * \a value must be between -1.0 and 1.0. | |||||
| * Set the plugin's output right balance value to @a value. | |||||
| * @a value must be between -1.0 and 1.0. | |||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| * | * | ||||
| * \note Pure-Stereo plugins only! | |||||
| * @note Pure-Stereo plugins only! | |||||
| */ | */ | ||||
| void setBalanceRight(const float value, const bool sendOsc, const bool sendCallback) noexcept; | void setBalanceRight(const float value, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set the plugin's output panning value to \a value.\n | |||||
| * \a value must be between -1.0 and 1.0. | |||||
| * Set the plugin's output panning value to @a value. | |||||
| * @a value must be between -1.0 and 1.0. | |||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| * | * | ||||
| * \note Force-Stereo plugins only! | |||||
| * @note Force-Stereo plugins only! | |||||
| */ | */ | ||||
| void setPanning(const float value, const bool sendOsc, const bool sendCallback) noexcept; | void setPanning(const float value, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| #endif | #endif | ||||
| @@ -504,8 +504,8 @@ public: | |||||
| /*! | /*! | ||||
| * Set the plugin's midi control channel. | * Set the plugin's midi control channel. | ||||
| * | * | ||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| */ | */ | ||||
| virtual void setCtrlChannel(const int8_t channel, const bool sendOsc, const bool sendCallback) noexcept; | virtual void setCtrlChannel(const int8_t channel, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| @@ -515,94 +515,92 @@ public: | |||||
| /*! | /*! | ||||
| * Set a plugin's parameter value. | * Set a plugin's parameter value. | ||||
| * | * | ||||
| * \param parameterId The parameter to change | |||||
| * \param value The new parameter value, must be within the parameter's range | |||||
| * \param sendGui Send message change to plugin's custom GUI, if any | |||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * @param parameterId The parameter to change | |||||
| * @param value The new parameter value, must be within the parameter's range | |||||
| * @param sendGui Send message change to plugin's custom GUI, if any | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| * | * | ||||
| * \see getParameterValue() | |||||
| * @see getParameterValue() | |||||
| */ | */ | ||||
| virtual void setParameterValue(const uint32_t parameterId, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | virtual void setParameterValue(const uint32_t parameterId, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set a plugin's parameter value, including internal parameters.\n | |||||
| * \a rindex can be negative to allow internal parameters change (as defined in InternalParametersIndex). | |||||
| * Set a plugin's parameter value, including internal parameters. | |||||
| * @a rindex can be negative to allow internal parameters change (as defined in InternalParametersIndex). | |||||
| * | * | ||||
| * \see setParameterValue() | |||||
| * \see setActive() | |||||
| * \see setDryWet() | |||||
| * \see setVolume() | |||||
| * \see setBalanceLeft() | |||||
| * \see setBalanceRight() | |||||
| * @see setParameterValue() | |||||
| * @see setActive() | |||||
| * @see setDryWet() | |||||
| * @see setVolume() | |||||
| * @see setBalanceLeft() | |||||
| * @see setBalanceRight() | |||||
| */ | */ | ||||
| void setParameterValueByRealIndex(const int32_t rindex, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | void setParameterValueByRealIndex(const int32_t rindex, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set parameter's \a parameterId MIDI channel to \a channel.\n | |||||
| * \a channel must be between 0 and 15. | |||||
| * Set parameter's @a parameterId MIDI channel to @a channel. | |||||
| * @a channel must be between 0 and 15. | |||||
| */ | */ | ||||
| virtual void setParameterMidiChannel(const uint32_t parameterId, const uint8_t channel, const bool sendOsc, const bool sendCallback) noexcept; | virtual void setParameterMidiChannel(const uint32_t parameterId, const uint8_t channel, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Set parameter's \a parameterId MIDI CC to \a cc.\n | |||||
| * \a cc must be between 0 and 95 (0x5F), or -1 for invalid. | |||||
| * Set parameter's @a parameterId MIDI CC to @a cc. | |||||
| * @a cc must be between 0 and 95 (0x5F), or -1 for invalid. | |||||
| */ | */ | ||||
| virtual void setParameterMidiCC(const uint32_t parameterId, const int16_t cc, const bool sendOsc, const bool sendCallback) noexcept; | virtual void setParameterMidiCC(const uint32_t parameterId, const int16_t cc, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Add a custom data set.\n | |||||
| * If \a key already exists, its current value will be swapped with \a value. | |||||
| * Add a custom data set. | |||||
| * If @a key already exists, its current value will be swapped with @a value. | |||||
| * | * | ||||
| * \param type Type of data used in \a value. | |||||
| * \param key A key identifing this data set. | |||||
| * \param value The value of the data set, of type \a type. | |||||
| * \param sendGui Send message change to plugin's custom GUI, if any | |||||
| * @param type Type of data used in @a value. | |||||
| * @param key A key identifing this data set. | |||||
| * @param value The value of the data set, of type @a type. | |||||
| * @param sendGui Send message change to plugin's custom GUI, if any | |||||
| * | * | ||||
| * \see getCustomDataCount() and getCustomData() | |||||
| * @see getCustomDataCount() and getCustomData() | |||||
| */ | */ | ||||
| virtual void setCustomData(const char* const type, const char* const key, const char* const value, const bool sendGui); | virtual void setCustomData(const char* const type, const char* const key, const char* const value, const bool sendGui); | ||||
| /*! | /*! | ||||
| * Set the complete chunk data as \a data.\n | |||||
| * Set the complete chunk data as @a data. | |||||
| * | * | ||||
| * \see getChunkData() | |||||
| * @see getChunkData() | |||||
| * | * | ||||
| * \note Make sure to verify the plugin supports chunks before calling this function | |||||
| * @note Make sure to verify the plugin supports chunks before calling this function | |||||
| */ | */ | ||||
| virtual void setChunkData(const void* const data, const std::size_t dataSize); | virtual void setChunkData(const void* const data, const std::size_t dataSize); | ||||
| /*! | /*! | ||||
| * Change the current plugin program to \a index. | |||||
| * Change the current plugin program to @a index. | |||||
| * | * | ||||
| * If \a index is negative the plugin's program will be considered unset.\n | |||||
| * If @a index is negative the plugin's program will be considered unset. | |||||
| * The plugin's default parameter values will be updated when this function is called. | * The plugin's default parameter values will be updated when this function is called. | ||||
| * | * | ||||
| * \param index New program index to use | |||||
| * \param sendGui Send message change to plugin's custom GUI, if any | |||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * \param block Block the audio callback | |||||
| * @param index New program index to use | |||||
| * @param sendGui Send message change to plugin's custom GUI, if any | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| */ | */ | ||||
| virtual void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | virtual void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * Change the current MIDI plugin program to \a index. | |||||
| * Change the current MIDI plugin program to @a index. | |||||
| * | * | ||||
| * If \a index is negative the plugin's program will be considered unset.\n | |||||
| * If @a index is negative the plugin's program will be considered unset. | |||||
| * The plugin's default parameter values will be updated when this function is called. | * The plugin's default parameter values will be updated when this function is called. | ||||
| * | * | ||||
| * \param index New program index to use | |||||
| * \param sendGui Send message change to plugin's custom GUI, if any | |||||
| * \param sendOsc Send message change over OSC | |||||
| * \param sendCallback Send message change to registered callback | |||||
| * \param block Block the audio callback | |||||
| * @param index New program index to use | |||||
| * @param sendGui Send message change to plugin's custom GUI, if any | |||||
| * @param sendOsc Send message change over OSC | |||||
| * @param sendCallback Send message change to registered callback | |||||
| */ | */ | ||||
| virtual void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | virtual void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| /*! | /*! | ||||
| * This is an overloaded call to setMidiProgram().\n | |||||
| * It changes the current MIDI program using \a bank and \a program values instead of index. | |||||
| * This is an overloaded call to setMidiProgram(). | |||||
| * It changes the current MIDI program using @a bank and @a program values instead of index. | |||||
| */ | */ | ||||
| void setMidiProgramById(const uint32_t bank, const uint32_t program, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | void setMidiProgramById(const uint32_t bank, const uint32_t program, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept; | ||||
| @@ -612,14 +610,14 @@ public: | |||||
| /*! | /*! | ||||
| * Idle function. | * Idle function. | ||||
| * | * | ||||
| * \note This function must be always called from the main thread. | |||||
| * @note This function must be always called from the main thread. | |||||
| */ | */ | ||||
| virtual void idle(); | virtual void idle(); | ||||
| /*! | /*! | ||||
| * Show (or hide) the plugin's custom UI according to \a yesNo. | |||||
| * Show (or hide) the plugin's custom UI according to @a yesNo. | |||||
| * | * | ||||
| * \note This function must be always called from the main thread. | |||||
| * @note This function must be always called from the main thread. | |||||
| */ | */ | ||||
| virtual void showCustomUI(const bool yesNo); | virtual void showCustomUI(const bool yesNo); | ||||
| @@ -627,7 +625,7 @@ public: | |||||
| // Plugin state | // Plugin state | ||||
| /*! | /*! | ||||
| * Reload the plugin's entire state (including programs).\n | |||||
| * Reload the plugin's entire state (including programs). | |||||
| * The plugin will be disabled during this call. | * The plugin will be disabled during this call. | ||||
| */ | */ | ||||
| virtual void reload() = 0; | virtual void reload() = 0; | ||||
| @@ -710,13 +708,13 @@ public: | |||||
| void registerToOscClient() noexcept; | void registerToOscClient() noexcept; | ||||
| /*! | /*! | ||||
| * Update the plugin's internal OSC data according to \a source and \a url.\n | |||||
| * Update the plugin's internal OSC data according to @a source and @a url. | |||||
| * This is used for OSC-GUI bridges. | * This is used for OSC-GUI bridges. | ||||
| */ | */ | ||||
| void updateOscData(const lo_address& source, const char* const url); | void updateOscData(const lo_address& source, const char* const url); | ||||
| /*! | /*! | ||||
| * Update the plugin's extra OSC data, called from the start of updateOscData().\n | |||||
| * Update the plugin's extra OSC data, called from the start of updateOscData(). | |||||
| * The default implementation does nothing. | * The default implementation does nothing. | ||||
| */ | */ | ||||
| virtual bool updateOscDataExtra(); | virtual bool updateOscDataExtra(); | ||||
| @@ -728,7 +726,7 @@ public: | |||||
| virtual void updateOscURL(); | virtual void updateOscURL(); | ||||
| /*! | /*! | ||||
| * Show the plugin's OSC based GUI.\n | |||||
| * Show the plugin's OSC based GUI. | |||||
| * This is a handy function that waits for the GUI to respond and automatically asks it to show itself. | * This is a handy function that waits for the GUI to respond and automatically asks it to show itself. | ||||
| */ | */ | ||||
| bool waitForOscGuiShow(); | bool waitForOscGuiShow(); | ||||
| @@ -738,16 +736,16 @@ public: | |||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| /*! | /*! | ||||
| * Send a single midi note to be processed in the next audio callback.\n | |||||
| * Send a single midi note to be processed in the next audio callback. | |||||
| * A note with 0 velocity means note-off. | * A note with 0 velocity means note-off. | ||||
| * \note Non-RT call | |||||
| * @note Non-RT call | |||||
| */ | */ | ||||
| void sendMidiSingleNote(const uint8_t channel, const uint8_t note, const uint8_t velo, const bool sendGui, const bool sendOsc, const bool sendCallback); | void sendMidiSingleNote(const uint8_t channel, const uint8_t note, const uint8_t velo, const bool sendGui, const bool sendOsc, const bool sendCallback); | ||||
| /*! | /*! | ||||
| * Send all midi notes off to the host callback.\n | |||||
| * Send all midi notes off to the host callback. | |||||
| * This doesn't send the actual MIDI All-Notes-Off event, but 128 note-offs instead (IFF ctrlChannel is valid). | * This doesn't send the actual MIDI All-Notes-Off event, but 128 note-offs instead (IFF ctrlChannel is valid). | ||||
| * \note RT call | |||||
| * @note RT call | |||||
| */ | */ | ||||
| void sendMidiAllNotesOffToCallback(); | void sendMidiAllNotesOffToCallback(); | ||||
| #endif | #endif | ||||
| @@ -843,7 +841,7 @@ public: | |||||
| // Plugin initializers | // Plugin initializers | ||||
| /*! | /*! | ||||
| * Get a plugin's binary type.\n | |||||
| * Get a plugin's binary type. | |||||
| * This is always BINARY_NATIVE unless the plugin is a bridge. | * This is always BINARY_NATIVE unless the plugin is a bridge. | ||||
| */ | */ | ||||
| virtual BinaryType getBinaryType() const noexcept | virtual BinaryType getBinaryType() const noexcept | ||||
| @@ -904,7 +902,7 @@ protected: | |||||
| // Helper classes | // Helper classes | ||||
| /*! | /*! | ||||
| * Fully disable plugin in scope and also its engine client.\n | |||||
| * Fully disable plugin in scope and also its engine client. | |||||
| * May wait-block on constructor for plugin process to end. | * May wait-block on constructor for plugin process to end. | ||||
| */ | */ | ||||
| class ScopedDisabler | class ScopedDisabler | ||||
| @@ -921,8 +919,8 @@ protected: | |||||
| }; | }; | ||||
| /*! | /*! | ||||
| * Lock the plugin's own run/process call.\n | |||||
| * Plugin will still work as normal, but output only silence.\n | |||||
| * Lock the plugin's own run/process call. | |||||
| * Plugin will still work as normal, but output only silence. | |||||
| * On destructor needsReset flag might be set if the plugin might have missed some events. | * On destructor needsReset flag might be set if the plugin might have missed some events. | ||||
| */ | */ | ||||
| class ScopedSingleProcessLocker | class ScopedSingleProcessLocker | ||||
| @@ -262,7 +262,7 @@ bool EngineTimeInfo::operator==(const EngineTimeInfo& timeInfo) const noexcept | |||||
| return false; | return false; | ||||
| if ((valid & kValidBBT) == 0) | if ((valid & kValidBBT) == 0) | ||||
| return true; | return true; | ||||
| if (timeInfo.bbt.beatsPerMinute != bbt.beatsPerMinute) | |||||
| if (! carla_compareFloats(timeInfo.bbt.beatsPerMinute, bbt.beatsPerMinute)) | |||||
| return false; | return false; | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -1203,7 +1203,7 @@ protected: | |||||
| void handleJackSampleRateCallback(const double newSampleRate) | void handleJackSampleRateCallback(const double newSampleRate) | ||||
| { | { | ||||
| if (pData->sampleRate == newSampleRate) | |||||
| if (carla_compareFloats(pData->sampleRate, newSampleRate)) | |||||
| return; | return; | ||||
| pData->sampleRate = newSampleRate; | pData->sampleRate = newSampleRate; | ||||
| @@ -1221,9 +1221,9 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) != 0 && pData->postProc.volume != 1.0f; | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && pData->postProc.dryWet != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) != 0 && ! carla_compareFloats(pData->postProc.volume, 1.0f); | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && ! carla_compareFloats(pData->postProc.dryWet, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| bool isPair; | bool isPair; | ||||
| float bufValue, oldBufLeft[doBalance ? frames : 1]; | float bufValue, oldBufLeft[doBalance ? frames : 1]; | ||||
| @@ -953,7 +953,7 @@ void CarlaPlugin::setDryWet(const float value, const bool sendOsc, const bool se | |||||
| const float fixedValue(carla_fixValue<float>(0.0f, 1.0f, value)); | const float fixedValue(carla_fixValue<float>(0.0f, 1.0f, value)); | ||||
| if (pData->postProc.dryWet == fixedValue) | |||||
| if (carla_compareFloats(pData->postProc.dryWet, fixedValue)) | |||||
| return; | return; | ||||
| pData->postProc.dryWet = fixedValue; | pData->postProc.dryWet = fixedValue; | ||||
| @@ -971,7 +971,7 @@ void CarlaPlugin::setVolume(const float value, const bool sendOsc, const bool se | |||||
| const float fixedValue(carla_fixValue<float>(0.0f, 1.27f, value)); | const float fixedValue(carla_fixValue<float>(0.0f, 1.27f, value)); | ||||
| if (pData->postProc.volume == fixedValue) | |||||
| if (carla_compareFloats(pData->postProc.volume, fixedValue)) | |||||
| return; | return; | ||||
| pData->postProc.volume = fixedValue; | pData->postProc.volume = fixedValue; | ||||
| @@ -989,7 +989,7 @@ void CarlaPlugin::setBalanceLeft(const float value, const bool sendOsc, const bo | |||||
| const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value)); | const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value)); | ||||
| if (pData->postProc.balanceLeft == fixedValue) | |||||
| if (carla_compareFloats(pData->postProc.balanceLeft, fixedValue)) | |||||
| return; | return; | ||||
| pData->postProc.balanceLeft = fixedValue; | pData->postProc.balanceLeft = fixedValue; | ||||
| @@ -1007,7 +1007,7 @@ void CarlaPlugin::setBalanceRight(const float value, const bool sendOsc, const b | |||||
| const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value)); | const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value)); | ||||
| if (pData->postProc.balanceRight == fixedValue) | |||||
| if (carla_compareFloats(pData->postProc.balanceRight, fixedValue)) | |||||
| return; | return; | ||||
| pData->postProc.balanceRight = fixedValue; | pData->postProc.balanceRight = fixedValue; | ||||
| @@ -1025,7 +1025,7 @@ void CarlaPlugin::setPanning(const float value, const bool sendOsc, const bool s | |||||
| const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value)); | const float fixedValue(carla_fixValue<float>(-1.0f, 1.0f, value)); | ||||
| if (pData->postProc.panning == fixedValue) | |||||
| if (carla_compareFloats(pData->postProc.panning, fixedValue)) | |||||
| return; | return; | ||||
| pData->postProc.panning = fixedValue; | pData->postProc.panning = fixedValue; | ||||
| @@ -1117,8 +1117,8 @@ void CarlaPlugin::setParameterValueByRealIndex(const int32_t rindex, const float | |||||
| { | { | ||||
| if (pData->param.data[i].rindex == rindex) | if (pData->param.data[i].rindex == rindex) | ||||
| { | { | ||||
| if (getParameterValue(i) != value) | |||||
| setParameterValue(i, value, sendGui, sendOsc, sendCallback); | |||||
| //if (! carla_compareFloats(getParameterValue(i), value)) | |||||
| setParameterValue(i, value, sendGui, sendOsc, sendCallback); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -663,9 +663,9 @@ public: | |||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': min > max", paramName); | carla_stderr2("WARNING - Broken plugin parameter '%s': min > max", paramName); | ||||
| min = max - 0.1f; | min = max - 0.1f; | ||||
| } | } | ||||
| else if (min == max) | |||||
| else if (carla_compareFloats(min, max)) | |||||
| { | { | ||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': min == maxf", paramName); | |||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': min == max", paramName); | |||||
| max = min + 0.1f; | max = min + 0.1f; | ||||
| } | } | ||||
| @@ -1651,8 +1651,8 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && pData->postProc.dryWet != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && ! carla_compareFloats(pData->postProc.dryWet, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| const bool isMono = (pData->audioIn.count == 1); | const bool isMono = (pData->audioIn.count == 1); | ||||
| bool isPair; | bool isPair; | ||||
| @@ -1396,8 +1396,8 @@ public: | |||||
| { | { | ||||
| // note - balance not possible with kUse16Outs, so we can safely skip fAudioOutBuffers | // note - balance not possible with kUse16Outs, so we can safely skip fAudioOutBuffers | ||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) > 0 && pData->postProc.volume != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) > 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) != 0 && ! carla_compareFloats(pData->postProc.volume, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| float oldBufLeft[doBalance ? frames : 1]; | float oldBufLeft[doBalance ? frames : 1]; | ||||
| @@ -637,9 +637,9 @@ public: | |||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': min > max", paramName); | carla_stderr2("WARNING - Broken plugin parameter '%s': min > max", paramName); | ||||
| min = max - 0.1f; | min = max - 0.1f; | ||||
| } | } | ||||
| else if (min == max) | |||||
| else if (carla_compareFloats(min, max)) | |||||
| { | { | ||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': min == maxf", paramName); | |||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': min == max", paramName); | |||||
| max = min + 0.1f; | max = min + 0.1f; | ||||
| } | } | ||||
| @@ -1248,8 +1248,8 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && pData->postProc.dryWet != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && ! carla_compareFloats(pData->postProc.dryWet, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| const bool isMono = (pData->audioIn.count == 1); | const bool isMono = (pData->audioIn.count == 1); | ||||
| bool isPair; | bool isPair; | ||||
| @@ -1068,8 +1068,8 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) > 0 && pData->postProc.volume != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) > 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) != 0 && ! carla_compareFloats(pData->postProc.volume, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| float oldBufLeft[doBalance ? frames : 1]; | float oldBufLeft[doBalance ? frames : 1]; | ||||
| @@ -1925,9 +1925,9 @@ public: | |||||
| max = (float)0xffffff; | max = (float)0xffffff; | ||||
| } | } | ||||
| if (max - min == 0.0f) | |||||
| if (carla_compareFloats(min, max)) | |||||
| { | { | ||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': max - min == 0.0f", fRdfDescriptor->Ports[i].Name); | |||||
| carla_stderr2("WARNING - Broken plugin parameter '%s': max == min", fRdfDescriptor->Ports[i].Name); | |||||
| max = min + 0.1f; | max = min + 0.1f; | ||||
| } | } | ||||
| @@ -2633,7 +2633,7 @@ public: | |||||
| break; | break; | ||||
| case LV2_PORT_DESIGNATION_TIME_BAR_BEAT: | case LV2_PORT_DESIGNATION_TIME_BAR_BEAT: | ||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && (fLastTimeInfo.bbt.tick != timeInfo.bbt.tick || | if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && (fLastTimeInfo.bbt.tick != timeInfo.bbt.tick || | ||||
| fLastTimeInfo.bbt.ticksPerBeat != timeInfo.bbt.ticksPerBeat)) | |||||
| !carla_compareFloats(fLastTimeInfo.bbt.ticksPerBeat, timeInfo.bbt.ticksPerBeat))) | |||||
| { | { | ||||
| fParamBuffers[k] = static_cast<float>(static_cast<double>(timeInfo.bbt.beat) - 1.0 + (static_cast<double>(timeInfo.bbt.tick) / timeInfo.bbt.ticksPerBeat)); | fParamBuffers[k] = static_cast<float>(static_cast<double>(timeInfo.bbt.beat) - 1.0 + (static_cast<double>(timeInfo.bbt.tick) / timeInfo.bbt.ticksPerBeat)); | ||||
| doPostRt = true; | doPostRt = true; | ||||
| @@ -2647,21 +2647,21 @@ public: | |||||
| } | } | ||||
| break; | break; | ||||
| case LV2_PORT_DESIGNATION_TIME_BEAT_UNIT: | case LV2_PORT_DESIGNATION_TIME_BEAT_UNIT: | ||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && fLastTimeInfo.bbt.beatType != timeInfo.bbt.beatType) | |||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && ! carla_compareFloats(fLastTimeInfo.bbt.beatType, timeInfo.bbt.beatType)) | |||||
| { | { | ||||
| fParamBuffers[k] = timeInfo.bbt.beatType; | fParamBuffers[k] = timeInfo.bbt.beatType; | ||||
| doPostRt = true; | doPostRt = true; | ||||
| } | } | ||||
| break; | break; | ||||
| case LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR: | case LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR: | ||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && fLastTimeInfo.bbt.beatsPerBar != timeInfo.bbt.beatsPerBar) | |||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && ! carla_compareFloats(fLastTimeInfo.bbt.beatsPerBar, timeInfo.bbt.beatsPerBar)) | |||||
| { | { | ||||
| fParamBuffers[k] = timeInfo.bbt.beatsPerBar; | fParamBuffers[k] = timeInfo.bbt.beatsPerBar; | ||||
| doPostRt = true; | doPostRt = true; | ||||
| } | } | ||||
| break; | break; | ||||
| case LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE: | case LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE: | ||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && fLastTimeInfo.bbt.beatsPerMinute != timeInfo.bbt.beatsPerMinute) | |||||
| if ((timeInfo.valid & EngineTimeInfo::kValidBBT) != 0 && ! carla_compareFloats(fLastTimeInfo.bbt.beatsPerMinute, timeInfo.bbt.beatsPerMinute)) | |||||
| { | { | ||||
| fParamBuffers[k] = static_cast<float>(timeInfo.bbt.beatsPerMinute); | fParamBuffers[k] = static_cast<float>(timeInfo.bbt.beatsPerMinute); | ||||
| doPostRt = true; | doPostRt = true; | ||||
| @@ -3383,7 +3383,7 @@ public: | |||||
| if (pData->param.data[k].hints & PARAMETER_IS_TRIGGER) | if (pData->param.data[k].hints & PARAMETER_IS_TRIGGER) | ||||
| { | { | ||||
| if (fParamBuffers[k] != pData->param.ranges[k].def) | |||||
| if (! carla_compareFloats(fParamBuffers[k], pData->param.ranges[k].def)) | |||||
| { | { | ||||
| fParamBuffers[k] = pData->param.ranges[k].def; | fParamBuffers[k] = pData->param.ranges[k].def; | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, static_cast<int32_t>(k), 0, fParamBuffers[k]); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, static_cast<int32_t>(k), 0, fParamBuffers[k]); | ||||
| @@ -3398,8 +3398,8 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && pData->postProc.dryWet != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && ! carla_compareFloats(pData->postProc.dryWet, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| const bool isMono = (pData->audioIn.count == 1); | const bool isMono = (pData->audioIn.count == 1); | ||||
| bool isPair; | bool isPair; | ||||
| @@ -3580,7 +3580,7 @@ public: | |||||
| CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); | CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); | ||||
| carla_debug("Lv2Plugin::sampleRateChanged(%g) - start", newSampleRate); | carla_debug("Lv2Plugin::sampleRateChanged(%g) - start", newSampleRate); | ||||
| if (fLv2Options.sampleRate != newSampleRate) | |||||
| if (! carla_compareFloats(fLv2Options.sampleRate, newSampleRate)) | |||||
| { | { | ||||
| fLv2Options.sampleRate = newSampleRate; | fLv2Options.sampleRate = newSampleRate; | ||||
| @@ -4336,8 +4336,8 @@ public: | |||||
| const float value(*(const float*)buffer); | const float value(*(const float*)buffer); | ||||
| if (fParamBuffers[index] != value) | |||||
| setParameterValue(index, value, false, true, true); | |||||
| //if (! carla_compareFloats(fParamBuffers[index], value)) | |||||
| setParameterValue(index, value, false, true, true); | |||||
| } break; | } break; | ||||
| @@ -1804,8 +1804,8 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && pData->postProc.dryWet != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && ! carla_compareFloats(pData->postProc.dryWet, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| bool isPair; | bool isPair; | ||||
| float bufValue, oldBufLeft[doBalance ? frames : 1]; | float bufValue, oldBufLeft[doBalance ? frames : 1]; | ||||
| @@ -686,7 +686,7 @@ public: | |||||
| carla_stderr2("WARNING - Broken plugin parameter min > max (with cockos extensions)"); | carla_stderr2("WARNING - Broken plugin parameter min > max (with cockos extensions)"); | ||||
| min = max - 0.1f; | min = max - 0.1f; | ||||
| } | } | ||||
| else if (min == max) | |||||
| else if (carla_compareFloats(min, max)) | |||||
| { | { | ||||
| carla_stderr2("WARNING - Broken plugin parameter min == max (with cockos extensions)"); | carla_stderr2("WARNING - Broken plugin parameter min == max (with cockos extensions)"); | ||||
| max = min + 0.1f; | max = min + 0.1f; | ||||
| @@ -728,7 +728,7 @@ public: | |||||
| carla_stderr2("WARNING - Broken plugin parameter min > max"); | carla_stderr2("WARNING - Broken plugin parameter min > max"); | ||||
| min = max - 0.1f; | min = max - 0.1f; | ||||
| } | } | ||||
| else if (min == max) | |||||
| else if (carla_compareFloats(min, max)) | |||||
| { | { | ||||
| carla_stderr2("WARNING - Broken plugin parameter min == max"); | carla_stderr2("WARNING - Broken plugin parameter min == max"); | ||||
| max = min + 0.1f; | max = min + 0.1f; | ||||
| @@ -1593,9 +1593,9 @@ public: | |||||
| // Post-processing (dry/wet, volume and balance) | // Post-processing (dry/wet, volume and balance) | ||||
| { | { | ||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) != 0 && pData->postProc.volume != 1.0f; | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && pData->postProc.dryWet != 1.0f; | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && (pData->postProc.balanceLeft != -1.0f || pData->postProc.balanceRight != 1.0f); | |||||
| const bool doVolume = (pData->hints & PLUGIN_CAN_VOLUME) != 0 && ! carla_compareFloats(pData->postProc.volume, 1.0f); | |||||
| const bool doDryWet = (pData->hints & PLUGIN_CAN_DRYWET) != 0 && ! carla_compareFloats(pData->postProc.dryWet, 1.0f); | |||||
| const bool doBalance = (pData->hints & PLUGIN_CAN_BALANCE) != 0 && ! (carla_compareFloats(pData->postProc.balanceLeft, -1.0f) && carla_compareFloats(pData->postProc.balanceRight, 1.0f)); | |||||
| bool isPair; | bool isPair; | ||||
| float bufValue, oldBufLeft[doBalance ? frames : 1]; | float bufValue, oldBufLeft[doBalance ? frames : 1]; | ||||
| @@ -1311,19 +1311,16 @@ class Host(object): | |||||
| # Load a file of any type. | # Load a file of any type. | ||||
| # This will try to load a generic file as a plugin, | # This will try to load a generic file as a plugin, | ||||
| # either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI). | # either by direct handling (GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI). | ||||
| # @param Filename Filename | |||||
| # @see carla_get_supported_file_extensions() | # @see carla_get_supported_file_extensions() | ||||
| def load_file(self, filename): | def load_file(self, filename): | ||||
| return bool(self.lib.carla_load_file(filename.encode("utf-8"))) | return bool(self.lib.carla_load_file(filename.encode("utf-8"))) | ||||
| # Load a Carla project file. | # Load a Carla project file. | ||||
| # @param Filename Filename | |||||
| # @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed. | # @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed. | ||||
| def load_project(self, filename): | def load_project(self, filename): | ||||
| return bool(self.lib.carla_load_project(filename.encode("utf-8"))) | return bool(self.lib.carla_load_project(filename.encode("utf-8"))) | ||||
| # Save current project to a file. | # Save current project to a file. | ||||
| # @param Filename Filename | |||||
| def save_project(self, filename): | def save_project(self, filename): | ||||
| return bool(self.lib.carla_save_project(filename.encode("utf-8"))) | return bool(self.lib.carla_save_project(filename.encode("utf-8"))) | ||||
| @@ -1355,7 +1352,6 @@ class Host(object): | |||||
| self.lib.carla_transport_pause() | self.lib.carla_transport_pause() | ||||
| # Relocate the engine transport to a specific frame. | # Relocate the engine transport to a specific frame. | ||||
| # @param frames Frame to relocate to. | |||||
| def transport_relocate(self, frame): | def transport_relocate(self, frame): | ||||
| self.lib.carla_transport_relocate(frame) | self.lib.carla_transport_relocate(frame) | ||||
| @@ -1682,8 +1678,8 @@ class Host(object): | |||||
| self.lib.carla_set_custom_data(pluginId, type_.encode("utf-8"), key.encode("utf-8"), value.encode("utf-8")) | self.lib.carla_set_custom_data(pluginId, type_.encode("utf-8"), key.encode("utf-8"), value.encode("utf-8")) | ||||
| # Set a plugin's chunk data. | # Set a plugin's chunk data. | ||||
| # @param pluginId Plugin | |||||
| # @param value New value | |||||
| # @param pluginId Plugin | |||||
| # @param chunkData New chunk data | |||||
| # @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data() | # @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data() | ||||
| def set_chunk_data(self, pluginId, chunkData): | def set_chunk_data(self, pluginId, chunkData): | ||||
| self.lib.carla_set_chunk_data(pluginId, chunkData.encode("utf-8")) | self.lib.carla_set_chunk_data(pluginId, chunkData.encode("utf-8")) | ||||
| @@ -44,9 +44,9 @@ | |||||
| /** | /** | ||||
| * container_of - cast a member of a structure out to the containing structure | * container_of - cast a member of a structure out to the containing structure | ||||
| * @ptr: the pointer to the member. | |||||
| * @type: the type of the container struct this is embedded in. | |||||
| * @member: the name of the member within the struct. | |||||
| * @param ptr: the pointer to the member. | |||||
| * @param type: the type of the container struct this is embedded in. | |||||
| * @param member the name of the member within the struct. | |||||
| * | * | ||||
| */ | */ | ||||
| #define container_of(ptr, type, member) ({ \ | #define container_of(ptr, type, member) ({ \ | ||||
| @@ -108,8 +108,8 @@ static inline void __list_add(struct list_head *new_, struct list_head *prev, st | |||||
| /** | /** | ||||
| * list_add - add a new entry | * list_add - add a new entry | ||||
| * @new: new entry to be added | |||||
| * @head: list head to add it after | |||||
| * @param new_ new entry to be added | |||||
| * @param head list head to add it after | |||||
| * | * | ||||
| * Insert a new entry after the specified head. | * Insert a new entry after the specified head. | ||||
| * This is good for implementing stacks. | * This is good for implementing stacks. | ||||
| @@ -121,8 +121,8 @@ static inline void list_add(struct list_head *new_, struct list_head *head) | |||||
| /** | /** | ||||
| * list_add_tail - add a new entry | * list_add_tail - add a new entry | ||||
| * @new: new entry to be added | |||||
| * @head: list head to add it before | |||||
| * @param new_ new entry to be added | |||||
| * @param head list head to add it before | |||||
| * | * | ||||
| * Insert a new entry before the specified head. | * Insert a new entry before the specified head. | ||||
| * This is useful for implementing queues. | * This is useful for implementing queues. | ||||
| @@ -147,7 +147,7 @@ static inline void __list_del(struct list_head *prev, struct list_head *next) | |||||
| /** | /** | ||||
| * list_del - deletes entry from list. | * list_del - deletes entry from list. | ||||
| * @entry: the element to delete from the list. | |||||
| * @param entry the element to delete from the list. | |||||
| * Note: list_empty on entry does not return true after this, the entry is | * Note: list_empty on entry does not return true after this, the entry is | ||||
| * in an undefined state. | * in an undefined state. | ||||
| */ | */ | ||||
| @@ -160,7 +160,7 @@ static inline void list_del(struct list_head *entry) | |||||
| /** | /** | ||||
| * list_del_init - deletes entry from list and reinitialize it. | * list_del_init - deletes entry from list and reinitialize it. | ||||
| * @entry: the element to delete from the list. | |||||
| * @param entry the element to delete from the list. | |||||
| */ | */ | ||||
| static inline void list_del_init(struct list_head *entry) | static inline void list_del_init(struct list_head *entry) | ||||
| { | { | ||||
| @@ -170,8 +170,8 @@ static inline void list_del_init(struct list_head *entry) | |||||
| /** | /** | ||||
| * list_move - delete from one list and add as another's head | * list_move - delete from one list and add as another's head | ||||
| * @list: the entry to move | |||||
| * @head: the head that will precede our entry | |||||
| * @param list the entry to move | |||||
| * @param head the head that will precede our entry | |||||
| */ | */ | ||||
| static inline void list_move(struct list_head *list, struct list_head *head) | static inline void list_move(struct list_head *list, struct list_head *head) | ||||
| { | { | ||||
| @@ -181,8 +181,8 @@ static inline void list_move(struct list_head *list, struct list_head *head) | |||||
| /** | /** | ||||
| * list_move_tail - delete from one list and add as another's tail | * list_move_tail - delete from one list and add as another's tail | ||||
| * @list: the entry to move | |||||
| * @head: the head that will follow our entry | |||||
| * @param list the entry to move | |||||
| * @param head the head that will follow our entry | |||||
| */ | */ | ||||
| static inline void list_move_tail(struct list_head *list, struct list_head *head) | static inline void list_move_tail(struct list_head *list, struct list_head *head) | ||||
| { | { | ||||
| @@ -192,7 +192,7 @@ static inline void list_move_tail(struct list_head *list, struct list_head *head | |||||
| /** | /** | ||||
| * list_empty - tests whether a list is empty | * list_empty - tests whether a list is empty | ||||
| * @head: the list to test. | |||||
| * @param head the list to test. | |||||
| */ | */ | ||||
| static inline int list_empty(const struct list_head *head) | static inline int list_empty(const struct list_head *head) | ||||
| { | { | ||||
| @@ -209,7 +209,7 @@ static inline int list_empty(const struct list_head *head) | |||||
| * to the list entry is list_del_init(). Eg. it cannot be used | * to the list entry is list_del_init(). Eg. it cannot be used | ||||
| * if another CPU could re-list_add() it. | * if another CPU could re-list_add() it. | ||||
| * | * | ||||
| * @head: the list to test. | |||||
| * @param head the list to test. | |||||
| */ | */ | ||||
| static inline int list_empty_careful(const struct list_head *head) | static inline int list_empty_careful(const struct list_head *head) | ||||
| { | { | ||||
| @@ -245,8 +245,8 @@ static inline void __list_splice_tail(struct list_head *list, struct list_head * | |||||
| /** | /** | ||||
| * list_splice - join two lists | * list_splice - join two lists | ||||
| * @list: the new list to add. | |||||
| * @head: the place to add it in the first list. | |||||
| * @param list the new list to add. | |||||
| * @param head the place to add it in the first list. | |||||
| */ | */ | ||||
| static inline void list_splice(struct list_head *list, struct list_head *head) | static inline void list_splice(struct list_head *list, struct list_head *head) | ||||
| { | { | ||||
| @@ -256,10 +256,10 @@ static inline void list_splice(struct list_head *list, struct list_head *head) | |||||
| /** | /** | ||||
| * list_splice_tail - join two lists | * list_splice_tail - join two lists | ||||
| * @list: the new list to add. | |||||
| * @head: the place to add it in the first list. | |||||
| * @param list the new list to add. | |||||
| * @param head the place to add it in the first list. | |||||
| * | * | ||||
| * @list goes to the end (at head->prev) | |||||
| * @a list goes to the end (at head->prev) | |||||
| */ | */ | ||||
| static inline void list_splice_tail(struct list_head *list, struct list_head *head) | static inline void list_splice_tail(struct list_head *list, struct list_head *head) | ||||
| { | { | ||||
| @@ -269,10 +269,10 @@ static inline void list_splice_tail(struct list_head *list, struct list_head *he | |||||
| /** | /** | ||||
| * list_splice_init - join two lists and reinitialise the emptied list. | * list_splice_init - join two lists and reinitialise the emptied list. | ||||
| * @list: the new list to add. | |||||
| * @head: the place to add it in the first list. | |||||
| * @param list the new list to add. | |||||
| * @param head the place to add it in the first list. | |||||
| * | * | ||||
| * The list at @list is reinitialised | |||||
| * The list at @a list is reinitialised | |||||
| */ | */ | ||||
| static inline void list_splice_init(struct list_head *list, struct list_head *head) | static inline void list_splice_init(struct list_head *list, struct list_head *head) | ||||
| { | { | ||||
| @@ -284,11 +284,11 @@ static inline void list_splice_init(struct list_head *list, struct list_head *he | |||||
| /** | /** | ||||
| * list_splice_tail_init - join two lists and reinitialise the emptied list. | * list_splice_tail_init - join two lists and reinitialise the emptied list. | ||||
| * @list: the new list to add. | |||||
| * @head: the place to add it in the first list. | |||||
| * @param list the new list to add. | |||||
| * @param head the place to add it in the first list. | |||||
| * | * | ||||
| * The list at @list is reinitialised | |||||
| * @list goes to the end (at head->prev) | |||||
| * The list @a list is reinitialised | |||||
| * @a list goes to the end (at head->prev) | |||||
| */ | */ | ||||
| static inline void list_splice_tail_init(struct list_head *list, struct list_head *head) | static inline void list_splice_tail_init(struct list_head *list, struct list_head *head) | ||||
| { | { | ||||
| @@ -300,9 +300,9 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_entry - get the struct for this entry | * list_entry - get the struct for this entry | ||||
| * @ptr: the &struct list_head pointer. | |||||
| * @type: the type of the struct this is embedded in. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param ptr: the &struct list_head pointer. | |||||
| * @param type: the type of the struct this is embedded in. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #if (defined(__GNUC__) || defined(__clang__)) && ! defined(__STRICT_ANSI__) | #if (defined(__GNUC__) || defined(__clang__)) && ! defined(__STRICT_ANSI__) | ||||
| # define list_entry(ptr, type, member) \ | # define list_entry(ptr, type, member) \ | ||||
| @@ -318,8 +318,8 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each - iterate over a list | * list_for_each - iterate over a list | ||||
| * @pos: the &struct list_head to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @param pos the &struct list_head to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| */ | */ | ||||
| #define list_for_each(pos, head) \ | #define list_for_each(pos, head) \ | ||||
| for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | ||||
| @@ -327,8 +327,8 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * __list_for_each - iterate over a list | * __list_for_each - iterate over a list | ||||
| * @pos: the &struct list_head to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @param pos the &struct list_head to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| * | * | ||||
| * This variant differs from list_for_each() in that it's the | * This variant differs from list_for_each() in that it's the | ||||
| * simplest possible list iteration code, no prefetching is done. | * simplest possible list iteration code, no prefetching is done. | ||||
| @@ -340,8 +340,8 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_prev - iterate over a list backwards | * list_for_each_prev - iterate over a list backwards | ||||
| * @pos: the &struct list_head to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @param pos the &struct list_head to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| */ | */ | ||||
| #define list_for_each_prev(pos, head) \ | #define list_for_each_prev(pos, head) \ | ||||
| for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ | for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ | ||||
| @@ -349,9 +349,9 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_safe - iterate over a list safe against removal of list entry | * list_for_each_safe - iterate over a list safe against removal of list entry | ||||
| * @pos: the &struct list_head to use as a loop counter. | |||||
| * @n: another &struct list_head to use as temporary storage | |||||
| * @head: the head for your list. | |||||
| * @param pos the &struct list_head to use as a loop counter. | |||||
| * @param n another &struct list_head to use as temporary storage | |||||
| * @param head the head for your list. | |||||
| */ | */ | ||||
| #define list_for_each_safe(pos, n, head) \ | #define list_for_each_safe(pos, n, head) \ | ||||
| for (pos = (head)->next, n = pos->next; pos != (head); \ | for (pos = (head)->next, n = pos->next; pos != (head); \ | ||||
| @@ -359,9 +359,9 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry - iterate over list of given type | * list_for_each_entry - iterate over list of given type | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry(pos, head, member) \ | #define list_for_each_entry(pos, head, member) \ | ||||
| for (pos = list_entry((head)->next, typeof(*pos), member); \ | for (pos = list_entry((head)->next, typeof(*pos), member); \ | ||||
| @@ -370,9 +370,9 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry_reverse - iterate backwards over list of given type. | * list_for_each_entry_reverse - iterate backwards over list of given type. | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_reverse(pos, head, member) \ | #define list_for_each_entry_reverse(pos, head, member) \ | ||||
| for (pos = list_entry((head)->prev, typeof(*pos), member); \ | for (pos = list_entry((head)->prev, typeof(*pos), member); \ | ||||
| @@ -381,18 +381,18 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_prepare_entry - prepare a pos entry for use as a start point in list_for_each_entry_continue | * list_prepare_entry - prepare a pos entry for use as a start point in list_for_each_entry_continue | ||||
| * @pos: the type * to use as a start point | |||||
| * @head: the head of the list | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a start point | |||||
| * @param head the head of the list | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_prepare_entry(pos, head, member) \ | #define list_prepare_entry(pos, head, member) \ | ||||
| ((pos) ? : list_entry(head, typeof(*pos), member)) | ((pos) ? : list_entry(head, typeof(*pos), member)) | ||||
| /** | /** | ||||
| * list_for_each_entry_continue - iterate over list of given type continuing after existing point | * list_for_each_entry_continue - iterate over list of given type continuing after existing point | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_continue(pos, head, member) \ | #define list_for_each_entry_continue(pos, head, member) \ | ||||
| for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | ||||
| @@ -401,9 +401,9 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry_from - iterate over list of given type continuing from existing point | * list_for_each_entry_from - iterate over list of given type continuing from existing point | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_from(pos, head, member) \ | #define list_for_each_entry_from(pos, head, member) \ | ||||
| for (; prefetch(pos->member.next), &pos->member != (head); \ | for (; prefetch(pos->member.next), &pos->member != (head); \ | ||||
| @@ -411,10 +411,10 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @n: another type * to use as temporary storage | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param n another type * to use as temporary storage | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_safe(pos, n, head, member) \ | #define list_for_each_entry_safe(pos, n, head, member) \ | ||||
| for (pos = list_entry((head)->next, typeof(*pos), member), \ | for (pos = list_entry((head)->next, typeof(*pos), member), \ | ||||
| @@ -424,10 +424,10 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry_safe_continue - iterate over list of given type continuing after existing point safe against removal of list entry | * list_for_each_entry_safe_continue - iterate over list of given type continuing after existing point safe against removal of list entry | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @n: another type * to use as temporary storage | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param n another type * to use as temporary storage | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_safe_continue(pos, n, head, member) \ | #define list_for_each_entry_safe_continue(pos, n, head, member) \ | ||||
| for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | ||||
| @@ -437,10 +437,10 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry_safe_from - iterate over list of given type from existing point safe against removal of list entry | * list_for_each_entry_safe_from - iterate over list of given type from existing point safe against removal of list entry | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @n: another type * to use as temporary storage | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param n another type * to use as temporary storage | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_safe_from(pos, n, head, member) \ | #define list_for_each_entry_safe_from(pos, n, head, member) \ | ||||
| for (n = list_entry(pos->member.next, typeof(*pos), member); \ | for (n = list_entry(pos->member.next, typeof(*pos), member); \ | ||||
| @@ -449,10 +449,10 @@ static inline void list_splice_tail_init(struct list_head *list, struct list_hea | |||||
| /** | /** | ||||
| * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against removal of list entry | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against removal of list entry | ||||
| * @pos: the type * to use as a loop counter. | |||||
| * @n: another type * to use as temporary storage | |||||
| * @head: the head for your list. | |||||
| * @member: the name of the list_struct within the struct. | |||||
| * @param pos the type * to use as a loop counter. | |||||
| * @param n another type * to use as temporary storage | |||||
| * @param head the head for your list. | |||||
| * @param member the name of the list_struct within the struct. | |||||
| */ | */ | ||||
| #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | ||||
| for (pos = list_entry((head)->prev, typeof(*pos), member), \ | for (pos = list_entry((head)->prev, typeof(*pos), member), \ | ||||
| @@ -15,6 +15,9 @@ | |||||
| * For a full copy of the GNU General Public License see the doc/GPL.txt file. | * For a full copy of the GNU General Public License see the doc/GPL.txt file. | ||||
| */ | */ | ||||
| // include this first to ignore documentation warnings | |||||
| #include "CarlaLv2Utils.hpp" | |||||
| #define CARLA_NATIVE_PLUGIN_LV2 | #define CARLA_NATIVE_PLUGIN_LV2 | ||||
| #include "carla-native-base.cpp" | #include "carla-native-base.cpp" | ||||
| @@ -15,25 +15,15 @@ | |||||
| * For a full copy of the GNU General Public License see the doc/GPL.txt file. | * For a full copy of the GNU General Public License see the doc/GPL.txt file. | ||||
| */ | */ | ||||
| // include this first to ignore documentation warnings | |||||
| #include "CarlaLv2Utils.hpp" | |||||
| #define CARLA_NATIVE_PLUGIN_LV2 | #define CARLA_NATIVE_PLUGIN_LV2 | ||||
| #include "carla-native-base.cpp" | #include "carla-native-base.cpp" | ||||
| // #include "CarlaMathUtils.hpp" | |||||
| #include "CarlaMathUtils.hpp" | |||||
| #include "CarlaString.hpp" | #include "CarlaString.hpp" | ||||
| #include "lv2/atom.h" | |||||
| #include "lv2/atom-util.h" | |||||
| #include "lv2/buf-size.h" | |||||
| #include "lv2/instance-access.h" | |||||
| #include "lv2/midi.h" | |||||
| #include "lv2/options.h" | |||||
| #include "lv2/state.h" | |||||
| #include "lv2/time.h" | |||||
| #include "lv2/ui.h" | |||||
| #include "lv2/urid.h" | |||||
| #include "lv2/lv2_external_ui.h" | |||||
| #include "lv2/lv2_programs.h" | |||||
| #include "juce_audio_basics.h" | #include "juce_audio_basics.h" | ||||
| using juce::FloatVectorOperations; | using juce::FloatVectorOperations; | ||||
| @@ -274,7 +264,7 @@ public: | |||||
| curValue = *fPorts.paramsPtr[i]; | curValue = *fPorts.paramsPtr[i]; | ||||
| if (fPorts.paramsLast[i] != curValue && (fDescriptor->get_parameter_info(fHandle, i)->hints & PARAMETER_IS_OUTPUT) == 0) | |||||
| if ((! carla_compareFloats(fPorts.paramsLast[i], curValue)) && (fDescriptor->get_parameter_info(fHandle, i)->hints & PARAMETER_IS_OUTPUT) == 0) | |||||
| { | { | ||||
| fPorts.paramsLast[i] = curValue; | fPorts.paramsLast[i] = curValue; | ||||
| fDescriptor->set_parameter_value(fHandle, i, curValue); | fDescriptor->set_parameter_value(fHandle, i, curValue); | ||||
| @@ -25,6 +25,15 @@ | |||||
| # define NULL nullptr | # define NULL nullptr | ||||
| #endif | #endif | ||||
| // disable -Wdocumentation for LV2 headers | |||||
| #if defined(__clang__) | |||||
| # pragma clang diagnostic push | |||||
| # pragma clang diagnostic ignored "-Wdocumentation" | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic push | |||||
| # pragma GCC diagnostic ignored "-Wdocumentation" | |||||
| #endif | |||||
| #include "lv2/lv2.h" | #include "lv2/lv2.h" | ||||
| #include "lv2/atom.h" | #include "lv2/atom.h" | ||||
| #include "lv2/atom-forge.h" | #include "lv2/atom-forge.h" | ||||
| @@ -61,11 +70,18 @@ | |||||
| #include "lv2/lv2_programs.h" | #include "lv2/lv2_programs.h" | ||||
| #include "lv2/lv2_rtmempool.h" | #include "lv2/lv2_rtmempool.h" | ||||
| #include "lv2_rdf.hpp" | |||||
| #include "lilv/lilvmm.hpp" | #include "lilv/lilvmm.hpp" | ||||
| #include "sratom/sratom.h" | #include "sratom/sratom.h" | ||||
| // enable -Wdocumentation again | |||||
| #if defined(__clang__) | |||||
| # pragma clang diagnostic pop | |||||
| #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
| # pragma GCC diagnostic pop | |||||
| #endif | |||||
| #include "lv2_rdf.hpp" | |||||
| #ifdef USE_QT | #ifdef USE_QT | ||||
| # include <QtCore/QStringList> | # include <QtCore/QStringList> | ||||
| #else | #else | ||||
| @@ -21,6 +21,7 @@ | |||||
| #include "CarlaUtils.hpp" | #include "CarlaUtils.hpp" | ||||
| #include <cmath> | #include <cmath> | ||||
| #include <limits> | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| // math functions (base) | // math functions (base) | ||||
| @@ -96,6 +97,16 @@ uint32_t carla_nextPowerOf2(uint32_t size) noexcept | |||||
| return ++size; | return ++size; | ||||
| } | } | ||||
| /* | |||||
| * Safely compare two floating point numbers. | |||||
| */ | |||||
| template<typename T> | |||||
| static inline | |||||
| bool carla_compareFloats(const T& v1, const T& v2) | |||||
| { | |||||
| return std::abs(v1-v2) < std::numeric_limits<T>::epsilon(); | |||||
| } | |||||
| #if 0 | #if 0 | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| // math functions (extended) | // math functions (extended) | ||||
| @@ -506,15 +506,15 @@ String StateSave::toString() const | |||||
| dataXml << " <Active>" << (active ? "Yes" : "No") << "</Active>\n"; | dataXml << " <Active>" << (active ? "Yes" : "No") << "</Active>\n"; | ||||
| if (dryWet != 1.0f) | |||||
| if (! carla_compareFloats(dryWet, 1.0f)) | |||||
| dataXml << " <DryWet>" << String(dryWet, 7) << "</DryWet>\n"; | dataXml << " <DryWet>" << String(dryWet, 7) << "</DryWet>\n"; | ||||
| if (volume != 1.0f) | |||||
| if (! carla_compareFloats(volume, 1.0f)) | |||||
| dataXml << " <Volume>" << String(volume, 7) << "</Volume>\n"; | dataXml << " <Volume>" << String(volume, 7) << "</Volume>\n"; | ||||
| if (balanceLeft != -1.0f) | |||||
| if (! carla_compareFloats(balanceLeft, -1.0f)) | |||||
| dataXml << " <Balance-Left>" << String(balanceLeft, 7) << "</Balance-Left>\n"; | dataXml << " <Balance-Left>" << String(balanceLeft, 7) << "</Balance-Left>\n"; | ||||
| if (balanceRight != 1.0f) | |||||
| if (! carla_compareFloats(balanceRight, 1.0f)) | |||||
| dataXml << " <Balance-Right>" << String(balanceRight, 7) << "</Balance-Right>\n"; | dataXml << " <Balance-Right>" << String(balanceRight, 7) << "</Balance-Right>\n"; | ||||
| if (panning != 0.0f) | |||||
| if (! carla_compareFloats(panning, 0.0f)) | |||||
| dataXml << " <Panning>" << String(panning, 7) << "</Panning>\n"; | dataXml << " <Panning>" << String(panning, 7) << "</Panning>\n"; | ||||
| if (ctrlChannel < 0) | if (ctrlChannel < 0) | ||||