update vst3

This commit is contained in:
Stefano D'Angelo 2024-02-01 09:15:00 +01:00
parent 069d84170d
commit d0de2e96a3
4 changed files with 57 additions and 39 deletions

View File

@ -23,8 +23,12 @@ else
endif
endif
COMMON_DIR := $(or $(COMMON_DIR),.)
DATA_DIR := $(or $(DATA_DIR),.)
PLUGIN_DIR := $(or $(PLUGIN_DIR),src)
CFLAGS = -O3 -Wall -Wpedantic -Wextra
CFLAGS_ALL = -fPIC ${CFLAGS} ${CFLAGS_EXTRA}
CFLAGS_ALL = -I${DATA_DIR}/src -I${PLUGIN_DIR} -fPIC ${CFLAGS} ${CFLAGS_EXTRA}
LDFLAGS =
LDFLAGS_ALL = -shared -lm ${LDFLAGS} ${LDFLAGS_EXTRA}
@ -38,17 +42,17 @@ ifeq ($(UNAME_S), Darwin)
all: build/${BUNDLE_DIR}/${DLL_FILE} build/${BUNDLE_DIR}/Contents/Info.plist
build/${BUNDLE_DIR}/Contents/Info.plist: data/Info.plist | build/${BUNDLE_DIR}/Contents
build/${BUNDLE_DIR}/Contents/Info.plist: ${DATA_DIR}/data/Info.plist | build/${BUNDLE_DIR}/Contents
cp $^ $@
build/${BUNDLE_DIR}/${DLL_FILE}: build/tmp/x86_64 build/tmp/arm64 | build/${BUNDLE_DIR}/${DLL_DIR}
lipo -create -output $@ $^
build/tmp/x86_64: src/vst3.c src/data.h src/plugin.h | build/tmp
${CC} src/vst3.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch x86_64
build/tmp/x86_64: ${COMMON_DIR}/src/vst3.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build/tmp
${CC} ${COMMON_DIR}/src/vst3.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch x86_64
build/tmp/arm64: src/vst3.c src/data.h src/plugin.h | build/tmp
${CC} src/vst3.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch arm64
build/tmp/arm64: ${COMMON_DIR}/src/vst3.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build/tmp
${CC} ${COMMON_DIR}/src/vst3.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch arm64
build/tmp build/${BUILD_DIR}/Contents:
mkdir -p $@
@ -57,8 +61,8 @@ else
all: build/${BUNDLE_DIR}/${DLL_FILE}
build/${BUNDLE_DIR}/${DLL_FILE}: src/vst3.c src/data.h | build/${BUNDLE_DIR}/${DLL_DIR}
${CC} src/vst3.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
build/${BUNDLE_DIR}/${DLL_FILE}: ${COMMON_DIR}/src/vst3.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build/${BUNDLE_DIR}/${DLL_DIR}
${CC} ${COMMON_DIR}/src/vst3.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
endif

View File

@ -1,3 +1,6 @@
BUNDLE_NAME := {{=it.product.bundleName}}
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.vst3_make && it.vst3_make.cflags ? it.vst3_make.cflags : ""}}
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.vst3_make && it.vst3_make.ldflags ? it.vst3_make.ldflags : ""}}
COMMON_DIR := {{=it.vst3_make && it.vst3_make.commonDir ? it.vst3_make.commonDir : (it.make && it.make.commonDir ? it.make.commonDir : "")}}
DATA_DIR := {{=it.vst3_make && it.vst3_make.dataDir ? it.vst3_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}}
PLUGIN_DIR := {{=it.vst3_make && it.vst3_make.pluginDir ? it.vst3_make.pluginDir : (it.make && it.make.pluginDir ? it.make.pluginDir : "")}}

View File

@ -990,8 +990,14 @@ static Steinberg_Vst_ParamValue controllerGetParamNormalized(void* thisInterface
TRACE("controller get param normalized\n");
#if DATA_PRODUCT_PARAMETERS_N + DATA_PRODUCT_BUSES_MIDI_INPUT_N > 0
controller *c = (controller *)((char *)thisInterface - offsetof(controller, vtblIEditController));
# if DATA_PRODUCT_BUSES_MIDI_INPUT_N > 0
return id >= DATA_PRODUCT_PARAMETERS_N ? c->parameters[id] : parameterUnmap(id, c->parameters[id]);
# else
return parameterUnmap(id, c->parameters[id]);
# endif
#else
(void)thisInterface;
(void)id;
return 0.0;
#endif
}
@ -1005,6 +1011,9 @@ static Steinberg_tresult controllerSetParamNormalized(void* thisInterface, Stein
c->parameters[id] = id >= DATA_PRODUCT_PARAMETERS_N ? value : parameterAdjust(id, parameterMap(id, value));
return Steinberg_kResultTrue;
#else
(void)thisInterface;
(void)id;
(void)value;
return Steinberg_kResultFalse;
#endif
}

View File

@ -1,38 +1,40 @@
var path = require("path");
var sep = path.sep;
module.exports = function (data, api) {
data.tibia.vst3 = {
units: {
"bar": "bars",
"beat": "beats",
"bpm": "BPM",
"cent": "ct",
"cm": "cm",
"coef": "",
"db": "dB",
"degree": "deg",
"frame": "frames",
"hz": "Hz",
"inch": "\"",
"khz": "kHz",
"km": "km",
"m": "m",
"mhz": "MHz",
"midiNote": "MIDI note",
"mile": "mi",
"min": "mins",
"mm": "mm",
"ms": "ms",
"oct": "octaves",
"pc": "%",
"s": "s",
"semitone12TET": "semi"
}
};
module.exports = function (data, api, outputCommon, outputData) {
if (outputData) {
data.tibia.vst3 = {
units: {
"bar": "bars",
"beat": "beats",
"bpm": "BPM",
"cent": "ct",
"cm": "cm",
"coef": "",
"db": "dB",
"degree": "deg",
"frame": "frames",
"hz": "Hz",
"inch": "\"",
"khz": "kHz",
"km": "km",
"m": "m",
"mhz": "MHz",
"midiNote": "MIDI note",
"mile": "mi",
"min": "mins",
"mm": "mm",
"ms": "ms",
"oct": "octaves",
"pc": "%",
"s": "s",
"semitone12TET": "semi"
}
};
for (var i = 0; i < data.product.parameters.length; i++)
data.product.parameters[i].paramIndex = i;
for (var i = 0; i < data.product.parameters.length; i++)
data.product.parameters[i].paramIndex = i;
}
api.generateFileFromTemplateFile(`data${sep}Info.plist`, `data${sep}Info.plist`, data);
api.copyFile(`src${sep}vst3.c`, `src${sep}vst3.c`);