@@ -46,7 +46,7 @@ POSIX_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(shell pkg-config --libs jack) -ldl | |||
WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORT -DPTW32_STATIC_LIB | |||
WIN_32BIT_FLAGS = $(32BIT_FLAGS) | |||
WIN_64BIT_FLAGS = $(64BIT_FLAGS) | |||
WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -mwindows -L../carla-jackbridge -lpthread | |||
WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -mwindows -L../carla-jackbridge -lpthread -lwinspool -lole32 -luuid -limm32 -lshell32 -lws2_32 | |||
# -------------------------------------------------------------- | |||
# UI bridges | |||
@@ -365,15 +365,12 @@ void CarlaEngineClient::setLatency(const uint32_t samples) | |||
CarlaEngine::CarlaEngine() | |||
: m_osc(this), | |||
m_thread(this) | |||
#ifdef Q_COMPILER_INITIALIZER_LISTS | |||
, | |||
m_thread(this), | |||
m_callbackPtr(nullptr), | |||
m_carlaPlugins{nullptr}, | |||
m_uniqueNames{nullptr}, | |||
m_insPeak{0.0}, | |||
m_outsPeak{0.0} | |||
#endif | |||
{ | |||
qDebug("CarlaEngine::CarlaEngine()"); | |||
@@ -386,20 +383,6 @@ CarlaEngine::CarlaEngine() | |||
m_aboutToClose = false; | |||
m_maxPluginNumber = 0; | |||
#ifndef Q_COMPILER_INITIALIZER_LISTS | |||
for (unsigned short i=0; i < MAX_PLUGINS; i++) | |||
{ | |||
m_carlaPlugins[i] = nullptr; | |||
m_uniqueNames[i] = nullptr; | |||
} | |||
for (unsigned short i=0; i < MAX_PLUGINS * MAX_PEAKS; i++) | |||
{ | |||
m_insPeak[i] = 0.0; | |||
m_outsPeak[i] = 0.0; | |||
} | |||
#endif | |||
} | |||
CarlaEngine::~CarlaEngine() | |||
@@ -159,12 +159,8 @@ struct CarlaEngineMidiEvent { | |||
CarlaEngineMidiEvent() | |||
: time(0), | |||
#ifdef Q_COMPILER_INITIALIZER_LISTS | |||
size(0), | |||
data{0} {} | |||
#else | |||
size(0) { data[0] = data[1] = data[2] = 0; } | |||
#endif | |||
}; | |||
/*! | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
* Carla common defines | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.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 | |||
@@ -15,22 +15,11 @@ | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_DEFINES_HPP | |||
#define CARLA_DEFINES_HPP | |||
//#ifdef __WINE__ | |||
//# define Q_CORE_EXPORT | |||
//# define Q_GUI_EXPORT | |||
//# define QT_NO_STL | |||
//#endif | |||
#ifndef __CARLA_DEFINES_HPP__ | |||
#define __CARLA_DEFINES_HPP__ | |||
#include <QtCore/Qt> | |||
// TESTING - remove later (QtCreator doesn't fully support this yet) | |||
#ifdef QTCREATOR_TEST | |||
# undef Q_COMPILER_INITIALIZER_LISTS | |||
#endif | |||
// If the compiler can't do C++11 lambdas, it most likely doesn't know about nullptr either | |||
#ifndef Q_COMPILER_LAMBDA | |||
# define nullptr (0) | |||
@@ -84,7 +73,7 @@ | |||
# define BINARY_NATIVE BINARY_WIN32 | |||
# endif | |||
#else | |||
# warning Unknown binary type | |||
# warning Unknown binary native | |||
# define BINARY_NATIVE BINARY_OTHER | |||
#endif | |||
@@ -108,4 +97,4 @@ | |||
# endif | |||
#endif | |||
#endif // CARLA_DEFINES_HPP | |||
#endif // __CARLA_DEFINES_HPP__ |
@@ -15,8 +15,8 @@ | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_MIDI_H | |||
#define CARLA_MIDI_H | |||
#ifndef __CARLA_MIDI_H__ | |||
#define __CARLA_MIDI_H__ | |||
#define MAX_MIDI_CHANNELS 16 | |||
@@ -135,4 +135,4 @@ | |||
#define MIDI_IS_CONTROL_EFFECT_CONTROL_1(control) ((control) == MIDI_CONTROL_EFFECT_CONTROL_1 || (control) == MIDI_CONTROL_EFFECT_CONTROL_1__LSB) | |||
#define MIDI_IS_CONTROL_EFFECT_CONTROL_2(control) ((control) == MIDI_CONTROL_EFFECT_CONTROL_2 || (control) == MIDI_CONTROL_EFFECT_CONTROL_2__LSB) | |||
#endif // CARLA_MIDI_H | |||
#endif // __CARLA_MIDI_H__ |
@@ -15,18 +15,20 @@ | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef LV2_ATOM_QUEUE_HPP | |||
#define LV2_ATOM_QUEUE_HPP | |||
#ifndef __LV2_ATOM_QUEUE_HPP__ | |||
#define __LV2_ATOM_QUEUE_HPP__ | |||
#include "carla_utils.hpp" | |||
#include "lv2/atom.h" | |||
#include <cstring> // memset | |||
#include <QtCore/QMutex> | |||
#include <cstring> // memcpy, memset | |||
#include <pthread.h> | |||
class Lv2AtomQueue | |||
{ | |||
public: | |||
Lv2AtomQueue() | |||
: mutex(PTHREAD_MUTEX_INITIALIZER) | |||
{ | |||
index = indexPool = 0; | |||
empty = true; | |||
@@ -38,8 +40,8 @@ public: | |||
void copyDataFrom(Lv2AtomQueue* const queue) | |||
{ | |||
// lock mutexes | |||
queue->mutex.lock(); | |||
mutex.lock(); | |||
queue->lock(); | |||
lock(); | |||
// copy data from queue | |||
::memcpy(data, queue->data, sizeof(datatype)*MAX_SIZE); | |||
@@ -50,7 +52,7 @@ public: | |||
full = queue->full; | |||
// unlock our mutex, no longer needed | |||
mutex.unlock(); | |||
unlock(); | |||
// reset queque | |||
::memset(queue->data, 0, sizeof(datatype)*MAX_SIZE); | |||
@@ -60,7 +62,7 @@ public: | |||
queue->full = false; | |||
// unlock queque mutex | |||
queue->mutex.unlock(); | |||
queue->unlock(); | |||
} | |||
bool isEmpty() | |||
@@ -73,17 +75,22 @@ public: | |||
return full; | |||
} | |||
void lock() | |||
bool lock() | |||
{ | |||
mutex.lock(); | |||
return (pthread_mutex_lock(&mutex) == 0); | |||
} | |||
void unlock() | |||
bool tryLock() | |||
{ | |||
mutex.unlock(); | |||
return (pthread_mutex_trylock(&mutex) == 0); | |||
} | |||
void put(const uint32_t portIndex, const LV2_Atom* const atom, const bool lock = true) | |||
bool unlock() | |||
{ | |||
return (pthread_mutex_unlock(&mutex) == 0); | |||
} | |||
void put(const uint32_t portIndex, const LV2_Atom* const atom) | |||
{ | |||
CARLA_ASSERT(atom && atom->size > 0); | |||
CARLA_ASSERT(indexPool + atom->size < MAX_POOL_SIZE); // overflow | |||
@@ -91,8 +98,7 @@ public: | |||
if (full || atom->size == 0 || indexPool + atom->size >= MAX_POOL_SIZE) | |||
return; | |||
if (lock) | |||
mutex.lock(); | |||
lock(); | |||
for (unsigned short i=0; i < MAX_SIZE; i++) | |||
{ | |||
@@ -110,19 +116,18 @@ public: | |||
} | |||
} | |||
if (lock) | |||
mutex.unlock(); | |||
unlock(); | |||
} | |||
bool get(uint32_t* const portIndex, const LV2_Atom** const atom, const bool lock = true) | |||
bool get(uint32_t* const portIndex, const LV2_Atom** const atom) | |||
{ | |||
CARLA_ASSERT(portIndex && atom); | |||
if (empty || ! (portIndex && atom)) | |||
return false; | |||
if (lock) | |||
mutex.lock(); | |||
if (! tryLock()) | |||
return false; | |||
full = false; | |||
@@ -131,9 +136,7 @@ public: | |||
index = indexPool = 0; | |||
empty = true; | |||
if (lock) | |||
mutex.unlock(); | |||
unlock(); | |||
return false; | |||
} | |||
@@ -151,9 +154,7 @@ public: | |||
index++; | |||
empty = false; | |||
if (lock) | |||
mutex.unlock(); | |||
unlock(); | |||
return true; | |||
} | |||
@@ -185,7 +186,7 @@ private: | |||
unsigned short index, indexPool; | |||
bool empty, full; | |||
QMutex mutex; | |||
pthread_mutex_t mutex; | |||
}; | |||
#endif // LV2_ATOM_QUEUE_HPP | |||
#endif // __LV2_ATOM_QUEUE_HPP__ |
@@ -1,6 +1,6 @@ | |||
/* | |||
* Custom types to store LV2 information | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.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 | |||
@@ -18,18 +18,15 @@ | |||
#ifndef LV2_RDF_INCLUDED | |||
#define LV2_RDF_INCLUDED | |||
// TODO - presets | |||
#include <cstdint> | |||
#include <cstdlib> | |||
// Base Types | |||
typedef const char* LV2_URI; | |||
typedef uint32_t LV2_Property; | |||
typedef unsigned long long LV2_PluginType; | |||
struct LV2_Type { | |||
LV2_Property Value; //... | |||
LV2_Property Value; | |||
LV2_URI URI; | |||
LV2_Type() | |||
@@ -209,11 +206,6 @@ struct LV2_Type { | |||
#define LV2_IS_PORT_DESIGNATION_TIME_SPEED(x) ((x) == LV2_PORT_DESIGNATION_TIME_SPEED) | |||
#define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_SPEED) | |||
// Preset State Types (TODO: Null is not a type, this is just a placeholder) | |||
#define LV2_PRESET_STATE_NULL 0x0 | |||
#define LV2_IS_PRESET_STATE_NULL(x) ((x) == LV2_PRESET_STATE_NULL) | |||
// Feature Types | |||
#define LV2_FEATURE_OPTIONAL 0x1 | |||
#define LV2_FEATURE_REQUIRED 0x2 | |||
@@ -243,47 +235,49 @@ struct LV2_Type { | |||
#define LV2_IS_UI_OLD_EXTERNAL(x) ((x) == LV2_UI_OLD_EXTERNAL) | |||
// Plugin Types | |||
#define LV2_PLUGIN_ALLPASS 0x000000001LL | |||
#define LV2_PLUGIN_AMPLIFIER 0x000000002LL | |||
#define LV2_PLUGIN_ANALYSER 0x000000004LL | |||
#define LV2_PLUGIN_BANDPASS 0x000000008LL | |||
#define LV2_PLUGIN_CHORUS 0x000000010LL | |||
#define LV2_PLUGIN_COMB 0x000000020LL | |||
#define LV2_PLUGIN_COMPRESSOR 0x000000040LL | |||
#define LV2_PLUGIN_CONSTANT 0x000000080LL | |||
#define LV2_PLUGIN_CONVERTER 0x000000100LL | |||
#define LV2_PLUGIN_DELAY 0x000000200LL | |||
#define LV2_PLUGIN_DISTORTION 0x000000400LL | |||
#define LV2_PLUGIN_DYNAMICS 0x000000800LL | |||
#define LV2_PLUGIN_EQ 0x000001000LL | |||
#define LV2_PLUGIN_EXPANDER 0x000002000LL | |||
#define LV2_PLUGIN_FILTER 0x000004000LL | |||
#define LV2_PLUGIN_FLANGER 0x000008000LL | |||
#define LV2_PLUGIN_FUNCTION 0x000010000LL | |||
#define LV2_PLUGIN_GATE 0x000020000LL | |||
#define LV2_PLUGIN_GENERATOR 0x000040000LL | |||
#define LV2_PLUGIN_HIGHPASS 0x000080000LL | |||
#define LV2_PLUGIN_INSTRUMENT 0x000100000LL | |||
#define LV2_PLUGIN_LIMITER 0x000200000LL | |||
#define LV2_PLUGIN_LOWPASS 0x000400000LL | |||
#define LV2_PLUGIN_MIXER 0x000800000LL | |||
#define LV2_PLUGIN_MODULATOR 0x001000000LL | |||
#define LV2_PLUGIN_MULTI_EQ 0x002000000LL | |||
#define LV2_PLUGIN_OSCILLATOR 0x004000000LL | |||
#define LV2_PLUGIN_PARA_EQ 0x008000000LL | |||
#define LV2_PLUGIN_PHASER 0x010000000LL | |||
#define LV2_PLUGIN_PITCH 0x020000000LL | |||
#define LV2_PLUGIN_REVERB 0x040000000LL | |||
#define LV2_PLUGIN_SIMULATOR 0x080000000LL | |||
#define LV2_PLUGIN_SPATIAL 0x100000000LL | |||
#define LV2_PLUGIN_SPECTRAL 0x200000000LL | |||
#define LV2_PLUGIN_UTILITY 0x400000000LL | |||
#define LV2_PLUGIN_WAVESHAPER 0x800000000LL | |||
#define LV2_PLUGIN_DELAY 0x000001 | |||
#define LV2_PLUGIN_REVERB 0x000002 | |||
#define LV2_PLUGIN_SIMULATOR 0x000004 | |||
#define LV2_PLUGIN_DISTORTION 0x000008 | |||
#define LV2_PLUGIN_WAVESHAPER 0x000010 | |||
#define LV2_PLUGIN_DYNAMICS 0x000020 | |||
#define LV2_PLUGIN_AMPLIFIER 0x000040 | |||
#define LV2_PLUGIN_COMPRESSOR 0x000080 | |||
#define LV2_PLUGIN_ENVELOPE 0x000100 | |||
#define LV2_PLUGIN_EXPANDER 0x000200 | |||
#define LV2_PLUGIN_GATE 0x000400 | |||
#define LV2_PLUGIN_LIMITER 0x000800 | |||
#define LV2_PLUGIN_EQ 0x001000 | |||
#define LV2_PLUGIN_MULTI_EQ 0x002000 | |||
#define LV2_PLUGIN_PARA_EQ 0x004000 | |||
#define LV2_PLUGIN_FILTER 0x008000 | |||
#define LV2_PLUGIN_ALLPASS 0x010000 | |||
#define LV2_PLUGIN_BANDPASS 0x020000 | |||
#define LV2_PLUGIN_COMB 0x040000 | |||
#define LV2_PLUGIN_HIGHPASS 0x080000 | |||
#define LV2_PLUGIN_LOWPASS 0x100000 | |||
#define LV2_PLUGIN_GENERATOR 0x000001 | |||
#define LV2_PLUGIN_CONSTANT 0x000002 | |||
#define LV2_PLUGIN_INSTRUMENT 0x000004 | |||
#define LV2_PLUGIN_OSCILLATOR 0x000008 | |||
#define LV2_PLUGIN_MODULATOR 0x000010 | |||
#define LV2_PLUGIN_CHORUS 0x000020 | |||
#define LV2_PLUGIN_FLANGER 0x000040 | |||
#define LV2_PLUGIN_PHASER 0x000080 | |||
#define LV2_PLUGIN_SPATIAL 0x000100 | |||
#define LV2_PLUGIN_SPECTRAL 0x000200 | |||
#define LV2_PLUGIN_PITCH 0x000400 | |||
#define LV2_PLUGIN_UTILITY 0x000800 | |||
#define LV2_PLUGIN_ANALYSER 0x001000 | |||
#define LV2_PLUGIN_CONVERTER 0x002000 | |||
#define LV2_PLUGIN_FUNCTION 0x008000 | |||
#define LV2_PLUGIN_MIXER 0x010000 | |||
#define LV2_GROUP_DELAY (LV2_PLUGIN_DELAY|LV2_PLUGIN_REVERB) | |||
#define LV2_GROUP_DISTORTION (LV2_PLUGIN_DISTORTION|LV2_PLUGIN_WAVESHAPER) | |||
#define LV2_GROUP_DYNAMICS (LV2_PLUGIN_DYNAMICS|LV2_PLUGIN_AMPLIFIER|LV2_PLUGIN_COMPRESSOR|LV2_PLUGIN_EXPANDER|LV2_PLUGIN_GATE|LV2_PLUGIN_LIMITER) | |||
#define LV2_GROUP_EQ (LV2_PLUGIN_EQ|LV2_PLUGIN_PARA_EQ|LV2_PLUGIN_MULTI_EQ) | |||
#define LV2_GROUP_DYNAMICS (LV2_PLUGIN_DYNAMICS|LV2_PLUGIN_AMPLIFIER|LV2_PLUGIN_COMPRESSOR|LV2_PLUGIN_ENVELOPE|LV2_PLUGIN_EXPANDER|LV2_PLUGIN_GATE|LV2_PLUGIN_LIMITER) | |||
#define LV2_GROUP_EQ (LV2_PLUGIN_EQ|LV2_PLUGIN_MULTI_EQ|LV2_PLUGIN_PARA_EQ) | |||
#define LV2_GROUP_FILTER (LV2_PLUGIN_FILTER|LV2_PLUGIN_ALLPASS|LV2_PLUGIN_BANDPASS|LV2_PLUGIN_COMB|LV2_GROUP_EQ|LV2_PLUGIN_HIGHPASS|LV2_PLUGIN_LOWPASS) | |||
#define LV2_GROUP_GENERATOR (LV2_PLUGIN_GENERATOR|LV2_PLUGIN_CONSTANT|LV2_PLUGIN_INSTRUMENT|LV2_PLUGIN_OSCILLATOR) | |||
#define LV2_GROUP_MODULATOR (LV2_PLUGIN_MODULATOR|LV2_PLUGIN_CHORUS|LV2_PLUGIN_FLANGER|LV2_PLUGIN_PHASER) | |||
@@ -293,18 +287,18 @@ struct LV2_Type { | |||
#define LV2_GROUP_SPECTRAL (LV2_PLUGIN_SPECTRAL|LV2_PLUGIN_PITCH) | |||
#define LV2_GROUP_UTILITY (LV2_PLUGIN_UTILITY|LV2_PLUGIN_ANALYSER|LV2_PLUGIN_CONVERTER|LV2_PLUGIN_FUNCTION|LV2_PLUGIN_MIXER) | |||
#define LV2_IS_DELAY(x) ((x) & LV2_GROUP_DELAY) | |||
#define LV2_IS_DISTORTION(x) ((x) & LV2_GROUP_DISTORTION) | |||
#define LV2_IS_DYNAMICS(x) ((x) & LV2_GROUP_DYNAMICS) | |||
#define LV2_IS_EQ(x) ((x) & LV2_GROUP_EQ) | |||
#define LV2_IS_FILTER(x) ((x) & LV2_GROUP_FILTER) | |||
#define LV2_IS_GENERATOR(x) ((x) & LV2_GROUP_GENERATOR) | |||
#define LV2_IS_MODULATOR(x) ((x) & LV2_GROUP_MODULATOR) | |||
#define LV2_IS_REVERB(x) ((x) & LV2_GROUP_REVERB) | |||
#define LV2_IS_SIMULATOR(x) ((x) & LV2_GROUP_SIMULATOR) | |||
#define LV2_IS_SPATIAL(x) ((x) & LV2_GROUP_SPATIAL) | |||
#define LV2_IS_SPECTRAL(x) ((x) & LV2_GROUP_SPECTRAL) | |||
#define LV2_IS_UTILITY(x) ((x) & LV2_GROUP_UTILITY) | |||
#define LV2_IS_DELAY(x, y) (((x) & LV2_GROUP_DELAY) || ((y) & LV2_GROUP_DELAY)) | |||
#define LV2_IS_DISTORTION(x, y) (((x) & LV2_GROUP_DISTORTION) || ((y) & LV2_GROUP_DISTORTION)) | |||
#define LV2_IS_DYNAMICS(x, y) (((x) & LV2_GROUP_DYNAMICS) || ((y) & LV2_GROUP_DYNAMICS)) | |||
#define LV2_IS_EQ(x, y) (((x) & LV2_GROUP_EQ) || ((y) & LV2_GROUP_EQ)) | |||
#define LV2_IS_FILTER(x, y) (((x) & LV2_GROUP_FILTER) || ((y) & LV2_GROUP_FILTER)) | |||
#define LV2_IS_GENERATOR(x, y) (((x) & LV2_GROUP_GENERATOR) || ((y) & LV2_GROUP_GENERATOR)) | |||
#define LV2_IS_MODULATOR(x, y) (((x) & LV2_GROUP_MODULATOR) || ((y) & LV2_GROUP_MODULATOR)) | |||
#define LV2_IS_REVERB(x, y) (((x) & LV2_GROUP_REVERB) || ((y) & LV2_GROUP_REVERB)) | |||
#define LV2_IS_SIMULATOR(x, y) (((x) & LV2_GROUP_SIMULATOR) || ((y) & LV2_GROUP_SIMULATOR)) | |||
#define LV2_IS_SPATIAL(x, y) (((x) & LV2_GROUP_SPATIAL) || ((y) & LV2_GROUP_SPATIAL)) | |||
#define LV2_IS_SPECTRAL(x, y) (((x) & LV2_GROUP_SPECTRAL) || ((y) & LV2_GROUP_SPECTRAL)) | |||
#define LV2_IS_UTILITY(x, y) (((x) & LV2_GROUP_UTILITY) || ((y) & LV2_GROUP_UTILITY)) | |||
// Port Midi Map | |||
struct LV2_RDF_PortMidiMap { | |||
@@ -376,7 +370,7 @@ struct LV2_RDF_PortScalePoint { | |||
// Port | |||
struct LV2_RDF_Port { | |||
LV2_Type Type; | |||
LV2_Property Types; | |||
LV2_Property Properties; | |||
LV2_Property Designation; | |||
const char* Name; | |||
@@ -390,7 +384,8 @@ struct LV2_RDF_Port { | |||
LV2_RDF_PortScalePoint* ScalePoints; | |||
LV2_RDF_Port() | |||
: Properties(0x0), | |||
: Types(0x0), | |||
Properties(0x0), | |||
Designation(0), | |||
Name(nullptr), | |||
Symbol(nullptr), | |||
@@ -410,59 +405,14 @@ struct LV2_RDF_Port { | |||
} | |||
}; | |||
// Preset Port | |||
struct LV2_RDF_PresetPort { | |||
const char* Symbol; | |||
float Value; | |||
LV2_RDF_PresetPort() | |||
: Symbol(nullptr), | |||
Value(0.0f) {} | |||
~LV2_RDF_PresetPort() | |||
{ | |||
if (Symbol) | |||
::free((void*)Symbol); | |||
} | |||
}; | |||
// Preset State | |||
struct LV2_RDF_PresetState { | |||
LV2_Property Type; | |||
const char* Key; | |||
union { | |||
// TODO | |||
} Value; | |||
LV2_RDF_PresetState() | |||
: Type(0), | |||
Key(nullptr) {} | |||
~LV2_RDF_PresetState() | |||
{ | |||
if (Key) | |||
::free((void*)Key); | |||
} | |||
}; | |||
// Preset | |||
struct LV2_RDF_Preset { | |||
LV2_URI URI; | |||
const char* Label; | |||
uint32_t PortCount; | |||
LV2_RDF_PresetPort* Ports; | |||
uint32_t StateCount; | |||
LV2_RDF_PresetState* States; | |||
LV2_RDF_Preset() | |||
: URI(nullptr), | |||
Label(nullptr), | |||
PortCount(0), | |||
Ports(nullptr), | |||
StateCount(0), | |||
States(nullptr) {} | |||
Label(nullptr) {} | |||
~LV2_RDF_Preset() | |||
{ | |||
@@ -471,12 +421,6 @@ struct LV2_RDF_Preset { | |||
if (Label) | |||
::free((void*)Label); | |||
if (Ports) | |||
delete[] Ports; | |||
if (States) | |||
delete[] States; | |||
} | |||
}; | |||
@@ -539,7 +483,7 @@ struct LV2_RDF_UI { | |||
// Plugin | |||
struct LV2_RDF_Descriptor { | |||
LV2_PluginType Type; | |||
LV2_Property Type[2]; | |||
LV2_URI URI; | |||
const char* Name; | |||
const char* Author; | |||
@@ -564,7 +508,7 @@ struct LV2_RDF_Descriptor { | |||
LV2_RDF_UI* UIs; | |||
LV2_RDF_Descriptor() | |||
: Type(0x0), | |||
: Type{0x0, 0x0}, | |||
URI(nullptr), | |||
Name(nullptr), | |||
Author(nullptr), | |||
@@ -223,8 +223,10 @@ uint32_t CarlaPlugin::parameterCount() const | |||
uint32_t CarlaPlugin::parameterScalePointCount(const uint32_t parameterId) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
return 0; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
} | |||
uint32_t CarlaPlugin::programCount() const | |||
@@ -308,8 +310,10 @@ const CustomData* CarlaPlugin::customData(const size_t index) const | |||
int32_t CarlaPlugin::chunkData(void** const dataPtr) | |||
{ | |||
CARLA_ASSERT(dataPtr); | |||
return 0; | |||
// unused | |||
Q_UNUSED(dataPtr); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -318,16 +322,21 @@ int32_t CarlaPlugin::chunkData(void** const dataPtr) | |||
double CarlaPlugin::getParameterValue(const uint32_t parameterId) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
return 0.0; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
} | |||
double CarlaPlugin::getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
return 0.0; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
Q_UNUSED(scalePointId); | |||
} | |||
void CarlaPlugin::getLabel(char* const strBuf) | |||
@@ -353,37 +362,53 @@ void CarlaPlugin::getRealName(char* const strBuf) | |||
void CarlaPlugin::getParameterName(const uint32_t parameterId, char* const strBuf) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
*strBuf = 0; | |||
return; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
} | |||
void CarlaPlugin::getParameterSymbol(const uint32_t parameterId, char* const strBuf) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
*strBuf = 0; | |||
return; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
} | |||
void CarlaPlugin::getParameterText(const uint32_t parameterId, char* const strBuf) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
*strBuf = 0; | |||
return; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
} | |||
void CarlaPlugin::getParameterUnit(const uint32_t parameterId, char* const strBuf) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
*strBuf = 0; | |||
return; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
} | |||
void CarlaPlugin::getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf) | |||
{ | |||
CARLA_ASSERT(parameterId < param.count); | |||
CARLA_ASSERT(scalePointId < parameterScalePointCount(parameterId)); | |||
*strBuf = 0; | |||
return; | |||
// unused | |||
Q_UNUSED(parameterId); | |||
Q_UNUSED(scalePointId); | |||
} | |||
void CarlaPlugin::getProgramName(const uint32_t index, char* const strBuf) | |||
@@ -408,6 +433,13 @@ void CarlaPlugin::getMidiProgramName(const uint32_t index, char* const strBuf) | |||
void CarlaPlugin::getParameterCountInfo(uint32_t* const ins, uint32_t* const outs, uint32_t* const total) | |||
{ | |||
CARLA_ASSERT(ins); | |||
CARLA_ASSERT(outs); | |||
CARLA_ASSERT(total); | |||
if (! (ins && outs && total)) | |||
return; | |||
*ins = 0; | |||
*outs = 0; | |||
*total = param.count; | |||
@@ -423,6 +455,12 @@ void CarlaPlugin::getParameterCountInfo(uint32_t* const ins, uint32_t* const out | |||
void CarlaPlugin::getGuiInfo(GuiType* const type, bool* const resizable) | |||
{ | |||
CARLA_ASSERT(type); | |||
CARLA_ASSERT(resizable); | |||
if (! (type && resizable)) | |||
return; | |||
*type = GUI_NONE; | |||
*resizable = false; | |||
} | |||
@@ -714,6 +752,10 @@ void CarlaPlugin::setCustomData(const char* const type, const char* const key, c | |||
void CarlaPlugin::setChunkData(const char* const stringData) | |||
{ | |||
CARLA_ASSERT(stringData); | |||
return; | |||
// unused | |||
Q_UNUSED(stringData); | |||
} | |||
void CarlaPlugin::setProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block) | |||
@@ -1339,6 +1381,9 @@ void CarlaPlugin::postEventsRun() | |||
void CarlaPlugin::postEventHandleCustom(const int32_t value1, const int32_t value2, const double value3, const void* const cdata) | |||
{ | |||
return; | |||
// unused | |||
Q_UNUSED(value1); | |||
Q_UNUSED(value2); | |||
Q_UNUSED(value3); | |||
@@ -1348,18 +1393,29 @@ void CarlaPlugin::postEventHandleCustom(const int32_t value1, const int32_t valu | |||
void CarlaPlugin::uiParameterChange(const uint32_t index, const double value) | |||
{ | |||
CARLA_ASSERT(index < param.count); | |||
return; | |||
// unused | |||
Q_UNUSED(index); | |||
Q_UNUSED(value); | |||
} | |||
void CarlaPlugin::uiProgramChange(const uint32_t index) | |||
{ | |||
CARLA_ASSERT(index < prog.count); | |||
return; | |||
// unused | |||
Q_UNUSED(index); | |||
} | |||
void CarlaPlugin::uiMidiProgramChange(const uint32_t index) | |||
{ | |||
CARLA_ASSERT(index < midiprog.count); | |||
return; | |||
// unused | |||
Q_UNUSED(index); | |||
} | |||
void CarlaPlugin::uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) | |||
@@ -1367,12 +1423,23 @@ void CarlaPlugin::uiNoteOn(const uint8_t channel, const uint8_t note, const uint | |||
CARLA_ASSERT(channel < 16); | |||
CARLA_ASSERT(note < 128); | |||
CARLA_ASSERT(velo > 0 && velo < 128); | |||
return; | |||
// unused | |||
Q_UNUSED(channel); | |||
Q_UNUSED(note); | |||
Q_UNUSED(velo); | |||
} | |||
void CarlaPlugin::uiNoteOff(const uint8_t channel, const uint8_t note) | |||
{ | |||
CARLA_ASSERT(channel < 16); | |||
CARLA_ASSERT(note < 128); | |||
return; | |||
// unused | |||
Q_UNUSED(channel); | |||
Q_UNUSED(note); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -2,9 +2,9 @@ | |||
QT = core gui | |||
CONFIG = debug | |||
CONFIG += static | |||
#CONFIG = debug | |||
CONFIG += link_pkgconfig qt warn_on | |||
CONFIG += dll shared | |||
DEFINES = DEBUG | |||
DEFINES += QTCREATOR_TEST | |||
@@ -13,15 +13,17 @@ DEFINES += QTCREATOR_TEST | |||
DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | |||
# Samplers | |||
DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER | |||
DEFINES += WANT_FLUIDSYNTH | |||
# WANT_LINUXSAMPLER | |||
# ZynAddSubFX | |||
DEFINES += WANT_ZYNADDSUBFX | |||
# Misc | |||
DEFINES += WANT_SUIL | |||
#DEFINES += WANT_SUIL | |||
PKGCONFIG = liblo suil-0 fluidsynth linuxsampler | |||
PKGCONFIG = liblo fluidsynth | |||
#suil-0 linuxsampler | |||
TARGET = carla_plugin | |||
TEMPLATE = lib | |||
@@ -71,7 +71,9 @@ void CarlaPluginThread::run() | |||
{ | |||
m_process = new QProcess(nullptr); | |||
m_process->setProcessChannelMode(QProcess::ForwardedChannels); | |||
#ifndef BUILD_BRIDGE | |||
m_process->setProcessEnvironment(engine->getOptionsAsProcessEnvironment()); | |||
#endif | |||
} | |||
QString name(plugin->name() ? plugin->name() : "(none)"); | |||
@@ -798,6 +798,7 @@ public: | |||
midiprog.data[i].name = strdup(pdesc->Name ? pdesc->Name : ""); | |||
} | |||
#ifndef BUILD_BRIDGE | |||
// Update OSC Names | |||
if (x_engine->isOscControlRegistered()) | |||
{ | |||
@@ -806,6 +807,7 @@ public: | |||
for (i=0; i < midiprog.count; i++) | |||
x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | |||
} | |||
#endif | |||
if (init) | |||
{ | |||
@@ -497,31 +497,32 @@ public: | |||
if (rdf_descriptor) | |||
{ | |||
LV2_Property category = rdf_descriptor->Type; | |||
LV2_Property cat1 = rdf_descriptor->Type[0]; | |||
LV2_Property cat2 = rdf_descriptor->Type[1]; | |||
if (LV2_IS_DELAY(category)) | |||
if (LV2_IS_DELAY(cat1, cat2)) | |||
return PLUGIN_CATEGORY_DELAY; | |||
if (LV2_IS_DISTORTION(category)) | |||
if (LV2_IS_DISTORTION(cat1, cat2)) | |||
return PLUGIN_CATEGORY_OTHER; | |||
if (LV2_IS_DYNAMICS(category)) | |||
if (LV2_IS_DYNAMICS(cat1, cat2)) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (LV2_IS_EQ(category)) | |||
if (LV2_IS_EQ(cat1, cat2)) | |||
return PLUGIN_CATEGORY_EQ; | |||
if (LV2_IS_FILTER(category)) | |||
if (LV2_IS_FILTER(cat1, cat2)) | |||
return PLUGIN_CATEGORY_FILTER; | |||
if (LV2_IS_GENERATOR(category)) | |||
if (LV2_IS_GENERATOR(cat1, cat2)) | |||
return PLUGIN_CATEGORY_SYNTH; | |||
if (LV2_IS_MODULATOR(category)) | |||
if (LV2_IS_MODULATOR(cat1, cat2)) | |||
return PLUGIN_CATEGORY_MODULATOR; | |||
if (LV2_IS_REVERB(category)) | |||
if (LV2_IS_REVERB(cat1, cat2)) | |||
return PLUGIN_CATEGORY_DELAY; | |||
if (LV2_IS_SIMULATOR(category)) | |||
if (LV2_IS_SIMULATOR(cat1, cat2)) | |||
return PLUGIN_CATEGORY_OTHER; | |||
if (LV2_IS_SPATIAL(category)) | |||
if (LV2_IS_SPATIAL(cat1, cat2)) | |||
return PLUGIN_CATEGORY_OTHER; | |||
if (LV2_IS_SPECTRAL(category)) | |||
if (LV2_IS_SPECTRAL(cat1, cat2)) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
if (LV2_IS_UTILITY(category)) | |||
if (LV2_IS_UTILITY(cat1, cat2)) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
} | |||
@@ -1067,13 +1068,13 @@ public: | |||
// Update event ports | |||
if (! atomQueueOut.isEmpty()) | |||
{ | |||
static Lv2AtomQueue queue; | |||
Lv2AtomQueue queue; | |||
queue.copyDataFrom(&atomQueueOut); | |||
uint32_t portIndex; | |||
const LV2_Atom* atom; | |||
while (queue.get(&portIndex, &atom, false)) | |||
while (queue.get(&portIndex, &atom)) | |||
{ | |||
if (gui.type == GUI_EXTERNAL_OSC) | |||
{ | |||
@@ -1130,44 +1131,44 @@ public: | |||
for (uint32_t i=0; i < portCount; i++) | |||
{ | |||
const LV2_Property portType = rdf_descriptor->Ports[i].Type.Value; | |||
const LV2_Property portTypes = rdf_descriptor->Ports[i].Types; | |||
if (LV2_IS_PORT_AUDIO(portType)) | |||
if (LV2_IS_PORT_AUDIO(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
aIns += 1; | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
aOuts += 1; | |||
} | |||
else if (LV2_IS_PORT_CV(portType)) | |||
else if (LV2_IS_PORT_CV(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
cvIns += 1; | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
cvOuts += 1; | |||
} | |||
else if (LV2_IS_PORT_ATOM_SEQUENCE(portType)) | |||
else if (LV2_IS_PORT_ATOM_SEQUENCE(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
evIns.push_back(CARLA_EVENT_DATA_ATOM); | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
evOuts.push_back(CARLA_EVENT_DATA_ATOM); | |||
} | |||
else if (LV2_IS_PORT_EVENT(portType)) | |||
else if (LV2_IS_PORT_EVENT(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
evIns.push_back(CARLA_EVENT_DATA_EVENT); | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
evOuts.push_back(CARLA_EVENT_DATA_EVENT); | |||
} | |||
else if (LV2_IS_PORT_MIDI_LL(portType)) | |||
else if (LV2_IS_PORT_MIDI_LL(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
evIns.push_back(CARLA_EVENT_DATA_MIDI_LL); | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
evOuts.push_back(CARLA_EVENT_DATA_MIDI_LL); | |||
} | |||
else if (LV2_IS_PORT_CONTROL(portType)) | |||
else if (LV2_IS_PORT_CONTROL(portTypes)) | |||
params += 1; | |||
} | |||
@@ -1300,9 +1301,9 @@ public: | |||
for (uint32_t i=0; i < portCount; i++) | |||
{ | |||
const LV2_Property portType = rdf_descriptor->Ports[i].Type.Value; | |||
const LV2_Property portTypes = rdf_descriptor->Ports[i].Types; | |||
if (LV2_IS_PORT_AUDIO(portType) || LV2_IS_PORT_ATOM_SEQUENCE(portType) || LV2_IS_PORT_CV(portType) || LV2_IS_PORT_EVENT(portType) || LV2_IS_PORT_MIDI_LL(portType)) | |||
if (LV2_IS_PORT_AUDIO(portTypes) || LV2_IS_PORT_ATOM_SEQUENCE(portTypes) || LV2_IS_PORT_CV(portTypes) || LV2_IS_PORT_EVENT(portTypes) || LV2_IS_PORT_MIDI_LL(portTypes)) | |||
{ | |||
portName.clear(); | |||
@@ -1316,9 +1317,9 @@ public: | |||
portName.truncate(portNameSize); | |||
} | |||
if (LV2_IS_PORT_AUDIO(portType)) | |||
if (LV2_IS_PORT_AUDIO(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
{ | |||
j = aIn.count++; | |||
aIn.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); | |||
@@ -1331,7 +1332,7 @@ public: | |||
aIn.rindexes[1] = i; | |||
} | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
{ | |||
j = aOut.count++; | |||
aOut.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); | |||
@@ -1348,13 +1349,13 @@ public: | |||
else | |||
qWarning("WARNING - Got a broken Port (Audio, but not input or output)"); | |||
} | |||
else if (LV2_IS_PORT_CV(portType)) | |||
else if (LV2_IS_PORT_CV(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
{ | |||
qWarning("WARNING - CV Ports are not supported yet"); | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
{ | |||
qWarning("WARNING - CV Ports are not supported yet"); | |||
} | |||
@@ -1364,9 +1365,9 @@ public: | |||
descriptor->connect_port(handle, i, nullptr); | |||
if (h2) descriptor->connect_port(h2, i, nullptr); | |||
} | |||
else if (LV2_IS_PORT_ATOM_SEQUENCE(portType)) | |||
else if (LV2_IS_PORT_ATOM_SEQUENCE(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
{ | |||
j = evIn.count++; | |||
descriptor->connect_port(handle, i, evIn.data[j].atom); | |||
@@ -1374,17 +1375,17 @@ public: | |||
evIn.data[j].rindex = i; | |||
if (portType & LV2_PORT_DATA_MIDI_EVENT) | |||
if (portTypes & LV2_PORT_DATA_MIDI_EVENT) | |||
{ | |||
evIn.data[j].type |= CARLA_EVENT_TYPE_MIDI; | |||
evIn.data[j].port = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||
} | |||
if (portType & LV2_PORT_DATA_PATCH_MESSAGE) | |||
if (portTypes & LV2_PORT_DATA_PATCH_MESSAGE) | |||
{ | |||
evIn.data[j].type |= CARLA_EVENT_TYPE_MESSAGE; | |||
} | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
{ | |||
j = evOut.count++; | |||
descriptor->connect_port(handle, i, evOut.data[j].atom); | |||
@@ -1392,12 +1393,12 @@ public: | |||
evOut.data[j].rindex = i; | |||
if (portType & LV2_PORT_DATA_MIDI_EVENT) | |||
if (portTypes & LV2_PORT_DATA_MIDI_EVENT) | |||
{ | |||
evOut.data[j].type |= CARLA_EVENT_TYPE_MIDI; | |||
evOut.data[j].port = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, false); | |||
} | |||
if (portType & LV2_PORT_DATA_PATCH_MESSAGE) | |||
if (portTypes & LV2_PORT_DATA_PATCH_MESSAGE) | |||
{ | |||
evOut.data[j].type |= CARLA_EVENT_TYPE_MESSAGE; | |||
} | |||
@@ -1405,9 +1406,9 @@ public: | |||
else | |||
qWarning("WARNING - Got a broken Port (Atom Sequence, but not input or output)"); | |||
} | |||
else if (LV2_IS_PORT_EVENT(portType)) | |||
else if (LV2_IS_PORT_EVENT(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
{ | |||
j = evIn.count++; | |||
descriptor->connect_port(handle, i, evIn.data[j].event); | |||
@@ -1415,13 +1416,13 @@ public: | |||
evIn.data[j].rindex = i; | |||
if (portType & LV2_PORT_DATA_MIDI_EVENT) | |||
if (portTypes & LV2_PORT_DATA_MIDI_EVENT) | |||
{ | |||
evIn.data[j].type |= CARLA_EVENT_TYPE_MIDI; | |||
evIn.data[j].port = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||
} | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
{ | |||
j = evOut.count++; | |||
descriptor->connect_port(handle, i, evOut.data[j].event); | |||
@@ -1429,7 +1430,7 @@ public: | |||
evOut.data[j].rindex = i; | |||
if (portType & LV2_PORT_DATA_MIDI_EVENT) | |||
if (portTypes & LV2_PORT_DATA_MIDI_EVENT) | |||
{ | |||
evOut.data[j].type |= CARLA_EVENT_TYPE_MIDI; | |||
evOut.data[j].port = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, false); | |||
@@ -1438,9 +1439,9 @@ public: | |||
else | |||
qWarning("WARNING - Got a broken Port (Event, but not input or output)"); | |||
} | |||
else if (LV2_IS_PORT_MIDI_LL(portType)) | |||
else if (LV2_IS_PORT_MIDI_LL(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
{ | |||
j = evIn.count++; | |||
descriptor->connect_port(handle, i, evIn.data[j].midi); | |||
@@ -1450,7 +1451,7 @@ public: | |||
evIn.data[j].port = (CarlaEngineMidiPort*)x_client->addPort(CarlaEnginePortTypeMIDI, portName, true); | |||
evIn.data[j].rindex = i; | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
{ | |||
j = evOut.count++; | |||
descriptor->connect_port(handle, i, evOut.data[j].midi); | |||
@@ -1463,7 +1464,7 @@ public: | |||
else | |||
qWarning("WARNING - Got a broken Port (Midi, but not input or output)"); | |||
} | |||
else if (LV2_IS_PORT_CONTROL(portType)) | |||
else if (LV2_IS_PORT_CONTROL(portTypes)) | |||
{ | |||
const LV2_Property portProps = rdf_descriptor->Ports[i].Properties; | |||
const LV2_Property portDesignation = rdf_descriptor->Ports[i].Designation; | |||
@@ -1557,7 +1558,7 @@ public: | |||
stepLarge = range/10.0; | |||
} | |||
if (LV2_IS_PORT_INPUT(portType)) | |||
if (LV2_IS_PORT_INPUT(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_DESIGNATION_LATENCY(portDesignation)) | |||
{ | |||
@@ -1597,7 +1598,7 @@ public: | |||
param.data[j].midiCC = portMidiMap->Number; | |||
} | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(portType)) | |||
else if (LV2_IS_PORT_OUTPUT(portTypes)) | |||
{ | |||
if (LV2_IS_PORT_DESIGNATION_LATENCY(portDesignation)) | |||
{ | |||
@@ -1725,7 +1726,7 @@ public: | |||
// plugin checks | |||
m_hints &= ~(PLUGIN_IS_SYNTH | PLUGIN_USES_CHUNKS | PLUGIN_CAN_DRYWET | PLUGIN_CAN_VOLUME | PLUGIN_CAN_BALANCE | PLUGIN_CAN_FORCE_STEREO); | |||
if (LV2_IS_GENERATOR(rdf_descriptor->Type)) | |||
if (LV2_IS_GENERATOR(rdf_descriptor->Type[0], rdf_descriptor->Type[1])) | |||
m_hints |= PLUGIN_IS_SYNTH; | |||
if (aOuts > 0 && (aIns == aOuts || aIns == 1)) | |||
@@ -1850,6 +1851,7 @@ public: | |||
midiprog.data[i].name = strdup(pdesc->name ? pdesc->name : ""); | |||
} | |||
#ifndef BUILD_BRIDGE | |||
// Update OSC Names | |||
if (x_engine->isOscControlRegistered()) | |||
{ | |||
@@ -1858,6 +1860,7 @@ public: | |||
for (i=0; i < midiprog.count; i++) | |||
x_engine->osc_send_control_set_midi_program_data(m_id, i, midiprog.data[i].bank, midiprog.data[i].program, midiprog.data[i].name); | |||
} | |||
#endif | |||
if (init) | |||
{ | |||
@@ -2377,7 +2380,7 @@ public: | |||
uint32_t portIndex; | |||
const LV2_Atom* atom; | |||
while (atomQueueIn.get(&portIndex, &atom, false)) | |||
while (atomQueueIn.get(&portIndex, &atom)) | |||
{ | |||
if (atom->type == CARLA_URI_MAP_ID_ATOM_WORKER) | |||
{ | |||
@@ -4100,8 +4103,8 @@ public: | |||
// Check supported ports | |||
for (uint32_t i=0; i < rdf_descriptor->PortCount; i++) | |||
{ | |||
LV2_Property PortType = rdf_descriptor->Ports[i].Type.Value; | |||
if (! bool(LV2_IS_PORT_AUDIO(PortType) || LV2_IS_PORT_CONTROL(PortType) || LV2_IS_PORT_ATOM_SEQUENCE(PortType) || LV2_IS_PORT_EVENT(PortType) || LV2_IS_PORT_MIDI_LL(PortType))) | |||
LV2_Property portTypes = rdf_descriptor->Ports[i].Types; | |||
if (! bool(LV2_IS_PORT_AUDIO(portTypes) || LV2_IS_PORT_CONTROL(portTypes) || LV2_IS_PORT_ATOM_SEQUENCE(portTypes) || LV2_IS_PORT_EVENT(portTypes) || LV2_IS_PORT_MIDI_LL(portTypes))) | |||
{ | |||
if (! LV2_IS_PORT_OPTIONAL(rdf_descriptor->Ports[i].Properties)) | |||
{ | |||
@@ -4187,7 +4190,11 @@ public: | |||
int eQt4, eCocoa, eHWND, eX11, eGtk2, eGtk3, iCocoa, iHWND, iX11, iQt4, iExt, iSuil, iFinal; | |||
eQt4 = eCocoa = eHWND = eX11 = eGtk2 = eGtk3 = iQt4 = iCocoa = iHWND = iX11 = iExt = iSuil = iFinal = -1; | |||
#ifdef BUILD_BRIDGE | |||
const bool preferUiBridges = x_engine->getOptions().preferUiBridges; | |||
#else | |||
const bool preferUiBridges = (x_engine->getOptions().preferUiBridges && (m_hints & PLUGIN_IS_BRIDGE) == 0); | |||
#endif | |||
for (uint32_t i=0; i < rdf_descriptor->UICount; i++) | |||
{ | |||
@@ -82,7 +82,7 @@ const char* lib_error(const char* const filename) | |||
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 %i: %s", filename, winErrorCode, (const char*)winErrorString); | |||
snprintf(libError, 2048, "%s: error code %li: %s", filename, winErrorCode, (const char*)winErrorString); | |||
LocalFree(winErrorString); | |||
return libError; | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
* Carla LV2 utils | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.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 | |||
@@ -15,10 +15,7 @@ | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_LV2_UTILS_HPP | |||
#define CARLA_LV2_UTILS_HPP | |||
// TODO - presets state | |||
// TODO - presets handling | |||
#include "lv2/lv2.h" | |||
#include "lv2/atom.h" | |||
@@ -58,7 +55,7 @@ | |||
#include "lilv/lilvmm.hpp" | |||
#include "sratom/sratom.h" | |||
#include "carla_defines.hpp" | |||
//#include "carla_defines.hpp" | |||
#include <QtCore/QMap> | |||
#include <QtCore/QStringList> | |||
@@ -76,6 +73,7 @@ | |||
#define LV2_MIDI_LL__MidiPort "http://ll-plugins.nongnu.org/lv2/ext/MidiPort" | |||
#define LV2_UI__Qt5UI LV2_UI_PREFIX "Qt5UI" | |||
#define LV2_UI__makeResident LV2_UI_PREFIX "makeResident" | |||
// ------------------------------------------------------------------------------------------------ | |||
@@ -170,15 +168,16 @@ public: | |||
Lilv::Node pprop_trigger; | |||
// Unit Hints | |||
Lilv::Node unit_unit; | |||
Lilv::Node unit_name; | |||
Lilv::Node unit_render; | |||
Lilv::Node unit_symbol; | |||
Lilv::Node unit_unit; | |||
// UI Types | |||
Lilv::Node ui_gtk2; | |||
Lilv::Node ui_gtk3; | |||
Lilv::Node ui_qt4; | |||
Lilv::Node ui_qt5; | |||
Lilv::Node ui_cocoa; | |||
Lilv::Node ui_windows; | |||
Lilv::Node ui_x11; | |||
@@ -186,8 +185,11 @@ public: | |||
Lilv::Node ui_externalOld; | |||
// Misc | |||
Lilv::Node preset_Preset; | |||
Lilv::Node preset_value; | |||
Lilv::Node atom_bufferType; | |||
Lilv::Node atom_sequence; | |||
Lilv::Node atom_supports; | |||
Lilv::Node preset_preset; | |||
Lilv::Node state_state; | |||
@@ -195,11 +197,7 @@ public: | |||
Lilv::Node value_minimum; | |||
Lilv::Node value_maximum; | |||
Lilv::Node atom_Sequence; | |||
Lilv::Node atom_bufferType; | |||
Lilv::Node atom_supports; | |||
// Event Data/Types | |||
// Port Data Types | |||
Lilv::Node midi_event; | |||
Lilv::Node patch_message; | |||
@@ -285,22 +283,26 @@ public: | |||
pprop_notOnGUI (new_uri(LV2_PORT_PROPS__notOnGUI)), | |||
pprop_trigger (new_uri(LV2_PORT_PROPS__trigger)), | |||
unit_unit (new_uri(LV2_UNITS__unit)), | |||
unit_name (new_uri(LV2_UNITS__name)), | |||
unit_render (new_uri(LV2_UNITS__render)), | |||
unit_symbol (new_uri(LV2_UNITS__symbol)), | |||
unit_unit (new_uri(LV2_UNITS__unit)), | |||
ui_gtk2 (new_uri(LV2_UI__GtkUI)), | |||
ui_gtk3 (new_uri(LV2_UI__Gtk3UI)), | |||
ui_qt4 (new_uri(LV2_UI__Qt4UI)), | |||
ui_qt5 (new_uri(LV2_UI__Qt5UI)), | |||
ui_cocoa (new_uri(LV2_UI__CocoaUI)), | |||
ui_windows (new_uri(LV2_UI__WindowsUI)), | |||
ui_x11 (new_uri(LV2_UI__X11UI)), | |||
ui_external (new_uri(LV2_EXTERNAL_UI__Widget)), | |||
ui_externalOld (new_uri(LV2_EXTERNAL_UI_DEPRECATED_URI)), | |||
preset_Preset (new_uri(LV2_PRESETS__Preset)), | |||
preset_value (new_uri(LV2_PRESETS__value)), | |||
atom_bufferType (new_uri(LV2_ATOM__bufferType)), | |||
atom_sequence (new_uri(LV2_ATOM__Sequence)), | |||
atom_supports (new_uri(LV2_ATOM__supports)), | |||
preset_preset (new_uri(LV2_PRESETS__Preset)), | |||
state_state (new_uri(LV2_STATE__state)), | |||
@@ -308,10 +310,6 @@ public: | |||
value_minimum (new_uri(LV2_CORE__minimum)), | |||
value_maximum (new_uri(LV2_CORE__maximum)), | |||
atom_Sequence (new_uri(LV2_ATOM__Sequence)), | |||
atom_bufferType (new_uri(LV2_ATOM__bufferType)), | |||
atom_supports (new_uri(LV2_ATOM__supports)), | |||
midi_event (new_uri(LV2_MIDI__MidiEvent)), | |||
patch_message (new_uri(LV2_PATCH__Message)), | |||
@@ -350,6 +348,9 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) | |||
{ | |||
CARLA_ASSERT(uri); | |||
if (! uri) | |||
return nullptr; | |||
Lilv::Plugins lilvPlugins = lv2World.get_all_plugins(); | |||
LILV_FOREACH(plugins, i, lilvPlugins) | |||
@@ -368,6 +369,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) | |||
if (typeNodes.size() > 0) | |||
{ | |||
#if 0 | |||
if (typeNodes.contains(lv2World.class_allpass)) | |||
rdfDescriptor->Type |= LV2_PLUGIN_ALLPASS; | |||
if (typeNodes.contains(lv2World.class_amplifier)) | |||
@@ -440,6 +442,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) | |||
rdfDescriptor->Type |= LV2_PLUGIN_UTILITY; | |||
if (typeNodes.contains(lv2World.class_waveshaper)) | |||
rdfDescriptor->Type |= LV2_PLUGIN_WAVESHAPER; | |||
#endif | |||
} | |||
} | |||
@@ -1174,5 +1177,3 @@ LV2_URI get_lv2_ui_uri(const LV2_Property type) | |||
return "UI URI type not supported"; | |||
} | |||
} | |||
#endif // CARLA_LV2_UTILS_HPP |
@@ -15,8 +15,8 @@ | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef JACK_UTILS_H | |||
#define JACK_UTILS_H | |||
#ifndef __JACK_UTILS_HPP__ | |||
#define __JACK_UTILS_HPP__ | |||
#include <jack/jack.h> | |||
#include <jack/midiport.h> | |||
@@ -85,4 +85,4 @@ std::string jack_status_get_error_string(const jack_status_t& status) | |||
return errorString; | |||
} | |||
#endif // JACK_UTILS_H | |||
#endif // __JACK_UTILS_HPP__ |
@@ -19,6 +19,7 @@ Cadence: | |||
- add freq info to systray tooltip | |||
- add freq Hz change | |||
- add desktop decriptions | |||
- jacksettings, remember last tab | |||
Claudia: | |||
- Handle sample-rate changes in JACK (made possible by switch-master) | |||
@@ -28,6 +29,9 @@ Claudia-Launcher: | |||
- Finish plugins | |||
- Auto-close option | |||
Carla: | |||
- auto-tab height fix | |||
------------------- | |||
- MODULES - | |||