Browse Source

Add some more inline code docs

tags/1.9.4
falkTX 11 years ago
parent
commit
d4f7ead7e7
2 changed files with 75 additions and 22 deletions
  1. +31
    -21
      source/backend/CarlaBackend.h
  2. +44
    -1
      source/carla_backend.py

+ 31
- 21
source/backend/CarlaBackend.h View File

@@ -1013,33 +1013,37 @@ typedef void (*EngineCallbackFunc)(void* ptr, EngineCallbackOpcode action, unsig
*/ */
typedef struct _ParameterData { typedef struct _ParameterData {
/*! /*!
*
* Index as seen by Carla.
*/ */
int32_t index; int32_t index;


/*! /*!
*
* Real index as seen by plugins.
*/ */
int32_t rindex; int32_t rindex;


/*! /*!
*
* This parameter hints.
* @see ParameterHints
*/ */
unsigned int hints; unsigned int hints;


/*! /*!
*
* Currently mapped MIDI CC.\n
* A value lower than 0 means invalid or unused.\n
* Maximum allowed value is 95 (0x5F).
*/ */
int16_t midiCC; int16_t midiCC;


/*! /*!
*
* Currently mapped MIDI channel.\n
* Counts from 0 to 15.
*/ */
uint8_t midiChannel; uint8_t midiChannel;


#ifdef __cplusplus #ifdef __cplusplus
/*! /*!
*
* C++ constructor.
*/ */
_ParameterData() noexcept _ParameterData() noexcept
: index(PARAMETER_NULL), : index(PARAMETER_NULL),
@@ -1070,7 +1074,7 @@ typedef struct _ParameterRanges {
float max; float max;


/*! /*!
* Regular step value.
* Regular, single step value.
*/ */
float step; float step;


@@ -1086,7 +1090,7 @@ typedef struct _ParameterRanges {


#ifdef __cplusplus #ifdef __cplusplus
/*! /*!
*
* C++ constructor.
*/ */
_ParameterRanges() noexcept _ParameterRanges() noexcept
: def(0.0f), : def(0.0f),
@@ -1097,7 +1101,7 @@ typedef struct _ParameterRanges {
stepLarge(0.1f) {} stepLarge(0.1f) {}


/*! /*!
* Fix default value range.
* Fix default value within range.
*/ */
void fixDefault() noexcept void fixDefault() noexcept
{ {
@@ -1116,7 +1120,7 @@ typedef struct _ParameterRanges {
} }


/*! /*!
*
* Get a fixed value within range.
*/ */
float getFixedValue(const float& value) const noexcept float getFixedValue(const float& value) const noexcept
{ {
@@ -1142,7 +1146,7 @@ typedef struct _ParameterRanges {
} }


/*! /*!
* Get a value normalized to 0.0<->1.0, but fix range first.
* Get a value normalized to 0.0<->1.0, fixed within range.
*/ */
float getFixedAndNormalizedValue(const float& value) const noexcept float getFixedAndNormalizedValue(const float& value) const noexcept
{ {
@@ -1176,23 +1180,23 @@ typedef struct _ParameterRanges {
*/ */
typedef struct _MidiProgramData { typedef struct _MidiProgramData {
/*! /*!
*
* MIDI bank.
*/ */
uint32_t bank; uint32_t bank;


/*! /*!
*
* MIDI program.
*/ */
uint32_t program; uint32_t program;


/*! /*!
*
* Midi program name.
*/ */
const char* name; const char* name;


#ifdef __cplusplus #ifdef __cplusplus
/*! /*!
*
* C++ constructor.
*/ */
_MidiProgramData() noexcept _MidiProgramData() noexcept
: bank(0), : bank(0),
@@ -1223,6 +1227,9 @@ typedef struct _CustomData {
const char* value; const char* value;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CustomData() noexcept _CustomData() noexcept
: type(nullptr), : type(nullptr),
key(nullptr), key(nullptr),
@@ -1235,23 +1242,26 @@ typedef struct _CustomData {
*/ */
typedef struct _EngineDriverDeviceInfo { typedef struct _EngineDriverDeviceInfo {
/*! /*!
*
* This driver device hints.
* @see EngineDriverHints
*/ */
unsigned int hints; unsigned int hints;


/*! /*!
*
* Available buffer sizes.\n
* Terminated with 0.
*/ */
const uint32_t* bufferSizes; // terminated with 0
const uint32_t* bufferSizes;


/*! /*!
*
* Available sample rates.\n
* Terminated with 0.0.
*/ */
const double* sampleRates; // terminated with 0.0
const double* sampleRates;


#ifdef __cplusplus #ifdef __cplusplus
/*! /*!
*
* C++ constructor.
*/ */
_EngineDriverDeviceInfo() _EngineDriverDeviceInfo()
: hints(0x0), : hints(0x0),


+ 44
- 1
source/carla_backend.py View File

@@ -722,46 +722,89 @@ EngineCallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_uint, c_int, c_int, c_f
# Parameter data. # Parameter data.
class ParameterData(Structure): class ParameterData(Structure):
_fields_ = [ _fields_ = [
("type", c_enum),
# Index as seen by Carla.
("index", c_int32), ("index", c_int32),

# Real index as seen by plugins.
("rindex", c_int32), ("rindex", c_int32),

# This parameter hints.
# @see ParameterHints
("hints", c_uint), ("hints", c_uint),

# Currently mapped MIDI CC.
# A value lower than 0 means invalid or unused.
# Maximum allowed value is 95 (0x5F).
("midiCC", c_int16), ("midiCC", c_int16),

# Currently mapped MIDI channel.
# Counts from 0 to 15.
("midiChannel", c_uint8) ("midiChannel", c_uint8)
] ]


# Parameter ranges. # Parameter ranges.
class ParameterRanges(Structure): class ParameterRanges(Structure):
_fields_ = [ _fields_ = [
# Default value.
("def", c_float), ("def", c_float),

# Minimum value.
("min", c_float), ("min", c_float),

# Maximum value.
("max", c_float), ("max", c_float),

# Regular, single step value.
("step", c_float), ("step", c_float),

# Small step value.
("stepSmall", c_float), ("stepSmall", c_float),

# Large step value.
("stepLarge", c_float) ("stepLarge", c_float)
] ]


# MIDI Program data. # MIDI Program data.
class MidiProgramData(Structure): class MidiProgramData(Structure):
_fields_ = [ _fields_ = [
# MIDI bank.
("bank", c_uint32), ("bank", c_uint32),

# MIDI program.
("program", c_uint32), ("program", c_uint32),

# MIDI program name.
("name", c_char_p) ("name", c_char_p)
] ]


# Custom data, for saving key:value 'dictionaries'. # Custom data, for saving key:value 'dictionaries'.
class CustomData(Structure): class CustomData(Structure):
_fields_ = [ _fields_ = [
# Value type, in URI form.
# @see CustomDataTypes
("type", c_char_p), ("type", c_char_p),

# Key.
# @see CustomDataKeys
("key", c_char_p), ("key", c_char_p),

# Value.
("value", c_char_p) ("value", c_char_p)
] ]


# Engine driver device information. # Engine driver device information.
class EngineDriverDeviceInfo(Structure): class EngineDriverDeviceInfo(Structure):
_fields_ = [ _fields_ = [
# This driver device hints.
# @see EngineDriverHints
("hints", c_uint), ("hints", c_uint),

# Available buffer sizes.
# Terminated with 0.
("bufferSizes", POINTER(c_uint32)), ("bufferSizes", POINTER(c_uint32)),

# Available sample rates.
# Terminated with 0.0.
("sampleRates", POINTER(c_double)) ("sampleRates", POINTER(c_double))
] ]




Loading…
Cancel
Save