Add carla qtcreator projects, misc fixes

This commit is contained in:
falkTX 2012-04-02 14:45:29 +01:00
parent a718cb6283
commit a4d6c613c5
16 changed files with 151 additions and 31 deletions

5
.gitignore vendored
View File

@ -1,8 +1,8 @@
.directory
.fuse-*
.*.kate-swp
*~
*~
*.o
*.a
*.exe
@ -22,8 +22,9 @@ ui_*.h
carla-bridge-*
carla-discovery-*
c++/patchcanvas/PatchCanvas
c++/*/Makefile
c++/patchcanvas/PatchCanvas
src/carla*/qtcreator/Makefile
src/carla-includes/aeffect.h
src/carla-includes/aeffectx.h

View File

@ -26,7 +26,7 @@ WIN_LINK_FLAGS = -static $(LINK_FLAGS)
WIN_32BIT_FLAGS = $(32BIT_FLAGS)
WIN_64BIT_FLAGS = $(64BIT_FLAGS)
WINE_BUILD_FLAGS = $(BUILD_FLAGS)
WINE_BUILD_FLAGS = -fpermissive $(BUILD_FLAGS)
WINE_LINK_FLAGS = $(LINK_FLAGS)
WINE_32BIT_FLAGS = -L/usr/lib32/wine -L/usr/lib/i386-linux-gnu/wine $(32BIT_FLAGS)
WINE_64BIT_FLAGS = -L/usr/lib64/wine -L/usr/lib/x86_64-linux-gnu/wine $(64BIT_FLAGS)
@ -35,7 +35,7 @@ SOURCES = carla_bridge.cpp carla_osc.cpp ../carla/carla_jack.cpp ../carla/carla_
all:
@echo "Build type must be unix32, unix64, win32 or win64"
@echo "Build type must be unix32, unix64, win[e]32 or win[e]64"
unix32: carla-bridge-unix32

View File

