Browse Source

More work, add more files

tags/1.9.4
falkTX 11 years ago
parent
commit
4df88167f8
10 changed files with 2270 additions and 72 deletions
  1. +4
    -14
      source/Makefile.mk
  2. +4
    -17
      source/backend/Makefile
  3. +48
    -0
      source/backend/Makefile.mk
  4. +181
    -0
      source/backend/carla_standalone.hpp
  5. +21
    -27
      source/backend/engine/Makefile
  6. +4
    -5
      source/backend/native/Makefile
  7. +6
    -7
      source/backend/plugin/Makefile
  8. +35
    -0
      source/backend/standalone/Makefile
  9. +1965
    -0
      source/backend/standalone/carla_standalone.cpp
  10. +2
    -2
      source/utils/carla_utils.hpp

+ 4
- 14
source/Makefile.mk View File

@@ -37,7 +37,7 @@ BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -Wc++-compat -Wunsuffixed-float-constan
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++0x $(CXXFLAGS)
LINK_FLAGS = $(LDFLAGS)

# BUILD_CXX_FLAGS += -Wzero-as-null-pointer-constant
BUILD_CXX_FLAGS += -Wzero-as-null-pointer-constant

ifneq ($(DEBUG),true)
BUILD_CXX_FLAGS += -DQT_NO_DEBUG -DQT_NO_DEBUG_STREAM -DQT_NO_DEBUG_OUTPUT
@@ -60,6 +60,9 @@ BUILD_CXX_FLAGS += -DVESTIGE_HEADER

# --------------------------------------------------------------

HAVE_JACK = $(shell pkg-config --exists jack && echo true)
HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml && echo true)

ifeq ($(CARLA_PLUGIN_SUPPORT),true)
HAVE_SUIL = $(shell pkg-config --exists suil-0 && echo true)
endif
@@ -73,16 +76,3 @@ ifeq ($(CARLA_RTAUDIO_SUPPORT),true)
HAVE_ALSA = $(shell pkg-config --exists alsa && echo true)
HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true)
endif

HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml && echo true)

# --------------------------------------------------------------

ifeq ($(CARLA_PLUGIN_SUPPORT),true)
BUILD_C_FLAGS += -DWANT_LV2
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST
endif

ifeq ($(HAVE_ZYN_DEPS),true)
BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX
endif

+ 4
- 17
source/backend/Makefile View File

@@ -1,32 +1,19 @@
#!/usr/bin/make -f
# Makefile for carla backend #
# ----------------------------------------- #
# Makefile for carla backend and standalone #
# -------------------------------------------------------------- #
# Created by falkTX
#

all:
all: carla_standalone

# --------------------------------------------------------------

# carla_backend.so: carla_engine.so carla_native.so carla_plugin.so carla_standalone.so
# $(CXX) $^

carla_engine.so:
$(MAKE) -C engine

carla_native.so:
$(MAKE) -C native

carla_plugin.so:
$(MAKE) -C plugin

carla_standalone.so:
carla_standalone:
$(MAKE) -C standalone

# --------------------------------------------------------------

clean:
rm -f *.so
$(MAKE) clean -C engine
$(MAKE) clean -C native
$(MAKE) clean -C plugin


+ 48
- 0
source/backend/Makefile.mk View File

@@ -0,0 +1,48 @@
#!/usr/bin/make -f
# Makefile for carla-backend #
# ------------------------------------ #
# Created by falkTX
#

include ../Makefile.mk

# --------------------------------------------------------------

BUILD_C_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes
BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes -I../../libs -I../../utils
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore)

LINK_FLAGS += $(shell pkg-config --libs QtCore)

# --------------------------------------------------------------

ifeq ($(HAVE_JACK),true)
BUILD_CXX_FLAGS += -DWANT_JACK
endif

ifeq ($(HAVE_FLUIDSYNTH),true)
BUILD_CXX_FLAGS += -DWANT_FLUIDSYNTH
endif

ifeq ($(HAVE_LINUXSAMPLER),true)
BUILD_CXX_FLAGS += -DWANT_LINUXSAMPLER
endif

ifeq ($(HAVE_SUIL),true)
BUILD_CXX_FLAGS += -DWANT_SUIL
endif

ifeq ($(HAVE_ZYN_DEPS),true)
BUILD_CXX_FLAGS += -DWANT_ZYNADDSUBFX
endif

# --------------------------------------------------------------

ifeq ($(CARLA_PLUGIN_SUPPORT),true)
BUILD_C_FLAGS += -DWANT_LV2
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST
endif

ifeq ($(CARLA_RTAUDIO_SUPPORT),true)
BUILD_CXX_FLAGS += -DWANT_RTAUDIO
endif

+ 181
- 0
source/backend/carla_standalone.hpp View File

