Browse Source

Update makefiles and to latest dpf

pull/2/head
falkTX 10 years ago
parent
commit
58194641e6
16 changed files with 218 additions and 256 deletions
  1. +43
    -30
      Makefile.mk
  2. +1
    -1
      dpf
  3. +11
    -11
      plugins/Info/ExamplePluginInfo.cpp
  4. +4
    -6
      plugins/Info/ExampleUIInfo.cpp
  5. +13
    -3
      plugins/Info/Makefile
  6. +39
    -20
      plugins/Makefile.mk
  7. +0
    -130
      plugins/Makefile.ntk.mk
  8. +11
    -11
      plugins/Meters/ExamplePluginMeters.cpp
  9. +5
    -6
      plugins/Meters/ExampleUIMeters.cpp
  10. +20
    -2
      plugins/Meters/Makefile
  11. +9
    -9
      plugins/Parameters/ExamplePluginParameters.cpp
  12. +5
    -7
      plugins/Parameters/ExampleUIParameters.cpp
  13. +21
    -2
      plugins/Parameters/Makefile
  14. +11
    -11
      plugins/States/ExamplePluginStates.cpp
  15. +5
    -5
      plugins/States/ExampleUIStates.cpp
  16. +20
    -2
      plugins/States/Makefile

+ 43
- 30
Makefile.mk View File

@@ -4,6 +4,7 @@
# Created by falkTX # Created by falkTX
# #


AR ?= ar
CC ?= gcc CC ?= gcc
CXX ?= g++ CXX ?= g++


@@ -19,38 +20,41 @@ endif
endif endif


# -------------------------------------------------------------- # --------------------------------------------------------------
# Common build and link flags
# Set build and link flags


BASE_FLAGS = -Wall -Wextra -pipe BASE_FLAGS = -Wall -Wextra -pipe
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
ifneq ($(NOOPT),true)
BASE_OPTS += -mtune=generic -msse -msse2 -mfpmath=sse
BASE_OPTS = -O2 -ffast-math -mtune=generic -msse -msse2 -fdata-sections -ffunction-sections

ifneq ($(MACOS),true)
# MacOS doesn't support this
BASE_OPTS += -mfpmath=sse
endif endif
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all


ifeq ($(MACOS),true) ifeq ($(MACOS),true)
# MacOS linker flags # MacOS linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs
else
# Common linker flags
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif endif


ifeq ($(RASPPI),true) ifeq ($(RASPPI),true)
# Raspberry-Pi flags
BASE_OPTS = -O2 -ffast-math
ifneq ($(NOOPT),true)
BASE_OPTS += -march=armv6 -mfpu=vfp -mfloat-abi=hard
endif
# Raspberry-Pi optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv6 -mfpu=vfp -mfloat-abi=hard
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif endif


ifeq ($(PANDORA),true) ifeq ($(PANDORA),true)
# OpenPandora flags
BASE_OPTS = -O2 -ffast-math
ifneq ($(NOOPT),true)
BASE_OPTS += -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
endif
# OpenPandora optimization flags
BASE_OPTS = -O2 -ffast-math -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all
endif endif


ifeq ($(NOOPT),true)
# No optimization flags
BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
endif

ifneq ($(WIN32),true) ifneq ($(WIN32),true)
# not needed for Windows # not needed for Windows
BASE_FLAGS += -fPIC -DPIC BASE_FLAGS += -fPIC -DPIC
@@ -75,27 +79,27 @@ LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS)
endif endif


# -------------------------------------------------------------- # --------------------------------------------------------------
# Check for required libs
# Check for optional libs


ifeq ($(LINUX),true) ifeq ($(LINUX),true)
ifneq ($(shell pkg-config --exists jack && echo true),true)
$(error JACK missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists gl && echo true),true)
$(error OpenGL missing, cannot continue)
endif
ifneq ($(shell pkg-config --exists x11 && echo true),true)
$(error X11 missing, cannot continue)
HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
HAVE_JACK = $(shell pkg-config --exists jack && echo true)
HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
endif endif

ifeq ($(MACOS),true)
HAVE_DGL = true
endif endif


ifneq ($(shell pkg-config --exists liblo && echo true),true)
$(error liblo missing, cannot continue)
ifeq ($(WIN32),true)
HAVE_DGL = true
endif endif


# -------------------------------------------------------------- # --------------------------------------------------------------
# Set libs stuff # Set libs stuff


ifeq ($(HAVE_DGL),true)