@ -74,6 +74,7 @@ int main(int argc, char* argv[])
id = add_plugin_vst(filename, label);
break;
default:
id = -1;
break;
}
@ -110,13 +111,11 @@ int main(int argc, char* argv[])
if (close_now) break;
// FIXME
//usleep(50000); // 50 ms
msleep(50);
}
delete plugin;
}
}
else
{

View File

@ -37,14 +37,14 @@ void osc_clear_data(OscData* osc_data);
void osc_error_handler(int num, const char* msg, const char* path);
int osc_message_handler(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* user_data);
void osc_send_configure(OscData* osc_data, const char* key, const char* value);
void osc_send_control(OscData* osc_data, int param_id, double value);
void osc_send_program(OscData* osc_data, int program_id);
void osc_send_program_as_midi(OscData* osc_data, int bank, int program);
void osc_send_midi_program(OscData* osc_data, int bank, int program);
void osc_send_show(OscData* osc_data);
void osc_send_hide(OscData* osc_data);
void osc_send_quit(OscData* osc_data);
//void osc_send_configure(OscData* osc_data, const char* key, const char* value);
//void osc_send_control(OscData* osc_data, int param_id, double value);
//void osc_send_program(OscData* osc_data, int program_id);
//void osc_send_program_as_midi(OscData* osc_data, int bank, int program);
//void osc_send_midi_program(OscData* osc_data, int bank, int program);
//void osc_send_show(OscData* osc_data);
//void osc_send_hide(OscData* osc_data);
//void osc_send_quit(OscData* osc_data);
void osc_send_update();
void osc_send_bridge_ains_peak(int index, double value);

View File

@ -0,0 +1,23 @@
# QtCreator project file
CONFIG = warn_on qt release
TEMPLATE = app
VERSION = 0.5
TARGET = carla-bridge-qtcreator
SOURCES = ../carla_bridge.cpp ../carla_osc.cpp \
../../carla/carla_jack.cpp ../../carla/carla_shared.cpp \
../../carla/ladspa.cpp ../../carla/dssi.cpp ../../carla/vst.cpp
HEADERS = ../carla_osc.h \
../../carla/carla_backend.h ../../carla/carla_includes.h \
../../carla/carla_jack.h ../../carla/carla_plugin.h ../../carla/carla_shared.h
INCLUDEPATH = ../ ../../carla-includes ../../carla
#../../carla-includes/vestige
LIBS += -ldl -ljack -llo
DEFINES = BUILD_BRIDGE

View File

@ -37,7 +37,7 @@ endif
all:
@echo "Build type must be unix32, unix64, win32 or win64"
@echo "Build type must be unix32, unix64, win[e]32 or win[e]64"
unix32: carla-discovery-unix32

View File

@ -83,7 +83,7 @@ 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_VOLUME = 0x20;
const unsigned int PLUGIN_CAN_BALANCE = 0x40;
enum BinaryType {

View File

@ -0,0 +1,17 @@
# QtCreator project file
CONFIG = warn_on qt release
TEMPLATE = app
VERSION = 0.5
TARGET = carla-discovery-qtcreator
SOURCES = ../carla-discovery.cpp
INCLUDEPATH = ../../carla-includes
#../../carla-includes/vestige
LIBS += -ldl
DEFINES = BUILD_UNIX64

View File

@ -37,7 +37,7 @@ 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_VOLUME = 0x20;
const unsigned int PLUGIN_CAN_VOLUME = 0x20;
const unsigned int PLUGIN_CAN_BALANCE = 0x40;
// parameter hints

View File

@ -38,12 +38,17 @@
#endif
#ifdef Q_OS_WIN
#include <windows.h>
# include <windows.h>
# define sleep(t) Sleep(t * 1000)
# define msleep(t) Sleep(t)
# define usleep(t) Sleep(t / 1000)
#else
#include <dlfcn.h>
#ifndef __cdecl
#define __cdecl
#endif
# include <dlfcn.h>
# include <unistd.h>
# define msleep(t) usleep(t * 1000)
# ifndef __cdecl
# define __cdecl
# endif
#endif
// needed for qDebug/Warning/Critical sections
@ -73,7 +78,7 @@
#endif
// don't export symbols if in bridge mode
#if defined(BUILD_BRIDGE)
#ifdef BUILD_BRIDGE
# define CARLA_EXPORT
#else
# ifdef Q_OS_WIN

View File

@ -103,6 +103,8 @@ int carla_jack_process_callback(jack_nframes_t nframes, void* arg)
}
return 0;
}
#else
Q_UNUSED(arg);
#endif
#ifdef BUILD_BRIDGE
@ -135,6 +137,7 @@ void carla_jack_shutdown_callback(void*)
// -------------------------------------------------------------------------------------------------------------------
#ifndef BUILD_BRIDGE
bool carla_jack_init(const char* client_name)
{
carla_jack_client = jack_client_open(client_name, JackNullOption, nullptr);
@ -200,6 +203,7 @@ bool carla_jack_close()
carla_jack_client = nullptr;
return false;
}
#endif
bool carla_jack_register_plugin(CarlaPlugin* plugin, jack_client_t** client)
{
@ -234,3 +238,8 @@ bool carla_jack_register_plugin(CarlaPlugin* plugin, jack_client_t** client)
return false;
}
int carla_jack_port_name_size()
{
return jack_port_name_size();
}

View File

@ -27,6 +27,10 @@ int carla_jack_srate_callback(jack_nframes_t new_sample_rate, void* arg);
int carla_jack_process_callback(jack_nframes_t nframes, void* arg);
void carla_jack_shutdown_callback(void* arg);
#ifndef BUILD_BRIDGE
bool carla_jack_init(const char* client_name);
bool carla_jack_close();
#endif
bool carla_jack_register_plugin(CarlaPlugin* plugin, jack_client_t** client);
int carla_jack_port_name_size();

View File

