@@ -7,10 +7,11 @@ | |||
CC ?= gcc | |||
CXX ?= g++ | |||
CARLA_BUILD_FLAGS = -Wall -std=c++0x -fPIC -I. -I../carla-includes `pkg-config --cflags jack fluidsynth liblo QtCore QtGui` $(CXXFLAGS) | |||
# 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_BUILD_FLAGS += -DDEBUG -O0 -g | |||
CARLA_LINK_FLAGS = -shared -fPIC -ldl `pkg-config --libs jack fluidsynth liblo QtCore QtGui` $(LDFLAGS) | |||
CARLA_C_FLAGS = -Wall -fPIC -I. -I../carla-includes $(CFLAGS) | |||
CARLA_CXX_FLAGS = -Wall -std=c++0x -fPIC -I. -I../carla-includes `pkg-config --cflags jack fluidsynth liblo QtCore QtGui` $(CXXFLAGS) | |||
#CARLA_CXX_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_CXX_FLAGS += -DDEBUG -O0 -g | |||
CARLA_LINK_FLAGS = -shared -fPIC -ldl `pkg-config --libs jack fluidsynth liblo QtCore QtGui` $(LDFLAGS) | |||
OBJS = carla_backend.o carla_bridge.o carla_jack.o carla_osc.o carla_shared.o carla_threads.o ladspa.o dssi.o lv2.o vst.o sf2.o lv2-rtmempool/rtmempool.o | |||
@@ -24,10 +25,10 @@ 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 $@ | |||
$(CC) -c $< $(CARLA_C_FLAGS) -o $@ | |||
.cpp.o: | |||
$(CXX) -c $< $(CARLA_BUILD_FLAGS) -o $@ | |||
$(CXX) -c $< $(CARLA_CXX_FLAGS) -o $@ | |||
clean: | |||
rm -f *.o lv2-rtmempool/*.o *.so *.dll |
@@ -203,23 +203,29 @@ CarlaPluginThread::CarlaPluginThread(CarlaPlugin* plugin, PluginThreadMode mode) | |||
{ | |||
qDebug("CarlaPluginThread::CarlaPluginThread(%p, %i)", plugin, mode); | |||
m_process = new QProcess(nullptr); | |||
m_process = nullptr; | |||
} | |||
CarlaPluginThread::~CarlaPluginThread() | |||
{ | |||
delete m_process; | |||
if (m_process) | |||
delete m_process; | |||
} | |||
void CarlaPluginThread::setOscData(const char* binary, const char* label, const char* data1) | |||
void CarlaPluginThread::setOscData(const char* binary, const char* label, const char* data1, const char* data2, const char* data3) | |||
{ | |||
m_binary = QString(binary); | |||
m_label = QString(label); | |||
m_data1 = QString(data1); | |||
m_data2 = QString(data2); | |||
m_data3 = QString(data3); | |||
} | |||
void CarlaPluginThread::run() | |||
{ | |||
if (m_process == nullptr) | |||
m_process = new QProcess(nullptr); | |||
QStringList arguments; | |||
switch (m_mode) | |||
@@ -232,9 +238,12 @@ void CarlaPluginThread::run() | |||
break; | |||
case PLUGIN_THREAD_LV2_GUI: | |||
//arguments << QString("%1/%2").arg(get_host_osc_url()).arg(m_plugin->id()); | |||
//arguments << m_label; | |||
//arguments << QString("%1 (GUI)").arg(m_plugin->name()); | |||
/* osc_url */ arguments << QString("%1/%2").arg(get_host_osc_url()).arg(m_plugin->id()); | |||
/* URI */ arguments << m_label; | |||
/* ui-URI */ arguments << m_data1; | |||
/* ui-filename */ arguments << m_data2; | |||
/* ui-bundle */ arguments << m_data3; | |||
/* ui-title */ arguments << QString("%1 (GUI)").arg(m_plugin->name()); | |||
break; | |||
case PLUGIN_THREAD_BRIDGE: | |||
@@ -243,6 +252,7 @@ void CarlaPluginThread::run() | |||
/* filename */ arguments << m_plugin->filename(); | |||
/* label */ arguments << m_label; | |||
break; | |||
default: | |||
break; | |||
} | |||
@@ -253,6 +263,7 @@ void CarlaPluginThread::run() | |||
switch (m_mode) | |||
{ | |||
case PLUGIN_THREAD_DSSI_GUI: | |||
case PLUGIN_THREAD_LV2_GUI: | |||
if (m_plugin->update_osc_gui()) | |||
{ | |||
m_process->waitForFinished(-1); | |||
@@ -50,7 +50,8 @@ public: | |||
CarlaPluginThread(CarlaPlugin* plugin, PluginThreadMode mode); | |||
~CarlaPluginThread(); | |||
void setOscData(const char* binary, const char* label, const char* data1=""); | |||
void startNow(); | |||
void setOscData(const char* binary, const char* label, const char* data1="", const char* data2="", const char* data3=""); | |||
protected: | |||
virtual void run(); | |||
@@ -62,6 +63,8 @@ private: | |||
QString m_binary; | |||
QString m_label; | |||
QString m_data1; | |||
QString m_data2; | |||
QString m_data3; | |||
QProcess* m_process; | |||
}; | |||
@@ -19,8 +19,6 @@ | |||
#include "dssi/dssi.h" | |||
#include <QtCore/QStringList> | |||
class DssiPlugin : public CarlaPlugin | |||
{ | |||
public: | |||
@@ -50,7 +48,6 @@ public: | |||
{ | |||
if (osc.data.target) | |||
{ | |||
qDebug("DSSI GUI close - sending UI hide & quit"); | |||
osc_send_hide(&osc.data); | |||
osc_send_quit(&osc.data); | |||
} | |||
@@ -72,8 +69,6 @@ public: | |||
delete osc.thread; | |||
} | |||
else | |||
qDebug("DSSI GUI close - no thread registered"); | |||
osc_clear_data(&osc.data); | |||
} | |||
@@ -387,7 +387,7 @@ rtsafe_memory_pool_create2( | |||
void | |||
rtmempool_allocator_init( | |||
struct lv2_rtsafe_memory_pool_provider * allocator_ptr) | |||
lv2_rtsafe_memory_pool_provider * allocator_ptr) | |||
{ | |||
allocator_ptr->create = rtsafe_memory_pool_create2; | |||
allocator_ptr->destroy = rtsafe_memory_pool_destroy; | |||
@@ -167,24 +167,31 @@ public: | |||
break; | |||
case GUI_EXTERNAL_OSC: | |||
// FIXME - fix dssi first, then copy | |||
// if (gui.visible) | |||
// osc_send_hide(&osc.data); | |||
// osc_send_quit(&osc.data); | |||
if (osc.data.target) | |||
{ | |||
osc_send_hide(&osc.data); | |||
osc_send_quit(&osc.data); | |||
} | |||
// if (osc.thread) | |||
// { | |||
// osc.thread->quit(); | |||
if (osc.thread) | |||
{ | |||
// Wait a bit first, try safe quit else force kill | |||
if (osc.thread->isRunning()) | |||
{ | |||
if (osc.thread->wait(2000) == false) | |||
osc.thread->quit(); | |||
// if (!osc.thread->wait(3000)) // 3 sec | |||
// qWarning("Failed to properly stop LV2 OSC GUI thread"); | |||
if (osc.thread->isRunning() && osc.thread->wait(1000) == false) | |||
{ | |||
qWarning("Failed to properly stop LV2 OSC-GUI thread"); | |||
osc.thread->terminate(); | |||
} | |||
} | |||
// delete osc.thread; | |||
// } | |||
delete osc.thread; | |||
} | |||
// osc_clear_data(&osc.data); | |||
osc_clear_data(&osc.data); | |||
break; | |||
@@ -2081,31 +2088,34 @@ public: | |||
if (is_bridged) | |||
{ | |||
gui.type = GUI_EXTERNAL_OSC; | |||
//osc.thread = lv2_thread; | |||
//CarlaPluginThread* lv2ui_thread = new Lv2OscGuiThread(); | |||
//lv2_thread->set_plugin_id(plugin->id); | |||
//lv2_thread->set_ui_type(UiType); | |||
//lv2_thread->start(); | |||
const char* osc_binary; | |||
switch (UiType) | |||
{ | |||
case LV2_UI_QT4: | |||
qDebug("Will use LV2 Qt4 UI, bridged"); | |||
osc_binary = nullptr; | |||
break; | |||
case LV2_UI_X11: | |||
qDebug("Will use LV2 X11 UI, bridged"); | |||
osc_binary = nullptr; | |||
break; | |||
case LV2_UI_GTK2: | |||
qDebug("Will use LV2 Gtk2 UI, bridged"); | |||
osc_binary = nullptr; | |||
break; | |||
default: | |||
qDebug("Will use LV2 Unknown UI, bridged"); | |||
osc_binary = nullptr; | |||
break; | |||
} | |||
if (osc_binary) | |||
{ | |||
gui.type = GUI_EXTERNAL_OSC; | |||
osc.thread = new CarlaPluginThread(this, CarlaPluginThread::PLUGIN_THREAD_LV2_GUI); | |||
osc.thread->setOscData("lv2-gtk here", descriptor->URI, ui.descriptor->URI, ui.rdf_descriptor->Binary, ui.rdf_descriptor->Bundle); | |||
} | |||
} | |||
else | |||
{ | |||
@@ -65,7 +65,6 @@ public: | |||
gui.width = 0; | |||
gui.height = 0; | |||
// FIXME? | |||
memset(midi_events, 0, sizeof(VstMidiEvent)*MAX_MIDI_EVENTS); | |||
for (unsigned short i=0; i<MAX_MIDI_EVENTS; i++) | |||
@@ -115,8 +114,7 @@ public: | |||
if (effect->flags & effFlagsIsSynth) | |||
return PLUGIN_CATEGORY_SYNTH; | |||
// TODO - try to get category from label | |||
return PLUGIN_CATEGORY_NONE; | |||
return get_category_from_name(m_name); | |||
} | |||
virtual long unique_id() | |||
@@ -175,6 +173,7 @@ public: | |||
virtual void set_parameter_value(uint32_t param_id, double value, bool gui_send, bool osc_send, bool callback_send) | |||
{ | |||
fix_parameter_value(value, param.ranges[param_id]); | |||
effect->setParameter(effect, param_id, value); | |||
CarlaPlugin::set_parameter_value(param_id, value, gui_send, osc_send, callback_send); | |||
} | |||