Browse Source

Continue API work

tags/1.9.4
falkTX 11 years ago
parent
commit
2d27207022
2 changed files with 29 additions and 63 deletions
  1. +15
    -41
      source/backend/CarlaBackend.h
  2. +14
    -22
      source/carla_backend.py

+ 15
- 41
source/backend/CarlaBackend.h View File

@@ -76,17 +76,18 @@ const unsigned int MAX_DEFAULT_PARAMETERS = 200;


/*! /*!
* Engine driver device has custom control-panel. * Engine driver device has custom control-panel.
* @see ENGINE_OPTION_AUDIO_SHOW_CTRL_PANEL
*/ */
const unsigned int ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1; const unsigned int ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1;


/*! /*!
* Engine driver device can change buffer-size on the fly. * 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; const unsigned int ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x2;


/*! /*!
* Engine driver device can change sample-rate on the fly. * 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; 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. * This hint is required because "bridge" itself is not a plugin type.
*/ */
const unsigned int PLUGIN_IS_BRIDGE = 0x01; 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. * Parameter value is boolean.
* It's always at either minimum or maximum value. * 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. * Parameter value is integer.
*/ */
const unsigned int PARAMETER_IS_INTEGER = 0x002;
const unsigned int PARAMETER_IS_INTEGER = 0x004;


/*! /*!
* Parameter value is logarithmic. * Parameter value is logarithmic.
*/ */
const unsigned int PARAMETER_IS_LOGARITHMIC = 0x004;
const unsigned int PARAMETER_IS_LOGARITHMIC = 0x008;


/*! /*!
* Parameter is enabled. * Parameter is enabled.
@@ -501,33 +508,6 @@ typedef enum {


} PluginCategory; } 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. * Special parameters used internally in Carla.
* Plugins do not know about their existence. * 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 _ParameterData() noexcept
: type(PARAMETER_UNKNOWN),
index(PARAMETER_NULL),
: index(PARAMETER_NULL),
rindex(-1), rindex(-1),
hints(0x0), hints(0x0),
midiChannel(0), midiChannel(0),


+ 14
- 22
source/carla_backend.py View File

@@ -28,6 +28,11 @@ from sys import platform, maxsize


kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32) kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32)


# ------------------------------------------------------------------------------------------------------------
# Define enum type (integer)

c_enum = c_int

# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Set Platform # Set Platform


@@ -131,13 +136,14 @@ MAX_DEFAULT_PARAMETERS = 200
# Engine Driver Device Hints # Engine Driver Device Hints


# Engine driver device has custom control-panel. # Engine driver device has custom control-panel.
# @see ENGINE_OPTION_AUDIO_SHOW_CTRL_PANEL
ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1 ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1


# Engine driver device can change buffer-size on the fly. # 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_VARIABLE_BUFFER_SIZE = 0x2


# Engine driver device can change sample-rate on the fly. # Engine driver device can change sample-rate on the fly.
# @see ENGINE_OPTION_AUDIO_SAMPLE_RATE
ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4 ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
@@ -202,14 +208,18 @@ PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100
# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Parameter Hints # 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 value is boolean.
PARAMETER_IS_BOOLEAN = 0x001
PARAMETER_IS_BOOLEAN = 0x002


# Parameter value is integer. # Parameter value is integer.
PARAMETER_IS_INTEGER = 0x002
PARAMETER_IS_INTEGER = 0x004


# Parameter value is logarithmic. # Parameter value is logarithmic.
PARAMETER_IS_LOGARITHMIC = 0x004
PARAMETER_IS_LOGARITHMIC = 0x008


# Parameter is enabled. # Parameter is enabled.
# It can be viewed, changed and stored. # 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). # Miscellaneous plugin (used to check if the plugin has a category).
PLUGIN_CATEGORY_OTHER = 9 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 # Internal Parameters Index


@@ -683,8 +677,6 @@ else:
# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Backend C++ -> Python variables # 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) 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) FileCallbackFunc = CFUNCTYPE(c_char_p, c_void_p, c_enum, c_bool, c_char_p, c_char_p)




Loading…
Cancel
Save