updated lv2
This commit is contained in:
parent
8164e38005
commit
069d84170d
@ -21,8 +21,12 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
COMMON_DIR := $(or $(COMMON_DIR),.)
|
||||||
|
DATA_DIR := $(or $(DATA_DIR),.)
|
||||||
|
PLUGIN_DIR := $(or $(PLUGIN_DIR),src)
|
||||||
|
|
||||||
CFLAGS = -O3 -Wall -Wpedantic -Wextra
|
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 =
|
||||||
LDFLAGS_ALL = -shared ${LDFLAGS} ${LDFLAGS_EXTRA}
|
LDFLAGS_ALL = -shared ${LDFLAGS} ${LDFLAGS_EXTRA}
|
||||||
@ -33,7 +37,7 @@ DLL_FILE = ${BUNDLE_NAME}${DLL_SUFFIX}
|
|||||||
|
|
||||||
all: build/${BUNDLE_DIR}/manifest.ttl build/${BUNDLE_DIR}/${DLL_FILE}
|
all: build/${BUNDLE_DIR}/manifest.ttl build/${BUNDLE_DIR}/${DLL_FILE}
|
||||||
|
|
||||||
build/${BUNDLE_DIR}/manifest.ttl: data/manifest.ttl.in | build/${BUNDLE_DIR}
|
build/${BUNDLE_DIR}/manifest.ttl: ${DATA_DIR}/data/manifest.ttl.in | build/${BUNDLE_DIR}
|
||||||
cat $^ | sed s/@DLL_SUFFIX@/${DLL_SUFFIX}/g > $@
|
cat $^ | sed s/@DLL_SUFFIX@/${DLL_SUFFIX}/g > $@
|
||||||
|
|
||||||
ifeq ($(UNAME_S), Darwin)
|
ifeq ($(UNAME_S), Darwin)
|
||||||
@ -41,19 +45,19 @@ ifeq ($(UNAME_S), Darwin)
|
|||||||
build/${BUNDLE_DIR}/${DLL_FILE}: build/tmp/x86_64 build/tmp/arm64 | build/${BUNDLE_DIR}
|
build/${BUNDLE_DIR}/${DLL_FILE}: build/tmp/x86_64 build/tmp/arm64 | build/${BUNDLE_DIR}
|
||||||
lipo -create -output $@ $^
|
lipo -create -output $@ $^
|
||||||
|
|
||||||
build/tmp/x86_64: src/lv2.c src/data.h src/plugin.h | build/tmp
|
build/tmp/x86_64: ${COMMON_DIR}/src/lv2.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build/tmp
|
||||||
${CC} src/lv2.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch x86_64
|
${CC} ${COMMON_DIR}/src/lv2.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch x86_64
|
||||||
|
|
||||||
build/tmp/arm64: src/lv2.c src/data.h src/plugin.h | build/tmp
|
build/tmp/arm64: ${COMMON_DIR}/src/lv2.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build/tmp
|
||||||
${CC} src/lv2.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch arm64
|
${CC} ${COMMON_DIR}/src/lv2.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch arm64
|
||||||
|
|
||||||
build/tmp:
|
build/tmp:
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
build/${BUNDLE_DIR}/${DLL_FILE}: src/lv2.c src/data.h | build/${BUNDLE_DIR}
|
build/${BUNDLE_DIR}/${DLL_FILE}: ${COMMON_DIR}/src/lv2.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build/${BUNDLE_DIR}
|
||||||
${CC} src/lv2.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
|
${CC} ${COMMON_DIR}/src/lv2.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
BUNDLE_NAME := {{=it.product.bundleName}}
|
BUNDLE_NAME := {{=it.product.bundleName}}
|
||||||
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.lv2_make && it.lv2_make.cflags ? it.lv2_make.cflags : ""}}
|
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.lv2_make && it.lv2_make.cflags ? it.lv2_make.cflags : ""}}
|
||||||
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.lv2_make && it.lv2_make.ldflags ? it.lv2_make.ldflags : ""}}
|
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.lv2_make && it.lv2_make.ldflags ? it.lv2_make.ldflags : ""}}
|
||||||
|
COMMON_DIR := {{=it.lv2_make && it.lv2_make.commonDir ? it.lv2_make.commonDir : (it.make && it.make.commonDir ? it.make.commonDir : "")}}
|
||||||
|
DATA_DIR := {{=it.lv2_make && it.lv2_make.dataDir ? it.lv2_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}}
|
||||||
|
PLUGIN_DIR := {{=it.lv2_make && it.lv2_make.pluginDir ? it.lv2_make.pluginDir : (it.make && it.make.pluginDir ? it.make.pluginDir : "")}}
|
||||||
|
@ -71,6 +71,8 @@ static LV2_Handle instantiate(const struct LV2_Descriptor * descriptor, double s
|
|||||||
}
|
}
|
||||||
|
|
||||||
instance->uri_midi_MidiEvent = instance->map->map(instance->map->handle, LV2_MIDI__MidiEvent);
|
instance->uri_midi_MidiEvent = instance->map->map(instance->map->handle, LV2_MIDI__MidiEvent);
|
||||||
|
#else
|
||||||
|
(void)features;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
plugin_init(&instance->p);
|
plugin_init(&instance->p);
|
||||||
@ -230,6 +232,8 @@ static void run(LV2_Handle instance, uint32_t sample_count) {
|
|||||||
if (i->c[k] != NULL)
|
if (i->c[k] != NULL)
|
||||||
*i->c[k] = plugin_get_parameter(&i->p, k);
|
*i->c[k] = plugin_get_parameter(&i->p, k);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)plugin_get_parameter;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,105 +1,107 @@
|
|||||||
var path = require("path");
|
var path = require("path");
|
||||||
var sep = path.sep;
|
var sep = path.sep;
|
||||||
|
|
||||||
module.exports = function (data, api) {
|
module.exports = function (data, api, outputCommon, outputData) {
|
||||||
data.tibia.lv2 = {
|
if (outputData) {
|
||||||
prefixes: [
|
data.tibia.lv2 = {
|
||||||
{ id: "atom", uri: "http://lv2plug.in/ns/ext/atom#" },
|
prefixes: [
|
||||||
{ id: "doap", uri: "http://usefulinc.com/ns/doap#" },
|
{ id: "atom", uri: "http://lv2plug.in/ns/ext/atom#" },
|
||||||
{ id: "foaf", uri: "http://xmlns.com/foaf/0.1/" },
|
{ id: "doap", uri: "http://usefulinc.com/ns/doap#" },
|
||||||
{ id: "log", uri: "http://lv2plug.in/ns/ext/log#" },
|
{ id: "foaf", uri: "http://xmlns.com/foaf/0.1/" },
|
||||||
{ id: "lv2", uri: "http://lv2plug.in/ns/lv2core#" },
|
{ id: "log", uri: "http://lv2plug.in/ns/ext/log#" },
|
||||||
{ id: "midi", uri: "http://lv2plug.in/ns/ext/midi#" },
|
{ id: "lv2", uri: "http://lv2plug.in/ns/lv2core#" },
|
||||||
{ id: "pprops", uri: "http://lv2plug.in/ns/ext/port-props#" },
|
{ id: "midi", uri: "http://lv2plug.in/ns/ext/midi#" },
|
||||||
{ id: "rdf", uri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#" },
|
{ id: "pprops", uri: "http://lv2plug.in/ns/ext/port-props#" },
|
||||||
{ id: "rdfs", uri: "http://www.w3.org/2000/01/rdf-schema#" },
|
{ id: "rdf", uri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#" },
|
||||||
{ id: "units", uri: "http://lv2plug.in/ns/extensions/units#" },
|
{ id: "rdfs", uri: "http://www.w3.org/2000/01/rdf-schema#" },
|
||||||
{ id: "urid", uri: "http://lv2plug.in/ns/ext/urid#" }
|
{ id: "units", uri: "http://lv2plug.in/ns/extensions/units#" },
|
||||||
],
|
{ id: "urid", uri: "http://lv2plug.in/ns/ext/urid#" }
|
||||||
units: {
|
],
|
||||||
"bar": "@units:bar",
|
units: {
|
||||||
"beat": "@units:beat",
|
"bar": "@units:bar",
|
||||||
"bpm": "@units:bpm",
|
"beat": "@units:beat",
|
||||||
"cent": "@units:cent",
|
"bpm": "@units:bpm",
|
||||||
"cm": "@units:cm",
|
"cent": "@units:cent",
|
||||||
"coef": "@units:coef",
|
"cm": "@units:cm",
|
||||||
"db": "@units:db",
|
"coef": "@units:coef",
|
||||||
"degree": "@units:degree",
|
"db": "@units:db",
|
||||||
"frame": "@units:frame",
|
"degree": "@units:degree",
|
||||||
"hz": "@units:hz",
|
"frame": "@units:frame",
|
||||||
"inch": "@units:inch",
|
"hz": "@units:hz",
|
||||||
"khz": "@units:khz",
|
"inch": "@units:inch",
|
||||||
"km": "@units:km",
|
"khz": "@units:khz",
|
||||||
"m": "@units:m",
|
"km": "@units:km",
|
||||||
"mhz": "@units:mhz",
|
"m": "@units:m",
|
||||||
"midiNote": "@units:midiNote",
|
"mhz": "@units:mhz",
|
||||||
"mile": "@units:mile",
|
"midiNote": "@units:midiNote",
|
||||||
"min": "@units:min",
|
"mile": "@units:mile",
|
||||||
"mm": "@units:mm",
|
"min": "@units:min",
|
||||||
"ms": "@units:ms",
|
"mm": "@units:mm",
|
||||||
"oct": "@units:oct",
|
"ms": "@units:ms",
|
||||||
"pc": "@units:pc",
|
"oct": "@units:oct",
|
||||||
"s": "@units:s",
|
"pc": "@units:pc",
|
||||||
"semitone12TET": "@units:semitone12TET"
|
"s": "@units:s",
|
||||||
},
|
"semitone12TET": "@units:semitone12TET"
|
||||||
ports: [],
|
},
|
||||||
|
ports: [],
|
||||||
|
|
||||||
ttlURI: function (uri) {
|
ttlURI: function (uri) {
|
||||||
return uri.charAt(0) == "@" ? uri.substring(1) : "<" + uri + ">";
|
return uri.charAt(0) == "@" ? uri.substring(1) : "<" + uri + ">";
|
||||||
},
|
},
|
||||||
|
|
||||||
expandURI: function (uri) {
|
expandURI: function (uri) {
|
||||||
if (uri.charAt(0) != "@")
|
if (uri.charAt(0) != "@")
|
||||||
return uri;
|
return uri;
|
||||||
var i = uri.indexOf(":");
|
var i = uri.indexOf(":");
|
||||||
var p = uri.substring(1, uri.indexOf(":"));
|
var p = uri.substring(1, uri.indexOf(":"));
|
||||||
return data.tibia.lv2.prefixes.find(x => x.id == p).uri + uri.substring(i + 1);
|
return data.tibia.lv2.prefixes.find(x => x.id == p).uri + uri.substring(i + 1);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var id in data.lv2.prefixes)
|
|
||||||
data.tibia.lv2.prefixes.push({ id: id, uri: data.lv2.prefixes[id] });
|
|
||||||
|
|
||||||
var buses = data.product.buses;
|
|
||||||
var audioPorts = [];
|
|
||||||
var midiPorts = [];
|
|
||||||
for (var bi = 0; bi < buses.length; bi++) {
|
|
||||||
var b = buses[bi];
|
|
||||||
if (b.type == "audio") {
|
|
||||||
if (b.channels == "mono") {
|
|
||||||
var e = { type: "audio", direction: b.direction, name: b.name, sidechain: b.sidechain, cv: b.cv, optional: b.optional, busIndex: bi };
|
|
||||||
e.symbol = data.lv2.busSymbols[bi];
|
|
||||||
audioPorts.push(e);
|
|
||||||
} else {
|
|
||||||
var e = { type: "audio", direction: b.direction, name: b.name + " Left", shortName: b.shortName + " L", sidechain: b.sidechain, cv: b.cv, busIndex: bi };
|
|
||||||
e.symbol = data.lv2.busSymbols[bi] + "_L";
|
|
||||||
data.tibia.lv2.ports.push(e);
|
|
||||||
var e = { type: "audio", direction: b.direction, name: b.name + " Right", shortName: b.shortName + " R", sidechain: b.sidechain, cv: b.cv, busIndex: bi };
|
|
||||||
e.symbol = data.lv2.busSymbols[bi] + "_R";
|
|
||||||
audioPorts.push(e);
|
|
||||||
}
|
}
|
||||||
} else {
|
};
|
||||||
var e = { type: "midi", direction: b.direction, name: b.name, sidechain: b.sidechain, control: b.control, optional: b.optional, busIndex: bi };
|
|
||||||
e.symbol = data.lv2.busSymbols[bi];
|
|
||||||
midiPorts.push(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
audioPorts.sort((a, b) => a.direction != b.direction ? (a.direction == "input" ? -1 : 1) : 0);
|
|
||||||
midiPorts.sort((a, b) => a.direction != b.direction ? (a.direction == "input" ? -1 : 1) : 0);
|
|
||||||
data.tibia.lv2.ports.push.apply(data.tibia.lv2.ports, audioPorts);
|
|
||||||
data.tibia.lv2.ports.push.apply(data.tibia.lv2.ports, midiPorts);
|
|
||||||
|
|
||||||
var ports = [];
|
for (var id in data.lv2.prefixes)
|
||||||
for (var i = 0; i < data.product.parameters.length; i++) {
|
data.tibia.lv2.prefixes.push({ id: id, uri: data.lv2.prefixes[id] });
|
||||||
var p = data.product.parameters[i];
|
|
||||||
var e = Object.create(p);
|
var buses = data.product.buses;
|
||||||
e.type = "control";
|
var audioPorts = [];
|
||||||
e.symbol = data.lv2.parameterSymbols[i];
|
var midiPorts = [];
|
||||||
e.paramIndex = i;
|
for (var bi = 0; bi < buses.length; bi++) {
|
||||||
ports.push(e);
|
var b = buses[bi];
|
||||||
|
if (b.type == "audio") {
|
||||||
|
if (b.channels == "mono") {
|
||||||
|
var e = { type: "audio", direction: b.direction, name: b.name, sidechain: b.sidechain, cv: b.cv, optional: b.optional, busIndex: bi };
|
||||||
|
e.symbol = data.lv2.busSymbols[bi];
|
||||||
|
audioPorts.push(e);
|
||||||
|
} else {
|
||||||
|
var e = { type: "audio", direction: b.direction, name: b.name + " Left", shortName: b.shortName + " L", sidechain: b.sidechain, cv: b.cv, busIndex: bi };
|
||||||
|
e.symbol = data.lv2.busSymbols[bi] + "_L";
|
||||||
|
data.tibia.lv2.ports.push(e);
|
||||||
|
var e = { type: "audio", direction: b.direction, name: b.name + " Right", shortName: b.shortName + " R", sidechain: b.sidechain, cv: b.cv, busIndex: bi };
|
||||||
|
e.symbol = data.lv2.busSymbols[bi] + "_R";
|
||||||
|
audioPorts.push(e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var e = { type: "midi", direction: b.direction, name: b.name, sidechain: b.sidechain, control: b.control, optional: b.optional, busIndex: bi };
|
||||||
|
e.symbol = data.lv2.busSymbols[bi];
|
||||||
|
midiPorts.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
audioPorts.sort((a, b) => a.direction != b.direction ? (a.direction == "input" ? -1 : 1) : 0);
|
||||||
|
midiPorts.sort((a, b) => a.direction != b.direction ? (a.direction == "input" ? -1 : 1) : 0);
|
||||||
|
data.tibia.lv2.ports.push.apply(data.tibia.lv2.ports, audioPorts);
|
||||||
|
data.tibia.lv2.ports.push.apply(data.tibia.lv2.ports, midiPorts);
|
||||||
|
|
||||||
|
var ports = [];
|
||||||
|
for (var i = 0; i < data.product.parameters.length; i++) {
|
||||||
|
var p = data.product.parameters[i];
|
||||||
|
var e = Object.create(p);
|
||||||
|
e.type = "control";
|
||||||
|
e.symbol = data.lv2.parameterSymbols[i];
|
||||||
|
e.paramIndex = i;
|
||||||
|
ports.push(e);
|
||||||
|
}
|
||||||
|
ports.sort((a, b) => a.direction != b.direction ? (a.direction == "input" ? -1 : 1) : 0);
|
||||||
|
data.tibia.lv2.ports.push.apply(data.tibia.lv2.ports, ports);
|
||||||
}
|
}
|
||||||
ports.sort((a, b) => a.direction != b.direction ? (a.direction == "input" ? -1 : 1) : 0);
|
|
||||||
data.tibia.lv2.ports.push.apply(data.tibia.lv2.ports, ports);
|
|
||||||
|
|
||||||
api.generateFileFromTemplateFile(`data${sep}manifest.ttl.in`, `data${sep}manifest.ttl.in`, data);
|
api.generateFileFromTemplateFile(`data${sep}manifest.ttl.in`, `data${sep}manifest.ttl.in`, data);
|
||||||
api.copyFile(`src${sep}lv2.c`, `src${sep}lv2.c`);
|
api.copyFile(`src${sep}lv2.c`, `src${sep}lv2.c`);
|
||||||
|
Loading…
Reference in New Issue
Block a user