@@ -144,7 +144,7 @@ int jack_process(jack_nframes_t nframes, void* ptr) | |||||
} | } | ||||
#else | #else | ||||
// MIDI Out | // MIDI Out | ||||
if (handlePtr->midiOutCount > 0 && transportState == JackTransportRolling) | |||||
if (transportState == JackTransportRolling && handlePtr->midiOutCount > 0) | |||||
{ | { | ||||
ListHead* entryPtr; | ListHead* entryPtr; | ||||
CaitlibOutPort* outPortPtr; | CaitlibOutPort* outPortPtr; | ||||
@@ -22,15 +22,15 @@ | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#else | #else | ||||
#include <stdbool.h> | |||||
# include <stdbool.h> | |||||
#endif | #endif | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#ifdef _WIN32 | #ifdef _WIN32 | ||||
#define CAITLIB_EXPORT __declspec (dllexport) | |||||
# define CAITLIB_EXPORT __declspec (dllexport) | |||||
#else | #else | ||||
#define CAITLIB_EXPORT __attribute__ ((visibility("default"))) | |||||
# define CAITLIB_EXPORT __attribute__ ((visibility("default"))) | |||||
#endif | #endif | ||||
/*! | /*! | ||||
@@ -112,7 +112,7 @@ typedef struct _MidiEvent | |||||
#ifndef DOXYGEN | #ifndef DOXYGEN | ||||
// padding for future events | // padding for future events | ||||
struct _MidiEventPadding { | struct _MidiEventPadding { | ||||
uint8_t pad[32]; | |||||
uint8_t pad[128]; | |||||
} __padding; | } __padding; | ||||
#endif | #endif | ||||
} data; | } data; | ||||
@@ -510,7 +510,7 @@ enum ProcessMode { | |||||
* | * | ||||
* \see set_callback_function() | * \see set_callback_function() | ||||
*/ | */ | ||||
typedef void (*CallbackFunc)(void* ptr, CallbackType action, unsigned short pluginId, int value1, int value2, double value3); | |||||
typedef void (*CallbackFunc)(void* ptr, CallbackType action, unsigned short pluginId, int value1, int value2, double value3, const char* valueStr); | |||||
struct ParameterData { | struct ParameterData { | ||||
ParameterType type; | ParameterType type; | ||||
@@ -1023,12 +1023,12 @@ void CarlaEngine::setOutputPeak(const unsigned short pluginId, const unsigned sh | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// Callback | // Callback | ||||
void CarlaEngine::callback(const CallbackType action, const unsigned short pluginId, const int value1, const int value2, const double value3) | |||||
void CarlaEngine::callback(const CallbackType action, const unsigned short pluginId, const int value1, const int value2, const double value3, const char* const valueStr) | |||||
{ | { | ||||
qDebug("CarlaEngine::callback(%s, %i, %i, %i, %f)", CallbackType2Str(action), pluginId, value1, value2, value3); | |||||
qDebug("CarlaEngine::callback(%s, %i, %i, %i, %f, \"%s\")", CallbackType2Str(action), pluginId, value1, value2, value3, valueStr); | |||||
if (m_callback) | if (m_callback) | ||||
m_callback(m_callbackPtr, action, pluginId, value1, value2, value3); | |||||
m_callback(m_callbackPtr, action, pluginId, value1, value2, value3, valueStr); | |||||
} | } | ||||
void CarlaEngine::setCallback(const CallbackFunc func, void* const ptr) | void CarlaEngine::setCallback(const CallbackFunc func, void* const ptr) | ||||
@@ -609,7 +609,7 @@ public: | |||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
// Callback | // Callback | ||||
void callback(const CallbackType action, const unsigned short pluginId, const int value1, const int value2, const double value3); | |||||
void callback(const CallbackType action, const unsigned short pluginId, const int value1, const int value2, const double value3, const char* const valueStr); | |||||
void setCallback(const CallbackFunc func, void* const ptr); | void setCallback(const CallbackFunc func, void* const ptr); | ||||
// ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
@@ -36,7 +36,7 @@ | |||||
# define nullptr (0) | # define nullptr (0) | ||||
#endif | #endif | ||||
// Common includes and macros | |||||
// Common includes | |||||
#ifdef Q_OS_WIN | #ifdef Q_OS_WIN | ||||
# include <winsock2.h> | # include <winsock2.h> | ||||
# include <windows.h> | # include <windows.h> | ||||
@@ -82,7 +82,7 @@ | |||||
# define BINARY_NATIVE BINARY_WIN64 | # define BINARY_NATIVE BINARY_WIN64 | ||||
# else | # else | ||||
# define BINARY_NATIVE BINARY_WIN32 | # define BINARY_NATIVE BINARY_WIN32 | ||||
# endif | |||||
# endif | |||||
#else | #else | ||||
# warning Unknown binary type | # warning Unknown binary type | ||||
# define BINARY_NATIVE BINARY_OTHER | # define BINARY_NATIVE BINARY_OTHER | ||||
@@ -13,18 +13,22 @@ BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I../carla-includes -I../carla- | |||||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) | BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) | ||||
ifeq ($(HAVE_ZYN_DEPS),true) | ifeq ($(HAVE_ZYN_DEPS),true) | ||||
BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX | |||||
ZYN_CXX_FLAGS = $(shell pkg-config --cflags fftw3 mxml) | ZYN_CXX_FLAGS = $(shell pkg-config --cflags fftw3 mxml) | ||||
endif | endif | ||||
# Simple plugins | |||||
OBJS = \ | OBJS = \ | ||||
bypass.o \ | bypass.o \ | ||||
midi-split.o | midi-split.o | ||||
# DISTRHO plugins | |||||
OBJS += \ | OBJS += \ | ||||
distrho-3bandeq.o \ | distrho-3bandeq.o \ | ||||
distrho-3bandsplitter.o \ | distrho-3bandsplitter.o \ | ||||
distrho-pugl.o | distrho-pugl.o | ||||
# ZynAddSubFX | |||||
ifeq ($(HAVE_ZYN_DEPS),true) | ifeq ($(HAVE_ZYN_DEPS),true) | ||||
OBJS += zynaddsubfx.o zynaddsubfx-src.o | OBJS += zynaddsubfx.o zynaddsubfx-src.o | ||||
endif | endif | ||||
@@ -105,6 +105,7 @@ typedef struct _MidiProgram { | |||||
} MidiProgram; | } MidiProgram; | ||||
typedef struct _TimeInfoBBT { | typedef struct _TimeInfoBBT { | ||||
bool valid; | |||||
int32_t bar; | int32_t bar; | ||||
int32_t beat; | int32_t beat; | ||||
int32_t tick; | int32_t tick; | ||||
@@ -119,19 +120,19 @@ typedef struct _TimeInfo { | |||||
bool playing; | bool playing; | ||||
uint32_t frame; | uint32_t frame; | ||||
uint32_t time; | uint32_t time; | ||||
uint32_t valid; | |||||
TimeInfoBBT bbt; | TimeInfoBBT bbt; | ||||
} TimeInfo; | } TimeInfo; | ||||
typedef struct _HostDescriptor { | typedef struct _HostDescriptor { | ||||
HostHandle handle; | HostHandle handle; | ||||
uint32_t (*get_buffer_size)(HostHandle handle); | uint32_t (*get_buffer_size)(HostHandle handle); | ||||
double (*get_sample_rate)(HostHandle handle); | double (*get_sample_rate)(HostHandle handle); | ||||
const TimeInfo* (*get_time_info)(HostHandle handle); | const TimeInfo* (*get_time_info)(HostHandle handle); | ||||
bool (*write_midi_event)(HostHandle handle, MidiEvent* event); | bool (*write_midi_event)(HostHandle handle, MidiEvent* event); | ||||
void (*ui_parameter_changed)(HostHandle handle, uint32_t index, float value); | void (*ui_parameter_changed)(HostHandle handle, uint32_t index, float value); | ||||
//void (*ui_midi_program_changed)(HostHandle handle, uint32_t bank, uint32_t program); | |||||
void (*ui_midi_program_changed)(HostHandle handle, uint32_t bank, uint32_t program); | |||||
void (*ui_custom_data_changed)(HostHandle handle, const char* key, const char* value); | void (*ui_custom_data_changed)(HostHandle handle, const char* key, const char* value); | ||||
void (*ui_closed)(HostHandle handle); | void (*ui_closed)(HostHandle handle); | ||||
} HostDescriptor; | } HostDescriptor; | ||||
@@ -183,21 +184,25 @@ typedef struct _PluginDescriptor { | |||||
// Register plugin | // Register plugin | ||||
void carla_register_native_plugin(const PluginDescriptor* desc); | void carla_register_native_plugin(const PluginDescriptor* desc); | ||||
// Available plugins | |||||
// Simple plugins | |||||
void carla_register_native_plugin_bypass(); | void carla_register_native_plugin_bypass(); | ||||
void carla_register_native_plugin_midiSplit(); | void carla_register_native_plugin_midiSplit(); | ||||
void carla_register_native_plugin_zynaddsubfx(); | |||||
// DISTRHO based plugins | |||||
// DISTRHO plugins | |||||
void carla_register_native_plugin_3BandEQ(); | void carla_register_native_plugin_3BandEQ(); | ||||
void carla_register_native_plugin_3BandSplitter(); | void carla_register_native_plugin_3BandSplitter(); | ||||
#ifdef WANT_ZYNADDSUBFX | |||||
// ZynAddSubFX | |||||
void carla_register_native_plugin_zynaddsubfx(); | |||||
#endif | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
/**@}*/ | /**@}*/ | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} /* extern "C" */ | |||||
} // extern "C" | |||||
#endif | #endif | ||||
#endif // CARLA_NATIVE_H | #endif // CARLA_NATIVE_H |
@@ -11,10 +11,10 @@ DEFINES += QTCREATOR_TEST | |||||
DEFINES += WANT_ZYNADDSUBFX WANT_ZYNADDSUBFX_GUI | DEFINES += WANT_ZYNADDSUBFX WANT_ZYNADDSUBFX_GUI | ||||
PKGCONFIG = fftw3 mxml ntk ntk_images | |||||
PKGCONFIG = fftw3 mxml | |||||
TARGET = carla_native | TARGET = carla_native | ||||
TEMPLATE = app #lib | |||||
TEMPLATE = app | |||||
VERSION = 0.5.0 | VERSION = 0.5.0 | ||||
SOURCES = \ | SOURCES = \ | ||||
@@ -42,9 +42,6 @@ INCLUDEPATH = . distrho \ | |||||
../carla-utils \ | ../carla-utils \ | ||||
../distrho-plugin-toolkit | ../distrho-plugin-toolkit | ||||
# FIX | |||||
INCLUDEPATH += /usr/include/ntk | |||||
LIBS = -lGL | LIBS = -lGL | ||||
QMAKE_CFLAGS *= -std=c99 | QMAKE_CFLAGS *= -std=c99 | ||||
@@ -259,7 +259,7 @@ public: | |||||
return contains(str.buffer); | return contains(str.buffer); | ||||
} | } | ||||
bool isDigit(size_t pos) const | |||||
bool isDigit(const size_t pos) const | |||||
{ | { | ||||
if (pos >= length()) | if (pos >= length()) | ||||
return false; | return false; | ||||
@@ -275,7 +275,7 @@ public: | |||||
buffer = ::strdup(""); | buffer = ::strdup(""); | ||||
} | } | ||||
void replace(char before, char after) | |||||
void replace(const char before, const char after) | |||||
{ | { | ||||
for (size_t i=0, len = ::strlen(buffer); i < len; i++) | for (size_t i=0, len = ::strlen(buffer); i < len; i++) | ||||
{ | { | ||||
@@ -284,7 +284,8 @@ public: | |||||
} | } | ||||
} | } | ||||
void truncate(unsigned int n) | |||||
// FIXME? | |||||
void truncate(const unsigned int n) | |||||
{ | { | ||||
for (size_t i=n, len = ::strlen(buffer); i < len; i++) | for (size_t i=n, len = ::strlen(buffer); i < len; i++) | ||||
buffer[i] = 0; | buffer[i] = 0; | ||||
@@ -294,7 +295,7 @@ public: | |||||
{ | { | ||||
for (size_t i=0, len = ::strlen(buffer); i < len; i++) | for (size_t i=0, len = ::strlen(buffer); i < len; i++) | ||||
{ | { | ||||
if ((buffer[i] >= '0' && buffer[i] <= '9') || (buffer[i] >= 'A' && buffer[i] <= 'Z') || (buffer[i] >= 'a' && buffer[i] <= 'z')) | |||||
if ((buffer[i] >= '0' && buffer[i] <= '9') || (buffer[i] >= 'A' && buffer[i] <= 'Z') || (buffer[i] >= 'a' && buffer[i] <= 'z') || buffer[i] == '_') | |||||
continue; | continue; | ||||
buffer[i] = '_'; | buffer[i] = '_'; | ||||
@@ -327,7 +328,7 @@ public: | |||||
return buffer; | return buffer; | ||||
} | } | ||||
char& operator[](int pos) | |||||
char& operator[](const unsigned int pos) | |||||
{ | { | ||||
return buffer[pos]; | return buffer[pos]; | ||||
} | } | ||||
@@ -1134,7 +1134,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
self.connect(self.act_help_about_qt, SIGNAL("triggered()"), app, SLOT("aboutQt()")) | self.connect(self.act_help_about_qt, SIGNAL("triggered()"), app, SLOT("aboutQt()")) | ||||
self.connect(self, SIGNAL("SIGUSR1()"), SLOT("slot_handleSIGUSR1()")) | self.connect(self, SIGNAL("SIGUSR1()"), SLOT("slot_handleSIGUSR1()")) | ||||
self.connect(self, SIGNAL("DebugCallback(int, int, int, double)"), SLOT("slot_handleDebugCallback(int, int, int, double)")) | |||||
self.connect(self, SIGNAL("DebugCallback(int, int, int, double, QString)"), SLOT("slot_handleDebugCallback(int, int, int, double, QString)")) | |||||
self.connect(self, SIGNAL("ParameterValueCallback(int, int, double)"), SLOT("slot_handleParameterValueCallback(int, int, double)")) | self.connect(self, SIGNAL("ParameterValueCallback(int, int, double)"), SLOT("slot_handleParameterValueCallback(int, int, double)")) | ||||
self.connect(self, SIGNAL("ParameterMidiChannelCallback(int, int, int)"), SLOT("slot_handleParameterMidiChannelCallback(int, int, int)")) | self.connect(self, SIGNAL("ParameterMidiChannelCallback(int, int, int)"), SLOT("slot_handleParameterMidiChannelCallback(int, int, int)")) | ||||
self.connect(self, SIGNAL("ParameterMidiCcCallback(int, int, int)"), SLOT("slot_handleParameterMidiCcCallback(int, int, int)")) | self.connect(self, SIGNAL("ParameterMidiCcCallback(int, int, int)"), SLOT("slot_handleParameterMidiCcCallback(int, int, int)")) | ||||
@@ -1285,9 +1285,9 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
print("Got SIGUSR1 -> Saving project now") | print("Got SIGUSR1 -> Saving project now") | ||||
QTimer.singleShot(0, self, SLOT("slot_file_save()")) | QTimer.singleShot(0, self, SLOT("slot_file_save()")) | ||||
@pyqtSlot(int, int, int, float) | |||||
def slot_handleDebugCallback(self, plugin_id, value1, value2, value3): | |||||
print("DEBUG :: %i, %i, %i, %f)" % (plugin_id, value1, value2, value3)) | |||||
@pyqtSlot(int, int, int, float, str) | |||||
def slot_handleDebugCallback(self, plugin_id, value1, value2, value3, valueStr): | |||||
print("DEBUG :: %i, %i, %i, %f, \"%s\")" % (plugin_id, value1, value2, value3, valueStr)) | |||||
@pyqtSlot(int, int, float) | @pyqtSlot(int, int, float) | ||||
def slot_handleParameterValueCallback(self, pluginId, parameterId, value): | def slot_handleParameterValueCallback(self, pluginId, parameterId, value): | ||||
@@ -1981,12 +1981,12 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
# ------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------ | ||||
def callback_function(ptr, action, pluginId, value1, value2, value3): | |||||
def callback_function(ptr, action, pluginId, value1, value2, value3, valueStr): | |||||
if pluginId< 0 or pluginId >= MAX_PLUGINS or not Carla.gui: | if pluginId< 0 or pluginId >= MAX_PLUGINS or not Carla.gui: | ||||
return | return | ||||
if action == CALLBACK_DEBUG: | if action == CALLBACK_DEBUG: | ||||
Carla.gui.emit(SIGNAL("DebugCallback(int, int, int, double)"), pluginId, value1, value2, value3) | |||||
Carla.gui.emit(SIGNAL("DebugCallback(int, int, int, double, QString)"), pluginId, value1, value2, value3, cString(valueStr)) | |||||
elif action == CALLBACK_PARAMETER_VALUE_CHANGED: | elif action == CALLBACK_PARAMETER_VALUE_CHANGED: | ||||
Carla.gui.emit(SIGNAL("ParameterValueCallback(int, int, double)"), pluginId, value1, value3) | Carla.gui.emit(SIGNAL("ParameterValueCallback(int, int, double)"), pluginId, value1, value3) | ||||
elif action == CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED: | elif action == CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED: | ||||
@@ -785,7 +785,7 @@ class GuiInfo(Structure): | |||||
("resizable", c_bool), | ("resizable", c_bool), | ||||
] | ] | ||||
CallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_ushort, c_int, c_int, c_double) | |||||
CallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_ushort, c_int, c_int, c_double, c_char_p) | |||||
# ------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------ | ||||
# Backend C++ -> Python object | # Backend C++ -> Python object | ||||