@@ -10,7 +10,7 @@ include ../Makefile.mk | |||||
# Common | # Common | ||||
LINK_FLAGS += $(shell pkg-config --libs gl liblo QtCore QtXml) | LINK_FLAGS += $(shell pkg-config --libs gl liblo QtCore QtXml) | ||||
LINK_FLAGS += -X11 | |||||
LINK_FLAGS += -lX11 | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# Engine | # Engine | ||||
@@ -9,8 +9,6 @@ include ../Makefile.mk | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils | BUILD_CXX_FLAGS += -I../backend -I../includes -I../utils | ||||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) | |||||
LINK_FLAGS += $(shell pkg-config --libs QtCore) | |||||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | ifeq ($(CARLA_PLUGIN_SUPPORT),true) | ||||
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | ||||
@@ -34,7 +32,8 @@ POSIX_LINK_FLAGS = $(LINK_FLAGS) -ldl | |||||
WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS) | WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS) | ||||
WIN_32BIT_FLAGS = $(32BIT_FLAGS) | WIN_32BIT_FLAGS = $(32BIT_FLAGS) | ||||
WIN_64BIT_FLAGS = $(64BIT_FLAGS) | WIN_64BIT_FLAGS = $(64BIT_FLAGS) | ||||
WIN_LINK_FLAGS = $(LINK_FLAGS) -static -mwindows -lole32 -luuid -lws2_32 | |||||
WIN_LINK_FLAGS = $(LINK_FLAGS) -static -mwindows | |||||
# -lole32 -luuid -lws2_32 | |||||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | ifeq ($(CARLA_PLUGIN_SUPPORT),true) | ||||
LIBS = ../libs/lilv.a | LIBS = ../libs/lilv.a | ||||
@@ -16,10 +16,10 @@ | |||||
*/ | */ | ||||
#include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
#include "CarlaJuceUtils.hpp" | |||||
#include "CarlaLibUtils.hpp" | |||||
#include "CarlaString.hpp" | |||||
#include "CarlaMIDI.h" | |||||
//#include "CarlaJuceUtils.hpp" | |||||
//#include "CarlaLibUtils.hpp" | |||||
//#include "CarlaString.hpp" | |||||
//#include "CarlaMIDI.h" | |||||
#ifdef WANT_LADSPA | #ifdef WANT_LADSPA | ||||
# include "CarlaLadspaUtils.hpp" | # include "CarlaLadspaUtils.hpp" | ||||
@@ -20,7 +20,7 @@ | |||||
//#include "plugin/DssiPlugin.cpp" | //#include "plugin/DssiPlugin.cpp" | ||||
//#include "../widgets/digitalpeakmeter.cpp" | //#include "../widgets/digitalpeakmeter.cpp" | ||||
#include "CarlaJuceHeader.hpp" | |||||
#include "CarlaUtils.hpp" | |||||
#if 0 | #if 0 | ||||
#include "CarlaDefines.hpp" | #include "CarlaDefines.hpp" | ||||
@@ -53,7 +53,9 @@ | |||||
#include "RtList.hpp" | #include "RtList.hpp" | ||||
#endif | #endif | ||||
int main() | |||||
#include "Utils.cpp" | |||||
int main2() | |||||
{ | { | ||||
return 0; | return 0; | ||||
} | } |
@@ -9,7 +9,7 @@ include ../Makefile.mk | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
BUILD_CXX_FLAGS += -I../backend -I../includes -I../libs -I../utils -Wall -Wextra | BUILD_CXX_FLAGS += -I../backend -I../includes -I../libs -I../utils -Wall -Wextra | ||||
BUILD_CXX_FLAGS += -isystem ../libs/juce | |||||
# BUILD_CXX_FLAGS += -isystem ../libs/juce | |||||
# BUILD_CXX_FLAGS += -DWANT_JACK -DWANT_LADSPA -DWANT_DSSI | # BUILD_CXX_FLAGS += -DWANT_JACK -DWANT_LADSPA -DWANT_DSSI | ||||
# BUILD_CXX_FLAGS += -isystem /usr/include/qt4 | # BUILD_CXX_FLAGS += -isystem /usr/include/qt4 | ||||
# BUILD_CXX_FLAGS += -isystem ../backend/engine/rtaudio-4.0.11 | # BUILD_CXX_FLAGS += -isystem ../backend/engine/rtaudio-4.0.11 | ||||
@@ -20,14 +20,14 @@ ANSI_CXX_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wlogical-op -Wagg | |||||
ANSI_CXX_FLAGS += -std=c++11 -Wzero-as-null-pointer-constant | ANSI_CXX_FLAGS += -std=c++11 -Wzero-as-null-pointer-constant | ||||
ANSI_CXX_FLAGS += -DVESTIGE_HEADER -shared -fPIC | ANSI_CXX_FLAGS += -DVESTIGE_HEADER -shared -fPIC | ||||
TARGETS = ANSI_ Base64 CarlaString RtList Thread Print | |||||
TARGETS = ANSI Base64 CarlaString RtList Thread Print Utils | |||||
all: $(TARGETS) RUN | all: $(TARGETS) RUN | ||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
ANSI_: ANSI.cpp | |||||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(ANSI_CXX_FLAGS) $(LINK_FLAGS) -o ANSI # $@ | |||||
ANSI: ANSI.cpp | |||||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(ANSI_CXX_FLAGS) $(LINK_FLAGS) -o $@ | |||||
Base64: Base64.cpp | Base64: Base64.cpp | ||||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | ||||
@@ -44,11 +44,11 @@ Thread: Thread.cpp | |||||
Print: Print.cpp | Print: Print.cpp | ||||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | ||||
GL_: GL.cpp | |||||
# $(CXX) $^ $(BUILD_CXX_FLAGS) -I../backend/engine/plugin -I../libs/distrho-plugin-toolkit $(LINK_FLAGS) -lgdi32 -lopengl32 -lole32 -luuid -lws2_32 -o GL # $@ | |||||
$(CXX) $^ $(BUILD_CXX_FLAGS) -I../backend/engine/plugin -I../libs/distrho-plugin-toolkit $(LINK_FLAGS) -lGL -lGLU -o GL # $@ | |||||
Utils: Utils.cpp | |||||
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | |||||
RUN: $(TARGETS) | RUN: $(TARGETS) | ||||
valgrind ./Utils | |||||
# ./CarlaString && ./RtList && ./Thread | # ./CarlaString && ./RtList && ./Thread | ||||
# ./Base64 | # ./Base64 | ||||
@@ -420,6 +420,7 @@ const char* getPluginTypeAsString(const PluginType& type) | |||||
static inline | static inline | ||||
PluginType getPluginTypeFromString(const char* const stype) | PluginType getPluginTypeFromString(const char* const stype) | ||||
{ | { | ||||
CARLA_ASSERT(stype != nullptr); | |||||
carla_debug("CarlaBackend::getPluginTypeFromString(%s)", stype); | carla_debug("CarlaBackend::getPluginTypeFromString(%s)", stype); | ||||
if (stype == nullptr) | if (stype == nullptr) | ||||
@@ -440,6 +441,8 @@ PluginType getPluginTypeFromString(const char* const stype) | |||||
return PLUGIN_LV2; | return PLUGIN_LV2; | ||||
if (std::strcmp(stype, "VST") == 0) | if (std::strcmp(stype, "VST") == 0) | ||||
return PLUGIN_VST; | return PLUGIN_VST; | ||||
if (std::strcmp(stype, "VST3") == 0) | |||||
return PLUGIN_VST3; | |||||
if (std::strcmp(stype, "GIG") == 0) | if (std::strcmp(stype, "GIG") == 0) | ||||
return PLUGIN_GIG; | return PLUGIN_GIG; | ||||
if (std::strcmp(stype, "SF2") == 0) | if (std::strcmp(stype, "SF2") == 0) | ||||
@@ -456,11 +459,14 @@ PluginType getPluginTypeFromString(const char* const stype) | |||||
static inline | static inline | ||||
PluginCategory getPluginCategoryFromName(const char* const name) | PluginCategory getPluginCategoryFromName(const char* const name) | ||||
{ | { | ||||
CARLA_ASSERT(name != nullptr); | |||||
carla_debug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name); | carla_debug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name); | ||||
CARLA_ASSERT(name); | |||||
if (! name) | |||||
if (name == nullptr) | |||||
{ | |||||
carla_stderr("CarlaBackend::getPluginCategoryFromName() - null name"); | |||||
return PLUGIN_CATEGORY_NONE; | return PLUGIN_CATEGORY_NONE; | ||||
} | |||||
CarlaString sname(name); | CarlaString sname(name); | ||||
@@ -54,7 +54,7 @@ void pass() {} | |||||
static inline | static inline | ||||
void carla_debug(const char* const fmt, ...) | void carla_debug(const char* const fmt, ...) | ||||
{ | { | ||||
std::va_list args; | |||||
va_list args; | |||||
va_start(args, fmt); | va_start(args, fmt); | ||||
std::fprintf(stdout, "\x1b[30;1m"); | std::fprintf(stdout, "\x1b[30;1m"); | ||||
std::vfprintf(stdout, fmt, args); | std::vfprintf(stdout, fmt, args); | ||||
@@ -66,7 +66,7 @@ void carla_debug(const char* const fmt, ...) | |||||
static inline | static inline | ||||
void carla_stdout(const char* const fmt, ...) | void carla_stdout(const char* const fmt, ...) | ||||
{ | { | ||||
std::va_list args; | |||||
va_list args; | |||||
va_start(args, fmt); | va_start(args, fmt); | ||||
std::vfprintf(stdout, fmt, args); | std::vfprintf(stdout, fmt, args); | ||||
std::fprintf(stdout, "\n"); | std::fprintf(stdout, "\n"); | ||||
@@ -76,7 +76,7 @@ void carla_stdout(const char* const fmt, ...) | |||||
static inline | static inline | ||||
void carla_stderr(const char* const fmt, ...) | void carla_stderr(const char* const fmt, ...) | ||||
{ | { | ||||
std::va_list args; | |||||
va_list args; | |||||
va_start(args, fmt); | va_start(args, fmt); | ||||
std::vfprintf(stderr, fmt, args); | std::vfprintf(stderr, fmt, args); | ||||
std::fprintf(stderr, "\n"); | std::fprintf(stderr, "\n"); | ||||
@@ -86,7 +86,7 @@ void carla_stderr(const char* const fmt, ...) | |||||
static inline | static inline | ||||
void carla_stderr2(const char* const fmt, ...) | void carla_stderr2(const char* const fmt, ...) | ||||
{ | { | ||||
std::va_list args; | |||||
va_list args; | |||||
va_start(args, fmt); | va_start(args, fmt); | ||||
std::fprintf(stderr, "\x1b[31m"); | std::fprintf(stderr, "\x1b[31m"); | ||||
std::vfprintf(stderr, fmt, args); | std::vfprintf(stderr, fmt, args); | ||||
@@ -224,6 +224,13 @@ const T& carla_min(const T& v1, const T& v2, const T& min) | |||||
return ((v1 < min || v2 < min) ? min : (v1 < v2 ? v1 : v2)); | return ((v1 < min || v2 < min) ? min : (v1 < v2 ? v1 : v2)); | ||||
} | } | ||||
template<typename T> | |||||
static inline | |||||
const T& carla_max(const T& v1, const T& v2, const T& max) | |||||
{ | |||||
return ((v1 > max || v2 > max) ? max : (v1 > v2 ? v1 : v2)); | |||||
} | |||||
template<typename T> | template<typename T> | ||||
static inline | static inline | ||||
const T& carla_fixValue(const T& min, const T& max, const T& value) | const T& carla_fixValue(const T& min, const T& max, const T& value) | ||||
@@ -280,25 +287,25 @@ void carla_fill(T* data, const size_t size, const T v) | |||||
} | } | ||||
static inline | static inline | ||||
void carla_copyDouble(double* dataDst, double* dataSrc, const size_t size) | |||||
void carla_copyDouble(double* const dataDst, double* const dataSrc, const size_t size) | |||||
{ | { | ||||
carla_copy<double>(dataDst, dataSrc, size); | carla_copy<double>(dataDst, dataSrc, size); | ||||
} | } | ||||
static inline | static inline | ||||
void carla_copyFloat(float* dataDst, float* dataSrc, const size_t size) | |||||
void carla_copyFloat(float* const dataDst, float* const dataSrc, const size_t size) | |||||
{ | { | ||||
carla_copy<float>(dataDst, dataSrc, size); | carla_copy<float>(dataDst, dataSrc, size); | ||||
} | } | ||||
static inline | static inline | ||||
void carla_zeroDouble(double* data, const size_t size) | |||||
void carla_zeroDouble(double* const data, const size_t size) | |||||
{ | { | ||||
carla_fill<double>(data, size, 0.0); | carla_fill<double>(data, size, 0.0); | ||||
} | } | ||||
static inline | static inline | ||||
void carla_zeroFloat(float* data, const size_t size) | |||||
void carla_zeroFloat(float* const data, const size_t size) | |||||
{ | { | ||||
carla_fill<float>(data, size, 0.0f); | carla_fill<float>(data, size, 0.0f); | ||||
} | } | ||||