@ -24,7 +24,6 @@
#include <cmath>
#include <cstring>
//#include <unistd.h>
#include <QtCore/QList>
#include <QtCore/QMutex>
@ -478,6 +477,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_control(&osc.data, PARAMETER_ACTIVE, value);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -501,6 +502,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_control(&osc.data, PARAMETER_DRYWET, value);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -524,6 +527,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_control(&osc.data, PARAMETER_VOLUME, value);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -547,6 +552,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_control(&osc.data, PARAMETER_BALANCE_LEFT, value);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -570,6 +577,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_control(&osc.data, PARAMETER_BALANCE_RIGHT, value);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -596,6 +605,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_control(&osc.data, index, value);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -697,6 +708,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_program(&osc.data, prog.current);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -726,6 +739,8 @@ public:
if (m_hints & PLUGIN_IS_BRIDGE)
osc_send_program(&osc.data, midiprog.current);
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -764,6 +779,8 @@ public:
// osc_send_note_off(&osc.data, m_id, note);
//}
}
#else
Q_UNUSED(osc_send);
#endif
if (callback_send)
@ -833,6 +850,7 @@ public:
post_events.lock.unlock();
}
#ifndef BUILD_BRIDGE
void update_osc_data(lo_address source, const char* url)
{
const char* host;
@ -902,6 +920,7 @@ public:
}
return false;
}
#endif
void remove_from_jack()
{
@ -1037,7 +1056,7 @@ public:
DWORD winErrorCode = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, winErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&winErrorString, 0, nullptr);
snprintf(libError, 2048, "%s: error code %li: %s", m_filename, winErrorCode, (const char*)winErrorString);
snprintf(libError, 2048, "%s: error code " P_INTPTR ": %s", m_filename, winErrorCode, (const char*)winErrorString);
LocalFree(winErrorString);
return libError;

View File

@ -47,6 +47,9 @@ const char* last_error = nullptr;
QMutex carla_proc_lock_var;
QMutex carla_midi_lock_var;
// carla_jack.cpp
int carla_jack_port_name_size();
// -------------------------------------------------------------------------------------------------------------------
// Exported symbols (API)
@ -105,18 +108,18 @@ short get_new_plugin_id()
const char* get_unique_name(const char* name)
{
//int max = jack_port_name_size()/2 - 5;
//if (carla_options.global_jack_client)
// max -= strlen(carla_client_name);
int max = carla_jack_port_name_size()/2 - 5;
if (carla_options.global_jack_client)
max -= strlen(get_host_client_name());
//qDebug("get_unique_name(%s) - truncated to %i", name, max);
qDebug("get_unique_name(%s) - truncated to %i", name, max);
QString qname(name);
if (qname.isEmpty())
qname = "(No name)";
//qname.truncate(max);
qname.truncate(max);
//qname.replace(":", "."); // ":" is used in JACK to split client/port names
for (unsigned short i=0; i<MAX_PLUGINS; i++)

View File

@ -1150,6 +1150,8 @@ public:
m_hints |= PLUGIN_HAS_GUI;
}
#else
Q_UNUSED(extra_stuff);
#endif
return true;

View File

@ -0,0 +1,38 @@
# QtCreator project file
CONFIG = warn_on qt release shared dll plugin
TEMPLATE = lib
VERSION = 0.5.0
SOURCES = \
../carla_backend.cpp \
../carla_bridge.cpp \
../carla_jack.cpp \
../carla_osc.cpp \
../carla_shared.cpp \
../carla_threads.cpp \
../ladspa.cpp \
../dssi.cpp \
../lv2.cpp \
../vst.cpp \
../sf2.cpp
HEADERS = \
../carla_includes.h \
../carla_backend.h \
../carla_jack.h \
../carla_osc.h \
../carla_plugin.h \
../carla_shared.h \
../carla_threads.h \
../ladspa_rdf.h \
../lv2_rdf.h
TARGET = carla_backend
INCLUDEPATH = \
# vestige \
../../carla-includes
LIBS += -ljack -llo -lpthread