@@ -0,0 +1,181 @@
/*
* Carla Standalone API
* 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 the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the GPL.txt file
*/

#ifndef __CARLA_STANDALONE_HPP__
#define __CARLA_STANDALONE_HPP__

#include "carla_backend.hpp"

// TODO - create struct for internal plugin info
// TODO - dont strdup() on const-char* returns, use static char[STR_MAX]

CARLA_BACKEND_START_NAMESPACE

/*!
* @defgroup CarlaBackendStandalone Carla Backend Standalone
*
* The Carla Backend Standalone API
*
* @{
*/

#if 0
struct PluginInfo {
PluginType type;
PluginCategory category;
unsigned int hints;
const char* binary;
const char* name;
const char* label;
const char* maker;
const char* copyright;
long uniqueId;

PluginInfo()
: type(PLUGIN_NONE),
category(PLUGIN_CATEGORY_NONE),
hints(0x0),
binary(nullptr),
name(nullptr),
label(nullptr),
maker(nullptr),
copyright(nullptr),
uniqueId(0) {}
};

struct PortCountInfo {
uint32_t ins;
uint32_t outs;
uint32_t total;

PortCountInfo()
: ins(0),
outs(0),
total(0) {}
};

struct ParameterInfo {
const char* name;
const char* symbol;
const char* unit;
uint32_t scalePointCount;

ParameterInfo()
: name(nullptr),
symbol(nullptr),
unit(nullptr),
scalePointCount(0) {}
};

struct ScalePointInfo {
double value;
const char* label;

ScalePointInfo()
: value(0.0),
label(nullptr) {}
};
#endif

CARLA_EXPORT const char* carla_get_extended_license_text();

CARLA_EXPORT unsigned int carla_get_engine_driver_count();
CARLA_EXPORT const char* carla_get_engine_driver_name(unsigned int index);

#if 0
CARLA_EXPORT unsigned int get_internal_plugin_count();
CARLA_EXPORT const PluginInfo* get_internal_plugin_info(unsigned int pluginId);

CARLA_EXPORT bool engine_init(const char* driverName, const char* clientName);
CARLA_EXPORT bool engine_close();
CARLA_EXPORT bool is_engine_running();

CARLA_EXPORT int add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, void* extraPtr);
CARLA_EXPORT bool remove_plugin(unsigned int pluginId);

CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned int pluginId);
CARLA_EXPORT const PortCountInfo* get_audio_port_count_info(unsigned int pluginId);
CARLA_EXPORT const PortCountInfo* get_midi_port_count_info(unsigned int pluginId);
CARLA_EXPORT const PortCountInfo* get_parameter_count_info(unsigned int pluginId);
CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameterId);
CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned int pluginId, uint32_t parameterId, uint32_t scalePointId);

CARLA_EXPORT const ParameterData* get_parameter_data(unsigned int pluginId, uint32_t parameterId);
CARLA_EXPORT const ParameterRanges* get_parameter_ranges(unsigned int pluginId, uint32_t parameterId);
CARLA_EXPORT const MidiProgramData* get_midi_program_data(unsigned int pluginId, uint32_t midiProgramId);
CARLA_EXPORT const CustomData* get_custom_data(unsigned int pluginId, uint32_t customDataId);
CARLA_EXPORT const char* get_chunk_data(unsigned int pluginId);

CARLA_EXPORT uint32_t get_parameter_count(unsigned int pluginId);
CARLA_EXPORT uint32_t get_program_count(unsigned int pluginId);
CARLA_EXPORT uint32_t get_midi_program_count(unsigned int pluginId);
CARLA_EXPORT uint32_t get_custom_data_count(unsigned int pluginId);

CARLA_EXPORT const char* get_parameter_text(unsigned int pluginId, uint32_t parameterId);
CARLA_EXPORT const char* get_program_name(unsigned int pluginId, uint32_t programId);
CARLA_EXPORT const char* get_midi_program_name(unsigned int pluginId, uint32_t midiProgramId);
CARLA_EXPORT const char* get_real_plugin_name(unsigned int pluginId);

CARLA_EXPORT int32_t get_current_program_index(unsigned int pluginId);
CARLA_EXPORT int32_t get_current_midi_program_index(unsigned int pluginId);

CARLA_EXPORT double get_default_parameter_value(unsigned int pluginId, uint32_t parameterId);
CARLA_EXPORT double get_current_parameter_value(unsigned int pluginId, uint32_t parameterId);

CARLA_EXPORT double get_input_peak_value(unsigned int pluginId, unsigned short portId);
CARLA_EXPORT double get_output_peak_value(unsigned int pluginId, unsigned short portId);

