From 1eccbe4355685b322194df72b5de2382d5290b3b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 7 Jul 2022 18:59:32 -0400 Subject: Rearrange source tree to be directly usable by dependants This allows the LV2 source distribution to be used as an include path for compilers and an LV2_PATH for applications, at the expense of self-contained bundles. That's a nice idea, but it made LV2 itself weird and annoying to depend on. This rearranges things so that directories in the source tree correspond more closely to installation directories. To make this possible, the "aux" directory in the documentation output has been changed to "style", to avoid the reserved name "aux" on Windows. --- lv2/atom.lv2/atom.meta.ttl | 552 ++++++++++++++ lv2/atom.lv2/atom.ttl | 247 ++++++ lv2/atom.lv2/manifest.ttl | 9 + lv2/atom/atom-test-utils.c | 73 -- lv2/atom/atom-test.c | 366 --------- lv2/atom/atom.h | 260 ------- lv2/atom/atom.meta.ttl | 552 -------------- lv2/atom/atom.ttl | 250 ------- lv2/atom/forge-overflow-test.c | 235 ------ lv2/atom/forge.h | 683 ----------------- lv2/atom/manifest.ttl | 9 - lv2/atom/meson.build | 61 -- lv2/atom/util.h | 523 ------------- lv2/buf-size.lv2/buf-size.meta.ttl | 157 ++++ lv2/buf-size.lv2/buf-size.ttl | 68 ++ lv2/buf-size.lv2/manifest.ttl | 9 + lv2/buf-size/buf-size.h | 51 -- lv2/buf-size/buf-size.meta.ttl | 157 ---- lv2/buf-size/buf-size.ttl | 69 -- lv2/buf-size/manifest.ttl | 9 - lv2/buf-size/meson.build | 40 - lv2/core.lv2/lv2core.meta.ttl | 915 +++++++++++++++++++++++ lv2/core.lv2/lv2core.ttl | 673 +++++++++++++++++ lv2/core.lv2/manifest.ttl | 15 + lv2/core.lv2/meta.ttl | 228 ++++++ lv2/core.lv2/people.ttl | 51 ++ lv2/core/attributes.h | 59 -- lv2/core/lv2.h | 485 ------------ lv2/core/lv2_util.h | 103 --- lv2/core/lv2core.meta.ttl | 915 ----------------------- lv2/core/lv2core.ttl | 675 ----------------- lv2/core/manifest.ttl | 15 - lv2/core/meson.build | 44 -- lv2/core/meta.ttl | 224 ------ lv2/core/people.ttl | 51 -- lv2/data-access.lv2/data-access.meta.ttl | 76 ++ lv2/data-access.lv2/data-access.ttl | 10 + lv2/data-access.lv2/manifest.ttl | 9 + lv2/data-access/data-access.h | 73 -- lv2/data-access/data-access.meta.ttl | 77 -- lv2/data-access/data-access.ttl | 11 - lv2/data-access/manifest.ttl | 9 - lv2/data-access/meson.build | 40 - lv2/dynmanifest.lv2/dynmanifest.meta.ttl | 131 ++++ lv2/dynmanifest.lv2/dynmanifest.ttl | 24 + lv2/dynmanifest.lv2/manifest.ttl | 9 + lv2/dynmanifest/dynmanifest.h | 160 ---- lv2/dynmanifest/dynmanifest.meta.ttl | 131 ---- lv2/dynmanifest/dynmanifest.ttl | 25 - lv2/dynmanifest/manifest.ttl | 9 - lv2/dynmanifest/meson.build | 40 - lv2/event.lv2/event.meta.ttl | 256 +++++++ lv2/event.lv2/event.ttl | 85 +++ lv2/event.lv2/manifest.ttl | 9 + lv2/event/event-helpers.h | 255 ------- lv2/event/event.h | 306 -------- lv2/event/event.meta.ttl | 256 ------- lv2/event/event.ttl | 87 --- lv2/event/manifest.ttl | 9 - lv2/event/meson.build | 41 - lv2/instance-access.lv2/instance-access.meta.ttl | 75 ++ lv2/instance-access.lv2/instance-access.ttl | 10 + lv2/instance-access.lv2/manifest.ttl | 9 + lv2/instance-access/instance-access.h | 41 - lv2/instance-access/instance-access.meta.ttl | 75 -- lv2/instance-access/instance-access.ttl | 11 - lv2/instance-access/manifest.ttl | 9 - lv2/instance-access/meson.build | 40 - lv2/log.lv2/log.meta.ttl | 126 ++++ lv2/log.lv2/log.ttl | 48 ++ lv2/log.lv2/manifest.ttl | 9 + lv2/log/log.h | 113 --- lv2/log/log.meta.ttl | 126 ---- lv2/log/log.ttl | 49 -- lv2/log/logger.h | 157 ---- lv2/log/manifest.ttl | 9 - lv2/log/meson.build | 41 - lv2/meson.build | 52 -- lv2/midi.lv2/manifest.ttl | 9 + lv2/midi.lv2/midi.meta.ttl | 153 ++++ lv2/midi.lv2/midi.ttl | 365 +++++++++ lv2/midi/manifest.ttl | 9 - lv2/midi/meson.build | 40 - lv2/midi/midi.h | 248 ------ lv2/midi/midi.meta.ttl | 153 ---- lv2/midi/midi.ttl | 366 --------- lv2/morph.lv2/manifest.ttl | 9 + lv2/morph.lv2/morph.meta.ttl | 90 +++ lv2/morph.lv2/morph.ttl | 46 ++ lv2/morph/manifest.ttl | 9 - lv2/morph/meson.build | 40 - lv2/morph/morph.h | 48 -- lv2/morph/morph.meta.ttl | 90 --- lv2/morph/morph.ttl | 47 -- lv2/options.lv2/manifest.ttl | 9 + lv2/options.lv2/options.meta.ttl | 129 ++++ lv2/options.lv2/options.ttl | 44 ++ lv2/options/manifest.ttl | 9 - lv2/options/meson.build | 40 - lv2/options/options.h | 149 ---- lv2/options/options.meta.ttl | 129 ---- lv2/options/options.ttl | 45 -- lv2/parameters.lv2/manifest.ttl | 9 + lv2/parameters.lv2/parameters.meta.ttl | 75 ++ lv2/parameters.lv2/parameters.ttl | 205 +++++ lv2/parameters/manifest.ttl | 9 - lv2/parameters/meson.build | 40 - lv2/parameters/parameters.h | 68 -- lv2/parameters/parameters.meta.ttl | 75 -- lv2/parameters/parameters.ttl | 205 ----- lv2/patch.lv2/manifest.ttl | 9 + lv2/patch.lv2/patch.meta.ttl | 388 ++++++++++ lv2/patch.lv2/patch.ttl | 248 ++++++ lv2/patch/manifest.ttl | 9 - lv2/patch/meson.build | 40 - lv2/patch/patch.h | 73 -- lv2/patch/patch.meta.ttl | 388 ---------- lv2/patch/patch.ttl | 249 ------ lv2/port-groups.lv2/manifest.ttl | 9 + lv2/port-groups.lv2/port-groups.meta.ttl | 144 ++++ lv2/port-groups.lv2/port-groups.ttl | 808 ++++++++++++++++++++ lv2/port-groups/manifest.ttl | 9 - lv2/port-groups/meson.build | 40 - lv2/port-groups/port-groups.h | 77 -- lv2/port-groups/port-groups.meta.ttl | 144 ---- lv2/port-groups/port-groups.ttl | 808 -------------------- lv2/port-props.lv2/manifest.ttl | 9 + lv2/port-props.lv2/port-props.meta.ttl | 202 +++++ lv2/port-props.lv2/port-props.ttl | 80 ++ lv2/port-props/manifest.ttl | 9 - lv2/port-props/meson.build | 40 - lv2/port-props/port-props.h | 53 -- lv2/port-props/port-props.meta.ttl | 202 ----- lv2/port-props/port-props.ttl | 80 -- lv2/presets.lv2/manifest.ttl | 9 + lv2/presets.lv2/presets.meta.ttl | 132 ++++ lv2/presets.lv2/presets.ttl | 61 ++ lv2/presets/manifest.ttl | 9 - lv2/presets/meson.build | 40 - lv2/presets/presets.h | 48 -- lv2/presets/presets.meta.ttl | 132 ---- lv2/presets/presets.ttl | 61 -- lv2/resize-port.lv2/manifest.ttl | 9 + lv2/resize-port.lv2/resize-port.meta.ttl | 74 ++ lv2/resize-port.lv2/resize-port.ttl | 36 + lv2/resize-port/manifest.ttl | 9 - lv2/resize-port/meson.build | 40 - lv2/resize-port/resize-port.h | 89 --- lv2/resize-port/resize-port.meta.ttl | 74 -- lv2/resize-port/resize-port.ttl | 37 - lv2/state.lv2/manifest.ttl | 9 + lv2/state.lv2/state.meta.ttl | 477 ++++++++++++ lv2/state.lv2/state.ttl | 60 ++ lv2/state/manifest.ttl | 9 - lv2/state/meson.build | 40 - lv2/state/state.h | 392 ---------- lv2/state/state.meta.ttl | 477 ------------ lv2/state/state.ttl | 61 -- lv2/time.lv2/manifest.ttl | 9 + lv2/time.lv2/time.meta.ttl | 112 +++ lv2/time.lv2/time.ttl | 121 +++ lv2/time/manifest.ttl | 9 - lv2/time/meson.build | 40 - lv2/time/time.h | 59 -- lv2/time/time.meta.ttl | 112 --- lv2/time/time.ttl | 122 --- lv2/ui.lv2/manifest.ttl | 9 + lv2/ui.lv2/ui.meta.ttl | 639 ++++++++++++++++ lv2/ui.lv2/ui.ttl | 249 ++++++ lv2/ui/manifest.ttl | 9 - lv2/ui/meson.build | 40 - lv2/ui/ui.h | 543 -------------- lv2/ui/ui.meta.ttl | 639 ---------------- lv2/ui/ui.ttl | 250 ------- lv2/units.lv2/manifest.ttl | 9 + lv2/units.lv2/units.meta.ttl | 154 ++++ lv2/units.lv2/units.ttl | 378 ++++++++++ lv2/units/manifest.ttl | 9 - lv2/units/meson.build | 40 - lv2/units/units.h | 75 -- lv2/units/units.meta.ttl | 154 ---- lv2/units/units.ttl | 379 ---------- lv2/uri-map.lv2/manifest.ttl | 9 + lv2/uri-map.lv2/uri-map.meta.ttl | 72 ++ lv2/uri-map.lv2/uri-map.ttl | 13 + lv2/uri-map/manifest.ttl | 9 - lv2/uri-map/meson.build | 40 - lv2/uri-map/uri-map.h | 121 --- lv2/uri-map/uri-map.meta.ttl | 72 -- lv2/uri-map/uri-map.ttl | 14 - lv2/urid.lv2/manifest.ttl | 9 + lv2/urid.lv2/urid.meta.ttl | 84 +++ lv2/urid.lv2/urid.ttl | 22 + lv2/urid/manifest.ttl | 9 - lv2/urid/meson.build | 40 - lv2/urid/urid.h | 140 ---- lv2/urid/urid.meta.ttl | 84 --- lv2/urid/urid.ttl | 23 - lv2/worker.lv2/manifest.ttl | 9 + lv2/worker.lv2/worker.meta.ttl | 82 ++ lv2/worker.lv2/worker.ttl | 24 + lv2/worker/manifest.ttl | 9 - lv2/worker/meson.build | 40 - lv2/worker/worker.h | 183 ----- lv2/worker/worker.meta.ttl | 82 -- lv2/worker/worker.ttl | 25 - 206 files changed, 9721 insertions(+), 17090 deletions(-) create mode 100644 lv2/atom.lv2/atom.meta.ttl create mode 100644 lv2/atom.lv2/atom.ttl create mode 100644 lv2/atom.lv2/manifest.ttl delete mode 100644 lv2/atom/atom-test-utils.c delete mode 100644 lv2/atom/atom-test.c delete mode 100644 lv2/atom/atom.h delete mode 100644 lv2/atom/atom.meta.ttl delete mode 100644 lv2/atom/atom.ttl delete mode 100644 lv2/atom/forge-overflow-test.c delete mode 100644 lv2/atom/forge.h delete mode 100644 lv2/atom/manifest.ttl delete mode 100644 lv2/atom/meson.build delete mode 100644 lv2/atom/util.h create mode 100644 lv2/buf-size.lv2/buf-size.meta.ttl create mode 100644 lv2/buf-size.lv2/buf-size.ttl create mode 100644 lv2/buf-size.lv2/manifest.ttl delete mode 100644 lv2/buf-size/buf-size.h delete mode 100644 lv2/buf-size/buf-size.meta.ttl delete mode 100644 lv2/buf-size/buf-size.ttl delete mode 100644 lv2/buf-size/manifest.ttl delete mode 100644 lv2/buf-size/meson.build create mode 100644 lv2/core.lv2/lv2core.meta.ttl create mode 100644 lv2/core.lv2/lv2core.ttl create mode 100644 lv2/core.lv2/manifest.ttl create mode 100644 lv2/core.lv2/meta.ttl create mode 100644 lv2/core.lv2/people.ttl delete mode 100644 lv2/core/attributes.h delete mode 100644 lv2/core/lv2.h delete mode 100644 lv2/core/lv2_util.h delete mode 100644 lv2/core/lv2core.meta.ttl delete mode 100644 lv2/core/lv2core.ttl delete mode 100644 lv2/core/manifest.ttl delete mode 100644 lv2/core/meson.build delete mode 100644 lv2/core/meta.ttl delete mode 100644 lv2/core/people.ttl create mode 100644 lv2/data-access.lv2/data-access.meta.ttl create mode 100644 lv2/data-access.lv2/data-access.ttl create mode 100644 lv2/data-access.lv2/manifest.ttl delete mode 100644 lv2/data-access/data-access.h delete mode 100644 lv2/data-access/data-access.meta.ttl delete mode 100644 lv2/data-access/data-access.ttl delete mode 100644 lv2/data-access/manifest.ttl delete mode 100644 lv2/data-access/meson.build create mode 100644 lv2/dynmanifest.lv2/dynmanifest.meta.ttl create mode 100644 lv2/dynmanifest.lv2/dynmanifest.ttl create mode 100644 lv2/dynmanifest.lv2/manifest.ttl delete mode 100644 lv2/dynmanifest/dynmanifest.h delete mode 100644 lv2/dynmanifest/dynmanifest.meta.ttl delete mode 100644 lv2/dynmanifest/dynmanifest.ttl delete mode 100644 lv2/dynmanifest/manifest.ttl delete mode 100644 lv2/dynmanifest/meson.build create mode 100644 lv2/event.lv2/event.meta.ttl create mode 100644 lv2/event.lv2/event.ttl create mode 100644 lv2/event.lv2/manifest.ttl delete mode 100644 lv2/event/event-helpers.h delete mode 100644 lv2/event/event.h delete mode 100644 lv2/event/event.meta.ttl delete mode 100644 lv2/event/event.ttl delete mode 100644 lv2/event/manifest.ttl delete mode 100644 lv2/event/meson.build create mode 100644 lv2/instance-access.lv2/instance-access.meta.ttl create mode 100644 lv2/instance-access.lv2/instance-access.ttl create mode 100644 lv2/instance-access.lv2/manifest.ttl delete mode 100644 lv2/instance-access/instance-access.h delete mode 100644 lv2/instance-access/instance-access.meta.ttl delete mode 100644 lv2/instance-access/instance-access.ttl delete mode 100644 lv2/instance-access/manifest.ttl delete mode 100644 lv2/instance-access/meson.build create mode 100644 lv2/log.lv2/log.meta.ttl create mode 100644 lv2/log.lv2/log.ttl create mode 100644 lv2/log.lv2/manifest.ttl delete mode 100644 lv2/log/log.h delete mode 100644 lv2/log/log.meta.ttl delete mode 100644 lv2/log/log.ttl delete mode 100644 lv2/log/logger.h delete mode 100644 lv2/log/manifest.ttl delete mode 100644 lv2/log/meson.build delete mode 100644 lv2/meson.build create mode 100644 lv2/midi.lv2/manifest.ttl create mode 100644 lv2/midi.lv2/midi.meta.ttl create mode 100644 lv2/midi.lv2/midi.ttl delete mode 100644 lv2/midi/manifest.ttl delete mode 100644 lv2/midi/meson.build delete mode 100644 lv2/midi/midi.h delete mode 100644 lv2/midi/midi.meta.ttl delete mode 100644 lv2/midi/midi.ttl create mode 100644 lv2/morph.lv2/manifest.ttl create mode 100644 lv2/morph.lv2/morph.meta.ttl create mode 100644 lv2/morph.lv2/morph.ttl delete mode 100644 lv2/morph/manifest.ttl delete mode 100644 lv2/morph/meson.build delete mode 100644 lv2/morph/morph.h delete mode 100644 lv2/morph/morph.meta.ttl delete mode 100644 lv2/morph/morph.ttl create mode 100644 lv2/options.lv2/manifest.ttl create mode 100644 lv2/options.lv2/options.meta.ttl create mode 100644 lv2/options.lv2/options.ttl delete mode 100644 lv2/options/manifest.ttl delete mode 100644 lv2/options/meson.build delete mode 100644 lv2/options/options.h delete mode 100644 lv2/options/options.meta.ttl delete mode 100644 lv2/options/options.ttl create mode 100644 lv2/parameters.lv2/manifest.ttl create mode 100644 lv2/parameters.lv2/parameters.meta.ttl create mode 100644 lv2/parameters.lv2/parameters.ttl delete mode 100644 lv2/parameters/manifest.ttl delete mode 100644 lv2/parameters/meson.build delete mode 100644 lv2/parameters/parameters.h delete mode 100644 lv2/parameters/parameters.meta.ttl delete mode 100644 lv2/parameters/parameters.ttl create mode 100644 lv2/patch.lv2/manifest.ttl create mode 100644 lv2/patch.lv2/patch.meta.ttl create mode 100644 lv2/patch.lv2/patch.ttl delete mode 100644 lv2/patch/manifest.ttl delete mode 100644 lv2/patch/meson.build delete mode 100644 lv2/patch/patch.h delete mode 100644 lv2/patch/patch.meta.ttl delete mode 100644 lv2/patch/patch.ttl create mode 100644 lv2/port-groups.lv2/manifest.ttl create mode 100644 lv2/port-groups.lv2/port-groups.meta.ttl create mode 100644 lv2/port-groups.lv2/port-groups.ttl delete mode 100644 lv2/port-groups/manifest.ttl delete mode 100644 lv2/port-groups/meson.build delete mode 100644 lv2/port-groups/port-groups.h delete mode 100644 lv2/port-groups/port-groups.meta.ttl delete mode 100644 lv2/port-groups/port-groups.ttl create mode 100644 lv2/port-props.lv2/manifest.ttl create mode 100644 lv2/port-props.lv2/port-props.meta.ttl create mode 100644 lv2/port-props.lv2/port-props.ttl delete mode 100644 lv2/port-props/manifest.ttl delete mode 100644 lv2/port-props/meson.build delete mode 100644 lv2/port-props/port-props.h delete mode 100644 lv2/port-props/port-props.meta.ttl delete mode 100644 lv2/port-props/port-props.ttl create mode 100644 lv2/presets.lv2/manifest.ttl create mode 100644 lv2/presets.lv2/presets.meta.ttl create mode 100644 lv2/presets.lv2/presets.ttl delete mode 100644 lv2/presets/manifest.ttl delete mode 100644 lv2/presets/meson.build delete mode 100644 lv2/presets/presets.h delete mode 100644 lv2/presets/presets.meta.ttl delete mode 100644 lv2/presets/presets.ttl create mode 100644 lv2/resize-port.lv2/manifest.ttl create mode 100644 lv2/resize-port.lv2/resize-port.meta.ttl create mode 100644 lv2/resize-port.lv2/resize-port.ttl delete mode 100644 lv2/resize-port/manifest.ttl delete mode 100644 lv2/resize-port/meson.build delete mode 100644 lv2/resize-port/resize-port.h delete mode 100644 lv2/resize-port/resize-port.meta.ttl delete mode 100644 lv2/resize-port/resize-port.ttl create mode 100644 lv2/state.lv2/manifest.ttl create mode 100644 lv2/state.lv2/state.meta.ttl create mode 100644 lv2/state.lv2/state.ttl delete mode 100644 lv2/state/manifest.ttl delete mode 100644 lv2/state/meson.build delete mode 100644 lv2/state/state.h delete mode 100644 lv2/state/state.meta.ttl delete mode 100644 lv2/state/state.ttl create mode 100644 lv2/time.lv2/manifest.ttl create mode 100644 lv2/time.lv2/time.meta.ttl create mode 100644 lv2/time.lv2/time.ttl delete mode 100644 lv2/time/manifest.ttl delete mode 100644 lv2/time/meson.build delete mode 100644 lv2/time/time.h delete mode 100644 lv2/time/time.meta.ttl delete mode 100644 lv2/time/time.ttl create mode 100644 lv2/ui.lv2/manifest.ttl create mode 100644 lv2/ui.lv2/ui.meta.ttl create mode 100644 lv2/ui.lv2/ui.ttl delete mode 100644 lv2/ui/manifest.ttl delete mode 100644 lv2/ui/meson.build delete mode 100644 lv2/ui/ui.h delete mode 100644 lv2/ui/ui.meta.ttl delete mode 100644 lv2/ui/ui.ttl create mode 100644 lv2/units.lv2/manifest.ttl create mode 100644 lv2/units.lv2/units.meta.ttl create mode 100644 lv2/units.lv2/units.ttl delete mode 100644 lv2/units/manifest.ttl delete mode 100644 lv2/units/meson.build delete mode 100644 lv2/units/units.h delete mode 100644 lv2/units/units.meta.ttl delete mode 100644 lv2/units/units.ttl create mode 100644 lv2/uri-map.lv2/manifest.ttl create mode 100644 lv2/uri-map.lv2/uri-map.meta.ttl create mode 100644 lv2/uri-map.lv2/uri-map.ttl delete mode 100644 lv2/uri-map/manifest.ttl delete mode 100644 lv2/uri-map/meson.build delete mode 100644 lv2/uri-map/uri-map.h delete mode 100644 lv2/uri-map/uri-map.meta.ttl delete mode 100644 lv2/uri-map/uri-map.ttl create mode 100644 lv2/urid.lv2/manifest.ttl create mode 100644 lv2/urid.lv2/urid.meta.ttl create mode 100644 lv2/urid.lv2/urid.ttl delete mode 100644 lv2/urid/manifest.ttl delete mode 100644 lv2/urid/meson.build delete mode 100644 lv2/urid/urid.h delete mode 100644 lv2/urid/urid.meta.ttl delete mode 100644 lv2/urid/urid.ttl create mode 100644 lv2/worker.lv2/manifest.ttl create mode 100644 lv2/worker.lv2/worker.meta.ttl create mode 100644 lv2/worker.lv2/worker.ttl delete mode 100644 lv2/worker/manifest.ttl delete mode 100644 lv2/worker/meson.build delete mode 100644 lv2/worker/worker.h delete mode 100644 lv2/worker/worker.meta.ttl delete mode 100644 lv2/worker/worker.ttl (limited to 'lv2') diff --git a/lv2/atom.lv2/atom.meta.ttl b/lv2/atom.lv2/atom.meta.ttl new file mode 100644 index 0000000..adab5f4 --- /dev/null +++ b/lv2/atom.lv2/atom.meta.ttl @@ -0,0 +1,552 @@ +@prefix atom: . +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Atom" ; + doap:shortdesc "A generic value container and several data types." ; + doap:license ; + doap:created "2007-00-00" ; + doap:developer ; + doap:release [ + doap:revision "2.4" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2_atom_object_get_typed() for easy type-safe access to object properties." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2014-08-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Deprecate Blank and Resource in favour of just Object." + ] , [ + rdfs:label "Add lv2_atom_forge_is_object_type() and lv2_atom_forge_is_blank() to ease backwards compatibility." + ] , [ + rdfs:label "Add lv2_atom_forge_key() for terser object writing." + ] , [ + rdfs:label "Add lv2_atom_sequence_clear() and lv2_atom_sequence_append_event() helper functions." + ] + ] + ] , [ + doap:revision "1.8" ; + doap:created "2014-01-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make lv2_atom_*_is_end() arguments const." + ] + ] + ] , [ + doap:revision "1.6" ; + doap:created "2013-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix crash in forge.h when pushing atoms to a full buffer." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2013-01-27" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix lv2_atom_sequence_end()." + ] , [ + rdfs:label "Remove atom:stringType in favour of owl:onDatatype so generic tools can understand and validate atom literals." + ] , [ + rdfs:label "Improve atom documentation." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix implicit conversions in forge.h that are invalid in C++11." + ] , [ + rdfs:label "Fix lv2_atom_object_next() on 32-bit platforms." + ] , [ + rdfs:label "Add lv2_atom_object_body_get()." + ] , [ + rdfs:label "Fix outdated documentation in forge.h." + ] , [ + rdfs:label "Use consistent label style." + ] , [ + rdfs:label "Add LV2_ATOM_CONTENTS_CONST and LV2_ATOM_BODY_CONST." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +An atom:Atom is a simple generic data container for holding any type of Plain +Old Data (POD). An Atom can contain simple primitive types like integers, +floating point numbers, and strings; as well as structured data like lists and +dictionary-like Objects. Since Atoms are POD, they can be easily copied +(for example, with `memcpy()`) anywhere and are suitable for use in real-time +code. + +Every atom starts with an LV2_Atom header, followed by the contents. This +allows code to process atoms without requiring special code for every type of +data. For example, plugins that mutually understand a type can be used +together in a host that does not understand that type, because the host is only +required to copy atoms, not interpret their contents. Similarly, plugins (such +as routers, delays, or data structures) can meaningfully process atoms of a +type unknown to them. + +Atoms should be used anywhere values of various types must be stored or +transmitted. An atom:AtomPort can be used to transmit atoms via ports. An +atom:AtomPort that contains a atom:Sequence can be used for sample accurate +communication of events, such as MIDI. + +### Serialisation + +Each Atom type defines a binary format for use at runtime, but also a +serialisation that is natural to express in Turtle format. Thus, this +specification defines a powerful real-time appropriate data model, as well as a +portable way to serialise any data in that model. This is particularly useful +for inter-process communication, saving/restoring state, and describing values +in plugin data files. + +### Custom Atom Types + +While it is possible to define new Atom types for any binary format, the +standard types defined here are powerful enough to describe almost anything. +Implementations SHOULD build structures out of the types provided here, rather +than define new binary formats (for example, using atom:Object rather than a +new C `struct` type). Host and tool implementations have support for +serialising all standard types, so new binary formats are an implementation +burden which harms interoperabilty. In particular, plugins SHOULD NOT expect +UI communication or state saving with custom binary types to work. In general, +new Atom types should only be defined where absolutely necessary due to +performance reasons and serialisation is not a concern. + +"""^^lv2:Markdown . + +atom:Atom + lv2:documentation """ + +An LV2_Atom has a 32-bit `size` and `type`, followed by a body of `size` bytes. +Atoms MUST be 64-bit aligned. + +All concrete Atom types (subclasses of this class) MUST define a precise binary +layout for their body. + +The `type` field is the URI of an Atom type mapped to an integer. +Implementations SHOULD gracefully pass through, or ignore, atoms with unknown +types. + +All atoms are POD by definition except references, which as a special case have +`type` 0. An Atom MUST NOT contain a Reference. It is safe to copy any +non-reference Atom with a simple `memcpy`, even if the implementation does not +understand `type`. Though this extension reserves the type 0 for references, +the details of reference handling are currently unspecified. A future revision +of this extension, or a different extension, may define how to use non-POD data +and references. Implementations MUST NOT send references to another +implementation unless the receiver is explicitly known to support references +(e.g. by supporting a feature). + +The special case of a null atom with both `type` and `size` 0 is not considered +a reference. + +"""^^lv2:Markdown . + +atom:Chunk + lv2:documentation """ + +This type is used to indicate a certain amount of space is available. For +example, output ports with a variably sized type are connected to a Chunk so +the plugin knows the size of the buffer available for writing. + +The use of a Chunk should be constrained to a local scope, since +interpreting it is impossible without context. However, if serialised to RDF, +a Chunk may be represented directly as an xsd:base64Binary string, for example: + + :::turtle + [] eg:someChunk "vu/erQ=="^^xsd:base64Binary . + +"""^^lv2:Markdown . + +atom:String + lv2:documentation """ + +The body of an LV2_Atom_String is a C string in UTF-8 encoding, i.e. an array +of bytes (`uint8_t`) terminated with a NULL byte (`'\\0'`). + +This type is for free-form strings, but SHOULD NOT be used for typed data or +text in any language. Use atom:Literal unless translating the string does not +make sense and the string has no meaningful datatype. + +"""^^lv2:Markdown . + +atom:Literal + lv2:documentation """ + +This type is compatible with rdfs:Literal and is capable of expressing a +string in any language or a value of any type. A Literal has a +`datatype` and `lang` followed by string data in UTF-8 +encoding. The length of the string data in bytes is `size - +sizeof(LV2_Atom_Literal)`, including the terminating NULL character. The +`lang` field SHOULD be a URI of the form +`http://lexvo.org/id/iso639-3/LANG` or +`http://lexvo.org/id/iso639-1/LANG` where LANG is a 3-character ISO 693-3 +language code, or a 2-character ISO 693-1 language code, respectively. + +A Literal may have a `datatype` or a `lang`, but never both. + +For example, a Literal can be Hello in English: + + :::c + void set_to_hello_in_english(LV2_Atom_Literal* lit) { + lit->atom.type = map(expand("atom:Literal")); + lit->atom.size = 14; + lit->body.datatype = 0; + lit->body.lang = map("http://lexvo.org/id/iso639-1/en"); + memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit), + "Hello", + sizeof("Hello")); // Assumes enough space + } + +or a Turtle string: + + :::c + void set_to_turtle_string(LV2_Atom_Literal* lit, const char* ttl) { + lit->atom.type = map(expand("atom:Literal")); + lit->atom.size = 64; + lit->body.datatype = map("http://www.w3.org/2008/turtle#turtle"); + lit->body.lang = 0; + memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit), + ttl, + strlen(ttl) + 1); // Assumes enough space + } + +"""^^lv2:Markdown . + +atom:Path + lv2:documentation """ + +A Path is a URI reference with only a path component: no scheme, authority, +query, or fragment. In particular, paths to files in the same bundle may be +cleanly written in Turtle files as a relative URI. However, implementations +may assume any binary Path (e.g. in an event payload) is a valid file path +which can passed to system functions like fopen() directly, without any +character encoding or escape expansion required. + +Any implementation that creates a Path atom to transmit to another is +responsible for ensuring it is valid. A Path SHOULD always be absolute, unless +there is some mechanism in place that defines a base path. Since this is not +the case for plugin instances, effectively any Path sent to or received from a +plugin instance MUST be absolute. + +"""^^lv2:Markdown . + +atom:URI + lv2:documentation """ + +This is useful when a URI is needed but mapping is inappropriate, for example +with temporary or relative URIs. Since the ability to distinguish URIs from +plain strings is often necessary, URIs MUST NOT be transmitted as atom:String. + +This is not strictly a URI, since UTF-8 is allowed. Escaping and related +issues are the host's responsibility. + +"""^^lv2:Markdown . + +atom:URID + lv2:documentation """ + +A URID is typically generated with the LV2_URID_Map provided by the host . + +"""^^lv2:Markdown . + +atom:Vector + lv2:documentation """ + +A homogeneous series of atom bodies with equivalent type and size. + +An LV2_Atom_Vector is a 32-bit `child_size` and `child_type` followed by `size +/ child_size` atom bodies. + +For example, an atom:Vector containing 42 elements of type atom:Float: + + :::c + struct VectorOf42Floats { + uint32_t size; // sizeof(LV2_Atom_Vector_Body) + (42 * sizeof(float); + uint32_t type; // map(expand("atom:Vector")) + uint32_t child_size; // sizeof(float) + uint32_t child_type; // map(expand("atom:Float")) + float elems[42]; + }; + +Note that it is possible to construct a valid Atom for each element of the +vector, even by an implementation which does not understand `child_type`. + +If serialised to RDF, a Vector SHOULD have the form: + + :::turtle + eg:someVector + a atom:Vector ; + atom:childType atom:Int ; + rdf:value ( + "1"^^xsd:int + "2"^^xsd:int + "3"^^xsd:int + "4"^^xsd:int + ) . + +"""^^lv2:Markdown . + +atom:Tuple + lv2:documentation """ + +The body of a Tuple is simply a series of complete atoms, each aligned to +64 bits. + +If serialised to RDF, a Tuple SHOULD have the form: + + :::turtle + eg:someVector + a atom:Tuple ; + rdf:value ( + "1"^^xsd:int + "3.5"^^xsd:float + "etc" + ) . + +"""^^lv2:Markdown . + +atom:Property + lv2:documentation """ + +An LV2_Atom_Property has a URID `key` and `context`, and an Atom `value`. This +corresponds to an RDF Property, where the key is the predicate +and the value is the object. + +The `context` field can be used to specify a different context for each +property, where this is useful. Otherwise, it may be 0. + +Properties generally only exist as part of an atom:Object. Accordingly, +they will typically be represented directly as properties in RDF (see +atom:Object). If this is not possible, they may be expressed as partial +reified statements, for example: + + :::turtle + eg:someProperty + rdf:predicate eg:theKey ; + rdf:object eg:theValue . + +"""^^lv2:Markdown . + +atom:Object + lv2:documentation """ + +An Object is an atom with a set of properties. This corresponds to an +RDF Resource, and can be thought of as a dictionary with URID keys. + +An LV2_Atom_Object body has a uint32_t `id` and `type`, followed by a series of +atom:Property bodies (LV2_Atom_Property_Body). The LV2_Atom_Object_Body::otype +field is equivalent to a property with key rdf:type, but is included in the +structure to allow for fast dispatching. + +Code SHOULD check for objects using lv2_atom_forge_is_object() or +lv2_atom_forge_is_blank() if a forge is available, rather than checking the +atom type directly. This will correctly handle the deprecated atom:Resource +and atom:Blank types. + +When serialised to RDF, an Object is represented as a resource, for example: + + :::turtle + eg:someObject + eg:firstPropertyKey "first property value" ; + eg:secondPropertyKey "first loser" ; + eg:andSoOn "and so on" . + +"""^^lv2:Markdown . + +atom:Resource + lv2:documentation """ + +This class is deprecated. Use atom:Object directly instead. + +An atom:Object where the id field is a URID, that is, an Object +with a URI. + +"""^^lv2:Markdown . + +atom:Blank + lv2:documentation """ + +This class is deprecated. Use atom:Object with ID 0 instead. + +An atom:Object where the LV2_Atom_Object::id is a blank node ID (NOT a URI). +The ID of a Blank is valid only within the context the Blank appears in. For +ports this is the context of the associated run() call, i.e. all ports share +the same context so outputs can contain IDs that correspond to IDs of blanks in +the input. + +"""^^lv2:Markdown . + +atom:Sound + lv2:documentation """ + +The format of a atom:Sound is the same as the buffer format for lv2:AudioPort +(except the size may be arbitrary). An atom:Sound inherently depends on the +sample rate, which is assumed to be known from context. Because of this, +directly serialising an atom:Sound is probably a bad idea, use a standard +format like WAV instead. + +"""^^lv2:Markdown . + +atom:Event + lv2:documentation """ + +An Event is typically an element of an atom:Sequence. Note that this is not an Atom type since it begins with a timestamp, not an atom header. + +"""^^lv2:Markdown . + +atom:Sequence + lv2:documentation """ + +A flat sequence of atom:Event, that is, a series of time-stamped Atoms. + +LV2_Atom_Sequence_Body.unit describes the time unit for the contained atoms. +If the unit is known from context (e.g. run() stamps are always audio frames), +this field may be zero. Otherwise, it SHOULD be either units:frame or +units:beat, in which case ev.time.frames or ev.time.beats is valid, +respectively. + +If serialised to RDF, a Sequence has a similar form to atom:Vector, but for +brevity the elements may be assumed to be atom:Event, for example: + + :::turtle + eg:someSequence + a atom:Sequence ; + rdf:value ( + [ + atom:frameTime 1 ; + rdf:value "901A01"^^midi:MidiEvent + ] [ + atom:frameTime 3 ; + rdf:value "902B02"^^midi:MidiEvent + ] + ) . + +"""^^lv2:Markdown . + +atom:AtomPort + lv2:documentation """ + +Ports of this type are connected to an LV2_Atom with a type specified by +atom:bufferType. + +Output ports with a variably sized type MUST be initialised by the host before +every run() to an atom:Chunk with size set to the available space. The plugin +reads this size to know how much space is available for writing. In all cases, +the plugin MUST write a complete atom (including header) to outputs. However, +to be robust, hosts SHOULD initialise output ports to a safe sentinel (e.g. the +null Atom) before calling run(). + +"""^^lv2:Markdown . + +atom:bufferType + lv2:documentation """ + +Indicates that an AtomPort may be connected to a certain Atom type. A port MAY +support several buffer types. The host MUST NOT connect a port to an Atom with +a type not explicitly listed with this property. The value of this property +MUST be a sub-class of atom:Atom. For example, an input port that is connected +directly to an LV2_Atom_Double value is described like so: + + :::turtle + + lv2:port [ + a lv2:InputPort , atom:AtomPort ; + atom:bufferType atom:Double ; + ] . + +This property only describes the types a port may be directly connected to. It +says nothing about the expected contents of containers. For that, use +atom:supports. + +"""^^lv2:Markdown . + +atom:supports + lv2:documentation """ + +This property is defined loosely, it may be used to indicate that anything +supports an Atom type, wherever that may be useful. It applies +recursively where collections are involved. + +In particular, this property can be used to describe which event types are +expected by a port. For example, a port that receives MIDI events is described +like so: + + :::turtle + + lv2:port [ + a lv2:InputPort , atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports midi:MidiEvent ; + ] . + +"""^^lv2:Markdown . + +atom:eventTransfer + lv2:documentation """ + +Transfer of individual events in a port buffer. Useful as the `format` for a +LV2UI_Write_Function. + +This protocol applies to ports which contain events, usually in an +atom:Sequence. The host must transfer each individual event to the recipient. +The format of the received data is an LV2_Atom, there is no timestamp header. + +"""^^lv2:Markdown . + +atom:atomTransfer + lv2:documentation """ + +Transfer of the complete atom in a port buffer. Useful as the `format` for a +LV2UI_Write_Function. + +This protocol applies to atom ports. The host must transfer the complete atom +contained in the port, including header. + +"""^^lv2:Markdown . + diff --git a/lv2/atom.lv2/atom.ttl b/lv2/atom.lv2/atom.ttl new file mode 100644 index 0000000..bdeaebf --- /dev/null +++ b/lv2/atom.lv2/atom.ttl @@ -0,0 +1,247 @@ +@prefix atom: . +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix ui: . +@prefix units: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:seeAlso ; + rdfs:label "LV2 Atom" ; + rdfs:comment "A generic value container and several data types." ; + owl:imports , + , + . + +atom:cType + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "C type" ; + rdfs:comment "The C type that describes the binary representation of an Atom type." ; + rdfs:domain rdfs:Class ; + rdfs:range lv2:Symbol . + +atom:Atom + a rdfs:Class ; + rdfs:label "Atom" ; + rdfs:comment "Abstract base class for all atoms." ; + atom:cType "LV2_Atom" . + +atom:Chunk + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Chunk" ; + rdfs:comment "A chunk of memory with undefined contents." ; + owl:onDatatype xsd:base64Binary . + +atom:Number + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Number" ; + rdfs:comment "Base class for numeric types." . + +atom:Int + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Int" ; + rdfs:comment "A native `int32_t`." ; + atom:cType "LV2_Atom_Int" ; + owl:onDatatype xsd:int . + +atom:Long + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Long" ; + rdfs:comment "A native `int64_t`." ; + atom:cType "LV2_Atom_Long" ; + owl:onDatatype xsd:long . + +atom:Float + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Float" ; + rdfs:comment "A native `float`." ; + atom:cType "LV2_Atom_Float" ; + owl:onDatatype xsd:float . + +atom:Double + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Double" ; + rdfs:comment "A native `double`." ; + atom:cType "LV2_Atom_Double" ; + owl:onDatatype xsd:double . + +atom:Bool + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Bool" ; + rdfs:comment "An atom:Int where 0 is false and any other value is true." ; + atom:cType "LV2_Atom_Bool" ; + owl:onDatatype xsd:boolean . + +atom:String + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Atom ; + rdfs:label "String" ; + rdfs:comment "A UTF-8 string." ; + atom:cType "LV2_Atom_String" ; + owl:onDatatype xsd:string . + +atom:Literal + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Literal" ; + rdfs:comment "A UTF-8 string literal with optional datatype or language." ; + atom:cType "LV2_Atom_Literal" . + +atom:Path + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:URI ; + owl:onDatatype atom:URI ; + rdfs:label "Path" ; + rdfs:comment "A local file path." . + +atom:URI + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:String ; + owl:onDatatype xsd:anyURI ; + rdfs:label "URI" ; + rdfs:comment "A URI string." . + +atom:URID + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "URID" ; + rdfs:comment "An unsigned 32-bit integer ID for a URI." ; + atom:cType "LV2_Atom_URID" . + +atom:Vector + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Vector" ; + rdfs:comment "A homogeneous sequence of atom bodies with equivalent type and size." ; + atom:cType "LV2_Atom_Vector" . + +atom:Tuple + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Tuple" ; + rdfs:comment "A sequence of atoms with varying type and size." . + +atom:Property + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Property" ; + rdfs:comment "A property of an atom:Object." ; + atom:cType "LV2_Atom_Property" . + +atom:Object + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Object" ; + rdfs:comment "A collection of properties." ; + atom:cType "LV2_Atom_Object" . + +atom:Resource + a rdfs:Class ; + rdfs:subClassOf atom:Object ; + rdfs:label "Resource" ; + rdfs:comment "A named collection of properties with a URI." ; + owl:deprecated "true"^^xsd:boolean ; + atom:cType "LV2_Atom_Object" . + +atom:Blank + a rdfs:Class ; + rdfs:subClassOf atom:Object ; + rdfs:label "Blank" ; + rdfs:comment "An anonymous collection of properties without a URI." ; + owl:deprecated "true"^^xsd:boolean ; + atom:cType "LV2_Atom_Object" . + +atom:Sound + a rdfs:Class ; + rdfs:subClassOf atom:Vector ; + rdfs:label "Sound" ; + rdfs:comment "A atom:Vector of atom:Float which represents an audio waveform." ; + atom:cType "LV2_Atom_Vector" . + +atom:frameTime + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:range xsd:decimal ; + rdfs:label "frame time" ; + rdfs:comment "A time stamp in audio frames." . + +atom:beatTime + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:range xsd:decimal ; + rdfs:label "beat time" ; + rdfs:comment "A time stamp in beats." . + +atom:Event + a rdfs:Class ; + rdfs:label "Event" ; + atom:cType "LV2_Atom_Event" ; + rdfs:comment "An atom with a time stamp prefix in a sequence." . + +atom:Sequence + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Sequence" ; + atom:cType "LV2_Atom_Sequence" ; + rdfs:comment "A sequence of events." . + +atom:AtomPort + a rdfs:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Atom Port" ; + rdfs:comment "A port which contains an atom:Atom." . + +atom:bufferType + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain atom:AtomPort ; + rdfs:range rdfs:Class ; + rdfs:label "buffer type" ; + rdfs:comment "An atom type that a port may be connected to." . + +atom:childType + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "child type" ; + rdfs:comment "The type of children in a container." . + +atom:supports + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "supports" ; + rdfs:comment "A supported atom type." ; + rdfs:range rdfs:Class . + +atom:eventTransfer + a ui:PortProtocol ; + rdfs:label "event transfer" ; + rdfs:comment "A port protocol for transferring events." . + +atom:atomTransfer + a ui:PortProtocol ; + rdfs:label "atom transfer" ; + rdfs:comment "A port protocol for transferring atoms." . + diff --git a/lv2/atom.lv2/manifest.ttl b/lv2/atom.lv2/manifest.ttl new file mode 100644 index 0000000..3cb5134 --- /dev/null +++ b/lv2/atom.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/atom/atom-test-utils.c b/lv2/atom/atom-test-utils.c deleted file mode 100644 index ae368c8..0000000 --- a/lv2/atom/atom-test-utils.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2012-2018 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/log/log.h" -#include "lv2/urid/urid.h" - -#include -#include -#include - -static char** uris = NULL; -static uint32_t n_uris = 0; - -static char* -copy_string(const char* str) -{ - const size_t len = strlen(str); - char* dup = (char*)malloc(len + 1); - memcpy(dup, str, len + 1); - return dup; -} - -static LV2_URID -urid_map(LV2_URID_Map_Handle handle, const char* uri) -{ - for (uint32_t i = 0; i < n_uris; ++i) { - if (!strcmp(uris[i], uri)) { - return i + 1; - } - } - - uris = (char**)realloc(uris, ++n_uris * sizeof(char*)); - uris[n_uris - 1] = copy_string(uri); - return n_uris; -} - -static void -free_urid_map(void) -{ - for (uint32_t i = 0; i < n_uris; ++i) { - free(uris[i]); - } - - free(uris); -} - -LV2_LOG_FUNC(1, 2) -static int -test_fail(const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - fprintf(stderr, "error: "); - vfprintf(stderr, fmt, args); - va_end(args); - return 1; -} diff --git a/lv2/atom/atom-test.c b/lv2/atom/atom-test.c deleted file mode 100644 index 230a7cd..0000000 --- a/lv2/atom/atom-test.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - Copyright 2012-2015 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#include "lv2/atom/atom-test-utils.c" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/atom/util.h" -#include "lv2/urid/urid.h" - -#include -#include -#include -#include - -int -main(void) -{ - LV2_URID_Map map = {NULL, urid_map}; - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - - LV2_URID eg_Object = urid_map(NULL, "http://example.org/Object"); - LV2_URID eg_one = urid_map(NULL, "http://example.org/one"); - LV2_URID eg_two = urid_map(NULL, "http://example.org/two"); - LV2_URID eg_three = urid_map(NULL, "http://example.org/three"); - LV2_URID eg_four = urid_map(NULL, "http://example.org/four"); - LV2_URID eg_true = urid_map(NULL, "http://example.org/true"); - LV2_URID eg_false = urid_map(NULL, "http://example.org/false"); - LV2_URID eg_path = urid_map(NULL, "http://example.org/path"); - LV2_URID eg_uri = urid_map(NULL, "http://example.org/uri"); - LV2_URID eg_urid = urid_map(NULL, "http://example.org/urid"); - LV2_URID eg_string = urid_map(NULL, "http://example.org/string"); - LV2_URID eg_literal = urid_map(NULL, "http://example.org/literal"); - LV2_URID eg_tuple = urid_map(NULL, "http://example.org/tuple"); - LV2_URID eg_vector = urid_map(NULL, "http://example.org/vector"); - LV2_URID eg_vector2 = urid_map(NULL, "http://example.org/vector2"); - LV2_URID eg_seq = urid_map(NULL, "http://example.org/seq"); - -#define BUF_SIZE 1024 -#define NUM_PROPS 15 - - uint8_t buf[BUF_SIZE]; - lv2_atom_forge_set_buffer(&forge, buf, BUF_SIZE); - - LV2_Atom_Forge_Frame obj_frame; - LV2_Atom* obj = lv2_atom_forge_deref( - &forge, lv2_atom_forge_object(&forge, &obj_frame, 0, eg_Object)); - - // eg_one = (Int)1 - lv2_atom_forge_key(&forge, eg_one); - LV2_Atom_Int* one = - (LV2_Atom_Int*)lv2_atom_forge_deref(&forge, lv2_atom_forge_int(&forge, 1)); - if (one->body != 1) { - return test_fail("%d != 1\n", one->body); - } - - // eg_two = (Long)2 - lv2_atom_forge_key(&forge, eg_two); - LV2_Atom_Long* two = (LV2_Atom_Long*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_long(&forge, 2)); - if (two->body != 2) { - return test_fail("%ld != 2\n", (long)two->body); - } - - // eg_three = (Float)3.0 - lv2_atom_forge_key(&forge, eg_three); - LV2_Atom_Float* three = (LV2_Atom_Float*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_float(&forge, 3.0f)); - if (three->body != 3) { - return test_fail("%f != 3\n", three->body); - } - - // eg_four = (Double)4.0 - lv2_atom_forge_key(&forge, eg_four); - LV2_Atom_Double* four = (LV2_Atom_Double*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_double(&forge, 4.0)); - if (four->body != 4) { - return test_fail("%f != 4\n", four->body); - } - - // eg_true = (Bool)1 - lv2_atom_forge_key(&forge, eg_true); - LV2_Atom_Bool* t = (LV2_Atom_Bool*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_bool(&forge, true)); - if (t->body != 1) { - return test_fail("%d != 1 (true)\n", t->body); - } - - // eg_false = (Bool)0 - lv2_atom_forge_key(&forge, eg_false); - LV2_Atom_Bool* f = (LV2_Atom_Bool*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_bool(&forge, false)); - if (f->body != 0) { - return test_fail("%d != 0 (false)\n", f->body); - } - - // eg_path = (Path)"/foo/bar" - const char* pstr = "/foo/bar"; - const uint32_t pstr_len = (uint32_t)strlen(pstr); - lv2_atom_forge_key(&forge, eg_path); - LV2_Atom_String* path = (LV2_Atom_String*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_uri(&forge, pstr, pstr_len)); - char* pbody = (char*)LV2_ATOM_BODY(path); - if (strcmp(pbody, pstr)) { - return test_fail("%s != \"%s\"\n", pbody, pstr); - } - - // eg_uri = (URI)"http://example.org/value" - const char* ustr = "http://example.org/value"; - const uint32_t ustr_len = (uint32_t)strlen(ustr); - lv2_atom_forge_key(&forge, eg_uri); - LV2_Atom_String* uri = (LV2_Atom_String*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_uri(&forge, ustr, ustr_len)); - char* ubody = (char*)LV2_ATOM_BODY(uri); - if (strcmp(ubody, ustr)) { - return test_fail("%s != \"%s\"\n", ubody, ustr); - } - - // eg_urid = (URID)"http://example.org/value" - LV2_URID eg_value = urid_map(NULL, "http://example.org/value"); - lv2_atom_forge_key(&forge, eg_urid); - LV2_Atom_URID* urid = (LV2_Atom_URID*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_urid(&forge, eg_value)); - if (urid->body != eg_value) { - return test_fail("%u != %u\n", urid->body, eg_value); - } - - // eg_string = (String)"hello" - lv2_atom_forge_key(&forge, eg_string); - LV2_Atom_String* string = (LV2_Atom_String*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_string(&forge, "hello", strlen("hello"))); - char* sbody = (char*)LV2_ATOM_BODY(string); - if (strcmp(sbody, "hello")) { - return test_fail("%s != \"hello\"\n", sbody); - } - - // eg_literal = (Literal)"hello"@fr - lv2_atom_forge_key(&forge, eg_literal); - LV2_Atom_Literal* literal = (LV2_Atom_Literal*)lv2_atom_forge_deref( - &forge, - lv2_atom_forge_literal(&forge, - "bonjour", - strlen("bonjour"), - 0, - urid_map(NULL, "http://lexvo.org/id/term/fr"))); - char* lbody = (char*)LV2_ATOM_CONTENTS(LV2_Atom_Literal, literal); - if (strcmp(lbody, "bonjour")) { - return test_fail("%s != \"bonjour\"\n", lbody); - } - - // eg_tuple = "foo",true - lv2_atom_forge_key(&forge, eg_tuple); - LV2_Atom_Forge_Frame tuple_frame; - LV2_Atom_Tuple* tuple = (LV2_Atom_Tuple*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_tuple(&forge, &tuple_frame)); - LV2_Atom_String* tup0 = (LV2_Atom_String*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_string(&forge, "foo", strlen("foo"))); - LV2_Atom_Bool* tup1 = (LV2_Atom_Bool*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_bool(&forge, true)); - lv2_atom_forge_pop(&forge, &tuple_frame); - LV2_Atom* i = lv2_atom_tuple_begin(tuple); - if (lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), tuple->atom.size, i)) { - return test_fail("Tuple iterator is empty\n"); - } - LV2_Atom* tup0i = i; - if (!lv2_atom_equals((LV2_Atom*)tup0, tup0i)) { - return test_fail("Corrupt tuple element 0\n"); - } - i = lv2_atom_tuple_next(i); - if (lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), tuple->atom.size, i)) { - return test_fail("Premature end of tuple iterator\n"); - } - LV2_Atom* tup1i = i; - if (!lv2_atom_equals((LV2_Atom*)tup1, tup1i)) { - return test_fail("Corrupt tuple element 1\n"); - } - i = lv2_atom_tuple_next(i); - if (!lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), tuple->atom.size, i)) { - return test_fail("Tuple iter is not at end\n"); - } - - // eg_vector = (Vector)1,2,3,4 - lv2_atom_forge_key(&forge, eg_vector); - int32_t elems[] = {1, 2, 3, 4}; - LV2_Atom_Vector* vector = (LV2_Atom_Vector*)lv2_atom_forge_deref( - &forge, - lv2_atom_forge_vector(&forge, sizeof(int32_t), forge.Int, 4, elems)); - void* vec_body = LV2_ATOM_CONTENTS(LV2_Atom_Vector, vector); - if (memcmp(elems, vec_body, sizeof(elems))) { - return test_fail("Corrupt vector\n"); - } - - // eg_vector2 = (Vector)1,2,3,4 - lv2_atom_forge_key(&forge, eg_vector2); - LV2_Atom_Forge_Frame vec_frame; - LV2_Atom_Vector* vector2 = (LV2_Atom_Vector*)lv2_atom_forge_deref( - &forge, - lv2_atom_forge_vector_head(&forge, &vec_frame, sizeof(int32_t), forge.Int)); - for (unsigned e = 0; e < sizeof(elems) / sizeof(int32_t); ++e) { - lv2_atom_forge_int(&forge, elems[e]); - } - lv2_atom_forge_pop(&forge, &vec_frame); - if (!lv2_atom_equals(&vector->atom, &vector2->atom)) { - return test_fail("Vector != Vector2\n"); - } - - // eg_seq = (Sequence)1, 2 - lv2_atom_forge_key(&forge, eg_seq); - LV2_Atom_Forge_Frame seq_frame; - LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)lv2_atom_forge_deref( - &forge, lv2_atom_forge_sequence_head(&forge, &seq_frame, 0)); - lv2_atom_forge_frame_time(&forge, 0); - lv2_atom_forge_int(&forge, 1); - lv2_atom_forge_frame_time(&forge, 1); - lv2_atom_forge_int(&forge, 2); - lv2_atom_forge_pop(&forge, &seq_frame); - - lv2_atom_forge_pop(&forge, &obj_frame); - - // Test equality - LV2_Atom_Int itwo = {{forge.Int, sizeof(int32_t)}, 2}; - if (lv2_atom_equals((LV2_Atom*)one, (LV2_Atom*)two)) { - return test_fail("1 == 2.0\n"); - } else if (lv2_atom_equals((LV2_Atom*)one, (LV2_Atom*)&itwo)) { - return test_fail("1 == 2\n"); - } else if (!lv2_atom_equals((LV2_Atom*)one, (LV2_Atom*)one)) { - return test_fail("1 != 1\n"); - } - - unsigned n_events = 0; - LV2_ATOM_SEQUENCE_FOREACH (seq, ev) { - if (ev->time.frames != n_events) { - return test_fail("Corrupt event %u has bad time\n", n_events); - } else if (ev->body.type != forge.Int) { - return test_fail("Corrupt event %u has bad type\n", n_events); - } else if (((LV2_Atom_Int*)&ev->body)->body != (int)n_events + 1) { - return test_fail("Event %u != %u\n", n_events, n_events + 1); - } - ++n_events; - } - - int n_props = 0; - LV2_ATOM_OBJECT_FOREACH ((LV2_Atom_Object*)obj, prop) { - if (!prop->key) { - return test_fail("Corrupt property %d has no key\n", n_props); - } else if (prop->context) { - return test_fail("Corrupt property %d has context\n", n_props); - } - ++n_props; - } - - if (n_props != NUM_PROPS) { - return test_fail( - "Corrupt object has %d properties != %d\n", n_props, NUM_PROPS); - } - - struct { - const LV2_Atom* one; - const LV2_Atom* two; - const LV2_Atom* three; - const LV2_Atom* four; - const LV2_Atom* affirmative; - const LV2_Atom* negative; - const LV2_Atom* path; - const LV2_Atom* uri; - const LV2_Atom* urid; - const LV2_Atom* string; - const LV2_Atom* literal; - const LV2_Atom* tuple; - const LV2_Atom* vector; - const LV2_Atom* vector2; - const LV2_Atom* seq; - } matches; - - memset(&matches, 0, sizeof(matches)); - - LV2_Atom_Object_Query q[] = {{eg_one, &matches.one}, - {eg_two, &matches.two}, - {eg_three, &matches.three}, - {eg_four, &matches.four}, - {eg_true, &matches.affirmative}, - {eg_false, &matches.negative}, - {eg_path, &matches.path}, - {eg_uri, &matches.uri}, - {eg_urid, &matches.urid}, - {eg_string, &matches.string}, - {eg_literal, &matches.literal}, - {eg_tuple, &matches.tuple}, - {eg_vector, &matches.vector}, - {eg_vector2, &matches.vector2}, - {eg_seq, &matches.seq}, - LV2_ATOM_OBJECT_QUERY_END}; - - int n_matches = lv2_atom_object_query((LV2_Atom_Object*)obj, q); - for (int n = 0; n < 2; ++n) { - if (n_matches != n_props) { - return test_fail("Query failed, %d matches != %d\n", n_matches, n_props); - } else if (!lv2_atom_equals((LV2_Atom*)one, matches.one)) { - return test_fail("Bad match one\n"); - } else if (!lv2_atom_equals((LV2_Atom*)two, matches.two)) { - return test_fail("Bad match two\n"); - } else if (!lv2_atom_equals((LV2_Atom*)three, matches.three)) { - return test_fail("Bad match three\n"); - } else if (!lv2_atom_equals((LV2_Atom*)four, matches.four)) { - return test_fail("Bad match four\n"); - } else if (!lv2_atom_equals((LV2_Atom*)t, matches.affirmative)) { - return test_fail("Bad match true\n"); - } else if (!lv2_atom_equals((LV2_Atom*)f, matches.negative)) { - return test_fail("Bad match false\n"); - } else if (!lv2_atom_equals((LV2_Atom*)path, matches.path)) { - return test_fail("Bad match path\n"); - } else if (!lv2_atom_equals((LV2_Atom*)uri, matches.uri)) { - return test_fail("Bad match URI\n"); - } else if (!lv2_atom_equals((LV2_Atom*)string, matches.string)) { - return test_fail("Bad match string\n"); - } else if (!lv2_atom_equals((LV2_Atom*)literal, matches.literal)) { - return test_fail("Bad match literal\n"); - } else if (!lv2_atom_equals((LV2_Atom*)tuple, matches.tuple)) { - return test_fail("Bad match tuple\n"); - } else if (!lv2_atom_equals((LV2_Atom*)vector, matches.vector)) { - return test_fail("Bad match vector\n"); - } else if (!lv2_atom_equals((LV2_Atom*)vector, matches.vector2)) { - return test_fail("Bad match vector2\n"); - } else if (!lv2_atom_equals((LV2_Atom*)seq, matches.seq)) { - return test_fail("Bad match sequence\n"); - } - memset(&matches, 0, sizeof(matches)); - - // clang-format off - n_matches = lv2_atom_object_get((LV2_Atom_Object*)obj, - eg_one, &matches.one, - eg_two, &matches.two, - eg_three, &matches.three, - eg_four, &matches.four, - eg_true, &matches.affirmative, - eg_false, &matches.negative, - eg_path, &matches.path, - eg_uri, &matches.uri, - eg_urid, &matches.urid, - eg_string, &matches.string, - eg_literal, &matches.literal, - eg_tuple, &matches.tuple, - eg_vector, &matches.vector, - eg_vector2, &matches.vector2, - eg_seq, &matches.seq, - 0); - // clang-format on - } - - free_urid_map(); - - return 0; -} diff --git a/lv2/atom/atom.h b/lv2/atom/atom.h deleted file mode 100644 index b090c1e..0000000 --- a/lv2/atom/atom.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_ATOM_H -#define LV2_ATOM_H - -/** - @defgroup atom Atom - @ingroup lv2 - - A generic value container and several data types. - - See for details. - - @{ -*/ - -#include - -// clang-format off - -#define LV2_ATOM_URI "http://lv2plug.in/ns/ext/atom" ///< http://lv2plug.in/ns/ext/atom -#define LV2_ATOM_PREFIX LV2_ATOM_URI "#" ///< http://lv2plug.in/ns/ext/atom# - -#define LV2_ATOM__Atom LV2_ATOM_PREFIX "Atom" ///< http://lv2plug.in/ns/ext/atom#Atom -#define LV2_ATOM__AtomPort LV2_ATOM_PREFIX "AtomPort" ///< http://lv2plug.in/ns/ext/atom#AtomPort -#define LV2_ATOM__Blank LV2_ATOM_PREFIX "Blank" ///< http://lv2plug.in/ns/ext/atom#Blank -#define LV2_ATOM__Bool LV2_ATOM_PREFIX "Bool" ///< http://lv2plug.in/ns/ext/atom#Bool -#define LV2_ATOM__Chunk LV2_ATOM_PREFIX "Chunk" ///< http://lv2plug.in/ns/ext/atom#Chunk -#define LV2_ATOM__Double LV2_ATOM_PREFIX "Double" ///< http://lv2plug.in/ns/ext/atom#Double -#define LV2_ATOM__Event LV2_ATOM_PREFIX "Event" ///< http://lv2plug.in/ns/ext/atom#Event -#define LV2_ATOM__Float LV2_ATOM_PREFIX "Float" ///< http://lv2plug.in/ns/ext/atom#Float -#define LV2_ATOM__Int LV2_ATOM_PREFIX "Int" ///< http://lv2plug.in/ns/ext/atom#Int -#define LV2_ATOM__Literal LV2_ATOM_PREFIX "Literal" ///< http://lv2plug.in/ns/ext/atom#Literal -#define LV2_ATOM__Long LV2_ATOM_PREFIX "Long" ///< http://lv2plug.in/ns/ext/atom#Long -#define LV2_ATOM__Number LV2_ATOM_PREFIX "Number" ///< http://lv2plug.in/ns/ext/atom#Number -#define LV2_ATOM__Object LV2_ATOM_PREFIX "Object" ///< http://lv2plug.in/ns/ext/atom#Object -#define LV2_ATOM__Path LV2_ATOM_PREFIX "Path" ///< http://lv2plug.in/ns/ext/atom#Path -#define LV2_ATOM__Property LV2_ATOM_PREFIX "Property" ///< http://lv2plug.in/ns/ext/atom#Property -#define LV2_ATOM__Resource LV2_ATOM_PREFIX "Resource" ///< http://lv2plug.in/ns/ext/atom#Resource -#define LV2_ATOM__Sequence LV2_ATOM_PREFIX "Sequence" ///< http://lv2plug.in/ns/ext/atom#Sequence -#define LV2_ATOM__Sound LV2_ATOM_PREFIX "Sound" ///< http://lv2plug.in/ns/ext/atom#Sound -#define LV2_ATOM__String LV2_ATOM_PREFIX "String" ///< http://lv2plug.in/ns/ext/atom#String -#define LV2_ATOM__Tuple LV2_ATOM_PREFIX "Tuple" ///< http://lv2plug.in/ns/ext/atom#Tuple -#define LV2_ATOM__URI LV2_ATOM_PREFIX "URI" ///< http://lv2plug.in/ns/ext/atom#URI -#define LV2_ATOM__URID LV2_ATOM_PREFIX "URID" ///< http://lv2plug.in/ns/ext/atom#URID -#define LV2_ATOM__Vector LV2_ATOM_PREFIX "Vector" ///< http://lv2plug.in/ns/ext/atom#Vector -#define LV2_ATOM__atomTransfer LV2_ATOM_PREFIX "atomTransfer" ///< http://lv2plug.in/ns/ext/atom#atomTransfer -#define LV2_ATOM__beatTime LV2_ATOM_PREFIX "beatTime" ///< http://lv2plug.in/ns/ext/atom#beatTime -#define LV2_ATOM__bufferType LV2_ATOM_PREFIX "bufferType" ///< http://lv2plug.in/ns/ext/atom#bufferType -#define LV2_ATOM__childType LV2_ATOM_PREFIX "childType" ///< http://lv2plug.in/ns/ext/atom#childType -#define LV2_ATOM__eventTransfer LV2_ATOM_PREFIX "eventTransfer" ///< http://lv2plug.in/ns/ext/atom#eventTransfer -#define LV2_ATOM__frameTime LV2_ATOM_PREFIX "frameTime" ///< http://lv2plug.in/ns/ext/atom#frameTime -#define LV2_ATOM__supports LV2_ATOM_PREFIX "supports" ///< http://lv2plug.in/ns/ext/atom#supports -#define LV2_ATOM__timeUnit LV2_ATOM_PREFIX "timeUnit" ///< http://lv2plug.in/ns/ext/atom#timeUnit - -// clang-format on - -#define LV2_ATOM_REFERENCE_TYPE 0 ///< The special type for a reference atom - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond */ -/** This expression will fail to compile if double does not fit in 64 bits. */ -typedef char lv2_atom_assert_double_fits_in_64_bits - [((sizeof(double) <= sizeof(uint64_t)) * 2) - 1]; -/** @endcond */ - -/** - Return a pointer to the contents of an Atom. The "contents" of an atom - is the data past the complete type-specific header. - @param type The type of the atom, for example LV2_Atom_String. - @param atom A variable-sized atom. -*/ -#define LV2_ATOM_CONTENTS(type, atom) ((void*)((uint8_t*)(atom) + sizeof(type))) - -/** - Const version of LV2_ATOM_CONTENTS. -*/ -#define LV2_ATOM_CONTENTS_CONST(type, atom) \ - ((const void*)((const uint8_t*)(atom) + sizeof(type))) - -/** - Return a pointer to the body of an Atom. The "body" of an atom is the - data just past the LV2_Atom head (i.e. the same offset for all types). -*/ -#define LV2_ATOM_BODY(atom) LV2_ATOM_CONTENTS(LV2_Atom, atom) - -/** - Const version of LV2_ATOM_BODY. -*/ -#define LV2_ATOM_BODY_CONST(atom) LV2_ATOM_CONTENTS_CONST(LV2_Atom, atom) - -/** The header of an atom:Atom. */ -typedef struct { - uint32_t size; /**< Size in bytes, not including type and size. */ - uint32_t type; /**< Type of this atom (mapped URI). */ -} LV2_Atom; - -/** An atom:Int or atom:Bool. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - int32_t body; /**< Integer value. */ -} LV2_Atom_Int; - -/** An atom:Long. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - int64_t body; /**< Integer value. */ -} LV2_Atom_Long; - -/** An atom:Float. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - float body; /**< Floating point value. */ -} LV2_Atom_Float; - -/** An atom:Double. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - double body; /**< Floating point value. */ -} LV2_Atom_Double; - -/** An atom:Bool. May be cast to LV2_Atom. */ -typedef LV2_Atom_Int LV2_Atom_Bool; - -/** An atom:URID. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - uint32_t body; /**< URID. */ -} LV2_Atom_URID; - -/** An atom:String. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - /* Contents (a null-terminated UTF-8 string) follow here. */ -} LV2_Atom_String; - -/** The body of an atom:Literal. */ -typedef struct { - uint32_t datatype; /**< Datatype URID. */ - uint32_t lang; /**< Language URID. */ - /* Contents (a null-terminated UTF-8 string) follow here. */ -} LV2_Atom_Literal_Body; - -/** An atom:Literal. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - LV2_Atom_Literal_Body body; /**< Body. */ -} LV2_Atom_Literal; - -/** An atom:Tuple. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - /* Contents (a series of complete atoms) follow here. */ -} LV2_Atom_Tuple; - -/** The body of an atom:Vector. */ -typedef struct { - uint32_t child_size; /**< The size of each element in the vector. */ - uint32_t child_type; /**< The type of each element in the vector. */ - /* Contents (a series of packed atom bodies) follow here. */ -} LV2_Atom_Vector_Body; - -/** An atom:Vector. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - LV2_Atom_Vector_Body body; /**< Body. */ -} LV2_Atom_Vector; - -/** The body of an atom:Property (typically in an atom:Object). */ -typedef struct { - uint32_t key; /**< Key (predicate) (mapped URI). */ - uint32_t context; /**< Context URID (may be, and generally is, 0). */ - LV2_Atom value; /**< Value atom header. */ - /* Value atom body follows here. */ -} LV2_Atom_Property_Body; - -/** An atom:Property. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - LV2_Atom_Property_Body body; /**< Body. */ -} LV2_Atom_Property; - -/** The body of an atom:Object. May be cast to LV2_Atom. */ -typedef struct { - uint32_t id; /**< URID, or 0 for blank. */ - uint32_t otype; /**< Type URID (same as rdf:type, for fast dispatch). */ - /* Contents (a series of property bodies) follow here. */ -} LV2_Atom_Object_Body; - -/** An atom:Object. May be cast to LV2_Atom. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - LV2_Atom_Object_Body body; /**< Body. */ -} LV2_Atom_Object; - -/** The header of an atom:Event. Note this type is NOT an LV2_Atom. */ -typedef struct { - /** Time stamp. Which type is valid is determined by context. */ - union { - int64_t frames; /**< Time in audio frames. */ - double beats; /**< Time in beats. */ - } time; - LV2_Atom body; /**< Event body atom header. */ - /* Body atom contents follow here. */ -} LV2_Atom_Event; - -/** - The body of an atom:Sequence (a sequence of events). - - The unit field is either a URID that described an appropriate time stamp - type, or may be 0 where a default stamp type is known. For - LV2_Descriptor::run(), the default stamp type is audio frames. - - The contents of a sequence is a series of LV2_Atom_Event, each aligned - to 64-bits, for example: -
-   | Event 1 (size 6)                              | Event 2
-   |       |       |       |       |       |       |       |       |
-   | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
-   |FRAMES         |TYPE   |SIZE   |DATADATADATAPAD|FRAMES         |...
-   
-*/ -typedef struct { - uint32_t unit; /**< URID of unit of event time stamps. */ - uint32_t pad; /**< Currently unused. */ - /* Contents (a series of events) follow here. */ -} LV2_Atom_Sequence_Body; - -/** An atom:Sequence. */ -typedef struct { - LV2_Atom atom; /**< Atom header. */ - LV2_Atom_Sequence_Body body; /**< Body. */ -} LV2_Atom_Sequence; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_ATOM_H */ diff --git a/lv2/atom/atom.meta.ttl b/lv2/atom/atom.meta.ttl deleted file mode 100644 index adab5f4..0000000 --- a/lv2/atom/atom.meta.ttl +++ /dev/null @@ -1,552 +0,0 @@ -@prefix atom: . -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Atom" ; - doap:shortdesc "A generic value container and several data types." ; - doap:license ; - doap:created "2007-00-00" ; - doap:developer ; - doap:release [ - doap:revision "2.4" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] - ] - ] , [ - doap:revision "2.2" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2_atom_object_get_typed() for easy type-safe access to object properties." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2014-08-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Deprecate Blank and Resource in favour of just Object." - ] , [ - rdfs:label "Add lv2_atom_forge_is_object_type() and lv2_atom_forge_is_blank() to ease backwards compatibility." - ] , [ - rdfs:label "Add lv2_atom_forge_key() for terser object writing." - ] , [ - rdfs:label "Add lv2_atom_sequence_clear() and lv2_atom_sequence_append_event() helper functions." - ] - ] - ] , [ - doap:revision "1.8" ; - doap:created "2014-01-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Make lv2_atom_*_is_end() arguments const." - ] - ] - ] , [ - doap:revision "1.6" ; - doap:created "2013-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix crash in forge.h when pushing atoms to a full buffer." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2013-01-27" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix lv2_atom_sequence_end()." - ] , [ - rdfs:label "Remove atom:stringType in favour of owl:onDatatype so generic tools can understand and validate atom literals." - ] , [ - rdfs:label "Improve atom documentation." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix implicit conversions in forge.h that are invalid in C++11." - ] , [ - rdfs:label "Fix lv2_atom_object_next() on 32-bit platforms." - ] , [ - rdfs:label "Add lv2_atom_object_body_get()." - ] , [ - rdfs:label "Fix outdated documentation in forge.h." - ] , [ - rdfs:label "Use consistent label style." - ] , [ - rdfs:label "Add LV2_ATOM_CONTENTS_CONST and LV2_ATOM_BODY_CONST." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -An atom:Atom is a simple generic data container for holding any type of Plain -Old Data (POD). An Atom can contain simple primitive types like integers, -floating point numbers, and strings; as well as structured data like lists and -dictionary-like Objects. Since Atoms are POD, they can be easily copied -(for example, with `memcpy()`) anywhere and are suitable for use in real-time -code. - -Every atom starts with an LV2_Atom header, followed by the contents. This -allows code to process atoms without requiring special code for every type of -data. For example, plugins that mutually understand a type can be used -together in a host that does not understand that type, because the host is only -required to copy atoms, not interpret their contents. Similarly, plugins (such -as routers, delays, or data structures) can meaningfully process atoms of a -type unknown to them. - -Atoms should be used anywhere values of various types must be stored or -transmitted. An atom:AtomPort can be used to transmit atoms via ports. An -atom:AtomPort that contains a atom:Sequence can be used for sample accurate -communication of events, such as MIDI. - -### Serialisation - -Each Atom type defines a binary format for use at runtime, but also a -serialisation that is natural to express in Turtle format. Thus, this -specification defines a powerful real-time appropriate data model, as well as a -portable way to serialise any data in that model. This is particularly useful -for inter-process communication, saving/restoring state, and describing values -in plugin data files. - -### Custom Atom Types - -While it is possible to define new Atom types for any binary format, the -standard types defined here are powerful enough to describe almost anything. -Implementations SHOULD build structures out of the types provided here, rather -than define new binary formats (for example, using atom:Object rather than a -new C `struct` type). Host and tool implementations have support for -serialising all standard types, so new binary formats are an implementation -burden which harms interoperabilty. In particular, plugins SHOULD NOT expect -UI communication or state saving with custom binary types to work. In general, -new Atom types should only be defined where absolutely necessary due to -performance reasons and serialisation is not a concern. - -"""^^lv2:Markdown . - -atom:Atom - lv2:documentation """ - -An LV2_Atom has a 32-bit `size` and `type`, followed by a body of `size` bytes. -Atoms MUST be 64-bit aligned. - -All concrete Atom types (subclasses of this class) MUST define a precise binary -layout for their body. - -The `type` field is the URI of an Atom type mapped to an integer. -Implementations SHOULD gracefully pass through, or ignore, atoms with unknown -types. - -All atoms are POD by definition except references, which as a special case have -`type` 0. An Atom MUST NOT contain a Reference. It is safe to copy any -non-reference Atom with a simple `memcpy`, even if the implementation does not -understand `type`. Though this extension reserves the type 0 for references, -the details of reference handling are currently unspecified. A future revision -of this extension, or a different extension, may define how to use non-POD data -and references. Implementations MUST NOT send references to another -implementation unless the receiver is explicitly known to support references -(e.g. by supporting a feature). - -The special case of a null atom with both `type` and `size` 0 is not considered -a reference. - -"""^^lv2:Markdown . - -atom:Chunk - lv2:documentation """ - -This type is used to indicate a certain amount of space is available. For -example, output ports with a variably sized type are connected to a Chunk so -the plugin knows the size of the buffer available for writing. - -The use of a Chunk should be constrained to a local scope, since -interpreting it is impossible without context. However, if serialised to RDF, -a Chunk may be represented directly as an xsd:base64Binary string, for example: - - :::turtle - [] eg:someChunk "vu/erQ=="^^xsd:base64Binary . - -"""^^lv2:Markdown . - -atom:String - lv2:documentation """ - -The body of an LV2_Atom_String is a C string in UTF-8 encoding, i.e. an array -of bytes (`uint8_t`) terminated with a NULL byte (`'\\0'`). - -This type is for free-form strings, but SHOULD NOT be used for typed data or -text in any language. Use atom:Literal unless translating the string does not -make sense and the string has no meaningful datatype. - -"""^^lv2:Markdown . - -atom:Literal - lv2:documentation """ - -This type is compatible with rdfs:Literal and is capable of expressing a -string in any language or a value of any type. A Literal has a -`datatype` and `lang` followed by string data in UTF-8 -encoding. The length of the string data in bytes is `size - -sizeof(LV2_Atom_Literal)`, including the terminating NULL character. The -`lang` field SHOULD be a URI of the form -`http://lexvo.org/id/iso639-3/LANG` or -`http://lexvo.org/id/iso639-1/LANG` where LANG is a 3-character ISO 693-3 -language code, or a 2-character ISO 693-1 language code, respectively. - -A Literal may have a `datatype` or a `lang`, but never both. - -For example, a Literal can be Hello in English: - - :::c - void set_to_hello_in_english(LV2_Atom_Literal* lit) { - lit->atom.type = map(expand("atom:Literal")); - lit->atom.size = 14; - lit->body.datatype = 0; - lit->body.lang = map("http://lexvo.org/id/iso639-1/en"); - memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit), - "Hello", - sizeof("Hello")); // Assumes enough space - } - -or a Turtle string: - - :::c - void set_to_turtle_string(LV2_Atom_Literal* lit, const char* ttl) { - lit->atom.type = map(expand("atom:Literal")); - lit->atom.size = 64; - lit->body.datatype = map("http://www.w3.org/2008/turtle#turtle"); - lit->body.lang = 0; - memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit), - ttl, - strlen(ttl) + 1); // Assumes enough space - } - -"""^^lv2:Markdown . - -atom:Path - lv2:documentation """ - -A Path is a URI reference with only a path component: no scheme, authority, -query, or fragment. In particular, paths to files in the same bundle may be -cleanly written in Turtle files as a relative URI. However, implementations -may assume any binary Path (e.g. in an event payload) is a valid file path -which can passed to system functions like fopen() directly, without any -character encoding or escape expansion required. - -Any implementation that creates a Path atom to transmit to another is -responsible for ensuring it is valid. A Path SHOULD always be absolute, unless -there is some mechanism in place that defines a base path. Since this is not -the case for plugin instances, effectively any Path sent to or received from a -plugin instance MUST be absolute. - -"""^^lv2:Markdown . - -atom:URI - lv2:documentation """ - -This is useful when a URI is needed but mapping is inappropriate, for example -with temporary or relative URIs. Since the ability to distinguish URIs from -plain strings is often necessary, URIs MUST NOT be transmitted as atom:String. - -This is not strictly a URI, since UTF-8 is allowed. Escaping and related -issues are the host's responsibility. - -"""^^lv2:Markdown . - -atom:URID - lv2:documentation """ - -A URID is typically generated with the LV2_URID_Map provided by the host . - -"""^^lv2:Markdown . - -atom:Vector - lv2:documentation """ - -A homogeneous series of atom bodies with equivalent type and size. - -An LV2_Atom_Vector is a 32-bit `child_size` and `child_type` followed by `size -/ child_size` atom bodies. - -For example, an atom:Vector containing 42 elements of type atom:Float: - - :::c - struct VectorOf42Floats { - uint32_t size; // sizeof(LV2_Atom_Vector_Body) + (42 * sizeof(float); - uint32_t type; // map(expand("atom:Vector")) - uint32_t child_size; // sizeof(float) - uint32_t child_type; // map(expand("atom:Float")) - float elems[42]; - }; - -Note that it is possible to construct a valid Atom for each element of the -vector, even by an implementation which does not understand `child_type`. - -If serialised to RDF, a Vector SHOULD have the form: - - :::turtle - eg:someVector - a atom:Vector ; - atom:childType atom:Int ; - rdf:value ( - "1"^^xsd:int - "2"^^xsd:int - "3"^^xsd:int - "4"^^xsd:int - ) . - -"""^^lv2:Markdown . - -atom:Tuple - lv2:documentation """ - -The body of a Tuple is simply a series of complete atoms, each aligned to -64 bits. - -If serialised to RDF, a Tuple SHOULD have the form: - - :::turtle - eg:someVector - a atom:Tuple ; - rdf:value ( - "1"^^xsd:int - "3.5"^^xsd:float - "etc" - ) . - -"""^^lv2:Markdown . - -atom:Property - lv2:documentation """ - -An LV2_Atom_Property has a URID `key` and `context`, and an Atom `value`. This -corresponds to an RDF Property, where the key is the predicate -and the value is the object. - -The `context` field can be used to specify a different context for each -property, where this is useful. Otherwise, it may be 0. - -Properties generally only exist as part of an atom:Object. Accordingly, -they will typically be represented directly as properties in RDF (see -atom:Object). If this is not possible, they may be expressed as partial -reified statements, for example: - - :::turtle - eg:someProperty - rdf:predicate eg:theKey ; - rdf:object eg:theValue . - -"""^^lv2:Markdown . - -atom:Object - lv2:documentation """ - -An Object is an atom with a set of properties. This corresponds to an -RDF Resource, and can be thought of as a dictionary with URID keys. - -An LV2_Atom_Object body has a uint32_t `id` and `type`, followed by a series of -atom:Property bodies (LV2_Atom_Property_Body). The LV2_Atom_Object_Body::otype -field is equivalent to a property with key rdf:type, but is included in the -structure to allow for fast dispatching. - -Code SHOULD check for objects using lv2_atom_forge_is_object() or -lv2_atom_forge_is_blank() if a forge is available, rather than checking the -atom type directly. This will correctly handle the deprecated atom:Resource -and atom:Blank types. - -When serialised to RDF, an Object is represented as a resource, for example: - - :::turtle - eg:someObject - eg:firstPropertyKey "first property value" ; - eg:secondPropertyKey "first loser" ; - eg:andSoOn "and so on" . - -"""^^lv2:Markdown . - -atom:Resource - lv2:documentation """ - -This class is deprecated. Use atom:Object directly instead. - -An atom:Object where the id field is a URID, that is, an Object -with a URI. - -"""^^lv2:Markdown . - -atom:Blank - lv2:documentation """ - -This class is deprecated. Use atom:Object with ID 0 instead. - -An atom:Object where the LV2_Atom_Object::id is a blank node ID (NOT a URI). -The ID of a Blank is valid only within the context the Blank appears in. For -ports this is the context of the associated run() call, i.e. all ports share -the same context so outputs can contain IDs that correspond to IDs of blanks in -the input. - -"""^^lv2:Markdown . - -atom:Sound - lv2:documentation """ - -The format of a atom:Sound is the same as the buffer format for lv2:AudioPort -(except the size may be arbitrary). An atom:Sound inherently depends on the -sample rate, which is assumed to be known from context. Because of this, -directly serialising an atom:Sound is probably a bad idea, use a standard -format like WAV instead. - -"""^^lv2:Markdown . - -atom:Event - lv2:documentation """ - -An Event is typically an element of an atom:Sequence. Note that this is not an Atom type since it begins with a timestamp, not an atom header. - -"""^^lv2:Markdown . - -atom:Sequence - lv2:documentation """ - -A flat sequence of atom:Event, that is, a series of time-stamped Atoms. - -LV2_Atom_Sequence_Body.unit describes the time unit for the contained atoms. -If the unit is known from context (e.g. run() stamps are always audio frames), -this field may be zero. Otherwise, it SHOULD be either units:frame or -units:beat, in which case ev.time.frames or ev.time.beats is valid, -respectively. - -If serialised to RDF, a Sequence has a similar form to atom:Vector, but for -brevity the elements may be assumed to be atom:Event, for example: - - :::turtle - eg:someSequence - a atom:Sequence ; - rdf:value ( - [ - atom:frameTime 1 ; - rdf:value "901A01"^^midi:MidiEvent - ] [ - atom:frameTime 3 ; - rdf:value "902B02"^^midi:MidiEvent - ] - ) . - -"""^^lv2:Markdown . - -atom:AtomPort - lv2:documentation """ - -Ports of this type are connected to an LV2_Atom with a type specified by -atom:bufferType. - -Output ports with a variably sized type MUST be initialised by the host before -every run() to an atom:Chunk with size set to the available space. The plugin -reads this size to know how much space is available for writing. In all cases, -the plugin MUST write a complete atom (including header) to outputs. However, -to be robust, hosts SHOULD initialise output ports to a safe sentinel (e.g. the -null Atom) before calling run(). - -"""^^lv2:Markdown . - -atom:bufferType - lv2:documentation """ - -Indicates that an AtomPort may be connected to a certain Atom type. A port MAY -support several buffer types. The host MUST NOT connect a port to an Atom with -a type not explicitly listed with this property. The value of this property -MUST be a sub-class of atom:Atom. For example, an input port that is connected -directly to an LV2_Atom_Double value is described like so: - - :::turtle - - lv2:port [ - a lv2:InputPort , atom:AtomPort ; - atom:bufferType atom:Double ; - ] . - -This property only describes the types a port may be directly connected to. It -says nothing about the expected contents of containers. For that, use -atom:supports. - -"""^^lv2:Markdown . - -atom:supports - lv2:documentation """ - -This property is defined loosely, it may be used to indicate that anything -supports an Atom type, wherever that may be useful. It applies -recursively where collections are involved. - -In particular, this property can be used to describe which event types are -expected by a port. For example, a port that receives MIDI events is described -like so: - - :::turtle - - lv2:port [ - a lv2:InputPort , atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports midi:MidiEvent ; - ] . - -"""^^lv2:Markdown . - -atom:eventTransfer - lv2:documentation """ - -Transfer of individual events in a port buffer. Useful as the `format` for a -LV2UI_Write_Function. - -This protocol applies to ports which contain events, usually in an -atom:Sequence. The host must transfer each individual event to the recipient. -The format of the received data is an LV2_Atom, there is no timestamp header. - -"""^^lv2:Markdown . - -atom:atomTransfer - lv2:documentation """ - -Transfer of the complete atom in a port buffer. Useful as the `format` for a -LV2UI_Write_Function. - -This protocol applies to atom ports. The host must transfer the complete atom -contained in the port, including header. - -"""^^lv2:Markdown . - diff --git a/lv2/atom/atom.ttl b/lv2/atom/atom.ttl deleted file mode 100644 index ef221ad..0000000 --- a/lv2/atom/atom.ttl +++ /dev/null @@ -1,250 +0,0 @@ -@prefix atom: . -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix ui: . -@prefix units: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:seeAlso , - , - , - ; - rdfs:label "LV2 Atom" ; - rdfs:comment "A generic value container and several data types." ; - owl:imports , - , - . - -atom:cType - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "C type" ; - rdfs:comment "The C type that describes the binary representation of an Atom type." ; - rdfs:domain rdfs:Class ; - rdfs:range lv2:Symbol . - -atom:Atom - a rdfs:Class ; - rdfs:label "Atom" ; - rdfs:comment "Abstract base class for all atoms." ; - atom:cType "LV2_Atom" . - -atom:Chunk - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Chunk" ; - rdfs:comment "A chunk of memory with undefined contents." ; - owl:onDatatype xsd:base64Binary . - -atom:Number - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Number" ; - rdfs:comment "Base class for numeric types." . - -atom:Int - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Number ; - rdfs:label "Int" ; - rdfs:comment "A native `int32_t`." ; - atom:cType "LV2_Atom_Int" ; - owl:onDatatype xsd:int . - -atom:Long - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Number ; - rdfs:label "Long" ; - rdfs:comment "A native `int64_t`." ; - atom:cType "LV2_Atom_Long" ; - owl:onDatatype xsd:long . - -atom:Float - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Number ; - rdfs:label "Float" ; - rdfs:comment "A native `float`." ; - atom:cType "LV2_Atom_Float" ; - owl:onDatatype xsd:float . - -atom:Double - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Number ; - rdfs:label "Double" ; - rdfs:comment "A native `double`." ; - atom:cType "LV2_Atom_Double" ; - owl:onDatatype xsd:double . - -atom:Bool - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Bool" ; - rdfs:comment "An atom:Int where 0 is false and any other value is true." ; - atom:cType "LV2_Atom_Bool" ; - owl:onDatatype xsd:boolean . - -atom:String - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:Atom ; - rdfs:label "String" ; - rdfs:comment "A UTF-8 string." ; - atom:cType "LV2_Atom_String" ; - owl:onDatatype xsd:string . - -atom:Literal - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Literal" ; - rdfs:comment "A UTF-8 string literal with optional datatype or language." ; - atom:cType "LV2_Atom_Literal" . - -atom:Path - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:URI ; - owl:onDatatype atom:URI ; - rdfs:label "Path" ; - rdfs:comment "A local file path." . - -atom:URI - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf atom:String ; - owl:onDatatype xsd:anyURI ; - rdfs:label "URI" ; - rdfs:comment "A URI string." . - -atom:URID - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "URID" ; - rdfs:comment "An unsigned 32-bit integer ID for a URI." ; - atom:cType "LV2_Atom_URID" . - -atom:Vector - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Vector" ; - rdfs:comment "A homogeneous sequence of atom bodies with equivalent type and size." ; - atom:cType "LV2_Atom_Vector" . - -atom:Tuple - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Tuple" ; - rdfs:comment "A sequence of atoms with varying type and size." . - -atom:Property - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Property" ; - rdfs:comment "A property of an atom:Object." ; - atom:cType "LV2_Atom_Property" . - -atom:Object - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Object" ; - rdfs:comment "A collection of properties." ; - atom:cType "LV2_Atom_Object" . - -atom:Resource - a rdfs:Class ; - rdfs:subClassOf atom:Object ; - rdfs:label "Resource" ; - rdfs:comment "A named collection of properties with a URI." ; - owl:deprecated "true"^^xsd:boolean ; - atom:cType "LV2_Atom_Object" . - -atom:Blank - a rdfs:Class ; - rdfs:subClassOf atom:Object ; - rdfs:label "Blank" ; - rdfs:comment "An anonymous collection of properties without a URI." ; - owl:deprecated "true"^^xsd:boolean ; - atom:cType "LV2_Atom_Object" . - -atom:Sound - a rdfs:Class ; - rdfs:subClassOf atom:Vector ; - rdfs:label "Sound" ; - rdfs:comment "A atom:Vector of atom:Float which represents an audio waveform." ; - atom:cType "LV2_Atom_Vector" . - -atom:frameTime - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:range xsd:decimal ; - rdfs:label "frame time" ; - rdfs:comment "A time stamp in audio frames." . - -atom:beatTime - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:range xsd:decimal ; - rdfs:label "beat time" ; - rdfs:comment "A time stamp in beats." . - -atom:Event - a rdfs:Class ; - rdfs:label "Event" ; - atom:cType "LV2_Atom_Event" ; - rdfs:comment "An atom with a time stamp prefix in a sequence." . - -atom:Sequence - a rdfs:Class ; - rdfs:subClassOf atom:Atom ; - rdfs:label "Sequence" ; - atom:cType "LV2_Atom_Sequence" ; - rdfs:comment "A sequence of events." . - -atom:AtomPort - a rdfs:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Atom Port" ; - rdfs:comment "A port which contains an atom:Atom." . - -atom:bufferType - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain atom:AtomPort ; - rdfs:range rdfs:Class ; - rdfs:label "buffer type" ; - rdfs:comment "An atom type that a port may be connected to." . - -atom:childType - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "child type" ; - rdfs:comment "The type of children in a container." . - -atom:supports - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "supports" ; - rdfs:comment "A supported atom type." ; - rdfs:range rdfs:Class . - -atom:eventTransfer - a ui:PortProtocol ; - rdfs:label "event transfer" ; - rdfs:comment "A port protocol for transferring events." . - -atom:atomTransfer - a ui:PortProtocol ; - rdfs:label "atom transfer" ; - rdfs:comment "A port protocol for transferring atoms." . - diff --git a/lv2/atom/forge-overflow-test.c b/lv2/atom/forge-overflow-test.c deleted file mode 100644 index 27f3497..0000000 --- a/lv2/atom/forge-overflow-test.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - Copyright 2019 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#include "lv2/atom/atom-test-utils.c" -#include "lv2/atom/atom.h" -#include "lv2/atom/forge.h" -#include "lv2/urid/urid.h" - -#include -#include -#include - -static int -test_string_overflow(void) -{ -#define MAX_CHARS 15 - - static const size_t capacity = sizeof(LV2_Atom_String) + MAX_CHARS + 1; - static const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - - uint8_t* buf = (uint8_t*)malloc(capacity); - LV2_URID_Map map = {NULL, urid_map}; - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - - // Check that writing increasingly long strings fails at the right point - for (unsigned count = 0; count < MAX_CHARS; ++count) { - lv2_atom_forge_set_buffer(&forge, buf, capacity); - - const LV2_Atom_Forge_Ref ref = lv2_atom_forge_string(&forge, str, count); - if (!ref) { - return test_fail("Failed to write %u byte string\n", count); - } - } - - // Failure writing to an exactly full forge - if (lv2_atom_forge_string(&forge, str, MAX_CHARS + 1)) { - return test_fail("Successfully wrote past end of buffer\n"); - } - - // Failure writing body after successfully writing header - lv2_atom_forge_set_buffer(&forge, buf, sizeof(LV2_Atom) + 1); - if (lv2_atom_forge_string(&forge, "AB", 2)) { - return test_fail("Successfully wrote atom header past end\n"); - } - - free(buf); - return 0; -} - -static int -test_literal_overflow(void) -{ - static const size_t capacity = sizeof(LV2_Atom_Literal) + 2; - - uint8_t* buf = (uint8_t*)malloc(capacity); - LV2_URID_Map map = {NULL, urid_map}; - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - - // Failure in atom header - lv2_atom_forge_set_buffer(&forge, buf, 1); - if (lv2_atom_forge_literal(&forge, "A", 1, 0, 0)) { - return test_fail("Successfully wrote atom header past end\n"); - } - - // Failure in literal header - lv2_atom_forge_set_buffer(&forge, buf, sizeof(LV2_Atom) + 1); - if (lv2_atom_forge_literal(&forge, "A", 1, 0, 0)) { - return test_fail("Successfully wrote literal header past end\n"); - } - - // Success (only room for one character + null terminator) - lv2_atom_forge_set_buffer(&forge, buf, capacity); - if (!lv2_atom_forge_literal(&forge, "A", 1, 0, 0)) { - return test_fail("Failed to write small enough literal\n"); - } - - // Failure in body - lv2_atom_forge_set_buffer(&forge, buf, capacity); - if (lv2_atom_forge_literal(&forge, "AB", 2, 0, 0)) { - return test_fail("Successfully wrote literal body past end\n"); - } - - free(buf); - return 0; -} - -static int -test_sequence_overflow(void) -{ - static const size_t size = sizeof(LV2_Atom_Sequence) + 6 * sizeof(LV2_Atom); - LV2_URID_Map map = {NULL, urid_map}; - - // Test over a range that fails in the sequence header and event components - for (size_t capacity = 1; capacity < size; ++capacity) { - uint8_t* buf = (uint8_t*)malloc(capacity); - - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - lv2_atom_forge_set_buffer(&forge, buf, capacity); - - LV2_Atom_Forge_Frame frame; - LV2_Atom_Forge_Ref ref = lv2_atom_forge_sequence_head(&forge, &frame, 0); - - assert(capacity >= sizeof(LV2_Atom_Sequence) || !frame.ref); - assert(capacity >= sizeof(LV2_Atom_Sequence) || !ref); - (void)ref; - - lv2_atom_forge_frame_time(&forge, 0); - lv2_atom_forge_int(&forge, 42); - lv2_atom_forge_pop(&forge, &frame); - - free(buf); - } - - return 0; -} - -static int -test_vector_head_overflow(void) -{ - static const size_t size = sizeof(LV2_Atom_Vector) + 3 * sizeof(LV2_Atom); - LV2_URID_Map map = {NULL, urid_map}; - - // Test over a range that fails in the vector header and elements - for (size_t capacity = 1; capacity < size; ++capacity) { - uint8_t* buf = (uint8_t*)malloc(capacity); - - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - lv2_atom_forge_set_buffer(&forge, buf, capacity); - - LV2_Atom_Forge_Frame frame; - LV2_Atom_Forge_Ref ref = - lv2_atom_forge_vector_head(&forge, &frame, sizeof(int32_t), forge.Int); - - assert(capacity >= sizeof(LV2_Atom_Vector) || !frame.ref); - assert(capacity >= sizeof(LV2_Atom_Vector) || !ref); - (void)ref; - - lv2_atom_forge_int(&forge, 1); - lv2_atom_forge_int(&forge, 2); - lv2_atom_forge_int(&forge, 3); - lv2_atom_forge_pop(&forge, &frame); - - free(buf); - } - - return 0; -} - -static int -test_vector_overflow(void) -{ - static const size_t size = sizeof(LV2_Atom_Vector) + 3 * sizeof(LV2_Atom); - static const int32_t vec[] = {1, 2, 3}; - LV2_URID_Map map = {NULL, urid_map}; - - // Test over a range that fails in the vector header and elements - for (size_t capacity = 1; capacity < size; ++capacity) { - uint8_t* buf = (uint8_t*)malloc(capacity); - - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - lv2_atom_forge_set_buffer(&forge, buf, capacity); - - LV2_Atom_Forge_Ref ref = - lv2_atom_forge_vector(&forge, sizeof(int32_t), forge.Int, 3, vec); - - assert(capacity >= sizeof(LV2_Atom_Vector) || !ref); - (void)ref; - - free(buf); - } - - return 0; -} - -static int -test_tuple_overflow(void) -{ - static const size_t size = sizeof(LV2_Atom_Tuple) + 3 * sizeof(LV2_Atom); - LV2_URID_Map map = {NULL, urid_map}; - - // Test over a range that fails in the tuple header and elements - for (size_t capacity = 1; capacity < size; ++capacity) { - uint8_t* buf = (uint8_t*)malloc(capacity); - - LV2_Atom_Forge forge; - lv2_atom_forge_init(&forge, &map); - lv2_atom_forge_set_buffer(&forge, buf, capacity); - - LV2_Atom_Forge_Frame frame; - LV2_Atom_Forge_Ref ref = lv2_atom_forge_tuple(&forge, &frame); - - assert(capacity >= sizeof(LV2_Atom_Tuple) || !frame.ref); - assert(capacity >= sizeof(LV2_Atom_Tuple) || !ref); - (void)ref; - - lv2_atom_forge_int(&forge, 1); - lv2_atom_forge_float(&forge, 2.0f); - lv2_atom_forge_string(&forge, "three", 5); - lv2_atom_forge_pop(&forge, &frame); - - free(buf); - } - - return 0; -} - -int -main(void) -{ - const int ret = test_string_overflow() || test_literal_overflow() || - test_sequence_overflow() || test_vector_head_overflow() || - test_vector_overflow() || test_tuple_overflow(); - - free_urid_map(); - - return ret; -} diff --git a/lv2/atom/forge.h b/lv2/atom/forge.h deleted file mode 100644 index 280bd53..0000000 --- a/lv2/atom/forge.h +++ /dev/null @@ -1,683 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - @file forge.h An API for constructing LV2 atoms. - - This file provides an API for constructing Atoms which makes it relatively - simple to build nested atoms of arbitrary complexity without requiring - dynamic memory allocation. - - The API is based on successively appending the appropriate pieces to build a - complete Atom. The size of containers is automatically updated. Functions - that begin a container return (via their frame argument) a stack frame which - must be popped when the container is finished. - - All output is written to a user-provided buffer or sink function. This - makes it possible to create atoms on the stack, on the heap, in LV2 port - buffers, in a ringbuffer, or elsewhere, all using the same API. - - This entire API is realtime safe if used with a buffer or a realtime safe - sink, except lv2_atom_forge_init() which is only realtime safe if the URI - map function is. - - Note these functions are all static inline, do not take their address. - - This header is non-normative, it is provided for convenience. -*/ - -#ifndef LV2_ATOM_FORGE_H -#define LV2_ATOM_FORGE_H - -/** - @defgroup forge Forge - @ingroup atom - - An API for constructing LV2 atoms. - - @{ -*/ - -#include "lv2/atom/atom.h" -#include "lv2/atom/util.h" -#include "lv2/core/attributes.h" -#include "lv2/urid/urid.h" - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Disable deprecation warnings for Blank and Resource -LV2_DISABLE_DEPRECATION_WARNINGS - -/** Handle for LV2_Atom_Forge_Sink. */ -typedef void* LV2_Atom_Forge_Sink_Handle; - -/** A reference to a chunk of written output. */ -typedef intptr_t LV2_Atom_Forge_Ref; - -/** Sink function for writing output. See lv2_atom_forge_set_sink(). */ -typedef LV2_Atom_Forge_Ref (*LV2_Atom_Forge_Sink)( - LV2_Atom_Forge_Sink_Handle handle, - const void* buf, - uint32_t size); - -/** Function for resolving a reference. See lv2_atom_forge_set_sink(). */ -typedef LV2_Atom* (*LV2_Atom_Forge_Deref_Func)( - LV2_Atom_Forge_Sink_Handle handle, - LV2_Atom_Forge_Ref ref); - -/** A stack frame used for keeping track of nested Atom containers. */ -typedef struct LV2_Atom_Forge_Frame { - struct LV2_Atom_Forge_Frame* parent; - LV2_Atom_Forge_Ref ref; -} LV2_Atom_Forge_Frame; - -/** A "forge" for creating atoms by appending to a buffer. */ -typedef struct { - uint8_t* buf; - uint32_t offset; - uint32_t size; - - LV2_Atom_Forge_Sink sink; - LV2_Atom_Forge_Deref_Func deref; - LV2_Atom_Forge_Sink_Handle handle; - - LV2_Atom_Forge_Frame* stack; - - LV2_URID Blank LV2_DEPRECATED; - LV2_URID Bool; - LV2_URID Chunk; - LV2_URID Double; - LV2_URID Float; - LV2_URID Int; - LV2_URID Long; - LV2_URID Literal; - LV2_URID Object; - LV2_URID Path; - LV2_URID Property; - LV2_URID Resource LV2_DEPRECATED; - LV2_URID Sequence; - LV2_URID String; - LV2_URID Tuple; - LV2_URID URI; - LV2_URID URID; - LV2_URID Vector; -} LV2_Atom_Forge; - -static inline void -lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size); - -/** - Initialise `forge`. - - URIs will be mapped using `map` and stored, a reference to `map` itself is - not held. -*/ -static inline void -lv2_atom_forge_init(LV2_Atom_Forge* forge, LV2_URID_Map* map) -{ - lv2_atom_forge_set_buffer(forge, NULL, 0); - forge->Blank = map->map(map->handle, LV2_ATOM__Blank); - forge->Bool = map->map(map->handle, LV2_ATOM__Bool); - forge->Chunk = map->map(map->handle, LV2_ATOM__Chunk); - forge->Double = map->map(map->handle, LV2_ATOM__Double); - forge->Float = map->map(map->handle, LV2_ATOM__Float); - forge->Int = map->map(map->handle, LV2_ATOM__Int); - forge->Long = map->map(map->handle, LV2_ATOM__Long); - forge->Literal = map->map(map->handle, LV2_ATOM__Literal); - forge->Object = map->map(map->handle, LV2_ATOM__Object); - forge->Path = map->map(map->handle, LV2_ATOM__Path); - forge->Property = map->map(map->handle, LV2_ATOM__Property); - forge->Resource = map->map(map->handle, LV2_ATOM__Resource); - forge->Sequence = map->map(map->handle, LV2_ATOM__Sequence); - forge->String = map->map(map->handle, LV2_ATOM__String); - forge->Tuple = map->map(map->handle, LV2_ATOM__Tuple); - forge->URI = map->map(map->handle, LV2_ATOM__URI); - forge->URID = map->map(map->handle, LV2_ATOM__URID); - forge->Vector = map->map(map->handle, LV2_ATOM__Vector); -} - -/** Access the Atom pointed to by a reference. */ -static inline LV2_Atom* -lv2_atom_forge_deref(LV2_Atom_Forge* forge, LV2_Atom_Forge_Ref ref) -{ - return forge->buf ? (LV2_Atom*)ref : forge->deref(forge->handle, ref); -} - -/** - @name Object Stack - @{ -*/ - -/** - Push a stack frame. - This is done automatically by container functions (which take a stack frame - pointer), but may be called by the user to push the top level container when - writing to an existing Atom. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_push(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Frame* frame, - LV2_Atom_Forge_Ref ref) -{ - frame->parent = forge->stack; - frame->ref = ref; - - if (ref) { - forge->stack = frame; // Don't push, so walking the stack is always safe - } - - return ref; -} - -/** Pop a stack frame. This must be called when a container is finished. */ -static inline void -lv2_atom_forge_pop(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame) -{ - if (frame->ref) { - // If frame has a valid ref, it must be the top of the stack - assert(frame == forge->stack); - forge->stack = frame->parent; - } - // Otherwise, frame was not pushed because of overflow, do nothing -} - -/** Return true iff the top of the stack has the given type. */ -static inline bool -lv2_atom_forge_top_is(LV2_Atom_Forge* forge, uint32_t type) -{ - return forge->stack && forge->stack->ref && - (lv2_atom_forge_deref(forge, forge->stack->ref)->type == type); -} - -/** Return true iff `type` is an atom:Object. */ -static inline bool -lv2_atom_forge_is_object_type(const LV2_Atom_Forge* forge, uint32_t type) -{ - return (type == forge->Object || type == forge->Blank || - type == forge->Resource); -} - -/** Return true iff `type` is an atom:Object with a blank ID. */ -static inline bool -lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge, - uint32_t type, - const LV2_Atom_Object_Body* body) -{ - return (type == forge->Blank || (type == forge->Object && body->id == 0)); -} - -/** - @} - @name Output Configuration - @{ -*/ - -/** Set the output buffer where `forge` will write atoms. */ -static inline void -lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size) -{ - forge->buf = buf; - forge->size = (uint32_t)size; - forge->offset = 0; - forge->deref = NULL; - forge->sink = NULL; - forge->handle = NULL; - forge->stack = NULL; -} - -/** - Set the sink function where `forge` will write output. - - The return value of forge functions is an LV2_Atom_Forge_Ref which is an - integer type safe to use as a pointer but is otherwise opaque. The sink - function must return a ref that can be dereferenced to access as least - sizeof(LV2_Atom) bytes of the written data, so sizes can be updated. For - ringbuffers, this should be possible as long as the size of the buffer is a - multiple of sizeof(LV2_Atom), since atoms are always aligned. - - Note that 0 is an invalid reference, so if you are using a buffer offset be - sure to offset it such that 0 is never a valid reference. You will get - confusing errors otherwise. -*/ -static inline void -lv2_atom_forge_set_sink(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Sink sink, - LV2_Atom_Forge_Deref_Func deref, - LV2_Atom_Forge_Sink_Handle handle) -{ - forge->buf = NULL; - forge->size = forge->offset = 0; - forge->deref = deref; - forge->sink = sink; - forge->handle = handle; - forge->stack = NULL; -} - -/** - @} - @name Low Level Output - @{ -*/ - -/** - Write raw output. This is used internally, but is also useful for writing - atom types not explicitly supported by the forge API. Note the caller is - responsible for ensuring the output is appropriately padded. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_raw(LV2_Atom_Forge* forge, const void* data, uint32_t size) -{ - LV2_Atom_Forge_Ref out = 0; - if (forge->sink) { - out = forge->sink(forge->handle, data, size); - } else { - out = (LV2_Atom_Forge_Ref)forge->buf + forge->offset; - uint8_t* mem = forge->buf + forge->offset; - if (forge->offset + size > forge->size) { - return 0; - } - forge->offset += size; - memcpy(mem, data, size); - } - for (LV2_Atom_Forge_Frame* f = forge->stack; f; f = f->parent) { - lv2_atom_forge_deref(forge, f->ref)->size += size; - } - return out; -} - -/** Pad output accordingly so next write is 64-bit aligned. */ -static inline void -lv2_atom_forge_pad(LV2_Atom_Forge* forge, uint32_t written) -{ - const uint64_t pad = 0; - const uint32_t pad_size = lv2_atom_pad_size(written) - written; - lv2_atom_forge_raw(forge, &pad, pad_size); -} - -/** Write raw output, padding to 64-bits as necessary. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_write(LV2_Atom_Forge* forge, const void* data, uint32_t size) -{ - LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, data, size); - if (out) { - lv2_atom_forge_pad(forge, size); - } - return out; -} - -/** Write a null-terminated string body. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_string_body(LV2_Atom_Forge* forge, const char* str, uint32_t len) -{ - LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, str, len); - if (out && (out = lv2_atom_forge_raw(forge, "", 1))) { - lv2_atom_forge_pad(forge, len + 1); - } - return out; -} - -/** - @} - @name Atom Output - @{ -*/ - -/** Write an atom:Atom header. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_atom(LV2_Atom_Forge* forge, uint32_t size, uint32_t type) -{ - const LV2_Atom a = {size, type}; - return lv2_atom_forge_raw(forge, &a, sizeof(a)); -} - -/** Write a primitive (fixed-size) atom. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_primitive(LV2_Atom_Forge* forge, const LV2_Atom* a) -{ - return ( - lv2_atom_forge_top_is(forge, forge->Vector) - ? lv2_atom_forge_raw(forge, LV2_ATOM_BODY_CONST(a), a->size) - : lv2_atom_forge_write(forge, a, (uint32_t)sizeof(LV2_Atom) + a->size)); -} - -/** Write an atom:Int. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_int(LV2_Atom_Forge* forge, int32_t val) -{ - const LV2_Atom_Int a = {{sizeof(val), forge->Int}, val}; - return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); -} - -/** Write an atom:Long. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_long(LV2_Atom_Forge* forge, int64_t val) -{ - const LV2_Atom_Long a = {{sizeof(val), forge->Long}, val}; - return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); -} - -/** Write an atom:Float. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_float(LV2_Atom_Forge* forge, float val) -{ - const LV2_Atom_Float a = {{sizeof(val), forge->Float}, val}; - return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); -} - -/** Write an atom:Double. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_double(LV2_Atom_Forge* forge, double val) -{ - const LV2_Atom_Double a = {{sizeof(val), forge->Double}, val}; - return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); -} - -/** Write an atom:Bool. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_bool(LV2_Atom_Forge* forge, bool val) -{ - const LV2_Atom_Bool a = {{sizeof(int32_t), forge->Bool}, val ? 1 : 0}; - return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); -} - -/** Write an atom:URID. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_urid(LV2_Atom_Forge* forge, LV2_URID id) -{ - const LV2_Atom_URID a = {{sizeof(id), forge->URID}, id}; - return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); -} - -/** Write an atom compatible with atom:String. Used internally. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_typed_string(LV2_Atom_Forge* forge, - uint32_t type, - const char* str, - uint32_t len) -{ - const LV2_Atom_String a = {{len + 1, type}}; - LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, &a, sizeof(a)); - if (out) { - if (!lv2_atom_forge_string_body(forge, str, len)) { - LV2_Atom* atom = lv2_atom_forge_deref(forge, out); - atom->size = atom->type = 0; - out = 0; - } - } - return out; -} - -/** Write an atom:String. Note that `str` need not be NULL terminated. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_string(LV2_Atom_Forge* forge, const char* str, uint32_t len) -{ - return lv2_atom_forge_typed_string(forge, forge->String, str, len); -} - -/** - Write an atom:URI. Note that `uri` need not be NULL terminated. - This does not map the URI, but writes the complete URI string. To write - a mapped URI, use lv2_atom_forge_urid(). -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_uri(LV2_Atom_Forge* forge, const char* uri, uint32_t len) -{ - return lv2_atom_forge_typed_string(forge, forge->URI, uri, len); -} - -/** Write an atom:Path. Note that `path` need not be NULL terminated. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_path(LV2_Atom_Forge* forge, const char* path, uint32_t len) -{ - return lv2_atom_forge_typed_string(forge, forge->Path, path, len); -} - -/** Write an atom:Literal. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_literal(LV2_Atom_Forge* forge, - const char* str, - uint32_t len, - uint32_t datatype, - uint32_t lang) -{ - const LV2_Atom_Literal a = { - {(uint32_t)(sizeof(LV2_Atom_Literal) - sizeof(LV2_Atom) + len + 1), - forge->Literal}, - {datatype, lang}}; - LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, &a, sizeof(a)); - if (out) { - if (!lv2_atom_forge_string_body(forge, str, len)) { - LV2_Atom* atom = lv2_atom_forge_deref(forge, out); - atom->size = atom->type = 0; - out = 0; - } - } - return out; -} - -/** Start an atom:Vector. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_vector_head(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Frame* frame, - uint32_t child_size, - uint32_t child_type) -{ - const LV2_Atom_Vector a = {{sizeof(LV2_Atom_Vector_Body), forge->Vector}, - {child_size, child_type}}; - return lv2_atom_forge_push( - forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -} - -/** Write a complete atom:Vector. */ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_vector(LV2_Atom_Forge* forge, - uint32_t child_size, - uint32_t child_type, - uint32_t n_elems, - const void* elems) -{ - const LV2_Atom_Vector a = { - {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size, - forge->Vector}, - {child_size, child_type}}; - LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); - if (out) { - lv2_atom_forge_write(forge, elems, child_size * n_elems); - } - return out; -} - -/** - Write the header of an atom:Tuple. - - The passed frame will be initialised to represent this tuple. To complete - the tuple, write a sequence of atoms, then pop the frame with - lv2_atom_forge_pop(). - - For example: - @code - // Write tuple (1, 2.0) - LV2_Atom_Forge_Frame frame; - LV2_Atom* tup = (LV2_Atom*)lv2_atom_forge_tuple(forge, &frame); - lv2_atom_forge_int(forge, 1); - lv2_atom_forge_float(forge, 2.0); - lv2_atom_forge_pop(forge, &frame); - @endcode -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_tuple(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame) -{ - const LV2_Atom_Tuple a = {{0, forge->Tuple}}; - return lv2_atom_forge_push( - forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -} - -/** - Write the header of an atom:Object. - - The passed frame will be initialised to represent this object. To complete - the object, write a sequence of properties, then pop the frame with - lv2_atom_forge_pop(). - - For example: - @code - LV2_URID eg_Cat = map("http://example.org/Cat"); - LV2_URID eg_name = map("http://example.org/name"); - - // Start object with type eg_Cat and blank ID - LV2_Atom_Forge_Frame frame; - lv2_atom_forge_object(forge, &frame, 0, eg_Cat); - - // Append property eg:name = "Hobbes" - lv2_atom_forge_key(forge, eg_name); - lv2_atom_forge_string(forge, "Hobbes", strlen("Hobbes")); - - // Finish object - lv2_atom_forge_pop(forge, &frame); - @endcode -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_object(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Frame* frame, - LV2_URID id, - LV2_URID otype) -{ - const LV2_Atom_Object a = { - {(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Object}, {id, otype}}; - return lv2_atom_forge_push( - forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -} - -/** - The same as lv2_atom_forge_object(), but for object:Resource. - - This function is deprecated and should not be used in new code. - Use lv2_atom_forge_object() directly instead. -*/ -LV2_DEPRECATED -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_resource(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Frame* frame, - LV2_URID id, - LV2_URID otype) -{ - const LV2_Atom_Object a = { - {(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource}, {id, otype}}; - return lv2_atom_forge_push( - forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -} - -/** - The same as lv2_atom_forge_object(), but for object:Blank. - - This function is deprecated and should not be used in new code. - Use lv2_atom_forge_object() directly instead. -*/ -LV2_DEPRECATED -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_blank(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Frame* frame, - uint32_t id, - LV2_URID otype) -{ - const LV2_Atom_Object a = { - {(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank}, {id, otype}}; - return lv2_atom_forge_push( - forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -} - -/** - Write a property key in an Object, to be followed by the value. - - See lv2_atom_forge_object() documentation for an example. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_key(LV2_Atom_Forge* forge, LV2_URID key) -{ - const LV2_Atom_Property_Body a = {key, 0, {0, 0}}; - return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t)); -} - -/** - Write the header for a property body in an object, with context. - - If you do not need the context, which is almost certainly the case, - use the simpler lv2_atom_forge_key() instead. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_property_head(LV2_Atom_Forge* forge, - LV2_URID key, - LV2_URID context) -{ - const LV2_Atom_Property_Body a = {key, context, {0, 0}}; - return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t)); -} - -/** - Write the header for a Sequence. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge, - LV2_Atom_Forge_Frame* frame, - uint32_t unit) -{ - const LV2_Atom_Sequence a = { - {(uint32_t)sizeof(LV2_Atom_Sequence_Body), forge->Sequence}, {unit, 0}}; - return lv2_atom_forge_push( - forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); -} - -/** - Write the time stamp header of an Event (in a Sequence) in audio frames. - After this, call the appropriate forge method(s) to write the body. Note - the returned reference is to an LV2_Event which is NOT an Atom. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_frame_time(LV2_Atom_Forge* forge, int64_t frames) -{ - return lv2_atom_forge_write(forge, &frames, sizeof(frames)); -} - -/** - Write the time stamp header of an Event (in a Sequence) in beats. After - this, call the appropriate forge method(s) to write the body. Note the - returned reference is to an LV2_Event which is NOT an Atom. -*/ -static inline LV2_Atom_Forge_Ref -lv2_atom_forge_beat_time(LV2_Atom_Forge* forge, double beats) -{ - return lv2_atom_forge_write(forge, &beats, sizeof(beats)); -} - -LV2_RESTORE_WARNINGS - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} - @} -*/ - -#endif /* LV2_ATOM_FORGE_H */ diff --git a/lv2/atom/manifest.ttl b/lv2/atom/manifest.ttl deleted file mode 100644 index 3cb5134..0000000 --- a/lv2/atom/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 2 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/atom/meson.build b/lv2/atom/meson.build deleted file mode 100644 index 3dc43b3..0000000 --- a/lv2/atom/meson.build +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'atom' -path = 'ns' / 'ext' / name - -atom_data = files( - 'atom.meta.ttl', - 'atom.ttl', - 'manifest.ttl', -) - -headers = files( - 'atom.h', - 'forge.h', - 'util.h', -) - -tests = [ - 'atom-test', - 'forge-overflow-test', -] - -# Install specification bundle -install_data(atom_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build and run tests -if not get_option('tests').disabled() - foreach test : tests - test(test, - executable( - test, - files('@0@.c'.format(test)), - c_args: c_suppressions, - include_directories: include_directories('../../'), - ), - suite: 'unit') - endforeach -endif - -# Build documentation -if build_docs - custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('atom.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/atom/util.h b/lv2/atom/util.h deleted file mode 100644 index 16d2c00..0000000 --- a/lv2/atom/util.h +++ /dev/null @@ -1,523 +0,0 @@ -/* - Copyright 2008-2015 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_ATOM_UTIL_H -#define LV2_ATOM_UTIL_H - -/** - @file util.h Helper functions for the LV2 Atom extension. - - Note these functions are all static inline, do not take their address. - - This header is non-normative, it is provided for convenience. -*/ - -/** - @defgroup util Utilities - @ingroup atom - - Utilities for working with atoms. - - @{ -*/ - -#include "lv2/atom/atom.h" - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Pad a size to 64 bits. */ -static inline uint32_t -lv2_atom_pad_size(uint32_t size) -{ - return (size + 7U) & (~7U); -} - -/** Return the total size of `atom`, including the header. */ -static inline uint32_t -lv2_atom_total_size(const LV2_Atom* atom) -{ - return (uint32_t)sizeof(LV2_Atom) + atom->size; -} - -/** Return true iff `atom` is null. */ -static inline bool -lv2_atom_is_null(const LV2_Atom* atom) -{ - return !atom || (atom->type == 0 && atom->size == 0); -} - -/** Return true iff `a` is equal to `b`. */ -static inline bool -lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b) -{ - return (a == b) || ((a->type == b->type) && (a->size == b->size) && - !memcmp(a + 1, b + 1, a->size)); -} - -/** - @name Sequence Iterator - @{ -*/ - -/** Get an iterator pointing to the first event in a Sequence body. */ -static inline LV2_Atom_Event* -lv2_atom_sequence_begin(const LV2_Atom_Sequence_Body* body) -{ - return (LV2_Atom_Event*)(body + 1); -} - -/** Get an iterator pointing to the end of a Sequence body. */ -static inline LV2_Atom_Event* -lv2_atom_sequence_end(const LV2_Atom_Sequence_Body* body, uint32_t size) -{ - return (LV2_Atom_Event*)((const uint8_t*)body + lv2_atom_pad_size(size)); -} - -/** Return true iff `i` has reached the end of `body`. */ -static inline bool -lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body, - uint32_t size, - const LV2_Atom_Event* i) -{ - return (const uint8_t*)i >= ((const uint8_t*)body + size); -} - -/** Return an iterator to the element following `i`. */ -static inline LV2_Atom_Event* -lv2_atom_sequence_next(const LV2_Atom_Event* i) -{ - return (LV2_Atom_Event*)((const uint8_t*)i + sizeof(LV2_Atom_Event) + - lv2_atom_pad_size(i->body.size)); -} - -/** - A macro for iterating over all events in a Sequence. - @param seq The sequence to iterate over - @param iter The name of the iterator - - This macro is used similarly to a for loop (which it expands to), for - example: - - @code - LV2_ATOM_SEQUENCE_FOREACH(sequence, ev) { - // Do something with ev (an LV2_Atom_Event*) here... - } - @endcode -*/ -#define LV2_ATOM_SEQUENCE_FOREACH(seq, iter) \ - for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(&(seq)->body); \ - !lv2_atom_sequence_is_end(&(seq)->body, (seq)->atom.size, (iter)); \ - (iter) = lv2_atom_sequence_next(iter)) - -/** Like LV2_ATOM_SEQUENCE_FOREACH but for a headerless sequence body. */ -#define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(body); \ - !lv2_atom_sequence_is_end(body, size, (iter)); \ - (iter) = lv2_atom_sequence_next(iter)) - -/** - @} - @name Sequence Utilities - @{ -*/ - -/** - Clear all events from `sequence`. - - This simply resets the size field, the other fields are left untouched. -*/ -static inline void -lv2_atom_sequence_clear(LV2_Atom_Sequence* seq) -{ - seq->atom.size = sizeof(LV2_Atom_Sequence_Body); -} - -/** - Append an event at the end of `sequence`. - - @param seq Sequence to append to. - @param capacity Total capacity of the sequence atom - (as set by the host for sequence output ports). - @param event Event to write. - - @return A pointer to the newly written event in `seq`, - or NULL on failure (insufficient space). -*/ -static inline LV2_Atom_Event* -lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq, - uint32_t capacity, - const LV2_Atom_Event* event) -{ - const uint32_t total_size = (uint32_t)sizeof(*event) + event->body.size; - if (capacity - seq->atom.size < total_size) { - return NULL; - } - - LV2_Atom_Event* e = lv2_atom_sequence_end(&seq->body, seq->atom.size); - memcpy(e, event, total_size); - - seq->atom.size += lv2_atom_pad_size(total_size); - - return e; -} - -/** - @} - @name Tuple Iterator - @{ -*/ - -/** Get an iterator pointing to the first element in `tup`. */ -static inline LV2_Atom* -lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup) -{ - return (LV2_Atom*)(LV2_ATOM_BODY(tup)); -} - -/** Return true iff `i` has reached the end of `body`. */ -static inline bool -lv2_atom_tuple_is_end(const void* body, uint32_t size, const LV2_Atom* i) -{ - return (const uint8_t*)i >= ((const uint8_t*)body + size); -} - -/** Return an iterator to the element following `i`. */ -static inline LV2_Atom* -lv2_atom_tuple_next(const LV2_Atom* i) -{ - return (LV2_Atom*)((const uint8_t*)i + sizeof(LV2_Atom) + - lv2_atom_pad_size(i->size)); -} - -/** - A macro for iterating over all properties of a Tuple. - @param tuple The tuple to iterate over - @param iter The name of the iterator - - This macro is used similarly to a for loop (which it expands to), for - example: - - @code - LV2_ATOM_TUPLE_FOREACH(tuple, elem) { - // Do something with elem (an LV2_Atom*) here... - } - @endcode -*/ -#define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ - for (LV2_Atom * iter = lv2_atom_tuple_begin(tuple); \ - !lv2_atom_tuple_is_end( \ - LV2_ATOM_BODY(tuple), (tuple)->atom.size, (iter)); \ - (iter) = lv2_atom_tuple_next(iter)) - -/** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */ -#define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom * iter = (LV2_Atom*)(body); \ - !lv2_atom_tuple_is_end(body, size, (iter)); \ - (iter) = lv2_atom_tuple_next(iter)) - -/** - @} - @name Object Iterator - @{ -*/ - -/** Return a pointer to the first property in `body`. */ -static inline LV2_Atom_Property_Body* -lv2_atom_object_begin(const LV2_Atom_Object_Body* body) -{ - return (LV2_Atom_Property_Body*)(body + 1); -} - -/** Return true iff `i` has reached the end of `obj`. */ -static inline bool -lv2_atom_object_is_end(const LV2_Atom_Object_Body* body, - uint32_t size, - const LV2_Atom_Property_Body* i) -{ - return (const uint8_t*)i >= ((const uint8_t*)body + size); -} - -/** Return an iterator to the property following `i`. */ -static inline LV2_Atom_Property_Body* -lv2_atom_object_next(const LV2_Atom_Property_Body* i) -{ - const LV2_Atom* const value = - (const LV2_Atom*)((const uint8_t*)i + 2 * sizeof(uint32_t)); - return (LV2_Atom_Property_Body*)((const uint8_t*)i + - lv2_atom_pad_size( - (uint32_t)sizeof(LV2_Atom_Property_Body) + - value->size)); -} - -/** - A macro for iterating over all properties of an Object. - @param obj The object to iterate over - @param iter The name of the iterator - - This macro is used similarly to a for loop (which it expands to), for - example: - - @code - LV2_ATOM_OBJECT_FOREACH(object, i) { - // Do something with i (an LV2_Atom_Property_Body*) here... - } - @endcode -*/ -#define LV2_ATOM_OBJECT_FOREACH(obj, iter) \ - for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(&(obj)->body); \ - !lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \ - (iter) = lv2_atom_object_next(iter)) - -/** Like LV2_ATOM_OBJECT_FOREACH but for a headerless object body. */ -#define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \ - for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(body); \ - !lv2_atom_object_is_end(body, size, (iter)); \ - (iter) = lv2_atom_object_next(iter)) - -/** - @} - @name Object Query - @{ -*/ - -/** A single entry in an Object query. */ -typedef struct { - uint32_t key; /**< Key to query (input set by user) */ - const LV2_Atom** value; /**< Found value (output set by query function) */ -} LV2_Atom_Object_Query; - -/** Sentinel for lv2_atom_object_query(). */ -static const LV2_Atom_Object_Query LV2_ATOM_OBJECT_QUERY_END = {0, NULL}; - -/** - Get an object's values for various keys. - - The value pointer of each item in `query` will be set to the location of - the corresponding value in `object`. Every value pointer in `query` MUST - be initialised to NULL. This function reads `object` in a single linear - sweep. By allocating `query` on the stack, objects can be "queried" - quickly without allocating any memory. This function is realtime safe. - - This function can only do "flat" queries, it is not smart enough to match - variables in nested objects. - - For example: - @code - const LV2_Atom* name = NULL; - const LV2_Atom* age = NULL; - LV2_Atom_Object_Query q[] = { - { urids.eg_name, &name }, - { urids.eg_age, &age }, - LV2_ATOM_OBJECT_QUERY_END - }; - lv2_atom_object_query(obj, q); - // name and age are now set to the appropriate values in obj, or NULL. - @endcode -*/ -static inline int -lv2_atom_object_query(const LV2_Atom_Object* object, - LV2_Atom_Object_Query* query) -{ - int matches = 0; - int n_queries = 0; - - /* Count number of query keys so we can short-circuit when done */ - for (LV2_Atom_Object_Query* q = query; q->key; ++q) { - ++n_queries; - } - - LV2_ATOM_OBJECT_FOREACH (object, prop) { - for (LV2_Atom_Object_Query* q = query; q->key; ++q) { - if (q->key == prop->key && !*q->value) { - *q->value = &prop->value; - if (++matches == n_queries) { - return matches; - } - break; - } - } - } - return matches; -} - -/** - Body only version of lv2_atom_object_get(). -*/ -static inline int -lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) -{ - int matches = 0; - int n_queries = 0; - - /* Count number of keys so we can short-circuit when done */ - va_list args; - va_start(args, body); - for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { - if (!va_arg(args, const LV2_Atom**)) { - va_end(args); - return -1; - } - } - va_end(args); - - LV2_ATOM_OBJECT_BODY_FOREACH (body, size, prop) { - va_start(args, body); - for (int i = 0; i < n_queries; ++i) { - uint32_t qkey = va_arg(args, uint32_t); - const LV2_Atom** qval = va_arg(args, const LV2_Atom**); - if (qkey == prop->key && !*qval) { - *qval = &prop->value; - if (++matches == n_queries) { - va_end(args); - return matches; - } - break; - } - } - va_end(args); - } - return matches; -} - -/** - Variable argument version of lv2_atom_object_query(). - - This is nicer-looking in code, but a bit more error-prone since it is not - type safe and the argument list must be terminated. - - The arguments should be a series of uint32_t key and const LV2_Atom** value - pairs, terminated by a zero key. The value pointers MUST be initialized to - NULL. For example: - - @code - const LV2_Atom* name = NULL; - const LV2_Atom* age = NULL; - lv2_atom_object_get(obj, - uris.name_key, &name, - uris.age_key, &age, - 0); - @endcode -*/ -static inline int -lv2_atom_object_get(const LV2_Atom_Object* object, ...) -{ - int matches = 0; - int n_queries = 0; - - /* Count number of keys so we can short-circuit when done */ - va_list args; - va_start(args, object); - for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { - if (!va_arg(args, const LV2_Atom**)) { - va_end(args); - return -1; - } - } - va_end(args); - - LV2_ATOM_OBJECT_FOREACH (object, prop) { - va_start(args, object); - for (int i = 0; i < n_queries; ++i) { - uint32_t qkey = va_arg(args, uint32_t); - const LV2_Atom** qval = va_arg(args, const LV2_Atom**); - if (qkey == prop->key && !*qval) { - *qval = &prop->value; - if (++matches == n_queries) { - va_end(args); - return matches; - } - break; - } - } - va_end(args); - } - return matches; -} - -/** - Variable argument version of lv2_atom_object_query() with types. - - This is like lv2_atom_object_get(), but each entry has an additional - parameter to specify the required type. Only atoms with a matching type - will be selected. - - The arguments should be a series of uint32_t key, const LV2_Atom**, uint32_t - type triples, terminated by a zero key. The value pointers MUST be - initialized to NULL. For example: - - @code - const LV2_Atom_String* name = NULL; - const LV2_Atom_Int* age = NULL; - lv2_atom_object_get(obj, - uris.name_key, &name, uris.atom_String, - uris.age_key, &age, uris.atom_Int - 0); - @endcode -*/ -static inline int -lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...) -{ - int matches = 0; - int n_queries = 0; - - /* Count number of keys so we can short-circuit when done */ - va_list args; - va_start(args, object); - for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { - if (!va_arg(args, const LV2_Atom**) || !va_arg(args, uint32_t)) { - va_end(args); - return -1; - } - } - va_end(args); - - LV2_ATOM_OBJECT_FOREACH (object, prop) { - va_start(args, object); - for (int i = 0; i < n_queries; ++i) { - const uint32_t qkey = va_arg(args, uint32_t); - const LV2_Atom** qval = va_arg(args, const LV2_Atom**); - const uint32_t qtype = va_arg(args, uint32_t); - if (!*qval && qkey == prop->key && qtype == prop->value.type) { - *qval = &prop->value; - if (++matches == n_queries) { - va_end(args); - return matches; - } - break; - } - } - va_end(args); - } - return matches; -} - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} - @} -*/ - -#endif /* LV2_ATOM_UTIL_H */ diff --git a/lv2/buf-size.lv2/buf-size.meta.ttl b/lv2/buf-size.lv2/buf-size.meta.ttl new file mode 100644 index 0000000..b1d8011 --- /dev/null +++ b/lv2/buf-size.lv2/buf-size.meta.ttl @@ -0,0 +1,157 @@ +@prefix bufsz: . +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Buf Size" ; + doap:shortdesc "Access to, and restrictions on, buffer sizes." ; + doap:created "2012-08-07" ; + doap:developer ; + doap:release [ + doap:revision "1.4" ; + doap:created "2015-09-18" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add bufsz:nominalBlockLength option." + ] , [ + rdfs:label "Add bufsz:coarseBlockLength feature." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-12-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix typo in bufsz:sequenceSize label." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a facility for plugins to get information about the +block length (the sample_count parameter of LV2_Descriptor::run) and port +buffer sizes, as well as several features which can be used to restrict the +block length. + +This extension defines features and properties but has no special purpose +API of its own. The host provides all the relevant information to the plugin +as [options](options.html). + +To require restrictions on the block length, plugins can require additional +features: bufsz:boundedBlockLength, bufsz:powerOf2BlockLength, and +bufsz:fixedBlockLength. These features are data-only, that is they merely +indicate a restriction and do not carry any data or API. + +"""^^lv2:Markdown . + +bufsz:boundedBlockLength + lv2:documentation """ + +A feature that indicates the host will provide both the bufsz:minBlockLength +and bufsz:maxBlockLength options to the plugin. Plugins that copy data from +audio inputs can require this feature to ensure they know how much space is +required for auxiliary buffers. Note the minimum may be zero, this feature is +mainly useful to ensure a maximum is available. + +All hosts SHOULD support this feature, since it is simple to support and +necessary for any plugins that may need to copy the input. + +"""^^lv2:Markdown . + +bufsz:fixedBlockLength + lv2:documentation """ + +A feature that indicates the host will always call LV2_Descriptor::run() with +the same value for sample_count. This length MUST be provided as the value of +both the bufsz:minBlockLength and bufsz:maxBlockLength options. + +Note that requiring this feature may severely limit the number of hosts capable +of running the plugin. + +"""^^lv2:Markdown . + +bufsz:powerOf2BlockLength + lv2:documentation """ + +A feature that indicates the host will always call LV2_Descriptor::run() with a +power of two sample_count. Note that this feature does not guarantee the value +is the same each call, to guarantee a fixed power of two block length plugins +must require both this feature and bufsz:fixedBlockLength. + +Note that requiring this feature may severely limit the number of hosts capable +of running the plugin. + +"""^^lv2:Markdown . + +bufsz:coarseBlockLength + lv2:documentation """ + +A feature that indicates the plugin prefers coarse, regular block lengths. For +example, plugins that do not implement sample-accurate control use this feature +to indicate that the host should not split the run cycle because controls have +changed. + +Note that this feature is merely a hint, and does not guarantee a fixed block +length. The run cycle may be split for other reasons, and the blocksize itself +may change anytime. + +"""^^lv2:Markdown . + +bufsz:maxBlockLength + lv2:documentation """ + +The maximum block length the host will ever request the plugin to process at +once, that is, the maximum `sample_count` parameter that will ever be passed to +LV2_Descriptor::run(). + +"""^^lv2:Markdown . + +bufsz:minBlockLength + lv2:documentation """ + +The minimum block length the host will ever request the plugin to process at +once, that is, the minimum `sample_count` parameter that will ever be passed to +LV2_Descriptor::run(). + +"""^^lv2:Markdown . + +bufsz:nominalBlockLength + lv2:documentation """ + +The typical block length the host will request the plugin to process at once, +that is, the typical `sample_count` parameter that will be passed to +LV2_Descriptor::run(). This will usually be equivalent, or close to, the +maximum block length, but there are no strong guarantees about this value +whatsoever. Plugins may use this length for optimization purposes, but MUST +NOT assume the host will always process blocks of this length. In particular, +the host MAY process longer blocks. + +"""^^lv2:Markdown . + +bufsz:sequenceSize + lv2:documentation """ + +This should be provided as an option by hosts that support event ports +(including but not limited to MIDI), so plugins have the ability to allocate +auxiliary buffers large enough to copy the input. + +"""^^lv2:Markdown . + diff --git a/lv2/buf-size.lv2/buf-size.ttl b/lv2/buf-size.lv2/buf-size.ttl new file mode 100644 index 0000000..4f6bd52 --- /dev/null +++ b/lv2/buf-size.lv2/buf-size.ttl @@ -0,0 +1,68 @@ +@prefix bufsz: . +@prefix lv2: . +@prefix opts: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Buf Size" ; + rdfs:comment "Access to, and restrictions on, buffer sizes." ; + rdfs:seeAlso ; + owl:imports , + . + +bufsz:boundedBlockLength + a lv2:Feature ; + rdfs:label "bounded block length" ; + rdfs:comment "Block length has lower and upper bounds." . + +bufsz:fixedBlockLength + a lv2:Feature ; + rdfs:label "fixed block length" ; + rdfs:comment "Block length never changes." . + +bufsz:powerOf2BlockLength + a lv2:Feature ; + rdfs:label "power of 2 block length" ; + rdfs:comment "Block length is a power of 2." . + +bufsz:coarseBlockLength + a lv2:Feature ; + rdfs:label "coarse block length" ; + rdfs:comment "Plugin prefers coarse block length without buffer splitting." . + +bufsz:maxBlockLength + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "maximum block length" ; + rdfs:comment "Block length has an upper bound." ; + rdfs:range xsd:nonNegativeInteger . + +bufsz:minBlockLength + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "minimum block length" ; + rdfs:comment "Block length has a lower bound." ; + rdfs:range xsd:nonNegativeInteger . + +bufsz:nominalBlockLength + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "nominal block length" ; + rdfs:comment "Typical block length that will most often be processed." ; + rdfs:range xsd:nonNegativeInteger . + +bufsz:sequenceSize + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "sequence size" ; + rdfs:comment "The maximum size of a sequence, in bytes." ; + rdfs:range xsd:nonNegativeInteger . + diff --git a/lv2/buf-size.lv2/manifest.ttl b/lv2/buf-size.lv2/manifest.ttl new file mode 100644 index 0000000..d242f97 --- /dev/null +++ b/lv2/buf-size.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/buf-size/buf-size.h b/lv2/buf-size/buf-size.h deleted file mode 100644 index d96e17d..0000000 --- a/lv2/buf-size/buf-size.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2007-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_BUF_SIZE_H -#define LV2_BUF_SIZE_H - -/** - @defgroup buf-size Buffer Size - @ingroup lv2 - - Access to, and restrictions on, buffer sizes. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_BUF_SIZE_URI "http://lv2plug.in/ns/ext/buf-size" ///< http://lv2plug.in/ns/ext/buf-size -#define LV2_BUF_SIZE_PREFIX LV2_BUF_SIZE_URI "#" ///< http://lv2plug.in/ns/ext/buf-size# - -#define LV2_BUF_SIZE__boundedBlockLength LV2_BUF_SIZE_PREFIX "boundedBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#boundedBlockLength -#define LV2_BUF_SIZE__coarseBlockLength LV2_BUF_SIZE_PREFIX "coarseBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#coarseBlockLength -#define LV2_BUF_SIZE__fixedBlockLength LV2_BUF_SIZE_PREFIX "fixedBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#fixedBlockLength -#define LV2_BUF_SIZE__maxBlockLength LV2_BUF_SIZE_PREFIX "maxBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#maxBlockLength -#define LV2_BUF_SIZE__minBlockLength LV2_BUF_SIZE_PREFIX "minBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#minBlockLength -#define LV2_BUF_SIZE__nominalBlockLength LV2_BUF_SIZE_PREFIX "nominalBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#nominalBlockLength -#define LV2_BUF_SIZE__powerOf2BlockLength LV2_BUF_SIZE_PREFIX "powerOf2BlockLength" ///< http://lv2plug.in/ns/ext/buf-size#powerOf2BlockLength -#define LV2_BUF_SIZE__sequenceSize LV2_BUF_SIZE_PREFIX "sequenceSize" ///< http://lv2plug.in/ns/ext/buf-size#sequenceSize - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_BUF_SIZE_H */ diff --git a/lv2/buf-size/buf-size.meta.ttl b/lv2/buf-size/buf-size.meta.ttl deleted file mode 100644 index b1d8011..0000000 --- a/lv2/buf-size/buf-size.meta.ttl +++ /dev/null @@ -1,157 +0,0 @@ -@prefix bufsz: . -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Buf Size" ; - doap:shortdesc "Access to, and restrictions on, buffer sizes." ; - doap:created "2012-08-07" ; - doap:developer ; - doap:release [ - doap:revision "1.4" ; - doap:created "2015-09-18" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add bufsz:nominalBlockLength option." - ] , [ - rdfs:label "Add bufsz:coarseBlockLength feature." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-12-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix typo in bufsz:sequenceSize label." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a facility for plugins to get information about the -block length (the sample_count parameter of LV2_Descriptor::run) and port -buffer sizes, as well as several features which can be used to restrict the -block length. - -This extension defines features and properties but has no special purpose -API of its own. The host provides all the relevant information to the plugin -as [options](options.html). - -To require restrictions on the block length, plugins can require additional -features: bufsz:boundedBlockLength, bufsz:powerOf2BlockLength, and -bufsz:fixedBlockLength. These features are data-only, that is they merely -indicate a restriction and do not carry any data or API. - -"""^^lv2:Markdown . - -bufsz:boundedBlockLength - lv2:documentation """ - -A feature that indicates the host will provide both the bufsz:minBlockLength -and bufsz:maxBlockLength options to the plugin. Plugins that copy data from -audio inputs can require this feature to ensure they know how much space is -required for auxiliary buffers. Note the minimum may be zero, this feature is -mainly useful to ensure a maximum is available. - -All hosts SHOULD support this feature, since it is simple to support and -necessary for any plugins that may need to copy the input. - -"""^^lv2:Markdown . - -bufsz:fixedBlockLength - lv2:documentation """ - -A feature that indicates the host will always call LV2_Descriptor::run() with -the same value for sample_count. This length MUST be provided as the value of -both the bufsz:minBlockLength and bufsz:maxBlockLength options. - -Note that requiring this feature may severely limit the number of hosts capable -of running the plugin. - -"""^^lv2:Markdown . - -bufsz:powerOf2BlockLength - lv2:documentation """ - -A feature that indicates the host will always call LV2_Descriptor::run() with a -power of two sample_count. Note that this feature does not guarantee the value -is the same each call, to guarantee a fixed power of two block length plugins -must require both this feature and bufsz:fixedBlockLength. - -Note that requiring this feature may severely limit the number of hosts capable -of running the plugin. - -"""^^lv2:Markdown . - -bufsz:coarseBlockLength - lv2:documentation """ - -A feature that indicates the plugin prefers coarse, regular block lengths. For -example, plugins that do not implement sample-accurate control use this feature -to indicate that the host should not split the run cycle because controls have -changed. - -Note that this feature is merely a hint, and does not guarantee a fixed block -length. The run cycle may be split for other reasons, and the blocksize itself -may change anytime. - -"""^^lv2:Markdown . - -bufsz:maxBlockLength - lv2:documentation """ - -The maximum block length the host will ever request the plugin to process at -once, that is, the maximum `sample_count` parameter that will ever be passed to -LV2_Descriptor::run(). - -"""^^lv2:Markdown . - -bufsz:minBlockLength - lv2:documentation """ - -The minimum block length the host will ever request the plugin to process at -once, that is, the minimum `sample_count` parameter that will ever be passed to -LV2_Descriptor::run(). - -"""^^lv2:Markdown . - -bufsz:nominalBlockLength - lv2:documentation """ - -The typical block length the host will request the plugin to process at once, -that is, the typical `sample_count` parameter that will be passed to -LV2_Descriptor::run(). This will usually be equivalent, or close to, the -maximum block length, but there are no strong guarantees about this value -whatsoever. Plugins may use this length for optimization purposes, but MUST -NOT assume the host will always process blocks of this length. In particular, -the host MAY process longer blocks. - -"""^^lv2:Markdown . - -bufsz:sequenceSize - lv2:documentation """ - -This should be provided as an option by hosts that support event ports -(including but not limited to MIDI), so plugins have the ability to allocate -auxiliary buffers large enough to copy the input. - -"""^^lv2:Markdown . - diff --git a/lv2/buf-size/buf-size.ttl b/lv2/buf-size/buf-size.ttl deleted file mode 100644 index c78d2cc..0000000 --- a/lv2/buf-size/buf-size.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix bufsz: . -@prefix lv2: . -@prefix opts: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Buf Size" ; - rdfs:comment "Access to, and restrictions on, buffer sizes." ; - rdfs:seeAlso , - ; - owl:imports , - . - -bufsz:boundedBlockLength - a lv2:Feature ; - rdfs:label "bounded block length" ; - rdfs:comment "Block length has lower and upper bounds." . - -bufsz:fixedBlockLength - a lv2:Feature ; - rdfs:label "fixed block length" ; - rdfs:comment "Block length never changes." . - -bufsz:powerOf2BlockLength - a lv2:Feature ; - rdfs:label "power of 2 block length" ; - rdfs:comment "Block length is a power of 2." . - -bufsz:coarseBlockLength - a lv2:Feature ; - rdfs:label "coarse block length" ; - rdfs:comment "Plugin prefers coarse block length without buffer splitting." . - -bufsz:maxBlockLength - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:label "maximum block length" ; - rdfs:comment "Block length has an upper bound." ; - rdfs:range xsd:nonNegativeInteger . - -bufsz:minBlockLength - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:label "minimum block length" ; - rdfs:comment "Block length has a lower bound." ; - rdfs:range xsd:nonNegativeInteger . - -bufsz:nominalBlockLength - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:label "nominal block length" ; - rdfs:comment "Typical block length that will most often be processed." ; - rdfs:range xsd:nonNegativeInteger . - -bufsz:sequenceSize - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:label "sequence size" ; - rdfs:comment "The maximum size of a sequence, in bytes." ; - rdfs:range xsd:nonNegativeInteger . - diff --git a/lv2/buf-size/manifest.ttl b/lv2/buf-size/manifest.ttl deleted file mode 100644 index d242f97..0000000 --- a/lv2/buf-size/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/buf-size/meson.build b/lv2/buf-size/meson.build deleted file mode 100644 index c0b3a5e..0000000 --- a/lv2/buf-size/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'buf-size' -path = 'ns' / 'ext' / name - -buf_size_data = files( - 'buf-size.meta.ttl', - 'buf-size.ttl', - 'manifest.ttl', -) - -headers = files( - 'buf-size.h', -) - -# Install extension bundle -install_data(buf_size_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_buf_size_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('buf-size.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/core.lv2/lv2core.meta.ttl b/lv2/core.lv2/lv2core.meta.ttl new file mode 100644 index 0000000..9faea9d --- /dev/null +++ b/lv2/core.lv2/lv2core.meta.ttl @@ -0,0 +1,915 @@ +@prefix lv2: . +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2" ; + doap:homepage ; + doap:created "2004-04-21" ; + doap:shortdesc "An extensible open standard for audio plugins" ; + doap:programming-language "C" ; + doap:developer , + ; + doap:maintainer ; + doap:release [ + doap:revision "18.4" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + doap:revision "18.0" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2:Markdown datatype." + ] , [ + rdfs:label "Deprecate lv2:reportsLatency." + ] + ] + ] , [ + doap:revision "16.0" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2:MIDIPlugin class." + ] , [ + rdfs:label "Rework port restrictions so that presets can be validated." + ] + ] + ] , [ + doap:revision "14.0" ; + doap:created "2016-09-18" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2_util.h with lv2_features_data() and lv2_features_query()." + ] , [ + rdfs:label "Add lv2:enabled designation." + ] + ] + ] , [ + doap:revision "12.4" ; + doap:created "2015-04-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Relax domain of lv2:minimum lv2:maximum and lv2:default so they can be used to describe properties/parameters as well." + ] , [ + rdfs:label "Add extern C and visibility attribute to LV2_SYMBOL_EXPORT." + ] , [ + rdfs:label "Add lv2:isSideChain port property." + ] + ] + ] , [ + doap:revision "12.2" ; + doap:created "2014-08-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Clarify lv2_descriptor() and lv2_lib_descriptor() documentation." + ] + ] + ] , [ + doap:revision "12.0" ; + doap:created "2014-01-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2:prototype for property inheritance." + ] + ] + ] , [ + doap:revision "10.0" ; + doap:created "2013-02-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2:EnvelopePlugin class." + ] , [ + rdfs:label "Add lv2:control for designating primary event-based control ports." + ] , [ + rdfs:label "Set range of lv2:designation to lv2:Designation." + ] , [ + rdfs:label "Make lv2:Parameter rdfs:subClassOf rdf:Property." + ] , [ + rdfs:label "Reserve minor version 0 for unstable development plugins." + ] + ] + ] , [ + doap:revision "8.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "8.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix LV2_SYMBOL_EXPORT and lv2_descriptor prototype for Windows." + ] , [ + rdfs:label "Add metadata concept of a designation, a channel or parameter description which can be assigned to ports for more intelligent use by hosts." + ] , [ + rdfs:label "Add new discovery API which allows libraries to read bundle files during discovery, makes library construction/destruction explicit, and adds extensibility to prevent future breakage." + ] , [ + rdfs:label "Relax the range of lv2:index so it can be used for things other than ports." + ] , [ + rdfs:label "Remove lv2:Resource, which turned out to be meaningless." + ] , [ + rdfs:label "Add lv2:CVPort." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "6.0" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Rename core.lv2 and lv2.ttl to lv2core.lv2 and lv2core.ttl to adhere to modern conventions." + ] , [ + rdfs:label "Add lv2:extensionData and lv2:ExtensionData for plugins to indicate that they support some URI for extension_data()." + ] , [ + rdfs:label "Remove lv2config in favour of the simple convention that specifications install headers to standard URI-based paths." + ] , [ + rdfs:label "Switch to the ISC license, a simple BSD-style license (with permission of all contributors to lv2.h and its ancestor, ladspa.h)." + ] , [ + rdfs:label "Make lv2core.ttl a valid OWL 2 DL ontology." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "4.0" ; + doap:created "2011-03-18" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make doap:license suggested, but not required (for wrappers)." + ] , [ + rdfs:label "Define lv2:binary (MUST be in manifest.ttl)." + ] , [ + rdfs:label "Define lv2:minorVersion and lv2:microVersion (MUST be in manifest.ttl)." + ] , [ + rdfs:label "Define lv2:documentation and use it to document lv2core." + ] , [ + rdfs:label "Add lv2:FunctionPlugin and lv2:ConstantPlugin classes." + ] , [ + rdfs:label "Move lv2:AmplifierPlugin under lv2:DynamicsPlugin." + ] , [ + rdfs:label "Loosen domain of lv2:optionalFeature and lv2:requiredFeature (to allow re-use in extensions)." + ] , [ + rdfs:label "Add generic lv2:Resource and lv2:PluginBase classes." + ] , [ + rdfs:label "Fix definition of lv2:minimum etc. (used for values, not scale points)." + ] , [ + rdfs:label "More precisely define properties with OWL." + ] , [ + rdfs:label "Move project metadata to manifest." + ] , [ + rdfs:label "Add lv2:enumeration port property." + ] , [ + rdfs:label "Define run() pre-roll special case (sample_count == 0)." + ] + ] + ] , [ + doap:revision "3.0" ; + doap:created "2008-11-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Require that serialisations refer to ports by symbol rather than index." + ] , [ + rdfs:label "Minor stylistic changes to lv2.ttl." + ] , [ + rdfs:label "No header changes." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2008-02-10" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +LV2 is an interface for writing audio plugins in C or compatible languages, +which can be dynamically loaded into many _host_ applications. This core +specification is simple and minimal, but is designed so that _extensions_ can +be defined to add more advanced features, making it possible to implement +nearly any feature. + +LV2 maintains a strong distinction between code and data. Plugin code is in a +shared library, while data is in a companion data file written in +[Turtle](https://www.w3.org/TR/turtle/). Code, data, and any other resources +(such as waveforms) are shipped together in a bundle directory. The code +contains only the executable portions of the plugin. All other data is +provided in the data file(s). This makes plugin data flexible and extensible, +and allows the host to do everything but run the plugin without loading or +executing any code. Among other advantages, this makes hosts more robust +(broken plugins can't crash a host during discovery) and allows generic tools +written in any language to work with LV2 data. The LV2 specification itself is +distributed in a similar way. + +An LV2 plugin library is suitable for dynamic loading (for example with +`dlopen()`) and provides one or more plugin descriptors via `lv2_descriptor()` +or `lv2_lib_descriptor()`. These can be instantiated to create plugin +instances, which can be run directly on data or connected together to perform +advanced signal processing tasks. + +Plugins communicate via _ports_, which can transmit any type of data. Data is +processed by first connecting each port to a buffer, then repeatedly calling +the `run()` method to process blocks of data. + +This core specification defines two types of port, equivalent to those in +[LADSPA](http://www.ladspa.org/), lv2:ControlPort and lv2:AudioPort, as well as +lv2:CVPort which has the same format as an audio port but is interpreted as +non-audible control data. Audio ports contain arrays with one `float` element +per sample, allowing a block of audio to be processed in a single call to +`run()`. Control ports contain single `float` values, which are fixed and +valid for the duration of the call to `run()`. Thus the _control rate_ is +determined by the block size, which is controlled by the host (and not +necessarily constant). + +### Threading Rules + +To facilitate use in multi-threaded programs, LV2 functions are partitioned into +several threading classes: + +| Discovery Class | Instantiation Class | Audio Class | +|----------------------------------|-------------------------------|------------------------------- | +| lv2_descriptor() | LV2_Descriptor::instantiate() | LV2_Descriptor::run() | +| lv2_lib_descriptor() | LV2_Descriptor::cleanup() | LV2_Descriptor::connect_port() | +| LV2_Descriptor::extension_data() | LV2_Descriptor::activate() | | +| | LV2_Descriptor::deactivate() | | + +Hosts MUST guarantee that: + + * A function in any class is never called concurrently with another function + in that class. + + * A _Discovery_ function is never called concurrently with any other function + in the same shared object file. + + * An _Instantiation_ function for an instance is never called concurrently + with any other function for that instance. + +Any simultaneous calls that are not explicitly forbidden by these rules are +allowed. For example, a host may call `run()` for two different plugin +instances simultaneously. + +Plugin functions in any class MUST NOT manipulate any state which might affect +other plugins or the host (beyond the contract of that function), for example +by using non-reentrant global functions. + +Extensions to this specification which add new functions MUST declare in which +of these classes the functions belong, define new classes for them, or +otherwise precisely describe their threading rules. + +"""^^lv2:Markdown . + +lv2:Specification + lv2:documentation """ + +An LV2 specification typically contains a vocabulary description, C headers to +define an API, and any other resources that may be useful. Specifications, +like plugins, are distributed and installed as bundles so that hosts may +discover them. + +"""^^lv2:Markdown . + +lv2:Markdown + lv2:documentation """ + +This datatype is typically used for documentation in +[Markdown](https://daringfireball.net/projects/markdown/syntax) syntax. + +Generally, documentation with this datatype should stay as close to readable +plain text as possible, but may use core Markdown syntax for nicer +presentation. Documentation can assume that basic extensions like codehilite +and tables are available. + +"""^^lv2:Markdown . + +lv2:documentation + lv2:documentation """ + +Relates a Resource to extended documentation. + +LV2 specifications are documented using this property with an lv2:Markdown +datatype. + +If the value has no explicit datatype, it is assumed to be a valid XHTML Basic +1.1 fragment suitable for use as the content of the `body` element of a page. + +XHTML Basic is a W3C Recommendation which defines a simplified subset of XHTML +intended to be reasonable to implement with limited resources, for exampe on +embedded devices. See [XHTML Basic, Section +3](http://www.w3.org/TR/xhtml-basic/#s_xhtmlmodules) for a list of valid tags. + +"""^^lv2:Markdown . + +lv2:PluginBase + lv2:documentation """ + +An abstract plugin-like resource that may not actually be an LV2 plugin, for +example that may not have a lv2:binary. This is useful for describing things +that share common structure with a plugin, but are not themselves an actual +plugin, such as presets. + +"""^^lv2:Markdown . + +lv2:Plugin + lv2:documentation """ + +To be discovered by hosts, plugins MUST explicitly have an rdf:type of lv2:Plugin +in their bundle's manifest, for example: + + :::turtle + a lv2:Plugin . + +Plugins should have a doap:name property that is at most a few words in length +using title capitalization, for example Tape Delay Unit. + +"""^^lv2:Markdown . + +lv2:PortBase + lv2:documentation """ + +Similar to lv2:PluginBase, this is an abstract port-like resource that may not +be a fully specified LV2 port. For example, this is used for preset "ports" +which do not specify an index. + +"""^^lv2:Markdown . + +lv2:Port + lv2:documentation """ + +All LV2 port descriptions MUST have a rdf:type that is one of lv2:Port, +lv2:InputPort or lv2:OutputPort. Additionally, there MUST be at least one +other rdf:type which more precisely describes type of the port, for example +lv2:AudioPort. + +Hosts that do not support a specific port class MUST NOT instantiate the +plugin, unless that port has the lv2:connectionOptional property set. + +A port has two identifiers: a (numeric) index, and a (textual) symbol. The +index can be used as an identifier at run-time, but persistent references to +ports (for example in presets or save files) MUST use the symbol. Only the +symbol is guaranteed to refer to the same port on all plugins with a given URI, +that is the index for a port may differ between plugin binaries. + +"""^^lv2:Markdown . + +lv2:AudioPort + lv2:documentation """ + +Ports of this type are connected to a buffer of `float` audio samples, which +the host guarantees have `sample_count` elements in any call to +LV2_Descriptor::run(). + +Audio samples are normalized between -1.0 and 1.0, though there is no +requirement for samples to be strictly within this range. + +"""^^lv2:Markdown . + +lv2:CVPort + lv2:documentation """ + +Ports of this type have the same buffer format as an lv2:AudioPort, except the +buffer represents audio-rate control data rather than audio. Like a +lv2:ControlPort, a CV port SHOULD have properties describing its value, in +particular lv2:minimum, lv2:maximum, and lv2:default. + +Hosts may present CV ports to users as controls in the same way as control +ports. Conceptually, aside from the buffer format, a CV port is the same as a +control port, so hosts can use all the same properties and expectations. + +In particular, this port type does not imply any range, unit, or meaning for +its values. However, if there is no inherent unit to the values, for example +if the port is used to modulate some other value, then plugins SHOULD use a +normalized range, either from -1.0 to 1.0, or from 0.0 to 1.0. + +It is generally safe to connect an audio output to a CV input, but not +vice-versa. Hosts must take care to prevent data from a CVPort port from being +used as audio. + +"""^^lv2:Markdown . + +lv2:project + lv2:documentation """ + +This property provides a way to group plugins and/or related resources. A +project may have useful metadata common to all plugins (such as homepage, +author, version history) which would be wasteful to list separately for each +plugin. + +Grouping via projects also allows users to find plugins in hosts by project, +which is often how they are remembered. For this reason, a project that +contains plugins SHOULD always have a doap:name. It is also a good idea for +each plugin and the project itself to have an lv2:symbol property, which allows +nice quasi-global identifiers for plugins, for example `myproj.superamp` which +can be useful for display or fast user entry. + +"""^^lv2:Markdown . + +lv2:prototype + lv2:documentation """ + +This property can be used to include common properties in several +descriptions, serving as a sort of template mechanism. If a plugin has a +prototype, then the host must load all the properties for the prototype as if +they were properties of the plugin. That is, if `:plug lv2:prototype :prot`, +then for each triple `:prot p o`, the triple `:plug p o` should be loaded. + +This facility is useful for distributing data-only plugins that rely on a +common binary, for example those where the internal state is loaded from some +other file. Such plugins can refer to a prototype in a template LV2 bundle +which is installed by the corresponding software. + +"""^^lv2:Markdown . + +lv2:minorVersion + lv2:documentation """ + +This, along with lv2:microVersion, is used to distinguish between different +versions of the same resource, for example to load only the bundle with +the most recent version of a plugin. An LV2 version has a minor and micro +number with the usual semantics: + + * The minor version MUST be incremented when backwards (but not forwards) + compatible additions are made, for example the addition of a port to a + plugin. + + * The micro version is incremented for changes which do not affect + compatibility at all, for example bug fixes or documentation updates. + +Note that there is deliberately no major version: all versions with the same +URI are compatible by definition. Replacing a resource with a newer version of +that resource MUST NOT break anything. If a change violates this rule, then +the URI of the resource (which serves as the major version) MUST be changed. + +Plugins and extensions MUST adhere to at least the following rules: + + * All versions of a plugin with a given URI MUST have the same set of + mandatory (not lv2:connectionOptional) ports with respect to lv2:symbol and + rdf:type. In other words, every port on a particular version is guaranteed + to exist on a future version with same lv2:symbol and at least those + rdf:types. + + * New ports MAY be added without changing the plugin URI if and only if they + are lv2:connectionOptional and the minor version is incremented. + + * The minor version MUST be incremented if the index of any port (identified + by its symbol) is changed. + + * All versions of a specification MUST be compatible in the sense that an + implementation of the new version can interoperate with an implementation + of any previous version. + +Anything that depends on a specific version of a plugin (including referencing +ports by index) MUST refer to the plugin by both URI and version. However, +implementations should be tolerant where possible. + +When hosts discover several installed versions of a resource, they SHOULD warn +the user and load only the most recent version. + +An odd minor _or_ micro version, or minor version zero, indicates that the +resource is a development version. Hosts and tools SHOULD clearly indicate +this wherever appropriate. Minor version zero is a special case for +pre-release development of plugins, or experimental plugins that are not +intended for stable use at all. Hosts SHOULD NOT expect such a plugin to +remain compatible with any future version. Where feasible, hosts SHOULD NOT +expose such plugins to users by default, but may provide an option to display +them. + +"""^^lv2:Markdown . + +lv2:microVersion + lv2:documentation """ + +Releases of plugins and extensions MUST be explicitly versioned. Correct +version numbers MUST always be maintained for any versioned resource that is +published. For example, after a release, if a change is made in the development +version in source control, the micro version MUST be incremented (to an odd +number) to distinguish this modified version from the previous release. + +This property describes half of a resource version. For detailed documentation +on LV2 resource versioning, see lv2:minorVersion. + +"""^^lv2:Markdown . + +lv2:binary + lv2:documentation """ + +The value of this property must be the URI of a shared library object, +typically in the same bundle as the data file which contains this property. +The actual type of the library is platform specific. + +This is a required property of a lv2:Plugin which MUST be included in the +bundle's `manifest.ttl` file. The lv2:binary of a lv2:Plugin is the shared +object containing the lv2_descriptor() or lv2_lib_descriptor() function. This +probably may also be used similarly by extensions to relate other resources to +their implementations (it is not implied that a lv2:binary on an arbitrary +resource is an LV2 plugin library). + +"""^^lv2:Markdown . + +lv2:appliesTo + lv2:documentation """ + +This is primarily intended for discovery purposes: bundles that describe +resources that work with particular plugins (like presets or user interfaces) +SHOULD specify this in their `manifest.ttl` so the host can associate them with +the correct plugin. For example: + + :::turtle + + a ext:Thing ; + lv2:appliesTo ; + rdfs:seeAlso . + +Using this pattern is preferable for large amounts of data, since the host may +choose whether/when to load the data. + +"""^^lv2:Markdown . + +lv2:Symbol + lv2:documentation """ + +The first character of a symbol must be one of `_`, `a-z` or `A-Z`, and +subsequent characters may additionally be `0-9`. This is, among other things, +a valid C identifier, and generally compatible in most contexts which have +restrictions on string identifiers, such as file paths. + +"""^^lv2:Markdown . + +lv2:symbol + lv2:documentation """ + +The value of this property MUST be a valid lv2:Symbol, and MUST NOT have a +language tag. + +A symbol is a unique identifier with respect to the parent, for example a +port's symbol is a unique identifiers with respect to its plugin. The plugin +author MUST change the plugin URI if any port symbol is changed or removed. + +"""^^lv2:Markdown . + +lv2:name + lv2:documentation """ + +Unlike lv2:symbol, this is unrestricted, may be translated, and is not relevant +for compatibility. The name is not necessarily unique and MUST NOT be used as +an identifier. + +"""^^lv2:Markdown . + +lv2:shortName + lv2:documentation """ + +This is the same as lv2:name, with the additional requirement that the value is +shorter than 16 characters. + +"""^^lv2:Markdown . + +lv2:Designation + lv2:documentation """ + +A designation is metadata that describes the meaning or role of something. By +assigning a designation to a port using lv2:designation, the port's content +becomes meaningful and can be used more intelligently by the host. + +"""^^lv2:Markdown . + +lv2:Channel + lv2:documentation """ + +A specific channel, for example the left channel of a stereo stream. A +channel may be audio, or another type such as a MIDI control stream. + +"""^^lv2:Markdown . + +lv2:Parameter + lv2:documentation """ + +A parameter is a designation for a control. + +A parameter defines the meaning of a control, not the method of conveying its +value. For example, a parameter could be controlled via a lv2:ControlPort, +messages, or both. + +A lv2:ControlPort can be associated with a parameter using lv2:designation. + +"""^^lv2:Markdown . + +lv2:designation + lv2:documentation """ + +This property is used to give a port's contents a well-defined meaning. For +example, if a port has the designation `eg:gain`, then the value of that port +represents the `eg:gain` of the plugin instance. + +Ports should be given designations whenever possible, particularly if a +suitable designation is already defined. This allows the host to act more +intelligently and provide a more effective user interface. For example, if the +plugin has a BPM parameter, the host may automatically set that parameter to +the current tempo. + +"""^^lv2:Markdown . + +lv2:freeWheeling + lv2:documentation """ + +If true, this means that all processing is happening as quickly as possible, +not in real-time. When free-wheeling there is no relationship between the +passage of real wall-clock time and the passage of time in the data being +processed. + +"""^^lv2:Markdown . + +lv2:enabled + lv2:documentation """ + +If this value is greater than zero, the plugin processes normally. If this +value is zero, the plugin is expected to bypass all signals unmodified. The +plugin must provide a click-free transition between the enabled and disabled +(bypassed) states. + +Values less than zero are reserved for future use (such as click-free +insertion/removal of latent plugins), and should be treated like zero +(bypassed) by current implementations. + +"""^^lv2:Markdown . + +lv2:control + lv2:documentation """ + +This should be used as the lv2:designation of ports that are used to send +commands and receive responses. Typically this will be an event port that +supports some protocol, for example MIDI or LV2 Atoms. + +"""^^lv2:Markdown . + +lv2:Point + lv2:documentation """ + + * A Point MUST have at least one rdfs:label which is a string. + + * A Point MUST have exactly one rdf:value with a type that is compatible with + the type of the corresponding Port. + +"""^^lv2:Markdown . + +lv2:default + lv2:documentation """ + +The host SHOULD set the port to this value initially, and in any situation +where the port value should be cleared or reset. + +"""^^lv2:Markdown . + +lv2:minimum + lv2:documentation """ + +This is a soft limit: the plugin is required to gracefully accept all values in +the range of a port's data type. + +"""^^lv2:Markdown . + +lv2:maximum + lv2:documentation """ + +This is a soft limit: the plugin is required to gracefully accept all values in +the range of a port's data type. + +"""^^lv2:Markdown . + +lv2:optionalFeature + lv2:documentation """ + +To support this feature, the host MUST pass its URI and any additional data to +the plugin in LV2_Descriptor::instantiate(). + +The plugin MUST NOT fail to instantiate if an optional feature is not supported +by the host. + +"""^^lv2:Markdown . + +lv2:requiredFeature + lv2:documentation """ + +To support this feature, the host MUST pass its URI and any additional data to +the plugin in LV2_Descriptor::instantiate(). + +The host MUST check this property before attempting to instantiate a plugin, +and not attempt to instantiate plugins which require features it does not +support. The plugin MUST fail to instantiate if a required feature is not +supported by the host. Note that these rules are intentionally redundant for +resilience: neither host nor plugin should assume that the other does not +violate them. + +"""^^lv2:Markdown . + +lv2:ExtensionData + lv2:documentation """ + +This is additional data that a plugin may return from +LV2_Descriptor::extension_data(). This is generally used to add APIs to extend +that defined by LV2_Descriptor. + +"""^^lv2:Markdown . + +lv2:extensionData + lv2:documentation """ + +If a plugin has a value for this property, it must be a URI that defines the +extension data. The plugin should return the appropriate data when +LV2_Descriptor::extension_data() is called with that URI as a parameter. + +"""^^lv2:Markdown . + +lv2:isLive + lv2:documentation """ + +This feature is for plugins that have time-sensitive internals, for example +communicating in real time over a socket. It indicates to the host that its +input and output must not be cached or subject to significant latency, and that +calls to LV2_Descriptor::run() should be made at a rate that roughly +corresponds to wall clock time (according to the `sample_count` parameter). + +Note that this feature is not related to hard real-time execution +requirements (see lv2:hardRTCapable). + +"""^^lv2:Markdown . + +lv2:inPlaceBroken + lv2:documentation """ + +This feature indicates that the plugin may not work correctly if the host +elects to use the same data location for both input and output. Plugins that +will fail to work correctly if ANY input port is connected to the same location +as ANY output port MUST require this feature. Doing so should be avoided +whenever possible since it prevents hosts from running the plugin on data +in-place. + +"""^^lv2:Markdown . + +lv2:hardRTCapable + lv2:documentation """ + +This feature indicates that the plugin is capable of running in a hard +real-time environment. This should be the case for most audio processors, +so most plugins are expected to have this feature. + +To support this feature, plugins MUST adhere to the following in all of their +audio class functions (LV2_Descriptor::run() and +LV2_Descriptor::connect_port()): + + * There is no use of `malloc()`, `free()` or any other heap memory management + functions. + + * There is no use of any library functions which do not adhere to these + rules. The plugin may assume that the standard C math library functions + are safe. + + * There is no access to files, devices, pipes, sockets, system calls, or any + other mechanism that might result in the process or thread blocking. + + * The maximum amount of time for a `run()` call is bounded by some expression + of the form `A + B * sample_count`, where `A` and `B` are platform specific + constants. Note that this bound does not depend on input signals or plugin + state. + +"""^^lv2:Markdown . + +lv2:portProperty + lv2:documentation """ + +States that a port has a particular lv2:PortProperty. This may be ignored +without catastrophic effects, though it may be useful, for example to provide a +sensible user interface for the port. + +"""^^lv2:Markdown . + +lv2:connectionOptional + lv2:documentation """ + +This property means that the port does not have to be connected to valid data +by the host. To leave a port unconnected, the host MUST explicitly +connect the port to `NULL`. + +"""^^lv2:Markdown . + +lv2:reportsLatency + lv2:documentation """ + +This property indicates that the port is used to express the processing latency +incurred by the plugin, expressed in samples. The latency may be affected by +the current sample rate, plugin settings, or other factors, and may be changed +by the plugin at any time. Where the latency is frequency dependent the plugin +may choose any appropriate value. If a plugin introduces latency it MUST +provide EXACTLY ONE port with this property set. In fuzzy cases the +value should be the most reasonable one based on user expectation of +input/output alignment. For example, musical delay plugins should not report +their delay as latency, since it is an intentional effect that the host should +not compensate for. + +This property is deprecated, use a lv2:designation of lv2:latency instead, +following the same rules as above: + + :::turtle + + lv2:port [ + a lv2:OutputPort , lv2:ControlPort ; + lv2:designation lv2:latency ; + lv2:symbol "latency" ; + ] + +"""^^lv2:Markdown . + +lv2:toggled + lv2:documentation """ + +Indicates that the data item should be considered a boolean toggle. Data less +than or equal to zero should be considered off or false, and data +above zero should be considered on or true. + +"""^^lv2:Markdown . + +lv2:sampleRate + lv2:documentation """ + +Indicates that any specified bounds should be interpreted as multiples of the +sample rate. For example, a frequency range from 0 Hz to the Nyquist frequency +(half the sample rate) can be specified by using this property with lv2:minimum +0.0 and lv2:maximum 0.5. Hosts that support bounds at all MUST support this +property. + +"""^^lv2:Markdown . + +lv2:integer + lv2:documentation """ + +Indicates that all the reasonable values for a port are integers. For such +ports, a user interface should provide a stepped control that only allows +choosing integer values. + +Note that this is only a hint, and that the plugin MUST operate reasonably even +if such a port has a non-integer value. + +"""^^lv2:Markdown . + +lv2:enumeration + lv2:documentation """ + +Indicates that all the rasonable values for a port are defined by +lv2:scalePoint properties. For such ports, a user interface should provide a selector that allows the user to choose any of the scale point values by name. It is recommended to show the value as well if possible. + +Note that this is only a hint, and that the plugin MUST operate reasonably even +if such a port has a value that does not correspond to a scale point. + +"""^^lv2:Markdown . + +lv2:isSideChain + lv2:documentation """ + +Indicates that a port is a sidechain, which affects the output somehow +but should not be considered a part of the main signal chain. Sidechain ports +SHOULD be lv2:connectionOptional, and may be ignored by hosts. + +"""^^lv2:Markdown . + diff --git a/lv2/core.lv2/lv2core.ttl b/lv2/core.lv2/lv2core.ttl new file mode 100644 index 0000000..f78865b --- /dev/null +++ b/lv2/core.lv2/lv2core.ttl @@ -0,0 +1,673 @@ +@prefix doap: . +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2" ; + rdfs:comment "An extensible open standard for audio plugins." ; + rdfs:seeAlso ; + owl:imports doap: . + +lv2:Specification + a rdfs:Class , + owl:Class ; + rdfs:subClassOf doap:Project ; + rdfs:label "Specification" ; + rdfs:comment "An LV2 specifiation." . + +lv2:Markdown + a rdfs:Datatype ; + owl:onDatatype xsd:string ; + rdfs:label "Markdown" ; + rdfs:comment "A string in Markdown syntax." . + +lv2:documentation + a rdf:Property , + owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:label "documentation" ; + rdfs:comment "Extended documentation." ; + rdfs:seeAlso . + +lv2:PluginBase + a rdfs:Class , + owl:Class ; + rdfs:label "Plugin Base" ; + rdfs:comment "Base class for a plugin-like resource." . + +lv2:Plugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:PluginBase ; + rdfs:label "Plugin" ; + rdfs:comment "An LV2 plugin." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty doap:name ; + owl:someValuesFrom rdf:PlainLiteral ; + rdfs:comment "A plugin MUST have at least one untranslated doap:name." + ] , [ + a owl:Restriction ; + owl:onProperty lv2:port ; + owl:allValuesFrom lv2:Port ; + rdfs:comment "All ports on a plugin MUST be fully specified lv2:Port instances." + ] . + +lv2:PortBase + a rdfs:Class , + owl:Class ; + rdfs:label "Port Base" ; + rdfs:comment "Base class for a port-like resource." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:symbol ; + owl:cardinality 1 ; + rdfs:comment "A port MUST have exactly one lv2:symbol." + ] . + +lv2:Port + a rdfs:Class , + owl:Class ; + rdfs:label "Port" ; + rdfs:comment "An LV2 plugin port." ; + rdfs:subClassOf lv2:PortBase , + [ + a owl:Restriction ; + owl:onProperty lv2:name ; + owl:minCardinality 1 ; + rdfs:comment "A port MUST have at least one lv2:name." + ] . + +lv2:InputPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Input Port" ; + rdfs:comment "A port connected to constant data which is read during `run()`." . + +lv2:OutputPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Output Port" ; + rdfs:comment "A port connected to data which is written during `run()`." . + +lv2:ControlPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Control Port" ; + rdfs:comment "A port connected to a single `float`." . + +lv2:AudioPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Audio Port" ; + rdfs:comment "A port connected to an array of float audio samples." . + +lv2:CVPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "CV Port" ; + rdfs:comment "A port connected to an array of float control values." . + +lv2:port + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:PluginBase ; + rdfs:range lv2:PortBase ; + rdfs:label "port" ; + rdfs:comment "A port (input or output) on this plugin." . + +lv2:project + a rdf:Property , + owl:ObjectProperty ; + rdfs:range doap:Project ; + rdfs:label "project" ; + rdfs:comment "The project this is a part of." . + +lv2:prototype + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "prototype" ; + rdfs:comment "The prototype to inherit properties from." . + +lv2:minorVersion + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "minor version" ; + rdfs:comment "The minor version of this resource." . + +lv2:microVersion + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "micro version" ; + rdfs:comment "The micro version of this resource." . + +lv2:binary + a rdf:Property , + owl:ObjectProperty ; + rdfs:range owl:Thing ; + rdfs:label "binary" ; + rdfs:comment "The binary of this resource." . + +lv2:appliesTo + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:Plugin ; + rdfs:label "applies to" ; + rdfs:comment "The plugin this resource is related to." . + +lv2:index + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:range xsd:unsignedInt ; + rdfs:label "index" ; + rdfs:comment "A non-negative zero-based 32-bit index." . + +lv2:Symbol + a rdfs:Datatype ; + owl:onDatatype xsd:string ; + owl:withRestrictions ( + [ + xsd:pattern "[_a-zA-Z][_a-zA-Z0-9]*" + ] + ) ; + rdfs:label "Symbol" ; + rdfs:comment "A short restricted name used as a strong identifier." . + +lv2:symbol + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "symbol" ; + rdfs:range lv2:Symbol , + rdf:PlainLiteral ; + rdfs:comment "The symbol that identifies this resource in the context of its parent." . + +lv2:name + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "name" ; + rdfs:range xsd:string ; + rdfs:comment "A display name for labeling in a user interface." . + +lv2:shortName + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "short name" ; + rdfs:range xsd:string ; + rdfs:comment "A short display name for labeling in a user interface." . + +lv2:Designation + a rdfs:Class , + owl:Class ; + rdfs:subClassOf rdf:Property ; + rdfs:label "Designation" ; + rdfs:comment "A designation which defines the meaning of some data." . + +lv2:Channel + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Designation ; + rdfs:label "Channel" ; + rdfs:comment "An individual channel, such as left or right." . + +lv2:Parameter + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Designation , + rdf:Property ; + rdfs:label "Parameter" ; + rdfs:comment "A property that is a plugin parameter." . + +lv2:designation + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:range rdf:Property ; + rdfs:label "designation" ; + rdfs:comment "The designation that defines the meaning of this input or output." . + +lv2:latency + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "latency" ; + rdfs:comment "The latency introduced, in frames." . + +lv2:freeWheeling + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "free-wheeling" ; + rdfs:range xsd:boolean ; + rdfs:comment "Whether processing is currently free-wheeling." . + +lv2:enabled + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "enabled" ; + rdfs:range xsd:int ; + rdfs:comment "Whether processing is currently enabled (not bypassed)." . + +lv2:control + a lv2:Channel ; + rdfs:label "control" ; + rdfs:comment "The primary control channel." . + +lv2:Point + a rdfs:Class , + owl:Class ; + rdfs:label "Point" ; + rdfs:comment "An interesting point in a value range." . + +lv2:ScalePoint + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Point ; + rdfs:label "Scale Point" ; + rdfs:comment "A single `float` Point for control inputs." . + +lv2:scalePoint + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:ScalePoint ; + rdfs:label "scale point" ; + rdfs:comment "A scale point of a port or parameter." . + +lv2:default + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "default" ; + rdfs:comment "The default value for this control." . + +lv2:minimum + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "minimum" ; + rdfs:comment "The minimum value for this control." . + +lv2:maximum + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "maximum" ; + rdfs:comment "The maximum value for this control." . + +lv2:Feature + a rdfs:Class , + owl:Class ; + rdfs:label "Feature" ; + rdfs:comment "An additional feature which may be used or required." . + +lv2:optionalFeature + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:Feature ; + rdfs:label "optional feature" ; + rdfs:comment "An optional feature that is supported if available." . + +lv2:requiredFeature + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:Feature ; + rdfs:label "required feature" ; + rdfs:comment "A required feature that must be available to run." . + +lv2:ExtensionData + a rdfs:Class , + owl:Class ; + rdfs:label "Extension Data" ; + rdfs:comment "Additional data defined by an extension." . + +lv2:extensionData + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:ExtensionData ; + rdfs:label "extension data" ; + rdfs:comment "Extension data provided by a plugin or other binary." . + +lv2:isLive + a lv2:Feature ; + rdfs:label "is live" ; + rdfs:comment "Plugin has a real-time dependency." . + +lv2:inPlaceBroken + a lv2:Feature ; + rdfs:label "in-place broken" ; + rdfs:comment "Plugin requires separate locations for input and output." . + +lv2:hardRTCapable + a lv2:Feature ; + rdfs:label "hard real-time capable" ; + rdfs:comment "Plugin is capable of running in a hard real-time environment." . + +lv2:PortProperty + a rdfs:Class , + owl:Class ; + rdfs:label "Port Property" ; + rdfs:comment "A particular property that a port has." . + +lv2:portProperty + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:Port ; + rdfs:range lv2:PortProperty ; + rdfs:label "port property" ; + rdfs:comment "A property of this port hosts may find useful." . + +lv2:connectionOptional + a lv2:PortProperty ; + rdfs:label "connection optional" ; + rdfs:comment "The property that this port may be connected to NULL." . + +lv2:reportsLatency + a lv2:PortProperty ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "reports latency" ; + rdfs:comment "Control port value is the plugin latency in frames." . + +lv2:toggled + a lv2:PortProperty ; + rdfs:label "toggled" ; + rdfs:comment "Control port value is considered a boolean toggle." . + +lv2:sampleRate + a lv2:PortProperty ; + rdfs:label "sample rate" ; + rdfs:comment "Control port bounds are interpreted as multiples of the sample rate." . + +lv2:integer + a lv2:PortProperty ; + rdfs:label "integer" ; + rdfs:comment "Control port values are treated as integers." . + +lv2:enumeration + a lv2:PortProperty ; + rdfs:label "enumeration" ; + rdfs:comment "Control port scale points represent all useful values." . + +lv2:isSideChain + a lv2:PortProperty ; + rdfs:label "is side-chain" ; + rdfs:comment "Signal for port should not be considered a main input or output." . + +lv2:GeneratorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Generator Plugin" ; + rdfs:comment "A plugin that generates new sound internally." . + +lv2:InstrumentPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:GeneratorPlugin ; + rdfs:label "Instrument Plugin" ; + rdfs:comment "A plugin intended to be played as a musical instrument." . + +lv2:OscillatorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:GeneratorPlugin ; + rdfs:label "Oscillator Plugin" ; + rdfs:comment "A plugin that generates output with an oscillator." . + +lv2:UtilityPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Utility Plugin" ; + rdfs:comment "A utility plugin that is not a typical audio effect or generator." . + +lv2:ConverterPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Converter Plugin" ; + rdfs:comment "A plugin that converts its input into a different form." . + +lv2:AnalyserPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Analyser Plugin" ; + rdfs:comment "A plugin that analyses its input and emits some useful information." . + +lv2:MixerPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Mixer Plugin" ; + rdfs:comment "A plugin that mixes some number of inputs into some number of outputs." . + +lv2:SimulatorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Simulator Plugin" ; + rdfs:comment "A plugin that aims to emulate some environmental effect or musical equipment." . + +lv2:DelayPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Delay Plugin" ; + rdfs:comment "An effect that intentionally delays its input as an effect." . + +lv2:ModulatorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Modulator Plugin" ; + rdfs:comment "An effect that modulats its input as an effect." . + +lv2:ReverbPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin , + lv2:SimulatorPlugin , + lv2:DelayPlugin ; + rdfs:label "Reverb Plugin" ; + rdfs:comment "An effect that adds reverberation to its input." . + +lv2:PhaserPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:ModulatorPlugin ; + rdfs:label "Phaser Plugin" ; + rdfs:comment "An effect that periodically sweeps a filter over its input." . + +lv2:FlangerPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:ModulatorPlugin ; + rdfs:label "Flanger Plugin" ; + rdfs:comment "An effect that mixes slightly delayed copies of its input." . + +lv2:ChorusPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:ModulatorPlugin ; + rdfs:label "Chorus Plugin" ; + rdfs:comment "An effect that mixes significantly delayed copies of its input." . + +lv2:FilterPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Filter Plugin" ; + rdfs:comment "An effect that manipulates the frequency spectrum of its input." . + +lv2:LowpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Lowpass Filter Plugin" ; + rdfs:comment "A filter that attenuates frequencies above some cutoff." . + +lv2:BandpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Bandpass Filter Plugin" ; + rdfs:comment "A filter that attenuates frequencies outside of some band." . + +lv2:HighpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Highpass Filter Plugin" ; + rdfs:comment "A filter that attenuates frequencies below some cutoff." . + +lv2:CombPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Comb FilterPlugin" ; + rdfs:comment "A filter that adds a delayed version of its input to itself." . + +lv2:AllpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Allpass Plugin" ; + rdfs:comment "A filter that changes the phase relationship between frequency components." . + +lv2:EQPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Equaliser Plugin" ; + rdfs:comment "A plugin that adjusts the balance between frequency components." . + +lv2:ParaEQPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:EQPlugin ; + rdfs:label "Parametric EQ Plugin" ; + rdfs:comment "A plugin that adjusts the balance between configurable frequency components." . + +lv2:MultiEQPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:EQPlugin ; + rdfs:label "Multiband EQ Plugin" ; + rdfs:comment "A plugin that adjusts the balance between a fixed set of frequency components." . + +lv2:SpatialPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Spatial Plugin" ; + rdfs:comment "A plugin that manipulates the position of audio in space." . + +lv2:SpectralPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Spectral Plugin" ; + rdfs:comment "A plugin that alters the spectral properties of audio." . + +lv2:PitchPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:SpectralPlugin ; + rdfs:label "Pitch Shifter Plugin" ; + rdfs:comment "A plugin that shifts the pitch of its input." . + +lv2:AmplifierPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Amplifier Plugin" ; + rdfs:comment "A plugin that primarily changes the volume of its input." . + +lv2:EnvelopePlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Envelope Plugin" ; + rdfs:comment "A plugin that applies an envelope to its input." . + +lv2:DistortionPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Distortion Plugin" ; + rdfs:comment "A plugin that adds distortion to its input." . + +lv2:WaveshaperPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DistortionPlugin ; + rdfs:label "Waveshaper Plugin" ; + rdfs:comment "An effect that alters the shape of input waveforms." . + +lv2:DynamicsPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Dynamics Plugin" ; + rdfs:comment "A plugin that alters the envelope or dynamic range of its input." . + +lv2:CompressorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Compressor Plugin" ; + rdfs:comment "A plugin that reduces the dynamic range of its input." . + +lv2:ExpanderPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Expander Plugin" ; + rdfs:comment "A plugin that expands the dynamic range of its input." . + +lv2:LimiterPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Limiter Plugin" ; + rdfs:comment "A plugin that limits its input to some maximum level." . + +lv2:GatePlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Gate Plugin" ; + rdfs:comment "A plugin that attenuates signals below some threshold." . + +lv2:FunctionPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Function Plugin" ; + rdfs:comment "A plugin whose output is a mathematical function of its input." . + +lv2:ConstantPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:GeneratorPlugin ; + rdfs:label "Constant Plugin" ; + rdfs:comment "A plugin that emits constant values." . + +lv2:MIDIPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "MIDI Plugin" ; + rdfs:comment "A plugin that primarily processes MIDI messages." . + diff --git a/lv2/core.lv2/manifest.ttl b/lv2/core.lv2/manifest.ttl new file mode 100644 index 0000000..6e61dde --- /dev/null +++ b/lv2/core.lv2/manifest.ttl @@ -0,0 +1,15 @@ +@prefix doap: . +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 18 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + + + a doap:Project ; + rdfs:seeAlso , + . + diff --git a/lv2/core.lv2/meta.ttl b/lv2/core.lv2/meta.ttl new file mode 100644 index 0000000..d8878c1 --- /dev/null +++ b/lv2/core.lv2/meta.ttl @@ -0,0 +1,228 @@ +@prefix dcs: . +@prefix doap: . +@prefix lv2: . +@prefix meta: . +@prefix rdf: . +@prefix rdfs: . + + + rdf:value """ +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +""" . + + + a doap:Project ; + lv2:symbol "lv2" ; + rdfs:label "LV2" ; + rdfs:comment "The LV2 Plugin Interface Project." ; + doap:name "LV2" ; + doap:license ; + doap:shortdesc "The LV2 Plugin Interface Project." ; + doap:description "LV2 is a plugin standard for audio systems. It defines a minimal yet extensible C API for plugin code and a format for plugin bundles" ; + doap:created "2006-05-10" ; + doap:homepage ; + doap:mailing-list ; + doap:programming-language "C" ; + doap:developer , + ; + doap:helper meta:larsl , + meta:bmwiedemann , + meta:gabrbedd , + meta:daste , + meta:kfoltman , + meta:paniq ; + doap:release [ + doap:revision "1.18.5" ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix or avoid new compiler and tool warnings." + ] , [ + rdfs:label "Add dark mode style for documentation." + ] , [ + rdfs:label "Clean up and modernize Python support code." + ] , [ + rdfs:label "Remove archaic properties from foaf vocabulary." + ] , [ + rdfs:label "Replace canonical dcs ontology with a minimal version for LV2." + ] , [ + rdfs:label "Switch to Meson build system." + ] , [ + rdfs:label "Separate API headers from data." + ] , [ + rdfs:label "Rearrange source tree to be directly usable by dependants." + ] + ] + ] , [ + doap:revision "1.18.4" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] , [ + rdfs:label "Fix build issues with newer toolchains." + ] + ] + ] , [ + doap:revision "1.18.2" ; + doap:created "2021-01-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "eg-sampler: Save and restore gain parameter value." + ] , [ + rdfs:label "Various code cleanups and infrastructure improvements." + ] + ] + ] , [ + doap:revision "1.18.0" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Improve documentation." + ] , [ + rdfs:label "Separate extended documentation from primary data." + ] + ] + ] , [ + doap:revision "1.16.0" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add core/attributes.h utility header." + ] , [ + rdfs:label "eg-sampler: Add waveform display to UI." + ] , [ + rdfs:label "eg-midigate: Respond to \"all notes off\" MIDI message." + ] , [ + rdfs:label "Simplify use of lv2specgen." + ] , [ + rdfs:label "Add lv2_validate utility." + ] , [ + rdfs:label "Install headers to simpler paths." + ] , [ + rdfs:label "Aggressively deprecate uri-map and event extensions." + ] , [ + rdfs:label "Upgrade build system and fix building with Python 3.7." + ] + ] + ] , [ + doap:revision "1.14.0" ; + doap:created "2016-09-19" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label """eg-scope: Don't feed back UI state updates.""" + ] , [ + rdfs:label "eg-sampler: Fix handling of state file paths." + ] , [ + rdfs:label "eg-sampler: Support thread-safe state restoration." + ] + ] + ] , [ + doap:revision "1.12.0" ; + doap:created "2015-04-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "eg-sampler: Support patch:Get, and request initial state from UI." + ] , [ + rdfs:label "eg-sampler: Add gain parameter." + ] , [ + rdfs:label "Fix merging of version histories in specification documentation." + ] , [ + rdfs:label "Improve API documentation." + ] , [ + rdfs:label "Simplify property restrictions by removing redundancy." + ] + ] + ] , [ + doap:revision "1.10.0" ; + doap:created "2014-08-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "lv2specgen: Display deprecated warning on classes marked owl:deprecated." + ] , [ + rdfs:label "Fix -Wconversion warnings in headers." + ] , [ + rdfs:label "Upgrade to waf 1.7.16." + ] + ] + ] , [ + doap:revision "1.8.0" ; + doap:created "2014-01-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add scope example plugin from Robin Gareus." + ] , [ + rdfs:label "lv2specgen: Fix links to externally defined terms." + ] , [ + rdfs:label "Install lv2specgen for use by other projects." + ] + ] + ] , [ + doap:revision "1.6.0" ; + doap:created "2013-08-09" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix port indices of metronome example." + ] , [ + rdfs:label "Fix lv2specgen usage from command line." + ] , [ + rdfs:label "Upgrade to waf 1.7.11." + ] + ] + ] , [ + doap:revision "1.4.0" ; + doap:created "2013-02-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add metronome example plugin to demonstrate sample accurate tempo sync." + ] , [ + rdfs:label "Generate book-style HTML documentation from example plugins." + ] + ] + ] , [ + doap:revision "1.2.0" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Move all project metadata for extensions (e.g. change log) to separate files to spare hosts from loading them during discovery." + ] , [ + rdfs:label "Use stricter datatype definitions conformant with the XSD and OWL specifications for better validation." + ] + ] + ] , [ + doap:revision "1.0.0" ; + doap:created "2012-04-16" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label """Initial release as a unified project. Projects can now simply depend on the pkg-config package 'lv2' for all official LV2 APIs.""" + ] , [ + rdfs:label "New extensions: atom, log, parameters, patch, port-groups, port-props, resize-port, state, time, worker." + ] + ] + ] . + diff --git a/lv2/core.lv2/people.ttl b/lv2/core.lv2/people.ttl new file mode 100644 index 0000000..52d0384 --- /dev/null +++ b/lv2/core.lv2/people.ttl @@ -0,0 +1,51 @@ +@prefix foaf: . +@prefix meta: . +@prefix rdfs: . + + + a foaf:Person ; + foaf:name "David Robillard" ; + foaf:mbox ; + rdfs:seeAlso . + + + a foaf:Person ; + foaf:name "Steve Harris" ; + foaf:mbox ; + rdfs:seeAlso . + +meta:larsl + a foaf:Person ; + foaf:name "Lars Luthman" ; + foaf:mbox . + +meta:gabrbedd + a foaf:Person ; + foaf:name "Gabriel M. Beddingfield" ; + foaf:mbox . + +meta:daste + a foaf:Person ; + foaf:name """Stefano D'Angelo""" ; + foaf:mbox . + +meta:kfoltman + a foaf:Person ; + foaf:name "Krzysztof Foltman" ; + foaf:mbox . + +meta:paniq + a foaf:Person ; + foaf:name "Leonard Ritter" ; + foaf:mbox . + +meta:harry + a foaf:Person ; + foaf:name "Harry van Haaren" ; + foaf:mbox . + +meta:bmwiedemann + a foaf:Person ; + foaf:name "Bernhard M. Wiedemann" ; + foaf:mbox . + diff --git a/lv2/core/attributes.h b/lv2/core/attributes.h deleted file mode 100644 index 81791a2..0000000 --- a/lv2/core/attributes.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2018 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_CORE_ATTRIBUTES_H -#define LV2_CORE_ATTRIBUTES_H - -/** - @defgroup attributes Attributes - @ingroup lv2 - - Macros for source code attributes. - - @{ -*/ - -#if defined(__GNUC__) && __GNUC__ > 3 -# define LV2_DEPRECATED __attribute__((__deprecated__)) -#else -# define LV2_DEPRECATED -#endif - -#if defined(__clang__) -# define LV2_DISABLE_DEPRECATION_WARNINGS \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") -#elif defined(__GNUC__) && __GNUC__ > 4 -# define LV2_DISABLE_DEPRECATION_WARNINGS \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#else -# define LV2_DISABLE_DEPRECATION_WARNINGS -#endif - -#if defined(__clang__) -# define LV2_RESTORE_WARNINGS _Pragma("clang diagnostic pop") -#elif defined(__GNUC__) && __GNUC__ > 4 -# define LV2_RESTORE_WARNINGS _Pragma("GCC diagnostic pop") -#else -# define LV2_RESTORE_WARNINGS -#endif - -/** - @} -*/ - -#endif /* LV2_CORE_ATTRIBUTES_H */ diff --git a/lv2/core/lv2.h b/lv2/core/lv2.h deleted file mode 100644 index 84c40a5..0000000 --- a/lv2/core/lv2.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - LV2 - An audio plugin interface specification. - Copyright 2006-2012 Steve Harris, David Robillard. - - Based on LADSPA, Copyright 2000-2002 Richard W.E. Furse, - Paul Barton-Davis, Stefan Westerfeld. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_H_INCLUDED -#define LV2_H_INCLUDED - -/** - @defgroup lv2 LV2 - - The LV2 specification. - - @{ -*/ - -/** - @defgroup lv2core LV2 Core - - Core LV2 specification. - - See for details. - - @{ -*/ - -#include - -// clang-format off - -#define LV2_CORE_URI "http://lv2plug.in/ns/lv2core" ///< http://lv2plug.in/ns/lv2core -#define LV2_CORE_PREFIX LV2_CORE_URI "#" ///< http://lv2plug.in/ns/lv2core# - -#define LV2_CORE__AllpassPlugin LV2_CORE_PREFIX "AllpassPlugin" ///< http://lv2plug.in/ns/lv2core#AllpassPlugin -#define LV2_CORE__AmplifierPlugin LV2_CORE_PREFIX "AmplifierPlugin" ///< http://lv2plug.in/ns/lv2core#AmplifierPlugin -#define LV2_CORE__AnalyserPlugin LV2_CORE_PREFIX "AnalyserPlugin" ///< http://lv2plug.in/ns/lv2core#AnalyserPlugin -#define LV2_CORE__AudioPort LV2_CORE_PREFIX "AudioPort" ///< http://lv2plug.in/ns/lv2core#AudioPort -#define LV2_CORE__BandpassPlugin LV2_CORE_PREFIX "BandpassPlugin" ///< http://lv2plug.in/ns/lv2core#BandpassPlugin -#define LV2_CORE__CVPort LV2_CORE_PREFIX "CVPort" ///< http://lv2plug.in/ns/lv2core#CVPort -#define LV2_CORE__ChorusPlugin LV2_CORE_PREFIX "ChorusPlugin" ///< http://lv2plug.in/ns/lv2core#ChorusPlugin -#define LV2_CORE__CombPlugin LV2_CORE_PREFIX "CombPlugin" ///< http://lv2plug.in/ns/lv2core#CombPlugin -#define LV2_CORE__CompressorPlugin LV2_CORE_PREFIX "CompressorPlugin" ///< http://lv2plug.in/ns/lv2core#CompressorPlugin -#define LV2_CORE__ConstantPlugin LV2_CORE_PREFIX "ConstantPlugin" ///< http://lv2plug.in/ns/lv2core#ConstantPlugin -#define LV2_CORE__ControlPort LV2_CORE_PREFIX "ControlPort" ///< http://lv2plug.in/ns/lv2core#ControlPort -#define LV2_CORE__ConverterPlugin LV2_CORE_PREFIX "ConverterPlugin" ///< http://lv2plug.in/ns/lv2core#ConverterPlugin -#define LV2_CORE__DelayPlugin LV2_CORE_PREFIX "DelayPlugin" ///< http://lv2plug.in/ns/lv2core#DelayPlugin -#define LV2_CORE__DistortionPlugin LV2_CORE_PREFIX "DistortionPlugin" ///< http://lv2plug.in/ns/lv2core#DistortionPlugin -#define LV2_CORE__DynamicsPlugin LV2_CORE_PREFIX "DynamicsPlugin" ///< http://lv2plug.in/ns/lv2core#DynamicsPlugin -#define LV2_CORE__EQPlugin LV2_CORE_PREFIX "EQPlugin" ///< http://lv2plug.in/ns/lv2core#EQPlugin -#define LV2_CORE__EnvelopePlugin LV2_CORE_PREFIX "EnvelopePlugin" ///< http://lv2plug.in/ns/lv2core#EnvelopePlugin -#define LV2_CORE__ExpanderPlugin LV2_CORE_PREFIX "ExpanderPlugin" ///< http://lv2plug.in/ns/lv2core#ExpanderPlugin -#define LV2_CORE__ExtensionData LV2_CORE_PREFIX "ExtensionData" ///< http://lv2plug.in/ns/lv2core#ExtensionData -#define LV2_CORE__Feature LV2_CORE_PREFIX "Feature" ///< http://lv2plug.in/ns/lv2core#Feature -#define LV2_CORE__FilterPlugin LV2_CORE_PREFIX "FilterPlugin" ///< http://lv2plug.in/ns/lv2core#FilterPlugin -#define LV2_CORE__FlangerPlugin LV2_CORE_PREFIX "FlangerPlugin" ///< http://lv2plug.in/ns/lv2core#FlangerPlugin -#define LV2_CORE__FunctionPlugin LV2_CORE_PREFIX "FunctionPlugin" ///< http://lv2plug.in/ns/lv2core#FunctionPlugin -#define LV2_CORE__GatePlugin LV2_CORE_PREFIX "GatePlugin" ///< http://lv2plug.in/ns/lv2core#GatePlugin -#define LV2_CORE__GeneratorPlugin LV2_CORE_PREFIX "GeneratorPlugin" ///< http://lv2plug.in/ns/lv2core#GeneratorPlugin -#define LV2_CORE__HighpassPlugin LV2_CORE_PREFIX "HighpassPlugin" ///< http://lv2plug.in/ns/lv2core#HighpassPlugin -#define LV2_CORE__InputPort LV2_CORE_PREFIX "InputPort" ///< http://lv2plug.in/ns/lv2core#InputPort -#define LV2_CORE__InstrumentPlugin LV2_CORE_PREFIX "InstrumentPlugin" ///< http://lv2plug.in/ns/lv2core#InstrumentPlugin -#define LV2_CORE__LimiterPlugin LV2_CORE_PREFIX "LimiterPlugin" ///< http://lv2plug.in/ns/lv2core#LimiterPlugin -#define LV2_CORE__LowpassPlugin LV2_CORE_PREFIX "LowpassPlugin" ///< http://lv2plug.in/ns/lv2core#LowpassPlugin -#define LV2_CORE__MixerPlugin LV2_CORE_PREFIX "MixerPlugin" ///< http://lv2plug.in/ns/lv2core#MixerPlugin -#define LV2_CORE__ModulatorPlugin LV2_CORE_PREFIX "ModulatorPlugin" ///< http://lv2plug.in/ns/lv2core#ModulatorPlugin -#define LV2_CORE__MultiEQPlugin LV2_CORE_PREFIX "MultiEQPlugin" ///< http://lv2plug.in/ns/lv2core#MultiEQPlugin -#define LV2_CORE__OscillatorPlugin LV2_CORE_PREFIX "OscillatorPlugin" ///< http://lv2plug.in/ns/lv2core#OscillatorPlugin -#define LV2_CORE__OutputPort LV2_CORE_PREFIX "OutputPort" ///< http://lv2plug.in/ns/lv2core#OutputPort -#define LV2_CORE__ParaEQPlugin LV2_CORE_PREFIX "ParaEQPlugin" ///< http://lv2plug.in/ns/lv2core#ParaEQPlugin -#define LV2_CORE__PhaserPlugin LV2_CORE_PREFIX "PhaserPlugin" ///< http://lv2plug.in/ns/lv2core#PhaserPlugin -#define LV2_CORE__PitchPlugin LV2_CORE_PREFIX "PitchPlugin" ///< http://lv2plug.in/ns/lv2core#PitchPlugin -#define LV2_CORE__Plugin LV2_CORE_PREFIX "Plugin" ///< http://lv2plug.in/ns/lv2core#Plugin -#define LV2_CORE__PluginBase LV2_CORE_PREFIX "PluginBase" ///< http://lv2plug.in/ns/lv2core#PluginBase -#define LV2_CORE__Point LV2_CORE_PREFIX "Point" ///< http://lv2plug.in/ns/lv2core#Point -#define LV2_CORE__Port LV2_CORE_PREFIX "Port" ///< http://lv2plug.in/ns/lv2core#Port -#define LV2_CORE__PortProperty LV2_CORE_PREFIX "PortProperty" ///< http://lv2plug.in/ns/lv2core#PortProperty -#define LV2_CORE__Resource LV2_CORE_PREFIX "Resource" ///< http://lv2plug.in/ns/lv2core#Resource -#define LV2_CORE__ReverbPlugin LV2_CORE_PREFIX "ReverbPlugin" ///< http://lv2plug.in/ns/lv2core#ReverbPlugin -#define LV2_CORE__ScalePoint LV2_CORE_PREFIX "ScalePoint" ///< http://lv2plug.in/ns/lv2core#ScalePoint -#define LV2_CORE__SimulatorPlugin LV2_CORE_PREFIX "SimulatorPlugin" ///< http://lv2plug.in/ns/lv2core#SimulatorPlugin -#define LV2_CORE__SpatialPlugin LV2_CORE_PREFIX "SpatialPlugin" ///< http://lv2plug.in/ns/lv2core#SpatialPlugin -#define LV2_CORE__Specification LV2_CORE_PREFIX "Specification" ///< http://lv2plug.in/ns/lv2core#Specification -#define LV2_CORE__SpectralPlugin LV2_CORE_PREFIX "SpectralPlugin" ///< http://lv2plug.in/ns/lv2core#SpectralPlugin -#define LV2_CORE__UtilityPlugin LV2_CORE_PREFIX "UtilityPlugin" ///< http://lv2plug.in/ns/lv2core#UtilityPlugin -#define LV2_CORE__WaveshaperPlugin LV2_CORE_PREFIX "WaveshaperPlugin" ///< http://lv2plug.in/ns/lv2core#WaveshaperPlugin -#define LV2_CORE__appliesTo LV2_CORE_PREFIX "appliesTo" ///< http://lv2plug.in/ns/lv2core#appliesTo -#define LV2_CORE__binary LV2_CORE_PREFIX "binary" ///< http://lv2plug.in/ns/lv2core#binary -#define LV2_CORE__connectionOptional LV2_CORE_PREFIX "connectionOptional" ///< http://lv2plug.in/ns/lv2core#connectionOptional -#define LV2_CORE__control LV2_CORE_PREFIX "control" ///< http://lv2plug.in/ns/lv2core#control -#define LV2_CORE__default LV2_CORE_PREFIX "default" ///< http://lv2plug.in/ns/lv2core#default -#define LV2_CORE__designation LV2_CORE_PREFIX "designation" ///< http://lv2plug.in/ns/lv2core#designation -#define LV2_CORE__documentation LV2_CORE_PREFIX "documentation" ///< http://lv2plug.in/ns/lv2core#documentation -#define LV2_CORE__enabled LV2_CORE_PREFIX "enabled" ///< http://lv2plug.in/ns/lv2core#enabled -#define LV2_CORE__enumeration LV2_CORE_PREFIX "enumeration" ///< http://lv2plug.in/ns/lv2core#enumeration -#define LV2_CORE__extensionData LV2_CORE_PREFIX "extensionData" ///< http://lv2plug.in/ns/lv2core#extensionData -#define LV2_CORE__freeWheeling LV2_CORE_PREFIX "freeWheeling" ///< http://lv2plug.in/ns/lv2core#freeWheeling -#define LV2_CORE__hardRTCapable LV2_CORE_PREFIX "hardRTCapable" ///< http://lv2plug.in/ns/lv2core#hardRTCapable -#define LV2_CORE__inPlaceBroken LV2_CORE_PREFIX "inPlaceBroken" ///< http://lv2plug.in/ns/lv2core#inPlaceBroken -#define LV2_CORE__index LV2_CORE_PREFIX "index" ///< http://lv2plug.in/ns/lv2core#index -#define LV2_CORE__integer LV2_CORE_PREFIX "integer" ///< http://lv2plug.in/ns/lv2core#integer -#define LV2_CORE__isLive LV2_CORE_PREFIX "isLive" ///< http://lv2plug.in/ns/lv2core#isLive -#define LV2_CORE__latency LV2_CORE_PREFIX "latency" ///< http://lv2plug.in/ns/lv2core#latency -#define LV2_CORE__maximum LV2_CORE_PREFIX "maximum" ///< http://lv2plug.in/ns/lv2core#maximum -#define LV2_CORE__microVersion LV2_CORE_PREFIX "microVersion" ///< http://lv2plug.in/ns/lv2core#microVersion -#define LV2_CORE__minimum LV2_CORE_PREFIX "minimum" ///< http://lv2plug.in/ns/lv2core#minimum -#define LV2_CORE__minorVersion LV2_CORE_PREFIX "minorVersion" ///< http://lv2plug.in/ns/lv2core#minorVersion -#define LV2_CORE__name LV2_CORE_PREFIX "name" ///< http://lv2plug.in/ns/lv2core#name -#define LV2_CORE__optionalFeature LV2_CORE_PREFIX "optionalFeature" ///< http://lv2plug.in/ns/lv2core#optionalFeature -#define LV2_CORE__port LV2_CORE_PREFIX "port" ///< http://lv2plug.in/ns/lv2core#port -#define LV2_CORE__portProperty LV2_CORE_PREFIX "portProperty" ///< http://lv2plug.in/ns/lv2core#portProperty -#define LV2_CORE__project LV2_CORE_PREFIX "project" ///< http://lv2plug.in/ns/lv2core#project -#define LV2_CORE__prototype LV2_CORE_PREFIX "prototype" ///< http://lv2plug.in/ns/lv2core#prototype -#define LV2_CORE__reportsLatency LV2_CORE_PREFIX "reportsLatency" ///< http://lv2plug.in/ns/lv2core#reportsLatency -#define LV2_CORE__requiredFeature LV2_CORE_PREFIX "requiredFeature" ///< http://lv2plug.in/ns/lv2core#requiredFeature -#define LV2_CORE__sampleRate LV2_CORE_PREFIX "sampleRate" ///< http://lv2plug.in/ns/lv2core#sampleRate -#define LV2_CORE__scalePoint LV2_CORE_PREFIX "scalePoint" ///< http://lv2plug.in/ns/lv2core#scalePoint -#define LV2_CORE__symbol LV2_CORE_PREFIX "symbol" ///< http://lv2plug.in/ns/lv2core#symbol -#define LV2_CORE__toggled LV2_CORE_PREFIX "toggled" ///< http://lv2plug.in/ns/lv2core#toggled - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Plugin Instance Handle. - - This is a handle for one particular instance of a plugin. It is valid to - compare to NULL (or 0 for C++) but otherwise the host MUST NOT attempt to - interpret it. -*/ -typedef void* LV2_Handle; - -/** - Feature. - - Features allow hosts to make additional functionality available to plugins - without requiring modification to the LV2 API. Extensions may define new - features and specify the `URI` and `data` to be used if necessary. - Some features, such as lv2:isLive, do not require the host to pass data. -*/ -typedef struct { - /** - A globally unique, case-sensitive identifier (URI) for this feature. - - This MUST be a valid URI string as defined by RFC 3986. - */ - const char* URI; - - /** - Pointer to arbitrary data. - - The format of this data is defined by the extension which describes the - feature with the given `URI`. - */ - void* data; -} LV2_Feature; - -/** - Plugin Descriptor. - - This structure provides the core functions necessary to instantiate and use - a plugin. -*/ -typedef struct LV2_Descriptor { - /** - A globally unique, case-sensitive identifier for this plugin. - - This MUST be a valid URI string as defined by RFC 3986. All plugins with - the same URI MUST be compatible to some degree, see - http://lv2plug.in/ns/lv2core for details. - */ - const char* URI; - - /** - Instantiate the plugin. - - Note that instance initialisation should generally occur in activate() - rather than here. If a host calls instantiate(), it MUST call cleanup() - at some point in the future. - - @param descriptor Descriptor of the plugin to instantiate. - - @param sample_rate Sample rate, in Hz, for the new plugin instance. - - @param bundle_path Path to the LV2 bundle which contains this plugin - binary. It MUST include the trailing directory separator so that simply - appending a filename will yield the path to that file in the bundle. - - @param features A NULL terminated array of LV2_Feature structs which - represent the features the host supports. Plugins may refuse to - instantiate if required features are not found here. However, hosts MUST - NOT use this as a discovery mechanism: instead, use the RDF data to - determine which features are required and do not attempt to instantiate - unsupported plugins at all. This parameter MUST NOT be NULL, i.e. a host - that supports no features MUST pass a single element array containing - NULL. - - @return A handle for the new plugin instance, or NULL if instantiation - has failed. - */ - LV2_Handle (*instantiate)(const struct LV2_Descriptor* descriptor, - double sample_rate, - const char* bundle_path, - const LV2_Feature* const* features); - - /** - Connect a port on a plugin instance to a memory location. - - Plugin writers should be aware that the host may elect to use the same - buffer for more than one port and even use the same buffer for both - input and output (see lv2:inPlaceBroken in lv2.ttl). - - If the plugin has the feature lv2:hardRTCapable then there are various - things that the plugin MUST NOT do within the connect_port() function; - see lv2core.ttl for details. - - connect_port() MUST be called at least once for each port before run() - is called, unless that port is lv2:connectionOptional. The plugin must - pay careful attention to the block size passed to run() since the block - allocated may only just be large enough to contain the data, and is not - guaranteed to remain constant between run() calls. - - connect_port() may be called more than once for a plugin instance to - allow the host to change the buffers that the plugin is reading or - writing. These calls may be made before or after activate() or - deactivate() calls. - - @param instance Plugin instance containing the port. - - @param port Index of the port to connect. The host MUST NOT try to - connect a port index that is not defined in the plugin's RDF data. If - it does, the plugin's behaviour is undefined (a crash is likely). - - @param data_location Pointer to data of the type defined by the port - type in the plugin's RDF data (for example, an array of float for an - lv2:AudioPort). This pointer must be stored by the plugin instance and - used to read/write data when run() is called. Data present at the time - of the connect_port() call MUST NOT be considered meaningful. - */ - void (*connect_port)(LV2_Handle instance, uint32_t port, void* data_location); - - /** - Initialise a plugin instance and activate it for use. - - This is separated from instantiate() to aid real-time support and so - that hosts can reinitialise a plugin instance by calling deactivate() - and then activate(). In this case the plugin instance MUST reset all - state information dependent on the history of the plugin instance except - for any data locations provided by connect_port(). If there is nothing - for activate() to do then this field may be NULL. - - When present, hosts MUST call this function once before run() is called - for the first time. This call SHOULD be made as close to the run() call - as possible and indicates to real-time plugins that they are now live, - however plugins MUST NOT rely on a prompt call to run() after - activate(). - - The host MUST NOT call activate() again until deactivate() has been - called first. If a host calls activate(), it MUST call deactivate() at - some point in the future. Note that connect_port() may be called before - or after activate(). - */ - void (*activate)(LV2_Handle instance); - - /** - Run a plugin instance for a block. - - Note that if an activate() function exists then it must be called before - run(). If deactivate() is called for a plugin instance then run() may - not be called until activate() has been called again. - - If the plugin has the feature lv2:hardRTCapable then there are various - things that the plugin MUST NOT do within the run() function (see - lv2core.ttl for details). - - As a special case, when `sample_count` is 0, the plugin should update - any output ports that represent a single instant in time (for example, - control ports, but not audio ports). This is particularly useful for - latent plugins, which should update their latency output port so hosts - can pre-roll plugins to compute latency. Plugins MUST NOT crash when - `sample_count` is 0. - - @param instance Instance to be run. - - @param sample_count The block size (in samples) for which the plugin - instance must run. - */ - void (*run)(LV2_Handle instance, uint32_t sample_count); - - /** - Deactivate a plugin instance (counterpart to activate()). - - Hosts MUST deactivate all activated instances after they have been run() - for the last time. This call SHOULD be made as close to the last run() - call as possible and indicates to real-time plugins that they are no - longer live, however plugins MUST NOT rely on prompt deactivation. If - there is nothing for deactivate() to do then this field may be NULL - - Deactivation is not similar to pausing since the plugin instance will be - reinitialised by activate(). However, deactivate() itself MUST NOT fully - reset plugin state. For example, the host may deactivate a plugin, then - store its state (using some extension to do so). - - Hosts MUST NOT call deactivate() unless activate() was previously - called. Note that connect_port() may be called before or after - deactivate(). - */ - void (*deactivate)(LV2_Handle instance); - - /** - Clean up a plugin instance (counterpart to instantiate()). - - Once an instance of a plugin has been finished with it must be deleted - using this function. The instance handle passed ceases to be valid after - this call. - - If activate() was called for a plugin instance then a corresponding call - to deactivate() MUST be made before cleanup() is called. Hosts MUST NOT - call cleanup() unless instantiate() was previously called. - */ - void (*cleanup)(LV2_Handle instance); - - /** - Return additional plugin data defined by some extension. - - A typical use of this facility is to return a struct containing function - pointers to extend the LV2_Descriptor API. - - The actual type and meaning of the returned object MUST be specified - precisely by the extension. This function MUST return NULL for any - unsupported URI. If a plugin does not support any extension data, this - field may be NULL. - - The host is never responsible for freeing the returned value. - */ - const void* (*extension_data)(const char* uri); -} LV2_Descriptor; - -/** - Helper macro needed for LV2_SYMBOL_EXPORT when using C++. -*/ -#ifdef __cplusplus -# define LV2_SYMBOL_EXTERN extern "C" -#else -# define LV2_SYMBOL_EXTERN -#endif - -/** - Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded - by the host as a symbol from the dynamic library. -*/ -#ifdef _WIN32 -# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport) -#else -# define LV2_SYMBOL_EXPORT \ - LV2_SYMBOL_EXTERN __attribute__((visibility("default"))) -#endif - -/** - Prototype for plugin accessor function. - - Plugins are discovered by hosts using RDF data (not by loading libraries). - See http://lv2plug.in for details on the discovery process, though most - hosts should use an existing library to implement this functionality. - - This is the simple plugin discovery API, suitable for most statically - defined plugins. Advanced plugins that need access to their bundle during - discovery can use lv2_lib_descriptor() instead. Plugin libraries MUST - include a function called "lv2_descriptor" or "lv2_lib_descriptor" with - C-style linkage, but SHOULD provide "lv2_descriptor" wherever possible. - - When it is time to load a plugin (designated by its URI), the host loads the - plugin's library, gets the lv2_descriptor() function from it, and uses this - function to find the LV2_Descriptor for the desired plugin. Plugins are - accessed by index using values from 0 upwards. This function MUST return - NULL for out of range indices, so the host can enumerate plugins by - increasing `index` until NULL is returned. - - Note that `index` has no meaning, hosts MUST NOT depend on it remaining - consistent between loads of the plugin library. -*/ -LV2_SYMBOL_EXPORT -const LV2_Descriptor* -lv2_descriptor(uint32_t index); - -/** - Type of the lv2_descriptor() function in a library (old discovery API). -*/ -typedef const LV2_Descriptor* (*LV2_Descriptor_Function)(uint32_t index); - -/** - Handle for a library descriptor. -*/ -typedef void* LV2_Lib_Handle; - -/** - Descriptor for a plugin library. - - To access a plugin library, the host creates an LV2_Lib_Descriptor via the - lv2_lib_descriptor() function in the shared object. -*/ -typedef struct { - /** - Opaque library data which must be passed as the first parameter to all - the methods of this struct. - */ - LV2_Lib_Handle handle; - - /** - The total size of this struct. This allows for this struct to be - expanded in the future if necessary. This MUST be set by the library to - sizeof(LV2_Lib_Descriptor). The host MUST NOT access any fields of this - struct beyond get_plugin() unless this field indicates they are present. - */ - uint32_t size; - - /** - Destroy this library descriptor and free all related resources. - */ - void (*cleanup)(LV2_Lib_Handle handle); - - /** - Plugin accessor. - - Plugins are accessed by index using values from 0 upwards. Out of range - indices MUST result in this function returning NULL, so the host can - enumerate plugins by increasing `index` until NULL is returned. - */ - const LV2_Descriptor* (*get_plugin)(LV2_Lib_Handle handle, uint32_t index); -} LV2_Lib_Descriptor; - -/** - Prototype for library accessor function. - - This is the more advanced discovery API, which allows plugin libraries to - access their bundles during discovery, which makes it possible for plugins to - be dynamically defined by files in their bundle. This API also has an - explicit cleanup function, removing any need for non-portable shared library - destructors. Simple plugins that do not require these features may use - lv2_descriptor() instead. - - This is the entry point for a plugin library. Hosts load this symbol from - the library and call this function to obtain a library descriptor which can - be used to access all the contained plugins. The returned object must not - be destroyed (using LV2_Lib_Descriptor::cleanup()) until all plugins loaded - from that library have been destroyed. -*/ -LV2_SYMBOL_EXPORT -const LV2_Lib_Descriptor* -lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features); - -/** - Type of the lv2_lib_descriptor() function in an LV2 library. -*/ -typedef const LV2_Lib_Descriptor* (*LV2_Lib_Descriptor_Function)( - const char* bundle_path, - const LV2_Feature* const* features); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} - @} -*/ - -#endif /* LV2_H_INCLUDED */ diff --git a/lv2/core/lv2_util.h b/lv2/core/lv2_util.h deleted file mode 100644 index f3766aa..0000000 --- a/lv2/core/lv2_util.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright 2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - @defgroup util Utilities - @ingroup lv2core - @{ -*/ - -#include "lv2/core/lv2.h" - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Return the data for a feature in a features array. - - If the feature is not found, NULL is returned. Note that this function is - only useful for features with data, and can not detect features that are - present but have NULL data. -*/ -static inline void* -lv2_features_data(const LV2_Feature* const* features, const char* const uri) -{ - if (features) { - for (const LV2_Feature* const* f = features; *f; ++f) { - if (!strcmp(uri, (*f)->URI)) { - return (*f)->data; - } - } - } - return NULL; -} - -/** - Query a features array. - - This function allows getting several features in one call, and detect - missing required features, with the same caveat of lv2_features_data(). - - The arguments should be a series of const char* uri, void** data, bool - required, terminated by a NULL URI. The data pointers MUST be initialized - to NULL. For example: - - @code - LV2_URID_Log* log = NULL; - LV2_URID_Map* map = NULL; - const char* missing = lv2_features_query( - features, - LV2_LOG__log, &log, false, - LV2_URID__map, &map, true, - NULL); - @endcode - - @return NULL on success, otherwise the URI of this missing feature. -*/ -static inline const char* -lv2_features_query(const LV2_Feature* const* features, ...) -{ - va_list args; - va_start(args, features); - - const char* uri = NULL; - while ((uri = va_arg(args, const char*))) { - void** data = va_arg(args, void**); - bool required = (bool)va_arg(args, int); - - *data = lv2_features_data(features, uri); - if (required && !*data) { - va_end(args); - return uri; - } - } - - va_end(args); - return NULL; -} - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ diff --git a/lv2/core/lv2core.meta.ttl b/lv2/core/lv2core.meta.ttl deleted file mode 100644 index 9faea9d..0000000 --- a/lv2/core/lv2core.meta.ttl +++ /dev/null @@ -1,915 +0,0 @@ -@prefix lv2: . -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2" ; - doap:homepage ; - doap:created "2004-04-21" ; - doap:shortdesc "An extensible open standard for audio plugins" ; - doap:programming-language "C" ; - doap:developer , - ; - doap:maintainer ; - doap:release [ - doap:revision "18.4" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] - ] - ] , [ - doap:revision "18.0" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2:Markdown datatype." - ] , [ - rdfs:label "Deprecate lv2:reportsLatency." - ] - ] - ] , [ - doap:revision "16.0" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2:MIDIPlugin class." - ] , [ - rdfs:label "Rework port restrictions so that presets can be validated." - ] - ] - ] , [ - doap:revision "14.0" ; - doap:created "2016-09-18" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2_util.h with lv2_features_data() and lv2_features_query()." - ] , [ - rdfs:label "Add lv2:enabled designation." - ] - ] - ] , [ - doap:revision "12.4" ; - doap:created "2015-04-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Relax domain of lv2:minimum lv2:maximum and lv2:default so they can be used to describe properties/parameters as well." - ] , [ - rdfs:label "Add extern C and visibility attribute to LV2_SYMBOL_EXPORT." - ] , [ - rdfs:label "Add lv2:isSideChain port property." - ] - ] - ] , [ - doap:revision "12.2" ; - doap:created "2014-08-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Clarify lv2_descriptor() and lv2_lib_descriptor() documentation." - ] - ] - ] , [ - doap:revision "12.0" ; - doap:created "2014-01-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2:prototype for property inheritance." - ] - ] - ] , [ - doap:revision "10.0" ; - doap:created "2013-02-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2:EnvelopePlugin class." - ] , [ - rdfs:label "Add lv2:control for designating primary event-based control ports." - ] , [ - rdfs:label "Set range of lv2:designation to lv2:Designation." - ] , [ - rdfs:label "Make lv2:Parameter rdfs:subClassOf rdf:Property." - ] , [ - rdfs:label "Reserve minor version 0 for unstable development plugins." - ] - ] - ] , [ - doap:revision "8.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "8.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix LV2_SYMBOL_EXPORT and lv2_descriptor prototype for Windows." - ] , [ - rdfs:label "Add metadata concept of a designation, a channel or parameter description which can be assigned to ports for more intelligent use by hosts." - ] , [ - rdfs:label "Add new discovery API which allows libraries to read bundle files during discovery, makes library construction/destruction explicit, and adds extensibility to prevent future breakage." - ] , [ - rdfs:label "Relax the range of lv2:index so it can be used for things other than ports." - ] , [ - rdfs:label "Remove lv2:Resource, which turned out to be meaningless." - ] , [ - rdfs:label "Add lv2:CVPort." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "6.0" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Rename core.lv2 and lv2.ttl to lv2core.lv2 and lv2core.ttl to adhere to modern conventions." - ] , [ - rdfs:label "Add lv2:extensionData and lv2:ExtensionData for plugins to indicate that they support some URI for extension_data()." - ] , [ - rdfs:label "Remove lv2config in favour of the simple convention that specifications install headers to standard URI-based paths." - ] , [ - rdfs:label "Switch to the ISC license, a simple BSD-style license (with permission of all contributors to lv2.h and its ancestor, ladspa.h)." - ] , [ - rdfs:label "Make lv2core.ttl a valid OWL 2 DL ontology." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "4.0" ; - doap:created "2011-03-18" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Make doap:license suggested, but not required (for wrappers)." - ] , [ - rdfs:label "Define lv2:binary (MUST be in manifest.ttl)." - ] , [ - rdfs:label "Define lv2:minorVersion and lv2:microVersion (MUST be in manifest.ttl)." - ] , [ - rdfs:label "Define lv2:documentation and use it to document lv2core." - ] , [ - rdfs:label "Add lv2:FunctionPlugin and lv2:ConstantPlugin classes." - ] , [ - rdfs:label "Move lv2:AmplifierPlugin under lv2:DynamicsPlugin." - ] , [ - rdfs:label "Loosen domain of lv2:optionalFeature and lv2:requiredFeature (to allow re-use in extensions)." - ] , [ - rdfs:label "Add generic lv2:Resource and lv2:PluginBase classes." - ] , [ - rdfs:label "Fix definition of lv2:minimum etc. (used for values, not scale points)." - ] , [ - rdfs:label "More precisely define properties with OWL." - ] , [ - rdfs:label "Move project metadata to manifest." - ] , [ - rdfs:label "Add lv2:enumeration port property." - ] , [ - rdfs:label "Define run() pre-roll special case (sample_count == 0)." - ] - ] - ] , [ - doap:revision "3.0" ; - doap:created "2008-11-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Require that serialisations refer to ports by symbol rather than index." - ] , [ - rdfs:label "Minor stylistic changes to lv2.ttl." - ] , [ - rdfs:label "No header changes." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2008-02-10" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -LV2 is an interface for writing audio plugins in C or compatible languages, -which can be dynamically loaded into many _host_ applications. This core -specification is simple and minimal, but is designed so that _extensions_ can -be defined to add more advanced features, making it possible to implement -nearly any feature. - -LV2 maintains a strong distinction between code and data. Plugin code is in a -shared library, while data is in a companion data file written in -[Turtle](https://www.w3.org/TR/turtle/). Code, data, and any other resources -(such as waveforms) are shipped together in a bundle directory. The code -contains only the executable portions of the plugin. All other data is -provided in the data file(s). This makes plugin data flexible and extensible, -and allows the host to do everything but run the plugin without loading or -executing any code. Among other advantages, this makes hosts more robust -(broken plugins can't crash a host during discovery) and allows generic tools -written in any language to work with LV2 data. The LV2 specification itself is -distributed in a similar way. - -An LV2 plugin library is suitable for dynamic loading (for example with -`dlopen()`) and provides one or more plugin descriptors via `lv2_descriptor()` -or `lv2_lib_descriptor()`. These can be instantiated to create plugin -instances, which can be run directly on data or connected together to perform -advanced signal processing tasks. - -Plugins communicate via _ports_, which can transmit any type of data. Data is -processed by first connecting each port to a buffer, then repeatedly calling -the `run()` method to process blocks of data. - -This core specification defines two types of port, equivalent to those in -[LADSPA](http://www.ladspa.org/), lv2:ControlPort and lv2:AudioPort, as well as -lv2:CVPort which has the same format as an audio port but is interpreted as -non-audible control data. Audio ports contain arrays with one `float` element -per sample, allowing a block of audio to be processed in a single call to -`run()`. Control ports contain single `float` values, which are fixed and -valid for the duration of the call to `run()`. Thus the _control rate_ is -determined by the block size, which is controlled by the host (and not -necessarily constant). - -### Threading Rules - -To facilitate use in multi-threaded programs, LV2 functions are partitioned into -several threading classes: - -| Discovery Class | Instantiation Class | Audio Class | -|----------------------------------|-------------------------------|------------------------------- | -| lv2_descriptor() | LV2_Descriptor::instantiate() | LV2_Descriptor::run() | -| lv2_lib_descriptor() | LV2_Descriptor::cleanup() | LV2_Descriptor::connect_port() | -| LV2_Descriptor::extension_data() | LV2_Descriptor::activate() | | -| | LV2_Descriptor::deactivate() | | - -Hosts MUST guarantee that: - - * A function in any class is never called concurrently with another function - in that class. - - * A _Discovery_ function is never called concurrently with any other function - in the same shared object file. - - * An _Instantiation_ function for an instance is never called concurrently - with any other function for that instance. - -Any simultaneous calls that are not explicitly forbidden by these rules are -allowed. For example, a host may call `run()` for two different plugin -instances simultaneously. - -Plugin functions in any class MUST NOT manipulate any state which might affect -other plugins or the host (beyond the contract of that function), for example -by using non-reentrant global functions. - -Extensions to this specification which add new functions MUST declare in which -of these classes the functions belong, define new classes for them, or -otherwise precisely describe their threading rules. - -"""^^lv2:Markdown . - -lv2:Specification - lv2:documentation """ - -An LV2 specification typically contains a vocabulary description, C headers to -define an API, and any other resources that may be useful. Specifications, -like plugins, are distributed and installed as bundles so that hosts may -discover them. - -"""^^lv2:Markdown . - -lv2:Markdown - lv2:documentation """ - -This datatype is typically used for documentation in -[Markdown](https://daringfireball.net/projects/markdown/syntax) syntax. - -Generally, documentation with this datatype should stay as close to readable -plain text as possible, but may use core Markdown syntax for nicer -presentation. Documentation can assume that basic extensions like codehilite -and tables are available. - -"""^^lv2:Markdown . - -lv2:documentation - lv2:documentation """ - -Relates a Resource to extended documentation. - -LV2 specifications are documented using this property with an lv2:Markdown -datatype. - -If the value has no explicit datatype, it is assumed to be a valid XHTML Basic -1.1 fragment suitable for use as the content of the `body` element of a page. - -XHTML Basic is a W3C Recommendation which defines a simplified subset of XHTML -intended to be reasonable to implement with limited resources, for exampe on -embedded devices. See [XHTML Basic, Section -3](http://www.w3.org/TR/xhtml-basic/#s_xhtmlmodules) for a list of valid tags. - -"""^^lv2:Markdown . - -lv2:PluginBase - lv2:documentation """ - -An abstract plugin-like resource that may not actually be an LV2 plugin, for -example that may not have a lv2:binary. This is useful for describing things -that share common structure with a plugin, but are not themselves an actual -plugin, such as presets. - -"""^^lv2:Markdown . - -lv2:Plugin - lv2:documentation """ - -To be discovered by hosts, plugins MUST explicitly have an rdf:type of lv2:Plugin -in their bundle's manifest, for example: - - :::turtle - a lv2:Plugin . - -Plugins should have a doap:name property that is at most a few words in length -using title capitalization, for example Tape Delay Unit. - -"""^^lv2:Markdown . - -lv2:PortBase - lv2:documentation """ - -Similar to lv2:PluginBase, this is an abstract port-like resource that may not -be a fully specified LV2 port. For example, this is used for preset "ports" -which do not specify an index. - -"""^^lv2:Markdown . - -lv2:Port - lv2:documentation """ - -All LV2 port descriptions MUST have a rdf:type that is one of lv2:Port, -lv2:InputPort or lv2:OutputPort. Additionally, there MUST be at least one -other rdf:type which more precisely describes type of the port, for example -lv2:AudioPort. - -Hosts that do not support a specific port class MUST NOT instantiate the -plugin, unless that port has the lv2:connectionOptional property set. - -A port has two identifiers: a (numeric) index, and a (textual) symbol. The -index can be used as an identifier at run-time, but persistent references to -ports (for example in presets or save files) MUST use the symbol. Only the -symbol is guaranteed to refer to the same port on all plugins with a given URI, -that is the index for a port may differ between plugin binaries. - -"""^^lv2:Markdown . - -lv2:AudioPort - lv2:documentation """ - -Ports of this type are connected to a buffer of `float` audio samples, which -the host guarantees have `sample_count` elements in any call to -LV2_Descriptor::run(). - -Audio samples are normalized between -1.0 and 1.0, though there is no -requirement for samples to be strictly within this range. - -"""^^lv2:Markdown . - -lv2:CVPort - lv2:documentation """ - -Ports of this type have the same buffer format as an lv2:AudioPort, except the -buffer represents audio-rate control data rather than audio. Like a -lv2:ControlPort, a CV port SHOULD have properties describing its value, in -particular lv2:minimum, lv2:maximum, and lv2:default. - -Hosts may present CV ports to users as controls in the same way as control -ports. Conceptually, aside from the buffer format, a CV port is the same as a -control port, so hosts can use all the same properties and expectations. - -In particular, this port type does not imply any range, unit, or meaning for -its values. However, if there is no inherent unit to the values, for example -if the port is used to modulate some other value, then plugins SHOULD use a -normalized range, either from -1.0 to 1.0, or from 0.0 to 1.0. - -It is generally safe to connect an audio output to a CV input, but not -vice-versa. Hosts must take care to prevent data from a CVPort port from being -used as audio. - -"""^^lv2:Markdown . - -lv2:project - lv2:documentation """ - -This property provides a way to group plugins and/or related resources. A -project may have useful metadata common to all plugins (such as homepage, -author, version history) which would be wasteful to list separately for each -plugin. - -Grouping via projects also allows users to find plugins in hosts by project, -which is often how they are remembered. For this reason, a project that -contains plugins SHOULD always have a doap:name. It is also a good idea for -each plugin and the project itself to have an lv2:symbol property, which allows -nice quasi-global identifiers for plugins, for example `myproj.superamp` which -can be useful for display or fast user entry. - -"""^^lv2:Markdown . - -lv2:prototype - lv2:documentation """ - -This property can be used to include common properties in several -descriptions, serving as a sort of template mechanism. If a plugin has a -prototype, then the host must load all the properties for the prototype as if -they were properties of the plugin. That is, if `:plug lv2:prototype :prot`, -then for each triple `:prot p o`, the triple `:plug p o` should be loaded. - -This facility is useful for distributing data-only plugins that rely on a -common binary, for example those where the internal state is loaded from some -other file. Such plugins can refer to a prototype in a template LV2 bundle -which is installed by the corresponding software. - -"""^^lv2:Markdown . - -lv2:minorVersion - lv2:documentation """ - -This, along with lv2:microVersion, is used to distinguish between different -versions of the same resource, for example to load only the bundle with -the most recent version of a plugin. An LV2 version has a minor and micro -number with the usual semantics: - - * The minor version MUST be incremented when backwards (but not forwards) - compatible additions are made, for example the addition of a port to a - plugin. - - * The micro version is incremented for changes which do not affect - compatibility at all, for example bug fixes or documentation updates. - -Note that there is deliberately no major version: all versions with the same -URI are compatible by definition. Replacing a resource with a newer version of -that resource MUST NOT break anything. If a change violates this rule, then -the URI of the resource (which serves as the major version) MUST be changed. - -Plugins and extensions MUST adhere to at least the following rules: - - * All versions of a plugin with a given URI MUST have the same set of - mandatory (not lv2:connectionOptional) ports with respect to lv2:symbol and - rdf:type. In other words, every port on a particular version is guaranteed - to exist on a future version with same lv2:symbol and at least those - rdf:types. - - * New ports MAY be added without changing the plugin URI if and only if they - are lv2:connectionOptional and the minor version is incremented. - - * The minor version MUST be incremented if the index of any port (identified - by its symbol) is changed. - - * All versions of a specification MUST be compatible in the sense that an - implementation of the new version can interoperate with an implementation - of any previous version. - -Anything that depends on a specific version of a plugin (including referencing -ports by index) MUST refer to the plugin by both URI and version. However, -implementations should be tolerant where possible. - -When hosts discover several installed versions of a resource, they SHOULD warn -the user and load only the most recent version. - -An odd minor _or_ micro version, or minor version zero, indicates that the -resource is a development version. Hosts and tools SHOULD clearly indicate -this wherever appropriate. Minor version zero is a special case for -pre-release development of plugins, or experimental plugins that are not -intended for stable use at all. Hosts SHOULD NOT expect such a plugin to -remain compatible with any future version. Where feasible, hosts SHOULD NOT -expose such plugins to users by default, but may provide an option to display -them. - -"""^^lv2:Markdown . - -lv2:microVersion - lv2:documentation """ - -Releases of plugins and extensions MUST be explicitly versioned. Correct -version numbers MUST always be maintained for any versioned resource that is -published. For example, after a release, if a change is made in the development -version in source control, the micro version MUST be incremented (to an odd -number) to distinguish this modified version from the previous release. - -This property describes half of a resource version. For detailed documentation -on LV2 resource versioning, see lv2:minorVersion. - -"""^^lv2:Markdown . - -lv2:binary - lv2:documentation """ - -The value of this property must be the URI of a shared library object, -typically in the same bundle as the data file which contains this property. -The actual type of the library is platform specific. - -This is a required property of a lv2:Plugin which MUST be included in the -bundle's `manifest.ttl` file. The lv2:binary of a lv2:Plugin is the shared -object containing the lv2_descriptor() or lv2_lib_descriptor() function. This -probably may also be used similarly by extensions to relate other resources to -their implementations (it is not implied that a lv2:binary on an arbitrary -resource is an LV2 plugin library). - -"""^^lv2:Markdown . - -lv2:appliesTo - lv2:documentation """ - -This is primarily intended for discovery purposes: bundles that describe -resources that work with particular plugins (like presets or user interfaces) -SHOULD specify this in their `manifest.ttl` so the host can associate them with -the correct plugin. For example: - - :::turtle - - a ext:Thing ; - lv2:appliesTo ; - rdfs:seeAlso . - -Using this pattern is preferable for large amounts of data, since the host may -choose whether/when to load the data. - -"""^^lv2:Markdown . - -lv2:Symbol - lv2:documentation """ - -The first character of a symbol must be one of `_`, `a-z` or `A-Z`, and -subsequent characters may additionally be `0-9`. This is, among other things, -a valid C identifier, and generally compatible in most contexts which have -restrictions on string identifiers, such as file paths. - -"""^^lv2:Markdown . - -lv2:symbol - lv2:documentation """ - -The value of this property MUST be a valid lv2:Symbol, and MUST NOT have a -language tag. - -A symbol is a unique identifier with respect to the parent, for example a -port's symbol is a unique identifiers with respect to its plugin. The plugin -author MUST change the plugin URI if any port symbol is changed or removed. - -"""^^lv2:Markdown . - -lv2:name - lv2:documentation """ - -Unlike lv2:symbol, this is unrestricted, may be translated, and is not relevant -for compatibility. The name is not necessarily unique and MUST NOT be used as -an identifier. - -"""^^lv2:Markdown . - -lv2:shortName - lv2:documentation """ - -This is the same as lv2:name, with the additional requirement that the value is -shorter than 16 characters. - -"""^^lv2:Markdown . - -lv2:Designation - lv2:documentation """ - -A designation is metadata that describes the meaning or role of something. By -assigning a designation to a port using lv2:designation, the port's content -becomes meaningful and can be used more intelligently by the host. - -"""^^lv2:Markdown . - -lv2:Channel - lv2:documentation """ - -A specific channel, for example the left channel of a stereo stream. A -channel may be audio, or another type such as a MIDI control stream. - -"""^^lv2:Markdown . - -lv2:Parameter - lv2:documentation """ - -A parameter is a designation for a control. - -A parameter defines the meaning of a control, not the method of conveying its -value. For example, a parameter could be controlled via a lv2:ControlPort, -messages, or both. - -A lv2:ControlPort can be associated with a parameter using lv2:designation. - -"""^^lv2:Markdown . - -lv2:designation - lv2:documentation """ - -This property is used to give a port's contents a well-defined meaning. For -example, if a port has the designation `eg:gain`, then the value of that port -represents the `eg:gain` of the plugin instance. - -Ports should be given designations whenever possible, particularly if a -suitable designation is already defined. This allows the host to act more -intelligently and provide a more effective user interface. For example, if the -plugin has a BPM parameter, the host may automatically set that parameter to -the current tempo. - -"""^^lv2:Markdown . - -lv2:freeWheeling - lv2:documentation """ - -If true, this means that all processing is happening as quickly as possible, -not in real-time. When free-wheeling there is no relationship between the -passage of real wall-clock time and the passage of time in the data being -processed. - -"""^^lv2:Markdown . - -lv2:enabled - lv2:documentation """ - -If this value is greater than zero, the plugin processes normally. If this -value is zero, the plugin is expected to bypass all signals unmodified. The -plugin must provide a click-free transition between the enabled and disabled -(bypassed) states. - -Values less than zero are reserved for future use (such as click-free -insertion/removal of latent plugins), and should be treated like zero -(bypassed) by current implementations. - -"""^^lv2:Markdown . - -lv2:control - lv2:documentation """ - -This should be used as the lv2:designation of ports that are used to send -commands and receive responses. Typically this will be an event port that -supports some protocol, for example MIDI or LV2 Atoms. - -"""^^lv2:Markdown . - -lv2:Point - lv2:documentation """ - - * A Point MUST have at least one rdfs:label which is a string. - - * A Point MUST have exactly one rdf:value with a type that is compatible with - the type of the corresponding Port. - -"""^^lv2:Markdown . - -lv2:default - lv2:documentation """ - -The host SHOULD set the port to this value initially, and in any situation -where the port value should be cleared or reset. - -"""^^lv2:Markdown . - -lv2:minimum - lv2:documentation """ - -This is a soft limit: the plugin is required to gracefully accept all values in -the range of a port's data type. - -"""^^lv2:Markdown . - -lv2:maximum - lv2:documentation """ - -This is a soft limit: the plugin is required to gracefully accept all values in -the range of a port's data type. - -"""^^lv2:Markdown . - -lv2:optionalFeature - lv2:documentation """ - -To support this feature, the host MUST pass its URI and any additional data to -the plugin in LV2_Descriptor::instantiate(). - -The plugin MUST NOT fail to instantiate if an optional feature is not supported -by the host. - -"""^^lv2:Markdown . - -lv2:requiredFeature - lv2:documentation """ - -To support this feature, the host MUST pass its URI and any additional data to -the plugin in LV2_Descriptor::instantiate(). - -The host MUST check this property before attempting to instantiate a plugin, -and not attempt to instantiate plugins which require features it does not -support. The plugin MUST fail to instantiate if a required feature is not -supported by the host. Note that these rules are intentionally redundant for -resilience: neither host nor plugin should assume that the other does not -violate them. - -"""^^lv2:Markdown . - -lv2:ExtensionData - lv2:documentation """ - -This is additional data that a plugin may return from -LV2_Descriptor::extension_data(). This is generally used to add APIs to extend -that defined by LV2_Descriptor. - -"""^^lv2:Markdown . - -lv2:extensionData - lv2:documentation """ - -If a plugin has a value for this property, it must be a URI that defines the -extension data. The plugin should return the appropriate data when -LV2_Descriptor::extension_data() is called with that URI as a parameter. - -"""^^lv2:Markdown . - -lv2:isLive - lv2:documentation """ - -This feature is for plugins that have time-sensitive internals, for example -communicating in real time over a socket. It indicates to the host that its -input and output must not be cached or subject to significant latency, and that -calls to LV2_Descriptor::run() should be made at a rate that roughly -corresponds to wall clock time (according to the `sample_count` parameter). - -Note that this feature is not related to hard real-time execution -requirements (see lv2:hardRTCapable). - -"""^^lv2:Markdown . - -lv2:inPlaceBroken - lv2:documentation """ - -This feature indicates that the plugin may not work correctly if the host -elects to use the same data location for both input and output. Plugins that -will fail to work correctly if ANY input port is connected to the same location -as ANY output port MUST require this feature. Doing so should be avoided -whenever possible since it prevents hosts from running the plugin on data -in-place. - -"""^^lv2:Markdown . - -lv2:hardRTCapable - lv2:documentation """ - -This feature indicates that the plugin is capable of running in a hard -real-time environment. This should be the case for most audio processors, -so most plugins are expected to have this feature. - -To support this feature, plugins MUST adhere to the following in all of their -audio class functions (LV2_Descriptor::run() and -LV2_Descriptor::connect_port()): - - * There is no use of `malloc()`, `free()` or any other heap memory management - functions. - - * There is no use of any library functions which do not adhere to these - rules. The plugin may assume that the standard C math library functions - are safe. - - * There is no access to files, devices, pipes, sockets, system calls, or any - other mechanism that might result in the process or thread blocking. - - * The maximum amount of time for a `run()` call is bounded by some expression - of the form `A + B * sample_count`, where `A` and `B` are platform specific - constants. Note that this bound does not depend on input signals or plugin - state. - -"""^^lv2:Markdown . - -lv2:portProperty - lv2:documentation """ - -States that a port has a particular lv2:PortProperty. This may be ignored -without catastrophic effects, though it may be useful, for example to provide a -sensible user interface for the port. - -"""^^lv2:Markdown . - -lv2:connectionOptional - lv2:documentation """ - -This property means that the port does not have to be connected to valid data -by the host. To leave a port unconnected, the host MUST explicitly -connect the port to `NULL`. - -"""^^lv2:Markdown . - -lv2:reportsLatency - lv2:documentation """ - -This property indicates that the port is used to express the processing latency -incurred by the plugin, expressed in samples. The latency may be affected by -the current sample rate, plugin settings, or other factors, and may be changed -by the plugin at any time. Where the latency is frequency dependent the plugin -may choose any appropriate value. If a plugin introduces latency it MUST -provide EXACTLY ONE port with this property set. In fuzzy cases the -value should be the most reasonable one based on user expectation of -input/output alignment. For example, musical delay plugins should not report -their delay as latency, since it is an intentional effect that the host should -not compensate for. - -This property is deprecated, use a lv2:designation of lv2:latency instead, -following the same rules as above: - - :::turtle - - lv2:port [ - a lv2:OutputPort , lv2:ControlPort ; - lv2:designation lv2:latency ; - lv2:symbol "latency" ; - ] - -"""^^lv2:Markdown . - -lv2:toggled - lv2:documentation """ - -Indicates that the data item should be considered a boolean toggle. Data less -than or equal to zero should be considered off or false, and data -above zero should be considered on or true. - -"""^^lv2:Markdown . - -lv2:sampleRate - lv2:documentation """ - -Indicates that any specified bounds should be interpreted as multiples of the -sample rate. For example, a frequency range from 0 Hz to the Nyquist frequency -(half the sample rate) can be specified by using this property with lv2:minimum -0.0 and lv2:maximum 0.5. Hosts that support bounds at all MUST support this -property. - -"""^^lv2:Markdown . - -lv2:integer - lv2:documentation """ - -Indicates that all the reasonable values for a port are integers. For such -ports, a user interface should provide a stepped control that only allows -choosing integer values. - -Note that this is only a hint, and that the plugin MUST operate reasonably even -if such a port has a non-integer value. - -"""^^lv2:Markdown . - -lv2:enumeration - lv2:documentation """ - -Indicates that all the rasonable values for a port are defined by -lv2:scalePoint properties. For such ports, a user interface should provide a selector that allows the user to choose any of the scale point values by name. It is recommended to show the value as well if possible. - -Note that this is only a hint, and that the plugin MUST operate reasonably even -if such a port has a value that does not correspond to a scale point. - -"""^^lv2:Markdown . - -lv2:isSideChain - lv2:documentation """ - -Indicates that a port is a sidechain, which affects the output somehow -but should not be considered a part of the main signal chain. Sidechain ports -SHOULD be lv2:connectionOptional, and may be ignored by hosts. - -"""^^lv2:Markdown . - diff --git a/lv2/core/lv2core.ttl b/lv2/core/lv2core.ttl deleted file mode 100644 index bd9fc93..0000000 --- a/lv2/core/lv2core.ttl +++ /dev/null @@ -1,675 +0,0 @@ -@prefix doap: . -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2" ; - rdfs:comment "An extensible open standard for audio plugins." ; - rdfs:seeAlso , - , - ; - owl:imports doap: . - -lv2:Specification - a rdfs:Class , - owl:Class ; - rdfs:subClassOf doap:Project ; - rdfs:label "Specification" ; - rdfs:comment "An LV2 specifiation." . - -lv2:Markdown - a rdfs:Datatype ; - owl:onDatatype xsd:string ; - rdfs:label "Markdown" ; - rdfs:comment "A string in Markdown syntax." . - -lv2:documentation - a rdf:Property , - owl:AnnotationProperty ; - rdfs:range rdfs:Literal ; - rdfs:label "documentation" ; - rdfs:comment "Extended documentation." ; - rdfs:seeAlso . - -lv2:PluginBase - a rdfs:Class , - owl:Class ; - rdfs:label "Plugin Base" ; - rdfs:comment "Base class for a plugin-like resource." . - -lv2:Plugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:PluginBase ; - rdfs:label "Plugin" ; - rdfs:comment "An LV2 plugin." ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty doap:name ; - owl:someValuesFrom rdf:PlainLiteral ; - rdfs:comment "A plugin MUST have at least one untranslated doap:name." - ] , [ - a owl:Restriction ; - owl:onProperty lv2:port ; - owl:allValuesFrom lv2:Port ; - rdfs:comment "All ports on a plugin MUST be fully specified lv2:Port instances." - ] . - -lv2:PortBase - a rdfs:Class , - owl:Class ; - rdfs:label "Port Base" ; - rdfs:comment "Base class for a port-like resource." ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty lv2:symbol ; - owl:cardinality 1 ; - rdfs:comment "A port MUST have exactly one lv2:symbol." - ] . - -lv2:Port - a rdfs:Class , - owl:Class ; - rdfs:label "Port" ; - rdfs:comment "An LV2 plugin port." ; - rdfs:subClassOf lv2:PortBase , - [ - a owl:Restriction ; - owl:onProperty lv2:name ; - owl:minCardinality 1 ; - rdfs:comment "A port MUST have at least one lv2:name." - ] . - -lv2:InputPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Input Port" ; - rdfs:comment "A port connected to constant data which is read during `run()`." . - -lv2:OutputPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Output Port" ; - rdfs:comment "A port connected to data which is written during `run()`." . - -lv2:ControlPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Control Port" ; - rdfs:comment "A port connected to a single `float`." . - -lv2:AudioPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Audio Port" ; - rdfs:comment "A port connected to an array of float audio samples." . - -lv2:CVPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "CV Port" ; - rdfs:comment "A port connected to an array of float control values." . - -lv2:port - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain lv2:PluginBase ; - rdfs:range lv2:PortBase ; - rdfs:label "port" ; - rdfs:comment "A port (input or output) on this plugin." . - -lv2:project - a rdf:Property , - owl:ObjectProperty ; - rdfs:range doap:Project ; - rdfs:label "project" ; - rdfs:comment "The project this is a part of." . - -lv2:prototype - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "prototype" ; - rdfs:comment "The prototype to inherit properties from." . - -lv2:minorVersion - a rdf:Property , - owl:DatatypeProperty ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "minor version" ; - rdfs:comment "The minor version of this resource." . - -lv2:microVersion - a rdf:Property , - owl:DatatypeProperty ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "micro version" ; - rdfs:comment "The micro version of this resource." . - -lv2:binary - a rdf:Property , - owl:ObjectProperty ; - rdfs:range owl:Thing ; - rdfs:label "binary" ; - rdfs:comment "The binary of this resource." . - -lv2:appliesTo - a rdf:Property , - owl:ObjectProperty ; - rdfs:range lv2:Plugin ; - rdfs:label "applies to" ; - rdfs:comment "The plugin this resource is related to." . - -lv2:index - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:range xsd:unsignedInt ; - rdfs:label "index" ; - rdfs:comment "A non-negative zero-based 32-bit index." . - -lv2:Symbol - a rdfs:Datatype ; - owl:onDatatype xsd:string ; - owl:withRestrictions ( - [ - xsd:pattern "[_a-zA-Z][_a-zA-Z0-9]*" - ] - ) ; - rdfs:label "Symbol" ; - rdfs:comment "A short restricted name used as a strong identifier." . - -lv2:symbol - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "symbol" ; - rdfs:range lv2:Symbol , - rdf:PlainLiteral ; - rdfs:comment "The symbol that identifies this resource in the context of its parent." . - -lv2:name - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "name" ; - rdfs:range xsd:string ; - rdfs:comment "A display name for labeling in a user interface." . - -lv2:shortName - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "short name" ; - rdfs:range xsd:string ; - rdfs:comment "A short display name for labeling in a user interface." . - -lv2:Designation - a rdfs:Class , - owl:Class ; - rdfs:subClassOf rdf:Property ; - rdfs:label "Designation" ; - rdfs:comment "A designation which defines the meaning of some data." . - -lv2:Channel - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Designation ; - rdfs:label "Channel" ; - rdfs:comment "An individual channel, such as left or right." . - -lv2:Parameter - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Designation , - rdf:Property ; - rdfs:label "Parameter" ; - rdfs:comment "A property that is a plugin parameter." . - -lv2:designation - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:range rdf:Property ; - rdfs:label "designation" ; - rdfs:comment "The designation that defines the meaning of this input or output." . - -lv2:latency - a rdf:Property , - owl:DatatypeProperty ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "latency" ; - rdfs:comment "The latency introduced, in frames." . - -lv2:freeWheeling - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "free-wheeling" ; - rdfs:range xsd:boolean ; - rdfs:comment "Whether processing is currently free-wheeling." . - -lv2:enabled - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "enabled" ; - rdfs:range xsd:int ; - rdfs:comment "Whether processing is currently enabled (not bypassed)." . - -lv2:control - a lv2:Channel ; - rdfs:label "control" ; - rdfs:comment "The primary control channel." . - -lv2:Point - a rdfs:Class , - owl:Class ; - rdfs:label "Point" ; - rdfs:comment "An interesting point in a value range." . - -lv2:ScalePoint - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Point ; - rdfs:label "Scale Point" ; - rdfs:comment "A single `float` Point for control inputs." . - -lv2:scalePoint - a rdf:Property , - owl:ObjectProperty ; - rdfs:range lv2:ScalePoint ; - rdfs:label "scale point" ; - rdfs:comment "A scale point of a port or parameter." . - -lv2:default - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "default" ; - rdfs:comment "The default value for this control." . - -lv2:minimum - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "minimum" ; - rdfs:comment "The minimum value for this control." . - -lv2:maximum - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "maximum" ; - rdfs:comment "The maximum value for this control." . - -lv2:Feature - a rdfs:Class , - owl:Class ; - rdfs:label "Feature" ; - rdfs:comment "An additional feature which may be used or required." . - -lv2:optionalFeature - a rdf:Property , - owl:ObjectProperty ; - rdfs:range lv2:Feature ; - rdfs:label "optional feature" ; - rdfs:comment "An optional feature that is supported if available." . - -lv2:requiredFeature - a rdf:Property , - owl:ObjectProperty ; - rdfs:range lv2:Feature ; - rdfs:label "required feature" ; - rdfs:comment "A required feature that must be available to run." . - -lv2:ExtensionData - a rdfs:Class , - owl:Class ; - rdfs:label "Extension Data" ; - rdfs:comment "Additional data defined by an extension." . - -lv2:extensionData - a rdf:Property , - owl:ObjectProperty ; - rdfs:range lv2:ExtensionData ; - rdfs:label "extension data" ; - rdfs:comment "Extension data provided by a plugin or other binary." . - -lv2:isLive - a lv2:Feature ; - rdfs:label "is live" ; - rdfs:comment "Plugin has a real-time dependency." . - -lv2:inPlaceBroken - a lv2:Feature ; - rdfs:label "in-place broken" ; - rdfs:comment "Plugin requires separate locations for input and output." . - -lv2:hardRTCapable - a lv2:Feature ; - rdfs:label "hard real-time capable" ; - rdfs:comment "Plugin is capable of running in a hard real-time environment." . - -lv2:PortProperty - a rdfs:Class , - owl:Class ; - rdfs:label "Port Property" ; - rdfs:comment "A particular property that a port has." . - -lv2:portProperty - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain lv2:Port ; - rdfs:range lv2:PortProperty ; - rdfs:label "port property" ; - rdfs:comment "A property of this port hosts may find useful." . - -lv2:connectionOptional - a lv2:PortProperty ; - rdfs:label "connection optional" ; - rdfs:comment "The property that this port may be connected to NULL." . - -lv2:reportsLatency - a lv2:PortProperty ; - owl:deprecated "true"^^xsd:boolean ; - rdfs:label "reports latency" ; - rdfs:comment "Control port value is the plugin latency in frames." . - -lv2:toggled - a lv2:PortProperty ; - rdfs:label "toggled" ; - rdfs:comment "Control port value is considered a boolean toggle." . - -lv2:sampleRate - a lv2:PortProperty ; - rdfs:label "sample rate" ; - rdfs:comment "Control port bounds are interpreted as multiples of the sample rate." . - -lv2:integer - a lv2:PortProperty ; - rdfs:label "integer" ; - rdfs:comment "Control port values are treated as integers." . - -lv2:enumeration - a lv2:PortProperty ; - rdfs:label "enumeration" ; - rdfs:comment "Control port scale points represent all useful values." . - -lv2:isSideChain - a lv2:PortProperty ; - rdfs:label "is side-chain" ; - rdfs:comment "Signal for port should not be considered a main input or output." . - -lv2:GeneratorPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Generator Plugin" ; - rdfs:comment "A plugin that generates new sound internally." . - -lv2:InstrumentPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:GeneratorPlugin ; - rdfs:label "Instrument Plugin" ; - rdfs:comment "A plugin intended to be played as a musical instrument." . - -lv2:OscillatorPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:GeneratorPlugin ; - rdfs:label "Oscillator Plugin" ; - rdfs:comment "A plugin that generates output with an oscillator." . - -lv2:UtilityPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Utility Plugin" ; - rdfs:comment "A utility plugin that is not a typical audio effect or generator." . - -lv2:ConverterPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Converter Plugin" ; - rdfs:comment "A plugin that converts its input into a different form." . - -lv2:AnalyserPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Analyser Plugin" ; - rdfs:comment "A plugin that analyses its input and emits some useful information." . - -lv2:MixerPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Mixer Plugin" ; - rdfs:comment "A plugin that mixes some number of inputs into some number of outputs." . - -lv2:SimulatorPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Simulator Plugin" ; - rdfs:comment "A plugin that aims to emulate some environmental effect or musical equipment." . - -lv2:DelayPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Delay Plugin" ; - rdfs:comment "An effect that intentionally delays its input as an effect." . - -lv2:ModulatorPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Modulator Plugin" ; - rdfs:comment "An effect that modulats its input as an effect." . - -lv2:ReverbPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin , - lv2:SimulatorPlugin , - lv2:DelayPlugin ; - rdfs:label "Reverb Plugin" ; - rdfs:comment "An effect that adds reverberation to its input." . - -lv2:PhaserPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:ModulatorPlugin ; - rdfs:label "Phaser Plugin" ; - rdfs:comment "An effect that periodically sweeps a filter over its input." . - -lv2:FlangerPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:ModulatorPlugin ; - rdfs:label "Flanger Plugin" ; - rdfs:comment "An effect that mixes slightly delayed copies of its input." . - -lv2:ChorusPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:ModulatorPlugin ; - rdfs:label "Chorus Plugin" ; - rdfs:comment "An effect that mixes significantly delayed copies of its input." . - -lv2:FilterPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Filter Plugin" ; - rdfs:comment "An effect that manipulates the frequency spectrum of its input." . - -lv2:LowpassPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Lowpass Filter Plugin" ; - rdfs:comment "A filter that attenuates frequencies above some cutoff." . - -lv2:BandpassPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Bandpass Filter Plugin" ; - rdfs:comment "A filter that attenuates frequencies outside of some band." . - -lv2:HighpassPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Highpass Filter Plugin" ; - rdfs:comment "A filter that attenuates frequencies below some cutoff." . - -lv2:CombPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Comb FilterPlugin" ; - rdfs:comment "A filter that adds a delayed version of its input to itself." . - -lv2:AllpassPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Allpass Plugin" ; - rdfs:comment "A filter that changes the phase relationship between frequency components." . - -lv2:EQPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Equaliser Plugin" ; - rdfs:comment "A plugin that adjusts the balance between frequency components." . - -lv2:ParaEQPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:EQPlugin ; - rdfs:label "Parametric EQ Plugin" ; - rdfs:comment "A plugin that adjusts the balance between configurable frequency components." . - -lv2:MultiEQPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:EQPlugin ; - rdfs:label "Multiband EQ Plugin" ; - rdfs:comment "A plugin that adjusts the balance between a fixed set of frequency components." . - -lv2:SpatialPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Spatial Plugin" ; - rdfs:comment "A plugin that manipulates the position of audio in space." . - -lv2:SpectralPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Spectral Plugin" ; - rdfs:comment "A plugin that alters the spectral properties of audio." . - -lv2:PitchPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:SpectralPlugin ; - rdfs:label "Pitch Shifter Plugin" ; - rdfs:comment "A plugin that shifts the pitch of its input." . - -lv2:AmplifierPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Amplifier Plugin" ; - rdfs:comment "A plugin that primarily changes the volume of its input." . - -lv2:EnvelopePlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Envelope Plugin" ; - rdfs:comment "A plugin that applies an envelope to its input." . - -lv2:DistortionPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Distortion Plugin" ; - rdfs:comment "A plugin that adds distortion to its input." . - -lv2:WaveshaperPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DistortionPlugin ; - rdfs:label "Waveshaper Plugin" ; - rdfs:comment "An effect that alters the shape of input waveforms." . - -lv2:DynamicsPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Dynamics Plugin" ; - rdfs:comment "A plugin that alters the envelope or dynamic range of its input." . - -lv2:CompressorPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Compressor Plugin" ; - rdfs:comment "A plugin that reduces the dynamic range of its input." . - -lv2:ExpanderPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Expander Plugin" ; - rdfs:comment "A plugin that expands the dynamic range of its input." . - -lv2:LimiterPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Limiter Plugin" ; - rdfs:comment "A plugin that limits its input to some maximum level." . - -lv2:GatePlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Gate Plugin" ; - rdfs:comment "A plugin that attenuates signals below some threshold." . - -lv2:FunctionPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Function Plugin" ; - rdfs:comment "A plugin whose output is a mathematical function of its input." . - -lv2:ConstantPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:GeneratorPlugin ; - rdfs:label "Constant Plugin" ; - rdfs:comment "A plugin that emits constant values." . - -lv2:MIDIPlugin - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "MIDI Plugin" ; - rdfs:comment "A plugin that primarily processes MIDI messages." . - diff --git a/lv2/core/manifest.ttl b/lv2/core/manifest.ttl deleted file mode 100644 index 6e61dde..0000000 --- a/lv2/core/manifest.ttl +++ /dev/null @@ -1,15 +0,0 @@ -@prefix doap: . -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 18 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - - - a doap:Project ; - rdfs:seeAlso , - . - diff --git a/lv2/core/meson.build b/lv2/core/meson.build deleted file mode 100644 index a629d0a..0000000 --- a/lv2/core/meson.build +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'core' -path = 'ns' / 'lv2core' - -core_data = files( - 'lv2core.meta.ttl', - 'lv2core.ttl', - 'manifest.ttl', - 'meta.ttl', - 'people.ttl', -) - -headers = files( - 'attributes.h', - 'lv2.h', - 'lv2_util.h', -) - -# Install specification bundle -install_data(core_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / 'ns' / 'lv2core') -endif - -# Build documentation -if build_docs - lv2_core_docs = custom_target( - 'lv2core.html', - command: lv2specgen_command_prefix + [ - '--docdir=../html', - '--style-uri=../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('lv2core.ttl'), - install: true, - install_dir: lv2_docdir / 'ns', - output: 'lv2core.html', - ) -endif diff --git a/lv2/core/meta.ttl b/lv2/core/meta.ttl deleted file mode 100644 index 34cfa4f..0000000 --- a/lv2/core/meta.ttl +++ /dev/null @@ -1,224 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix lv2: . -@prefix meta: . -@prefix rdf: . -@prefix rdfs: . - - - rdf:value """ -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -""" . - - - a doap:Project ; - lv2:symbol "lv2" ; - rdfs:label "LV2" ; - rdfs:comment "The LV2 Plugin Interface Project." ; - doap:name "LV2" ; - doap:license ; - doap:shortdesc "The LV2 Plugin Interface Project." ; - doap:description "LV2 is a plugin standard for audio systems. It defines a minimal yet extensible C API for plugin code and a format for plugin bundles" ; - doap:created "2006-05-10" ; - doap:homepage ; - doap:mailing-list ; - doap:programming-language "C" ; - doap:developer , - ; - doap:helper meta:larsl , - meta:bmwiedemann , - meta:gabrbedd , - meta:daste , - meta:kfoltman , - meta:paniq ; - doap:release [ - doap:revision "1.18.5" ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix or avoid new compiler and tool warnings." - ] , [ - rdfs:label "Add dark mode style for documentation." - ] , [ - rdfs:label "Clean up and modernize Python support code." - ] , [ - rdfs:label "Remove archaic properties from foaf vocabulary." - ] , [ - rdfs:label "Replace canonical dcs ontology with a minimal version for LV2." - ] , [ - rdfs:label "Switch to Meson build system." - ] - ] - ] , [ - doap:revision "1.18.4" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] , [ - rdfs:label "Fix build issues with newer toolchains." - ] - ] - ] , [ - doap:revision "1.18.2" ; - doap:created "2021-01-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "eg-sampler: Save and restore gain parameter value." - ] , [ - rdfs:label "Various code cleanups and infrastructure improvements." - ] - ] - ] , [ - doap:revision "1.18.0" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Improve documentation." - ] , [ - rdfs:label "Separate extended documentation from primary data." - ] - ] - ] , [ - doap:revision "1.16.0" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add core/attributes.h utility header." - ] , [ - rdfs:label "eg-sampler: Add waveform display to UI." - ] , [ - rdfs:label "eg-midigate: Respond to \"all notes off\" MIDI message." - ] , [ - rdfs:label "Simplify use of lv2specgen." - ] , [ - rdfs:label "Add lv2_validate utility." - ] , [ - rdfs:label "Install headers to simpler paths." - ] , [ - rdfs:label "Aggressively deprecate uri-map and event extensions." - ] , [ - rdfs:label "Upgrade build system and fix building with Python 3.7." - ] - ] - ] , [ - doap:revision "1.14.0" ; - doap:created "2016-09-19" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label """eg-scope: Don't feed back UI state updates.""" - ] , [ - rdfs:label "eg-sampler: Fix handling of state file paths." - ] , [ - rdfs:label "eg-sampler: Support thread-safe state restoration." - ] - ] - ] , [ - doap:revision "1.12.0" ; - doap:created "2015-04-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "eg-sampler: Support patch:Get, and request initial state from UI." - ] , [ - rdfs:label "eg-sampler: Add gain parameter." - ] , [ - rdfs:label "Fix merging of version histories in specification documentation." - ] , [ - rdfs:label "Improve API documentation." - ] , [ - rdfs:label "Simplify property restrictions by removing redundancy." - ] - ] - ] , [ - doap:revision "1.10.0" ; - doap:created "2014-08-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "lv2specgen: Display deprecated warning on classes marked owl:deprecated." - ] , [ - rdfs:label "Fix -Wconversion warnings in headers." - ] , [ - rdfs:label "Upgrade to waf 1.7.16." - ] - ] - ] , [ - doap:revision "1.8.0" ; - doap:created "2014-01-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add scope example plugin from Robin Gareus." - ] , [ - rdfs:label "lv2specgen: Fix links to externally defined terms." - ] , [ - rdfs:label "Install lv2specgen for use by other projects." - ] - ] - ] , [ - doap:revision "1.6.0" ; - doap:created "2013-08-09" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix port indices of metronome example." - ] , [ - rdfs:label "Fix lv2specgen usage from command line." - ] , [ - rdfs:label "Upgrade to waf 1.7.11." - ] - ] - ] , [ - doap:revision "1.4.0" ; - doap:created "2013-02-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add metronome example plugin to demonstrate sample accurate tempo sync." - ] , [ - rdfs:label "Generate book-style HTML documentation from example plugins." - ] - ] - ] , [ - doap:revision "1.2.0" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Move all project metadata for extensions (e.g. change log) to separate files to spare hosts from loading them during discovery." - ] , [ - rdfs:label "Use stricter datatype definitions conformant with the XSD and OWL specifications for better validation." - ] - ] - ] , [ - doap:revision "1.0.0" ; - doap:created "2012-04-16" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label """Initial release as a unified project. Projects can now simply depend on the pkg-config package 'lv2' for all official LV2 APIs.""" - ] , [ - rdfs:label "New extensions: atom, log, parameters, patch, port-groups, port-props, resize-port, state, time, worker." - ] - ] - ] . - diff --git a/lv2/core/people.ttl b/lv2/core/people.ttl deleted file mode 100644 index 52d0384..0000000 --- a/lv2/core/people.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix foaf: . -@prefix meta: . -@prefix rdfs: . - - - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:mbox ; - rdfs:seeAlso . - - - a foaf:Person ; - foaf:name "Steve Harris" ; - foaf:mbox ; - rdfs:seeAlso . - -meta:larsl - a foaf:Person ; - foaf:name "Lars Luthman" ; - foaf:mbox . - -meta:gabrbedd - a foaf:Person ; - foaf:name "Gabriel M. Beddingfield" ; - foaf:mbox . - -meta:daste - a foaf:Person ; - foaf:name """Stefano D'Angelo""" ; - foaf:mbox . - -meta:kfoltman - a foaf:Person ; - foaf:name "Krzysztof Foltman" ; - foaf:mbox . - -meta:paniq - a foaf:Person ; - foaf:name "Leonard Ritter" ; - foaf:mbox . - -meta:harry - a foaf:Person ; - foaf:name "Harry van Haaren" ; - foaf:mbox . - -meta:bmwiedemann - a foaf:Person ; - foaf:name "Bernhard M. Wiedemann" ; - foaf:mbox . - diff --git a/lv2/data-access.lv2/data-access.meta.ttl b/lv2/data-access.lv2/data-access.meta.ttl new file mode 100644 index 0000000..822b28c --- /dev/null +++ b/lv2/data-access.lv2/data-access.meta.ttl @@ -0,0 +1,76 @@ +@prefix da: . +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 Data Access" ; + doap:shortdesc "Provides access to plugin extension data." ; + doap:created "2008-00-00" ; + doap:developer ; + doap:release [ + doap:revision "1.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2011-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system for installation." + ] , [ + rdfs:label "Switch to ISC license." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2010-10-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a feature, LV2_Extension_Data_Feature, which provides +access to LV2_Descriptor::extension_data() for plugin UIs or other potentially +remote users of a plugin. + +Note that the use of this extension by UIs violates the important principle of +UI/plugin separation, and is potentially a source of many problems. +Accordingly, **use of this extension is highly discouraged**, and plugins +should not expect hosts to support it, since it is often impossible to do so. + +To support this feature the host must pass an LV2_Feature struct to +LV2_Descriptor::extension_data() with URI LV2_DATA_ACCESS_URI and data pointed +to an instance of LV2_Extension_Data_Feature. + +"""^^lv2:Markdown . + diff --git a/lv2/data-access.lv2/data-access.ttl b/lv2/data-access.lv2/data-access.ttl new file mode 100644 index 0000000..b0dc6f4 --- /dev/null +++ b/lv2/data-access.lv2/data-access.ttl @@ -0,0 +1,10 @@ +@prefix da: . +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Feature ; + rdfs:label "data access" ; + rdfs:comment "A feature that provides access to plugin extension data." ; + rdfs:seeAlso . + diff --git a/lv2/data-access.lv2/manifest.ttl b/lv2/data-access.lv2/manifest.ttl new file mode 100644 index 0000000..9585a5e --- /dev/null +++ b/lv2/data-access.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso . + diff --git a/lv2/data-access/data-access.h b/lv2/data-access/data-access.h deleted file mode 100644 index de3b6b6..0000000 --- a/lv2/data-access/data-access.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_DATA_ACCESS_H -#define LV2_DATA_ACCESS_H - -/** - @defgroup data-access Data Access - @ingroup lv2 - - Access to plugin extension_data() for UIs. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_DATA_ACCESS_URI "http://lv2plug.in/ns/ext/data-access" ///< http://lv2plug.in/ns/ext/data-access -#define LV2_DATA_ACCESS_PREFIX LV2_DATA_ACCESS_URI "#" ///< http://lv2plug.in/ns/ext/data-access# - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -/** - The data field of the LV2_Feature for this extension. - - To support this feature the host must pass an LV2_Feature struct to the - instantiate method with URI "http://lv2plug.in/ns/ext/data-access" - and data pointed to an instance of this struct. -*/ -typedef struct { - /** - A pointer to a method the UI can call to get data (of a type specified - by some other extension) from the plugin. - - This call never is never guaranteed to return anything, UIs should - degrade gracefully if direct access to the plugin data is not possible - (in which case this function will return NULL). - - This is for access to large data that can only possibly work if the UI - and plugin are running in the same process. For all other things, use - the normal LV2 UI communication system. - */ - const void* (*data_access)(const char* uri); -} LV2_Extension_Data_Feature; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_DATA_ACCESS_H */ diff --git a/lv2/data-access/data-access.meta.ttl b/lv2/data-access/data-access.meta.ttl deleted file mode 100644 index 3184110..0000000 --- a/lv2/data-access/data-access.meta.ttl +++ /dev/null @@ -1,77 +0,0 @@ -@prefix da: . -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - rdfs:seeAlso ; - doap:license ; - doap:name "LV2 Data Access" ; - doap:shortdesc "Provides access to plugin extension data." ; - doap:created "2008-00-00" ; - doap:developer ; - doap:release [ - doap:revision "1.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2011-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system for installation." - ] , [ - rdfs:label "Switch to ISC license." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2010-10-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a feature, LV2_Extension_Data_Feature, which provides -access to LV2_Descriptor::extension_data() for plugin UIs or other potentially -remote users of a plugin. - -Note that the use of this extension by UIs violates the important principle of -UI/plugin separation, and is potentially a source of many problems. -Accordingly, **use of this extension is highly discouraged**, and plugins -should not expect hosts to support it, since it is often impossible to do so. - -To support this feature the host must pass an LV2_Feature struct to -LV2_Descriptor::extension_data() with URI LV2_DATA_ACCESS_URI and data pointed -to an instance of LV2_Extension_Data_Feature. - -"""^^lv2:Markdown . - diff --git a/lv2/data-access/data-access.ttl b/lv2/data-access/data-access.ttl deleted file mode 100644 index 0185cd0..0000000 --- a/lv2/data-access/data-access.ttl +++ /dev/null @@ -1,11 +0,0 @@ -@prefix da: . -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Feature ; - rdfs:label "data access" ; - rdfs:comment "A feature that provides access to plugin extension data." ; - rdfs:seeAlso , - . - diff --git a/lv2/data-access/manifest.ttl b/lv2/data-access/manifest.ttl deleted file mode 100644 index 9585a5e..0000000 --- a/lv2/data-access/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 6 ; - rdfs:seeAlso . - diff --git a/lv2/data-access/meson.build b/lv2/data-access/meson.build deleted file mode 100644 index 05b086b..0000000 --- a/lv2/data-access/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'data-access' -path = 'ns' / 'ext' / 'data-access' - -data_access_data = files( - 'data-access.meta.ttl', - 'data-access.ttl', - 'manifest.ttl', -) - -headers = files( - 'data-access.h', -) - -# Install specification bundle -install_data(data_access_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_data_access_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('data-access.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/dynmanifest.lv2/dynmanifest.meta.ttl b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl new file mode 100644 index 0000000..4e66d98 --- /dev/null +++ b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl @@ -0,0 +1,131 @@ +@prefix dcs: . +@prefix dman: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 Dynamic Manifest" ; + doap:homepage ; + doap:created "2009-06-13" ; + doap:shortdesc "Support for dynamic manifest data generation." ; + doap:programming-language "C" ; + doap:developer ; + doap:release [ + doap:revision "1.6" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2010-04-10" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +The LV2 API, on its own, cannot be used to write plugin libraries where data is +dynamically generated at runtime, since LV2 requires needed information to be +provided in one or more static data (RDF) files. This API addresses this +limitation by extending the LV2 API. + +To detect that a plugin library implements a dynamic manifest generator, the +host checks its static manifest for a description like: + + :::turtle + + a dman:DynManifest ; + lv2:binary . + +To load the data, the host loads the library (`mydynmanifest.so` in this +example) as usual and fetches the dynamic Turtle data from it using this API. + +The host is allowed to request regeneration of the dynamic manifest multiple +times, and the plugin library is expected to provide updated data if/when +possible. All data and references provided via this API before the last +regeneration of the dynamic manifest is to be considered invalid by the host, +including plugin descriptors whose URIs were discovered using this API. + +### Accessing Data + +To access data using this API, the host must: + + 1. Call lv2_dyn_manifest_open(). + + 2. Create a `FILE` for functions to write data to (for example with `tmpfile()`). + + 3. Get a list of exposed subject URIs using lv2_dyn_manifest_get_subjects(). + + 4. Call lv2_dyn_manifest_get_data() for each URI of interest to write the + related data to the file. + + 5. Call lv2_dyn_manifest_close(). + + 6. Parse the content of the file(s). + + 7. Remove the file(s). + +Each call to the above mentioned dynamic manifest functions MUST write a +complete, valid Turtle document (including all needed prefix definitions) to +the output FILE. + +Each call to lv2_dyn_manifest_open() causes the (re)generation of the dynamic +manifest data, and invalidates all data fetched before the call. + +In case the plugin library uses this same API to access other dynamic +manifests, it MUST implement some mechanism to avoid potentially endless loops +(such as A loads B, B loads A, etc.) and, in case such a loop is detected, the +operation MUST fail. For this purpose, use of a static boolean flag is +suggested. + +### Threading Rules + +All of the functions defined by this specification belong to the Discovery +class. + + +"""^^lv2:Markdown . + +dman:DynManifest + lv2:documentation """ + +There MUST NOT be any instances of dman:DynManifest in the generated manifest. + +All relative URIs in the generated data MUST be relative to the base path that +would be used to parse a normal LV2 manifest (the bundle path). + +"""^^lv2:Markdown . + diff --git a/lv2/dynmanifest.lv2/dynmanifest.ttl b/lv2/dynmanifest.lv2/dynmanifest.ttl new file mode 100644 index 0000000..b46d694 --- /dev/null +++ b/lv2/dynmanifest.lv2/dynmanifest.ttl @@ -0,0 +1,24 @@ +@prefix dman: . +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Dyn Manifest" ; + rdfs:comment "Support for dynamic manifest data generation." ; + rdfs:seeAlso . + +dman:DynManifest + a rdfs:Class ; + rdfs:label "Dynamic Manifest" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:binary ; + owl:minCardinality 1 ; + rdfs:comment "A DynManifest MUST have at least one lv2:binary." + ] ; + rdfs:comment "Dynamic manifest for an LV2 binary." . + diff --git a/lv2/dynmanifest.lv2/manifest.ttl b/lv2/dynmanifest.lv2/manifest.ttl new file mode 100644 index 0000000..db27a73 --- /dev/null +++ b/lv2/dynmanifest.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso . + diff --git a/lv2/dynmanifest/dynmanifest.h b/lv2/dynmanifest/dynmanifest.h deleted file mode 100644 index 674577b..0000000 --- a/lv2/dynmanifest/dynmanifest.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - Dynamic manifest specification for LV2 - Copyright 2008-2011 Stefano D'Angelo - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_DYN_MANIFEST_H_INCLUDED -#define LV2_DYN_MANIFEST_H_INCLUDED - -/** - @defgroup dynmanifest Dynamic Manifest - @ingroup lv2 - - Support for dynamic data generation. - - See for details. - - @{ -*/ - -#include "lv2/core/lv2.h" - -#include - -// clang-format off - -#define LV2_DYN_MANIFEST_URI "http://lv2plug.in/ns/ext/dynmanifest" ///< http://lv2plug.in/ns/ext/dynmanifest -#define LV2_DYN_MANIFEST_PREFIX LV2_DYN_MANIFEST_URI "#" ///< http://lv2plug.in/ns/ext/dynmanifest# - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Dynamic manifest generator handle. - - This handle indicates a particular status of a dynamic manifest generator. - The host MUST NOT attempt to interpret it and, unlikely LV2_Handle, it is - NOT even valid to compare this to NULL. The dynamic manifest generator MAY - use it to reference internal data. -*/ -typedef void* LV2_Dyn_Manifest_Handle; - -/** - Generate the dynamic manifest. - - @param handle Pointer to an uninitialized dynamic manifest generator handle. - - @param features NULL terminated array of LV2_Feature structs which represent - the features the host supports. The dynamic manifest generator may refuse to - (re)generate the dynamic manifest if required features are not found here - (however hosts SHOULD NOT use this as a discovery mechanism, instead of - reading the static manifest file). This array must always exist; if a host - has no features, it MUST pass a single element array containing NULL. - - @return 0 on success, otherwise a non-zero error code. The host SHOULD - evaluate the result of the operation by examining the returned value and - MUST NOT try to interpret the value of handle. -*/ -int -lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, - const LV2_Feature* const* features); - -/** - Fetch a "list" of subject URIs described in the dynamic manifest. - - The dynamic manifest generator has to fill the resource only with the needed - triples to make the host aware of the "objects" it wants to expose. For - example, if the plugin library exposes a regular LV2 plugin, it should - output only a triple like the following: - - a lv2:Plugin . - - The objects that are eligible for exposure are those that would need to be - represented by a subject node in a static manifest. - - @param handle Dynamic manifest generator handle. - - @param fp FILE * identifying the resource the host has to set up for the - dynamic manifest generator. The host MUST pass a writable, empty resource to - this function, and the dynamic manifest generator MUST ONLY perform write - operations on it at the end of the stream (for example, using only - fprintf(), fwrite() and similar). - - @return 0 on success, otherwise a non-zero error code. -*/ -int -lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); - -/** - Function that fetches data related to a specific URI. - - The dynamic manifest generator has to fill the resource with data related to - object represented by the given URI. For example, if the library exposes a - regular LV2 plugin whose URI, as retrieved by the host using - lv2_dyn_manifest_get_subjects() is http://example.org/plugin then it - should output something like: - -
-   
-       a lv2:Plugin ;
-       doap:name "My Plugin" ;
-       lv2:binary  ;
-       etc:etc "..." .
-   
- - @param handle Dynamic manifest generator handle. - - @param fp FILE * identifying the resource the host has to set up for the - dynamic manifest generator. The host MUST pass a writable resource to this - function, and the dynamic manifest generator MUST ONLY perform write - operations on it at the current position of the stream (for example, using - only fprintf(), fwrite() and similar). - - @param uri URI to get data about (in the "plain" form, i.e., absolute URI - without Turtle prefixes). - - @return 0 on success, otherwise a non-zero error code. -*/ -int -lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, - FILE* fp, - const char* uri); - -/** - Function that ends the operations on the dynamic manifest generator. - - This function SHOULD be used by the dynamic manifest generator to perform - cleanup operations, etc. - - Once this function is called, referring to handle will cause undefined - behavior. - - @param handle Dynamic manifest generator handle. -*/ -void -lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_DYN_MANIFEST_H_INCLUDED */ diff --git a/lv2/dynmanifest/dynmanifest.meta.ttl b/lv2/dynmanifest/dynmanifest.meta.ttl deleted file mode 100644 index 4e66d98..0000000 --- a/lv2/dynmanifest/dynmanifest.meta.ttl +++ /dev/null @@ -1,131 +0,0 @@ -@prefix dcs: . -@prefix dman: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 Dynamic Manifest" ; - doap:homepage ; - doap:created "2009-06-13" ; - doap:shortdesc "Support for dynamic manifest data generation." ; - doap:programming-language "C" ; - doap:developer ; - doap:release [ - doap:revision "1.6" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2010-04-10" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -The LV2 API, on its own, cannot be used to write plugin libraries where data is -dynamically generated at runtime, since LV2 requires needed information to be -provided in one or more static data (RDF) files. This API addresses this -limitation by extending the LV2 API. - -To detect that a plugin library implements a dynamic manifest generator, the -host checks its static manifest for a description like: - - :::turtle - - a dman:DynManifest ; - lv2:binary . - -To load the data, the host loads the library (`mydynmanifest.so` in this -example) as usual and fetches the dynamic Turtle data from it using this API. - -The host is allowed to request regeneration of the dynamic manifest multiple -times, and the plugin library is expected to provide updated data if/when -possible. All data and references provided via this API before the last -regeneration of the dynamic manifest is to be considered invalid by the host, -including plugin descriptors whose URIs were discovered using this API. - -### Accessing Data - -To access data using this API, the host must: - - 1. Call lv2_dyn_manifest_open(). - - 2. Create a `FILE` for functions to write data to (for example with `tmpfile()`). - - 3. Get a list of exposed subject URIs using lv2_dyn_manifest_get_subjects(). - - 4. Call lv2_dyn_manifest_get_data() for each URI of interest to write the - related data to the file. - - 5. Call lv2_dyn_manifest_close(). - - 6. Parse the content of the file(s). - - 7. Remove the file(s). - -Each call to the above mentioned dynamic manifest functions MUST write a -complete, valid Turtle document (including all needed prefix definitions) to -the output FILE. - -Each call to lv2_dyn_manifest_open() causes the (re)generation of the dynamic -manifest data, and invalidates all data fetched before the call. - -In case the plugin library uses this same API to access other dynamic -manifests, it MUST implement some mechanism to avoid potentially endless loops -(such as A loads B, B loads A, etc.) and, in case such a loop is detected, the -operation MUST fail. For this purpose, use of a static boolean flag is -suggested. - -### Threading Rules - -All of the functions defined by this specification belong to the Discovery -class. - - -"""^^lv2:Markdown . - -dman:DynManifest - lv2:documentation """ - -There MUST NOT be any instances of dman:DynManifest in the generated manifest. - -All relative URIs in the generated data MUST be relative to the base path that -would be used to parse a normal LV2 manifest (the bundle path). - -"""^^lv2:Markdown . - diff --git a/lv2/dynmanifest/dynmanifest.ttl b/lv2/dynmanifest/dynmanifest.ttl deleted file mode 100644 index 4e2e830..0000000 --- a/lv2/dynmanifest/dynmanifest.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix dman: . -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Dyn Manifest" ; - rdfs:comment "Support for dynamic manifest data generation." ; - rdfs:seeAlso , - . - -dman:DynManifest - a rdfs:Class ; - rdfs:label "Dynamic Manifest" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty lv2:binary ; - owl:minCardinality 1 ; - rdfs:comment "A DynManifest MUST have at least one lv2:binary." - ] ; - rdfs:comment "Dynamic manifest for an LV2 binary." . - diff --git a/lv2/dynmanifest/manifest.ttl b/lv2/dynmanifest/manifest.ttl deleted file mode 100644 index db27a73..0000000 --- a/lv2/dynmanifest/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 6 ; - rdfs:seeAlso . - diff --git a/lv2/dynmanifest/meson.build b/lv2/dynmanifest/meson.build deleted file mode 100644 index ba78972..0000000 --- a/lv2/dynmanifest/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'dynmanifest' -path = 'ns' / 'ext' / 'dynmanifest' - -dynmanifest_data = files( - 'dynmanifest.meta.ttl', - 'dynmanifest.ttl', - 'manifest.ttl', -) - -headers = files( - 'dynmanifest.h', -) - -# Install specification bundle -install_data(dynmanifest_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_dynmanifest_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('dynmanifest.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/event.lv2/event.meta.ttl b/lv2/event.lv2/event.meta.ttl new file mode 100644 index 0000000..e9c26bc --- /dev/null +++ b/lv2/event.lv2/event.meta.ttl @@ -0,0 +1,256 @@ +@prefix dcs: . +@prefix doap: . +@prefix ev: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 Event" ; + doap:shortdesc "A port-based real-time generic event interface." ; + doap:created "2008-00-00" ; + doap:developer , + ; + doap:release [ + doap:revision "1.14" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + doap:revision "1.12" ; + doap:created "2014-08-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Minor documentation improvements." + ] + ] + ] , [ + doap:revision "1.10" ; + doap:created "2013-01-13" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix incorrect return type in lv2_event_get()." + ] + ] + ] , [ + doap:revision "1.8" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make event iterator gracefully handle optional ports." + ] , [ + rdfs:label "Remove asserts from event-helper.h." + ] , [ + rdfs:label "Use more precise domain and range for EventPort properties." + ] , [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "1.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix bug in lv2_event_reserve()." + ] , [ + rdfs:label "Fix incorrect ranges of some properties." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Update packaging." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2011-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system (for installation)." + ] , [ + rdfs:label "Convert documentation to HTML and use lv2:documentation." + ] , [ + rdfs:label "Use lv2:Specification to be discovered as an extension." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2010-11-24" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension is deprecated. New implementations +should use LV2 Atom instead. + +This extension defines a generic time-stamped event port type, which can be +used to create plugins that read and write real-time events, such as MIDI, +OSC, or any other type of event payload. The type(s) of event supported by +a port is defined in the data file for a plugin, for example: + + :::turtle + + lv2:port [ + a ev:EventPort, lv2:InputPort ; + lv2:index 0 ; + ev:supportsEvent ; + lv2:symbol "midi_input" ; + lv2:name "MIDI input" ; + ] . + +"""^^lv2:Markdown . + +ev:EventPort + lv2:documentation """ + +Ports of this type will be connected to a struct of type LV2_Event_Buffer, +defined in event.h. These ports contain a sequence of generic events (possibly +several types mixed in a single stream), the specific types of which are +defined by some URI in another LV2 extension. + +"""^^lv2:Markdown . + +ev:Event + a rdfs:Class ; + rdfs:label "Event" ; + lv2:documentation """ + +An ev:EventPort contains an LV2_Event_Buffer which contains a sequence of these +events. The binary format of LV2 events is defined by the LV2_Event struct in +event.h. + +Specific event types (such as MIDI or OSC) are defined by extensions, and +should be rdfs:subClassOf this class. + +"""^^lv2:Markdown . + +ev:TimeStamp + lv2:documentation """ + +This defines the meaning of the 'frames' and 'subframes' fields of an LV2_Event +(both unsigned 32-bit integers). + +"""^^lv2:Markdown . + +ev:FrameStamp + lv2:documentation """ + +The default time stamp unit for an LV2 event: the frames field represents audio +frames (in the sample rate passed to instantiate), and the subframes field is +1/UINT32_MAX of a frame. + +"""^^lv2:Markdown . + +ev:generic + lv2:documentation """ + +Indicates that this port does something meaningful for any event type. This is +useful for things like event mixers, delays, serialisers, and so on. + +If this property is set, hosts should consider the port suitable for any type +of event. Otherwise, hosts should consider the port 'appropriate' only for the +specific event types listed with :supportsEvent. Note that plugins must +gracefully handle unknown event types whether or not this property is present. + +"""^^lv2:Markdown . + +ev:supportsEvent + lv2:documentation """ + +Indicates that this port supports or "understands" a certain event type. + +For input ports, this means the plugin understands and does something useful +with events of this type. For output ports, this means the plugin may generate +events of this type. If the plugin never actually generates events of this +type, but might pass them through from an input, this property should not be +set (use ev:inheritsEvent for that). + +Plugins with event input ports must always gracefully handle any type of event, +even if it does not 'support' it. This property should always be set for event +types the plugin understands/generates so hosts can discover plugins +appropriate for a given scenario (for example, plugins with a MIDI input). +Hosts are not expected to consider event ports suitable for some type of event +if the relevant :supportsEvent property is not set, unless the ev:generic +property for that port is also set. + + +"""^^lv2:Markdown . + +ev:inheritsEvent + lv2:documentation """ + +Indicates that this output port might pass through events that arrived at some +other input port (or generate an event of the same type as events arriving at +that input). The host must always check the stamp type of all outputs when +connecting an input, but this property should be set whenever it applies. + + +"""^^lv2:Markdown . + +ev:supportsTimeStamp + lv2:documentation """ + +Indicates that this port supports or "understands" a certain time stamp type. +Meaningful only for input ports, the host must never connect a port to an event +buffer with a time stamp type that isn't supported by the port. + +"""^^lv2:Markdown . + +ev:generatesTimeStamp + lv2:documentation """ + +Indicates that this port may output a certain time stamp type, regardless of +the time stamp type of any input ports. + +If the port outputs stamps based on what type inputs are connected to, this +property should not be set (use the ev:inheritsTimeStamp property for that). +Hosts MUST check the time_stamp value of any output port buffers after a call +to connect_port on ANY event input port on the plugin. + +If the plugin changes the stamp_type field of an output event buffer during a +call to run(), the plugin must call the stamp_type_changed function provided by +the host in the LV2_Event_Feature struct, if it is non-NULL. + +"""^^lv2:Markdown . + +ev:inheritsTimeStamp + lv2:documentation """ + +Indicates that this port follows the time stamp type of an input port. + +This property is not necessary, but it should be set for outputs that base +their output type on an input port so the host can make more sense of the +plugin and provide a more sensible interface. + +"""^^lv2:Markdown . + diff --git a/lv2/event.lv2/event.ttl b/lv2/event.lv2/event.ttl new file mode 100644 index 0000000..2d871f6 --- /dev/null +++ b/lv2/event.lv2/event.ttl @@ -0,0 +1,85 @@ +@prefix ev: . +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . + + + a owl:Ontology ; + owl:deprecated true ; + rdfs:label "LV2 Event" ; + rdfs:comment "A port-based real-time generic event interface." ; + rdfs:seeAlso ; + owl:imports . + +ev:EventPort + a rdfs:Class ; + rdfs:label "Event Port" ; + rdfs:subClassOf lv2:Port ; + rdfs:comment "An LV2 event port." . + +ev:Event + a rdfs:Class ; + rdfs:label "Event" ; + rdfs:comment "A single generic time-stamped event." . + +ev:TimeStamp + a rdfs:Class ; + rdfs:label "Event Time Stamp" ; + rdfs:comment "The time stamp of an Event." . + +ev:FrameStamp + a rdfs:Class ; + rdfs:subClassOf ev:TimeStamp ; + rdfs:label "Audio Frame Time Stamp" ; + rdfs:comment "The default time stamp unit for an event." . + +ev:generic + a lv2:PortProperty ; + rdfs:label "generic event port" ; + rdfs:comment "Port works with generic events." . + +ev:supportsEvent + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort ; + rdfs:range rdfs:Class ; + rdfs:label "supports event type" ; + rdfs:comment "An event type supported by this port." . + +ev:inheritsEvent + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:OutputPort ; + rdfs:range lv2:Port ; + rdfs:label "inherits event type" ; + rdfs:comment "Output port inherits event types from an input port." . + +ev:supportsTimeStamp + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:InputPort ; + rdfs:range rdfs:Class ; + rdfs:label "supports time stamp type" ; + rdfs:comment "A time stamp type supported by this input port." . + +ev:generatesTimeStamp + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:OutputPort ; + rdfs:range rdfs:Class ; + rdfs:label "generates time stamp type" ; + rdfs:comment "A time stamp type generated by this input port." . + +ev:inheritsTimeStamp + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:OutputPort ; + rdfs:range lv2:Port ; + rdfs:label "inherits time stamp type" ; + rdfs:comment "Output port inherits time stamp types from an input port." . + diff --git a/lv2/event.lv2/manifest.ttl b/lv2/event.lv2/manifest.ttl new file mode 100644 index 0000000..230fe73 --- /dev/null +++ b/lv2/event.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 14 ; + rdfs:seeAlso . + diff --git a/lv2/event/event-helpers.h b/lv2/event/event-helpers.h deleted file mode 100644 index bf1b885..0000000 --- a/lv2/event/event-helpers.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - Copyright 2008-2015 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_EVENT_HELPERS_H -#define LV2_EVENT_HELPERS_H - -/** - @file event-helpers.h Helper functions for the LV2 Event extension - . -*/ - -#include "lv2/core/attributes.h" -#include "lv2/event/event.h" - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -LV2_DISABLE_DEPRECATION_WARNINGS - -/** @file - * Helper functions for the LV2 Event extension - * . - * - * These functions are provided for convenience only, use of them is not - * required for supporting lv2ev (i.e. the events extension is defined by the - * raw buffer format described in lv2_event.h and NOT by this API). - * - * Note that these functions are all static inline which basically means: - * do not take the address of these functions. */ - -/** Pad a size to 64 bits (for event sizes) */ -static inline uint16_t -lv2_event_pad_size(uint16_t size) -{ - return (uint16_t)((size + 7U) & ~7U); -} - -/** Initialize (empty, reset..) an existing event buffer. - * The contents of buf are ignored entirely and overwritten, except capacity - * which is unmodified. */ -static inline void -lv2_event_buffer_reset(LV2_Event_Buffer* buf, - uint16_t stamp_type, - uint8_t* data) -{ - buf->data = data; - buf->header_size = sizeof(LV2_Event_Buffer); - buf->stamp_type = stamp_type; - buf->event_count = 0; - buf->size = 0; -} - -/** Allocate a new, empty event buffer. */ -static inline LV2_Event_Buffer* -lv2_event_buffer_new(uint32_t capacity, uint16_t stamp_type) -{ - const size_t size = sizeof(LV2_Event_Buffer) + capacity; - LV2_Event_Buffer* buf = (LV2_Event_Buffer*)malloc(size); - if (buf != NULL) { - buf->capacity = capacity; - lv2_event_buffer_reset(buf, stamp_type, (uint8_t*)(buf + 1)); - return buf; - } - return NULL; -} - -/** An iterator over an LV2_Event_Buffer. - * - * Multiple simultaneous read iterators over a single buffer is fine, - * but changing the buffer invalidates all iterators. */ -typedef struct { - LV2_Event_Buffer* buf; - uint32_t offset; -} LV2_Event_Iterator; - -/** Reset an iterator to point to the start of `buf`. - * @return True if `iter` is valid, otherwise false (buffer is empty) */ -static inline bool -lv2_event_begin(LV2_Event_Iterator* iter, LV2_Event_Buffer* buf) -{ - iter->buf = buf; - iter->offset = 0; - return (buf->size > 0); -} - -/** Check if `iter` is valid. - * @return True if `iter` is valid, otherwise false (past end of buffer) */ -static inline bool -lv2_event_is_valid(LV2_Event_Iterator* iter) -{ - return (iter->buf && (iter->offset < iter->buf->size)); -} - -/** Advance `iter` forward one event. - * `iter` must be valid. - * @return True if `iter` is valid, otherwise false (reached end of buffer) */ -static inline bool -lv2_event_increment(LV2_Event_Iterator* iter) -{ - if (!lv2_event_is_valid(iter)) { - return false; - } - - LV2_Event* const ev = (LV2_Event*)(iter->buf->data + iter->offset); - - iter->offset += - lv2_event_pad_size((uint16_t)((uint16_t)sizeof(LV2_Event) + ev->size)); - - return true; -} - -/** Dereference an event iterator (get the event currently pointed at). - * `iter` must be valid. - * `data` if non-NULL, will be set to point to the contents of the event - * returned. - * @return A Pointer to the event `iter` is currently pointing at, or NULL - * if the end of the buffer is reached (in which case `data` is - * also set to NULL). */ -static inline LV2_Event* -lv2_event_get(LV2_Event_Iterator* iter, uint8_t** data) -{ - if (!lv2_event_is_valid(iter)) { - return NULL; - } - - LV2_Event* const ev = (LV2_Event*)(iter->buf->data + iter->offset); - - if (data) { - *data = (uint8_t*)ev + sizeof(LV2_Event); - } - - return ev; -} - -/** Write an event at `iter`. - * The event (if any) pointed to by `iter` will be overwritten, and `iter` - * incremented to point to the following event (i.e. several calls to this - * function can be done in sequence without twiddling iter in-between). - * @return True if event was written, otherwise false (buffer is full). */ -static inline bool -lv2_event_write(LV2_Event_Iterator* iter, - uint32_t frames, - uint32_t subframes, - uint16_t type, - uint16_t size, - const uint8_t* data) -{ - if (!iter->buf) { - return false; - } - - if (iter->buf->capacity - iter->buf->size < sizeof(LV2_Event) + size) { - return false; - } - - LV2_Event* const ev = (LV2_Event*)(iter->buf->data + iter->offset); - - ev->frames = frames; - ev->subframes = subframes; - ev->type = type; - ev->size = size; - memcpy((uint8_t*)ev + sizeof(LV2_Event), data, size); - ++iter->buf->event_count; - - size = lv2_event_pad_size((uint16_t)(sizeof(LV2_Event) + size)); - iter->buf->size += size; - iter->offset += size; - - return true; -} - -/** Reserve space for an event in the buffer and return a pointer to - the memory where the caller can write the event data, or NULL if there - is not enough room in the buffer. */ -static inline uint8_t* -lv2_event_reserve(LV2_Event_Iterator* iter, - uint32_t frames, - uint32_t subframes, - uint16_t type, - uint16_t size) -{ - const uint16_t total_size = (uint16_t)(sizeof(LV2_Event) + size); - if (iter->buf->capacity - iter->buf->size < total_size) { - return NULL; - } - - LV2_Event* const ev = (LV2_Event*)(iter->buf->data + iter->offset); - - ev->frames = frames; - ev->subframes = subframes; - ev->type = type; - ev->size = size; - ++iter->buf->event_count; - - const uint16_t padded_size = lv2_event_pad_size(total_size); - iter->buf->size += padded_size; - iter->offset += padded_size; - - return (uint8_t*)ev + sizeof(LV2_Event); -} - -/** Write an event at `iter`. - * The event (if any) pointed to by `iter` will be overwritten, and `iter` - * incremented to point to the following event (i.e. several calls to this - * function can be done in sequence without twiddling iter in-between). - * @return True if event was written, otherwise false (buffer is full). */ -static inline bool -lv2_event_write_event(LV2_Event_Iterator* iter, - const LV2_Event* ev, - const uint8_t* data) -{ - const uint16_t total_size = (uint16_t)(sizeof(LV2_Event) + ev->size); - if (iter->buf->capacity - iter->buf->size < total_size) { - return false; - } - - LV2_Event* const write_ev = (LV2_Event*)(iter->buf->data + iter->offset); - - *write_ev = *ev; - memcpy((uint8_t*)write_ev + sizeof(LV2_Event), data, ev->size); - ++iter->buf->event_count; - - const uint16_t padded_size = lv2_event_pad_size(total_size); - iter->buf->size += padded_size; - iter->offset += padded_size; - - return true; -} - -LV2_RESTORE_WARNINGS - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV2_EVENT_HELPERS_H */ diff --git a/lv2/event/event.h b/lv2/event/event.h deleted file mode 100644 index 045ac12..0000000 --- a/lv2/event/event.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - Copyright 2006-2007 Lars Luthman - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_EVENT_H -#define LV2_EVENT_H - -/** - @defgroup event Event - @ingroup lv2 - - Generic time-stamped events. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_EVENT_URI "http://lv2plug.in/ns/ext/event" ///< http://lv2plug.in/ns/ext/event -#define LV2_EVENT_PREFIX LV2_EVENT_URI "#" ///< http://lv2plug.in/ns/ext/event# - -#define LV2_EVENT__Event LV2_EVENT_PREFIX "Event" ///< http://lv2plug.in/ns/ext/event#Event -#define LV2_EVENT__EventPort LV2_EVENT_PREFIX "EventPort" ///< http://lv2plug.in/ns/ext/event#EventPort -#define LV2_EVENT__FrameStamp LV2_EVENT_PREFIX "FrameStamp" ///< http://lv2plug.in/ns/ext/event#FrameStamp -#define LV2_EVENT__TimeStamp LV2_EVENT_PREFIX "TimeStamp" ///< http://lv2plug.in/ns/ext/event#TimeStamp -#define LV2_EVENT__generatesTimeStamp LV2_EVENT_PREFIX "generatesTimeStamp" ///< http://lv2plug.in/ns/ext/event#generatesTimeStamp -#define LV2_EVENT__generic LV2_EVENT_PREFIX "generic" ///< http://lv2plug.in/ns/ext/event#generic -#define LV2_EVENT__inheritsEvent LV2_EVENT_PREFIX "inheritsEvent" ///< http://lv2plug.in/ns/ext/event#inheritsEvent -#define LV2_EVENT__inheritsTimeStamp LV2_EVENT_PREFIX "inheritsTimeStamp" ///< http://lv2plug.in/ns/ext/event#inheritsTimeStamp -#define LV2_EVENT__supportsEvent LV2_EVENT_PREFIX "supportsEvent" ///< http://lv2plug.in/ns/ext/event#supportsEvent -#define LV2_EVENT__supportsTimeStamp LV2_EVENT_PREFIX "supportsTimeStamp" ///< http://lv2plug.in/ns/ext/event#supportsTimeStamp - -// clang-format on - -#define LV2_EVENT_AUDIO_STAMP 0 ///< Special timestamp type for audio frames - -#include "lv2/core/attributes.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -LV2_DISABLE_DEPRECATION_WARNINGS - -/** - The best Pulses Per Quarter Note for tempo-based uint32_t timestamps. - Equal to 2^12 * 5 * 7 * 9 * 11 * 13 * 17, which is evenly divisible - by all integers from 1 through 18 inclusive, and powers of 2 up to 2^12. -*/ -LV2_DEPRECATED -static const uint32_t LV2_EVENT_PPQN = 3136573440U; - -/** - An LV2 event (header only). - - LV2 events are generic time-stamped containers for any type of event. - The type field defines the format of a given event's contents. - - This struct defines the header of an LV2 event. An LV2 event is a single - chunk of POD (plain old data), usually contained in a flat buffer (see - LV2_EventBuffer below). Unless a required feature says otherwise, hosts may - assume a deep copy of an LV2 event can be created safely using a simple: - - memcpy(ev_copy, ev, sizeof(LV2_Event) + ev->size); (or equivalent) -*/ -LV2_DEPRECATED -typedef struct { - /** - The frames portion of timestamp. The units used here can optionally be - set for a port (with the lv2ev:timeUnits property), otherwise this is - audio frames, corresponding to the sample_count parameter of the LV2 run - method (frame 0 is the first frame for that call to run). - */ - uint32_t frames; - - /** - The sub-frames portion of timestamp. The units used here can optionally - be set for a port (with the lv2ev:timeUnits property), otherwise this is - 1/(2^32) of an audio frame. - */ - uint32_t subframes; - - /** - The type of this event, as a number which represents some URI - defining an event type. This value MUST be some value previously - returned from a call to the uri_to_id function defined in the LV2 - URI map extension (see lv2_uri_map.h). - There are special rules which must be followed depending on the type - of an event. If the plugin recognizes an event type, the definition - of that event type will describe how to interpret the event, and - any required behaviour. Otherwise, if the type is 0, this event is a - non-POD event and lv2_event_unref MUST be called if the event is - 'dropped' (see above). Even if the plugin does not understand an event, - it may pass the event through to an output by simply copying (and NOT - calling lv2_event_unref). These rules are designed to allow for generic - event handling plugins and large non-POD events, but with minimal hassle - on simple plugins that "don't care" about these more advanced features. - */ - uint16_t type; - - /** - The size of the data portion of this event in bytes, which immediately - follows. The header size (12 bytes) is not included in this value. - */ - uint16_t size; - - /* size bytes of data follow here */ -} LV2_Event; - -/** - A buffer of LV2 events (header only). - - Like events (which this contains) an event buffer is a single chunk of POD: - the entire buffer (including contents) can be copied with a single memcpy. - The first contained event begins sizeof(LV2_EventBuffer) bytes after the - start of this struct. - - After this header, the buffer contains an event header (defined by struct - LV2_Event), followed by that event's contents (padded to 64 bits), followed - by another header, etc: - - | | | | | | | - | | | | | | | | | | | | | | | | | | | | | | | | | - |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ... -*/ -LV2_DEPRECATED -typedef struct { - /** - The contents of the event buffer. This may or may not reside in the - same block of memory as this header, plugins must not assume either. - The host guarantees this points to at least capacity bytes of allocated - memory (though only size bytes of that are valid events). - */ - uint8_t* data; - - /** - The size of this event header in bytes (including everything). - - This is to allow for extending this header in the future without - breaking binary compatibility. Whenever this header is copied, - it MUST be done using this field (and NOT the sizeof this struct). - */ - uint16_t header_size; - - /** - The type of the time stamps for events in this buffer. - As a special exception, '0' always means audio frames and subframes - (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate. - - INPUTS: The host must set this field to the numeric ID of some URI - defining the meaning of the frames/subframes fields of contained events - (obtained by the LV2 URI Map uri_to_id function with the URI of this - extension as the 'map' argument, see lv2_uri_map.h). The host must - never pass a plugin a buffer which uses a stamp type the plugin does not - 'understand'. The value of this field must never change, except when - connect_port is called on the input port, at which time the host MUST - have set the stamp_type field to the value that will be used for all - subsequent run calls. - - OUTPUTS: The plugin may set this to any value that has been returned - from uri_to_id with the URI of this extension for a 'map' argument. - When connected to a buffer with connect_port, output ports MUST set this - field to the type of time stamp they will be writing. On any call to - connect_port on an event input port, the plugin may change this field on - any output port, it is the responsibility of the host to check if any of - these values have changed and act accordingly. - */ - uint16_t stamp_type; - - /** - The number of events in this buffer. - - INPUTS: The host must set this field to the number of events contained - in the data buffer before calling run(). The plugin must not change - this field. - - OUTPUTS: The plugin must set this field to the number of events it has - written to the buffer before returning from run(). Any initial value - should be ignored by the plugin. - */ - uint32_t event_count; - - /** - The size of the data buffer in bytes. - This is set by the host and must not be changed by the plugin. - The host is allowed to change this between run() calls. - */ - uint32_t capacity; - - /** - The size of the initial portion of the data buffer containing data. - - INPUTS: The host must set this field to the number of bytes used - by all events it has written to the buffer (including headers) - before calling the plugin's run(). - The plugin must not change this field. - - OUTPUTS: The plugin must set this field to the number of bytes - used by all events it has written to the buffer (including headers) - before returning from run(). - Any initial value should be ignored by the plugin. - */ - uint32_t size; -} LV2_Event_Buffer; - -/** - Opaque pointer to host data. -*/ -LV2_DEPRECATED -typedef void* LV2_Event_Callback_Data; - -/** - Non-POD events feature. - - To support this feature the host must pass an LV2_Feature struct to the - plugin's instantiate method with URI "http://lv2plug.in/ns/ext/event" - and data pointed to an instance of this struct. Note this feature - is not mandatory to support the event extension. -*/ -LV2_DEPRECATED -typedef struct { - /** - Opaque pointer to host data. - - The plugin MUST pass this to any call to functions in this struct. - Otherwise, it must not be interpreted in any way. - */ - LV2_Event_Callback_Data callback_data; - - /** - Take a reference to a non-POD event. - - If a plugin receives an event with type 0, it means the event is a - pointer to some object in memory and not a flat sequence of bytes - in the buffer. When receiving a non-POD event, the plugin already - has an implicit reference to the event. If the event is stored AND - passed to an output, lv2_event_ref MUST be called on that event. - If the event is only stored OR passed through, this is not necessary - (as the plugin already has 1 implicit reference). - - @param event An event received at an input that will not be copied to - an output or stored in any way. - - @param context The calling context. Like event types, this is a mapped - URI, see lv2_context.h. Simple plugin with just a run() method should - pass 0 here (the ID of the 'standard' LV2 run context). The host - guarantees that this function is realtime safe iff the context is - realtime safe. - - PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS. - */ - uint32_t (*lv2_event_ref)(LV2_Event_Callback_Data callback_data, - LV2_Event* event); - - /** - Drop a reference to a non-POD event. - - If a plugin receives an event with type 0, it means the event is a - pointer to some object in memory and not a flat sequence of bytes - in the buffer. If the plugin does not pass the event through to - an output or store it internally somehow, it MUST call this function - on the event (more information on using non-POD events below). - - @param event An event received at an input that will not be copied to an - output or stored in any way. - - @param context The calling context. Like event types, this is a mapped - URI, see lv2_context.h. Simple plugin with just a run() method should - pass 0 here (the ID of the 'standard' LV2 run context). The host - guarantees that this function is realtime safe iff the context is - realtime safe. - - PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS. - */ - uint32_t (*lv2_event_unref)(LV2_Event_Callback_Data callback_data, - LV2_Event* event); -} LV2_Event_Feature; - -LV2_RESTORE_WARNINGS - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_EVENT_H */ diff --git a/lv2/event/event.meta.ttl b/lv2/event/event.meta.ttl deleted file mode 100644 index e9c26bc..0000000 --- a/lv2/event/event.meta.ttl +++ /dev/null @@ -1,256 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix ev: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 Event" ; - doap:shortdesc "A port-based real-time generic event interface." ; - doap:created "2008-00-00" ; - doap:developer , - ; - doap:release [ - doap:revision "1.14" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] - ] - ] , [ - doap:revision "1.12" ; - doap:created "2014-08-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Minor documentation improvements." - ] - ] - ] , [ - doap:revision "1.10" ; - doap:created "2013-01-13" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix incorrect return type in lv2_event_get()." - ] - ] - ] , [ - doap:revision "1.8" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Make event iterator gracefully handle optional ports." - ] , [ - rdfs:label "Remove asserts from event-helper.h." - ] , [ - rdfs:label "Use more precise domain and range for EventPort properties." - ] , [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "1.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix bug in lv2_event_reserve()." - ] , [ - rdfs:label "Fix incorrect ranges of some properties." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Update packaging." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2011-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system (for installation)." - ] , [ - rdfs:label "Convert documentation to HTML and use lv2:documentation." - ] , [ - rdfs:label "Use lv2:Specification to be discovered as an extension." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2010-11-24" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension is deprecated. New implementations -should use LV2 Atom instead. - -This extension defines a generic time-stamped event port type, which can be -used to create plugins that read and write real-time events, such as MIDI, -OSC, or any other type of event payload. The type(s) of event supported by -a port is defined in the data file for a plugin, for example: - - :::turtle - - lv2:port [ - a ev:EventPort, lv2:InputPort ; - lv2:index 0 ; - ev:supportsEvent ; - lv2:symbol "midi_input" ; - lv2:name "MIDI input" ; - ] . - -"""^^lv2:Markdown . - -ev:EventPort - lv2:documentation """ - -Ports of this type will be connected to a struct of type LV2_Event_Buffer, -defined in event.h. These ports contain a sequence of generic events (possibly -several types mixed in a single stream), the specific types of which are -defined by some URI in another LV2 extension. - -"""^^lv2:Markdown . - -ev:Event - a rdfs:Class ; - rdfs:label "Event" ; - lv2:documentation """ - -An ev:EventPort contains an LV2_Event_Buffer which contains a sequence of these -events. The binary format of LV2 events is defined by the LV2_Event struct in -event.h. - -Specific event types (such as MIDI or OSC) are defined by extensions, and -should be rdfs:subClassOf this class. - -"""^^lv2:Markdown . - -ev:TimeStamp - lv2:documentation """ - -This defines the meaning of the 'frames' and 'subframes' fields of an LV2_Event -(both unsigned 32-bit integers). - -"""^^lv2:Markdown . - -ev:FrameStamp - lv2:documentation """ - -The default time stamp unit for an LV2 event: the frames field represents audio -frames (in the sample rate passed to instantiate), and the subframes field is -1/UINT32_MAX of a frame. - -"""^^lv2:Markdown . - -ev:generic - lv2:documentation """ - -Indicates that this port does something meaningful for any event type. This is -useful for things like event mixers, delays, serialisers, and so on. - -If this property is set, hosts should consider the port suitable for any type -of event. Otherwise, hosts should consider the port 'appropriate' only for the -specific event types listed with :supportsEvent. Note that plugins must -gracefully handle unknown event types whether or not this property is present. - -"""^^lv2:Markdown . - -ev:supportsEvent - lv2:documentation """ - -Indicates that this port supports or "understands" a certain event type. - -For input ports, this means the plugin understands and does something useful -with events of this type. For output ports, this means the plugin may generate -events of this type. If the plugin never actually generates events of this -type, but might pass them through from an input, this property should not be -set (use ev:inheritsEvent for that). - -Plugins with event input ports must always gracefully handle any type of event, -even if it does not 'support' it. This property should always be set for event -types the plugin understands/generates so hosts can discover plugins -appropriate for a given scenario (for example, plugins with a MIDI input). -Hosts are not expected to consider event ports suitable for some type of event -if the relevant :supportsEvent property is not set, unless the ev:generic -property for that port is also set. - - -"""^^lv2:Markdown . - -ev:inheritsEvent - lv2:documentation """ - -Indicates that this output port might pass through events that arrived at some -other input port (or generate an event of the same type as events arriving at -that input). The host must always check the stamp type of all outputs when -connecting an input, but this property should be set whenever it applies. - - -"""^^lv2:Markdown . - -ev:supportsTimeStamp - lv2:documentation """ - -Indicates that this port supports or "understands" a certain time stamp type. -Meaningful only for input ports, the host must never connect a port to an event -buffer with a time stamp type that isn't supported by the port. - -"""^^lv2:Markdown . - -ev:generatesTimeStamp - lv2:documentation """ - -Indicates that this port may output a certain time stamp type, regardless of -the time stamp type of any input ports. - -If the port outputs stamps based on what type inputs are connected to, this -property should not be set (use the ev:inheritsTimeStamp property for that). -Hosts MUST check the time_stamp value of any output port buffers after a call -to connect_port on ANY event input port on the plugin. - -If the plugin changes the stamp_type field of an output event buffer during a -call to run(), the plugin must call the stamp_type_changed function provided by -the host in the LV2_Event_Feature struct, if it is non-NULL. - -"""^^lv2:Markdown . - -ev:inheritsTimeStamp - lv2:documentation """ - -Indicates that this port follows the time stamp type of an input port. - -This property is not necessary, but it should be set for outputs that base -their output type on an input port so the host can make more sense of the -plugin and provide a more sensible interface. - -"""^^lv2:Markdown . - diff --git a/lv2/event/event.ttl b/lv2/event/event.ttl deleted file mode 100644 index 119e606..0000000 --- a/lv2/event/event.ttl +++ /dev/null @@ -1,87 +0,0 @@ -@prefix ev: . -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . - - - a owl:Ontology ; - owl:deprecated true ; - rdfs:label "LV2 Event" ; - rdfs:comment "A port-based real-time generic event interface." ; - rdfs:seeAlso , - , - ; - owl:imports . - -ev:EventPort - a rdfs:Class ; - rdfs:label "Event Port" ; - rdfs:subClassOf lv2:Port ; - rdfs:comment "An LV2 event port." . - -ev:Event - a rdfs:Class ; - rdfs:label "Event" ; - rdfs:comment "A single generic time-stamped event." . - -ev:TimeStamp - a rdfs:Class ; - rdfs:label "Event Time Stamp" ; - rdfs:comment "The time stamp of an Event." . - -ev:FrameStamp - a rdfs:Class ; - rdfs:subClassOf ev:TimeStamp ; - rdfs:label "Audio Frame Time Stamp" ; - rdfs:comment "The default time stamp unit for an event." . - -ev:generic - a lv2:PortProperty ; - rdfs:label "generic event port" ; - rdfs:comment "Port works with generic events." . - -ev:supportsEvent - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ev:EventPort ; - rdfs:range rdfs:Class ; - rdfs:label "supports event type" ; - rdfs:comment "An event type supported by this port." . - -ev:inheritsEvent - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ev:EventPort , - lv2:OutputPort ; - rdfs:range lv2:Port ; - rdfs:label "inherits event type" ; - rdfs:comment "Output port inherits event types from an input port." . - -ev:supportsTimeStamp - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ev:EventPort , - lv2:InputPort ; - rdfs:range rdfs:Class ; - rdfs:label "supports time stamp type" ; - rdfs:comment "A time stamp type supported by this input port." . - -ev:generatesTimeStamp - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ev:EventPort , - lv2:OutputPort ; - rdfs:range rdfs:Class ; - rdfs:label "generates time stamp type" ; - rdfs:comment "A time stamp type generated by this input port." . - -ev:inheritsTimeStamp - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ev:EventPort , - lv2:OutputPort ; - rdfs:range lv2:Port ; - rdfs:label "inherits time stamp type" ; - rdfs:comment "Output port inherits time stamp types from an input port." . - diff --git a/lv2/event/manifest.ttl b/lv2/event/manifest.ttl deleted file mode 100644 index 230fe73..0000000 --- a/lv2/event/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 14 ; - rdfs:seeAlso . - diff --git a/lv2/event/meson.build b/lv2/event/meson.build deleted file mode 100644 index 020acc8..0000000 --- a/lv2/event/meson.build +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'event' -path = 'ns' / 'ext' / 'event' - -event_data = files( - 'event.meta.ttl', - 'event.ttl', - 'manifest.ttl', -) - -headers = files( - 'event-helpers.h', - 'event.h', -) - -# Install specification bundle -install_data(event_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_event_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('event.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/instance-access.lv2/instance-access.meta.ttl b/lv2/instance-access.lv2/instance-access.meta.ttl new file mode 100644 index 0000000..875e2f8 --- /dev/null +++ b/lv2/instance-access.lv2/instance-access.meta.ttl @@ -0,0 +1,75 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix ia: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 Instance Access" ; + doap:shortdesc "Provides access to the LV2_Handle of a plugin." ; + doap:created "2010-10-04" ; + doap:developer ; + doap:release [ + doap:revision "1.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2011-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system for installation." + ] , [ + rdfs:label "Switch to ISC license." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2010-10-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a feature which allows plugin UIs to get a direct handle +to an LV2 plugin instance (LV2_Handle), if possible. + +Note that the use of this extension by UIs violates the important principle of +UI/plugin separation, and is potentially a source of many problems. +Accordingly, **use of this extension is highly discouraged**, and plugins +should not expect hosts to support it, since it is often impossible to do so. + +To support this feature the host must pass an LV2_Feature struct to the UI +instantiate method with URI LV2_INSTANCE_ACCESS_URI and data pointed directly +to the LV2_Handle of the plugin instance. + +"""^^lv2:Markdown . + diff --git a/lv2/instance-access.lv2/instance-access.ttl b/lv2/instance-access.lv2/instance-access.ttl new file mode 100644 index 0000000..637f4e0 --- /dev/null +++ b/lv2/instance-access.lv2/instance-access.ttl @@ -0,0 +1,10 @@ +@prefix ia: . +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Feature ; + rdfs:label "instance access" ; + rdfs:comment "A feature that provides access to a plugin instance." ; + rdfs:seeAlso . + diff --git a/lv2/instance-access.lv2/manifest.ttl b/lv2/instance-access.lv2/manifest.ttl new file mode 100644 index 0000000..e6c8810 --- /dev/null +++ b/lv2/instance-access.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso . + diff --git a/lv2/instance-access/instance-access.h b/lv2/instance-access/instance-access.h deleted file mode 100644 index 2986f69..0000000 --- a/lv2/instance-access/instance-access.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_INSTANCE_ACCESS_H -#define LV2_INSTANCE_ACCESS_H - -/** - @defgroup instance-access Instance Access - @ingroup lv2 - - Access to the LV2_Handle of a plugin for UIs. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_INSTANCE_ACCESS_URI "http://lv2plug.in/ns/ext/instance-access" ///< http://lv2plug.in/ns/ext/instance-access - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_INSTANCE_ACCESS_H */ diff --git a/lv2/instance-access/instance-access.meta.ttl b/lv2/instance-access/instance-access.meta.ttl deleted file mode 100644 index 875e2f8..0000000 --- a/lv2/instance-access/instance-access.meta.ttl +++ /dev/null @@ -1,75 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix ia: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 Instance Access" ; - doap:shortdesc "Provides access to the LV2_Handle of a plugin." ; - doap:created "2010-10-04" ; - doap:developer ; - doap:release [ - doap:revision "1.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2011-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system for installation." - ] , [ - rdfs:label "Switch to ISC license." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2010-10-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a feature which allows plugin UIs to get a direct handle -to an LV2 plugin instance (LV2_Handle), if possible. - -Note that the use of this extension by UIs violates the important principle of -UI/plugin separation, and is potentially a source of many problems. -Accordingly, **use of this extension is highly discouraged**, and plugins -should not expect hosts to support it, since it is often impossible to do so. - -To support this feature the host must pass an LV2_Feature struct to the UI -instantiate method with URI LV2_INSTANCE_ACCESS_URI and data pointed directly -to the LV2_Handle of the plugin instance. - -"""^^lv2:Markdown . - diff --git a/lv2/instance-access/instance-access.ttl b/lv2/instance-access/instance-access.ttl deleted file mode 100644 index 085ae37..0000000 --- a/lv2/instance-access/instance-access.ttl +++ /dev/null @@ -1,11 +0,0 @@ -@prefix ia: . -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Feature ; - rdfs:label "instance access" ; - rdfs:comment "A feature that provides access to a plugin instance." ; - rdfs:seeAlso , - . - diff --git a/lv2/instance-access/manifest.ttl b/lv2/instance-access/manifest.ttl deleted file mode 100644 index e6c8810..0000000 --- a/lv2/instance-access/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 6 ; - rdfs:seeAlso . - diff --git a/lv2/instance-access/meson.build b/lv2/instance-access/meson.build deleted file mode 100644 index 70ff48e..0000000 --- a/lv2/instance-access/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'instance-access' -path = 'ns' / 'ext' / 'instance-access' - -instance_access_data = files( - 'instance-access.meta.ttl', - 'instance-access.ttl', - 'manifest.ttl', -) - -headers = files( - 'instance-access.h', -) - -# Install specification bundle -install_data(instance_access_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_instance_access_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('instance-access.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/log.lv2/log.meta.ttl b/lv2/log.lv2/log.meta.ttl new file mode 100644 index 0000000..87cff43 --- /dev/null +++ b/lv2/log.lv2/log.meta.ttl @@ -0,0 +1,126 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix log: . +@prefix lv2: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Log" ; + doap:shortdesc "A feature for writing log messages." ; + doap:created "2012-01-12" ; + doap:developer ; + doap:release [ + doap:revision "2.4" ; + doap:created "2016-07-30" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add lv2_log_logger_set_map() for changing the URI map of an existing logger." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2014-01-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add missing include string.h to logger.h for memset." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2013-01-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add logger convenience API." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a feature, log:log, which allows plugins to print log +messages with an API similar to the standard C `printf` function. This allows, +for example, plugin logs to be nicely presented to the user in a graphical user +interface. + +Different log levels are defined by URI and passed as an LV2_URID. This +extensions defines standard levels which are expected to be understood by all +implementations and should be sufficient in most cases, but advanced +implementations may define and use additional levels to suit their needs. + +"""^^lv2:Markdown . + +log:Entry + a rdfs:Class ; + rdfs:label "Log Entry" ; + lv2:documentation """ + +Subclasses of this are passed as the `type` parameter to LV2_Log_Log methods to +describe the nature of the log entry. + +"""^^lv2:Markdown . + +log:Error + lv2:documentation """ + +An error should only be posted when a serious unexpected error occurs, and +should be actively shown to the user by the host. + +"""^^lv2:Markdown . + +log:Note + lv2:documentation """ + +A note records some useful piece of information, but may be ignored. The host +should provide passive access to note entries to the user. + +"""^^lv2:Markdown . + +log:Warning + lv2:documentation """ + +A warning should be posted when an unexpected, but non-critical, error occurs. +The host should provide passive access to warnings entries to the user, but may +also choose to actively show them. + +"""^^lv2:Markdown . + +log:Trace + lv2:documentation """ + +A trace should not be displayed during normal operation, but the host may +implement an option to display them for debugging purposes. + +This entry type is special in that one may be posted in a real-time thread. It +is assumed that if debug tracing is enabled, real-time performance is not a +concern. However, the host MUST guarantee that posting a trace _is_ real-time +safe if debug tracing is not enabled (for example, by simply ignoring the call +as early as possible). + +"""^^lv2:Markdown . + +log:log + lv2:documentation """ + +A feature which plugins may use to log messages. To support this feature, +the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI +LV2_LOG__log and data pointed to an instance of LV2_Log_Log. + +"""^^lv2:Markdown . + diff --git a/lv2/log.lv2/log.ttl b/lv2/log.lv2/log.ttl new file mode 100644 index 0000000..0b334ed --- /dev/null +++ b/lv2/log.lv2/log.ttl @@ -0,0 +1,48 @@ +@prefix log: . +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Log" ; + rdfs:comment "A feature for writing log messages." ; + rdfs:seeAlso ; + owl:imports . + +log:Entry + a rdfs:Class ; + rdfs:label "Entry" ; + rdfs:comment "A log entry." . + +log:Error + a rdfs:Class ; + rdfs:label "Error" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "An error message." . + +log:Note + a rdfs:Class ; + rdfs:label "Note" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "An informative message." . + +log:Warning + a rdfs:Class ; + rdfs:label "Warning" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "A warning message." . + +log:Trace + a rdfs:Class ; + rdfs:label "Trace" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "A debugging trace message." . + +log:log + a lv2:Feature ; + rdfs:label "log" ; + rdfs:comment "Logging feature." . + diff --git a/lv2/log.lv2/manifest.ttl b/lv2/log.lv2/manifest.ttl new file mode 100644 index 0000000..bcaeff3 --- /dev/null +++ b/lv2/log.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/log/log.h b/lv2/log/log.h deleted file mode 100644 index cc62bef..0000000 --- a/lv2/log/log.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_LOG_H -#define LV2_LOG_H - -/** - @defgroup log Log - @ingroup lv2 - - Interface for plugins to log via the host. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_LOG_URI "http://lv2plug.in/ns/ext/log" ///< http://lv2plug.in/ns/ext/log -#define LV2_LOG_PREFIX LV2_LOG_URI "#" ///< http://lv2plug.in/ns/ext/log# - -#define LV2_LOG__Entry LV2_LOG_PREFIX "Entry" ///< http://lv2plug.in/ns/ext/log#Entry -#define LV2_LOG__Error LV2_LOG_PREFIX "Error" ///< http://lv2plug.in/ns/ext/log#Error -#define LV2_LOG__Note LV2_LOG_PREFIX "Note" ///< http://lv2plug.in/ns/ext/log#Note -#define LV2_LOG__Trace LV2_LOG_PREFIX "Trace" ///< http://lv2plug.in/ns/ext/log#Trace -#define LV2_LOG__Warning LV2_LOG_PREFIX "Warning" ///< http://lv2plug.in/ns/ext/log#Warning -#define LV2_LOG__log LV2_LOG_PREFIX "log" ///< http://lv2plug.in/ns/ext/log#log - -// clang-format on - -#include "lv2/urid/urid.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @cond */ -#ifdef __GNUC__ -/** Allow type checking of printf-like functions. */ -# define LV2_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) -#else -# define LV2_LOG_FUNC(fmt, arg1) -#endif -/** @endcond */ - -/** - Opaque data to host data for LV2_Log_Log. -*/ -typedef void* LV2_Log_Handle; - -/** - Log feature (LV2_LOG__log) -*/ -typedef struct { - /** - Opaque pointer to host data. - - This MUST be passed to methods in this struct whenever they are called. - Otherwise, it must not be interpreted in any way. - */ - LV2_Log_Handle handle; - - /** - Log a message, passing format parameters directly. - - The API of this function matches that of the standard C printf function, - except for the addition of the first two parameters. This function may - be called from any non-realtime context, or from any context if `type` - is @ref LV2_LOG__Trace. - */ - LV2_LOG_FUNC(3, 4) - int (*printf)(LV2_Log_Handle handle, LV2_URID type, const char* fmt, ...); - - /** - Log a message, passing format parameters in a va_list. - - The API of this function matches that of the standard C vprintf - function, except for the addition of the first two parameters. This - function may be called from any non-realtime context, or from any - context if `type` is @ref LV2_LOG__Trace. - */ - LV2_LOG_FUNC(3, 0) - int (*vprintf)(LV2_Log_Handle handle, - LV2_URID type, - const char* fmt, - va_list ap); -} LV2_Log_Log; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_LOG_H */ diff --git a/lv2/log/log.meta.ttl b/lv2/log/log.meta.ttl deleted file mode 100644 index 87cff43..0000000 --- a/lv2/log/log.meta.ttl +++ /dev/null @@ -1,126 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix log: . -@prefix lv2: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Log" ; - doap:shortdesc "A feature for writing log messages." ; - doap:created "2012-01-12" ; - doap:developer ; - doap:release [ - doap:revision "2.4" ; - doap:created "2016-07-30" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add lv2_log_logger_set_map() for changing the URI map of an existing logger." - ] - ] - ] , [ - doap:revision "2.2" ; - doap:created "2014-01-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add missing include string.h to logger.h for memset." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2013-01-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add logger convenience API." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a feature, log:log, which allows plugins to print log -messages with an API similar to the standard C `printf` function. This allows, -for example, plugin logs to be nicely presented to the user in a graphical user -interface. - -Different log levels are defined by URI and passed as an LV2_URID. This -extensions defines standard levels which are expected to be understood by all -implementations and should be sufficient in most cases, but advanced -implementations may define and use additional levels to suit their needs. - -"""^^lv2:Markdown . - -log:Entry - a rdfs:Class ; - rdfs:label "Log Entry" ; - lv2:documentation """ - -Subclasses of this are passed as the `type` parameter to LV2_Log_Log methods to -describe the nature of the log entry. - -"""^^lv2:Markdown . - -log:Error - lv2:documentation """ - -An error should only be posted when a serious unexpected error occurs, and -should be actively shown to the user by the host. - -"""^^lv2:Markdown . - -log:Note - lv2:documentation """ - -A note records some useful piece of information, but may be ignored. The host -should provide passive access to note entries to the user. - -"""^^lv2:Markdown . - -log:Warning - lv2:documentation """ - -A warning should be posted when an unexpected, but non-critical, error occurs. -The host should provide passive access to warnings entries to the user, but may -also choose to actively show them. - -"""^^lv2:Markdown . - -log:Trace - lv2:documentation """ - -A trace should not be displayed during normal operation, but the host may -implement an option to display them for debugging purposes. - -This entry type is special in that one may be posted in a real-time thread. It -is assumed that if debug tracing is enabled, real-time performance is not a -concern. However, the host MUST guarantee that posting a trace _is_ real-time -safe if debug tracing is not enabled (for example, by simply ignoring the call -as early as possible). - -"""^^lv2:Markdown . - -log:log - lv2:documentation """ - -A feature which plugins may use to log messages. To support this feature, -the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI -LV2_LOG__log and data pointed to an instance of LV2_Log_Log. - -"""^^lv2:Markdown . - diff --git a/lv2/log/log.ttl b/lv2/log/log.ttl deleted file mode 100644 index a8c4236..0000000 --- a/lv2/log/log.ttl +++ /dev/null @@ -1,49 +0,0 @@ -@prefix log: . -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Log" ; - rdfs:comment "A feature for writing log messages." ; - rdfs:seeAlso , - ; - owl:imports . - -log:Entry - a rdfs:Class ; - rdfs:label "Entry" ; - rdfs:comment "A log entry." . - -log:Error - a rdfs:Class ; - rdfs:label "Error" ; - rdfs:subClassOf log:Entry ; - rdfs:comment "An error message." . - -log:Note - a rdfs:Class ; - rdfs:label "Note" ; - rdfs:subClassOf log:Entry ; - rdfs:comment "An informative message." . - -log:Warning - a rdfs:Class ; - rdfs:label "Warning" ; - rdfs:subClassOf log:Entry ; - rdfs:comment "A warning message." . - -log:Trace - a rdfs:Class ; - rdfs:label "Trace" ; - rdfs:subClassOf log:Entry ; - rdfs:comment "A debugging trace message." . - -log:log - a lv2:Feature ; - rdfs:label "log" ; - rdfs:comment "Logging feature." . - diff --git a/lv2/log/logger.h b/lv2/log/logger.h deleted file mode 100644 index d6919a2..0000000 --- a/lv2/log/logger.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_ATOM_LOGGER_H -#define LV2_ATOM_LOGGER_H - -/** - @defgroup logger Logger - @ingroup log - - Convenience API for easy logging in plugin code. This API provides simple - wrappers for logging from a plugin, which automatically fall back to - printing to stderr if host support is unavailable. - - @{ -*/ - -#include "lv2/log/log.h" -#include "lv2/urid/urid.h" - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Logger convenience API state. -*/ -typedef struct { - LV2_Log_Log* log; - - LV2_URID Error; - LV2_URID Note; - LV2_URID Trace; - LV2_URID Warning; -} LV2_Log_Logger; - -/** - Set `map` as the URI map for `logger`. - - This affects the message type URIDs (Error, Warning, etc) which are passed - to the log's print functions. -*/ -static inline void -lv2_log_logger_set_map(LV2_Log_Logger* logger, LV2_URID_Map* map) -{ - if (map) { - logger->Error = map->map(map->handle, LV2_LOG__Error); - logger->Note = map->map(map->handle, LV2_LOG__Note); - logger->Trace = map->map(map->handle, LV2_LOG__Trace); - logger->Warning = map->map(map->handle, LV2_LOG__Warning); - } else { - logger->Error = logger->Note = logger->Trace = logger->Warning = 0; - } -} - -/** - Initialise `logger`. - - URIs will be mapped using `map` and stored, a reference to `map` itself is - not held. Both `map` and `log` may be NULL when unsupported by the host, - in which case the implementation will fall back to printing to stderr. -*/ -static inline void -lv2_log_logger_init(LV2_Log_Logger* logger, LV2_URID_Map* map, LV2_Log_Log* log) -{ - logger->log = log; - lv2_log_logger_set_map(logger, map); -} - -/** - Log a message to the host, or stderr if support is unavailable. -*/ -LV2_LOG_FUNC(3, 0) -static inline int -lv2_log_vprintf(LV2_Log_Logger* logger, - LV2_URID type, - const char* fmt, - va_list args) -{ - return ((logger && logger->log) - ? logger->log->vprintf(logger->log->handle, type, fmt, args) - : vfprintf(stderr, fmt, args)); -} - -/** Log an error via lv2_log_vprintf(). */ -LV2_LOG_FUNC(2, 3) -static inline int -lv2_log_error(LV2_Log_Logger* logger, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - const int ret = lv2_log_vprintf(logger, logger->Error, fmt, args); - va_end(args); - return ret; -} - -/** Log a note via lv2_log_vprintf(). */ -LV2_LOG_FUNC(2, 3) -static inline int -lv2_log_note(LV2_Log_Logger* logger, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - const int ret = lv2_log_vprintf(logger, logger->Note, fmt, args); - va_end(args); - return ret; -} - -/** Log a trace via lv2_log_vprintf(). */ -LV2_LOG_FUNC(2, 3) -static inline int -lv2_log_trace(LV2_Log_Logger* logger, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - const int ret = lv2_log_vprintf(logger, logger->Trace, fmt, args); - va_end(args); - return ret; -} - -/** Log a warning via lv2_log_vprintf(). */ -LV2_LOG_FUNC(2, 3) -static inline int -lv2_log_warning(LV2_Log_Logger* logger, const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - const int ret = lv2_log_vprintf(logger, logger->Warning, fmt, args); - va_end(args); - return ret; -} - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_LOG_LOGGER_H */ diff --git a/lv2/log/manifest.ttl b/lv2/log/manifest.ttl deleted file mode 100644 index bcaeff3..0000000 --- a/lv2/log/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 2 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/log/meson.build b/lv2/log/meson.build deleted file mode 100644 index 9b13db0..0000000 --- a/lv2/log/meson.build +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'log' -path = 'ns' / 'ext' / 'log' - -log_data = files( - 'log.meta.ttl', - 'log.ttl', - 'manifest.ttl', -) - -headers = files( - 'log.h', - 'logger.h', -) - -# Install specification bundle -install_data(log_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_log_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('log.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/meson.build b/lv2/meson.build deleted file mode 100644 index d8875eb..0000000 --- a/lv2/meson.build +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -dirs = [ - 'atom', - 'buf-size', - 'core', - 'data-access', - 'dynmanifest', - 'event', - 'instance-access', - 'log', - 'midi', - 'morph', - 'options', - 'parameters', - 'patch', - 'port-groups', - 'port-props', - 'presets', - 'resize-port', - 'state', - 'time', - 'ui', - 'units', - 'uri-map', - 'urid', - 'worker', -] - -foreach dir : dirs - subdir(dir) -endforeach - -if not get_option('tests').disabled() - check_python = pymod.find_installation('python3', - modules: ['rdflib'], - required: get_option('tests')) - - if check_python.found() - lv2_check_specification = files( - lv2_source_root / 'scripts' / 'lv2_check_specification.py' - ) - - foreach dir : dirs - test(dir, - lv2_check_specification, - args: files(dir / 'manifest.ttl'), - suite: ['spec']) - endforeach - endif -endif diff --git a/lv2/midi.lv2/manifest.ttl b/lv2/midi.lv2/manifest.ttl new file mode 100644 index 0000000..f141936 --- /dev/null +++ b/lv2/midi.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 10 ; + rdfs:seeAlso . + diff --git a/lv2/midi.lv2/midi.meta.ttl b/lv2/midi.lv2/midi.meta.ttl new file mode 100644 index 0000000..7efdb01 --- /dev/null +++ b/lv2/midi.lv2/midi.meta.ttl @@ -0,0 +1,153 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix midi: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 MIDI" ; + doap:shortdesc "A normalised definition of raw MIDI." ; + doap:maintainer ; + doap:created "2006-00-00" ; + doap:developer , + ; + doap:release [ + doap:revision "1.10" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix incorrect range of midi:chunk." + ] + ] + ] , [ + doap:revision "1.8" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] , [ + rdfs:label "Add midi:binding and midi:channel predicates." + ] , [ + rdfs:label "Add midi:HexByte datatype for status bytes and masks." + ] , [ + rdfs:label "Remove non-standard midi:Tick message type." + ] , [ + rdfs:label "Add C definitions for message types and standard controllers." + ] , [ + rdfs:label "Fix definition of SystemExclusive status byte." + ] + ] + ] , [ + doap:revision "1.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add class definitions for various message types." + ] , [ + rdfs:label "Document how to serialise a MidiEvent to a string." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2011-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system for installation." + ] , [ + rdfs:label "Switch to ISC license." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2010-10-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This specification defines a data type for a MIDI message, midi:MidiEvent, +which is normalised for fast and convenient real-time processing. MIDI is the +Musical Instrument Digital Interface, a ubiquitous binary standard for +controlling digital music devices. + +For plugins that process MIDI (or other situations where MIDI is sent via a +generic transport) the main type defined here, midi:MidiEvent, can be mapped to +an integer and used as the type of an LV2 [Atom](atom.html#Atom) or +[Event](event.html#Event). + +This specification also defines a complete vocabulary for the MIDI standard, +except for standard controller numbers. These descriptions are detailed enough +to express any MIDI message as properties. + +"""^^lv2:Markdown . + +midi:MidiEvent + lv2:documentation """ + +A single raw MIDI message (a sequence of bytes). + +This is equivalent to a standard MIDI messages, except with the following +restrictions to simplify handling: + + * Running status is not allowed, every message must have its own status byte. + + * Note On messages with velocity 0 are not allowed. These messages are + equivalent to Note Off in standard MIDI streams, but here only proper Note + Off messages are allowed. + + * "Realtime messages" (status bytes 0xF8 to 0xFF) are allowed, but may not + occur inside other messages like they can in standard MIDI streams. + + * All messages are complete valid MIDI messages. This means, for example, + that only the first byte in each event (the status byte) may have the + eighth bit set, that Note On and Note Off events are always 3 bytes long, + etc. + +Where messages are communicated, the writer is responsible for writing valid +messages, and the reader may assume that all events are valid. + +If a midi:MidiEvent is serialised to a string, the format should be +xsd:hexBinary, for example: + + :::turtle + [] eg:someEvent "901A01"^^midi:MidiEvent . + +"""^^lv2:Markdown . + +midi:statusMask + lv2:documentation """ + +This is a status byte with the lower nibble set to zero. + +"""^^lv2:Markdown . + diff --git a/lv2/midi.lv2/midi.ttl b/lv2/midi.lv2/midi.ttl new file mode 100644 index 0000000..4a0e8c9 --- /dev/null +++ b/lv2/midi.lv2/midi.ttl @@ -0,0 +1,365 @@ +@prefix atom: . +@prefix ev: . +@prefix lv2: . +@prefix midi: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 MIDI" ; + rdfs:comment "A normalised definition of raw MIDI." ; + rdfs:seeAlso . + +midi:ActiveSense + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Active Sense" ; + rdfs:comment "MIDI active sense message." ; + midi:status "FE"^^xsd:hexBinary . + +midi:Aftertouch + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Aftertouch" ; + rdfs:comment "MIDI aftertouch message." ; + midi:statusMask "A0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:noteNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:pressure + ] . + +midi:Bender + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Bender" ; + rdfs:comment "MIDI bender message." ; + midi:statusMask "E0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 , + 1 ; + midi:property midi:benderValue + ] . + +midi:ChannelPressure + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Channel Pressure" ; + rdfs:comment "MIDI channel pressure message." ; + midi:statusMask "D0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:pressure + ] . + +midi:Chunk + a rdfs:Class ; + rdfs:label "Chunk" ; + rdfs:comment "A sequence of contiguous bytes in a MIDI message." . + +midi:Clock + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Clock" ; + rdfs:comment "MIDI clock message." ; + midi:status "F8"^^xsd:hexBinary . + +midi:Continue + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Continue" ; + rdfs:comment "MIDI continue message." ; + midi:status "FB"^^xsd:hexBinary . + +midi:Controller + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Controller" ; + rdfs:comment "MIDI controller change message." ; + midi:statusMask "B0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:controllerNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:controllerValue + ] . + +midi:HexByte + a rdfs:Datatype ; + owl:onDatatype xsd:hexBinary ; + owl:withRestrictions ( + [ + xsd:maxInclusive "FF" + ] + ) ; + rdfs:label "Hex Byte" ; + rdfs:comment "A hexadecimal byte, which has a value <= FF." . + +midi:MidiEvent + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf ev:Event , + atom:Atom ; + owl:onDatatype xsd:hexBinary ; + rdfs:label "MIDI Message" ; + rdfs:comment "A single raw MIDI message." . + +midi:NoteOff + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Note Off" ; + rdfs:comment "MIDI note off message." ; + midi:statusMask "80"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:noteNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:velocity + ] . + +midi:NoteOn + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Note On" ; + rdfs:comment "MIDI note on message." ; + midi:statusMask "90"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:noteNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:velocity + ] . + +midi:ProgramChange + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Program Change" ; + rdfs:comment "MIDI program change message." ; + midi:statusMask "C0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:programNumber + ] . + +midi:QuarterFrame + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Quarter Frame" ; + rdfs:comment "MIDI quarter frame message." ; + midi:status "F1"^^xsd:hexBinary . + +midi:Reset + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Reset" ; + rdfs:comment "MIDI reset message." ; + midi:status "FF"^^xsd:hexBinary . + +midi:SongPosition + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Song Position" ; + rdfs:comment "MIDI song position pointer message." ; + midi:status "F2"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 , + 1 ; + midi:property midi:songPosition + ] . + +midi:SongSelect + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Song Select" ; + rdfs:comment "MIDI song select message." ; + midi:status "F3"^^xsd:hexBinary . + +midi:Start + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Start" ; + rdfs:comment "MIDI start message." ; + midi:status "FA"^^xsd:hexBinary . + +midi:Stop + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Stop" ; + rdfs:comment "MIDI stop message." ; + midi:status "FC"^^xsd:hexBinary . + +midi:SystemCommon + a rdfs:Class ; + rdfs:subClassOf midi:SystemMessage ; + rdfs:label "System Common" ; + rdfs:comment "MIDI system common message." . + +midi:SystemExclusive + a rdfs:Class ; + rdfs:subClassOf midi:SystemMessage ; + rdfs:label "System Exclusive" ; + rdfs:comment "MIDI system exclusive message." ; + midi:status "F0"^^xsd:hexBinary . + +midi:SystemMessage + a rdfs:Class ; + rdfs:subClassOf midi:MidiEvent ; + rdfs:label "System Message" ; + rdfs:comment "MIDI system message." ; + midi:statusMask "F0"^^xsd:hexBinary . + +midi:SystemRealtime + a rdfs:Class ; + rdfs:subClassOf midi:SystemMessage ; + rdfs:label "System Realtime" ; + rdfs:comment "MIDI system realtime message." . + +midi:TuneRequest + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Tune Request" ; + rdfs:comment "MIDI tune request message." ; + midi:status "F6"^^xsd:hexBinary . + +midi:VoiceMessage + a rdfs:Class ; + rdfs:subClassOf midi:MidiEvent ; + rdfs:label "Voice Message" ; + rdfs:comment "MIDI voice message." ; + midi:statusMask "F0"^^xsd:hexBinary . + +midi:benderValue + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "bender value" ; + rdfs:range xsd:short ; + rdfs:comment "MIDI pitch bender message (-8192 to 8192)." . + +midi:binding + a rdf:Property , + owl:ObjectProperty ; + rdfs:range midi:MidiEvent ; + rdfs:label "binding" ; + rdfs:comment "The MIDI event to bind a parameter to." . + +midi:byteNumber + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "byte number" ; + rdfs:domain midi:Chunk ; + rdfs:range xsd:unsignedByte ; + rdfs:comment "The 0-based index of a byte which is part of this chunk." . + +midi:channel + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "MIDI channel" ; + rdfs:range xsd:unsignedByte ; + rdfs:comment "The channel number of a MIDI message." . + +midi:chunk + a rdf:Property , + owl:ObjectProperty ; + rdfs:range midi:Chunk ; + rdfs:label "MIDI chunk" ; + rdfs:comment "A chunk of a MIDI message." . + +midi:controllerNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "MIDI controller number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a controller (0 to 127)." . + +midi:controllerValue + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "MIDI controller value" ; + rdfs:range xsd:byte ; + rdfs:comment "The value of a controller (0 to 127)." . + +midi:noteNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "note number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a note (0 to 127)." . + +midi:pressure + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "key pressure" ; + rdfs:range xsd:byte ; + rdfs:comment "Key pressure (0 to 127)." . + +midi:programNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "program number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a program (0 to 127)." . + +midi:property + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:label "property" ; + rdfs:domain midi:Chunk ; + rdfs:range rdf:Property ; + rdfs:comment "The property this chunk represents." . + +midi:songNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "song number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a song (0 to 127)." . + +midi:songPosition + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "song position" ; + rdfs:range xsd:short ; + rdfs:comment "Song position in MIDI beats (16th notes) (-8192 to 8192)." . + +midi:status + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "status byte" ; + rdfs:range midi:HexByte ; + rdfs:comment "The exact status byte for a message of this type." . + +midi:statusMask + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "status mask" ; + rdfs:range midi:HexByte ; + rdfs:comment "The status byte for a message of this type on channel 1." . + +midi:velocity + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "velocity" ; + rdfs:range midi:HexByte ; + rdfs:comment "The velocity of a note message (0 to 127)." . + diff --git a/lv2/midi/manifest.ttl b/lv2/midi/manifest.ttl deleted file mode 100644 index f141936..0000000 --- a/lv2/midi/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 10 ; - rdfs:seeAlso . - diff --git a/lv2/midi/meson.build b/lv2/midi/meson.build deleted file mode 100644 index 7907dfa..0000000 --- a/lv2/midi/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'midi' -path = 'ns' / 'ext' / 'midi' - -midi_data = files( - 'midi.meta.ttl', - 'midi.ttl', - 'manifest.ttl', -) - -headers = files( - 'midi.h', -) - -# Install specification bundle -install_data(midi_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_midi_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('midi.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/midi/midi.h b/lv2/midi/midi.h deleted file mode 100644 index f7e0500..0000000 --- a/lv2/midi/midi.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_MIDI_H -#define LV2_MIDI_H - -/** - @defgroup midi MIDI - @ingroup lv2 - - Definitions of standard MIDI messages. - - See for details. - - @{ -*/ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// clang-format off - -#define LV2_MIDI_URI "http://lv2plug.in/ns/ext/midi" ///< http://lv2plug.in/ns/ext/midi -#define LV2_MIDI_PREFIX LV2_MIDI_URI "#" ///< http://lv2plug.in/ns/ext/midi# - -#define LV2_MIDI__ActiveSense LV2_MIDI_PREFIX "ActiveSense" ///< http://lv2plug.in/ns/ext/midi#ActiveSense -#define LV2_MIDI__Aftertouch LV2_MIDI_PREFIX "Aftertouch" ///< http://lv2plug.in/ns/ext/midi#Aftertouch -#define LV2_MIDI__Bender LV2_MIDI_PREFIX "Bender" ///< http://lv2plug.in/ns/ext/midi#Bender -#define LV2_MIDI__ChannelPressure LV2_MIDI_PREFIX "ChannelPressure" ///< http://lv2plug.in/ns/ext/midi#ChannelPressure -#define LV2_MIDI__Chunk LV2_MIDI_PREFIX "Chunk" ///< http://lv2plug.in/ns/ext/midi#Chunk -#define LV2_MIDI__Clock LV2_MIDI_PREFIX "Clock" ///< http://lv2plug.in/ns/ext/midi#Clock -#define LV2_MIDI__Continue LV2_MIDI_PREFIX "Continue" ///< http://lv2plug.in/ns/ext/midi#Continue -#define LV2_MIDI__Controller LV2_MIDI_PREFIX "Controller" ///< http://lv2plug.in/ns/ext/midi#Controller -#define LV2_MIDI__MidiEvent LV2_MIDI_PREFIX "MidiEvent" ///< http://lv2plug.in/ns/ext/midi#MidiEvent -#define LV2_MIDI__NoteOff LV2_MIDI_PREFIX "NoteOff" ///< http://lv2plug.in/ns/ext/midi#NoteOff -#define LV2_MIDI__NoteOn LV2_MIDI_PREFIX "NoteOn" ///< http://lv2plug.in/ns/ext/midi#NoteOn -#define LV2_MIDI__ProgramChange LV2_MIDI_PREFIX "ProgramChange" ///< http://lv2plug.in/ns/ext/midi#ProgramChange -#define LV2_MIDI__QuarterFrame LV2_MIDI_PREFIX "QuarterFrame" ///< http://lv2plug.in/ns/ext/midi#QuarterFrame -#define LV2_MIDI__Reset LV2_MIDI_PREFIX "Reset" ///< http://lv2plug.in/ns/ext/midi#Reset -#define LV2_MIDI__SongPosition LV2_MIDI_PREFIX "SongPosition" ///< http://lv2plug.in/ns/ext/midi#SongPosition -#define LV2_MIDI__SongSelect LV2_MIDI_PREFIX "SongSelect" ///< http://lv2plug.in/ns/ext/midi#SongSelect -#define LV2_MIDI__Start LV2_MIDI_PREFIX "Start" ///< http://lv2plug.in/ns/ext/midi#Start -#define LV2_MIDI__Stop LV2_MIDI_PREFIX "Stop" ///< http://lv2plug.in/ns/ext/midi#Stop -#define LV2_MIDI__SystemCommon LV2_MIDI_PREFIX "SystemCommon" ///< http://lv2plug.in/ns/ext/midi#SystemCommon -#define LV2_MIDI__SystemExclusive LV2_MIDI_PREFIX "SystemExclusive" ///< http://lv2plug.in/ns/ext/midi#SystemExclusive -#define LV2_MIDI__SystemMessage LV2_MIDI_PREFIX "SystemMessage" ///< http://lv2plug.in/ns/ext/midi#SystemMessage -#define LV2_MIDI__SystemRealtime LV2_MIDI_PREFIX "SystemRealtime" ///< http://lv2plug.in/ns/ext/midi#SystemRealtime -#define LV2_MIDI__Tick LV2_MIDI_PREFIX "Tick" ///< http://lv2plug.in/ns/ext/midi#Tick -#define LV2_MIDI__TuneRequest LV2_MIDI_PREFIX "TuneRequest" ///< http://lv2plug.in/ns/ext/midi#TuneRequest -#define LV2_MIDI__VoiceMessage LV2_MIDI_PREFIX "VoiceMessage" ///< http://lv2plug.in/ns/ext/midi#VoiceMessage -#define LV2_MIDI__benderValue LV2_MIDI_PREFIX "benderValue" ///< http://lv2plug.in/ns/ext/midi#benderValue -#define LV2_MIDI__binding LV2_MIDI_PREFIX "binding" ///< http://lv2plug.in/ns/ext/midi#binding -#define LV2_MIDI__byteNumber LV2_MIDI_PREFIX "byteNumber" ///< http://lv2plug.in/ns/ext/midi#byteNumber -#define LV2_MIDI__channel LV2_MIDI_PREFIX "channel" ///< http://lv2plug.in/ns/ext/midi#channel -#define LV2_MIDI__chunk LV2_MIDI_PREFIX "chunk" ///< http://lv2plug.in/ns/ext/midi#chunk -#define LV2_MIDI__controllerNumber LV2_MIDI_PREFIX "controllerNumber" ///< http://lv2plug.in/ns/ext/midi#controllerNumber -#define LV2_MIDI__controllerValue LV2_MIDI_PREFIX "controllerValue" ///< http://lv2plug.in/ns/ext/midi#controllerValue -#define LV2_MIDI__noteNumber LV2_MIDI_PREFIX "noteNumber" ///< http://lv2plug.in/ns/ext/midi#noteNumber -#define LV2_MIDI__pressure LV2_MIDI_PREFIX "pressure" ///< http://lv2plug.in/ns/ext/midi#pressure -#define LV2_MIDI__programNumber LV2_MIDI_PREFIX "programNumber" ///< http://lv2plug.in/ns/ext/midi#programNumber -#define LV2_MIDI__property LV2_MIDI_PREFIX "property" ///< http://lv2plug.in/ns/ext/midi#property -#define LV2_MIDI__songNumber LV2_MIDI_PREFIX "songNumber" ///< http://lv2plug.in/ns/ext/midi#songNumber -#define LV2_MIDI__songPosition LV2_MIDI_PREFIX "songPosition" ///< http://lv2plug.in/ns/ext/midi#songPosition -#define LV2_MIDI__status LV2_MIDI_PREFIX "status" ///< http://lv2plug.in/ns/ext/midi#status -#define LV2_MIDI__statusMask LV2_MIDI_PREFIX "statusMask" ///< http://lv2plug.in/ns/ext/midi#statusMask -#define LV2_MIDI__velocity LV2_MIDI_PREFIX "velocity" ///< http://lv2plug.in/ns/ext/midi#velocity - -// clang-format on - -/** - MIDI Message Type. - - This includes both voice messages (which have a channel) and system messages - (which do not), as well as a sentinel value for invalid messages. To get - the type of a message suitable for use in a switch statement, use - lv2_midi_get_type() on the status byte. -*/ -typedef enum { - LV2_MIDI_MSG_INVALID = 0, /**< Invalid Message */ - LV2_MIDI_MSG_NOTE_OFF = 0x80, /**< Note Off */ - LV2_MIDI_MSG_NOTE_ON = 0x90, /**< Note On */ - LV2_MIDI_MSG_NOTE_PRESSURE = 0xA0, /**< Note Pressure */ - LV2_MIDI_MSG_CONTROLLER = 0xB0, /**< Controller */ - LV2_MIDI_MSG_PGM_CHANGE = 0xC0, /**< Program Change */ - LV2_MIDI_MSG_CHANNEL_PRESSURE = 0xD0, /**< Channel Pressure */ - LV2_MIDI_MSG_BENDER = 0xE0, /**< Pitch Bender */ - LV2_MIDI_MSG_SYSTEM_EXCLUSIVE = 0xF0, /**< System Exclusive Begin */ - LV2_MIDI_MSG_MTC_QUARTER = 0xF1, /**< MTC Quarter Frame */ - LV2_MIDI_MSG_SONG_POS = 0xF2, /**< Song Position */ - LV2_MIDI_MSG_SONG_SELECT = 0xF3, /**< Song Select */ - LV2_MIDI_MSG_TUNE_REQUEST = 0xF6, /**< Tune Request */ - LV2_MIDI_MSG_CLOCK = 0xF8, /**< Clock */ - LV2_MIDI_MSG_START = 0xFA, /**< Start */ - LV2_MIDI_MSG_CONTINUE = 0xFB, /**< Continue */ - LV2_MIDI_MSG_STOP = 0xFC, /**< Stop */ - LV2_MIDI_MSG_ACTIVE_SENSE = 0xFE, /**< Active Sensing */ - LV2_MIDI_MSG_RESET = 0xFF /**< Reset */ -} LV2_Midi_Message_Type; - -/** - Standard MIDI Controller Numbers. -*/ -typedef enum { - LV2_MIDI_CTL_MSB_BANK = 0x00, /**< Bank Selection */ - LV2_MIDI_CTL_MSB_MODWHEEL = 0x01, /**< Modulation */ - LV2_MIDI_CTL_MSB_BREATH = 0x02, /**< Breath */ - LV2_MIDI_CTL_MSB_FOOT = 0x04, /**< Foot */ - LV2_MIDI_CTL_MSB_PORTAMENTO_TIME = 0x05, /**< Portamento Time */ - LV2_MIDI_CTL_MSB_DATA_ENTRY = 0x06, /**< Data Entry */ - LV2_MIDI_CTL_MSB_MAIN_VOLUME = 0x07, /**< Main Volume */ - LV2_MIDI_CTL_MSB_BALANCE = 0x08, /**< Balance */ - LV2_MIDI_CTL_MSB_PAN = 0x0A, /**< Panpot */ - LV2_MIDI_CTL_MSB_EXPRESSION = 0x0B, /**< Expression */ - LV2_MIDI_CTL_MSB_EFFECT1 = 0x0C, /**< Effect1 */ - LV2_MIDI_CTL_MSB_EFFECT2 = 0x0D, /**< Effect2 */ - LV2_MIDI_CTL_MSB_GENERAL_PURPOSE1 = 0x10, /**< General Purpose 1 */ - LV2_MIDI_CTL_MSB_GENERAL_PURPOSE2 = 0x11, /**< General Purpose 2 */ - LV2_MIDI_CTL_MSB_GENERAL_PURPOSE3 = 0x12, /**< General Purpose 3 */ - LV2_MIDI_CTL_MSB_GENERAL_PURPOSE4 = 0x13, /**< General Purpose 4 */ - LV2_MIDI_CTL_LSB_BANK = 0x20, /**< Bank Selection */ - LV2_MIDI_CTL_LSB_MODWHEEL = 0x21, /**< Modulation */ - LV2_MIDI_CTL_LSB_BREATH = 0x22, /**< Breath */ - LV2_MIDI_CTL_LSB_FOOT = 0x24, /**< Foot */ - LV2_MIDI_CTL_LSB_PORTAMENTO_TIME = 0x25, /**< Portamento Time */ - LV2_MIDI_CTL_LSB_DATA_ENTRY = 0x26, /**< Data Entry */ - LV2_MIDI_CTL_LSB_MAIN_VOLUME = 0x27, /**< Main Volume */ - LV2_MIDI_CTL_LSB_BALANCE = 0x28, /**< Balance */ - LV2_MIDI_CTL_LSB_PAN = 0x2A, /**< Panpot */ - LV2_MIDI_CTL_LSB_EXPRESSION = 0x2B, /**< Expression */ - LV2_MIDI_CTL_LSB_EFFECT1 = 0x2C, /**< Effect1 */ - LV2_MIDI_CTL_LSB_EFFECT2 = 0x2D, /**< Effect2 */ - LV2_MIDI_CTL_LSB_GENERAL_PURPOSE1 = 0x30, /**< General Purpose 1 */ - LV2_MIDI_CTL_LSB_GENERAL_PURPOSE2 = 0x31, /**< General Purpose 2 */ - LV2_MIDI_CTL_LSB_GENERAL_PURPOSE3 = 0x32, /**< General Purpose 3 */ - LV2_MIDI_CTL_LSB_GENERAL_PURPOSE4 = 0x33, /**< General Purpose 4 */ - LV2_MIDI_CTL_SUSTAIN = 0x40, /**< Sustain Pedal */ - LV2_MIDI_CTL_PORTAMENTO = 0x41, /**< Portamento */ - LV2_MIDI_CTL_SOSTENUTO = 0x42, /**< Sostenuto */ - LV2_MIDI_CTL_SOFT_PEDAL = 0x43, /**< Soft Pedal */ - LV2_MIDI_CTL_LEGATO_FOOTSWITCH = 0x44, /**< Legato Foot Switch */ - LV2_MIDI_CTL_HOLD2 = 0x45, /**< Hold2 */ - LV2_MIDI_CTL_SC1_SOUND_VARIATION = 0x46, /**< SC1 Sound Variation */ - LV2_MIDI_CTL_SC2_TIMBRE = 0x47, /**< SC2 Timbre */ - LV2_MIDI_CTL_SC3_RELEASE_TIME = 0x48, /**< SC3 Release Time */ - LV2_MIDI_CTL_SC4_ATTACK_TIME = 0x49, /**< SC4 Attack Time */ - LV2_MIDI_CTL_SC5_BRIGHTNESS = 0x4A, /**< SC5 Brightness */ - LV2_MIDI_CTL_SC6 = 0x4B, /**< SC6 */ - LV2_MIDI_CTL_SC7 = 0x4C, /**< SC7 */ - LV2_MIDI_CTL_SC8 = 0x4D, /**< SC8 */ - LV2_MIDI_CTL_SC9 = 0x4E, /**< SC9 */ - LV2_MIDI_CTL_SC10 = 0x4F, /**< SC10 */ - LV2_MIDI_CTL_GENERAL_PURPOSE5 = 0x50, /**< General Purpose 5 */ - LV2_MIDI_CTL_GENERAL_PURPOSE6 = 0x51, /**< General Purpose 6 */ - LV2_MIDI_CTL_GENERAL_PURPOSE7 = 0x52, /**< General Purpose 7 */ - LV2_MIDI_CTL_GENERAL_PURPOSE8 = 0x53, /**< General Purpose 8 */ - LV2_MIDI_CTL_PORTAMENTO_CONTROL = 0x54, /**< Portamento Control */ - LV2_MIDI_CTL_E1_REVERB_DEPTH = 0x5B, /**< E1 Reverb Depth */ - LV2_MIDI_CTL_E2_TREMOLO_DEPTH = 0x5C, /**< E2 Tremolo Depth */ - LV2_MIDI_CTL_E3_CHORUS_DEPTH = 0x5D, /**< E3 Chorus Depth */ - LV2_MIDI_CTL_E4_DETUNE_DEPTH = 0x5E, /**< E4 Detune Depth */ - LV2_MIDI_CTL_E5_PHASER_DEPTH = 0x5F, /**< E5 Phaser Depth */ - LV2_MIDI_CTL_DATA_INCREMENT = 0x60, /**< Data Increment */ - LV2_MIDI_CTL_DATA_DECREMENT = 0x61, /**< Data Decrement */ - LV2_MIDI_CTL_NRPN_LSB = 0x62, /**< Non-registered Parameter Number */ - LV2_MIDI_CTL_NRPN_MSB = 0x63, /**< Non-registered Parameter Number */ - LV2_MIDI_CTL_RPN_LSB = 0x64, /**< Registered Parameter Number */ - LV2_MIDI_CTL_RPN_MSB = 0x65, /**< Registered Parameter Number */ - LV2_MIDI_CTL_ALL_SOUNDS_OFF = 0x78, /**< All Sounds Off */ - LV2_MIDI_CTL_RESET_CONTROLLERS = 0x79, /**< Reset Controllers */ - LV2_MIDI_CTL_LOCAL_CONTROL_SWITCH = 0x7A, /**< Local Control Switch */ - LV2_MIDI_CTL_ALL_NOTES_OFF = 0x7B, /**< All Notes Off */ - LV2_MIDI_CTL_OMNI_OFF = 0x7C, /**< Omni Off */ - LV2_MIDI_CTL_OMNI_ON = 0x7D, /**< Omni On */ - LV2_MIDI_CTL_MONO1 = 0x7E, /**< Mono1 */ - LV2_MIDI_CTL_MONO2 = 0x7F /**< Mono2 */ -} LV2_Midi_Controller; - -/** - Return true iff `msg` is a MIDI voice message (which has a channel). -*/ -static inline bool -lv2_midi_is_voice_message(const uint8_t* msg) -{ - return msg[0] >= 0x80 && msg[0] < 0xF0; -} - -/** - Return true iff `msg` is a MIDI system message (which has no channel). -*/ -static inline bool -lv2_midi_is_system_message(const uint8_t* msg) -{ - switch (msg[0]) { - case 0xF4: - case 0xF5: - case 0xF7: - case 0xF9: - case 0xFD: - return false; - default: - return (msg[0] & 0xF0u) == 0xF0u; - } -} - -/** - Return the type of a MIDI message. - @param msg Pointer to the start (status byte) of a MIDI message. -*/ -static inline LV2_Midi_Message_Type -lv2_midi_message_type(const uint8_t* msg) -{ - if (lv2_midi_is_voice_message(msg)) { - return (LV2_Midi_Message_Type)(msg[0] & 0xF0u); - } - - if (lv2_midi_is_system_message(msg)) { - return (LV2_Midi_Message_Type)msg[0]; - } - - return LV2_MIDI_MSG_INVALID; -} - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_MIDI_H */ diff --git a/lv2/midi/midi.meta.ttl b/lv2/midi/midi.meta.ttl deleted file mode 100644 index 7efdb01..0000000 --- a/lv2/midi/midi.meta.ttl +++ /dev/null @@ -1,153 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix midi: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 MIDI" ; - doap:shortdesc "A normalised definition of raw MIDI." ; - doap:maintainer ; - doap:created "2006-00-00" ; - doap:developer , - ; - doap:release [ - doap:revision "1.10" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix incorrect range of midi:chunk." - ] - ] - ] , [ - doap:revision "1.8" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] , [ - rdfs:label "Add midi:binding and midi:channel predicates." - ] , [ - rdfs:label "Add midi:HexByte datatype for status bytes and masks." - ] , [ - rdfs:label "Remove non-standard midi:Tick message type." - ] , [ - rdfs:label "Add C definitions for message types and standard controllers." - ] , [ - rdfs:label "Fix definition of SystemExclusive status byte." - ] - ] - ] , [ - doap:revision "1.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add class definitions for various message types." - ] , [ - rdfs:label "Document how to serialise a MidiEvent to a string." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2011-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system for installation." - ] , [ - rdfs:label "Switch to ISC license." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2010-10-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This specification defines a data type for a MIDI message, midi:MidiEvent, -which is normalised for fast and convenient real-time processing. MIDI is the -Musical Instrument Digital Interface, a ubiquitous binary standard for -controlling digital music devices. - -For plugins that process MIDI (or other situations where MIDI is sent via a -generic transport) the main type defined here, midi:MidiEvent, can be mapped to -an integer and used as the type of an LV2 [Atom](atom.html#Atom) or -[Event](event.html#Event). - -This specification also defines a complete vocabulary for the MIDI standard, -except for standard controller numbers. These descriptions are detailed enough -to express any MIDI message as properties. - -"""^^lv2:Markdown . - -midi:MidiEvent - lv2:documentation """ - -A single raw MIDI message (a sequence of bytes). - -This is equivalent to a standard MIDI messages, except with the following -restrictions to simplify handling: - - * Running status is not allowed, every message must have its own status byte. - - * Note On messages with velocity 0 are not allowed. These messages are - equivalent to Note Off in standard MIDI streams, but here only proper Note - Off messages are allowed. - - * "Realtime messages" (status bytes 0xF8 to 0xFF) are allowed, but may not - occur inside other messages like they can in standard MIDI streams. - - * All messages are complete valid MIDI messages. This means, for example, - that only the first byte in each event (the status byte) may have the - eighth bit set, that Note On and Note Off events are always 3 bytes long, - etc. - -Where messages are communicated, the writer is responsible for writing valid -messages, and the reader may assume that all events are valid. - -If a midi:MidiEvent is serialised to a string, the format should be -xsd:hexBinary, for example: - - :::turtle - [] eg:someEvent "901A01"^^midi:MidiEvent . - -"""^^lv2:Markdown . - -midi:statusMask - lv2:documentation """ - -This is a status byte with the lower nibble set to zero. - -"""^^lv2:Markdown . - diff --git a/lv2/midi/midi.ttl b/lv2/midi/midi.ttl deleted file mode 100644 index 81f3495..0000000 --- a/lv2/midi/midi.ttl +++ /dev/null @@ -1,366 +0,0 @@ -@prefix atom: . -@prefix ev: . -@prefix lv2: . -@prefix midi: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 MIDI" ; - rdfs:comment "A normalised definition of raw MIDI." ; - rdfs:seeAlso , - . - -midi:ActiveSense - a rdfs:Class ; - rdfs:subClassOf midi:SystemRealtime ; - rdfs:label "Active Sense" ; - rdfs:comment "MIDI active sense message." ; - midi:status "FE"^^xsd:hexBinary . - -midi:Aftertouch - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Aftertouch" ; - rdfs:comment "MIDI aftertouch message." ; - midi:statusMask "A0"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 ; - midi:property midi:noteNumber - ] , [ - midi:byteNumber 1 ; - midi:property midi:pressure - ] . - -midi:Bender - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Bender" ; - rdfs:comment "MIDI bender message." ; - midi:statusMask "E0"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 , - 1 ; - midi:property midi:benderValue - ] . - -midi:ChannelPressure - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Channel Pressure" ; - rdfs:comment "MIDI channel pressure message." ; - midi:statusMask "D0"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 ; - midi:property midi:pressure - ] . - -midi:Chunk - a rdfs:Class ; - rdfs:label "Chunk" ; - rdfs:comment "A sequence of contiguous bytes in a MIDI message." . - -midi:Clock - a rdfs:Class ; - rdfs:subClassOf midi:SystemRealtime ; - rdfs:label "Clock" ; - rdfs:comment "MIDI clock message." ; - midi:status "F8"^^xsd:hexBinary . - -midi:Continue - a rdfs:Class ; - rdfs:subClassOf midi:SystemRealtime ; - rdfs:label "Continue" ; - rdfs:comment "MIDI continue message." ; - midi:status "FB"^^xsd:hexBinary . - -midi:Controller - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Controller" ; - rdfs:comment "MIDI controller change message." ; - midi:statusMask "B0"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 ; - midi:property midi:controllerNumber - ] , [ - midi:byteNumber 1 ; - midi:property midi:controllerValue - ] . - -midi:HexByte - a rdfs:Datatype ; - owl:onDatatype xsd:hexBinary ; - owl:withRestrictions ( - [ - xsd:maxInclusive "FF" - ] - ) ; - rdfs:label "Hex Byte" ; - rdfs:comment "A hexadecimal byte, which has a value <= FF." . - -midi:MidiEvent - a rdfs:Class , - rdfs:Datatype ; - rdfs:subClassOf ev:Event , - atom:Atom ; - owl:onDatatype xsd:hexBinary ; - rdfs:label "MIDI Message" ; - rdfs:comment "A single raw MIDI message." . - -midi:NoteOff - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Note Off" ; - rdfs:comment "MIDI note off message." ; - midi:statusMask "80"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 ; - midi:property midi:noteNumber - ] , [ - midi:byteNumber 1 ; - midi:property midi:velocity - ] . - -midi:NoteOn - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Note On" ; - rdfs:comment "MIDI note on message." ; - midi:statusMask "90"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 ; - midi:property midi:noteNumber - ] , [ - midi:byteNumber 1 ; - midi:property midi:velocity - ] . - -midi:ProgramChange - a rdfs:Class ; - rdfs:subClassOf midi:VoiceMessage ; - rdfs:label "Program Change" ; - rdfs:comment "MIDI program change message." ; - midi:statusMask "C0"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 ; - midi:property midi:programNumber - ] . - -midi:QuarterFrame - a rdfs:Class ; - rdfs:subClassOf midi:SystemCommon ; - rdfs:label "Quarter Frame" ; - rdfs:comment "MIDI quarter frame message." ; - midi:status "F1"^^xsd:hexBinary . - -midi:Reset - a rdfs:Class ; - rdfs:subClassOf midi:SystemRealtime ; - rdfs:label "Reset" ; - rdfs:comment "MIDI reset message." ; - midi:status "FF"^^xsd:hexBinary . - -midi:SongPosition - a rdfs:Class ; - rdfs:subClassOf midi:SystemCommon ; - rdfs:label "Song Position" ; - rdfs:comment "MIDI song position pointer message." ; - midi:status "F2"^^xsd:hexBinary ; - midi:chunk [ - midi:byteNumber 0 , - 1 ; - midi:property midi:songPosition - ] . - -midi:SongSelect - a rdfs:Class ; - rdfs:subClassOf midi:SystemCommon ; - rdfs:label "Song Select" ; - rdfs:comment "MIDI song select message." ; - midi:status "F3"^^xsd:hexBinary . - -midi:Start - a rdfs:Class ; - rdfs:subClassOf midi:SystemRealtime ; - rdfs:label "Start" ; - rdfs:comment "MIDI start message." ; - midi:status "FA"^^xsd:hexBinary . - -midi:Stop - a rdfs:Class ; - rdfs:subClassOf midi:SystemRealtime ; - rdfs:label "Stop" ; - rdfs:comment "MIDI stop message." ; - midi:status "FC"^^xsd:hexBinary . - -midi:SystemCommon - a rdfs:Class ; - rdfs:subClassOf midi:SystemMessage ; - rdfs:label "System Common" ; - rdfs:comment "MIDI system common message." . - -midi:SystemExclusive - a rdfs:Class ; - rdfs:subClassOf midi:SystemMessage ; - rdfs:label "System Exclusive" ; - rdfs:comment "MIDI system exclusive message." ; - midi:status "F0"^^xsd:hexBinary . - -midi:SystemMessage - a rdfs:Class ; - rdfs:subClassOf midi:MidiEvent ; - rdfs:label "System Message" ; - rdfs:comment "MIDI system message." ; - midi:statusMask "F0"^^xsd:hexBinary . - -midi:SystemRealtime - a rdfs:Class ; - rdfs:subClassOf midi:SystemMessage ; - rdfs:label "System Realtime" ; - rdfs:comment "MIDI system realtime message." . - -midi:TuneRequest - a rdfs:Class ; - rdfs:subClassOf midi:SystemCommon ; - rdfs:label "Tune Request" ; - rdfs:comment "MIDI tune request message." ; - midi:status "F6"^^xsd:hexBinary . - -midi:VoiceMessage - a rdfs:Class ; - rdfs:subClassOf midi:MidiEvent ; - rdfs:label "Voice Message" ; - rdfs:comment "MIDI voice message." ; - midi:statusMask "F0"^^xsd:hexBinary . - -midi:benderValue - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "bender value" ; - rdfs:range xsd:short ; - rdfs:comment "MIDI pitch bender message (-8192 to 8192)." . - -midi:binding - a rdf:Property , - owl:ObjectProperty ; - rdfs:range midi:MidiEvent ; - rdfs:label "binding" ; - rdfs:comment "The MIDI event to bind a parameter to." . - -midi:byteNumber - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "byte number" ; - rdfs:domain midi:Chunk ; - rdfs:range xsd:unsignedByte ; - rdfs:comment "The 0-based index of a byte which is part of this chunk." . - -midi:channel - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "MIDI channel" ; - rdfs:range xsd:unsignedByte ; - rdfs:comment "The channel number of a MIDI message." . - -midi:chunk - a rdf:Property , - owl:ObjectProperty ; - rdfs:range midi:Chunk ; - rdfs:label "MIDI chunk" ; - rdfs:comment "A chunk of a MIDI message." . - -midi:controllerNumber - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "MIDI controller number" ; - rdfs:range xsd:byte ; - rdfs:comment "The numeric ID of a controller (0 to 127)." . - -midi:controllerValue - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "MIDI controller value" ; - rdfs:range xsd:byte ; - rdfs:comment "The value of a controller (0 to 127)." . - -midi:noteNumber - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "note number" ; - rdfs:range xsd:byte ; - rdfs:comment "The numeric ID of a note (0 to 127)." . - -midi:pressure - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "key pressure" ; - rdfs:range xsd:byte ; - rdfs:comment "Key pressure (0 to 127)." . - -midi:programNumber - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "program number" ; - rdfs:range xsd:byte ; - rdfs:comment "The numeric ID of a program (0 to 127)." . - -midi:property - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:label "property" ; - rdfs:domain midi:Chunk ; - rdfs:range rdf:Property ; - rdfs:comment "The property this chunk represents." . - -midi:songNumber - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "song number" ; - rdfs:range xsd:byte ; - rdfs:comment "The numeric ID of a song (0 to 127)." . - -midi:songPosition - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "song position" ; - rdfs:range xsd:short ; - rdfs:comment "Song position in MIDI beats (16th notes) (-8192 to 8192)." . - -midi:status - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "status byte" ; - rdfs:range midi:HexByte ; - rdfs:comment "The exact status byte for a message of this type." . - -midi:statusMask - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "status mask" ; - rdfs:range midi:HexByte ; - rdfs:comment "The status byte for a message of this type on channel 1." . - -midi:velocity - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "velocity" ; - rdfs:range midi:HexByte ; - rdfs:comment "The velocity of a note message (0 to 127)." . - diff --git a/lv2/morph.lv2/manifest.ttl b/lv2/morph.lv2/manifest.ttl new file mode 100644 index 0000000..7c85cfd --- /dev/null +++ b/lv2/morph.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; + rdfs:seeAlso . + diff --git a/lv2/morph.lv2/morph.meta.ttl b/lv2/morph.lv2/morph.meta.ttl new file mode 100644 index 0000000..c247783 --- /dev/null +++ b/lv2/morph.lv2/morph.meta.ttl @@ -0,0 +1,90 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix morph: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Morph" ; + doap:shortdesc "Ports that can dynamically change type." ; + doap:created "2012-05-22" ; + doap:developer ; + doap:release [ + doap:revision "1.0" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines two port types: morph:MorphPort, which has a +host-configurable type, and morph:AutoMorphPort, which may automatically change +type when a MorphPort's type is changed. These ports always have a default +type and work normally work in hosts that are unaware of this extension. Thus, +this extension provides a backwards compatibility mechanism which allows +plugins to use new port types but gracefully fall back to a default type in +hosts that do not support them. + +This extension only defines port types and properties for describing morph +ports. The actual run-time switching is done via the opts:interface API. + +"""^^lv2:Markdown . + +morph:MorphPort + lv2:documentation """ + +Ports of this type MUST have another type which defines the default buffer +format (for example lv2:ControlPort) but can be dynamically changed to a +different type in hosts that support opts:interface. + +The host may change the type of a MorphPort by setting its morph:currentType +with LV2_Options_Interface::set(). If the plugin has any morph:AutoMorphPort +ports, the host MUST check their types after changing any port type since they +may have changed. + +"""^^lv2:Markdown . + +morph:AutoMorphPort + lv2:documentation """ + +Ports of this type MUST have another type which defines the default buffer +format (for example, lv2:ControlPort) but may dynamically change types based on +the configured types of any morph:MorphPort ports on the same plugin instance. + +The type of a port may only change in response to a host call to +LV2_Options_Interface::set(). Whenever any port type on the instance changes, +the host MUST check the type of all morph:AutoMorphPort ports with +LV2_Options_Interface::get() before calling run() again, since they may have +changed. If the type of any port is zero, it means the current configuration +is invalid and the plugin may not be run (unless that port is +lv2:connectionOptional and connected to NULL). + +This is mainly useful for outputs whose type depends on the type of +corresponding inputs. + +"""^^lv2:Markdown . + +morph:supportsType + lv2:documentation """ + +Indicates that a port supports being switched to a certain type. A MorphPort +MUST list each type it supports being switched to in the plugin data using this +property. + +"""^^lv2:Markdown . + +morph:currentType + lv2:documentation """ + +The currently active type of the port. This is for dynamic use as an option +and SHOULD NOT be listed in the static plugin data. + +"""^^lv2:Markdown . + diff --git a/lv2/morph.lv2/morph.ttl b/lv2/morph.lv2/morph.ttl new file mode 100644 index 0000000..9b8ef51 --- /dev/null +++ b/lv2/morph.lv2/morph.ttl @@ -0,0 +1,46 @@ +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix morph: . +@prefix opts: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Morph" ; + rdfs:comment "Ports that can dynamically change type." ; + rdfs:seeAlso ; + owl:imports . + +morph:MorphPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Morph Port" ; + rdfs:comment "A port which can be switched to another type." . + +morph:AutoMorphPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Auto Morph Port" ; + rdfs:comment "A port that can change its type based on that of another." . + +morph:supportsType + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain morph:MorphPort ; + rdfs:label "supports type" ; + rdfs:comment "A type that a port supports being switched to." . + +morph:currentType + a rdf:Property , + opts:Option , + owl:ObjectProperty ; + rdfs:domain morph:MorphPort ; + rdfs:label "current type" ; + rdfs:comment "The currently active type of the port." . + diff --git a/lv2/morph/manifest.ttl b/lv2/morph/manifest.ttl deleted file mode 100644 index 7c85cfd..0000000 --- a/lv2/morph/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 0 ; - rdfs:seeAlso . - diff --git a/lv2/morph/meson.build b/lv2/morph/meson.build deleted file mode 100644 index 0742c03..0000000 --- a/lv2/morph/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'morph' -path = 'ns' / 'ext' / 'morph' - -morph_data = files( - 'morph.meta.ttl', - 'morph.ttl', - 'manifest.ttl', -) - -headers = files( - 'morph.h', -) - -# Install specification bundle -install_data(morph_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_morph_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('morph.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/morph/morph.h b/lv2/morph/morph.h deleted file mode 100644 index 370937a..0000000 --- a/lv2/morph/morph.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_MORPH_H -#define LV2_MORPH_H - -/** - @defgroup morph Morph - @ingroup lv2 - - Ports that can dynamically change type. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_MORPH_URI "http://lv2plug.in/ns/ext/morph" ///< http://lv2plug.in/ns/ext/morph -#define LV2_MORPH_PREFIX LV2_MORPH_URI "#" ///< http://lv2plug.in/ns/ext/morph# - -#define LV2_MORPH__AutoMorphPort LV2_MORPH_PREFIX "AutoMorphPort" ///< http://lv2plug.in/ns/ext/morph#AutoMorphPort -#define LV2_MORPH__MorphPort LV2_MORPH_PREFIX "MorphPort" ///< http://lv2plug.in/ns/ext/morph#MorphPort -#define LV2_MORPH__interface LV2_MORPH_PREFIX "interface" ///< http://lv2plug.in/ns/ext/morph#interface -#define LV2_MORPH__supportsType LV2_MORPH_PREFIX "supportsType" ///< http://lv2plug.in/ns/ext/morph#supportsType -#define LV2_MORPH__currentType LV2_MORPH_PREFIX "currentType" ///< http://lv2plug.in/ns/ext/morph#currentType - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_MORPH_H */ diff --git a/lv2/morph/morph.meta.ttl b/lv2/morph/morph.meta.ttl deleted file mode 100644 index c247783..0000000 --- a/lv2/morph/morph.meta.ttl +++ /dev/null @@ -1,90 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix morph: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Morph" ; - doap:shortdesc "Ports that can dynamically change type." ; - doap:created "2012-05-22" ; - doap:developer ; - doap:release [ - doap:revision "1.0" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines two port types: morph:MorphPort, which has a -host-configurable type, and morph:AutoMorphPort, which may automatically change -type when a MorphPort's type is changed. These ports always have a default -type and work normally work in hosts that are unaware of this extension. Thus, -this extension provides a backwards compatibility mechanism which allows -plugins to use new port types but gracefully fall back to a default type in -hosts that do not support them. - -This extension only defines port types and properties for describing morph -ports. The actual run-time switching is done via the opts:interface API. - -"""^^lv2:Markdown . - -morph:MorphPort - lv2:documentation """ - -Ports of this type MUST have another type which defines the default buffer -format (for example lv2:ControlPort) but can be dynamically changed to a -different type in hosts that support opts:interface. - -The host may change the type of a MorphPort by setting its morph:currentType -with LV2_Options_Interface::set(). If the plugin has any morph:AutoMorphPort -ports, the host MUST check their types after changing any port type since they -may have changed. - -"""^^lv2:Markdown . - -morph:AutoMorphPort - lv2:documentation """ - -Ports of this type MUST have another type which defines the default buffer -format (for example, lv2:ControlPort) but may dynamically change types based on -the configured types of any morph:MorphPort ports on the same plugin instance. - -The type of a port may only change in response to a host call to -LV2_Options_Interface::set(). Whenever any port type on the instance changes, -the host MUST check the type of all morph:AutoMorphPort ports with -LV2_Options_Interface::get() before calling run() again, since they may have -changed. If the type of any port is zero, it means the current configuration -is invalid and the plugin may not be run (unless that port is -lv2:connectionOptional and connected to NULL). - -This is mainly useful for outputs whose type depends on the type of -corresponding inputs. - -"""^^lv2:Markdown . - -morph:supportsType - lv2:documentation """ - -Indicates that a port supports being switched to a certain type. A MorphPort -MUST list each type it supports being switched to in the plugin data using this -property. - -"""^^lv2:Markdown . - -morph:currentType - lv2:documentation """ - -The currently active type of the port. This is for dynamic use as an option -and SHOULD NOT be listed in the static plugin data. - -"""^^lv2:Markdown . - diff --git a/lv2/morph/morph.ttl b/lv2/morph/morph.ttl deleted file mode 100644 index a771e03..0000000 --- a/lv2/morph/morph.ttl +++ /dev/null @@ -1,47 +0,0 @@ -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix morph: . -@prefix opts: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Morph" ; - rdfs:comment "Ports that can dynamically change type." ; - rdfs:seeAlso , - ; - owl:imports . - -morph:MorphPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Morph Port" ; - rdfs:comment "A port which can be switched to another type." . - -morph:AutoMorphPort - a rdfs:Class , - owl:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Auto Morph Port" ; - rdfs:comment "A port that can change its type based on that of another." . - -morph:supportsType - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain morph:MorphPort ; - rdfs:label "supports type" ; - rdfs:comment "A type that a port supports being switched to." . - -morph:currentType - a rdf:Property , - opts:Option , - owl:ObjectProperty ; - rdfs:domain morph:MorphPort ; - rdfs:label "current type" ; - rdfs:comment "The currently active type of the port." . - diff --git a/lv2/options.lv2/manifest.ttl b/lv2/options.lv2/manifest.ttl new file mode 100644 index 0000000..18db448 --- /dev/null +++ b/lv2/options.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/options.lv2/options.meta.ttl b/lv2/options.lv2/options.meta.ttl new file mode 100644 index 0000000..838b0b9 --- /dev/null +++ b/lv2/options.lv2/options.meta.ttl @@ -0,0 +1,129 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix opts: . +@prefix rdf: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Options" ; + doap:shortdesc "Runtime options for LV2 plugins and UIs." ; + doap:created "2012-08-20" ; + doap:developer ; + doap:release [ + doap:revision "1.4" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Relax range of opts:requiredOption and opts:supportedOption" + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2013-01-10" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Set the range of opts:requiredOption and opts:supportedOption to opts:Option." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a facility for options, which are values the host +passes to a plugin or UI at run time. + +There are two facilities for passing options to an instance: opts:options +allows passing options at instantiation time, and the opts:interface interface +allows options to be dynamically set and retrieved after instantiation. + +Note that this extension is only for allowing hosts to configure plugins, and +is not a live control mechanism. For real-time control, use event-based +control via an atom:AtomPort with an atom:Sequence buffer. + +Instances may indicate they require an option with the opts:requiredOption +property, or that they optionally support an option with the +opts:supportedOption property. + +"""^^lv2:Markdown . + +opts:Option + lv2:documentation """ + +It is not required for a property to explicitly be an Option in order to be +used as such. However, properties which are primarily intended for use as +options, or are at least particularly useful as options, should be explicitly +given this type for documentation purposes, and to assist hosts in discovering +option definitions. + +"""^^lv2:Markdown . + +opts:interface + lv2:documentation """ + +An interface (LV2_Options_Interface) for dynamically setting and getting +options. Note that this is intended for use by the host for configuring +plugins only, and is not a live plugin control mechanism. + +The plugin data file should advertise this interface like so: + + :::turtle + @prefix opts: . + + + a lv2:Plugin ; + lv2:extensionData opts:interface . + +"""^^lv2:Markdown . + +opts:options + lv2:documentation """ + +To implement this feature, hosts MUST pass an LV2_Feature to the appropriate +instantiate method with this URI and data pointed to an array of +LV2_Options_Option terminated by an element with both key and value set to +zero. The instance should cast this data pointer to `const +LV2_Options_Option*` and scan the array for any options of interest. The +instance MUST NOT modify the options array in any way. + +Note that requiring this feature may reduce the number of compatible hosts. +Unless some options are strictly required by the instance, this feature SHOULD +be listed as an lv2:optionalFeature. + +"""^^lv2:Markdown . + +opts:requiredOption + lv2:documentation """ + +The host MUST pass a value for the specified option via opts:options during +instantiation. + +Note that use of this property may reduce the number of compatible hosts. +Wherever possible, it is better to list options with opts:supportedOption and +fall back to a reasonable default value if it is not provided. + +"""^^lv2:Markdown . + +opts:supportedOption + lv2:documentation """ + +The host SHOULD provide a value for the specified option if one is known, or +provide the user an opportunity to specify one if possible. + +"""^^lv2:Markdown . + diff --git a/lv2/options.lv2/options.ttl b/lv2/options.lv2/options.ttl new file mode 100644 index 0000000..5f9fcc9 --- /dev/null +++ b/lv2/options.lv2/options.ttl @@ -0,0 +1,44 @@ +@prefix lv2: . +@prefix opts: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Options" ; + rdfs:comment "Runtime options for LV2 plugins and UIs." ; + rdfs:seeAlso ; + owl:imports . + +opts:Option + a rdfs:Class ; + rdfs:label "Option" ; + rdfs:subClassOf rdf:Property ; + rdfs:comment "A value for a static option passed to an instance." . + +opts:interface + a lv2:ExtensionData ; + rdfs:label "interface" ; + rdfs:comment "An interface for dynamically setting and getting options." . + +opts:options + a lv2:Feature ; + rdfs:label "options" ; + rdfs:comment "The feature used to provide options to an instance." . + +opts:requiredOption + a rdf:Property , + owl:ObjectProperty ; + rdfs:range rdf:Property ; + rdfs:label "required option" ; + rdfs:comment "An option required by the instance to function at all." . + +opts:supportedOption + a rdf:Property , + owl:ObjectProperty ; + rdfs:range rdf:Property ; + rdfs:label "supported option" ; + rdfs:comment "An option supported or by the instance." . + diff --git a/lv2/options/manifest.ttl b/lv2/options/manifest.ttl deleted file mode 100644 index 18db448..0000000 --- a/lv2/options/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/options/meson.build b/lv2/options/meson.build deleted file mode 100644 index 5644b87..0000000 --- a/lv2/options/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'options' -path = 'ns' / 'ext' / 'options' - -options_data = files( - 'options.meta.ttl', - 'options.ttl', - 'manifest.ttl', -) - -headers = files( - 'options.h', -) - -# Install specification bundle -install_data(options_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_options_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('options.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/options/options.h b/lv2/options/options.h deleted file mode 100644 index 06e5db4..0000000 --- a/lv2/options/options.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_OPTIONS_H -#define LV2_OPTIONS_H - -/** - @defgroup options Options - @ingroup lv2 - - Instantiation time options. - - See for details. - - @{ -*/ - -#include "lv2/core/lv2.h" -#include "lv2/urid/urid.h" - -#include - -// clang-format off - -#define LV2_OPTIONS_URI "http://lv2plug.in/ns/ext/options" ///< http://lv2plug.in/ns/ext/options -#define LV2_OPTIONS_PREFIX LV2_OPTIONS_URI "#" ///< http://lv2plug.in/ns/ext/options# - -#define LV2_OPTIONS__Option LV2_OPTIONS_PREFIX "Option" ///< http://lv2plug.in/ns/ext/options#Option -#define LV2_OPTIONS__interface LV2_OPTIONS_PREFIX "interface" ///< http://lv2plug.in/ns/ext/options#interface -#define LV2_OPTIONS__options LV2_OPTIONS_PREFIX "options" ///< http://lv2plug.in/ns/ext/options#options -#define LV2_OPTIONS__requiredOption LV2_OPTIONS_PREFIX "requiredOption" ///< http://lv2plug.in/ns/ext/options#requiredOption -#define LV2_OPTIONS__supportedOption LV2_OPTIONS_PREFIX "supportedOption" ///< http://lv2plug.in/ns/ext/options#supportedOption - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -/** - The context of an Option, which defines the subject it applies to. -*/ -typedef enum { - /** - This option applies to the instance itself. The subject must be - ignored. - */ - LV2_OPTIONS_INSTANCE, - - /** - This option applies to some named resource. The subject is a URI mapped - to an integer (a LV2_URID, like the key) - */ - LV2_OPTIONS_RESOURCE, - - /** - This option applies to some blank node. The subject is a blank node - identifier, which is valid only within the current local scope. - */ - LV2_OPTIONS_BLANK, - - /** - This option applies to a port on the instance. The subject is the - port's index. - */ - LV2_OPTIONS_PORT -} LV2_Options_Context; - -/** - An option. - - This is a property with a subject, also known as a triple or statement. - - This struct is useful anywhere a statement needs to be passed where no - memory ownership issues are present (since the value is a const pointer). - - Options can be passed to an instance via the feature LV2_OPTIONS__options - with data pointed to an array of options terminated by a zeroed option, or - accessed/manipulated using LV2_Options_Interface. -*/ -typedef struct { - LV2_Options_Context context; /**< Context (type of subject). */ - uint32_t subject; /**< Subject. */ - LV2_URID key; /**< Key (property). */ - uint32_t size; /**< Size of value in bytes. */ - LV2_URID type; /**< Type of value (datatype). */ - const void* value; /**< Pointer to value (object). */ -} LV2_Options_Option; - -/** A status code for option functions. */ -typedef enum { - LV2_OPTIONS_SUCCESS = 0u, /**< Completed successfully. */ - LV2_OPTIONS_ERR_UNKNOWN = 1u, /**< Unknown error. */ - LV2_OPTIONS_ERR_BAD_SUBJECT = 1u << 1u, /**< Invalid/unsupported subject. */ - LV2_OPTIONS_ERR_BAD_KEY = 1u << 2u, /**< Invalid/unsupported key. */ - LV2_OPTIONS_ERR_BAD_VALUE = 1u << 3u /**< Invalid/unsupported value. */ -} LV2_Options_Status; - -/** - Interface for dynamically setting options (LV2_OPTIONS__interface). -*/ -typedef struct { - /** - Get the given options. - - Each element of the passed options array MUST have type, subject, and - key set. All other fields (size, type, value) MUST be initialised to - zero, and are set to the option value if such an option is found. - - This function is in the "instantiation" LV2 threading class, so no other - instance functions may be called concurrently. - - @return Bitwise OR of LV2_Options_Status values. - */ - uint32_t (*get)(LV2_Handle instance, LV2_Options_Option* options); - - /** - Set the given options. - - This function is in the "instantiation" LV2 threading class, so no other - instance functions may be called concurrently. - - @return Bitwise OR of LV2_Options_Status values. - */ - uint32_t (*set)(LV2_Handle instance, const LV2_Options_Option* options); -} LV2_Options_Interface; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_OPTIONS_H */ diff --git a/lv2/options/options.meta.ttl b/lv2/options/options.meta.ttl deleted file mode 100644 index 838b0b9..0000000 --- a/lv2/options/options.meta.ttl +++ /dev/null @@ -1,129 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix opts: . -@prefix rdf: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Options" ; - doap:shortdesc "Runtime options for LV2 plugins and UIs." ; - doap:created "2012-08-20" ; - doap:developer ; - doap:release [ - doap:revision "1.4" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Relax range of opts:requiredOption and opts:supportedOption" - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2013-01-10" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Set the range of opts:requiredOption and opts:supportedOption to opts:Option." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a facility for options, which are values the host -passes to a plugin or UI at run time. - -There are two facilities for passing options to an instance: opts:options -allows passing options at instantiation time, and the opts:interface interface -allows options to be dynamically set and retrieved after instantiation. - -Note that this extension is only for allowing hosts to configure plugins, and -is not a live control mechanism. For real-time control, use event-based -control via an atom:AtomPort with an atom:Sequence buffer. - -Instances may indicate they require an option with the opts:requiredOption -property, or that they optionally support an option with the -opts:supportedOption property. - -"""^^lv2:Markdown . - -opts:Option - lv2:documentation """ - -It is not required for a property to explicitly be an Option in order to be -used as such. However, properties which are primarily intended for use as -options, or are at least particularly useful as options, should be explicitly -given this type for documentation purposes, and to assist hosts in discovering -option definitions. - -"""^^lv2:Markdown . - -opts:interface - lv2:documentation """ - -An interface (LV2_Options_Interface) for dynamically setting and getting -options. Note that this is intended for use by the host for configuring -plugins only, and is not a live plugin control mechanism. - -The plugin data file should advertise this interface like so: - - :::turtle - @prefix opts: . - - - a lv2:Plugin ; - lv2:extensionData opts:interface . - -"""^^lv2:Markdown . - -opts:options - lv2:documentation """ - -To implement this feature, hosts MUST pass an LV2_Feature to the appropriate -instantiate method with this URI and data pointed to an array of -LV2_Options_Option terminated by an element with both key and value set to -zero. The instance should cast this data pointer to `const -LV2_Options_Option*` and scan the array for any options of interest. The -instance MUST NOT modify the options array in any way. - -Note that requiring this feature may reduce the number of compatible hosts. -Unless some options are strictly required by the instance, this feature SHOULD -be listed as an lv2:optionalFeature. - -"""^^lv2:Markdown . - -opts:requiredOption - lv2:documentation """ - -The host MUST pass a value for the specified option via opts:options during -instantiation. - -Note that use of this property may reduce the number of compatible hosts. -Wherever possible, it is better to list options with opts:supportedOption and -fall back to a reasonable default value if it is not provided. - -"""^^lv2:Markdown . - -opts:supportedOption - lv2:documentation """ - -The host SHOULD provide a value for the specified option if one is known, or -provide the user an opportunity to specify one if possible. - -"""^^lv2:Markdown . - diff --git a/lv2/options/options.ttl b/lv2/options/options.ttl deleted file mode 100644 index 78defef..0000000 --- a/lv2/options/options.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix lv2: . -@prefix opts: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Options" ; - rdfs:comment "Runtime options for LV2 plugins and UIs." ; - rdfs:seeAlso , - ; - owl:imports . - -opts:Option - a rdfs:Class ; - rdfs:label "Option" ; - rdfs:subClassOf rdf:Property ; - rdfs:comment "A value for a static option passed to an instance." . - -opts:interface - a lv2:ExtensionData ; - rdfs:label "interface" ; - rdfs:comment "An interface for dynamically setting and getting options." . - -opts:options - a lv2:Feature ; - rdfs:label "options" ; - rdfs:comment "The feature used to provide options to an instance." . - -opts:requiredOption - a rdf:Property , - owl:ObjectProperty ; - rdfs:range rdf:Property ; - rdfs:label "required option" ; - rdfs:comment "An option required by the instance to function at all." . - -opts:supportedOption - a rdf:Property , - owl:ObjectProperty ; - rdfs:range rdf:Property ; - rdfs:label "supported option" ; - rdfs:comment "An option supported or by the instance." . - diff --git a/lv2/parameters.lv2/manifest.ttl b/lv2/parameters.lv2/manifest.ttl new file mode 100644 index 0000000..57f5d2e --- /dev/null +++ b/lv2/parameters.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/parameters.lv2/parameters.meta.ttl b/lv2/parameters.lv2/parameters.meta.ttl new file mode 100644 index 0000000..9d7c623 --- /dev/null +++ b/lv2/parameters.lv2/parameters.meta.ttl @@ -0,0 +1,75 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix param: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Parameters" ; + doap:release [ + doap:revision "1.4" ; + doap:created "2015-04-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add range to parameters so hosts know how to control them." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] , [ + rdfs:label "Add param:sampleRate." + ] , [ + rdfs:label "Add parameters.h of URI defines for convenience." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + doap:created "2009-00-00" ; + doap:shortdesc "Common parameters for audio processing." ; + doap:maintainer ; + doap:developer ; + lv2:documentation """ + +This is a vocabulary for parameters that are common in audio processing +software. A parameter is purely a metadata concept, unrelated to any +particular code mechanism. Parameters are used to assign meaning to controls +(for example, using lv2:designation for ports) so they can be used more +intelligently or presented to the user more efficiently. + +"""^^lv2:Markdown . + +param:wetDryRatio + a lv2:Parameter ; + rdfs:label "wet/dry ratio" ; + lv2:documentation """ + +The ratio between processed and bypass components in output signal. The dry +and wet percentages can be calculated from the following equations: + + :::c + dry = (wetDryRatio.maximum - wetDryRatio.value) / wetDryRatio.maximum + wet = wetDryRatio.value / wetDryRatio.maximum + +Typically, maximum value of 1 or 100 and minimum value of 0 should be used. + +"""^^lv2:Markdown . + diff --git a/lv2/parameters.lv2/parameters.ttl b/lv2/parameters.lv2/parameters.ttl new file mode 100644 index 0000000..9987812 --- /dev/null +++ b/lv2/parameters.lv2/parameters.ttl @@ -0,0 +1,205 @@ +@prefix atom: . +@prefix lv2: . +@prefix owl: . +@prefix param: . +@prefix pg: . +@prefix rdf: . +@prefix rdfs: . +@prefix units: . + + + a owl:Ontology ; + rdfs:label "LV2 Parameters" ; + rdfs:comment "Common parameters for audio processing." ; + rdfs:seeAlso ; + owl:imports , + , + . + +param:ControlGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Control Group" ; + rdfs:comment "A group representing a set of associated controls." . + +param:amplitude + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "amplitude" ; + rdfs:comment "An amplitude as a factor, where 0 is silent and 1 is unity." . + +param:attack + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "attack" ; + rdfs:comment "The duration of an envelope attack stage." . + +param:cutoffFrequency + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "cutoff frequency" ; + rdfs:comment "The cutoff frequency, typically in Hz, for a filter." . + +param:decay + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "decay" ; + rdfs:comment "The duration of an envelope decay stage." . + +param:delay + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "delay" ; + rdfs:comment "The duration of an envelope delay stage." . + +param:frequency + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "frequency" ; + rdfs:comment "A frequency, typically in Hz." . + +param:hold + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "hold" ; + rdfs:comment "The duration of an envelope hold stage." . + +param:pulseWidth + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "pulse width" ; + rdfs:comment "The width of a pulse of a rectangular waveform." . + +param:ratio + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "ratio" ; + rdfs:comment "Compression ratio." . + +param:release + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "release" ; + rdfs:comment "The duration of an envelope release stage." . + +param:resonance + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "resonance" ; + rdfs:comment "The resonance of a filter." . + +param:sustain + a lv2:Parameter ; + rdfs:label "sustain" ; + rdfs:range atom:Float ; + rdfs:comment "The level of an envelope sustain stage as a factor." . + +param:threshold + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "threshold" ; + rdfs:comment "Compression threshold." . + +param:waveform + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "waveform" ; + rdfs:comment """The waveform "fader" for oscillators or modulators that have several.""" . + +param:gain + a lv2:Parameter ; + rdfs:range atom:Float ; + lv2:default 0.0 ; + lv2:minimum -20.0 ; + lv2:maximum 20.0 ; + units:unit units:db ; + rdfs:label "gain" ; + rdfs:comment "Gain in decibels." . + +param:wetDryRatio + a lv2:Parameter ; + rdfs:label "wet/dry ratio" ; + rdfs:comment "The ratio between processed and bypassed levels in the output." . + +param:wetLevel + a lv2:Parameter ; + rdfs:label "wet level" ; + rdfs:comment "The level of the processed component of a signal." . + +param:dryLevel + a lv2:Parameter ; + rdfs:label "dry level" ; + rdfs:comment "The level of the unprocessed component of a signal." . + +param:bypass + a lv2:Parameter ; + rdfs:label "bypass" ; + rdfs:comment "A boolean parameter that disables processing if true." . + +param:sampleRate + a lv2:Parameter ; + rdfs:label "sample rate" ; + rdfs:comment "A sample rate in Hz." . + +param:EnvelopeControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Envelope Controls" ; + rdfs:comment "Typical controls for a DAHDSR envelope." ; + pg:element [ + lv2:index 0 ; + lv2:designation param:delay + ] , [ + lv2:index 1 ; + lv2:designation param:attack + ] , [ + lv2:index 2 ; + lv2:designation param:hold + ] , [ + lv2:index 3 ; + lv2:designation param:decay + ] , [ + lv2:index 4 ; + lv2:designation param:sustain + ] , [ + lv2:index 5 ; + lv2:designation param:release + ] . + +param:OscillatorControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Oscillator Controls" ; + rdfs:comment "Typical controls for an oscillator." ; + pg:element [ + lv2:designation param:frequency + ] , [ + lv2:designation param:amplitude + ] , [ + lv2:designation param:waveform + ] , [ + lv2:designation param:pulseWidth + ] . + +param:FilterControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Filter Controls" ; + rdfs:comment "Typical controls for a filter." ; + pg:element [ + lv2:designation param:cutoffFrequency + ] , [ + lv2:designation param:resonance + ] . + +param:CompressorControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Compressor Controls" ; + rdfs:comment "Typical controls for a compressor." ; + pg:element [ + lv2:designation param:threshold + ] , [ + lv2:designation param:ratio + ] . + diff --git a/lv2/parameters/manifest.ttl b/lv2/parameters/manifest.ttl deleted file mode 100644 index 57f5d2e..0000000 --- a/lv2/parameters/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/parameters/meson.build b/lv2/parameters/meson.build deleted file mode 100644 index ae50866..0000000 --- a/lv2/parameters/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'parameters' -path = 'ns' / 'ext' / 'parameters' - -parameters_data = files( - 'parameters.meta.ttl', - 'parameters.ttl', - 'manifest.ttl', -) - -headers = files( - 'parameters.h', -) - -# Install specification bundle -install_data(parameters_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_parameters_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('parameters.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/parameters/parameters.h b/lv2/parameters/parameters.h deleted file mode 100644 index 66a7561..0000000 --- a/lv2/parameters/parameters.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_PARAMETERS_H -#define LV2_PARAMETERS_H - -/** - @defgroup parameters Parameters - @ingroup lv2 - - Common parameters for audio processing. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_PARAMETERS_URI "http://lv2plug.in/ns/ext/parameters" ///< http://lv2plug.in/ns/ext/parameters -#define LV2_PARAMETERS_PREFIX LV2_PARAMETERS_URI "#" ///< http://lv2plug.in/ns/ext/parameters# - -#define LV2_PARAMETERS__CompressorControls LV2_PARAMETERS_PREFIX "CompressorControls" ///< http://lv2plug.in/ns/ext/parameters#CompressorControls -#define LV2_PARAMETERS__ControlGroup LV2_PARAMETERS_PREFIX "ControlGroup" ///< http://lv2plug.in/ns/ext/parameters#ControlGroup -#define LV2_PARAMETERS__EnvelopeControls LV2_PARAMETERS_PREFIX "EnvelopeControls" ///< http://lv2plug.in/ns/ext/parameters#EnvelopeControls -#define LV2_PARAMETERS__FilterControls LV2_PARAMETERS_PREFIX "FilterControls" ///< http://lv2plug.in/ns/ext/parameters#FilterControls -#define LV2_PARAMETERS__OscillatorControls LV2_PARAMETERS_PREFIX "OscillatorControls" ///< http://lv2plug.in/ns/ext/parameters#OscillatorControls -#define LV2_PARAMETERS__amplitude LV2_PARAMETERS_PREFIX "amplitude" ///< http://lv2plug.in/ns/ext/parameters#amplitude -#define LV2_PARAMETERS__attack LV2_PARAMETERS_PREFIX "attack" ///< http://lv2plug.in/ns/ext/parameters#attack -#define LV2_PARAMETERS__bypass LV2_PARAMETERS_PREFIX "bypass" ///< http://lv2plug.in/ns/ext/parameters#bypass -#define LV2_PARAMETERS__cutoffFrequency LV2_PARAMETERS_PREFIX "cutoffFrequency" ///< http://lv2plug.in/ns/ext/parameters#cutoffFrequency -#define LV2_PARAMETERS__decay LV2_PARAMETERS_PREFIX "decay" ///< http://lv2plug.in/ns/ext/parameters#decay -#define LV2_PARAMETERS__delay LV2_PARAMETERS_PREFIX "delay" ///< http://lv2plug.in/ns/ext/parameters#delay -#define LV2_PARAMETERS__dryLevel LV2_PARAMETERS_PREFIX "dryLevel" ///< http://lv2plug.in/ns/ext/parameters#dryLevel -#define LV2_PARAMETERS__frequency LV2_PARAMETERS_PREFIX "frequency" ///< http://lv2plug.in/ns/ext/parameters#frequency -#define LV2_PARAMETERS__gain LV2_PARAMETERS_PREFIX "gain" ///< http://lv2plug.in/ns/ext/parameters#gain -#define LV2_PARAMETERS__hold LV2_PARAMETERS_PREFIX "hold" ///< http://lv2plug.in/ns/ext/parameters#hold -#define LV2_PARAMETERS__pulseWidth LV2_PARAMETERS_PREFIX "pulseWidth" ///< http://lv2plug.in/ns/ext/parameters#pulseWidth -#define LV2_PARAMETERS__ratio LV2_PARAMETERS_PREFIX "ratio" ///< http://lv2plug.in/ns/ext/parameters#ratio -#define LV2_PARAMETERS__release LV2_PARAMETERS_PREFIX "release" ///< http://lv2plug.in/ns/ext/parameters#release -#define LV2_PARAMETERS__resonance LV2_PARAMETERS_PREFIX "resonance" ///< http://lv2plug.in/ns/ext/parameters#resonance -#define LV2_PARAMETERS__sampleRate LV2_PARAMETERS_PREFIX "sampleRate" ///< http://lv2plug.in/ns/ext/parameters#sampleRate -#define LV2_PARAMETERS__sustain LV2_PARAMETERS_PREFIX "sustain" ///< http://lv2plug.in/ns/ext/parameters#sustain -#define LV2_PARAMETERS__threshold LV2_PARAMETERS_PREFIX "threshold" ///< http://lv2plug.in/ns/ext/parameters#threshold -#define LV2_PARAMETERS__waveform LV2_PARAMETERS_PREFIX "waveform" ///< http://lv2plug.in/ns/ext/parameters#waveform -#define LV2_PARAMETERS__wetDryRatio LV2_PARAMETERS_PREFIX "wetDryRatio" ///< http://lv2plug.in/ns/ext/parameters#wetDryRatio -#define LV2_PARAMETERS__wetLevel LV2_PARAMETERS_PREFIX "wetLevel" ///< http://lv2plug.in/ns/ext/parameters#wetLevel - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_PARAMETERS_H */ diff --git a/lv2/parameters/parameters.meta.ttl b/lv2/parameters/parameters.meta.ttl deleted file mode 100644 index 9d7c623..0000000 --- a/lv2/parameters/parameters.meta.ttl +++ /dev/null @@ -1,75 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix param: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Parameters" ; - doap:release [ - doap:revision "1.4" ; - doap:created "2015-04-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add range to parameters so hosts know how to control them." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] , [ - rdfs:label "Add param:sampleRate." - ] , [ - rdfs:label "Add parameters.h of URI defines for convenience." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - doap:created "2009-00-00" ; - doap:shortdesc "Common parameters for audio processing." ; - doap:maintainer ; - doap:developer ; - lv2:documentation """ - -This is a vocabulary for parameters that are common in audio processing -software. A parameter is purely a metadata concept, unrelated to any -particular code mechanism. Parameters are used to assign meaning to controls -(for example, using lv2:designation for ports) so they can be used more -intelligently or presented to the user more efficiently. - -"""^^lv2:Markdown . - -param:wetDryRatio - a lv2:Parameter ; - rdfs:label "wet/dry ratio" ; - lv2:documentation """ - -The ratio between processed and bypass components in output signal. The dry -and wet percentages can be calculated from the following equations: - - :::c - dry = (wetDryRatio.maximum - wetDryRatio.value) / wetDryRatio.maximum - wet = wetDryRatio.value / wetDryRatio.maximum - -Typically, maximum value of 1 or 100 and minimum value of 0 should be used. - -"""^^lv2:Markdown . - diff --git a/lv2/parameters/parameters.ttl b/lv2/parameters/parameters.ttl deleted file mode 100644 index 9987812..0000000 --- a/lv2/parameters/parameters.ttl +++ /dev/null @@ -1,205 +0,0 @@ -@prefix atom: . -@prefix lv2: . -@prefix owl: . -@prefix param: . -@prefix pg: . -@prefix rdf: . -@prefix rdfs: . -@prefix units: . - - - a owl:Ontology ; - rdfs:label "LV2 Parameters" ; - rdfs:comment "Common parameters for audio processing." ; - rdfs:seeAlso ; - owl:imports , - , - . - -param:ControlGroup - a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:label "Control Group" ; - rdfs:comment "A group representing a set of associated controls." . - -param:amplitude - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "amplitude" ; - rdfs:comment "An amplitude as a factor, where 0 is silent and 1 is unity." . - -param:attack - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "attack" ; - rdfs:comment "The duration of an envelope attack stage." . - -param:cutoffFrequency - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "cutoff frequency" ; - rdfs:comment "The cutoff frequency, typically in Hz, for a filter." . - -param:decay - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "decay" ; - rdfs:comment "The duration of an envelope decay stage." . - -param:delay - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "delay" ; - rdfs:comment "The duration of an envelope delay stage." . - -param:frequency - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "frequency" ; - rdfs:comment "A frequency, typically in Hz." . - -param:hold - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "hold" ; - rdfs:comment "The duration of an envelope hold stage." . - -param:pulseWidth - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "pulse width" ; - rdfs:comment "The width of a pulse of a rectangular waveform." . - -param:ratio - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "ratio" ; - rdfs:comment "Compression ratio." . - -param:release - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "release" ; - rdfs:comment "The duration of an envelope release stage." . - -param:resonance - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "resonance" ; - rdfs:comment "The resonance of a filter." . - -param:sustain - a lv2:Parameter ; - rdfs:label "sustain" ; - rdfs:range atom:Float ; - rdfs:comment "The level of an envelope sustain stage as a factor." . - -param:threshold - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "threshold" ; - rdfs:comment "Compression threshold." . - -param:waveform - a lv2:Parameter ; - rdfs:range atom:Float ; - rdfs:label "waveform" ; - rdfs:comment """The waveform "fader" for oscillators or modulators that have several.""" . - -param:gain - a lv2:Parameter ; - rdfs:range atom:Float ; - lv2:default 0.0 ; - lv2:minimum -20.0 ; - lv2:maximum 20.0 ; - units:unit units:db ; - rdfs:label "gain" ; - rdfs:comment "Gain in decibels." . - -param:wetDryRatio - a lv2:Parameter ; - rdfs:label "wet/dry ratio" ; - rdfs:comment "The ratio between processed and bypassed levels in the output." . - -param:wetLevel - a lv2:Parameter ; - rdfs:label "wet level" ; - rdfs:comment "The level of the processed component of a signal." . - -param:dryLevel - a lv2:Parameter ; - rdfs:label "dry level" ; - rdfs:comment "The level of the unprocessed component of a signal." . - -param:bypass - a lv2:Parameter ; - rdfs:label "bypass" ; - rdfs:comment "A boolean parameter that disables processing if true." . - -param:sampleRate - a lv2:Parameter ; - rdfs:label "sample rate" ; - rdfs:comment "A sample rate in Hz." . - -param:EnvelopeControls - a rdfs:Class ; - rdfs:subClassOf param:ControlGroup ; - rdfs:label "Envelope Controls" ; - rdfs:comment "Typical controls for a DAHDSR envelope." ; - pg:element [ - lv2:index 0 ; - lv2:designation param:delay - ] , [ - lv2:index 1 ; - lv2:designation param:attack - ] , [ - lv2:index 2 ; - lv2:designation param:hold - ] , [ - lv2:index 3 ; - lv2:designation param:decay - ] , [ - lv2:index 4 ; - lv2:designation param:sustain - ] , [ - lv2:index 5 ; - lv2:designation param:release - ] . - -param:OscillatorControls - a rdfs:Class ; - rdfs:subClassOf param:ControlGroup ; - rdfs:label "Oscillator Controls" ; - rdfs:comment "Typical controls for an oscillator." ; - pg:element [ - lv2:designation param:frequency - ] , [ - lv2:designation param:amplitude - ] , [ - lv2:designation param:waveform - ] , [ - lv2:designation param:pulseWidth - ] . - -param:FilterControls - a rdfs:Class ; - rdfs:subClassOf param:ControlGroup ; - rdfs:label "Filter Controls" ; - rdfs:comment "Typical controls for a filter." ; - pg:element [ - lv2:designation param:cutoffFrequency - ] , [ - lv2:designation param:resonance - ] . - -param:CompressorControls - a rdfs:Class ; - rdfs:subClassOf param:ControlGroup ; - rdfs:label "Compressor Controls" ; - rdfs:comment "Typical controls for a compressor." ; - pg:element [ - lv2:designation param:threshold - ] , [ - lv2:designation param:ratio - ] . - diff --git a/lv2/patch.lv2/manifest.ttl b/lv2/patch.lv2/manifest.ttl new file mode 100644 index 0000000..4bf9cfb --- /dev/null +++ b/lv2/patch.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 10 ; + rdfs:seeAlso . + diff --git a/lv2/patch.lv2/patch.meta.ttl b/lv2/patch.lv2/patch.meta.ttl new file mode 100644 index 0000000..12cb6c6 --- /dev/null +++ b/lv2/patch.lv2/patch.meta.ttl @@ -0,0 +1,388 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix patch: . +@prefix rdfs: . + + + a doap:Project ; + doap:created "2012-02-09" ; + doap:license ; + doap:developer ; + doap:name "LV2 Patch" ; + doap:shortdesc "A protocol for accessing and manipulating properties." ; + doap:release [ + doap:revision "2.10" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] , [ + rdfs:label "Make the type of patch:wildcard more precise." + ] , [ + rdfs:label "Fix type and range of patch:value." + ] + ] + ] , [ + doap:revision "2.8" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix incorrect type of patch:sequenceNumber." + ] + ] + ] , [ + doap:revision "2.6" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add patch:accept property." + ] , [ + rdfs:label "Add patch:context property." + ] + ] + ] , [ + doap:revision "2.4" ; + doap:created "2015-04-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Define patch:Get with no subject to implicitly apply to receiver. This can be used by UIs to get an initial description of a plugin." + ] , [ + rdfs:label "Add patch:Copy method." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2014-08-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add patch:sequenceNumber for associating replies with requests." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2013-01-10" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make patch:Set a compact message for setting one property." + ] , [ + rdfs:label "Add patch:readable and patch:writable for describing available properties." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This is a vocabulary for messages that access and manipulate properties. +It can be used as a dynamic control interface for plugins, +or anything else with a property-based model. + +The key underlying concept here is to control things by manipulating arbitrary properties, +rather than by calling application-specific methods. +This allows implementations to understand what messages do +(at least in a mechanical sense), +which makes things like caching, proxying, or undo relatively straightforward to implement. +Note, however, that this is only conceptual: +there is no requirement to implement a general property store. +Typically, a plugin will understand a fixed set of properties that represent its parameters or other internal state, and ignore everything else. + +This protocol is syntax-agnostic, +and [homoiconic](https://en.wikipedia.org/wiki/Homoiconicity) +in the sense that the messages use the same format as the data they manipulate. +In particular, messages can be serialised as a binary [Object](atom.html#Object) for realtime plugin control, +or as Turtle for saving to a file, +sending over a network, +printing for debugging purposes, +and so on. + +This specification only defines a semantic protocol, +there is no corresponding API. +It can be used with the [Atom](atom.html) extension to control plugins which support message-based parameters as defined by the [Parameters](parameters.html) extension. + +For example, if a plugin defines a `eg:volume` parameter, it can be controlled by the host by sending a patch:Set message to the plugin instance: + + :::turtle + [ + a patch:Set ; + patch:property eg:volume ; + patch:value 11.0 ; + ] + +Similarly, the host could get the current value for this parameter by sending a patch:Get message: + + :::turtle + [ + a patch:Get ; + patch:property eg:volume ; + ] + +The plugin would then respond with the same patch:Set message as above. +In this case, the plugin instance is implicitly the patch:subject, +but a specific subject can also be given for deeper control. + +"""^^lv2:Markdown . + +patch:Copy + lv2:documentation """ + +After this, the destination has the same description as the subject, +and the subject is unchanged. + +It is an error if the subject does not exist, +or if the destination already exists. + +Multiple subjects may be given if the destination is a container, +but the semantics of this case are application-defined. + +"""^^lv2:Markdown . + +patch:Get + lv2:documentation """ + +If a patch:property is given, +then the receiver should respond with a patch:Set message that gives only that property. + +Otherwise, it should respond with a [concise bounded description](http://www.w3.org/Submission/CBD/) in a patch:Put message, +that is, a description that recursively includes any blank node values. + +If a patch:subject is given, then the response should have the same subject. +If no subject is given, then the receiver is implicitly the subject. + +If a patch:request node or a patch:sequenceNumber is given, +then the response should be a patch:Response and have the same property. +If neither is given, then the receiver can respond with a simple patch:Put message. +For example: + + :::turtle + [] + a patch:Get ; + patch:subject eg:something . + +Could result in: + + :::turtle + [] + a patch:Put ; + patch:subject eg:something ; + patch:body [ + eg:name "Something" ; + eg:ratio 1.6180339887 ; + ] . + +"""^^lv2:Markdown . + +patch:Insert + lv2:documentation """ + +If the subject does not exist, it is created. If the subject does already +exist, it is added to. + +This request only adds properties, it never removes them. The user must take +care that multiple values are not set for properties which should only have +one. + +"""^^lv2:Markdown . + +patch:Message + lv2:documentation """ + +This is an abstract base class for all patch messages. Concrete messages are +either a patch:Request or a patch:Response. + +"""^^lv2:Markdown . + +patch:Move + lv2:documentation """ + +After this, the destination has the description that the subject had, and the +subject no longer exists. + +It is an error if the subject does not exist, or if the destination already +exists. + +"""^^lv2:Markdown . + +patch:Patch + lv2:documentation """ + +This method always has at least one subject, and exactly one patch:add and +patch:remove property. The value of patch:add and patch:remove are nodes which +have the properties to add or remove from the subject(s), respectively. The +special value patch:wildcard may be used as the value of a remove property to +remove all properties with the given predicate. For example: + + :::turtle + [] + a patch:Patch ; + patch:subject ; + patch:add [ + eg:name "New name" ; + eg:age 42 ; + ] ; + patch:remove [ + eg:name "Old name" ; + eg:age patch:wildcard ; # Remove all old eg:age properties + ] . + +"""^^lv2:Markdown . + +patch:Put + lv2:documentation """ + +If the subject does not already exist, it is created. If the subject does +already exist, the patch:body is considered an updated version of it, and the +previous version is replaced. + + :::turtle + [] + a patch:Put ; + patch:subject ; + patch:body [ + eg:name "New name" ; + eg:age 42 ; + ] . + +"""^^lv2:Markdown . + +patch:Request + a rdfs:Class ; + rdfs:label "Request" ; + rdfs:subClassOf patch:Message ; + lv2:documentation """ + +A request may have a patch:subject property, which specifies the resource that +the request applies to. The subject may be omitted in contexts where it is +implicit, for example if the recipient is the subject. + +"""^^lv2:Markdown . + +patch:Set + lv2:documentation """ + +This is equivalent to a patch:Patch which removes _all_ pre-existing values for +the property before setting the new value. For example: + + :::turtle + [] + a patch:Set ; + patch:subject ; + patch:property eg:name ; + patch:value "New name" . + +Which is equivalent to: + + :::turtle + [] + a patch:Patch ; + patch:subject ; + patch:add [ + eg:name "New name" ; + ] ; + patch:remove [ + eg:name patch:wildcard ; + ] . + +"""^^lv2:Markdown . + +patch:body + lv2:documentation """ + +The details of this property's value depend on the type of message it is a part +of. + +"""^^lv2:Markdown . + +patch:context + lv2:documentation """ + +For example, a plugin may have a special context for ephemeral properties which +are only relevant during the lifetime of the instance and should not be saved +in state. + +The specific uses for contexts are application specific. However, the context +MUST be a URI, and can be interpreted as the ID of a data model where +properties should be stored. Implementations MAY have special support for +contexts, for example by storing in a quad store or serializing to a format +that supports multiple RDF graphs such as TriG. + +"""^^lv2:Markdown . + +patch:readable + lv2:documentation """ + +See the similar patch:writable property for details. + +"""^^lv2:Markdown . + +patch:request + lv2:documentation """ + +This can be used if referring directly to the URI or blank node ID of the +request is possible. Otherwise, use patch:sequenceNumber. + +"""^^lv2:Markdown . + +patch:sequenceNumber + lv2:documentation """ + +This property is used to associate replies with requests when it is not +feasible to refer to request URIs with patch:request. A patch:Response with a +given sequence number is the reply to the previously send patch:Request with +the same sequence number. + +The special sequence number 0 means that no reply is desired. + +"""^^lv2:Markdown . + +patch:wildcard + lv2:documentation """ + +This makes it possible to describe the removal of all values for a given +property. + +"""^^lv2:Markdown . + +patch:writable + lv2:documentation """ + +This is used to list properties that can be changed, for example to allow user +interfaces to present appropriate controls. For example: + + :::turtle + @prefix eg: . + @prefix rdf: . + @prefix rdfs: . + @prefix xsd: . + + eg:title + a rdf:Property ; + rdfs:label "title" ; + rdfs:range xsd:string . + + eg:plugin + patch:writable eg:title . + +"""^^lv2:Markdown . + diff --git a/lv2/patch.lv2/patch.ttl b/lv2/patch.lv2/patch.ttl new file mode 100644 index 0000000..33d04d1 --- /dev/null +++ b/lv2/patch.lv2/patch.ttl @@ -0,0 +1,248 @@ +@prefix foaf: . +@prefix owl: . +@prefix patch: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:seeAlso ; + rdfs:label "LV2 Patch" ; + rdfs:comment "A protocol for accessing and manipulating properties." . + +patch:Ack + a rdfs:Class ; + rdfs:subClassOf patch:Response ; + rdfs:label "Ack" ; + rdfs:comment "An acknowledgement that a request was successful." . + +patch:Copy + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Copy" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:minCardinality 1 ; + owl:onProperty patch:subject + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:destination + ] ; + rdfs:comment "A request to copy the patch:subject to the patch:destination." . + +patch:Delete + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Delete" ; + rdfs:comment "Request that the patch:subject or subjects be deleted." . + +patch:Error + a rdfs:Class ; + rdfs:subClassOf patch:Response ; + rdfs:label "Error" ; + rdfs:comment "A response indicating an error processing a request." . + +patch:Get + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Get" ; + rdfs:comment "A request for a description of the patch:subject." . + +patch:Insert + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Insert" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:subject + ] ; + rdfs:comment "A request to insert a patch:body into the patch:subject." . + +patch:Message + a rdfs:Class ; + rdfs:label "Patch Message" ; + rdfs:comment "A patch message." . + +patch:Move + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Move" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:subject + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:destination + ] ; + rdfs:comment "A request to move the patch:subject to the patch:destination." . + +patch:Patch + a rdfs:Class ; + rdfs:subClassOf patch:Request , + [ + a owl:Restriction ; + owl:minCardinality 1 ; + owl:onProperty patch:subject + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:add + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:remove + ] ; + rdfs:label "Patch" ; + rdfs:comment "A request to add and/or remove properties of the patch:subject." . + +patch:Put + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Put" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:subject + ] ; + rdfs:comment "A request to put the patch:body as the patch:subject." . + +patch:Request + a rdfs:Class ; + rdfs:label "Request" ; + rdfs:subClassOf patch:Message ; + rdfs:comment "A patch request message." . + +patch:Response + a rdfs:Class ; + rdfs:subClassOf patch:Message ; + rdfs:label "Response" ; + rdfs:comment "A response to a patch:Request." . + +patch:Set + a rdfs:Class ; + rdfs:label "Set" ; + rdfs:subClassOf patch:Request , + [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:property + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:value + ] ; + rdfs:comment "A compact request to set a property to a value." . + +patch:accept + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "accept" ; + rdfs:domain patch:Request ; + rdfs:range rdfs:Class ; + rdfs:comment "An accepted type for a response." . + +patch:add + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Patch ; + rdfs:range rdfs:Resource ; + rdfs:label "add" ; + rdfs:comment "The properties to add to the subject." . + +patch:body + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message ; + rdfs:label "body" ; + rdfs:comment "The body of a message." . + +patch:context + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain patch:Message ; + rdfs:label "context" ; + rdfs:comment "The context of properties in this message." . + +patch:destination + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message ; + rdfs:label "destination" ; + rdfs:comment "The destination to move the patch:subject to." . + +patch:property + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "property" ; + rdfs:domain patch:Message ; + rdfs:range rdf:Property ; + rdfs:comment "The property for a patch:Set or patch:Get message." . + +patch:readable + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "readable" ; + rdfs:range rdf:Property ; + rdfs:comment "A property that can be read with a patch:Get message." . + +patch:remove + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:label "remove" ; + rdfs:domain patch:Patch ; + rdfs:range rdfs:Resource ; + rdfs:comment "The properties to remove from the subject." . + +patch:request + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:label "request" ; + rdfs:domain patch:Response ; + rdfs:range patch:Request ; + rdfs:comment "The request this is a response to." . + +patch:sequenceNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "sequence number" ; + rdfs:domain patch:Message ; + rdfs:range xsd:int ; + rdfs:comment "The sequence number of a request or response." . + +patch:subject + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message ; + rdfs:label "subject" ; + rdfs:comment "The subject this message applies to." . + +patch:value + a rdf:Property ; + rdfs:label "value" ; + rdfs:domain patch:Set ; + rdfs:comment "The value of a property in a patch:Set message." . + +patch:wildcard + a owl:Thing ; + rdfs:label "wildcard" ; + rdfs:comment "A wildcard that matches any resource." . + +patch:writable + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "writable" ; + rdfs:range rdf:Property ; + rdfs:comment "A property that can be set with a patch:Set or patch:Patch message." . + diff --git a/lv2/patch/manifest.ttl b/lv2/patch/manifest.ttl deleted file mode 100644 index 4bf9cfb..0000000 --- a/lv2/patch/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 2 ; - lv2:microVersion 10 ; - rdfs:seeAlso . - diff --git a/lv2/patch/meson.build b/lv2/patch/meson.build deleted file mode 100644 index cb54fb6..0000000 --- a/lv2/patch/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'patch' -path = 'ns' / 'ext' / 'patch' - -patch_data = files( - 'patch.meta.ttl', - 'patch.ttl', - 'manifest.ttl', -) - -headers = files( - 'patch.h', -) - -# Install specification bundle -install_data(patch_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_patch_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('patch.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/patch/patch.h b/lv2/patch/patch.h deleted file mode 100644 index 4db2abb..0000000 --- a/lv2/patch/patch.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_PATCH_H -#define LV2_PATCH_H - -/** - @defgroup patch Patch - @ingroup lv2 - - Messages for accessing and manipulating properties. - - Note the patch extension is purely data, this header merely defines URIs for - convenience. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_PATCH_URI "http://lv2plug.in/ns/ext/patch" ///< http://lv2plug.in/ns/ext/patch -#define LV2_PATCH_PREFIX LV2_PATCH_URI "#" ///< http://lv2plug.in/ns/ext/patch# - -#define LV2_PATCH__Ack LV2_PATCH_PREFIX "Ack" ///< http://lv2plug.in/ns/ext/patch#Ack -#define LV2_PATCH__Delete LV2_PATCH_PREFIX "Delete" ///< http://lv2plug.in/ns/ext/patch#Delete -#define LV2_PATCH__Copy LV2_PATCH_PREFIX "Copy" ///< http://lv2plug.in/ns/ext/patch#Copy -#define LV2_PATCH__Error LV2_PATCH_PREFIX "Error" ///< http://lv2plug.in/ns/ext/patch#Error -#define LV2_PATCH__Get LV2_PATCH_PREFIX "Get" ///< http://lv2plug.in/ns/ext/patch#Get -#define LV2_PATCH__Message LV2_PATCH_PREFIX "Message" ///< http://lv2plug.in/ns/ext/patch#Message -#define LV2_PATCH__Move LV2_PATCH_PREFIX "Move" ///< http://lv2plug.in/ns/ext/patch#Move -#define LV2_PATCH__Patch LV2_PATCH_PREFIX "Patch" ///< http://lv2plug.in/ns/ext/patch#Patch -#define LV2_PATCH__Post LV2_PATCH_PREFIX "Post" ///< http://lv2plug.in/ns/ext/patch#Post -#define LV2_PATCH__Put LV2_PATCH_PREFIX "Put" ///< http://lv2plug.in/ns/ext/patch#Put -#define LV2_PATCH__Request LV2_PATCH_PREFIX "Request" ///< http://lv2plug.in/ns/ext/patch#Request -#define LV2_PATCH__Response LV2_PATCH_PREFIX "Response" ///< http://lv2plug.in/ns/ext/patch#Response -#define LV2_PATCH__Set LV2_PATCH_PREFIX "Set" ///< http://lv2plug.in/ns/ext/patch#Set -#define LV2_PATCH__accept LV2_PATCH_PREFIX "accept" ///< http://lv2plug.in/ns/ext/patch#accept -#define LV2_PATCH__add LV2_PATCH_PREFIX "add" ///< http://lv2plug.in/ns/ext/patch#add -#define LV2_PATCH__body LV2_PATCH_PREFIX "body" ///< http://lv2plug.in/ns/ext/patch#body -#define LV2_PATCH__context LV2_PATCH_PREFIX "context" ///< http://lv2plug.in/ns/ext/patch#context -#define LV2_PATCH__destination LV2_PATCH_PREFIX "destination" ///< http://lv2plug.in/ns/ext/patch#destination -#define LV2_PATCH__property LV2_PATCH_PREFIX "property" ///< http://lv2plug.in/ns/ext/patch#property -#define LV2_PATCH__readable LV2_PATCH_PREFIX "readable" ///< http://lv2plug.in/ns/ext/patch#readable -#define LV2_PATCH__remove LV2_PATCH_PREFIX "remove" ///< http://lv2plug.in/ns/ext/patch#remove -#define LV2_PATCH__request LV2_PATCH_PREFIX "request" ///< http://lv2plug.in/ns/ext/patch#request -#define LV2_PATCH__subject LV2_PATCH_PREFIX "subject" ///< http://lv2plug.in/ns/ext/patch#subject -#define LV2_PATCH__sequenceNumber LV2_PATCH_PREFIX "sequenceNumber" ///< http://lv2plug.in/ns/ext/patch#sequenceNumber -#define LV2_PATCH__value LV2_PATCH_PREFIX "value" ///< http://lv2plug.in/ns/ext/patch#value -#define LV2_PATCH__wildcard LV2_PATCH_PREFIX "wildcard" ///< http://lv2plug.in/ns/ext/patch#wildcard -#define LV2_PATCH__writable LV2_PATCH_PREFIX "writable" ///< http://lv2plug.in/ns/ext/patch#writable - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_PATCH_H */ diff --git a/lv2/patch/patch.meta.ttl b/lv2/patch/patch.meta.ttl deleted file mode 100644 index 12cb6c6..0000000 --- a/lv2/patch/patch.meta.ttl +++ /dev/null @@ -1,388 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix patch: . -@prefix rdfs: . - - - a doap:Project ; - doap:created "2012-02-09" ; - doap:license ; - doap:developer ; - doap:name "LV2 Patch" ; - doap:shortdesc "A protocol for accessing and manipulating properties." ; - doap:release [ - doap:revision "2.10" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] , [ - rdfs:label "Make the type of patch:wildcard more precise." - ] , [ - rdfs:label "Fix type and range of patch:value." - ] - ] - ] , [ - doap:revision "2.8" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix incorrect type of patch:sequenceNumber." - ] - ] - ] , [ - doap:revision "2.6" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add patch:accept property." - ] , [ - rdfs:label "Add patch:context property." - ] - ] - ] , [ - doap:revision "2.4" ; - doap:created "2015-04-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Define patch:Get with no subject to implicitly apply to receiver. This can be used by UIs to get an initial description of a plugin." - ] , [ - rdfs:label "Add patch:Copy method." - ] - ] - ] , [ - doap:revision "2.2" ; - doap:created "2014-08-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add patch:sequenceNumber for associating replies with requests." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2013-01-10" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Make patch:Set a compact message for setting one property." - ] , [ - rdfs:label "Add patch:readable and patch:writable for describing available properties." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This is a vocabulary for messages that access and manipulate properties. -It can be used as a dynamic control interface for plugins, -or anything else with a property-based model. - -The key underlying concept here is to control things by manipulating arbitrary properties, -rather than by calling application-specific methods. -This allows implementations to understand what messages do -(at least in a mechanical sense), -which makes things like caching, proxying, or undo relatively straightforward to implement. -Note, however, that this is only conceptual: -there is no requirement to implement a general property store. -Typically, a plugin will understand a fixed set of properties that represent its parameters or other internal state, and ignore everything else. - -This protocol is syntax-agnostic, -and [homoiconic](https://en.wikipedia.org/wiki/Homoiconicity) -in the sense that the messages use the same format as the data they manipulate. -In particular, messages can be serialised as a binary [Object](atom.html#Object) for realtime plugin control, -or as Turtle for saving to a file, -sending over a network, -printing for debugging purposes, -and so on. - -This specification only defines a semantic protocol, -there is no corresponding API. -It can be used with the [Atom](atom.html) extension to control plugins which support message-based parameters as defined by the [Parameters](parameters.html) extension. - -For example, if a plugin defines a `eg:volume` parameter, it can be controlled by the host by sending a patch:Set message to the plugin instance: - - :::turtle - [ - a patch:Set ; - patch:property eg:volume ; - patch:value 11.0 ; - ] - -Similarly, the host could get the current value for this parameter by sending a patch:Get message: - - :::turtle - [ - a patch:Get ; - patch:property eg:volume ; - ] - -The plugin would then respond with the same patch:Set message as above. -In this case, the plugin instance is implicitly the patch:subject, -but a specific subject can also be given for deeper control. - -"""^^lv2:Markdown . - -patch:Copy - lv2:documentation """ - -After this, the destination has the same description as the subject, -and the subject is unchanged. - -It is an error if the subject does not exist, -or if the destination already exists. - -Multiple subjects may be given if the destination is a container, -but the semantics of this case are application-defined. - -"""^^lv2:Markdown . - -patch:Get - lv2:documentation """ - -If a patch:property is given, -then the receiver should respond with a patch:Set message that gives only that property. - -Otherwise, it should respond with a [concise bounded description](http://www.w3.org/Submission/CBD/) in a patch:Put message, -that is, a description that recursively includes any blank node values. - -If a patch:subject is given, then the response should have the same subject. -If no subject is given, then the receiver is implicitly the subject. - -If a patch:request node or a patch:sequenceNumber is given, -then the response should be a patch:Response and have the same property. -If neither is given, then the receiver can respond with a simple patch:Put message. -For example: - - :::turtle - [] - a patch:Get ; - patch:subject eg:something . - -Could result in: - - :::turtle - [] - a patch:Put ; - patch:subject eg:something ; - patch:body [ - eg:name "Something" ; - eg:ratio 1.6180339887 ; - ] . - -"""^^lv2:Markdown . - -patch:Insert - lv2:documentation """ - -If the subject does not exist, it is created. If the subject does already -exist, it is added to. - -This request only adds properties, it never removes them. The user must take -care that multiple values are not set for properties which should only have -one. - -"""^^lv2:Markdown . - -patch:Message - lv2:documentation """ - -This is an abstract base class for all patch messages. Concrete messages are -either a patch:Request or a patch:Response. - -"""^^lv2:Markdown . - -patch:Move - lv2:documentation """ - -After this, the destination has the description that the subject had, and the -subject no longer exists. - -It is an error if the subject does not exist, or if the destination already -exists. - -"""^^lv2:Markdown . - -patch:Patch - lv2:documentation """ - -This method always has at least one subject, and exactly one patch:add and -patch:remove property. The value of patch:add and patch:remove are nodes which -have the properties to add or remove from the subject(s), respectively. The -special value patch:wildcard may be used as the value of a remove property to -remove all properties with the given predicate. For example: - - :::turtle - [] - a patch:Patch ; - patch:subject ; - patch:add [ - eg:name "New name" ; - eg:age 42 ; - ] ; - patch:remove [ - eg:name "Old name" ; - eg:age patch:wildcard ; # Remove all old eg:age properties - ] . - -"""^^lv2:Markdown . - -patch:Put - lv2:documentation """ - -If the subject does not already exist, it is created. If the subject does -already exist, the patch:body is considered an updated version of it, and the -previous version is replaced. - - :::turtle - [] - a patch:Put ; - patch:subject ; - patch:body [ - eg:name "New name" ; - eg:age 42 ; - ] . - -"""^^lv2:Markdown . - -patch:Request - a rdfs:Class ; - rdfs:label "Request" ; - rdfs:subClassOf patch:Message ; - lv2:documentation """ - -A request may have a patch:subject property, which specifies the resource that -the request applies to. The subject may be omitted in contexts where it is -implicit, for example if the recipient is the subject. - -"""^^lv2:Markdown . - -patch:Set - lv2:documentation """ - -This is equivalent to a patch:Patch which removes _all_ pre-existing values for -the property before setting the new value. For example: - - :::turtle - [] - a patch:Set ; - patch:subject ; - patch:property eg:name ; - patch:value "New name" . - -Which is equivalent to: - - :::turtle - [] - a patch:Patch ; - patch:subject ; - patch:add [ - eg:name "New name" ; - ] ; - patch:remove [ - eg:name patch:wildcard ; - ] . - -"""^^lv2:Markdown . - -patch:body - lv2:documentation """ - -The details of this property's value depend on the type of message it is a part -of. - -"""^^lv2:Markdown . - -patch:context - lv2:documentation """ - -For example, a plugin may have a special context for ephemeral properties which -are only relevant during the lifetime of the instance and should not be saved -in state. - -The specific uses for contexts are application specific. However, the context -MUST be a URI, and can be interpreted as the ID of a data model where -properties should be stored. Implementations MAY have special support for -contexts, for example by storing in a quad store or serializing to a format -that supports multiple RDF graphs such as TriG. - -"""^^lv2:Markdown . - -patch:readable - lv2:documentation """ - -See the similar patch:writable property for details. - -"""^^lv2:Markdown . - -patch:request - lv2:documentation """ - -This can be used if referring directly to the URI or blank node ID of the -request is possible. Otherwise, use patch:sequenceNumber. - -"""^^lv2:Markdown . - -patch:sequenceNumber - lv2:documentation """ - -This property is used to associate replies with requests when it is not -feasible to refer to request URIs with patch:request. A patch:Response with a -given sequence number is the reply to the previously send patch:Request with -the same sequence number. - -The special sequence number 0 means that no reply is desired. - -"""^^lv2:Markdown . - -patch:wildcard - lv2:documentation """ - -This makes it possible to describe the removal of all values for a given -property. - -"""^^lv2:Markdown . - -patch:writable - lv2:documentation """ - -This is used to list properties that can be changed, for example to allow user -interfaces to present appropriate controls. For example: - - :::turtle - @prefix eg: . - @prefix rdf: . - @prefix rdfs: . - @prefix xsd: . - - eg:title - a rdf:Property ; - rdfs:label "title" ; - rdfs:range xsd:string . - - eg:plugin - patch:writable eg:title . - -"""^^lv2:Markdown . - diff --git a/lv2/patch/patch.ttl b/lv2/patch/patch.ttl deleted file mode 100644 index c7f6d76..0000000 --- a/lv2/patch/patch.ttl +++ /dev/null @@ -1,249 +0,0 @@ -@prefix foaf: . -@prefix owl: . -@prefix patch: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:seeAlso , - ; - rdfs:label "LV2 Patch" ; - rdfs:comment "A protocol for accessing and manipulating properties." . - -patch:Ack - a rdfs:Class ; - rdfs:subClassOf patch:Response ; - rdfs:label "Ack" ; - rdfs:comment "An acknowledgement that a request was successful." . - -patch:Copy - a rdfs:Class ; - rdfs:subClassOf patch:Request ; - rdfs:label "Copy" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty patch:subject - ] , [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:destination - ] ; - rdfs:comment "A request to copy the patch:subject to the patch:destination." . - -patch:Delete - a rdfs:Class ; - rdfs:subClassOf patch:Request ; - rdfs:label "Delete" ; - rdfs:comment "Request that the patch:subject or subjects be deleted." . - -patch:Error - a rdfs:Class ; - rdfs:subClassOf patch:Response ; - rdfs:label "Error" ; - rdfs:comment "A response indicating an error processing a request." . - -patch:Get - a rdfs:Class ; - rdfs:subClassOf patch:Request ; - rdfs:label "Get" ; - rdfs:comment "A request for a description of the patch:subject." . - -patch:Insert - a rdfs:Class ; - rdfs:subClassOf patch:Request ; - rdfs:label "Insert" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:subject - ] ; - rdfs:comment "A request to insert a patch:body into the patch:subject." . - -patch:Message - a rdfs:Class ; - rdfs:label "Patch Message" ; - rdfs:comment "A patch message." . - -patch:Move - a rdfs:Class ; - rdfs:subClassOf patch:Request ; - rdfs:label "Move" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:subject - ] , [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:destination - ] ; - rdfs:comment "A request to move the patch:subject to the patch:destination." . - -patch:Patch - a rdfs:Class ; - rdfs:subClassOf patch:Request , - [ - a owl:Restriction ; - owl:minCardinality 1 ; - owl:onProperty patch:subject - ] , [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:add - ] , [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:remove - ] ; - rdfs:label "Patch" ; - rdfs:comment "A request to add and/or remove properties of the patch:subject." . - -patch:Put - a rdfs:Class ; - rdfs:subClassOf patch:Request ; - rdfs:label "Put" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:subject - ] ; - rdfs:comment "A request to put the patch:body as the patch:subject." . - -patch:Request - a rdfs:Class ; - rdfs:label "Request" ; - rdfs:subClassOf patch:Message ; - rdfs:comment "A patch request message." . - -patch:Response - a rdfs:Class ; - rdfs:subClassOf patch:Message ; - rdfs:label "Response" ; - rdfs:comment "A response to a patch:Request." . - -patch:Set - a rdfs:Class ; - rdfs:label "Set" ; - rdfs:subClassOf patch:Request , - [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:property - ] , [ - a owl:Restriction ; - owl:cardinality 1 ; - owl:onProperty patch:value - ] ; - rdfs:comment "A compact request to set a property to a value." . - -patch:accept - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "accept" ; - rdfs:domain patch:Request ; - rdfs:range rdfs:Class ; - rdfs:comment "An accepted type for a response." . - -patch:add - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain patch:Patch ; - rdfs:range rdfs:Resource ; - rdfs:label "add" ; - rdfs:comment "The properties to add to the subject." . - -patch:body - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain patch:Message ; - rdfs:label "body" ; - rdfs:comment "The body of a message." . - -patch:context - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain patch:Message ; - rdfs:label "context" ; - rdfs:comment "The context of properties in this message." . - -patch:destination - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain patch:Message ; - rdfs:label "destination" ; - rdfs:comment "The destination to move the patch:subject to." . - -patch:property - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "property" ; - rdfs:domain patch:Message ; - rdfs:range rdf:Property ; - rdfs:comment "The property for a patch:Set or patch:Get message." . - -patch:readable - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "readable" ; - rdfs:range rdf:Property ; - rdfs:comment "A property that can be read with a patch:Get message." . - -patch:remove - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:label "remove" ; - rdfs:domain patch:Patch ; - rdfs:range rdfs:Resource ; - rdfs:comment "The properties to remove from the subject." . - -patch:request - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:label "request" ; - rdfs:domain patch:Response ; - rdfs:range patch:Request ; - rdfs:comment "The request this is a response to." . - -patch:sequenceNumber - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:label "sequence number" ; - rdfs:domain patch:Message ; - rdfs:range xsd:int ; - rdfs:comment "The sequence number of a request or response." . - -patch:subject - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain patch:Message ; - rdfs:label "subject" ; - rdfs:comment "The subject this message applies to." . - -patch:value - a rdf:Property ; - rdfs:label "value" ; - rdfs:domain patch:Set ; - rdfs:comment "The value of a property in a patch:Set message." . - -patch:wildcard - a owl:Thing ; - rdfs:label "wildcard" ; - rdfs:comment "A wildcard that matches any resource." . - -patch:writable - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "writable" ; - rdfs:range rdf:Property ; - rdfs:comment "A property that can be set with a patch:Set or patch:Patch message." . - diff --git a/lv2/port-groups.lv2/manifest.ttl b/lv2/port-groups.lv2/manifest.ttl new file mode 100644 index 0000000..a887cb0 --- /dev/null +++ b/lv2/port-groups.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/port-groups.lv2/port-groups.meta.ttl b/lv2/port-groups.lv2/port-groups.meta.ttl new file mode 100644 index 0000000..67408ec --- /dev/null +++ b/lv2/port-groups.lv2/port-groups.meta.ttl @@ -0,0 +1,144 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix pg: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 Port Groups" ; + doap:shortdesc "Multi-channel groups of LV2 ports." ; + doap:created "2008-00-00" ; + doap:developer , + ; + doap:release [ + doap:revision "1.4" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Replace broken links with detailed Ambisonic channel descriptions." + ] , [ + rdfs:label "Remove incorrect type of pg:letterCode." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] . + +pg:Group + lv2:documentation """ + +A group logically combines ports which should be considered part of the same +stream. For example, two audio ports in a group may form a stereo stream. + +Like ports, groups have a lv2:symbol that is unique within the context of the +plugin, where group symbols and port symbols reside in the same namespace. In +other words, a group on a plugin MUST NOT have the same symbol as any other +group or port on that plugin. This makes it possible to uniquely reference a +port or group on a plugin with a single identifier and no context. + +Group definitions may be shared across plugins for brevity. For example, a +plugin collection may define a single URI for a pg:StereoGroup with the symbol +"input" and use it in many plugins. + +"""^^lv2:Markdown . + +pg:sideChainOf + lv2:documentation """ + +Indicates that this port or group should be considered a "side chain" of some +other port or group. The precise definition of "side chain" depends on the +plugin, but in general this group should be considered a modifier to some other +group, rather than an independent input itself. + +"""^^lv2:Markdown . + +pg:subGroupOf + lv2:documentation """ + +Indicates that this group is a child of another group. This property has no +meaning with respect to plugin execution, but the host may find this +information useful to provide a better user interface. Note that being a +sub-group does not relax the restriction that the group MUST have a unique +symbol with respect to the plugin. + +"""^^lv2:Markdown . + +pg:source + lv2:documentation """ + +Indicates that this port or group should be considered the "result" of some +other port or group. This property only makes sense on groups with outputs +when the source is a group with inputs. This can be used to convey a +relationship between corresponding input and output groups with different +types, for example in a mono to stereo plugin. + +"""^^lv2:Markdown . + +pg:mainInput + lv2:documentation """ + +Indicates that this group should be considered the "main" input, i.e. the +primary task is processing the signal in this group. A plugin MUST NOT have +more than one pg:mainInput property. + +"""^^lv2:Markdown . + +pg:mainOutput + lv2:documentation """ + +Indicates that this group should be considered the "main" output. The main +output group SHOULD have the main input group as a pg:source. + +"""^^lv2:Markdown . + +pg:group + lv2:documentation """ + +Indicates that this port is a part of a group of ports on the plugin. The port +should also have an lv2:designation property to define its designation within +that group. + +"""^^lv2:Markdown . + +pg:DiscreteGroup + lv2:documentation """ + +These groups are divided into channels where each represents a particular +speaker location. The position of sound in one of these groups depends on a +particular speaker configuration. + +"""^^lv2:Markdown . + +pg:AmbisonicGroup + lv2:documentation """ + +These groups are divided into channels which together represent a position in +an abstract n-dimensional space. The position of sound in one of these groups +does not depend on a particular speaker configuration; a decoder can be used to +convert an ambisonic stream for any speaker configuration. + +"""^^lv2:Markdown . + diff --git a/lv2/port-groups.lv2/port-groups.ttl b/lv2/port-groups.lv2/port-groups.ttl new file mode 100644 index 0000000..2806821 --- /dev/null +++ b/lv2/port-groups.lv2/port-groups.ttl @@ -0,0 +1,808 @@ +@prefix lv2: . +@prefix owl: . +@prefix pg: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Port Groups" ; + rdfs:comment "Multi-channel groups of LV2 ports." ; + rdfs:seeAlso ; + owl:imports . + +pg:Group + a rdfs:Class ; + rdfs:label "Port Group" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:symbol ; + owl:cardinality 1 ; + rdfs:comment "A Group MUST have exactly one string lv2:symbol." + ] ; + rdfs:comment "A set of ports that are logically grouped together." . + +pg:InputGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Input Group" ; + rdfs:comment "A group which contains exclusively inputs." . + +pg:OutputGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Output Group" ; + rdfs:comment "A group which contains exclusively outputs." . + +pg:Element + a rdfs:Class ; + rdfs:label "Element" ; + rdfs:comment "An ordered element of a group." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:designation ; + owl:cardinality 1 ; + rdfs:comment "An element MUST have exactly one lv2:designation." + ] ; + rdfs:comment "An element of a group, with a designation and optional index." . + +pg:element + a rdf:Property , + owl:ObjectProperty ; + rdfs:range pg:Element ; + rdfs:label "element" ; + rdfs:comment "An element within a port group." . + +pg:sideChainOf + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "side-chain of" ; + rdfs:comment "Port or group is a side chain of another." . + +pg:subGroupOf + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain pg:Group ; + rdfs:range pg:Group ; + rdfs:label "sub-group of" ; + rdfs:comment "Group is a child of another group." . + +pg:source + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain pg:OutputGroup ; + rdfs:range pg:InputGroup ; + rdfs:label "source" ; + rdfs:comment "Port or group that this group is the output of." . + +pg:mainInput + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Plugin ; + rdfs:range pg:InputGroup ; + rdfs:label "main input" ; + rdfs:comment "Input group that is the primary input of the plugin." . + +pg:mainOutput + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Plugin ; + rdfs:range pg:OutputGroup ; + rdfs:label "main output" ; + rdfs:comment "Output group that is the primary output of the plugin." . + +pg:group + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Port ; + rdfs:range pg:Group ; + rdfs:label "group" ; + rdfs:comment "Group that this port is a part of." . + +pg:DiscreteGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Discrete Group" ; + rdfs:comment "A group of discrete channels." . + +pg:left + a lv2:Channel ; + rdfs:label "left" ; + rdfs:comment "The left channel of a stereo audio group." . + +pg:right + a lv2:Channel ; + rdfs:label "right" ; + rdfs:comment "The right channel of a stereo audio group." . + +pg:center + a lv2:Channel ; + rdfs:label "center" ; + rdfs:comment "The center channel of a discrete audio group." . + +pg:side + a lv2:Channel ; + rdfs:label "side" ; + rdfs:comment "The side channel of a mid-side audio group." . + +pg:centerLeft + a lv2:Channel ; + rdfs:label "center left" ; + rdfs:comment "The center-left channel of a 7.1 wide surround sound group." . + +pg:centerRight + a lv2:Channel ; + rdfs:label "center right" ; + rdfs:comment "The center-right channel of a 7.1 wide surround sound group." . + +pg:sideLeft + a lv2:Channel ; + rdfs:label "side left" ; + rdfs:comment "The side-left channel of a 6.1 or 7.1 surround sound group." . + +pg:sideRight + a lv2:Channel ; + rdfs:label "side right" ; + rdfs:comment "The side-right channel of a 6.1 or 7.1 surround sound group." . + +pg:rearLeft + a lv2:Channel ; + rdfs:label "rear left" ; + rdfs:comment "The rear-left channel of a surround sound group." . + +pg:rearRight + a lv2:Channel ; + rdfs:label "rear right" ; + rdfs:comment "The rear-right channel of a surround sound group." . + +pg:rearCenter + a lv2:Channel ; + rdfs:label "rear center" ; + rdfs:comment "The rear-center channel of a surround sound group." . + +pg:lowFrequencyEffects + a lv2:Channel ; + rdfs:label "low-frequency effects" ; + rdfs:comment "The LFE channel of a *.1 surround sound group." . + +pg:MonoGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "Mono" ; + rdfs:comment "A single channel audio group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:center + ] . + +pg:StereoGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "Stereo" ; + rdfs:comment "A 2-channel discrete stereo audio group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:right + ] . + +pg:MidSideGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "Mid-Side Stereo" ; + rdfs:comment "A 2-channel mid-side stereo audio group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:center + ] , [ + lv2:index 1 ; + lv2:designation pg:side + ] . + +pg:ThreePointZeroGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "3.0 Surround" ; + rdfs:comment "A 3.0 discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:right + ] , [ + lv2:index 2 ; + lv2:designation pg:rearCenter + ] . + +pg:FourPointZeroGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "4.0 Surround" ; + rdfs:comment "A 4.0 (Quadraphonic) discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:rearCenter + ] . + +pg:FivePointZeroGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "5.0 Surround" ; + rdfs:comment "A 5.0 (3-2 stereo) discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:rearRight + ] . + +pg:FivePointOneGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "5.1 Surround" ; + rdfs:comment "A 5.1 (3-2 stereo with sub) discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:rearRight + ] , [ + lv2:index 5 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:SixPointOneGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "6.1 Surround" ; + rdfs:comment "A 6.1 discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:sideLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:sideRight + ] , [ + lv2:index 5 ; + lv2:designation pg:rearCenter + ] , [ + lv2:index 6 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:SevenPointOneGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "7.1 Surround" ; + rdfs:comment "A 7.1 discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:sideLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:sideRight + ] , [ + lv2:index 5 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 6 ; + lv2:designation pg:rearRight + ] , [ + lv2:index 7 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:SevenPointOneWideGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "7.1 Surround (Wide)" ; + rdfs:comment "A 7.1 wide discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:centerLeft + ] , [ + lv2:index 2 ; + lv2:designation pg:center + ] , [ + lv2:index 3 ; + lv2:designation pg:centerRight + ] , [ + lv2:index 4 ; + lv2:designation pg:right + ] , [ + lv2:index 5 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 6 ; + lv2:designation pg:rearRight + ] , [ + lv2:index 7 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:letterCode + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Channel ; + rdfs:range rdf:PlainLiteral ; + rdfs:label "ambisonic letter code" ; + rdfs:comment "The YuMa letter code for an Ambisonic channel." . + +pg:harmonicDegree + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Channel ; + rdfs:range xsd:integer ; + rdfs:label "harmonic degree" ; + rdfs:comment "The degree coefficient (l) of the spherical harmonic for an Ambisonic channel." . + +pg:harmonicIndex + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Channel ; + rdfs:range xsd:integer ; + rdfs:label "harmonic index" ; + rdfs:comment "The index coefficient (m) of the spherical harmonic for an Ambisonic channel." . + +pg:ACN0 + a lv2:Channel ; + pg:letterCode "W" ; + pg:harmonicDegree 0 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN0" ; + rdfs:comment "Ambisonic channel 0 (W): degree 0, index 0." . + +pg:ACN1 + a lv2:Channel ; + pg:letterCode "Y" ; + pg:harmonicDegree 1 ; + pg:harmonicIndex -1 ; + rdfs:label "ACN1" ; + rdfs:comment "Ambisonic channel 1 (Y): degree 1, index -1." . + +pg:ACN2 + a lv2:Channel ; + pg:letterCode "Z" ; + pg:harmonicDegree 1 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN2" ; + rdfs:comment "Ambisonic channel 2 (Z): degree 1, index 0." . + +pg:ACN3 + a lv2:Channel ; + pg:letterCode "X" ; + pg:harmonicDegree 1 ; + pg:harmonicIndex 1 ; + rdfs:label "ACN3" ; + rdfs:comment "Ambisonic channel 3 (X): degree 1, index 1." . + +pg:ACN4 + a lv2:Channel ; + pg:letterCode "V" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex -2 ; + rdfs:label "ACN4" ; + rdfs:comment "Ambisonic channel 4 (V): degree 2, index -2." . + +pg:ACN5 + a lv2:Channel ; + pg:letterCode "T" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex -1 ; + rdfs:label "ACN5" ; + rdfs:comment "Ambisonic channel 5 (T): degree 2, index -1." . + +pg:ACN6 + a lv2:Channel ; + pg:letterCode "R" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN6" ; + rdfs:comment "Ambisonic channel 6 (R): degree 2, index 0." . + +pg:ACN7 + a lv2:Channel ; + pg:letterCode "S" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex 1 ; + rdfs:label "ACN7" ; + rdfs:comment "Ambisonic channel 7 (S): degree 2, index 1." . + +pg:ACN8 + a lv2:Channel ; + pg:letterCode "U" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex 2 ; + rdfs:label "ACN8" ; + rdfs:comment "Ambisonic channel 8 (U): degree 2, index 2." . + +pg:ACN9 + a lv2:Channel ; + pg:letterCode "Q" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex -3 ; + rdfs:label "ACN9" ; + rdfs:comment "Ambisonic channel 9 (Q): degree 3, index -3." . + +pg:ACN10 + a lv2:Channel ; + pg:letterCode "O" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex -2 ; + rdfs:label "ACN10" ; + rdfs:comment "Ambisonic channel 10 (O): degree 3, index -2." . + +pg:ACN11 + a lv2:Channel ; + pg:letterCode "M" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex -1 ; + rdfs:label "ACN11" ; + rdfs:comment "Ambisonic channel 11 (M): degree 3, index -1." . + +pg:ACN12 + a lv2:Channel ; + pg:letterCode "K" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN12" ; + rdfs:comment "Ambisonic channel 12 (K): degree 3, index 0." . + +pg:ACN13 + a lv2:Channel ; + pg:letterCode "L" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 1 ; + rdfs:label "ACN13" ; + rdfs:comment "Ambisonic channel 13 (L): degree 3, index 1." . + +pg:ACN14 + a lv2:Channel ; + pg:letterCode "N" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 2 ; + rdfs:label "ACN14" ; + rdfs:comment "Ambisonic channel 14 (N): degree 3, index 2." . + +pg:ACN15 + a lv2:Channel ; + pg:letterCode "P" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 3 ; + rdfs:label "ACN15" ; + rdfs:comment "Ambisonic channel 15 (P): degree 3, index 3." . + +pg:AmbisonicGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Ambisonic Group" ; + rdfs:comment "A group of Ambisonic channels." . + +pg:AmbisonicBH1P0Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH1P0" ; + rdfs:comment "Ambisonic B stream of horizontal order 1 and peripheral order 0." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN3 + ] . + +pg:AmbisonicBH1P1Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH1P1" ; + rdfs:comment "Ambisonic B stream of horizontal order 1 and peripheral order 1." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] . + +pg:AmbisonicBH2P0Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH2P0" ; + rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 0." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN8 + ] . + +pg:AmbisonicBH2P1Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH2P1" ; + rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 1." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN8 + ] . + +pg:AmbisonicBH2P2Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH2P2" ; + rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 2." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN5 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN6 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN7 + ] , [ + lv2:index 8 ; + lv2:designation pg:ACN8 + ] . + +pg:AmbisonicBH3P0Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P0" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 0." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN15 + ] . + +pg:AmbisonicBH3P1Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P1" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 1." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN15 + ] . + +pg:AmbisonicBH3P2Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P2" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 2." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN5 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN6 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN7 + ] , [ + lv2:index 8 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 9 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 10 ; + lv2:designation pg:ACN15 + ] . + +pg:AmbisonicBH3P3Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P3" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 3." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN5 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN6 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN7 + ] , [ + lv2:index 8 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 9 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 10 ; + lv2:designation pg:ACN10 + ] , [ + lv2:index 11 ; + lv2:designation pg:ACN11 + ] , [ + lv2:index 12 ; + lv2:designation pg:ACN12 + ] , [ + lv2:index 13 ; + lv2:designation pg:ACN13 + ] , [ + lv2:index 14 ; + lv2:designation pg:ACN14 + ] , [ + lv2:index 15 ; + lv2:designation pg:ACN15 + ] . + diff --git a/lv2/port-groups/manifest.ttl b/lv2/port-groups/manifest.ttl deleted file mode 100644 index a887cb0..0000000 --- a/lv2/port-groups/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/port-groups/meson.build b/lv2/port-groups/meson.build deleted file mode 100644 index 816109f..0000000 --- a/lv2/port-groups/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'port-groups' -path = 'ns' / 'ext' / 'port-groups' - -port_groups_data = files( - 'port-groups.meta.ttl', - 'port-groups.ttl', - 'manifest.ttl', -) - -headers = files( - 'port-groups.h', -) - -# Install specification bundle -install_data(port_groups_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_port_groups_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('port-groups.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/port-groups/port-groups.h b/lv2/port-groups/port-groups.h deleted file mode 100644 index 0ff25c7..0000000 --- a/lv2/port-groups/port-groups.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_PORT_GROUPS_H -#define LV2_PORT_GROUPS_H - -/** - @defgroup port-groups Port Groups - @ingroup lv2 - - Multi-channel groups of LV2 ports. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_PORT_GROUPS_URI "http://lv2plug.in/ns/ext/port-groups" ///< http://lv2plug.in/ns/ext/port-groups -#define LV2_PORT_GROUPS_PREFIX LV2_PORT_GROUPS_URI "#" ///< http://lv2plug.in/ns/ext/port-groups# - -#define LV2_PORT_GROUPS__DiscreteGroup LV2_PORT_GROUPS_PREFIX "DiscreteGroup" ///< http://lv2plug.in/ns/ext/port-groups#DiscreteGroup -#define LV2_PORT_GROUPS__Element LV2_PORT_GROUPS_PREFIX "Element" ///< http://lv2plug.in/ns/ext/port-groups#Element -#define LV2_PORT_GROUPS__FivePointOneGroup LV2_PORT_GROUPS_PREFIX "FivePointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#FivePointOneGroup -#define LV2_PORT_GROUPS__FivePointZeroGroup LV2_PORT_GROUPS_PREFIX "FivePointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#FivePointZeroGroup -#define LV2_PORT_GROUPS__FourPointZeroGroup LV2_PORT_GROUPS_PREFIX "FourPointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#FourPointZeroGroup -#define LV2_PORT_GROUPS__Group LV2_PORT_GROUPS_PREFIX "Group" ///< http://lv2plug.in/ns/ext/port-groups#Group -#define LV2_PORT_GROUPS__InputGroup LV2_PORT_GROUPS_PREFIX "InputGroup" ///< http://lv2plug.in/ns/ext/port-groups#InputGroup -#define LV2_PORT_GROUPS__MidSideGroup LV2_PORT_GROUPS_PREFIX "MidSideGroup" ///< http://lv2plug.in/ns/ext/port-groups#MidSideGroup -#define LV2_PORT_GROUPS__MonoGroup LV2_PORT_GROUPS_PREFIX "MonoGroup" ///< http://lv2plug.in/ns/ext/port-groups#MonoGroup -#define LV2_PORT_GROUPS__OutputGroup LV2_PORT_GROUPS_PREFIX "OutputGroup" ///< http://lv2plug.in/ns/ext/port-groups#OutputGroup -#define LV2_PORT_GROUPS__SevenPointOneGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#SevenPointOneGroup -#define LV2_PORT_GROUPS__SevenPointOneWideGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneWideGroup" ///< http://lv2plug.in/ns/ext/port-groups#SevenPointOneWideGroup -#define LV2_PORT_GROUPS__SixPointOneGroup LV2_PORT_GROUPS_PREFIX "SixPointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#SixPointOneGroup -#define LV2_PORT_GROUPS__StereoGroup LV2_PORT_GROUPS_PREFIX "StereoGroup" ///< http://lv2plug.in/ns/ext/port-groups#StereoGroup -#define LV2_PORT_GROUPS__ThreePointZeroGroup LV2_PORT_GROUPS_PREFIX "ThreePointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#ThreePointZeroGroup -#define LV2_PORT_GROUPS__center LV2_PORT_GROUPS_PREFIX "center" ///< http://lv2plug.in/ns/ext/port-groups#center -#define LV2_PORT_GROUPS__centerLeft LV2_PORT_GROUPS_PREFIX "centerLeft" ///< http://lv2plug.in/ns/ext/port-groups#centerLeft -#define LV2_PORT_GROUPS__centerRight LV2_PORT_GROUPS_PREFIX "centerRight" ///< http://lv2plug.in/ns/ext/port-groups#centerRight -#define LV2_PORT_GROUPS__element LV2_PORT_GROUPS_PREFIX "element" ///< http://lv2plug.in/ns/ext/port-groups#element -#define LV2_PORT_GROUPS__group LV2_PORT_GROUPS_PREFIX "group" ///< http://lv2plug.in/ns/ext/port-groups#group -#define LV2_PORT_GROUPS__left LV2_PORT_GROUPS_PREFIX "left" ///< http://lv2plug.in/ns/ext/port-groups#left -#define LV2_PORT_GROUPS__lowFrequencyEffects LV2_PORT_GROUPS_PREFIX "lowFrequencyEffects" ///< http://lv2plug.in/ns/ext/port-groups#lowFrequencyEffects -#define LV2_PORT_GROUPS__mainInput LV2_PORT_GROUPS_PREFIX "mainInput" ///< http://lv2plug.in/ns/ext/port-groups#mainInput -#define LV2_PORT_GROUPS__mainOutput LV2_PORT_GROUPS_PREFIX "mainOutput" ///< http://lv2plug.in/ns/ext/port-groups#mainOutput -#define LV2_PORT_GROUPS__rearCenter LV2_PORT_GROUPS_PREFIX "rearCenter" ///< http://lv2plug.in/ns/ext/port-groups#rearCenter -#define LV2_PORT_GROUPS__rearLeft LV2_PORT_GROUPS_PREFIX "rearLeft" ///< http://lv2plug.in/ns/ext/port-groups#rearLeft -#define LV2_PORT_GROUPS__rearRight LV2_PORT_GROUPS_PREFIX "rearRight" ///< http://lv2plug.in/ns/ext/port-groups#rearRight -#define LV2_PORT_GROUPS__right LV2_PORT_GROUPS_PREFIX "right" ///< http://lv2plug.in/ns/ext/port-groups#right -#define LV2_PORT_GROUPS__side LV2_PORT_GROUPS_PREFIX "side" ///< http://lv2plug.in/ns/ext/port-groups#side -#define LV2_PORT_GROUPS__sideChainOf LV2_PORT_GROUPS_PREFIX "sideChainOf" ///< http://lv2plug.in/ns/ext/port-groups#sideChainOf -#define LV2_PORT_GROUPS__sideLeft LV2_PORT_GROUPS_PREFIX "sideLeft" ///< http://lv2plug.in/ns/ext/port-groups#sideLeft -#define LV2_PORT_GROUPS__sideRight LV2_PORT_GROUPS_PREFIX "sideRight" ///< http://lv2plug.in/ns/ext/port-groups#sideRight -#define LV2_PORT_GROUPS__source LV2_PORT_GROUPS_PREFIX "source" ///< http://lv2plug.in/ns/ext/port-groups#source -#define LV2_PORT_GROUPS__subGroupOf LV2_PORT_GROUPS_PREFIX "subGroupOf" ///< http://lv2plug.in/ns/ext/port-groups#subGroupOf - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_PORT_GROUPS_H */ diff --git a/lv2/port-groups/port-groups.meta.ttl b/lv2/port-groups/port-groups.meta.ttl deleted file mode 100644 index 67408ec..0000000 --- a/lv2/port-groups/port-groups.meta.ttl +++ /dev/null @@ -1,144 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix pg: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 Port Groups" ; - doap:shortdesc "Multi-channel groups of LV2 ports." ; - doap:created "2008-00-00" ; - doap:developer , - ; - doap:release [ - doap:revision "1.4" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Replace broken links with detailed Ambisonic channel descriptions." - ] , [ - rdfs:label "Remove incorrect type of pg:letterCode." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] . - -pg:Group - lv2:documentation """ - -A group logically combines ports which should be considered part of the same -stream. For example, two audio ports in a group may form a stereo stream. - -Like ports, groups have a lv2:symbol that is unique within the context of the -plugin, where group symbols and port symbols reside in the same namespace. In -other words, a group on a plugin MUST NOT have the same symbol as any other -group or port on that plugin. This makes it possible to uniquely reference a -port or group on a plugin with a single identifier and no context. - -Group definitions may be shared across plugins for brevity. For example, a -plugin collection may define a single URI for a pg:StereoGroup with the symbol -"input" and use it in many plugins. - -"""^^lv2:Markdown . - -pg:sideChainOf - lv2:documentation """ - -Indicates that this port or group should be considered a "side chain" of some -other port or group. The precise definition of "side chain" depends on the -plugin, but in general this group should be considered a modifier to some other -group, rather than an independent input itself. - -"""^^lv2:Markdown . - -pg:subGroupOf - lv2:documentation """ - -Indicates that this group is a child of another group. This property has no -meaning with respect to plugin execution, but the host may find this -information useful to provide a better user interface. Note that being a -sub-group does not relax the restriction that the group MUST have a unique -symbol with respect to the plugin. - -"""^^lv2:Markdown . - -pg:source - lv2:documentation """ - -Indicates that this port or group should be considered the "result" of some -other port or group. This property only makes sense on groups with outputs -when the source is a group with inputs. This can be used to convey a -relationship between corresponding input and output groups with different -types, for example in a mono to stereo plugin. - -"""^^lv2:Markdown . - -pg:mainInput - lv2:documentation """ - -Indicates that this group should be considered the "main" input, i.e. the -primary task is processing the signal in this group. A plugin MUST NOT have -more than one pg:mainInput property. - -"""^^lv2:Markdown . - -pg:mainOutput - lv2:documentation """ - -Indicates that this group should be considered the "main" output. The main -output group SHOULD have the main input group as a pg:source. - -"""^^lv2:Markdown . - -pg:group - lv2:documentation """ - -Indicates that this port is a part of a group of ports on the plugin. The port -should also have an lv2:designation property to define its designation within -that group. - -"""^^lv2:Markdown . - -pg:DiscreteGroup - lv2:documentation """ - -These groups are divided into channels where each represents a particular -speaker location. The position of sound in one of these groups depends on a -particular speaker configuration. - -"""^^lv2:Markdown . - -pg:AmbisonicGroup - lv2:documentation """ - -These groups are divided into channels which together represent a position in -an abstract n-dimensional space. The position of sound in one of these groups -does not depend on a particular speaker configuration; a decoder can be used to -convert an ambisonic stream for any speaker configuration. - -"""^^lv2:Markdown . - diff --git a/lv2/port-groups/port-groups.ttl b/lv2/port-groups/port-groups.ttl deleted file mode 100644 index 2806821..0000000 --- a/lv2/port-groups/port-groups.ttl +++ /dev/null @@ -1,808 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix pg: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Port Groups" ; - rdfs:comment "Multi-channel groups of LV2 ports." ; - rdfs:seeAlso ; - owl:imports . - -pg:Group - a rdfs:Class ; - rdfs:label "Port Group" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty lv2:symbol ; - owl:cardinality 1 ; - rdfs:comment "A Group MUST have exactly one string lv2:symbol." - ] ; - rdfs:comment "A set of ports that are logically grouped together." . - -pg:InputGroup - a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:label "Input Group" ; - rdfs:comment "A group which contains exclusively inputs." . - -pg:OutputGroup - a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:label "Output Group" ; - rdfs:comment "A group which contains exclusively outputs." . - -pg:Element - a rdfs:Class ; - rdfs:label "Element" ; - rdfs:comment "An ordered element of a group." ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty lv2:designation ; - owl:cardinality 1 ; - rdfs:comment "An element MUST have exactly one lv2:designation." - ] ; - rdfs:comment "An element of a group, with a designation and optional index." . - -pg:element - a rdf:Property , - owl:ObjectProperty ; - rdfs:range pg:Element ; - rdfs:label "element" ; - rdfs:comment "An element within a port group." . - -pg:sideChainOf - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "side-chain of" ; - rdfs:comment "Port or group is a side chain of another." . - -pg:subGroupOf - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain pg:Group ; - rdfs:range pg:Group ; - rdfs:label "sub-group of" ; - rdfs:comment "Group is a child of another group." . - -pg:source - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain pg:OutputGroup ; - rdfs:range pg:InputGroup ; - rdfs:label "source" ; - rdfs:comment "Port or group that this group is the output of." . - -pg:mainInput - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain lv2:Plugin ; - rdfs:range pg:InputGroup ; - rdfs:label "main input" ; - rdfs:comment "Input group that is the primary input of the plugin." . - -pg:mainOutput - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain lv2:Plugin ; - rdfs:range pg:OutputGroup ; - rdfs:label "main output" ; - rdfs:comment "Output group that is the primary output of the plugin." . - -pg:group - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain lv2:Port ; - rdfs:range pg:Group ; - rdfs:label "group" ; - rdfs:comment "Group that this port is a part of." . - -pg:DiscreteGroup - a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:label "Discrete Group" ; - rdfs:comment "A group of discrete channels." . - -pg:left - a lv2:Channel ; - rdfs:label "left" ; - rdfs:comment "The left channel of a stereo audio group." . - -pg:right - a lv2:Channel ; - rdfs:label "right" ; - rdfs:comment "The right channel of a stereo audio group." . - -pg:center - a lv2:Channel ; - rdfs:label "center" ; - rdfs:comment "The center channel of a discrete audio group." . - -pg:side - a lv2:Channel ; - rdfs:label "side" ; - rdfs:comment "The side channel of a mid-side audio group." . - -pg:centerLeft - a lv2:Channel ; - rdfs:label "center left" ; - rdfs:comment "The center-left channel of a 7.1 wide surround sound group." . - -pg:centerRight - a lv2:Channel ; - rdfs:label "center right" ; - rdfs:comment "The center-right channel of a 7.1 wide surround sound group." . - -pg:sideLeft - a lv2:Channel ; - rdfs:label "side left" ; - rdfs:comment "The side-left channel of a 6.1 or 7.1 surround sound group." . - -pg:sideRight - a lv2:Channel ; - rdfs:label "side right" ; - rdfs:comment "The side-right channel of a 6.1 or 7.1 surround sound group." . - -pg:rearLeft - a lv2:Channel ; - rdfs:label "rear left" ; - rdfs:comment "The rear-left channel of a surround sound group." . - -pg:rearRight - a lv2:Channel ; - rdfs:label "rear right" ; - rdfs:comment "The rear-right channel of a surround sound group." . - -pg:rearCenter - a lv2:Channel ; - rdfs:label "rear center" ; - rdfs:comment "The rear-center channel of a surround sound group." . - -pg:lowFrequencyEffects - a lv2:Channel ; - rdfs:label "low-frequency effects" ; - rdfs:comment "The LFE channel of a *.1 surround sound group." . - -pg:MonoGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "Mono" ; - rdfs:comment "A single channel audio group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:center - ] . - -pg:StereoGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "Stereo" ; - rdfs:comment "A 2-channel discrete stereo audio group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:right - ] . - -pg:MidSideGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "Mid-Side Stereo" ; - rdfs:comment "A 2-channel mid-side stereo audio group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:center - ] , [ - lv2:index 1 ; - lv2:designation pg:side - ] . - -pg:ThreePointZeroGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "3.0 Surround" ; - rdfs:comment "A 3.0 discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:right - ] , [ - lv2:index 2 ; - lv2:designation pg:rearCenter - ] . - -pg:FourPointZeroGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "4.0 Surround" ; - rdfs:comment "A 4.0 (Quadraphonic) discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:center - ] , [ - lv2:index 2 ; - lv2:designation pg:right - ] , [ - lv2:index 3 ; - lv2:designation pg:rearCenter - ] . - -pg:FivePointZeroGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "5.0 Surround" ; - rdfs:comment "A 5.0 (3-2 stereo) discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:center - ] , [ - lv2:index 2 ; - lv2:designation pg:right - ] , [ - lv2:index 3 ; - lv2:designation pg:rearLeft - ] , [ - lv2:index 4 ; - lv2:designation pg:rearRight - ] . - -pg:FivePointOneGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "5.1 Surround" ; - rdfs:comment "A 5.1 (3-2 stereo with sub) discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:center - ] , [ - lv2:index 2 ; - lv2:designation pg:right - ] , [ - lv2:index 3 ; - lv2:designation pg:rearLeft - ] , [ - lv2:index 4 ; - lv2:designation pg:rearRight - ] , [ - lv2:index 5 ; - lv2:designation pg:lowFrequencyEffects - ] . - -pg:SixPointOneGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "6.1 Surround" ; - rdfs:comment "A 6.1 discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:center - ] , [ - lv2:index 2 ; - lv2:designation pg:right - ] , [ - lv2:index 3 ; - lv2:designation pg:sideLeft - ] , [ - lv2:index 4 ; - lv2:designation pg:sideRight - ] , [ - lv2:index 5 ; - lv2:designation pg:rearCenter - ] , [ - lv2:index 6 ; - lv2:designation pg:lowFrequencyEffects - ] . - -pg:SevenPointOneGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "7.1 Surround" ; - rdfs:comment "A 7.1 discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:center - ] , [ - lv2:index 2 ; - lv2:designation pg:right - ] , [ - lv2:index 3 ; - lv2:designation pg:sideLeft - ] , [ - lv2:index 4 ; - lv2:designation pg:sideRight - ] , [ - lv2:index 5 ; - lv2:designation pg:rearLeft - ] , [ - lv2:index 6 ; - lv2:designation pg:rearRight - ] , [ - lv2:index 7 ; - lv2:designation pg:lowFrequencyEffects - ] . - -pg:SevenPointOneWideGroup - a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "7.1 Surround (Wide)" ; - rdfs:comment "A 7.1 wide discrete surround sound group." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:left - ] , [ - lv2:index 1 ; - lv2:designation pg:centerLeft - ] , [ - lv2:index 2 ; - lv2:designation pg:center - ] , [ - lv2:index 3 ; - lv2:designation pg:centerRight - ] , [ - lv2:index 4 ; - lv2:designation pg:right - ] , [ - lv2:index 5 ; - lv2:designation pg:rearLeft - ] , [ - lv2:index 6 ; - lv2:designation pg:rearRight - ] , [ - lv2:index 7 ; - lv2:designation pg:lowFrequencyEffects - ] . - -pg:letterCode - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain lv2:Channel ; - rdfs:range rdf:PlainLiteral ; - rdfs:label "ambisonic letter code" ; - rdfs:comment "The YuMa letter code for an Ambisonic channel." . - -pg:harmonicDegree - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain lv2:Channel ; - rdfs:range xsd:integer ; - rdfs:label "harmonic degree" ; - rdfs:comment "The degree coefficient (l) of the spherical harmonic for an Ambisonic channel." . - -pg:harmonicIndex - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain lv2:Channel ; - rdfs:range xsd:integer ; - rdfs:label "harmonic index" ; - rdfs:comment "The index coefficient (m) of the spherical harmonic for an Ambisonic channel." . - -pg:ACN0 - a lv2:Channel ; - pg:letterCode "W" ; - pg:harmonicDegree 0 ; - pg:harmonicIndex 0 ; - rdfs:label "ACN0" ; - rdfs:comment "Ambisonic channel 0 (W): degree 0, index 0." . - -pg:ACN1 - a lv2:Channel ; - pg:letterCode "Y" ; - pg:harmonicDegree 1 ; - pg:harmonicIndex -1 ; - rdfs:label "ACN1" ; - rdfs:comment "Ambisonic channel 1 (Y): degree 1, index -1." . - -pg:ACN2 - a lv2:Channel ; - pg:letterCode "Z" ; - pg:harmonicDegree 1 ; - pg:harmonicIndex 0 ; - rdfs:label "ACN2" ; - rdfs:comment "Ambisonic channel 2 (Z): degree 1, index 0." . - -pg:ACN3 - a lv2:Channel ; - pg:letterCode "X" ; - pg:harmonicDegree 1 ; - pg:harmonicIndex 1 ; - rdfs:label "ACN3" ; - rdfs:comment "Ambisonic channel 3 (X): degree 1, index 1." . - -pg:ACN4 - a lv2:Channel ; - pg:letterCode "V" ; - pg:harmonicDegree 2 ; - pg:harmonicIndex -2 ; - rdfs:label "ACN4" ; - rdfs:comment "Ambisonic channel 4 (V): degree 2, index -2." . - -pg:ACN5 - a lv2:Channel ; - pg:letterCode "T" ; - pg:harmonicDegree 2 ; - pg:harmonicIndex -1 ; - rdfs:label "ACN5" ; - rdfs:comment "Ambisonic channel 5 (T): degree 2, index -1." . - -pg:ACN6 - a lv2:Channel ; - pg:letterCode "R" ; - pg:harmonicDegree 2 ; - pg:harmonicIndex 0 ; - rdfs:label "ACN6" ; - rdfs:comment "Ambisonic channel 6 (R): degree 2, index 0." . - -pg:ACN7 - a lv2:Channel ; - pg:letterCode "S" ; - pg:harmonicDegree 2 ; - pg:harmonicIndex 1 ; - rdfs:label "ACN7" ; - rdfs:comment "Ambisonic channel 7 (S): degree 2, index 1." . - -pg:ACN8 - a lv2:Channel ; - pg:letterCode "U" ; - pg:harmonicDegree 2 ; - pg:harmonicIndex 2 ; - rdfs:label "ACN8" ; - rdfs:comment "Ambisonic channel 8 (U): degree 2, index 2." . - -pg:ACN9 - a lv2:Channel ; - pg:letterCode "Q" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex -3 ; - rdfs:label "ACN9" ; - rdfs:comment "Ambisonic channel 9 (Q): degree 3, index -3." . - -pg:ACN10 - a lv2:Channel ; - pg:letterCode "O" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex -2 ; - rdfs:label "ACN10" ; - rdfs:comment "Ambisonic channel 10 (O): degree 3, index -2." . - -pg:ACN11 - a lv2:Channel ; - pg:letterCode "M" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex -1 ; - rdfs:label "ACN11" ; - rdfs:comment "Ambisonic channel 11 (M): degree 3, index -1." . - -pg:ACN12 - a lv2:Channel ; - pg:letterCode "K" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex 0 ; - rdfs:label "ACN12" ; - rdfs:comment "Ambisonic channel 12 (K): degree 3, index 0." . - -pg:ACN13 - a lv2:Channel ; - pg:letterCode "L" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex 1 ; - rdfs:label "ACN13" ; - rdfs:comment "Ambisonic channel 13 (L): degree 3, index 1." . - -pg:ACN14 - a lv2:Channel ; - pg:letterCode "N" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex 2 ; - rdfs:label "ACN14" ; - rdfs:comment "Ambisonic channel 14 (N): degree 3, index 2." . - -pg:ACN15 - a lv2:Channel ; - pg:letterCode "P" ; - pg:harmonicDegree 3 ; - pg:harmonicIndex 3 ; - rdfs:label "ACN15" ; - rdfs:comment "Ambisonic channel 15 (P): degree 3, index 3." . - -pg:AmbisonicGroup - a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:label "Ambisonic Group" ; - rdfs:comment "A group of Ambisonic channels." . - -pg:AmbisonicBH1P0Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH1P0" ; - rdfs:comment "Ambisonic B stream of horizontal order 1 and peripheral order 0." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN3 - ] . - -pg:AmbisonicBH1P1Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH1P1" ; - rdfs:comment "Ambisonic B stream of horizontal order 1 and peripheral order 1." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN2 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN3 - ] . - -pg:AmbisonicBH2P0Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH2P0" ; - rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 0." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN8 - ] . - -pg:AmbisonicBH2P1Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH2P1" ; - rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 1." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN2 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 5 ; - lv2:designation pg:ACN8 - ] . - -pg:AmbisonicBH2P2Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH2P2" ; - rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 2." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN2 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 5 ; - lv2:designation pg:ACN5 - ] , [ - lv2:index 6 ; - lv2:designation pg:ACN6 - ] , [ - lv2:index 7 ; - lv2:designation pg:ACN7 - ] , [ - lv2:index 8 ; - lv2:designation pg:ACN8 - ] . - -pg:AmbisonicBH3P0Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH3P0" ; - rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 0." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN8 - ] , [ - lv2:index 5 ; - lv2:designation pg:ACN9 - ] , [ - lv2:index 6 ; - lv2:designation pg:ACN15 - ] . - -pg:AmbisonicBH3P1Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH3P1" ; - rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 1." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN2 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 5 ; - lv2:designation pg:ACN8 - ] , [ - lv2:index 6 ; - lv2:designation pg:ACN9 - ] , [ - lv2:index 7 ; - lv2:designation pg:ACN15 - ] . - -pg:AmbisonicBH3P2Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH3P2" ; - rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 2." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN2 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 5 ; - lv2:designation pg:ACN5 - ] , [ - lv2:index 6 ; - lv2:designation pg:ACN6 - ] , [ - lv2:index 7 ; - lv2:designation pg:ACN7 - ] , [ - lv2:index 8 ; - lv2:designation pg:ACN8 - ] , [ - lv2:index 9 ; - lv2:designation pg:ACN9 - ] , [ - lv2:index 10 ; - lv2:designation pg:ACN15 - ] . - -pg:AmbisonicBH3P3Group - a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic BH3P3" ; - rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 3." ; - pg:element [ - lv2:index 0 ; - lv2:designation pg:ACN0 - ] , [ - lv2:index 1 ; - lv2:designation pg:ACN1 - ] , [ - lv2:index 2 ; - lv2:designation pg:ACN2 - ] , [ - lv2:index 3 ; - lv2:designation pg:ACN3 - ] , [ - lv2:index 4 ; - lv2:designation pg:ACN4 - ] , [ - lv2:index 5 ; - lv2:designation pg:ACN5 - ] , [ - lv2:index 6 ; - lv2:designation pg:ACN6 - ] , [ - lv2:index 7 ; - lv2:designation pg:ACN7 - ] , [ - lv2:index 8 ; - lv2:designation pg:ACN8 - ] , [ - lv2:index 9 ; - lv2:designation pg:ACN9 - ] , [ - lv2:index 10 ; - lv2:designation pg:ACN10 - ] , [ - lv2:index 11 ; - lv2:designation pg:ACN11 - ] , [ - lv2:index 12 ; - lv2:designation pg:ACN12 - ] , [ - lv2:index 13 ; - lv2:designation pg:ACN13 - ] , [ - lv2:index 14 ; - lv2:designation pg:ACN14 - ] , [ - lv2:index 15 ; - lv2:designation pg:ACN15 - ] . - diff --git a/lv2/port-props.lv2/manifest.ttl b/lv2/port-props.lv2/manifest.ttl new file mode 100644 index 0000000..45f598d --- /dev/null +++ b/lv2/port-props.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 2 ; + rdfs:seeAlso . + diff --git a/lv2/port-props.lv2/port-props.meta.ttl b/lv2/port-props.lv2/port-props.meta.ttl new file mode 100644 index 0000000..7077e4b --- /dev/null +++ b/lv2/port-props.lv2/port-props.meta.ttl @@ -0,0 +1,202 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix pprops: . +@prefix rdf: . +@prefix rdfs: . + + + a doap:Project ; + doap:name "LV2 Port Properties" ; + doap:created "2009-01-01" ; + doap:shortdesc "Various properties for LV2 plugin ports." ; + doap:maintainer ; + doap:developer ; + doap:release [ + doap:revision "1.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This vocabulary defines various properties for plugin ports, which can be used +to better describe how a plugin can be controlled. Using this metadata, hosts +can build better UIs for plugins, and provide more advanced automatic +functionality. + +"""^^lv2:Markdown . + +pprops:trigger + lv2:documentation """ + +Indicates that the data item corresponds to a momentary event that has been +detected (control output ports) or is to be triggered (control input ports). +For input ports, the port needs to be reset to lv2:default value after run() +function of the plugin has returned. If the control port is assigned a GUI +widget by the host, the widget should be of auto-off (momentary, one-shot) type +- for example, a push button if the port is also declared as lv2:toggled, or a +series of push button or auto-clear input box with a "Send" button if the port +is also lv2:integer. + +"""^^lv2:Markdown . + +pprops:supportsStrictBounds + lv2:documentation """ + +Indicates use of host support for pprops:hasStrictBounds port property. A +plugin that specifies it as optional feature can omit value clamping for +hasStrictBounds ports, if the feature is supported by the host. When specified +as required feature, it indicates that the plugin does not do any clamping for +input ports that have a pprops:hasStrictBounds property. + +"""^^lv2:Markdown . + +pprops:hasStrictBounds + lv2:documentation """ + +For hosts that support pprops:supportsStrictBounds, this indicates that the +value of the port should never exceed the port's minimum and maximum control +points. For input ports, it moves the responsibility for limiting the range of +values to host, if it supports pprops:supportsStrictBounds. For output ports, +it indicates that values within specified range are to be expected, and +breaking that should be considered by the host as error in plugin +implementation. + +"""^^lv2:Markdown . + +pprops:expensive + lv2:documentation """ + +Input ports only. Indicates that any changes to the port value may trigger +expensive background calculation (for example, regeneration of lookup tables in +a background thread). Any value changes may have not have immediate effect, or +may cause silence or diminished-quality version of the output until background +processing is finished. Ports having this property are typically not well +suited for connection to outputs of other plugins, and should not be offered as +connection targets or for automation by default. + +"""^^lv2:Markdown . + +pprops:causesArtifacts + lv2:documentation """ + +Input ports only. Indicates that any changes to the port value may produce +slight artifacts to produced audio signals (zipper noise and other results of +signal discontinuities). Connecting ports of this type to continuous signals +is not recommended, and when presenting a list of automation targets, those +ports may be marked as artifact-producing. + +"""^^lv2:Markdown . + +pprops:continuousCV + lv2:documentation """ + +Indicates that the port carries a "smooth" modulation signal. Control input +ports of this type are well-suited for being connected to sources of smooth +signals (knobs with smoothing, modulation rate oscillators, output ports with +continuousCV type, etc.). Typically, the plugin with ports which have this +property will implement appropriate smoothing to avoid audio artifacts. For +output ports, this property suggests the value of the port is likely to change +frequently, and describes a smooth signal (so successive values may be +considered points along a curve). + +"""^^lv2:Markdown . + +pprops:discreteCV + lv2:documentation """ + +Indicates that the port carries a "discrete" modulation signal. Input ports of +this type are well-suited for being connected to sources of discrete signals +(switches, buttons, classifiers, event detectors, etc.). May be combined with +pprops:trigger property. For output ports, this property suggests the value of +the port describe discrete values that should be interpreted as steps (and not +points along a curve). + +"""^^lv2:Markdown . + +pprops:logarithmic + lv2:documentation """ + +Indicates that port value behaviour within specified range (bounds) is a value +using logarithmic scale. The lower and upper bounds must be specified, and +must be of the same sign. + +"""^^lv2:Markdown . + +pprops:notAutomatic + lv2:documentation """ + +Indicates that the port is not primarily intended to be fed with modulation +signals from external sources (other plugins, etc.). It is merely a UI hint +and hosts may allow the user to override it. + +"""^^lv2:Markdown . + +pprops:notOnGUI + lv2:documentation """ + +Indicates that the port is not primarily intended to be represented by a +separate control in the user interface window (or any similar mechanism used +for direct, immediate control of control ports). It is merely a UI hint and +hosts may allow the user to override it. + +"""^^lv2:Markdown . + +pprops:displayPriority + lv2:documentation """ + +Indicates how important a port is to controlling the plugin. If a host can +only display some ports of a plugin, it should prefer ports with a higher +display priority. Priorities do not need to be unique, and are only meaningful +when compared to each other. + +"""^^lv2:Markdown . + +pprops:rangeSteps + lv2:documentation """ + +This value indicates into how many evenly-divided points the (control) port +range should be divided for step-wise control. This may be used for changing +the value with step-based controllers like arrow keys, mouse wheel, rotary +encoders, and so on. + +Note that when used with a pprops:logarithmic port, the steps are logarithmic +too, and port value can be calculated as: + + :::c + value = lower * pow(upper / lower, step / (steps - 1)) + +and the step from value is: + + :::c + step = (steps - 1) * log(value / lower) / log(upper / lower) + +where: + + * `value` is the port value. + + * `step` is the step number (0..steps). + + * `steps` is the number of steps (= value of :rangeSteps property). + + * `lower` and upper are the bounds. + +"""^^lv2:Markdown . + diff --git a/lv2/port-props.lv2/port-props.ttl b/lv2/port-props.lv2/port-props.ttl new file mode 100644 index 0000000..ea25c6b --- /dev/null +++ b/lv2/port-props.lv2/port-props.ttl @@ -0,0 +1,80 @@ +@prefix lv2: . +@prefix owl: . +@prefix pprops: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Port Properties" ; + rdfs:comment "Various properties for LV2 plugin ports." ; + rdfs:seeAlso ; + owl:imports . + +pprops:trigger + a lv2:PortProperty ; + rdfs:label "trigger" ; + rdfs:comment "Port is a momentary trigger." . + +pprops:supportsStrictBounds + a lv2:Feature ; + rdfs:label "supports strict bounds" ; + rdfs:comment "A feature indicating plugin support for strict port bounds." . + +pprops:hasStrictBounds + a lv2:PortProperty ; + rdfs:label "has strict bounds" ; + rdfs:comment "Port has strict bounds which are not internally clamped." . + +pprops:expensive + a lv2:PortProperty ; + rdfs:label "changes are expensive" ; + rdfs:comment "Input port is expensive to change." . + +pprops:causesArtifacts + a lv2:PortProperty ; + rdfs:label "changes cause artifacts" ; + rdfs:comment "Input port causes audible artifacts when changed." . + +pprops:continuousCV + a lv2:PortProperty ; + rdfs:label "smooth modulation signal" ; + rdfs:comment "Port carries a smooth modulation signal." . + +pprops:discreteCV + a lv2:PortProperty ; + rdfs:label "discrete modulation signal" ; + rdfs:comment "Port carries a discrete modulation signal." . + +pprops:logarithmic + a lv2:PortProperty ; + rdfs:label "logarithmic" ; + rdfs:comment "Port value is logarithmic." . + +pprops:notAutomatic + a lv2:PortProperty ; + rdfs:label "not automatic" ; + rdfs:comment "Port that is not intended to be fed with a modulation signal." . + +pprops:notOnGUI + a lv2:PortProperty ; + rdfs:label "not on GUI" ; + rdfs:comment "Port that should not be displayed on a GUI." . + +pprops:displayPriority + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Port ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "display priority" ; + rdfs:comment "A priority ranking this port in importance to its plugin." . + +pprops:rangeSteps + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Port ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "range steps" ; + rdfs:comment "The number of even steps the range should be divided into." . + diff --git a/lv2/port-props/manifest.ttl b/lv2/port-props/manifest.ttl deleted file mode 100644 index 45f598d..0000000 --- a/lv2/port-props/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 2 ; - rdfs:seeAlso . - diff --git a/lv2/port-props/meson.build b/lv2/port-props/meson.build deleted file mode 100644 index 900b637..0000000 --- a/lv2/port-props/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'port-props' -path = 'ns' / 'ext' / 'port-props' - -port_props_data = files( - 'port-props.meta.ttl', - 'port-props.ttl', - 'manifest.ttl', -) - -headers = files( - 'port-props.h', -) - -# Install specification bundle -install_data(port_props_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_port_props_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('port-props.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/port-props/port-props.h b/lv2/port-props/port-props.h deleted file mode 100644 index ff4adcd..0000000 --- a/lv2/port-props/port-props.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_PORT_PROPS_H -#define LV2_PORT_PROPS_H - -/** - @defgroup port-props Port Properties - @ingroup lv2 - - Various port properties. - - @{ -*/ - -// clang-format off - -#define LV2_PORT_PROPS_URI "http://lv2plug.in/ns/ext/port-props" ///< http://lv2plug.in/ns/ext/port-props -#define LV2_PORT_PROPS_PREFIX LV2_PORT_PROPS_URI "#" ///< http://lv2plug.in/ns/ext/port-props# - -#define LV2_PORT_PROPS__causesArtifacts LV2_PORT_PROPS_PREFIX "causesArtifacts" ///< http://lv2plug.in/ns/ext/port-props#causesArtifacts -#define LV2_PORT_PROPS__continuousCV LV2_PORT_PROPS_PREFIX "continuousCV" ///< http://lv2plug.in/ns/ext/port-props#continuousCV -#define LV2_PORT_PROPS__discreteCV LV2_PORT_PROPS_PREFIX "discreteCV" ///< http://lv2plug.in/ns/ext/port-props#discreteCV -#define LV2_PORT_PROPS__displayPriority LV2_PORT_PROPS_PREFIX "displayPriority" ///< http://lv2plug.in/ns/ext/port-props#displayPriority -#define LV2_PORT_PROPS__expensive LV2_PORT_PROPS_PREFIX "expensive" ///< http://lv2plug.in/ns/ext/port-props#expensive -#define LV2_PORT_PROPS__hasStrictBounds LV2_PORT_PROPS_PREFIX "hasStrictBounds" ///< http://lv2plug.in/ns/ext/port-props#hasStrictBounds -#define LV2_PORT_PROPS__logarithmic LV2_PORT_PROPS_PREFIX "logarithmic" ///< http://lv2plug.in/ns/ext/port-props#logarithmic -#define LV2_PORT_PROPS__notAutomatic LV2_PORT_PROPS_PREFIX "notAutomatic" ///< http://lv2plug.in/ns/ext/port-props#notAutomatic -#define LV2_PORT_PROPS__notOnGUI LV2_PORT_PROPS_PREFIX "notOnGUI" ///< http://lv2plug.in/ns/ext/port-props#notOnGUI -#define LV2_PORT_PROPS__rangeSteps LV2_PORT_PROPS_PREFIX "rangeSteps" ///< http://lv2plug.in/ns/ext/port-props#rangeSteps -#define LV2_PORT_PROPS__supportsStrictBounds LV2_PORT_PROPS_PREFIX "supportsStrictBounds" ///< http://lv2plug.in/ns/ext/port-props#supportsStrictBounds -#define LV2_PORT_PROPS__trigger LV2_PORT_PROPS_PREFIX "trigger" ///< http://lv2plug.in/ns/ext/port-props#trigger - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_PORT_PROPS_H */ diff --git a/lv2/port-props/port-props.meta.ttl b/lv2/port-props/port-props.meta.ttl deleted file mode 100644 index 7077e4b..0000000 --- a/lv2/port-props/port-props.meta.ttl +++ /dev/null @@ -1,202 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix pprops: . -@prefix rdf: . -@prefix rdfs: . - - - a doap:Project ; - doap:name "LV2 Port Properties" ; - doap:created "2009-01-01" ; - doap:shortdesc "Various properties for LV2 plugin ports." ; - doap:maintainer ; - doap:developer ; - doap:release [ - doap:revision "1.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This vocabulary defines various properties for plugin ports, which can be used -to better describe how a plugin can be controlled. Using this metadata, hosts -can build better UIs for plugins, and provide more advanced automatic -functionality. - -"""^^lv2:Markdown . - -pprops:trigger - lv2:documentation """ - -Indicates that the data item corresponds to a momentary event that has been -detected (control output ports) or is to be triggered (control input ports). -For input ports, the port needs to be reset to lv2:default value after run() -function of the plugin has returned. If the control port is assigned a GUI -widget by the host, the widget should be of auto-off (momentary, one-shot) type -- for example, a push button if the port is also declared as lv2:toggled, or a -series of push button or auto-clear input box with a "Send" button if the port -is also lv2:integer. - -"""^^lv2:Markdown . - -pprops:supportsStrictBounds - lv2:documentation """ - -Indicates use of host support for pprops:hasStrictBounds port property. A -plugin that specifies it as optional feature can omit value clamping for -hasStrictBounds ports, if the feature is supported by the host. When specified -as required feature, it indicates that the plugin does not do any clamping for -input ports that have a pprops:hasStrictBounds property. - -"""^^lv2:Markdown . - -pprops:hasStrictBounds - lv2:documentation """ - -For hosts that support pprops:supportsStrictBounds, this indicates that the -value of the port should never exceed the port's minimum and maximum control -points. For input ports, it moves the responsibility for limiting the range of -values to host, if it supports pprops:supportsStrictBounds. For output ports, -it indicates that values within specified range are to be expected, and -breaking that should be considered by the host as error in plugin -implementation. - -"""^^lv2:Markdown . - -pprops:expensive - lv2:documentation """ - -Input ports only. Indicates that any changes to the port value may trigger -expensive background calculation (for example, regeneration of lookup tables in -a background thread). Any value changes may have not have immediate effect, or -may cause silence or diminished-quality version of the output until background -processing is finished. Ports having this property are typically not well -suited for connection to outputs of other plugins, and should not be offered as -connection targets or for automation by default. - -"""^^lv2:Markdown . - -pprops:causesArtifacts - lv2:documentation """ - -Input ports only. Indicates that any changes to the port value may produce -slight artifacts to produced audio signals (zipper noise and other results of -signal discontinuities). Connecting ports of this type to continuous signals -is not recommended, and when presenting a list of automation targets, those -ports may be marked as artifact-producing. - -"""^^lv2:Markdown . - -pprops:continuousCV - lv2:documentation """ - -Indicates that the port carries a "smooth" modulation signal. Control input -ports of this type are well-suited for being connected to sources of smooth -signals (knobs with smoothing, modulation rate oscillators, output ports with -continuousCV type, etc.). Typically, the plugin with ports which have this -property will implement appropriate smoothing to avoid audio artifacts. For -output ports, this property suggests the value of the port is likely to change -frequently, and describes a smooth signal (so successive values may be -considered points along a curve). - -"""^^lv2:Markdown . - -pprops:discreteCV - lv2:documentation """ - -Indicates that the port carries a "discrete" modulation signal. Input ports of -this type are well-suited for being connected to sources of discrete signals -(switches, buttons, classifiers, event detectors, etc.). May be combined with -pprops:trigger property. For output ports, this property suggests the value of -the port describe discrete values that should be interpreted as steps (and not -points along a curve). - -"""^^lv2:Markdown . - -pprops:logarithmic - lv2:documentation """ - -Indicates that port value behaviour within specified range (bounds) is a value -using logarithmic scale. The lower and upper bounds must be specified, and -must be of the same sign. - -"""^^lv2:Markdown . - -pprops:notAutomatic - lv2:documentation """ - -Indicates that the port is not primarily intended to be fed with modulation -signals from external sources (other plugins, etc.). It is merely a UI hint -and hosts may allow the user to override it. - -"""^^lv2:Markdown . - -pprops:notOnGUI - lv2:documentation """ - -Indicates that the port is not primarily intended to be represented by a -separate control in the user interface window (or any similar mechanism used -for direct, immediate control of control ports). It is merely a UI hint and -hosts may allow the user to override it. - -"""^^lv2:Markdown . - -pprops:displayPriority - lv2:documentation """ - -Indicates how important a port is to controlling the plugin. If a host can -only display some ports of a plugin, it should prefer ports with a higher -display priority. Priorities do not need to be unique, and are only meaningful -when compared to each other. - -"""^^lv2:Markdown . - -pprops:rangeSteps - lv2:documentation """ - -This value indicates into how many evenly-divided points the (control) port -range should be divided for step-wise control. This may be used for changing -the value with step-based controllers like arrow keys, mouse wheel, rotary -encoders, and so on. - -Note that when used with a pprops:logarithmic port, the steps are logarithmic -too, and port value can be calculated as: - - :::c - value = lower * pow(upper / lower, step / (steps - 1)) - -and the step from value is: - - :::c - step = (steps - 1) * log(value / lower) / log(upper / lower) - -where: - - * `value` is the port value. - - * `step` is the step number (0..steps). - - * `steps` is the number of steps (= value of :rangeSteps property). - - * `lower` and upper are the bounds. - -"""^^lv2:Markdown . - diff --git a/lv2/port-props/port-props.ttl b/lv2/port-props/port-props.ttl deleted file mode 100644 index ea25c6b..0000000 --- a/lv2/port-props/port-props.ttl +++ /dev/null @@ -1,80 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix pprops: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Port Properties" ; - rdfs:comment "Various properties for LV2 plugin ports." ; - rdfs:seeAlso ; - owl:imports . - -pprops:trigger - a lv2:PortProperty ; - rdfs:label "trigger" ; - rdfs:comment "Port is a momentary trigger." . - -pprops:supportsStrictBounds - a lv2:Feature ; - rdfs:label "supports strict bounds" ; - rdfs:comment "A feature indicating plugin support for strict port bounds." . - -pprops:hasStrictBounds - a lv2:PortProperty ; - rdfs:label "has strict bounds" ; - rdfs:comment "Port has strict bounds which are not internally clamped." . - -pprops:expensive - a lv2:PortProperty ; - rdfs:label "changes are expensive" ; - rdfs:comment "Input port is expensive to change." . - -pprops:causesArtifacts - a lv2:PortProperty ; - rdfs:label "changes cause artifacts" ; - rdfs:comment "Input port causes audible artifacts when changed." . - -pprops:continuousCV - a lv2:PortProperty ; - rdfs:label "smooth modulation signal" ; - rdfs:comment "Port carries a smooth modulation signal." . - -pprops:discreteCV - a lv2:PortProperty ; - rdfs:label "discrete modulation signal" ; - rdfs:comment "Port carries a discrete modulation signal." . - -pprops:logarithmic - a lv2:PortProperty ; - rdfs:label "logarithmic" ; - rdfs:comment "Port value is logarithmic." . - -pprops:notAutomatic - a lv2:PortProperty ; - rdfs:label "not automatic" ; - rdfs:comment "Port that is not intended to be fed with a modulation signal." . - -pprops:notOnGUI - a lv2:PortProperty ; - rdfs:label "not on GUI" ; - rdfs:comment "Port that should not be displayed on a GUI." . - -pprops:displayPriority - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain lv2:Port ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "display priority" ; - rdfs:comment "A priority ranking this port in importance to its plugin." . - -pprops:rangeSteps - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain lv2:Port ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "range steps" ; - rdfs:comment "The number of even steps the range should be divided into." . - diff --git a/lv2/presets.lv2/manifest.ttl b/lv2/presets.lv2/manifest.ttl new file mode 100644 index 0000000..b9cacf5 --- /dev/null +++ b/lv2/presets.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 8 ; + rdfs:seeAlso . + diff --git a/lv2/presets.lv2/presets.meta.ttl b/lv2/presets.lv2/presets.meta.ttl new file mode 100644 index 0000000..8ff25c1 --- /dev/null +++ b/lv2/presets.lv2/presets.meta.ttl @@ -0,0 +1,132 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix pset: . +@prefix rdfs: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 Presets" ; + doap:shortdesc "Presets for LV2 plugins." ; + doap:created "2009-00-00" ; + doap:developer ; + doap:release [ + doap:revision "2.8" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] , [ + rdfs:label "Add preset banks." + ] + ] + ] , [ + doap:revision "2.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add pset:preset property for describing the preset currently applied to a plugin instance." + ] , [ + rdfs:label "Remove pset:appliesTo property, use lv2:appliesTo instead." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2010-10-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This is a vocabulary for LV2 plugin presets, that is, named sets of control +values and possibly other state. The structure of a pset:Preset is +deliberately identical to that of an lv2:Plugin, and can be thought of as a +plugin template or overlay. + +Presets may be defined in any bundle, including the plugin's bundle, separate +third party preset bundles, or user preset bundles saved by hosts. Since +preset data tends to be large, it is recommended that plugins describe presets +in a separate file(s) to avoid slowing down hosts. The `manifest.ttl` of a +bundle containing presets should list them like so: + + :::turtle + eg:mypreset + a pset:Preset ; + lv2:appliesTo eg:myplugin ; + rdfs:seeAlso . + +"""^^lv2:Markdown . + +pset:Preset + lv2:documentation """ + +The structure of a Preset deliberately mirrors that of a plugin, so existing +predicates can be used to describe any data associated with the preset. For +example: + + :::turtle + @prefix eg: . + + eg:mypreset + a pset:Preset ; + rdfs:label "One louder" ; + lv2:appliesTo eg:myplugin ; + lv2:port [ + lv2:symbol "volume1" ; + pset:value 11.0 + ] , [ + lv2:symbol "volume2" ; + pset:value 11.0 + ] . + +A Preset SHOULD have at least one lv2:appliesTo property. Each Port on a +Preset MUST have at least a lv2:symbol property and a pset:value property. + +Hosts SHOULD save user presets to a bundle in the user-local LV2 directory (for +example `~/.lv2`) with a name like `_.preset.lv2` +(for example `LV2_Amp_At_Eleven.preset.lv2`), where names are transformed to be +valid LV2 symbols for maximum compatibility. + +"""^^lv2:Markdown . + +pset:value + lv2:documentation """ + +This property is used in a similar way to lv2:default. + +"""^^lv2:Markdown . + +pset:preset + lv2:documentation """ + +Specifies the preset currently applied to a plugin instance. This property may +be useful for saving state, or notifying a plugin instance at run-time about a +preset change. + +"""^^lv2:Markdown . + diff --git a/lv2/presets.lv2/presets.ttl b/lv2/presets.lv2/presets.ttl new file mode 100644 index 0000000..60189ea --- /dev/null +++ b/lv2/presets.lv2/presets.ttl @@ -0,0 +1,61 @@ +@prefix lv2: . +@prefix owl: . +@prefix pset: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Presets" ; + rdfs:comment "Presets for LV2 plugins." ; + rdfs:seeAlso ; + owl:imports . + +pset:Bank + a rdfs:Class ; + rdfs:label "Bank" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty rdfs:label ; + owl:minCardinality 1 ; + rdfs:comment "A Bank MUST have at least one string rdfs:label." + ] ; + rdfs:comment "A bank of presets." . + +pset:Preset + a rdfs:Class ; + rdfs:subClassOf lv2:PluginBase ; + rdfs:label "Preset" ; + rdfs:comment "A preset for an LV2 plugin." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty rdfs:label ; + owl:minCardinality 1 ; + rdfs:comment "A Preset MUST have at least one string rdfs:label." + ] . + +pset:bank + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain pset:Preset ; + rdfs:range pset:Bank ; + rdfs:label "bank" ; + rdfs:comment "The bank this preset belongs to." . + +pset:value + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:PortBase ; + rdfs:label "value" ; + rdfs:comment "The value of a port in a preset." . + +pset:preset + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:PluginBase ; + rdfs:range pset:Preset ; + rdfs:label "preset" ; + rdfs:comment "The preset currently applied to a plugin instance." . + diff --git a/lv2/presets/manifest.ttl b/lv2/presets/manifest.ttl deleted file mode 100644 index b9cacf5..0000000 --- a/lv2/presets/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 2 ; - lv2:microVersion 8 ; - rdfs:seeAlso . - diff --git a/lv2/presets/meson.build b/lv2/presets/meson.build deleted file mode 100644 index a3f2feb..0000000 --- a/lv2/presets/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'presets' -path = 'ns' / 'ext' / 'presets' - -presets_data = files( - 'presets.meta.ttl', - 'presets.ttl', - 'manifest.ttl', -) - -headers = files( - 'presets.h', -) - -# Install specification bundle -install_data(presets_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_presets_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('presets.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/presets/presets.h b/lv2/presets/presets.h deleted file mode 100644 index 716ab32..0000000 --- a/lv2/presets/presets.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_PRESETS_H -#define LV2_PRESETS_H - -/** - @defgroup presets Presets - @ingroup lv2 - - Presets for plugins. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_PRESETS_URI "http://lv2plug.in/ns/ext/presets" ///< http://lv2plug.in/ns/ext/presets -#define LV2_PRESETS_PREFIX LV2_PRESETS_URI "#" ///< http://lv2plug.in/ns/ext/presets# - -#define LV2_PRESETS__Bank LV2_PRESETS_PREFIX "Bank" ///< http://lv2plug.in/ns/ext/presets#Bank -#define LV2_PRESETS__Preset LV2_PRESETS_PREFIX "Preset" ///< http://lv2plug.in/ns/ext/presets#Preset -#define LV2_PRESETS__bank LV2_PRESETS_PREFIX "bank" ///< http://lv2plug.in/ns/ext/presets#bank -#define LV2_PRESETS__preset LV2_PRESETS_PREFIX "preset" ///< http://lv2plug.in/ns/ext/presets#preset -#define LV2_PRESETS__value LV2_PRESETS_PREFIX "value" ///< http://lv2plug.in/ns/ext/presets#value - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_PRESETS_H */ diff --git a/lv2/presets/presets.meta.ttl b/lv2/presets/presets.meta.ttl deleted file mode 100644 index 8ff25c1..0000000 --- a/lv2/presets/presets.meta.ttl +++ /dev/null @@ -1,132 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix pset: . -@prefix rdfs: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 Presets" ; - doap:shortdesc "Presets for LV2 plugins." ; - doap:created "2009-00-00" ; - doap:developer ; - doap:release [ - doap:revision "2.8" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] , [ - rdfs:label "Add preset banks." - ] - ] - ] , [ - doap:revision "2.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add pset:preset property for describing the preset currently applied to a plugin instance." - ] , [ - rdfs:label "Remove pset:appliesTo property, use lv2:appliesTo instead." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "2.2" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2010-10-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This is a vocabulary for LV2 plugin presets, that is, named sets of control -values and possibly other state. The structure of a pset:Preset is -deliberately identical to that of an lv2:Plugin, and can be thought of as a -plugin template or overlay. - -Presets may be defined in any bundle, including the plugin's bundle, separate -third party preset bundles, or user preset bundles saved by hosts. Since -preset data tends to be large, it is recommended that plugins describe presets -in a separate file(s) to avoid slowing down hosts. The `manifest.ttl` of a -bundle containing presets should list them like so: - - :::turtle - eg:mypreset - a pset:Preset ; - lv2:appliesTo eg:myplugin ; - rdfs:seeAlso . - -"""^^lv2:Markdown . - -pset:Preset - lv2:documentation """ - -The structure of a Preset deliberately mirrors that of a plugin, so existing -predicates can be used to describe any data associated with the preset. For -example: - - :::turtle - @prefix eg: . - - eg:mypreset - a pset:Preset ; - rdfs:label "One louder" ; - lv2:appliesTo eg:myplugin ; - lv2:port [ - lv2:symbol "volume1" ; - pset:value 11.0 - ] , [ - lv2:symbol "volume2" ; - pset:value 11.0 - ] . - -A Preset SHOULD have at least one lv2:appliesTo property. Each Port on a -Preset MUST have at least a lv2:symbol property and a pset:value property. - -Hosts SHOULD save user presets to a bundle in the user-local LV2 directory (for -example `~/.lv2`) with a name like `_.preset.lv2` -(for example `LV2_Amp_At_Eleven.preset.lv2`), where names are transformed to be -valid LV2 symbols for maximum compatibility. - -"""^^lv2:Markdown . - -pset:value - lv2:documentation """ - -This property is used in a similar way to lv2:default. - -"""^^lv2:Markdown . - -pset:preset - lv2:documentation """ - -Specifies the preset currently applied to a plugin instance. This property may -be useful for saving state, or notifying a plugin instance at run-time about a -preset change. - -"""^^lv2:Markdown . - diff --git a/lv2/presets/presets.ttl b/lv2/presets/presets.ttl deleted file mode 100644 index 60189ea..0000000 --- a/lv2/presets/presets.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix pset: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Presets" ; - rdfs:comment "Presets for LV2 plugins." ; - rdfs:seeAlso ; - owl:imports . - -pset:Bank - a rdfs:Class ; - rdfs:label "Bank" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality 1 ; - rdfs:comment "A Bank MUST have at least one string rdfs:label." - ] ; - rdfs:comment "A bank of presets." . - -pset:Preset - a rdfs:Class ; - rdfs:subClassOf lv2:PluginBase ; - rdfs:label "Preset" ; - rdfs:comment "A preset for an LV2 plugin." ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty rdfs:label ; - owl:minCardinality 1 ; - rdfs:comment "A Preset MUST have at least one string rdfs:label." - ] . - -pset:bank - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain pset:Preset ; - rdfs:range pset:Bank ; - rdfs:label "bank" ; - rdfs:comment "The bank this preset belongs to." . - -pset:value - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain lv2:PortBase ; - rdfs:label "value" ; - rdfs:comment "The value of a port in a preset." . - -pset:preset - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain lv2:PluginBase ; - rdfs:range pset:Preset ; - rdfs:label "preset" ; - rdfs:comment "The preset currently applied to a plugin instance." . - diff --git a/lv2/resize-port.lv2/manifest.ttl b/lv2/resize-port.lv2/manifest.ttl new file mode 100644 index 0000000..9fae8b8 --- /dev/null +++ b/lv2/resize-port.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; + rdfs:seeAlso . + diff --git a/lv2/resize-port.lv2/resize-port.meta.ttl b/lv2/resize-port.lv2/resize-port.meta.ttl new file mode 100644 index 0000000..d44620c --- /dev/null +++ b/lv2/resize-port.lv2/resize-port.meta.ttl @@ -0,0 +1,74 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . +@prefix rsz: . + + + a doap:Project ; + doap:name "LV2 Resize Port" ; + doap:shortdesc "Dynamically sized LV2 port buffers." ; + doap:created "2007-00-00" ; + doap:developer ; + doap:release [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a feature, rsz:resize, which allows plugins to +dynamically resize their output port buffers. + +In addition to the dynamic feature, there are properties which describe the +space required for a particular port buffer which can be used statically in +data files. + +"""^^lv2:Markdown . + +rsz:resize + lv2:documentation """ + +A feature to resize output port buffers in LV2_Plugin_Descriptor::run(). + +To support this feature, the host must pass an LV2_Feature to the plugin's +instantiate method with URI LV2_RESIZE_PORT__resize and a pointer to a +LV2_Resize_Port_Resize structure. This structure provides a resize_port +function which plugins may use to resize output port buffers as necessary. + +"""^^lv2:Markdown . + +rsz:asLargeAs + lv2:documentation """ + +Indicates that a port requires at least as much buffer space as the port with +the given symbol on the same plugin instance. This may be used for any ports, +but is generally most useful to indicate an output port must be at least as +large as some input port (because it will copy from it). If a port is +asLargeAs several ports, it is asLargeAs the largest such port (not the sum of +those ports' sizes). + +The host guarantees that whenever an ObjectPort's run method is called, any +output `O` that is rsz:asLargeAs an input `I` is connected to a buffer large +enough to copy `I`, or `NULL` if the port is lv2:connectionOptional. + +"""^^lv2:Markdown . + +rsz:minimumSize + lv2:documentation """ + +Indicates that a port requires a buffer at least this large, in bytes. Any +host that supports the resize-port feature MUST connect any port with a +minimumSize specified to a buffer at least as large as the value given for this +property. Any host, especially those that do NOT support dynamic port +resizing, SHOULD do so or reduced functionality may result. + +"""^^lv2:Markdown . + diff --git a/lv2/resize-port.lv2/resize-port.ttl b/lv2/resize-port.lv2/resize-port.ttl new file mode 100644 index 0000000..6f42c8f --- /dev/null +++ b/lv2/resize-port.lv2/resize-port.ttl @@ -0,0 +1,36 @@ +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix rsz: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Resize Port" ; + rdfs:comment "Dynamically sized LV2 port buffers." ; + rdfs:seeAlso ; + owl:imports . + +rsz:resize + a lv2:Feature ; + rdfs:label "resize" ; + rdfs:comment "A feature for resizing output port buffers." . + +rsz:asLargeAs + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Port ; + rdfs:range lv2:Symbol ; + rdfs:label "as large as" ; + rdfs:comment "Port that this port must have at least as much buffer space as." . + +rsz:minimumSize + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Port ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "minimum size" ; + rdfs:comment "Minimum buffer size required by a port, in bytes." . + diff --git a/lv2/resize-port/manifest.ttl b/lv2/resize-port/manifest.ttl deleted file mode 100644 index 9fae8b8..0000000 --- a/lv2/resize-port/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 0 ; - rdfs:seeAlso . - diff --git a/lv2/resize-port/meson.build b/lv2/resize-port/meson.build deleted file mode 100644 index cd18a2c..0000000 --- a/lv2/resize-port/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'resize-port' -path = 'ns' / 'ext' / 'resize-port' - -resize_port_data = files( - 'resize-port.meta.ttl', - 'resize-port.ttl', - 'manifest.ttl', -) - -headers = files( - 'resize-port.h', -) - -# Install specification bundle -install_data(resize_port_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_resize_port_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('resize-port.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/resize-port/resize-port.h b/lv2/resize-port/resize-port.h deleted file mode 100644 index a3a11c4..0000000 --- a/lv2/resize-port/resize-port.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright 2007-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_RESIZE_PORT_H -#define LV2_RESIZE_PORT_H - -/** - @defgroup resize-port Resize Port - @ingroup lv2 - - Dynamically sized LV2 port buffers. - - @{ -*/ - -#include -#include - -// clang-format off - -#define LV2_RESIZE_PORT_URI "http://lv2plug.in/ns/ext/resize-port" ///< http://lv2plug.in/ns/ext/resize-port -#define LV2_RESIZE_PORT_PREFIX LV2_RESIZE_PORT_URI "#" ///< http://lv2plug.in/ns/ext/resize-port# - -#define LV2_RESIZE_PORT__asLargeAs LV2_RESIZE_PORT_PREFIX "asLargeAs" ///< http://lv2plug.in/ns/ext/resize-port#asLargeAs -#define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize" ///< http://lv2plug.in/ns/ext/resize-port#minimumSize -#define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize" ///< http://lv2plug.in/ns/ext/resize-port#resize - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -/** A status code for state functions. */ -typedef enum { - LV2_RESIZE_PORT_SUCCESS = 0, /**< Completed successfully. */ - LV2_RESIZE_PORT_ERR_UNKNOWN = 1, /**< Unknown error. */ - LV2_RESIZE_PORT_ERR_NO_SPACE = 2 /**< Insufficient space. */ -} LV2_Resize_Port_Status; - -/** Opaque data for resize method. */ -typedef void* LV2_Resize_Port_Feature_Data; - -/** Host feature to allow plugins to resize their port buffers. */ -typedef struct { - /** Opaque data for resize method. */ - LV2_Resize_Port_Feature_Data data; - - /** - Resize a port buffer to at least `size` bytes. - - This function MAY return an error, in which case the port buffer was not - resized and the port is still connected to the same location. Plugins - MUST gracefully handle this situation. - - This function is in the audio threading class. - - The host MUST preserve the contents of the port buffer when resizing. - - Plugins MAY resize a port many times in a single run callback. Hosts - SHOULD make this as inexpensive as possible. - */ - LV2_Resize_Port_Status (*resize)(LV2_Resize_Port_Feature_Data data, - uint32_t index, - size_t size); -} LV2_Resize_Port_Resize; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_RESIZE_PORT_H */ diff --git a/lv2/resize-port/resize-port.meta.ttl b/lv2/resize-port/resize-port.meta.ttl deleted file mode 100644 index d44620c..0000000 --- a/lv2/resize-port/resize-port.meta.ttl +++ /dev/null @@ -1,74 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix rsz: . - - - a doap:Project ; - doap:name "LV2 Resize Port" ; - doap:shortdesc "Dynamically sized LV2 port buffers." ; - doap:created "2007-00-00" ; - doap:developer ; - doap:release [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a feature, rsz:resize, which allows plugins to -dynamically resize their output port buffers. - -In addition to the dynamic feature, there are properties which describe the -space required for a particular port buffer which can be used statically in -data files. - -"""^^lv2:Markdown . - -rsz:resize - lv2:documentation """ - -A feature to resize output port buffers in LV2_Plugin_Descriptor::run(). - -To support this feature, the host must pass an LV2_Feature to the plugin's -instantiate method with URI LV2_RESIZE_PORT__resize and a pointer to a -LV2_Resize_Port_Resize structure. This structure provides a resize_port -function which plugins may use to resize output port buffers as necessary. - -"""^^lv2:Markdown . - -rsz:asLargeAs - lv2:documentation """ - -Indicates that a port requires at least as much buffer space as the port with -the given symbol on the same plugin instance. This may be used for any ports, -but is generally most useful to indicate an output port must be at least as -large as some input port (because it will copy from it). If a port is -asLargeAs several ports, it is asLargeAs the largest such port (not the sum of -those ports' sizes). - -The host guarantees that whenever an ObjectPort's run method is called, any -output `O` that is rsz:asLargeAs an input `I` is connected to a buffer large -enough to copy `I`, or `NULL` if the port is lv2:connectionOptional. - -"""^^lv2:Markdown . - -rsz:minimumSize - lv2:documentation """ - -Indicates that a port requires a buffer at least this large, in bytes. Any -host that supports the resize-port feature MUST connect any port with a -minimumSize specified to a buffer at least as large as the value given for this -property. Any host, especially those that do NOT support dynamic port -resizing, SHOULD do so or reduced functionality may result. - -"""^^lv2:Markdown . - diff --git a/lv2/resize-port/resize-port.ttl b/lv2/resize-port/resize-port.ttl deleted file mode 100644 index a6712e7..0000000 --- a/lv2/resize-port/resize-port.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix rsz: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Resize Port" ; - rdfs:comment "Dynamically sized LV2 port buffers." ; - rdfs:seeAlso , - ; - owl:imports . - -rsz:resize - a lv2:Feature ; - rdfs:label "resize" ; - rdfs:comment "A feature for resizing output port buffers." . - -rsz:asLargeAs - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain lv2:Port ; - rdfs:range lv2:Symbol ; - rdfs:label "as large as" ; - rdfs:comment "Port that this port must have at least as much buffer space as." . - -rsz:minimumSize - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain lv2:Port ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "minimum size" ; - rdfs:comment "Minimum buffer size required by a port, in bytes." . - diff --git a/lv2/state.lv2/manifest.ttl b/lv2/state.lv2/manifest.ttl new file mode 100644 index 0000000..e56c4e5 --- /dev/null +++ b/lv2/state.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 10 ; + rdfs:seeAlso . + diff --git a/lv2/state.lv2/state.meta.ttl b/lv2/state.lv2/state.meta.ttl new file mode 100644 index 0000000..cebe0ac --- /dev/null +++ b/lv2/state.lv2/state.meta.ttl @@ -0,0 +1,477 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . +@prefix state: . + + + a doap:Project ; + doap:created "2010-11-09" ; + doap:name "LV2 State" ; + doap:shortdesc "An interface for LV2 plugins to save and restore state." ; + doap:license ; + doap:developer , + ; + doap:maintainer ; + doap:release [ + doap:revision "2.10" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + doap:revision "2.8" ; + doap:created "2021-01-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix state:StateChanged URI in metadata and documentation." + ] + ] + ] , [ + doap:revision "2.6" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add state:freePath feature." + ] + ] + ] , [ + doap:revision "2.4" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add state:StateChanged for notification events." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2016-07-31" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add LV2_STATE_ERR_NO_SPACE status flag." + ] , [ + rdfs:label "Add state:threadSafeRestore feature for dropout-free state restoration." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2013-01-16" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add state:loadDefaultState feature so plugins can have their default state loaded without hard-coding default state as a special case." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a simple mechanism that allows hosts to save and restore +a plugin instance's state. The goal is for an instance's state to be +completely described by port values and a simple dictionary. + +The state defined here is conceptually a key:value dictionary, with URI keys +and values of any type. For performance reasons the key and value type are +actually a "URID", a URI mapped to an integer. A single key:value pair is +called a "property". + +This state model is simple yet has many benefits: + + * Both fast and extensible thanks to URID keys. + + * No limitations on possible value types. + + * Easy to serialise in almost any format. + + * Easy to store in a typical "map" or "dictionary" data structure. + + * Elegantly described in Turtle, so state can be described in LV2 data files + (including presets). + + * Does not impose any file formats, data structures, or file system + requirements. + + * Suitable for portable persistent state as well as fast in-memory snapshots. + + * Keys _may_ be well-defined and used meaningfully across several + implementations. + + * State _may_ be dynamic, but plugins are not required to have a dynamic + dictionary data structure available. + +To implement state, the plugin provides a state:interface to the host. To save +or restore, the host calls LV2_State_Interface::save() or +LV2_State_Interface::restore(), passing a callback to be used for handling a +single property. The host is free to implement property storage and retrieval +in any way. + +Since value types are defined by URI, any type is possible. However, a set of +standard types is defined by the [LV2 Atom](atom.html) extension. Use of these +types is recommended. Hosts MUST implement at least +[atom:String](atom.html#String), which is simply a C string. + +### Referring to Files + +Plugins may need to refer to existing files (such as loaded samples) in their +state. This is done by storing the file's path as a property just like any +other value. However, there are some rules which MUST be followed when storing +paths, see state:mapPath for details. Plugins MUST use the type +[atom:Path](atom.html#Path) for all paths in their state. + +Plugins are strongly encouraged to avoid creating files, instead storing all +state as properties. However, occasionally the ability to create files is +necessary. To make this possible, the host can provide the feature +state:makePath which allocates paths for plugin-created files. Plugins MUST +NOT create files in any other locations. + +### Plugin Code Example + + :::c + + /* Namespace for this plugin's keys. This SHOULD be something that could be + published as a document, even if that document does not exist right now. + */ + #define NS_MY "http://example.org/myplugin/schema#" + + #define DEFAULT_GREETING "Hello" + + LV2_Handle + my_instantiate(...) + { + MyPlugin* plugin = ...; + plugin->uris.atom_String = map_uri(LV2_ATOM__String); + plugin->uris.my_greeting = map_uri(NS_MY "greeting"); + plugin->state.greeting = strdup(DEFAULT_GREETING); + return plugin; + } + + LV2_State_Status + my_save(LV2_Handle instance, + LV2_State_Store_Function store, + LV2_State_Handle handle, + uint32_t flags, + const LV2_Feature *const * features) + { + MyPlugin* plugin = (MyPlugin*)instance; + const char* greeting = plugin->state.greeting; + + store(handle, + plugin->uris.my_greeting, + greeting, + strlen(greeting) + 1, // Careful! Need space for terminator + plugin->uris.atom_String, + LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE); + + return LV2_STATE_SUCCESS; + } + + LV2_State_Status + my_restore(LV2_Handle instance, + LV2_State_Retrieve_Function retrieve, + LV2_State_Handle handle, + uint32_t flags, + const LV2_Feature *const * features) + { + MyPlugin* plugin = (MyPlugin*)instance; + + size_t size; + uint32_t type; + uint32_t flags; + const char* greeting = retrieve( + handle, plugin->uris.my_greeting, &size, &type, &flags); + + if (greeting) { + free(plugin->state->greeting); + plugin->state->greeting = strdup(greeting); + } else { + plugin->state->greeting = strdup(DEFAULT_GREETING); + } + + return LV2_STATE_SUCCESS; + } + + const void* + my_extension_data(const char* uri) + { + static const LV2_State_Interface state_iface = { my_save, my_restore }; + if (!strcmp(uri, LV2_STATE__interface)) { + return &state_iface; + } + } + +### Host Code Example + + :::c + LV2_State_Status + store_callback(LV2_State_Handle handle, + uint32_t key, + const void* value, + size_t size, + uint32_t type, + uint32_t flags) + { + if ((flags & LV2_STATE_IS_POD)) { + // We only care about POD since we're keeping state in memory only. + // Disk or network use would also require LV2_STATE_IS_PORTABLE. + Map* state_map = (Map*)handle; + state_map->insert(key, Value(copy(value), size, type)); + return LV2_STATE_SUCCESS;; + } else { + return LV2_STATE_ERR_BAD_FLAGS; // Non-POD events are unsupported + } + } + + Map + get_plugin_state(LV2_Handle instance) + { + LV2_State* state = instance.extension_data(LV2_STATE__interface); + + // Request a fast/native/POD save, since we're just copying in memory + Map state_map; + state.save(instance, store_callback, &state_map, + LV2_STATE_IS_POD|LV2_STATE_IS_NATIVE); + + return state_map; + } + +### Extensions to this Specification + +It is likely that other interfaces for working with plugin state will be +developed as needed. This is encouraged, however everything SHOULD work within +the state _model_ defined here. That is, **do not complicate the state +model**. Implementations can assume the following: + + * The current port values and state dictionary completely describe a plugin + instance, at least well enough that saving and restoring will yield an + "identical" instance from the user's perspective. + + * Hosts are not expected to save and/or restore any other attributes of a + plugin instance. + +### The "Property Principle" + +The main benefit of this meaningful state model is that it can double as a +plugin control/query mechanism. For plugins that require more advanced control +than simple control ports, instead of defining a set of commands, define +properties whose values can be set appropriately. This provides both a way to +control and save that state "for free", since there is no need to define +commands _and_ a set of properties for storing their effects. In particular, +this is a good way for UIs to achieve more advanced control of plugins. + +This "property principle" is summed up in the phrase: "Don't stop; set playing +to false". + +This extension does not define a dynamic mechanism for state access and +manipulation. The [LV2 Patch](patch.html) extension defines a generic set of +messages which can be used to access or manipulate properties, and the [LV2 +Atom](atom.html) extension defines a port type and data container capable of +transmitting those messages. + +"""^^lv2:Markdown . + +state:interface + lv2:documentation """ + +A structure (LV2_State_Interface) which contains functions to be called by the +host to save and restore state. In order to support this extension, the plugin +must return a valid LV2_State_Interface from LV2_Descriptor::extension_data() +when it is called with URI LV2_STATE__interface. + +The plugin data file should describe this like so: + + :::turtle + @prefix state: . + + + a lv2:Plugin ; + lv2:extensionData state:interface . + +"""^^lv2:Markdown . + +state:State + lv2:documentation """ + +This type should be used wherever instance state is described. The properties +of a resource with this type correspond directly to the properties of the state +dictionary (except the property that states it has this type). + +"""^^lv2:Markdown . + +state:loadDefaultState + lv2:documentation """ + +This feature indicates that the plugin has default state listed with the +state:state property which should be loaded by the host before running the +plugin. Requiring this feature allows plugins to implement a single state +loading mechanism which works for initialisation as well as restoration, +without having to hard-code default state. + +To support this feature, the host MUST restore the default state after +instantiating the plugin but before calling run(). + +"""^^lv2:Markdown . + +state:state + lv2:documentation """ + +This property may be used anywhere a state needs to be described, for example: + + :::turtle + @prefix eg: . + + + state:state [ + eg:somekey "some value" ; + eg:someotherkey "some other value" ; + eg:favourite-number 2 + ] . + +"""^^lv2:Markdown . + +state:mapPath + lv2:documentation """ + +This feature maps absolute paths to/from abstract paths which are stored +in state. To support this feature a host must pass an LV2_Feature with URI +LV2_STATE__mapPath and data pointed to an LV2_State_Map_Path to the plugin's +LV2_State_Interface methods. + +The plugin MUST map _all_ paths stored in its state (including those inside any +files). This is necessary so that hosts can handle file system references +correctly, for example to share common files, or bundle state for distribution +or archival. + +For example, a plugin may write a path to a state file like so: + + :::c + void write_path(LV2_State_Map_Path* map_path, FILE* myfile, const char* path) + { + char* abstract_path = map_path->abstract_path(map_path->handle, path); + fprintf(myfile, "%s", abstract_path); + free(abstract_path); + } + +Then, later reload the path like so: + + :::c + char* read_path(LV2_State_Map_Path* map_path, FILE* myfile) + { + /* Obviously this is not production quality code! */ + char abstract_path[1024]; + fscanf(myfile, "%s", abstract_path); + return map_path->absolute_path(map_path->handle, abstract_path); + } + +"""^^lv2:Markdown . + +state:makePath + lv2:documentation """ + +This feature allows plugins to create new files and/or directories. To support +this feature the host passes an LV2_Feature with URI LV2_STATE__makePath and +data pointed to an LV2_State_Make_Path to the plugin. The host may make this +feature available only during save by passing it to +LV2_State_Interface::save(), or available any time by passing it to +LV2_Descriptor::instantiate(). If passed to LV2_State_Interface::save(), the +feature MUST NOT be used beyond the scope of that call. + +The plugin is guaranteed a hierarchical namespace unique to that plugin +instance, and may expect the returned path to have the requested path as a +suffix. There is one such namespace, even if the feature is passed to both +LV2_Descriptor::instantiate() and LV2_State_Interface::save(). Beyond this, +the plugin MUST NOT make any assumptions about the returned paths. + +Like any other paths, the plugin MUST map these paths using state:mapPath +before storing them in state. The plugin MUST NOT assume these paths will be +available across a save/restore otherwise, that is, only mapped paths saved to +state are persistent, any other created paths are temporary. + +For example, a plugin may create a file in a subdirectory like so: + + :::c + char* save_myfile(LV2_State_Make_Path* make_path) + { + char* path = make_path->path(make_path->handle, "foo/bar/myfile.txt"); + FILE* myfile = fopen(path, 'w'); + fprintf(myfile, "I am some data"); + fclose(myfile); + return path; + } + +"""^^lv2:Markdown . + +state:threadSafeRestore + lv2:documentation """ + +If a plugin supports this feature, its LV2_State_Interface::restore method is +thread-safe and may be called concurrently with audio class functions. + +To support this feature, the host MUST pass a +[work:schedule](worker.html#schedule) feature to the restore method, which will +be used to complete the state restoration. The usual mechanics of the worker +apply: the host will call the plugin's work method, which emits a response +which is later applied in the audio thread. + +The host is not required to block audio processing while restore() and work() +load the state, so this feature allows state to be restored without dropouts. + +"""^^lv2:Markdown . + +state:freePath + lv2:documentation """ + +This feature provides a function that can be used by plugins to free paths that +were allocated by the host via other state features (state:mapPath and +state:makePath). + +"""^^lv2:Markdown . + +state:StateChanged + lv2:documentation """ + +A notification that the internal state of the plugin has been changed in a way +that the host can not otherwise know about. + +This is a one-way notification, intended to be used as the type of an +[Object](atom.html#Object) sent from plugins when necessary. + +Plugins SHOULD emit such an event whenever a change has occurred that would +result in a different state being saved, but not when the host explicitly makes +a change which it knows is likely to have that effect, such as changing a +parameter. + +"""^^lv2:Markdown . + diff --git a/lv2/state.lv2/state.ttl b/lv2/state.lv2/state.ttl new file mode 100644 index 0000000..463fdb9 --- /dev/null +++ b/lv2/state.lv2/state.ttl @@ -0,0 +1,60 @@ +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix state: . + + + a owl:Ontology ; + rdfs:label "LV2 State" ; + rdfs:comment "An interface for LV2 plugins to save and restore state." ; + rdfs:seeAlso ; + owl:imports . + +state:interface + a lv2:ExtensionData ; + rdfs:label "interface" ; + rdfs:comment "A plugin interface for saving and restoring state." . + +state:State + a rdfs:Class ; + rdfs:label "State" ; + rdfs:comment "LV2 plugin state." . + +state:loadDefaultState + a lv2:Feature ; + rdfs:label "load default state" ; + rdfs:comment "A feature indicating that the plugin has default state." . + +state:state + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "state" ; + rdfs:range state:State ; + rdfs:comment "The state of an LV2 plugin instance." . + +state:mapPath + a lv2:Feature ; + rdfs:label "map path" ; + rdfs:comment "A feature for mapping between absolute and abstract file paths." . + +state:makePath + a lv2:Feature ; + rdfs:label "make path" ; + rdfs:comment "A feature for creating new files and directories." . + +state:threadSafeRestore + a lv2:Feature ; + rdfs:label "thread-safe restore" ; + rdfs:comment "A feature indicating support for thread-safe state restoration." . + +state:freePath + a lv2:Feature ; + rdfs:label "free path" ; + rdfs:comment "A feature for freeing paths allocated by the host." . + +state:StateChanged + a rdfs:Class ; + rdfs:label "State Changed" ; + rdfs:comment "A notification that the internal state of the plugin has changed." . + diff --git a/lv2/state/manifest.ttl b/lv2/state/manifest.ttl deleted file mode 100644 index e56c4e5..0000000 --- a/lv2/state/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 2 ; - lv2:microVersion 10 ; - rdfs:seeAlso . - diff --git a/lv2/state/meson.build b/lv2/state/meson.build deleted file mode 100644 index 7914797..0000000 --- a/lv2/state/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'state' -path = 'ns' / 'ext' / 'state' - -state_data = files( - 'state.meta.ttl', - 'state.ttl', - 'manifest.ttl', -) - -headers = files( - 'state.h', -) - -# Install specification bundle -install_data(state_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_state_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('state.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/state/state.h b/lv2/state/state.h deleted file mode 100644 index 01ec598..0000000 --- a/lv2/state/state.h +++ /dev/null @@ -1,392 +0,0 @@ -/* - Copyright 2010-2016 David Robillard - Copyright 2010 Leonard Ritter - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_STATE_H -#define LV2_STATE_H - -/** - @defgroup state State - @ingroup lv2 - - An interface for LV2 plugins to save and restore state. - - See for details. - - @{ -*/ - -#include "lv2/core/lv2.h" - -#include -#include - -// clang-format off - -#define LV2_STATE_URI "http://lv2plug.in/ns/ext/state" ///< http://lv2plug.in/ns/ext/state -#define LV2_STATE_PREFIX LV2_STATE_URI "#" ///< http://lv2plug.in/ns/ext/state# - -#define LV2_STATE__State LV2_STATE_PREFIX "State" ///< http://lv2plug.in/ns/ext/state#State -#define LV2_STATE__interface LV2_STATE_PREFIX "interface" ///< http://lv2plug.in/ns/ext/state#interface -#define LV2_STATE__loadDefaultState LV2_STATE_PREFIX "loadDefaultState" ///< http://lv2plug.in/ns/ext/state#loadDefaultState -#define LV2_STATE__freePath LV2_STATE_PREFIX "freePath" ///< http://lv2plug.in/ns/ext/state#freePath -#define LV2_STATE__makePath LV2_STATE_PREFIX "makePath" ///< http://lv2plug.in/ns/ext/state#makePath -#define LV2_STATE__mapPath LV2_STATE_PREFIX "mapPath" ///< http://lv2plug.in/ns/ext/state#mapPath -#define LV2_STATE__state LV2_STATE_PREFIX "state" ///< http://lv2plug.in/ns/ext/state#state -#define LV2_STATE__threadSafeRestore LV2_STATE_PREFIX "threadSafeRestore" ///< http://lv2plug.in/ns/ext/state#threadSafeRestore -#define LV2_STATE__StateChanged LV2_STATE_PREFIX "StateChanged" ///< http://lv2plug.in/ns/ext/state#StateChanged - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* LV2_State_Handle; ///< Opaque handle for state save/restore -typedef void* - LV2_State_Free_Path_Handle; ///< Opaque handle for state:freePath feature -typedef void* - LV2_State_Map_Path_Handle; ///< Opaque handle for state:mapPath feature -typedef void* - LV2_State_Make_Path_Handle; ///< Opaque handle for state:makePath feature - -/** - Flags describing value characteristics. - - These flags are used along with the value's type URI to determine how to - (de-)serialise the value data, or whether it is even possible to do so. -*/ -typedef enum { - /** - Plain Old Data. - - Values with this flag contain no pointers or references to other areas - of memory. It is safe to copy POD values with a simple memcpy and store - them for the duration of the process. A POD value is not necessarily - safe to transmit between processes or machines (for example, filenames - are POD), see LV2_STATE_IS_PORTABLE for details. - - Implementations MUST NOT attempt to copy or serialise a non-POD value if - they do not understand its type (and thus know how to correctly do so). - */ - LV2_STATE_IS_POD = 1u << 0u, - - /** - Portable (architecture independent) data. - - Values with this flag are in a format that is usable on any - architecture. A portable value saved on one machine can be restored on - another machine regardless of architecture. The format of portable - values MUST NOT depend on architecture-specific properties like - endianness or alignment. Portable values MUST NOT contain filenames. - */ - LV2_STATE_IS_PORTABLE = 1u << 1u, - - /** - Native data. - - This flag is used by the host to indicate that the saved data is only - going to be used locally in the currently running process (for things - like instance duplication or snapshots), so the plugin should use the - most efficient representation possible and not worry about serialisation - and portability. - */ - LV2_STATE_IS_NATIVE = 1u << 2u -} LV2_State_Flags; - -/** A status code for state functions. */ -typedef enum { - LV2_STATE_SUCCESS = 0, /**< Completed successfully. */ - LV2_STATE_ERR_UNKNOWN = 1, /**< Unknown error. */ - LV2_STATE_ERR_BAD_TYPE = 2, /**< Failed due to unsupported type. */ - LV2_STATE_ERR_BAD_FLAGS = 3, /**< Failed due to unsupported flags. */ - LV2_STATE_ERR_NO_FEATURE = 4, /**< Failed due to missing features. */ - LV2_STATE_ERR_NO_PROPERTY = 5, /**< Failed due to missing property. */ - LV2_STATE_ERR_NO_SPACE = 6 /**< Failed due to insufficient space. */ -} LV2_State_Status; - -/** - A host-provided function to store a property. - @param handle Must be the handle passed to LV2_State_Interface.save(). - @param key The key to store `value` under (URID). - @param value Pointer to the value to be stored. - @param size The size of `value` in bytes. - @param type The type of `value` (URID). - @param flags LV2_State_Flags for `value`. - @return 0 on success, otherwise a non-zero error code. - - The host passes a callback of this type to LV2_State_Interface.save(). This - callback is called repeatedly by the plugin to store all the properties that - describe its current state. - - DO NOT INVENT NONSENSE URI SCHEMES FOR THE KEY. Best is to use keys from - existing vocabularies. If nothing appropriate is available, use http URIs - that point to somewhere you can host documents so documentation can be made - resolvable (typically a child of the plugin or project URI). If this is not - possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST - NOT pass an invalid URI key. - - The host MAY fail to store a property for whatever reason, but SHOULD - store any property that is LV2_STATE_IS_POD and LV2_STATE_IS_PORTABLE. - Implementations SHOULD use the types from the LV2 Atom extension - (http://lv2plug.in/ns/ext/atom) wherever possible. The plugin SHOULD - attempt to fall-back and avoid the error if possible. - - Note that `size` MUST be > 0, and `value` MUST point to a valid region of - memory `size` bytes long (this is required to make restore unambiguous). - - The plugin MUST NOT attempt to use this function outside of the - LV2_State_Interface.restore() context. -*/ -typedef LV2_State_Status (*LV2_State_Store_Function)(LV2_State_Handle handle, - uint32_t key, - const void* value, - size_t size, - uint32_t type, - uint32_t flags); - -/** - A host-provided function to retrieve a property. - @param handle Must be the handle passed to LV2_State_Interface.restore(). - @param key The key of the property to retrieve (URID). - @param size (Output) If non-NULL, set to the size of the restored value. - @param type (Output) If non-NULL, set to the type of the restored value. - @param flags (Output) If non-NULL, set to the flags for the restored value. - @return A pointer to the restored value (object), or NULL if no value - has been stored under `key`. - - A callback of this type is passed by the host to - LV2_State_Interface.restore(). This callback is called repeatedly by the - plugin to retrieve any properties it requires to restore its state. - - The returned value MUST remain valid until LV2_State_Interface.restore() - returns. The plugin MUST NOT attempt to use this function, or any value - returned from it, outside of the LV2_State_Interface.restore() context. -*/ -typedef const void* (*LV2_State_Retrieve_Function)(LV2_State_Handle handle, - uint32_t key, - size_t* size, - uint32_t* type, - uint32_t* flags); - -/** - LV2 Plugin State Interface. - - When the plugin's extension_data is called with argument - LV2_STATE__interface, the plugin MUST return an LV2_State_Interface - structure, which remains valid for the lifetime of the plugin. - - The host can use the contained function pointers to save and restore the - state of a plugin instance at any time, provided the threading restrictions - of the functions are met. - - Stored data is only guaranteed to be compatible between instances of plugins - with the same URI (i.e. if a change to a plugin would cause a fatal error - when restoring state saved by a previous version of that plugin, the plugin - URI MUST change just as it must when ports change incompatibly). Plugin - authors should consider this possibility, and always store sensible data - with meaningful types to avoid such problems in the future. -*/ -typedef struct { - /** - Save plugin state using a host-provided `store` callback. - - @param instance The instance handle of the plugin. - @param store The host-provided store callback. - @param handle An opaque pointer to host data which MUST be passed as the - handle parameter to `store` if it is called. - @param flags Flags describing desired properties of this save. These - flags may be used to determine the most appropriate values to store. - @param features Extensible parameter for passing any additional - features to be used for this save. - - The plugin is expected to store everything necessary to completely - restore its state later. Plugins SHOULD store simple POD data whenever - possible, and consider the possibility of state being restored much - later on a different machine. - - The `handle` pointer and `store` function MUST NOT be used - beyond the scope of save(). - - This function has its own special threading class: it may not be called - concurrently with any "Instantiation" function, but it may be called - concurrently with functions in any other class, unless the definition of - that class prohibits it (for example, it may not be called concurrently - with a "Discovery" function, but it may be called concurrently with an - "Audio" function. The plugin is responsible for any locking or - lock-free techniques necessary to make this possible. - - Note that in the simple case where state is only modified by restore(), - there are no synchronization issues since save() is never called - concurrently with restore() (though run() may read it during a save). - - Plugins that dynamically modify state while running, however, must take - care to do so in such a way that a concurrent call to save() will save a - consistent representation of plugin state for a single instant in time. - */ - LV2_State_Status (*save)(LV2_Handle instance, - LV2_State_Store_Function store, - LV2_State_Handle handle, - uint32_t flags, - const LV2_Feature* const* features); - - /** - Restore plugin state using a host-provided `retrieve` callback. - - @param instance The instance handle of the plugin. - @param retrieve The host-provided retrieve callback. - @param handle An opaque pointer to host data which MUST be passed as the - handle parameter to `retrieve` if it is called. - @param flags Currently unused. - @param features Extensible parameter for passing any additional - features to be used for this restore. - - The plugin MAY assume a restored value was set by a previous call to - LV2_State_Interface.save() by a plugin with the same URI. - - The plugin MUST gracefully fall back to a default value when a value can - not be retrieved. This allows the host to reset the plugin state with - an empty map. - - The `handle` pointer and `store` function MUST NOT be used - beyond the scope of restore(). - - This function is in the "Instantiation" threading class as defined by - LV2. This means it MUST NOT be called concurrently with any other - function on the same plugin instance. - */ - LV2_State_Status (*restore)(LV2_Handle instance, - LV2_State_Retrieve_Function retrieve, - LV2_State_Handle handle, - uint32_t flags, - const LV2_Feature* const* features); -} LV2_State_Interface; - -/** - Feature data for state:mapPath (@ref LV2_STATE__mapPath). -*/ -typedef struct { - /** - Opaque host data. - */ - LV2_State_Map_Path_Handle handle; - - /** - Map an absolute path to an abstract path for use in plugin state. - @param handle MUST be the `handle` member of this struct. - @param absolute_path The absolute path of a file. - @return An abstract path suitable for use in plugin state. - - The plugin MUST use this function to map any paths that will be stored - in plugin state. The returned value is an abstract path which MAY not - be an actual file system path; absolute_path() MUST be used to map - it to an actual path in order to use the file. - - Plugins MUST NOT make any assumptions about abstract paths except that - they can be mapped back to the absolute path of the "same" file (though - not necessarily the same original path) using absolute_path(). - - This function may only be called within the context of - LV2_State_Interface methods. The caller must free the returned value - with LV2_State_Free_Path.free_path(). - */ - char* (*abstract_path)(LV2_State_Map_Path_Handle handle, - const char* absolute_path); - - /** - Map an abstract path from plugin state to an absolute path. - @param handle MUST be the `handle` member of this struct. - @param abstract_path An abstract path (typically from plugin state). - @return An absolute file system path. - - The plugin MUST use this function in order to actually open or otherwise - use any paths loaded from plugin state. - - This function may only be called within the context of - LV2_State_Interface methods. The caller must free the returned value - with LV2_State_Free_Path.free_path(). - */ - char* (*absolute_path)(LV2_State_Map_Path_Handle handle, - const char* abstract_path); -} LV2_State_Map_Path; - -/** - Feature data for state:makePath (@ref LV2_STATE__makePath). -*/ -typedef struct { - /** - Opaque host data. - */ - LV2_State_Make_Path_Handle handle; - - /** - Return a path the plugin may use to create a new file. - @param handle MUST be the `handle` member of this struct. - @param path The path of the new file within a namespace unique to this - plugin instance. - @return The absolute path to use for the new file. - - This function can be used by plugins to create files and directories, - either at state saving time (if this feature is passed to - LV2_State_Interface.save()) or any time (if this feature is passed to - LV2_Descriptor.instantiate()). - - The host MUST do whatever is necessary for the plugin to be able to - create a file at the returned path (for example, using fopen()), - including creating any leading directories. - - If this function is passed to LV2_Descriptor.instantiate(), it may be - called from any non-realtime context. If it is passed to - LV2_State_Interface.save(), it may only be called within the dynamic - scope of that function call. - - The caller must free the returned value with - LV2_State_Free_Path.free_path(). - */ - char* (*path)(LV2_State_Make_Path_Handle handle, const char* path); -} LV2_State_Make_Path; - -/** - Feature data for state:freePath (@ref LV2_STATE__freePath). -*/ -typedef struct { - /** - Opaque host data. - */ - LV2_State_Free_Path_Handle handle; - - /** - Free a path returned by a state feature. - - @param handle MUST be the `handle` member of this struct. - @param path The path previously returned by a state feature. - - This function can be used by plugins to free paths allocated by the host - and returned by state features (LV2_State_Map_Path.abstract_path(), - LV2_State_Map_Path.absolute_path(), and LV2_State_Make_Path.path()). - */ - void (*free_path)(LV2_State_Free_Path_Handle handle, char* path); -} LV2_State_Free_Path; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_STATE_H */ diff --git a/lv2/state/state.meta.ttl b/lv2/state/state.meta.ttl deleted file mode 100644 index cebe0ac..0000000 --- a/lv2/state/state.meta.ttl +++ /dev/null @@ -1,477 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix state: . - - - a doap:Project ; - doap:created "2010-11-09" ; - doap:name "LV2 State" ; - doap:shortdesc "An interface for LV2 plugins to save and restore state." ; - doap:license ; - doap:developer , - ; - doap:maintainer ; - doap:release [ - doap:revision "2.10" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] - ] - ] , [ - doap:revision "2.8" ; - doap:created "2021-01-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix state:StateChanged URI in metadata and documentation." - ] - ] - ] , [ - doap:revision "2.6" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add state:freePath feature." - ] - ] - ] , [ - doap:revision "2.4" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add state:StateChanged for notification events." - ] - ] - ] , [ - doap:revision "2.2" ; - doap:created "2016-07-31" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add LV2_STATE_ERR_NO_SPACE status flag." - ] , [ - rdfs:label "Add state:threadSafeRestore feature for dropout-free state restoration." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2013-01-16" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add state:loadDefaultState feature so plugins can have their default state loaded without hard-coding default state as a special case." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a simple mechanism that allows hosts to save and restore -a plugin instance's state. The goal is for an instance's state to be -completely described by port values and a simple dictionary. - -The state defined here is conceptually a key:value dictionary, with URI keys -and values of any type. For performance reasons the key and value type are -actually a "URID", a URI mapped to an integer. A single key:value pair is -called a "property". - -This state model is simple yet has many benefits: - - * Both fast and extensible thanks to URID keys. - - * No limitations on possible value types. - - * Easy to serialise in almost any format. - - * Easy to store in a typical "map" or "dictionary" data structure. - - * Elegantly described in Turtle, so state can be described in LV2 data files - (including presets). - - * Does not impose any file formats, data structures, or file system - requirements. - - * Suitable for portable persistent state as well as fast in-memory snapshots. - - * Keys _may_ be well-defined and used meaningfully across several - implementations. - - * State _may_ be dynamic, but plugins are not required to have a dynamic - dictionary data structure available. - -To implement state, the plugin provides a state:interface to the host. To save -or restore, the host calls LV2_State_Interface::save() or -LV2_State_Interface::restore(), passing a callback to be used for handling a -single property. The host is free to implement property storage and retrieval -in any way. - -Since value types are defined by URI, any type is possible. However, a set of -standard types is defined by the [LV2 Atom](atom.html) extension. Use of these -types is recommended. Hosts MUST implement at least -[atom:String](atom.html#String), which is simply a C string. - -### Referring to Files - -Plugins may need to refer to existing files (such as loaded samples) in their -state. This is done by storing the file's path as a property just like any -other value. However, there are some rules which MUST be followed when storing -paths, see state:mapPath for details. Plugins MUST use the type -[atom:Path](atom.html#Path) for all paths in their state. - -Plugins are strongly encouraged to avoid creating files, instead storing all -state as properties. However, occasionally the ability to create files is -necessary. To make this possible, the host can provide the feature -state:makePath which allocates paths for plugin-created files. Plugins MUST -NOT create files in any other locations. - -### Plugin Code Example - - :::c - - /* Namespace for this plugin's keys. This SHOULD be something that could be - published as a document, even if that document does not exist right now. - */ - #define NS_MY "http://example.org/myplugin/schema#" - - #define DEFAULT_GREETING "Hello" - - LV2_Handle - my_instantiate(...) - { - MyPlugin* plugin = ...; - plugin->uris.atom_String = map_uri(LV2_ATOM__String); - plugin->uris.my_greeting = map_uri(NS_MY "greeting"); - plugin->state.greeting = strdup(DEFAULT_GREETING); - return plugin; - } - - LV2_State_Status - my_save(LV2_Handle instance, - LV2_State_Store_Function store, - LV2_State_Handle handle, - uint32_t flags, - const LV2_Feature *const * features) - { - MyPlugin* plugin = (MyPlugin*)instance; - const char* greeting = plugin->state.greeting; - - store(handle, - plugin->uris.my_greeting, - greeting, - strlen(greeting) + 1, // Careful! Need space for terminator - plugin->uris.atom_String, - LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE); - - return LV2_STATE_SUCCESS; - } - - LV2_State_Status - my_restore(LV2_Handle instance, - LV2_State_Retrieve_Function retrieve, - LV2_State_Handle handle, - uint32_t flags, - const LV2_Feature *const * features) - { - MyPlugin* plugin = (MyPlugin*)instance; - - size_t size; - uint32_t type; - uint32_t flags; - const char* greeting = retrieve( - handle, plugin->uris.my_greeting, &size, &type, &flags); - - if (greeting) { - free(plugin->state->greeting); - plugin->state->greeting = strdup(greeting); - } else { - plugin->state->greeting = strdup(DEFAULT_GREETING); - } - - return LV2_STATE_SUCCESS; - } - - const void* - my_extension_data(const char* uri) - { - static const LV2_State_Interface state_iface = { my_save, my_restore }; - if (!strcmp(uri, LV2_STATE__interface)) { - return &state_iface; - } - } - -### Host Code Example - - :::c - LV2_State_Status - store_callback(LV2_State_Handle handle, - uint32_t key, - const void* value, - size_t size, - uint32_t type, - uint32_t flags) - { - if ((flags & LV2_STATE_IS_POD)) { - // We only care about POD since we're keeping state in memory only. - // Disk or network use would also require LV2_STATE_IS_PORTABLE. - Map* state_map = (Map*)handle; - state_map->insert(key, Value(copy(value), size, type)); - return LV2_STATE_SUCCESS;; - } else { - return LV2_STATE_ERR_BAD_FLAGS; // Non-POD events are unsupported - } - } - - Map - get_plugin_state(LV2_Handle instance) - { - LV2_State* state = instance.extension_data(LV2_STATE__interface); - - // Request a fast/native/POD save, since we're just copying in memory - Map state_map; - state.save(instance, store_callback, &state_map, - LV2_STATE_IS_POD|LV2_STATE_IS_NATIVE); - - return state_map; - } - -### Extensions to this Specification - -It is likely that other interfaces for working with plugin state will be -developed as needed. This is encouraged, however everything SHOULD work within -the state _model_ defined here. That is, **do not complicate the state -model**. Implementations can assume the following: - - * The current port values and state dictionary completely describe a plugin - instance, at least well enough that saving and restoring will yield an - "identical" instance from the user's perspective. - - * Hosts are not expected to save and/or restore any other attributes of a - plugin instance. - -### The "Property Principle" - -The main benefit of this meaningful state model is that it can double as a -plugin control/query mechanism. For plugins that require more advanced control -than simple control ports, instead of defining a set of commands, define -properties whose values can be set appropriately. This provides both a way to -control and save that state "for free", since there is no need to define -commands _and_ a set of properties for storing their effects. In particular, -this is a good way for UIs to achieve more advanced control of plugins. - -This "property principle" is summed up in the phrase: "Don't stop; set playing -to false". - -This extension does not define a dynamic mechanism for state access and -manipulation. The [LV2 Patch](patch.html) extension defines a generic set of -messages which can be used to access or manipulate properties, and the [LV2 -Atom](atom.html) extension defines a port type and data container capable of -transmitting those messages. - -"""^^lv2:Markdown . - -state:interface - lv2:documentation """ - -A structure (LV2_State_Interface) which contains functions to be called by the -host to save and restore state. In order to support this extension, the plugin -must return a valid LV2_State_Interface from LV2_Descriptor::extension_data() -when it is called with URI LV2_STATE__interface. - -The plugin data file should describe this like so: - - :::turtle - @prefix state: . - - - a lv2:Plugin ; - lv2:extensionData state:interface . - -"""^^lv2:Markdown . - -state:State - lv2:documentation """ - -This type should be used wherever instance state is described. The properties -of a resource with this type correspond directly to the properties of the state -dictionary (except the property that states it has this type). - -"""^^lv2:Markdown . - -state:loadDefaultState - lv2:documentation """ - -This feature indicates that the plugin has default state listed with the -state:state property which should be loaded by the host before running the -plugin. Requiring this feature allows plugins to implement a single state -loading mechanism which works for initialisation as well as restoration, -without having to hard-code default state. - -To support this feature, the host MUST restore the default state after -instantiating the plugin but before calling run(). - -"""^^lv2:Markdown . - -state:state - lv2:documentation """ - -This property may be used anywhere a state needs to be described, for example: - - :::turtle - @prefix eg: . - - - state:state [ - eg:somekey "some value" ; - eg:someotherkey "some other value" ; - eg:favourite-number 2 - ] . - -"""^^lv2:Markdown . - -state:mapPath - lv2:documentation """ - -This feature maps absolute paths to/from abstract paths which are stored -in state. To support this feature a host must pass an LV2_Feature with URI -LV2_STATE__mapPath and data pointed to an LV2_State_Map_Path to the plugin's -LV2_State_Interface methods. - -The plugin MUST map _all_ paths stored in its state (including those inside any -files). This is necessary so that hosts can handle file system references -correctly, for example to share common files, or bundle state for distribution -or archival. - -For example, a plugin may write a path to a state file like so: - - :::c - void write_path(LV2_State_Map_Path* map_path, FILE* myfile, const char* path) - { - char* abstract_path = map_path->abstract_path(map_path->handle, path); - fprintf(myfile, "%s", abstract_path); - free(abstract_path); - } - -Then, later reload the path like so: - - :::c - char* read_path(LV2_State_Map_Path* map_path, FILE* myfile) - { - /* Obviously this is not production quality code! */ - char abstract_path[1024]; - fscanf(myfile, "%s", abstract_path); - return map_path->absolute_path(map_path->handle, abstract_path); - } - -"""^^lv2:Markdown . - -state:makePath - lv2:documentation """ - -This feature allows plugins to create new files and/or directories. To support -this feature the host passes an LV2_Feature with URI LV2_STATE__makePath and -data pointed to an LV2_State_Make_Path to the plugin. The host may make this -feature available only during save by passing it to -LV2_State_Interface::save(), or available any time by passing it to -LV2_Descriptor::instantiate(). If passed to LV2_State_Interface::save(), the -feature MUST NOT be used beyond the scope of that call. - -The plugin is guaranteed a hierarchical namespace unique to that plugin -instance, and may expect the returned path to have the requested path as a -suffix. There is one such namespace, even if the feature is passed to both -LV2_Descriptor::instantiate() and LV2_State_Interface::save(). Beyond this, -the plugin MUST NOT make any assumptions about the returned paths. - -Like any other paths, the plugin MUST map these paths using state:mapPath -before storing them in state. The plugin MUST NOT assume these paths will be -available across a save/restore otherwise, that is, only mapped paths saved to -state are persistent, any other created paths are temporary. - -For example, a plugin may create a file in a subdirectory like so: - - :::c - char* save_myfile(LV2_State_Make_Path* make_path) - { - char* path = make_path->path(make_path->handle, "foo/bar/myfile.txt"); - FILE* myfile = fopen(path, 'w'); - fprintf(myfile, "I am some data"); - fclose(myfile); - return path; - } - -"""^^lv2:Markdown . - -state:threadSafeRestore - lv2:documentation """ - -If a plugin supports this feature, its LV2_State_Interface::restore method is -thread-safe and may be called concurrently with audio class functions. - -To support this feature, the host MUST pass a -[work:schedule](worker.html#schedule) feature to the restore method, which will -be used to complete the state restoration. The usual mechanics of the worker -apply: the host will call the plugin's work method, which emits a response -which is later applied in the audio thread. - -The host is not required to block audio processing while restore() and work() -load the state, so this feature allows state to be restored without dropouts. - -"""^^lv2:Markdown . - -state:freePath - lv2:documentation """ - -This feature provides a function that can be used by plugins to free paths that -were allocated by the host via other state features (state:mapPath and -state:makePath). - -"""^^lv2:Markdown . - -state:StateChanged - lv2:documentation """ - -A notification that the internal state of the plugin has been changed in a way -that the host can not otherwise know about. - -This is a one-way notification, intended to be used as the type of an -[Object](atom.html#Object) sent from plugins when necessary. - -Plugins SHOULD emit such an event whenever a change has occurred that would -result in a different state being saved, but not when the host explicitly makes -a change which it knows is likely to have that effect, such as changing a -parameter. - -"""^^lv2:Markdown . - diff --git a/lv2/state/state.ttl b/lv2/state/state.ttl deleted file mode 100644 index 48537c8..0000000 --- a/lv2/state/state.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix state: . - - - a owl:Ontology ; - rdfs:label "LV2 State" ; - rdfs:comment "An interface for LV2 plugins to save and restore state." ; - rdfs:seeAlso , - ; - owl:imports . - -state:interface - a lv2:ExtensionData ; - rdfs:label "interface" ; - rdfs:comment "A plugin interface for saving and restoring state." . - -state:State - a rdfs:Class ; - rdfs:label "State" ; - rdfs:comment "LV2 plugin state." . - -state:loadDefaultState - a lv2:Feature ; - rdfs:label "load default state" ; - rdfs:comment "A feature indicating that the plugin has default state." . - -state:state - a rdf:Property , - owl:ObjectProperty ; - rdfs:label "state" ; - rdfs:range state:State ; - rdfs:comment "The state of an LV2 plugin instance." . - -state:mapPath - a lv2:Feature ; - rdfs:label "map path" ; - rdfs:comment "A feature for mapping between absolute and abstract file paths." . - -state:makePath - a lv2:Feature ; - rdfs:label "make path" ; - rdfs:comment "A feature for creating new files and directories." . - -state:threadSafeRestore - a lv2:Feature ; - rdfs:label "thread-safe restore" ; - rdfs:comment "A feature indicating support for thread-safe state restoration." . - -state:freePath - a lv2:Feature ; - rdfs:label "free path" ; - rdfs:comment "A feature for freeing paths allocated by the host." . - -state:StateChanged - a rdfs:Class ; - rdfs:label "State Changed" ; - rdfs:comment "A notification that the internal state of the plugin has changed." . - diff --git a/lv2/time.lv2/manifest.ttl b/lv2/time.lv2/manifest.ttl new file mode 100644 index 0000000..d80aa75 --- /dev/null +++ b/lv2/time.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso . + diff --git a/lv2/time.lv2/time.meta.ttl b/lv2/time.lv2/time.meta.ttl new file mode 100644 index 0000000..2b99cb7 --- /dev/null +++ b/lv2/time.lv2/time.meta.ttl @@ -0,0 +1,112 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . +@prefix time: . + + + a doap:Project ; + doap:name "LV2 Time" ; + doap:shortdesc "A vocabulary for describing musical time." ; + doap:created "2011-10-05" ; + doap:developer ; + doap:release [ + doap:revision "1.6" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Clarify time:beat origin." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2016-07-31" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Define LV2_TIME_PREFIX." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This is a vocabulary for describing a position in time and the speed of time +passage, in both real and musical terms. + +In addition to real time (based on seconds), two units of time are used: +_frames_ and _beats_. A frame is a numbered quantum of time. Frame time is +related to real-time by the _frame rate_ or _sample rate_, +time:framesPerSecond. A beat is a single pulse of musical time. Beat time is +related to real-time by the _tempo_, time:beatsPerMinute. + +Musical time additionally has a _meter_ which describes passage of time in +terms of musical _bars_. A bar is a higher level grouping of beats. The meter +describes how many beats are in one bar. + +"""^^lv2:Markdown . + +time:Position + lv2:documentation """ + +A point in time and/or the speed at which time is passing. A position is both +a point and a speed, which precisely defines a time within a timeline. + +"""^^lv2:Markdown . + +time:Rate + lv2:documentation """ + +The rate of passage of time in terms of one unit with respect to another. + +"""^^lv2:Markdown . + +time:beat + lv2:documentation """ + +This is not the beat within a bar like time:barBeat, but relative to the same +origin as time:bar and monotonically increases unless the transport is +repositioned. + +"""^^lv2:Markdown . + +time:beatUnit + lv2:documentation """ + +Beat unit, the note value that counts as one beat. This is the bottom number +in a time signature: 2 for half note, 4 for quarter note, and so on. + +"""^^lv2:Markdown . + +time:speed + lv2:documentation """ + +The rate of the progress of time as a fraction of normal speed. For example, a +rate of 0.0 is stopped, 1.0 is rolling at normal speed, 0.5 is rolling at half +speed, -1.0 is reverse, and so on. + +"""^^lv2:Markdown . + diff --git a/lv2/time.lv2/time.ttl b/lv2/time.lv2/time.ttl new file mode 100644 index 0000000..f3da9b0 --- /dev/null +++ b/lv2/time.lv2/time.ttl @@ -0,0 +1,121 @@ +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix time: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Time" ; + rdfs:comment "A vocabulary for describing musical time." ; + rdfs:seeAlso . + +time:Time + a rdfs:Class , + owl:Class ; + rdfs:subClassOf time:Position ; + rdfs:label "Time" ; + rdfs:comment "A point in time in some unit/dimension." . + +time:Position + a rdfs:Class , + owl:Class ; + rdfs:label "Position" ; + rdfs:comment "A point in time and/or the speed at which time is passing." . + +time:Rate + a rdfs:Class , + owl:Class ; + rdfs:subClassOf time:Position ; + rdfs:label "Rate" ; + rdfs:comment "The rate of passage of time." . + +time:position + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:range time:Position ; + rdfs:label "position" ; + rdfs:comment "A musical position." . + +time:barBeat + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:float ; + rdfs:label "beat within bar" ; + rdfs:comment "The beat number within the bar, from 0 to time:beatsPerBar." . + +time:bar + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:long ; + rdfs:label "bar" ; + rdfs:comment "A musical bar or measure." . + +time:beat + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:double ; + rdfs:label "beat" ; + rdfs:comment "The global running beat number." . + +time:beatUnit + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "beat unit" ; + rdfs:comment "The note value that counts as one beat." . + +time:beatsPerBar + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "beats per bar" ; + rdfs:comment "The number of beats in one bar." . + +time:beatsPerMinute + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "beats per minute" ; + rdfs:comment "Tempo in beats per minute." . + +time:frame + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:long ; + rdfs:label "frame" ; + rdfs:comment "A time stamp in audio frames." . + +time:framesPerSecond + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "frames per second" ; + rdfs:comment "Frame rate in frames per second." . + +time:speed + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "speed" ; + rdfs:comment "The rate of the progress of time as a fraction of normal speed." . + diff --git a/lv2/time/manifest.ttl b/lv2/time/manifest.ttl deleted file mode 100644 index d80aa75..0000000 --- a/lv2/time/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 6 ; - rdfs:seeAlso . - diff --git a/lv2/time/meson.build b/lv2/time/meson.build deleted file mode 100644 index 5f47e89..0000000 --- a/lv2/time/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'time' -path = 'ns' / 'ext' / 'time' - -time_data = files( - 'time.meta.ttl', - 'time.ttl', - 'manifest.ttl', -) - -headers = files( - 'time.h', -) - -# Install specification bundle -install_data(time_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_time_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('time.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/time/time.h b/lv2/time/time.h deleted file mode 100644 index 1dce219..0000000 --- a/lv2/time/time.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2011-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_TIME_H -#define LV2_TIME_H - -/** - @defgroup time Time - @ingroup lv2 - - Properties for describing time. - - Note the time extension is purely data, this header merely defines URIs for - convenience. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_TIME_URI "http://lv2plug.in/ns/ext/time" ///< http://lv2plug.in/ns/ext/time -#define LV2_TIME_PREFIX LV2_TIME_URI "#" ///< http://lv2plug.in/ns/ext/time# - -#define LV2_TIME__Time LV2_TIME_PREFIX "Time" ///< http://lv2plug.in/ns/ext/time#Time -#define LV2_TIME__Position LV2_TIME_PREFIX "Position" ///< http://lv2plug.in/ns/ext/time#Position -#define LV2_TIME__Rate LV2_TIME_PREFIX "Rate" ///< http://lv2plug.in/ns/ext/time#Rate -#define LV2_TIME__position LV2_TIME_PREFIX "position" ///< http://lv2plug.in/ns/ext/time#position -#define LV2_TIME__barBeat LV2_TIME_PREFIX "barBeat" ///< http://lv2plug.in/ns/ext/time#barBeat -#define LV2_TIME__bar LV2_TIME_PREFIX "bar" ///< http://lv2plug.in/ns/ext/time#bar -#define LV2_TIME__beat LV2_TIME_PREFIX "beat" ///< http://lv2plug.in/ns/ext/time#beat -#define LV2_TIME__beatUnit LV2_TIME_PREFIX "beatUnit" ///< http://lv2plug.in/ns/ext/time#beatUnit -#define LV2_TIME__beatsPerBar LV2_TIME_PREFIX "beatsPerBar" ///< http://lv2plug.in/ns/ext/time#beatsPerBar -#define LV2_TIME__beatsPerMinute LV2_TIME_PREFIX "beatsPerMinute" ///< http://lv2plug.in/ns/ext/time#beatsPerMinute -#define LV2_TIME__frame LV2_TIME_PREFIX "frame" ///< http://lv2plug.in/ns/ext/time#frame -#define LV2_TIME__framesPerSecond LV2_TIME_PREFIX "framesPerSecond" ///< http://lv2plug.in/ns/ext/time#framesPerSecond -#define LV2_TIME__speed LV2_TIME_PREFIX "speed" ///< http://lv2plug.in/ns/ext/time#speed - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_TIME_H */ diff --git a/lv2/time/time.meta.ttl b/lv2/time/time.meta.ttl deleted file mode 100644 index 2b99cb7..0000000 --- a/lv2/time/time.meta.ttl +++ /dev/null @@ -1,112 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix time: . - - - a doap:Project ; - doap:name "LV2 Time" ; - doap:shortdesc "A vocabulary for describing musical time." ; - doap:created "2011-10-05" ; - doap:developer ; - doap:release [ - doap:revision "1.6" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Clarify time:beat origin." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2016-07-31" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Define LV2_TIME_PREFIX." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This is a vocabulary for describing a position in time and the speed of time -passage, in both real and musical terms. - -In addition to real time (based on seconds), two units of time are used: -_frames_ and _beats_. A frame is a numbered quantum of time. Frame time is -related to real-time by the _frame rate_ or _sample rate_, -time:framesPerSecond. A beat is a single pulse of musical time. Beat time is -related to real-time by the _tempo_, time:beatsPerMinute. - -Musical time additionally has a _meter_ which describes passage of time in -terms of musical _bars_. A bar is a higher level grouping of beats. The meter -describes how many beats are in one bar. - -"""^^lv2:Markdown . - -time:Position - lv2:documentation """ - -A point in time and/or the speed at which time is passing. A position is both -a point and a speed, which precisely defines a time within a timeline. - -"""^^lv2:Markdown . - -time:Rate - lv2:documentation """ - -The rate of passage of time in terms of one unit with respect to another. - -"""^^lv2:Markdown . - -time:beat - lv2:documentation """ - -This is not the beat within a bar like time:barBeat, but relative to the same -origin as time:bar and monotonically increases unless the transport is -repositioned. - -"""^^lv2:Markdown . - -time:beatUnit - lv2:documentation """ - -Beat unit, the note value that counts as one beat. This is the bottom number -in a time signature: 2 for half note, 4 for quarter note, and so on. - -"""^^lv2:Markdown . - -time:speed - lv2:documentation """ - -The rate of the progress of time as a fraction of normal speed. For example, a -rate of 0.0 is stopped, 1.0 is rolling at normal speed, 0.5 is rolling at half -speed, -1.0 is reverse, and so on. - -"""^^lv2:Markdown . - diff --git a/lv2/time/time.ttl b/lv2/time/time.ttl deleted file mode 100644 index a4085c6..0000000 --- a/lv2/time/time.ttl +++ /dev/null @@ -1,122 +0,0 @@ -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix time: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Time" ; - rdfs:comment "A vocabulary for describing musical time." ; - rdfs:seeAlso , - . - -time:Time - a rdfs:Class , - owl:Class ; - rdfs:subClassOf time:Position ; - rdfs:label "Time" ; - rdfs:comment "A point in time in some unit/dimension." . - -time:Position - a rdfs:Class , - owl:Class ; - rdfs:label "Position" ; - rdfs:comment "A point in time and/or the speed at which time is passing." . - -time:Rate - a rdfs:Class , - owl:Class ; - rdfs:subClassOf time:Position ; - rdfs:label "Rate" ; - rdfs:comment "The rate of passage of time." . - -time:position - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:range time:Position ; - rdfs:label "position" ; - rdfs:comment "A musical position." . - -time:barBeat - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Time ; - rdfs:range xsd:float ; - rdfs:label "beat within bar" ; - rdfs:comment "The beat number within the bar, from 0 to time:beatsPerBar." . - -time:bar - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Time ; - rdfs:range xsd:long ; - rdfs:label "bar" ; - rdfs:comment "A musical bar or measure." . - -time:beat - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Time ; - rdfs:range xsd:double ; - rdfs:label "beat" ; - rdfs:comment "The global running beat number." . - -time:beatUnit - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Rate ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "beat unit" ; - rdfs:comment "The note value that counts as one beat." . - -time:beatsPerBar - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Rate ; - rdfs:range xsd:float ; - rdfs:label "beats per bar" ; - rdfs:comment "The number of beats in one bar." . - -time:beatsPerMinute - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Rate ; - rdfs:range xsd:float ; - rdfs:label "beats per minute" ; - rdfs:comment "Tempo in beats per minute." . - -time:frame - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Time ; - rdfs:range xsd:long ; - rdfs:label "frame" ; - rdfs:comment "A time stamp in audio frames." . - -time:framesPerSecond - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Rate ; - rdfs:range xsd:float ; - rdfs:label "frames per second" ; - rdfs:comment "Frame rate in frames per second." . - -time:speed - a rdf:Property , - owl:DatatypeProperty , - owl:FunctionalProperty ; - rdfs:domain time:Rate ; - rdfs:range xsd:float ; - rdfs:label "speed" ; - rdfs:comment "The rate of the progress of time as a fraction of normal speed." . - diff --git a/lv2/ui.lv2/manifest.ttl b/lv2/ui.lv2/manifest.ttl new file mode 100644 index 0000000..d3b12b5 --- /dev/null +++ b/lv2/ui.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 24 ; + rdfs:seeAlso . + diff --git a/lv2/ui.lv2/ui.meta.ttl b/lv2/ui.lv2/ui.meta.ttl new file mode 100644 index 0000000..95336bf --- /dev/null +++ b/lv2/ui.lv2/ui.meta.ttl @@ -0,0 +1,639 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdf: . +@prefix rdfs: . +@prefix ui: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 UI" ; + doap:shortdesc "User interfaces for LV2 plugins." ; + doap:created "2006-00-00" ; + doap:developer ; + doap:maintainer ; + doap:release [ + doap:revision "2.24" ; + doap:created "2022-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] , [ + rdfs:label "Deprecate ui:resize." + ] + ] + ] , [ + doap:revision "2.22" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add ui:requestValue feature." + ] , [ + rdfs:label "Add ui:scaleFactor, ui:foregroundColor, and ui:backgroundColor properties." + ] , [ + rdfs:label "Deprecate ui:binary." + ] + ] + ] , [ + doap:revision "2.20" ; + doap:created "2015-07-25" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Improve documentation." + ] , [ + rdfs:label "Add missing property labels." + ] + ] + ] , [ + doap:revision "2.18" ; + doap:created "2014-08-08" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add show interface so UIs can gracefully degrade to separate windows if hosts can not use their widget directly." + ] , [ + rdfs:label "Fix identifier typos in documentation." + ] + ] + ] , [ + doap:revision "2.16" ; + doap:created "2014-01-04" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix LV2_UI_INVALID_PORT_INDEX identifier in documentation." + ] + ] + ] , [ + doap:revision "2.14" ; + doap:created "2013-03-18" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add idle interface so native UIs and foreign toolkits can drive their event loops." + ] , [ + rdfs:label "Add ui:updateRate property." + ] + ] + ] , [ + doap:revision "2.12" ; + doap:created "2012-12-01" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix incorrect linker flag in ui:makeSONameResident documentation." + ] + ] + ] , [ + doap:revision "2.10" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add types for WindowsUI, CocoaUI, and Gtk3UI." + ] , [ + rdfs:label "Use consistent label style." + ] , [ + rdfs:label "Add missing LV2_SYMBOL_EXPORT declaration for lv2ui_descriptor prototype." + ] + ] + ] , [ + doap:revision "2.8" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add ui:parent and ui:resize." + ] , [ + rdfs:label "Add support for referring to ports by symbol." + ] , [ + rdfs:label "Add ui:portMap for accessing ports by symbol, allowing for UIs to be distributed separately from plugins." + ] , [ + rdfs:label "Add port protocols and a dynamic notification subscription mechanism, for more flexible communication, and audio port metering without control port kludges." + ] , [ + rdfs:label "Add touch feature to notify the host that the user has grabbed a control." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "2.4" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Deprecate ui:makeSONameResident." + ] , [ + rdfs:label "Add Qt4 and X11 widget types." + ] , [ + rdfs:label "Install header to URI-based system path." + ] , [ + rdfs:label "Add pkg-config file." + ] , [ + rdfs:label "Make ui.ttl a valid OWL 2 DL ontology." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2011-05-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system (for installation)." + ] , [ + rdfs:label "Convert documentation to HTML and use lv2:documentation." + ] , [ + rdfs:label "Use lv2:Specification to be discovered as an extension." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2010-10-06" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension makes it possible to create user interfaces for LV2 plugins. + +UIs are implemented as an LV2UI_Descriptor loaded via lv2ui_descriptor() in a +shared library, and are distributed in bundles just like plugins. + +UIs are associated with plugins in data: + + :::turtle + @prefix ui: . + + ui:ui . + a ui:X11UI ; + lv2:binary . + +where `http://my.plugin` is the URI of the plugin, `http://my.pluginui` is the +URI of the plugin UI and `myui.so` is the relative URI to the shared object +file. + +While it is possible to have the plugin UI and the plugin in the same shared +object file, it is a good idea to keep them separate so that hosts can avoid +loading the UI code if they do not need it. A UI MUST specify its class in the +RDF data (`ui:X11UI` in the above example). The class defines what type the UI +is, for example what graphics toolkit it uses. Any type of UI class can be +defined separately from this extension. + +It is possible to have multiple UIs for the same plugin, or to have the UI for +a plugin in a different bundle from the actual plugin. This allows plugin UIs +to be written independently. + +Note that the process that loads the shared object file containing the UI code +and the process that loads the shared object file containing the actual plugin +implementation are not necessarily the same process (and not even necessarily +on the same machine). This means that plugin and UI code MUST NOT use +singletons and global variables and expect them to refer to the same objects in +the UI and the actual plugin. The function callback interface defined in this +header is the only method of communication between UIs and plugin instances +(extensions may define more, though this is discouraged unless absolutely +necessary since the significant benefits of network transparency and +serialisability are lost). + +UI functionality may be extended via features, much like plugins: + + :::turtle + lv2:requiredFeature . + lv2:optionalFeature . + +The rules for a UI with a required or optional feature are identical to those +of lv2:Plugin instances: if a UI declares a feature as required, the host is +NOT allowed to load it unless it supports that feature; and if it does support +a feature, it MUST pass an appropriate LV2_Feature struct to the UI's +instantiate() method. This extension defines several standard features for +common functionality. + +UIs written to this specification do not need to be thread-safe. All functions +may only be called in the UI thread. There is only one UI thread (for +toolkits, the one the UI main loop runs in). There is no requirement that a +UI actually be a graphical widget. + +Note that UIs are completely separate from plugins. From the plugin's +perspective, control from a UI is indistinguishable from any other control, as +it all occurs via ports. + +"""^^lv2:Markdown . + +ui:GtkUI + lv2:documentation """ + +The host must guarantee that the Gtk+ 2 library has been initialised and the +Glib main loop is running before the UI is instantiated. Note that this UI +type is not suitable for binary distribution since multiple versions of Gtk can +not be used in the same process. + +"""^^lv2:Markdown . + +ui:Gtk3UI + lv2:documentation """ + +The host must guarantee that the Gtk+ 3 library has been initialised and the +Glib main loop is running before the UI is instantiated. Note that this UI +type is not suitable for binary distribution since multiple versions of Gtk can +not be used in the same process. + +"""^^lv2:Markdown . + +ui:Qt4UI + lv2:documentation """ + +The host must guarantee that the Qt4 library has been initialised and the Qt4 +main loop is running before the UI is instantiated. Note that this UI type is +not suitable for binary distribution since multiple versions of Qt can not be +used in the same process. + +"""^^lv2:Markdown . + +ui:Qt5UI + lv2:documentation """ + +The host must guarantee that the Qt5 library has been initialised and the Qt5 +main loop is running before the UI is instantiated. Note that this UI type is +not suitable for binary distribution since multiple versions of Qt can not be +used in the same process. + +"""^^lv2:Markdown . + +ui:X11UI + lv2:documentation """ + +Note that the LV2UI_Widget for this type of UI is not a pointer, but should be +interpreted directly as an X11 `Window` ID. This is the native UI type on most +POSIX systems. + +"""^^lv2:Markdown . + +ui:WindowsUI + lv2:documentation """ + +Note that the LV2UI_Widget for this type of UI is not a pointer, but should be +interpreted directly as a `HWND`. This is the native UI type on Microsoft +Windows. + +"""^^lv2:Markdown . + +ui:CocoaUI + lv2:documentation """ + +This is the native UI type on Mac OS X. + +"""^^lv2:Markdown . + +ui:binary + lv2:documentation """ + +This property is redundant and deprecated: new UIs should use lv2:binary +instead, however hosts must still support ui:binary. + +"""^^lv2:Markdown . + +ui:makeSONameResident + lv2:documentation """ + +This feature was intended to support UIs that link against toolkit libraries +which may not be unloaded during the lifetime of the host. This is better +achieved by using the appropriate flags when linking the UI, for example `gcc +-Wl,-z,nodelete`. + +"""^^lv2:Markdown . + +ui:noUserResize + lv2:documentation """ + +If a UI has this feature, it indicates that it does not make sense to let the +user resize the main widget, and the host should prevent that. This feature +may not make sense for all UI types. The data pointer for this feature should +always be set to NULL. + +"""^^lv2:Markdown . + +ui:fixedSize + lv2:documentation """ + +If a UI has this feature, it indicates the same thing as ui:noUserResize, and +additionally that the UI will not resize itself on its own. That is, the UI +will always remain the same size. This feature may not make sense for all UI +types. The data pointer for this feature should always be set to NULL. + +"""^^lv2:Markdown . + +ui:scaleFactor + lv2:documentation """ + +HiDPI (High Dots Per Inch) displays have a high resolution on a relatively +small form factor. Many systems use a scale factor to compensate for this, so +for example, a scale factor of 2 means things are drawn twice as large as +normal. + +Hosts can pass this as an option to UIs to communicate this information, so +that the UI can draw at an appropriate scale. + +"""^^lv2:Markdown . + +ui:backgroundColor + lv2:documentation """ + +The background color of the host's UI. The host can pass this as an option so +that UIs can integrate nicely with the host window around it. + +Hosts should pass this as an option to UIs with an integer RGBA32 color value. +If the value is a 32-bit integer, it is guaranteed to be in RGBA32 format, but +the UI must check the value type and not assume this, to allow for other types +of color in the future. + +"""^^lv2:Markdown . + +ui:foregroundColor + lv2:documentation """ + +The foreground color of the host's UI. The host can pass this as an option so +that UIs can integrate nicely with the host window around it. + +Hosts should pass this as an option to UIs with an integer RGBA32 color value. +If the value is a 32-bit integer, it is guaranteed to be in RGBA32 format, but +the UI must check the value type and not assume this, to allow for other types +of color in the future. + +"""^^lv2:Markdown . + +ui:parent + lv2:documentation """ + +This feature can be used to pass a parent that the UI should be a child of. +The format of data pointer of this feature is determined by the UI type, and is +generally the same type as the LV2UI_Widget that the UI would return. For +example, for a ui:X11UI, the parent should be a `Window`. This is particularly +useful for embedding, where the parent often must be known at construction time +for embedding to work correctly. + +UIs should not _require_ this feature unless it is necessary for them to work +at all, but hosts should provide it whenever possible. + +"""^^lv2:Markdown . + +ui:PortNotification + lv2:documentation """ + +This describes which ports the host must send notifications to the UI about. +The port must be specific either by index, using the ui:portIndex property, or +symbol, using the lv2:symbol property. Since port indices are not guaranteed +to be stable, using the symbol is recommended, and the inde MUST NOT be used +except by UIs that are shipped in the same bundle as the corresponding plugin. + +"""^^lv2:Markdown . + +ui:portNotification + lv2:documentation """ + +Specifies that a UI should receive notifications about changes to a particular +port's value via LV2UI_Descriptor::port_event(). + +For example: + + :::turtle + eg:ui + a ui:X11UI ; + ui:portNotification [ + ui:plugin eg:plugin ; + lv2:symbol "gain" ; + ui:protocol ui:floatProtocol + ] . + +"""^^lv2:Markdown . + +ui:notifyType + lv2:documentation """ + +Specifies a particular type that the UI should be notified of. + +This is useful for message-based ports where several types of data can be +present, but only some are interesting to the UI. For example, if UI control +is multiplexed in the same port as MIDI, this property can be used to ensure +that only the relevant events are forwarded to the UI, and not potentially high +frequency MIDI data. + +"""^^lv2:Markdown . + +ui:resize + lv2:documentation """ + +This feature corresponds to the LV2UI_Resize struct, which should be passed +with the URI LV2_UI__resize. This struct may also be provided by the UI as +extension data using the same URI, in which case it is used by the host to +request that the UI change its size. + +"""^^lv2:Markdown . + +ui:portMap + lv2:documentation """ + +This makes it possible to implement and distribute UIs separately from the +plugin binaries they control. + +This feature corresponds to the LV2UI_Port_Index struct, which should be passed +with the URI LV2_UI__portIndex. + +"""^^lv2:Markdown . + +ui:portSubscribe + lv2:documentation """ + +This makes it possible for a UI to explicitly request a particular style of +update from a port at run-time, in a more flexible and powerful way than +listing subscriptions statically allows. + +This feature corresponds to the LV2UI_Port_Subscribe struct, which should be +passed with the URI LV2_UI__portSubscribe. + +"""^^lv2:Markdown . + +ui:touch + lv2:documentation """ + +This is useful for automation, so the host can allow the user to take control +of a port, even if that port would otherwise be automated (much like grabbing a +physical motorised fader). + +It can also be used for MIDI learn or in any other situation where the host +needs to do something with a particular control and it would be convenient for +the user to select it directly from the plugin UI. + +This feature corresponds to the LV2UI_Touch struct, which should be passed with +the URI LV2_UI__touch. + +"""^^lv2:Markdown . + +ui:requestValue + lv2:documentation """ + +This allows a plugin UI to request a new parameter value using the host's UI, +for example by showing a dialog or integrating with the host's built-in content +browser. This should only be used for complex parameter types where the plugin +UI is not capable of showing the expected native platform or host interface to +choose a value, such as file path parameters. + +This feature corresponds to the LV2UI_Request_Value struct, which should be +passed with the URI LV2_UI__requestValue. + +"""^^lv2:Markdown . + +ui:idleInterface + lv2:documentation """ + +To support this feature, the UI should list it as a lv2:optionalFeature or +lv2:requiredFeature in its data, and also as lv2:extensionData. When the UI's +extension_data() is called with this URI (LV2_UI__idleInterface), it should +return a pointer to an LV2UI_Idle_Interface. + +To indicate support, the host should pass a feature to instantiate() with this +URI, with NULL for data. + +"""^^lv2:Markdown . + +ui:showInterface + lv2:documentation """ + +This allows UIs to gracefully degrade to separate windows when the host is +unable to embed the UI widget for whatever reason. When the UI's +extension_data() is called with this URI (LV2_UI__showInterface), it should +return a pointer to an LV2UI_Show_Interface. + +"""^^lv2:Markdown . + +ui:PortProtocol + lv2:documentation """ + +A PortProtocol MUST define: + +Port Type +: Which plugin port types the buffer type is valid for. + +Feature Data +: What data (if any) should be passed in the LV2_Feature. + +A PortProtocol for an output port MUST define: + +Update Frequency +: When the host should call port_event(). + +Update Format +: The format of the data in the buffer passed to port_event(). + +Options +: The format of the options passed to subscribe() and unsubscribe(). + +A PortProtocol for an input port MUST define: + +Write Format +: The format of the data in the buffer passed to write_port(). + +Write Effect +: What happens when the UI calls write_port(). + +For an example, see ui:floatProtocol or ui:peakProtocol. + +PortProtocol is a subclass of lv2:Feature, so UIs use lv2:optionalFeature and +lv2:requiredFeature to specify which PortProtocols they want to use. + +"""^^lv2:Markdown . + +ui:floatProtocol + lv2:documentation """ + +A protocol for transferring single floating point values. The rules for this +protocol are: + +Port Type +: lv2:ControlPort + +Feature Data +: None. + +Update Frequency +: The host SHOULD call port_event() as soon as possible when the port value has + changed, but there are no timing guarantees. + +Update Format +: A single float. + +Options +: None. + +Write Format +: A single float. + +Write Effect +: The host SHOULD set the port to the received value as soon as possible, but + there is no guarantee that run() actually sees this value. + +"""^^lv2:Markdown . + +ui:peakProtocol + lv2:documentation """ + +This port protocol defines a way for the host to send continuous peak +measurements of the audio signal at a certain port to the UI. The intended use +is visualisation, for example an animated meter widget that shows the level of +the audio input or output. + +A contiguous sequence of audio samples for which a peak value has been computed +is called a _measurement period_. + +The rules for this protocol are: + +Port Type +: lv2:AudioPort + +Feature Data +: None. + +Update Frequency +: The host SHOULD call port_event() at regular intervals. The measurement + periods used for calls to port_event() for the same port SHOULD be + contiguous (i.e. the measurement period for one call should begin right + after the end of the measurement period for the previous call ends) unless + the UI has removed and re-added the port subscription between those calls. + However, UIs MUST NOT depend on either the regularity of the calls or the + contiguity of the measurement periods; hosts may change the call rate or + skip calls for performance or other reasons. Measurement periods for + different calls to port_event() for the same port MUST NOT overlap. + +Update Format +: A single LV2UI_Peak_Data object. + +Options +: None. + +Write Format +: None. + +Write Effect +: None. + +"""^^lv2:Markdown . + diff --git a/lv2/ui.lv2/ui.ttl b/lv2/ui.lv2/ui.ttl new file mode 100644 index 0000000..1c2e455 --- /dev/null +++ b/lv2/ui.lv2/ui.ttl @@ -0,0 +1,249 @@ +@prefix lv2: . +@prefix opts: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix ui: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 UI" ; + rdfs:comment "User interfaces for LV2 plugins." ; + rdfs:seeAlso ; + owl:imports , + . + +ui:UI + a rdfs:Class , + owl:Class ; + rdfs:label "User Interface" ; + rdfs:comment "A UI for an LV2 plugin." . + +ui:GtkUI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "GTK2 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Gtk+ 2.0 GtkWidget." . + +ui:Gtk3UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "GTK3 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Gtk+ 3.0 GtkWidget." . + +ui:Qt4UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Qt4 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Qt4 QWidget." . + +ui:Qt5UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Qt5 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Qt5 QWidget." . + +ui:X11UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "X11 UI" ; + rdfs:comment "A UI where the widget is an X11 Window window ID." . + +ui:WindowsUI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Windows UI" ; + rdfs:comment "A UI where the widget is a Windows HWND window ID." . + +ui:CocoaUI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Cocoa UI" ; + rdfs:comment "A UI where the widget is a pointer to a NSView." . + +ui:ui + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:Plugin ; + rdfs:range ui:UI ; + rdfs:label "user interface" ; + rdfs:comment "Relates a plugin to a UI that applies to it." . + +ui:binary + a rdf:Property , + owl:ObjectProperty ; + owl:sameAs lv2:binary ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "binary" ; + rdfs:comment "The shared library that a UI resides in." . + +ui:makeSONameResident + a lv2:Feature ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "make SO name resident" ; + rdfs:comment "UI binary must not be unloaded." . + +ui:noUserResize + a lv2:Feature ; + rdfs:label "no user resize" ; + rdfs:comment "Non-resizable UI." . + +ui:fixedSize + a lv2:Feature ; + rdfs:label "fixed size" ; + rdfs:comment "Non-resizable UI that will never resize itself." . + +ui:scaleFactor + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:range xsd:float ; + rdfs:label "scale factor" ; + rdfs:comment "Scale factor for high resolution screens." . + +ui:backgroundColor + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "background color" ; + rdfs:comment """The background color of the host's UI.""" . + +ui:foregroundColor + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "foreground color" ; + rdfs:comment """The foreground color of the host's UI.""" . + +ui:parent + a lv2:Feature ; + rdfs:label "parent" ; + rdfs:comment "The parent for a UI." . + +ui:PortNotification + a rdfs:Class , + owl:Class ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty ui:plugin ; + owl:cardinality 1 ; + rdfs:comment "A PortNotification MUST have exactly one ui:plugin." + ] ; + rdfs:label "Port Notification" ; + rdfs:comment "A description of port updates that a host must send a UI." . + +ui:portNotification + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:UI ; + rdfs:range ui:PortNotification ; + rdfs:label "port notification" ; + rdfs:comment "Specifies a port notification that is required by a UI." . + +ui:plugin + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:PortNotification ; + rdfs:range lv2:Plugin ; + rdfs:label "plugin" ; + rdfs:comment "The plugin a portNotification applies to." . + +ui:portIndex + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain ui:PortNotification ; + rdfs:range xsd:decimal ; + rdfs:label "port index" ; + rdfs:comment "The index of the port a portNotification applies to." . + +ui:notifyType + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:PortNotification ; + rdfs:label "notify type" ; + rdfs:comment "A particular type that the UI should be notified of." . + +ui:resize + a lv2:Feature , + lv2:ExtensionData ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "resize" ; + rdfs:comment """A feature that provides control of, and notifications about, a UI's size.""" . + +ui:portMap + a lv2:Feature ; + rdfs:label "port map" ; + rdfs:comment "A feature for accessing the index of a port by symbol." . + +ui:portSubscribe + a lv2:Feature ; + rdfs:label "port subscribe" ; + rdfs:comment "A feature for dynamically subscribing to updates from a port." . + +ui:touch + a lv2:Feature ; + rdfs:label "touch" ; + rdfs:comment "A feature to notify that the user has grabbed a port control." . + +ui:requestValue + a lv2:Feature ; + rdfs:label "request value" ; + rdfs:comment "A feature to request a parameter value from the user via the host." . + +ui:idleInterface + a lv2:Feature , + lv2:ExtensionData ; + rdfs:label "idle interface" ; + rdfs:comment "A feature that provides a callback for the host to drive the UI." . + +ui:showInterface + a lv2:ExtensionData ; + rdfs:label "show interface" ; + rdfs:comment "An interface for showing and hiding a window for a UI." . + +ui:windowTitle + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:string ; + rdfs:label "window title" ; + rdfs:comment "The title for the window shown by LV2UI_Show_Interface." . + +ui:updateRate + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:float ; + rdfs:label "update rate" ; + rdfs:comment "The target rate, in Hz, to send updates to the UI." . + +ui:protocol + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:PortNotification ; + rdfs:range ui:PortProtocol ; + rdfs:label "protocol" ; + rdfs:comment "The protocol to be used for this notification." . + +ui:PortProtocol + a rdfs:Class ; + rdfs:subClassOf lv2:Feature ; + rdfs:label "Port Protocol" ; + rdfs:comment "A method to communicate port data between a UI and plugin." . + +ui:floatProtocol + a ui:PortProtocol ; + rdfs:label "float protocol" ; + rdfs:comment "A protocol for transferring single floating point values." . + +ui:peakProtocol + a ui:PortProtocol ; + rdfs:label "peak protocol" ; + rdfs:comment "A protocol for sending continuous peak measurements of an audio signal." . + diff --git a/lv2/ui/manifest.ttl b/lv2/ui/manifest.ttl deleted file mode 100644 index d3b12b5..0000000 --- a/lv2/ui/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 2 ; - lv2:microVersion 24 ; - rdfs:seeAlso . - diff --git a/lv2/ui/meson.build b/lv2/ui/meson.build deleted file mode 100644 index 3eb4223..0000000 --- a/lv2/ui/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'ui' -path = 'ns' / 'extensions' / 'ui' - -ui_data = files( - 'ui.meta.ttl', - 'ui.ttl', - 'manifest.ttl', -) - -headers = files( - 'ui.h', -) - -# Install specification bundle -install_data(ui_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_ui_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('ui.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'extensions', - output: name + '.html', - ) -endif diff --git a/lv2/ui/ui.h b/lv2/ui/ui.h deleted file mode 100644 index fb41d90..0000000 --- a/lv2/ui/ui.h +++ /dev/null @@ -1,543 +0,0 @@ -/* - LV2 UI Extension - Copyright 2009-2016 David Robillard - Copyright 2006-2011 Lars Luthman - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_UI_H -#define LV2_UI_H - -/** - @defgroup ui User Interfaces - @ingroup lv2 - - User interfaces of any type for plugins. - - See for details. - - @{ -*/ - -#include "lv2/core/lv2.h" -#include "lv2/urid/urid.h" - -#include -#include - -// clang-format off - -#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui" ///< http://lv2plug.in/ns/extensions/ui -#define LV2_UI_PREFIX LV2_UI_URI "#" ///< http://lv2plug.in/ns/extensions/ui# - -#define LV2_UI__CocoaUI LV2_UI_PREFIX "CocoaUI" ///< http://lv2plug.in/ns/extensions/ui#CocoaUI -#define LV2_UI__Gtk3UI LV2_UI_PREFIX "Gtk3UI" ///< http://lv2plug.in/ns/extensions/ui#Gtk3UI -#define LV2_UI__GtkUI LV2_UI_PREFIX "GtkUI" ///< http://lv2plug.in/ns/extensions/ui#GtkUI -#define LV2_UI__PortNotification LV2_UI_PREFIX "PortNotification" ///< http://lv2plug.in/ns/extensions/ui#PortNotification -#define LV2_UI__PortProtocol LV2_UI_PREFIX "PortProtocol" ///< http://lv2plug.in/ns/extensions/ui#PortProtocol -#define LV2_UI__Qt4UI LV2_UI_PREFIX "Qt4UI" ///< http://lv2plug.in/ns/extensions/ui#Qt4UI -#define LV2_UI__Qt5UI LV2_UI_PREFIX "Qt5UI" ///< http://lv2plug.in/ns/extensions/ui#Qt5UI -#define LV2_UI__UI LV2_UI_PREFIX "UI" ///< http://lv2plug.in/ns/extensions/ui#UI -#define LV2_UI__WindowsUI LV2_UI_PREFIX "WindowsUI" ///< http://lv2plug.in/ns/extensions/ui#WindowsUI -#define LV2_UI__X11UI LV2_UI_PREFIX "X11UI" ///< http://lv2plug.in/ns/extensions/ui#X11UI -#define LV2_UI__binary LV2_UI_PREFIX "binary" ///< http://lv2plug.in/ns/extensions/ui#binary -#define LV2_UI__fixedSize LV2_UI_PREFIX "fixedSize" ///< http://lv2plug.in/ns/extensions/ui#fixedSize -#define LV2_UI__idleInterface LV2_UI_PREFIX "idleInterface" ///< http://lv2plug.in/ns/extensions/ui#idleInterface -#define LV2_UI__noUserResize LV2_UI_PREFIX "noUserResize" ///< http://lv2plug.in/ns/extensions/ui#noUserResize -#define LV2_UI__notifyType LV2_UI_PREFIX "notifyType" ///< http://lv2plug.in/ns/extensions/ui#notifyType -#define LV2_UI__parent LV2_UI_PREFIX "parent" ///< http://lv2plug.in/ns/extensions/ui#parent -#define LV2_UI__plugin LV2_UI_PREFIX "plugin" ///< http://lv2plug.in/ns/extensions/ui#plugin -#define LV2_UI__portIndex LV2_UI_PREFIX "portIndex" ///< http://lv2plug.in/ns/extensions/ui#portIndex -#define LV2_UI__portMap LV2_UI_PREFIX "portMap" ///< http://lv2plug.in/ns/extensions/ui#portMap -#define LV2_UI__portNotification LV2_UI_PREFIX "portNotification" ///< http://lv2plug.in/ns/extensions/ui#portNotification -#define LV2_UI__portSubscribe LV2_UI_PREFIX "portSubscribe" ///< http://lv2plug.in/ns/extensions/ui#portSubscribe -#define LV2_UI__protocol LV2_UI_PREFIX "protocol" ///< http://lv2plug.in/ns/extensions/ui#protocol -#define LV2_UI__requestValue LV2_UI_PREFIX "requestValue" ///< http://lv2plug.in/ns/extensions/ui#requestValue -#define LV2_UI__floatProtocol LV2_UI_PREFIX "floatProtocol" ///< http://lv2plug.in/ns/extensions/ui#floatProtocol -#define LV2_UI__peakProtocol LV2_UI_PREFIX "peakProtocol" ///< http://lv2plug.in/ns/extensions/ui#peakProtocol -#define LV2_UI__resize LV2_UI_PREFIX "resize" ///< http://lv2plug.in/ns/extensions/ui#resize -#define LV2_UI__showInterface LV2_UI_PREFIX "showInterface" ///< http://lv2plug.in/ns/extensions/ui#showInterface -#define LV2_UI__touch LV2_UI_PREFIX "touch" ///< http://lv2plug.in/ns/extensions/ui#touch -#define LV2_UI__ui LV2_UI_PREFIX "ui" ///< http://lv2plug.in/ns/extensions/ui#ui -#define LV2_UI__updateRate LV2_UI_PREFIX "updateRate" ///< http://lv2plug.in/ns/extensions/ui#updateRate -#define LV2_UI__windowTitle LV2_UI_PREFIX "windowTitle" ///< http://lv2plug.in/ns/extensions/ui#windowTitle -#define LV2_UI__scaleFactor LV2_UI_PREFIX "scaleFactor" ///< http://lv2plug.in/ns/extensions/ui#scaleFactor -#define LV2_UI__foregroundColor LV2_UI_PREFIX "foregroundColor" ///< http://lv2plug.in/ns/extensions/ui#foregroundColor -#define LV2_UI__backgroundColor LV2_UI_PREFIX "backgroundColor" ///< http://lv2plug.in/ns/extensions/ui#backgroundColor - -// clang-format on - -/** - The index returned by LV2UI_Port_Map::port_index() for unknown ports. -*/ -#define LV2UI_INVALID_PORT_INDEX ((uint32_t)-1) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - A pointer to some widget or other type of UI handle. - - The actual type is defined by the type of the UI. -*/ -typedef void* LV2UI_Widget; - -/** - A pointer to UI instance internals. - - The host may compare this to NULL, but otherwise MUST NOT interpret it. -*/ -typedef void* LV2UI_Handle; - -/** - A pointer to a controller provided by the host. - - The UI may compare this to NULL, but otherwise MUST NOT interpret it. -*/ -typedef void* LV2UI_Controller; - -/** - A pointer to opaque data for a feature. -*/ -typedef void* LV2UI_Feature_Handle; - -/** - A host-provided function that sends data to a plugin's input ports. - - @param controller The opaque controller pointer passed to - LV2UI_Descriptor::instantiate(). - - @param port_index Index of the port to update. - - @param buffer Buffer containing `buffer_size` bytes of data. - - @param buffer_size Size of `buffer` in bytes. - - @param port_protocol Either 0 or the URID for a ui:PortProtocol. If 0, the - protocol is implicitly ui:floatProtocol, the port MUST be an lv2:ControlPort - input, `buffer` MUST point to a single float value, and `buffer_size` MUST - be sizeof(float). The UI SHOULD NOT use a protocol not supported by the - host, but the host MUST gracefully ignore any protocol it does not - understand. -*/ -typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller, - uint32_t port_index, - uint32_t buffer_size, - uint32_t port_protocol, - const void* buffer); - -/** - A plugin UI. - - A pointer to an object of this type is returned by the lv2ui_descriptor() - function. -*/ -typedef struct LV2UI_Descriptor { - /** - The URI for this UI (not for the plugin it controls). - */ - const char* URI; - - /** - Create a new UI and return a handle to it. This function works - similarly to LV2_Descriptor::instantiate(). - - @param descriptor The descriptor for the UI to instantiate. - - @param plugin_uri The URI of the plugin that this UI will control. - - @param bundle_path The path to the bundle containing this UI, including - the trailing directory separator. - - @param write_function A function that the UI can use to send data to the - plugin's input ports. - - @param controller A handle for the UI instance to be passed as the - first parameter of UI methods. - - @param widget (output) widget pointer. The UI points this at its main - widget, which has the type defined by the UI type in the data file. - - @param features An array of LV2_Feature pointers. The host must pass - all feature URIs that it and the UI supports and any additional data, as - in LV2_Descriptor::instantiate(). Note that UI features and plugin - features are not necessarily the same. - - */ - LV2UI_Handle (*instantiate)(const struct LV2UI_Descriptor* descriptor, - const char* plugin_uri, - const char* bundle_path, - LV2UI_Write_Function write_function, - LV2UI_Controller controller, - LV2UI_Widget* widget, - const LV2_Feature* const* features); - - /** - Destroy the UI. The host must not try to access the widget after - calling this function. - */ - void (*cleanup)(LV2UI_Handle ui); - - /** - Tell the UI that something interesting has happened at a plugin port. - - What is "interesting" and how it is written to `buffer` is defined by - `format`, which has the same meaning as in LV2UI_Write_Function(). - Format 0 is a special case for lv2:ControlPort, where this function - should be called when the port value changes (but not necessarily for - every change), `buffer_size` must be sizeof(float), and `buffer` - points to a single IEEE-754 float. - - By default, the host should only call this function for lv2:ControlPort - inputs. However, the UI can request updates for other ports statically - with ui:portNotification or dynamically with ui:portSubscribe. - - The UI MUST NOT retain any reference to `buffer` after this function - returns, it is only valid for the duration of the call. - - This member may be NULL if the UI is not interested in any port events. - */ - void (*port_event)(LV2UI_Handle ui, - uint32_t port_index, - uint32_t buffer_size, - uint32_t format, - const void* buffer); - - /** - Return a data structure associated with an extension URI, typically an - interface struct with additional function pointers - - This member may be set to NULL if the UI is not interested in supporting - any extensions. This is similar to LV2_Descriptor::extension_data(). - - */ - const void* (*extension_data)(const char* uri); -} LV2UI_Descriptor; - -/** - Feature/interface for resizable UIs (LV2_UI__resize). - - This structure is used in two ways: as a feature passed by the host via - LV2UI_Descriptor::instantiate(), or as an interface provided by a UI via - LV2UI_Descriptor::extension_data()). -*/ -typedef struct { - /** - Pointer to opaque data which must be passed to ui_resize(). - */ - LV2UI_Feature_Handle handle; - - /** - Request/advertise a size change. - - When provided by the host, the UI may call this function to inform the - host about the size of the UI. - - When provided by the UI, the host may call this function to notify the - UI that it should change its size accordingly. In this case, the host - must pass the LV2UI_Handle to provide access to the UI instance. - - @return 0 on success. - */ - int (*ui_resize)(LV2UI_Feature_Handle handle, int width, int height); -} LV2UI_Resize; - -/** - Feature to map port symbols to UIs. - - This can be used by the UI to get the index for a port with the given - symbol. This makes it possible to implement and distribute a UI separately - from the plugin (since symbol, unlike index, is a stable port identifier). -*/ -typedef struct { - /** - Pointer to opaque data which must be passed to port_index(). - */ - LV2UI_Feature_Handle handle; - - /** - Get the index for the port with the given `symbol`. - - @return The index of the port, or LV2UI_INVALID_PORT_INDEX if no such - port is found. - */ - uint32_t (*port_index)(LV2UI_Feature_Handle handle, const char* symbol); -} LV2UI_Port_Map; - -/** - Feature to subscribe to port updates (LV2_UI__portSubscribe). -*/ -typedef struct { - /** - Pointer to opaque data which must be passed to subscribe() and - unsubscribe(). - */ - LV2UI_Feature_Handle handle; - - /** - Subscribe to updates for a port. - - This means that the host will call the UI's port_event() function when - the port value changes (as defined by protocol). - - Calling this function with the same `port_index` and `port_protocol` - as an already active subscription has no effect. - - @param handle The handle field of this struct. - @param port_index The index of the port. - @param port_protocol The URID of the ui:PortProtocol. - @param features Features for this subscription. - @return 0 on success. - */ - uint32_t (*subscribe)(LV2UI_Feature_Handle handle, - uint32_t port_index, - uint32_t port_protocol, - const LV2_Feature* const* features); - - /** - Unsubscribe from updates for a port. - - This means that the host will cease calling calling port_event() when - the port value changes. - - Calling this function with a `port_index` and `port_protocol` that - does not refer to an active port subscription has no effect. - - @param handle The handle field of this struct. - @param port_index The index of the port. - @param port_protocol The URID of the ui:PortProtocol. - @param features Features for this subscription. - @return 0 on success. - */ - uint32_t (*unsubscribe)(LV2UI_Feature_Handle handle, - uint32_t port_index, - uint32_t port_protocol, - const LV2_Feature* const* features); -} LV2UI_Port_Subscribe; - -/** - A feature to notify the host that the user has grabbed a UI control. -*/ -typedef struct { - /** - Pointer to opaque data which must be passed to touch(). - */ - LV2UI_Feature_Handle handle; - - /** - Notify the host that a control has been grabbed or released. - - The host should cease automating the port or otherwise manipulating the - port value until the control has been ungrabbed. - - @param handle The handle field of this struct. - @param port_index The index of the port associated with the control. - @param grabbed If true, the control has been grabbed, otherwise the - control has been released. - */ - void (*touch)(LV2UI_Feature_Handle handle, uint32_t port_index, bool grabbed); -} LV2UI_Touch; - -/** - A status code for LV2UI_Request_Value::request(). -*/ -typedef enum { - /** - Completed successfully. - - The host will set the parameter later if the user chooses a new value. - */ - LV2UI_REQUEST_VALUE_SUCCESS, - - /** - Parameter already being requested. - - The host is already requesting a parameter from the user (for example, a - dialog is visible), or the UI is otherwise busy and can not make this - request. - */ - LV2UI_REQUEST_VALUE_BUSY, - - /** - Unknown parameter. - - The host is not aware of this parameter, and is not able to set a new - value for it. - */ - LV2UI_REQUEST_VALUE_ERR_UNKNOWN, - - /** - Unsupported parameter. - - The host knows about this parameter, but does not support requesting a - new value for it from the user. This is likely because the host does - not have UI support for choosing a value with the appropriate type. - */ - LV2UI_REQUEST_VALUE_ERR_UNSUPPORTED -} LV2UI_Request_Value_Status; - -/** - A feature to request a new parameter value from the host. -*/ -typedef struct { - /** - Pointer to opaque data which must be passed to request(). - */ - LV2UI_Feature_Handle handle; - - /** - Request a value for a parameter from the host. - - This is mainly used by UIs to request values for complex parameters that - don't change often, such as file paths, but it may be used to request - any parameter value. - - This function returns immediately, and the return value indicates - whether the host can fulfil the request. The host may notify the - plugin about the new parameter value, for example when a file is - selected by the user, via the usual mechanism. Typically, the host will - send a message to the plugin that sets the new parameter value, and the - plugin will notify the UI via a message as usual for any other parameter - change. - - To provide an appropriate UI, the host can determine details about the - parameter from the plugin data as usual. The additional parameters of - this function provide support for more advanced use cases, but in the - simple common case, the plugin will simply pass the key of the desired - parameter and zero for everything else. - - @param handle The handle field of this struct. - - @param key The URID of the parameter. - - @param type The optional type of the value to request. This can be used - to request a specific value type for parameters that support several. - If non-zero, it must be the URID of an instance of rdfs:Class or - rdfs:Datatype. - - @param features Additional features for this request, or NULL. - - @return A status code which is 0 on success. - */ - LV2UI_Request_Value_Status (*request)(LV2UI_Feature_Handle handle, - LV2_URID key, - LV2_URID type, - const LV2_Feature* const* features); - -} LV2UI_Request_Value; - -/** - UI Idle Interface (LV2_UI__idleInterface) - - UIs can provide this interface to have an idle() callback called by the host - rapidly to update the UI. -*/ -typedef struct { - /** - Run a single iteration of the UI's idle loop. - - This will be called rapidly in the UI thread at a rate appropriate - for a toolkit main loop. There are no precise timing guarantees, but - the host should attempt to call idle() at a high enough rate for smooth - animation, at least 30Hz. - - @return non-zero if the UI has been closed, in which case the host - should stop calling idle(), and can either completely destroy the UI, or - re-show it and resume calling idle(). - */ - int (*idle)(LV2UI_Handle ui); -} LV2UI_Idle_Interface; - -/** - UI Show Interface (LV2_UI__showInterface) - - UIs can provide this interface to show and hide a window, which allows them - to function in hosts unable to embed their widget. This allows any UI to - provide a fallback for embedding that works in any host. - - If used: - - The host MUST use LV2UI_Idle_Interface to drive the UI. - - The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has - been closed. - - If idle() returns non-zero, the host MUST call hide() and stop calling - idle(). It MAY later call show() then resume calling idle(). -*/ -typedef struct { - /** - Show a window for this UI. - - The window title MAY have been passed by the host to - LV2UI_Descriptor::instantiate() as an LV2_Options_Option with key - LV2_UI__windowTitle. - - @return 0 on success, or anything else to stop being called. - */ - int (*show)(LV2UI_Handle ui); - - /** - Hide the window for this UI. - - @return 0 on success, or anything else to stop being called. - */ - int (*hide)(LV2UI_Handle ui); -} LV2UI_Show_Interface; - -/** - Peak data for a slice of time, the update format for ui:peakProtocol. -*/ -typedef struct { - /** - The start of the measurement period. This is just a running counter - that is only meaningful in comparison to previous values and must not be - interpreted as an absolute time. - */ - uint32_t period_start; - - /** - The size of the measurement period, in the same units as period_start. - */ - uint32_t period_size; - - /** - The peak value for the measurement period. This should be the maximal - value for abs(sample) over all the samples in the period. - */ - float peak; -} LV2UI_Peak_Data; - -/** - Prototype for UI accessor function. - - This is the entry point to a UI library, which works in the same way as - lv2_descriptor() but for UIs rather than plugins. -*/ -LV2_SYMBOL_EXPORT -const LV2UI_Descriptor* -lv2ui_descriptor(uint32_t index); - -/** - The type of the lv2ui_descriptor() function. -*/ -typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index); - -#ifdef __cplusplus -} -#endif - -/** - @} -*/ - -#endif /* LV2_UI_H */ diff --git a/lv2/ui/ui.meta.ttl b/lv2/ui/ui.meta.ttl deleted file mode 100644 index 95336bf..0000000 --- a/lv2/ui/ui.meta.ttl +++ /dev/null @@ -1,639 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdf: . -@prefix rdfs: . -@prefix ui: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 UI" ; - doap:shortdesc "User interfaces for LV2 plugins." ; - doap:created "2006-00-00" ; - doap:developer ; - doap:maintainer ; - doap:release [ - doap:revision "2.24" ; - doap:created "2022-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix spelling errors." - ] , [ - rdfs:label "Deprecate ui:resize." - ] - ] - ] , [ - doap:revision "2.22" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add ui:requestValue feature." - ] , [ - rdfs:label "Add ui:scaleFactor, ui:foregroundColor, and ui:backgroundColor properties." - ] , [ - rdfs:label "Deprecate ui:binary." - ] - ] - ] , [ - doap:revision "2.20" ; - doap:created "2015-07-25" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Improve documentation." - ] , [ - rdfs:label "Add missing property labels." - ] - ] - ] , [ - doap:revision "2.18" ; - doap:created "2014-08-08" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add show interface so UIs can gracefully degrade to separate windows if hosts can not use their widget directly." - ] , [ - rdfs:label "Fix identifier typos in documentation." - ] - ] - ] , [ - doap:revision "2.16" ; - doap:created "2014-01-04" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix LV2_UI_INVALID_PORT_INDEX identifier in documentation." - ] - ] - ] , [ - doap:revision "2.14" ; - doap:created "2013-03-18" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add idle interface so native UIs and foreign toolkits can drive their event loops." - ] , [ - rdfs:label "Add ui:updateRate property." - ] - ] - ] , [ - doap:revision "2.12" ; - doap:created "2012-12-01" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix incorrect linker flag in ui:makeSONameResident documentation." - ] - ] - ] , [ - doap:revision "2.10" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add types for WindowsUI, CocoaUI, and Gtk3UI." - ] , [ - rdfs:label "Use consistent label style." - ] , [ - rdfs:label "Add missing LV2_SYMBOL_EXPORT declaration for lv2ui_descriptor prototype." - ] - ] - ] , [ - doap:revision "2.8" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add ui:parent and ui:resize." - ] , [ - rdfs:label "Add support for referring to ports by symbol." - ] , [ - rdfs:label "Add ui:portMap for accessing ports by symbol, allowing for UIs to be distributed separately from plugins." - ] , [ - rdfs:label "Add port protocols and a dynamic notification subscription mechanism, for more flexible communication, and audio port metering without control port kludges." - ] , [ - rdfs:label "Add touch feature to notify the host that the user has grabbed a control." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "2.4" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Deprecate ui:makeSONameResident." - ] , [ - rdfs:label "Add Qt4 and X11 widget types." - ] , [ - rdfs:label "Install header to URI-based system path." - ] , [ - rdfs:label "Add pkg-config file." - ] , [ - rdfs:label "Make ui.ttl a valid OWL 2 DL ontology." - ] - ] - ] , [ - doap:revision "2.2" ; - doap:created "2011-05-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system (for installation)." - ] , [ - rdfs:label "Convert documentation to HTML and use lv2:documentation." - ] , [ - rdfs:label "Use lv2:Specification to be discovered as an extension." - ] - ] - ] , [ - doap:revision "2.0" ; - doap:created "2010-10-06" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension makes it possible to create user interfaces for LV2 plugins. - -UIs are implemented as an LV2UI_Descriptor loaded via lv2ui_descriptor() in a -shared library, and are distributed in bundles just like plugins. - -UIs are associated with plugins in data: - - :::turtle - @prefix ui: . - - ui:ui . - a ui:X11UI ; - lv2:binary . - -where `http://my.plugin` is the URI of the plugin, `http://my.pluginui` is the -URI of the plugin UI and `myui.so` is the relative URI to the shared object -file. - -While it is possible to have the plugin UI and the plugin in the same shared -object file, it is a good idea to keep them separate so that hosts can avoid -loading the UI code if they do not need it. A UI MUST specify its class in the -RDF data (`ui:X11UI` in the above example). The class defines what type the UI -is, for example what graphics toolkit it uses. Any type of UI class can be -defined separately from this extension. - -It is possible to have multiple UIs for the same plugin, or to have the UI for -a plugin in a different bundle from the actual plugin. This allows plugin UIs -to be written independently. - -Note that the process that loads the shared object file containing the UI code -and the process that loads the shared object file containing the actual plugin -implementation are not necessarily the same process (and not even necessarily -on the same machine). This means that plugin and UI code MUST NOT use -singletons and global variables and expect them to refer to the same objects in -the UI and the actual plugin. The function callback interface defined in this -header is the only method of communication between UIs and plugin instances -(extensions may define more, though this is discouraged unless absolutely -necessary since the significant benefits of network transparency and -serialisability are lost). - -UI functionality may be extended via features, much like plugins: - - :::turtle - lv2:requiredFeature . - lv2:optionalFeature . - -The rules for a UI with a required or optional feature are identical to those -of lv2:Plugin instances: if a UI declares a feature as required, the host is -NOT allowed to load it unless it supports that feature; and if it does support -a feature, it MUST pass an appropriate LV2_Feature struct to the UI's -instantiate() method. This extension defines several standard features for -common functionality. - -UIs written to this specification do not need to be thread-safe. All functions -may only be called in the UI thread. There is only one UI thread (for -toolkits, the one the UI main loop runs in). There is no requirement that a -UI actually be a graphical widget. - -Note that UIs are completely separate from plugins. From the plugin's -perspective, control from a UI is indistinguishable from any other control, as -it all occurs via ports. - -"""^^lv2:Markdown . - -ui:GtkUI - lv2:documentation """ - -The host must guarantee that the Gtk+ 2 library has been initialised and the -Glib main loop is running before the UI is instantiated. Note that this UI -type is not suitable for binary distribution since multiple versions of Gtk can -not be used in the same process. - -"""^^lv2:Markdown . - -ui:Gtk3UI - lv2:documentation """ - -The host must guarantee that the Gtk+ 3 library has been initialised and the -Glib main loop is running before the UI is instantiated. Note that this UI -type is not suitable for binary distribution since multiple versions of Gtk can -not be used in the same process. - -"""^^lv2:Markdown . - -ui:Qt4UI - lv2:documentation """ - -The host must guarantee that the Qt4 library has been initialised and the Qt4 -main loop is running before the UI is instantiated. Note that this UI type is -not suitable for binary distribution since multiple versions of Qt can not be -used in the same process. - -"""^^lv2:Markdown . - -ui:Qt5UI - lv2:documentation """ - -The host must guarantee that the Qt5 library has been initialised and the Qt5 -main loop is running before the UI is instantiated. Note that this UI type is -not suitable for binary distribution since multiple versions of Qt can not be -used in the same process. - -"""^^lv2:Markdown . - -ui:X11UI - lv2:documentation """ - -Note that the LV2UI_Widget for this type of UI is not a pointer, but should be -interpreted directly as an X11 `Window` ID. This is the native UI type on most -POSIX systems. - -"""^^lv2:Markdown . - -ui:WindowsUI - lv2:documentation """ - -Note that the LV2UI_Widget for this type of UI is not a pointer, but should be -interpreted directly as a `HWND`. This is the native UI type on Microsoft -Windows. - -"""^^lv2:Markdown . - -ui:CocoaUI - lv2:documentation """ - -This is the native UI type on Mac OS X. - -"""^^lv2:Markdown . - -ui:binary - lv2:documentation """ - -This property is redundant and deprecated: new UIs should use lv2:binary -instead, however hosts must still support ui:binary. - -"""^^lv2:Markdown . - -ui:makeSONameResident - lv2:documentation """ - -This feature was intended to support UIs that link against toolkit libraries -which may not be unloaded during the lifetime of the host. This is better -achieved by using the appropriate flags when linking the UI, for example `gcc --Wl,-z,nodelete`. - -"""^^lv2:Markdown . - -ui:noUserResize - lv2:documentation """ - -If a UI has this feature, it indicates that it does not make sense to let the -user resize the main widget, and the host should prevent that. This feature -may not make sense for all UI types. The data pointer for this feature should -always be set to NULL. - -"""^^lv2:Markdown . - -ui:fixedSize - lv2:documentation """ - -If a UI has this feature, it indicates the same thing as ui:noUserResize, and -additionally that the UI will not resize itself on its own. That is, the UI -will always remain the same size. This feature may not make sense for all UI -types. The data pointer for this feature should always be set to NULL. - -"""^^lv2:Markdown . - -ui:scaleFactor - lv2:documentation """ - -HiDPI (High Dots Per Inch) displays have a high resolution on a relatively -small form factor. Many systems use a scale factor to compensate for this, so -for example, a scale factor of 2 means things are drawn twice as large as -normal. - -Hosts can pass this as an option to UIs to communicate this information, so -that the UI can draw at an appropriate scale. - -"""^^lv2:Markdown . - -ui:backgroundColor - lv2:documentation """ - -The background color of the host's UI. The host can pass this as an option so -that UIs can integrate nicely with the host window around it. - -Hosts should pass this as an option to UIs with an integer RGBA32 color value. -If the value is a 32-bit integer, it is guaranteed to be in RGBA32 format, but -the UI must check the value type and not assume this, to allow for other types -of color in the future. - -"""^^lv2:Markdown . - -ui:foregroundColor - lv2:documentation """ - -The foreground color of the host's UI. The host can pass this as an option so -that UIs can integrate nicely with the host window around it. - -Hosts should pass this as an option to UIs with an integer RGBA32 color value. -If the value is a 32-bit integer, it is guaranteed to be in RGBA32 format, but -the UI must check the value type and not assume this, to allow for other types -of color in the future. - -"""^^lv2:Markdown . - -ui:parent - lv2:documentation """ - -This feature can be used to pass a parent that the UI should be a child of. -The format of data pointer of this feature is determined by the UI type, and is -generally the same type as the LV2UI_Widget that the UI would return. For -example, for a ui:X11UI, the parent should be a `Window`. This is particularly -useful for embedding, where the parent often must be known at construction time -for embedding to work correctly. - -UIs should not _require_ this feature unless it is necessary for them to work -at all, but hosts should provide it whenever possible. - -"""^^lv2:Markdown . - -ui:PortNotification - lv2:documentation """ - -This describes which ports the host must send notifications to the UI about. -The port must be specific either by index, using the ui:portIndex property, or -symbol, using the lv2:symbol property. Since port indices are not guaranteed -to be stable, using the symbol is recommended, and the inde MUST NOT be used -except by UIs that are shipped in the same bundle as the corresponding plugin. - -"""^^lv2:Markdown . - -ui:portNotification - lv2:documentation """ - -Specifies that a UI should receive notifications about changes to a particular -port's value via LV2UI_Descriptor::port_event(). - -For example: - - :::turtle - eg:ui - a ui:X11UI ; - ui:portNotification [ - ui:plugin eg:plugin ; - lv2:symbol "gain" ; - ui:protocol ui:floatProtocol - ] . - -"""^^lv2:Markdown . - -ui:notifyType - lv2:documentation """ - -Specifies a particular type that the UI should be notified of. - -This is useful for message-based ports where several types of data can be -present, but only some are interesting to the UI. For example, if UI control -is multiplexed in the same port as MIDI, this property can be used to ensure -that only the relevant events are forwarded to the UI, and not potentially high -frequency MIDI data. - -"""^^lv2:Markdown . - -ui:resize - lv2:documentation """ - -This feature corresponds to the LV2UI_Resize struct, which should be passed -with the URI LV2_UI__resize. This struct may also be provided by the UI as -extension data using the same URI, in which case it is used by the host to -request that the UI change its size. - -"""^^lv2:Markdown . - -ui:portMap - lv2:documentation """ - -This makes it possible to implement and distribute UIs separately from the -plugin binaries they control. - -This feature corresponds to the LV2UI_Port_Index struct, which should be passed -with the URI LV2_UI__portIndex. - -"""^^lv2:Markdown . - -ui:portSubscribe - lv2:documentation """ - -This makes it possible for a UI to explicitly request a particular style of -update from a port at run-time, in a more flexible and powerful way than -listing subscriptions statically allows. - -This feature corresponds to the LV2UI_Port_Subscribe struct, which should be -passed with the URI LV2_UI__portSubscribe. - -"""^^lv2:Markdown . - -ui:touch - lv2:documentation """ - -This is useful for automation, so the host can allow the user to take control -of a port, even if that port would otherwise be automated (much like grabbing a -physical motorised fader). - -It can also be used for MIDI learn or in any other situation where the host -needs to do something with a particular control and it would be convenient for -the user to select it directly from the plugin UI. - -This feature corresponds to the LV2UI_Touch struct, which should be passed with -the URI LV2_UI__touch. - -"""^^lv2:Markdown . - -ui:requestValue - lv2:documentation """ - -This allows a plugin UI to request a new parameter value using the host's UI, -for example by showing a dialog or integrating with the host's built-in content -browser. This should only be used for complex parameter types where the plugin -UI is not capable of showing the expected native platform or host interface to -choose a value, such as file path parameters. - -This feature corresponds to the LV2UI_Request_Value struct, which should be -passed with the URI LV2_UI__requestValue. - -"""^^lv2:Markdown . - -ui:idleInterface - lv2:documentation """ - -To support this feature, the UI should list it as a lv2:optionalFeature or -lv2:requiredFeature in its data, and also as lv2:extensionData. When the UI's -extension_data() is called with this URI (LV2_UI__idleInterface), it should -return a pointer to an LV2UI_Idle_Interface. - -To indicate support, the host should pass a feature to instantiate() with this -URI, with NULL for data. - -"""^^lv2:Markdown . - -ui:showInterface - lv2:documentation """ - -This allows UIs to gracefully degrade to separate windows when the host is -unable to embed the UI widget for whatever reason. When the UI's -extension_data() is called with this URI (LV2_UI__showInterface), it should -return a pointer to an LV2UI_Show_Interface. - -"""^^lv2:Markdown . - -ui:PortProtocol - lv2:documentation """ - -A PortProtocol MUST define: - -Port Type -: Which plugin port types the buffer type is valid for. - -Feature Data -: What data (if any) should be passed in the LV2_Feature. - -A PortProtocol for an output port MUST define: - -Update Frequency -: When the host should call port_event(). - -Update Format -: The format of the data in the buffer passed to port_event(). - -Options -: The format of the options passed to subscribe() and unsubscribe(). - -A PortProtocol for an input port MUST define: - -Write Format -: The format of the data in the buffer passed to write_port(). - -Write Effect -: What happens when the UI calls write_port(). - -For an example, see ui:floatProtocol or ui:peakProtocol. - -PortProtocol is a subclass of lv2:Feature, so UIs use lv2:optionalFeature and -lv2:requiredFeature to specify which PortProtocols they want to use. - -"""^^lv2:Markdown . - -ui:floatProtocol - lv2:documentation """ - -A protocol for transferring single floating point values. The rules for this -protocol are: - -Port Type -: lv2:ControlPort - -Feature Data -: None. - -Update Frequency -: The host SHOULD call port_event() as soon as possible when the port value has - changed, but there are no timing guarantees. - -Update Format -: A single float. - -Options -: None. - -Write Format -: A single float. - -Write Effect -: The host SHOULD set the port to the received value as soon as possible, but - there is no guarantee that run() actually sees this value. - -"""^^lv2:Markdown . - -ui:peakProtocol - lv2:documentation """ - -This port protocol defines a way for the host to send continuous peak -measurements of the audio signal at a certain port to the UI. The intended use -is visualisation, for example an animated meter widget that shows the level of -the audio input or output. - -A contiguous sequence of audio samples for which a peak value has been computed -is called a _measurement period_. - -The rules for this protocol are: - -Port Type -: lv2:AudioPort - -Feature Data -: None. - -Update Frequency -: The host SHOULD call port_event() at regular intervals. The measurement - periods used for calls to port_event() for the same port SHOULD be - contiguous (i.e. the measurement period for one call should begin right - after the end of the measurement period for the previous call ends) unless - the UI has removed and re-added the port subscription between those calls. - However, UIs MUST NOT depend on either the regularity of the calls or the - contiguity of the measurement periods; hosts may change the call rate or - skip calls for performance or other reasons. Measurement periods for - different calls to port_event() for the same port MUST NOT overlap. - -Update Format -: A single LV2UI_Peak_Data object. - -Options -: None. - -Write Format -: None. - -Write Effect -: None. - -"""^^lv2:Markdown . - diff --git a/lv2/ui/ui.ttl b/lv2/ui/ui.ttl deleted file mode 100644 index b355764..0000000 --- a/lv2/ui/ui.ttl +++ /dev/null @@ -1,250 +0,0 @@ -@prefix lv2: . -@prefix opts: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix ui: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 UI" ; - rdfs:comment "User interfaces for LV2 plugins." ; - rdfs:seeAlso , - ; - owl:imports , - . - -ui:UI - a rdfs:Class , - owl:Class ; - rdfs:label "User Interface" ; - rdfs:comment "A UI for an LV2 plugin." . - -ui:GtkUI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "GTK2 UI" ; - rdfs:comment "A UI where the widget is a pointer to a Gtk+ 2.0 GtkWidget." . - -ui:Gtk3UI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "GTK3 UI" ; - rdfs:comment "A UI where the widget is a pointer to a Gtk+ 3.0 GtkWidget." . - -ui:Qt4UI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "Qt4 UI" ; - rdfs:comment "A UI where the widget is a pointer to a Qt4 QWidget." . - -ui:Qt5UI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "Qt5 UI" ; - rdfs:comment "A UI where the widget is a pointer to a Qt5 QWidget." . - -ui:X11UI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "X11 UI" ; - rdfs:comment "A UI where the widget is an X11 Window window ID." . - -ui:WindowsUI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "Windows UI" ; - rdfs:comment "A UI where the widget is a Windows HWND window ID." . - -ui:CocoaUI - a rdfs:Class , - owl:Class ; - rdfs:subClassOf ui:UI ; - rdfs:label "Cocoa UI" ; - rdfs:comment "A UI where the widget is a pointer to a NSView." . - -ui:ui - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain lv2:Plugin ; - rdfs:range ui:UI ; - rdfs:label "user interface" ; - rdfs:comment "Relates a plugin to a UI that applies to it." . - -ui:binary - a rdf:Property , - owl:ObjectProperty ; - owl:sameAs lv2:binary ; - owl:deprecated "true"^^xsd:boolean ; - rdfs:label "binary" ; - rdfs:comment "The shared library that a UI resides in." . - -ui:makeSONameResident - a lv2:Feature ; - owl:deprecated "true"^^xsd:boolean ; - rdfs:label "make SO name resident" ; - rdfs:comment "UI binary must not be unloaded." . - -ui:noUserResize - a lv2:Feature ; - rdfs:label "no user resize" ; - rdfs:comment "Non-resizable UI." . - -ui:fixedSize - a lv2:Feature ; - rdfs:label "fixed size" ; - rdfs:comment "Non-resizable UI that will never resize itself." . - -ui:scaleFactor - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:range xsd:float ; - rdfs:label "scale factor" ; - rdfs:comment "Scale factor for high resolution screens." . - -ui:backgroundColor - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:label "background color" ; - rdfs:comment """The background color of the host's UI.""" . - -ui:foregroundColor - a rdf:Property , - owl:DatatypeProperty , - opts:Option ; - rdfs:label "foreground color" ; - rdfs:comment """The foreground color of the host's UI.""" . - -ui:parent - a lv2:Feature ; - rdfs:label "parent" ; - rdfs:comment "The parent for a UI." . - -ui:PortNotification - a rdfs:Class , - owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ui:plugin ; - owl:cardinality 1 ; - rdfs:comment "A PortNotification MUST have exactly one ui:plugin." - ] ; - rdfs:label "Port Notification" ; - rdfs:comment "A description of port updates that a host must send a UI." . - -ui:portNotification - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ui:UI ; - rdfs:range ui:PortNotification ; - rdfs:label "port notification" ; - rdfs:comment "Specifies a port notification that is required by a UI." . - -ui:plugin - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ui:PortNotification ; - rdfs:range lv2:Plugin ; - rdfs:label "plugin" ; - rdfs:comment "The plugin a portNotification applies to." . - -ui:portIndex - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain ui:PortNotification ; - rdfs:range xsd:decimal ; - rdfs:label "port index" ; - rdfs:comment "The index of the port a portNotification applies to." . - -ui:notifyType - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ui:PortNotification ; - rdfs:label "notify type" ; - rdfs:comment "A particular type that the UI should be notified of." . - -ui:resize - a lv2:Feature , - lv2:ExtensionData ; - owl:deprecated "true"^^xsd:boolean ; - rdfs:label "resize" ; - rdfs:comment """A feature that provides control of, and notifications about, a UI's size.""" . - -ui:portMap - a lv2:Feature ; - rdfs:label "port map" ; - rdfs:comment "A feature for accessing the index of a port by symbol." . - -ui:portSubscribe - a lv2:Feature ; - rdfs:label "port subscribe" ; - rdfs:comment "A feature for dynamically subscribing to updates from a port." . - -ui:touch - a lv2:Feature ; - rdfs:label "touch" ; - rdfs:comment "A feature to notify that the user has grabbed a port control." . - -ui:requestValue - a lv2:Feature ; - rdfs:label "request value" ; - rdfs:comment "A feature to request a parameter value from the user via the host." . - -ui:idleInterface - a lv2:Feature , - lv2:ExtensionData ; - rdfs:label "idle interface" ; - rdfs:comment "A feature that provides a callback for the host to drive the UI." . - -ui:showInterface - a lv2:ExtensionData ; - rdfs:label "show interface" ; - rdfs:comment "An interface for showing and hiding a window for a UI." . - -ui:windowTitle - a rdf:Property , - owl:DatatypeProperty ; - rdfs:range xsd:string ; - rdfs:label "window title" ; - rdfs:comment "The title for the window shown by LV2UI_Show_Interface." . - -ui:updateRate - a rdf:Property , - owl:DatatypeProperty ; - rdfs:range xsd:float ; - rdfs:label "update rate" ; - rdfs:comment "The target rate, in Hz, to send updates to the UI." . - -ui:protocol - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain ui:PortNotification ; - rdfs:range ui:PortProtocol ; - rdfs:label "protocol" ; - rdfs:comment "The protocol to be used for this notification." . - -ui:PortProtocol - a rdfs:Class ; - rdfs:subClassOf lv2:Feature ; - rdfs:label "Port Protocol" ; - rdfs:comment "A method to communicate port data between a UI and plugin." . - -ui:floatProtocol - a ui:PortProtocol ; - rdfs:label "float protocol" ; - rdfs:comment "A protocol for transferring single floating point values." . - -ui:peakProtocol - a ui:PortProtocol ; - rdfs:label "peak protocol" ; - rdfs:comment "A protocol for sending continuous peak measurements of an audio signal." . - diff --git a/lv2/units.lv2/manifest.ttl b/lv2/units.lv2/manifest.ttl new file mode 100644 index 0000000..c6c9286 --- /dev/null +++ b/lv2/units.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 5 ; + lv2:microVersion 12 ; + rdfs:seeAlso . + diff --git a/lv2/units.lv2/units.meta.ttl b/lv2/units.lv2/units.meta.ttl new file mode 100644 index 0000000..a857046 --- /dev/null +++ b/lv2/units.lv2/units.meta.ttl @@ -0,0 +1,154 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . +@prefix units: . + + + a doap:Project ; + doap:name "LV2 Units" ; + doap:shortdesc "Units for LV2 values." ; + doap:created "2007-02-06" ; + doap:homepage ; + doap:license ; + doap:release [ + doap:revision "5.12" ; + doap:created "2019-02-03" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix outdated port description in documentation." + ] , [ + rdfs:label "Remove overly restrictive domain from units:unit." + ] + ] + ] , [ + doap:revision "5.10" ; + doap:created "2015-04-07" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix non-existent port type in examples." + ] , [ + rdfs:label "Add lv2:Parameter to domain of units:unit." + ] + ] + ] , [ + doap:revision "5.8" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Remove units:name in favour of rdfs:label." + ] , [ + rdfs:label "Use consistent label style." + ] + ] + ] , [ + doap:revision "5.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add unit for audio frames." + ] , [ + rdfs:label "Add header of URI defines." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "5.4" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make units.ttl a valid OWL 2 DL ontology." + ] , [ + rdfs:label "Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor)." + ] , [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "5.2" ; + doap:created "2010-10-05" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system (for installation)." + ] , [ + rdfs:label "Convert documentation to HTML and use lv2:documentation." + ] + ] + ] , [ + doap:revision "5.0" ; + doap:created "2010-10-05" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] , [ + rdfs:label "Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor)." + ] , [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Improve documentation." + ] + ] + ] ; + doap:developer ; + doap:maintainer ; + lv2:documentation """ + +This is a vocabulary for units typically used for control values in audio +processing. + +For example, to say that a gain control is in decibels: + + :::turtle + @prefix units: . + @prefix eg: . + + eg:plugin lv2:port [ + a lv2:ControlPort , lv2:InputPort ; + lv2:index 0 ; + lv2:symbol "gain" ; + lv2:name "Gain" ; + units:unit units:db + ] . + +Using the same form, plugins may also specify one-off units inline, to give +better display hints to hosts: + + :::turtle + eg:plugin lv2:port [ + a lv2:ControlPort , lv2:InputPort ; + lv2:index 0 ; + lv2:symbol "frob" ; + lv2:name "frob level" ; + units:unit [ + a units:Unit ; + rdfs:label "frobnication" ; + units:symbol "fr" ; + units:render "%f f" + ] + ] . + +It is also possible to define conversions between various units, which makes it +possible for hosts to automatically convert between units where possible. The +units defined in this extension include conversion definitions where it makes +sense to do so. + +"""^^lv2:Markdown . + diff --git a/lv2/units.lv2/units.ttl b/lv2/units.lv2/units.ttl new file mode 100644 index 0000000..21a1898 --- /dev/null +++ b/lv2/units.lv2/units.ttl @@ -0,0 +1,378 @@ +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix units: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Units" ; + rdfs:comment "Units for LV2 values." ; + rdfs:seeAlso . + +units:Unit + a rdfs:Class , + owl:Class ; + rdfs:label "Unit" ; + rdfs:comment "A unit for a control value." . + +units:unit + a rdf:Property , + owl:ObjectProperty ; + rdfs:range units:Unit ; + rdfs:label "unit" ; + rdfs:comment "The unit used by the value of a port or parameter." . + +units:render + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "unit format string" ; + rdfs:domain units:Unit ; + rdfs:range xsd:string ; + rdfs:comment """A printf format string for rendering a value (e.g., "%f dB").""" . + +units:symbol + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "unit symbol" ; + rdfs:domain units:Unit ; + rdfs:range xsd:string ; + rdfs:comment """The abbreviated symbol for this unit (e.g., "dB").""" . + +units:Conversion + a rdfs:Class , + owl:Class ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty units:to ; + owl:cardinality 1 ; + rdfs:comment "A conversion MUST have exactly 1 units:to property." + ] ; + rdfs:label "Conversion" ; + rdfs:comment "A conversion from one unit to another." . + +units:conversion + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain units:Unit ; + rdfs:range units:Conversion ; + rdfs:label "conversion" ; + rdfs:comment "A conversion from this unit to another." . + +units:prefixConversion + a rdf:Property , + owl:ObjectProperty ; + rdfs:subPropertyOf units:conversion ; + rdfs:domain units:Unit ; + rdfs:range units:Conversion ; + rdfs:label "prefix conversion" ; + rdfs:comment "A conversion from this unit to another with the same base but a different prefix." . + +units:to + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain units:Conversion ; + rdfs:range units:Unit ; + rdfs:label "conversion target" ; + rdfs:comment "The target unit this conversion converts to." . + +units:factor + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain units:Conversion ; + rdfs:label "conversion factor" ; + rdfs:comment "The factor to multiply the source value by in order to convert to the target unit." . + +units:s + a units:Unit ; + units:conversion [ + units:factor 0.0166666666 ; + units:to units:min + ] ; + rdfs:label "seconds" ; + rdfs:comment "Seconds, the SI base unit for time." ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:ms + ] ; + units:render "%f s" ; + units:symbol "s" . + +units:ms + a units:Unit ; + rdfs:label "milliseconds" ; + rdfs:comment "Milliseconds (thousandths of seconds)." ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:s + ] ; + units:render "%f ms" ; + units:symbol "ms" . + +units:min + a units:Unit ; + units:conversion [ + units:factor 60.0 ; + units:to units:s + ] ; + rdfs:label "minutes" ; + rdfs:comment "Minutes (60s of seconds and 60ths of an hour)." ; + units:render "%f mins" ; + units:symbol "min" . + +units:bar + a units:Unit ; + rdfs:label "bars" ; + rdfs:comment "Musical bars or measures." ; + units:render "%f bars" ; + units:symbol "bars" . + +units:beat + a units:Unit ; + rdfs:label "beats" ; + rdfs:comment "Musical beats." ; + units:render "%f beats" ; + units:symbol "beats" . + +units:frame + a units:Unit ; + rdfs:label "audio frames" ; + rdfs:comment "Audio frames or samples." ; + units:render "%f frames" ; + units:symbol "frames" . + +units:m + a units:Unit ; + units:conversion [ + units:factor 39.37 ; + units:to units:inch + ] ; + rdfs:label "metres" ; + rdfs:comment "Metres, the SI base unit for length." ; + units:prefixConversion [ + units:factor 100 ; + units:to units:cm + ] , [ + units:factor 1000 ; + units:to units:mm + ] , [ + units:factor 0.001 ; + units:to units:km + ] ; + units:render "%f m" ; + units:symbol "m" . + +units:cm + a units:Unit ; + units:conversion [ + units:factor 0.3937 ; + units:to units:inch + ] ; + rdfs:label "centimetres" ; + rdfs:comment "Centimetres (hundredths of metres)." ; + units:prefixConversion [ + units:factor 0.01 ; + units:to units:m + ] , [ + units:factor 10 ; + units:to units:mm + ] , [ + units:factor 0.00001 ; + units:to units:km + ] ; + units:render "%f cm" ; + units:symbol "cm" . + +units:mm + a units:Unit ; + units:conversion [ + units:factor 0.03937 ; + units:to units:inch + ] ; + rdfs:label "millimetres" ; + rdfs:comment "Millimetres (thousandths of metres)." ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:m + ] , [ + units:factor 0.1 ; + units:to units:cm + ] , [ + units:factor 0.000001 ; + units:to units:km + ] ; + units:render "%f mm" ; + units:symbol "mm" . + +units:km + a units:Unit ; + units:conversion [ + units:factor 0.62138818 ; + units:to units:mile + ] ; + rdfs:label "kilometres" ; + rdfs:comment "Kilometres (thousands of metres)." ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:m + ] , [ + units:factor 100000 ; + units:to units:cm + ] , [ + units:factor 1000000 ; + units:to units:mm + ] ; + units:render "%f km" ; + units:symbol "km" . + +units:inch + a units:Unit ; + units:conversion [ + units:factor 0.0254 ; + units:to units:m + ] ; + rdfs:label "inches" ; + rdfs:comment "An inch, defined as exactly 0.0254 metres." ; + units:render "%f\"" ; + units:symbol "in" . + +units:mile + a units:Unit ; + units:conversion [ + units:factor 1609.344 ; + units:to units:m + ] ; + rdfs:label "miles" ; + rdfs:comment "A mile, defined as exactly 1609.344 metres." ; + units:render "%f mi" ; + units:symbol "mi" . + +units:db + a units:Unit ; + rdfs:label "decibels" ; + rdfs:comment "Decibels, a logarithmic relative unit where 0 is unity." ; + units:render "%f dB" ; + units:symbol "dB" . + +units:pc + a units:Unit ; + units:conversion [ + units:factor 0.01 ; + units:to units:coef + ] ; + rdfs:label "percent" ; + rdfs:comment "Percentage, a ratio as a fraction of 100." ; + units:render "%f%%" ; + units:symbol "%" . + +units:coef + a units:Unit ; + units:conversion [ + units:factor 100 ; + units:to units:pc + ] ; + rdfs:label "coefficient" ; + rdfs:comment "A scale coefficient where 1 is unity, or 100 percent." ; + units:render "* %f" ; + units:symbol "" . + +units:hz + a units:Unit ; + rdfs:label "hertz" ; + rdfs:comment "Hertz, or inverse seconds, the SI derived unit for frequency." ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:khz + ] , [ + units:factor 0.000001 ; + units:to units:mhz + ] ; + units:render "%f Hz" ; + units:symbol "Hz" . + +units:khz + a units:Unit ; + rdfs:label "kilohertz" ; + rdfs:comment "Kilohertz (thousands of Hertz)." ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:hz + ] , [ + units:factor 0.001 ; + units:to units:mhz + ] ; + units:render "%f kHz" ; + units:symbol "kHz" . + +units:mhz + a units:Unit ; + rdfs:label "megahertz" ; + rdfs:comment "Megahertz (millions of Hertz)." ; + units:prefixConversion [ + units:factor 1000000 ; + units:to units:hz + ] , [ + units:factor 0.001 ; + units:to units:khz + ] ; + units:render "%f MHz" ; + units:symbol "MHz" . + +units:bpm + a units:Unit ; + rdfs:label "beats per minute" ; + rdfs:comment "Beats Per Minute (BPM), the standard unit for musical tempo." ; + units:prefixConversion [ + units:factor 0.0166666666 ; + units:to units:hz + ] ; + units:render "%f BPM" ; + units:symbol "BPM" . + +units:oct + a units:Unit ; + units:conversion [ + units:factor 12.0 ; + units:to units:semitone12TET + ] ; + rdfs:label "octaves" ; + rdfs:comment "Octaves, relative musical pitch where +1 octave doubles the frequency." ; + units:render "%f octaves" ; + units:symbol "oct" . + +units:cent + a units:Unit ; + units:conversion [ + units:factor 0.01 ; + units:to units:semitone12TET + ] ; + rdfs:label "cents" ; + rdfs:comment "Cents (hundredths of semitones)." ; + units:render "%f ct" ; + units:symbol "ct" . + +units:semitone12TET + a units:Unit ; + units:conversion [ + units:factor 0.083333333 ; + units:to units:oct + ] ; + rdfs:label "semitones" ; + rdfs:comment "A semitone in the 12-tone equal temperament scale." ; + units:render "%f semi" ; + units:symbol "semi" . + +units:degree + a units:Unit ; + rdfs:label "degrees" ; + rdfs:comment "An angle where 360 degrees is one full rotation." ; + units:render "%f deg" ; + units:symbol "deg" . + +units:midiNote + a units:Unit ; + rdfs:label "MIDI note" ; + rdfs:comment "A MIDI note number." ; + units:render "MIDI note %d" ; + units:symbol "note" . + diff --git a/lv2/units/manifest.ttl b/lv2/units/manifest.ttl deleted file mode 100644 index c6c9286..0000000 --- a/lv2/units/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 5 ; - lv2:microVersion 12 ; - rdfs:seeAlso . - diff --git a/lv2/units/meson.build b/lv2/units/meson.build deleted file mode 100644 index 00d50dc..0000000 --- a/lv2/units/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'units' -path = 'ns' / 'extensions' / 'units' - -units_data = files( - 'units.meta.ttl', - 'units.ttl', - 'manifest.ttl', -) - -headers = files( - 'units.h', -) - -# Install specification bundle -install_data(units_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_units_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('units.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'extensions', - output: name + '.html', - ) -endif diff --git a/lv2/units/units.h b/lv2/units/units.h deleted file mode 100644 index 09ae16b..0000000 --- a/lv2/units/units.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_UNITS_H -#define LV2_UNITS_H - -/** - @defgroup units Units - @ingroup lv2 - - Units for LV2 values. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_UNITS_URI "http://lv2plug.in/ns/extensions/units" ///< http://lv2plug.in/ns/extensions/units -#define LV2_UNITS_PREFIX LV2_UNITS_URI "#" ///< http://lv2plug.in/ns/extensions/units# - -#define LV2_UNITS__Conversion LV2_UNITS_PREFIX "Conversion" ///< http://lv2plug.in/ns/extensions/units#Conversion -#define LV2_UNITS__Unit LV2_UNITS_PREFIX "Unit" ///< http://lv2plug.in/ns/extensions/units#Unit -#define LV2_UNITS__bar LV2_UNITS_PREFIX "bar" ///< http://lv2plug.in/ns/extensions/units#bar -#define LV2_UNITS__beat LV2_UNITS_PREFIX "beat" ///< http://lv2plug.in/ns/extensions/units#beat -#define LV2_UNITS__bpm LV2_UNITS_PREFIX "bpm" ///< http://lv2plug.in/ns/extensions/units#bpm -#define LV2_UNITS__cent LV2_UNITS_PREFIX "cent" ///< http://lv2plug.in/ns/extensions/units#cent -#define LV2_UNITS__cm LV2_UNITS_PREFIX "cm" ///< http://lv2plug.in/ns/extensions/units#cm -#define LV2_UNITS__coef LV2_UNITS_PREFIX "coef" ///< http://lv2plug.in/ns/extensions/units#coef -#define LV2_UNITS__conversion LV2_UNITS_PREFIX "conversion" ///< http://lv2plug.in/ns/extensions/units#conversion -#define LV2_UNITS__db LV2_UNITS_PREFIX "db" ///< http://lv2plug.in/ns/extensions/units#db -#define LV2_UNITS__degree LV2_UNITS_PREFIX "degree" ///< http://lv2plug.in/ns/extensions/units#degree -#define LV2_UNITS__frame LV2_UNITS_PREFIX "frame" ///< http://lv2plug.in/ns/extensions/units#frame -#define LV2_UNITS__hz LV2_UNITS_PREFIX "hz" ///< http://lv2plug.in/ns/extensions/units#hz -#define LV2_UNITS__inch LV2_UNITS_PREFIX "inch" ///< http://lv2plug.in/ns/extensions/units#inch -#define LV2_UNITS__khz LV2_UNITS_PREFIX "khz" ///< http://lv2plug.in/ns/extensions/units#khz -#define LV2_UNITS__km LV2_UNITS_PREFIX "km" ///< http://lv2plug.in/ns/extensions/units#km -#define LV2_UNITS__m LV2_UNITS_PREFIX "m" ///< http://lv2plug.in/ns/extensions/units#m -#define LV2_UNITS__mhz LV2_UNITS_PREFIX "mhz" ///< http://lv2plug.in/ns/extensions/units#mhz -#define LV2_UNITS__midiNote LV2_UNITS_PREFIX "midiNote" ///< http://lv2plug.in/ns/extensions/units#midiNote -#define LV2_UNITS__mile LV2_UNITS_PREFIX "mile" ///< http://lv2plug.in/ns/extensions/units#mile -#define LV2_UNITS__min LV2_UNITS_PREFIX "min" ///< http://lv2plug.in/ns/extensions/units#min -#define LV2_UNITS__mm LV2_UNITS_PREFIX "mm" ///< http://lv2plug.in/ns/extensions/units#mm -#define LV2_UNITS__ms LV2_UNITS_PREFIX "ms" ///< http://lv2plug.in/ns/extensions/units#ms -#define LV2_UNITS__name LV2_UNITS_PREFIX "name" ///< http://lv2plug.in/ns/extensions/units#name -#define LV2_UNITS__oct LV2_UNITS_PREFIX "oct" ///< http://lv2plug.in/ns/extensions/units#oct -#define LV2_UNITS__pc LV2_UNITS_PREFIX "pc" ///< http://lv2plug.in/ns/extensions/units#pc -#define LV2_UNITS__prefixConversion LV2_UNITS_PREFIX "prefixConversion" ///< http://lv2plug.in/ns/extensions/units#prefixConversion -#define LV2_UNITS__render LV2_UNITS_PREFIX "render" ///< http://lv2plug.in/ns/extensions/units#render -#define LV2_UNITS__s LV2_UNITS_PREFIX "s" ///< http://lv2plug.in/ns/extensions/units#s -#define LV2_UNITS__semitone12TET LV2_UNITS_PREFIX "semitone12TET" ///< http://lv2plug.in/ns/extensions/units#semitone12TET -#define LV2_UNITS__symbol LV2_UNITS_PREFIX "symbol" ///< http://lv2plug.in/ns/extensions/units#symbol -#define LV2_UNITS__unit LV2_UNITS_PREFIX "unit" ///< http://lv2plug.in/ns/extensions/units#unit - -// clang-format on - -/** - @} -*/ - -#endif /* LV2_UNITS_H */ diff --git a/lv2/units/units.meta.ttl b/lv2/units/units.meta.ttl deleted file mode 100644 index a857046..0000000 --- a/lv2/units/units.meta.ttl +++ /dev/null @@ -1,154 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix units: . - - - a doap:Project ; - doap:name "LV2 Units" ; - doap:shortdesc "Units for LV2 values." ; - doap:created "2007-02-06" ; - doap:homepage ; - doap:license ; - doap:release [ - doap:revision "5.12" ; - doap:created "2019-02-03" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix outdated port description in documentation." - ] , [ - rdfs:label "Remove overly restrictive domain from units:unit." - ] - ] - ] , [ - doap:revision "5.10" ; - doap:created "2015-04-07" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix non-existent port type in examples." - ] , [ - rdfs:label "Add lv2:Parameter to domain of units:unit." - ] - ] - ] , [ - doap:revision "5.8" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Remove units:name in favour of rdfs:label." - ] , [ - rdfs:label "Use consistent label style." - ] - ] - ] , [ - doap:revision "5.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add unit for audio frames." - ] , [ - rdfs:label "Add header of URI defines." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "5.4" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Make units.ttl a valid OWL 2 DL ontology." - ] , [ - rdfs:label "Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor)." - ] , [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "5.2" ; - doap:created "2010-10-05" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system (for installation)." - ] , [ - rdfs:label "Convert documentation to HTML and use lv2:documentation." - ] - ] - ] , [ - doap:revision "5.0" ; - doap:created "2010-10-05" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] , [ - rdfs:label "Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor)." - ] , [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Improve documentation." - ] - ] - ] ; - doap:developer ; - doap:maintainer ; - lv2:documentation """ - -This is a vocabulary for units typically used for control values in audio -processing. - -For example, to say that a gain control is in decibels: - - :::turtle - @prefix units: . - @prefix eg: . - - eg:plugin lv2:port [ - a lv2:ControlPort , lv2:InputPort ; - lv2:index 0 ; - lv2:symbol "gain" ; - lv2:name "Gain" ; - units:unit units:db - ] . - -Using the same form, plugins may also specify one-off units inline, to give -better display hints to hosts: - - :::turtle - eg:plugin lv2:port [ - a lv2:ControlPort , lv2:InputPort ; - lv2:index 0 ; - lv2:symbol "frob" ; - lv2:name "frob level" ; - units:unit [ - a units:Unit ; - rdfs:label "frobnication" ; - units:symbol "fr" ; - units:render "%f f" - ] - ] . - -It is also possible to define conversions between various units, which makes it -possible for hosts to automatically convert between units where possible. The -units defined in this extension include conversion definitions where it makes -sense to do so. - -"""^^lv2:Markdown . - diff --git a/lv2/units/units.ttl b/lv2/units/units.ttl deleted file mode 100644 index 959c063..0000000 --- a/lv2/units/units.ttl +++ /dev/null @@ -1,379 +0,0 @@ -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix units: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Units" ; - rdfs:comment "Units for LV2 values." ; - rdfs:seeAlso , - . - -units:Unit - a rdfs:Class , - owl:Class ; - rdfs:label "Unit" ; - rdfs:comment "A unit for a control value." . - -units:unit - a rdf:Property , - owl:ObjectProperty ; - rdfs:range units:Unit ; - rdfs:label "unit" ; - rdfs:comment "The unit used by the value of a port or parameter." . - -units:render - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "unit format string" ; - rdfs:domain units:Unit ; - rdfs:range xsd:string ; - rdfs:comment """A printf format string for rendering a value (e.g., "%f dB").""" . - -units:symbol - a rdf:Property , - owl:DatatypeProperty ; - rdfs:label "unit symbol" ; - rdfs:domain units:Unit ; - rdfs:range xsd:string ; - rdfs:comment """The abbreviated symbol for this unit (e.g., "dB").""" . - -units:Conversion - a rdfs:Class , - owl:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty units:to ; - owl:cardinality 1 ; - rdfs:comment "A conversion MUST have exactly 1 units:to property." - ] ; - rdfs:label "Conversion" ; - rdfs:comment "A conversion from one unit to another." . - -units:conversion - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain units:Unit ; - rdfs:range units:Conversion ; - rdfs:label "conversion" ; - rdfs:comment "A conversion from this unit to another." . - -units:prefixConversion - a rdf:Property , - owl:ObjectProperty ; - rdfs:subPropertyOf units:conversion ; - rdfs:domain units:Unit ; - rdfs:range units:Conversion ; - rdfs:label "prefix conversion" ; - rdfs:comment "A conversion from this unit to another with the same base but a different prefix." . - -units:to - a rdf:Property , - owl:ObjectProperty ; - rdfs:domain units:Conversion ; - rdfs:range units:Unit ; - rdfs:label "conversion target" ; - rdfs:comment "The target unit this conversion converts to." . - -units:factor - a rdf:Property , - owl:DatatypeProperty ; - rdfs:domain units:Conversion ; - rdfs:label "conversion factor" ; - rdfs:comment "The factor to multiply the source value by in order to convert to the target unit." . - -units:s - a units:Unit ; - units:conversion [ - units:factor 0.0166666666 ; - units:to units:min - ] ; - rdfs:label "seconds" ; - rdfs:comment "Seconds, the SI base unit for time." ; - units:prefixConversion [ - units:factor 1000 ; - units:to units:ms - ] ; - units:render "%f s" ; - units:symbol "s" . - -units:ms - a units:Unit ; - rdfs:label "milliseconds" ; - rdfs:comment "Milliseconds (thousandths of seconds)." ; - units:prefixConversion [ - units:factor 0.001 ; - units:to units:s - ] ; - units:render "%f ms" ; - units:symbol "ms" . - -units:min - a units:Unit ; - units:conversion [ - units:factor 60.0 ; - units:to units:s - ] ; - rdfs:label "minutes" ; - rdfs:comment "Minutes (60s of seconds and 60ths of an hour)." ; - units:render "%f mins" ; - units:symbol "min" . - -units:bar - a units:Unit ; - rdfs:label "bars" ; - rdfs:comment "Musical bars or measures." ; - units:render "%f bars" ; - units:symbol "bars" . - -units:beat - a units:Unit ; - rdfs:label "beats" ; - rdfs:comment "Musical beats." ; - units:render "%f beats" ; - units:symbol "beats" . - -units:frame - a units:Unit ; - rdfs:label "audio frames" ; - rdfs:comment "Audio frames or samples." ; - units:render "%f frames" ; - units:symbol "frames" . - -units:m - a units:Unit ; - units:conversion [ - units:factor 39.37 ; - units:to units:inch - ] ; - rdfs:label "metres" ; - rdfs:comment "Metres, the SI base unit for length." ; - units:prefixConversion [ - units:factor 100 ; - units:to units:cm - ] , [ - units:factor 1000 ; - units:to units:mm - ] , [ - units:factor 0.001 ; - units:to units:km - ] ; - units:render "%f m" ; - units:symbol "m" . - -units:cm - a units:Unit ; - units:conversion [ - units:factor 0.3937 ; - units:to units:inch - ] ; - rdfs:label "centimetres" ; - rdfs:comment "Centimetres (hundredths of metres)." ; - units:prefixConversion [ - units:factor 0.01 ; - units:to units:m - ] , [ - units:factor 10 ; - units:to units:mm - ] , [ - units:factor 0.00001 ; - units:to units:km - ] ; - units:render "%f cm" ; - units:symbol "cm" . - -units:mm - a units:Unit ; - units:conversion [ - units:factor 0.03937 ; - units:to units:inch - ] ; - rdfs:label "millimetres" ; - rdfs:comment "Millimetres (thousandths of metres)." ; - units:prefixConversion [ - units:factor 0.001 ; - units:to units:m - ] , [ - units:factor 0.1 ; - units:to units:cm - ] , [ - units:factor 0.000001 ; - units:to units:km - ] ; - units:render "%f mm" ; - units:symbol "mm" . - -units:km - a units:Unit ; - units:conversion [ - units:factor 0.62138818 ; - units:to units:mile - ] ; - rdfs:label "kilometres" ; - rdfs:comment "Kilometres (thousands of metres)." ; - units:prefixConversion [ - units:factor 1000 ; - units:to units:m - ] , [ - units:factor 100000 ; - units:to units:cm - ] , [ - units:factor 1000000 ; - units:to units:mm - ] ; - units:render "%f km" ; - units:symbol "km" . - -units:inch - a units:Unit ; - units:conversion [ - units:factor 0.0254 ; - units:to units:m - ] ; - rdfs:label "inches" ; - rdfs:comment "An inch, defined as exactly 0.0254 metres." ; - units:render "%f\"" ; - units:symbol "in" . - -units:mile - a units:Unit ; - units:conversion [ - units:factor 1609.344 ; - units:to units:m - ] ; - rdfs:label "miles" ; - rdfs:comment "A mile, defined as exactly 1609.344 metres." ; - units:render "%f mi" ; - units:symbol "mi" . - -units:db - a units:Unit ; - rdfs:label "decibels" ; - rdfs:comment "Decibels, a logarithmic relative unit where 0 is unity." ; - units:render "%f dB" ; - units:symbol "dB" . - -units:pc - a units:Unit ; - units:conversion [ - units:factor 0.01 ; - units:to units:coef - ] ; - rdfs:label "percent" ; - rdfs:comment "Percentage, a ratio as a fraction of 100." ; - units:render "%f%%" ; - units:symbol "%" . - -units:coef - a units:Unit ; - units:conversion [ - units:factor 100 ; - units:to units:pc - ] ; - rdfs:label "coefficient" ; - rdfs:comment "A scale coefficient where 1 is unity, or 100 percent." ; - units:render "* %f" ; - units:symbol "" . - -units:hz - a units:Unit ; - rdfs:label "hertz" ; - rdfs:comment "Hertz, or inverse seconds, the SI derived unit for frequency." ; - units:prefixConversion [ - units:factor 0.001 ; - units:to units:khz - ] , [ - units:factor 0.000001 ; - units:to units:mhz - ] ; - units:render "%f Hz" ; - units:symbol "Hz" . - -units:khz - a units:Unit ; - rdfs:label "kilohertz" ; - rdfs:comment "Kilohertz (thousands of Hertz)." ; - units:prefixConversion [ - units:factor 1000 ; - units:to units:hz - ] , [ - units:factor 0.001 ; - units:to units:mhz - ] ; - units:render "%f kHz" ; - units:symbol "kHz" . - -units:mhz - a units:Unit ; - rdfs:label "megahertz" ; - rdfs:comment "Megahertz (millions of Hertz)." ; - units:prefixConversion [ - units:factor 1000000 ; - units:to units:hz - ] , [ - units:factor 0.001 ; - units:to units:khz - ] ; - units:render "%f MHz" ; - units:symbol "MHz" . - -units:bpm - a units:Unit ; - rdfs:label "beats per minute" ; - rdfs:comment "Beats Per Minute (BPM), the standard unit for musical tempo." ; - units:prefixConversion [ - units:factor 0.0166666666 ; - units:to units:hz - ] ; - units:render "%f BPM" ; - units:symbol "BPM" . - -units:oct - a units:Unit ; - units:conversion [ - units:factor 12.0 ; - units:to units:semitone12TET - ] ; - rdfs:label "octaves" ; - rdfs:comment "Octaves, relative musical pitch where +1 octave doubles the frequency." ; - units:render "%f octaves" ; - units:symbol "oct" . - -units:cent - a units:Unit ; - units:conversion [ - units:factor 0.01 ; - units:to units:semitone12TET - ] ; - rdfs:label "cents" ; - rdfs:comment "Cents (hundredths of semitones)." ; - units:render "%f ct" ; - units:symbol "ct" . - -units:semitone12TET - a units:Unit ; - units:conversion [ - units:factor 0.083333333 ; - units:to units:oct - ] ; - rdfs:label "semitones" ; - rdfs:comment "A semitone in the 12-tone equal temperament scale." ; - units:render "%f semi" ; - units:symbol "semi" . - -units:degree - a units:Unit ; - rdfs:label "degrees" ; - rdfs:comment "An angle where 360 degrees is one full rotation." ; - units:render "%f deg" ; - units:symbol "deg" . - -units:midiNote - a units:Unit ; - rdfs:label "MIDI note" ; - rdfs:comment "A MIDI note number." ; - units:render "MIDI note %d" ; - units:symbol "note" . - diff --git a/lv2/uri-map.lv2/manifest.ttl b/lv2/uri-map.lv2/manifest.ttl new file mode 100644 index 0000000..a64e4fb --- /dev/null +++ b/lv2/uri-map.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso . + diff --git a/lv2/uri-map.lv2/uri-map.meta.ttl b/lv2/uri-map.lv2/uri-map.meta.ttl new file mode 100644 index 0000000..acd1c26 --- /dev/null +++ b/lv2/uri-map.lv2/uri-map.meta.ttl @@ -0,0 +1,72 @@ +@prefix lv2: . +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix rdfs: . + + + a doap:Project ; + doap:maintainer ; + doap:created "2008-00-00" ; + doap:developer , + ; + doap:license ; + doap:name "LV2 URI Map" ; + doap:shortdesc "A feature for mapping URIs to integers." ; + doap:release [ + doap:revision "1.6" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.4" ; + doap:created "2011-11-21" ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Update packaging." + ] , [ + rdfs:label "Deprecate uri-map in favour of urid." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2011-05-26" ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add build system (for installation)." + ] , [ + rdfs:label "Mark up documentation in HTML using lv2:documentation." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2010-10-18" ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension is deprecated. New implementations +should use [LV2 URID](urid.html) instead. + +This extension defines a simple mechanism for plugins to map URIs to integers, +usually for performance reasons (e.g. processing events typed by URIs in real +time). The expected use case is for plugins to map URIs to integers for things +they 'understand' at instantiation time, and store those values for use in the +audio thread without doing any string comparison. This allows the +extensibility of RDF with the performance of integers (or centrally defined +enumerations). + +"""^^lv2:Markdown . + diff --git a/lv2/uri-map.lv2/uri-map.ttl b/lv2/uri-map.lv2/uri-map.ttl new file mode 100644 index 0000000..7a7d6e3 --- /dev/null +++ b/lv2/uri-map.lv2/uri-map.ttl @@ -0,0 +1,13 @@ +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix umap: . + + + a lv2:Feature ; + owl:deprecated true ; + rdfs:label "LV2 URI Map" ; + rdfs:comment "A feature for mapping URIs to integers." ; + rdfs:seeAlso . + diff --git a/lv2/uri-map/manifest.ttl b/lv2/uri-map/manifest.ttl deleted file mode 100644 index a64e4fb..0000000 --- a/lv2/uri-map/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 6 ; - rdfs:seeAlso . - diff --git a/lv2/uri-map/meson.build b/lv2/uri-map/meson.build deleted file mode 100644 index 1961645..0000000 --- a/lv2/uri-map/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'uri-map' -path = 'ns' / 'ext' / 'uri-map' - -uri_map_data = files( - 'uri-map.meta.ttl', - 'uri-map.ttl', - 'manifest.ttl', -) - -headers = files( - 'uri-map.h', -) - -# Install specification bundle -install_data(uri_map_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_uri_map_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('uri-map.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/uri-map/uri-map.h b/lv2/uri-map/uri-map.h deleted file mode 100644 index 47cde1c..0000000 --- a/lv2/uri-map/uri-map.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_URI_MAP_H -#define LV2_URI_MAP_H - -/** - @defgroup uri-map URI Map - @ingroup lv2 - - A feature for mapping URIs to integers. - - This extension defines a simple mechanism for plugins to map URIs to - integers, usually for performance reasons (e.g. processing events typed by - URIs in real time). The expected use case is for plugins to map URIs to - integers for things they 'understand' at instantiation time, and store those - values for use in the audio thread without doing any string comparison. - This allows the extensibility of RDF with the performance of integers (or - centrally defined enumerations). - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_URI_MAP_URI "http://lv2plug.in/ns/ext/uri-map" ///< http://lv2plug.in/ns/ext/uri-map -#define LV2_URI_MAP_PREFIX LV2_URI_MAP_URI "#" ///< http://lv2plug.in/ns/ext/uri-map# - -// clang-format on - -#include "lv2/core/attributes.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -LV2_DISABLE_DEPRECATION_WARNINGS - -/** - Opaque pointer to host data. -*/ -LV2_DEPRECATED -typedef void* LV2_URI_Map_Callback_Data; - -/** - URI Map Feature. - - To support this feature the host must pass an LV2_Feature struct to the - plugin's instantiate method with URI "http://lv2plug.in/ns/ext/uri-map" - and data pointed to an instance of this struct. -*/ -LV2_DEPRECATED -typedef struct { - /** - Opaque pointer to host data. - - The plugin MUST pass this to any call to functions in this struct. - Otherwise, it must not be interpreted in any way. - */ - LV2_URI_Map_Callback_Data callback_data; - - /** - Get the numeric ID of a URI from the host. - - @param callback_data Must be the callback_data member of this struct. - @param map The 'context' of this URI. Certain extensions may define a - URI that must be passed here with certain restrictions on the return - value (e.g. limited range). This value may be NULL if the plugin needs - an ID for a URI in general. Extensions SHOULD NOT define a context - unless there is a specific need to do so, e.g. to restrict the range of - the returned value. - @param uri The URI to be mapped to an integer ID. - - This function is referentially transparent; any number of calls with the - same arguments is guaranteed to return the same value over the life of a - plugin instance (though the same URI may return different values with a - different map parameter). However, this function is not necessarily very - fast: plugins SHOULD cache any IDs they might need in performance - critical situations. - - The return value 0 is reserved and indicates that an ID for that URI - could not be created for whatever reason. Extensions MAY define more - precisely what this means in a certain context, but in general plugins - SHOULD handle this situation as gracefully as possible. However, hosts - SHOULD NOT return 0 from this function in non-exceptional circumstances - (e.g. the URI map SHOULD be dynamic). Hosts that statically support only - a fixed set of URIs should not expect plugins to function correctly. - */ - uint32_t (*uri_to_id)(LV2_URI_Map_Callback_Data callback_data, - const char* map, - const char* uri); -} LV2_URI_Map_Feature; - -LV2_RESTORE_WARNINGS - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_URI_MAP_H */ diff --git a/lv2/uri-map/uri-map.meta.ttl b/lv2/uri-map/uri-map.meta.ttl deleted file mode 100644 index acd1c26..0000000 --- a/lv2/uri-map/uri-map.meta.ttl +++ /dev/null @@ -1,72 +0,0 @@ -@prefix lv2: . -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix rdfs: . - - - a doap:Project ; - doap:maintainer ; - doap:created "2008-00-00" ; - doap:developer , - ; - doap:license ; - doap:name "LV2 URI Map" ; - doap:shortdesc "A feature for mapping URIs to integers." ; - doap:release [ - doap:revision "1.6" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.4" ; - doap:created "2011-11-21" ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Update packaging." - ] , [ - rdfs:label "Deprecate uri-map in favour of urid." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2011-05-26" ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add build system (for installation)." - ] , [ - rdfs:label "Mark up documentation in HTML using lv2:documentation." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2010-10-18" ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension is deprecated. New implementations -should use [LV2 URID](urid.html) instead. - -This extension defines a simple mechanism for plugins to map URIs to integers, -usually for performance reasons (e.g. processing events typed by URIs in real -time). The expected use case is for plugins to map URIs to integers for things -they 'understand' at instantiation time, and store those values for use in the -audio thread without doing any string comparison. This allows the -extensibility of RDF with the performance of integers (or centrally defined -enumerations). - -"""^^lv2:Markdown . - diff --git a/lv2/uri-map/uri-map.ttl b/lv2/uri-map/uri-map.ttl deleted file mode 100644 index bfb0d0b..0000000 --- a/lv2/uri-map/uri-map.ttl +++ /dev/null @@ -1,14 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix umap: . - - - a lv2:Feature ; - owl:deprecated true ; - rdfs:label "LV2 URI Map" ; - rdfs:comment "A feature for mapping URIs to integers." ; - rdfs:seeAlso , - . - diff --git a/lv2/urid.lv2/manifest.ttl b/lv2/urid.lv2/manifest.ttl new file mode 100644 index 0000000..772e2b6 --- /dev/null +++ b/lv2/urid.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso . + diff --git a/lv2/urid.lv2/urid.meta.ttl b/lv2/urid.lv2/urid.meta.ttl new file mode 100644 index 0000000..b2a74fa --- /dev/null +++ b/lv2/urid.lv2/urid.meta.ttl @@ -0,0 +1,84 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . +@prefix urid: . + + + a doap:Project ; + doap:license ; + doap:name "LV2 URID" ; + doap:shortdesc "Features for mapping URIs to and from integers." ; + doap:created "2011-07-22" ; + doap:developer ; + doap:maintainer ; + doap:release [ + doap:revision "1.4" ; + doap:created "2012-10-14" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix typo in urid:unmap documentation." + ] + ] + ] , [ + doap:revision "1.2" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add feature struct names." + ] , [ + rdfs:label "Merge with unified LV2 package." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2011-11-21" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a simple mechanism for plugins to map URIs to and from +integers. This is usually used for performance reasons, for example for +processing events with URI types in real-time audio code). Typically, plugins +map URIs to integers for things they "understand" at instantiation time, and +store those values for use in the audio thread without doing any string +comparison. This allows for the extensibility of RDF but with the performance +of integers. + +This extension is intended as an improved and simplified replacement for the +[uri-map](uri-map.html) extension, since the `map` context parameter there has +proven problematic. This extension is functionally equivalent to the uri-map +extension with a NULL context. New implementations are encouraged to use this +extension for URI mapping. + +"""^^lv2:Markdown . + +urid:map + lv2:documentation """ + +To support this feature, the host must pass an LV2_Feature to +LV2_Descriptor::instantiate() with URI LV2_URID__map and data pointed to an +instance of LV2_URID_Map. + +"""^^lv2:Markdown . + +urid:unmap + lv2:documentation """ + +To support this feature, the host must pass an LV2_Feature to +LV2_Descriptor::instantiate() with URI LV2_URID__unmap and data pointed to an +instance of LV2_URID_Unmap. + +"""^^lv2:Markdown . + diff --git a/lv2/urid.lv2/urid.ttl b/lv2/urid.lv2/urid.ttl new file mode 100644 index 0000000..6ce666a --- /dev/null +++ b/lv2/urid.lv2/urid.ttl @@ -0,0 +1,22 @@ +@prefix lv2: . +@prefix owl: . +@prefix rdfs: . +@prefix urid: . + + + a owl:Ontology ; + rdfs:label "LV2 URID" ; + rdfs:comment "Features for mapping URIs to and from integers." ; + rdfs:seeAlso ; + owl:imports . + +urid:map + a lv2:Feature ; + rdfs:label "map" ; + rdfs:comment "A feature to map URI strings to integer URIDs." . + +urid:unmap + a lv2:Feature ; + rdfs:label "unmap" ; + rdfs:comment "A feature to unmap URIDs back to strings." . + diff --git a/lv2/urid/manifest.ttl b/lv2/urid/manifest.ttl deleted file mode 100644 index 772e2b6..0000000 --- a/lv2/urid/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 4 ; - rdfs:seeAlso . - diff --git a/lv2/urid/meson.build b/lv2/urid/meson.build deleted file mode 100644 index 38efe4b..0000000 --- a/lv2/urid/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'urid' -path = 'ns' / 'ext' / 'urid' - -urid_data = files( - 'urid.meta.ttl', - 'urid.ttl', - 'manifest.ttl', -) - -headers = files( - 'urid.h', -) - -# Install specification bundle -install_data(urid_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_urid_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('urid.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/urid/urid.h b/lv2/urid/urid.h deleted file mode 100644 index b537d14..0000000 --- a/lv2/urid/urid.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - Copyright 2008-2016 David Robillard - Copyright 2011 Gabriel M. Beddingfield - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_URID_H -#define LV2_URID_H - -/** - @defgroup urid URID - @ingroup lv2 - - Features for mapping URIs to and from integers. - - See for details. - - @{ -*/ - -// clang-format off - -#define LV2_URID_URI "http://lv2plug.in/ns/ext/urid" ///< http://lv2plug.in/ns/ext/urid -#define LV2_URID_PREFIX LV2_URID_URI "#" ///< http://lv2plug.in/ns/ext/urid# - -#define LV2_URID__map LV2_URID_PREFIX "map" ///< http://lv2plug.in/ns/ext/urid#map -#define LV2_URID__unmap LV2_URID_PREFIX "unmap" ///< http://lv2plug.in/ns/ext/urid#unmap - -#define LV2_URID_MAP_URI LV2_URID__map ///< Legacy -#define LV2_URID_UNMAP_URI LV2_URID__unmap ///< Legacy - -// clang-format on - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Opaque pointer to host data for LV2_URID_Map. -*/ -typedef void* LV2_URID_Map_Handle; - -/** - Opaque pointer to host data for LV2_URID_Unmap. -*/ -typedef void* LV2_URID_Unmap_Handle; - -/** - URI mapped to an integer. -*/ -typedef uint32_t LV2_URID; - -/** - URID Map Feature (LV2_URID__map) -*/ -typedef struct { - /** - Opaque pointer to host data. - - This MUST be passed to map_uri() whenever it is called. - Otherwise, it must not be interpreted in any way. - */ - LV2_URID_Map_Handle handle; - - /** - Get the numeric ID of a URI. - - If the ID does not already exist, it will be created. - - This function is referentially transparent; any number of calls with the - same arguments is guaranteed to return the same value over the life of a - plugin instance. Note, however, that several URIs MAY resolve to the - same ID if the host considers those URIs equivalent. - - This function is not necessarily very fast or RT-safe: plugins SHOULD - cache any IDs they might need in performance critical situations. - - The return value 0 is reserved and indicates that an ID for that URI - could not be created for whatever reason. However, hosts SHOULD NOT - return 0 from this function in non-exceptional circumstances (i.e. the - URI map SHOULD be dynamic). - - @param handle Must be the callback_data member of this struct. - @param uri The URI to be mapped to an integer ID. - */ - LV2_URID (*map)(LV2_URID_Map_Handle handle, const char* uri); -} LV2_URID_Map; - -/** - URI Unmap Feature (LV2_URID__unmap) -*/ -typedef struct { - /** - Opaque pointer to host data. - - This MUST be passed to unmap() whenever it is called. - Otherwise, it must not be interpreted in any way. - */ - LV2_URID_Unmap_Handle handle; - - /** - Get the URI for a previously mapped numeric ID. - - Returns NULL if `urid` is not yet mapped. Otherwise, the corresponding - URI is returned in a canonical form. This MAY not be the exact same - string that was originally passed to LV2_URID_Map::map(), but it MUST be - an identical URI according to the URI syntax specification (RFC3986). A - non-NULL return for a given `urid` will always be the same for the life - of the plugin. Plugins that intend to perform string comparison on - unmapped URIs SHOULD first canonicalise URI strings with a call to - map_uri() followed by a call to unmap_uri(). - - @param handle Must be the callback_data member of this struct. - @param urid The ID to be mapped back to the URI string. - */ - const char* (*unmap)(LV2_URID_Unmap_Handle handle, LV2_URID urid); -} LV2_URID_Unmap; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_URID_H */ diff --git a/lv2/urid/urid.meta.ttl b/lv2/urid/urid.meta.ttl deleted file mode 100644 index b2a74fa..0000000 --- a/lv2/urid/urid.meta.ttl +++ /dev/null @@ -1,84 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix urid: . - - - a doap:Project ; - doap:license ; - doap:name "LV2 URID" ; - doap:shortdesc "Features for mapping URIs to and from integers." ; - doap:created "2011-07-22" ; - doap:developer ; - doap:maintainer ; - doap:release [ - doap:revision "1.4" ; - doap:created "2012-10-14" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Fix typo in urid:unmap documentation." - ] - ] - ] , [ - doap:revision "1.2" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Add feature struct names." - ] , [ - rdfs:label "Merge with unified LV2 package." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2011-11-21" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension defines a simple mechanism for plugins to map URIs to and from -integers. This is usually used for performance reasons, for example for -processing events with URI types in real-time audio code). Typically, plugins -map URIs to integers for things they "understand" at instantiation time, and -store those values for use in the audio thread without doing any string -comparison. This allows for the extensibility of RDF but with the performance -of integers. - -This extension is intended as an improved and simplified replacement for the -[uri-map](uri-map.html) extension, since the `map` context parameter there has -proven problematic. This extension is functionally equivalent to the uri-map -extension with a NULL context. New implementations are encouraged to use this -extension for URI mapping. - -"""^^lv2:Markdown . - -urid:map - lv2:documentation """ - -To support this feature, the host must pass an LV2_Feature to -LV2_Descriptor::instantiate() with URI LV2_URID__map and data pointed to an -instance of LV2_URID_Map. - -"""^^lv2:Markdown . - -urid:unmap - lv2:documentation """ - -To support this feature, the host must pass an LV2_Feature to -LV2_Descriptor::instantiate() with URI LV2_URID__unmap and data pointed to an -instance of LV2_URID_Unmap. - -"""^^lv2:Markdown . - diff --git a/lv2/urid/urid.ttl b/lv2/urid/urid.ttl deleted file mode 100644 index 53aa1e5..0000000 --- a/lv2/urid/urid.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix rdfs: . -@prefix urid: . - - - a owl:Ontology ; - rdfs:label "LV2 URID" ; - rdfs:comment "Features for mapping URIs to and from integers." ; - rdfs:seeAlso , - ; - owl:imports . - -urid:map - a lv2:Feature ; - rdfs:label "map" ; - rdfs:comment "A feature to map URI strings to integer URIDs." . - -urid:unmap - a lv2:Feature ; - rdfs:label "unmap" ; - rdfs:comment "A feature to unmap URIDs back to strings." . - diff --git a/lv2/worker.lv2/manifest.ttl b/lv2/worker.lv2/manifest.ttl new file mode 100644 index 0000000..692720d --- /dev/null +++ b/lv2/worker.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 2 ; + rdfs:seeAlso . + diff --git a/lv2/worker.lv2/worker.meta.ttl b/lv2/worker.lv2/worker.meta.ttl new file mode 100644 index 0000000..2fc51bc --- /dev/null +++ b/lv2/worker.lv2/worker.meta.ttl @@ -0,0 +1,82 @@ +@prefix dcs: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdfs: . +@prefix work: . + + + a doap:Project ; + doap:name "LV2 Worker" ; + doap:shortdesc "Support for doing non-realtime work in plugins." ; + doap:created "2012-03-22" ; + doap:developer ; + doap:release [ + doap:revision "1.2" ; + doap:created "2020-04-26" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Improve documentation." + ] + ] + ] , [ + doap:revision "1.0" ; + doap:created "2012-04-17" ; + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial release." + ] + ] + ] ; + lv2:documentation """ + +This extension allows plugins to schedule work that must be performed in +another thread. Plugins can use this interface to safely perform work that is +not real-time safe, and receive the result in the run context. The details of +threading are managed by the host, allowing plugins to be simple and portable +while using resources more efficiently. + +This interface is designed to gracefully support single-threaded synchronous +execution, which allows the same code to work with sample accuracy for offline +rendering. For example, a sampler plugin may schedule a sample to be loaded +from disk in another thread. During live execution, the host will call the +plugin's work method from another thread, and deliver the result to the audio +thread when it is finished. However, during offline export, the +scheduled load would be executed immediately in the same thread. This +enables reproducible offline rendering, where any changes affect the output +immediately regardless of how long the work takes to execute. + +"""^^lv2:Markdown . + +work:interface + lv2:documentation """ + +The work interface provided by a plugin, LV2_Worker_Interface. + + :::turtle + + @prefix work: . + + + a lv2:Plugin ; + lv2:extensionData work:interface . + +"""^^lv2:Markdown . + +work:schedule + lv2:documentation """ + +The work scheduling feature provided by a host, LV2_Worker_Schedule. + +If the host passes this feature to LV2_Descriptor::instantiate, the plugin MAY +use it to schedule work in the audio thread, and MUST NOT call it in any other +context. Hosts MAY pass this feature to other functions as well, in which case +the plugin MAY use it to schedule work in the calling context. The plugin MUST +NOT assume any relationship between different schedule features. + +"""^^lv2:Markdown . + diff --git a/lv2/worker.lv2/worker.ttl b/lv2/worker.lv2/worker.ttl new file mode 100644 index 0000000..581be71 --- /dev/null +++ b/lv2/worker.lv2/worker.ttl @@ -0,0 +1,24 @@ +@prefix lv2: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix work: . +@prefix xsd: . + + + a owl:Ontology ; + rdfs:label "LV2 Worker" ; + rdfs:comment "Support for doing non-realtime work in plugins." ; + owl:imports ; + rdfs:seeAlso . + +work:interface + a lv2:ExtensionData ; + rdfs:label "work interface" ; + rdfs:comment "The work interface provided by a plugin." . + +work:schedule + a lv2:Feature ; + rdfs:label "work schedule" ; + rdfs:comment "The work scheduling feature provided by a host." . + diff --git a/lv2/worker/manifest.ttl b/lv2/worker/manifest.ttl deleted file mode 100644 index 692720d..0000000 --- a/lv2/worker/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - - a lv2:Specification ; - lv2:minorVersion 1 ; - lv2:microVersion 2 ; - rdfs:seeAlso . - diff --git a/lv2/worker/meson.build b/lv2/worker/meson.build deleted file mode 100644 index 248c594..0000000 --- a/lv2/worker/meson.build +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2022 David Robillard -# SPDX-License-Identifier: CC0-1.0 OR ISC - -name = 'worker' -path = 'ns' / 'ext' / 'worker' - -worker_data = files( - 'worker.meta.ttl', - 'worker.ttl', - 'manifest.ttl', -) - -headers = files( - 'worker.h', -) - -# Install specification bundle -install_data(worker_data, install_dir: lv2dir / name + '.lv2') -install_headers(headers, subdir: 'lv2' / name) -if get_option('old_headers') - install_headers(headers, subdir: 'lv2' / 'lv2plug.in' / path) -endif - -# Build documentation -if build_docs - lv2_worker_docs = custom_target( - name + '.html', - command: lv2specgen_command_prefix + [ - '--docdir=../../html', - '--style-uri=../../aux/style.css', - '@INPUT@', - '@OUTPUT@', - ], - depends: doc_deps, - input: files('worker.ttl'), - install: true, - install_dir: lv2_docdir / 'ns' / 'ext', - output: name + '.html', - ) -endif diff --git a/lv2/worker/worker.h b/lv2/worker/worker.h deleted file mode 100644 index 4fd89f9..0000000 --- a/lv2/worker/worker.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - Copyright 2012-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef LV2_WORKER_H -#define LV2_WORKER_H - -/** - @defgroup worker Worker - @ingroup lv2 - - Support for non-realtime plugin operations. - - See for details. - - @{ -*/ - -#include "lv2/core/lv2.h" - -#include - -// clang-format off - -#define LV2_WORKER_URI "http://lv2plug.in/ns/ext/worker" ///< http://lv2plug.in/ns/ext/worker -#define LV2_WORKER_PREFIX LV2_WORKER_URI "#" ///< http://lv2plug.in/ns/ext/worker# - -#define LV2_WORKER__interface LV2_WORKER_PREFIX "interface" ///< http://lv2plug.in/ns/ext/worker#interface -#define LV2_WORKER__schedule LV2_WORKER_PREFIX "schedule" ///< http://lv2plug.in/ns/ext/worker#schedule - -// clang-format on - -#ifdef __cplusplus -extern "C" { -#endif - -/** - Status code for worker functions. -*/ -typedef enum { - LV2_WORKER_SUCCESS = 0, /**< Completed successfully. */ - LV2_WORKER_ERR_UNKNOWN = 1, /**< Unknown error. */ - LV2_WORKER_ERR_NO_SPACE = 2 /**< Failed due to lack of space. */ -} LV2_Worker_Status; - -/** Opaque handle for LV2_Worker_Interface::work(). */ -typedef void* LV2_Worker_Respond_Handle; - -/** - A function to respond to run() from the worker method. - - The `data` MUST be safe for the host to copy and later pass to - work_response(), and the host MUST guarantee that it will be eventually - passed to work_response() if this function returns LV2_WORKER_SUCCESS. -*/ -typedef LV2_Worker_Status (*LV2_Worker_Respond_Function)( - LV2_Worker_Respond_Handle handle, - uint32_t size, - const void* data); - -/** - Plugin Worker Interface. - - This is the interface provided by the plugin to implement a worker method. - The plugin's extension_data() method should return an LV2_Worker_Interface - when called with LV2_WORKER__interface as its argument. -*/ -typedef struct { - /** - The worker method. This is called by the host in a non-realtime context - as requested, possibly with an arbitrary message to handle. - - A response can be sent to run() using `respond`. The plugin MUST NOT - make any assumptions about which thread calls this method, except that - there are no real-time requirements and only one call may be executed at - a time. That is, the host MAY call this method from any non-real-time - thread, but MUST NOT make concurrent calls to this method from several - threads. - - @param instance The LV2 instance this is a method on. - @param respond A function for sending a response to run(). - @param handle Must be passed to `respond` if it is called. - @param size The size of `data`. - @param data Data from run(), or NULL. - */ - LV2_Worker_Status (*work)(LV2_Handle instance, - LV2_Worker_Respond_Function respond, - LV2_Worker_Respond_Handle handle, - uint32_t size, - const void* data); - - /** - Handle a response from the worker. This is called by the host in the - run() context when a response from the worker is ready. - - @param instance The LV2 instance this is a method on. - @param size The size of `body`. - @param body Message body, or NULL. - */ - LV2_Worker_Status (*work_response)(LV2_Handle instance, - uint32_t size, - const void* body); - - /** - Called when all responses for this cycle have been delivered. - - Since work_response() may be called after run() finished, this provides - a hook for code that must run after the cycle is completed. - - This field may be NULL if the plugin has no use for it. Otherwise, the - host MUST call it after every run(), regardless of whether or not any - responses were sent that cycle. - */ - LV2_Worker_Status (*end_run)(LV2_Handle instance); -} LV2_Worker_Interface; - -/** Opaque handle for LV2_Worker_Schedule. */ -typedef void* LV2_Worker_Schedule_Handle; - -/** - Schedule Worker Host Feature. - - The host passes this feature to provide a schedule_work() function, which - the plugin can use to schedule a worker call from run(). -*/ -typedef struct { - /** - Opaque host data. - */ - LV2_Worker_Schedule_Handle handle; - - /** - Request from run() that the host call the worker. - - This function is in the audio threading class. It should be called from - run() to request that the host call the work() method in a non-realtime - context with the given arguments. - - This function is always safe to call from run(), but it is not - guaranteed that the worker is actually called from a different thread. - In particular, when free-wheeling (for example, during offline - rendering), the worker may be executed immediately. This allows - single-threaded processing with sample accuracy and avoids timing - problems when run() is executing much faster or slower than real-time. - - Plugins SHOULD be written in such a way that if the worker runs - immediately, and responses from the worker are delivered immediately, - the effect of the work takes place immediately with sample accuracy. - - The `data` MUST be safe for the host to copy and later pass to work(), - and the host MUST guarantee that it will be eventually passed to work() - if this function returns LV2_WORKER_SUCCESS. - - @param handle The handle field of this struct. - @param size The size of `data`. - @param data Message to pass to work(), or NULL. - */ - LV2_Worker_Status (*schedule_work)(LV2_Worker_Schedule_Handle handle, - uint32_t size, - const void* data); -} LV2_Worker_Schedule; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -/** - @} -*/ - -#endif /* LV2_WORKER_H */ diff --git a/lv2/worker/worker.meta.ttl b/lv2/worker/worker.meta.ttl deleted file mode 100644 index 2fc51bc..0000000 --- a/lv2/worker/worker.meta.ttl +++ /dev/null @@ -1,82 +0,0 @@ -@prefix dcs: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix work: . - - - a doap:Project ; - doap:name "LV2 Worker" ; - doap:shortdesc "Support for doing non-realtime work in plugins." ; - doap:created "2012-03-22" ; - doap:developer ; - doap:release [ - doap:revision "1.2" ; - doap:created "2020-04-26" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Improve documentation." - ] - ] - ] , [ - doap:revision "1.0" ; - doap:created "2012-04-17" ; - doap:file-release ; - dcs:blame ; - dcs:changeset [ - dcs:item [ - rdfs:label "Initial release." - ] - ] - ] ; - lv2:documentation """ - -This extension allows plugins to schedule work that must be performed in -another thread. Plugins can use this interface to safely perform work that is -not real-time safe, and receive the result in the run context. The details of -threading are managed by the host, allowing plugins to be simple and portable -while using resources more efficiently. - -This interface is designed to gracefully support single-threaded synchronous -execution, which allows the same code to work with sample accuracy for offline -rendering. For example, a sampler plugin may schedule a sample to be loaded -from disk in another thread. During live execution, the host will call the -plugin's work method from another thread, and deliver the result to the audio -thread when it is finished. However, during offline export, the -scheduled load would be executed immediately in the same thread. This -enables reproducible offline rendering, where any changes affect the output -immediately regardless of how long the work takes to execute. - -"""^^lv2:Markdown . - -work:interface - lv2:documentation """ - -The work interface provided by a plugin, LV2_Worker_Interface. - - :::turtle - - @prefix work: . - - - a lv2:Plugin ; - lv2:extensionData work:interface . - -"""^^lv2:Markdown . - -work:schedule - lv2:documentation """ - -The work scheduling feature provided by a host, LV2_Worker_Schedule. - -If the host passes this feature to LV2_Descriptor::instantiate, the plugin MAY -use it to schedule work in the audio thread, and MUST NOT call it in any other -context. Hosts MAY pass this feature to other functions as well, in which case -the plugin MAY use it to schedule work in the calling context. The plugin MUST -NOT assume any relationship between different schedule features. - -"""^^lv2:Markdown . - diff --git a/lv2/worker/worker.ttl b/lv2/worker/worker.ttl deleted file mode 100644 index cb8a81a..0000000 --- a/lv2/worker/worker.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix lv2: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix work: . -@prefix xsd: . - - - a owl:Ontology ; - rdfs:label "LV2 Worker" ; - rdfs:comment "Support for doing non-realtime work in plugins." ; - owl:imports ; - rdfs:seeAlso , - . - -work:interface - a lv2:ExtensionData ; - rdfs:label "work interface" ; - rdfs:comment "The work interface provided by a plugin." . - -work:schedule - a lv2:Feature ; - rdfs:label "work schedule" ; - rdfs:comment "The work scheduling feature provided by a host." . - -- cgit v1.2.1