Browse Source

More of the same

tags/1.9.4
falkTX 12 years ago
parent
commit
a71a95a5be
5 changed files with 310 additions and 14 deletions
  1. +1
    -1
      source/backend/CarlaBackend.doxygen
  2. +1
    -1
      source/backend/CarlaBackend.h
  3. +199
    -8
      source/backend/CarlaHost.h
  4. +1
    -1
      source/backend/standalone/CarlaStandalone.cpp
  5. +108
    -3
      source/carla_backend.py

+ 1
- 1
source/backend/CarlaBackend.doxygen View File

@@ -41,7 +41,7 @@ DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
TYPEDEF_HIDES_STRUCT = YES
SYMBOL_CACHE_SIZE = 0 SYMBOL_CACHE_SIZE = 0
LOOKUP_CACHE_SIZE = 0 LOOKUP_CACHE_SIZE = 0
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------


+ 1
- 1
source/backend/CarlaBackend.h View File

@@ -1206,7 +1206,7 @@ typedef struct _MidiProgramData {
} MidiProgramData; } MidiProgramData;


/*! /*!
* Custom data, for saving key:value 'dictionaries'.
* Custom data, used for saving key:value 'dictionaries'.
*/ */
typedef struct _CustomData { typedef struct _CustomData {
/*! /*!


+ 199
- 8
source/backend/CarlaHost.h View File

@@ -43,12 +43,10 @@ using CarlaBackend::CarlaEngine;
* *
* The Carla Host API. * The Carla Host API.
* *
* This API makes it possible to use the Carla Backend in a Host application.\n
* All functions are C-compatible, making it possible to use this API in non-C++ hosts.
* 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.\n
* 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.
*
* @{ * @{
*/ */


@@ -59,7 +57,7 @@ using CarlaBackend::CarlaEngine;
*/ */
typedef enum { typedef enum {
/*! /*!
* Debug.
* Debug.\n
* This opcode is undefined and used only for testing purposes. * This opcode is undefined and used only for testing purposes.
*/ */
FILE_CALLBACK_DEBUG = 0, FILE_CALLBACK_DEBUG = 0,
@@ -83,32 +81,96 @@ typedef enum {
typedef const char* (*FileCallbackFunc)(void* ptr, FileCallbackOpcode action, bool isDir, const char* title, const char* filter); typedef const char* (*FileCallbackFunc)(void* ptr, FileCallbackOpcode action, bool isDir, const char* title, const char* filter);


/*! /*!
* Plugin information.
* Information about a loaded plugin.
* @see carla_get_plugin_info() * @see carla_get_plugin_info()
*/ */
typedef struct _CarlaPluginInfo { typedef struct _CarlaPluginInfo {
/*!
* Plugin type.
*/
PluginType type; PluginType type;

/*!
* Plugin category.
*/
PluginCategory category; PluginCategory category;

/*!
* Plugin hints.
* @see PluginHints
*/
unsigned int hints; unsigned int hints;

/*!
* Plugin options available for the user to change.
* @see PluginOptions
*/
unsigned int optionsAvailable; unsigned int optionsAvailable;

/*!
* Plugin options currently enabled.\n
* Some options are enabled but not available, which means they will always be on.
* @see PluginOptions
*/
unsigned int optionsEnabled; unsigned int optionsEnabled;
const char* binary;

/*!
* Plugin filename.\n
* This can be the plugin binary or resource file.
*/
const char* filename;

/*!
* Plugin name.\n
* This name is unique within a Carla instance.
* @see carla_get_real_plugin_name()
*/
const char* name; const char* name;

/*!
* Plugin label or URI.
*/
const char* label; const char* label;

/*!
* Plugin author/maker.
*/
const char* maker; const char* maker;

/*!
* Plugin copyright/license.
*/
const char* copyright; const char* copyright;

/*!
* Icon name for this plugin, in lowercase.\n
* Default is "plugin".
*/
const char* iconName; const char* iconName;

/*!
* Patchbay client Id for this plugin.\n
* When 0, Id is considered invalid or unused.
*/
int patchbayClientId; int patchbayClientId;

/*!
* Plugin unique Id.\n
* This Id is dependant on the plugin type and may sometimes be 0.
*/
long uniqueId; long uniqueId;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CarlaPluginInfo() _CarlaPluginInfo()
: type(CarlaBackend::PLUGIN_NONE), : type(CarlaBackend::PLUGIN_NONE),
category(CarlaBackend::PLUGIN_CATEGORY_NONE), category(CarlaBackend::PLUGIN_CATEGORY_NONE),
hints(0x0), hints(0x0),
optionsAvailable(0x0), optionsAvailable(0x0),
optionsEnabled(0x0), optionsEnabled(0x0),
binary(nullptr),
filename(nullptr),
name(nullptr), name(nullptr),
label(nullptr), label(nullptr),
maker(nullptr), maker(nullptr),
@@ -117,6 +179,9 @@ typedef struct _CarlaPluginInfo {
patchbayClientId(0), patchbayClientId(0),
uniqueId(0) {} uniqueId(0) {}


/*!
* C++ destructor.
*/
~_CarlaPluginInfo() ~_CarlaPluginInfo()
{ {
if (label != nullptr) if (label != nullptr)
@@ -139,24 +204,75 @@ typedef struct _CarlaPluginInfo {
} CarlaPluginInfo; } CarlaPluginInfo;


/*! /*!
* Native plugin information.
* Information about an internal Carla plugin.
* @see carla_get_internal_plugin_info() * @see carla_get_internal_plugin_info()
*/ */
typedef struct _CarlaNativePluginInfo { typedef struct _CarlaNativePluginInfo {
/*!
* Plugin category.
*/
PluginCategory category; PluginCategory category;

/*!
* Plugin hints.
* @see PluginHints
*/
unsigned int hints; unsigned int hints;

/*!
* Number of audio inputs.
*/
uint32_t audioIns; uint32_t audioIns;

/*!
* Number of audio outputs.
*/
uint32_t audioOuts; uint32_t audioOuts;

/*!
* Number of MIDI inputs.
*/
uint32_t midiIns; uint32_t midiIns;

/*!
* Number of MIDI outputs.
*/
uint32_t midiOuts; uint32_t midiOuts;

/*!
* Number of input parameters.
*/
uint32_t parameterIns; uint32_t parameterIns;

/*!
* Number of output parameters.
*/
uint32_t parameterOuts; uint32_t parameterOuts;

/*!
* Plugin name.
*/
const char* name; const char* name;

/*!
* Plugin label.
*/
const char* label; const char* label;

/*!
* Plugin author/maker.
*/
const char* maker; const char* maker;

/*!
* Plugin copyright/license.
*/
const char* copyright; const char* copyright;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CarlaNativePluginInfo() _CarlaNativePluginInfo()
: category(CarlaBackend::PLUGIN_CATEGORY_NONE), : category(CarlaBackend::PLUGIN_CATEGORY_NONE),
hints(0x0), hints(0x0),
@@ -180,11 +296,25 @@ typedef struct _CarlaNativePluginInfo {
* @see carla_get_parameter_count_info() * @see carla_get_parameter_count_info()
*/ */
typedef struct _CarlaPortCountInfo { typedef struct _CarlaPortCountInfo {
/*!
* Number of inputs.
*/
uint32_t ins; uint32_t ins;

/*!
* Number of outputs.
*/
uint32_t outs; uint32_t outs;

/*!
* Total number of ports.
*/
uint32_t total; uint32_t total;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CarlaPortCountInfo() _CarlaPortCountInfo()
: ins(0), : ins(0),
outs(0), outs(0),
@@ -197,18 +327,40 @@ typedef struct _CarlaPortCountInfo {
* @see carla_get_parameter_info() * @see carla_get_parameter_info()
*/ */
typedef struct _CarlaParameterInfo { typedef struct _CarlaParameterInfo {
/*!
* Parameter name.
*/
const char* name; const char* name;

/*!
* Parameter symbol.
*/
const char* symbol; const char* symbol;

/*!
* Parameter unit.
*/
const char* unit; const char* unit;

/*!
* Number of scale points.
* @see CarlaScalePointInfo
*/
uint32_t scalePointCount; uint32_t scalePointCount;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CarlaParameterInfo() _CarlaParameterInfo()
: name(nullptr), : name(nullptr),
symbol(nullptr), symbol(nullptr),
unit(nullptr), unit(nullptr),
scalePointCount(0) {} scalePointCount(0) {}


/*!
* C++ destructor.
*/
~_CarlaParameterInfo() ~_CarlaParameterInfo()
{ {
if (name != nullptr) if (name != nullptr)
@@ -235,14 +387,27 @@ typedef struct _CarlaParameterInfo {
* @see carla_get_parameter_scalepoint_info() * @see carla_get_parameter_scalepoint_info()
*/ */
typedef struct _CarlaScalePointInfo { typedef struct _CarlaScalePointInfo {
/*!
* Scale point value.
*/
float value; float value;

/*!
* Scale point label.
*/
const char* label; const char* label;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CarlaScalePointInfo() _CarlaScalePointInfo()
: value(0.0f), : value(0.0f),
label(nullptr) {} label(nullptr) {}


/*!
* C++ destructor.
*/
~_CarlaScalePointInfo() ~_CarlaScalePointInfo()
{ {
if (label != nullptr) if (label != nullptr)
@@ -259,14 +424,40 @@ typedef struct _CarlaScalePointInfo {
* @see carla_get_transport_info() * @see carla_get_transport_info()
*/ */
typedef struct _CarlaTransportInfo { typedef struct _CarlaTransportInfo {
/*!
* Wherever transport is playing.
*/
bool playing; bool playing;

/*!
* Current transport frame.
*/
uint64_t frame; uint64_t frame;

/*!
* Bar.
*/
int32_t bar; int32_t bar;

/*!
* Beat.
*/
int32_t beat; int32_t beat;

/*!
* Tick.
*/
int32_t tick; int32_t tick;

/*!
* Beats per minute.
*/
double bpm; double bpm;


#ifdef __cplusplus #ifdef __cplusplus
/*!
* C++ constructor.
*/
_CarlaTransportInfo() _CarlaTransportInfo()
: playing(false), : playing(false),
frame(0), frame(0),


+ 1
- 1
source/backend/standalone/CarlaStandalone.cpp View File

@@ -18,7 +18,7 @@
// TODO: // TODO:
// Check carla_stderr2("Engine is not running"); <= prepend func name and args // Check carla_stderr2("Engine is not running"); <= prepend func name and args


#include "CarlaHost.hpp"
#include "CarlaHost.h"
#include "CarlaEngine.hpp" #include "CarlaEngine.hpp"
#include "CarlaPlugin.hpp" #include "CarlaPlugin.hpp"




+ 108
- 3
source/carla_backend.py View File

@@ -777,7 +777,7 @@ class MidiProgramData(Structure):
("name", c_char_p) ("name", c_char_p)
] ]


# Custom data, for saving key:value 'dictionaries'.
# Custom data, used for saving key:value 'dictionaries'.
class CustomData(Structure): class CustomData(Structure):
_fields_ = [ _fields_ = [
# Value type, in URI form. # Value type, in URI form.
@@ -871,80 +871,181 @@ FILE_CALLBACK_SAVE = 2
# @see FileCallbackOpcode # @see FileCallbackOpcode
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)


# Information about a loaded plugin.
# @see carla_get_plugin_info()
class CarlaPluginInfo(Structure): class CarlaPluginInfo(Structure):
_fields_ = [ _fields_ = [
# Plugin type.
("type", c_enum), ("type", c_enum),

# Plugin category.
("category", c_enum), ("category", c_enum),

# Plugin hints.
# @see PluginHints
("hints", c_uint), ("hints", c_uint),

# Plugin options available for the user to change.
# @see PluginOptions
("optionsAvailable", c_uint), ("optionsAvailable", c_uint),

# Plugin options currently enabled.\n
# Some options are enabled but not available, which means they will always be on.
# @see PluginOptions
("optionsEnabled", c_uint), ("optionsEnabled", c_uint),
("binary", c_char_p),

# Plugin filename.\n
# This can be the plugin binary or resource file.
("filename", c_char_p),

# Plugin name.\n
# This name is unique within a Carla instance.
# @see carla_get_real_plugin_name()
("name", c_char_p), ("name", c_char_p),

# Plugin label or URI.
("label", c_char_p), ("label", c_char_p),

# Plugin author/maker.
("maker", c_char_p), ("maker", c_char_p),

# Plugin copyright/license.
("copyright", c_char_p), ("copyright", c_char_p),

# Icon name for this plugin, in lowercase.\n
# Default is "plugin".
("iconName", c_char_p), ("iconName", c_char_p),

# Patchbay client Id for this plugin.\n
# When 0, Id is considered invalid or unused.
("patchbayClientId", c_int), ("patchbayClientId", c_int),

# Plugin unique Id.\n
# This Id is dependant on the plugin type and may sometimes be 0.
("uniqueId", c_long) ("uniqueId", c_long)
] ]


# Information about an internal Carla plugin.
# @see carla_get_internal_plugin_info()
class CarlaNativePluginInfo(Structure): class CarlaNativePluginInfo(Structure):
_fields_ = [ _fields_ = [
# Plugin category.
("category", c_enum), ("category", c_enum),

# Plugin hints.
# @see PluginHints
("hints", c_uint), ("hints", c_uint),

# Number of audio inputs.
("audioIns", c_uint32), ("audioIns", c_uint32),

# Number of audio outputs.
("audioOuts", c_uint32), ("audioOuts", c_uint32),

# Number of MIDI inputs.
("midiIns", c_uint32), ("midiIns", c_uint32),

# Number of MIDI outputs.
("midiOuts", c_uint32), ("midiOuts", c_uint32),

# Number of input parameters.
("parameterIns", c_uint32), ("parameterIns", c_uint32),

# Number of output parameters.
("parameterOuts", c_uint32), ("parameterOuts", c_uint32),

# Plugin name.
("name", c_char_p), ("name", c_char_p),

# Plugin label.
("label", c_char_p), ("label", c_char_p),

# Plugin author/maker.
("maker", c_char_p), ("maker", c_char_p),

# Plugin copyright/license.
("copyright", c_char_p) ("copyright", c_char_p)
] ]


# Port count information, used for Audio and MIDI ports and parameters.
# @see carla_get_audio_port_count_info()
# @see carla_get_midi_port_count_info()
# @see carla_get_parameter_count_info()
class CarlaPortCountInfo(Structure): class CarlaPortCountInfo(Structure):
_fields_ = [ _fields_ = [
# Number of inputs.
("ins", c_uint32), ("ins", c_uint32),

# Number of outputs.
("outs", c_uint32), ("outs", c_uint32),

# Total number of ports.
("total", c_uint32) ("total", c_uint32)
] ]


# Parameter information.
# @see carla_get_parameter_info()
class CarlaParameterInfo(Structure): class CarlaParameterInfo(Structure):
_fields_ = [ _fields_ = [
# Parameter name.
("name", c_char_p), ("name", c_char_p),

# Parameter symbol.
("symbol", c_char_p), ("symbol", c_char_p),

# Parameter unit.
("unit", c_char_p), ("unit", c_char_p),

# Number of scale points.
# @see CarlaScalePointInfo
("scalePointCount", c_uint32) ("scalePointCount", c_uint32)
] ]


# Parameter scale point information.
# @see carla_get_parameter_scalepoint_info()
class CarlaScalePointInfo(Structure): class CarlaScalePointInfo(Structure):
_fields_ = [ _fields_ = [
# Scale point value.
("value", c_float), ("value", c_float),

# Scale point label.
("label", c_char_p) ("label", c_char_p)
] ]


# Transport information.
# @see carla_get_transport_info()
class CarlaTransportInfo(Structure): class CarlaTransportInfo(Structure):
_fields_ = [ _fields_ = [
# Wherever transport is playing.
("playing", c_bool), ("playing", c_bool),

# Current transport frame.
("frame", c_uint64), ("frame", c_uint64),

# Bar
("bar", c_int32), ("bar", c_int32),

# Beat
("beat", c_int32), ("beat", c_int32),

# Tick
("tick", c_int32), ("tick", c_int32),

# Beats per minute.
("bpm", c_double) ("bpm", c_double)
] ]


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Carla Host API (Python compatible stuff) # Carla Host API (Python compatible stuff)


# @see CarlaPluginInfo
PyCarlaPluginInfo = { PyCarlaPluginInfo = {
'type': PLUGIN_NONE, 'type': PLUGIN_NONE,
'category': PLUGIN_CATEGORY_NONE, 'category': PLUGIN_CATEGORY_NONE,
'hints': 0x0, 'hints': 0x0,
'optionsAvailable': 0x0, 'optionsAvailable': 0x0,
'optionsEnabled': 0x0, 'optionsEnabled': 0x0,
'binary': None,
'filename': None,
'name': None, 'name': None,
'label': None, 'label': None,
'maker': None, 'maker': None,
@@ -954,12 +1055,14 @@ PyCarlaPluginInfo = {
'uniqueId': 0 'uniqueId': 0
} }


# @see CarlaPortCountInfo
PyCarlaPortCountInfo = { PyCarlaPortCountInfo = {
'ins': 0, 'ins': 0,
'outs': 0, 'outs': 0,
'total': 0 'total': 0
} }


# @see CarlaParameterInfo
PyCarlaParameterInfo = { PyCarlaParameterInfo = {
'name': None, 'name': None,
'symbol': None, 'symbol': None,
@@ -967,11 +1070,13 @@ PyCarlaParameterInfo = {
'scalePointCount': 0, 'scalePointCount': 0,
} }


# @see CarlaScalePointInfo
PyCarlaScalePointInfo = { PyCarlaScalePointInfo = {
'value': 0.0, 'value': 0.0,
'label': None 'label': None
} }


# @see CarlaTransportInfo
PyCarlaTransportInfo = { PyCarlaTransportInfo = {
"playing": False, "playing": False,
"frame": 0, "frame": 0,


Loading…
Cancel
Save