CARLA_EXPORT void set_active(unsigned int pluginId, bool onOff);
CARLA_EXPORT void set_drywet(unsigned int pluginId, double value);
CARLA_EXPORT void set_volume(unsigned int pluginId, double value);
CARLA_EXPORT void set_balance_left(unsigned int pluginId, double value);
CARLA_EXPORT void set_balance_right(unsigned int pluginId, double value);

CARLA_EXPORT void set_parameter_value(unsigned int pluginId, uint32_t parameterId, double value);
CARLA_EXPORT void set_parameter_midi_channel(unsigned int pluginId, uint32_t parameterId, uint8_t channel);
CARLA_EXPORT void set_parameter_midi_cc(unsigned int pluginId, uint32_t parameterId, int16_t cc);
CARLA_EXPORT void set_program(unsigned int pluginId, uint32_t programId);
CARLA_EXPORT void set_midi_program(unsigned int pluginId, uint32_t midiProgramId);

CARLA_EXPORT void set_custom_data(unsigned int pluginId, const char* type, const char* key, const char* value);
CARLA_EXPORT void set_chunk_data(unsigned int pluginId, const char* chunkData);

CARLA_EXPORT void show_gui(unsigned int pluginId, bool yesNo);
CARLA_EXPORT void idle_guis();

CARLA_EXPORT void send_midi_note(unsigned int pluginId, uint8_t channel, uint8_t note, uint8_t velocity);
CARLA_EXPORT void prepare_for_save(unsigned int pluginId);

CARLA_EXPORT uint32_t get_buffer_size();
CARLA_EXPORT double get_sample_rate();

CARLA_EXPORT const char* get_last_error();
CARLA_EXPORT const char* get_host_osc_url();

CARLA_EXPORT void set_callback_function(CallbackFunc func);
CARLA_EXPORT void set_option(OptionsType option, int value, const char* valueStr);

CARLA_EXPORT void nsm_announce(const char* url, int pid);
CARLA_EXPORT void nsm_reply_open();
CARLA_EXPORT void nsm_reply_save();
#endif

/**@}*/

CARLA_BACKEND_END_NAMESPACE

#endif // __CARLA_STANDALONE_HPP__

+ 21
- 27
source/backend/engine/Makefile View File

@@ -4,45 +4,39 @@
# Created by falkTX
#

include ../../Makefile.mk
include ../Makefile.mk

# --------------------------------------------------------------

BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes -I../../libs -I../../utils
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) # liblo -isystem /opt/kxstudio/include/
# BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo)
BUILD_CXX_FLAGS += -isystem /opt/kxstudio/include/

LINK_FLAGS += -shared
LINK_FLAGS += $(shell pkg-config --libs liblo QtCore)
LINK_FLAGS += $(shell pkg-config --libs liblo)

ifeq ($(HAVE_JACK),true)
BUILD_CXX_FLAGS += -DCARLA_ENGINE_JACK
BUILD_CXX_FLAGS += $(shell pkg-config --cflags jack) -D__UNIX_JACK__
LINK_FLAGS += $(shell pkg-config --libs jack)
WANT_JACK = true
endif

ifeq ($(CARLA_RTAUDIO_SUPPORT),true)
BUILD_CXX_FLAGS += -DCARLA_ENGINE_RTAUDIO -DHAVE_GETTIMEOFDAY
BUILD_CXX_FLAGS += -Irtaudio-4.0.11 -Irtmidi-2.0.1
ifeq ($(DEBUG),true)
BUILD_CXX_FLAGS += -D__RTAUDIO_DEBUG__ -D__RTMIDI_DEBUG__
else
BUILD_CXX_FLAGS += -D_FORTIFY_SOURCE=2
endif

ifeq ($(HAVE_ALSA),true)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__
LINK_FLAGS += $(shell pkg-config --libs alsa)
WANT_RTAUDIO = true
endif

ifeq ($(HAVE_PULSEAUDIO),true)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags libpulse-simple) -D__LINUX_PULSE__
LINK_FLAGS += $(shell pkg-config --libs libpulse-simple)
WANT_RTAUDIO = true
endif

ifeq ($(WANT_JACK),true)
BUILD_CXX_FLAGS += -DCARLA_ENGINE_JACK
endif

ifeq ($(WANT_RTAUDIO),true)
BUILD_CXX_FLAGS += -DCARLA_ENGINE_RTAUDIO -DHAVE_GETTIMEOFDAY
BUILD_CXX_FLAGS += -Irtaudio-4.0.11 -Irtmidi-2.0.1
ifeq ($(DEBUG),true)
BUILD_CXX_FLAGS += -D__RTAUDIO_DEBUG__ -D__RTMIDI_DEBUG__
else
BUILD_CXX_FLAGS += -D_FORTIFY_SOURCE=2
endif
endif

@@ -50,19 +44,19 @@ endif

OBJS = \
carla_engine.cpp.o \
jack.cpp.o
jack.cpp.o \
rtaudio.cpp.o

