| @@ -4,6 +4,7 @@ | |||
| # Created by falkTX | |||
| # | |||
| AR ?= ar | |||
| CC ?= gcc | |||
| CXX ?= g++ | |||
| @@ -19,38 +20,41 @@ endif | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Common build and link flags | |||
| # Set build and link flags | |||
| 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 | |||
| LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--strip-all | |||
| ifeq ($(MACOS),true) | |||
| # MacOS linker flags | |||
| 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 | |||
| 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 | |||
| endif | |||
| 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 | |||
| endif | |||
| ifeq ($(NOOPT),true) | |||
| # No optimization flags | |||
| BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections | |||
| endif | |||
| ifneq ($(WIN32),true) | |||
| # not needed for Windows | |||
| BASE_FLAGS += -fPIC -DPIC | |||
| @@ -75,27 +79,27 @@ LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Check for required libs | |||
| # Check for optional libs | |||
| 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 | |||
| ifeq ($(MACOS),true) | |||
| HAVE_DGL = true | |||
| endif | |||
| ifneq ($(shell pkg-config --exists liblo && echo true),true) | |||
| $(error liblo missing, cannot continue) | |||
| ifeq ($(WIN32),true) | |||
| HAVE_DGL = true | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Set libs stuff | |||
| ifeq ($(HAVE_DGL),true) | |||
| ifeq ($(LINUX),true) | |||
| DGL_FLAGS = $(shell pkg-config --cflags gl x11) | |||
| DGL_LIBS = $(shell pkg-config --libs gl x11) | |||
| @@ -109,17 +113,26 @@ ifeq ($(WIN32),true) | |||
| DGL_LIBS = -lopengl32 -lgdi32 | |||
| 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) | |||
| EXT = dylib | |||
| LIB_EXT = .dylib | |||
| endif | |||
| ifeq ($(WIN32),true) | |||
| EXT = dll | |||
| LIB_EXT = .dll | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| @@ -1 +1 @@ | |||
| Subproject commit 097ea84595ef7a9395c39c1626c0fde888e12971 | |||
| Subproject commit f0561d522e3bf5e561ae4cfd74957fd26475509c | |||
| @@ -40,7 +40,7 @@ protected: | |||
| Get the plugin label. | |||
| 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"; | |||
| } | |||
| @@ -48,7 +48,7 @@ protected: | |||
| /** | |||
| Get the plugin author/maker. | |||
| */ | |||
| const char* d_getMaker() const override | |||
| const char* getMaker() const override | |||
| { | |||
| return "DISTRHO"; | |||
| } | |||
| @@ -56,7 +56,7 @@ protected: | |||
| /** | |||
| Get the plugin license name (a single line of text). | |||
| */ | |||
| const char* d_getLicense() const override | |||
| const char* getLicense() const override | |||
| { | |||
| return "ISC"; | |||
| } | |||
| @@ -65,7 +65,7 @@ protected: | |||
| Get the plugin version, in hexadecimal. | |||
| TODO format to be defined | |||
| */ | |||
| uint32_t d_getVersion() const override | |||
| uint32_t getVersion() const override | |||
| { | |||
| return 0x1000; | |||
| } | |||
| @@ -74,7 +74,7 @@ protected: | |||
| Get the plugin unique Id. | |||
| 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'); | |||
| } | |||
| @@ -86,7 +86,7 @@ protected: | |||
| Initialize the parameter @a index. | |||
| 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.ranges.def = 0.0f; | |||
| @@ -158,7 +158,7 @@ protected: | |||
| /** | |||
| 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]; | |||
| @@ -167,7 +167,7 @@ protected: | |||
| /** | |||
| 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. | |||
| } | |||
| @@ -178,7 +178,7 @@ protected: | |||
| /** | |||
| 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. | |||
| @@ -192,9 +192,9 @@ protected: | |||
| std::memcpy(outputs[1], inputs[1], sizeof(float)*frames); | |||
| // 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[kParameterTimeFrame] = timePos.frame; | |||
| @@ -26,15 +26,13 @@ class ExampleUIInfo : public UI | |||
| { | |||
| public: | |||
| ExampleUIInfo() | |||
| : UI() | |||
| : UI(405, 256) | |||
| { | |||
| std::memset(fParameters, 0, sizeof(float)*kParameterCount); | |||
| std::memset(fStrBuf, 0, sizeof(char)*(0xff+1)); | |||
| fSampleRate = d_getSampleRate(); | |||
| fSampleRate = getSampleRate(); | |||
| fFont = createFont("sans", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"); | |||
| setSize(405, 256); | |||
| } | |||
| protected: | |||
| @@ -45,7 +43,7 @@ protected: | |||
| A parameter has changed on the plugin side. | |||
| 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; | |||
| repaint(); | |||
| @@ -57,7 +55,7 @@ protected: | |||
| /** | |||
| 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; | |||
| repaint(); | |||
| @@ -26,10 +26,20 @@ include ../Makefile.mk | |||
| # -------------------------------------------------------------- | |||
| # 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 | |||
| all: lv2_sep vst | |||
| TARGETS += lv2_dsp | |||
| endif | |||
| TARGETS += vst | |||
| all: $(TARGETS) | |||
| # -------------------------------------------------------------- | |||
| @@ -16,34 +16,43 @@ TARGET_DIR = ../../bin | |||
| BUILD_C_FLAGS += -I. | |||
| 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 | |||
| # 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 | |||
| DISTRHO_PLUGIN_FILES = ../../dpf/distrho/DistrhoPluginMain.cpp | |||
| ifeq ($(HAVE_DGL),true) | |||
| DISTRHO_UI_FILES = ../../dpf/distrho/DistrhoUIMain.cpp ../../dpf/libdgl.a | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| # Handle plugins without UI | |||
| ifeq ($(TARGET_NOUI),true) | |||
| ifneq ($(HAVE_DGL),true) | |||
| dssi_ui = | |||
| lv2_ui = | |||
| DISTRHO_UI_FILES = | |||
| @@ -60,13 +69,13 @@ all: | |||
| # Common | |||
| %.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: | |||
| rm -f *.o | |||
| rm -f *.d *.o | |||
| 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_dsp) $(dssi_ui) | |||
| dssi: $(dssi_dsp) $(dssi_ui) | |||
| dssi_dsp: $(dssi_dsp) | |||
| dssi_ui: $(dssi_ui) | |||
| $(dssi_dsp): $(OBJS_DSP) $(DISTRHO_PLUGIN_FILES) | |||
| mkdir -p $(shell dirname $@) | |||
| @@ -104,6 +115,7 @@ $(dssi_ui): $(OBJS_UI) $(DISTRHO_UI_FILES) | |||
| # LV2 | |||
| lv2_one: $(lv2) | |||
| lv2_dsp: $(lv2_dsp) | |||
| lv2_sep: $(lv2_dsp) $(lv2_ui) | |||
| $(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 $@ | |||
| # -------------------------------------------------------------- | |||
| -include $(OBJS_DSP:%.o=%.d) | |||
| ifeq ($(HAVE_DGL),true) | |||
| -include $(OBJS_UI:%.o=%.d) | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| @@ -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 $@ | |||
| # -------------------------------------------------------------- | |||
| @@ -43,7 +43,7 @@ protected: | |||
| Get the plugin label. | |||
| 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"; | |||
| } | |||
| @@ -51,7 +51,7 @@ protected: | |||
| /** | |||
| Get the plugin author/maker. | |||
| */ | |||
| const char* d_getMaker() const override | |||
| const char* getMaker() const override | |||
| { | |||
| return "DISTRHO"; | |||
| } | |||
| @@ -59,7 +59,7 @@ protected: | |||
| /** | |||
| Get the plugin license name (a single line of text). | |||
| */ | |||
| const char* d_getLicense() const override | |||
| const char* getLicense() const override | |||
| { | |||
| return "ISC"; | |||
| } | |||
| @@ -68,7 +68,7 @@ protected: | |||
| Get the plugin version, in hexadecimal. | |||
| TODO format to be defined | |||
| */ | |||
| uint32_t d_getVersion() const override | |||
| uint32_t getVersion() const override | |||
| { | |||
| return 0x1000; | |||
| } | |||
| @@ -77,7 +77,7 @@ protected: | |||
| Get the plugin unique Id. | |||
| 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'); | |||
| } | |||
| @@ -89,7 +89,7 @@ protected: | |||
| Initialize the parameter @a index. | |||
| 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. | |||
| @@ -125,7 +125,7 @@ protected: | |||
| Set a state key and default value. | |||
| 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 | |||
| } | |||
| @@ -136,7 +136,7 @@ protected: | |||
| /** | |||
| Get the current value of a parameter. | |||
| */ | |||
| float d_getParameterValue(uint32_t index) const override | |||
| float getParameterValue(uint32_t index) const override | |||
| { | |||
| switch (index) | |||
| { | |||
| @@ -151,7 +151,7 @@ protected: | |||
| /** | |||
| 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. | |||
| if (index != 0) return; | |||
| @@ -162,7 +162,7 @@ protected: | |||
| /** | |||
| 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) | |||
| return; | |||
| @@ -176,7 +176,7 @@ protected: | |||
| /** | |||
| 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 tmpLeft = 0.0f; | |||
| @@ -34,7 +34,7 @@ class ExampleUIMeters : public UI | |||
| { | |||
| public: | |||
| ExampleUIMeters() | |||
| : UI(), | |||
| : UI(128, 512), | |||
| // default color is green | |||
| fColor(93, 231, 61), | |||
| // which is value 0 | |||
| @@ -43,7 +43,6 @@ public: | |||
| fOutLeft(0.0f), | |||
| fOutRight(0.0f) | |||
| { | |||
| setSize(128, 512); | |||
| } | |||
| protected: | |||
| @@ -54,7 +53,7 @@ protected: | |||
| A parameter has changed on the plugin side. | |||
| 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) | |||
| { | |||
| @@ -94,7 +93,7 @@ protected: | |||
| A state has changed on the plugin side. | |||
| 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 | |||
| } | |||
| @@ -116,7 +115,7 @@ protected: | |||
| const float outRight(fOutRight); | |||
| // tell DSP side to reset meter values | |||
| d_setState("reset", ""); | |||
| setState("reset", ""); | |||
| // useful vars | |||
| const float halfWidth = static_cast<float>(getWidth())/2; | |||
| @@ -193,7 +192,7 @@ protected: | |||
| const int newColor(fColorValue == 0 ? 1 : 0); | |||
| updateColor(newColor); | |||
| d_setParameterValue(0, newColor); | |||
| setParameterValue(0, newColor); | |||
| return true; | |||
| } | |||
| @@ -26,10 +26,28 @@ include ../Makefile.mk | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| ifeq ($(HAVE_DGL),true) | |||
| ifeq ($(HAVE_JACK),true) | |||
| TARGETS += jack | |||
| endif | |||
| endif | |||
| 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 | |||
| all: dssi lv2_sep vst | |||
| TARGETS += lv2_dsp | |||
| endif | |||
| TARGETS += vst | |||
| all: $(TARGETS) | |||
| # -------------------------------------------------------------- | |||
| @@ -45,7 +45,7 @@ protected: | |||
| Get the plugin label. | |||
| 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"; | |||
| } | |||
| @@ -53,7 +53,7 @@ protected: | |||
| /** | |||
| Get the plugin author/maker. | |||
| */ | |||
| const char* d_getMaker() const override | |||
| const char* getMaker() const override | |||
| { | |||
| return "DISTRHO"; | |||
| } | |||
| @@ -61,7 +61,7 @@ protected: | |||
| /** | |||
| Get the plugin license name (a single line of text). | |||
| */ | |||
| const char* d_getLicense() const override | |||
| const char* getLicense() const override | |||
| { | |||
| return "ISC"; | |||
| } | |||
| @@ -70,7 +70,7 @@ protected: | |||
| Get the plugin version, in hexadecimal. | |||
| TODO format to be defined | |||
| */ | |||
| uint32_t d_getVersion() const override | |||
| uint32_t getVersion() const override | |||
| { | |||
| return 0x1000; | |||
| } | |||
| @@ -79,7 +79,7 @@ protected: | |||
| Get the plugin unique Id. | |||
| 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'); | |||
| } | |||
| @@ -91,7 +91,7 @@ protected: | |||
| Initialize the parameter @a index. | |||
| 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. | |||
| @@ -160,7 +160,7 @@ protected: | |||
| /** | |||
| 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]; | |||
| } | |||
| @@ -168,7 +168,7 @@ protected: | |||
| /** | |||
| Change a parameter value. | |||
| */ | |||
| void d_setParameterValue(uint32_t index, float value) override | |||
| void setParameterValue(uint32_t index, float value) override | |||
| { | |||
| fParamGrid[index] = value; | |||
| } | |||
| @@ -179,7 +179,7 @@ protected: | |||
| /** | |||
| 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. | |||
| @@ -35,15 +35,13 @@ class ExampleUIParameters : public UI | |||
| { | |||
| public: | |||
| ExampleUIParameters() | |||
| : UI() | |||
| : UI(kUIWidth, kUIHeight) | |||
| { | |||
| /** | |||
| Initialize all our parameters to their defaults. | |||
| In this example all default values are false, so we can simply zero them. | |||
| */ | |||
| std::memset(fParamGrid, 0, sizeof(bool)*9); | |||
| setSize(kUIWidth, kUIHeight); | |||
| } | |||
| protected: | |||
| @@ -54,7 +52,7 @@ protected: | |||
| A parameter has changed on the plugin side. | |||
| 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 | |||
| fParamGrid[index] = (value > 0.5f); | |||
| @@ -146,7 +144,7 @@ protected: | |||
| fParamGrid[index] = !fParamGrid[index]; | |||
| // 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 | |||
| repaint(); | |||
| @@ -161,7 +159,7 @@ protected: | |||
| // same as before | |||
| const uint32_t index = 3+i; | |||
| fParamGrid[index] = !fParamGrid[index]; | |||
| d_setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); | |||
| setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); | |||
| repaint(); | |||
| break; | |||
| } | |||
| @@ -174,7 +172,7 @@ protected: | |||
| // same as before | |||
| const uint32_t index = 6+i; | |||
| fParamGrid[index] = !fParamGrid[index]; | |||
| d_setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); | |||
| setParameterValue(index, fParamGrid[index] ? 1.0f : 0.0f); | |||
| repaint(); | |||
| break; | |||
| } | |||
| @@ -26,10 +26,29 @@ include ../Makefile.mk | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| ifeq ($(HAVE_DGL),true) | |||
| ifeq ($(HAVE_JACK),true) | |||
| TARGETS += jack | |||
| endif | |||
| endif | |||
| 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 | |||
| all: ladspa dssi lv2_sep vst | |||
| TARGETS += lv2_dsp | |||
| endif | |||
| TARGETS += vst | |||
| all: $(TARGETS) | |||
| # -------------------------------------------------------------- | |||
| @@ -41,7 +41,7 @@ protected: | |||
| Get the plugin label. | |||
| 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"; | |||
| } | |||
| @@ -49,7 +49,7 @@ protected: | |||
| /** | |||
| Get the plugin author/maker. | |||
| */ | |||
| const char* d_getMaker() const override | |||
| const char* getMaker() const override | |||
| { | |||
| return "DISTRHO"; | |||
| } | |||
| @@ -57,7 +57,7 @@ protected: | |||
| /** | |||
| Get the plugin license name (a single line of text). | |||
| */ | |||
| const char* d_getLicense() const override | |||
| const char* getLicense() const override | |||
| { | |||
| return "ISC"; | |||
| } | |||
| @@ -66,7 +66,7 @@ protected: | |||
| Get the plugin version, in hexadecimal. | |||
| TODO format to be defined | |||
| */ | |||
| uint32_t d_getVersion() const override | |||
| uint32_t getVersion() const override | |||
| { | |||
| return 0x1000; | |||
| } | |||
| @@ -75,7 +75,7 @@ protected: | |||
| Get the plugin unique Id. | |||
| 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'); | |||
| } | |||
| @@ -86,9 +86,9 @@ protected: | |||
| /** | |||
| 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 */ | |||
| @@ -97,7 +97,7 @@ protected: | |||
| Set the state key and default value of @a index. | |||
| 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) | |||
| { | |||
| @@ -136,7 +136,7 @@ protected: | |||
| /** | |||
| 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. | |||
| // 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. | |||
| */ | |||
| 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. | |||
| @@ -73,13 +73,13 @@ protected: | |||
| /** | |||
| 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. | |||
| 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" | |||
| @@ -189,7 +189,7 @@ protected: | |||
| fParamGrid[index] = !fParamGrid[index]; | |||
| // report change to host (and thus plugin) | |||
| d_setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false"); | |||
| setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false"); | |||
| // trigger repaint | |||
| repaint(); | |||
| @@ -204,7 +204,7 @@ protected: | |||
| // same as before | |||
| const uint32_t index = 3+i; | |||
| fParamGrid[index] = !fParamGrid[index]; | |||
| d_setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false"); | |||
| setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false"); | |||
| repaint(); | |||
| break; | |||
| } | |||
| @@ -217,7 +217,7 @@ protected: | |||
| // same as before | |||
| const uint32_t index = 6+i; | |||
| fParamGrid[index] = !fParamGrid[index]; | |||
| d_setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false"); | |||
| setState(getStateKeyFromIndex(index), fParamGrid[index] ? "true" : "false"); | |||
| repaint(); | |||
| break; | |||
| } | |||
| @@ -26,10 +26,28 @@ include ../Makefile.mk | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| ifeq ($(HAVE_DGL),true) | |||
| ifeq ($(HAVE_JACK),true) | |||
| TARGETS += jack | |||
| endif | |||
| endif | |||
| 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 | |||
| all: dssi lv2_sep vst | |||
| TARGETS += lv2_dsp | |||
| endif | |||
| TARGETS += vst | |||
| all: $(TARGETS) | |||
| # -------------------------------------------------------------- | |||