ifeq ($(LINUX),true) ifeq ($(LINUX),true)
DGL_FLAGS = $(shell pkg-config --cflags gl x11) DGL_FLAGS = $(shell pkg-config --cflags gl x11)
DGL_LIBS = $(shell pkg-config --libs gl x11) DGL_LIBS = $(shell pkg-config --libs gl x11)
@@ -109,17 +113,26 @@ ifeq ($(WIN32),true)
DGL_LIBS = -lopengl32 -lgdi32 DGL_LIBS = -lopengl32 -lgdi32
endif endif


endif # HAVE_DGL

# --------------------------------------------------------------
# Set app extension

ifeq ($(WIN32),true)
APP_EXT = .exe
endif

# -------------------------------------------------------------- # --------------------------------------------------------------
# Set extension
# Set shared lib extension


EXT = so
LIB_EXT = .so


ifeq ($(MACOS),true) ifeq ($(MACOS),true)
EXT = dylib
LIB_EXT = .dylib
endif endif


ifeq ($(WIN32),true) ifeq ($(WIN32),true)
EXT = dll
LIB_EXT = .dll
endif endif


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


+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 097ea84595ef7a9395c39c1626c0fde888e12971
Subproject commit f0561d522e3bf5e561ae4cfd74957fd26475509c

+ 11
- 11
plugins/Info/ExamplePluginInfo.cpp View File