# carla_engine_osc.cpp.o \
# carla_engine_thread.cpp.o \
# rtaudio.cpp.o

ifeq ($(WANT_RTAUDIO),true)
# OBJS += \
# rtaudio-4.0.11/RtAudio.cpp.o \
# rtmidi-2.0.1/RtMidi.cpp.o
ifeq ($(CARLA_RTAUDIO_SUPPORT),true)
OBJS += \
rtaudio-4.0.11/RtAudio.cpp.o \
rtmidi-2.0.1/RtMidi.cpp.o
endif

TARGET = ../carla_engine.so
TARGET = ../libcarla_engine.so

# --------------------------------------------------------------



+ 4
- 5
source/backend/native/Makefile View File

@@ -8,12 +8,11 @@ include ../../Makefile.mk

# --------------------------------------------------------------

BUILD_C_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes
BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes -I../../utils -I../../libs/distrho-plugin-toolkit
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore QtGui)
BUILD_CXX_FLAGS += -I../../libs/distrho-plugin-toolkit
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtGui)

LINK_FLAGS += -shared
LINK_FLAGS += $(shell pkg-config --libs QtCore QtGui) -lGL
LINK_FLAGS += $(shell pkg-config --libs QtGui) -lGL

ifeq ($(HAVE_ZYN_DEPS),true)
ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS)
@@ -42,7 +41,7 @@ OBJS += \
zynaddsubfx-src.cpp.o
endif

TARGET = ../carla_native.so
TARGET = ../libcarla_native.so

# --------------------------------------------------------------



+ 6
- 7
source/backend/plugin/Makefile View File

@@ -8,24 +8,23 @@ include ../../Makefile.mk

# --------------------------------------------------------------

BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC -I. -I.. -I../../includes -I../../libs -I../../utils
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore QtGui)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtGui)

LINK_FLAGS += -shared
LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui)
LINK_FLAGS += $(shell pkg-config --libs liblo QtGui)

ifeq ($(HAVE_SUIL),true)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags suil-0) -DWANT_SUIL
BUILD_CXX_FLAGS += $(shell pkg-config --cflags suil-0)
LINK_FLAGS += $(shell pkg-config --libs suil-0)
endif

ifeq ($(HAVE_FLUIDSYNTH),true)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags fluidsynth) -DWANT_FLUIDSYNTH
BUILD_CXX_FLAGS += $(shell pkg-config --cflags fluidsynth)
LINK_FLAGS += $(shell pkg-config --libs fluidsynth)
endif

ifeq ($(HAVE_LINUXSAMPLER),true)
BUILD_CXX_FLAGS += $(shell pkg-config --cflags linuxsampler) -DWANT_LINUXSAMPLER
BUILD_CXX_FLAGS += $(shell pkg-config --cflags linuxsampler)
LINK_FLAGS += $(shell pkg-config --libs linuxsampler)
endif

@@ -43,7 +42,7 @@ OBJS = \
# fluidsynth.cpp.o \
# linuxsampler.cpp.o

TARGET = ../carla_plugin.so
TARGET = ../libcarla_plugin.so

# --------------------------------------------------------------



+ 35
- 0
source/backend/standalone/Makefile View File

@@ -0,0 +1,35 @@
#!/usr/bin/make -f
# Makefile for carla-standalone #
# --------------------------------------- #
# Created by falkTX
#

include ../Makefile.mk

# --------------------------------------------------------------

# LINK_FLAGS += -shared
LINK_FLAGS += -Wl,-rpath,. -L.. -lcarla_engine -lcarla_native -lcarla_plugin

# --------------------------------------------------------------

OBJS = \
carla_standalone.cpp.o

TARGET = ../carla_standalone
#lib*.so

# --------------------------------------------------------------

all: $(TARGET)

clean:
rm -f $(OBJS) $(TARGET)

# --------------------------------------------------------------

%.cpp.o: %.cpp
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

$(TARGET): $(OBJS)
$(CXX) $^ $(LINK_FLAGS) -o $@

+ 1965
- 0
source/backend/standalone/carla_standalone.cpp
File diff suppressed because it is too large
View File


+ 2
- 2
source/utils/carla_utils.hpp View File

@@ -494,7 +494,7 @@ public:
for (size_t i=0; i < bufferLen; i++)
{
if (buffer[i] >= 'A' && buffer[i] <= 'Z')
buffer[i] += charDiff;
buffer[i] = char(buffer[i] + charDiff);
}
}

@@ -505,7 +505,7 @@ public:
for (size_t i=0; i < bufferLen; i++)
{
if (buffer[i] >= 'a' && buffer[i] <= 'z')
buffer[i] -= charDiff;
buffer[i] = char(buffer[i] + charDiff);
}
}



Loading…
Cancel
Save