From 2d27207022eda8ddeebad0d2fc7bf95e9b1e27dc Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 30 Nov 2013 21:36:42 +0000 Subject: [PATCH] Continue API work --- source/backend/CarlaBackend.h | 56 ++++++++++------------------------- source/carla_backend.py | 36 +++++++++------------- 2 files changed, 29 insertions(+), 63 deletions(-) diff --git a/source/backend/CarlaBackend.h b/source/backend/CarlaBackend.h index f66106148..3d185e41a 100644 --- a/source/backend/CarlaBackend.h +++ b/source/backend/CarlaBackend.h @@ -76,17 +76,18 @@ const unsigned int MAX_DEFAULT_PARAMETERS = 200; /*! * Engine driver device has custom control-panel. - * @see ENGINE_OPTION_AUDIO_SHOW_CTRL_PANEL */ const unsigned int ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1; /*! * Engine driver device can change buffer-size on the fly. + * @see ENGINE_OPTION_AUDIO_BUFFER_SIZE */ const unsigned int ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x2; /*! * Engine driver device can change sample-rate on the fly. + * @see ENGINE_OPTION_AUDIO_SAMPLE_RATE */ const unsigned int ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4; @@ -101,7 +102,7 @@ const unsigned int ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4; */ /*! - * Plugin is a bridge. + * Plugin is a bridge.\n * This hint is required because "bridge" itself is not a plugin type. */ const unsigned int PLUGIN_IS_BRIDGE = 0x01; @@ -207,21 +208,27 @@ const unsigned int PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100; * @{ */ +/*! + * Parameter is input.\n + * When this hint is not set, parameter is assumed to be output. + */ +const unsigned int PARAMETER_IS_INPUT = 0x001; + /*! * Parameter value is boolean. * It's always at either minimum or maximum value. */ -const unsigned int PARAMETER_IS_BOOLEAN = 0x001; +const unsigned int PARAMETER_IS_BOOLEAN = 0x002; /*! * Parameter value is integer. */ -const unsigned int PARAMETER_IS_INTEGER = 0x002; +const unsigned int PARAMETER_IS_INTEGER = 0x004; /*! * Parameter value is logarithmic. */ -const unsigned int PARAMETER_IS_LOGARITHMIC = 0x004; +const unsigned int PARAMETER_IS_LOGARITHMIC = 0x008; /*! * Parameter is enabled. @@ -501,33 +508,6 @@ typedef enum { } PluginCategory; -/*! - * Plugin parameter type. - */ -typedef enum { - /*! - * Unknown parameter type. - */ - PARAMETER_UNKNOWN = 0, - - /*! - * Input parameter. - */ - PARAMETER_INPUT = 1, - - /*! - * Output parameter. - */ - PARAMETER_OUTPUT = 2, - - /*! - * Special parameter. - * Used to report specific information to plugins. - */ - PARAMETER_SPECIAL = 3 - -} ParameterType; - /*! * Special parameters used internally in Carla. * Plugins do not know about their existence. @@ -1063,17 +1043,12 @@ typedef struct _ParameterData { /*! * */ - ParameterType type; - - /*! - * - */ - int32_t index; + int32_t index; /*! * */ - int32_t rindex; + int32_t rindex; /*! * @@ -1095,8 +1070,7 @@ typedef struct _ParameterData { * */ _ParameterData() noexcept - : type(PARAMETER_UNKNOWN), - index(PARAMETER_NULL), + : index(PARAMETER_NULL), rindex(-1), hints(0x0), midiChannel(0), diff --git a/source/carla_backend.py b/source/carla_backend.py index 39c8b0d8c..2f2e18425 100644 --- a/source/carla_backend.py +++ b/source/carla_backend.py @@ -28,6 +28,11 @@ from sys import platform, maxsize kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32) +# ------------------------------------------------------------------------------------------------------------ +# Define enum type (integer) + +c_enum = c_int + # ------------------------------------------------------------------------------------------------------------ # Set Platform @@ -131,13 +136,14 @@ MAX_DEFAULT_PARAMETERS = 200 # Engine Driver Device Hints # Engine driver device has custom control-panel. -# @see ENGINE_OPTION_AUDIO_SHOW_CTRL_PANEL ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1 # Engine driver device can change buffer-size on the fly. +# @see ENGINE_OPTION_AUDIO_BUFFER_SIZE ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x2 # Engine driver device can change sample-rate on the fly. +# @see ENGINE_OPTION_AUDIO_SAMPLE_RATE ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4 # ------------------------------------------------------------------------------------------------------------ @@ -202,14 +208,18 @@ PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100 # ------------------------------------------------------------------------------------------------------------ # Parameter Hints +# Parameter is input. +# When this hint is not set, parameter is assumed to be output. +PARAMETER_IS_INPUT = 0x001 + # Parameter value is boolean. -PARAMETER_IS_BOOLEAN = 0x001 +PARAMETER_IS_BOOLEAN = 0x002 # Parameter value is integer. -PARAMETER_IS_INTEGER = 0x002 +PARAMETER_IS_INTEGER = 0x004 # Parameter value is logarithmic. -PARAMETER_IS_LOGARITHMIC = 0x004 +PARAMETER_IS_LOGARITHMIC = 0x008 # Parameter is enabled. # It can be viewed, changed and stored. @@ -368,22 +378,6 @@ PLUGIN_CATEGORY_UTILITY = 8 # Miscellaneous plugin (used to check if the plugin has a category). PLUGIN_CATEGORY_OTHER = 9 -# ------------------------------------------------------------------------------------------------------------ -# Parameter Type - -# Unknown parameter type. -PARAMETER_UNKNOWN = 0 - -# Input parameter. -PARAMETER_INPUT = 1 - -# Output parameter. -PARAMETER_OUTPUT = 2 - -# Special parameter. -# Used to report specific information to plugins. -PARAMETER_SPECIAL = 3 - # ------------------------------------------------------------------------------------------------------------ # Internal Parameters Index @@ -683,8 +677,6 @@ else: # ------------------------------------------------------------------------------------------------------------ # Backend C++ -> Python variables -c_enum = c_int32 - EngineCallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_uint, c_int, c_int, c_float, c_char_p) FileCallbackFunc = CFUNCTYPE(c_char_p, c_void_p, c_enum, c_bool, c_char_p, c_char_p)