@@ -40,7 +40,7 @@ protected:
Get the plugin label. Get the plugin label.
A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers. A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers.
*/ */
const char* d_getLabel() const override
const char* getLabel() const override
{ {
return "info"; return "info";
} }
@@ -48,7 +48,7 @@ protected:
/** /**
Get the plugin author/maker. Get the plugin author/maker.
*/ */
const char* d_getMaker() const override
const char* getMaker() const override
{ {
return "DISTRHO"; return "DISTRHO";
} }
@@ -56,7 +56,7 @@ protected:
/** /**
Get the plugin license name (a single line of text). Get the plugin license name (a single line of text).
*/ */
const char* d_getLicense() const override
const char* getLicense() const override
{ {
return "ISC"; return "ISC";
} }
@@ -65,7 +65,7 @@ protected:
Get the plugin version, in hexadecimal. Get the plugin version, in hexadecimal.
TODO format to be defined TODO format to be defined
*/ */
uint32_t d_getVersion() const override
uint32_t getVersion() const override
{ {
return 0x1000; return 0x1000;
} }
@@ -74,7 +74,7 @@ protected:
Get the plugin unique Id. Get the plugin unique Id.
This value is used by LADSPA, DSSI and VST plugin formats. This value is used by LADSPA, DSSI and VST plugin formats.
*/ */
int64_t d_getUniqueId() const override
int64_t getUniqueId() const override
{ {
return d_cconst('d', 'N', 'f', 'o'); return d_cconst('d', 'N', 'f', 'o');
} }
@@ -86,7 +86,7 @@ protected:
Initialize the parameter @a index. Initialize the parameter @a index.
This function will be called once, shortly after the plugin is created. This function will be called once, shortly after the plugin is created.
*/ */
void d_initParameter(uint32_t index, Parameter& parameter) override
void initParameter(uint32_t index, Parameter& parameter) override
{ {
parameter.hints = kParameterIsAutomable|kParameterIsOutput; parameter.hints = kParameterIsAutomable|kParameterIsOutput;
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
@@ -158,7 +158,7 @@ protected:
/** /**
Get the current value of a parameter. Get the current value of a parameter.
*/ */
float d_getParameterValue(uint32_t index) const override
float getParameterValue(uint32_t index) const override
{ {
return fParameters[index]; return fParameters[index];
@@ -167,7 +167,7 @@ protected:
/** /**
Change a parameter value. Change a parameter value.
*/ */
void d_setParameterValue(uint32_t, float) override
void setParameterValue(uint32_t, float) override
{ {
// this is only called for input paramters, which we have none of. // this is only called for input paramters, which we have none of.
} }
@@ -178,7 +178,7 @@ protected:
/** /**
Run/process function for plugins without MIDI input. Run/process function for plugins without MIDI input.
*/ */
void d_run(const float** inputs, float** outputs, uint32_t frames) override
void run(const float** inputs, float** outputs, uint32_t frames) override
{ {
/** /**
This plugin does nothing, it just demonstrates information usage. This plugin does nothing, it just demonstrates information usage.
@@ -192,9 +192,9 @@ protected:
std::memcpy(outputs[1], inputs[1], sizeof(float)*frames); std::memcpy(outputs[1], inputs[1], sizeof(float)*frames);
// set info // set info
fParameters[kParameterBufferSize] = d_getBufferSize();
fParameters[kParameterBufferSize] = getBufferSize();
const TimePosition& timePos(d_getTimePosition());
const TimePosition& timePos(getTimePosition());
fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f; fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f;
fParameters[kParameterTimeFrame] = timePos.frame; fParameters[kParameterTimeFrame] = timePos.frame;


+ 4
- 6
plugins/Info/ExampleUIInfo.cpp View File

@@ -26,15 +26,13 @@ class ExampleUIInfo : public UI
{ {
public: public:
ExampleUIInfo() ExampleUIInfo()
: UI()
: UI(405, 256)
{ {
std::memset(fParameters, 0, sizeof(float)*kParameterCount); std::memset(fParameters, 0, sizeof(float)*kParameterCount);
std::memset(fStrBuf, 0, sizeof(char)*(0xff+1)); std::memset(fStrBuf, 0, sizeof(char)*(0xff+1));


fSampleRate = d_getSampleRate();
fSampleRate = getSampleRate();
fFont = createFont("sans", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"); fFont = createFont("sans", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");

setSize(405, 256);
} }


protected: protected:
@@ -45,7 +43,7 @@ protected:
A parameter has changed on the plugin side. A parameter has changed on the plugin side.
This is called by the host to inform the UI about parameter changes. This is called by the host to inform the UI about parameter changes.
*/ */
void d_parameterChanged(uint32_t index, float value) override
void parameterChanged(uint32_t index, float value) override
{ {
fParameters[index] = value; fParameters[index] = value;
repaint(); repaint();
@@ -57,7 +55,7 @@ protected:
/** /**
Optional callback to inform the UI about a sample rate change on the plugin side. Optional callback to inform the UI about a sample rate change on the plugin side.
*/ */
void d_sampleRateChanged(double newSampleRate)
void sampleRateChanged(double newSampleRate)
{ {
fSampleRate = newSampleRate; fSampleRate = newSampleRate;
repaint(); repaint();


+ 13
- 3
plugins/Info/Makefile View File

@@ -26,10 +26,20 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Enable all possible plugin types # Enable all possible plugin types


ifeq ($(LINUX),true)
all: jack lv2_sep vst
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_JACK),true)
TARGETS += jack
endif
endif

ifeq ($(HAVE_DGL),true)
TARGETS += lv2_sep
else else
all: lv2_sep vst
TARGETS += lv2_dsp
endif endif


TARGETS += vst

all: $(TARGETS)

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

+ 39
- 20
plugins/Makefile.mk View File

@@ -16,34 +16,43 @@ TARGET_DIR = ../../bin
BUILD_C_FLAGS += -I. BUILD_C_FLAGS += -I.
BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl


# --------------------------------------------------------------
# Set plugin binary file targets
ifeq ($(HAVE_DGL),true)
BASE_FLAGS += -DHAVE_DGL
endif


jack = $(TARGET_DIR)/$(NAME)
ladspa_dsp = $(TARGET_DIR)/$(NAME)-ladspa.$(EXT)
dssi_dsp = $(TARGET_DIR)/$(NAME)-dssi.$(EXT)
dssi_ui = $(TARGET_DIR)/$(NAME)-dssi/$(NAME)_ui
lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME).$(EXT)
lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp.$(EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui.$(EXT)
vst = $(TARGET_DIR)/$(NAME)-vst.$(EXT)

ifeq ($(WIN32),true)
dssi_ui += .exe
ifeq ($(HAVE_JACK),true)
BASE_FLAGS += -DHAVE_JACK
endif endif


# TODO: MacOS VST bundle
ifeq ($(HAVE_LIBLO),true)
BASE_FLAGS += -DHAVE_LIBLO
endif

# --------------------------------------------------------------
# Set plugin binary file targets

jack = $(TARGET_DIR)/$(NAME)$(APP_EXT)
ladspa_dsp = $(TARGET_DIR)/$(NAME)-ladspa$(LIB_EXT)
dssi_dsp = $(TARGET_DIR)/$(NAME)-dssi$(LIB_EXT)
dssi_ui = $(TARGET_DIR)/$(NAME)-dssi/$(NAME)_ui$(APP_EXT)
lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME)$(LIB_EXT)
lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp$(LIB_EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui$(LIB_EXT)
vst = $(TARGET_DIR)/$(NAME)-vst$(LIB_EXT)


# -------------------------------------------------------------- # --------------------------------------------------------------
# Set distrho code files # Set distrho code files


DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp

ifeq ($(HAVE_DGL),true)
DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a
endif


# -------------------------------------------------------------- # --------------------------------------------------------------
# Handle plugins without UI # Handle plugins without UI


ifeq ($(TARGET_NOUI),true)
ifneq ($(HAVE_DGL),true)
dssi_ui = dssi_ui =
lv2_ui = lv2_ui =
DISTRHO_UI_FILES = DISTRHO_UI_FILES =
@@ -60,13 +69,13 @@ all:
# Common # Common


%.c.o: %.c %.c.o: %.c
$(CC) $< $(BUILD_C_FLAGS) -c -o $@
$(CC) $< $(BUILD_C_FLAGS) -MD -MP -c -o $@


%.cpp.o: %.cpp ../../dpf/distrho/*
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
%.cpp.o: %.cpp
$(CXX) $< $(BUILD_CXX_FLAGS) -MD -MP -c -o $@


clean: clean:
rm -f *.o
rm -f *.d *.o
rm -rf $(TARGET_DIR)/$(NAME) $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2/ rm -rf $(TARGET_DIR)/$(NAME) $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2/


# -------------------------------------------------------------- # --------------------------------------------------------------
@@ -90,7 +99,9 @@ $(ladspa_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
# -------------------------------------------------------------- # --------------------------------------------------------------
# DSSI # DSSI


dssi: $(dssi_dsp) $(dssi_ui)
dssi: $(dssi_dsp) $(dssi_ui)
dssi_dsp: $(dssi_dsp)
dssi_ui: $(dssi_ui)


$(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES) $(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@) mkdir -p $(shell dirname $@)
@@ -104,6 +115,7 @@ $(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
# LV2 # LV2


lv2_one: $(lv2) lv2_one: $(lv2)
lv2_dsp: $(lv2_dsp)
lv2_sep: $(lv2_dsp) $(lv2_ui) lv2_sep: $(lv2_dsp) $(lv2_ui)


$(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES) $(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
@@ -128,3 +140,10 @@ $(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@ $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@


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

-include $(OBJS_DSP:%.o=%.d)
ifeq ($(HAVE_DGL),true)
-include $(OBJS_UI:%.o=%.d)
endif

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

+ 0
- 130
plugins/Makefile.ntk.mk View File

@@ -1,130 +0,0 @@
#!/usr/bin/make -f
# Makefile for DISTRHO Plugins #
# ---------------------------- #
# Created by falkTX
#

# NAME, OBJS_DSP and OBJS_UI have been defined before

include ../../Makefile.mk

# --------------------------------------------------------------
# Basic setup

TARGET_DIR = ../../bin

BUILD_C_FLAGS += -I.
BUILD_CXX_FLAGS += -I. -I../../dpf/distrho -I../../dpf/dgl

# --------------------------------------------------------------
# Set plugin binary file targets

jack = $(TARGET_DIR)/$(NAME)
ladspa_dsp = $(TARGET_DIR)/$(NAME)-ladspa.$(EXT)
dssi_dsp = $(TARGET_DIR)/$(NAME)-dssi.$(EXT)
dssi_ui = $(TARGET_DIR)/$(NAME)-dssi/$(NAME)_ui
lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME).$(EXT)
lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp.$(EXT)
lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui.$(EXT)
vst = $(TARGET_DIR)/$(NAME)-vst.$(EXT)

ifeq ($(WIN32),true)
dssi_ui += .exe
endif

# TODO: MacOS VST bundle

# --------------------------------------------------------------
# Set distrho code files

DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp
DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp

# --------------------------------------------------------------
# Handle plugins without UI

ifeq ($(TARGET_NOUI),true)
dssi_ui =
lv2_ui =
DISTRHO_UI_FILES =
DGL_LIBS =
OBJS_UI =
endif

# --------------------------------------------------------------
# all needs to be first

all:

# --------------------------------------------------------------
# Common

%.c.o: %.c
$(CC) $< $(BUILD_C_FLAGS) -c -o $@

%.cpp.o: %.cpp ../../dpf/distrho/*
$(CXX) $< $(BUILD_CXX_FLAGS) $(shell pkg-config --cflags ntk_images ntk) -c -o $@

clean:
rm -f *.o
rm -rf $(TARGET_DIR)/$(NAME) $(TARGET_DIR)/$(NAME)-* $(TARGET_DIR)/$(NAME).lv2/

# --------------------------------------------------------------
# JACK

jack: $(jack)

$(jack): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs jack ntk_images ntk) -DDISTRHO_PLUGIN_TARGET_JACK -o $@

# --------------------------------------------------------------
# LADSPA

ladspa: $(ladspa_dsp)

$(ladspa_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LADSPA -o $@

# --------------------------------------------------------------
# DSSI

dssi: $(dssi_dsp) $(dssi_ui)

$(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@

$(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs liblo ntk_images ntk) -DDISTRHO_PLUGIN_TARGET_DSSI -o $@

# --------------------------------------------------------------
# LV2

lv2_one: $(lv2)
lv2_sep: $(lv2_dsp) $(lv2_ui)

$(lv2): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs ntk_images ntk) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

$(lv2_ui): $(OBJS_UI) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs ntk_images ntk) $(SHARED) -DDISTRHO_PLUGIN_TARGET_LV2 -o $@

# --------------------------------------------------------------
# VST

vst: $(vst)

$(vst): $(OBJS_DSP) $(OBJS_UI) $(DISTRHO_PLUGIN_FILES) $(DISTRHO_UI_FILES)
mkdir -p $(shell dirname $@)
$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(DGL_LIBS) $(shell pkg-config --cflags --libs ntk_images ntk) $(SHARED) -DDISTRHO_PLUGIN_TARGET_VST -o $@

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

+ 11
- 11
plugins/Meters/ExamplePluginMeters.cpp View File

@@ -43,7 +43,7 @@ protected:
Get the plugin label. Get the plugin label.
A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers. A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers.
*/ */
const char* d_getLabel() const override
const char* getLabel() const override
{ {
return "meters"; return "meters";
} }
@@ -51,7 +51,7 @@ protected:
/** /**
Get the plugin author/maker. Get the plugin author/maker.
*/ */
const char* d_getMaker() const override
const char* getMaker() const override
{ {
return "DISTRHO"; return "DISTRHO";
} }
@@ -59,7 +59,7 @@ protected:
/** /**
Get the plugin license name (a single line of text). Get the plugin license name (a single line of text).
*/ */
const char* d_getLicense() const override
const char* getLicense() const override
{ {
return "ISC"; return "ISC";
} }
@@ -68,7 +68,7 @@ protected:
Get the plugin version, in hexadecimal. Get the plugin version, in hexadecimal.
TODO format to be defined TODO format to be defined
*/ */
uint32_t d_getVersion() const override
uint32_t getVersion() const override
{ {
return 0x1000; return 0x1000;
} }
@@ -77,7 +77,7 @@ protected:
Get the plugin unique Id. Get the plugin unique Id.
This value is used by LADSPA, DSSI and VST plugin formats. This value is used by LADSPA, DSSI and VST plugin formats.
*/ */
int64_t d_getUniqueId() const override
int64_t getUniqueId() const override
{ {
return d_cconst('d', 'M', 't', 'r'); return d_cconst('d', 'M', 't', 'r');
} }
@@ -89,7 +89,7 @@ protected:
Initialize the parameter @a index. Initialize the parameter @a index.
This function will be called once, shortly after the plugin is created. This function will be called once, shortly after the plugin is created.
*/ */
void d_initParameter(uint32_t index, Parameter& parameter) override
void initParameter(uint32_t index, Parameter& parameter) override
{ {
/** /**
All parameters in this plugin have the same ranges. All parameters in this plugin have the same ranges.
@@ -125,7 +125,7 @@ protected:
Set a state key and default value. Set a state key and default value.
This function will be called once, shortly after the plugin is created. This function will be called once, shortly after the plugin is created.
*/ */
void d_initState(uint32_t, d_string&, d_string&) override
void initState(uint32_t, String&, String&) override
{ {
// we are using states but don't want them saved in the host // we are using states but don't want them saved in the host
} }
@@ -136,7 +136,7 @@ protected:
/** /**
Get the current value of a parameter. Get the current value of a parameter.
*/ */
float d_getParameterValue(uint32_t index) const override
float getParameterValue(uint32_t index) const override
{ {
switch (index) switch (index)
{ {
@@ -151,7 +151,7 @@ protected:
/** /**
Change a parameter value. Change a parameter value.
*/ */
void d_setParameterValue(uint32_t index, float value) override
void setParameterValue(uint32_t index, float value) override
{ {
// this is only called for input paramters, and we only have one of those. // this is only called for input paramters, and we only have one of those.
if (index != 0) return; if (index != 0) return;
@@ -162,7 +162,7 @@ protected:
/** /**
Change an internal state. Change an internal state.
*/ */
void d_setState(const char* key, const char*) override
void setState(const char* key, const char*) override
{ {
if (std::strcmp(key, "reset") != 0) if (std::strcmp(key, "reset") != 0)
return; return;
@@ -176,7 +176,7 @@ protected:
/** /**
Run/process function for plugins without MIDI input. Run/process function for plugins without MIDI input.
*/ */
void d_run(const float** inputs, float** outputs, uint32_t frames) override
void run(const float** inputs, float** outputs, uint32_t frames) override
{ {
float tmp; float tmp;
float tmpLeft = 0.0f; float tmpLeft = 0.0f;


+ 5
- 6
plugins/Meters/ExampleUIMeters.cpp View File

@@ -34,7 +34,7 @@ class ExampleUIMeters : public UI
{ {
public: public:
ExampleUIMeters() ExampleUIMeters()
: UI(),
: UI(128, 512),
// default color is green // default color is green
fColor(93, 231, 61), fColor(93, 231, 61),
// which is value 0 // which is value 0
@@ -43,7 +43,6 @@ public:
fOutLeft(0.0f), fOutLeft(0.0f),
fOutRight(0.0f) fOutRight(0.0f)
{ {
setSize(128, 512);
} }


protected: protected:
@@ -54,7 +53,7 @@ protected:
A parameter has changed on the plugin side. A parameter has changed on the plugin side.
This is called by the host to inform the UI about parameter changes. This is called by the host to inform the UI about parameter changes.
*/ */
void d_parameterChanged(uint32_t index, float value) override
void parameterChanged(uint32_t index, float value) override
{ {
switch (index) switch (index)
{ {
@@ -94,7 +93,7 @@ protected:
A state has changed on the plugin side. A state has changed on the plugin side.
This is called by the host to inform the UI about state changes. This is called by the host to inform the UI about state changes.
*/ */
void d_stateChanged(const char*, const char*)
void stateChanged(const char*, const char*)
{ {
// nothing here // nothing here
} }
@@ -116,7 +115,7 @@ protected:
const float outRight(fOutRight); const float outRight(fOutRight);


// tell DSP side to reset meter values // tell DSP side to reset meter values
d_setState("reset", "");
setState("reset", "");


// useful vars // useful vars
const float halfWidth = static_cast<float>(getWidth())/2; const float halfWidth = static_cast<float>(getWidth())/2;
@@ -193,7 +192,7 @@ protected:


const int newColor(fColorValue == 0 ? 1 : 0); const int newColor(fColorValue == 0 ? 1 : 0);
updateColor(newColor); updateColor(newColor);
d_setParameterValue(0, newColor);
setParameterValue(0, newColor);


return true; return true;
} }


+ 20
- 2
plugins/Meters/Makefile View File

@@ -26,10 +26,28 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Enable all possible plugin types # Enable all possible plugin types


ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_JACK),true)
TARGETS += jack
endif
endif

ifeq ($(LINUX),true) ifeq ($(LINUX),true)
all: jack dssi lv2_sep vst
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_LIBLO),true)
TARGETS += dssi
endif
endif
endif

ifeq ($(HAVE_DGL),true)
TARGETS += lv2_sep
else else
all: dssi lv2_sep vst
TARGETS += lv2_dsp
endif endif


TARGETS += vst

all: $(TARGETS)

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

+ 9
- 9
plugins/Parameters/ExamplePluginParameters.cpp View File

@@ -45,7 +45,7 @@ protected:
Get the plugin label. Get the plugin label.
A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers. A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers.
*/ */
const char* d_getLabel() const override
const char* getLabel() const override
{ {
return "parameters"; return "parameters";
} }
@@ -53,7 +53,7 @@ protected:
/** /**
Get the plugin author/maker. Get the plugin author/maker.
*/ */
const char* d_getMaker() const override
const char* getMaker() const override
{ {
return "DISTRHO"; return "DISTRHO";
} }
@@ -61,7 +61,7 @@ protected:
/** /**
Get the plugin license name (a single line of text). Get the plugin license name (a single line of text).
*/ */
const char* d_getLicense() const override
const char* getLicense() const override
{ {
return "ISC"; return "ISC";
} }
@@ -70,7 +70,7 @@ protected:
Get the plugin version, in hexadecimal. Get the plugin version, in hexadecimal.
TODO format to be defined TODO format to be defined
*/ */
uint32_t d_getVersion() const override
uint32_t getVersion() const override
{ {
return 0x1000; return 0x1000;
} }
@@ -79,7 +79,7 @@ protected:
Get the plugin unique Id. Get the plugin unique Id.
This value is used by LADSPA, DSSI and VST plugin formats. This value is used by LADSPA, DSSI and VST plugin formats.
*/ */
int64_t d_getUniqueId() const override
int64_t getUniqueId() const override
{ {
return d_cconst('d', 'P', 'r', 'm'); return d_cconst('d', 'P', 'r', 'm');
} }
@@ -91,7 +91,7 @@ protected:
Initialize the parameter @a index. Initialize the parameter @a index.
This function will be called once, shortly after the plugin is created. This function will be called once, shortly after the plugin is created.
*/ */
void d_initParameter(uint32_t index, Parameter& parameter) override
void initParameter(uint32_t index, Parameter& parameter) override
{ {
/** /**
All parameters in this plugin are similar except for name. All parameters in this plugin are similar except for name.
@@ -160,7 +160,7 @@ protected:
/** /**
Get the current value of a parameter. Get the current value of a parameter.
*/ */
float d_getParameterValue(uint32_t index) const override
float getParameterValue(uint32_t index) const override
{ {
return fParamGrid[index]; return fParamGrid[index];
} }
@@ -168,7 +168,7 @@ protected:
/** /**
Change a parameter value. Change a parameter value.
*/ */
void d_setParameterValue(uint32_t index, float value) override
void setParameterValue(uint32_t index, float value) override
{ {
fParamGrid[index] = value; fParamGrid[index] = value;
} }
@@ -179,7 +179,7 @@ protected:
/** /**
Run/process function for plugins without MIDI input. Run/process function for plugins without MIDI input.
*/ */
void d_run(const float** inputs, float** outputs, uint32_t frames) override
void run(const float** inputs, float** outputs, uint32_t frames) override
{ {
/** /**
This plugin does nothing, it just demonstrates parameter usage. This plugin does nothing, it just demonstrates parameter usage.


+ 5
- 7
plugins/Parameters/ExampleUIParameters.cpp View File

@@ -35,15 +35,13 @@ class ExampleUIParameters : public UI
{ {
public: public:
ExampleUIParameters() ExampleUIParameters()
: UI()
: UI(kUIWidth, kUIHeight)
{ {
/** /**
Initialize all our parameters to their defaults. Initialize all our parameters to their defaults.
In this example all default values are false, so we can simply zero them. In this example all default values are false, so we can simply zero them.
*/ */
std::memset(fParamGrid, 0, sizeof(bool)*9); std::memset(fParamGrid, 0, sizeof(bool)*9);

setSize(kUIWidth, kUIHeight);
} }


protected: protected:
@@ -54,7 +52,7 @@ protected:
A parameter has changed on the plugin side. A parameter has changed on the plugin side.
This is called by the host to inform the UI about parameter changes. This is called by the host to inform the UI about parameter changes.
*/ */
void d_parameterChanged(uint32_t index, float value) override
void parameterChanged(uint32_t index, float value) override
{ {
// update our grid state to match the plugin side // update our grid state to match the plugin side
fParamGrid[index] = (value > 0.5f); fParamGrid[index] = (value > 0.5f);
@@ -146,7 +144,7 @@ protected:
fParamGrid[index] = !fParamGrid[index]; fParamGrid[index] = !fParamGrid[index];


// report change to host (and thus plugin) // report change to host (and thus plugin)
d_setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f);
setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f);


// trigger repaint // trigger repaint
repaint(); repaint();
@@ -161,7 +159,7 @@ protected:
// same as before // same as before
const uint32_t index = 3+i; const uint32_t index = 3+i;
fParamGrid[index] = !fParamGrid[index]; fParamGrid[index] = !fParamGrid[index];
d_setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f);
setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f);
repaint(); repaint();
break; break;
} }
@@ -174,7 +172,7 @@ protected:
// same as before // same as before
const uint32_t index = 6+i; const uint32_t index = 6+i;
fParamGrid[index] = !fParamGrid[index]; fParamGrid[index] = !fParamGrid[index];
d_setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f);
setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f);
repaint(); repaint();
break; break;
} }


+ 21
- 2
plugins/Parameters/Makefile View File

@@ -26,10 +26,29 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Enable all possible plugin types # Enable all possible plugin types


ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_JACK),true)
TARGETS += jack
endif
endif

ifeq ($(LINUX),true) ifeq ($(LINUX),true)
all: jack ladspa dssi lv2_sep vst
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_LIBLO),true)
TARGETS += ladspa
TARGETS += dssi
endif
endif
endif

ifeq ($(HAVE_DGL),true)
TARGETS += lv2_sep
else else
all: ladspa dssi lv2_sep vst
TARGETS += lv2_dsp
endif endif


TARGETS += vst

all: $(TARGETS)

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

+ 11
- 11
plugins/States/ExamplePluginStates.cpp View File

@@ -41,7 +41,7 @@ protected:
Get the plugin label. Get the plugin label.
A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers. A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers.
*/ */
const char* d_getLabel() const override
const char* getLabel() const override
{ {
return "states"; return "states";
} }
@@ -49,7 +49,7 @@ protected:
/** /**
Get the plugin author/maker. Get the plugin author/maker.
*/ */
const char* d_getMaker() const override
const char* getMaker() const override
{ {
return "DISTRHO"; return "DISTRHO";
} }
@@ -57,7 +57,7 @@ protected:
/** /**
Get the plugin license name (a single line of text). Get the plugin license name (a single line of text).
*/ */
const char* d_getLicense() const override
const char* getLicense() const override
{ {
return "ISC"; return "ISC";
} }
@@ -66,7 +66,7 @@ protected:
Get the plugin version, in hexadecimal. Get the plugin version, in hexadecimal.
TODO format to be defined TODO format to be defined
*/ */
uint32_t d_getVersion() const override
uint32_t getVersion() const override
{ {
return 0x1000; return 0x1000;
} }
@@ -75,7 +75,7 @@ protected:
Get the plugin unique Id. Get the plugin unique Id.
This value is used by LADSPA, DSSI and VST plugin formats. This value is used by LADSPA, DSSI and VST plugin formats.
*/ */
int64_t d_getUniqueId() const override
int64_t getUniqueId() const override
{ {
return d_cconst('d', 'S', 't', 's'); return d_cconst('d', 'S', 't', 's');
} }
@@ -86,9 +86,9 @@ protected:
/** /**
This plugin has no parameters, so we can safely ignore some functions. This plugin has no parameters, so we can safely ignore some functions.
*/ */
void d_initParameter(uint32_t, Parameter&) override {}
void d_setParameterValue(uint32_t, float) override {}
float d_getParameterValue(uint32_t) const override { return 0.0f; }
void initParameter(uint32_t, Parameter&) override {}
void setParameterValue(uint32_t, float) override {}
float getParameterValue(uint32_t) const override { return 0.0f; }
/* -------------------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------------------
* State */ * State */
@@ -97,7 +97,7 @@ protected:
Set the state key and default value of @a index. Set the state key and default value of @a index.
This function will be called once, shortly after the plugin is created. This function will be called once, shortly after the plugin is created.
*/ */
void d_initState(uint32_t index, d_string& stateKey, d_string& defaultStateValue) override
void initState(uint32_t index, String& stateKey, String& defaultStateValue) override
{ {
switch (index) switch (index)
{ {
@@ -136,7 +136,7 @@ protected:
/** /**
Change an internal state. Change an internal state.
*/ */
void d_setState(const char*, const char*) override
void setState(const char*, const char*) override
{ {
// there is no plugin side state here. // there is no plugin side state here.
// states on this plugin will only change the UI grid, so we do nothing here // states on this plugin will only change the UI grid, so we do nothing here
@@ -148,7 +148,7 @@ protected:
/** /**
Run/process function for plugins without MIDI input. Run/process function for plugins without MIDI input.
*/ */
void d_run(const float** inputs, float** outputs, uint32_t frames) override
void run(const float** inputs, float** outputs, uint32_t frames) override
{ {
/** /**
This plugin does nothing, it just demonstrates parameter usage. This plugin does nothing, it just demonstrates parameter usage.


+ 5
- 5
plugins/States/ExampleUIStates.cpp View File

@@ -73,13 +73,13 @@ protected:
/** /**
This plugin has no parameters, so we can safely ignore this. This plugin has no parameters, so we can safely ignore this.
*/ */
void d_parameterChanged(uint32_t, float) override {}
void parameterChanged(uint32_t, float) override {}


/** /**
A state has changed on the plugin side. A state has changed on the plugin side.
This is called by the host to inform the UI about state changes. This is called by the host to inform the UI about state changes.
*/ */
void d_stateChanged(const char* key, const char* value)
void stateChanged(const char* key, const char* value)
{ {
// check which block changed, enable it if its value is "true" // check which block changed, enable it if its value is "true"


@@ -189,7 +189,7 @@ protected:
fParamGrid[index] = !fParamGrid[index]; fParamGrid[index] = !fParamGrid[index];


// report change to host (and thus plugin) // report change to host (and thus plugin)
d_setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false");
setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false");


// trigger repaint // trigger repaint
repaint(); repaint();
@@ -204,7 +204,7 @@ protected:
// same as before // same as before
const uint32_t index = 3+i; const uint32_t index = 3+i;
fParamGrid[index] = !fParamGrid[index]; fParamGrid[index] = !fParamGrid[index];
d_setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false");
setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false");
repaint(); repaint();
break; break;
} }
@@ -217,7 +217,7 @@ protected:
// same as before // same as before
const uint32_t index = 6+i; const uint32_t index = 6+i;
fParamGrid[index] = !fParamGrid[index]; fParamGrid[index] = !fParamGrid[index];
d_setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false");
setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false");
repaint(); repaint();
break; break;
} }


+ 20
- 2
plugins/States/Makefile View File

@@ -26,10 +26,28 @@ include ../Makefile.mk
# -------------------------------------------------------------- # --------------------------------------------------------------
# Enable all possible plugin types # Enable all possible plugin types


ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_JACK),true)
TARGETS += jack
endif
endif

ifeq ($(LINUX),true) ifeq ($(LINUX),true)
all: jack dssi lv2_sep vst
ifeq ($(HAVE_DGL),true)
ifeq ($(HAVE_LIBLO),true)
TARGETS += dssi
endif
endif
endif

ifeq ($(HAVE_DGL),true)
TARGETS += lv2_sep
else else
all: dssi lv2_sep vst
TARGETS += lv2_dsp
endif endif


TARGETS += vst

all: $(TARGETS)

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

Loading…
Cancel
Save