@@ -87,6 +87,7 @@ const unsigned int PLUGIN_CAN_VOL = 0x20; | |||
const unsigned int PLUGIN_CAN_BALANCE = 0x40; | |||
enum BinaryType { | |||
BINARY_NONE = 0, | |||
BINARY_UNIX32 = 1, | |||
BINARY_UNIX64 = 2, | |||
BINARY_WIN32 = 3, | |||
@@ -378,12 +378,16 @@ typedef struct _DSSI_Descriptor { | |||
/** | |||
* set_custom_data() | |||
*/ | |||
int (*set_custom_data)(LADSPA_Handle Instance, void *Data, unsigned long DataLength); | |||
int (*set_custom_data)(LADSPA_Handle Instance, | |||
void *Data, | |||
unsigned long DataLength); | |||
/** | |||
* get_custom_data() | |||
*/ | |||
int (*get_custom_data)(LADSPA_Handle Instance, void **Data, unsigned long *DataLength); | |||
int (*get_custom_data)(LADSPA_Handle Instance, | |||
void **Data, | |||
unsigned long *DataLength); | |||
} DSSI_Descriptor; | |||
@@ -20,11 +20,11 @@ | |||
import json, os, sys | |||
#from PyQt4.QtCore import Qt, QSettings, QThread, QTimer, QVariant, SIGNAL, SLOT | |||
#from PyQt4.QtGui import QApplication, QColor, QCursor, QFileDialog, QFontMetrics, QInputDialog, QMenu, QPainter, QPixmap, QVBoxLayout | |||
#from PyQt4.QtXml import QDomDocument | |||
from time import sleep | |||
#from sip import unwrapinstance | |||
from PyQt4.QtCore import pyqtSlot, Qt, QSettings, QThread | |||
from PyQt4.QtGui import QApplication, QDialog, QFrame, QMainWindow, QTableWidgetItem, QWidget | |||
from PyQt4.QtXml import QDomDocument | |||
# Imports (Custom Stuff) | |||
import ui_carla, ui_carla_about, ui_carla_database, ui_carla_edit, ui_carla_parameter, ui_carla_plugin, ui_carla_refresh | |||
@@ -77,7 +77,7 @@ save_state_parameter = { | |||
} | |||
save_state_custom_data = { | |||
'type': CUSTOM_DATA_INVALID, | |||
'type': "", | |||
'key': "", | |||
'value': "" | |||
} | |||
@@ -2668,7 +2668,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
self.settings_db = QSettings("Cadence", "Carla-Database") | |||
self.loadSettings() | |||
#self.loadRDFs() | |||
self.loadRDFs() | |||
self.setStyleSheet(""" | |||
QWidget#centralwidget { | |||
@@ -2761,11 +2761,9 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
#elif (action == CALLBACK_QUIT): | |||
#self.emit(SIGNAL("QuitCallback()")) | |||
#return 0 | |||
#def handleSIGUSR1(self): | |||
#print "Got SIGUSR1 -> Saving project now" | |||
#self.func_file_save() | |||
def handleSIGUSR1(self): | |||
print("Got SIGUSR1 -> Saving project now") | |||
QTimer.singleShot(0, self, SLOT("slot_file_save()")) | |||
#def handleDebugCallback(self, plugin_id, value1, value2, value3): | |||
#print "DEBUG ::", plugin_id, value1, value2, value3 | |||
@@ -2857,12 +2855,12 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
#CustomMessageBox(self, QMessageBox.Warning, self.tr("Warning"), self.tr("JACK has been stopped or crashed.\nPlease start JACK and restart Carla"), | |||
#"You may want to save your session now...", QMessageBox.Ok, QMessageBox.Ok) | |||
#def func_add_plugin(self, ptype, filename, label, extra_stuff, activate): | |||
#new_plugin_id = NativeHost.add_plugin(ptype, filename, label, extra_stuff) | |||
def add_plugin(self, btype, ptype, filename, label, extra_stuff, activate): | |||
new_plugin_id = NativeHost.add_plugin(btype, ptype, filename, label, extra_stuff) | |||
#if (new_plugin_id < 0): | |||
#CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to load plugin"), | |||
#NativeHost.get_last_error(), QMessageBox.Ok, QMessageBox.Ok) | |||
if (new_plugin_id < 0): | |||
CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to load plugin"), | |||
NativeHost.get_last_error(), QMessageBox.Ok, QMessageBox.Ok) | |||
#else: | |||
#pwidget = PluginWidget(self, new_plugin_id) | |||
#self.w_plugins.layout().addWidget(pwidget) | |||
@@ -2872,7 +2870,7 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
#if (activate): | |||
#pwidget.set_active(True, True) | |||
#return new_plugin_id | |||
return new_plugin_id | |||
def remove_plugin(self, plugin_id, showError): | |||
pwidget = self.m_plugin_list[plugin_id] | |||
@@ -2899,22 +2897,22 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
else: | |||
self.act_plugin_remove_all.setEnabled(False) | |||
#def get_extra_stuff(self, plugin): | |||
#ptype = plugin['type'] | |||
def get_extra_stuff(self, plugin): | |||
ptype = plugin['type'] | |||
#if (ptype == PLUGIN_LADSPA): | |||
#p_id = long(plugin['id']) | |||
#for rdf_item in self.ladspa_rdf_list: | |||
#if (rdf_item.UniqueID == p_id): | |||
#return pointer(rdf_item) | |||
#else: | |||
#return c_nullptr | |||
if (ptype == PLUGIN_LADSPA): | |||
unique_id = plugin['unique_id'] | |||
for rdf_item in self.ladspa_rdf_list: | |||
if (rdf_item.UniqueID == unique_id): | |||
return pointer(rdf_item) | |||
else: | |||
return c_nullptr | |||
#elif (ptype == PLUGIN_DSSI): | |||
#if (plugin['hints'] & PLUGIN_HAS_GUI): | |||
#return findDSSIGUI(plugin['binary'], plugin['name'], plugin['label']) | |||
#else: | |||
#return c_nullptr | |||
elif (ptype == PLUGIN_DSSI): | |||
if (plugin['hints'] & PLUGIN_HAS_GUI): | |||
return findDSSIGUI(plugin['binary'], plugin['name'], plugin['label']) | |||
else: | |||
return c_nullptr | |||
#elif (ptype == PLUGIN_LV2): | |||
#p_uri = plugin['label'] | |||
@@ -2937,8 +2935,8 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
#self.winvst_info.aouts = plugin['audio.outs'] | |||
#return pointer(self.winvst_info) | |||
#else: | |||
#return c_nullptr | |||
else: | |||
return c_nullptr | |||
def save_project(self): | |||
content = ("<?xml version='1.0' encoding='UTF-8'?>\n" | |||
@@ -2975,13 +2973,13 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
QMessageBox.critical(self, self.tr("Error"), self.tr("Failed to load project file")) | |||
return | |||
#xml = QDomDocument() | |||
#xml.setContent(project_read) | |||
xml = QDomDocument() | |||
xml.setContent(project_read) | |||
#xml_node = xml.documentElement() | |||
#if (xml_node.tagName() != "CARLA-PROJECT"): | |||
#QMessageBox.critical(self, self.tr("Error"), self.tr("Not a valid Carla project file")) | |||
#return | |||
xml_node = xml.documentElement() | |||
if (xml_node.tagName() != "CARLA-PROJECT"): | |||
QMessageBox.critical(self, self.tr("Error"), self.tr("Not a valid Carla project file")) | |||
return | |||
#failed_plugins = [] | |||
#x_save_state_dicts = [] | |||
@@ -3095,20 +3093,20 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
#print "----------- FAILED TO LOAD!! ->", failed_plugins | |||
## TODO - display error | |||
#def loadRDFs(self): | |||
## Save RDF info for later | |||
#if (haveRDF): | |||
#SettingsDir = os.path.join(HOME, ".config", "Cadence") | |||
def loadRDFs(self): | |||
# Save RDF info for later | |||
if (haveRDF): | |||
SettingsDir = os.path.join(HOME, ".config", "Cadence") | |||
#fr_ladspa_file = os.path.join(SettingsDir, "ladspa_rdf.db") | |||
#if (os.path.exists(fr_ladspa_file)): | |||
#fr_ladspa = open(fr_ladspa_file, 'r') | |||
#if (fr_ladspa): | |||
#try: | |||
#self.ladspa_rdf_list = ladspa_rdf.get_c_ladspa_rdfs(json.load(fr_ladspa)) | |||
#except: | |||
#self.ladspa_rdf_list = [] | |||
#fr_ladspa.close() | |||
fr_ladspa_file = os.path.join(SettingsDir, "ladspa_rdf.db") | |||
if (os.path.exists(fr_ladspa_file)): | |||
fr_ladspa = open(fr_ladspa_file, 'r') | |||
if (fr_ladspa): | |||
try: | |||
self.ladspa_rdf_list = ladspa_rdf.get_c_ladspa_rdfs(json.load(fr_ladspa)) | |||
except: | |||
self.ladspa_rdf_list = [] | |||
fr_ladspa.close() | |||
#fr_lv2_file = os.path.join(SettingsDir, "lv2_rdf.db") | |||
#if (os.path.exists(fr_lv2_file)): | |||
@@ -3120,8 +3118,8 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
#self.lv2_rdf_list = [] | |||
#fr_lv2.close() | |||
#else: | |||
#self.ladspa_rdf_list = [] | |||
else: | |||
self.ladspa_rdf_list = [] | |||
#self.lv2_rdf_list = [] | |||
@pyqtSlot() | |||
@@ -3163,13 +3161,12 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||
def slot_plugin_add(self): | |||
dialog = PluginDatabaseW(self) | |||
if (dialog.exec_()): | |||
pass | |||
#plugin = dialog.plugin_to_add | |||
#fname = plugin['binary'] | |||
#label = plugin['label'] | |||
#ptype = plugin['type'] | |||
#extra_stuff = self.get_extra_stuff(plugin) | |||
#self.func_add_plugin(ptype, fname, label, extra_stuff, True) | |||
btype = dialog.ret_plugin['build'] | |||
ptype = dialog.ret_plugin['type'] | |||
filename = dialog.ret_plugin['binary'] | |||
label = dialog.ret_plugin['label'] | |||
extra_stuff = self.get_extra_stuff(dialog.ret_plugin) | |||
self.add_plugin(btype, ptype, filename, label, extra_stuff, True) | |||
@pyqtSlot() | |||
def slot_remove_all(self): | |||
@@ -0,0 +1,36 @@ | |||
#!/usr/bin/make -f | |||
# Makefile for Cadence # | |||
# ---------------------- # | |||
# Created by falkTX | |||
# | |||
CC ?= gcc | |||
CXX ?= g++ | |||
CARLA_BUILD_FLAGS = -Wall -std=c++0x -fPIC -I. -Ivestige `pkg-config --cflags jack fluidsynth liblo QtCore QtGui` $(CXXFLAGS) | |||
CARLA_BUILD_FLAGS += -DDEBUG -O0 -g | |||
# CARLA_BUILD_FLAGS += -DNDEBUG -DQT_NO_DEBUG -DQT_NO_DEBUG_STREAM -DQT_NO_DEBUG_OUTPUT -O2 -fvisibility=hidden -ffast-math -fomit-frame-pointer -mtune=generic -msse | |||
CARLA_LINK_FLAGS = -shared -fPIC -ldl `pkg-config --libs jack fluidsynth liblo QtCore QtGui` $(LDFLAGS) | |||
OBJS = carla_backend.o | |||
# jack.o osc.o misc.o ladspa.o dssi.o lv2.o vst.o winvst.o sf2.o lv2-rtmempool/rtmempool.o | |||
all: carla_backend.so | |||
carla_backend.so: $(OBJS) | |||
$(CXX) $(OBJS) $(CARLA_LINK_FLAGS) -o carla_backend.so | |||
# carla_backend.dll: $(OBJS) windows.def | |||
# $(CXX) $(OBJS) windows.def $(CARLA_LINK_FLAGS) -o carla_backend.dll | |||
.c.o: | |||
$(CC) -c $< $(CARLA_BUILD_FLAGS) -o $@ | |||
.cpp.o: | |||
$(CXX) -c $< $(CARLA_BUILD_FLAGS) -o $@ | |||
clean: | |||
rm -f *.o *.so *.dll | |||
# lv2-rtmempool/*.o | |||
@@ -0,0 +1,303 @@ | |||
/* | |||
* JACK Backend code for Carla | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@gmail.com> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BACKEND_H | |||
#define CARLA_BACKEND_H | |||
#include "includes.h" | |||
#define STR_MAX 255 | |||
// static max values | |||
const unsigned short MAX_PLUGINS = 99; | |||
const unsigned int MAX_PARAMETERS = 200; | |||
const unsigned int MAX_MIDI_EVENTS = 512; | |||
// plugin hints | |||
const unsigned int PLUGIN_HAS_GUI = 0x01; | |||
const unsigned int PLUGIN_IS_BRIDGE = 0x02; | |||
const unsigned int PLUGIN_IS_SYNTH = 0x04; | |||
const unsigned int PLUGIN_USES_CHUNKS = 0x08; | |||
const unsigned int PLUGIN_CAN_DRYWET = 0x10; | |||
const unsigned int PLUGIN_CAN_VOL = 0x20; | |||
const unsigned int PLUGIN_CAN_BALANCE = 0x40; | |||
// parameter hints | |||
const unsigned int PARAMETER_IS_ENABLED = 0x01; | |||
const unsigned int PARAMETER_IS_AUTOMABLE = 0x02; | |||
const unsigned int PARAMETER_HAS_STRICT_BOUNDS = 0x04; | |||
const unsigned int PARAMETER_USES_SCALEPOINTS = 0x08; | |||
const unsigned int PARAMETER_USES_SAMPLERATE = 0x10; | |||
enum BinaryType { | |||
BINARY_NONE = 0, | |||
BINARY_UNIX32 = 1, | |||
BINARY_UNIX64 = 2, | |||
BINARY_WIN32 = 3, | |||
BINARY_WIN64 = 4 | |||
}; | |||
enum PluginType { | |||
PLUGIN_NONE = 0, | |||
PLUGIN_LADSPA = 1, | |||
PLUGIN_DSSI = 2, | |||
PLUGIN_LV2 = 3, | |||
PLUGIN_VST = 4, | |||
PLUGIN_SF2 = 5 | |||
}; | |||
enum PluginCategory { | |||
PLUGIN_CATEGORY_NONE = 0, | |||
PLUGIN_CATEGORY_SYNTH = 1, | |||
PLUGIN_CATEGORY_DELAY = 2, // also Reverb | |||
PLUGIN_CATEGORY_EQ = 3, | |||
PLUGIN_CATEGORY_FILTER = 4, | |||
PLUGIN_CATEGORY_DYNAMICS = 5, // Amplifier, Compressor, Gate | |||
PLUGIN_CATEGORY_MODULATOR = 6, // Chorus, Flanger, Phaser | |||
PLUGIN_CATEGORY_UTILITY = 7, // Analyzer, Converter, Mixer | |||
PLUGIN_CATEGORY_OUTRO = 8 // used to check if a plugin has a category | |||
}; | |||
enum ParameterType { | |||
PARAMETER_UNKNOWN = 0, | |||
PARAMETER_INPUT = 1, | |||
PARAMETER_OUTPUT = 2 | |||
}; | |||
enum InternalParametersIndex { | |||
PARAMETER_ACTIVE = -1, | |||
PARAMETER_DRYWET = -2, | |||
PARAMETER_VOLUME = -3, | |||
PARAMETER_BALANCE_LEFT = -4, | |||
PARAMETER_BALANCE_RIGHT = -5 | |||
}; | |||
enum GuiType { | |||
GUI_NONE = 0, | |||
GUI_INTERNAL_QT4 = 1, | |||
GUI_INTERNAL_X11 = 2, | |||
GUI_EXTERNAL_OSC = 3, | |||
GUI_EXTERNAL_LV2 = 4 | |||
}; | |||
enum OptionsType { | |||
OPTION_GLOBAL_JACK_CLIENT = 1 | |||
}; | |||
enum CallbackType { | |||
CALLBACK_DEBUG = 0, | |||
CALLBACK_PARAMETER_CHANGED = 1, // parameter_id, 0, value | |||
CALLBACK_PROGRAM_CHANGED = 2, // program_id, 0, 0 | |||
CALLBACK_MIDI_PROGRAM_CHANGED = 3, // bank_id, program_id, 0 | |||
CALLBACK_NOTE_ON = 4, // key, velocity, 0 | |||
CALLBACK_NOTE_OFF = 5, // key, velocity, 0 | |||
CALLBACK_SHOW_GUI = 6, // show? (0|1, -1=quit), 0, 0 | |||
CALLBACK_RESIZE_GUI = 7, // width, height, 0 | |||
CALLBACK_UPDATE = 8, | |||
CALLBACK_RELOAD_INFO = 9, | |||
CALLBACK_RELOAD_PARAMETERS = 10, | |||
CALLBACK_RELOAD_PROGRAMS = 11, | |||
CALLBACK_RELOAD_ALL = 12, | |||
CALLBACK_QUIT = 13 | |||
}; | |||
struct ParameterData { | |||
ParameterType type; | |||
int32_t index; | |||
int32_t rindex; | |||
int32_t hints; | |||
uint8_t midi_channel; | |||
int16_t midi_cc; | |||
}; | |||
struct ParameterRanges { | |||
double def; | |||
double min; | |||
double max; | |||
double step; | |||
double step_small; | |||
double step_large; | |||
}; | |||
struct CustomData { | |||
const char* type; | |||
const char* key; | |||
const char* value; | |||
}; | |||
struct GuiData { | |||
GuiType type; | |||
bool visible; | |||
bool resizable; | |||
unsigned int width; | |||
unsigned int height; | |||
const char* name; // DSSI Filename; LV2 Window Title | |||
bool show_now; | |||
}; | |||
struct PluginInfo { | |||
bool valid; | |||
PluginType type; | |||
PluginCategory category; | |||
unsigned int hints; | |||
const char* binary; | |||
const char* name; | |||
const char* label; | |||
const char* maker; | |||
const char* copyright; | |||
long unique_id; | |||
}; | |||
struct PortCountInfo { | |||
bool valid; | |||
uint32_t ins; | |||
uint32_t outs; | |||
uint32_t total; | |||
}; | |||
struct ParameterInfo { | |||
bool valid; | |||
const char* name; | |||
const char* symbol; | |||
const char* label; | |||
uint32_t scalepoint_count; | |||
}; | |||
struct ScalePointInfo { | |||
bool valid; | |||
double value; | |||
const char* label; | |||
}; | |||
struct MidiProgramInfo { | |||
bool valid; | |||
uint32_t bank; | |||
uint32_t program; | |||
const char* label; | |||
}; | |||
struct PluginBridgeInfo { | |||
PluginCategory category; | |||
unsigned int hints; | |||
const char* name; | |||
const char* maker; | |||
long unique_id; | |||
uint32_t ains; | |||
uint32_t aouts; | |||
}; | |||
struct carla_options_t { | |||
bool initiated; | |||
bool global_jack_client; | |||
}; | |||
typedef void (*CallbackFunc)(CallbackType action, unsigned short plugin_id, int value1, int value2, double value3); | |||
// ----------------------------------------------------- | |||
// Exported symbols (API) | |||
CARLA_EXPORT bool carla_init(const char* client_name); | |||
CARLA_EXPORT bool carla_close(); | |||
CARLA_EXPORT bool carla_is_engine_running(); | |||
CARLA_EXPORT short add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* label, void* extra_stuff); | |||
CARLA_EXPORT bool remove_plugin(unsigned short plugin_id); | |||
CARLA_EXPORT PluginInfo* get_plugin_info(unsigned short plugin_id); | |||
CARLA_EXPORT PortCountInfo* get_audio_port_count_info(unsigned short plugin_id); | |||
CARLA_EXPORT PortCountInfo* get_midi_port_count_info(unsigned short plugin_id); | |||
CARLA_EXPORT PortCountInfo* get_parameter_count_info(unsigned short plugin_id); | |||
CARLA_EXPORT ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameter_id); | |||
CARLA_EXPORT ScalePointInfo* get_scalepoint_info(unsigned short plugin_id, uint32_t parameter_id, uint32_t scalepoint_id); | |||
CARLA_EXPORT MidiProgramInfo* get_midi_program_info(unsigned short plugin_id, uint32_t midi_program_id); | |||
CARLA_EXPORT ParameterData* get_parameter_data(unsigned short plugin_id, uint32_t parameter_id); | |||
CARLA_EXPORT ParameterRanges* get_parameter_ranges(unsigned short plugin_id, uint32_t parameter_id); | |||
CARLA_EXPORT CustomData* get_custom_data(unsigned short plugin_id, uint32_t custom_data_id); | |||
CARLA_EXPORT const char* get_chunk_data(unsigned short plugin_id); | |||
CARLA_EXPORT GuiData* get_gui_data(unsigned short plugin_id); | |||
CARLA_EXPORT uint32_t get_parameter_count(unsigned short plugin_id); | |||
CARLA_EXPORT uint32_t get_program_count(unsigned short plugin_id); | |||
CARLA_EXPORT uint32_t get_midi_program_count(unsigned short plugin_id); | |||
CARLA_EXPORT uint32_t get_custom_data_count(unsigned short plugin_id); | |||
CARLA_EXPORT const char* get_program_name(unsigned short plugin_id, uint32_t program_id); | |||
CARLA_EXPORT const char* get_midi_program_name(unsigned short plugin_id, uint32_t midi_program_id); | |||
CARLA_EXPORT const char* get_real_plugin_name(unsigned short plugin_id); | |||
CARLA_EXPORT int32_t get_current_program_index(unsigned short plugin_id); | |||
CARLA_EXPORT int32_t get_current_midi_program_index(unsigned short plugin_id); | |||
CARLA_EXPORT double get_default_parameter_value(unsigned short plugin_id, uint32_t parameter_id); | |||
CARLA_EXPORT double get_current_parameter_value(unsigned short plugin_id, uint32_t parameter_id); | |||
CARLA_EXPORT double get_input_peak_value(unsigned short plugin_id, unsigned short port_id); | |||
CARLA_EXPORT double get_output_peak_value(unsigned short plugin_id, unsigned short port_id); | |||
CARLA_EXPORT void set_active(unsigned short plugin_id, bool onoff); | |||
CARLA_EXPORT void set_drywet(unsigned short plugin_id, double value); | |||
CARLA_EXPORT void set_volume(unsigned short plugin_id, double value); | |||
CARLA_EXPORT void set_balance_left(unsigned short plugin_id, double value); | |||
CARLA_EXPORT void set_balance_right(unsigned short plugin_id, double value); | |||
CARLA_EXPORT void set_parameter_value(unsigned short plugin_id, uint32_t parameter_id, double value); | |||
CARLA_EXPORT void set_parameter_midi_channel(unsigned short plugin_id, uint32_t parameter_id, uint8_t channel); | |||
CARLA_EXPORT void set_parameter_midi_cc(unsigned short plugin_id, uint32_t parameter_id, int16_t midi_cc); | |||
CARLA_EXPORT void set_program(unsigned short plugin_id, uint32_t program_id); | |||
CARLA_EXPORT void set_midi_program(unsigned short plugin_id, uint32_t midi_program_id); | |||
CARLA_EXPORT void set_custom_data(unsigned short plugin_id, const char* type, const char* key, const char* value); | |||
CARLA_EXPORT void set_chunk_data(unsigned short plugin_id, const char* chunk_data); | |||
CARLA_EXPORT void set_gui_data(unsigned short plugin_id, int data, intptr_t gui_addr); | |||
CARLA_EXPORT void show_gui(unsigned short plugin_id, bool yesno); | |||
CARLA_EXPORT void idle_gui(unsigned short plugin_id); | |||
CARLA_EXPORT void send_midi_note(unsigned short plugin_id, bool onoff, uint8_t note, uint8_t velocity); | |||
CARLA_EXPORT void prepare_for_save(unsigned short plugin_id); | |||
CARLA_EXPORT void set_callback_function(CallbackFunc func); | |||
CARLA_EXPORT void set_option(OptionsType option, int value, const char* value_str); | |||
CARLA_EXPORT const char* get_last_error(); | |||
CARLA_EXPORT const char* get_host_client_name(); | |||
CARLA_EXPORT const char* get_host_osc_url(); | |||
CARLA_EXPORT uint32_t get_buffer_size(); | |||
CARLA_EXPORT double get_sample_rate(); | |||
CARLA_EXPORT double get_latency(); | |||
// End of exported symbols | |||
// ----------------------------------------------------- | |||
#if 0 | |||
// Helper functions | |||
short get_new_plugin_id(); | |||
const char* get_unique_name(const char* name); | |||
void* get_pointer(intptr_t ptr_addr); | |||
void set_last_error(const char* error); | |||
void callback_action(CallbackType action, unsigned short plugin_id, int value1, int value2, double value3); | |||
void carla_proc_lock(); | |||
bool carla_proc_trylock(); | |||
void carla_proc_unlock(); | |||
void carla_midi_lock(); | |||
void carla_midi_unlock(); | |||
void send_plugin_midi_note(unsigned short plugin_id, bool onoff, uint8_t note, uint8_t velo, bool gui_send, bool osc_send, bool callback_send); | |||
#endif | |||
#endif // CARLA_BACKEND_H |
@@ -0,0 +1,71 @@ | |||
/* | |||
* JACK Backend code for Carla | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@gmail.com> | |||
* | |||
* This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_INCLUDES_H | |||
#define CARLA_INCLUDES_H | |||
#include <stdint.h> | |||
#include <Qt> | |||
#if defined (__GXX_EXPERIMENTAL_CXX0X__) && defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
// nullptr is available | |||
#else | |||
#define nullptr (0) | |||
#endif | |||
#ifdef Q_OS_WIN | |||
#include <windows.h> | |||
#else | |||
#include <dlfcn.h> | |||
#ifndef __cdecl | |||
#define __cdecl | |||
#endif | |||
#endif | |||
// needed for qDebug/Warning/Critical sections | |||
#if __WORDSIZE == 64 | |||
# define P_INTPTR "%li" | |||
# define P_SIZE "%lu" | |||
#else | |||
# define P_INTPTR "%i" | |||
# define P_SIZE "%u" | |||
#endif | |||
// set native binary type | |||
#if defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) | |||
# if __LP64__ | |||
# define BINARY_NATIVE BINARY_UNIX64 | |||
# else | |||
# define BINARY_NATIVE BINARY_UNIX32 | |||
# endif | |||
#elif defined(Q_OS_WIN) | |||
# ifdef Q_OS_WIN64 | |||
# define BINARY_NATIVE BINARY_WIN64 | |||
# else | |||
# define BINARY_NATIVE BINARY_WIN32 | |||
# endif | |||
#else | |||
# error Invalid build type | |||
#endif | |||
#ifdef Q_OS_WIN | |||
# define CARLA_EXPORT extern "C" __declspec (dllexport) | |||
#else | |||
# define CARLA_EXPORT extern "C" __attribute__ ((visibility("default"))) | |||
#endif | |||
#endif // CARLA_INCLUDES_H |
@@ -559,8 +559,6 @@ def checkPluginSF2(filename, tool): | |||
# ------------------------------------------------------------------------------------------------ | |||
# Backend C++ -> Python variables | |||
global Callback | |||
c_enum = c_int | |||
c_nullptr = None | |||
@@ -623,11 +621,6 @@ PARAMETER_VOLUME = -3 | |||
PARAMETER_BALANCE_LEFT = -4 | |||
PARAMETER_BALANCE_RIGHT = -5 | |||
# enum CustomDataType | |||
CUSTOM_DATA_INVALID = 0 | |||
CUSTOM_DATA_STRING = 1 | |||
CUSTOM_DATA_BINARY = 2 | |||
# enum GuiType | |||
GUI_NONE = 0 | |||
GUI_INTERNAL_QT4 = 1 | |||
@@ -636,12 +629,7 @@ GUI_EXTERNAL_OSC = 3 | |||
GUI_EXTERNAL_LV2 = 4 | |||
# enum OptionsType | |||
OPTION_GLOBAL_JACK_CLIENT = 1 | |||
OPTION_BRIDGE_PATH_LV2_GTK2 = 2 | |||
OPTION_BRIDGE_PATH_LV2_QT4 = 3 | |||
OPTION_BRIDGE_PATH_LV2_X11 = 4 | |||
OPTION_BRIDGE_PATH_VST_QT4 = 5 | |||
OPTION_BRIDGE_PATH_WINVST = 6 | |||
OPTION_GLOBAL_JACK_CLIENT = 1 | |||
# enum CallbackType | |||
CALLBACK_DEBUG = 0 | |||
@@ -681,7 +669,7 @@ class ParameterRanges(Structure): | |||
class CustomData(Structure): | |||
_fields_ = [ | |||
("type", c_enum), | |||
("type", c_char_p), | |||
("key", c_char_p), | |||
("value", c_char_p) | |||
] | |||
@@ -693,7 +681,7 @@ class GuiData(Structure): | |||
("resizable", c_bool), | |||
("width", c_uint), | |||
("height", c_uint), | |||
("name", c_char_p), | |||
("name", c_char_p), # DSSI Filename; LV2 Window Title | |||
("show_now", c_bool) | |||
] | |||
@@ -743,7 +731,7 @@ class MidiProgramInfo(Structure): | |||
("label", c_char_p) | |||
] | |||
class WinVstBaseInfo(Structure): | |||
class PluginBridgeInfo(Structure): | |||
_fields_ = [ | |||
("category", c_enum), | |||
("hints", c_uint), | |||
@@ -754,6 +742,8 @@ class WinVstBaseInfo(Structure): | |||
("aouts", c_uint32) | |||
] | |||
CallbackFunc = CFUNCTYPE(None, c_enum, c_ushort, c_int, c_int, c_double) | |||
if (LINUX or MACOS): | |||
BINARY_NATIVE = BINARY_UNIX64 if (is64bit) else BINARY_UNIX32 | |||
elif (WINDOWS): | |||
@@ -775,286 +765,343 @@ class Host(object): | |||
else: | |||
libname = "carla_backend.so" | |||
self.lib = None #cdll.LoadLibrary(os.path.join(cwd, "carla", libname)) | |||
self.lib = cdll.LoadLibrary(os.path.join("carla", libname)) | |||
# bool carla_init(const char* client_name); - FIXME | |||
def carla_init(self, client_name): | |||
return True | |||
#self.lib.carla_init.argtypes = [c_char_p] | |||
#self.lib.carla_init.restype = c_bool | |||
#return self.lib.carla_init(client_name) | |||
self.lib.carla_init.argtypes = [c_char_p] | |||
self.lib.carla_init.restype = c_bool | |||
return self.lib.carla_init(client_name) | |||
# bool carla_close(); - FIXME | |||
def carla_close(self): | |||
return True | |||
#self.lib.carla_close.argtypes = None | |||
#self.lib.carla_close.restype = c_bool | |||
#return self.lib.carla_close() | |||
self.lib.carla_close.argtypes = None | |||
self.lib.carla_close.restype = c_bool | |||
return self.lib.carla_close() | |||
# bool carla_is_engine_running(); - FIXME | |||
def carla_is_engine_running(self): | |||
return False | |||
#self.lib.carla_is_engine_running.argtypes = None | |||
#self.lib.carla_is_engine_running.restype = c_bool | |||
#return self.lib.carla_is_engine_running() | |||
def add_plugin(self, ptype, filename, label, extra_stuff): | |||
self.lib.add_plugin.argtypes = [c_enum, c_char_p, c_char_p, c_void_p] | |||
self.lib.carla_is_engine_running.argtypes = None | |||
self.lib.carla_is_engine_running.restype = c_bool | |||
return self.lib.carla_is_engine_running() | |||
# short add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* label, void* extra_stuff); - FIXME | |||
def add_plugin(self, btype, ptype, filename, label, extra_stuff): | |||
return -1 | |||
self.lib.add_plugin.argtypes = [c_enum, c_enum, c_char_p, c_char_p, c_void_p] | |||
self.lib.add_plugin.restype = c_short | |||
return self.lib.add_plugin(ptype, filename, label, cast(extra_stuff, c_void_p)) | |||
return self.lib.add_plugin(btype, ptype, filename, label, cast(extra_stuff, c_void_p)) | |||
# bool remove_plugin(unsigned short plugin_id); | |||
def remove_plugin(self, plugin_id): | |||
self.lib.remove_plugin.argtypes = [c_ushort] | |||
self.lib.remove_plugin.restype = c_bool | |||
return self.lib.remove_plugin(plugin_id) | |||
# PluginInfo* get_plugin_info(unsigned short plugin_id); | |||
def get_plugin_info(self, plugin_id): | |||
self.lib.get_plugin_info.argtypes = [c_ushort] | |||
self.lib.get_plugin_info.restype = POINTER(PluginInfo) | |||
return struct_to_dict(self.lib.get_plugin_info(plugin_id).contents) | |||
# PortCountInfo* get_audio_port_count_info(unsigned short plugin_id); | |||
def get_audio_port_count_info(self, plugin_id): | |||
self.lib.get_audio_port_count_info.argtypes = [c_ushort] | |||
self.lib.get_audio_port_count_info.restype = POINTER(PortCountInfo) | |||
return struct_to_dict(self.lib.get_audio_port_count_info(plugin_id).contents) | |||
# PortCountInfo* get_midi_port_count_info(unsigned short plugin_id); | |||
def get_midi_port_count_info(self, plugin_id): | |||
self.lib.get_midi_port_count_info.argtypes = [c_ushort] | |||
self.lib.get_midi_port_count_info.restype = POINTER(PortCountInfo) | |||
return struct_to_dict(self.lib.get_midi_port_count_info(plugin_id).contents) | |||
# PortCountInfo* get_parameter_count_info(unsigned short plugin_id); | |||
def get_parameter_count_info(self, plugin_id): | |||
self.lib.get_parameter_count_info.argtypes = [c_ushort] | |||
self.lib.get_parameter_count_info.restype = POINTER(PortCountInfo) | |||
return struct_to_dict(self.lib.get_parameter_count_info(plugin_id).contents) | |||
# ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameter_id); | |||
def get_parameter_info(self, plugin_id, parameter_id): | |||
self.lib.get_parameter_info.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_parameter_info.restype = POINTER(ParameterInfo) | |||
return struct_to_dict(self.lib.get_parameter_info(plugin_id, parameter_id).contents) | |||
# ScalePointInfo* get_scalepoint_info(unsigned short plugin_id, uint32_t parameter_id, uint32_t scalepoint_id); | |||
def get_scalepoint_info(self, plugin_id, parameter_id, scalepoint_id): | |||
self.lib.get_scalepoint_info.argtypes = [c_ushort, c_uint32, c_uint32] | |||
self.lib.get_scalepoint_info.restype = POINTER(ScalePointInfo) | |||
return struct_to_dict(self.lib.get_scalepoint_info(plugin_id, parameter_id, scalepoint_id).contents) | |||
# MidiProgramInfo* get_midi_program_info(unsigned short plugin_id, uint32_t midi_program_id); | |||
def get_midi_program_info(self, plugin_id, midi_program_id): | |||
self.lib.get_midi_program_info.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_midi_program_info.restype = POINTER(MidiProgramInfo) | |||
return struct_to_dict(self.lib.get_midi_program_info(plugin_id, midi_program_id).contents) | |||
# ParameterData* get_parameter_data(unsigned short plugin_id, uint32_t parameter_id); | |||
def get_parameter_data(self, plugin_id, parameter_id): | |||
self.lib.get_parameter_data.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_parameter_data.restype = POINTER(ParameterData) | |||
return struct_to_dict(self.lib.get_parameter_data(plugin_id, parameter_id).contents) | |||
# ParameterRanges* get_parameter_ranges(unsigned short plugin_id, uint32_t parameter_id); | |||
def get_parameter_ranges(self, plugin_id, parameter_id): | |||
self.lib.get_parameter_ranges.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_parameter_ranges.restype = POINTER(ParameterRanges) | |||
return struct_to_dict(self.lib.get_parameter_ranges(plugin_id, parameter_id).contents) | |||
# CustomData* get_custom_data(unsigned short plugin_id, uint32_t custom_data_id); | |||
def get_custom_data(self, plugin_id, custom_data_id): | |||
self.lib.get_custom_data.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_custom_data.restype = POINTER(CustomData) | |||
return struct_to_dict(self.lib.get_custom_data(plugin_id, custom_data_id).contents) | |||
# const char* get_chunk_data(unsigned short plugin_id); | |||
def get_chunk_data(self, plugin_id): | |||
self.lib.get_chunk_data.argtypes = [c_ushort] | |||
self.lib.get_chunk_data.restype = c_char_p | |||
return self.lib.get_chunk_data(plugin_id) | |||
# GuiData* get_gui_data(unsigned short plugin_id); | |||
def get_gui_data(self, plugin_id): | |||
self.lib.get_gui_data.argtypes = [c_ushort] | |||
self.lib.get_gui_data.restype = POINTER(GuiData) | |||
return struct_to_dict(self.lib.get_gui_data(plugin_id).contents) | |||
# uint32_t get_parameter_count(unsigned short plugin_id); | |||
def get_parameter_count(self, plugin_id): | |||
self.lib.get_parameter_count.argtypes = [c_ushort] | |||
self.lib.get_parameter_count.restype = c_uint32 | |||
return self.lib.get_parameter_count(plugin_id) | |||
# uint32_t get_program_count(unsigned short plugin_id); | |||
def get_program_count(self, plugin_id): | |||
self.lib.get_program_count.argtypes = [c_ushort] | |||
self.lib.get_program_count.restype = c_uint32 | |||
return self.lib.get_program_count(plugin_id) | |||
# uint32_t get_midi_program_count(unsigned short plugin_id); | |||
def get_midi_program_count(self, plugin_id): | |||
self.lib.get_midi_program_count.argtypes = [c_ushort] | |||
self.lib.get_midi_program_count.restype = c_uint32 | |||
return self.lib.get_midi_program_count(plugin_id) | |||
# uint32_t get_custom_data_count(unsigned short plugin_id); | |||
def get_custom_data_count(self, plugin_id): | |||
self.lib.get_custom_data_count.argtypes = [c_ushort] | |||
self.lib.get_custom_data_count.restype = c_uint32 | |||
return self.lib.get_custom_data_count(plugin_id) | |||
# const char* get_program_name(unsigned short plugin_id, uint32_t program_id); | |||
def get_program_name(self, plugin_id, program_id): | |||
self.lib.get_program_name.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_program_name.restype = c_char_p | |||
return self.lib.get_program_name(plugin_id, program_id) | |||
# const char* get_midi_program_name(unsigned short plugin_id, uint32_t midi_program_id); | |||
def get_midi_program_name(self, plugin_id, midi_program_id): | |||
self.lib.get_midi_program_name.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_midi_program_name.restype = c_char_p | |||
return self.lib.get_midi_program_name(plugin_id, midi_program_id) | |||
# const char* get_real_plugin_name(unsigned short plugin_id); | |||
def get_real_plugin_name(self, plugin_id): | |||
self.lib.get_real_plugin_name.argtypes = [c_ushort] | |||
self.lib.get_real_plugin_name.restype = c_char_p | |||
return self.lib.get_real_plugin_name(plugin_id) | |||
# int32_t get_current_program_index(unsigned short plugin_id); | |||
def get_current_program_index(self, plugin_id): | |||
self.lib.get_current_program_index.argtypes = [c_ushort] | |||
self.lib.get_current_program_index.restype = c_int32 | |||
return self.lib.get_current_program_index(plugin_id) | |||
# int32_t get_current_midi_program_index(unsigned short plugin_id); | |||
def get_current_midi_program_index(self, plugin_id): | |||
self.lib.get_current_midi_program_index.argtypes = [c_ushort] | |||
self.lib.get_current_midi_program_index.restype = c_int32 | |||
return self.lib.get_current_midi_program_index(plugin_id) | |||
# double get_default_parameter_value(unsigned short plugin_id, uint32_t parameter_id); | |||
def get_default_parameter_value(self, plugin_id, parameter_id): | |||
self.lib.get_default_parameter_value.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_default_parameter_value.restype = c_double | |||
return self.lib.get_default_parameter_value(plugin_id, parameter_id) | |||
# double get_current_parameter_value(unsigned short plugin_id, uint32_t parameter_id); | |||
def get_current_parameter_value(self, plugin_id, parameter_id): | |||
self.lib.get_current_parameter_value.argtypes = [c_ushort, c_uint32] | |||
self.lib.get_current_parameter_value.restype = c_double | |||
return self.lib.get_current_parameter_value(plugin_id, parameter_id) | |||
# double get_input_peak_value(unsigned short plugin_id, unsigned short port_id); | |||
def get_input_peak_value(self, plugin_id, port_id): | |||
self.lib.get_input_peak_value.argtypes = [c_ushort, c_ushort] | |||
self.lib.get_input_peak_value.restype = c_double | |||
return self.lib.get_input_peak_value(plugin_id, port_id) | |||
# double get_output_peak_value(unsigned short plugin_id, unsigned short port_id); | |||
def get_output_peak_value(self, plugin_id, port_id): | |||
self.lib.get_output_peak_value.argtypes = [c_ushort, c_ushort] | |||
self.lib.get_output_peak_value.restype = c_double | |||
return self.lib.get_output_peak_value(plugin_id, port_id) | |||
# void set_active(unsigned short plugin_id, bool onoff); | |||
def set_active(self, plugin_id, onoff): | |||
self.lib.set_active.argtypes = [c_ushort, c_bool] | |||
self.lib.set_active.restype = None | |||
self.lib.set_active(plugin_id, onoff) | |||
# void set_drywet(unsigned short plugin_id, double value); | |||
def set_drywet(self, plugin_id, value): | |||
self.lib.set_drywet.argtypes = [c_ushort, c_double] | |||
self.lib.set_drywet.restype = None | |||
self.lib.set_drywet(plugin_id, value) | |||
def set_vol(self, plugin_id, value): | |||
self.lib.set_vol.argtypes = [c_ushort, c_double] | |||
self.lib.set_vol.restype = None | |||
self.lib.set_vol(plugin_id, value) | |||
# void set_volume(unsigned short plugin_id, double value); | |||
def set_volume(self, plugin_id, value): | |||
self.lib.set_volume.argtypes = [c_ushort, c_double] | |||
self.lib.set_volume.restype = None | |||
self.lib.set_volume(plugin_id, value) | |||
# void set_balance_left(unsigned short plugin_id, double value); | |||
def set_balance_left(self, plugin_id, value): | |||
self.lib.set_balance_left.argtypes = [c_ushort, c_double] | |||
self.lib.set_balance_left.restype = None | |||
self.lib.set_balance_left(plugin_id, value) | |||
# void set_balance_right(unsigned short plugin_id, double value); | |||
def set_balance_right(self, plugin_id, value): | |||
self.lib.set_balance_right.argtypes = [c_ushort, c_double] | |||
self.lib.set_balance_right.restype = None | |||
self.lib.set_balance_right(plugin_id, value) | |||
# void set_parameter_value(unsigned short plugin_id, uint32_t parameter_id, double value); | |||
def set_parameter_value(self, plugin_id, parameter_id, value): | |||
self.lib.set_parameter_value.argtypes = [c_ushort, c_uint32, c_double] | |||
self.lib.set_parameter_value.restype = None | |||
self.lib.set_parameter_value(plugin_id, parameter_id, value) | |||
# void set_parameter_midi_channel(unsigned short plugin_id, uint32_t parameter_id, uint8_t channel); | |||
def set_parameter_midi_channel(self, plugin_id, parameter_id, channel): | |||
self.lib.set_parameter_midi_channel.argtypes = [c_ushort, c_uint32, c_uint8] | |||
self.lib.set_parameter_midi_channel.restype = None | |||
self.lib.set_parameter_midi_channel(plugin_id, parameter_id, channel) | |||
def set_parameter_midi_cc(self, plugin_id, parameter_id, cc): | |||
# void set_parameter_midi_cc(unsigned short plugin_id, uint32_t parameter_id, int16_t midi_cc); | |||
def set_parameter_midi_cc(self, plugin_id, parameter_id, midi_cc): | |||
self.lib.set_parameter_midi_cc.argtypes = [c_ushort, c_uint32, c_int16] | |||
self.lib.set_parameter_midi_cc.restype = None | |||
self.lib.set_parameter_midi_cc(plugin_id, parameter_id, cc) | |||
self.lib.set_parameter_midi_cc(plugin_id, parameter_id, midi_cc) | |||
# void set_program(unsigned short plugin_id, uint32_t program_id); | |||
def set_program(self, plugin_id, program_id): | |||
self.lib.set_program.argtypes = [c_ushort, c_uint32] | |||
self.lib.set_program.restype = None | |||
self.lib.set_program(plugin_id, program_id) | |||
# void set_midi_program(unsigned short plugin_id, uint32_t midi_program_id); | |||
def set_midi_program(self, plugin_id, midi_program_id): | |||
self.lib.set_midi_program.argtypes = [c_ushort, c_uint32] | |||
self.lib.set_midi_program.restype = None | |||
self.lib.set_midi_program(plugin_id, midi_program_id) | |||
# void set_custom_data(unsigned short plugin_id, const char* type, const char* key, const char* value); | |||
def set_custom_data(self, plugin_id, dtype, key, value): | |||
self.lib.set_custom_data.argtypes = [c_ushort, c_enum, c_char_p, c_char_p] | |||
self.lib.set_custom_data.argtypes = [c_ushort, c_char_p, c_char_p, c_char_p] | |||
self.lib.set_custom_data.restype = None | |||
return self.lib.set_custom_data(plugin_id, dtype, key, value) | |||
# void set_chunk_data(unsigned short plugin_id, const char* chunk_data); | |||
def set_chunk_data(self, plugin_id, chunk_data): | |||
self.lib.set_chunk_data.argtypes = [c_ushort, c_char_p] | |||
self.lib.set_chunk_data.restype = None | |||
self.lib.set_chunk_data(plugin_id, chunk_data) | |||
# void set_gui_data(unsigned short plugin_id, int data, intptr_t gui_addr); | |||
def set_gui_data(self, plugin_id, data, gui_addr): | |||
self.lib.set_gui_data.argtypes = [c_ushort, c_int, c_intptr] | |||
self.lib.set_gui_data.restype = None | |||
self.lib.set_gui_data(plugin_id, data, gui_addr) | |||
# void show_gui(unsigned short plugin_id, bool yesno); | |||
def show_gui(self, plugin_id, yesno): | |||
self.lib.show_gui.argtypes = [c_ushort, c_bool] | |||
self.lib.show_gui.restype = None | |||
self.lib.show_gui(plugin_id, yesno) | |||
# void idle_gui(unsigned short plugin_id); | |||
def idle_gui(self, plugin_id): | |||
self.lib.idle_gui.argtypes = [c_ushort] | |||
self.lib.idle_gui.restype = None | |||
self.lib.idle_gui(plugin_id) | |||
# void send_midi_note(unsigned short plugin_id, bool onoff, uint8_t note, uint8_t velocity); | |||
def send_midi_note(self, plugin_id, onoff, note, velocity): | |||
self.lib.send_midi_note.argtypes = [c_ushort, c_bool, c_uint8, c_uint8] | |||
self.lib.send_midi_note.restype = None | |||
self.lib.send_midi_note(plugin_id, onoff, note, velocity) | |||
# void prepare_for_save(unsigned short plugin_id); | |||
def prepare_for_save(self, plugin_id): | |||
self.lib.prepare_for_save.argtypes = [c_ushort] | |||
self.lib.prepare_for_save.restype = None | |||
self.lib.prepare_for_save(plugin_id) | |||
# void set_callback_function(CallbackFunc func); - FIXME | |||
def set_callback_function(self, func): | |||
return | |||
global Callback | |||
#Callback = CFUNCTYPE(None, c_enum, c_ushort, c_int, c_int, c_double)(func) | |||
#self.lib.set_callback_function.argtypes = [] # TODO | |||
#self.lib.set_callback_function.restype = None | |||
#self.lib.set_callback_function(Callback) | |||
Callback = CallbackFunc(func) | |||
self.lib.set_callback_function.argtypes = [CallbackFunc] | |||
self.lib.set_callback_function.restype = None | |||
self.lib.set_callback_function(Callback) | |||
# void set_option(OptionsType option, int value, const char* value_str); | |||
def set_option(self, option, value, value_str): | |||
self.lib.set_option.argtypes = [c_enum, c_int, c_char_p] | |||
self.lib.set_option.restype = None | |||
self.lib.set_option(option, value, value_str) | |||
# const char* get_last_error(); - FIXME | |||
def get_last_error(self): | |||
return "" | |||
#self.lib.get_last_error.argtypes = None | |||
#self.lib.get_last_error.restype = c_char_p | |||
#return self.lib.get_last_error() | |||
self.lib.get_last_error.argtypes = None | |||
self.lib.get_last_error.restype = c_char_p | |||
return self.lib.get_last_error() | |||
def get_host_osc_url(self): | |||
# const char* get_host_client_name(); - FIXME | |||
def get_host_client_name(self): | |||
return "" | |||
#self.lib.get_host_osc_url.argtypes = None | |||
#self.lib.get_host_osc_url.restype = c_char_p | |||
#return self.lib.get_host_osc_url() | |||
self.lib.get_host_client_name.argtypes = None | |||
self.lib.get_host_client_name.restype = c_char_p | |||
return self.lib.get_host_client_name() | |||
def get_host_client_name(self): | |||
# const char* get_host_osc_url(); - FIXME | |||
def get_host_osc_url(self): | |||
return "" | |||
#self.lib.get_host_client_name.argtypes = None | |||
#self.lib.get_host_client_name.restype = c_char_p | |||
#return self.lib.get_host_client_name() | |||
self.lib.get_host_osc_url.argtypes = None | |||
self.lib.get_host_osc_url.restype = c_char_p | |||
return self.lib.get_host_osc_url() | |||
# uint32_t get_buffer_size(); | |||
def get_buffer_size(self): | |||
self.lib.get_buffer_size.argtypes = None | |||
self.lib.get_buffer_size.restype = c_uint32 | |||
return self.lib.get_buffer_size() | |||
# double get_sample_rate(); | |||
def get_sample_rate(self): | |||
self.lib.get_sample_rate.argtypes = None | |||
self.lib.get_sample_rate.restype = c_double | |||
return self.lib.get_sample_rate() | |||
# double get_latency(); | |||
def get_latency(self): | |||
self.lib.get_latency.argtypes = None | |||
self.lib.get_latency.restype = c_double | |||