diff --git a/TODO b/TODO index 36e52a9..d5b5cda 100644 --- a/TODO +++ b/TODO @@ -26,3 +26,4 @@ * LV2: round latency output value * daisy-seed: DAC * plugin_init and plugin_set_sample_rate to return char (can fail) +* daisy-seed: isolate C part from C++ diff --git a/templates/android-make/vars.mk b/templates/android-make/vars.mk index 400ee28..a3b83d5 100644 --- a/templates/android-make/vars.mk +++ b/templates/android-make/vars.mk @@ -3,8 +3,11 @@ JAVA_PACKAGE_NAME := {{=it.android.javaPackageName}} CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.android_make && it.android_make.cflags ? it.android_make.cflags : ""}} CXXFLAGS_EXTRA := {{=it.make && it.make.cxxflags ? it.make.cxxflags : ""}} {{=it.android_make && it.android_make.cxxflags ? it.android_make.cxxflags : ""}} -LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.android_make && it.android_make.ldflags ? it.android_make.ldflags : ""}} JFLAGS_EXTRA := {{=it.make && it.make.jflags ? it.make.jflags : ""}} {{=it.android_make && it.android_make.jflags ? it.android_make.jflags : ""}} +LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.android_make && it.android_make.ldflags ? it.android_make.ldflags : ""}} + +C_SRCS_EXTRA := {{=it.make && it.make.cSrcs ? it.make.cSrcs : ""}} {{=it.android_make.cSrcs ? it.android_make.cSrcs : ""}} +CXX_SRCS_EXTRA := {{=it.make && it.make.cxxSrcs ? it.make.cxxSrcs : ""}} {{=it.android_make.cxxSrcs ? it.android_make.cxxSrcs : ""}} COMMON_DIR := {{=it.android_make && it.android_make.commonDir ? it.android_make.commonDir : (it.make && it.make.commonDir ? it.make.commonDir : "")}} DATA_DIR := {{=it.android_make && it.android_make.dataDir ? it.android_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}} diff --git a/templates/daisy-seed-make/Makefile b/templates/daisy-seed-make/Makefile index 2fce2e6..39246c5 100644 --- a/templates/daisy-seed-make/Makefile +++ b/templates/daisy-seed-make/Makefile @@ -6,11 +6,14 @@ COMMON_DIR := $(or $(COMMON_DIR),.) DATA_DIR := $(or $(DATA_DIR),.) PLUGIN_DIR := $(or $(PLUGIN_DIR),src) -CPP_SOURCES = ${COMMON_DIR}/src/main.cpp ${CPP_SOURCES_EXTRA} +CPP_SOURCES = ${COMMON_DIR}/src/main.cpp ${CXX_SRCS_EXTRA} SYSTEM_FILES_DIR = ${LIBDAISY_DIR}/core include ${SYSTEM_FILES_DIR}/Makefile +C_SOURCES += ${C_SRCS_EXTRA} + CFLAGS += -I${DATA_DIR}/src -I${PLUGIN_DIR} ${CFLAGS_EXTRA} LDFLAGS += ${LDFLAGS_EXTRA} +CXXFLAGS += -I${DATA_DIR}/src -I${PLUGIN_DIR} ${CXXFLAGS_EXTRA} diff --git a/templates/daisy-seed-make/vars.mk b/templates/daisy-seed-make/vars.mk index b5b79d4..3754556 100644 --- a/templates/daisy-seed-make/vars.mk +++ b/templates/daisy-seed-make/vars.mk @@ -1,6 +1,12 @@ BUNDLE_NAME := {{=it.product.bundleName}} + CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.daisy_seed_make.cflags ? it.daisy_seed_make.cflags : ""}} LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.daisy_seed_make.ldflags ? it.daisy_seed_make.ldflags : ""}} +CXXFLAGS_EXTRA := {{=it.make && it.make.cxxflags ? it.make.cxxflags : ""}} {{=it.daisy_seed_make.cxxflags ? it.daisy_seed_make.cxxflags : ""}} + +C_SRCS_EXTRA := {{=it.make && it.make.cSrcs ? it.make.cSrcs : ""}} {{=it.daisy_seed_make.cSrcs ? it.daisy_seed_make.cSrcs : ""}} +CXX_SRCS_EXTRA := {{=it.make && it.make.cxxSrcs ? it.make.cxxSrcs : ""}} {{=it.daisy_seed_make.cxxSrcs ? it.daisy_seed_make.cxxSrcs : ""}} + COMMON_DIR := {{=it.daisy_seed_make && it.daisy_seed_make.commonDir ? it.daisy_seed_make.commonDir : (it.make && it.make.commonDir ? it.make.commonDir : "")}} DATA_DIR := {{=it.daisy_seed_make && it.daisy_seed_make.dataDir ? it.daisy_seed_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}} PLUGIN_DIR := {{=it.daisy_seed_make && it.daisy_seed_make.pluginDir ? it.daisy_seed_make.pluginDir : (it.make && it.make.pluginDir ? it.make.pluginDir : "")}} diff --git a/templates/daisy-seed/src/data.h b/templates/daisy-seed/src/data.h index 39093ec..d4221d2 100644 --- a/templates/daisy-seed/src/data.h +++ b/templates/daisy-seed/src/data.h @@ -34,7 +34,7 @@ static struct { /* .min = */ {{=p.minimum.toExponential()}}f, /* .max = */ {{=p.maximum.toExponential()}}f, /* .def = */ {{=p.defaultValue.toExponential()}}f, - /* .flags = */ {{?p.isBypass}}PARAM_BYPASS{{??}}0{{?p.toggled}} | PARAM_TOGGLED{{?}}{{?p.integer}} | PARAM_INTEGER{{?}}{{?p.map == "logarithmic"}}| PARAM_MAP_LOG{{?}}{{?}}, + /* .flags = */ {{?p.isBypass}}PARAM_BYPASS{{??}}0{{?p.toggled}} | PARAM_TOGGLED{{?}}{{?p.integer}} | PARAM_INTEGER{{?}}{{?p.map == "logarithmic"}} | PARAM_MAP_LOG{{?}}{{?}}, /* .mapK = */ {{?p.map == "logarithmic"}}{{=Number(2.0 * Math.log(Math.sqrt(p.maximum * p.minimum) / Math.abs(p.minimum))).toExponential()}}{{??}}0.0{{?}}f }, {{~}}