Browse Source

Testing

tags/1.9.4
falkTX 11 years ago
parent
commit
35f8e2dfcc
7 changed files with 41 additions and 27 deletions
  1. +1
    -1
      source/backend/standalone/Makefile
  2. +2
    -3
      source/discovery/Makefile
  3. +4
    -4
      source/discovery/carla-discovery.cpp
  4. +4
    -2
      source/tests/ANSI.cpp
  5. +7
    -7
      source/tests/Makefile
  6. +8
    -2
      source/utils/CarlaBackendUtils.hpp
  7. +15
    -8
      source/utils/CarlaUtils.hpp

+ 1
- 1
source/backend/standalone/Makefile View File

@@ -10,7 +10,7 @@ include ../Makefile.mk
# Common

LINK_FLAGS += $(shell pkg-config --libs gl liblo QtCore QtXml)
LINK_FLAGS += -X11
LINK_FLAGS += -lX11

# --------------------------------------------------------------
# Engine


+ 2
- 3
source/discovery/Makefile View File

@@ -9,8 +9,6 @@ include ../Makefile.mk
# --------------------------------------------------------------

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)
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_32BIT_FLAGS = $(32BIT_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)
LIBS = ../libs/lilv.a


+ 4
- 4
source/discovery/carla-discovery.cpp View File

@@ -16,10 +16,10 @@
*/

#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
# include "CarlaLadspaUtils.hpp"


+ 4
- 2
source/tests/ANSI.cpp View File

@@ -20,7 +20,7 @@
//#include "plugin/DssiPlugin.cpp"
//#include "../widgets/digitalpeakmeter.cpp"

#include "CarlaJuceHeader.hpp"
#include "CarlaUtils.hpp"

#if 0
#include "CarlaDefines.hpp"
@@ -53,7 +53,9 @@
#include "RtList.hpp"
#endif

int main()
#include "Utils.cpp"

int main2()
{
return 0;
}

+ 7
- 7
source/tests/Makefile View File

@@ -9,7 +9,7 @@ include ../Makefile.mk
# --------------------------------------------------------------

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 += -isystem /usr/include/qt4
# 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 += -DVESTIGE_HEADER -shared -fPIC

TARGETS = ANSI_ Base64 CarlaString RtList Thread Print
TARGETS = ANSI Base64 CarlaString RtList Thread Print Utils

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
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@
@@ -44,11 +44,11 @@ Thread: Thread.cpp
Print: Print.cpp
$(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)
valgrind ./Utils
# ./CarlaString && ./RtList && ./Thread
# ./Print
# ./Base64


+ 8
- 2
source/utils/CarlaBackendUtils.hpp View File

@@ -420,6 +420,7 @@ const char* getPluginTypeAsString(const PluginType& type)
static inline
PluginType getPluginTypeFromString(const char* const stype)
{
CARLA_ASSERT(stype != nullptr);
carla_debug("CarlaBackend::getPluginTypeFromString(%s)", stype);

if (stype == nullptr)
@@ -440,6 +441,8 @@ PluginType getPluginTypeFromString(const char* const stype)
return PLUGIN_LV2;
if (std::strcmp(stype, "VST") == 0)
return PLUGIN_VST;
if (std::strcmp(stype, "VST3") == 0)
return PLUGIN_VST3;
if (std::strcmp(stype, "GIG") == 0)
return PLUGIN_GIG;
if (std::strcmp(stype, "SF2") == 0)
@@ -456,11 +459,14 @@ PluginType getPluginTypeFromString(const char* const stype)
static inline
PluginCategory getPluginCategoryFromName(const char* const name)
{
CARLA_ASSERT(name != nullptr);
carla_debug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name);
CARLA_ASSERT(name);

if (! name)
if (name == nullptr)
{
carla_stderr("CarlaBackend::getPluginCategoryFromName() - null name");
return PLUGIN_CATEGORY_NONE;
}

CarlaString sname(name);



+ 15
- 8
source/utils/CarlaUtils.hpp View File

@@ -54,7 +54,7 @@ void pass() {}
static inline
void carla_debug(const char* const fmt, ...)
{
std::va_list args;
va_list args;
va_start(args, fmt);
std::fprintf(stdout, "\x1b[30;1m");
std::vfprintf(stdout, fmt, args);
@@ -66,7 +66,7 @@ void carla_debug(const char* const fmt, ...)
static inline
void carla_stdout(const char* const fmt, ...)
{
std::va_list args;
va_list args;
va_start(args, fmt);
std::vfprintf(stdout, fmt, args);
std::fprintf(stdout, "\n");
@@ -76,7 +76,7 @@ void carla_stdout(const char* const fmt, ...)
static inline
void carla_stderr(const char* const fmt, ...)
{
std::va_list args;
va_list args;
va_start(args, fmt);
std::vfprintf(stderr, fmt, args);
std::fprintf(stderr, "\n");
@@ -86,7 +86,7 @@ void carla_stderr(const char* const fmt, ...)
static inline
void carla_stderr2(const char* const fmt, ...)
{
std::va_list args;
va_list args;
va_start(args, fmt);
std::fprintf(stderr, "\x1b[31m");
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));
}

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>
static inline
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
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);
}

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);
}

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);
}

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);
}


Loading…
Cancel
Save