aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-format37
-rw-r--r--.clang-tidy23
-rw-r--r--.gitignore10
-rw-r--r--.gitlab-ci.yml261
-rw-r--r--.gitmodules3
-rw-r--r--.reuse/dep572
-rw-r--r--.stylelintrc.json8
-rw-r--r--COPYING18
-rw-r--r--INSTALL.md79
-rw-r--r--LICENSES/0BSD.txt12
-rw-r--r--LICENSES/Apache-2.0.txt201
-rw-r--r--LICENSES/CC-BY-1.0.txt221
-rw-r--r--LICENSES/CC-BY-4.0.txt395
l---------LICENSES/ISC.txt1
-rw-r--r--LICENSES/MIT.txt17
-rw-r--r--LICENSES/W3C-19980720.txt45
-rw-r--r--LICENSES/W3C-20150513.txt40
-rw-r--r--NEWS277
-rw-r--r--README.md94
-rw-r--r--doc/c/doxy-style.css (renamed from doc/doxy-style.css)240
-rw-r--r--doc/c/footer.html (renamed from doc/footer.html)0
-rw-r--r--doc/c/header.html (renamed from doc/header.html)0
-rw-r--r--doc/c/layout.xml (renamed from doc/layout.xml)58
-rw-r--r--doc/c/mainpage.md (renamed from doc/mainpage.md)0
-rw-r--r--doc/c/meson.build41
-rw-r--r--doc/c/reference.doxygen.in (renamed from doc/reference.doxygen.in)491
-rw-r--r--doc/index.html.in7
-rw-r--r--doc/ns/ext/meson.build68
-rw-r--r--doc/ns/extensions/meson.build49
-rw-r--r--doc/ns/meson.build83
-rw-r--r--doc/pygments.css61
-rw-r--r--doc/style/asciidoc.css (renamed from doc/asciidoc.css)2
-rw-r--r--doc/style/meson.build13
-rw-r--r--doc/style/pygments.css558
-rw-r--r--doc/style/style.css (renamed from doc/style.css)176
-rw-r--r--include/lv2/atom/atom.h (renamed from lv2/atom/atom.h)156
-rw-r--r--include/lv2/atom/forge.h (renamed from lv2/atom/forge.h)474
-rw-r--r--include/lv2/atom/util.h (renamed from lv2/atom/util.h)388
-rw-r--r--include/lv2/buf-size/buf-size.h (renamed from lv2/buf-size/buf-size.h)32
-rw-r--r--include/lv2/core/attributes.h46
-rw-r--r--include/lv2/core/lv2.h (renamed from lv2/core/lv2.h)500
-rw-r--r--include/lv2/core/lv2_util.h95
-rw-r--r--include/lv2/data-access/data-access.h60
-rw-r--r--include/lv2/dynmanifest/dynmanifest.h (renamed from lv2/dynmanifest/dynmanifest.h)66
-rw-r--r--include/lv2/event/event-helpers.h242
-rw-r--r--include/lv2/event/event.h285
-rw-r--r--include/lv2/instance-access/instance-access.h28
-rw-r--r--include/lv2/log/log.h100
-rw-r--r--include/lv2/log/logger.h144
-rw-r--r--include/lv2/midi/midi.h235
-rw-r--r--include/lv2/morph/morph.h35
-rw-r--r--include/lv2/options/options.h136
-rw-r--r--include/lv2/parameters/parameters.h (renamed from lv2/parameters/parameters.h)32
-rw-r--r--include/lv2/patch/patch.h (renamed from lv2/patch/patch.h)30
-rw-r--r--include/lv2/port-groups/port-groups.h (renamed from lv2/port-groups/port-groups.h)30
-rw-r--r--include/lv2/port-props/port-props.h (renamed from lv2/port-props/port-props.h)27
-rw-r--r--include/lv2/presets/presets.h35
-rw-r--r--include/lv2/resize-port/resize-port.h76
-rw-r--r--include/lv2/state/state.h379
-rw-r--r--include/lv2/time/time.h (renamed from lv2/time/time.h)32
-rw-r--r--include/lv2/ui/ui.h529
-rw-r--r--include/lv2/units/units.h (renamed from lv2/units/units.h)30
-rw-r--r--include/lv2/uri-map/uri-map.h108
-rw-r--r--include/lv2/urid/urid.h127
-rw-r--r--include/lv2/worker/worker.h170
-rw-r--r--lv2.pc.in7
-rw-r--r--lv2/atom.lv2/atom.meta.ttl (renamed from lv2/atom/atom.meta.ttl)95
-rw-r--r--lv2/atom.lv2/atom.ttl (renamed from lv2/atom/atom.ttl)11
-rw-r--r--lv2/atom.lv2/manifest.ttl (renamed from lv2/atom/manifest.ttl)3
-rw-r--r--lv2/atom/atom-test-utils.c73
-rw-r--r--lv2/atom/atom-test.c366
-rw-r--r--lv2/atom/forge-overflow-test.c239
-rw-r--r--lv2/buf-size.lv2/buf-size.meta.ttl (renamed from lv2/buf-size/buf-size.meta.ttl)35
-rw-r--r--lv2/buf-size.lv2/buf-size.ttl (renamed from lv2/buf-size/buf-size.ttl)6
-rw-r--r--lv2/buf-size.lv2/manifest.ttl (renamed from lv2/buf-size/manifest.ttl)1
-rw-r--r--lv2/core.lv2/lv2core.meta.ttl (renamed from lv2/core/lv2core.meta.ttl)207
-rw-r--r--lv2/core.lv2/lv2core.ttl (renamed from lv2/core/lv2core.ttl)14
-rw-r--r--lv2/core.lv2/manifest.ttl (renamed from lv2/core/manifest.ttl)3
-rw-r--r--lv2/core.lv2/meta.ttl34
-rw-r--r--lv2/core.lv2/people.ttl (renamed from lv2/core/people.ttl)1
-rw-r--r--lv2/core/attributes.h59
-rw-r--r--lv2/core/lv2_util.h104
-rw-r--r--lv2/core/meta.ttl187
-rw-r--r--lv2/data-access.lv2/data-access.meta.ttl (renamed from lv2/data-access/data-access.meta.ttl)48
-rw-r--r--lv2/data-access.lv2/data-access.ttl (renamed from lv2/data-access/data-access.ttl)4
-rw-r--r--lv2/data-access.lv2/manifest.ttl (renamed from lv2/data-access/manifest.ttl)1
-rw-r--r--lv2/data-access/data-access.h69
-rw-r--r--lv2/dynmanifest.lv2/dynmanifest.meta.ttl (renamed from lv2/dynmanifest/dynmanifest.meta.ttl)43
-rw-r--r--lv2/dynmanifest.lv2/dynmanifest.ttl (renamed from lv2/dynmanifest/dynmanifest.ttl)4
-rw-r--r--lv2/dynmanifest.lv2/manifest.ttl (renamed from lv2/dynmanifest/manifest.ttl)1
-rw-r--r--lv2/event.lv2/event.meta.ttl (renamed from lv2/event/event.meta.ttl)89
-rw-r--r--lv2/event.lv2/event.ttl (renamed from lv2/event/event.ttl)8
-rw-r--r--lv2/event.lv2/manifest.ttl (renamed from lv2/event/manifest.ttl)3
-rw-r--r--lv2/event/event-helpers.h268
-rw-r--r--lv2/event/event.h304
-rw-r--r--lv2/instance-access.lv2/instance-access.meta.ttl28
-rw-r--r--lv2/instance-access.lv2/instance-access.ttl (renamed from lv2/instance-access/instance-access.ttl)4
-rw-r--r--lv2/instance-access.lv2/manifest.ttl (renamed from lv2/instance-access/manifest.ttl)1
-rw-r--r--lv2/instance-access/instance-access.h37
-rw-r--r--lv2/instance-access/instance-access.meta.ttl75
-rw-r--r--lv2/log.lv2/log.meta.ttl (renamed from lv2/log/log.meta.ttl)43
-rw-r--r--lv2/log.lv2/log.ttl (renamed from lv2/log/log.ttl)5
-rw-r--r--lv2/log.lv2/manifest.ttl (renamed from lv2/log/manifest.ttl)1
-rw-r--r--lv2/log/log.h110
-rw-r--r--lv2/log/logger.h158
-rw-r--r--lv2/midi.lv2/manifest.ttl (renamed from lv2/midi/manifest.ttl)1
-rw-r--r--lv2/midi.lv2/midi.meta.ttl (renamed from lv2/midi/midi.meta.ttl)81
-rw-r--r--lv2/midi.lv2/midi.ttl (renamed from lv2/midi/midi.ttl)4
-rw-r--r--lv2/midi/midi.h236
-rw-r--r--lv2/morph.lv2/manifest.ttl (renamed from lv2/morph/manifest.ttl)1
-rw-r--r--lv2/morph.lv2/morph.meta.ttl (renamed from lv2/morph/morph.meta.ttl)13
-rw-r--r--lv2/morph.lv2/morph.ttl (renamed from lv2/morph/morph.ttl)5
-rw-r--r--lv2/morph/morph.h43
-rw-r--r--lv2/options.lv2/manifest.ttl (renamed from lv2/options/manifest.ttl)1
-rw-r--r--lv2/options.lv2/options.meta.ttl (renamed from lv2/options/options.meta.ttl)33
-rw-r--r--lv2/options.lv2/options.ttl (renamed from lv2/options/options.ttl)5
-rw-r--r--lv2/options/options.h146
-rw-r--r--lv2/parameters.lv2/manifest.ttl (renamed from lv2/parameters/manifest.ttl)1
-rw-r--r--lv2/parameters.lv2/parameters.meta.ttl (renamed from lv2/parameters/parameters.meta.ttl)37
-rw-r--r--lv2/parameters.lv2/parameters.ttl (renamed from lv2/parameters/parameters.ttl)6
-rw-r--r--lv2/patch.lv2/manifest.ttl (renamed from lv2/patch/manifest.ttl)3
-rw-r--r--lv2/patch.lv2/patch.meta.ttl (renamed from lv2/patch/patch.meta.ttl)69
-rw-r--r--lv2/patch.lv2/patch.ttl (renamed from lv2/patch/patch.ttl)10
-rw-r--r--lv2/port-groups.lv2/manifest.ttl (renamed from lv2/port-groups/manifest.ttl)1
-rw-r--r--lv2/port-groups.lv2/port-groups.meta.ttl (renamed from lv2/port-groups/port-groups.meta.ttl)37
-rw-r--r--lv2/port-groups.lv2/port-groups.ttl (renamed from lv2/port-groups/port-groups.ttl)6
-rw-r--r--lv2/port-props.lv2/manifest.ttl (renamed from lv2/port-props/manifest.ttl)1
-rw-r--r--lv2/port-props.lv2/port-props.meta.ttl (renamed from lv2/port-props/port-props.meta.ttl)23
-rw-r--r--lv2/port-props.lv2/port-props.ttl (renamed from lv2/port-props/port-props.ttl)4
-rw-r--r--lv2/presets.lv2/manifest.ttl (renamed from lv2/presets/manifest.ttl)1
-rw-r--r--lv2/presets.lv2/presets.meta.ttl (renamed from lv2/presets/presets.meta.ttl)51
-rw-r--r--lv2/presets.lv2/presets.ttl (renamed from lv2/presets/presets.ttl)8
-rw-r--r--lv2/presets/presets.h42
-rw-r--r--lv2/resize-port.lv2/manifest.ttl (renamed from lv2/resize-port/manifest.ttl)1
-rw-r--r--lv2/resize-port.lv2/resize-port.meta.ttl (renamed from lv2/resize-port/resize-port.meta.ttl)13
-rw-r--r--lv2/resize-port.lv2/resize-port.ttl (renamed from lv2/resize-port/resize-port.ttl)5
-rw-r--r--lv2/resize-port/resize-port.h86
-rw-r--r--lv2/state.lv2/manifest.ttl (renamed from lv2/state/manifest.ttl)3
-rw-r--r--lv2/state.lv2/state.meta.ttl (renamed from lv2/state/state.meta.ttl)75
-rw-r--r--lv2/state.lv2/state.ttl (renamed from lv2/state/state.ttl)5
-rw-r--r--lv2/state/state.h389
-rw-r--r--lv2/time.lv2/manifest.ttl (renamed from lv2/time/manifest.ttl)1
-rw-r--r--lv2/time.lv2/time.meta.ttl (renamed from lv2/time/time.meta.ttl)43
-rw-r--r--lv2/time.lv2/time.ttl (renamed from lv2/time/time.ttl)4
-rw-r--r--lv2/ui.lv2/manifest.ttl (renamed from lv2/ui/manifest.ttl)3
-rw-r--r--lv2/ui.lv2/ui.meta.ttl (renamed from lv2/ui/ui.meta.ttl)151
-rw-r--r--lv2/ui.lv2/ui.ttl (renamed from lv2/ui/ui.ttl)10
-rw-r--r--lv2/ui/ui.h539
-rw-r--r--lv2/units.lv2/manifest.ttl (renamed from lv2/units/manifest.ttl)1
-rw-r--r--lv2/units.lv2/units.meta.ttl57
-rw-r--r--lv2/units.lv2/units.ttl (renamed from lv2/units/units.ttl)4
-rw-r--r--lv2/units/units.meta.ttl154
-rw-r--r--lv2/uri-map.lv2/manifest.ttl (renamed from lv2/uri-map/manifest.ttl)1
-rw-r--r--lv2/uri-map.lv2/uri-map.meta.ttl (renamed from lv2/uri-map/uri-map.meta.ttl)44
-rw-r--r--lv2/uri-map.lv2/uri-map.ttl (renamed from lv2/uri-map/uri-map.ttl)4
-rw-r--r--lv2/uri-map/uri-map.h115
-rw-r--r--lv2/urid.lv2/manifest.ttl (renamed from lv2/urid/manifest.ttl)1
-rw-r--r--lv2/urid.lv2/urid.meta.ttl (renamed from lv2/urid/urid.meta.ttl)35
-rw-r--r--lv2/urid.lv2/urid.ttl (renamed from lv2/urid/urid.ttl)5
-rw-r--r--lv2/urid/urid.h137
-rw-r--r--lv2/worker.lv2/manifest.ttl (renamed from lv2/worker/manifest.ttl)1
-rw-r--r--lv2/worker.lv2/worker.meta.ttl (renamed from lv2/worker/worker.meta.ttl)23
-rw-r--r--lv2/worker.lv2/worker.ttl (renamed from lv2/worker/worker.ttl)4
-rw-r--r--lv2/worker/worker.h178
-rw-r--r--lv2specgen/DTD/xhtml-rdfa-1.dtd41
-rwxr-xr-xlv2specgen/lv2docgen.py108
-rwxr-xr-xlv2specgen/lv2specgen.py451
-rw-r--r--lv2specgen/meson.build44
l---------lv2specgen/style.css1
-rw-r--r--lv2specgen/template.html21
-rw-r--r--meson.build373
-rw-r--r--meson/suppressions/meson.build167
-rw-r--r--meson_options.txt26
-rw-r--r--plugins/.clang-tidy14
-rw-r--r--plugins/eg-amp.lv2/amp.c134
-rw-r--r--plugins/eg-amp.lv2/meson.build41
l---------plugins/eg-amp.lv2/waf1
-rw-r--r--plugins/eg-amp.lv2/wscript51
-rw-r--r--plugins/eg-fifths.lv2/fifths.c255
-rw-r--r--plugins/eg-fifths.lv2/meson.build41
-rw-r--r--plugins/eg-fifths.lv2/uris.h59
l---------plugins/eg-fifths.lv2/waf1
-rw-r--r--plugins/eg-fifths.lv2/wscript49
-rw-r--r--plugins/eg-metro.lv2/meson.build41
-rw-r--r--plugins/eg-metro.lv2/metro.c476
l---------plugins/eg-metro.lv2/waf1
-rw-r--r--plugins/eg-metro.lv2/wscript50
-rw-r--r--plugins/eg-midigate.lv2/meson.build41
-rw-r--r--plugins/eg-midigate.lv2/midigate.c243
l---------plugins/eg-midigate.lv2/waf1
-rw-r--r--plugins/eg-midigate.lv2/wscript49
-rw-r--r--plugins/eg-params.lv2/meson.build41
-rw-r--r--plugins/eg-params.lv2/params.c710
-rw-r--r--plugins/eg-params.lv2/state_map.h99
-rw-r--r--plugins/eg-params.lv2/wscript49
-rw-r--r--plugins/eg-sampler.lv2/atom_sink.h34
-rw-r--r--plugins/eg-sampler.lv2/manifest.ttl.in2
-rw-r--r--plugins/eg-sampler.lv2/meson.build78
-rw-r--r--plugins/eg-sampler.lv2/peaks.h317
-rw-r--r--plugins/eg-sampler.lv2/sampler.c957
-rw-r--r--plugins/eg-sampler.lv2/sampler.ttl2
-rw-r--r--plugins/eg-sampler.lv2/sampler_ui.c608
-rw-r--r--plugins/eg-sampler.lv2/uris.h216
l---------plugins/eg-sampler.lv2/waf1
-rw-r--r--plugins/eg-sampler.lv2/wscript64
-rw-r--r--plugins/eg-scope.lv2/examploscope.c590
-rw-r--r--plugins/eg-scope.lv2/examploscope_ui.c995
-rw-r--r--plugins/eg-scope.lv2/manifest.ttl.in2
-rw-r--r--plugins/eg-scope.lv2/meson.build62
-rw-r--r--plugins/eg-scope.lv2/uris.h92
-rw-r--r--plugins/eg-scope.lv2/wscript56
-rwxr-xr-xplugins/literasc.py158
-rw-r--r--plugins/meson.build82
-rw-r--r--plugins/wscript45
-rw-r--r--resources/logo/lv2.ipe291
-rw-r--r--resources/logo/lv2_badge_metallic.svg25
-rw-r--r--resources/logo/lv2_flat_green.svg10
-rw-r--r--resources/logo/lv2_flat_green_border.svg14
-rw-r--r--resources/logo/lv2_flat_purple.svg10
-rw-r--r--resources/logo/lv2_metallic.svg20
-rw-r--r--resources/logo/lv2site.ipe295
-rw-r--r--resources/logo/lv2site_purple.svg9
-rw-r--r--schemas.lv2/README.txt (renamed from schemas.lv2/README)0
-rw-r--r--schemas.lv2/dcs.ttl272
-rw-r--r--schemas.lv2/dcterms.ttl (renamed from schemas.lv2/dct.ttl)3
-rw-r--r--schemas.lv2/doap.ttl167
-rw-r--r--schemas.lv2/foaf.ttl918
-rw-r--r--schemas.lv2/manifest.ttl8
-rw-r--r--schemas.lv2/meson.build15
-rw-r--r--schemas.lv2/owl.ttl885
-rw-r--r--schemas.lv2/rdf.ttl185
-rw-r--r--schemas.lv2/rdfs.ttl179
-rw-r--r--schemas.lv2/xsd.ttl253
-rwxr-xr-xscripts/lv2_build_index.py207
-rwxr-xr-xscripts/lv2_check_specification.py248
-rwxr-xr-xscripts/lv2_check_syntax.py85
-rw-r--r--scripts/meson.build8
-rw-r--r--test/.clang-tidy15
-rw-r--r--test/atom_test_utils.c60
-rw-r--r--test/cpp/.clang-tidy26
-rw-r--r--test/cpp/test_build.cpp54
-rw-r--r--test/headers/.clang-tidy22
-rw-r--r--test/headers/meson.build68
-rw-r--r--test/headers/test_headers.c42
-rw-r--r--test/meson.build172
-rw-r--r--test/test_atom.c354
-rw-r--r--test/test_build.c39
-rw-r--r--test/test_forge_overflow.c223
-rwxr-xr-xutil/lv2_validate.in20
-rw-r--r--util/meson.build12
-rwxr-xr-xwaf27
m---------waflib0
-rw-r--r--wscript827
253 files changed, 14624 insertions, 13482 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..8ee2675
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,37 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+---
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+AlignEscapedNewlinesLeft: true
+BasedOnStyle: Mozilla
+BraceWrapping:
+ AfterNamespace: false
+ AfterClass: true
+ AfterEnum: false
+ AfterExternBlock: false
+ AfterFunction: true
+ AfterStruct: false
+ SplitEmptyFunction: false
+ SplitEmptyRecord: false
+BreakBeforeBraces: Custom
+Cpp11BracedListStyle: true
+IndentCaseLabels: false
+IndentPPDirectives: AfterHash
+KeepEmptyLinesAtTheStartOfBlocks: false
+SpacesInContainerLiterals: false
+StatementMacros:
+ - LV2_DEPRECATED
+ - LV2_DISABLE_DEPRECATION_WARNINGS
+ - LV2_RESTORE_WARNINGS
+ - LV2_SYMBOL_EXPORT
+ - _Pragma
+ForEachMacros:
+ - LV2_ATOM_OBJECT_BODY_FOREACH
+ - LV2_ATOM_OBJECT_FOREACH
+ - LV2_ATOM_SEQUENCE_BODY_FOREACH
+ - LV2_ATOM_SEQUENCE_FOREACH
+ - LV2_ATOM_TUPLE_BODY_FOREACH
+ - LV2_ATOM_TUPLE_FOREACH
+...
diff --git a/.clang-tidy b/.clang-tidy
index e354d02..5dc550b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,13 +1,24 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
Checks: >
*,
-*-magic-numbers,
- -*-uppercase-literal-suffix,
+ -altera-*,
+ -bugprone-assignment-in-if-condition,
+ -bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
- -clang-diagnostic-empty-translation-unit,
-clang-diagnostic-unused-function,
-clang-diagnostic-unused-macros,
- -hicpp-signed-bitwise,
- -llvm-header-guard,
-WarningsAsErrors: '*'
-HeaderFilterRegex: '.*'
+ -llvmlibc-restrict-system-libc-headers,
+ -modernize-macro-to-enum,
+ -performance-no-int-to-ptr,
+ -readability-identifier-length,
+CheckOptions:
+ - key: hicpp-uppercase-literal-suffix.NewSuffixes
+ value: L;U;f
+ - key: readability-uppercase-literal-suffix.NewSuffixes
+ value: L;U;f
FormatStyle: file
+HeaderFilterRegex: 'lv2/.*\.h'
+WarningsAsErrors: '*'
diff --git a/.gitignore b/.gitignore
index 9a895df..bb24764 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,15 @@
+# Copyright 2016-2021 David Robillard <d@drobilla.net>
+# Copyright 2016 Robin Gareus <robin@gareus.org>
+# SPDX-License-Identifier: 0BSD OR ISC
+
# generated files and folders
-.waf-*
-.lock-waf*
/build
*.pyc
-NEWS
# misc editor/tools
*.swp
cscope.*
tags
+
+# cached files when used as a meson subproject
+.meson-subproject-wrap-hash.txt
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d6014f1..f4f6be7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,156 +1,141 @@
-stages: [build, test, deploy]
+# Copyright 2018-2023 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
-variables:
- GIT_SUBMODULE_STRATEGY: normal
-
-.build_template: &build_definition
- stage: build
- artifacts:
- paths: ["build/", ".lock-waf*"]
-
-.test_template: &test_definition
- stage: test
+default:
+ image: lv2plugin/debian-x64
+ script:
+ - meson setup build -Dwerror=true
+ - ninja -C build test
+
+dev:
+ image: lv2plugin/debian-x64-big
+ script:
+ - meson setup build -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Db_coverage=true -Dlint=true
+ - ninja -C build test
+ - ninja -C build coverage-html
+ - meson configure -Dbuildtype=release -Db_coverage=false build
+ - ninja -C build test
+ coverage: '/ *lines\.*: \d+\.\d+.*/'
artifacts:
- paths: [build/coverage]
-
-
-arm32_dbg:
- <<: *build_definition
- image: lv2plugin/debian-arm32
- script: python ./waf configure build -dST --werror
- variables:
- CC: "arm-linux-gnueabihf-gcc"
- CXX: "arm-linux-gnueabihf-g++"
-
-test:arm32_dbg:
- <<: *test_definition
- image: lv2plugin/debian-arm32
- script: python ./waf test --wrapper=qemu-arm
- needs: [arm32_dbg]
-
+ paths:
+ - build/meson-logs/coveragereport
-arm32_rel:
- <<: *build_definition
- image: lv2plugin/debian-arm32
- script: python ./waf configure build -ST --werror
+static:
+ image: lv2plugin/debian-x64
+ script:
+ - meson setup build -Ddefault_library=static -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+
+sanitize:
+ image: lv2plugin/debian-x64-clang
+ script:
+ - meson setup build -Db_lundef=false -Dbuildtype=plain -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
variables:
- CC: "arm-linux-gnueabihf-gcc"
- CXX: "arm-linux-gnueabihf-g++"
-
-test:arm32_rel:
- <<: *test_definition
- image: lv2plugin/debian-arm32
- script: python ./waf test --wrapper=qemu-arm
- needs: [arm32_rel]
+ CC: "clang"
+ CFLAGS: "-fno-sanitize-recover=all -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability"
+ LDFLAGS: "-fno-sanitize-recover=all -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero -fsanitize=unsigned-integer-overflow -fsanitize=implicit-conversion -fsanitize=local-bounds -fsanitize=nullability"
+# Linux Distributions
-arm64_dbg:
- <<: *build_definition
- image: lv2plugin/debian-arm64
- script: python ./waf configure build -dST --werror
+fedora:
+ image: lv2plugin/fedora-big
+ script:
+ - meson setup build -Dbuildtype=plain -Dwarning_level=3 -Ddocs=enabled -Dwerror=true
+ - ninja -C build test
variables:
- CC: "aarch64-linux-gnu-gcc"
- CXX: "aarch64-linux-gnu-g++"
-
-test:arm64_dbg:
- <<: *test_definition
- image: lv2plugin/debian-arm64
- script: python ./waf test --wrapper=qemu-aarch64
- needs: [arm64_dbg]
+ CFLAGS: -O2 -D_FORTIFY_SOURCE=2
+ artifacts:
+ paths:
+ - build/doc
+# Linux Platforms
-arm64_rel:
- <<: *build_definition
- image: lv2plugin/debian-arm64
- script: python ./waf configure build -ST --werror
- variables:
- CC: "aarch64-linux-gnu-gcc"
- CXX: "aarch64-linux-gnu-g++"
+arm32:
+ image: lv2plugin/debian-arm32
+ script:
+ - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
-test:arm64_rel:
- <<: *test_definition
+arm64:
image: lv2plugin/debian-arm64
- script: python ./waf test --wrapper=qemu-aarch64
- needs: [arm64_rel]
-
-
-x64_dbg:
- <<: *build_definition
- image: lv2plugin/debian-x64
- script: python ./waf configure build -dST --werror
-
-test:x64_dbg:
- <<: *test_definition
- image: lv2plugin/debian-x64
- script: python ./waf test
- needs: [x64_dbg]
-
-
-x64_rel:
- <<: *build_definition
- image: lv2plugin/debian-x64
- script: python ./waf configure build -ST --werror
-
-test:x64_rel:
- <<: *test_definition
- image: lv2plugin/debian-x64
- script: python ./waf test
- needs: [x64_rel]
-
-
-mac_dbg:
- <<: *build_definition
- script: python ./waf configure build -dST --werror --no-coverage
- tags: [macos]
-
-test:mac_dbg:
- <<: *test_definition
- script: python ./waf test
- needs: [mac_dbg]
+ script:
+ - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+mingw32:
+ image: lv2plugin/debian-mingw32
+ script:
+ - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+mingw64:
+ image: lv2plugin/debian-mingw64
+ script:
+ - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+wasm:
+ image: lv2plugin/debian-wasm
+ script:
+ - meson setup build --cross-file=/usr/share/meson/cross/wasm.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddefault_library=static -Ddocs=disabled -Dplugins=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+x32:
+ image: lv2plugin/debian-x32
+ script:
+ - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+# Non-Linux/Docker rows (not hosted)
+
+freebsd:
+ tags: [freebsd,meson]
+ script:
+ - meson setup build -Dbuildtype=debug -Dwarning_level=3 -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+mac:
tags: [macos]
-
-
-mac_rel:
- <<: *build_definition
- script: python ./waf configure build -ST --werror --no-coverage
- tags: [macos]
-
-test:mac_rel:
- <<: *test_definition
- script: python ./waf test
- needs: [mac_rel]
- tags: [macos]
-
-
-win_dbg:
- <<: *build_definition
- script: python ./waf configure build -dST --werror --no-coverage
- tags: [windows,msvc,python]
-
-test:win_dbg:
- <<: *test_definition
- script: python ./waf test
- needs: [win_dbg]
- tags: [windows,msvc,python]
-
-
-win_rel:
- <<: *build_definition
- script: python ./waf configure build -ST --werror --no-coverage
- tags: [windows,msvc,python]
-
-test:win_rel:
- <<: *test_definition
- script: python ./waf test
- needs: [win_rel]
- tags: [windows,msvc,python]
-
+ script:
+ - meson setup build -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+win:
+ tags: [windows,meson]
+ script:
+ - meson setup build -Dbuildtype=debug -Dwarning_level=everything -Dwerror=true -Ddocs=disabled
+ - ninja -C build test
+ - meson configure -Dbuildtype=release build
+ - ninja -C build test
+
+# Documentation
pages:
stage: deploy
- script: mv build/coverage/ public/
- dependencies: ["test:x64_dbg"]
+ script:
+ - mkdir -p public
+ - mv build/meson-logs/coveragereport/ public/coverage
+ needs:
+ - dev
artifacts:
- paths: [public]
+ paths:
+ - public
only:
- master
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index cc8b569..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "waflib"]
- path = waflib
- url = ../../drobilla/autowaf.git
diff --git a/.reuse/dep5 b/.reuse/dep5
new file mode 100644
index 0000000..78cd3aa
--- /dev/null
+++ b/.reuse/dep5
@@ -0,0 +1,72 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: lv2
+Upstream-Contact: David Robillard <d@drobilla.net>
+Source: https://gitlab.com/lv2/lv2
+
+Files: .stylelintrc.json doc/htaccess.in
+Copyright: 2011-2022 David Robillard <d@drobilla.net>
+Comment: Contributed to the Commons as a tool configuration
+License: 0BSD OR ISC
+
+Files: NEWS
+Copyright: 2011-2022 David Robillard <d@drobilla.net>
+Comment: Contributed to the Commons as a representation of simple facts
+License: 0BSD OR ISC
+
+Files: **/manifest.ttl
+Copyright: Copyright 2015 David Robillard <d@drobilla.net>
+Comment: Contributed to the Commons as a representation of simple facts
+License: 0BSD OR ISC
+
+Files: doc/c/mainpage.md doc/*.css doc/c/layout.xml doc/c/reference.doxygen.in
+Copyright: Copyright 2020-2022 David Robillard <d@drobilla.net>
+License: ISC
+
+Files: **/README.txt doc/index.html.in doc/c/*.html lv2specgen/template.html resources/logo/*
+Copyright: Copyright 2010-2022 David Robillard <d@drobilla.net>
+License: ISC
+
+Files: plugins/eg-sampler.lv2/click.wav
+Copyright: Copyright 2012 David Robillard <d@drobilla.net>
+License: ISC
+
+Files: lv2/**/*.ttl plugins/**/*.ttl plugins/**/*.ttl.in schemas.lv2/xsd.ttl
+Copyright: Copyright 2011-2022 David Robillard <d@drobilla.net>
+Copyright: Copyright 2013 Robin Gareus <robin@gareus.org>
+Copyright: Copyright 2006 Steve Harris <steve@plugin.org.uk>
+License: ISC
+
+Files: lv2specgen/DTD/*
+Copyright: Copyright 1994-2001 World Wide Web Consortium
+Comment: DTDs from the W3C for documentation validation tests
+License: W3C-19980720
+
+Files: schemas.lv2/xsd.ttl
+Copyright: Copyright 2015-2021 David Robillard <d@drobilla.net>
+License: 0BSD OR ISC
+
+Files: schemas.lv2/doap.ttl
+Copyright: Copyright 2004-2016 Edd Dumbill <edd@usefulinc.com>
+Copyright: Copyright 2016-2017 Edd Wilder-James <edd@ewj.me>
+License: Apache-2.0
+
+Files: schemas.lv2/foaf.ttl
+Copyright: Copyright 2000-2014 Dan Brickley <danbri@danbri.org>
+Copyright: Copyright 2000-2014 Libby Miller <libby@nicecupoftea.org>
+License: CC-BY-1.0
+
+Files: schemas.lv2/rdf.ttl
+Copyright: Copyright 1997-1999 W3C
+License: W3C-20150513
+
+Files: schemas.lv2/rdfs.ttl
+Copyright: Copyright 2004-2014 W3C
+License: W3C-20150513
+
+Files: schemas.lv2/owl.ttl
+Copyright: Copyright 2006 W3C
+License: W3C-20150513
+
+Files: schemas.lv2/dcterms.ttl
+Copyright: Copyright 1995-2022 DCMI
+License: CC-BY-4.0
diff --git a/.stylelintrc.json b/.stylelintrc.json
new file mode 100644
index 0000000..473a3da
--- /dev/null
+++ b/.stylelintrc.json
@@ -0,0 +1,8 @@
+{
+ "extends": "/usr/lib/node_modules/stylelint-config-standard",
+ "rules": {
+ "color-hex-case": "upper",
+ "selector-list-comma-newline-after": "always-multi-line",
+ "no-descending-specificity": "off"
+ }
+}
diff --git a/COPYING b/COPYING
index 4d59452..14ef505 100644
--- a/COPYING
+++ b/COPYING
@@ -1,16 +1,14 @@
Copyright 2006-2012 Steve Harris, David Robillard.
-
-Based on LADSPA, Copyright 2000-2002 Richard W.E. Furse,
-Paul Barton-Davis, Stefan Westerfeld.
+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.
+THE 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.
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 0000000..0f6e2bd
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,79 @@
+<!-- Copyright 2011-2022 David Robillard <d@drobilla.net> -->
+<!-- SPDX-License-Identifier: ISC -->
+
+Installation Instructions
+=========================
+
+Prerequisites
+-------------
+
+To build from source, you will need:
+
+ * A relatively modern C compiler (GCC, Clang, and MSVC are known to work).
+
+ * [Meson](http://mesonbuild.com/), which depends on
+ [Python](http://python.org/).
+
+This is a brief overview of building this project with meson. See the meson
+documentation for more detailed information.
+
+Configuration
+-------------
+
+The build is configured with the `setup` command, which creates a new build
+directory with the given name:
+
+ meson setup build
+
+Some environment variables are read during `setup` and stored with the
+configuration:
+
+ * `CC`: Path to C compiler.
+ * `CFLAGS`: C compiler options.
+ * `CXX`: Path to C++ compiler.
+ * `CXXFLAGS`: C++ compiler options.
+ * `LDFLAGS`: Linker options.
+
+However, it is better to use meson options for configuration. All options can
+be inspected with the `configure` command from within the build directory:
+
+ cd build
+ meson configure
+
+Options can be set by passing C-style "define" options to `configure`:
+
+ meson configure -Dc_args="-march=native" -Dprefix="/opt/mypackage/"
+
+Note that some options, such as `strict` and `werror` are for
+developer/maintainer use only. Please don't file issues about anything that
+happens when they are enabled.
+
+Building
+--------
+
+From within a configured build directory, everything can be built with the
+`compile` command:
+
+ meson compile
+
+Similarly, tests can be run with the `test` command:
+
+ meson test
+
+Meson can also generate a project for several popular IDEs, see the `backend`
+option for details.
+
+Installation
+------------
+
+A compiled project can be installed with the `install` command:
+
+ meson install
+
+You may need to acquire root permissions to install to a system-wide prefix.
+For packaging, the installation may be staged to a directory using the
+`DESTDIR` environment variable or the `--destdir` option:
+
+ DESTDIR=/tmp/mypackage/ meson install
+
+ meson install --destdir=/tmp/mypackage/
diff --git a/LICENSES/0BSD.txt b/LICENSES/0BSD.txt
new file mode 100644
index 0000000..b3e8cfd
--- /dev/null
+++ b/LICENSES/0BSD.txt
@@ -0,0 +1,12 @@
+Copyright 2011-2022 David Robillard <d@drobilla.net>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE 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.
diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/LICENSES/Apache-2.0.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/LICENSES/CC-BY-1.0.txt b/LICENSES/CC-BY-1.0.txt
new file mode 100644
index 0000000..5081bc9
--- /dev/null
+++ b/LICENSES/CC-BY-1.0.txt
@@ -0,0 +1,221 @@
+Creative Commons Attribution 1.0
+
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL
+ SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN
+ "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION
+ PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE
+BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS
+CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.
+
+1. Definitions
+
+ a. "Collective Work" means a work, such as a periodical issue, anthology or
+ encyclopedia, in which the Work in its entirety in unmodified form, along
+ with a number of other contributions, constituting separate and
+ independent works in themselves, are assembled into a collective whole. A
+ work that constitutes a Collective Work will not be considered a
+ Derivative Work (as defined below) for the purposes of this License.
+
+ b. "Derivative Work" means a work based upon the Work or upon the Work and
+ other pre-existing works, such as a translation, musical arrangement,
+ dramatization, fictionalization, motion picture version, sound recording,
+ art reproduction, abridgment, condensation, or any other form in which
+ the Work may be recast, transformed, or adapted, except that a work that
+ constitutes a Collective Work will not be considered a Derivative Work
+ for the purpose of this License.
+
+ c. "Licensor" means the individual or entity that offers the Work under the
+ terms of this License.
+
+ d. "Original Author" means the individual or entity who created the Work.
+
+ e. "Work" means the copyrightable work of authorship offered under the terms
+ of this License.
+
+ f. "You" means an individual or entity exercising rights under this License
+ who has not previously violated the terms of this License with respect to
+ the Work, or who has received express permission from the Licensor to
+ exercise rights under this License despite a previous violation.
+
+2. Fair Use Rights
+
+Nothing in this license is intended to reduce, limit, or restrict any rights
+arising from fair use, first sale or other limitations on the exclusive rights
+of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant
+
+Subject to the terms and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the
+applicable copyright) license to exercise the rights in the Work as stated
+below:
+
+ a. to reproduce the Work, to incorporate the Work into one or more Collective
+ Works, and to reproduce the Work as incorporated in the Collective Works;
+
+ b. to create and reproduce Derivative Works;
+
+ c. to distribute copies or phonorecords of, display publicly, perform
+ publicly, and perform publicly by means of a digital audio transmission
+ the Work including as incorporated in Collective Works;
+
+ d. to distribute copies or phonorecords of, display publicly, perform
+ publicly, and perform publicly by means of a digital audio transmission
+ Derivative Works;
+
+The above rights may be exercised in all media and formats whether now known or
+hereafter devised. The above rights include the right to make such
+modifications as are technically necessary to exercise the rights in other
+media and formats. All rights not expressly granted by Licensor are hereby
+reserved.
+
+4. Restrictions
+
+The license granted in Section 3 above is expressly made subject to and limited
+by the following restrictions:
+
+ a. You may distribute, publicly display, publicly perform, or publicly
+ digitally perform the Work only under the terms of this License, and You
+ must include a copy of, or the Uniform Resource Identifier for, this
+ License with every copy or phonorecord of the Work You distribute,
+ publicly display, publicly perform, or publicly digitally perform. You may
+ not offer or impose any terms on the Work that alter or restrict the terms
+ of this License or the recipients' exercise of the rights granted
+ hereunder. You may not sublicense the Work. You must keep intact all
+ notices that refer to this License and to the disclaimer of
+ warranties. You may not distribute, publicly display, publicly perform, or
+ publicly digitally perform the Work with any technological measures that
+ control access or use of the Work in a manner inconsistent with the terms
+ of this License Agreement. The above applies to the Work as incorporated
+ in a Collective Work, but this does not require the Collective Work apart
+ from the Work itself to be made subject to the terms of this License. If
+ You create a Collective Work, upon notice from any Licensor You must, to
+ the extent practicable, remove from the Collective Work any reference to
+ such Licensor or the Original Author, as requested. If You create a
+ Derivative Work, upon notice from any Licensor You must, to the extent
+ practicable, remove from the Derivative Work any reference to such
+ Licensor or the Original Author, as requested.
+
+ b. If you distribute, publicly display, publicly perform, or publicly
+ digitally perform the Work or any Derivative Works or Collective Works,
+ You must keep intact all copyright notices for the Work and give the
+ Original Author credit reasonable to the medium or means You are utilizing
+ by conveying the name (or pseudonym if applicable) of the Original Author
+ if supplied; the title of the Work if supplied; in the case of a
+ Derivative Work, a credit identifying the use of the Work in the
+ Derivative Work (e.g., "French translation of the Work by Original
+ Author," or "Screenplay based on original Work by Original Author"). Such
+ credit may be implemented in any reasonable manner; provided, however,
+ that in the case of a Derivative Work or Collective Work, at a minimum
+ such credit will appear where any other comparable authorship credit
+ appears and in a manner at least as prominent as such other comparable
+ authorship credit.
+
+5. Representations, Warranties and Disclaimer
+
+ a. By offering the Work for public release under this License, Licensor
+ represents and warrants that, to the best of Licensor's knowledge after
+ reasonable inquiry:
+
+ i. Licensor has secured all rights in the Work necessary to grant the
+ license rights hereunder and to permit the lawful exercise of the
+ rights granted hereunder without You having any obligation to pay
+ any royalties, compulsory license fees, residuals or any other
+ payments;
+
+ ii. The Work does not infringe the copyright, trademark, publicity
+ rights, common law rights or any other right of any third party or
+ constitute defamation, invasion of privacy or other tortious injury
+ to any third party.
+
+ b. EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING
+ OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF
+ THE WORK.
+
+6. Limitation on Liability
+
+EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING
+FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN
+SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
+ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING
+OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+ a. This License and the rights granted hereunder will terminate automatically
+ upon any breach by You of the terms of this License. Individuals or
+ entities who have received Derivative Works or Collective Works from You
+ under this License, however, will not have their licenses terminated
+ provided such individuals or entities remain in full compliance with those
+ licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of
+ this License.
+
+ b. Subject to the above terms and conditions, the license granted here is
+ perpetual (for the duration of the applicable copyright in the
+ Work). Notwithstanding the above, Licensor reserves the right to release
+ the Work under different license terms or to stop distributing the Work at
+ any time; provided, however that any such election will not serve to
+ withdraw this License (or any other license that has been, or is required
+ to be, granted under the terms of this License), and this License will
+ continue in full force and effect unless terminated as stated above.
+
+8. Miscellaneous
+
+ a. Each time You distribute or publicly digitally perform the Work or a
+ Collective Work, the Licensor offers to the recipient a license to the
+ Work on the same terms and conditions as the license granted to You under
+ this License.
+
+ b. Each time You distribute or publicly digitally perform a Derivative Work,
+ Licensor offers to the recipient a license to the original Work on the
+ same terms and conditions as the license granted to You under this
+ License.
+
+ c. If any provision of this License is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this License, and without further action by the
+ parties to this agreement, such provision shall be reformed to the minimum
+ extent necessary to make such provision valid and enforceable.
+
+ d. No term or provision of this License shall be deemed waived and no breach
+ consented to unless such waiver or consent shall be in writing and signed
+ by the party to be charged with such waiver or consent.
+
+ e. This License constitutes the entire agreement between the parties with
+ respect to the Work licensed here. There are no understandings, agreements
+ or representations with respect to the Work not specified here. Licensor
+ shall not be bound by any additional provisions that may appear in any
+ communication from You. This License may not be modified without the
+ mutual written agreement of the Licensor and You.
+
+Creative Commons is not a party to this License, and makes no warranty
+whatsoever in connection with the Work. Creative Commons will not be liable to
+You or any party on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or consequential damages
+arising in connection to this license. Notwithstanding the foregoing two (2)
+sentences, if Creative Commons has expressly identified itself as the Licensor
+hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is
+licensed under the CCPL, neither party will use the trademark "Creative
+Commons" or any related trademark or logo of Creative Commons without the prior
+written consent of Creative Commons. Any permitted use will be in compliance
+with Creative Commons' then-current trademark usage guidelines, as may be
+published on its website or otherwise made available upon request from time to
+time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt
new file mode 100644
index 0000000..10fabd9
--- /dev/null
+++ b/LICENSES/CC-BY-4.0.txt
@@ -0,0 +1,395 @@
+Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public licenses.
+Notwithstanding, Creative Commons may elect to apply one of its public
+licenses to material it publishes and in those instances will be
+considered the “Licensor.” The text of the Creative Commons public
+licenses is dedicated to the public domain under the CC0 Public Domain
+Dedication. Except for the limited purpose of indicating that material
+is shared under a Creative Commons public license or as otherwise
+permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the public
+licenses.
+
+Creative Commons may be contacted at creativecommons.org.
diff --git a/LICENSES/ISC.txt b/LICENSES/ISC.txt
new file mode 120000
index 0000000..012065c
--- /dev/null
+++ b/LICENSES/ISC.txt
@@ -0,0 +1 @@
+../COPYING \ No newline at end of file
diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt
new file mode 100644
index 0000000..f85e365
--- /dev/null
+++ b/LICENSES/MIT.txt
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/LICENSES/W3C-19980720.txt b/LICENSES/W3C-19980720.txt
new file mode 100644
index 0000000..a1cda7e
--- /dev/null
+++ b/LICENSES/W3C-19980720.txt
@@ -0,0 +1,45 @@
+W3C SOFTWARE NOTICE AND LICENSE
+
+Copyright (c) 1994-2002 World Wide Web Consortium, (Massachusetts Institute of
+Technology, Institut National de Recherche en Informatique et en Automatique,
+Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
+
+This W3C work (including software, documents, or other related items) is being
+provided by the copyright holders under the following license. By obtaining,
+using and/or copying this work, you (the licensee) agree that you have read,
+understood, and will comply with the following terms and conditions:
+
+Permission to use, copy, modify, and distribute this software and its
+documentation, with or without modification,  for any purpose and without fee
+or royalty is hereby granted, provided that you include the following on ALL
+copies of the software and documentation or portions thereof, including
+modifications, that you make:
+
+ 1. The full text of this NOTICE in a location viewable to users of the
+ redistributed or derivative work.
+
+ 2. Any pre-existing intellectual property disclaimers, notices, or terms and
+ conditions. If none exist, a short notice of the following form (hypertext
+ is preferred, text is permitted) should be used within the body of any
+ redistributed or derivative code: "Copyright © [$date-of-software] World
+ Wide Web Consortium, (Massachusetts Institute of Technology, Institut
+ National de Recherche en Informatique et en Automatique, Keio
+ University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
+
+ 3. Notice of any changes or modifications to the W3C files, including the
+ date changes were made. (We recommend you provide URIs to the location
+ from which the code is derived.)
+
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
+NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
+THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
+PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+
+The name and trademarks of copyright holders may NOT be used in advertising or
+publicity pertaining to the software without specific, written prior
+permission. Title to copyright in this software and any associated
+documentation will at all times remain with copyright holders.
diff --git a/LICENSES/W3C-20150513.txt b/LICENSES/W3C-20150513.txt
new file mode 100644
index 0000000..f58c363
--- /dev/null
+++ b/LICENSES/W3C-20150513.txt
@@ -0,0 +1,40 @@
+This work is being provided by the copyright holders under the following
+license.
+
+License
+
+By obtaining and/or copying this work, you (the licensee) agree that you have
+read, understood, and will comply with the following terms and conditions.
+
+Permission to copy, modify, and distribute this work, with or without
+modification, for any purpose and without fee or royalty is hereby granted,
+provided that you include the following on ALL copies of the work or portions
+thereof, including modifications:
+
+ * The full text of this NOTICE in a location viewable to users of the
+ redistributed or derivative work.
+
+ * Any pre-existing intellectual property disclaimers, notices, or terms and
+ conditions. If none exist, the W3C Software and Document Short Notice
+ should be included.
+
+ * Notice of any changes or modifications, through a copyright statement on
+ the new code or document such as "This software or document includes
+ material copied from or derived from [title and URI of the W3C
+ document]. Copyright (c) [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)."
+
+Disclaimers
+
+THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
+MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE
+SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
+TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT.
+
+The name and trademarks of copyright holders may NOT be used in advertising or
+publicity pertaining to the work without specific, written prior
+permission. Title to copyright in this work will at all times remain with
+copyright holders.
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..d75a2ae
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,277 @@
+lv2 (1.18.11) unstable; urgency=medium
+
+ * Allow LV2_SYMBOL_EXPORT to be overridden
+ * Fix pylint warning in test script
+ * Override pkg-config dependency within meson
+ * Remove troublesome lv2_atom_assert_double_fits_in_64_bits
+
+ -- David Robillard <d@drobilla.net> Thu, 15 Dec 2022 17:15:58 +0000
+
+lv2 (1.18.10) stable; urgency=medium
+
+ * Fix includedir in pkg-config file
+ * Fix missing example plugin UI binaries
+ * Only install lv2specgen when required Python modules are found
+ * Replace change history data with a plain text NEWS file
+
+ -- David Robillard <d@drobilla.net> Fri, 09 Sep 2022 17:26:51 +0000
+
+lv2 (1.18.8) stable; urgency=medium
+
+ * Fix documentation build with Python 3.7
+ * Fix documentation build with meson 0.56.2
+ * Fix lv2.h missing from installation
+ * eg-midigate: Fix output timing
+ * eg-sampler: Add resampling via libsamplerate
+ * eg-sampler: Fix potentially corrupt notification events
+ * lv2core: Fix inconsistent plugin class labels
+ * lv2specgen: Fix installed data paths
+
+ -- David Robillard <d@drobilla.net> Fri, 12 Aug 2022 00:00:00 +0000
+
+lv2 (1.18.6) stable; urgency=medium
+
+ * Add dark mode style for documentation
+ * Clean up and modernize Python support code
+ * Fix or avoid new compiler and tool warnings
+ * Rearrange source tree to be directly usable by dependants
+ * Remove archaic properties from foaf vocabulary
+ * Replace canonical dcs ontology with a minimal version for LV2
+ * Separate API headers from data
+ * Switch to Meson build system
+
+ -- David Robillard <d@drobilla.net> Thu, 07 Jul 2022 00:00:00 +0000
+
+lv2 (1.18.4) stable; urgency=medium
+
+ * Fix build issues with newer toolchains
+ * Fix spelling errors
+ * atom: Fix spelling errors
+ * event: Fix spelling errors
+ * lv2core: Fix spelling errors
+ * patch: Fix spelling errors
+ * patch: Fix type and range of patch:value
+ * patch: Make the type of patch:wildcard more precise
+ * state: Fix spelling errors
+ * ui: Deprecate ui:resize
+ * ui: Fix spelling errors
+
+ -- David Robillard <d@drobilla.net> Thu, 26 May 2022 00:00:00 +0000
+
+lv2 (1.18.2) stable; urgency=medium
+
+ * Various code cleanups and infrastructure improvements
+ * eg-sampler: Save and restore gain parameter value
+ * state: Fix state:StateChanged URI in metadata and documentation
+
+ -- David Robillard <d@drobilla.net> Thu, 07 Jan 2021 00:00:00 +0000
+
+lv2 (1.18.0) stable; urgency=medium
+
+ * Improve documentation
+ * Separate extended documentation from primary data
+ * lv2core: Add lv2:Markdown datatype
+ * lv2core: Deprecate lv2:reportsLatency
+ * patch: Fix incorrect type of patch:sequenceNumber
+ * port-groups: Remove incorrect type of pg:letterCode
+ * port-groups: Replace broken links with detailed channel descriptions
+ * state: Add state:freePath feature
+ * ui: Add ui:requestValue feature
+ * ui: Add ui:scaleFactor, ui:foregroundColor, and ui:backgroundColor
+ * ui: Deprecate ui:binary
+ * worker: Improve documentation
+
+ -- David Robillard <d@drobilla.net> Sun, 26 Apr 2020 00:00:00 +0000
+
+lv2 (1.16.0) stable; urgency=medium
+
+ * Add core/attributes.h utility header
+ * Add lv2_validate utility
+ * Aggressively deprecate uri-map and event extensions
+ * Install headers to simpler paths
+ * Simplify use of lv2specgen
+ * Upgrade build system and fix building with Python 3.7
+ * atom: Add lv2_atom_object_get_typed()
+ * eg-midigate: Respond to "all notes off" MIDI message
+ * eg-sampler: Add waveform display to UI
+ * lv2core: Add lv2:MIDIPlugin class
+ * lv2core: Rework port restrictions so that presets can be validated
+ * midi: Fix incorrect range of midi:chunk
+ * options: Relax range of opts:requiredOption and opts:supportedOption
+ * patch: Add patch:accept property
+ * patch: Add patch:context property
+ * state: Add state:StateChanged for notification events
+ * time: Clarify time:beat origin
+ * units: Fix outdated port description in documentation
+ * units: Remove overly restrictive domain from units:unit
+
+ -- David Robillard <d@drobilla.net> Sun, 03 Feb 2019 00:00:00 +0000
+
+lv2 (1.14.0) stable; urgency=medium
+
+ * buf-size: Add bufsz:coarseBlockLength feature
+ * buf-size: Add bufsz:nominalBlockLength option
+ * eg-sampler: Fix handling of state file paths
+ * eg-sampler: Support thread-safe state restoration
+ * eg-scope: Don't feed back UI state updates
+ * log: Add lv2_log_logger_set_map()
+ * lv2core: Add lv2:enabled designation
+ * lv2core: Add lv2_util.h with lv2_features_data() and lv2_features_query()
+ * state: Add LV2_STATE_ERR_NO_SPACE status flag
+ * state: Add state:threadSafeRestore feature
+ * time: Define LV2_TIME_PREFIX
+ * ui: Add missing property labels
+ * ui: Improve documentation
+
+ -- David Robillard <d@drobilla.net> Mon, 19 Sep 2016 00:00:00 +0000
+
+lv2 (1.12.0) stable; urgency=medium
+
+ * Fix merging of version histories in specification documentation
+ * Improve API documentation
+ * Simplify property restrictions by removing redundancy
+ * eg-sampler: Add gain parameter
+ * eg-sampler: Support patch:Get, and request initial state from UI
+ * lv2core: Add extern C and visibility attribute to LV2_SYMBOL_EXPORT
+ * lv2core: Add lv2:isSideChain port property
+ * lv2core: Relax domain of lv2:minimum lv2:maximum and lv2:default
+ * parameters: Add range to parameters so hosts know how to control them
+ * patch: Add patch:Copy method
+ * patch: Define patch:Get with no subject to implicitly apply to receiver
+ * units: Add lv2:Parameter to domain of units:unit
+ * units: Fix non-existent port type in examples
+
+ -- David Robillard <d@drobilla.net> Tue, 07 Apr 2015 00:00:00 +0000
+
+lv2 (1.10.0) stable; urgency=medium
+
+ * Fix -Wconversion warnings in headers
+ * Upgrade to waf 1.7.16
+ * atom: Add lv2_atom_forge_is_object_type() and lv2_atom_forge_is_blank()
+ * atom: Add lv2_atom_forge_key() for terser object writing
+ * atom: Add lv2_atom_sequence_clear() and lv2_atom_sequence_append_event()
+ * atom: Deprecate Blank and Resource in favour of just Object
+ * event: Minor documentation improvements
+ * lv2core: Clarify lv2_descriptor() and lv2_lib_descriptor() documentation
+ * lv2specgen: Display deprecated warning on classes marked owl:deprecated
+ * patch: Add patch:sequenceNumber for associating replies with requests
+ * ui: Add show interface so UIs can gracefully degrade to separate windows
+ * ui: Fix identifier typos in documentation
+
+ -- David Robillard <d@drobilla.net> Fri, 08 Aug 2014 00:00:00 +0000
+
+lv2 (1.8.0) stable; urgency=medium
+
+ * Add scope example plugin from Robin Gareus
+ * Install lv2specgen for use by other projects
+ * atom: Make lv2_atom_*_is_end() arguments const
+ * log: Add missing include string.h to logger.h for memset
+ * lv2core: Add lv2:prototype for property inheritance
+ * lv2specgen: Fix links to externally defined terms
+ * ui: Fix LV2_UI_INVALID_PORT_INDEX identifier in documentation
+
+ -- David Robillard <d@drobilla.net> Sat, 04 Jan 2014 00:00:00 +0000
+
+lv2 (1.6.0) stable; urgency=medium
+
+ * Fix lv2specgen usage from command line
+ * Fix port indices of metronome example
+ * Upgrade to waf 1.7.11
+ * atom: Fix crash in forge.h when pushing atoms to a full buffer
+ * ui: Add idle interface for native UIs and foreign toolkits
+ * ui: Add ui:updateRate property
+
+ -- David Robillard <d@drobilla.net> Fri, 09 Aug 2013 00:00:00 +0000
+
+lv2 (1.4.0) stable; urgency=medium
+
+ * Add metronome example plugin to demonstrate sample accurate tempo sync
+ * Generate book-style HTML documentation from example plugins
+ * atom: Fix lv2_atom_sequence_end()
+ * atom: Improve atom documentation
+ * atom: Remove atom:stringType in favour of the more general owl:onDatatype
+ * buf-size: Fix typo in bufsz:sequenceSize label
+ * event: Fix incorrect return type in lv2_event_get()
+ * log: Add logger convenience API
+ * lv2core: Add lv2:EnvelopePlugin class
+ * lv2core: Add lv2:control for designating primary control ports
+ * lv2core: Make lv2:Parameter rdfs:subClassOf rdf:Property
+ * lv2core: Reserve minor version 0 for unstable development plugins
+ * lv2core: Set range of lv2:designation to lv2:Designation
+ * options: Set the range of opts:requiredOption and opts:supportedOption
+ * patch: Add patch:readable and patch:writable properties
+ * patch: Make patch:Set a compact message for setting one property
+ * state: Add state:loadDefaultState feature
+ * ui: Fix incorrect linker flag in ui:makeSONameResident documentation
+
+ -- David Robillard <d@drobilla.net> Sun, 17 Feb 2013 00:00:00 +0000
+
+lv2 (1.2.0) stable; urgency=medium
+
+ * Move all project metadata for extensions to separate files to save memory
+ * Use stricter datatype definitions conformant with XSD and OWL
+ * atom: Add LV2_ATOM_CONTENTS_CONST and LV2_ATOM_BODY_CONST
+ * atom: Add lv2_atom_object_body_get()
+ * atom: Fix implicit conversions in forge.h that are invalid in C++11
+ * atom: Fix lv2_atom_object_next() on 32-bit platforms
+ * atom: Fix outdated documentation in forge.h
+ * atom: Use consistent label style
+ * buf-size: Initial release
+ * dynmanifest: Use consistent label style
+ * event: Make event iterator gracefully handle optional ports
+ * event: Remove asserts from event-helper.h
+ * event: Use consistent label style
+ * event: Use more precise domain and range for EventPort properties
+ * lv2core: Use consistent label style
+ * midi: Add C definitions for message types and standard controllers
+ * midi: Add midi:HexByte datatype for status bytes and masks
+ * midi: Add midi:binding and midi:channel predicates
+ * midi: Fix definition of SystemExclusive status byte
+ * midi: Remove non-standard midi:Tick message type
+ * midi: Use consistent label style
+ * morph: Initial release
+ * options: Initial release
+ * parameters: Add param:sampleRate
+ * parameters: Add parameters.h of URI defines for convenience
+ * parameters: Use consistent label style
+ * port-groups: Use consistent label style
+ * port-props: Use consistent label style
+ * presets: Add preset banks
+ * presets: Use consistent label style
+ * state: Use consistent label style
+ * time: Use consistent label style
+ * ui: Add missing LV2_SYMBOL_EXPORT declaration for lv2ui_descriptor
+ * ui: Add types for WindowsUI, CocoaUI, and Gtk3UI
+ * ui: Use consistent label style
+ * units: Remove units:name in favour of rdfs:label
+ * units: Use consistent label style
+ * urid: Fix typo in urid:unmap documentation
+
+ -- David Robillard <d@drobilla.net> Sun, 14 Oct 2012 00:00:00 +0000
+
+lv2 (1.0.0) stable; urgency=medium
+
+ * Initial release as a unified project
+ * atom: Initial release
+ * data-access: Initial unified release
+ * dynmanifest: Initial unified release
+ * event: Initial unified release
+ * instance-access: Initial unified release
+ * log: Initial release
+ * lv2core: Initial unified release
+ * midi: Initial unified release
+ * parameters: Initial release
+ * patch: Initial release
+ * port-groups: Initial release
+ * port-props: Initial release
+ * presets: Initial unified release
+ * resize-port: Initial release
+ * state: Initial release
+ * time: Initial release
+ * ui: Initial unified release
+ * units: Initial unified release
+ * uri-map: Initial unified release
+ * urid: Initial unified release
+ * worker: Initial release
+
+ -- David Robillard <d@drobilla.net> Mon, 16 Apr 2012 00:00:00 +0000
diff --git a/README.md b/README.md
index a69441b..bbc7b63 100644
--- a/README.md
+++ b/README.md
@@ -1,82 +1,48 @@
+<!-- Copyright 2010-2022 David Robillard <d@drobilla.net> -->
+<!-- SPDX-License-Identifier: ISC -->
+
LV2
===
-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". See
-<http://lv2plug.in> for more information.
-
-This package contains specifications (C headers and Turtle files),
-documentation generation tools, and example plugins.
-
-Building and installation requires only Python 2.6. Building the documentation
-requires Doxygen.
+LV2 is a plugin standard for audio systems. It defines an extensible C API for
+plugins, and a format for self-contained "bundle" directories that contain
+plugins, metadata, and other resources. See <http://lv2plug.in/> for more
+information.
+This package contains specifications (C headers and Turtle data files),
+documentation generation tools, tests, and example plugins.
Installation
------------
-A typical build looks something like this:
-
- ./waf configure --prefix=/foo
- ./waf
- sudo ./waf install
-
-or, for packaging:
-
- DESTDIR=/home/packager/lv2root ./waf install
-
-For help on the other available options, run:
-
- ./waf --help
-
-The bundle installation directory can be set with the --lv2dir option, e.g.:
-
- ./waf configure --lv2dir=/foo/lib/lv2
-
-Configuring with `--lv2-user` will install bundles to the user-local location.
+See the [installation instructions](INSTALL.md) for details on how to
+configure, build, and install LV2 with meson.
+By default, on UNIX-like systems, everything is installed within the `prefix`,
+and LV2 bundles are installed in the "lv2" subdirectory of the `libdir`. On
+other systems, bundles are installed by default to the standard location for
+plugins on the system. The bundle installation directory can be overridden
+with the `lv2dir` option.
-Packaging
----------
+The [specification bundles](lv2) are run-time dependencies of LV2 applications.
+Programs expect their data to be available somewhere in `LV2_PATH`. See
+<http://lv2plug.in/pages/filesystem-hierarchy-standard.html> for details on the
+standard installation paths.
-Specification bundles are both a build-time and run-time dependency of programs
-that use LV2. Programs expect their data to be available somewhere in
-`LV2_PATH`.
+Headers
+-------
-See <http://lv2plug.in/pages/filesystem-hierarchy-standard.html> for details on
-the standard installation paths.
+The `lv2/` include namespace is reserved for this LV2 distribution.
+Other projects may extend LV2, but must place their headers elsewhere.
-Do not split up LV2 bundles, they are self-contained and must remain whole.
-Other than that, things may be split to suit distribution needs. For example,
-separate packages for specifications, tools, and plugins, may be good idea.
-
-
-Header Installation
--------------------
-
-By default symbolic links to headers in bundles are installed to `INCLUDEDIR`.
-If symbolic links are a problem, configure with `--copy-headers` and copies
-will be installed instead.
-
-Headers are installed in two paths, the universal URI-based style:
-
- #include "lv2/lv2plug.in/ns/ext/urid/urid.h"
-
-and the newer simple core style:
+Headers are installed to `includedir` with paths like:
#include "lv2/urid/urid.h"
-Projects are encouraged to migrate to the latter style, though note that this
-style of include path may only be used by official LV2 specifications.
-
-
-Documentation
--------------
+For backwards compatibility, if the `old_headers` option is set, then headers
+are also installed to the older URI-based paths:
-Configuring with the --docs option will build the documentation for all the
-included specifications if Doxygen is available. For example:
-
- ./waf configure --docs
- ./waf
+ #include "lv2/lv2plug.in/ns/ext/urid/urid.h"
-Specification documentation is also availabe online at <http://lv2plug.in/ns>.
+Projects still using this style are encourated to migrate to the shorter style
+above.
diff --git a/doc/doxy-style.css b/doc/c/doxy-style.css
index df8fcea..6f15ee4 100644
--- a/doc/doxy-style.css
+++ b/doc/c/doxy-style.css
@@ -1,6 +1,9 @@
-body {
+html {
background: #FFF;
color: #222;
+}
+
+body {
font-style: normal;
line-height: 1.6em;
margin-left: auto;
@@ -186,10 +189,6 @@ div.navtab {
margin-right: 15px;
}
-.contents a:visited {
- color: #344E00;
-}
-
a.qindexHL {
background-color: #9CAFD4;
color: #FFF;
@@ -209,6 +208,10 @@ dl.el {
font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed;
}
+.ttc {
+ display: none;
+}
+
pre.fragment {
border: 1px solid #C4C4C4;
background-color: #F9F9F9;
@@ -526,7 +529,6 @@ td.mlabels-right {
margin-top: 0;
padding-top: 0.25em;
font-weight: normal;
- color: #444;
font-size: 0.9em;
}
@@ -641,6 +643,7 @@ td.entry {
width: 16px;
height: 22px;
vertical-align: top;
+ visibility: hidden;
}
td.entry b {
@@ -861,3 +864,228 @@ th {
span.icon {
display: none;
}
+
+/* Dark mode */
+@media (prefers-color-scheme: dark) {
+ html {
+ background: #222;
+ color: #DDD;
+ }
+
+ a {
+ color: #B4C342;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+ color: #DDD;
+ }
+
+ h1 a:link, h2 a:link, h3 a:link, h4 a:link, h5 a:link, h6 a:link {
+ color: #DDD;
+ }
+
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
+ color: #DDD;
+ }
+
+ #header {
+ border-bottom-color: #333;
+ }
+
+ #title {
+ color: #CCC;
+ }
+
+ #shortdesc {
+ color: #BBB;
+ }
+
+ code {
+ color: #DDD;
+ }
+
+ pre.fragment {
+ border: 1px solid #444;
+ background-color: #333;
+ }
+
+ div.ah {
+ background-color: #000;
+ color: #FFF;
+ border-color: #333;
+ }
+
+ .groupheader + p {
+ color: #BBB;
+ }
+
+ td.indexkey {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ }
+
+ td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ }
+
+ tr.memlist {
+ background-color: #EEF1F7;
+ }
+
+ span.keyword {
+ color: #586E75;
+ }
+
+ span.keywordtype {
+ color: #546E00;
+ }
+
+ span.keywordflow {
+ color: #586E75;
+ }
+
+ span.comment {
+ color: #6C71C4;
+ }
+
+ span.preprocessor {
+ color: #D33682;
+ }
+
+ span.stringliteral {
+ color: #CB4B16;
+ }
+
+ span.charliteral {
+ color: #CB4B16;
+ }
+
+ .dirtab {
+ border: 1px solid #A3B4D7;
+ }
+
+ th.dirtab {
+ background: #EBEFF6;
+ }
+
+ hr {
+ border-top: 1px solid #DDD;
+ }
+
+ #footer {
+ color: #888;
+ }
+
+ .mdescLeft,.mdescRight {
+ color: #555;
+ }
+
+ .memTemplParams {
+ color: #464646;
+ }
+
+ td.mlabels-right {
+ color: #B4C342;
+ }
+
+ .memtitle {
+ border-bottom: 1px solid #666;
+ }
+
+ .memtemplate {
+ color: #888;
+ }
+
+ .memnav {
+ background-color: #666;
+ border: 1px solid #B4C342;
+ }
+
+ .memproto {
+ border-bottom: 1px solid #666;
+ border-left: 1px solid #666;
+ color: #BBB;
+ }
+
+ .memdoc > p:first-child, .memdoc .textblock > p:first-child {
+ color: #BBB;
+ }
+
+ .memdoc > p:first-child, .memdoc .textblock > h3:first-child {
+ color: #BBB;
+ }
+
+ .paramtype {
+ color: #BBB;
+ }
+
+ .params .paramname {
+ color: #E8E8E8;
+ }
+
+ .fieldname {
+ color: #FFF;
+ }
+
+ .fieldtable tbody tr td {
+ border-top-color: #555;
+ border-bottom-color: #555;
+ }
+
+ td.fieldtype {
+ color: #BBB;
+ }
+
+ .arrow {
+ color: #666;
+ }
+
+ address {
+ color: #444;
+ }
+
+ table.doxtable td,table.doxtable th {
+ border-color: #DDD;
+ }
+
+ table.doxtable th {
+ background-color: #F3F3F3;
+ color: #000;
+ }
+
+ div.navpath {
+ color: #444;
+ }
+
+ #metabox {
+ color: #666;
+ }
+
+ .glow {
+ background-color: #00736F;
+ box-shadow: 0 0 10px #00736F;
+ }
+
+ span.lineno {
+ border-right: 2px solid #B4C342;
+ background-color: #383838;
+ }
+
+ span.lineno a {
+ background-color: #404040;
+ }
+
+ span.lineno a:hover {
+ background-color: #484848;
+ }
+
+}
+
+/* Hard black for dark mode on mobile (since it's likely to be an OLED screen) */
+@media only screen and (hover: none) and (pointer: coarse) and (prefers-color-scheme: dark) {
+ html {
+ background: #000;
+ color: #CCC;
+ }
+}
diff --git a/doc/footer.html b/doc/c/footer.html
index 0dc6919..0dc6919 100644
--- a/doc/footer.html
+++ b/doc/c/footer.html
diff --git a/doc/header.html b/doc/c/header.html
index 2e419e3..2e419e3 100644
--- a/doc/header.html
+++ b/doc/c/header.html
diff --git a/doc/layout.xml b/doc/c/layout.xml
index 1f63a76..938dbce 100644
--- a/doc/layout.xml
+++ b/doc/c/layout.xml
@@ -9,26 +9,12 @@
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
- <tab type="interfaces" visible="yes" title="">
- <tab type="interfacelist" visible="yes" title="" intro=""/>
- <tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
- <tab type="interfacehierarchy" visible="yes" title="" intro=""/>
- </tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
- <tab type="structs" visible="yes" title="">
- <tab type="structlist" visible="yes" title="" intro=""/>
- <tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
- </tab>
- <tab type="exceptions" visible="yes" title="">
- <tab type="exceptionlist" visible="yes" title="" intro=""/>
- <tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
- <tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
- </tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
@@ -47,7 +33,6 @@
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
- <interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
@@ -82,7 +67,6 @@
<typedefs title=""/>
<enums title=""/>
<services title=""/>
- <interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
@@ -95,37 +79,6 @@
<authorsection visible="yes"/>
</class>
- <!-- Layout definition for a namespace page -->
- <namespace>
- <briefdescription visible="yes"/>
- <detaileddescription title=""/>
- <memberdecl>
- <nestednamespaces visible="yes" title=""/>
- <constantgroups visible="yes" title=""/>
- <interfaces visible="yes" title=""/>
- <classes visible="yes" title=""/>
- <structs visible="yes" title=""/>
- <exceptions visible="yes" title=""/>
- <typedefs title=""/>
- <sequences title=""/>
- <dictionaries title=""/>
- <enums title=""/>
- <functions title=""/>
- <variables title=""/>
- <membergroups visible="yes"/>
- </memberdecl>
- <memberdef>
- <inlineclasses title=""/>
- <typedefs title=""/>
- <sequences title=""/>
- <dictionaries title=""/>
- <enums title=""/>
- <functions title=""/>
- <variables title=""/>
- </memberdef>
- <authorsection visible="yes"/>
- </namespace>
-
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
@@ -135,16 +88,11 @@
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
- <interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
- <structs visible="yes" title=""/>
- <exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
- <sequences title=""/>
- <dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
@@ -154,8 +102,6 @@
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
- <sequences title=""/>
- <dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
@@ -176,8 +122,6 @@
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
- <sequences title=""/>
- <dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
@@ -196,8 +140,6 @@
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
- <sequences title=""/>
- <dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
diff --git a/doc/mainpage.md b/doc/c/mainpage.md
index 561bc93..561bc93 100644
--- a/doc/mainpage.md
+++ b/doc/c/mainpage.md
diff --git a/doc/c/meson.build b/doc/c/meson.build
new file mode 100644
index 0000000..da88b86
--- /dev/null
+++ b/doc/c/meson.build
@@ -0,0 +1,41 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+lv2_source_doc = meson.current_source_dir()
+
+if doxygen.found()
+ reference_doxygen_in = files('reference.doxygen.in')
+
+ config = configuration_data(
+ {
+ 'LV2_SRCDIR': lv2_source_root,
+ 'LV2_BUILDDIR': lv2_build_root,
+ 'LV2_VERSION': meson.project_version(),
+ },
+ )
+
+ reference_doxygen = configure_file(
+ configuration: config,
+ input: reference_doxygen_in,
+ output: 'reference.doxygen',
+ )
+
+ docs = custom_target(
+ 'html',
+ command: [doxygen, '@INPUT@'],
+ input: reference_doxygen,
+ install: true,
+ install_dir: lv2_docdir / 'c',
+ output: ['html', 'tags'],
+ )
+
+ # TODO: doc_deps is needed because Meson did not support using custom target
+ # outputs as dependencies until 0.60.0. When 0.60.0 is required, this can be
+ # cleaned up by removing doc_deps and using lv2_tags (not its path) as a
+ # command argument, which Meson will correctly make a dependency for.
+
+ lv2_tags = docs[1]
+ doc_deps = [docs]
+else
+ doc_deps = []
+endif
diff --git a/doc/reference.doxygen.in b/doc/c/reference.doxygen.in
index 053b542..333fe1c 100644
--- a/doc/reference.doxygen.in
+++ b/doc/c/reference.doxygen.in
@@ -1,4 +1,4 @@
-# Doxyfile 1.8.15
+# Doxyfile 1.9.3
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = .
+OUTPUT_DIRECTORY = @LV2_BUILDDIR@
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@@ -93,14 +93,6 @@ ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
-# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all generated output in the proper direction.
-# Possible values are: None, LTR, RTL and Context.
-# The default value is: None.
-
-OUTPUT_TEXT_DIRECTION = None
-
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
@@ -230,16 +222,16 @@ TAB_SIZE = 4
# the documentation. An alias has the form:
# name=value
# For example adding
-# "sideeffect=@par Side Effects:\n"
+# "sideeffect=@par Side Effects:^^"
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines (in the resulting output). You can put ^^ in the value part of an
-# alias to insert a newline as if a physical newline was in the original file.
-# When you need a literal { or } or , in the value part of an alias you have to
-# escape them by means of a backslash (\), this can lead to conflicts with the
-# commands \{ and \} for these it is advised to use the version @{ and @} or use
-# a double escape (\\{ and \\})
+# "Side Effects:". Note that you cannot put \n's in the value part of an alias
+# to insert newlines (in the resulting output). You can put ^^ in the value part
+# of an alias to insert a newline as if a physical newline was in the original
+# file. When you need a literal { or } or , in the value part of an alias you
+# have to escape them by means of a backslash (\), this can lead to conflicts
+# with the commands \{ and \} for these it is advised to use the version @{ and
+# @} or use a double escape (\\{ and \\})
ALIASES =
@@ -271,31 +263,26 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
-# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
-# sources only. Doxygen will then generate output that is more tailored for that
-# language. For instance, namespaces will be presented as modules, types will be
-# separated into more groups, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_SLICE = NO
-
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
-# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
-# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is
-# Fortran), use: inc=Fortran f=C.
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
EXTENSION_MAPPING =
@@ -313,7 +300,7 @@ MARKDOWN_SUPPORT = YES
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
-# Minimum value: 0, maximum value: 99, default value: 0.
+# Minimum value: 0, maximum value: 99, default value: 5.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
@@ -503,8 +490,8 @@ HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO, these declarations will be
-# included in the documentation.
+# declarations. If set to NO, these declarations will be included in the
+# documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
@@ -523,11 +510,18 @@ HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES, upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
# The default value is: system dependent.
CASE_SENSE_NAMES = YES
@@ -703,13 +697,14 @@ FILE_VERSION_FILTER =
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
+# will be used as the name of the layout file. See also section "Changing the
+# layout of pages" for information.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
-LAYOUT_FILE = @LV2_SRCDIR@/doc/layout.xml
+LAYOUT_FILE = @LV2_SRCDIR@/doc/c/layout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@@ -749,24 +744,28 @@ WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
+# potential errors in the documentation, such as documenting some parameters in
+# a documented function twice, or documenting parameters that don't exist or
+# using markup commands wrongly.
# The default value is: YES.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong or incomplete
-# parameter documentation, but not about the absence of documentation. If
-# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
+# value. If set to NO, doxygen will only warn about wrong parameter
+# documentation, but not about the absence of documentation. If EXTRACT_ALL is
+# set to YES then this flag will automatically be disabled. See also
+# WARN_IF_INCOMPLETE_DOC
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
-# a warning is encountered.
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
+# at the end of the doxygen process doxygen will return with a non-zero status.
+# Possible values are: NO, YES and FAIL_ON_WARNINGS.
# The default value is: NO.
WARN_AS_ERROR = NO
@@ -783,7 +782,10 @@ WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
# messages should be written. If left blank the output is written to standard
-# error (stderr).
+# error (stderr). In case the file specified cannot be opened for writing the
+# warning and error messages are written to standard error. When as file - is
+# specified the warning and error messages are written to standard output
+# (stdout).
WARN_LOGFILE =
@@ -797,41 +799,42 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = @LV2_SRCDIR@/doc/mainpage.md \
- @LV2_SRCDIR@/lv2/atom/atom.h \
- @LV2_SRCDIR@/lv2/atom/forge.h \
- @LV2_SRCDIR@/lv2/atom/util.h \
- @LV2_SRCDIR@/lv2/buf-size/buf-size.h \
- @LV2_SRCDIR@/lv2/core/lv2.h \
- @LV2_SRCDIR@/lv2/data-access/data-access.h \
- @LV2_SRCDIR@/lv2/dynmanifest/dynmanifest.h \
- @LV2_SRCDIR@/lv2/event/event-helpers.h \
- @LV2_SRCDIR@/lv2/event/event.h \
- @LV2_SRCDIR@/lv2/instance-access/instance-access.h \
- @LV2_SRCDIR@/lv2/log/log.h \
- @LV2_SRCDIR@/lv2/log/logger.h \
- @LV2_SRCDIR@/lv2/midi/midi.h \
- @LV2_SRCDIR@/lv2/morph/morph.h \
- @LV2_SRCDIR@/lv2/options/options.h \
- @LV2_SRCDIR@/lv2/parameters/parameters.h \
- @LV2_SRCDIR@/lv2/patch/patch.h \
- @LV2_SRCDIR@/lv2/port-groups/port-groups.h \
- @LV2_SRCDIR@/lv2/port-props/port-props.h \
- @LV2_SRCDIR@/lv2/presets/presets.h \
- @LV2_SRCDIR@/lv2/resize-port/resize-port.h \
- @LV2_SRCDIR@/lv2/state/state.h \
- @LV2_SRCDIR@/lv2/time/time.h \
- @LV2_SRCDIR@/lv2/ui/ui.h \
- @LV2_SRCDIR@/lv2/units/units.h \
- @LV2_SRCDIR@/lv2/uri-map/uri-map.h \
- @LV2_SRCDIR@/lv2/urid/urid.h \
- @LV2_SRCDIR@/lv2/worker/worker.h
+INPUT = @LV2_SRCDIR@/doc/c/mainpage.md \
+ @LV2_SRCDIR@/include/lv2/atom/atom.h \
+ @LV2_SRCDIR@/include/lv2/atom/forge.h \
+ @LV2_SRCDIR@/include/lv2/atom/util.h \
+ @LV2_SRCDIR@/include/lv2/buf-size/buf-size.h \
+ @LV2_SRCDIR@/include/lv2/core/lv2.h \
+ @LV2_SRCDIR@/include/lv2/core/lv2_util.h \
+ @LV2_SRCDIR@/include/lv2/data-access/data-access.h \
+ @LV2_SRCDIR@/include/lv2/dynmanifest/dynmanifest.h \
+ @LV2_SRCDIR@/include/lv2/event/event-helpers.h \
+ @LV2_SRCDIR@/include/lv2/event/event.h \
+ @LV2_SRCDIR@/include/lv2/instance-access/instance-access.h \
+ @LV2_SRCDIR@/include/lv2/log/log.h \
+ @LV2_SRCDIR@/include/lv2/log/logger.h \
+ @LV2_SRCDIR@/include/lv2/midi/midi.h \
+ @LV2_SRCDIR@/include/lv2/morph/morph.h \
+ @LV2_SRCDIR@/include/lv2/options/options.h \
+ @LV2_SRCDIR@/include/lv2/parameters/parameters.h \
+ @LV2_SRCDIR@/include/lv2/patch/patch.h \
+ @LV2_SRCDIR@/include/lv2/port-groups/port-groups.h \
+ @LV2_SRCDIR@/include/lv2/port-props/port-props.h \
+ @LV2_SRCDIR@/include/lv2/presets/presets.h \
+ @LV2_SRCDIR@/include/lv2/resize-port/resize-port.h \
+ @LV2_SRCDIR@/include/lv2/state/state.h \
+ @LV2_SRCDIR@/include/lv2/time/time.h \
+ @LV2_SRCDIR@/include/lv2/ui/ui.h \
+ @LV2_SRCDIR@/include/lv2/units/units.h \
+ @LV2_SRCDIR@/include/lv2/uri-map/uri-map.h \
+ @LV2_SRCDIR@/include/lv2/urid/urid.h \
+ @LV2_SRCDIR@/include/lv2/worker/worker.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
-# possible encodings.
+# documentation (see:
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
@@ -844,11 +847,15 @@ INPUT_ENCODING = UTF-8
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# read by doxygen.
#
+# Note the list of default checked file patterns might differ from the list of
+# default file extension mappings.
+#
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
-# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
-# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
-# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
+# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
+# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
+# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
+# *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS =
@@ -887,7 +894,7 @@ EXCLUDE_PATTERNS =
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
+# ANamespace::AClass, ANamespace::*Test
#
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
@@ -974,7 +981,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
-USE_MDFILE_AS_MAINPAGE = @LV2_SRCDIR@/doc/mainpage.md
+USE_MDFILE_AS_MAINPAGE = @LV2_SRCDIR@/doc/c/mainpage.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@@ -1073,13 +1080,6 @@ VERBATIM_HEADERS = NO
ALPHABETICAL_INDEX = NO
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX = 5
-
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
@@ -1103,7 +1103,7 @@ GENERATE_HTML = YES
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_OUTPUT = html
+HTML_OUTPUT = @LV2_BUILDDIR@/doc/c/html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
@@ -1130,7 +1130,7 @@ HTML_FILE_EXTENSION = .html
# of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_HEADER = @LV2_SRCDIR@/doc/header.html
+HTML_HEADER = @LV2_SRCDIR@/doc/c/header.html
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
# generated HTML page. If the tag is left blank doxygen will generate a standard
@@ -1140,7 +1140,7 @@ HTML_HEADER = @LV2_SRCDIR@/doc/header.html
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_FOOTER = @LV2_SRCDIR@/doc/footer.html
+HTML_FOOTER = @LV2_SRCDIR@/doc/c/footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1152,7 +1152,7 @@ HTML_FOOTER = @LV2_SRCDIR@/doc/footer.html
# obsolete.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_STYLESHEET = @LV2_SRCDIR@/doc/doxy-style.css
+HTML_STYLESHEET = @LV2_SRCDIR@/doc/c/doxy-style.css
# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
# cascading style sheets that are included after the standard style sheets
@@ -1179,7 +1179,7 @@ HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
+# this color. Hue is specified as an angle on a color-wheel, see
# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
@@ -1189,7 +1189,7 @@ HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 160
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
+# in the HTML output. For a value of 0 the output will use gray-scales only. A
# value of 255 will produce the most vivid colors.
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1207,20 +1207,11 @@ HTML_COLORSTYLE_SAT = 30
HTML_COLORSTYLE_GAMMA = 100
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = NO
-
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
-# are dynamically created via Javascript. If disabled, the navigation index will
+# are dynamically created via JavaScript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
-# page. Disable this option to support browsers that do not have Javascript,
+# page. Disable this option to support browsers that do not have JavaScript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1250,10 +1241,11 @@ HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: https://developer.apple.com/xcode/), introduced with OSX
-# 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
+# environment (see:
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
+# create a documentation set, doxygen will generate a Makefile in the HTML
+# output directory. Running make will produce the docset in that directory and
+# running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
# genXcode/_index.html for more information.
@@ -1295,8 +1287,12 @@ DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
+# on Windows. In the beginning of 2021 Microsoft took the original page, with
+# a.o. the download links, offline the HTML help workshop was already many years
+# in maintenance mode). You can download the HTML help workshop from the web
+# archives at Installation executable (see:
+# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
+# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
@@ -1326,7 +1322,7 @@ CHM_FILE =
HHC_LOCATION =
# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the master .chm file (NO).
+# (YES) or that it should be included in the main .chm file (NO).
# The default value is: NO.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
@@ -1371,7 +1367,8 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1379,8 +1376,8 @@ QHP_NAMESPACE =
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
-# folders).
+# Folders (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1388,30 +1385,30 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
-# filters).
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
-# filters).
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
+# The QHG_LOCATION tag can be used to specify the location (absolute path
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
+# run qhelpgenerator on the generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
@@ -1454,11 +1451,11 @@ DISABLE_INDEX = NO
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
# (i.e. any modern browser). Windows users are probably better off using the
# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
+# further fine tune the look of the index (see "Fine-tuning the output"). As an
+# example, the default style sheet generated by doxygen has an example that
+# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
+# Since the tree basically has the same information as the tab index, you could
+# consider setting DISABLE_INDEX to YES when enabling this option.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1497,19 +1494,8 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
-# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# https://www.mathjax.org) which uses client side Javascript for the rendering
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
@@ -1520,10 +1506,17 @@ FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
+# the MathJax output. For more details about the output format see MathJax
+# version 2 (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
+# (see:
+# http://docs.mathjax.org/en/latest/web/components/output.html).
# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
+# compatibility. This is the name for Mathjax version 2, for MathJax version 3
+# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
+# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
+# is the name for Mathjax version 3, for MathJax version 2 this will be
+# translated into HTML-CSS) and SVG.
# The default value is: HTML-CSS.
# This tag requires that the tag USE_MATHJAX is set to YES.
@@ -1536,22 +1529,29 @@ MATHJAX_FORMAT = HTML-CSS
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from https://www.mathjax.org before deployment.
-# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
+# MathJax from https://www.mathjax.org before deployment. The default value is:
+# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
+# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
# extension names that should be enabled during MathJax rendering. For example
+# for MathJax version 2 (see
+# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# For example for MathJax version 3 (see
+# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
+# MATHJAX_EXTENSIONS = ams
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
# example see the documentation.
# This tag requires that the tag USE_MATHJAX is set to YES.
@@ -1579,7 +1579,7 @@ MATHJAX_CODEFILE =
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
+# implemented using a web server instead of a web client using JavaScript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
@@ -1598,7 +1598,8 @@ SERVER_BASED_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: https://xapian.org/).
+# Xapian (see:
+# https://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
@@ -1611,8 +1612,9 @@ EXTERNAL_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: https://xapian.org/). See the section "External Indexing and
-# Searching" for details.
+# Xapian (see:
+# https://xapian.org/). See the section "External Indexing and Searching" for
+# details.
# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
@@ -1682,15 +1684,6 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
-# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
-# generate index for LaTeX.
-# Note: This tag is used in the generated output file (.tex).
-# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
-# The default value is: \makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_MAKEINDEX_CMD = \makeindex
-
# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
@@ -1720,29 +1713,31 @@ PAPER_TYPE = a4
EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
+# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
+# the generated LaTeX document. The header should contain everything until the
+# first chapter. If it is left blank doxygen will generate a standard header. It
+# is highly recommended to start with a default header using
+# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
+# and then modify the file new_header.tex. See also section "Doxygen usage" for
+# information on how to generate the default header that doxygen normally uses.
#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
-# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
-# string, for the replacement values of the other commands the user is referred
-# to HTML_HEADER.
+# Note: Only use a user-defined header if you know what you are doing!
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. The following
+# commands have a special meaning inside the header (and footer): For a
+# description of the possible markers and block names see the documentation.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer. See
+# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
+# the generated LaTeX document. The footer should contain everything after the
+# last chapter. If it is left blank doxygen will generate a standard footer. See
# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
+# special commands can be used inside the footer. See also section "Doxygen
+# usage" for information on how to generate the default footer that doxygen
+# normally uses. Note: Only use a user-defined footer if you know what you are
+# doing!
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
@@ -1775,9 +1770,11 @@ LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES, to get a
-# higher quality PDF documentation.
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
+# files. Set this option to YES, to get a higher quality PDF documentation.
+#
+# See also section LATEX_CMD_NAME for selecting the engine.
# The default value is: YES.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1785,8 +1782,7 @@ USE_PDFLATEX = YES
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
+# if errors occur, instead of asking the user for help.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
@@ -1799,16 +1795,6 @@ LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE = NO
-
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
@@ -1817,22 +1803,6 @@ LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
-# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_TIMESTAMP = NO
-
-# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
-# path from which the emoji images will be read. If a relative path is entered,
-# it will be relative to the LATEX_OUTPUT directory. If left blank the
-# LATEX_OUTPUT directory will be used.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EMOJI_DIRECTORY =
-
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1889,16 +1859,6 @@ RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
-# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
-# with syntax highlighting in the RTF output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_SOURCE_CODE = NO
-
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -1970,13 +1930,6 @@ XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
-# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
-# namespace members in file scope as well, matching the HTML output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_NS_MEMB_FILE_SCOPE = NO
-
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
@@ -1995,15 +1948,6 @@ GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
-# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
-# program listings (including syntax highlighting and cross-referencing
-# information) to the DOCBOOK output. Note that enabling this will significantly
-# increase the size of the DOCBOOK output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_PROGRAMLISTING = NO
-
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
@@ -2155,7 +2099,7 @@ TAGFILES =
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
-GENERATE_TAGFILE = tags
+GENERATE_TAGFILE = @LV2_BUILDDIR@/doc/c/tags
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be
@@ -2182,15 +2126,6 @@ EXTERNAL_PAGES = YES
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS = YES
-
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
@@ -2223,23 +2158,6 @@ HAVE_DOT = NO
DOT_NUM_THREADS = 0
-# When you want a differently looking font in the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME =
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE = 10
-
# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
# the path where dot can find it using this tag.
@@ -2247,11 +2165,14 @@ DOT_FONTSIZE = 10
DOT_FONTPATH =
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a
+# graph for each documented class showing the direct and indirect inheritance
+# relations. In case HAVE_DOT is set as well dot will be used to draw the graph,
+# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set
+# to TEXT the direct and indirect inheritance relations will be shown as texts /
+# links.
+# Possible values are: NO, YES, TEXT and GRAPH.
# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
CLASS_GRAPH = YES
@@ -2288,7 +2209,7 @@ UML_LOOK = NO
# but if the number exceeds 15, the total amount of fields shown is limited to
# 10.
# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# This tag requires that the tag UML_LOOK is set to YES.
UML_LIMIT_NUM_FIELDS = 10
@@ -2411,10 +2332,10 @@ MSCFILE_DIRS =
DIAFILE_DIRS =
# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
+# path where java can find the plantuml.jar file or to the filename of jar file
+# to be used. If left blank, it is assumed PlantUML is not used or called during
+# a preprocessing step. Doxygen will generate a warning when it encounters a
+# \startuml command in this case and will not generate output for the diagram.
PLANTUML_JAR_PATH =
@@ -2452,18 +2373,6 @@ DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT = NO
-
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
@@ -2476,14 +2385,18 @@ DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
# explaining the meaning of the various boxes and arrows in the dot generated
# graphs.
+# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal
+# graphical representation for inheritance and collaboration diagrams is used.
# The default value is: YES.
# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
# files that are used to generate the various graphs.
+#
+# Note: This setting is not only used for dot files but also for msc temporary
+# files.
# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
DOT_CLEANUP = YES
diff --git a/doc/index.html.in b/doc/index.html.in
index 875ad39..3be99f4 100644
--- a/doc/index.html.in
+++ b/doc/index.html.in
@@ -6,7 +6,7 @@
<meta http-equiv="Content-Type"
content="application/xhtml+xml;charset=utf-8" />
<link rel="stylesheet" type="text/css"
- href="../aux/style.css" />
+ href="../style/style.css" />
</head>
<body>
@@ -19,7 +19,6 @@
<div id="metabox">
<table id="meta">
<tr><th>Version</th><td>@LV2_VERSION@</td></tr>
- <tr><th>Date</th><td>@DATE@</td></tr>
<tr><th>Discuss</th>
<td>
<a href="mailto:devel@lists.lv2plug.in">devel@lists.lv2plug.in</a>
@@ -62,12 +61,12 @@
</div>
<div>
Valid
- <a about="" rel="dct:conformsTo" resource="http://www.w3.org/TR/rdfa-syntax"
+ <a about="" rel="dcterms:conformsTo" resource="http://www.w3.org/TR/rdfa-syntax"
href="http://validator.w3.org/check?uri=referer">
XHTML+RDFa
</a>
and
- <a about="" rel="dct:conformsTo" resource="http://www.w3.org/TR/CSS2"
+ <a about="" rel="dcterms:conformsTo" resource="http://www.w3.org/TR/CSS2"
href="http://jigsaw.w3.org/css-validator/check/referer">
CSS
</a>
diff --git a/doc/ns/ext/meson.build b/doc/ns/ext/meson.build
new file mode 100644
index 0000000..bf6431b
--- /dev/null
+++ b/doc/ns/ext/meson.build
@@ -0,0 +1,68 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+config = configuration_data({'BASE': '/ns/ext'})
+
+if get_option('online_docs')
+ htaccess = configure_file(
+ configuration: config,
+ input: files('..' / '..' / 'htaccess.in'),
+ install_dir: lv2_docdir / 'ns' / 'ext',
+ output: '.htaccess',
+ )
+endif
+
+spec_names = [
+ 'atom',
+ 'buf-size',
+ 'data-access',
+ 'dynmanifest',
+ 'event',
+ 'instance-access',
+ 'log',
+ 'midi',
+ 'morph',
+ 'options',
+ 'parameters',
+ 'patch',
+ 'port-groups',
+ 'port-props',
+ 'presets',
+ 'resize-port',
+ 'state',
+ 'time',
+ 'uri-map',
+ 'urid',
+ 'worker',
+]
+
+if build_docs
+ foreach name : spec_names
+ spec_file = files(lv2_source_root / 'lv2' / name + '.lv2' / name + '.ttl')
+
+ custom_target(
+ name + '.html',
+ command: lv2specgen_command_prefix + [
+ '--docdir=../../c/html',
+ '--style-uri=../../style/style.css',
+ ] + [
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ depends: doc_deps,
+ input: spec_file,
+ install: true,
+ install_dir: lv2_docdir / 'ns' / 'ext',
+ output: name + '.html',
+ )
+
+ if get_option('online_docs')
+ configure_file(
+ copy: true,
+ input: spec_file,
+ install_dir: lv2_docdir / 'ns' / 'ext',
+ output: '@PLAINNAME@',
+ )
+ endif
+ endforeach
+endif
diff --git a/doc/ns/extensions/meson.build b/doc/ns/extensions/meson.build
new file mode 100644
index 0000000..837f736
--- /dev/null
+++ b/doc/ns/extensions/meson.build
@@ -0,0 +1,49 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+config = configuration_data({'BASE': '/ns/extensions'})
+
+if get_option('online_docs')
+ htaccess = configure_file(
+ configuration: config,
+ input: files('..' / '..' / 'htaccess.in'),
+ install_dir: lv2_docdir / 'ns' / 'extensions',
+ output: '.htaccess',
+ )
+endif
+
+spec_names = [
+ 'ui',
+ 'units',
+]
+
+if build_docs
+ foreach name : spec_names
+ spec_file = files(lv2_source_root / 'lv2' / name + '.lv2' / name + '.ttl')
+
+ custom_target(
+ name + '.html',
+ command: lv2specgen_command_prefix + [
+ '--docdir=../../c/html',
+ '--style-uri=../../style/style.css',
+ ] + [
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ depends: doc_deps,
+ input: spec_file,
+ install: true,
+ install_dir: lv2_docdir / 'ns' / 'extensions',
+ output: name + '.html',
+ )
+
+ if get_option('online_docs')
+ configure_file(
+ copy: true,
+ input: spec_file,
+ install_dir: lv2_docdir / 'ns' / 'ext',
+ output: '@PLAINNAME@',
+ )
+ endif
+ endforeach
+endif
diff --git a/doc/ns/meson.build b/doc/ns/meson.build
new file mode 100644
index 0000000..126a100
--- /dev/null
+++ b/doc/ns/meson.build
@@ -0,0 +1,83 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+config = configuration_data({'BASE': '/ns'})
+
+if get_option('online_docs')
+ htaccess = configure_file(
+ configuration: config,
+ input: files('..' / 'htaccess.in'),
+ install_dir: lv2_docdir / 'ns',
+ output: '.htaccess',
+ )
+endif
+
+######################
+# Core Documentation #
+######################
+
+if build_docs
+ spec_file = files(lv2_source_root / 'lv2' / 'core.lv2' / 'lv2core.ttl')
+
+ lv2_core_docs = custom_target(
+ 'lv2core.html',
+ command: lv2specgen_command_prefix + [
+ '--docdir=../c/html',
+ '--style-uri=../style/style.css',
+ ] + [
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ input: spec_file,
+ output: 'lv2core.html',
+ depends: doc_deps,
+ install: true,
+ install_dir: lv2_docdir / 'ns',
+ )
+
+ if get_option('online_docs')
+ configure_file(
+ copy: true,
+ input: spec_file,
+ install_dir: lv2_docdir / 'ns' / 'ext',
+ output: '@PLAINNAME@',
+ )
+ endif
+endif
+
+###########################
+# Extension Documentation #
+###########################
+
+subdir('ext')
+subdir('extensions')
+
+#########
+# Index #
+#########
+
+lv2_build_index = find_program(
+ lv2_source_root / 'scripts' / 'lv2_build_index.py',
+)
+
+lv2_build_index_command = [
+ lv2_build_index,
+ ['--lv2-version', meson.project_version()],
+ ['--lv2-source-root', lv2_source_root],
+]
+
+if get_option('online_docs')
+ lv2_build_index_command += [
+ '--online',
+ ]
+endif
+
+index = custom_target(
+ 'index.html',
+ capture: true,
+ command: lv2_build_index_command + ['@INPUT@'],
+ input: spec_files,
+ install: true,
+ install_dir: lv2_docdir / 'ns',
+ output: 'index.html',
+)
diff --git a/doc/pygments.css b/doc/pygments.css
deleted file mode 100644
index 4fb3387..0000000
--- a/doc/pygments.css
+++ /dev/null
@@ -1,61 +0,0 @@
-.c { color: #6C71C4; font-style: italic } /* Comment */
-.err { border: 1px solid #DC322F } /* Error */
-.k { color: #888888 } /* Keyword */
-.o { color: #839496 } /* Operator */
-.cm { color: #6C71C4; font-style: italic } /* Comment.Multiline */
-.cp { color: #D33682 } /* Comment.Preproc */
-.c1 { color: #6C71C4; font-style: italic } /* Comment.Single */
-.cs { color: #6C71C4; font-style: italic } /* Comment.Special */
-.gd { color: #A00000 } /* Generic.Deleted */
-.ge { font-style: italic } /* Generic.Emph */
-.gr { color: #DC322F } /* Generic.Error */
-.gh { color: #6C71C4; font-weight: bold } /* Generic.Heading */
-.gi { color: #859900 } /* Generic.Inserted */
-.go { color: #808080 } /* Generic.Output */
-.gp { color: #268BD2; font-weight: bold } /* Generic.Prompt */
-.gs { font-weight: bold } /* Generic.Strong */
-.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-.gt { color: #0040D0 } /* Generic.Traceback */
-.kc { color: #586E75; font-weight: bold } /* Keyword.Constant */
-.kd { color: #586E75; font-weight: bold } /* Keyword.Declaration */
-.kn { color: #586E75; font-weight: bold } /* Keyword.Namespace */
-.kp { color: #586E75 } /* Keyword.Pseudo */
-.kr { color: #586E75; font-weight: bold } /* Keyword.Reserved */
-.kt { color: #546E00 } /* Keyword.Type */
-.m { color: #666666 } /* Literal.Number */
-.s { color: #CB4B16 } /* Literal.String */
-.na { color: #7D9029 } /* Name.Attribute */
-.nb { color: #008000 } /* Name.Builtin */
-.nc { color: #000000; } /* Name.Class */
-.no { color: #880000 } /* Name.Constant */
-.nd { color: #AA22FF } /* Name.Decorator */
-.ni { color: #999999; font-weight: bold } /* Name.Entity */
-.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
-.nf { color: #000000; } /* Name.Function */
-.nl { color: #A0A000 } /* Name.Label */
-.nn { color: #555555 } /* Name.Namespace */
-.nt { color: #223322; } /* Name.Tag */
-.nv { color: #222222 } /* Name.Variable */
-.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
-.w { color: #bbbbbb } /* Text.Whitespace */
-.mf { color: #000000 } /* Literal.Number.Float */
-.mh { color: #000000 } /* Literal.Number.Hex */
-.mi { color: #000000 } /* Literal.Number.Integer */
-.mo { color: #000000 } /* Literal.Number.Oct */
-.sb { color: #CB4B16 } /* Literal.String.Backtick */
-.sc { color: #CB4B16 } /* Literal.String.Char */
-.sd { color: #CB4B16; font-style: italic } /* Literal.String.Doc */
-.s2 { color: #CB4B16 } /* Literal.String.Double */
-.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
-.sh { color: #CB4B16 } /* Literal.String.Heredoc */
-.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
-.sx { color: #008000 } /* Literal.String.Other */
-.sr { color: #BB6688 } /* Literal.String.Regex */
-.s1 { color: #CB4B16 } /* Literal.String.Single */
-.ss { color: #00629D } /* Literal.String.Symbol */
-.bp { color: #008000 } /* Name.Builtin.Pseudo */
-.vc { color: #00629D } /* Name.Variable.Class */
-.vg { color: #00629D } /* Name.Variable.Global */
-.vi { color: #00629D } /* Name.Variable.Instance */
-.il { color: #666666 } /* Literal.Number.Integer.Long */
-.p { color: #888888 } /* Punctuation */
diff --git a/doc/asciidoc.css b/doc/style/asciidoc.css
index 59bf677..2e64544 100644
--- a/doc/asciidoc.css
+++ b/doc/style/asciidoc.css
@@ -435,7 +435,7 @@ th.tableblock {
td.tableblock, th.tableblock {
border: 1px dashed #ccc;
}
-/* Because the table frame attribute is overriden by CSS in most browsers. */
+/* Because the table frame attribute is overridden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
border-style: none;
}
diff --git a/doc/style/meson.build b/doc/style/meson.build
new file mode 100644
index 0000000..39e9242
--- /dev/null
+++ b/doc/style/meson.build
@@ -0,0 +1,13 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+style_files = files('pygments.css', 'style.css')
+
+foreach file : style_files
+ configure_file(
+ copy: true,
+ input: file,
+ install_dir: lv2_docdir / 'style',
+ output: '@PLAINNAME@',
+ )
+endforeach
diff --git a/doc/style/pygments.css b/doc/style/pygments.css
new file mode 100644
index 0000000..2472b1a
--- /dev/null
+++ b/doc/style/pygments.css
@@ -0,0 +1,558 @@
+/* Light (default) theme */
+
+.n {
+ color: #222;
+}
+
+.c {
+ color: #3F4D91;
+ font-style: italic;
+}
+
+.err {
+ border: 1px solid #DC322F;
+}
+
+.k {
+ color: #586E75;
+}
+
+.o {
+ color: #586E75;
+}
+
+.cm {
+ color: #3F4D91;
+ font-style: italic;
+}
+
+.cp {
+ color: #586E75;
+}
+
+.cpf {
+ color: #93115C;
+}
+
+.c1 {
+ color: #3F4D91;
+ font-style: italic;
+}
+
+.cs {
+ color: #3F4D91;
+ font-style: italic;
+}
+
+.gd {
+ color: #990A1B;
+}
+
+.ge {
+ font-style: italic;
+}
+
+.gr {
+ color: #DC322F;
+}
+
+.gh {
+ color: #3F4D91;
+ font-weight: bold;
+}
+
+.gi {
+ color: #859900;
+}
+
+.go {
+ color: #666;
+}
+
+.gp {
+ color: #666;
+ font-weight: bold;
+}
+
+.gs {
+ font-weight: bold;
+}
+
+.gu {
+ color: #444;
+ font-weight: bold;
+}
+
+.gt {
+ color: #268BD2;
+}
+
+.kc {
+ color: #586E75;
+ font-weight: bold;
+}
+
+.kd {
+ color: #586E75;
+ font-weight: bold;
+}
+
+.kn {
+ color: #586E75;
+ font-weight: bold;
+}
+
+.kp {
+ color: #586E75;
+}
+
+.kr {
+ color: #586E75;
+ font-weight: bold;
+}
+
+.kt {
+ color: #586E75;
+}
+
+.m {
+ color: #666;
+}
+
+.s {
+ color: #93115C;
+}
+
+.na {
+ color: #444;
+}
+
+.nb {
+ color: #3F4D91;
+}
+
+.nc {
+ color: #000;
+}
+
+.no {
+ color: #880;
+}
+
+.nd {
+ color: #A2F;
+}
+
+.ni {
+ color: #666;
+ font-weight: bold;
+}
+
+.ne {
+ color: #D2413A;
+ font-weight: bold;
+}
+
+.nf {
+ color: #000;
+}
+
+.nl {
+ color: #546E00;
+}
+
+.nn {
+ color: #444;
+}
+
+.nt {
+ color: #444;
+}
+
+.nv {
+ color: #222;
+}
+
+.ow {
+ color: #3F4D91;
+}
+
+.w {
+ color: #BBB;
+}
+
+.mb {
+ color: #93115C;
+ font-weight: bold;
+}
+
+.mf {
+ color: #93115C;
+}
+
+.mh {
+ color: #93115C;
+ font-weight: bold;
+}
+
+.mi {
+ color: #93115C;
+}
+
+.mo {
+ color: #93115C;
+ font-weight: bold;
+}
+
+.sb {
+ color: #93115C;
+}
+
+.sc {
+ color: #93115C;
+}
+
+.sd {
+ color: #3F4D91;
+ font-style: italic;
+}
+
+.s2 {
+ color: #93115C;
+}
+
+.se {
+ color: #93115C;
+ font-weight: bold;
+}
+
+.sh {
+ color: #93115C;
+}
+
+.si {
+ color: #93115C;
+ font-weight: bold;
+}
+
+.sx {
+ color: #93115C;
+}
+
+.sr {
+ color: #93115C;
+ font-weight: bold;
+}
+
+.s1 {
+ color: #93115C;
+}
+
+.ss {
+ color: #444;
+ font-weight: bold;
+}
+
+.bp {
+ color: #859900;
+}
+
+.vc {
+ color: #00629D;
+}
+
+.vg {
+ color: #00629D;
+}
+
+.vi {
+ color: #00629D;
+}
+
+.il {
+ color: #000;
+}
+
+.p {
+ color: #444;
+}
+
+/* Dark theme */
+@media (prefers-color-scheme: dark) {
+ .n {
+ color: #BBB;
+ }
+
+ .c {
+ color: #6C71C4;
+ font-style: italic;
+ }
+
+ .err {
+ border: 1px solid #FF6E64;
+ }
+
+ .k {
+ color: #93A1A1;
+ }
+
+ .o {
+ color: #93A1A1;
+ }
+
+ .cm {
+ color: #6C71C4;
+ font-style: italic;
+ }
+
+ .cp {
+ color: #93A1A1;
+ }
+
+ .cpf {
+ color: #D33682;
+ }
+
+ .c1 {
+ color: #6C71C4;
+ font-style: italic;
+ }
+
+ .cs {
+ color: #6C71C4;
+ font-style: italic;
+ }
+
+ .gd {
+ color: #DC322F;
+ }
+
+ .ge {
+ font-style: italic;
+ }
+
+ .gr {
+ color: #FF6E64;
+ }
+
+ .gh {
+ color: #6C71C4;
+ font-weight: bold;
+ }
+
+ .gi {
+ color: #859900;
+ }
+
+ .go {
+ color: #666;
+ }
+
+ .gp {
+ color: #666;
+ font-weight: bold;
+ }
+
+ .gs {
+ font-weight: bold;
+ }
+
+ .gu {
+ color: #BBB;
+ font-weight: bold;
+ }
+
+ .gt {
+ color: #69B7F0;
+ }
+
+ .kc {
+ color: #93A1A1;
+ font-weight: bold;
+ }
+
+ .kd {
+ color: #93A1A1;
+ font-weight: bold;
+ }
+
+ .kn {
+ color: #93A1A1;
+ font-weight: bold;
+ }
+
+ .kp {
+ color: #93A1A1;
+ }
+
+ .kr {
+ color: #93A1A1;
+ font-weight: bold;
+ }
+
+ .kt {
+ color: #93A1A1;
+ }
+
+ .m {
+ color: #999;
+ }
+
+ .s {
+ color: #D33682;
+ }
+
+ .na {
+ color: #BBB;
+ }
+
+ .nb {
+ color: #6C71C4;
+ }
+
+ .nc {
+ color: #FFF;
+ }
+
+ .no {
+ color: #880;
+ }
+
+ .nd {
+ color: #A2F;
+ }
+
+ .ni {
+ color: #999;
+ font-weight: bold;
+ }
+
+ .ne {
+ color: #D2413A;
+ font-weight: bold;
+ }
+
+ .nf {
+ color: #FFF;
+ }
+
+ .nl {
+ color: #546E00;
+ }
+
+ .nn {
+ color: #BBB;
+ }
+
+ .nt {
+ color: #BBB;
+ }
+
+ .nv {
+ color: #DDD;
+ }
+
+ .ow {
+ color: #6C71C4;
+ }
+
+ .w {
+ color: #BBB;
+ }
+
+ .mb {
+ color: #D33682;
+ font-weight: bold;
+ }
+
+ .mf {
+ color: #D33682;
+ }
+
+ .mh {
+ color: #D33682;
+ font-weight: bold;
+ }
+
+ .mi {
+ color: #D33682;
+ }
+
+ .mo {
+ color: #D33682;
+ font-weight: bold;
+ }
+
+ .sb {
+ color: #D33682;
+ }
+
+ .sc {
+ color: #D33682;
+ }
+
+ .sd {
+ color: #6C71C4;
+ font-style: italic;
+ }
+
+ .s2 {
+ color: #D33682;
+ }
+
+ .se {
+ color: #D33682;
+ font-weight: bold;
+ }
+
+ .sh {
+ color: #D33682;
+ }
+
+ .si {
+ color: #D33682;
+ font-weight: bold;
+ }
+
+ .sx {
+ color: #D33682;
+ }
+
+ .sr {
+ color: #D33682;
+ font-weight: bold;
+ }
+
+ .s1 {
+ color: #D33682;
+ }
+
+ .ss {
+ color: #BBB;
+ font-weight: bold;
+ }
+
+ .bp {
+ color: #859900;
+ }
+
+ .vc {
+ color: #268BD2;
+ }
+
+ .vg {
+ color: #268BD2;
+ }
+
+ .vi {
+ color: #268BD2;
+ }
+
+ .il {
+ color: #FFF;
+ }
+
+ .p {
+ color: #BBB;
+ }
+}
diff --git a/doc/style.css b/doc/style/style.css
index cf32b28..fca399e 100644
--- a/doc/style.css
+++ b/doc/style/style.css
@@ -2,9 +2,12 @@
/* Generic page style */
-body {
+html {
background: #FFF;
color: #222;
+}
+
+body {
font-family: "DejaVu Sans", "SF Pro Text", Verdana, sans-serif;
font-style: normal;
line-height: 1.6em;
@@ -19,7 +22,7 @@ h1 {
font-size: 2.38em;
font-weight: 600;
line-height: 1.41em;
- margin: 0 0 0.25em 0;
+ margin: 0 0 0.25em;
}
h2 {
@@ -27,7 +30,7 @@ h2 {
font-size: 1.68em;
font-weight: 600;
line-height: 1.3em;
- margin: 1.25em 0 0.5em 0;
+ margin: 1.25em 0 0.5em;
}
h3 {
@@ -35,7 +38,7 @@ h3 {
font-size: 1.41em;
font-weight: 600;
line-height: 1.19em;
- margin: 1.25em 0 0.5em 0;
+ margin: 1.25em 0 0.5em;
}
h4 {
@@ -43,7 +46,7 @@ h4 {
font-size: 1.19em;
font-weight: 600;
line-height: 1.09em;
- margin: 1.25em 0 0.5em 0;
+ margin: 1.25em 0 0.5em;
}
h5, h6 {
@@ -51,7 +54,7 @@ h5, h6 {
font-size: 1em;
font-weight: 600;
line-height: 1em;
- margin: 1.25em 0 0.5em 0;
+ margin: 1.25em 0 0.5em;
}
a {
@@ -89,7 +92,7 @@ img {
}
p {
- margin: 0.5em 0 0.5em 0;
+ margin: 0.5em 0;
}
blockquote {
@@ -106,13 +109,13 @@ pre, code, kbd, samp {
}
ul, ol {
- margin: 0 0 0.5em 0;
+ margin: 0 0 0.5em;
padding-top: 0;
}
dt {
font-weight: 600;
- margin: 0.75em 0 0.125em 0;
+ margin: 0.75em 0 0.125em;
}
dt::after {
@@ -123,7 +126,7 @@ dt::after {
hr {
background-color: #EEE;
border: 0;
- color: gray;
+ color: #666;
height: 1px;
margin-bottom: 1.5ex;
margin-top: 1.5ex;
@@ -192,7 +195,7 @@ footer {
#meta tr, #meta th, #meta td {
border: 0;
font-weight: normal;
- padding: 0 0 0.125em 0;
+ padding: 0 0 0.125em;
background-color: transparent;
}
@@ -211,7 +214,7 @@ footer {
#shortdesc {
padding: 0;
- margin: 0 0 0.5em 0;
+ margin: 0 0 0.5em;
font-style: italic;
color: #666;
display: inline-block;
@@ -238,7 +241,7 @@ footer {
padding: 3px 10px 0 0;
position: absolute;
top: 63px;
- width: 93.900002%;
+ width: 93.9%;
z-index: 0;
}
@@ -416,17 +419,11 @@ input.formbutton {
padding: 0 0 0 12px;
}
-blockquote {
- border-left: 1px solid #CCC;
- margin-left: 1em;
- padding-left: 1em;
-}
-
#footer {
bottom: 0;
clear: both;
font-size: x-small;
- margin: 2em 0 0 0;
+ margin: 2em 0 0;
padding: 0;
color: #888;
}
@@ -449,8 +446,8 @@ blockquote {
@media print {
#topbar {
color: #000;
- margin: 0.25em auto 0.25em auto;
- padding: 0.25em 0.5em 0.5em 0.5em;
+ margin: 0.25em auto;
+ padding: 0.25em 0.5em 0.5em;
max-width: 60em;
position: relative;
}
@@ -470,7 +467,7 @@ blockquote {
@media screen {
#topbar {
- margin: 0.25em auto 0.25em auto;
+ margin: 0.25em auto;
padding: 0;
max-width: 60em;
position: relative;
@@ -479,7 +476,7 @@ blockquote {
#contentsbox {
color: #546E00;
font-size: small;
- margin: 0 0 1.5em 0;
+ margin: 0 0 1.5em;
}
#contents {
@@ -506,7 +503,7 @@ blockquote {
.section {
clear: right;
- padding: 0 0 1.5em 0;
+ padding: 0 0 1.5em;
}
.category {
@@ -581,12 +578,11 @@ table.index {
border-bottom-left-radius: 6px;
}
-
table.terminfo {
border-top: 0;
border-collapse: collapse;
margin: -1px 0 2em 2em;
- padding: 0.25em 0 0.25em 0;
+ padding: 0.25em 0;
float: right;
border-bottom: 1px solid #EEE;
border-left: 1px solid #EEE;
@@ -602,7 +598,7 @@ table.terminfo td {
.restriction {
border-style: hidden;
- margin: 0 0 0.5ex 0;
+ margin: 0 0 0.5ex;
padding: 0;
vertical-align: text-top;
}
@@ -659,15 +655,6 @@ dl {
padding: 0;
}
-hr {
- background-color: #EEE;
- border: 0;
- color: gray;
- height: 1px;
- margin-bottom: 1.5ex;
- margin-top: 1.5ex;
-}
-
div.head {
margin-bottom: 1em;
}
@@ -701,3 +688,118 @@ div.head table {
.highlight, .codehilite {
margin-left: 2em;
}
+
+/* Dark mode */
+@media (prefers-color-scheme: dark) {
+ /* Dark generic page style */
+
+ html {
+ background: #222;
+ color: #DDD;
+ }
+
+ a {
+ color: #B4C342;
+ }
+
+ a:link {
+ color: #B4C342;
+ }
+
+ a:visited {
+ color: #B4C342;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+ color: #DDD;
+ }
+
+ h1 a:link, h2 a:link, h3 a:link, h4 a:link, h5 a:link, h6 a:link {
+ color: #DDD;
+ }
+
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
+ color: #DDD;
+ }
+
+ blockquote {
+ border-left: 1px solid #444;
+ }
+
+ pre, code, kbd, samp {
+ color: #DDD;
+ }
+
+ hr {
+ background-color: #333;
+ border: 0;
+ color: #666;
+ }
+
+ th {
+ border: 1px solid #444;
+ }
+
+ td {
+ border: 1px solid #444;
+ }
+
+ footer {
+ color: #BBB;
+ }
+
+ /* Dark specgen style */
+
+ #metabox {
+ color: #999;
+ }
+
+ #shortdesc {
+ color: #999;
+ }
+
+ #titlesep {
+ color: #444;
+ }
+
+ .terminfo, .restriction {
+ color: #999;
+ }
+
+ table.terminfo {
+ border-bottom: 1px solid #444;
+ border-left: 1px solid #444;
+ }
+
+ .spectermbody {
+ border-top: 1px solid #444;
+ }
+
+ .spectermbody .description .comment > p:first-child {
+ color: #BBB;
+ }
+
+ .error {
+ color: #DC322F;
+ }
+
+ .warning {
+ color: #B58900;
+ }
+
+ .success {
+ color: #859900;
+ }
+
+ #topbar {
+ border-bottom: 1px solid #444;
+ }
+}
+
+/* Hard black for dark mode on mobile (since it's likely to be an OLED screen) */
+@media only screen and (hover: none) and (pointer: coarse) and (prefers-color-scheme: dark) {
+ html {
+ background: #000;
+ color: #CCC;
+ }
+}
diff --git a/lv2/atom/atom.h b/include/lv2/atom/atom.h
index 8c0f30a..ca607d3 100644
--- a/lv2/atom/atom.h
+++ b/include/lv2/atom/atom.h
@@ -1,35 +1,24 @@
-/*
- Copyright 2008-2016 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_ATOM_ATOM_H
+#define LV2_ATOM_ATOM_H
/**
@defgroup atom Atom
@ingroup lv2
- A generic value container and several data types, see
- <http://lv2plug.in/ns/ext/atom> for details.
+ A generic value container and several data types.
+
+ See <http://lv2plug.in/ns/ext/atom> for details.
@{
*/
-#ifndef LV2_ATOM_H
-#define LV2_ATOM_H
-
-#include <stddef.h>
#include <stdint.h>
+// 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#
@@ -65,32 +54,27 @@
#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
-#define LV2_ATOM_REFERENCE_TYPE 0 ///< The special type for a reference atom
+// 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)))
+#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)))
+ ((const void*)((const uint8_t*)(atom) + sizeof(type)))
/**
Return a pointer to the body of an Atom. The "body" of an atom is the
@@ -105,32 +89,32 @@ typedef char lv2_atom_assert_double_fits_in_64_bits[
/** 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). */
+ 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 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 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 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 atom; /**< Atom header. */
+ double body; /**< Floating point value. */
} LV2_Atom_Double;
/** An atom:Bool. May be cast to LV2_Atom. */
@@ -138,84 +122,84 @@ 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 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 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. */
+ 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 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 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. */
+ 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 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. */
+ 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 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. */
+ 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 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. */
+ /** 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;
/**
@@ -231,27 +215,27 @@ typedef struct {
| Event 1 (size 6) | Event 2
| | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
- |FRAMES |SUBFRMS|TYPE |SIZE |DATADATADATAPAD|FRAMES |SUBFRMS|...
+ |FRAMES |SIZE |TYPE |DATADATADATAPAD|FRAMES |...
</pre>
*/
typedef struct {
- uint32_t unit; /**< URID of unit of event time stamps. */
- uint32_t pad; /**< Currently unused. */
- /* Contents (a series of events) follow here. */
+ 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 atom; /**< Atom header. */
+ LV2_Atom_Sequence_Body body; /**< Body. */
} LV2_Atom_Sequence;
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
/**
@}
*/
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* LV2_ATOM_H */
+#endif // LV2_ATOM_ATOM_H
diff --git a/lv2/atom/forge.h b/include/lv2/atom/forge.h
index 05fc539..f894a5a 100644
--- a/lv2/atom/forge.h
+++ b/include/lv2/atom/forge.h
@@ -1,18 +1,5 @@
-/*
- Copyright 2008-2016 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
/**
@file forge.h An API for constructing LV2 atoms.
@@ -27,8 +14,8 @@
must be popped when the container is finished.
All output is written to a user-provided buffer or sink function. This
- makes it popssible to create create atoms on the stack, on the heap, in LV2
- port buffers, in a ringbuffer, or elsewhere, all using the same API.
+ 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
@@ -39,15 +26,18 @@
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.
+
@{
*/
-#ifndef LV2_ATOM_FORGE_H
-#define LV2_ATOM_FORGE_H
-
#include "lv2/atom/atom.h"
#include "lv2/atom/util.h"
#include "lv2/core/attributes.h"
@@ -55,6 +45,8 @@
#include <assert.h>
#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
#ifdef __cplusplus
extern "C" {
@@ -70,52 +62,52 @@ typedef void* LV2_Atom_Forge_Sink_Handle;
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);
+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);
+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;
+ 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;
+ 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
@@ -130,32 +122,33 @@ lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size);
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);
+ 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);
+ // NOLINTNEXTLINE(performance-no-int-to-ptr)
+ return forge->buf ? (LV2_Atom*)ref : forge->deref(forge->handle, ref);
}
/**
@@ -174,43 +167,42 @@ 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;
+ frame->parent = forge->stack;
+ frame->ref = ref;
- if (ref) {
- forge->stack = frame; // Don't push, so walking the stack is always safe
- }
+ if (ref) {
+ forge->stack = frame; // Don't push, so walking the stack is always safe
+ }
- return ref;
+ 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
+ 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 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 (type == forge->Object || type == forge->Blank ||
+ type == forge->Resource);
}
/** Return true iff `type` is an atom:Object with a blank ID. */
@@ -219,8 +211,7 @@ 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));
+ return (type == forge->Blank || (type == forge->Object && body->id == 0));
}
/**
@@ -233,13 +224,13 @@ lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge,
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;
+ forge->buf = buf;
+ forge->size = (uint32_t)size;
+ forge->offset = 0;
+ forge->deref = NULL;
+ forge->sink = NULL;
+ forge->handle = NULL;
+ forge->stack = NULL;
}
/**
@@ -262,12 +253,12 @@ lv2_atom_forge_set_sink(LV2_Atom_Forge* forge,
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;
+ forge->buf = NULL;
+ forge->size = forge->offset = 0;
+ forge->deref = deref;
+ forge->sink = sink;
+ forge->handle = handle;
+ forge->stack = NULL;
}
/**
@@ -279,60 +270,65 @@ lv2_atom_forge_set_sink(LV2_Atom_Forge* forge,
/**
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 approriately padded.
+ 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;
+ 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);
+ 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;
+ const 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_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;
+ const LV2_Atom_Forge_Ref s = lv2_atom_forge_raw(forge, str, len);
+ if (!s) {
+ return s;
+ }
+
+ const LV2_Atom_Forge_Ref t = lv2_atom_forge_raw(forge, "", 1);
+ if (!t) {
+ return t;
+ }
+
+ lv2_atom_forge_pad(forge, len + 1U);
+ return t;
}
/**
@@ -345,66 +341,66 @@ lv2_atom_forge_string_body(LV2_Atom_Forge* forge,
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));
+ 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));
+ 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, &a.atom);
+ 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, &a.atom);
+ 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, &a.atom);
+ 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, &a.atom);
+ 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, &a.atom);
+ 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, &a.atom);
+ 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. */
@@ -414,23 +410,23 @@ lv2_atom_forge_typed_string(LV2_Atom_Forge* forge,
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;
+ 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);
+ return lv2_atom_forge_typed_string(forge, forge->String, str, len);
}
/**
@@ -441,14 +437,14 @@ lv2_atom_forge_string(LV2_Atom_Forge* forge, const char* str, uint32_t len)
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);
+ 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);
+ return lv2_atom_forge_typed_string(forge, forge->Path, path, len);
}
/** Write an atom:Literal. */
@@ -459,21 +455,19 @@ lv2_atom_forge_literal(LV2_Atom_Forge* forge,
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;
+ 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. */
@@ -483,12 +477,10 @@ lv2_atom_forge_vector_head(LV2_Atom_Forge* forge,
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)));
+ 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. */
@@ -499,16 +491,15 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge,
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;
+ const LV2_Atom_Vector a = {
+ {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size,
+ forge->Vector},
+ {child_size, child_type}};
+ const 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;
}
/**
@@ -531,9 +522,9 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge,
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)));
+ const LV2_Atom_Tuple a = {{0, forge->Tuple}};
+ return lv2_atom_forge_push(
+ forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
/**
@@ -566,12 +557,10 @@ lv2_atom_forge_object(LV2_Atom_Forge* forge,
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)));
+ 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)));
}
/**
@@ -587,12 +576,10 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge,
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)));
+ 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)));
}
/**
@@ -608,12 +595,10 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge,
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)));
+ 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)));
}
/**
@@ -622,11 +607,10 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge,
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)
+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));
+ const LV2_Atom_Property_Body a = {key, 0, {0, 0}};
+ return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t));
}
/**
@@ -640,8 +624,8 @@ 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));
+ const LV2_Atom_Property_Body a = {key, context, {0, 0}};
+ return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t));
}
/**
@@ -652,12 +636,10 @@ 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)));
+ 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)));
}
/**
@@ -668,7 +650,7 @@ lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge,
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));
+ return lv2_atom_forge_write(forge, &frames, sizeof(frames));
}
/**
@@ -679,18 +661,18 @@ lv2_atom_forge_frame_time(LV2_Atom_Forge* forge, int64_t frames)
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));
+ return lv2_atom_forge_write(forge, &beats, sizeof(beats));
}
-/**
- @}
- @}
-*/
-
LV2_RESTORE_WARNINGS
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* LV2_ATOM_FORGE_H */
+/**
+ @}
+ @}
+*/
+
+#endif // LV2_ATOM_FORGE_H
diff --git a/lv2/atom/util.h b/include/lv2/atom/util.h
index 6f3158f..a2369da 100644
--- a/lv2/atom/util.h
+++ b/include/lv2/atom/util.h
@@ -1,18 +1,8 @@
-/*
- Copyright 2008-2015 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2008-2015 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_ATOM_UTIL_H
+#define LV2_ATOM_UTIL_H
/**
@file util.h Helper functions for the LV2 Atom extension.
@@ -23,14 +13,14 @@
*/
/**
- @defgroup util Utilities
+ @defgroup atom_util Utilities
@ingroup atom
+
+ Utilities for working with atoms.
+
@{
*/
-#ifndef LV2_ATOM_UTIL_H
-#define LV2_ATOM_UTIL_H
-
#include "lv2/atom/atom.h"
#include <stdarg.h>
@@ -38,6 +28,8 @@
#include <stdint.h>
#include <string.h>
+// NOLINTBEGIN(bugprone-macro-parentheses)
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -46,30 +38,31 @@ extern "C" {
static inline uint32_t
lv2_atom_pad_size(uint32_t size)
{
- return (size + 7U) & (~7U);
+ static const uint32_t mask = 7U;
+
+ return (size + mask) & ~mask;
}
/** 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 (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 !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));
+ return (a == b) || ((a->type == b->type) && (a->size == b->size) &&
+ !memcmp(a + 1, b + 1, a->size));
}
/**
@@ -81,14 +74,14 @@ lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b)
static inline LV2_Atom_Event*
lv2_atom_sequence_begin(const LV2_Atom_Sequence_Body* body)
{
- return (LV2_Atom_Event*)(body + 1);
+ 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 (LV2_Atom_Event*)((const uint8_t*)body + lv2_atom_pad_size(size));
}
/** Return true iff `i` has reached the end of `body`. */
@@ -97,16 +90,15 @@ 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 (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));
+ return (LV2_Atom_Event*)((const uint8_t*)i + sizeof(LV2_Atom_Event) +
+ lv2_atom_pad_size(i->body.size));
}
/**
@@ -123,16 +115,16 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i)
}
@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))
+#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))
+#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))
/**
@}
@@ -148,7 +140,7 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i)
static inline void
lv2_atom_sequence_clear(LV2_Atom_Sequence* seq)
{
- seq->atom.size = sizeof(LV2_Atom_Sequence_Body);
+ seq->atom.size = sizeof(LV2_Atom_Sequence_Body);
}
/**
@@ -167,17 +159,17 @@ 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;
- }
+ 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);
+ 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);
+ seq->atom.size += lv2_atom_pad_size(total_size);
- return e;
+ return e;
}
/**
@@ -190,22 +182,22 @@ lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq,
static inline LV2_Atom*
lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup)
{
- return (LV2_Atom*)(LV2_ATOM_BODY(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 (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));
+ return (LV2_Atom*)((const uint8_t*)i + sizeof(LV2_Atom) +
+ lv2_atom_pad_size(i->size));
}
/**
@@ -222,16 +214,16 @@ lv2_atom_tuple_next(const LV2_Atom* i)
}
@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))
+#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))
+ for (LV2_Atom* iter = (LV2_Atom*)(body); \
+ !lv2_atom_tuple_is_end(body, size, (iter)); \
+ (iter) = lv2_atom_tuple_next(iter))
/**
@}
@@ -243,7 +235,7 @@ lv2_atom_tuple_next(const LV2_Atom* i)
static inline LV2_Atom_Property_Body*
lv2_atom_object_begin(const LV2_Atom_Object_Body* body)
{
- return (LV2_Atom_Property_Body*)(body + 1);
+ return (LV2_Atom_Property_Body*)(body + 1);
}
/** Return true iff `i` has reached the end of `obj`. */
@@ -252,18 +244,19 @@ 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 (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));
+ 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));
}
/**
@@ -280,16 +273,16 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i)
}
@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))
+#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))
+#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))
/**
@}
@@ -299,12 +292,12 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i)
/** 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) */
+ 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 };
+static const LV2_Atom_Object_Query LV2_ATOM_OBJECT_QUERY_END = {0, NULL};
/**
Get an object's values for various keys.
@@ -335,26 +328,26 @@ 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;
+ 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;
}
/**
@@ -363,37 +356,37 @@ lv2_atom_object_query(const LV2_Atom_Object* object,
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;
+ int matches = 0;
+ int n_queries = 0;
+
+ /* Count number of keys so we can short-circuit when done */
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
+ 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) {
+ const 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;
}
/**
@@ -418,37 +411,37 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...)
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;
+ int matches = 0;
+ int n_queries = 0;
+
+ /* Count number of keys so we can short-circuit when done */
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
+ 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) {
+ const 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;
}
/**
@@ -474,48 +467,49 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...)
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;
+ int matches = 0;
+ int n_queries = 0;
+
+ /* Count number of keys so we can short-circuit when done */
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
+ 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
+
+// NOLINTEND(bugprone-macro-parentheses)
+
/**
@}
@}
*/
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* LV2_ATOM_UTIL_H */
+#endif // LV2_ATOM_UTIL_H
diff --git a/lv2/buf-size/buf-size.h b/include/lv2/buf-size/buf-size.h
index ae86545..c1a00e1 100644
--- a/lv2/buf-size/buf-size.h
+++ b/include/lv2/buf-size/buf-size.h
@@ -1,32 +1,22 @@
-/*
- Copyright 2007-2016 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2007-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
-#ifndef LV2_BUF_SIZE_H
-#define LV2_BUF_SIZE_H
+#ifndef LV2_BUF_SIZE_BUF_SIZE_H
+#define LV2_BUF_SIZE_BUF_SIZE_H
/**
@defgroup buf-size Buffer Size
@ingroup lv2
- Access to, and restrictions on, buffer sizes; see
- <http://lv2plug.in/ns/ext/buf-size> for details.
+ Access to, and restrictions on, buffer sizes.
+
+ See <http://lv2plug.in/ns/ext/buf-size> 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#
@@ -39,8 +29,10 @@
#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 */
+#endif // LV2_BUF_SIZE_BUF_SIZE_H
diff --git a/include/lv2/core/attributes.h b/include/lv2/core/attributes.h
new file mode 100644
index 0000000..2db876f
--- /dev/null
+++ b/include/lv2/core/attributes.h
@@ -0,0 +1,46 @@
+// Copyright 2018 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#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/include/lv2/core/lv2.h
index 9b2de6f..b085ac5 100644
--- a/lv2/core/lv2.h
+++ b/include/lv2/core/lv2.h
@@ -1,22 +1,10 @@
-/*
- 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.
-*/
+// Copyright 2006-2020 David Robillard <d@drobilla.net>
+// Copyright 2006-2012 Steve Harris <steve@plugin.org.uk>
+// Copyright 2000-2002 Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld.
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_CORE_LV2_H
+#define LV2_CORE_LV2_H
/**
@defgroup lv2 LV2
@@ -29,16 +17,17 @@
/**
@defgroup lv2core LV2 Core
- Core LV2 specification, see <http://lv2plug.in/ns/lv2core> for details.
+ Core LV2 specification.
+
+ See <http://lv2plug.in/ns/lv2core> for details.
@{
*/
-#ifndef LV2_H_INCLUDED
-#define LV2_H_INCLUDED
-
#include <stdint.h>
+// 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#
@@ -101,6 +90,7 @@
#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
@@ -127,6 +117,8 @@
#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
@@ -138,7 +130,7 @@ extern "C" {
compare to NULL (or 0 for C++) but otherwise the host MUST NOT attempt to
interpret it.
*/
-typedef void * LV2_Handle;
+typedef void* LV2_Handle;
/**
Feature.
@@ -149,20 +141,20 @@ typedef void * LV2_Handle;
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.
+ /**
+ 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;
+ This MUST be a valid URI string as defined by RFC 3986.
+ */
+ const char* URI;
- /**
- Pointer to arbitrary data.
+ /**
+ Pointer to arbitrary data.
- The format of this data is defined by the extension which describes the
- feature with the given `URI`.
- */
- void * data;
+ The format of this data is defined by the extension which describes the
+ feature with the given `URI`.
+ */
+ void* data;
} LV2_Feature;
/**
@@ -172,200 +164,200 @@ typedef struct {
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 extenion.
-
- 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);
+ /**
+ 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"
+# define LV2_SYMBOL_EXTERN extern "C"
#else
-# define LV2_SYMBOL_EXTERN
+# 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
+#ifndef LV2_SYMBOL_EXPORT
+# ifdef _WIN32
# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport)
-#else
-# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __attribute__((visibility("default")))
+# else
+# define LV2_SYMBOL_EXPORT \
+ LV2_SYMBOL_EXTERN __attribute__((visibility("default")))
+# endif
#endif
/**
@@ -392,13 +384,13 @@ typedef struct LV2_Descriptor {
consistent between loads of the plugin library.
*/
LV2_SYMBOL_EXPORT
-const LV2_Descriptor * lv2_descriptor(uint32_t index);
+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);
+typedef const LV2_Descriptor* (*LV2_Descriptor_Function)(uint32_t index);
/**
Handle for a library descriptor.
@@ -412,34 +404,33 @@ typedef void* LV2_Lib_Handle;
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);
+ /**
+ 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;
/**
@@ -459,24 +450,23 @@ typedef struct {
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);
+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);
+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 */
-
/**
@}
@}
*/
+
+#endif // LV2_CORE_LV2_H
diff --git a/include/lv2/core/lv2_util.h b/include/lv2/core/lv2_util.h
new file mode 100644
index 0000000..2bac3c9
--- /dev/null
+++ b/include/lv2/core/lv2_util.h
@@ -0,0 +1,95 @@
+// Copyright 2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_CORE_LV2_UTIL_H
+#define LV2_CORE_LV2_UTIL_H
+
+/**
+ @defgroup lv2_util Utilities
+ @ingroup lv2core
+ @{
+*/
+
+#include "lv2/core/lv2.h"
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <string.h>
+
+#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; // NOLINT(cppcoreguidelines-init-variables)
+ va_start(args, features);
+
+ const char* uri = NULL;
+ while ((uri = va_arg(args, const char*))) {
+ void** data = va_arg(args, void**);
+ const 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
+
+/**
+ @}
+*/
+
+#endif // LV2_CORE_LV2_UTIL_H
diff --git a/include/lv2/data-access/data-access.h b/include/lv2/data-access/data-access.h
new file mode 100644
index 0000000..4586273
--- /dev/null
+++ b/include/lv2/data-access/data-access.h
@@ -0,0 +1,60 @@
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_DATA_ACCESS_DATA_ACCESS_H
+#define LV2_DATA_ACCESS_DATA_ACCESS_H
+
+/**
+ @defgroup data-access Data Access
+ @ingroup lv2
+
+ Access to plugin extension_data() for UIs.
+
+ See <http://lv2plug.in/ns/ext/data-access> 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_DATA_ACCESS_H
diff --git a/lv2/dynmanifest/dynmanifest.h b/include/lv2/dynmanifest/dynmanifest.h
index 16274e4..b1a273c 100644
--- a/lv2/dynmanifest/dynmanifest.h
+++ b/include/lv2/dynmanifest/dynmanifest.h
@@ -1,40 +1,31 @@
-/*
- Dynamic manifest specification for LV2
- Copyright 2008-2011 Stefano D'Angelo <zanga.mail@gmail.com>
-
- 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.
-*/
+// Copyright 2008-2011 Stefano D'Angelo <zanga.mail@gmail.com>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_DYNMANIFEST_DYNMANIFEST_H
+#define LV2_DYNMANIFEST_DYNMANIFEST_H
/**
@defgroup dynmanifest Dynamic Manifest
@ingroup lv2
- Support for dynamic data generation, see
- <http://lv2plug.in/ns/ext/dynmanifest> for details.
+ Support for dynamic data generation.
+
+ See <http://lv2plug.in/ns/ext/dynmanifest> for details.
@{
*/
-#ifndef LV2_DYN_MANIFEST_H_INCLUDED
-#define LV2_DYN_MANIFEST_H_INCLUDED
-
#include "lv2/core/lv2.h"
#include <stdio.h>
+// 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
@@ -47,7 +38,7 @@ extern "C" {
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;
+typedef void* LV2_Dyn_Manifest_Handle;
/**
Generate the dynamic manifest.
@@ -65,8 +56,10 @@ typedef void * LV2_Dyn_Manifest_Handle;
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);
+LV2_SYMBOL_EXPORT
+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.
@@ -78,7 +71,7 @@ int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
<http://example.org/plugin> a lv2:Plugin .
- The objects that are elegible for exposure are those that would need to be
+ 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.
@@ -91,8 +84,9 @@ int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
@return 0 on success, otherwise a non-zero error code.
*/
-int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle,
- FILE * fp);
+LV2_SYMBOL_EXPORT
+int
+lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp);
/**
Function that fetches data related to a specific URI.
@@ -124,9 +118,11 @@ int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle,
@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);
+LV2_SYMBOL_EXPORT
+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.
@@ -139,14 +135,16 @@ int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle,
@param handle Dynamic manifest generator handle.
*/
-void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle);
+LV2_SYMBOL_EXPORT
+void
+lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle);
#ifdef __cplusplus
-}
+} /* extern "C" */
#endif
-#endif /* LV2_DYN_MANIFEST_H_INCLUDED */
-
/**
@}
*/
+
+#endif // LV2_DYNMANIFEST_DYNMANIFEST_H
diff --git a/include/lv2/event/event-helpers.h b/include/lv2/event/event-helpers.h
new file mode 100644
index 0000000..a9eb423
--- /dev/null
+++ b/include/lv2/event/event-helpers.h
@@ -0,0 +1,242 @@
+// Copyright 2008-2015 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_EVENT_EVENT_HELPERS_H
+#define LV2_EVENT_EVENT_HELPERS_H
+
+/**
+ @file event-helpers.h Helper functions for the LV2 Event extension
+ <http://lv2plug.in/ns/ext/event>.
+*/
+
+#include "lv2/core/attributes.h"
+#include "lv2/event/event.h"
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LV2_DISABLE_DEPRECATION_WARNINGS
+
+/** @file
+ * Helper functions for the LV2 Event extension
+ * <http://lv2plug.in/ns/ext/event>.
+ *
+ * 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_EVENT_HELPERS_H
diff --git a/include/lv2/event/event.h b/include/lv2/event/event.h
new file mode 100644
index 0000000..e255291
--- /dev/null
+++ b/include/lv2/event/event.h
@@ -0,0 +1,285 @@
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_EVENT_EVENT_H
+#define LV2_EVENT_EVENT_H
+
+/**
+ @defgroup event Event
+ @ingroup lv2
+
+ Generic time-stamped events.
+
+ See <http://lv2plug.in/ns/ext/event> 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 <stdint.h>
+
+#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 callback_data The callback_data field of this struct.
+
+ @param event An event received at an input that will not be copied to
+ an output or stored in any way.
+
+ 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 callback_data The callback_data field of this struct.
+
+ @param event An event received at an input that will not be copied to an
+ output or stored in any way.
+
+ 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_EVENT_H
diff --git a/include/lv2/instance-access/instance-access.h b/include/lv2/instance-access/instance-access.h
new file mode 100644
index 0000000..70c2789
--- /dev/null
+++ b/include/lv2/instance-access/instance-access.h
@@ -0,0 +1,28 @@
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_INSTANCE_ACCESS_INSTANCE_ACCESS_H
+#define LV2_INSTANCE_ACCESS_INSTANCE_ACCESS_H
+
+/**
+ @defgroup instance-access Instance Access
+ @ingroup lv2
+
+ Access to the LV2_Handle of a plugin for UIs.
+
+ See <http://lv2plug.in/ns/ext/instance-access> 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_INSTANCE_ACCESS_H
diff --git a/include/lv2/log/log.h b/include/lv2/log/log.h
new file mode 100644
index 0000000..b460f45
--- /dev/null
+++ b/include/lv2/log/log.h
@@ -0,0 +1,100 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_LOG_LOG_H
+#define LV2_LOG_LOG_H
+
+/**
+ @defgroup log Log
+ @ingroup lv2
+
+ Interface for plugins to log via the host.
+
+ See <http://lv2plug.in/ns/ext/log> 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 <stdarg.h>
+
+#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_LOG_H
diff --git a/include/lv2/log/logger.h b/include/lv2/log/logger.h
new file mode 100644
index 0000000..37fe564
--- /dev/null
+++ b/include/lv2/log/logger.h
@@ -0,0 +1,144 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_LOG_LOGGER_H
+#define LV2_LOG_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 <stdarg.h>
+#include <stdio.h>
+
+#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; // NOLINT(cppcoreguidelines-init-variables)
+ 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; // NOLINT(cppcoreguidelines-init-variables)
+ 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; // NOLINT(cppcoreguidelines-init-variables)
+ 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; // NOLINT(cppcoreguidelines-init-variables)
+ 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/include/lv2/midi/midi.h b/include/lv2/midi/midi.h
new file mode 100644
index 0000000..2a687fb
--- /dev/null
+++ b/include/lv2/midi/midi.h
@@ -0,0 +1,235 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_MIDI_MIDI_H
+#define LV2_MIDI_MIDI_H
+
+/**
+ @defgroup midi MIDI
+ @ingroup lv2
+
+ Definitions of standard MIDI messages.
+
+ See <http://lv2plug.in/ns/ext/midi> for details.
+
+ @{
+*/
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#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_MIDI_H
diff --git a/include/lv2/morph/morph.h b/include/lv2/morph/morph.h
new file mode 100644
index 0000000..88bfe81
--- /dev/null
+++ b/include/lv2/morph/morph.h
@@ -0,0 +1,35 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_MORPH_MORPH_H
+#define LV2_MORPH_MORPH_H
+
+/**
+ @defgroup morph Morph
+ @ingroup lv2
+
+ Ports that can dynamically change type.
+
+ See <http://lv2plug.in/ns/ext/morph> 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_MORPH_H
diff --git a/include/lv2/options/options.h b/include/lv2/options/options.h
new file mode 100644
index 0000000..0169b46
--- /dev/null
+++ b/include/lv2/options/options.h
@@ -0,0 +1,136 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_OPTIONS_OPTIONS_H
+#define LV2_OPTIONS_OPTIONS_H
+
+/**
+ @defgroup options Options
+ @ingroup lv2
+
+ Instantiation time options.
+
+ See <http://lv2plug.in/ns/ext/options> for details.
+
+ @{
+*/
+
+#include "lv2/core/lv2.h"
+#include "lv2/urid/urid.h"
+
+#include <stdint.h>
+
+// 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_OPTIONS_H
diff --git a/lv2/parameters/parameters.h b/include/lv2/parameters/parameters.h
index 01c6dde..b20c83e 100644
--- a/lv2/parameters/parameters.h
+++ b/include/lv2/parameters/parameters.h
@@ -1,31 +1,21 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_PARAMETERS_PARAMETERS_H
+#define LV2_PARAMETERS_PARAMETERS_H
/**
@defgroup parameters Parameters
@ingroup lv2
- Common parameters for audio processing, see
- <http://lv2plug.in/ns/ext/parameters>.
+ Common parameters for audio processing.
+
+ See <http://lv2plug.in/ns/ext/parameters> for details.
@{
*/
-#ifndef LV2_PARAMETERS_H
-#define LV2_PARAMETERS_H
+// 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#
@@ -56,8 +46,10 @@
#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
-#endif /* LV2_PARAMETERS_H */
+// clang-format on
/**
@}
*/
+
+#endif // LV2_PARAMETERS_PARAMETERS_H
diff --git a/lv2/patch/patch.h b/include/lv2/patch/patch.h
index a721c5e..99fd8e9 100644
--- a/lv2/patch/patch.h
+++ b/include/lv2/patch/patch.h
@@ -1,34 +1,24 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
- 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_PATCH_H
+#define LV2_PATCH_PATCH_H
/**
@defgroup patch Patch
@ingroup lv2
- Messages for accessing and manipulating properties, see
- <http://lv2plug.in/ns/ext/patch> for details.
+ Messages for accessing and manipulating properties.
Note the patch extension is purely data, this header merely defines URIs for
convenience.
+ See <http://lv2plug.in/ns/ext/patch> for details.
+
@{
*/
-#ifndef LV2_PATCH_H
-#define LV2_PATCH_H
+// 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#
@@ -61,8 +51,10 @@
#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
-#endif /* LV2_PATCH_H */
+// clang-format on
/**
@}
*/
+
+#endif // LV2_PATCH_PATCH_H
diff --git a/lv2/port-groups/port-groups.h b/include/lv2/port-groups/port-groups.h
index 4c5699f..ff00533 100644
--- a/lv2/port-groups/port-groups.h
+++ b/include/lv2/port-groups/port-groups.h
@@ -1,31 +1,21 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
- 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_PORT_GROUPS_H
+#define LV2_PORT_GROUPS_PORT_GROUPS_H
/**
@defgroup port-groups Port Groups
@ingroup lv2
- Multi-channel groups of LV2 ports, see
- <http://lv2plug.in/ns/ext/port-groups> for details.
+ Multi-channel groups of LV2 ports.
+
+ See <http://lv2plug.in/ns/ext/port-groups> for details.
@{
*/
-#ifndef LV2_PORT_GROUPS_H
-#define LV2_PORT_GROUPS_H
+// 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#
@@ -65,8 +55,10 @@
#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
-#endif /* LV2_PORT_GROUPS_H */
+// clang-format on
/**
@}
*/
+
+#endif // LV2_PORT_GROUPS_PORT_GROUPS_H
diff --git a/lv2/port-props/port-props.h b/include/lv2/port-props/port-props.h
index eb55130..6007f4b 100644
--- a/lv2/port-props/port-props.h
+++ b/include/lv2/port-props/port-props.h
@@ -1,18 +1,8 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_PORT_PROPS_PORT_PROPS_H
+#define LV2_PORT_PROPS_PORT_PROPS_H
/**
@defgroup port-props Port Properties
@@ -23,8 +13,7 @@
@{
*/
-#ifndef LV2_PORT_PROPS_H
-#define LV2_PORT_PROPS_H
+// 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#
@@ -42,8 +31,10 @@
#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
-#endif /* LV2_PORT_PROPS_H */
+// clang-format on
/**
@}
*/
+
+#endif // LV2_PORT_PROPS_PORT_PROPS_H
diff --git a/include/lv2/presets/presets.h b/include/lv2/presets/presets.h
new file mode 100644
index 0000000..ecd23a2
--- /dev/null
+++ b/include/lv2/presets/presets.h
@@ -0,0 +1,35 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_PRESETS_PRESETS_H
+#define LV2_PRESETS_PRESETS_H
+
+/**
+ @defgroup presets Presets
+ @ingroup lv2
+
+ Presets for plugins.
+
+ See <http://lv2plug.in/ns/ext/presets> 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_PRESETS_H
diff --git a/include/lv2/resize-port/resize-port.h b/include/lv2/resize-port/resize-port.h
new file mode 100644
index 0000000..7593a6d
--- /dev/null
+++ b/include/lv2/resize-port/resize-port.h
@@ -0,0 +1,76 @@
+// Copyright 2007-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_RESIZE_PORT_RESIZE_PORT_H
+#define LV2_RESIZE_PORT_RESIZE_PORT_H
+
+/**
+ @defgroup resize-port Resize Port
+ @ingroup lv2
+
+ Dynamically sized LV2 port buffers.
+
+ @{
+*/
+
+#include <stddef.h>
+#include <stdint.h>
+
+// 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_RESIZE_PORT_H
diff --git a/include/lv2/state/state.h b/include/lv2/state/state.h
new file mode 100644
index 0000000..a44f3cc
--- /dev/null
+++ b/include/lv2/state/state.h
@@ -0,0 +1,379 @@
+// Copyright 2010-2016 David Robillard <d@drobilla.net>
+// Copyright 2010 Leonard Ritter <paniq@paniq.org>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_STATE_STATE_H
+#define LV2_STATE_STATE_H
+
+/**
+ @defgroup state State
+ @ingroup lv2
+
+ An interface for LV2 plugins to save and restore state.
+
+ See <http://lv2plug.in/ns/ext/state> for details.
+
+ @{
+*/
+
+#include "lv2/core/lv2.h"
+
+#include <stddef.h>
+#include <stdint.h>
+
+// 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_STATE_H
diff --git a/lv2/time/time.h b/include/lv2/time/time.h
index 912d732..2d81dc7 100644
--- a/lv2/time/time.h
+++ b/include/lv2/time/time.h
@@ -1,34 +1,24 @@
-/*
- Copyright 2011-2016 David Robillard <http://drobilla.net>
-
- 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.
-*/
+// Copyright 2011-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_TIME_TIME_H
+#define LV2_TIME_TIME_H
/**
@defgroup time Time
@ingroup lv2
- Properties for describing time, see <http://lv2plug.in/ns/ext/time> for
- details.
+ Properties for describing time.
Note the time extension is purely data, this header merely defines URIs for
convenience.
+ See <http://lv2plug.in/ns/ext/time> for details.
+
@{
*/
-#ifndef LV2_TIME_H
-#define LV2_TIME_H
+// 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#
@@ -47,8 +37,10 @@
#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 */
+#endif // LV2_TIME_TIME_H
diff --git a/include/lv2/ui/ui.h b/include/lv2/ui/ui.h
new file mode 100644
index 0000000..4d2fed7
--- /dev/null
+++ b/include/lv2/ui/ui.h
@@ -0,0 +1,529 @@
+// Copyright 2009-2016 David Robillard <d@drobilla.net>
+// Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_UI_UI_H
+#define LV2_UI_UI_H
+
+/**
+ @defgroup ui User Interfaces
+ @ingroup lv2
+
+ User interfaces of any type for plugins.
+
+ See <http://lv2plug.in/ns/extensions/ui> for details.
+
+ @{
+*/
+
+#include "lv2/core/lv2.h"
+#include "lv2/urid/urid.h"
+
+#include <stdbool.h>
+#include <stdint.h>
+
+// 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_UI_H
diff --git a/lv2/units/units.h b/include/lv2/units/units.h
index caea38d..a6ac4c5 100644
--- a/lv2/units/units.h
+++ b/include/lv2/units/units.h
@@ -1,31 +1,21 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
- 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_UNITS_H
+#define LV2_UNITS_UNITS_H
/**
@defgroup units Units
@ingroup lv2
- Units for LV2 values, see <http://lv2plug.in/ns/extensions/units> for
- details.
+ Units for LV2 values.
+
+ See <http://lv2plug.in/ns/extensions/units> for details.
@{
*/
-#ifndef LV2_UNITS_H
-#define LV2_UNITS_H
+// 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#
@@ -63,8 +53,10 @@
#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
-#endif /* LV2_UNITS_H */
+// clang-format on
/**
@}
*/
+
+#endif // LV2_UNITS_UNITS_H
diff --git a/include/lv2/uri-map/uri-map.h b/include/lv2/uri-map/uri-map.h
new file mode 100644
index 0000000..dc25a55
--- /dev/null
+++ b/include/lv2/uri-map/uri-map.h
@@ -0,0 +1,108 @@
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_URI_MAP_URI_MAP_H
+#define LV2_URI_MAP_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 <http://lv2plug.in/ns/ext/uri-map> 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 <stdint.h>
+
+#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_URI_MAP_H
diff --git a/include/lv2/urid/urid.h b/include/lv2/urid/urid.h
new file mode 100644
index 0000000..8dc4332
--- /dev/null
+++ b/include/lv2/urid/urid.h
@@ -0,0 +1,127 @@
+// Copyright 2008-2016 David Robillard <d@drobilla.net>
+// Copyright 2011 Gabriel M. Beddingfield <gabrbedd@gmail.com>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_URID_URID_H
+#define LV2_URID_URID_H
+
+/**
+ @defgroup urid URID
+ @ingroup lv2
+
+ Features for mapping URIs to and from integers.
+
+ See <http://lv2plug.in/ns/ext/urid> 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 <stdint.h>
+
+#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_URID_H
diff --git a/include/lv2/worker/worker.h b/include/lv2/worker/worker.h
new file mode 100644
index 0000000..613198b
--- /dev/null
+++ b/include/lv2/worker/worker.h
@@ -0,0 +1,170 @@
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef LV2_WORKER_WORKER_H
+#define LV2_WORKER_WORKER_H
+
+/**
+ @defgroup worker Worker
+ @ingroup lv2
+
+ Support for non-realtime plugin operations.
+
+ See <http://lv2plug.in/ns/ext/worker> for details.
+
+ @{
+*/
+
+#include "lv2/core/lv2.h"
+
+#include <stdint.h>
+
+// 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_WORKER_H
diff --git a/lv2.pc.in b/lv2.pc.in
deleted file mode 100644
index bfc1d14..0000000
--- a/lv2.pc.in
+++ /dev/null
@@ -1,7 +0,0 @@
-prefix=@PREFIX@
-includedir=@INCLUDEDIR@
-
-Name: LV2
-Version: @VERSION@
-Description: An extensible audio plugin interface.
-Cflags: -I${includedir}
diff --git a/lv2/atom/atom.meta.ttl b/lv2/atom.lv2/atom.meta.ttl
index 9d714d8..e2902c5 100644
--- a/lv2/atom/atom.meta.ttl
+++ b/lv2/atom.lv2/atom.meta.ttl
@@ -1,5 +1,4 @@
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -12,97 +11,6 @@
doap:license <http://opensource.org/licenses/isc> ;
doap:created "2007-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "2.2" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.6.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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
@@ -258,7 +166,7 @@ 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 implemenation that creates a Path atom to transmit to another is
+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
@@ -539,4 +447,3 @@ 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.lv2/atom.ttl
index ddfb430..03d3531 100644
--- a/lv2/atom/atom.ttl
+++ b/lv2/atom.lv2/atom.ttl
@@ -9,12 +9,12 @@
<http://lv2plug.in/ns/ext/atom>
a owl:Ontology ;
- rdfs:seeAlso <atom.h> ,
- <util.h> ,
- <forge.h> ,
- <atom.meta.ttl> ;
+ rdfs:seeAlso <atom.meta.ttl> ;
rdfs:label "LV2 Atom" ;
- rdfs:comment "A generic value container and several data types." .
+ rdfs:comment "A generic value container and several data types." ;
+ owl:imports <http://lv2plug.in/ns/lv2core> ,
+ <http://lv2plug.in/ns/extensions/ui> ,
+ <http://lv2plug.in/ns/extensions/units> .
atom:cType
a rdf:Property ,
@@ -244,4 +244,3 @@ atom:atomTransfer
a ui:PortProtocol ;
rdfs:label "atom transfer" ;
rdfs:comment "A port protocol for transferring atoms." .
-
diff --git a/lv2/atom/manifest.ttl b/lv2/atom.lv2/manifest.ttl
index 46d6de5..8875a20 100644
--- a/lv2/atom/manifest.ttl
+++ b/lv2/atom.lv2/manifest.ttl
@@ -4,6 +4,5 @@
<http://lv2plug.in/ns/ext/atom>
a lv2:Specification ;
lv2:minorVersion 2 ;
- lv2:microVersion 2 ;
+ lv2:microVersion 4 ;
rdfs:seeAlso <atom.ttl> .
-
diff --git a/lv2/atom/atom-test-utils.c b/lv2/atom/atom-test-utils.c
deleted file mode 100644
index 50e8887..0000000
--- a/lv2/atom/atom-test-utils.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- Copyright 2012-2018 David Robillard <http://drobilla.net>
-
- 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 <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-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 1af1ae1..0000000
--- a/lv2/atom/atom-test.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- Copyright 2012-2015 David Robillard <http://drobilla.net>
-
- 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 <inttypes.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-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("%" PRId64 " != 2\n", 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<Int>)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<Int>)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));
- 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);
- }
-
- free_urid_map();
-
- return 0;
-}
diff --git a/lv2/atom/forge-overflow-test.c b/lv2/atom/forge-overflow-test.c
deleted file mode 100644
index 3c46a25..0000000
--- a/lv2/atom/forge-overflow-test.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- Copyright 2019 David Robillard <http://drobilla.net>
-
- 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 <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-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 (size_t 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 %zu byte string\n", count);
- }
- }
-
- // Failure writing to an exactly full forge
- LV2_Atom_Forge_Ref ref = 0;
- if ((ref = 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 ((ref = 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_Ref ref = 0;
- LV2_Atom_Forge forge;
- lv2_atom_forge_init(&forge, &map);
-
- // Failure in atom header
- lv2_atom_forge_set_buffer(&forge, buf, 1);
- if ((ref = 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 ((ref = 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 (!(ref = 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 ((ref = 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/buf-size/buf-size.meta.ttl b/lv2/buf-size.lv2/buf-size.meta.ttl
index b1d8011..dbce35b 100644
--- a/lv2/buf-size/buf-size.meta.ttl
+++ b/lv2/buf-size.lv2/buf-size.meta.ttl
@@ -1,5 +1,4 @@
@prefix bufsz: <http://lv2plug.in/ns/ext/buf-size#> .
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -11,39 +10,6 @@
doap:shortdesc "Access to, and restrictions on, buffer sizes." ;
doap:created "2012-08-07" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.4" ;
- doap:created "2015-09-18" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Fix typo in bufsz:sequenceSize label."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a facility for plugins to get information about the
@@ -154,4 +120,3 @@ This should be provided as an option by hosts that support event ports
auxiliary buffers large enough to copy the input.
"""^^lv2:Markdown .
-
diff --git a/lv2/buf-size/buf-size.ttl b/lv2/buf-size.lv2/buf-size.ttl
index 8863198..be18fbe 100644
--- a/lv2/buf-size/buf-size.ttl
+++ b/lv2/buf-size.lv2/buf-size.ttl
@@ -10,8 +10,9 @@
a owl:Ontology ;
rdfs:label "LV2 Buf Size" ;
rdfs:comment "Access to, and restrictions on, buffer sizes." ;
- rdfs:seeAlso <buf-size.h> ,
- <buf-size.meta.ttl> .
+ rdfs:seeAlso <buf-size.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> ,
+ <http://lv2plug.in/ns/ext/options> .
bufsz:boundedBlockLength
a lv2:Feature ;
@@ -64,4 +65,3 @@ bufsz:sequenceSize
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.lv2/manifest.ttl
index d242f97..b9cd1ec 100644
--- a/lv2/buf-size/manifest.ttl
+++ b/lv2/buf-size.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <buf-size.ttl> .
-
diff --git a/lv2/core/lv2core.meta.ttl b/lv2/core.lv2/lv2core.meta.ttl
index 465917d..e593d2e 100644
--- a/lv2/core/lv2core.meta.ttl
+++ b/lv2/core.lv2/lv2core.meta.ttl
@@ -1,5 +1,4 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@@ -15,205 +14,6 @@
doap:developer <http://plugin.org.uk/swh.xrdf#me> ,
<http://drobilla.net/drobilla#me> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "18.0" ;
- doap:created "2020-04-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Add lv2:prototype for property inheritance."
- ]
- ]
- ] , [
- doap:revision "10.0" ;
- doap:created "2013-02-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Use consistent label style."
- ]
- ]
- ] , [
- doap:revision "8.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2core-6.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2core-4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2core-3.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2core-2.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
LV2 is an interface for writing audio plugins in C or compatible languages,
@@ -256,7 +56,7 @@ necessarily constant).
### Threading Rules
-To faciliate use in multi-threaded programs, LV2 functions are partitioned into
+To facilitate use in multi-threaded programs, LV2 functions are partitioned into
several threading classes:
| Discovery Class | Instantiation Class | Audio Class |
@@ -271,7 +71,7 @@ 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 fuction
+ * 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
@@ -337,7 +137,7 @@ lv2:PluginBase
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 actul
+that share common structure with a plugin, but are not themselves an actual
plugin, such as presets.
"""^^lv2:Markdown .
@@ -902,4 +702,3 @@ 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.lv2/lv2core.ttl
index f5836c6..669ca2a 100644
--- a/lv2/core/lv2core.ttl
+++ b/lv2/core.lv2/lv2core.ttl
@@ -9,9 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2" ;
rdfs:comment "An extensible open standard for audio plugins." ;
- rdfs:seeAlso <lv2.h> ,
- <lv2_util.h> ,
- <lv2core.meta.ttl> .
+ rdfs:seeAlso <lv2core.meta.ttl> ;
+ owl:imports doap: .
lv2:Specification
a rdfs:Class ,
@@ -536,21 +535,21 @@ lv2:CombPlugin
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf lv2:FilterPlugin ;
- rdfs:label "Comb FilterPlugin" ;
+ rdfs:label "Comb Filter Plugin" ;
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:label "Allpass Filter 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:label "EQ Plugin" ;
rdfs:comment "A plugin that adjusts the balance between frequency components." .
lv2:ParaEQPlugin
@@ -656,7 +655,7 @@ lv2:FunctionPlugin
owl:Class ;
rdfs:subClassOf lv2:UtilityPlugin ;
rdfs:label "Function Plugin" ;
- rdfs:comment "A plugin whose output is a mathmatical function of its input." .
+ rdfs:comment "A plugin whose output is a mathematical function of its input." .
lv2:ConstantPlugin
a rdfs:Class ,
@@ -671,4 +670,3 @@ lv2:MIDIPlugin
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.lv2/manifest.ttl
index 7f1512b..27793dc 100644
--- a/lv2/core/manifest.ttl
+++ b/lv2/core.lv2/manifest.ttl
@@ -5,11 +5,10 @@
<http://lv2plug.in/ns/lv2core>
a lv2:Specification ;
lv2:minorVersion 18 ;
- lv2:microVersion 0 ;
+ lv2:microVersion 6 ;
rdfs:seeAlso <lv2core.ttl> .
<http://lv2plug.in/ns/lv2>
a doap:Project ;
rdfs:seeAlso <meta.ttl> ,
<people.ttl> .
-
diff --git a/lv2/core.lv2/meta.ttl b/lv2/core.lv2/meta.ttl
new file mode 100644
index 0000000..014285c
--- /dev/null
+++ b/lv2/core.lv2/meta.ttl
@@ -0,0 +1,34 @@
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix meta: <http://lv2plug.in/ns/meta#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+<http://opensource.org/licenses/isc>
+ 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.
+""" .
+
+<http://lv2plug.in/ns/lv2>
+ a doap:Project ;
+ lv2:symbol "lv2" ;
+ rdfs:label "LV2" ;
+ rdfs:comment "The LV2 Plugin Interface Project." ;
+ doap:name "LV2" ;
+ doap:license <http://opensource.org/licenses/isc> ;
+ 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 <http://lv2plug.in/> ;
+ doap:mailing-list <http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in> ;
+ doap:programming-language "C" ;
+ doap:developer <http://drobilla.net/drobilla#me> ,
+ <http://plugin.org.uk/swh.xrdf#me> ;
+ doap:helper meta:larsl ,
+ meta:bmwiedemann ,
+ meta:gabrbedd ,
+ meta:daste ,
+ meta:kfoltman ,
+ meta:paniq .
diff --git a/lv2/core/people.ttl b/lv2/core.lv2/people.ttl
index 52d0384..c735af6 100644
--- a/lv2/core/people.ttl
+++ b/lv2/core.lv2/people.ttl
@@ -48,4 +48,3 @@ meta:bmwiedemann
a foaf:Person ;
foaf:name "Bernhard M. Wiedemann" ;
foaf:mbox <bwiedemann@suse.de> .
-
diff --git a/lv2/core/attributes.h b/lv2/core/attributes.h
deleted file mode 100644
index 672d716..0000000
--- a/lv2/core/attributes.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- Copyright 2018 David Robillard <http://drobilla.net>
-
- 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_util.h b/lv2/core/lv2_util.h
deleted file mode 100644
index 0269c70..0000000
--- a/lv2/core/lv2_util.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Copyright 2016 David Robillard <http://drobilla.net>
-
- 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 <stdarg.h>
-#include <stdbool.h>
-#include <string.h>
-
-#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 = 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/meta.ttl b/lv2/core/meta.ttl
deleted file mode 100644
index 721fba8..0000000
--- a/lv2/core/meta.ttl
+++ /dev/null
@@ -1,187 +0,0 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix meta: <http://lv2plug.in/ns/meta#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-
-<http://opensource.org/licenses/isc>
- 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.
-""" .
-
-<http://lv2plug.in/ns/lv2>
- a doap:Project ;
- lv2:symbol "lv2" ;
- rdfs:label "LV2" ;
- rdfs:comment "The LV2 Plugin Interface Project." ;
- doap:name "LV2" ;
- doap:license <http://opensource.org/licenses/isc> ;
- 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 <http://lv2plug.in/> ;
- doap:mailing-list <http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in> ;
- doap:programming-language "C" ;
- doap:repository [
- a doap:SVNRepository ;
- doap:location <http://lv2plug.in/repo>
- ] ;
- doap:developer <http://drobilla.net/drobilla#me> ,
- <http://plugin.org.uk/swh.xrdf#me> ;
- doap:helper meta:larsl ,
- meta:bmwiedemann ,
- meta:gabrbedd ,
- meta:daste ,
- meta:kfoltman ,
- meta:paniq ;
- doap:release [
- doap:revision "1.18.0" ;
- doap:created "2020-04-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.6.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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/data-access/data-access.meta.ttl b/lv2/data-access.lv2/data-access.meta.ttl
index 3184110..735bf0b 100644
--- a/lv2/data-access/data-access.meta.ttl
+++ b/lv2/data-access.lv2/data-access.meta.ttl
@@ -1,5 +1,4 @@
@prefix da: <http://lv2plug.in/ns/ext/data-access#> .
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -7,57 +6,11 @@
<http://lv2plug.in/ns/ext/data-access>
a doap:Project ;
- rdfs:seeAlso <data-access.h> ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Data Access" ;
doap:shortdesc "Provides access to plugin extension data." ;
doap:created "2008-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.6" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Merge with unified LV2 package."
- ]
- ]
- ] , [
- doap:revision "1.4" ;
- doap:created "2011-11-21" ;
- doap:file-release <http://lv2plug.in/spec/lv2-data-access-1.4.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Update packaging."
- ] , [
- rdfs:label "Improve documentation."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2011-05-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-data-access-1.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-data-access-1.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a feature, LV2_Extension_Data_Feature, which provides
@@ -74,4 +27,3 @@ 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.lv2/data-access.ttl
index 0185cd0..b75cc81 100644
--- a/lv2/data-access/data-access.ttl
+++ b/lv2/data-access.lv2/data-access.ttl
@@ -6,6 +6,4 @@
a lv2:Feature ;
rdfs:label "data access" ;
rdfs:comment "A feature that provides access to plugin extension data." ;
- rdfs:seeAlso <data-access.h> ,
- <data-access.meta.ttl> .
-
+ rdfs:seeAlso <data-access.meta.ttl> .
diff --git a/lv2/data-access/manifest.ttl b/lv2/data-access.lv2/manifest.ttl
index 9585a5e..54fcace 100644
--- a/lv2/data-access/manifest.ttl
+++ b/lv2/data-access.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <data-access.ttl> .
-
diff --git a/lv2/data-access/data-access.h b/lv2/data-access/data-access.h
deleted file mode 100644
index f57b1e2..0000000
--- a/lv2/data-access/data-access.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- LV2 Data Access Extension
- Copyright 2008-2016 David Robillard <http://drobilla.net>
-
- 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 data-access Data Access
- @ingroup lv2
-
- Access to plugin extension_data() for UIs, see
- <http://lv2plug.in/ns/ext/data-access> for details.
-
- @{
-*/
-
-#ifndef LV2_DATA_ACCESS_H
-#define LV2_DATA_ACCESS_H
-
-#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#
-
-#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/dynmanifest/dynmanifest.meta.ttl b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl
index 4e66d98..9c2919d 100644
--- a/lv2/dynmanifest/dynmanifest.meta.ttl
+++ b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix dman: <http://lv2plug.in/ns/ext/dynmanifest#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -14,47 +13,6 @@
doap:shortdesc "Support for dynamic manifest data generation." ;
doap:programming-language "C" ;
doap:developer <http://lv2plug.in/ns/meta#daste> ;
- doap:release [
- doap:revision "1.6" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Use consistent label style."
- ]
- ]
- ] , [
- doap:revision "1.4" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Merge with unified LV2 package."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2011-11-21" ;
- doap:file-release <http://lv2plug.in/spec/lv2-dynmanifest-1.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Improve documentation."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2010-04-10" ;
- doap:file-release <http://lv2plug.in/spec/lv2-dyn-manifest-1.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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
@@ -128,4 +86,3 @@ 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.lv2/dynmanifest.ttl
index 4e2e830..12be4dc 100644
--- a/lv2/dynmanifest/dynmanifest.ttl
+++ b/lv2/dynmanifest.lv2/dynmanifest.ttl
@@ -9,8 +9,7 @@
a owl:Ontology ;
rdfs:label "LV2 Dyn Manifest" ;
rdfs:comment "Support for dynamic manifest data generation." ;
- rdfs:seeAlso <dynmanifest.h> ,
- <dynmanifest.meta.ttl> .
+ rdfs:seeAlso <dynmanifest.meta.ttl> .
dman:DynManifest
a rdfs:Class ;
@@ -22,4 +21,3 @@ dman:DynManifest
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.lv2/manifest.ttl
index db27a73..2c072a3 100644
--- a/lv2/dynmanifest/manifest.ttl
+++ b/lv2/dynmanifest.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <dynmanifest.ttl> .
-
diff --git a/lv2/event/event.meta.ttl b/lv2/event.lv2/event.meta.ttl
index ecc40c7..4492d2b 100644
--- a/lv2/event/event.meta.ttl
+++ b/lv2/event.lv2/event.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix ev: <http://lv2plug.in/ns/ext/event#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@@ -13,91 +12,6 @@
doap:created "2008-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ,
<http://lv2plug.in/ns/meta#larsl> ;
- doap:release [
- doap:revision "1.12" ;
- doap:created "2014-08-08" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Minor documentation improvements."
- ]
- ]
- ] , [
- doap:revision "1.10" ;
- doap:created "2013-01-13" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-event-1.4.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Update packaging."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2011-05-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-event-1.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-event-1.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
<span class="warning">This extension is deprecated.</span> New implementations
@@ -156,7 +70,7 @@ 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 intantiate), and the subframes field is
+frames (in the sample rate passed to instantiate), and the subframes field is
1/UINT32_MAX of a frame.
"""^^lv2:Markdown .
@@ -243,4 +157,3 @@ 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.lv2/event.ttl
index de400d4..ebcbd3a 100644
--- a/lv2/event/event.ttl
+++ b/lv2/event.lv2/event.ttl
@@ -9,9 +9,8 @@
owl:deprecated true ;
rdfs:label "LV2 Event" ;
rdfs:comment "A port-based real-time generic event interface." ;
- rdfs:seeAlso <event.h> ,
- <event-helpers.h> ,
- <event.meta.ttl> .
+ rdfs:seeAlso <event.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
ev:EventPort
a rdfs:Class ;
@@ -64,7 +63,7 @@ ev:supportsTimeStamp
lv2:InputPort ;
rdfs:range rdfs:Class ;
rdfs:label "supports time stamp type" ;
- rdfs:comment "A time stamp type suported by this input port." .
+ rdfs:comment "A time stamp type supported by this input port." .
ev:generatesTimeStamp
a rdf:Property ,
@@ -83,4 +82,3 @@ ev:inheritsTimeStamp
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.lv2/manifest.ttl
index 0194d71..15b095b 100644
--- a/lv2/event/manifest.ttl
+++ b/lv2/event.lv2/manifest.ttl
@@ -4,6 +4,5 @@
<http://lv2plug.in/ns/ext/event>
a lv2:Specification ;
lv2:minorVersion 1 ;
- lv2:microVersion 12 ;
+ lv2:microVersion 14 ;
rdfs:seeAlso <event.ttl> .
-
diff --git a/lv2/event/event-helpers.h b/lv2/event/event-helpers.h
deleted file mode 100644
index ca3abec..0000000
--- a/lv2/event/event-helpers.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- Copyright 2008-2015 David Robillard <http://drobilla.net>
-
- 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 event-helpers.h Helper functions for the LV2 Event extension
- <http://lv2plug.in/ns/ext/event>.
-*/
-
-#ifndef LV2_EVENT_HELPERS_H
-#define LV2_EVENT_HELPERS_H
-
-#include "lv2/core/attributes.h"
-#include "lv2/event/event.h"
-
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-LV2_DISABLE_DEPRECATION_WARNINGS
-
-/** @file
- * Helper functions for the LV2 Event extension
- * <http://lv2plug.in/ns/ext/event>.
- *
- * 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) & (uint16_t)(~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 aa67390..0000000
--- a/lv2/event/event.h
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- Copyright 2008-2016 David Robillard <http://drobilla.net>
- Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com>
-
- 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 event Event
- @ingroup lv2
-
- Generic time-stamped events, see <http://lv2plug.in/ns/ext/event> for
- details.
-
- @{
-*/
-
-#ifndef LV2_EVENT_H
-#define LV2_EVENT_H
-
-#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
-
-#define LV2_EVENT_AUDIO_STAMP 0 ///< Special timestamp type for audio frames
-
-#include "lv2/core/attributes.h"
-
-#include <stdint.h>
-
-#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 divisble
- 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/instance-access.lv2/instance-access.meta.ttl b/lv2/instance-access.lv2/instance-access.meta.ttl
new file mode 100644
index 0000000..b9cdfc4
--- /dev/null
+++ b/lv2/instance-access.lv2/instance-access.meta.ttl
@@ -0,0 +1,28 @@
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix ia: <http://lv2plug.in/ns/ext/instance-access#> .
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+<http://lv2plug.in/ns/ext/instance-access>
+ a doap:Project ;
+ doap:license <http://opensource.org/licenses/isc> ;
+ doap:name "LV2 Instance Access" ;
+ doap:shortdesc "Provides access to the LV2_Handle of a plugin." ;
+ doap:created "2010-10-04" ;
+ doap:developer <http://drobilla.net/drobilla#me> ;
+ 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.lv2/instance-access.ttl
index 085ae37..068ef4f 100644
--- a/lv2/instance-access/instance-access.ttl
+++ b/lv2/instance-access.lv2/instance-access.ttl
@@ -6,6 +6,4 @@
a lv2:Feature ;
rdfs:label "instance access" ;
rdfs:comment "A feature that provides access to a plugin instance." ;
- rdfs:seeAlso <instance-access.h> ,
- <instance-access.meta.ttl> .
-
+ rdfs:seeAlso <instance-access.meta.ttl> .
diff --git a/lv2/instance-access/manifest.ttl b/lv2/instance-access.lv2/manifest.ttl
index e6c8810..3da863d 100644
--- a/lv2/instance-access/manifest.ttl
+++ b/lv2/instance-access.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <instance-access.ttl> .
-
diff --git a/lv2/instance-access/instance-access.h b/lv2/instance-access/instance-access.h
deleted file mode 100644
index 6a58541..0000000
--- a/lv2/instance-access/instance-access.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- LV2 Instance Access Extension
- Copyright 2008-2016 David Robillard <http://drobilla.net>
-
- 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 instance-access Instance Access
- @ingroup lv2
-
- Access to the LV2_Handle of a plugin for UIs; see
- <http://lv2plug.in/ns/ext/instance-access> for details.
-
- @{
-*/
-
-#ifndef LV2_INSTANCE_ACCESS_H
-#define LV2_INSTANCE_ACCESS_H
-
-#define LV2_INSTANCE_ACCESS_URI "http://lv2plug.in/ns/ext/instance-access" ///< http://lv2plug.in/ns/ext/instance-access
-
-#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: <http://ontologi.es/doap-changeset#> .
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ia: <http://lv2plug.in/ns/ext/instance-access#> .
-@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-
-<http://lv2plug.in/ns/ext/instance-access>
- a doap:Project ;
- doap:license <http://opensource.org/licenses/isc> ;
- doap:name "LV2 Instance Access" ;
- doap:shortdesc "Provides access to the LV2_Handle of a plugin." ;
- doap:created "2010-10-04" ;
- doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.6" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Merge with unified LV2 package."
- ]
- ]
- ] , [
- doap:revision "1.4" ;
- doap:created "2011-11-21" ;
- doap:file-release <http://lv2plug.in/spec/lv2-instance-access-1.4.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Update packaging."
- ] , [
- rdfs:label "Improve documentation."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2011-05-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-instance-access-1.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-instance-access-1.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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/log/log.meta.ttl b/lv2/log.lv2/log.meta.ttl
index 87cff43..0c74e6c 100644
--- a/lv2/log/log.meta.ttl
+++ b/lv2/log.lv2/log.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix log: <http://lv2plug.in/ns/ext/log#> .
@@ -11,47 +10,6 @@
doap:shortdesc "A feature for writing log messages." ;
doap:created "2012-01-12" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "2.4" ;
- doap:created "2016-07-30" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Add logger convenience API."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a feature, log:log, which allows plugins to print log
@@ -123,4 +81,3 @@ 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.lv2/log.ttl
index 46cba45..10f0acc 100644
--- a/lv2/log/log.ttl
+++ b/lv2/log.lv2/log.ttl
@@ -9,8 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2 Log" ;
rdfs:comment "A feature for writing log messages." ;
- rdfs:seeAlso <log.h> ,
- <log.meta.ttl> .
+ rdfs:seeAlso <log.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
log:Entry
a rdfs:Class ;
@@ -45,4 +45,3 @@ log:log
a lv2:Feature ;
rdfs:label "log" ;
rdfs:comment "Logging feature." .
-
diff --git a/lv2/log/manifest.ttl b/lv2/log.lv2/manifest.ttl
index bcaeff3..f448ffe 100644
--- a/lv2/log/manifest.ttl
+++ b/lv2/log.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 2 ;
lv2:microVersion 4 ;
rdfs:seeAlso <log.ttl> .
-
diff --git a/lv2/log/log.h b/lv2/log/log.h
deleted file mode 100644
index 8930fac..0000000
--- a/lv2/log/log.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 log Log
- @ingroup lv2
-
- Interface for plugins to log via the host; see
- <http://lv2plug.in/ns/ext/log> for details.
-
- @{
-*/
-
-#ifndef LV2_LOG_H
-#define LV2_LOG_H
-
-#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
-
-#include "lv2/urid/urid.h"
-
-#include <stdarg.h>
-
-#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/logger.h b/lv2/log/logger.h
deleted file mode 100644
index b66a8e4..0000000
--- a/lv2/log/logger.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 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 unavailabe.
-
- @{
-*/
-
-#ifndef LV2_ATOM_LOGGER_H
-#define LV2_ATOM_LOGGER_H
-
-#include "lv2/log/log.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#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/midi/manifest.ttl b/lv2/midi.lv2/manifest.ttl
index f141936..7c9efcd 100644
--- a/lv2/midi/manifest.ttl
+++ b/lv2/midi.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 10 ;
rdfs:seeAlso <midi.ttl> .
-
diff --git a/lv2/midi/midi.meta.ttl b/lv2/midi.lv2/midi.meta.ttl
index 7efdb01..8afb944 100644
--- a/lv2/midi/midi.meta.ttl
+++ b/lv2/midi.lv2/midi.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -14,85 +13,6 @@
doap:created "2006-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ,
<http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.10" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Fix incorrect range of midi:chunk."
- ]
- ]
- ] , [
- doap:revision "1.8" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-midi-1.4.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Update packaging."
- ] , [
- rdfs:label "Improve documentation."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2011-05-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-midi-1.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-midi-1.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This specification defines a data type for a MIDI message, midi:MidiEvent,
@@ -150,4 +70,3 @@ midi:statusMask
This is a status byte with the lower nibble set to zero.
"""^^lv2:Markdown .
-
diff --git a/lv2/midi/midi.ttl b/lv2/midi.lv2/midi.ttl
index 81f3495..5dfdbc7 100644
--- a/lv2/midi/midi.ttl
+++ b/lv2/midi.lv2/midi.ttl
@@ -11,8 +11,7 @@
a owl:Ontology ;
rdfs:label "LV2 MIDI" ;
rdfs:comment "A normalised definition of raw MIDI." ;
- rdfs:seeAlso <midi.h> ,
- <midi.meta.ttl> .
+ rdfs:seeAlso <midi.meta.ttl> .
midi:ActiveSense
a rdfs:Class ;
@@ -363,4 +362,3 @@ midi:velocity
rdfs:label "velocity" ;
rdfs:range midi:HexByte ;
rdfs:comment "The velocity of a note message (0 to 127)." .
-
diff --git a/lv2/midi/midi.h b/lv2/midi/midi.h
deleted file mode 100644
index 3a9583b..0000000
--- a/lv2/midi/midi.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 midi MIDI
- @ingroup lv2
-
- Definitions of standard MIDI messages, see <http://lv2plug.in/ns/ext/midi>
- for details.
-
- @{
-*/
-
-#ifndef LV2_MIDI_H
-#define LV2_MIDI_H
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#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
-
-/**
- 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] & 0xF0) == 0xF0;
- }
-}
-
-/**
- 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] & 0xF0);
- }
-
- 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/morph/manifest.ttl b/lv2/morph.lv2/manifest.ttl
index 7c85cfd..c63317b 100644
--- a/lv2/morph/manifest.ttl
+++ b/lv2/morph.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 0 ;
rdfs:seeAlso <morph.ttl> .
-
diff --git a/lv2/morph/morph.meta.ttl b/lv2/morph.lv2/morph.meta.ttl
index c247783..09945c0 100644
--- a/lv2/morph/morph.meta.ttl
+++ b/lv2/morph.lv2/morph.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -11,17 +10,6 @@
doap:shortdesc "Ports that can dynamically change type." ;
doap:created "2012-05-22" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.0" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines two port types: morph:MorphPort, which has a
@@ -87,4 +75,3 @@ 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.lv2/morph.ttl
index 303293d..cd21dd9 100644
--- a/lv2/morph/morph.ttl
+++ b/lv2/morph.lv2/morph.ttl
@@ -12,8 +12,8 @@
a owl:Ontology ;
rdfs:label "LV2 Morph" ;
rdfs:comment "Ports that can dynamically change type." ;
- rdfs:seeAlso <morph.h> ,
- <morph.meta.ttl> .
+ rdfs:seeAlso <morph.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
morph:MorphPort
a rdfs:Class ,
@@ -43,4 +43,3 @@ morph:currentType
rdfs:domain morph:MorphPort ;
rdfs:label "current type" ;
rdfs:comment "The currently active type of the port." .
-
diff --git a/lv2/morph/morph.h b/lv2/morph/morph.h
deleted file mode 100644
index 101df8e..0000000
--- a/lv2/morph/morph.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 morph Morph
- @ingroup lv2
-
- Ports that can dynamically change type, see <http://lv2plug.in/ns/ext/morph>
- for details.
-
- @{
-*/
-
-#ifndef LV2_MORPH_H
-#define LV2_MORPH_H
-
-#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
-
-#endif /* LV2_MORPH_H */
-
-/**
- @}
-*/
diff --git a/lv2/options/manifest.ttl b/lv2/options.lv2/manifest.ttl
index 18db448..c54456c 100644
--- a/lv2/options/manifest.ttl
+++ b/lv2/options.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <options.ttl> .
-
diff --git a/lv2/options/options.meta.ttl b/lv2/options.lv2/options.meta.ttl
index 838b0b9..33946f4 100644
--- a/lv2/options/options.meta.ttl
+++ b/lv2/options.lv2/options.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -12,37 +11,6 @@
doap:shortdesc "Runtime options for LV2 plugins and UIs." ;
doap:created "2012-08-20" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.4" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a facility for <q>options</q>, which are values the host
@@ -126,4 +94,3 @@ 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.lv2/options.ttl
index f8388da..7233180 100644
--- a/lv2/options/options.ttl
+++ b/lv2/options.lv2/options.ttl
@@ -9,8 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2 Options" ;
rdfs:comment "Runtime options for LV2 plugins and UIs." ;
- rdfs:seeAlso <options.h> ,
- <options.meta.ttl> .
+ rdfs:seeAlso <options.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
opts:Option
a rdfs:Class ;
@@ -41,4 +41,3 @@ opts:supportedOption
rdfs:range rdf:Property ;
rdfs:label "supported option" ;
rdfs:comment "An option supported or by the instance." .
-
diff --git a/lv2/options/options.h b/lv2/options/options.h
deleted file mode 100644
index 2ed9f8a..0000000
--- a/lv2/options/options.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 options Options
- @ingroup lv2
-
- Instantiation time options, see <http://lv2plug.in/ns/ext/options> for
- details.
-
- @{
-*/
-
-#ifndef LV2_OPTIONS_H
-#define LV2_OPTIONS_H
-
-#include "lv2/core/lv2.h"
-#include "lv2/urid/urid.h"
-
-#include <stdint.h>
-
-#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
-
-#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 = 0, /**< Completed successfully. */
- LV2_OPTIONS_ERR_UNKNOWN = 1, /**< Unknown error. */
- LV2_OPTIONS_ERR_BAD_SUBJECT = 1 << 1, /**< Invalid/unsupported subject. */
- LV2_OPTIONS_ERR_BAD_KEY = 1 << 2, /**< Invalid/unsupported key. */
- LV2_OPTIONS_ERR_BAD_VALUE = 1 << 3 /**< 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/parameters/manifest.ttl b/lv2/parameters.lv2/manifest.ttl
index 57f5d2e..4889ae5 100644
--- a/lv2/parameters/manifest.ttl
+++ b/lv2/parameters.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <parameters.ttl> .
-
diff --git a/lv2/parameters/parameters.meta.ttl b/lv2/parameters.lv2/parameters.meta.ttl
index 9d7c623..653f715 100644
--- a/lv2/parameters/parameters.meta.ttl
+++ b/lv2/parameters.lv2/parameters.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -8,41 +7,6 @@
<http://lv2plug.in/ns/ext/parameters>
a doap:Project ;
doap:name "LV2 Parameters" ;
- doap:release [
- doap:revision "1.4" ;
- doap:created "2015-04-07" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
doap:created "2009-00-00" ;
doap:shortdesc "Common parameters for audio processing." ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
@@ -72,4 +36,3 @@ and wet percentages can be calculated from the following equations:
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.lv2/parameters.ttl
index 5c3dadf..2e2c5df 100644
--- a/lv2/parameters/parameters.ttl
+++ b/lv2/parameters.lv2/parameters.ttl
@@ -11,7 +11,10 @@
a owl:Ontology ;
rdfs:label "LV2 Parameters" ;
rdfs:comment "Common parameters for audio processing." ;
- rdfs:seeAlso <parameters.meta.ttl> .
+ rdfs:seeAlso <parameters.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/ext/atom> ,
+ <http://lv2plug.in/ns/ext/port-groups> ,
+ <http://lv2plug.in/ns/lv2core> .
param:ControlGroup
a rdfs:Class ;
@@ -199,4 +202,3 @@ param:CompressorControls
] , [
lv2:designation param:ratio
] .
-
diff --git a/lv2/patch/manifest.ttl b/lv2/patch.lv2/manifest.ttl
index 25150bd..fee2375 100644
--- a/lv2/patch/manifest.ttl
+++ b/lv2/patch.lv2/manifest.ttl
@@ -4,6 +4,5 @@
<http://lv2plug.in/ns/ext/patch>
a lv2:Specification ;
lv2:minorVersion 2 ;
- lv2:microVersion 8 ;
+ lv2:microVersion 10 ;
rdfs:seeAlso <patch.ttl> .
-
diff --git a/lv2/patch/patch.meta.ttl b/lv2/patch.lv2/patch.meta.ttl
index ebe0807..edbb5dc 100644
--- a/lv2/patch/patch.meta.ttl
+++ b/lv2/patch.lv2/patch.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -12,73 +11,6 @@
doap:developer <http://drobilla.net/drobilla#me> ;
doap:name "LV2 Patch" ;
doap:shortdesc "A protocol for accessing and manipulating properties." ;
- doap:release [
- doap:revision "2.8" ;
- doap:created "2020-04-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Fix incorrect type of patch:sequenceNumber."
- ]
- ]
- ] , [
- doap:revision "2.6" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Define patch:Get with no subject to implicitly apply to reciever. 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 <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This is a vocabulary for messages that access and manipulate properties.
@@ -371,4 +303,3 @@ interfaces to present appropriate controls. For example:
patch:writable eg:title .
"""^^lv2:Markdown .
-
diff --git a/lv2/patch/patch.ttl b/lv2/patch.lv2/patch.ttl
index 7804009..59ca118 100644
--- a/lv2/patch/patch.ttl
+++ b/lv2/patch.lv2/patch.ttl
@@ -7,8 +7,7 @@
<http://lv2plug.in/ns/ext/patch>
a owl:Ontology ;
- rdfs:seeAlso <patch.h> ,
- <patch.meta.ttl> ;
+ rdfs:seeAlso <patch.meta.ttl> ;
rdfs:label "LV2 Patch" ;
rdfs:comment "A protocol for accessing and manipulating properties." .
@@ -230,15 +229,13 @@ patch:subject
rdfs:comment "The subject this message applies to." .
patch:value
- a rdf:Property ,
- owl:DatatypeProperty ;
+ a rdf:Property ;
rdfs:label "value" ;
rdfs:domain patch:Set ;
- rdfs:range rdf:Property ;
rdfs:comment "The value of a property in a patch:Set message." .
patch:wildcard
- a rdfs:Resource ;
+ a owl:Thing ;
rdfs:label "wildcard" ;
rdfs:comment "A wildcard that matches any resource." .
@@ -248,4 +245,3 @@ patch:writable
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/manifest.ttl b/lv2/port-groups.lv2/manifest.ttl
index a887cb0..7df99a8 100644
--- a/lv2/port-groups/manifest.ttl
+++ b/lv2/port-groups.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <port-groups.ttl> .
-
diff --git a/lv2/port-groups/port-groups.meta.ttl b/lv2/port-groups.lv2/port-groups.meta.ttl
index 67408ec..a76d783 100644
--- a/lv2/port-groups/port-groups.meta.ttl
+++ b/lv2/port-groups.lv2/port-groups.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -12,40 +11,7 @@
doap:shortdesc "Multi-channel groups of LV2 ports." ;
doap:created "2008-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ,
- <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.4" ;
- doap:created "2020-04-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Use consistent label style."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] .
+ <http://drobilla.net/drobilla#me> .
pg:Group
lv2:documentation """
@@ -141,4 +107,3 @@ 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.lv2/port-groups.ttl
index d248f28..9fc5c34 100644
--- a/lv2/port-groups/port-groups.ttl
+++ b/lv2/port-groups.lv2/port-groups.ttl
@@ -9,7 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2 Port Groups" ;
rdfs:comment "Multi-channel groups of LV2 ports." ;
- rdfs:seeAlso <port-groups.meta.ttl> .
+ rdfs:seeAlso <port-groups.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
pg:Group
a rdfs:Class ;
@@ -20,7 +21,7 @@ pg:Group
owl:cardinality 1 ;
rdfs:comment "A Group MUST have exactly one string lv2:symbol."
] ;
- rdfs:comment "A set of ports that are logicaly grouped together." .
+ rdfs:comment "A set of ports that are logically grouped together." .
pg:InputGroup
a rdfs:Class ;
@@ -804,4 +805,3 @@ pg:AmbisonicBH3P3Group
lv2:index 15 ;
lv2:designation pg:ACN15
] .
-
diff --git a/lv2/port-props/manifest.ttl b/lv2/port-props.lv2/manifest.ttl
index 45f598d..dd12797 100644
--- a/lv2/port-props/manifest.ttl
+++ b/lv2/port-props.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 2 ;
rdfs:seeAlso <port-props.ttl> .
-
diff --git a/lv2/port-props/port-props.meta.ttl b/lv2/port-props.lv2/port-props.meta.ttl
index 7077e4b..e97de45 100644
--- a/lv2/port-props/port-props.meta.ttl
+++ b/lv2/port-props.lv2/port-props.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -13,27 +12,6 @@
doap:shortdesc "Various properties for LV2 plugin ports." ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:developer <http://lv2plug.in/ns/meta#kfoltman> ;
- doap:release [
- doap:revision "1.2" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Use consistent label style."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This vocabulary defines various properties for plugin ports, which can be used
@@ -199,4 +177,3 @@ where:
* `lower` and <code>upper</code> are the bounds.
"""^^lv2:Markdown .
-
diff --git a/lv2/port-props/port-props.ttl b/lv2/port-props.lv2/port-props.ttl
index 1ddeed0..063996a 100644
--- a/lv2/port-props/port-props.ttl
+++ b/lv2/port-props.lv2/port-props.ttl
@@ -9,7 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2 Port Properties" ;
rdfs:comment "Various properties for LV2 plugin ports." ;
- rdfs:seeAlso <port-props.meta.ttl> .
+ rdfs:seeAlso <port-props.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
pprops:trigger
a lv2:PortProperty ;
@@ -76,4 +77,3 @@ pprops:rangeSteps
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/manifest.ttl b/lv2/presets.lv2/manifest.ttl
index b9cacf5..1508770 100644
--- a/lv2/presets/manifest.ttl
+++ b/lv2/presets.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 2 ;
lv2:microVersion 8 ;
rdfs:seeAlso <presets.ttl> .
-
diff --git a/lv2/presets/presets.meta.ttl b/lv2/presets.lv2/presets.meta.ttl
index 8ff25c1..d3e1ef9 100644
--- a/lv2/presets/presets.meta.ttl
+++ b/lv2/presets.lv2/presets.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -12,55 +11,6 @@
doap:shortdesc "Presets for LV2 plugins." ;
doap:created "2009-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "2.8" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-presets-2.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Update packaging."
- ] , [
- rdfs:label "Improve documentation."
- ]
- ]
- ] , [
- doap:revision "2.0" ;
- doap:created "2010-10-04" ;
- doap:file-release <http://lv2plug.in/spec/lv2-presets-2.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This is a vocabulary for LV2 plugin presets, that is, named sets of control
@@ -129,4 +79,3 @@ 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.lv2/presets.ttl
index c1caf43..8de997b 100644
--- a/lv2/presets/presets.ttl
+++ b/lv2/presets.lv2/presets.ttl
@@ -9,7 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2 Presets" ;
rdfs:comment "Presets for LV2 plugins." ;
- rdfs:seeAlso <presets.meta.ttl> .
+ rdfs:seeAlso <presets.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
pset:Bank
a rdfs:Class ;
@@ -17,7 +18,7 @@ pset:Bank
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty rdfs:label ;
- owl:someValuesFrom xsd:string ;
+ owl:minCardinality 1 ;
rdfs:comment "A Bank MUST have at least one string rdfs:label."
] ;
rdfs:comment "A bank of presets." .
@@ -30,7 +31,7 @@ pset:Preset
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty rdfs:label ;
- owl:someValuesFrom xsd:string ;
+ owl:minCardinality 1 ;
rdfs:comment "A Preset MUST have at least one string rdfs:label."
] .
@@ -57,4 +58,3 @@ pset:preset
rdfs:range pset:Preset ;
rdfs:label "preset" ;
rdfs:comment "The preset currently applied to a plugin instance." .
-
diff --git a/lv2/presets/presets.h b/lv2/presets/presets.h
deleted file mode 100644
index 8264a9c..0000000
--- a/lv2/presets/presets.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 presets Presets
- @ingroup lv2
-
- Presets for plugins, see <http://lv2plug.in/ns/ext/presets> for details.
-
- @{
-*/
-
-#ifndef LV2_PRESETS_H
-#define LV2_PRESETS_H
-
-#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
-
-#endif /* LV2_PRESETS_H */
-
-/**
- @}
-*/
diff --git a/lv2/resize-port/manifest.ttl b/lv2/resize-port.lv2/manifest.ttl
index 9fae8b8..fb8da8a 100644
--- a/lv2/resize-port/manifest.ttl
+++ b/lv2/resize-port.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 0 ;
rdfs:seeAlso <resize-port.ttl> .
-
diff --git a/lv2/resize-port/resize-port.meta.ttl b/lv2/resize-port.lv2/resize-port.meta.ttl
index d44620c..ffd1b9b 100644
--- a/lv2/resize-port/resize-port.meta.ttl
+++ b/lv2/resize-port.lv2/resize-port.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -11,17 +10,6 @@
doap:shortdesc "Dynamically sized LV2 port buffers." ;
doap:created "2007-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a feature, rsz:resize, which allows plugins to
@@ -71,4 +59,3 @@ 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.lv2/resize-port.ttl
index 29cd18b..ffdeda2 100644
--- a/lv2/resize-port/resize-port.ttl
+++ b/lv2/resize-port.lv2/resize-port.ttl
@@ -9,8 +9,8 @@
a owl:Ontology ;
rdfs:label "LV2 Resize Port" ;
rdfs:comment "Dynamically sized LV2 port buffers." ;
- rdfs:seeAlso <resize-port.h> ,
- <resize-port.meta.ttl> .
+ rdfs:seeAlso <resize-port.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
rsz:resize
a lv2:Feature ;
@@ -33,4 +33,3 @@ rsz:minimumSize
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/resize-port.h b/lv2/resize-port/resize-port.h
deleted file mode 100644
index a60626d..0000000
--- a/lv2/resize-port/resize-port.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright 2007-2016 David Robillard <http://drobilla.net>
-
- 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 resize-port Resize Port
- @ingroup lv2
-
- Dynamically sized LV2 port buffers.
-
- @{
-*/
-
-#ifndef LV2_RESIZE_PORT_H
-#define LV2_RESIZE_PORT_H
-
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-
-#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
-
-#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/state/manifest.ttl b/lv2/state.lv2/manifest.ttl
index 089baf2..6b17b52 100644
--- a/lv2/state/manifest.ttl
+++ b/lv2/state.lv2/manifest.ttl
@@ -4,6 +4,5 @@
<http://lv2plug.in/ns/ext/state>
a lv2:Specification ;
lv2:minorVersion 2 ;
- lv2:microVersion 7 ;
+ lv2:microVersion 10 ;
rdfs:seeAlso <state.ttl> .
-
diff --git a/lv2/state/state.meta.ttl b/lv2/state.lv2/state.meta.ttl
index 59c9092..1cd0544 100644
--- a/lv2/state/state.meta.ttl
+++ b/lv2/state.lv2/state.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -14,77 +13,6 @@
doap:developer <http://lv2plug.in/ns/meta#paniq> ,
<http://drobilla.net/drobilla#me> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "2.7" ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Add state:freePath feature."
- ]
- ]
- ] , [
- doap:revision "2.4" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Add state:StateChanged for notification events."
- ]
- ]
- ] , [
- doap:revision "2.2" ;
- doap:created "2016-07-31" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Use consistent label style."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a simple mechanism that allows hosts to save and restore
@@ -457,9 +385,8 @@ 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 explicity makes
+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.lv2/state.ttl
index 19ccaa2..9a5ddcb 100644
--- a/lv2/state/state.ttl
+++ b/lv2/state.lv2/state.ttl
@@ -8,8 +8,8 @@
a owl:Ontology ;
rdfs:label "LV2 State" ;
rdfs:comment "An interface for LV2 plugins to save and restore state." ;
- rdfs:seeAlso <state.h> ,
- <state.meta.ttl> .
+ rdfs:seeAlso <state.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
state:interface
a lv2:ExtensionData ;
@@ -57,4 +57,3 @@ 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/state.h b/lv2/state/state.h
deleted file mode 100644
index 2823989..0000000
--- a/lv2/state/state.h
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- Copyright 2010-2016 David Robillard <http://drobilla.net>
- Copyright 2010 Leonard Ritter <paniq@paniq.org>
-
- 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 state State
- @ingroup lv2
-
- An interface for LV2 plugins to save and restore state, see
- <http://lv2plug.in/ns/ext/state> for details.
-
- @{
-*/
-
-#ifndef LV2_STATE_H
-#define LV2_STATE_H
-
-#include "lv2/core/lv2.h"
-
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-
-#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
-
-#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 trasmit 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 = 1,
-
- /**
- 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 = 1 << 1,
-
- /**
- 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 = 1 << 2
-} 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/time/manifest.ttl b/lv2/time.lv2/manifest.ttl
index d80aa75..ece8679 100644
--- a/lv2/time/manifest.ttl
+++ b/lv2/time.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <time.ttl> .
-
diff --git a/lv2/time/time.meta.ttl b/lv2/time.lv2/time.meta.ttl
index 2b99cb7..723a61b 100644
--- a/lv2/time/time.meta.ttl
+++ b/lv2/time.lv2/time.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -11,47 +10,6 @@
doap:shortdesc "A vocabulary for describing musical time." ;
doap:created "2011-10-05" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.6" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Clarify time:beat origin."
- ]
- ]
- ] , [
- doap:revision "1.4" ;
- doap:created "2016-07-31" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Define LV2_TIME_PREFIX."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Use consistent label style."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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
@@ -109,4 +67,3 @@ 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.lv2/time.ttl
index a4085c6..f9c65ee 100644
--- a/lv2/time/time.ttl
+++ b/lv2/time.lv2/time.ttl
@@ -8,8 +8,7 @@
a owl:Ontology ;
rdfs:label "LV2 Time" ;
rdfs:comment "A vocabulary for describing musical time." ;
- rdfs:seeAlso <time.h> ,
- <time.meta.ttl> .
+ rdfs:seeAlso <time.meta.ttl> .
time:Time
a rdfs:Class ,
@@ -119,4 +118,3 @@ time:speed
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/manifest.ttl b/lv2/ui.lv2/manifest.ttl
index 9f259ad..4f5ed48 100644
--- a/lv2/ui/manifest.ttl
+++ b/lv2/ui.lv2/manifest.ttl
@@ -4,6 +4,5 @@
<http://lv2plug.in/ns/extensions/ui>
a lv2:Specification ;
lv2:minorVersion 2 ;
- lv2:microVersion 22 ;
+ lv2:microVersion 24 ;
rdfs:seeAlso <ui.ttl> .
-
diff --git a/lv2/ui/ui.meta.ttl b/lv2/ui.lv2/ui.meta.ttl
index cb92a86..ede80ae 100644
--- a/lv2/ui/ui.meta.ttl
+++ b/lv2/ui.lv2/ui.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -14,153 +13,6 @@
doap:created "2006-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "2.22" ;
- doap:created "2020-04-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.6.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-ui-2.4.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-ui-2.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-ui-2.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension makes it possible to create user interfaces for LV2 plugins.
@@ -223,7 +75,7 @@ toolkits, the one the UI main loop runs in). There is no requirement that a
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 occcurs via ports.
+it all occurs via ports.
"""^^lv2:Markdown .
@@ -624,4 +476,3 @@ Write Effect
: None.
"""^^lv2:Markdown .
-
diff --git a/lv2/ui/ui.ttl b/lv2/ui.lv2/ui.ttl
index 61f8bca..a59b069 100644
--- a/lv2/ui/ui.ttl
+++ b/lv2/ui.lv2/ui.ttl
@@ -10,9 +10,9 @@
a owl:Ontology ;
rdfs:label "LV2 UI" ;
rdfs:comment "User interfaces for LV2 plugins." ;
- owl:imports <http://lv2plug.in/ns/lv2core> ;
- rdfs:seeAlso <ui.h> ,
- <ui.meta.ttl> .
+ rdfs:seeAlso <ui.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> ,
+ <http://lv2plug.in/ns/ext/options> .
ui:UI
a rdfs:Class ,
@@ -174,8 +174,9 @@ ui:notifyType
ui:resize
a lv2:Feature ,
lv2:ExtensionData ;
+ owl:deprecated "true"^^xsd:boolean ;
rdfs:label "resize" ;
- rdfs:comment """A feature that control of, and notifications about, a UI's size.""" .
+ rdfs:comment """A feature that provides control of, and notifications about, a UI's size.""" .
ui:portMap
a lv2:Feature ;
@@ -245,4 +246,3 @@ 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/ui.h b/lv2/ui/ui.h
deleted file mode 100644
index 42e0f51..0000000
--- a/lv2/ui/ui.h
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- LV2 UI Extension
- Copyright 2009-2016 David Robillard <d@drobilla.net>
- Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
-
- 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 ui User Interfaces
- @ingroup lv2
-
- User interfaces of any type for plugins,
- <http://lv2plug.in/ns/extensions/ui> for details.
-
- @{
-*/
-
-#ifndef LV2_UI_H
-#define LV2_UI_H
-
-#include "lv2/core/lv2.h"
-#include "lv2/urid/urid.h"
-
-#include <stdbool.h>
-#include <stdint.h>
-
-#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
-
-/**
- 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 dynamicaly 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 choses 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 fulfill 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/units/manifest.ttl b/lv2/units.lv2/manifest.ttl
index c6c9286..8b84346 100644
--- a/lv2/units/manifest.ttl
+++ b/lv2/units.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 5 ;
lv2:microVersion 12 ;
rdfs:seeAlso <units.ttl> .
-
diff --git a/lv2/units.lv2/units.meta.ttl b/lv2/units.lv2/units.meta.ttl
new file mode 100644
index 0000000..0e03b35
--- /dev/null
+++ b/lv2/units.lv2/units.meta.ttl
@@ -0,0 +1,57 @@
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix units: <http://lv2plug.in/ns/extensions/units#> .
+
+<http://lv2plug.in/ns/extensions/units>
+ a doap:Project ;
+ doap:name "LV2 Units" ;
+ doap:shortdesc "Units for LV2 values." ;
+ doap:created "2007-02-06" ;
+ doap:homepage <http://lv2plug.in/ns/extensions/units> ;
+ doap:license <http://opensource.org/licenses/isc> ;
+ doap:developer <http://plugin.org.uk/swh.xrdf#me> ;
+ doap:maintainer <http://drobilla.net/drobilla#me> ;
+ 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: <http://lv2plug.in/ns/extensions/units#> .
+ @prefix eg: <http://example.org/> .
+
+ 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.lv2/units.ttl
index 959c063..0f94cc3 100644
--- a/lv2/units/units.ttl
+++ b/lv2/units.lv2/units.ttl
@@ -8,8 +8,7 @@
a owl:Ontology ;
rdfs:label "LV2 Units" ;
rdfs:comment "Units for LV2 values." ;
- rdfs:seeAlso <units.h> ,
- <units.meta.ttl> .
+ rdfs:seeAlso <units.meta.ttl> .
units:Unit
a rdfs:Class ,
@@ -376,4 +375,3 @@ units:midiNote
rdfs:comment "A MIDI note number." ;
units:render "MIDI note %d" ;
units:symbol "note" .
-
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: <http://ontologi.es/doap-changeset#> .
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix units: <http://lv2plug.in/ns/extensions/units#> .
-
-<http://lv2plug.in/ns/extensions/units>
- a doap:Project ;
- doap:name "LV2 Units" ;
- doap:shortdesc "Units for LV2 values." ;
- doap:created "2007-02-06" ;
- doap:homepage <http://lv2plug.in/ns/extensions/units> ;
- doap:license <http://opensource.org/licenses/isc> ;
- doap:release [
- doap:revision "5.12" ;
- doap:created "2019-02-03" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-units-5.4.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-units-5.2.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-units-5.0.tar.gz> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://plugin.org.uk/swh.xrdf#me> ;
- doap:maintainer <http://drobilla.net/drobilla#me> ;
- 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: <http://lv2plug.in/ns/extensions/units#> .
- @prefix eg: <http://example.org/> .
-
- 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/uri-map/manifest.ttl b/lv2/uri-map.lv2/manifest.ttl
index a64e4fb..3824435 100644
--- a/lv2/uri-map/manifest.ttl
+++ b/lv2/uri-map.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <uri-map.ttl> .
-
diff --git a/lv2/uri-map/uri-map.meta.ttl b/lv2/uri-map.lv2/uri-map.meta.ttl
index acd1c26..9615f31 100644
--- a/lv2/uri-map/uri-map.meta.ttl
+++ b/lv2/uri-map.lv2/uri-map.meta.ttl
@@ -1,5 +1,4 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@@ -13,48 +12,6 @@
doap:license <http://opensource.org/licenses/isc> ;
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 <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Merge with unified LV2 package."
- ]
- ]
- ] , [
- doap:revision "1.4" ;
- doap:created "2011-11-21" ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://drobilla.net/drobilla#me> ;
- 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 <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
<span class="warning">This extension is deprecated.</span> New implementations
@@ -69,4 +26,3 @@ 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.lv2/uri-map.ttl
index bfb0d0b..8a7a043 100644
--- a/lv2/uri-map/uri-map.ttl
+++ b/lv2/uri-map.lv2/uri-map.ttl
@@ -9,6 +9,4 @@
owl:deprecated true ;
rdfs:label "LV2 URI Map" ;
rdfs:comment "A feature for mapping URIs to integers." ;
- rdfs:seeAlso <uri-map.h> ,
- <uri-map.meta.ttl> .
-
+ rdfs:seeAlso <uri-map.meta.ttl> .
diff --git a/lv2/uri-map/uri-map.h b/lv2/uri-map/uri-map.h
deleted file mode 100644
index 651c3a8..0000000
--- a/lv2/uri-map/uri-map.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright 2008-2016 David Robillard <http://drobilla.net>
-
- 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 uri-map URI Map
- @ingroup lv2
-
- C API for the LV2 URI Map extension <http://lv2plug.in/ns/ext/uri-map>.
-
- 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).
-
- @{
-*/
-
-#ifndef LV2_URI_MAP_H
-#define LV2_URI_MAP_H
-
-#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#
-
-#include "lv2/core/attributes.h"
-
-#include <stdint.h>
-
-#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/urid/manifest.ttl b/lv2/urid.lv2/manifest.ttl
index 772e2b6..7dc919f 100644
--- a/lv2/urid/manifest.ttl
+++ b/lv2/urid.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <urid.ttl> .
-
diff --git a/lv2/urid/urid.meta.ttl b/lv2/urid.lv2/urid.meta.ttl
index b2a74fa..cbc5153 100644
--- a/lv2/urid/urid.meta.ttl
+++ b/lv2/urid.lv2/urid.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -13,39 +12,6 @@
doap:created "2011-07-22" ;
doap:developer <http://lv2plug.in/ns/meta#gabrbedd> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.4" ;
- doap:created "2012-10-14" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Fix typo in urid:unmap documentation."
- ]
- ]
- ] , [
- doap:revision "1.2" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- 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 <http://lv2plug.in/spec/lv2-urid-1.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension defines a simple mechanism for plugins to map URIs to and from
@@ -81,4 +47,3 @@ 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.lv2/urid.ttl
index 2c44b56..e875fba 100644
--- a/lv2/urid/urid.ttl
+++ b/lv2/urid.lv2/urid.ttl
@@ -7,8 +7,8 @@
a owl:Ontology ;
rdfs:label "LV2 URID" ;
rdfs:comment "Features for mapping URIs to and from integers." ;
- rdfs:seeAlso <urid.h> ,
- <urid.meta.ttl> .
+ rdfs:seeAlso <urid.meta.ttl> ;
+ owl:imports <http://lv2plug.in/ns/lv2core> .
urid:map
a lv2:Feature ;
@@ -19,4 +19,3 @@ urid:unmap
a lv2:Feature ;
rdfs:label "unmap" ;
rdfs:comment "A feature to unmap URIDs back to strings." .
-
diff --git a/lv2/urid/urid.h b/lv2/urid/urid.h
deleted file mode 100644
index a68bc12..0000000
--- a/lv2/urid/urid.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- Copyright 2008-2016 David Robillard <http://drobilla.net>
- Copyright 2011 Gabriel M. Beddingfield <gabrbedd@gmail.com>
-
- 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 urid URID
- @ingroup lv2
-
- Features for mapping URIs to and from integers, see
- <http://lv2plug.in/ns/ext/urid> for details.
-
- @{
-*/
-
-#ifndef LV2_URID_H
-#define LV2_URID_H
-
-#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
-
-#include <stdint.h>
-
-#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/worker/manifest.ttl b/lv2/worker.lv2/manifest.ttl
index 692720d..cf4a83f 100644
--- a/lv2/worker/manifest.ttl
+++ b/lv2/worker.lv2/manifest.ttl
@@ -6,4 +6,3 @@
lv2:minorVersion 1 ;
lv2:microVersion 2 ;
rdfs:seeAlso <worker.ttl> .
-
diff --git a/lv2/worker/worker.meta.ttl b/lv2/worker.lv2/worker.meta.ttl
index 2fc51bc..b9d651a 100644
--- a/lv2/worker/worker.meta.ttl
+++ b/lv2/worker.lv2/worker.meta.ttl
@@ -1,4 +1,3 @@
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@@ -11,27 +10,6 @@
doap:shortdesc "Support for doing non-realtime work in plugins." ;
doap:created "2012-03-22" ;
doap:developer <http://drobilla.net/drobilla#me> ;
- doap:release [
- doap:revision "1.2" ;
- doap:created "2020-04-26" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.18.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Improve documentation."
- ]
- ]
- ] , [
- doap:revision "1.0" ;
- doap:created "2012-04-17" ;
- doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
- dcs:blame <http://drobilla.net/drobilla#me> ;
- dcs:changeset [
- dcs:item [
- rdfs:label "Initial release."
- ]
- ]
- ] ;
lv2:documentation """
This extension allows plugins to schedule work that must be performed in
@@ -79,4 +57,3 @@ 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.lv2/worker.ttl
index cb8a81a..be07105 100644
--- a/lv2/worker/worker.ttl
+++ b/lv2/worker.lv2/worker.ttl
@@ -10,8 +10,7 @@
rdfs:label "LV2 Worker" ;
rdfs:comment "Support for doing non-realtime work in plugins." ;
owl:imports <http://lv2plug.in/ns/lv2core> ;
- rdfs:seeAlso <worker.h> ,
- <worker.meta.ttl> .
+ rdfs:seeAlso <worker.meta.ttl> .
work:interface
a lv2:ExtensionData ;
@@ -22,4 +21,3 @@ work:schedule
a lv2:Feature ;
rdfs:label "work schedule" ;
rdfs:comment "The work scheduling feature provided by a host." .
-
diff --git a/lv2/worker/worker.h b/lv2/worker/worker.h
deleted file mode 100644
index 69cc1d3..0000000
--- a/lv2/worker/worker.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- Copyright 2012-2016 David Robillard <http://drobilla.net>
-
- 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 worker Worker
- @ingroup lv2
-
- Support for non-realtime plugin operations, see
- <http://lv2plug.in/ns/ext/worker> for details.
-
- @{
-*/
-
-#ifndef LV2_WORKER_H
-#define LV2_WORKER_H
-
-#include "lv2/core/lv2.h"
-
-#include <stdint.h>
-
-#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
-
-#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/lv2specgen/DTD/xhtml-rdfa-1.dtd b/lv2specgen/DTD/xhtml-rdfa-1.dtd
index 26ed117..53890bb 100644
--- a/lv2specgen/DTD/xhtml-rdfa-1.dtd
+++ b/lv2specgen/DTD/xhtml-rdfa-1.dtd
@@ -437,36 +437,17 @@
<!-- end of XHTML-RDFa DTD ................................................ -->
<!-- ....................................................................... -->
-<!-- Add xmlns attributes to validate lv2specgen output -->
-<!-- This is a pretty dirty hack, but avoids needing to write a bunch of code to
- mangle DTDs to appease validation -->
+<!-- Hack for lv2specgen: declare prefixes for the external vocabularies used
+ in LV2 (most of which are generally common for RDF), so RDFa in spec pages
+ can use prefixed names. This glaring separation-of-concerns violation
+ is... not nice, but neither is diving into the horrors of custom XML DTD
+ validation, so here we are.
+-->
-<!ATTLIST html xmlns:dc CDATA #IMPLIED>
-<!ATTLIST html xmlns:dct CDATA #IMPLIED>
+<!ATTLIST html xmlns:dcterms CDATA #IMPLIED>
+<!ATTLIST html xmlns:doap CDATA #IMPLIED>
+<!ATTLIST html xmlns:foaf CDATA #IMPLIED>
+<!ATTLIST html xmlns:owl CDATA #IMPLIED>
<!ATTLIST html xmlns:rdf CDATA #IMPLIED>
<!ATTLIST html xmlns:rdfs CDATA #IMPLIED>
-
-<!ATTLIST html xmlns:atom CDATA #IMPLIED>
-<!ATTLIST html xmlns:bufsz CDATA #IMPLIED>
-<!ATTLIST html xmlns:da CDATA #IMPLIED>
-<!ATTLIST html xmlns:dman CDATA #IMPLIED>
-<!ATTLIST html xmlns:ev CDATA #IMPLIED>
-<!ATTLIST html xmlns:ia CDATA #IMPLIED>
-<!ATTLIST html xmlns:log CDATA #IMPLIED>
-<!ATTLIST html xmlns:lv2 CDATA #IMPLIED>
-<!ATTLIST html xmlns:midi CDATA #IMPLIED>
-<!ATTLIST html xmlns:morph CDATA #IMPLIED>
-<!ATTLIST html xmlns:opts CDATA #IMPLIED>
-<!ATTLIST html xmlns:param CDATA #IMPLIED>
-<!ATTLIST html xmlns:patch CDATA #IMPLIED>
-<!ATTLIST html xmlns:pg CDATA #IMPLIED>
-<!ATTLIST html xmlns:pprops CDATA #IMPLIED>
-<!ATTLIST html xmlns:pset CDATA #IMPLIED>
-<!ATTLIST html xmlns:rsz CDATA #IMPLIED>
-<!ATTLIST html xmlns:state CDATA #IMPLIED>
-<!ATTLIST html xmlns:time CDATA #IMPLIED>
-<!ATTLIST html xmlns:ui CDATA #IMPLIED>
-<!ATTLIST html xmlns:umap CDATA #IMPLIED>
-<!ATTLIST html xmlns:units CDATA #IMPLIED>
-<!ATTLIST html xmlns:urid CDATA #IMPLIED>
-<!ATTLIST html xmlns:work CDATA #IMPLIED>
+<!ATTLIST html xmlns:xsd CDATA #IMPLIED>
diff --git a/lv2specgen/lv2docgen.py b/lv2specgen/lv2docgen.py
index 23a239d..9b1685a 100755
--- a/lv2specgen/lv2docgen.py
+++ b/lv2specgen/lv2docgen.py
@@ -1,82 +1,80 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# lv2docgen, a documentation generator for LV2 plugins
+#!/usr/bin/env python3
+
# Copyright 2012 David Robillard <d@drobilla.net>
-#
-# 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.
+# SPDX-License-Identifier: ISC
import errno
import os
import sys
-__date__ = '2012-03-27'
-__version__ = '0.0.0'
-__authors__ = 'David Robillard'
-__license__ = 'ISC License <http://www.opensource.org/licenses/isc>'
-__contact__ = 'devel@lists.lv2plug.in'
+__date__ = "2012-03-27"
+__version__ = "0.0.0"
+__authors__ = "David Robillard"
+__license__ = "ISC License <http://www.opensource.org/licenses/isc>"
+__contact__ = "devel@lists.lv2plug.in"
try:
import rdflib
except ImportError:
- sys.exit('Error importing rdflib')
+ sys.exit("Error importing rdflib")
+
+doap = rdflib.Namespace("http://usefulinc.com/ns/doap#")
+lv2 = rdflib.Namespace("http://lv2plug.in/ns/lv2core#")
+rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
+rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#")
-doap = rdflib.Namespace('http://usefulinc.com/ns/doap#')
-lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#')
-rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
-rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#')
def uri_to_path(uri):
- path = uri[uri.find(':'):]
+ first_colon = uri.find(":")
+ path = uri[first_colon:]
while not path[0].isalpha():
path = path[1:]
return path
+
def get_doc(model, subject):
comment = model.value(subject, rdfs.comment, None)
if comment:
return '<p class="content">%s</p>' % comment
- return ''
+ return ""
+
def port_doc(model, port):
name = model.value(port, lv2.name, None)
- comment = model.value(port, rdfs.comment, None)
html = '<div class="specterm"><h3>%s</h3>' % name
html += get_doc(model, port)
- html += '</div>'
+ html += "</div>"
return html
+
def plugin_doc(model, plugin, style_uri):
- uri = str(plugin)
+ uri = str(plugin)
name = model.value(plugin, doap.name, None)
- html = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
+ dtd = "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"
+ html = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" %s>
<html about="%s"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:lv2="http://lv2plug.in/ns/lv2core#"
- xml:lang="en">''' % uri
+ xml:lang="en">""" % (
+ uri,
+ dtd,
+ )
- html += '''<head>
+ html += """<head>
<title>%s</title>
<meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" />
<meta name="generator" content="lv2docgen" />
<link href="%s" rel="stylesheet" type="text/css" />
</head>
- <body>''' % (name, style_uri)
+ <body>""" % (
+ name,
+ style_uri,
+ )
- html += '''
+ html += """
<!-- HEADER -->
<div id="header">
<h1 id="title">%s</h1>
@@ -85,44 +83,53 @@ def plugin_doc(model, plugin, style_uri):
<tr><th>Version</th><td>%s</td></tr>
</table>
</div>
-''' % (name, uri, uri, '0.0.0')
+""" % (
+ name,
+ uri,
+ uri,
+ "0.0.0",
+ )
html += get_doc(model, plugin)
- ports_html = ''
+ ports_html = ""
for p in model.triples([plugin, lv2.port, None]):
ports_html += port_doc(model, p[2])
if len(ports_html):
- html += '''
+ html += (
+ """
<h2 class="sec">Ports</h2>
<div class="content">
%s
- </div>''' % ports_html
+ </div>"""
+ % ports_html
+ )
- html += ' </body></html>'
+ html += " </body></html>"
return html
-if __name__ == '__main__':
- 'LV2 plugin documentation generator'
+
+if __name__ == "__main__":
+ "LV2 plugin documentation generator"
if len(sys.argv) < 2:
- print('Usage: %s OUTDIR FILE...' % sys.argv[0])
+ print("Usage: %s OUTDIR FILE..." % sys.argv[0])
sys.exit(1)
outdir = sys.argv[1]
files = sys.argv[2:]
model = rdflib.ConjunctiveGraph()
for f in files:
- model.parse(f, format='n3')
+ model.parse(f, format="n3")
- style_uri = os.path.abspath(os.path.join(outdir, 'style.css'))
+ style_uri = os.path.abspath(os.path.join(outdir, "style.css"))
for p in model.triples([None, rdf.type, lv2.Plugin]):
plugin = p[0]
html = plugin_doc(model, plugin, style_uri)
path = uri_to_path(plugin)
- outpath = os.path.join(outdir, path + '.html')
+ outpath = os.path.join(outdir, path + ".html")
try:
os.makedirs(os.path.dirname(outpath))
except OSError:
@@ -132,7 +139,6 @@ if __name__ == '__main__':
else:
raise
- print('Writing <%s> documentation to %s' % (plugin, outpath))
- out = open(outpath, 'w')
- out.write(html)
- out.close()
+ print("Writing <%s> documentation to %s" % (plugin, outpath))
+ with open(outpath, "w") as out:
+ out.write(html)
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index e3948f1..d6e86f8 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -1,34 +1,13 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
#
-# lv2specgen, a documentation generator for LV2 specifications.
-# Copyright (c) 2009-2014 David Robillard <d@drobilla.net>
+# Copyright 2009-2022 David Robillard <d@drobilla.net>
+# Copyright 2003-2008 Christopher Schmidt <crschmidt@crschmidt.net>
+# Copyright 2005-2008 Uldis Bojars <uldis.bojars@deri.org>
+# Copyright 2007-2008 Sergio Fernández <sergio.fernandez@fundacionctic.org>
+# SPDX-License-Identifier: MIT
#
# Based on SpecGen:
# <http://forge.morfeo-project.org/wiki_en/index.php/SpecGen>
-# Copyright (c) 2003-2008 Christopher Schmidt <crschmidt@crschmidt.net>
-# Copyright (c) 2005-2008 Uldis Bojars <uldis.bojars@deri.org>
-# Copyright (c) 2007-2008 Sergio Fernández <sergio.fernandez@fundacionctic.org>
-#
-# This software is licensed under the terms of the MIT License.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
import datetime
import markdown
@@ -86,20 +65,13 @@ spec_pre = None
spec_bundle = None
specgendir = None
ns_list = {
+ "http://purl.org/dc/terms/": "dcterms",
+ "http://usefulinc.com/ns/doap#": "doap",
+ "http://xmlns.com/foaf/0.1/": "foaf",
+ "http://www.w3.org/2002/07/owl#": "owl",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
"http://www.w3.org/2000/01/rdf-schema#": "rdfs",
- "http://www.w3.org/2002/07/owl#": "owl",
"http://www.w3.org/2001/XMLSchema#": "xsd",
- "http://rdfs.org/sioc/ns#": "sioc",
- "http://xmlns.com/foaf/0.1/": "foaf",
- "http://purl.org/dc/elements/1.1/": "dc",
- "http://purl.org/dc/terms/": "dct",
- "http://purl.org/rss/1.0/modules/content/": "content",
- "http://www.w3.org/2003/01/geo/wgs84_pos#": "geo",
- "http://www.w3.org/2004/02/skos/core#": "skos",
- "http://lv2plug.in/ns/lv2core#": "lv2",
- "http://usefulinc.com/ns/doap#": "doap",
- "http://ontologi.es/doap-changeset#": "dcs",
}
rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
@@ -107,7 +79,6 @@ rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#")
owl = rdflib.Namespace("http://www.w3.org/2002/07/owl#")
lv2 = rdflib.Namespace("http://lv2plug.in/ns/lv2core#")
doap = rdflib.Namespace("http://usefulinc.com/ns/doap#")
-dcs = rdflib.Namespace("http://ontologi.es/doap-changeset#")
foaf = rdflib.Namespace("http://xmlns.com/foaf/0.1/")
@@ -140,21 +111,21 @@ def getLiteralString(s):
def isResource(n):
- return type(n) == rdflib.URIRef
+ return isinstance(n, rdflib.URIRef)
def isBlank(n):
- return type(n) == rdflib.BNode
+ return isinstance(n, rdflib.BNode)
def isLiteral(n):
- return type(n) == rdflib.Literal
+ return isinstance(n, rdflib.Literal)
def niceName(uri):
global spec_bundle
if uri.startswith(spec_ns_str):
- return uri[len(spec_ns_str) :]
+ return uri.replace(spec_ns_str, "")
elif uri == str(rdfs.seeAlso):
return "See also"
@@ -166,8 +137,6 @@ def niceName(uri):
if pref in ns_list:
return ns_list.get(pref, pref) + ":" + rez.group(2)
else:
- print("warning: prefix %s not in ns list:" % pref)
- print(ns_list)
return uri
@@ -239,9 +208,9 @@ def linkifyVocabIdentifiers(m, string, classlist, proplist, instalist):
def prettifyHtml(m, markup, subject, classlist, proplist, instalist):
# Syntax highlight all C code
if have_pygments:
- code_rgx = re.compile('<pre class="c-code">(.*?)</pre>', re.DOTALL)
+ code_re = re.compile('<pre class="c-code">(.*?)</pre>', re.DOTALL)
while True:
- code = code_rgx.search(markup)
+ code = code_re.search(markup)
if not code:
break
match_str = xml.sax.saxutils.unescape(code.group(1))
@@ -250,15 +219,13 @@ def prettifyHtml(m, markup, subject, classlist, proplist, instalist):
pygments.lexers.CLexer(),
pygments.formatters.HtmlFormatter(),
)
- markup = code_rgx.sub(code_str, markup, 1)
+ markup = code_re.sub(code_str, markup, 1)
# Syntax highlight all Turtle code
if have_pygments:
- code_rgx = re.compile(
- '<pre class="turtle-code">(.*?)</pre>', re.DOTALL
- )
+ code_re = re.compile('<pre class="turtle-code">(.*?)</pre>', re.DOTALL)
while True:
- code = code_rgx.search(markup)
+ code = code_re.search(markup)
if not code:
break
match_str = xml.sax.saxutils.unescape(code.group(1))
@@ -267,7 +234,7 @@ def prettifyHtml(m, markup, subject, classlist, proplist, instalist):
pygments.lexers.rdf.TurtleLexer(),
pygments.formatters.HtmlFormatter(),
)
- markup = code_rgx.sub(code_str, markup, 1)
+ markup = code_re.sub(code_str, markup, 1)
# Add links to code documentation for identifiers
markup = linkifyCodeIdentifiers(markup)
@@ -768,12 +735,15 @@ def docTerms(category, list, m, classlist, proplist, instalist):
doc = ""
for term in list:
if not term.startswith(spec_ns_str):
- sys.stderr.write("warning: Skipping external term `%s'" % term)
continue
t = termName(m, term)
curie = term.split(spec_ns_str[-1])[1]
- doc += '<div class="specterm" id="%s" about="%s">' % (t, term)
+ if t:
+ doc += '<div class="specterm" id="%s" about="%s">' % (t, term)
+ else:
+ doc += '<div class="specterm" about="%s">' % term
+
doc += '<h3><a href="#%s">%s</a></h3>' % (getAnchor(term), curie)
doc += '<span class="spectermtype">%s</span>' % category
@@ -830,7 +800,7 @@ def getShortName(uri):
def getAnchor(uri):
uri = str(uri)
if uri.startswith(spec_ns_str):
- return uri[len(spec_ns_str) :].replace("/", "_")
+ return uri.replace(spec_ns_str, "").replace("/", "_")
else:
return getShortName(uri)
@@ -861,7 +831,7 @@ def buildIndex(m, classlist, proplist, instalist=None):
local_subclass = False
for p in findStatements(m, c, rdfs.subClassOf, None):
parent = str(p[2])
- if parent[0 : len(spec_ns_str)] == spec_ns_str:
+ if parent.startswith(spec_ns_str):
local_subclass = True
if local_subclass:
continue
@@ -1020,17 +990,14 @@ def specAuthors(m, subject):
for d in sorted(dev):
if not first:
devdoc += ", "
- devdoc += (
- '<span class="author" property="doap:developer">%s</span>' % d
- )
+
+ devdoc += f'<span class="author" property="doap:developer">{d}</span>'
first = False
if len(dev) == 1:
- doc += (
- '<tr><th class="metahead">Developer</th><td>%s</td></tr>' % devdoc
- )
+ doc += f'<tr><th class="metahead">Developer</th><td>{devdoc}</td></tr>'
elif len(dev) > 0:
doc += (
- '<tr><th class="metahead">Developers</th><td>%s</td></tr>' % devdoc
+ f'<tr><th class="metahead">Developers</th><td>{devdoc}</td></tr>'
)
maintdoc = ""
@@ -1038,95 +1005,18 @@ def specAuthors(m, subject):
for m in sorted(maint):
if not first:
maintdoc += ", "
+
maintdoc += (
- '<span class="author" property="doap:maintainer">%s</span>' % m
+ f'<span class="author" property="doap:maintainer">{m}</span>'
)
first = False
- if len(maint) == 1:
- doc += (
- '<tr><th class="metahead">Maintainer</th><td>%s</td></tr>'
- % maintdoc
- )
- elif len(maint) > 0:
- doc += (
- '<tr><th class="metahead">Maintainers</th><td>%s</td></tr>'
- % maintdoc
- )
+ if len(maint):
+ label = "Maintainer" if len(maint) == 1 else "Maintainers"
+ doc += f'<tr><th class="metahead">{label}</th><td>{maintdoc}</td></tr>'
return doc
-def releaseChangeset(m, release, prefix=""):
- changeset = findOne(m, release, dcs.changeset, None)
- if changeset is None:
- return ""
-
- entry = ""
- # entry = '<dd><ul>\n'
- for i in sorted(findStatements(m, getObject(changeset), dcs.item, None)):
- item = getObject(i)
- label = findOne(m, item, rdfs.label, None)
- if not label:
- print("error: dcs:item has no rdfs:label")
- continue
-
- text = getLiteralString(getObject(label))
- if prefix:
- text = prefix + ": " + text
-
- entry += "<li>%s</li>\n" % text
-
- # entry += '</ul></dd>\n'
- return entry
-
-
-def specHistoryEntries(m, subject, entries):
- for r in findStatements(m, subject, doap.release, None):
- release = getObject(r)
- revNode = findOne(m, release, doap.revision, None)
- if not revNode:
- print("error: doap:release has no doap:revision")
- continue
-
- rev = getLiteralString(getObject(revNode))
-
- created = findOne(m, release, doap.created, None)
-
- dist = findOne(m, release, doap["file-release"], None)
- if dist:
- entry = '<dt><a href="%s">Version %s</a>' % (getObject(dist), rev)
- else:
- entry = "<dt>Version %s" % rev
- # print("warning: doap:release has no doap:file-release")
-
- if created:
- entry += " (%s)</dt>\n" % getLiteralString(getObject(created))
- else:
- entry += ' (<span class="warning">EXPERIMENTAL</span>)</dt>'
-
- entry += "<dd><ul>\n%s" % releaseChangeset(m, release)
-
- if dist is not None:
- entries[(getObject(created), getObject(dist))] = entry
-
- return entries
-
-
-def specHistoryMarkup(entries):
- if len(entries) > 0:
- history = "<dl>\n"
- for e in sorted(entries.keys(), reverse=True):
- history += entries[e] + "</ul></dd>"
- history += "</dl>\n"
- return history
- else:
- return ""
-
-
-def specHistory(m, subject):
- return specHistoryMarkup(specHistoryEntries(m, subject, {}))
-
-
def specVersion(m, subject):
"""
Return a (minorVersion, microVersion, date) tuple
@@ -1222,7 +1112,6 @@ def load_tags(path, docdir):
and cn.tagName == "compound"
and cn.getAttribute("kind") != "page"
):
-
name = getChildText(cn, "name")
filename = getChildText(cn, "filename")
anchor = getChildText(cn, "anchor")
@@ -1246,119 +1135,14 @@ def load_tags(path, docdir):
return linkmap
-def writeIndex(model, specloc, index_path, root_path, root_uri, online):
- # Get extension URI
- ext_node = model.value(None, rdf.type, lv2.Specification)
- if not ext_node:
- ext_node = model.value(None, rdf.type, owl.Ontology)
- if not ext_node:
- print("no extension found in %s" % bundle)
- sys.exit(1)
-
- ext = str(ext_node)
-
- # Get version
- minor = 0
- micro = 0
- try:
- minor = int(model.value(ext_node, lv2.minorVersion, None))
- micro = int(model.value(ext_node, lv2.microVersion, None))
- except Exception:
- print("warning: %s: failed to find version for %s" % (bundle, ext))
-
- # Get date
- date = None
- for r in model.triples([ext_node, doap.release, None]):
- revision = model.value(r[2], doap.revision, None)
- if str(revision) == ("%d.%d" % (minor, micro)):
- date = model.value(r[2], doap.created, None)
- break
-
- # Verify that this date is the latest
- for r in model.triples([ext_node, doap.release, None]):
- this_date = model.value(r[2], doap.created, None)
- if this_date > date:
- print(
- "warning: %s revision %d.%d (%s) is not the latest release"
- % (ext_node, minor, micro, date)
- )
- break
-
- # Get name and short description
- name = model.value(ext_node, doap.name, None)
- shortdesc = model.value(ext_node, doap.shortdesc, None)
-
- # Chop 'LV2' prefix from name for cleaner index
- if name.startswith("LV2 "):
- name = name[4:]
-
- # Find relative link target
- if root_uri and ext_node.startswith(root_uri):
- target = ext_node[len(root_uri) :]
- else:
- target = os.path.relpath(ext_node, root_path)
-
- if not online:
- target += ".html"
-
- stem = os.path.splitext(os.path.basename(target))[0]
-
- # Specification (comment is to act as a sort key)
- row = '<tr><!-- %s --><td><a rel="rdfs:seeAlso" href="%s">%s</a></td>' % (
- b,
- target,
- name,
- )
-
- # API
- row += "<td>"
- row += '<a rel="rdfs:seeAlso" href="../doc/html/group__%s.html">%s</a>' % (
- stem,
- name,
- )
- row += "</td>"
-
- # Description
- if shortdesc:
- row += "<td>" + str(shortdesc) + "</td>"
- else:
- row += "<td></td>"
-
- # Version
- version_str = "%s.%s" % (minor, micro)
- if minor == 0 or (micro % 2 != 0):
- row += '<td><span style="color: red">' + version_str + "</span></td>"
- else:
- row += "<td>" + version_str + "</td>"
-
- # Status
- deprecated = model.value(ext_node, owl.deprecated, None)
- if minor == 0:
- row += '<td><span class="error">Experimental</span></td>'
- elif deprecated and str(deprecated[2]) != "false":
- row += '<td><span class="warning">Deprecated</span></td>'
- elif micro % 2 == 0:
- row += '<td><span class="success">Stable</span></td>'
-
- row += "</tr>"
-
- index = open(index_path, "w")
- index.write(row)
- index.close()
-
-
def specgen(
specloc,
- indir,
+ template_path,
style_uri,
docdir,
tags,
opts,
instances=False,
- root_link=None,
- index_path=None,
- root_path=None,
- root_uri=None,
):
"""The meat and potatoes: Everything starts here."""
@@ -1372,19 +1156,21 @@ def specgen(
global linkmap
spec_bundle = "file://%s/" % os.path.abspath(os.path.dirname(specloc))
- specgendir = os.path.abspath(indir)
# Template
- temploc = os.path.join(indir, "template.html")
- template = None
- f = open(temploc, "r")
- template = f.read()
- f.close()
+ with open(template_path, "r") as f:
+ template = f.read()
# Load code documentation link map from tags file
linkmap = load_tags(tags, docdir)
m = rdflib.ConjunctiveGraph()
+
+ # RDFLib adds its own prefixes, so kludge around "time" prefix conflict
+ m.namespace_manager.bind(
+ "time", rdflib.URIRef("http://lv2plug.in/ns/ext/time#"), replace=True
+ )
+
manifest_path = os.path.join(os.path.dirname(specloc), "manifest.ttl")
if os.path.exists(manifest_path):
m.parse(manifest_path, format="n3")
@@ -1480,8 +1266,6 @@ def specgen(
name = specProperty(m, spec, doap.name)
title = name
- if root_link:
- name = '<a href="%s">%s</a>' % (root_link, name)
template = template.replace("@TITLE@", title)
template = template.replace("@NAME@", name)
@@ -1490,15 +1274,9 @@ def specgen(
)
template = template.replace("@URI@", spec)
template = template.replace("@PREFIX@", spec_pre)
- if spec_pre == "lv2":
- template = template.replace("@XMLNS@", "")
- else:
- template = template.replace(
- "@XMLNS@", ' xmlns:%s="%s"' % (spec_pre, spec_ns_str)
- )
filename = os.path.basename(specloc)
- basename = filename[0 : filename.rfind(".")]
+ basename = os.path.splitext(filename)[0]
template = template.replace("@STYLE_URI@", style_uri)
template = template.replace("@PREFIXES@", str(prefixes_html))
@@ -1508,7 +1286,6 @@ def specgen(
template = template.replace("@REFERENCE@", termlist)
template = template.replace("@FILENAME@", filename)
template = template.replace("@HEADER@", basename + ".h")
- template = template.replace("@HISTORY@", specHistory(m, spec))
mail_row = ""
if "list_email" in opts:
@@ -1554,10 +1331,6 @@ def specgen(
template = template.replace("@DATE@", build_date.strftime("%F"))
template = template.replace("@TIME@", build_date.strftime("%F %H:%M UTC"))
- # Write index row
- if index_path is not None:
- writeIndex(m, specloc, index_path, root_path, root_uri, opts["online"])
-
# Validate complete output page
try:
oldcwd = os.getcwd()
@@ -1570,7 +1343,9 @@ def specgen(
etree.XMLParser(dtd_validation=True, no_network=True),
)
except Exception as e:
- sys.stderr.write("error: Validation failed for %s: %s" % (specloc, e))
+ sys.stderr.write(
+ "error: Validation failed for %s: %s\n" % (specloc, e)
+ )
finally:
os.chdir(oldcwd)
@@ -1579,10 +1354,9 @@ def specgen(
def save(path, text):
try:
- f = open(path, "w")
- f.write(text)
- f.flush()
- f.close()
+ with open(path, "w") as f:
+ f.write(text)
+ f.flush()
except Exception:
e = sys.exc_info()[1]
print('Error writing to file "' + path + '": ' + str(e))
@@ -1618,12 +1392,57 @@ def usage():
return "Usage: %s ONTOLOGY_TTL OUTPUT_HTML [OPTION]..." % script
+def _path_from_env(variable, default):
+ value = os.environ.get(variable)
+ return value if value and os.path.isabs(value) else default
+
+
+def _paths_from_env(variable, default):
+ paths = []
+ value = os.environ.get(variable)
+ if value:
+ paths = [p for p in value.split(os.pathsep) if os.path.isabs(p)]
+
+ return paths if paths else default
+
+
+def _data_dirs():
+ return _paths_from_env(
+ "XDG_DATA_DIRS", ["/usr/local/share/", "/usr/share/"]
+ )
+
+
if __name__ == "__main__":
"""Ontology specification generator tool"""
- indir = os.path.abspath(os.path.dirname(sys.argv[0]))
- if not os.path.exists(os.path.join(indir, "template.html")):
- indir = os.path.join(os.path.dirname(indir), "share", "lv2specgen")
+ data_dir = None
+ for d in _data_dirs():
+ path = os.path.join(d, "lv2specgen")
+ if (
+ os.path.exists(os.path.join(path, "template.html"))
+ and os.path.exists(os.path.join(path, "style.css"))
+ and os.path.exists(os.path.join(path, "pygments.css"))
+ ):
+ data_dir = path
+ break
+
+ if data_dir:
+ # Use installed files
+ specgendir = data_dir
+ default_template_path = os.path.join(data_dir, "template.html")
+ default_style_dir = data_dir
+ else:
+ script_path = os.path.realpath(__file__)
+ script_dir = os.path.dirname(os.path.realpath(__file__))
+ if os.path.exists(os.path.join(script_dir, "template.html")):
+ # Run from source repository
+ specgendir = script_dir
+ lv2_source_root = os.path.dirname(script_dir)
+ default_template_path = os.path.join(script_dir, "template.html")
+ default_style_dir = os.path.join(lv2_source_root, "doc", "style")
+ else:
+ sys.stderr.write("error: Unable to find lv2specgen data\n")
+ sys.exit(-2)
opt = optparse.OptionParser(
usage=usage(),
@@ -1642,11 +1461,18 @@ if __name__ == "__main__":
help="Mailing list info page address",
)
opt.add_option(
- "--template-dir",
+ "--template",
type="string",
- dest="template_dir",
- default=indir,
- help="Template directory",
+ dest="template",
+ default=default_template_path,
+ help="Template file for output page",
+ )
+ opt.add_option(
+ "--style-dir",
+ type="string",
+ dest="style_dir",
+ default=default_style_dir,
+ help="Stylesheet directory path",
)
opt.add_option(
"--style-uri",
@@ -1663,13 +1489,6 @@ if __name__ == "__main__":
help="Doxygen output directory",
)
opt.add_option(
- "--index",
- type="string",
- dest="index_path",
- default=None,
- help="Index row output file",
- )
- opt.add_option(
"--tags",
type="string",
dest="tags",
@@ -1677,22 +1496,6 @@ if __name__ == "__main__":
help="Doxygen tags file",
)
opt.add_option(
- "-r",
- "--root-path",
- type="string",
- dest="root_path",
- default="",
- help="Root path",
- )
- opt.add_option(
- "-R",
- "--root-uri",
- type="string",
- dest="root_uri",
- default="",
- help="Root URI",
- )
- opt.add_option(
"-p",
"--prefix",
type="string",
@@ -1712,13 +1515,6 @@ if __name__ == "__main__":
dest="copy_style",
help="Copy style from template directory to output directory",
)
- opt.add_option(
- "-o",
- "--online",
- action="store_true",
- dest="online",
- help="Generate index for online documentation",
- )
(options, args) = opt.parse_args()
opts = vars(options)
@@ -1730,7 +1526,6 @@ if __name__ == "__main__":
spec_pre = options.prefix
ontology = "file:" + str(args[0])
output = args[1]
- index_path = options.index_path
docdir = options.docdir
tags = options.tags
@@ -1743,27 +1538,18 @@ if __name__ == "__main__":
b = os.path.basename(outdir)
if not os.access(os.path.abspath(spec), os.R_OK):
- print("warning: extension %s has no %s.ttl file" % (b, b))
+ sys.stderr.write("error: extension %s has no %s.ttl file\n" % (b, b))
sys.exit(1)
- # Root link
- root_path = opts["root_path"]
- root_uri = opts["root_uri"]
- root_link = os.path.join(root_path, "index.html")
-
# Generate spec documentation
specdoc = specgen(
spec,
- indir,
+ opts["template"],
opts["style_uri"],
docdir,
tags,
opts,
instances=True,
- root_link=root_link,
- index_path=index_path,
- root_path=root_path,
- root_uri=root_uri,
)
# Save to HTML output file
@@ -1772,7 +1558,10 @@ if __name__ == "__main__":
if opts["copy_style"]:
import shutil
- shutil.copyfile(
- os.path.join(indir, "style.css"),
- os.path.join(os.path.dirname(output), "style.css"),
- )
+ for stylesheet in ["pygments.css", "style.css"]:
+ style_dir = opts["style_dir"]
+ output_dir = os.path.dirname(output)
+ shutil.copyfile(
+ os.path.join(style_dir, stylesheet),
+ os.path.join(output_dir, stylesheet),
+ )
diff --git a/lv2specgen/meson.build b/lv2specgen/meson.build
new file mode 100644
index 0000000..69b029b
--- /dev/null
+++ b/lv2specgen/meson.build
@@ -0,0 +1,44 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+lv2specgen_py = files('lv2specgen.py')
+
+lv2_list_email = 'devel@lists.lv2plug.in'
+lv2_list_page = 'http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in'
+
+lv2specgen_command_prefix = [
+ lv2specgen_py,
+ '--list-email=' + lv2_list_email,
+ '--list-page=' + lv2_list_page,
+ '--style-dir=' + lv2_source_root / 'doc' / 'style',
+ '--template',
+ files('template.html'),
+]
+
+if is_variable('lv2_tags')
+ lv2specgen_command_prefix += [
+ ['--tags', lv2_tags.full_path()], # TODO: Remove full_path() in meson 0.60.0
+ ]
+endif
+
+install_data(
+ files('lv2specgen.py'),
+ install_dir: get_option('bindir'),
+ install_mode: 'rwxr-xr-x',
+)
+
+meson.override_find_program('lv2specgen.py', lv2specgen_py)
+
+install_data(
+ files(
+ '../doc/style/pygments.css',
+ '../doc/style/style.css',
+ 'template.html',
+ ),
+ install_dir: get_option('datadir') / 'lv2specgen',
+)
+
+install_subdir(
+ 'DTD',
+ install_dir: get_option('datadir') / 'lv2specgen',
+)
diff --git a/lv2specgen/style.css b/lv2specgen/style.css
deleted file mode 120000
index f320096..0000000
--- a/lv2specgen/style.css
+++ /dev/null
@@ -1 +0,0 @@
-../doc/style.css \ No newline at end of file
diff --git a/lv2specgen/template.html b/lv2specgen/template.html
index ed9d6fb..dcc2759 100644
--- a/lv2specgen/template.html
+++ b/lv2specgen/template.html
@@ -2,12 +2,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html about="@URI@"
xmlns="http://www.w3.org/1999/xhtml"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:dct="http://purl.org/dc/terms/"
+ xmlns:dcterms="http://purl.org/dc/terms/"
+ xmlns:doap="http://usefulinc.com/ns/doap#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+ xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
- xmlns:lv2="http://lv2plug.in/ns/lv2core#"
- @XMLNS@
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xml:lang="en">
<head>
<title>@TITLE@</title>
@@ -28,7 +29,6 @@
<table id="meta">
<tr><th>ID</th><td><a href="@URI@">@URI@</a></td></tr>
<tr><th>Version</th><td>@VERSION@</td></tr>
- <tr><th>Date</th><td>@DATE@</td></tr>
@MAIL@
@AUTHORS@
</table>
@@ -42,7 +42,6 @@
<ul id="contents">
<!-- <li><a href="#sec-description">Description</a></li> -->
<li><a href="#sec-index">Index</a></li>
- <li><a href="#sec-history">History</a></li>
@CONTENT_LINKS@
</ul>
</div>
@@ -61,12 +60,6 @@
@REFERENCE@
</div>
- <!-- HISTORY -->
- <h2 id="sec-history">History</h2>
- <div class="section">
- @HISTORY@
- </div>
-
<!-- FOOTER -->
<div id="footer">
<div>
@@ -77,12 +70,12 @@
</div>
<div>
Valid
- <a about="" rel="dct:conformsTo" resource="http://www.w3.org/TR/rdfa-syntax"
+ <a about="" rel="dcterms:conformsTo" resource="http://www.w3.org/TR/rdfa-syntax"
href="http://validator.w3.org/check?uri=referer">
XHTML+RDFa
</a>
and
- <a about="" rel="dct:conformsTo" resource="http://www.w3.org/TR/CSS2"
+ <a about="" rel="dcterms:conformsTo" resource="http://www.w3.org/TR/CSS2"
href="http://jigsaw.w3.org/css-validator/check/referer">
CSS
</a>
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..aa9963f
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,373 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+project(
+ 'lv2',
+ ['c'],
+ default_options: [
+ 'b_ndebug=if-release',
+ 'buildtype=release',
+ 'c_std=c99',
+ ],
+ license: 'ISC',
+ meson_version: '>= 0.56.0',
+ version: '1.18.11',
+)
+
+lv2_docdir = get_option('datadir') / 'doc' / 'lv2'
+lv2_source_root = meson.current_source_dir()
+lv2_build_root = meson.current_build_dir()
+
+#######################
+# Compilers and Flags #
+#######################
+
+# Required tools
+pkg = import('pkgconfig')
+pymod = import('python')
+cc = meson.get_compiler('c')
+
+# Optional C++ compiler and Python tools for tests
+if not get_option('tests').disabled()
+ if add_languages(['cpp'], native: false, required: get_option('tests'))
+ cpp = meson.get_compiler('cpp')
+ endif
+endif
+
+# Set global warning flags
+subdir('meson/suppressions')
+
+##########################
+# LV2 Path Configuration #
+##########################
+
+lv2dir = get_option('lv2dir')
+if lv2dir == ''
+ prefix = get_option('prefix')
+ if target_machine.system() == 'darwin' and prefix == '/'
+ lv2dir = '/Library/Audio/Plug-Ins/LV2'
+ elif target_machine.system() == 'haiku' and prefix == '/'
+ lv2dir = '/boot/common/add-ons/lv2'
+ elif target_machine.system() == 'windows' and prefix == 'C:/'
+ lv2dir = 'C:/Program Files/Common Files/LV2'
+ else
+ lv2dir = prefix / get_option('libdir') / 'lv2'
+ endif
+endif
+
+######################
+# Package/Dependency #
+######################
+
+# Generage pkg-config file for external dependants
+pkg.generate(
+ description: 'Plugin standard for audio systems',
+ filebase: 'lv2',
+ name: 'LV2',
+ variables: [
+ 'lv2dir=' + lv2dir,
+ 'plugindir=' + lv2dir,
+ ],
+ version: meson.project_version(),
+)
+
+# Declare dependency for internal meson dependants
+lv2_dep = declare_dependency(
+ include_directories: include_directories('include'),
+ variables: [
+ 'lv2dir=' + lv2_source_root / 'lv2',
+ 'plugindir=' + lv2_build_root / 'plugins',
+ ],
+ version: meson.project_version(),
+)
+
+# Override pkg-config dependency for internal meson dependants
+meson.override_dependency('lv2', lv2_dep)
+
+##################
+# Specifications #
+##################
+
+# Extensions in http://lv2plug.in/ns/ext/
+ext_names = [
+ 'atom',
+ 'buf-size',
+ 'data-access',
+ 'dynmanifest',
+ 'event',
+ 'instance-access',
+ 'log',
+ 'midi',
+ 'morph',
+ 'options',
+ 'parameters',
+ 'patch',
+ 'port-groups',
+ 'port-props',
+ 'presets',
+ 'resize-port',
+ 'state',
+ 'time',
+ 'uri-map',
+ 'urid',
+ 'worker',
+]
+
+# Extensions in http://lv2plug.in/ns/extensions/
+extensions_names = [
+ 'ui',
+ 'units',
+]
+
+# All extensions (not core) in http://lv2plug.in/ns/
+all_extension_names = ext_names + extensions_names
+
+# All specifications in http://lv2plug.in/ns/
+all_spec_names = ['core'] + ext_names + extensions_names
+
+###############
+# API Headers #
+###############
+
+prefix = get_option('prefix')
+includedir = get_option('includedir')
+
+install_subdir('include/lv2', install_dir: includedir)
+
+if get_option('old_headers')
+ uri_include_dir = prefix / includedir / 'lv2' / 'lv2plug.in' / 'ns'
+ include_prefix = 'include' / 'lv2'
+
+ # Install the core headers specially, because they are inconsistent
+
+ core_headers = files(
+ include_prefix / 'core' / 'attributes.h',
+ include_prefix / 'core' / 'lv2.h',
+ include_prefix / 'core' / 'lv2_util.h',
+ )
+
+ # Special case lv2.h is also in top-level include directory
+ install_headers(files(include_prefix / 'core' / 'lv2.h'))
+
+ # Core headers are inconsistently in "lv2plug.in/ns/lv2core"
+ install_data(core_headers, install_dir: uri_include_dir / 'lv2core')
+
+ # Some extensions are in "lv2plug.in/ns/ext"
+ foreach dir : ext_names
+ install_subdir(
+ include_prefix / dir,
+ install_dir: uri_include_dir / 'ext',
+ )
+ endforeach
+
+ # Some extensions are in "lv2plug.in/ns/extensions"
+ foreach dir : extensions_names
+ install_subdir(
+ include_prefix / dir,
+ install_dir: uri_include_dir / 'extensions',
+ )
+ endforeach
+endif
+
+#######################
+# Scripts and Schemas #
+#######################
+
+subdir('scripts')
+subdir('schemas.lv2')
+
+##################
+# Specifications #
+##################
+
+lv2_check_specification = files('scripts' / 'lv2_check_specification.py')
+
+check_python = pymod.find_installation(
+ 'python3',
+ modules: ['rdflib'],
+ required: get_option('tests'),
+)
+
+if (
+ check_python.found()
+ and check_python.language_version().version_compare('<3.7')
+)
+ warning('Python 3.7 is required for tests')
+ check_python = disabler()
+endif
+
+foreach bundle_name : all_spec_names
+ bundle = 'lv2' / bundle_name + '.lv2'
+
+ # Check specification
+ if check_python.found()
+ test(
+ bundle_name,
+ lv2_check_specification,
+ args: files(bundle / 'manifest.ttl'),
+ suite: ['spec'],
+ )
+ endif
+
+ # Install specification bundle
+ install_subdir(bundle, install_dir: lv2dir)
+endforeach
+
+spec_files = files(
+ 'lv2/atom.lv2/atom.meta.ttl',
+ 'lv2/atom.lv2/atom.ttl',
+ 'lv2/atom.lv2/manifest.ttl',
+ 'lv2/buf-size.lv2/buf-size.meta.ttl',
+ 'lv2/buf-size.lv2/buf-size.ttl',
+ 'lv2/buf-size.lv2/manifest.ttl',
+ 'lv2/core.lv2/lv2core.meta.ttl',
+ 'lv2/core.lv2/lv2core.ttl',
+ 'lv2/core.lv2/manifest.ttl',
+ 'lv2/core.lv2/meta.ttl',
+ 'lv2/core.lv2/people.ttl',
+ 'lv2/data-access.lv2/data-access.meta.ttl',
+ 'lv2/data-access.lv2/data-access.ttl',
+ 'lv2/data-access.lv2/manifest.ttl',
+ 'lv2/dynmanifest.lv2/dynmanifest.meta.ttl',
+ 'lv2/dynmanifest.lv2/dynmanifest.ttl',
+ 'lv2/dynmanifest.lv2/manifest.ttl',
+ 'lv2/event.lv2/event.meta.ttl',
+ 'lv2/event.lv2/event.ttl',
+ 'lv2/event.lv2/manifest.ttl',
+ 'lv2/instance-access.lv2/instance-access.meta.ttl',
+ 'lv2/instance-access.lv2/instance-access.ttl',
+ 'lv2/instance-access.lv2/manifest.ttl',
+ 'lv2/log.lv2/log.meta.ttl',
+ 'lv2/log.lv2/log.ttl',
+ 'lv2/log.lv2/manifest.ttl',
+ 'lv2/midi.lv2/manifest.ttl',
+ 'lv2/midi.lv2/midi.meta.ttl',
+ 'lv2/midi.lv2/midi.ttl',
+ 'lv2/morph.lv2/manifest.ttl',
+ 'lv2/morph.lv2/morph.meta.ttl',
+ 'lv2/morph.lv2/morph.ttl',
+ 'lv2/options.lv2/manifest.ttl',
+ 'lv2/options.lv2/options.meta.ttl',
+ 'lv2/options.lv2/options.ttl',
+ 'lv2/parameters.lv2/manifest.ttl',
+ 'lv2/parameters.lv2/parameters.meta.ttl',
+ 'lv2/parameters.lv2/parameters.ttl',
+ 'lv2/patch.lv2/manifest.ttl',
+ 'lv2/patch.lv2/patch.meta.ttl',
+ 'lv2/patch.lv2/patch.ttl',
+ 'lv2/port-groups.lv2/manifest.ttl',
+ 'lv2/port-groups.lv2/port-groups.meta.ttl',
+ 'lv2/port-groups.lv2/port-groups.ttl',
+ 'lv2/port-props.lv2/manifest.ttl',
+ 'lv2/port-props.lv2/port-props.meta.ttl',
+ 'lv2/port-props.lv2/port-props.ttl',
+ 'lv2/presets.lv2/manifest.ttl',
+ 'lv2/presets.lv2/presets.meta.ttl',
+ 'lv2/presets.lv2/presets.ttl',
+ 'lv2/resize-port.lv2/manifest.ttl',
+ 'lv2/resize-port.lv2/resize-port.meta.ttl',
+ 'lv2/resize-port.lv2/resize-port.ttl',
+ 'lv2/state.lv2/manifest.ttl',
+ 'lv2/state.lv2/state.meta.ttl',
+ 'lv2/state.lv2/state.ttl',
+ 'lv2/time.lv2/manifest.ttl',
+ 'lv2/time.lv2/time.meta.ttl',
+ 'lv2/time.lv2/time.ttl',
+ 'lv2/ui.lv2/manifest.ttl',
+ 'lv2/ui.lv2/ui.meta.ttl',
+ 'lv2/ui.lv2/ui.ttl',
+ 'lv2/units.lv2/manifest.ttl',
+ 'lv2/units.lv2/units.meta.ttl',
+ 'lv2/units.lv2/units.ttl',
+ 'lv2/uri-map.lv2/manifest.ttl',
+ 'lv2/uri-map.lv2/uri-map.meta.ttl',
+ 'lv2/uri-map.lv2/uri-map.ttl',
+ 'lv2/urid.lv2/manifest.ttl',
+ 'lv2/urid.lv2/urid.meta.ttl',
+ 'lv2/urid.lv2/urid.ttl',
+ 'lv2/worker.lv2/manifest.ttl',
+ 'lv2/worker.lv2/worker.meta.ttl',
+ 'lv2/worker.lv2/worker.ttl',
+)
+
+#################
+# Documentation #
+#################
+
+# Determine if all the dependencies for building documentation are present
+doxygen = find_program('doxygen', required: get_option('docs'))
+build_docs = false
+build_lv2specgen = false
+doc_deps = []
+if not get_option('docs').disabled()
+ doc_python_modules = ['lxml', 'markdown', 'pygments', 'rdflib']
+
+ python = pymod.find_installation(
+ 'python3',
+ modules: doc_python_modules,
+ required: get_option('docs'),
+ )
+
+ if python.found() and python.language_version().version_compare('<3.7')
+ warning('Python 3.7 is required for documentation')
+ build_docs = false
+ endif
+
+ build_docs = doxygen.found() and python.found()
+ build_lv2specgen = python.found()
+endif
+
+# Run Doxygen first to generate tags
+subdir('doc/c')
+
+# Set up lv2specgen and lv2specgen_command_prefix (which references tags)
+if build_lv2specgen
+ subdir('lv2specgen')
+endif
+
+# Generate specification documentation
+if build_docs
+ subdir('doc/style')
+ subdir('doc/ns')
+endif
+
+###########
+# Plugins #
+###########
+
+# Example plugins and "Programming LV2 Plugins" book
+if not get_option('plugins').disabled()
+ subdir('plugins')
+endif
+
+############
+# Programs #
+############
+
+# Command-line utilities
+subdir('util')
+
+# Data and build tests
+if not get_option('tests').disabled()
+ subdir('test')
+endif
+
+if not meson.is_subproject()
+ summary(
+ {
+ 'Tests': not get_option('tests').disabled(),
+ 'Documentation': build_docs,
+ },
+ bool_yn: true,
+ section: 'Components',
+ )
+
+ summary(
+ {
+ 'Install prefix': get_option('prefix'),
+ 'Headers': get_option('prefix') / get_option('includedir'),
+ 'LV2 bundles': lv2dir,
+ },
+ section: 'Directories',
+ )
+endif
diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build
new file mode 100644
index 0000000..96ff2ab
--- /dev/null
+++ b/meson/suppressions/meson.build
@@ -0,0 +1,167 @@
+# Copyright 2020-2023 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+# Project-specific warning suppressions
+
+warning_level = get_option('warning_level')
+
+#####
+# C #
+#####
+
+if is_variable('cc')
+ c_suppressions = []
+
+ if warning_level == 'everything'
+ if cc.get_id() in ['clang', 'emscripten']
+ c_suppressions += [
+ '-Wno-bad-function-cast',
+ '-Wno-cast-align',
+ '-Wno-cast-function-type-strict',
+ '-Wno-cast-qual',
+ '-Wno-declaration-after-statement',
+ '-Wno-documentation-unknown-command',
+ '-Wno-double-promotion',
+ '-Wno-float-conversion',
+ '-Wno-float-equal',
+ '-Wno-implicit-float-conversion',
+ '-Wno-padded',
+ '-Wno-reserved-id-macro',
+ '-Wno-shorten-64-to-32',
+ '-Wno-sign-conversion',
+ '-Wno-switch-enum',
+ '-Wno-unsafe-buffer-usage',
+ ]
+
+ if not meson.is_cross_build()
+ c_suppressions += [
+ '-Wno-poison-system-directories',
+ ]
+ endif
+
+ if host_machine.system() == 'windows'
+ c_suppressions += [
+ '-Wno-format-nonliteral',
+ ]
+ endif
+
+ elif cc.get_id() == 'gcc'
+ c_suppressions += [
+ '-Wno-bad-function-cast',
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-conversion',
+ '-Wno-double-promotion',
+ '-Wno-float-equal',
+ '-Wno-inline',
+ '-Wno-padded',
+ '-Wno-suggest-attribute=const',
+ '-Wno-suggest-attribute=malloc',
+ '-Wno-suggest-attribute=pure',
+ '-Wno-switch-default',
+ '-Wno-switch-enum',
+ '-Wno-unsuffixed-float-constants',
+ '-Wno-unused-const-variable',
+ ]
+
+ if target_machine.system() == 'windows'
+ c_suppressions += [
+ '-Wno-suggest-attribute=format',
+ ]
+ endif
+
+ elif cc.get_id() == 'msvc'
+ c_suppressions += [
+ '/wd4061', # enumerator in switch is not explicitly handled
+ '/wd4244', # conversion with possible loss of data
+ '/wd4267', # conversion from size_t to a smaller type
+ '/wd4310', # cast truncates constant value
+ '/wd4365', # signed/unsigned mismatch
+ '/wd4464', # relative include path contains ".."
+ '/wd4514', # unreferenced inline function has been removed
+ '/wd4514', # unreferenced inline function has been removed
+ '/wd4706', # assignment within conditional expression
+ '/wd4710', # function not inlined
+ '/wd4711', # function selected for automatic inline expansion
+ '/wd4820', # padding added after construct
+ '/wd5045', # will insert Spectre mitigation for memory load
+ ]
+ endif
+ endif
+
+ if cc.get_id() in ['clang', 'emscripten']
+ c_suppressions += ['-Wno-unused-parameter']
+ elif cc.get_id() == 'gcc'
+ c_suppressions += ['-Wno-unused-parameter']
+ elif cc.get_id() == 'msvc'
+ c_suppressions += [
+ '/wd4100', # unreferenced formal parameter
+ ]
+ endif
+
+ c_suppressions = cc.get_supported_arguments(c_suppressions)
+endif
+
+#######
+# C++ #
+#######
+
+if is_variable('cpp')
+ cpp_suppressions = []
+
+ if warning_level == 'everything'
+ if cpp.get_id() in ['clang', 'emscripten']
+ cpp_suppressions += [
+ '-Wno-c++98-compat',
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-documentation-unknown-command',
+ '-Wno-nullability-extension',
+ '-Wno-padded',
+ '-Wno-reserved-id-macro',
+ '-Wno-unsafe-buffer-usage',
+ ]
+
+ if not meson.is_cross_build()
+ cpp_suppressions += [
+ '-Wno-poison-system-directories',
+ ]
+ endif
+
+ if host_machine.system() == 'windows'
+ cpp_suppressions += [
+ '-Wno-format-nonliteral',
+ ]
+ endif
+
+ elif cpp.get_id() == 'gcc'
+ cpp_suppressions += [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-inline',
+ '-Wno-padded',
+ '-Wno-unused-const-variable',
+ '-Wno-useless-cast',
+ ]
+
+ if target_machine.system() == 'windows'
+ cpp_suppressions += [
+ '-Wno-suggest-attribute=format',
+ ]
+ endif
+
+ elif cpp.get_id() == 'msvc'
+ cpp_suppressions += [
+ '/wd4514', # unreferenced inline function has been removed
+ '/wd4706', # assignment within conditional expression
+ '/wd4710', # function not inlined
+ '/wd4711', # function selected for automatic inline expansion
+ '/wd4820', # padding added after data member
+ '/wd5045', # will insert Spectre mitigation
+ '/wd5264', # const variable is not used
+ ]
+ endif
+ endif
+
+ cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions)
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..0a8c145
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,26 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+option('docs', type: 'feature', value: 'auto', yield: true,
+ description: 'Build documentation')
+
+option('lint', type: 'boolean', value: false, yield: true,
+ description: 'Run code quality checks')
+
+option('lv2dir', type: 'string', value: '', yield: true,
+ description: 'LV2 bundle installation directory')
+
+option('old_headers', type: 'boolean', value: true, yield: true,
+ description: 'Install backwards compatible headers at URI-style paths')
+
+option('online_docs', type: 'boolean', value: false, yield: true,
+ description: 'Build documentation for online hosting')
+
+option('plugins', type: 'feature', value: 'auto', yield: true,
+ description: 'Build example plugins')
+
+option('tests', type: 'feature', value: 'auto', yield: true,
+ description: 'Build tests')
+
+option('title', type: 'string', value: 'LV2',
+ description: 'Project title')
diff --git a/plugins/.clang-tidy b/plugins/.clang-tidy
new file mode 100644
index 0000000..5fc86ab
--- /dev/null
+++ b/plugins/.clang-tidy
@@ -0,0 +1,14 @@
+# Copyright 2020-2023 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+Checks: >
+ -*-narrowing-conversions,
+ -bugprone-assignment-in-if-condition,
+ -bugprone-easily-swappable-parameters,
+ -bugprone-suspicious-realloc-usage,
+ -cert-err33-c,
+ -hicpp-signed-bitwise,
+ -llvm-header-guard,
+ -misc-unused-parameters,
+ -readability-function-cognitive-complexity,
+InheritParentConfig: true
diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c
index c3ba279..90a5769 100644
--- a/plugins/eg-amp.lv2/amp.c
+++ b/plugins/eg-amp.lv2/amp.c
@@ -1,19 +1,6 @@
-/*
- Copyright 2006-2016 David Robillard <d@drobilla.net>
- Copyright 2006 Steve Harris <steve@plugin.org.uk>
-
- 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.
-*/
+// Copyright 2006-2016 David Robillard <d@drobilla.net>
+// Copyright 2006 Steve Harris <steve@plugin.org.uk>
+// SPDX-License-Identifier: ISC
/**
LV2 headers are based on the URI of the specification they come from, so a
@@ -42,11 +29,7 @@
In code, ports are referred to by index. An enumeration of port indices
should be defined for readability.
*/
-typedef enum {
- AMP_GAIN = 0,
- AMP_INPUT = 1,
- AMP_OUTPUT = 2
-} PortIndex;
+typedef enum { AMP_GAIN = 0, AMP_INPUT = 1, AMP_OUTPUT = 2 } PortIndex;
/**
Every plugin defines a private structure for the plugin instance. All data
@@ -55,10 +38,10 @@ typedef enum {
stored, since there is no additional instance data.
*/
typedef struct {
- // Port buffers
- const float* gain;
- const float* input;
- float* output;
+ // Port buffers
+ const float* gain;
+ const float* input;
+ float* output;
} Amp;
/**
@@ -77,9 +60,9 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
- Amp* amp = (Amp*)calloc(1, sizeof(Amp));
+ Amp* amp = (Amp*)calloc(1, sizeof(Amp));
- return (LV2_Handle)amp;
+ return (LV2_Handle)amp;
}
/**
@@ -91,23 +74,21 @@ instantiate(const LV2_Descriptor* descriptor,
context as run().
*/
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- Amp* amp = (Amp*)instance;
-
- switch ((PortIndex)port) {
- case AMP_GAIN:
- amp->gain = (const float*)data;
- break;
- case AMP_INPUT:
- amp->input = (const float*)data;
- break;
- case AMP_OUTPUT:
- amp->output = (float*)data;
- break;
- }
+ Amp* amp = (Amp*)instance;
+
+ switch ((PortIndex)port) {
+ case AMP_GAIN:
+ amp->gain = (const float*)data;
+ break;
+ case AMP_INPUT:
+ amp->input = (const float*)data;
+ break;
+ case AMP_OUTPUT:
+ amp->output = (float*)data;
+ break;
+ }
}
/**
@@ -121,11 +102,10 @@ connect_port(LV2_Handle instance,
*/
static void
activate(LV2_Handle instance)
-{
-}
+{}
/** Define a macro for converting a gain in dB to a coefficient. */
-#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g) * 0.05f) : 0.0f)
+#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g)*0.05f) : 0.0f)
/**
The `run()` method is the main process function of the plugin. It processes
@@ -136,34 +116,33 @@ activate(LV2_Handle instance)
static void
run(LV2_Handle instance, uint32_t n_samples)
{
- const Amp* amp = (const Amp*)instance;
+ const Amp* amp = (const Amp*)instance;
- const float gain = *(amp->gain);
- const float* const input = amp->input;
- float* const output = amp->output;
+ const float gain = *(amp->gain);
+ const float* const input = amp->input;
+ float* const output = amp->output;
- const float coef = DB_CO(gain);
+ const float coef = DB_CO(gain);
- for (uint32_t pos = 0; pos < n_samples; pos++) {
- output[pos] = input[pos] * coef;
- }
+ for (uint32_t pos = 0; pos < n_samples; pos++) {
+ output[pos] = input[pos] * coef;
+ }
}
/**
- The `deactivate()` method is the counterpart to `activate()`, and is called by
- the host after running the plugin. It indicates that the host will not call
- `run()` again until another call to `activate()` and is mainly useful for more
- advanced plugins with ``live'' characteristics such as those with auxiliary
- processing threads. As with `activate()`, this plugin has no use for this
- information so this method does nothing.
+ The `deactivate()` method is the counterpart to `activate()`, and is called
+ by the host after running the plugin. It indicates that the host will not
+ call `run()` again until another call to `activate()` and is mainly useful
+ for more advanced plugins with ``live'' characteristics such as those with
+ auxiliary processing threads. As with `activate()`, this plugin has no use
+ for this information so this method does nothing.
This method is in the ``instantiation'' threading class, so no other
methods on this instance will be called concurrently with it.
*/
static void
deactivate(LV2_Handle instance)
-{
-}
+{}
/**
Destroy a plugin instance (counterpart to `instantiate()`).
@@ -174,7 +153,7 @@ deactivate(LV2_Handle instance)
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
/**
@@ -190,7 +169,7 @@ cleanup(LV2_Handle instance)
static const void*
extension_data(const char* uri)
{
- return NULL;
+ return NULL;
}
/**
@@ -198,22 +177,20 @@ extension_data(const char* uri)
descriptors statically to avoid leaking memory and non-portable shared
library constructors and destructors to clean up properly.
*/
-static const LV2_Descriptor descriptor = {
- AMP_URI,
- instantiate,
- connect_port,
- activate,
- run,
- deactivate,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor = {AMP_URI,
+ instantiate,
+ connect_port,
+ activate,
+ run,
+ deactivate,
+ cleanup,
+ extension_data};
/**
- The `lv2_descriptor()` function is the entry point to the plugin library. The
+ The `lv2_descriptor()` function is the entry point to the plugin library. The
host will load the library and call this function repeatedly with increasing
indices to find all the plugins defined in the library. The index is not an
- indentifier, the URI of the returned descriptor is used to determine the
+ identifier, the URI of the returned descriptor is used to determine the
identify of the plugin.
This method is in the ``discovery'' threading class, so no other functions
@@ -223,8 +200,5 @@ LV2_SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0: return &descriptor;
- default: return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-amp.lv2/meson.build b/plugins/eg-amp.lv2/meson.build
new file mode 100644
index 0000000..726038e
--- /dev/null
+++ b/plugins/eg-amp.lv2/meson.build
@@ -0,0 +1,41 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('amp.c')
+bundle_name = 'eg-amp.lv2'
+data_filenames = ['manifest.ttl.in', 'amp.ttl']
+
+module = shared_library(
+ 'amp',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+)
+
+config = configuration_data(
+ {
+ 'LIB_EXT': '.' + module.full_path().split('.')[-1],
+ },
+)
+
+foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+endforeach
diff --git a/plugins/eg-amp.lv2/waf b/plugins/eg-amp.lv2/waf
deleted file mode 120000
index 59a1ac9..0000000
--- a/plugins/eg-amp.lv2/waf
+++ /dev/null
@@ -1 +0,0 @@
-../../waf \ No newline at end of file
diff --git a/plugins/eg-amp.lv2/wscript b/plugins/eg-amp.lv2/wscript
deleted file mode 100644
index 822825d..0000000
--- a/plugins/eg-amp.lv2/wscript
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-amp.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2', uselib_store='LV2')
-
- conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False)
-
-def build(bld):
- bundle = 'eg-amp.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- bld(features = 'subst',
- source = 'manifest.ttl.in',
- target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Copy other data files to build bundle (build/eg-amp.lv2)
- for i in ['amp.ttl']:
- bld(features = 'subst',
- is_copy = True,
- source = i,
- target = 'lv2/%s/%s' % (bundle, i),
- install_path = '${LV2DIR}/%s' % bundle)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'amp.c',
- name = 'amp',
- target = 'lv2/%s/amp' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- uselib = 'M LV2')
diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c
index 0abcfbd..9f6a388 100644
--- a/plugins/eg-fifths.lv2/fifths.c
+++ b/plugins/eg-fifths.lv2/fifths.c
@@ -1,19 +1,5 @@
-/*
- LV2 Fifths Example Plugin
- Copyright 2014-2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2014-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "./uris.h"
@@ -31,40 +17,35 @@
#include <stdio.h>
#include <stdlib.h>
-enum {
- FIFTHS_IN = 0,
- FIFTHS_OUT = 1
-};
+enum { FIFTHS_IN = 0, FIFTHS_OUT = 1 };
typedef struct {
- // Features
- LV2_URID_Map* map;
- LV2_Log_Logger logger;
+ // Features
+ LV2_URID_Map* map;
+ LV2_Log_Logger logger;
- // Ports
- const LV2_Atom_Sequence* in_port;
- LV2_Atom_Sequence* out_port;
+ // Ports
+ const LV2_Atom_Sequence* in_port;
+ LV2_Atom_Sequence* out_port;
- // URIs
- FifthsURIs uris;
+ // URIs
+ FifthsURIs uris;
} Fifths;
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- Fifths* self = (Fifths*)instance;
- switch (port) {
- case FIFTHS_IN:
- self->in_port = (const LV2_Atom_Sequence*)data;
- break;
- case FIFTHS_OUT:
- self->out_port = (LV2_Atom_Sequence*)data;
- break;
- default:
- break;
- }
+ Fifths* self = (Fifths*)instance;
+ switch (port) {
+ case FIFTHS_IN:
+ self->in_port = (const LV2_Atom_Sequence*)data;
+ break;
+ case FIFTHS_OUT:
+ self->out_port = (LV2_Atom_Sequence*)data;
+ break;
+ default:
+ break;
+ }
}
static LV2_Handle
@@ -73,121 +54,115 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
- // Allocate and initialise instance structure.
- Fifths* self = (Fifths*)calloc(1, sizeof(Fifths));
- if (!self) {
- return NULL;
- }
-
- // Scan host features for URID map
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &self->logger.log, false,
- LV2_URID__map, &self->map, true,
- NULL);
- lv2_log_logger_set_map(&self->logger, self->map);
- if (missing) {
- lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
- free(self);
- return NULL;
- }
-
- map_fifths_uris(self->map, &self->uris);
-
- return (LV2_Handle)self;
+ // Allocate and initialise instance structure.
+ Fifths* self = (Fifths*)calloc(1, sizeof(Fifths));
+ if (!self) {
+ return NULL;
+ }
+
+ // Scan host features for URID map
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &self->logger.log, false,
+ LV2_URID__map, &self->map, true,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&self->logger, self->map);
+ if (missing) {
+ lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
+ free(self);
+ return NULL;
+ }
+
+ map_fifths_uris(self->map, &self->uris);
+
+ return (LV2_Handle)self;
}
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
static void
-run(LV2_Handle instance,
- uint32_t sample_count)
+run(LV2_Handle instance, uint32_t sample_count)
{
- Fifths* self = (Fifths*)instance;
- FifthsURIs* uris = &self->uris;
-
- // Struct for a 3 byte MIDI event, used for writing notes
- typedef struct {
- LV2_Atom_Event event;
- uint8_t msg[3];
- } MIDINoteEvent;
-
- // Initially self->out_port contains a Chunk with size set to capacity
-
- // Get the capacity
- const uint32_t out_capacity = self->out_port->atom.size;
-
- // Write an empty Sequence header to the output
- lv2_atom_sequence_clear(self->out_port);
- self->out_port->atom.type = self->in_port->atom.type;
-
- // Read incoming events
- LV2_ATOM_SEQUENCE_FOREACH(self->in_port, ev) {
- if (ev->body.type == uris->midi_Event) {
- const uint8_t* const msg = (const uint8_t*)(ev + 1);
- switch (lv2_midi_message_type(msg)) {
- case LV2_MIDI_MSG_NOTE_ON:
- case LV2_MIDI_MSG_NOTE_OFF:
- // Forward note to output
- lv2_atom_sequence_append_event(
- self->out_port, out_capacity, ev);
-
- if (msg[1] <= 127 - 7) {
- // Make a note one 5th (7 semitones) higher than input
- MIDINoteEvent fifth;
-
- // Could simply do fifth.event = *ev here instead...
- fifth.event.time.frames = ev->time.frames; // Same time
- fifth.event.body.type = ev->body.type; // Same type
- fifth.event.body.size = ev->body.size; // Same size
-
- fifth.msg[0] = msg[0]; // Same status
- fifth.msg[1] = msg[1] + 7; // Pitch up 7 semitones
- fifth.msg[2] = msg[2]; // Same velocity
-
- // Write 5th event
- lv2_atom_sequence_append_event(
- self->out_port, out_capacity, &fifth.event);
- }
- break;
- default:
- // Forward all other MIDI events directly
- lv2_atom_sequence_append_event(
- self->out_port, out_capacity, ev);
- break;
- }
- }
- }
+ Fifths* self = (Fifths*)instance;
+ FifthsURIs* uris = &self->uris;
+
+ // Struct for a 3 byte MIDI event, used for writing notes
+ typedef struct {
+ LV2_Atom_Event event;
+ uint8_t msg[3];
+ } MIDINoteEvent;
+
+ // Initially self->out_port contains a Chunk with size set to capacity
+
+ // Get the capacity
+ const uint32_t out_capacity = self->out_port->atom.size;
+
+ // Write an empty Sequence header to the output
+ lv2_atom_sequence_clear(self->out_port);
+ self->out_port->atom.type = self->in_port->atom.type;
+
+ // Read incoming events
+ LV2_ATOM_SEQUENCE_FOREACH (self->in_port, ev) {
+ if (ev->body.type == uris->midi_Event) {
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
+ switch (lv2_midi_message_type(msg)) {
+ case LV2_MIDI_MSG_NOTE_ON:
+ case LV2_MIDI_MSG_NOTE_OFF:
+ // Forward note to output
+ lv2_atom_sequence_append_event(self->out_port, out_capacity, ev);
+
+ if (msg[1] <= 127 - 7) {
+ // Make a note one 5th (7 semitones) higher than input
+ MIDINoteEvent fifth;
+
+ // Could simply do fifth.event = *ev here instead...
+ fifth.event.time.frames = ev->time.frames; // Same time
+ fifth.event.body.type = ev->body.type; // Same type
+ fifth.event.body.size = ev->body.size; // Same size
+
+ fifth.msg[0] = msg[0]; // Same status
+ fifth.msg[1] = msg[1] + 7; // Pitch up 7 semitones
+ fifth.msg[2] = msg[2]; // Same velocity
+
+ // Write 5th event
+ lv2_atom_sequence_append_event(
+ self->out_port, out_capacity, &fifth.event);
+ }
+ break;
+ default:
+ // Forward all other MIDI events directly
+ lv2_atom_sequence_append_event(self->out_port, out_capacity, ev);
+ break;
+ }
+ }
+ }
}
static const void*
extension_data(const char* uri)
{
- return NULL;
+ return NULL;
}
-static const LV2_Descriptor descriptor = {
- EG_FIFTHS_URI,
- instantiate,
- connect_port,
- NULL, // activate,
- run,
- NULL, // deactivate,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor = {EG_FIFTHS_URI,
+ instantiate,
+ connect_port,
+ NULL, // activate,
+ run,
+ NULL, // deactivate,
+ cleanup,
+ extension_data};
LV2_SYMBOL_EXPORT
-const LV2_Descriptor* lv2_descriptor(uint32_t index)
+const LV2_Descriptor*
+lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-fifths.lv2/meson.build b/plugins/eg-fifths.lv2/meson.build
new file mode 100644
index 0000000..bba21ce
--- /dev/null
+++ b/plugins/eg-fifths.lv2/meson.build
@@ -0,0 +1,41 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('fifths.c')
+bundle_name = 'eg-fifths.lv2'
+data_filenames = ['manifest.ttl.in', 'fifths.ttl']
+
+module = shared_library(
+ 'fifths',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+)
+
+config = configuration_data(
+ {
+ 'LIB_EXT': '.' + module.full_path().split('.')[-1],
+ },
+)
+
+foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+endforeach
diff --git a/plugins/eg-fifths.lv2/uris.h b/plugins/eg-fifths.lv2/uris.h
index 04b09f6..7cbbd94 100644
--- a/plugins/eg-fifths.lv2/uris.h
+++ b/plugins/eg-fifths.lv2/uris.h
@@ -1,55 +1,40 @@
-/*
- LV2 Fifths Example Plugin
- Copyright 2014-2015 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2014-2015 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#ifndef FIFTHS_URIS_H
#define FIFTHS_URIS_H
#include "lv2/atom/atom.h"
-#include "lv2/log/log.h"
#include "lv2/midi/midi.h"
#include "lv2/patch/patch.h"
-#include "lv2/state/state.h"
+#include "lv2/urid/urid.h"
#define EG_FIFTHS_URI "http://lv2plug.in/plugins/eg-fifths"
typedef struct {
- LV2_URID atom_Path;
- LV2_URID atom_Resource;
- LV2_URID atom_Sequence;
- LV2_URID atom_URID;
- LV2_URID atom_eventTransfer;
- LV2_URID midi_Event;
- LV2_URID patch_Set;
- LV2_URID patch_property;
- LV2_URID patch_value;
+ LV2_URID atom_Path;
+ LV2_URID atom_Resource;
+ LV2_URID atom_Sequence;
+ LV2_URID atom_URID;
+ LV2_URID atom_eventTransfer;
+ LV2_URID midi_Event;
+ LV2_URID patch_Set;
+ LV2_URID patch_property;
+ LV2_URID patch_value;
} FifthsURIs;
static inline void
map_fifths_uris(LV2_URID_Map* map, FifthsURIs* uris)
{
- uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
- uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource);
- uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
- uris->atom_URID = map->map(map->handle, LV2_ATOM__URID);
- uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
- uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent);
- uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
- uris->patch_property = map->map(map->handle, LV2_PATCH__property);
- uris->patch_value = map->map(map->handle, LV2_PATCH__value);
+ uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
+ uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource);
+ uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
+ uris->atom_URID = map->map(map->handle, LV2_ATOM__URID);
+ uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
+ uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent);
+ uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
+ uris->patch_property = map->map(map->handle, LV2_PATCH__property);
+ uris->patch_value = map->map(map->handle, LV2_PATCH__value);
}
-#endif /* FIFTHS_URIS_H */
+#endif // FIFTHS_URIS_H
diff --git a/plugins/eg-fifths.lv2/waf b/plugins/eg-fifths.lv2/waf
deleted file mode 120000
index 59a1ac9..0000000
--- a/plugins/eg-fifths.lv2/waf
+++ /dev/null
@@ -1 +0,0 @@
-../../waf \ No newline at end of file
diff --git a/plugins/eg-fifths.lv2/wscript b/plugins/eg-fifths.lv2/wscript
deleted file mode 100644
index 8b2991b..0000000
--- a/plugins/eg-fifths.lv2/wscript
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-fifths.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2 >= 1.2.1', uselib_store='LV2')
-
-def build(bld):
- bundle = 'eg-fifths.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- bld(features = 'subst',
- source = 'manifest.ttl.in',
- target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Copy other data files to build bundle (build/eg-fifths.lv2)
- for i in ['fifths.ttl']:
- bld(features = 'subst',
- is_copy = True,
- source = i,
- target = 'lv2/%s/%s' % (bundle, i),
- install_path = '${LV2DIR}/%s' % bundle)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'fifths.c',
- name = 'fifths',
- target = 'lv2/%s/fifths' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = 'LV2')
diff --git a/plugins/eg-metro.lv2/meson.build b/plugins/eg-metro.lv2/meson.build
new file mode 100644
index 0000000..5d83c9e
--- /dev/null
+++ b/plugins/eg-metro.lv2/meson.build
@@ -0,0 +1,41 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('metro.c')
+bundle_name = 'eg-metro.lv2'
+data_filenames = ['manifest.ttl.in', 'metro.ttl']
+
+module = shared_library(
+ 'metro',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+)
+
+config = configuration_data(
+ {
+ 'LIB_EXT': '.' + module.full_path().split('.')[-1],
+ },
+)
+
+foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+endforeach
diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c
index a7231d2..f3fe164 100644
--- a/plugins/eg-metro.lv2/metro.c
+++ b/plugins/eg-metro.lv2/metro.c
@@ -1,19 +1,5 @@
-/*
- LV2 Metronome Example Plugin
- Copyright 2012-2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2012-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "lv2/atom/atom.h"
#include "lv2/atom/util.h"
@@ -32,37 +18,34 @@
#include <string.h>
#ifndef M_PI
-# define M_PI 3.14159265
+# define M_PI 3.14159265
#endif
#define EG_METRO_URI "http://lv2plug.in/plugins/eg-metro"
typedef struct {
- LV2_URID atom_Blank;
- LV2_URID atom_Float;
- LV2_URID atom_Object;
- LV2_URID atom_Path;
- LV2_URID atom_Resource;
- LV2_URID atom_Sequence;
- LV2_URID time_Position;
- LV2_URID time_barBeat;
- LV2_URID time_beatsPerMinute;
- LV2_URID time_speed;
+ LV2_URID atom_Blank;
+ LV2_URID atom_Float;
+ LV2_URID atom_Object;
+ LV2_URID atom_Path;
+ LV2_URID atom_Resource;
+ LV2_URID atom_Sequence;
+ LV2_URID time_Position;
+ LV2_URID time_barBeat;
+ LV2_URID time_beatsPerMinute;
+ LV2_URID time_speed;
} MetroURIs;
static const double attack_s = 0.005;
static const double decay_s = 0.075;
-enum {
- METRO_CONTROL = 0,
- METRO_OUT = 1
-};
+enum { METRO_CONTROL = 0, METRO_OUT = 1 };
/** During execution this plugin can be in one of 3 states: */
typedef enum {
- STATE_ATTACK, // Envelope rising
- STATE_DECAY, // Envelope lowering
- STATE_OFF // Silent
+ STATE_ATTACK, // Envelope rising
+ STATE_DECAY, // Envelope lowering
+ STATE_OFF // Silent
} State;
/**
@@ -77,50 +60,48 @@ typedef enum {
the user to modify these parameters, the frequency of the wave, and so on.
*/
typedef struct {
- LV2_URID_Map* map; // URID map feature
- LV2_Log_Logger logger; // Logger API
- MetroURIs uris; // Cache of mapped URIDs
-
- struct {
- LV2_Atom_Sequence* control;
- float* output;
- } ports;
-
- // Variables to keep track of the tempo information sent by the host
- double rate; // Sample rate
- float bpm; // Beats per minute (tempo)
- float speed; // Transport speed (usually 0=stop, 1=play)
-
- uint32_t elapsed_len; // Frames since the start of the last click
- uint32_t wave_offset; // Current play offset in the wave
- State state; // Current play state
-
- // One cycle of a sine wave
- float* wave;
- uint32_t wave_len;
-
- // Envelope parameters
- uint32_t attack_len;
- uint32_t decay_len;
+ LV2_URID_Map* map; // URID map feature
+ LV2_Log_Logger logger; // Logger API
+ MetroURIs uris; // Cache of mapped URIDs
+
+ struct {
+ LV2_Atom_Sequence* control;
+ float* output;
+ } ports;
+
+ // Variables to keep track of the tempo information sent by the host
+ double rate; // Sample rate
+ float bpm; // Beats per minute (tempo)
+ float speed; // Transport speed (usually 0=stop, 1=play)
+
+ uint32_t elapsed_len; // Frames since the start of the last click
+ uint32_t wave_offset; // Current play offset in the wave
+ State state; // Current play state
+
+ // One cycle of a sine wave
+ float* wave;
+ uint32_t wave_len;
+
+ // Envelope parameters
+ uint32_t attack_len;
+ uint32_t decay_len;
} Metro;
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- Metro* self = (Metro*)instance;
-
- switch (port) {
- case METRO_CONTROL:
- self->ports.control = (LV2_Atom_Sequence*)data;
- break;
- case METRO_OUT:
- self->ports.output = (float*)data;
- break;
- default:
- break;
- }
+ Metro* self = (Metro*)instance;
+
+ switch (port) {
+ case METRO_CONTROL:
+ self->ports.control = (LV2_Atom_Sequence*)data;
+ break;
+ case METRO_OUT:
+ self->ports.output = (float*)data;
+ break;
+ default:
+ break;
+ }
}
/**
@@ -130,11 +111,11 @@ connect_port(LV2_Handle instance,
static void
activate(LV2_Handle instance)
{
- Metro* self = (Metro*)instance;
+ Metro* self = (Metro*)instance;
- self->elapsed_len = 0;
- self->wave_offset = 0;
- self->state = STATE_OFF;
+ self->elapsed_len = 0;
+ self->wave_offset = 0;
+ self->state = STATE_OFF;
}
/**
@@ -149,61 +130,64 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
- Metro* self = (Metro*)calloc(1, sizeof(Metro));
- if (!self) {
- return NULL;
- }
-
- // Scan host features for URID map
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &self->logger.log, false,
- LV2_URID__map, &self->map, true,
- NULL);
- lv2_log_logger_set_map(&self->logger, self->map);
- if (missing) {
- lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
- free(self);
- return NULL;
- }
-
- // Map URIS
- MetroURIs* const uris = &self->uris;
- LV2_URID_Map* const map = self->map;
- uris->atom_Blank = map->map(map->handle, LV2_ATOM__Blank);
- uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
- uris->atom_Object = map->map(map->handle, LV2_ATOM__Object);
- uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
- uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource);
- uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
- uris->time_Position = map->map(map->handle, LV2_TIME__Position);
- uris->time_barBeat = map->map(map->handle, LV2_TIME__barBeat);
- uris->time_beatsPerMinute = map->map(map->handle, LV2_TIME__beatsPerMinute);
- uris->time_speed = map->map(map->handle, LV2_TIME__speed);
-
- // Initialise instance fields
- self->rate = rate;
- self->bpm = 120.0f;
- self->attack_len = (uint32_t)(attack_s * rate);
- self->decay_len = (uint32_t)(decay_s * rate);
- self->state = STATE_OFF;
-
- // Generate one cycle of a sine wave at the desired frequency
- const double freq = 440.0 * 2.0;
- const double amp = 0.5;
- self->wave_len = (uint32_t)(rate / freq);
- self->wave = (float*)malloc(self->wave_len * sizeof(float));
- for (uint32_t i = 0; i < self->wave_len; ++i) {
- self->wave[i] = (float)(sin(i * 2 * M_PI * freq / rate) * amp);
- }
-
- return (LV2_Handle)self;
+ Metro* self = (Metro*)calloc(1, sizeof(Metro));
+ if (!self) {
+ return NULL;
+ }
+
+ // Scan host features for URID map
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &self->logger.log, false,
+ LV2_URID__map, &self->map, true,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&self->logger, self->map);
+ if (missing) {
+ lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
+ free(self);
+ return NULL;
+ }
+
+ // Map URIS
+ MetroURIs* const uris = &self->uris;
+ LV2_URID_Map* const map = self->map;
+ uris->atom_Blank = map->map(map->handle, LV2_ATOM__Blank);
+ uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
+ uris->atom_Object = map->map(map->handle, LV2_ATOM__Object);
+ uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
+ uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource);
+ uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
+ uris->time_Position = map->map(map->handle, LV2_TIME__Position);
+ uris->time_barBeat = map->map(map->handle, LV2_TIME__barBeat);
+ uris->time_beatsPerMinute = map->map(map->handle, LV2_TIME__beatsPerMinute);
+ uris->time_speed = map->map(map->handle, LV2_TIME__speed);
+
+ // Initialise instance fields
+ self->rate = rate;
+ self->bpm = 120.0f;
+ self->attack_len = (uint32_t)(attack_s * rate);
+ self->decay_len = (uint32_t)(decay_s * rate);
+ self->state = STATE_OFF;
+
+ // Generate one cycle of a sine wave at the desired frequency
+ const double freq = 440.0 * 2.0;
+ const double amp = 0.5;
+ self->wave_len = (uint32_t)(rate / freq);
+ self->wave = (float*)malloc(self->wave_len * sizeof(float));
+ for (uint32_t i = 0; i < self->wave_len; ++i) {
+ self->wave[i] = (float)(sin(i * 2 * M_PI * freq / rate) * amp);
+ }
+
+ return (LV2_Handle)self;
}
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
/**
@@ -213,47 +197,47 @@ cleanup(LV2_Handle instance)
static void
play(Metro* self, uint32_t begin, uint32_t end)
{
- float* const output = self->ports.output;
- const uint32_t frames_per_beat = 60.0f / self->bpm * self->rate;
-
- if (self->speed == 0.0f) {
- memset(output, 0, (end - begin) * sizeof(float));
- return;
- }
-
- for (uint32_t i = begin; i < end; ++i) {
- switch (self->state) {
- case STATE_ATTACK:
- // Amplitude increases from 0..1 until attack_len
- output[i] = self->wave[self->wave_offset] *
- self->elapsed_len / (float)self->attack_len;
- if (self->elapsed_len >= self->attack_len) {
- self->state = STATE_DECAY;
- }
- break;
- case STATE_DECAY:
- // Amplitude decreases from 1..0 until attack_len + decay_len
- output[i] = 0.0f;
- output[i] = self->wave[self->wave_offset] *
- (1 - ((self->elapsed_len - self->attack_len) /
- (float)self->decay_len));
- if (self->elapsed_len >= self->attack_len + self->decay_len) {
- self->state = STATE_OFF;
- }
- break;
- case STATE_OFF:
- output[i] = 0.0f;
- }
-
- // We continuously play the sine wave regardless of envelope
- self->wave_offset = (self->wave_offset + 1) % self->wave_len;
-
- // Update elapsed time and start attack if necessary
- if (++self->elapsed_len == frames_per_beat) {
- self->state = STATE_ATTACK;
- self->elapsed_len = 0;
- }
- }
+ float* const output = self->ports.output;
+ const uint32_t frames_per_beat = (uint32_t)(60.0f / self->bpm * self->rate);
+
+ if (self->speed == 0.0f) {
+ memset(output, 0, (end - begin) * sizeof(float));
+ return;
+ }
+
+ for (uint32_t i = begin; i < end; ++i) {
+ switch (self->state) {
+ case STATE_ATTACK:
+ // Amplitude increases from 0..1 until attack_len
+ output[i] = self->wave[self->wave_offset] * (float)self->elapsed_len /
+ (float)self->attack_len;
+ if (self->elapsed_len >= self->attack_len) {
+ self->state = STATE_DECAY;
+ }
+ break;
+ case STATE_DECAY:
+ // Amplitude decreases from 1..0 until attack_len + decay_len
+ output[i] = 0.0f;
+ output[i] = self->wave[self->wave_offset] *
+ (1 - ((float)(self->elapsed_len - self->attack_len) /
+ (float)self->decay_len));
+ if (self->elapsed_len >= self->attack_len + self->decay_len) {
+ self->state = STATE_OFF;
+ }
+ break;
+ case STATE_OFF:
+ output[i] = 0.0f;
+ }
+
+ // We continuously play the sine wave regardless of envelope
+ self->wave_offset = (self->wave_offset + 1) % self->wave_len;
+
+ // Update elapsed time and start attack if necessary
+ if (++self->elapsed_len == frames_per_beat) {
+ self->state = STATE_ATTACK;
+ self->elapsed_len = 0;
+ }
+ }
}
/**
@@ -263,93 +247,93 @@ play(Metro* self, uint32_t begin, uint32_t end)
static void
update_position(Metro* self, const LV2_Atom_Object* obj)
{
- const MetroURIs* uris = &self->uris;
-
- // Received new transport position/speed
- LV2_Atom *beat = NULL, *bpm = NULL, *speed = NULL;
- lv2_atom_object_get(obj,
- uris->time_barBeat, &beat,
- uris->time_beatsPerMinute, &bpm,
- uris->time_speed, &speed,
- NULL);
- if (bpm && bpm->type == uris->atom_Float) {
- // Tempo changed, update BPM
- self->bpm = ((LV2_Atom_Float*)bpm)->body;
- }
- if (speed && speed->type == uris->atom_Float) {
- // Speed changed, e.g. 0 (stop) to 1 (play)
- self->speed = ((LV2_Atom_Float*)speed)->body;
- }
- if (beat && beat->type == uris->atom_Float) {
- // Received a beat position, synchronise
- // This hard sync may cause clicks, a real plugin would be more graceful
- const float frames_per_beat = 60.0f / self->bpm * self->rate;
- const float bar_beats = ((LV2_Atom_Float*)beat)->body;
- const float beat_beats = bar_beats - floorf(bar_beats);
- self->elapsed_len = beat_beats * frames_per_beat;
- if (self->elapsed_len < self->attack_len) {
- self->state = STATE_ATTACK;
- } else if (self->elapsed_len < self->attack_len + self->decay_len) {
- self->state = STATE_DECAY;
- } else {
- self->state = STATE_OFF;
- }
- }
+ const MetroURIs* uris = &self->uris;
+
+ // Received new transport position/speed
+ LV2_Atom* beat = NULL;
+ LV2_Atom* bpm = NULL;
+ LV2_Atom* speed = NULL;
+ // clang-format off
+ lv2_atom_object_get(obj,
+ uris->time_barBeat, &beat,
+ uris->time_beatsPerMinute, &bpm,
+ uris->time_speed, &speed,
+ NULL);
+ // clang-format on
+
+ if (bpm && bpm->type == uris->atom_Float) {
+ // Tempo changed, update BPM
+ self->bpm = ((LV2_Atom_Float*)bpm)->body;
+ }
+ if (speed && speed->type == uris->atom_Float) {
+ // Speed changed, e.g. 0 (stop) to 1 (play)
+ self->speed = ((LV2_Atom_Float*)speed)->body;
+ }
+ if (beat && beat->type == uris->atom_Float) {
+ // Received a beat position, synchronise
+ // This hard sync may cause clicks, a real plugin would be more graceful
+ const float frames_per_beat = (float)(60.0 / self->bpm * self->rate);
+ const float bar_beats = ((LV2_Atom_Float*)beat)->body;
+ const float beat_beats = bar_beats - floorf(bar_beats);
+ self->elapsed_len = (uint32_t)(beat_beats * frames_per_beat);
+ if (self->elapsed_len < self->attack_len) {
+ self->state = STATE_ATTACK;
+ } else if (self->elapsed_len < self->attack_len + self->decay_len) {
+ self->state = STATE_DECAY;
+ } else {
+ self->state = STATE_OFF;
+ }
+ }
}
static void
run(LV2_Handle instance, uint32_t sample_count)
{
- Metro* self = (Metro*)instance;
- const MetroURIs* uris = &self->uris;
-
- // Work forwards in time frame by frame, handling events as we go
- const LV2_Atom_Sequence* in = self->ports.control;
- uint32_t last_t = 0;
- for (const LV2_Atom_Event* ev = lv2_atom_sequence_begin(&in->body);
- !lv2_atom_sequence_is_end(&in->body, in->atom.size, ev);
- ev = lv2_atom_sequence_next(ev)) {
-
- // Play the click for the time slice from last_t until now
- play(self, last_t, ev->time.frames);
-
- // Check if this event is an Object
- // (or deprecated Blank to tolerate old hosts)
- if (ev->body.type == uris->atom_Object ||
- ev->body.type == uris->atom_Blank) {
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
- if (obj->body.otype == uris->time_Position) {
- // Received position information, update
- update_position(self, obj);
- }
- }
-
- // Update time for next iteration and move to next event
- last_t = ev->time.frames;
- }
-
- // Play for remainder of cycle
- play(self, last_t, sample_count);
+ Metro* self = (Metro*)instance;
+ const MetroURIs* uris = &self->uris;
+
+ // Work forwards in time frame by frame, handling events as we go
+ const LV2_Atom_Sequence* in = self->ports.control;
+ uint32_t last_t = 0;
+ for (const LV2_Atom_Event* ev = lv2_atom_sequence_begin(&in->body);
+ !lv2_atom_sequence_is_end(&in->body, in->atom.size, ev);
+ ev = lv2_atom_sequence_next(ev)) {
+ // Play the click for the time slice from last_t until now
+ play(self, last_t, (uint32_t)ev->time.frames);
+
+ // Check if this event is an Object
+ // (or deprecated Blank to tolerate old hosts)
+ if (ev->body.type == uris->atom_Object ||
+ ev->body.type == uris->atom_Blank) {
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
+ if (obj->body.otype == uris->time_Position) {
+ // Received position information, update
+ update_position(self, obj);
+ }
+ }
+
+ // Update time for next iteration and move to next event
+ last_t = (uint32_t)ev->time.frames;
+ }
+
+ // Play for remainder of cycle
+ play(self, last_t, sample_count);
}
static const LV2_Descriptor descriptor = {
- EG_METRO_URI,
- instantiate,
- connect_port,
- activate,
- run,
- NULL, // deactivate,
- cleanup,
- NULL, // extension_data
+ EG_METRO_URI,
+ instantiate,
+ connect_port,
+ activate,
+ run,
+ NULL, // deactivate,
+ cleanup,
+ NULL, // extension_data
};
-LV2_SYMBOL_EXPORT const LV2_Descriptor*
+LV2_SYMBOL_EXPORT
+const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-metro.lv2/waf b/plugins/eg-metro.lv2/waf
deleted file mode 120000
index 59a1ac9..0000000
--- a/plugins/eg-metro.lv2/waf
+++ /dev/null
@@ -1 +0,0 @@
-../../waf \ No newline at end of file
diff --git a/plugins/eg-metro.lv2/wscript b/plugins/eg-metro.lv2/wscript
deleted file mode 100644
index 5fb0d07..0000000
--- a/plugins/eg-metro.lv2/wscript
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-metro.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2 >= 0.2.0', uselib_store='LV2')
-
- conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False)
-
-def build(bld):
- bundle = 'eg-metro.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- bld(features = 'subst',
- source = 'manifest.ttl.in',
- target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Copy other data files to build bundle (build/eg-metro.lv2)
- bld(features = 'subst',
- is_copy = True,
- source = 'metro.ttl',
- target = 'lv2/%s/metro.ttl' % bundle,
- install_path = '${LV2DIR}/%s' % bundle)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'metro.c',
- name = 'metro',
- target = 'lv2/%s/metro' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = ['M', 'LV2'])
diff --git a/plugins/eg-midigate.lv2/meson.build b/plugins/eg-midigate.lv2/meson.build
new file mode 100644
index 0000000..9f0a5ac
--- /dev/null
+++ b/plugins/eg-midigate.lv2/meson.build
@@ -0,0 +1,41 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('midigate.c')
+bundle_name = 'eg-midigate.lv2'
+data_filenames = ['manifest.ttl.in', 'midigate.ttl']
+
+module = shared_library(
+ 'midigate',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+)
+
+config = configuration_data(
+ {
+ 'LIB_EXT': '.' + module.full_path().split('.')[-1],
+ },
+)
+
+foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+endforeach
diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c
index 70901f6..db2fdea 100644
--- a/plugins/eg-midigate.lv2/midigate.c
+++ b/plugins/eg-midigate.lv2/midigate.c
@@ -1,18 +1,5 @@
-/*
- Copyright 2013-2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2013-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "lv2/atom/atom.h"
#include "lv2/atom/util.h"
@@ -32,27 +19,27 @@
#define MIDIGATE_URI "http://lv2plug.in/plugins/eg-midigate"
typedef enum {
- MIDIGATE_CONTROL = 0,
- MIDIGATE_IN = 1,
- MIDIGATE_OUT = 2
+ MIDIGATE_CONTROL = 0,
+ MIDIGATE_IN = 1,
+ MIDIGATE_OUT = 2
} PortIndex;
typedef struct {
- // Port buffers
- const LV2_Atom_Sequence* control;
- const float* in;
- float* out;
+ // Port buffers
+ const LV2_Atom_Sequence* control;
+ const float* in;
+ float* out;
- // Features
- LV2_URID_Map* map;
- LV2_Log_Logger logger;
+ // Features
+ LV2_URID_Map* map;
+ LV2_Log_Logger logger;
- struct {
- LV2_URID midi_MidiEvent;
- } uris;
+ struct {
+ LV2_URID midi_MidiEvent;
+ } uris;
- unsigned n_active_notes;
- unsigned program; // 0 = normal, 1 = inverted
+ unsigned n_active_notes;
+ unsigned program; // 0 = normal, 1 = inverted
} Midigate;
static LV2_Handle
@@ -61,56 +48,57 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
- Midigate* self = (Midigate*)calloc(1, sizeof(Midigate));
- if (!self) {
- return NULL;
- }
-
- // Scan host features for URID map
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &self->logger.log, false,
- LV2_URID__map, &self->map, true,
- NULL);
- lv2_log_logger_set_map(&self->logger, self->map);
- if (missing) {
- lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
- free(self);
- return NULL;
- }
-
- self->uris.midi_MidiEvent = self->map->map(
- self->map->handle, LV2_MIDI__MidiEvent);
-
- return (LV2_Handle)self;
+ Midigate* self = (Midigate*)calloc(1, sizeof(Midigate));
+ if (!self) {
+ return NULL;
+ }
+
+ // Scan host features for URID map
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &self->logger.log, false,
+ LV2_URID__map, &self->map, true,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&self->logger, self->map);
+ if (missing) {
+ lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
+ free(self);
+ return NULL;
+ }
+
+ self->uris.midi_MidiEvent =
+ self->map->map(self->map->handle, LV2_MIDI__MidiEvent);
+
+ return (LV2_Handle)self;
}
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- Midigate* self = (Midigate*)instance;
-
- switch ((PortIndex)port) {
- case MIDIGATE_CONTROL:
- self->control = (const LV2_Atom_Sequence*)data;
- break;
- case MIDIGATE_IN:
- self->in = (const float*)data;
- break;
- case MIDIGATE_OUT:
- self->out = (float*)data;
- break;
- }
+ Midigate* self = (Midigate*)instance;
+
+ switch ((PortIndex)port) {
+ case MIDIGATE_CONTROL:
+ self->control = (const LV2_Atom_Sequence*)data;
+ break;
+ case MIDIGATE_IN:
+ self->in = (const float*)data;
+ break;
+ case MIDIGATE_OUT:
+ self->out = (float*)data;
+ break;
+ }
}
static void
activate(LV2_Handle instance)
{
- Midigate* self = (Midigate*)instance;
- self->n_active_notes = 0;
- self->program = 0;
+ Midigate* self = (Midigate*)instance;
+ self->n_active_notes = 0;
+ self->program = 0;
}
/**
@@ -121,14 +109,13 @@ activate(LV2_Handle instance)
static void
write_output(Midigate* self, uint32_t offset, uint32_t len)
{
- const bool active = (self->program == 0)
- ? (self->n_active_notes > 0)
- : (self->n_active_notes == 0);
- if (active) {
- memcpy(self->out + offset, self->in + offset, len * sizeof(float));
- } else {
- memset(self->out + offset, 0, len * sizeof(float));
- }
+ const bool active = (self->program == 0) ? (self->n_active_notes > 0)
+ : (self->n_active_notes == 0);
+ if (active) {
+ memcpy(self->out + offset, self->in + offset, len * sizeof(float));
+ } else {
+ memset(self->out + offset, 0, len * sizeof(float));
+ }
}
/**
@@ -156,40 +143,41 @@ write_output(Midigate* self, uint32_t offset, uint32_t len)
static void
run(LV2_Handle instance, uint32_t sample_count)
{
- Midigate* self = (Midigate*)instance;
- uint32_t offset = 0;
-
- LV2_ATOM_SEQUENCE_FOREACH(self->control, ev) {
- if (ev->body.type == self->uris.midi_MidiEvent) {
- const uint8_t* const msg = (const uint8_t*)(ev + 1);
- switch (lv2_midi_message_type(msg)) {
- case LV2_MIDI_MSG_NOTE_ON:
- ++self->n_active_notes;
- break;
- case LV2_MIDI_MSG_NOTE_OFF:
- if (self->n_active_notes > 0) {
- --self->n_active_notes;
- }
- break;
- case LV2_MIDI_MSG_CONTROLLER:
- if (msg[1] == LV2_MIDI_CTL_ALL_NOTES_OFF) {
- self->n_active_notes = 0;
- }
- break;
- case LV2_MIDI_MSG_PGM_CHANGE:
- if (msg[1] == 0 || msg[1] == 1) {
- self->program = msg[1];
- }
- break;
- default: break;
- }
- }
-
- write_output(self, offset, ev->time.frames - offset);
- offset = (uint32_t)ev->time.frames;
- }
-
- write_output(self, offset, sample_count - offset);
+ Midigate* self = (Midigate*)instance;
+ uint32_t offset = 0;
+
+ LV2_ATOM_SEQUENCE_FOREACH (self->control, ev) {
+ write_output(self, offset, (uint32_t)(ev->time.frames - offset));
+ offset = (uint32_t)ev->time.frames;
+
+ if (ev->body.type == self->uris.midi_MidiEvent) {
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
+ switch (lv2_midi_message_type(msg)) {
+ case LV2_MIDI_MSG_NOTE_ON:
+ ++self->n_active_notes;
+ break;
+ case LV2_MIDI_MSG_NOTE_OFF:
+ if (self->n_active_notes > 0) {
+ --self->n_active_notes;
+ }
+ break;
+ case LV2_MIDI_MSG_CONTROLLER:
+ if (msg[1] == LV2_MIDI_CTL_ALL_NOTES_OFF) {
+ self->n_active_notes = 0;
+ }
+ break;
+ case LV2_MIDI_MSG_PGM_CHANGE:
+ if (msg[1] == 0 || msg[1] == 1) {
+ self->program = msg[1];
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ write_output(self, offset, sample_count - offset);
}
/**
@@ -204,7 +192,7 @@ deactivate(LV2_Handle instance)
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
/**
@@ -213,28 +201,21 @@ cleanup(LV2_Handle instance)
static const void*
extension_data(const char* uri)
{
- return NULL;
+ return NULL;
}
-static const LV2_Descriptor descriptor = {
- MIDIGATE_URI,
- instantiate,
- connect_port,
- activate,
- run,
- deactivate,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor = {MIDIGATE_URI,
+ instantiate,
+ connect_port,
+ activate,
+ run,
+ deactivate,
+ cleanup,
+ extension_data};
LV2_SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-midigate.lv2/waf b/plugins/eg-midigate.lv2/waf
deleted file mode 120000
index 59a1ac9..0000000
--- a/plugins/eg-midigate.lv2/waf
+++ /dev/null
@@ -1 +0,0 @@
-../../waf \ No newline at end of file
diff --git a/plugins/eg-midigate.lv2/wscript b/plugins/eg-midigate.lv2/wscript
deleted file mode 100644
index 5862721..0000000
--- a/plugins/eg-midigate.lv2/wscript
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-midigate.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2', uselib_store='LV2')
-
-def build(bld):
- bundle = 'eg-midigate.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- bld(features = 'subst',
- source = 'manifest.ttl.in',
- target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Copy other data files to build bundle (build/eg-midigate.lv2)
- for i in ['midigate.ttl']:
- bld(features = 'subst',
- is_copy = True,
- source = i,
- target = 'lv2/%s/%s' % (bundle, i),
- install_path = '${LV2DIR}/%s' % bundle)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'midigate.c',
- name = 'midigate',
- target = 'lv2/%s/midigate' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- uselib = 'LV2')
diff --git a/plugins/eg-params.lv2/meson.build b/plugins/eg-params.lv2/meson.build
new file mode 100644
index 0000000..00602bc
--- /dev/null
+++ b/plugins/eg-params.lv2/meson.build
@@ -0,0 +1,41 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('params.c')
+bundle_name = 'eg-params.lv2'
+data_filenames = ['manifest.ttl.in', 'params.ttl']
+
+module = shared_library(
+ 'params',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+)
+
+config = configuration_data(
+ {
+ 'LIB_EXT': '.' + module.full_path().split('.')[-1],
+ },
+)
+
+foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+endforeach
diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c
index 94d34a5..af96fc8 100644
--- a/plugins/eg-params.lv2/params.c
+++ b/plugins/eg-params.lv2/params.c
@@ -1,19 +1,5 @@
-/*
- LV2 Parameter Example Plugin
- Copyright 2014-2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2014-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "state_map.h"
@@ -37,106 +23,101 @@
#define MAX_STRING 1024
-#define EG_PARAMS_URI "http://lv2plug.in/plugins/eg-params"
+#define EG_PARAMS_URI "http://lv2plug.in/plugins/eg-params"
#define N_PROPS 9
typedef struct {
- LV2_URID plugin;
- LV2_URID atom_Path;
- LV2_URID atom_Sequence;
- LV2_URID atom_URID;
- LV2_URID atom_eventTransfer;
- LV2_URID eg_spring;
- LV2_URID midi_Event;
- LV2_URID patch_Get;
- LV2_URID patch_Set;
- LV2_URID patch_Put;
- LV2_URID patch_body;
- LV2_URID patch_subject;
- LV2_URID patch_property;
- LV2_URID patch_value;
+ LV2_URID plugin;
+ LV2_URID atom_Path;
+ LV2_URID atom_Sequence;
+ LV2_URID atom_URID;
+ LV2_URID atom_eventTransfer;
+ LV2_URID eg_spring;
+ LV2_URID midi_Event;
+ LV2_URID patch_Get;
+ LV2_URID patch_Set;
+ LV2_URID patch_Put;
+ LV2_URID patch_body;
+ LV2_URID patch_subject;
+ LV2_URID patch_property;
+ LV2_URID patch_value;
} URIs;
typedef struct {
- LV2_Atom_Int aint;
- LV2_Atom_Long along;
- LV2_Atom_Float afloat;
- LV2_Atom_Double adouble;
- LV2_Atom_Bool abool;
- LV2_Atom astring;
- char string[MAX_STRING];
- LV2_Atom apath;
- char path[MAX_STRING];
- LV2_Atom_Float lfo;
- LV2_Atom_Float spring;
+ LV2_Atom_Int aint;
+ LV2_Atom_Long along;
+ LV2_Atom_Float afloat;
+ LV2_Atom_Double adouble;
+ LV2_Atom_Bool abool;
+ LV2_Atom astring;
+ char string[MAX_STRING];
+ LV2_Atom apath;
+ char path[MAX_STRING];
+ LV2_Atom_Float lfo;
+ LV2_Atom_Float spring;
} State;
static inline void
map_uris(LV2_URID_Map* map, URIs* uris)
{
- uris->plugin = map->map(map->handle, EG_PARAMS_URI);
-
- uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
- uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
- uris->atom_URID = map->map(map->handle, LV2_ATOM__URID);
- uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
- uris->eg_spring = map->map(map->handle, EG_PARAMS_URI "#spring");
- uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent);
- uris->patch_Get = map->map(map->handle, LV2_PATCH__Get);
- uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
- uris->patch_Put = map->map(map->handle, LV2_PATCH__Put);
- uris->patch_body = map->map(map->handle, LV2_PATCH__body);
- uris->patch_subject = map->map(map->handle, LV2_PATCH__subject);
- uris->patch_property = map->map(map->handle, LV2_PATCH__property);
- uris->patch_value = map->map(map->handle, LV2_PATCH__value);
+ uris->plugin = map->map(map->handle, EG_PARAMS_URI);
+
+ uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
+ uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
+ uris->atom_URID = map->map(map->handle, LV2_ATOM__URID);
+ uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
+ uris->eg_spring = map->map(map->handle, EG_PARAMS_URI "#spring");
+ uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent);
+ uris->patch_Get = map->map(map->handle, LV2_PATCH__Get);
+ uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
+ uris->patch_Put = map->map(map->handle, LV2_PATCH__Put);
+ uris->patch_body = map->map(map->handle, LV2_PATCH__body);
+ uris->patch_subject = map->map(map->handle, LV2_PATCH__subject);
+ uris->patch_property = map->map(map->handle, LV2_PATCH__property);
+ uris->patch_value = map->map(map->handle, LV2_PATCH__value);
}
-enum {
- PARAMS_IN = 0,
- PARAMS_OUT = 1
-};
+enum { PARAMS_IN = 0, PARAMS_OUT = 1 };
typedef struct {
- // Features
- LV2_URID_Map* map;
- LV2_URID_Unmap* unmap;
- LV2_Log_Logger log;
+ // Features
+ LV2_URID_Map* map;
+ LV2_URID_Unmap* unmap;
+ LV2_Log_Logger log;
- // Forge for creating atoms
- LV2_Atom_Forge forge;
+ // Forge for creating atoms
+ LV2_Atom_Forge forge;
- // Ports
- const LV2_Atom_Sequence* in_port;
- LV2_Atom_Sequence* out_port;
+ // Ports
+ const LV2_Atom_Sequence* in_port;
+ LV2_Atom_Sequence* out_port;
- // URIs
- URIs uris;
+ // URIs
+ URIs uris;
- // Plugin state
- StateMapItem props[N_PROPS];
- State state;
+ // Plugin state
+ StateMapItem props[N_PROPS];
+ State state;
- // Buffer for making strings from URIDs if unmap is not provided
- char urid_buf[12];
+ // Buffer for making strings from URIDs if unmap is not provided
+ char urid_buf[12];
} Params;
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- Params* self = (Params*)instance;
- switch (port) {
- case PARAMS_IN:
- self->in_port = (const LV2_Atom_Sequence*)data;
- break;
- case PARAMS_OUT:
- self->out_port = (LV2_Atom_Sequence*)data;
- break;
- default:
- break;
- }
+ Params* self = (Params*)instance;
+ switch (port) {
+ case PARAMS_IN:
+ self->in_port = (const LV2_Atom_Sequence*)data;
+ break;
+ case PARAMS_OUT:
+ self->out_port = (LV2_Atom_Sequence*)data;
+ break;
+ default:
+ break;
+ }
}
static LV2_Handle
@@ -145,81 +126,83 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
- // Allocate instance
- Params* self = (Params*)calloc(1, sizeof(Params));
- if (!self) {
- return NULL;
- }
-
- // Get host features
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &self->log.log, false,
- LV2_URID__map, &self->map, true,
- LV2_URID__unmap, &self->unmap, false,
- NULL);
- lv2_log_logger_set_map(&self->log, self->map);
- if (missing) {
- lv2_log_error(&self->log, "Missing feature <%s>\n", missing);
- free(self);
- return NULL;
- }
-
- // Map URIs and initialise forge
- map_uris(self->map, &self->uris);
- lv2_atom_forge_init(&self->forge, self->map);
-
- // Initialise state dictionary
- State* state = &self->state;
- state_map_init(
- self->props, self->map, self->map->handle,
- EG_PARAMS_URI "#int", STATE_MAP_INIT(Int, &state->aint),
- EG_PARAMS_URI "#long", STATE_MAP_INIT(Long, &state->along),
- EG_PARAMS_URI "#float", STATE_MAP_INIT(Float, &state->afloat),
- EG_PARAMS_URI "#double", STATE_MAP_INIT(Double, &state->adouble),
- EG_PARAMS_URI "#bool", STATE_MAP_INIT(Bool, &state->abool),
- EG_PARAMS_URI "#string", STATE_MAP_INIT(String, &state->astring),
- EG_PARAMS_URI "#path", STATE_MAP_INIT(Path, &state->apath),
- EG_PARAMS_URI "#lfo", STATE_MAP_INIT(Float, &state->lfo),
- EG_PARAMS_URI "#spring", STATE_MAP_INIT(Float, &state->spring),
- NULL);
-
- return (LV2_Handle)self;
+ // Allocate instance
+ Params* self = (Params*)calloc(1, sizeof(Params));
+ if (!self) {
+ return NULL;
+ }
+
+ // Get host features
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &self->log.log, false,
+ LV2_URID__map, &self->map, true,
+ LV2_URID__unmap, &self->unmap, false,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&self->log, self->map);
+ if (missing) {
+ lv2_log_error(&self->log, "Missing feature <%s>\n", missing);
+ free(self);
+ return NULL;
+ }
+
+ // Map URIs and initialise forge
+ map_uris(self->map, &self->uris);
+ lv2_atom_forge_init(&self->forge, self->map);
+
+ // Initialise state dictionary
+ // clang-format off
+ State* state = &self->state;
+ state_map_init(
+ self->props, self->map, self->map->handle,
+ EG_PARAMS_URI "#int", STATE_MAP_INIT(Int, &state->aint),
+ EG_PARAMS_URI "#long", STATE_MAP_INIT(Long, &state->along),
+ EG_PARAMS_URI "#float", STATE_MAP_INIT(Float, &state->afloat),
+ EG_PARAMS_URI "#double", STATE_MAP_INIT(Double, &state->adouble),
+ EG_PARAMS_URI "#bool", STATE_MAP_INIT(Bool, &state->abool),
+ EG_PARAMS_URI "#string", STATE_MAP_INIT(String, &state->astring),
+ EG_PARAMS_URI "#path", STATE_MAP_INIT(Path, &state->apath),
+ EG_PARAMS_URI "#lfo", STATE_MAP_INIT(Float, &state->lfo),
+ EG_PARAMS_URI "#spring", STATE_MAP_INIT(Float, &state->spring),
+ NULL);
+ // clang-format on
+
+ return (LV2_Handle)self;
}
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
/** Helper function to unmap a URID if possible. */
static const char*
unmap(Params* self, LV2_URID urid)
{
- if (self->unmap) {
- return self->unmap->unmap(self->unmap->handle, urid);
- } else {
- snprintf(self->urid_buf, sizeof(self->urid_buf), "%u", urid);
- return self->urid_buf;
- }
+ if (self->unmap) {
+ return self->unmap->unmap(self->unmap->handle, urid);
+ }
+
+ snprintf(self->urid_buf, sizeof(self->urid_buf), "%u", urid);
+ return self->urid_buf;
}
static LV2_State_Status
-check_type(Params* self,
- LV2_URID key,
- LV2_URID type,
- LV2_URID required_type)
+check_type(Params* self, LV2_URID key, LV2_URID type, LV2_URID required_type)
{
- if (type != required_type) {
- lv2_log_trace(
- &self->log, "Bad type <%s> for <%s> (needs <%s>)\n",
- unmap(self, type),
- unmap(self, key),
- unmap(self, required_type));
- return LV2_STATE_ERR_BAD_TYPE;
- }
- return LV2_STATE_SUCCESS;
+ if (type != required_type) {
+ lv2_log_trace(&self->log,
+ "Bad type <%s> for <%s> (needs <%s>)\n",
+ unmap(self, type),
+ unmap(self, key),
+ unmap(self, required_type));
+ return LV2_STATE_ERR_BAD_TYPE;
+ }
+ return LV2_STATE_SUCCESS;
}
static LV2_State_Status
@@ -230,36 +213,36 @@ set_parameter(Params* self,
const void* body,
bool from_state)
{
- // Look up property in state dictionary
- const StateMapItem* entry = state_map_find(self->props, N_PROPS, key);
- if (!entry) {
- lv2_log_trace(&self->log, "Unknown parameter <%s>\n", unmap(self, key));
- return LV2_STATE_ERR_NO_PROPERTY;
- }
-
- // Ensure given type matches property's type
- if (check_type(self, key, type, entry->value->type)) {
- return LV2_STATE_ERR_BAD_TYPE;
- }
-
- // Set property value in state dictionary
- lv2_log_trace(&self->log, "Set <%s>\n", entry->uri);
- memcpy(entry->value + 1, body, size);
- entry->value->size = size;
- return LV2_STATE_SUCCESS;
+ // Look up property in state dictionary
+ const StateMapItem* entry = state_map_find(self->props, N_PROPS, key);
+ if (!entry) {
+ lv2_log_trace(&self->log, "Unknown parameter <%s>\n", unmap(self, key));
+ return LV2_STATE_ERR_NO_PROPERTY;
+ }
+
+ // Ensure given type matches property's type
+ if (check_type(self, key, type, entry->value->type)) {
+ return LV2_STATE_ERR_BAD_TYPE;
+ }
+
+ // Set property value in state dictionary
+ lv2_log_trace(&self->log, "Set <%s>\n", entry->uri);
+ memcpy(entry->value + 1, body, size);
+ entry->value->size = size;
+ return LV2_STATE_SUCCESS;
}
static const LV2_Atom*
get_parameter(Params* self, LV2_URID key)
{
- const StateMapItem* entry = state_map_find(self->props, N_PROPS, key);
- if (entry) {
- lv2_log_trace(&self->log, "Get <%s>\n", entry->uri);
- return entry->value;
- }
-
- lv2_log_trace(&self->log, "Unknown parameter <%s>\n", unmap(self, key));
- return NULL;
+ const StateMapItem* entry = state_map_find(self->props, N_PROPS, key);
+ if (entry) {
+ lv2_log_trace(&self->log, "Get <%s>\n", entry->uri);
+ return entry->value;
+ }
+
+ lv2_log_trace(&self->log, "Unknown parameter <%s>\n", unmap(self, key));
+ return NULL;
}
static LV2_State_Status
@@ -270,15 +253,15 @@ write_param_to_forge(LV2_State_Handle handle,
uint32_t type,
uint32_t flags)
{
- LV2_Atom_Forge* forge = (LV2_Atom_Forge*)handle;
+ LV2_Atom_Forge* forge = (LV2_Atom_Forge*)handle;
- if (!lv2_atom_forge_key(forge, key) ||
- !lv2_atom_forge_atom(forge, size, type) ||
- !lv2_atom_forge_write(forge, value, size)) {
- return LV2_STATE_ERR_UNKNOWN;
- }
+ if (!lv2_atom_forge_key(forge, key) ||
+ !lv2_atom_forge_atom(forge, size, type) ||
+ !lv2_atom_forge_write(forge, value, size)) {
+ return LV2_STATE_ERR_UNKNOWN;
+ }
- return LV2_STATE_SUCCESS;
+ return LV2_STATE_SUCCESS;
}
static void
@@ -290,31 +273,31 @@ store_prop(Params* self,
LV2_URID key,
const LV2_Atom* value)
{
- LV2_State_Status st;
- if (map_path && value->type == self->uris.atom_Path) {
- // Map path to abstract path for portable storage
- const char* path = (const char*)(value + 1);
- char* apath = map_path->abstract_path(map_path->handle, path);
- st = store(handle,
- key,
- apath,
- strlen(apath) + 1,
- self->uris.atom_Path,
- LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
- free(apath);
- } else {
- // Store simple property
- st = store(handle,
- key,
- value + 1,
- value->size,
- value->type,
- LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
- }
-
- if (save_status && !*save_status) {
- *save_status = st;
- }
+ LV2_State_Status st = LV2_STATE_SUCCESS;
+ if (map_path && value->type == self->uris.atom_Path) {
+ // Map path to abstract path for portable storage
+ const char* path = (const char*)(value + 1);
+ char* apath = map_path->abstract_path(map_path->handle, path);
+ st = store(handle,
+ key,
+ apath,
+ strlen(apath) + 1,
+ self->uris.atom_Path,
+ LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
+ free(apath);
+ } else {
+ // Store simple property
+ st = store(handle,
+ key,
+ value + 1,
+ value->size,
+ value->type,
+ LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
+ }
+
+ if (save_status && !*save_status) {
+ *save_status = st;
+ }
}
/**
@@ -331,17 +314,17 @@ save(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- Params* self = (Params*)instance;
- LV2_State_Map_Path* map_path = (LV2_State_Map_Path*)lv2_features_data(
- features, LV2_STATE__mapPath);
+ Params* self = (Params*)instance;
+ LV2_State_Map_Path* map_path =
+ (LV2_State_Map_Path*)lv2_features_data(features, LV2_STATE__mapPath);
- LV2_State_Status st = LV2_STATE_SUCCESS;
- for (unsigned i = 0; i < N_PROPS; ++i) {
- StateMapItem* prop = &self->props[i];
- store_prop(self, map_path, &st, store, handle, prop->urid, prop->value);
- }
+ LV2_State_Status st = LV2_STATE_SUCCESS;
+ for (unsigned i = 0; i < N_PROPS; ++i) {
+ StateMapItem* prop = &self->props[i];
+ store_prop(self, map_path, &st, store, handle, prop->urid, prop->value);
+ }
- return st;
+ return st;
}
static void
@@ -351,20 +334,20 @@ retrieve_prop(Params* self,
LV2_State_Handle handle,
LV2_URID key)
{
- // Retrieve value from saved state
- size_t vsize;
- uint32_t vtype;
- uint32_t vflags;
- const void* value = retrieve(handle, key, &vsize, &vtype, &vflags);
-
- // Set plugin instance state
- const LV2_State_Status st = value
- ? set_parameter(self, key, vsize, vtype, value, true)
- : LV2_STATE_ERR_NO_PROPERTY;
-
- if (!*restore_status) {
- *restore_status = st; // Set status if there has been no error yet
- }
+ // Retrieve value from saved state
+ size_t vsize = 0;
+ uint32_t vtype = 0;
+ uint32_t vflags = 0;
+ const void* value = retrieve(handle, key, &vsize, &vtype, &vflags);
+
+ // Set plugin instance state
+ const LV2_State_Status st =
+ value ? set_parameter(self, key, vsize, vtype, value, true)
+ : LV2_STATE_ERR_NO_PROPERTY;
+
+ if (!*restore_status) {
+ *restore_status = st; // Set status if there has been no error yet
+ }
}
/** State restore method. */
@@ -375,152 +358,163 @@ restore(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- Params* self = (Params*)instance;
- LV2_State_Status st = LV2_STATE_SUCCESS;
+ Params* self = (Params*)instance;
+ LV2_State_Status st = LV2_STATE_SUCCESS;
- for (unsigned i = 0; i < N_PROPS; ++i) {
- retrieve_prop(self, &st, retrieve, handle, self->props[i].urid);
- }
+ for (unsigned i = 0; i < N_PROPS; ++i) {
+ retrieve_prop(self, &st, retrieve, handle, self->props[i].urid);
+ }
- return st;
+ return st;
}
static inline bool
subject_is_plugin(Params* self, const LV2_Atom_URID* subject)
{
- // This simple plugin only supports one subject: itself
- return (!subject || (subject->atom.type == self->uris.atom_URID &&
- subject->body == self->uris.plugin));
+ // This simple plugin only supports one subject: itself
+ return (!subject || (subject->atom.type == self->uris.atom_URID &&
+ subject->body == self->uris.plugin));
}
static void
run(LV2_Handle instance, uint32_t sample_count)
{
- Params* self = (Params*)instance;
- URIs* uris = &self->uris;
-
- // Initially, self->out_port contains a Chunk with size set to capacity
- // Set up forge to write directly to output port
- const uint32_t out_capacity = self->out_port->atom.size;
- lv2_atom_forge_set_buffer(&self->forge,
- (uint8_t*)self->out_port,
- out_capacity);
-
- // Start a sequence in the output port
- LV2_Atom_Forge_Frame out_frame;
- lv2_atom_forge_sequence_head(&self->forge, &out_frame, 0);
-
- // Read incoming events
- LV2_ATOM_SEQUENCE_FOREACH(self->in_port, ev) {
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
- if (obj->body.otype == uris->patch_Set) {
- // Get the property and value of the set message
- const LV2_Atom_URID* subject = NULL;
- const LV2_Atom_URID* property = NULL;
- const LV2_Atom* value = NULL;
- lv2_atom_object_get(obj,
- uris->patch_subject, (const LV2_Atom**)&subject,
- uris->patch_property, (const LV2_Atom**)&property,
- uris->patch_value, &value,
- 0);
- if (!subject_is_plugin(self, subject)) {
- lv2_log_error(&self->log, "Set for unknown subject\n");
- } else if (!property) {
- lv2_log_error(&self->log, "Set with no property\n");
- } else if (property->atom.type != uris->atom_URID) {
- lv2_log_error(&self->log, "Set property is not a URID\n");
- } else {
- // Set property to the given value
- const LV2_URID key = property->body;
- set_parameter(self, key, value->size, value->type, value + 1, false);
- }
- } else if (obj->body.otype == uris->patch_Get) {
- // Get the property of the get message
- const LV2_Atom_URID* subject = NULL;
- const LV2_Atom_URID* property = NULL;
- lv2_atom_object_get(obj,
- uris->patch_subject, (const LV2_Atom**)&subject,
- uris->patch_property, (const LV2_Atom**)&property,
- 0);
- if (!subject_is_plugin(self, subject)) {
- lv2_log_error(&self->log, "Get with unknown subject\n");
- } else if (!property) {
- // Get with no property, emit complete state
- lv2_atom_forge_frame_time(&self->forge, ev->time.frames);
- LV2_Atom_Forge_Frame pframe;
- lv2_atom_forge_object(&self->forge, &pframe, 0, uris->patch_Put);
- lv2_atom_forge_key(&self->forge, uris->patch_body);
-
- LV2_Atom_Forge_Frame bframe;
- lv2_atom_forge_object(&self->forge, &bframe, 0, 0);
- save(self, write_param_to_forge, &self->forge, 0, NULL);
-
- lv2_atom_forge_pop(&self->forge, &bframe);
- lv2_atom_forge_pop(&self->forge, &pframe);
- } else if (property->atom.type != uris->atom_URID) {
- lv2_log_error(&self->log, "Get property is not a URID\n");
- } else {
- // Get for a specific property
- const LV2_URID key = property->body;
- const LV2_Atom* value = get_parameter(self, key);
- if (value) {
- lv2_atom_forge_frame_time(&self->forge, ev->time.frames);
- LV2_Atom_Forge_Frame frame;
- lv2_atom_forge_object(&self->forge, &frame, 0, uris->patch_Set);
- lv2_atom_forge_key(&self->forge, uris->patch_property);
- lv2_atom_forge_urid(&self->forge, property->body);
- store_prop(self, NULL, NULL, write_param_to_forge, &self->forge,
- uris->patch_value, value);
- lv2_atom_forge_pop(&self->forge, &frame);
- }
- }
- } else {
- lv2_log_trace(&self->log, "Unknown object type <%s>\n",
- unmap(self, obj->body.otype));
- }
- }
-
- if (self->state.spring.body > 0.0f) {
- const float spring = self->state.spring.body;
- self->state.spring.body = (spring >= 0.001) ? spring - 0.001 : 0.0;
- lv2_atom_forge_frame_time(&self->forge, 0);
- LV2_Atom_Forge_Frame frame;
- lv2_atom_forge_object(&self->forge, &frame, 0, uris->patch_Set);
-
- lv2_atom_forge_key(&self->forge, uris->patch_property);
- lv2_atom_forge_urid(&self->forge, uris->eg_spring);
- lv2_atom_forge_key(&self->forge, uris->patch_value);
- lv2_atom_forge_float(&self->forge, self->state.spring.body);
-
- lv2_atom_forge_pop(&self->forge, &frame);
- }
-
- lv2_atom_forge_pop(&self->forge, &out_frame);
+ Params* self = (Params*)instance;
+ URIs* uris = &self->uris;
+
+ // Initially, self->out_port contains a Chunk with size set to capacity
+ // Set up forge to write directly to output port
+ const uint32_t out_capacity = self->out_port->atom.size;
+ lv2_atom_forge_set_buffer(
+ &self->forge, (uint8_t*)self->out_port, out_capacity);
+
+ // Start a sequence in the output port
+ LV2_Atom_Forge_Frame out_frame;
+ lv2_atom_forge_sequence_head(&self->forge, &out_frame, 0);
+
+ // Read incoming events
+ LV2_ATOM_SEQUENCE_FOREACH (self->in_port, ev) {
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
+ if (obj->body.otype == uris->patch_Set) {
+ // Get the property and value of the set message
+ const LV2_Atom_URID* subject = NULL;
+ const LV2_Atom_URID* property = NULL;
+ const LV2_Atom* value = NULL;
+
+ // clang-format off
+ lv2_atom_object_get(obj,
+ uris->patch_subject, (const LV2_Atom**)&subject,
+ uris->patch_property, (const LV2_Atom**)&property,
+ uris->patch_value, &value,
+ 0);
+ // clang-format on
+
+ if (!subject_is_plugin(self, subject)) {
+ lv2_log_error(&self->log, "Set for unknown subject\n");
+ } else if (!property) {
+ lv2_log_error(&self->log, "Set with no property\n");
+ } else if (property->atom.type != uris->atom_URID) {
+ lv2_log_error(&self->log, "Set property is not a URID\n");
+ } else {
+ // Set property to the given value
+ const LV2_URID key = property->body;
+ set_parameter(self, key, value->size, value->type, value + 1, false);
+ }
+ } else if (obj->body.otype == uris->patch_Get) {
+ // Get the property of the get message
+ const LV2_Atom_URID* subject = NULL;
+ const LV2_Atom_URID* property = NULL;
+
+ // clang-format off
+ lv2_atom_object_get(obj,
+ uris->patch_subject, (const LV2_Atom**)&subject,
+ uris->patch_property, (const LV2_Atom**)&property,
+ 0);
+ // clang-format on
+
+ if (!subject_is_plugin(self, subject)) {
+ lv2_log_error(&self->log, "Get with unknown subject\n");
+ } else if (!property) {
+ // Get with no property, emit complete state
+ lv2_atom_forge_frame_time(&self->forge, ev->time.frames);
+ LV2_Atom_Forge_Frame pframe;
+ lv2_atom_forge_object(&self->forge, &pframe, 0, uris->patch_Put);
+ lv2_atom_forge_key(&self->forge, uris->patch_body);
+
+ LV2_Atom_Forge_Frame bframe;
+ lv2_atom_forge_object(&self->forge, &bframe, 0, 0);
+ save(self, write_param_to_forge, &self->forge, 0, NULL);
+
+ lv2_atom_forge_pop(&self->forge, &bframe);
+ lv2_atom_forge_pop(&self->forge, &pframe);
+ } else if (property->atom.type != uris->atom_URID) {
+ lv2_log_error(&self->log, "Get property is not a URID\n");
+ } else {
+ // Get for a specific property
+ const LV2_URID key = property->body;
+ const LV2_Atom* value = get_parameter(self, key);
+ if (value) {
+ lv2_atom_forge_frame_time(&self->forge, ev->time.frames);
+ LV2_Atom_Forge_Frame frame;
+ lv2_atom_forge_object(&self->forge, &frame, 0, uris->patch_Set);
+ lv2_atom_forge_key(&self->forge, uris->patch_property);
+ lv2_atom_forge_urid(&self->forge, property->body);
+ store_prop(self,
+ NULL,
+ NULL,
+ write_param_to_forge,
+ &self->forge,
+ uris->patch_value,
+ value);
+ lv2_atom_forge_pop(&self->forge, &frame);
+ }
+ }
+ } else {
+ lv2_log_trace(
+ &self->log, "Unknown object type <%s>\n", unmap(self, obj->body.otype));
+ }
+ }
+
+ if (self->state.spring.body > 0.0f) {
+ const float spring = self->state.spring.body;
+ self->state.spring.body = (spring >= 0.001) ? spring - 0.001f : 0.0f;
+ lv2_atom_forge_frame_time(&self->forge, 0);
+ LV2_Atom_Forge_Frame frame;
+ lv2_atom_forge_object(&self->forge, &frame, 0, uris->patch_Set);
+
+ lv2_atom_forge_key(&self->forge, uris->patch_property);
+ lv2_atom_forge_urid(&self->forge, uris->eg_spring);
+ lv2_atom_forge_key(&self->forge, uris->patch_value);
+ lv2_atom_forge_float(&self->forge, self->state.spring.body);
+
+ lv2_atom_forge_pop(&self->forge, &frame);
+ }
+
+ lv2_atom_forge_pop(&self->forge, &out_frame);
}
static const void*
extension_data(const char* uri)
{
- static const LV2_State_Interface state = { save, restore };
- if (!strcmp(uri, LV2_STATE__interface)) {
- return &state;
- }
- return NULL;
+ static const LV2_State_Interface state = {save, restore};
+ if (!strcmp(uri, LV2_STATE__interface)) {
+ return &state;
+ }
+ return NULL;
}
-static const LV2_Descriptor descriptor = {
- EG_PARAMS_URI,
- instantiate,
- connect_port,
- NULL, // activate,
- run,
- NULL, // deactivate,
- cleanup,
- extension_data
-};
-
-LV2_SYMBOL_EXPORT const LV2_Descriptor*
+static const LV2_Descriptor descriptor = {EG_PARAMS_URI,
+ instantiate,
+ connect_port,
+ NULL, // activate,
+ run,
+ NULL, // deactivate,
+ cleanup,
+ extension_data};
+
+LV2_SYMBOL_EXPORT
+const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- return (index == 0) ? &descriptor : NULL;
+ return (index == 0) ? &descriptor : NULL;
}
diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h
index 9e7b63e..2a29e09 100644
--- a/plugins/eg-params.lv2/state_map.h
+++ b/plugins/eg-params.lv2/state_map.h
@@ -1,55 +1,40 @@
-/*
- LV2 State Map
- Copyright 2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "lv2/atom/atom.h"
#include "lv2/urid/urid.h"
#include <stdarg.h>
+#include <stdint.h>
#include <stdlib.h>
/** Entry in an array that serves as a dictionary of properties. */
typedef struct {
- const char* uri;
- LV2_URID urid;
- LV2_Atom* value;
+ const char* uri;
+ LV2_URID urid;
+ LV2_Atom* value;
} StateMapItem;
/** Comparator for StateMapItems sorted by URID. */
static int
state_map_cmp(const void* a, const void* b)
{
- const StateMapItem* ka = (const StateMapItem*)a;
- const StateMapItem* kb = (const StateMapItem*)b;
- if (ka->urid < kb->urid) {
- return -1;
- }
+ const StateMapItem* ka = (const StateMapItem*)a;
+ const StateMapItem* kb = (const StateMapItem*)b;
+ if (ka->urid < kb->urid) {
+ return -1;
+ }
- if (kb->urid < ka->urid) {
- return 1;
- }
+ if (kb->urid < ka->urid) {
+ return 1;
+ }
- return 0;
+ return 0;
}
/** Helper macro for terse state map initialisation. */
#define STATE_MAP_INIT(type, ptr) \
- (LV2_ATOM__ ## type), \
- (sizeof(*ptr) - sizeof(LV2_Atom)), \
- (ptr)
+ (LV2_ATOM__##type), (sizeof(*(ptr)) - sizeof(LV2_Atom)), (ptr)
/**
Initialise a state map.
@@ -75,29 +60,30 @@ state_map_cmp(const void* a, const void* b)
NULL);
*/
static void
-state_map_init(StateMapItem dict[],
- LV2_URID_Map* map,
- LV2_URID_Map_Handle handle,
- /* const char* uri, const char* type, uint32_t size, LV2_Atom* value */ ...)
+state_map_init(
+ StateMapItem dict[],
+ LV2_URID_Map* map,
+ LV2_URID_Map_Handle handle,
+ /* const char* uri, const char* type, uint32_t size, LV2_Atom* value */...)
{
- // Set dict entries from parameters
- unsigned i = 0;
- va_list args;
- va_start(args, handle);
- for (const char* uri = NULL; (uri = va_arg(args, const char*)); ++i) {
- const char* type = va_arg(args, const char*);
- const uint32_t size = va_arg(args, uint32_t);
- LV2_Atom* const value = va_arg(args, LV2_Atom*);
- dict[i].uri = uri;
- dict[i].urid = map->map(map->handle, uri);
- dict[i].value = value;
- dict[i].value->size = size;
- dict[i].value->type = map->map(map->handle, type);
- }
- va_end(args);
-
- // Sort for fast lookup by URID by state_map_find()
- qsort(dict, i, sizeof(StateMapItem), state_map_cmp);
+ // Set dict entries from parameters
+ unsigned i = 0;
+ va_list args; // NOLINT(cppcoreguidelines-init-variables)
+ va_start(args, handle);
+ for (const char* uri = NULL; (uri = va_arg(args, const char*)); ++i) {
+ const char* type = va_arg(args, const char*);
+ const uint32_t size = va_arg(args, uint32_t);
+ LV2_Atom* const value = va_arg(args, LV2_Atom*);
+ dict[i].uri = uri;
+ dict[i].urid = map->map(map->handle, uri);
+ dict[i].value = value;
+ dict[i].value->size = size;
+ dict[i].value->type = map->map(map->handle, type);
+ }
+ va_end(args);
+
+ // Sort for fast lookup by URID by state_map_find()
+ qsort(dict, i, sizeof(StateMapItem), state_map_cmp);
}
/**
@@ -110,8 +96,7 @@ state_map_init(StateMapItem dict[],
static StateMapItem*
state_map_find(StateMapItem dict[], uint32_t n_entries, LV2_URID urid)
{
- const StateMapItem key = { NULL, urid, NULL };
- return (StateMapItem*)bsearch(
- &key, dict, n_entries, sizeof(StateMapItem), state_map_cmp);
+ const StateMapItem key = {NULL, urid, NULL};
+ return (StateMapItem*)bsearch(
+ &key, dict, n_entries, sizeof(StateMapItem), state_map_cmp);
}
-
diff --git a/plugins/eg-params.lv2/wscript b/plugins/eg-params.lv2/wscript
deleted file mode 100644
index 503e8db..0000000
--- a/plugins/eg-params.lv2/wscript
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-params.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2 >= 1.12.1', uselib_store='LV2')
-
-def build(bld):
- bundle = 'eg-params.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- bld(features = 'subst',
- source = 'manifest.ttl.in',
- target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Copy other data files to build bundle (build/eg-params.lv2)
- for i in ['params.ttl']:
- bld(features = 'subst',
- is_copy = True,
- source = i,
- target = 'lv2/%s/%s' % (bundle, i),
- install_path = '${LV2DIR}/%s' % bundle)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'params.c',
- name = 'params',
- target = 'lv2/%s/params' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = 'LV2')
diff --git a/plugins/eg-sampler.lv2/atom_sink.h b/plugins/eg-sampler.lv2/atom_sink.h
index b84ca55..8966eb2 100644
--- a/plugins/eg-sampler.lv2/atom_sink.h
+++ b/plugins/eg-sampler.lv2/atom_sink.h
@@ -1,20 +1,12 @@
-/*
- Copyright 2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
+#include "lv2/atom/util.h"
+
+#include <stdint.h>
+#include <string.h>
/**
A forge sink that writes to an atom buffer.
@@ -25,11 +17,11 @@
static LV2_Atom_Forge_Ref
atom_sink(LV2_Atom_Forge_Sink_Handle handle, const void* buf, uint32_t size)
{
- LV2_Atom* atom = (LV2_Atom*)handle;
- const uint32_t offset = lv2_atom_total_size(atom);
- memcpy((char*)atom + offset, buf, size);
- atom->size += size;
- return offset;
+ LV2_Atom* atom = (LV2_Atom*)handle;
+ const uint32_t offset = lv2_atom_total_size(atom);
+ memcpy((char*)atom + offset, buf, size);
+ atom->size += size;
+ return offset;
}
/**
@@ -38,5 +30,5 @@ atom_sink(LV2_Atom_Forge_Sink_Handle handle, const void* buf, uint32_t size)
static LV2_Atom*
atom_sink_deref(LV2_Atom_Forge_Sink_Handle handle, LV2_Atom_Forge_Ref ref)
{
- return (LV2_Atom*)((char*)handle + ref);
+ return (LV2_Atom*)((char*)handle + ref);
}
diff --git a/plugins/eg-sampler.lv2/manifest.ttl.in b/plugins/eg-sampler.lv2/manifest.ttl.in
index 8a01428..e688256 100644
--- a/plugins/eg-sampler.lv2/manifest.ttl.in
+++ b/plugins/eg-sampler.lv2/manifest.ttl.in
@@ -15,5 +15,5 @@
<http://lv2plug.in/plugins/eg-sampler#ui>
a ui:GtkUI ;
- ui:binary <sampler_ui@LIB_EXT@> ;
+ lv2:binary <sampler_ui@LIB_EXT@> ;
rdfs:seeAlso <sampler.ttl> .
diff --git a/plugins/eg-sampler.lv2/meson.build b/plugins/eg-sampler.lv2/meson.build
new file mode 100644
index 0000000..9700df2
--- /dev/null
+++ b/plugins/eg-sampler.lv2/meson.build
@@ -0,0 +1,78 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('sampler.c')
+ui_sources = files('sampler_ui.c')
+bundle_name = 'eg-sampler.lv2'
+data_filenames = ['manifest.ttl.in', 'sampler.ttl', 'click.wav']
+
+samplerate_dep = dependency(
+ 'samplerate',
+ required: get_option('plugins'),
+ version: '>= 0.1.0',
+)
+
+sndfile_dep = dependency(
+ 'sndfile',
+ required: get_option('plugins'),
+ version: '>= 1.0.0',
+)
+
+gtk2_dep = dependency(
+ 'gtk+-2.0',
+ include_type: 'system',
+ required: get_option('plugins'),
+ version: '>= 2.18.0',
+)
+
+if samplerate_dep.found() and sndfile_dep.found()
+ module = shared_library(
+ 'sampler',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep, samplerate_dep, sndfile_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+ )
+
+ extension = '.' + module.full_path().split('.')[-1]
+ config = configuration_data({'LIB_EXT': extension})
+
+ foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+ endforeach
+
+ if gtk2_dep.found()
+ ui_suppressions = c_suppressions
+ if cc.get_id() == 'gcc'
+ ui_suppressions += ['-Wno-strict-overflow']
+ endif
+
+ shared_library(
+ 'sampler_ui',
+ ui_sources,
+ c_args: ui_suppressions,
+ dependencies: [lv2_dep, gtk2_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+ )
+ endif
+endif
diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h
index 4a51cd7..47d6616 100644
--- a/plugins/eg-sampler.lv2/peaks.h
+++ b/plugins/eg-sampler.lv2/peaks.h
@@ -1,19 +1,8 @@
-/*
- LV2 audio peaks utilities
- Copyright 2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef PEAKS_H_INCLUDED
+#define PEAKS_H_INCLUDED
/**
This file defines utilities for sending and receiving audio peaks for
@@ -25,50 +14,53 @@
requested, with reasonably sized incremental updates sent over plugin ports.
*/
-#ifndef PEAKS_H_INCLUDED
-#define PEAKS_H_INCLUDED
-
+#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
+#include "lv2/atom/util.h"
+#include "lv2/urid/urid.h"
#include <math.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdlib.h>
+#include <string.h>
-#define PEAKS_URI "http://lv2plug.in/ns/peaks#"
-#define PEAKS__PeakUpdate PEAKS_URI "PeakUpdate"
-#define PEAKS__magnitudes PEAKS_URI "magnitudes"
-#define PEAKS__offset PEAKS_URI "offset"
-#define PEAKS__total PEAKS_URI "total"
+#define PEAKS_URI "http://lv2plug.in/ns/peaks#"
+#define PEAKS__PeakUpdate PEAKS_URI "PeakUpdate"
+#define PEAKS__magnitudes PEAKS_URI "magnitudes"
+#define PEAKS__offset PEAKS_URI "offset"
+#define PEAKS__total PEAKS_URI "total"
#ifndef MIN
-# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
-# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
typedef struct {
- LV2_URID atom_Float;
- LV2_URID atom_Int;
- LV2_URID atom_Vector;
- LV2_URID peaks_PeakUpdate;
- LV2_URID peaks_magnitudes;
- LV2_URID peaks_offset;
- LV2_URID peaks_total;
+ LV2_URID atom_Float;
+ LV2_URID atom_Int;
+ LV2_URID atom_Vector;
+ LV2_URID peaks_PeakUpdate;
+ LV2_URID peaks_magnitudes;
+ LV2_URID peaks_offset;
+ LV2_URID peaks_total;
} PeaksURIs;
typedef struct {
- PeaksURIs uris; ///< URIDs used in protocol
- const float* samples; ///< Sample data
- uint32_t n_samples; ///< Total number of samples
- uint32_t n_peaks; ///< Total number of peaks
- uint32_t current_offset; ///< Current peak offset
- bool sending; ///< True iff currently sending
+ PeaksURIs uris; ///< URIDs used in protocol
+ const float* samples; ///< Sample data
+ uint32_t n_samples; ///< Total number of samples
+ uint32_t n_peaks; ///< Total number of peaks
+ uint32_t current_offset; ///< Current peak offset
+ bool sending; ///< True iff currently sending
} PeaksSender;
typedef struct {
- PeaksURIs uris; ///< URIDs used in protocol
- float* peaks; ///< Received peaks, or zeroes
- uint32_t n_peaks; ///< Total number of peaks
+ PeaksURIs uris; ///< URIDs used in protocol
+ float* peaks; ///< Received peaks, or zeroes
+ uint32_t n_peaks; ///< Total number of peaks
} PeaksReceiver;
/**
@@ -77,13 +69,13 @@ typedef struct {
static inline void
peaks_map_uris(PeaksURIs* uris, LV2_URID_Map* map)
{
- uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
- uris->atom_Int = map->map(map->handle, LV2_ATOM__Int);
- uris->atom_Vector = map->map(map->handle, LV2_ATOM__Vector);
- uris->peaks_PeakUpdate = map->map(map->handle, PEAKS__PeakUpdate);
- uris->peaks_magnitudes = map->map(map->handle, PEAKS__magnitudes);
- uris->peaks_offset = map->map(map->handle, PEAKS__offset);
- uris->peaks_total = map->map(map->handle, PEAKS__total);
+ uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
+ uris->atom_Int = map->map(map->handle, LV2_ATOM__Int);
+ uris->atom_Vector = map->map(map->handle, LV2_ATOM__Vector);
+ uris->peaks_PeakUpdate = map->map(map->handle, PEAKS__PeakUpdate);
+ uris->peaks_magnitudes = map->map(map->handle, PEAKS__magnitudes);
+ uris->peaks_offset = map->map(map->handle, PEAKS__offset);
+ uris->peaks_total = map->map(map->handle, PEAKS__total);
}
/**
@@ -94,9 +86,9 @@ peaks_map_uris(PeaksURIs* uris, LV2_URID_Map* map)
static inline PeaksSender*
peaks_sender_init(PeaksSender* sender, LV2_URID_Map* map)
{
- memset(sender, 0, sizeof(*sender));
- peaks_map_uris(&sender->uris, map);
- return sender;
+ memset(sender, 0, sizeof(*sender));
+ peaks_map_uris(&sender->uris, map);
+ return sender;
}
/**
@@ -109,11 +101,11 @@ peaks_sender_start(PeaksSender* sender,
uint32_t n_samples,
uint32_t n_peaks)
{
- sender->samples = samples;
- sender->n_samples = n_samples;
- sender->n_peaks = n_peaks;
- sender->current_offset = 0;
- sender->sending = true;
+ sender->samples = samples;
+ sender->n_samples = n_samples;
+ sender->n_peaks = n_peaks;
+ sender->current_offset = 0;
+ sender->sending = true;
}
/**
@@ -123,10 +115,10 @@ peaks_sender_start(PeaksSender* sender,
[source,turtle]
----
[]
- a peaks:PeakUpdate ;
- peaks:offset 256 ;
- peaks:total 1024 ;
- peaks:magnitudes [ 0.2f, 0.3f, ... ] .
+ a peaks:PeakUpdate ;
+ peaks:offset 256 ;
+ peaks:total 1024 ;
+ peaks:magnitudes [ 0.2f, 0.3f, ... ] .
----
*/
static inline bool
@@ -135,53 +127,53 @@ peaks_sender_send(PeaksSender* sender,
uint32_t n_frames,
uint32_t offset)
{
- const PeaksURIs* uris = &sender->uris;
- if (!sender->sending || sender->current_offset >= sender->n_peaks) {
- return sender->sending = false;
- }
-
- // Start PeakUpdate object
- lv2_atom_forge_frame_time(forge, offset);
- LV2_Atom_Forge_Frame frame;
- lv2_atom_forge_object(forge, &frame, 0, uris->peaks_PeakUpdate);
-
- // eg:offset = OFFSET
- lv2_atom_forge_key(forge, uris->peaks_offset);
- lv2_atom_forge_int(forge, sender->current_offset);
-
- // eg:total = TOTAL
- lv2_atom_forge_key(forge, uris->peaks_total);
- lv2_atom_forge_int(forge, sender->n_peaks);
-
- // eg:magnitudes = Vector<Float>(PEAK, PEAK, ...)
- lv2_atom_forge_key(forge, uris->peaks_magnitudes);
- LV2_Atom_Forge_Frame vec_frame;
- lv2_atom_forge_vector_head(
- forge, &vec_frame, sizeof(float), uris->atom_Float);
-
- // Calculate how many peaks to send this update
- const uint32_t chunk_size = MAX(1u, sender->n_samples / sender->n_peaks);
- const uint32_t space = forge->size - forge->offset;
- const uint32_t remaining = sender->n_peaks - sender->current_offset;
- const uint32_t n_update = MIN(remaining,
- MIN(n_frames / 4u, space / sizeof(float)));
-
- // Calculate peak (maximum magnitude) for each chunk
- for (uint32_t i = 0; i < n_update; ++i) {
- const uint32_t start = (sender->current_offset + i) * chunk_size;
- float peak = 0.0f;
- for (uint32_t j = 0; j < chunk_size; ++j) {
- peak = fmaxf(peak, fabsf(sender->samples[start + j]));
- }
- lv2_atom_forge_float(forge, peak);
- }
-
- // Finish message
- lv2_atom_forge_pop(forge, &vec_frame);
- lv2_atom_forge_pop(forge, &frame);
-
- sender->current_offset += n_update;
- return true;
+ const PeaksURIs* uris = &sender->uris;
+ if (!sender->sending || sender->current_offset >= sender->n_peaks) {
+ return sender->sending = false;
+ }
+
+ // Start PeakUpdate object
+ lv2_atom_forge_frame_time(forge, offset);
+ LV2_Atom_Forge_Frame frame;
+ lv2_atom_forge_object(forge, &frame, 0, uris->peaks_PeakUpdate);
+
+ // eg:offset = OFFSET
+ lv2_atom_forge_key(forge, uris->peaks_offset);
+ lv2_atom_forge_int(forge, (int32_t)sender->current_offset);
+
+ // eg:total = TOTAL
+ lv2_atom_forge_key(forge, uris->peaks_total);
+ lv2_atom_forge_int(forge, (int32_t)sender->n_peaks);
+
+ // eg:magnitudes = Vector<Float>(PEAK, PEAK, ...)
+ lv2_atom_forge_key(forge, uris->peaks_magnitudes);
+ LV2_Atom_Forge_Frame vec_frame;
+ lv2_atom_forge_vector_head(
+ forge, &vec_frame, sizeof(float), uris->atom_Float);
+
+ // Calculate how many peaks to send this update
+ const uint32_t chunk_size = MAX(1U, sender->n_samples / sender->n_peaks);
+ const uint32_t space = forge->size - forge->offset;
+ const uint32_t remaining = sender->n_peaks - sender->current_offset;
+ const uint32_t n_update =
+ MIN(remaining, MIN(n_frames / 4U, space / sizeof(float)));
+
+ // Calculate peak (maximum magnitude) for each chunk
+ for (uint32_t i = 0; i < n_update; ++i) {
+ const uint32_t start = (sender->current_offset + i) * chunk_size;
+ float peak = 0.0f;
+ for (uint32_t j = 0; j < chunk_size; ++j) {
+ peak = fmaxf(peak, fabsf(sender->samples[start + j]));
+ }
+ lv2_atom_forge_float(forge, peak);
+ }
+
+ // Finish message
+ lv2_atom_forge_pop(forge, &vec_frame);
+ lv2_atom_forge_pop(forge, &frame);
+
+ sender->current_offset += n_update;
+ return true;
}
/**
@@ -191,9 +183,9 @@ peaks_sender_send(PeaksSender* sender,
static inline PeaksReceiver*
peaks_receiver_init(PeaksReceiver* receiver, LV2_URID_Map* map)
{
- memset(receiver, 0, sizeof(*receiver));
- peaks_map_uris(&receiver->uris, map);
- return receiver;
+ memset(receiver, 0, sizeof(*receiver));
+ peaks_map_uris(&receiver->uris, map);
+ return receiver;
}
/**
@@ -203,9 +195,9 @@ peaks_receiver_init(PeaksReceiver* receiver, LV2_URID_Map* map)
static inline void
peaks_receiver_clear(PeaksReceiver* receiver)
{
- free(receiver->peaks);
- receiver->peaks = NULL;
- receiver->n_peaks = 0;
+ free(receiver->peaks);
+ receiver->peaks = NULL;
+ receiver->n_peaks = 0;
}
/**
@@ -219,53 +211,56 @@ peaks_receiver_clear(PeaksReceiver* receiver)
static inline int
peaks_receiver_receive(PeaksReceiver* receiver, const LV2_Atom_Object* update)
{
- const PeaksURIs* uris = &receiver->uris;
-
- // Get properties of interest from update
- const LV2_Atom_Int* offset = NULL;
- const LV2_Atom_Int* total = NULL;
- const LV2_Atom_Vector* peaks = NULL;
- lv2_atom_object_get_typed(update,
- uris->peaks_offset, &offset, uris->atom_Int,
- uris->peaks_total, &total, uris->atom_Int,
- uris->peaks_magnitudes, &peaks, uris->atom_Vector,
- 0);
-
- if (!offset || !total || !peaks ||
- peaks->body.child_type != uris->atom_Float) {
- return -1; // Invalid update
- }
-
- const uint32_t n = (uint32_t)total->body;
- if (receiver->n_peaks != n) {
- // Update is for a different total number of peaks, resize
- receiver->peaks = (float*)realloc(receiver->peaks, n * sizeof(float));
- if (receiver->n_peaks > 0 && receiver->n_peaks < n) {
- /* The peaks array is being expanded. Copy the old peaks,
- duplicating each as necessary to fill the new peaks buffer.
- This preserves the current peaks so that the peaks array can be
- reasonably drawn at any time, but the resolution will increase
- as new updates arrive. */
- const int64_t n_per = n / receiver->n_peaks;
- for (int64_t i = n - 1; i >= 0; --i) {
- receiver->peaks[i] = receiver->peaks[i / n_per];
- }
- } else if (receiver->n_peaks > 0) {
- /* The peak array is being shrunk. Similar to the above. */
- const int64_t n_per = receiver->n_peaks / n;
- for (int64_t i = n - 1; i >= 0; --i) {
- receiver->peaks[i] = receiver->peaks[i * n_per];
- }
- }
- receiver->n_peaks = n;
- }
-
- // Copy vector contents to corresponding range in peaks array
- memcpy(receiver->peaks + offset->body,
- peaks + 1,
- peaks->atom.size - sizeof(LV2_Atom_Vector_Body));
-
- return 0;
+ const PeaksURIs* uris = &receiver->uris;
+
+ // Get properties of interest from update
+ const LV2_Atom_Int* offset = NULL;
+ const LV2_Atom_Int* total = NULL;
+ const LV2_Atom_Vector* peaks = NULL;
+
+ // clang-format off
+ lv2_atom_object_get_typed(update,
+ uris->peaks_offset, &offset, uris->atom_Int,
+ uris->peaks_total, &total, uris->atom_Int,
+ uris->peaks_magnitudes, &peaks, uris->atom_Vector,
+ 0);
+ // clang-format on
+
+ if (!offset || !total || !peaks ||
+ peaks->body.child_type != uris->atom_Float) {
+ return -1; // Invalid update
+ }
+
+ const uint32_t n = (uint32_t)total->body;
+ if (receiver->n_peaks != n) {
+ // Update is for a different total number of peaks, resize
+ receiver->peaks = (float*)realloc(receiver->peaks, n * sizeof(float));
+ if (receiver->n_peaks > 0 && receiver->n_peaks < n) {
+ /* The peaks array is being expanded. Copy the old peaks,
+ duplicating each as necessary to fill the new peaks buffer.
+ This preserves the current peaks so that the peaks array can be
+ reasonably drawn at any time, but the resolution will increase
+ as new updates arrive. */
+ const int64_t n_per = n / receiver->n_peaks;
+ for (int64_t i = n - 1; i >= 0; --i) {
+ receiver->peaks[i] = receiver->peaks[i / n_per];
+ }
+ } else if (receiver->n_peaks > 0) {
+ /* The peak array is being shrunk. Similar to the above. */
+ const int64_t n_per = receiver->n_peaks / n;
+ for (int64_t i = n - 1; i >= 0; --i) {
+ receiver->peaks[i] = receiver->peaks[i * n_per];
+ }
+ }
+ receiver->n_peaks = n;
+ }
+
+ // Copy vector contents to corresponding range in peaks array
+ memcpy(receiver->peaks + offset->body,
+ peaks + 1,
+ peaks->atom.size - sizeof(LV2_Atom_Vector_Body));
+
+ return 0;
}
#endif // PEAKS_H_INCLUDED
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index 17f62a8..d870a07 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -1,21 +1,7 @@
-/*
- LV2 Sampler Example Plugin
- Copyright 2011-2016 David Robillard <d@drobilla.net>
- Copyright 2011 Gabriel M. Beddingfield <gabriel@teuton.org>
- Copyright 2011 James Morris <jwm.art.net@gmail.com>
-
- 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.
-*/
+// Copyright 2011-2016 David Robillard <d@drobilla.net>
+// Copyright 2011 Gabriel M. Beddingfield <gabriel@teuton.org>
+// Copyright 2011 James Morris <jwm.art.net@gmail.com>
+// SPDX-License-Identifier: ISC
#include "atom_sink.h"
#include "peaks.h"
@@ -33,6 +19,7 @@
#include "lv2/urid/urid.h"
#include "lv2/worker/worker.h"
+#include <samplerate.h>
#include <sndfile.h>
#include <math.h>
@@ -42,46 +29,45 @@
#include <stdlib.h>
#include <string.h>
-enum {
- SAMPLER_CONTROL = 0,
- SAMPLER_NOTIFY = 1,
- SAMPLER_OUT = 2
-};
+enum { SAMPLER_CONTROL = 0, SAMPLER_NOTIFY = 1, SAMPLER_OUT = 2 };
typedef struct {
- SF_INFO info; // Info about sample from sndfile
- float* data; // Sample data in float
- char* path; // Path of file
- uint32_t path_len; // Length of path
+ SF_INFO info; // Info about sample from sndfile
+ float* data; // Sample data in float
+ char* path; // Path of file
+ uint32_t path_len; // Length of path
} Sample;
typedef struct {
- // Features
- LV2_URID_Map* map;
- LV2_Worker_Schedule* schedule;
- LV2_Log_Logger logger;
-
- // Ports
- const LV2_Atom_Sequence* control_port;
- LV2_Atom_Sequence* notify_port;
- float* output_port;
-
- // Communication utilities
- LV2_Atom_Forge_Frame notify_frame; ///< Cached for worker replies
- LV2_Atom_Forge forge; ///< Forge for writing atoms in run thread
- PeaksSender psend; ///< Audio peaks sender
-
- // URIs
- SamplerURIs uris;
-
- // Playback state
- Sample* sample;
- uint32_t frame_offset;
- float gain;
- sf_count_t frame;
- bool play;
- bool activated;
- bool sample_changed;
+ // Features
+ LV2_URID_Map* map;
+ LV2_Worker_Schedule* schedule;
+ LV2_Log_Logger logger;
+
+ // Ports
+ const LV2_Atom_Sequence* control_port;
+ LV2_Atom_Sequence* notify_port;
+ float* output_port;
+
+ // Communication utilities
+ LV2_Atom_Forge_Frame notify_frame; ///< Cached for worker replies
+ LV2_Atom_Forge forge; ///< Forge for writing atoms in run thread
+ PeaksSender psend; ///< Audio peaks sender
+
+ // URIs
+ SamplerURIs uris;
+
+ // Playback state
+ Sample* sample;
+ uint32_t frame_offset;
+ float gain;
+ float gain_dB;
+ sf_count_t frame;
+ bool play;
+ bool activated;
+ bool gain_changed;
+ bool sample_changed;
+ int sample_rate;
} Sampler;
/**
@@ -93,11 +79,28 @@ typedef struct {
ringbuffer.
*/
typedef struct {
- LV2_Atom atom;
- Sample* sample;
+ LV2_Atom atom;
+ Sample* sample;
} SampleMessage;
/**
+ Convert an interleaved audio buffer to mono.
+
+ This simply ignores the data on all channels but the first.
+*/
+static sf_count_t
+convert_to_mono(float* data, sf_count_t num_input_frames, uint32_t channels)
+{
+ sf_count_t num_output_frames = 0;
+
+ for (sf_count_t i = 0; i < num_input_frames * channels; i += channels) {
+ data[num_output_frames++] = data[i];
+ }
+
+ return num_output_frames;
+}
+
+/**
Load a new sample and return it.
Since this is of course not a real-time safe action, this is called in the
@@ -105,55 +108,95 @@ typedef struct {
not modified.
*/
static Sample*
-load_sample(LV2_Log_Logger* logger, const char* path)
+load_sample(LV2_Log_Logger* logger, const char* path, const int sample_rate)
{
- lv2_log_trace(logger, "Loading %s\n", path);
-
- const size_t path_len = strlen(path);
- Sample* const sample = (Sample*)calloc(1, sizeof(Sample));
- SF_INFO* const info = &sample->info;
- SNDFILE* const sndfile = sf_open(path, SFM_READ, info);
- float* data = NULL;
- bool error = true;
- if (!sndfile || !info->frames) {
- lv2_log_error(logger, "Failed to open %s\n", path);
- } else if (info->channels != 1) {
- lv2_log_error(logger, "%s has %d channels\n", path, info->channels);
- } else if (!(data = (float*)malloc(sizeof(float) * info->frames))) {
- lv2_log_error(logger, "Failed to allocate memory for sample\n");
- } else {
- error = false;
- }
-
- if (error) {
- free(sample);
- free(data);
- sf_close(sndfile);
- return NULL;
- }
-
- sf_seek(sndfile, 0ul, SEEK_SET);
- sf_read_float(sndfile, data, info->frames);
- sf_close(sndfile);
-
- // Fill sample struct and return it
- sample->data = data;
- sample->path = (char*)malloc(path_len + 1);
- sample->path_len = (uint32_t)path_len;
- memcpy(sample->path, path, path_len + 1);
-
- return sample;
+ lv2_log_trace(logger, "Loading %s\n", path);
+
+ const size_t path_len = strlen(path);
+ Sample* const sample = (Sample*)calloc(1, sizeof(Sample));
+ SF_INFO* const info = &sample->info;
+ SNDFILE* const sndfile = sf_open(path, SFM_READ, info);
+ float* data = NULL;
+ bool error = true;
+ if (!sndfile || !info->frames) {
+ lv2_log_error(logger, "Failed to open %s\n", path);
+ } else if (!(data = (float*)malloc(sizeof(float) * info->frames *
+ info->channels))) {
+ lv2_log_error(logger, "Failed to allocate memory for sample\n");
+ } else {
+ error = false;
+ }
+
+ if (error) {
+ free(sample);
+ free(data);
+ sf_close(sndfile);
+ return NULL;
+ }
+
+ sf_seek(sndfile, 0UL, SEEK_SET);
+ sf_read_float(sndfile, data, info->frames * info->channels);
+ sf_close(sndfile);
+
+ if (info->channels != 1) {
+ info->frames = convert_to_mono(data, info->frames, info->channels);
+ info->channels = 1;
+ }
+
+ if (info->samplerate != sample_rate) {
+ lv2_log_trace(logger,
+ "Converting from %d Hz to %d Hz\n",
+ info->samplerate,
+ sample_rate);
+
+ const double src_ratio = (double)sample_rate / (double)info->samplerate;
+ const double output_length = ceil((double)info->frames * src_ratio);
+ const long output_frames = (long)output_length;
+ float* const output_buffer = (float*)malloc(sizeof(float) * output_frames);
+
+ SRC_DATA src_data = {
+ data,
+ output_buffer,
+ info->frames,
+ output_frames,
+ 0,
+ 0,
+ 0,
+ src_ratio,
+ };
+
+ if (src_simple(&src_data, SRC_SINC_BEST_QUALITY, 1) != 0) {
+ lv2_log_error(logger, "Sample rate conversion failed\n");
+ free(output_buffer);
+ } else {
+ // Replace original data with converted buffer
+ free(data);
+ data = output_buffer;
+ info->frames = src_data.output_frames_gen;
+ }
+ } else {
+ lv2_log_trace(
+ logger, "Sample matches the current rate of %d Hz\n", sample_rate);
+ }
+
+ // Fill sample struct and return it
+ sample->data = data;
+ sample->path = (char*)malloc(path_len + 1);
+ sample->path_len = (uint32_t)path_len;
+ memcpy(sample->path, path, path_len + 1);
+
+ return sample;
}
static void
free_sample(Sampler* self, Sample* sample)
{
- if (sample) {
- lv2_log_trace(&self->logger, "Freeing %s\n", sample->path);
- free(sample->path);
- free(sample->data);
- free(sample);
- }
+ if (sample) {
+ lv2_log_trace(&self->logger, "Freeing %s\n", sample->path);
+ free(sample->path);
+ free(sample->data);
+ free(sample);
+ }
}
/**
@@ -170,30 +213,30 @@ work(LV2_Handle instance,
uint32_t size,
const void* data)
{
- Sampler* self = (Sampler*)instance;
- const LV2_Atom* atom = (const LV2_Atom*)data;
- if (atom->type == self->uris.eg_freeSample) {
- // Free old sample
- const SampleMessage* msg = (const SampleMessage*)data;
- free_sample(self, msg->sample);
- } else if (atom->type == self->forge.Object) {
- // Handle set message (load sample).
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)data;
- const char* path = read_set_file(&self->uris, obj);
- if (!path) {
- lv2_log_error(&self->logger, "Malformed set file request\n");
- return LV2_WORKER_ERR_UNKNOWN;
- }
-
- // Load sample.
- Sample* sample = load_sample(&self->logger, path);
- if (sample) {
- // Send new sample to run() to be applied
- respond(handle, sizeof(sample), &sample);
- }
- }
-
- return LV2_WORKER_SUCCESS;
+ Sampler* self = (Sampler*)instance;
+ const LV2_Atom* atom = (const LV2_Atom*)data;
+ if (atom->type == self->uris.eg_freeSample) {
+ // Free old sample
+ const SampleMessage* msg = (const SampleMessage*)data;
+ free_sample(self, msg->sample);
+ } else if (atom->type == self->forge.Object) {
+ // Handle set message (load sample).
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)data;
+ const char* path = read_set_file(&self->uris, obj);
+ if (!path) {
+ lv2_log_error(&self->logger, "Malformed set file request\n");
+ return LV2_WORKER_ERR_UNKNOWN;
+ }
+
+ // Load sample.
+ Sample* sample = load_sample(&self->logger, path, self->sample_rate);
+ if (sample) {
+ // Send new sample to run() to be applied
+ respond(handle, sizeof(Sample*), &sample);
+ }
+ }
+
+ return LV2_WORKER_SUCCESS;
}
/**
@@ -204,50 +247,48 @@ work(LV2_Handle instance,
scheduled.
*/
static LV2_Worker_Status
-work_response(LV2_Handle instance,
- uint32_t size,
- const void* data)
+work_response(LV2_Handle instance, uint32_t size, const void* data)
{
- Sampler* self = (Sampler*)instance;
- Sample* old_sample = self->sample;
- Sample* new_sample = *(Sample*const*)data;
+ Sampler* self = (Sampler*)instance;
+ Sample* old_sample = self->sample;
+ Sample* new_sample = *(Sample* const*)data;
- // Install the new sample
- self->sample = *(Sample*const*)data;
+ // Install the new sample
+ self->sample = *(Sample* const*)data;
- // Schedule work to free the old sample
- SampleMessage msg = { { sizeof(Sample*), self->uris.eg_freeSample },
- old_sample };
- self->schedule->schedule_work(self->schedule->handle, sizeof(msg), &msg);
+ // Stop playing previous sample, which can be larger than new one
+ self->frame = 0;
+ self->play = false;
- // Send a notification that we're using a new sample
- lv2_atom_forge_frame_time(&self->forge, self->frame_offset);
- write_set_file(&self->forge, &self->uris,
- new_sample->path,
- new_sample->path_len);
+ // Schedule work to free the old sample
+ SampleMessage msg = {{sizeof(Sample*), self->uris.eg_freeSample}, old_sample};
+ self->schedule->schedule_work(self->schedule->handle, sizeof(msg), &msg);
- return LV2_WORKER_SUCCESS;
+ // Send a notification that we're using a new sample
+ lv2_atom_forge_frame_time(&self->forge, self->frame_offset);
+ write_set_file(
+ &self->forge, &self->uris, new_sample->path, new_sample->path_len);
+
+ return LV2_WORKER_SUCCESS;
}
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- Sampler* self = (Sampler*)instance;
- switch (port) {
- case SAMPLER_CONTROL:
- self->control_port = (const LV2_Atom_Sequence*)data;
- break;
- case SAMPLER_NOTIFY:
- self->notify_port = (LV2_Atom_Sequence*)data;
- break;
- case SAMPLER_OUT:
- self->output_port = (float*)data;
- break;
- default:
- break;
- }
+ Sampler* self = (Sampler*)instance;
+ switch (port) {
+ case SAMPLER_CONTROL:
+ self->control_port = (const LV2_Atom_Sequence*)data;
+ break;
+ case SAMPLER_NOTIFY:
+ self->notify_port = (LV2_Atom_Sequence*)data;
+ break;
+ case SAMPLER_OUT:
+ self->output_port = (float*)data;
+ break;
+ default:
+ break;
+ }
}
static LV2_Handle
@@ -256,58 +297,63 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
- // Allocate and initialise instance structure.
- Sampler* self = (Sampler*)calloc(1, sizeof(Sampler));
- if (!self) {
- return NULL;
- }
-
- // Get host features
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &self->logger.log, false,
- LV2_URID__map, &self->map, true,
- LV2_WORKER__schedule, &self->schedule, true,
- NULL);
- lv2_log_logger_set_map(&self->logger, self->map);
- if (missing) {
- lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
- free(self);
- return NULL;
- }
-
- // Map URIs and initialise forge
- map_sampler_uris(self->map, &self->uris);
- lv2_atom_forge_init(&self->forge, self->map);
- peaks_sender_init(&self->psend, self->map);
-
- self->gain = 1.0;
-
- return (LV2_Handle)self;
+ // Allocate and initialise instance structure.
+ Sampler* self = (Sampler*)calloc(1, sizeof(Sampler));
+ if (!self) {
+ return NULL;
+ }
+
+ // Get host features
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &self->logger.log, false,
+ LV2_URID__map, &self->map, true,
+ LV2_WORKER__schedule, &self->schedule, true,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&self->logger, self->map);
+ if (missing) {
+ lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
+ free(self);
+ return NULL;
+ }
+
+ // Map URIs and initialise forge
+ map_sampler_uris(self->map, &self->uris);
+ lv2_atom_forge_init(&self->forge, self->map);
+ peaks_sender_init(&self->psend, self->map);
+
+ self->gain = 1.0f;
+ self->gain_dB = 0.0f;
+ self->sample_rate = (int)rate;
+
+ return (LV2_Handle)self;
}
static void
cleanup(LV2_Handle instance)
{
- Sampler* self = (Sampler*)instance;
- free_sample(self, self->sample);
- free(self);
+ Sampler* self = (Sampler*)instance;
+ free_sample(self, self->sample);
+ free(self);
}
static void
activate(LV2_Handle instance)
{
- ((Sampler*)instance)->activated = true;
+ ((Sampler*)instance)->activated = true;
}
static void
deactivate(LV2_Handle instance)
{
- ((Sampler*)instance)->activated = false;
+ ((Sampler*)instance)->activated = false;
}
/** Define a macro for converting a gain in dB to a coefficient. */
-#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g) * 0.05f) : 0.0f)
+#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g)*0.05f) : 0.0f)
/**
Handle an incoming event in the audio thread.
@@ -318,79 +364,88 @@ deactivate(LV2_Handle instance)
static void
handle_event(Sampler* self, LV2_Atom_Event* ev)
{
- SamplerURIs* uris = &self->uris;
- PeaksURIs* peaks_uris = &self->psend.uris;
-
- if (ev->body.type == uris->midi_Event) {
- const uint8_t* const msg = (const uint8_t*)(ev + 1);
- switch (lv2_midi_message_type(msg)) {
- case LV2_MIDI_MSG_NOTE_ON:
- self->frame = 0;
- self->play = true;
- break;
- default:
- break;
- }
- } else if (lv2_atom_forge_is_object_type(&self->forge, ev->body.type)) {
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
- if (obj->body.otype == uris->patch_Set) {
- // Get the property and value of the set message
- const LV2_Atom* property = NULL;
- const LV2_Atom* value = NULL;
- lv2_atom_object_get(obj,
- uris->patch_property, &property,
- uris->patch_value, &value,
- 0);
- if (!property) {
- lv2_log_error(&self->logger, "Set message with no property\n");
- return;
- } else if (property->type != uris->atom_URID) {
- lv2_log_error(&self->logger, "Set property is not a URID\n");
- return;
- }
-
- const uint32_t key = ((const LV2_Atom_URID*)property)->body;
- if (key == uris->eg_sample) {
- // Sample change, send it to the worker.
- lv2_log_trace(&self->logger, "Scheduling sample change\n");
- self->schedule->schedule_work(self->schedule->handle,
- lv2_atom_total_size(&ev->body),
- &ev->body);
- } else if (key == uris->param_gain) {
- // Gain change
- if (value->type == uris->atom_Float) {
- self->gain = DB_CO(((LV2_Atom_Float*)value)->body);
- }
- }
- } else if (obj->body.otype == uris->patch_Get && self->sample) {
- const LV2_Atom_URID* accept = NULL;
- const LV2_Atom_Int* n_peaks = NULL;
- lv2_atom_object_get_typed(
- obj,
- uris->patch_accept, &accept, uris->atom_URID,
- peaks_uris->peaks_total, &n_peaks, peaks_uris->atom_Int, 0);
- if (accept && accept->body == peaks_uris->peaks_PeakUpdate) {
- // Received a request for peaks, prepare for transmission
- peaks_sender_start(&self->psend,
- self->sample->data,
- self->sample->info.frames,
- n_peaks->body);
- } else {
- // Received a get message, emit our state (probably to UI)
- lv2_atom_forge_frame_time(&self->forge, self->frame_offset);
- write_set_file(&self->forge, &self->uris,
- self->sample->path,
- self->sample->path_len);
- }
- } else {
- lv2_log_trace(&self->logger,
- "Unknown object type %u\n", obj->body.otype);
- }
- } else {
- lv2_log_trace(&self->logger,
- "Unknown event type %u\n", ev->body.type);
- }
-
+ SamplerURIs* uris = &self->uris;
+ PeaksURIs* peaks_uris = &self->psend.uris;
+
+ if (ev->body.type == uris->midi_Event) {
+ const uint8_t* const msg = (const uint8_t*)(ev + 1);
+ switch (lv2_midi_message_type(msg)) {
+ case LV2_MIDI_MSG_NOTE_ON:
+ self->frame = 0;
+ self->play = true;
+ break;
+ default:
+ break;
+ }
+ } else if (lv2_atom_forge_is_object_type(&self->forge, ev->body.type)) {
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
+ if (obj->body.otype == uris->patch_Set) {
+ // Get the property and value of the set message
+ const LV2_Atom* property = NULL;
+ const LV2_Atom* value = NULL;
+
+ // clang-format off
+ lv2_atom_object_get(obj,
+ uris->patch_property, &property,
+ uris->patch_value, &value,
+ 0);
+ // clang-format on
+
+ if (!property) {
+ lv2_log_error(&self->logger, "Set message with no property\n");
+ return;
+ }
+
+ if (property->type != uris->atom_URID) {
+ lv2_log_error(&self->logger, "Set property is not a URID\n");
+ return;
+ }
+
+ const uint32_t key = ((const LV2_Atom_URID*)property)->body;
+ if (key == uris->eg_sample) {
+ // Sample change, send it to the worker.
+ lv2_log_trace(&self->logger, "Scheduling sample change\n");
+ self->schedule->schedule_work(
+ self->schedule->handle, lv2_atom_total_size(&ev->body), &ev->body);
+ } else if (key == uris->param_gain) {
+ // Gain change
+ if (value->type == uris->atom_Float) {
+ self->gain_dB = ((LV2_Atom_Float*)value)->body;
+ self->gain = DB_CO(self->gain_dB);
+ }
+ }
+ } else if (obj->body.otype == uris->patch_Get && self->sample) {
+ const LV2_Atom_URID* accept = NULL;
+ const LV2_Atom_Int* n_peaks = NULL;
+
+ // clang-format off
+ lv2_atom_object_get_typed(
+ obj,
+ uris->patch_accept, &accept, uris->atom_URID,
+ peaks_uris->peaks_total, &n_peaks, peaks_uris->atom_Int,
+ 0);
+ // clang-format on
+
+ if (accept && accept->body == peaks_uris->peaks_PeakUpdate) {
+ // Received a request for peaks, prepare for transmission
+ peaks_sender_start(&self->psend,
+ self->sample->data,
+ self->sample->info.frames,
+ n_peaks->body);
+ } else {
+ // Received a get message, emit our state (probably to UI)
+ lv2_atom_forge_frame_time(&self->forge, self->frame_offset);
+ write_set_file(&self->forge,
+ &self->uris,
+ self->sample->path,
+ self->sample->path_len);
+ }
+ } else {
+ lv2_log_trace(&self->logger, "Unknown object type %u\n", obj->body.otype);
+ }
+ } else {
+ lv2_log_trace(&self->logger, "Unknown event type %u\n", ev->body.type);
+ }
}
/**
@@ -399,70 +454,76 @@ handle_event(Sampler* self, LV2_Atom_Event* ev)
static void
render(Sampler* self, uint32_t start, uint32_t end)
{
- float* output = self->output_port;
-
- if (self->play && self->sample) {
- // Start/continue writing sample to output
- for (; start < end; ++start) {
- output[start] = self->sample->data[self->frame] * self->gain;
- if (++self->frame == self->sample->info.frames) {
- self->play = false; // Reached end of sample
- break;
- }
- }
- }
-
- // Write silence to remaining buffer
- for (; start < end; ++start) {
- output[start] = 0.0f;
- }
+ float* output = self->output_port;
+
+ if (self->play && self->sample) {
+ // Start/continue writing sample to output
+ for (; start < end; ++start) {
+ output[start] = self->sample->data[self->frame] * self->gain;
+ if (++self->frame == self->sample->info.frames) {
+ self->play = false; // Reached end of sample
+ break;
+ }
+ }
+ }
+
+ // Write silence to remaining buffer
+ for (; start < end; ++start) {
+ output[start] = 0.0f;
+ }
}
static void
run(LV2_Handle instance, uint32_t sample_count)
{
- Sampler* self = (Sampler*)instance;
-
- // Set up forge to write directly to notify output port.
- const uint32_t notify_capacity = self->notify_port->atom.size;
- lv2_atom_forge_set_buffer(&self->forge,
- (uint8_t*)self->notify_port,
- notify_capacity);
-
- // Start a sequence in the notify output port.
- lv2_atom_forge_sequence_head(&self->forge, &self->notify_frame, 0);
-
- // Send update to UI if sample has changed due to state restore
- if (self->sample_changed) {
- lv2_atom_forge_frame_time(&self->forge, 0);
- write_set_file(&self->forge, &self->uris,
- self->sample->path,
- self->sample->path_len);
- self->sample_changed = false;
- }
-
- // Iterate over incoming events, emitting audio along the way
- self->frame_offset = 0;
- LV2_ATOM_SEQUENCE_FOREACH(self->control_port, ev) {
- // Render output up to the time of this event
- render(self, self->frame_offset, ev->time.frames);
-
- /* Update current frame offset to this event's time. This is stored in
- the instance because it is used for sychronous worker event
- execution. This allows a sample load event to be executed with
- sample accuracy when running in a non-realtime context (such as
- exporting a session). */
- self->frame_offset = ev->time.frames;
-
- // Process this event
- handle_event(self, ev);
- }
-
- // Use available space after any emitted events to send peaks
- peaks_sender_send(&self->psend, &self->forge, sample_count, self->frame_offset);
-
- // Render output for the rest of the cycle past the last event
- render(self, self->frame_offset, sample_count);
+ Sampler* self = (Sampler*)instance;
+
+ // Set up forge to write directly to notify output port.
+ const uint32_t notify_capacity = self->notify_port->atom.size;
+ lv2_atom_forge_set_buffer(
+ &self->forge, (uint8_t*)self->notify_port, notify_capacity);
+
+ // Start a sequence in the notify output port.
+ lv2_atom_forge_sequence_head(&self->forge, &self->notify_frame, 0);
+
+ // Send update to UI if gain has changed due to state restore
+ if (self->gain_changed) {
+ lv2_atom_forge_frame_time(&self->forge, 0);
+ write_set_gain(&self->forge, &self->uris, self->gain_dB);
+ self->gain_changed = false;
+ }
+
+ // Send update to UI if sample has changed due to state restore
+ if (self->sample_changed) {
+ lv2_atom_forge_frame_time(&self->forge, 0);
+ write_set_file(
+ &self->forge, &self->uris, self->sample->path, self->sample->path_len);
+ self->sample_changed = false;
+ }
+
+ // Iterate over incoming events, emitting audio along the way
+ self->frame_offset = 0;
+ LV2_ATOM_SEQUENCE_FOREACH (self->control_port, ev) {
+ // Render output up to the time of this event
+ render(self, self->frame_offset, ev->time.frames);
+
+ /* Update current frame offset to this event's time. This is stored in
+ the instance because it is used for synchronous worker event
+ execution. This allows a sample load event to be executed with
+ sample accuracy when running in a non-realtime context (such as
+ exporting a session). */
+ self->frame_offset = ev->time.frames;
+
+ // Process this event
+ handle_event(self, ev);
+ }
+
+ // Use available space after any emitted events to send peaks
+ peaks_sender_send(
+ &self->psend, &self->forge, sample_count, self->frame_offset);
+
+ // Render output for the rest of the cycle past the last event
+ render(self, self->frame_offset, sample_count);
}
static LV2_State_Status
@@ -472,30 +533,39 @@ save(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- Sampler* self = (Sampler*)instance;
- if (!self->sample) {
- return LV2_STATE_SUCCESS;
- }
-
- LV2_State_Map_Path* map_path = (LV2_State_Map_Path*)lv2_features_data(
- features, LV2_STATE__mapPath);
- if (!map_path) {
- return LV2_STATE_ERR_NO_FEATURE;
- }
-
- // Map absolute sample path to an abstract state path
- char* apath = map_path->abstract_path(map_path->handle, self->sample->path);
-
- // Store eg:sample = abstract path
- store(handle,
- self->uris.eg_sample,
- apath,
- strlen(apath) + 1,
- self->uris.atom_Path,
- LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
-
- free(apath);
- return LV2_STATE_SUCCESS;
+ Sampler* self = (Sampler*)instance;
+ if (!self->sample) {
+ return LV2_STATE_SUCCESS;
+ }
+
+ LV2_State_Map_Path* map_path =
+ (LV2_State_Map_Path*)lv2_features_data(features, LV2_STATE__mapPath);
+ if (!map_path) {
+ return LV2_STATE_ERR_NO_FEATURE;
+ }
+
+ // Map absolute sample path to an abstract state path
+ char* apath = map_path->abstract_path(map_path->handle, self->sample->path);
+
+ // Store eg:sample = abstract path
+ store(handle,
+ self->uris.eg_sample,
+ apath,
+ strlen(apath) + 1,
+ self->uris.atom_Path,
+ LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
+
+ free(apath);
+
+ // Store the gain value
+ store(handle,
+ self->uris.param_gain,
+ &self->gain_dB,
+ sizeof(self->gain_dB),
+ self->uris.atom_Float,
+ LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
+
+ return LV2_STATE_SUCCESS;
}
static LV2_State_Status
@@ -505,99 +575,122 @@ restore(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- Sampler* self = (Sampler*)instance;
-
- // Get host features
- LV2_Worker_Schedule* schedule = NULL;
- LV2_State_Map_Path* paths = NULL;
- const char* missing = lv2_features_query(
- features,
- LV2_STATE__mapPath, &paths, true,
- LV2_WORKER__schedule, &schedule, false,
- NULL);
- if (missing) {
- lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
- return LV2_STATE_ERR_NO_FEATURE;
- }
-
- // Get eg:sample from state
- size_t size;
- uint32_t type;
- uint32_t valflags;
- const void* value = retrieve(handle, self->uris.eg_sample,
- &size, &type, &valflags);
- if (!value) {
- lv2_log_error(&self->logger, "Missing eg:sample\n");
- return LV2_STATE_ERR_NO_PROPERTY;
- } else if (type != self->uris.atom_Path) {
- lv2_log_error(&self->logger, "Non-path eg:sample\n");
- return LV2_STATE_ERR_BAD_TYPE;
- }
-
- // Map abstract state path to absolute path
- const char* apath = (const char*)value;
- char* path = paths->absolute_path(paths->handle, apath);
-
- // Replace current sample with the new one
- if (!self->activated || !schedule) {
- // No scheduling available, load sample immediately
- lv2_log_trace(&self->logger, "Synchronous restore\n");
- Sample* sample = load_sample(&self->logger, path);
- if (sample) {
- free_sample(self, self->sample);
- self->sample = sample;
- self->sample_changed = true;
- }
- } else {
- // Schedule sample to be loaded by the provided worker
- lv2_log_trace(&self->logger, "Scheduling restore\n");
- LV2_Atom_Forge forge;
- LV2_Atom* buf = (LV2_Atom*)calloc(1, strlen(path) + 128);
- lv2_atom_forge_init(&forge, self->map);
- lv2_atom_forge_set_sink(&forge, atom_sink, atom_sink_deref, buf);
- write_set_file(&forge, &self->uris, path, strlen(path));
-
- const uint32_t msg_size = lv2_atom_pad_size(buf->size);
- schedule->schedule_work(self->schedule->handle, msg_size, buf + 1);
- free(buf);
- }
-
- free(path);
-
- return LV2_STATE_SUCCESS;
+ Sampler* self = (Sampler*)instance;
+
+ // Get host features
+ LV2_Worker_Schedule* schedule = NULL;
+ LV2_State_Map_Path* paths = NULL;
+
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_STATE__mapPath, &paths, true,
+ LV2_WORKER__schedule, &schedule, false,
+ NULL);
+ // clang-format on
+
+ if (missing) {
+ lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
+ return LV2_STATE_ERR_NO_FEATURE;
+ }
+
+ // Get eg:sample from state
+ size_t size = 0;
+ uint32_t type = 0;
+ uint32_t valflags = 0;
+ const void* value =
+ retrieve(handle, self->uris.eg_sample, &size, &type, &valflags);
+
+ if (!value) {
+ lv2_log_error(&self->logger, "Missing eg:sample\n");
+ return LV2_STATE_ERR_NO_PROPERTY;
+ }
+
+ if (type != self->uris.atom_Path) {
+ lv2_log_error(&self->logger, "Non-path eg:sample\n");
+ return LV2_STATE_ERR_BAD_TYPE;
+ }
+
+ // Map abstract state path to absolute path
+ const char* apath = (const char*)value;
+ char* path = paths->absolute_path(paths->handle, apath);
+
+ // Replace current sample with the new one
+ if (!self->activated || !schedule) {
+ // No scheduling available, load sample immediately
+ lv2_log_trace(&self->logger, "Synchronous restore\n");
+ Sample* sample = load_sample(&self->logger, path, self->sample_rate);
+ if (sample) {
+ free_sample(self, self->sample);
+ self->sample = sample;
+ self->sample_changed = true;
+ }
+ } else {
+ // Schedule sample to be loaded by the provided worker
+ lv2_log_trace(&self->logger, "Scheduling restore\n");
+ LV2_Atom_Forge forge;
+ LV2_Atom* buf = (LV2_Atom*)calloc(1, strlen(path) + 128);
+ lv2_atom_forge_init(&forge, self->map);
+ lv2_atom_forge_set_sink(&forge, atom_sink, atom_sink_deref, buf);
+ write_set_file(&forge, &self->uris, path, strlen(path));
+
+ const uint32_t msg_size = lv2_atom_pad_size(buf->size);
+ schedule->schedule_work(self->schedule->handle, msg_size, buf + 1);
+ free(buf);
+ }
+
+ free(path);
+
+ // Get param:gain from state
+ value = retrieve(handle, self->uris.param_gain, &size, &type, &valflags);
+
+ if (!value) {
+ // Not an error, since older versions did not save this property
+ lv2_log_note(&self->logger, "Missing param:gain\n");
+ return LV2_STATE_SUCCESS;
+ }
+
+ if (type != self->uris.atom_Float) {
+ lv2_log_error(&self->logger, "Non-float param:gain\n");
+ return LV2_STATE_ERR_BAD_TYPE;
+ }
+
+ self->gain_dB = *(const float*)value;
+ self->gain = DB_CO(self->gain_dB);
+ self->gain_changed = true;
+
+ return LV2_STATE_SUCCESS;
}
static const void*
extension_data(const char* uri)
{
- static const LV2_State_Interface state = { save, restore };
- static const LV2_Worker_Interface worker = { work, work_response, NULL };
- if (!strcmp(uri, LV2_STATE__interface)) {
- return &state;
- } else if (!strcmp(uri, LV2_WORKER__interface)) {
- return &worker;
- }
- return NULL;
+ static const LV2_State_Interface state = {save, restore};
+ static const LV2_Worker_Interface worker = {work, work_response, NULL};
+
+ if (!strcmp(uri, LV2_STATE__interface)) {
+ return &state;
+ }
+
+ if (!strcmp(uri, LV2_WORKER__interface)) {
+ return &worker;
+ }
+
+ return NULL;
}
-static const LV2_Descriptor descriptor = {
- EG_SAMPLER_URI,
- instantiate,
- connect_port,
- activate,
- run,
- deactivate,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor = {EG_SAMPLER_URI,
+ instantiate,
+ connect_port,
+ activate,
+ run,
+ deactivate,
+ cleanup,
+ extension_data};
LV2_SYMBOL_EXPORT
-const LV2_Descriptor* lv2_descriptor(uint32_t index)
+const LV2_Descriptor*
+lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-sampler.lv2/sampler.ttl b/plugins/eg-sampler.lv2/sampler.ttl
index f5088f3..4a3c24c 100644
--- a/plugins/eg-sampler.lv2/sampler.ttl
+++ b/plugins/eg-sampler.lv2/sampler.ttl
@@ -58,7 +58,7 @@
] ;
state:state [
<http://lv2plug.in/plugins/eg-sampler#sample> <click.wav> ;
- param:gain "1.0"^^xsd:float
+ param:gain "0.0"^^xsd:float
] .
<http://lv2plug.in/plugins/eg-sampler#ui>
diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c
index 13a8cd4..16a8c71 100644
--- a/plugins/eg-sampler.lv2/sampler_ui.c
+++ b/plugins/eg-sampler.lv2/sampler_ui.c
@@ -1,19 +1,5 @@
-/*
- LV2 Sampler Example Plugin UI
- Copyright 2011-2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2011-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "peaks.h"
#include "uris.h"
@@ -36,6 +22,7 @@
#include <gobject/gclosure.h>
#include <gtk/gtk.h>
+#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
@@ -47,193 +34,198 @@
#define MIN_CANVAS_H 80
typedef struct {
- LV2_Atom_Forge forge;
- LV2_URID_Map* map;
- LV2UI_Request_Value* request_value;
- LV2_Log_Logger logger;
- SamplerURIs uris;
- PeaksReceiver precv;
-
- LV2UI_Write_Function write;
- LV2UI_Controller controller;
-
- GtkWidget* box;
- GtkWidget* play_button;
- GtkWidget* file_button;
- GtkWidget* request_file_button;
- GtkWidget* button_box;
- GtkWidget* canvas;
-
- uint32_t width;
- uint32_t requested_n_peaks;
- char* filename;
-
- uint8_t forge_buf[1024];
-
- // Optional show/hide interface
- GtkWidget* window;
- bool did_init;
+ LV2_Atom_Forge forge;
+ LV2_URID_Map* map;
+ LV2UI_Request_Value* request_value;
+ LV2_Log_Logger logger;
+ SamplerURIs uris;
+ PeaksReceiver precv;
+
+ LV2UI_Write_Function write;
+ LV2UI_Controller controller;
+
+ GtkWidget* box;
+ GtkWidget* play_button;
+ GtkWidget* file_button;
+ GtkWidget* request_file_button;
+ GtkWidget* button_box;
+ GtkWidget* canvas;
+
+ uint32_t width;
+ uint32_t requested_n_peaks;
+ char* filename;
+
+ uint8_t forge_buf[1024];
+
+ // Optional show/hide interface
+ GtkWidget* window;
+ bool did_init;
} SamplerUI;
static void
on_file_set(GtkFileChooserButton* widget, void* handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
+ SamplerUI* ui = (SamplerUI*)handle;
- // Get the filename from the file chooser
- char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
+ // Get the filename from the file chooser
+ char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
- // Write a set message to the plugin to load new file
- lv2_atom_forge_set_buffer(&ui->forge, ui->forge_buf, sizeof(ui->forge_buf));
- LV2_Atom* msg = (LV2_Atom*)write_set_file(&ui->forge, &ui->uris,
- filename, strlen(filename));
+ // Write a set message to the plugin to load new file
+ lv2_atom_forge_set_buffer(&ui->forge, ui->forge_buf, sizeof(ui->forge_buf));
+ LV2_Atom* msg = (LV2_Atom*)write_set_file(
+ &ui->forge, &ui->uris, filename, strlen(filename));
- ui->write(ui->controller, 0, lv2_atom_total_size(msg),
- ui->uris.atom_eventTransfer,
- msg);
+ assert(msg);
- g_free(filename);
+ ui->write(ui->controller,
+ 0,
+ lv2_atom_total_size(msg),
+ ui->uris.atom_eventTransfer,
+ msg);
+
+ g_free(filename);
}
static void
on_request_file(GtkButton* widget, void* handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
+ SamplerUI* ui = (SamplerUI*)handle;
- ui->request_value->request(ui->request_value->handle,
- ui->uris.eg_sample,
- 0,
- NULL);
+ ui->request_value->request(
+ ui->request_value->handle, ui->uris.eg_sample, 0, NULL);
}
static void
on_play_clicked(GtkFileChooserButton* widget, void* handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
- struct {
- LV2_Atom atom;
- uint8_t msg[3];
- } note_on;
-
- note_on.atom.type = ui->uris.midi_Event;
- note_on.atom.size = 3;
- note_on.msg[0] = LV2_MIDI_MSG_NOTE_ON;
- note_on.msg[1] = 60;
- note_on.msg[2] = 60;
- ui->write(ui->controller, 0, sizeof(LV2_Atom) + 3,
- ui->uris.atom_eventTransfer,
- &note_on);
+ SamplerUI* ui = (SamplerUI*)handle;
+ struct {
+ LV2_Atom atom;
+ uint8_t msg[3];
+ } note_on;
+
+ note_on.atom.type = ui->uris.midi_Event;
+ note_on.atom.size = 3;
+ note_on.msg[0] = LV2_MIDI_MSG_NOTE_ON;
+ note_on.msg[1] = 60;
+ note_on.msg[2] = 60;
+ ui->write(ui->controller,
+ 0,
+ sizeof(LV2_Atom) + 3,
+ ui->uris.atom_eventTransfer,
+ &note_on);
}
static void
request_peaks(SamplerUI* ui, uint32_t n_peaks)
{
- if (n_peaks == ui->requested_n_peaks) {
- return;
- }
-
- lv2_atom_forge_set_buffer(&ui->forge, ui->forge_buf, sizeof(ui->forge_buf));
-
- LV2_Atom_Forge_Frame frame;
- lv2_atom_forge_object(&ui->forge, &frame, 0, ui->uris.patch_Get);
- lv2_atom_forge_key(&ui->forge, ui->uris.patch_accept);
- lv2_atom_forge_urid(&ui->forge, ui->precv.uris.peaks_PeakUpdate);
- lv2_atom_forge_key(&ui->forge, ui->precv.uris.peaks_total);
- lv2_atom_forge_int(&ui->forge, n_peaks);
- lv2_atom_forge_pop(&ui->forge, &frame);
-
- LV2_Atom* msg = lv2_atom_forge_deref(&ui->forge, frame.ref);
- ui->write(ui->controller, 0, lv2_atom_total_size(msg),
- ui->uris.atom_eventTransfer,
- msg);
-
- ui->requested_n_peaks = n_peaks;
+ if (n_peaks == ui->requested_n_peaks) {
+ return;
+ }
+
+ lv2_atom_forge_set_buffer(&ui->forge, ui->forge_buf, sizeof(ui->forge_buf));
+
+ LV2_Atom_Forge_Frame frame;
+ lv2_atom_forge_object(&ui->forge, &frame, 0, ui->uris.patch_Get);
+ lv2_atom_forge_key(&ui->forge, ui->uris.patch_accept);
+ lv2_atom_forge_urid(&ui->forge, ui->precv.uris.peaks_PeakUpdate);
+ lv2_atom_forge_key(&ui->forge, ui->precv.uris.peaks_total);
+ lv2_atom_forge_int(&ui->forge, n_peaks);
+ lv2_atom_forge_pop(&ui->forge, &frame);
+
+ LV2_Atom* msg = lv2_atom_forge_deref(&ui->forge, frame.ref);
+ ui->write(ui->controller,
+ 0,
+ lv2_atom_total_size(msg),
+ ui->uris.atom_eventTransfer,
+ msg);
+
+ ui->requested_n_peaks = n_peaks;
}
/** Set Cairo color to a GDK color (to follow Gtk theme). */
static void
cairo_set_source_gdk(cairo_t* cr, const GdkColor* color)
{
- cairo_set_source_rgb(
- cr, color->red / 65535.0, color->green / 65535.0, color->blue / 65535.0);
-
+ cairo_set_source_rgb(
+ cr, color->red / 65535.0, color->green / 65535.0, color->blue / 65535.0);
}
static gboolean
on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data)
{
- SamplerUI* ui = (SamplerUI*)data;
+ SamplerUI* ui = (SamplerUI*)data;
- GtkAllocation size;
- gtk_widget_get_allocation(widget, &size);
+ GtkAllocation size;
+ gtk_widget_get_allocation(widget, &size);
- ui->width = size.width;
- if ((uint32_t)ui->width > 2 * ui->requested_n_peaks) {
- request_peaks(ui, 2 * ui->requested_n_peaks);
- }
+ ui->width = size.width;
+ if (ui->width > 2 * ui->requested_n_peaks) {
+ request_peaks(ui, 2 * ui->requested_n_peaks);
+ }
- cairo_t* cr = gdk_cairo_create(gtk_widget_get_window(widget));
+ cairo_t* cr = gdk_cairo_create(gtk_widget_get_window(widget));
- cairo_set_line_width(cr, 1.0);
- cairo_translate(cr, 0.5, 0.5);
+ cairo_set_line_width(cr, 1.0);
+ cairo_translate(cr, 0.5, 0.5);
- const int mid_y = size.height / 2;
+ const double mid_y = size.height / 2.0;
- const float* const peaks = ui->precv.peaks;
- const int32_t n_peaks = ui->precv.n_peaks;
- if (peaks) {
- // Draw waveform
- const double scale = size.width / ((double)n_peaks - 1.0f);
+ const float* const peaks = ui->precv.peaks;
+ const int32_t n_peaks = ui->precv.n_peaks;
+ if (peaks) {
+ // Draw waveform
+ const double scale = size.width / ((double)n_peaks - 1.0f);
- // Start at left origin
- cairo_move_to(cr, 0, mid_y);
+ // Start at left origin
+ cairo_move_to(cr, 0, mid_y);
- // Draw line through top peaks
- for (int i = 0; i < n_peaks; ++i) {
- const float peak = peaks[i];
- cairo_line_to(cr, i * scale, mid_y + (peak / 2.0f) * size.height);
- }
+ // Draw line through top peaks
+ for (int i = 0; i < n_peaks; ++i) {
+ const float peak = peaks[i];
+ cairo_line_to(cr, i * scale, mid_y + (peak / 2.0f) * size.height);
+ }
- // Continue through bottom peaks
- for (int i = n_peaks - 1; i >= 0; --i) {
- const float peak = peaks[i];
- cairo_line_to(cr, i * scale, mid_y - (peak / 2.0f) * size.height);
- }
+ // Continue through bottom peaks
+ for (int i = n_peaks - 1; i >= 0; --i) {
+ const float peak = peaks[i];
+ cairo_line_to(cr, i * scale, mid_y - (peak / 2.0f) * size.height);
+ }
- // Close shape
- cairo_line_to(cr, 0, mid_y);
+ // Close shape
+ cairo_line_to(cr, 0, mid_y);
- cairo_set_source_gdk(cr, widget->style->mid);
- cairo_fill_preserve(cr);
+ cairo_set_source_gdk(cr, widget->style->mid);
+ cairo_fill_preserve(cr);
- cairo_set_source_gdk(cr, widget->style->fg);
- cairo_stroke(cr);
- }
+ cairo_set_source_gdk(cr, widget->style->fg);
+ cairo_stroke(cr);
+ }
- cairo_destroy(cr);
- return TRUE;
+ cairo_destroy(cr);
+ return TRUE;
}
static void
destroy_window(SamplerUI* ui)
{
- if (ui->window) {
- gtk_container_remove(GTK_CONTAINER(ui->window), ui->box);
- gtk_widget_destroy(ui->window);
- ui->window = NULL;
- }
+ if (ui->window) {
+ gtk_container_remove(GTK_CONTAINER(ui->window), ui->box);
+ gtk_widget_destroy(ui->window);
+ ui->window = NULL;
+ }
}
static gboolean
on_window_closed(GtkWidget* widget, GdkEvent* event, gpointer data)
{
- SamplerUI* ui = (SamplerUI*)data;
+ SamplerUI* ui = (SamplerUI*)data;
- // Remove widget so Gtk doesn't delete it when the window is closed
- gtk_container_remove(GTK_CONTAINER(ui->window), ui->box);
- ui->window = NULL;
+ // Remove widget so Gtk doesn't delete it when the window is closed
+ gtk_container_remove(GTK_CONTAINER(ui->window), ui->box);
+ ui->window = NULL;
- return FALSE;
+ return FALSE;
}
static LV2UI_Handle
@@ -245,97 +237,104 @@ instantiate(const LV2UI_Descriptor* descriptor,
LV2UI_Widget* widget,
const LV2_Feature* const* features)
{
- SamplerUI* ui = (SamplerUI*)calloc(1, sizeof(SamplerUI));
- if (!ui) {
- return NULL;
- }
-
- ui->write = write_function;
- ui->controller = controller;
- ui->width = MIN_CANVAS_W;
- *widget = NULL;
- ui->window = NULL;
- ui->did_init = false;
-
- // Get host features
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &ui->logger.log , false,
- LV2_URID__map, &ui->map, true,
- LV2_UI__requestValue, &ui->request_value, false,
- NULL);
- lv2_log_logger_set_map(&ui->logger, ui->map);
- if (missing) {
- lv2_log_error(&ui->logger, "Missing feature <%s>\n", missing);
- free(ui);
- return NULL;
- }
-
- // Map URIs and initialise forge
- map_sampler_uris(ui->map, &ui->uris);
- lv2_atom_forge_init(&ui->forge, ui->map);
- peaks_receiver_init(&ui->precv, ui->map);
-
- // Construct Gtk UI
- ui->box = gtk_vbox_new(FALSE, 4);
- ui->play_button = gtk_button_new_with_label("▶");
- ui->canvas = gtk_drawing_area_new();
- ui->button_box = gtk_hbox_new(FALSE, 4);
- ui->file_button = gtk_file_chooser_button_new(
- "Load Sample", GTK_FILE_CHOOSER_ACTION_OPEN);
- ui->request_file_button = gtk_button_new_with_label("Request Sample");
- gtk_widget_set_size_request(ui->canvas, MIN_CANVAS_W, MIN_CANVAS_H);
- gtk_container_set_border_width(GTK_CONTAINER(ui->box), 4);
- gtk_box_pack_start(GTK_BOX(ui->box), ui->canvas, TRUE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX(ui->box), ui->button_box, FALSE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX(ui->button_box), ui->play_button, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(ui->button_box), ui->request_file_button, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(ui->button_box), ui->file_button, TRUE, TRUE, 0);
-
- g_signal_connect(ui->file_button, "file-set",
- G_CALLBACK(on_file_set), ui);
-
- g_signal_connect(ui->request_file_button, "clicked",
- G_CALLBACK(on_request_file), ui);
-
- g_signal_connect(ui->play_button, "clicked",
- G_CALLBACK(on_play_clicked), ui);
-
- g_signal_connect(G_OBJECT(ui->canvas), "expose_event",
- G_CALLBACK(on_canvas_expose), ui);
-
- // Request state (filename) from plugin
- lv2_atom_forge_set_buffer(&ui->forge, ui->forge_buf, sizeof(ui->forge_buf));
- LV2_Atom_Forge_Frame frame;
- LV2_Atom* msg = (LV2_Atom*)lv2_atom_forge_object(
- &ui->forge, &frame, 0, ui->uris.patch_Get);
- lv2_atom_forge_pop(&ui->forge, &frame);
-
- ui->write(ui->controller, 0, lv2_atom_total_size(msg),
- ui->uris.atom_eventTransfer,
- msg);
-
- *widget = ui->box;
-
- return ui;
+ SamplerUI* ui = (SamplerUI*)calloc(1, sizeof(SamplerUI));
+ if (!ui) {
+ return NULL;
+ }
+
+ ui->write = write_function;
+ ui->controller = controller;
+ ui->width = MIN_CANVAS_W;
+ *widget = NULL;
+ ui->window = NULL;
+ ui->did_init = false;
+
+ // Get host features
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &ui->logger.log, false,
+ LV2_URID__map, &ui->map, true,
+ LV2_UI__requestValue, &ui->request_value, false,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&ui->logger, ui->map);
+ if (missing) {
+ lv2_log_error(&ui->logger, "Missing feature <%s>\n", missing);
+ free(ui);
+ return NULL;
+ }
+
+ // Map URIs and initialise forge
+ map_sampler_uris(ui->map, &ui->uris);
+ lv2_atom_forge_init(&ui->forge, ui->map);
+ peaks_receiver_init(&ui->precv, ui->map);
+
+ // Construct Gtk UI
+ ui->box = gtk_vbox_new(FALSE, 4);
+ ui->play_button = gtk_button_new_with_label("▶");
+ ui->canvas = gtk_drawing_area_new();
+ ui->button_box = gtk_hbox_new(FALSE, 4);
+ ui->file_button =
+ gtk_file_chooser_button_new("Load Sample", GTK_FILE_CHOOSER_ACTION_OPEN);
+ ui->request_file_button = gtk_button_new_with_label("Request Sample");
+ gtk_widget_set_size_request(ui->canvas, MIN_CANVAS_W, MIN_CANVAS_H);
+ gtk_container_set_border_width(GTK_CONTAINER(ui->box), 4);
+ gtk_box_pack_start(GTK_BOX(ui->box), ui->canvas, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(ui->box), ui->button_box, FALSE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(ui->button_box), ui->play_button, FALSE, FALSE, 0);
+ gtk_box_pack_start(
+ GTK_BOX(ui->button_box), ui->request_file_button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(ui->button_box), ui->file_button, TRUE, TRUE, 0);
+
+ g_signal_connect(ui->file_button, "file-set", G_CALLBACK(on_file_set), ui);
+
+ g_signal_connect(
+ ui->request_file_button, "clicked", G_CALLBACK(on_request_file), ui);
+
+ g_signal_connect(ui->play_button, "clicked", G_CALLBACK(on_play_clicked), ui);
+
+ g_signal_connect(
+ G_OBJECT(ui->canvas), "expose_event", G_CALLBACK(on_canvas_expose), ui);
+
+ // Request state (filename) from plugin
+ lv2_atom_forge_set_buffer(&ui->forge, ui->forge_buf, sizeof(ui->forge_buf));
+ LV2_Atom_Forge_Frame frame;
+ LV2_Atom* msg =
+ (LV2_Atom*)lv2_atom_forge_object(&ui->forge, &frame, 0, ui->uris.patch_Get);
+
+ assert(msg);
+
+ lv2_atom_forge_pop(&ui->forge, &frame);
+
+ ui->write(ui->controller,
+ 0,
+ lv2_atom_total_size(msg),
+ ui->uris.atom_eventTransfer,
+ msg);
+
+ *widget = ui->box;
+
+ return ui;
}
static void
cleanup(LV2UI_Handle handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
-
- if (ui->window) {
- destroy_window(ui);
- }
-
- gtk_widget_destroy(ui->canvas);
- gtk_widget_destroy(ui->play_button);
- gtk_widget_destroy(ui->file_button);
- gtk_widget_destroy(ui->request_file_button);
- gtk_widget_destroy(ui->button_box);
- gtk_widget_destroy(ui->box);
- free(ui);
+ SamplerUI* ui = (SamplerUI*)handle;
+
+ if (ui->window) {
+ destroy_window(ui);
+ }
+
+ gtk_widget_destroy(ui->canvas);
+ gtk_widget_destroy(ui->play_button);
+ gtk_widget_destroy(ui->file_button);
+ gtk_widget_destroy(ui->request_file_button);
+ gtk_widget_destroy(ui->button_box);
+ gtk_widget_destroy(ui->box);
+ free(ui);
}
static void
@@ -345,121 +344,116 @@ port_event(LV2UI_Handle handle,
uint32_t format,
const void* buffer)
{
- SamplerUI* ui = (SamplerUI*)handle;
- if (format == ui->uris.atom_eventTransfer) {
- const LV2_Atom* atom = (const LV2_Atom*)buffer;
- if (lv2_atom_forge_is_object_type(&ui->forge, atom->type)) {
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)atom;
- if (obj->body.otype == ui->uris.patch_Set) {
- const char* path = read_set_file(&ui->uris, obj);
- if (path && (!ui->filename || strcmp(path, ui->filename))) {
- g_free(ui->filename);
- ui->filename = g_strdup(path);
- gtk_file_chooser_set_filename(
- GTK_FILE_CHOOSER(ui->file_button), path);
- peaks_receiver_clear(&ui->precv);
- ui->requested_n_peaks = 0;
- request_peaks(ui, ui->width / 2 * 2);
- } else if (!path) {
- lv2_log_warning(&ui->logger, "Set message has no path\n");
- }
- } else if (obj->body.otype == ui->precv.uris.peaks_PeakUpdate) {
- if (!peaks_receiver_receive(&ui->precv, obj)) {
- gtk_widget_queue_draw(ui->canvas);
- }
- }
- } else {
- lv2_log_error(&ui->logger, "Unknown message type\n");
- }
- } else {
- lv2_log_warning(&ui->logger, "Unknown port event format\n");
- }
+ SamplerUI* ui = (SamplerUI*)handle;
+ if (format == ui->uris.atom_eventTransfer) {
+ const LV2_Atom* atom = (const LV2_Atom*)buffer;
+ if (lv2_atom_forge_is_object_type(&ui->forge, atom->type)) {
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)atom;
+ if (obj->body.otype == ui->uris.patch_Set) {
+ const char* path = read_set_file(&ui->uris, obj);
+ if (path && (!ui->filename || !!strcmp(path, ui->filename))) {
+ g_free(ui->filename);
+ ui->filename = g_strdup(path);
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(ui->file_button),
+ path);
+ peaks_receiver_clear(&ui->precv);
+ ui->requested_n_peaks = 0;
+ request_peaks(ui, ui->width / 2 * 2);
+ } else if (!path) {
+ lv2_log_warning(&ui->logger, "Set message has no path\n");
+ }
+ } else if (obj->body.otype == ui->precv.uris.peaks_PeakUpdate) {
+ if (!peaks_receiver_receive(&ui->precv, obj)) {
+ gtk_widget_queue_draw(ui->canvas);
+ }
+ }
+ } else {
+ lv2_log_error(&ui->logger, "Unknown message type\n");
+ }
+ } else {
+ lv2_log_warning(&ui->logger, "Unknown port event format\n");
+ }
}
/* Optional non-embedded UI show interface. */
static int
ui_show(LV2UI_Handle handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
+ SamplerUI* ui = (SamplerUI*)handle;
- if (ui->window) {
- return 0;
- }
+ if (ui->window) {
+ return 0;
+ }
- if (!ui->did_init) {
- int argc = 0;
- gtk_init_check(&argc, NULL);
- g_object_ref(ui->box);
- ui->did_init = true;
- }
+ if (!ui->did_init) {
+ int argc = 0;
+ gtk_init_check(&argc, NULL);
+ g_object_ref(ui->box);
+ ui->did_init = true;
+ }
- ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_container_add(GTK_CONTAINER(ui->window), ui->box);
+ ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_container_add(GTK_CONTAINER(ui->window), ui->box);
- g_signal_connect(G_OBJECT(ui->window),
- "delete-event",
- G_CALLBACK(on_window_closed),
- handle);
+ g_signal_connect(
+ G_OBJECT(ui->window), "delete-event", G_CALLBACK(on_window_closed), handle);
- gtk_widget_show_all(ui->window);
- gtk_window_present(GTK_WINDOW(ui->window));
+ gtk_widget_show_all(ui->window);
+ gtk_window_present(GTK_WINDOW(ui->window));
- return 0;
+ return 0;
}
/* Optional non-embedded UI hide interface. */
static int
ui_hide(LV2UI_Handle handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
+ SamplerUI* ui = (SamplerUI*)handle;
- if (ui->window) {
- destroy_window(ui);
- }
+ if (ui->window) {
+ destroy_window(ui);
+ }
- return 0;
+ return 0;
}
/* Idle interface for optional non-embedded UI. */
static int
ui_idle(LV2UI_Handle handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
- if (ui->window) {
- gtk_main_iteration_do(false);
- }
- return 0;
+ SamplerUI* ui = (SamplerUI*)handle;
+ if (ui->window) {
+ gtk_main_iteration_do(false);
+ }
+ return 0;
}
static const void*
extension_data(const char* uri)
{
- static const LV2UI_Show_Interface show = { ui_show, ui_hide };
- static const LV2UI_Idle_Interface idle = { ui_idle };
- if (!strcmp(uri, LV2_UI__showInterface)) {
- return &show;
- } else if (!strcmp(uri, LV2_UI__idleInterface)) {
- return &idle;
- }
- return NULL;
+ static const LV2UI_Show_Interface show = {ui_show, ui_hide};
+ static const LV2UI_Idle_Interface idle = {ui_idle};
+
+ if (!strcmp(uri, LV2_UI__showInterface)) {
+ return &show;
+ }
+
+ if (!strcmp(uri, LV2_UI__idleInterface)) {
+ return &idle;
+ }
+
+ return NULL;
}
-static const LV2UI_Descriptor descriptor = {
- SAMPLER_UI_URI,
- instantiate,
- cleanup,
- port_event,
- extension_data
-};
+static const LV2UI_Descriptor descriptor = {SAMPLER_UI_URI,
+ instantiate,
+ cleanup,
+ port_event,
+ extension_data};
LV2_SYMBOL_EXPORT
const LV2UI_Descriptor*
lv2ui_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h
index 57e5754..f934390 100644
--- a/plugins/eg-sampler.lv2/uris.h
+++ b/plugins/eg-sampler.lv2/uris.h
@@ -1,76 +1,89 @@
-/*
- LV2 Sampler Example Plugin
- Copyright 2011-2016 David Robillard <d@drobilla.net>
-
- 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.
-*/
+// Copyright 2011-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#ifndef SAMPLER_URIS_H
#define SAMPLER_URIS_H
#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
-#include "lv2/log/log.h"
+#include "lv2/atom/util.h"
#include "lv2/midi/midi.h"
#include "lv2/parameters/parameters.h"
#include "lv2/patch/patch.h"
-#include "lv2/state/state.h"
+#include "lv2/urid/urid.h"
+#include <stdint.h>
#include <stdio.h>
-#define EG_SAMPLER_URI "http://lv2plug.in/plugins/eg-sampler"
+#define EG_SAMPLER_URI "http://lv2plug.in/plugins/eg-sampler"
#define EG_SAMPLER__applySample EG_SAMPLER_URI "#applySample"
-#define EG_SAMPLER__freeSample EG_SAMPLER_URI "#freeSample"
-#define EG_SAMPLER__sample EG_SAMPLER_URI "#sample"
+#define EG_SAMPLER__freeSample EG_SAMPLER_URI "#freeSample"
+#define EG_SAMPLER__sample EG_SAMPLER_URI "#sample"
typedef struct {
- LV2_URID atom_Float;
- LV2_URID atom_Path;
- LV2_URID atom_Resource;
- LV2_URID atom_Sequence;
- LV2_URID atom_URID;
- LV2_URID atom_eventTransfer;
- LV2_URID eg_applySample;
- LV2_URID eg_freeSample;
- LV2_URID eg_sample;
- LV2_URID midi_Event;
- LV2_URID param_gain;
- LV2_URID patch_Get;
- LV2_URID patch_Set;
- LV2_URID patch_accept;
- LV2_URID patch_property;
- LV2_URID patch_value;
+ LV2_URID atom_Float;
+ LV2_URID atom_Path;
+ LV2_URID atom_Resource;
+ LV2_URID atom_Sequence;
+ LV2_URID atom_URID;
+ LV2_URID atom_eventTransfer;
+ LV2_URID eg_applySample;
+ LV2_URID eg_freeSample;
+ LV2_URID eg_sample;
+ LV2_URID midi_Event;
+ LV2_URID param_gain;
+ LV2_URID patch_Get;
+ LV2_URID patch_Set;
+ LV2_URID patch_accept;
+ LV2_URID patch_property;
+ LV2_URID patch_value;
} SamplerURIs;
static inline void
map_sampler_uris(LV2_URID_Map* map, SamplerURIs* uris)
{
- uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
- uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
- uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource);
- uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
- uris->atom_URID = map->map(map->handle, LV2_ATOM__URID);
- uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
- uris->eg_applySample = map->map(map->handle, EG_SAMPLER__applySample);
- uris->eg_freeSample = map->map(map->handle, EG_SAMPLER__freeSample);
- uris->eg_sample = map->map(map->handle, EG_SAMPLER__sample);
- uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent);
- uris->param_gain = map->map(map->handle, LV2_PARAMETERS__gain);
- uris->patch_Get = map->map(map->handle, LV2_PATCH__Get);
- uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
- uris->patch_accept = map->map(map->handle, LV2_PATCH__accept);
- uris->patch_property = map->map(map->handle, LV2_PATCH__property);
- uris->patch_value = map->map(map->handle, LV2_PATCH__value);
+ uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
+ uris->atom_Path = map->map(map->handle, LV2_ATOM__Path);
+ uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource);
+ uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence);
+ uris->atom_URID = map->map(map->handle, LV2_ATOM__URID);
+ uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
+ uris->eg_applySample = map->map(map->handle, EG_SAMPLER__applySample);
+ uris->eg_freeSample = map->map(map->handle, EG_SAMPLER__freeSample);
+ uris->eg_sample = map->map(map->handle, EG_SAMPLER__sample);
+ uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent);
+ uris->param_gain = map->map(map->handle, LV2_PARAMETERS__gain);
+ uris->patch_Get = map->map(map->handle, LV2_PATCH__Get);
+ uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
+ uris->patch_accept = map->map(map->handle, LV2_PATCH__accept);
+ uris->patch_property = map->map(map->handle, LV2_PATCH__property);
+ uris->patch_value = map->map(map->handle, LV2_PATCH__value);
+}
+
+/**
+ Write a message like the following to `forge`:
+ [source,turtle]
+ ----
+ []
+ a patch:Set ;
+ patch:property param:gain ;
+ patch:value 0.0f .
+ ----
+*/
+static inline LV2_Atom_Forge_Ref
+write_set_gain(LV2_Atom_Forge* forge, const SamplerURIs* uris, const float gain)
+{
+ LV2_Atom_Forge_Frame frame;
+ LV2_Atom_Forge_Ref set =
+ lv2_atom_forge_object(forge, &frame, 0, uris->patch_Set);
+
+ lv2_atom_forge_key(forge, uris->patch_property);
+ lv2_atom_forge_urid(forge, uris->param_gain);
+ lv2_atom_forge_key(forge, uris->patch_value);
+ lv2_atom_forge_float(forge, gain);
+
+ lv2_atom_forge_pop(forge, &frame);
+ return set;
}
/**
@@ -89,17 +102,17 @@ write_set_file(LV2_Atom_Forge* forge,
const char* filename,
const uint32_t filename_len)
{
- LV2_Atom_Forge_Frame frame;
- LV2_Atom_Forge_Ref set = lv2_atom_forge_object(
- forge, &frame, 0, uris->patch_Set);
+ LV2_Atom_Forge_Frame frame;
+ LV2_Atom_Forge_Ref set =
+ lv2_atom_forge_object(forge, &frame, 0, uris->patch_Set);
- lv2_atom_forge_key(forge, uris->patch_property);
- lv2_atom_forge_urid(forge, uris->eg_sample);
- lv2_atom_forge_key(forge, uris->patch_value);
- lv2_atom_forge_path(forge, filename, filename_len);
+ lv2_atom_forge_key(forge, uris->patch_property);
+ lv2_atom_forge_urid(forge, uris->eg_sample);
+ lv2_atom_forge_key(forge, uris->patch_value);
+ lv2_atom_forge_path(forge, filename, filename_len);
- lv2_atom_forge_pop(forge, &frame);
- return set;
+ lv2_atom_forge_pop(forge, &frame);
+ return set;
}
/**
@@ -113,46 +126,45 @@ write_set_file(LV2_Atom_Forge* forge,
----
*/
static inline const char*
-read_set_file(const SamplerURIs* uris,
- const LV2_Atom_Object* obj)
+read_set_file(const SamplerURIs* uris, const LV2_Atom_Object* obj)
{
- if (obj->body.otype != uris->patch_Set) {
- fprintf(stderr, "Ignoring unknown message type %u\n", obj->body.otype);
- return NULL;
- }
-
- /* Get property URI. */
- const LV2_Atom* property = NULL;
- lv2_atom_object_get(obj, uris->patch_property, &property, 0);
- if (!property) {
- fprintf(stderr, "Malformed set message has no body.\n");
- return NULL;
- }
-
- if (property->type != uris->atom_URID) {
- fprintf(stderr, "Malformed set message has non-URID property.\n");
- return NULL;
- }
-
- if (((const LV2_Atom_URID*)property)->body != uris->eg_sample) {
- fprintf(stderr, "Set message for unknown property.\n");
- return NULL;
- }
-
- /* Get value. */
- const LV2_Atom* value = NULL;
- lv2_atom_object_get(obj, uris->patch_value, &value, 0);
- if (!value) {
- fprintf(stderr, "Malformed set message has no value.\n");
- return NULL;
- }
-
- if (value->type != uris->atom_Path) {
- fprintf(stderr, "Set message value is not a Path.\n");
- return NULL;
- }
-
- return (const char*)LV2_ATOM_BODY_CONST(value);
+ if (obj->body.otype != uris->patch_Set) {
+ fprintf(stderr, "Ignoring unknown message type %u\n", obj->body.otype);
+ return NULL;
+ }
+
+ /* Get property URI. */
+ const LV2_Atom* property = NULL;
+ lv2_atom_object_get(obj, uris->patch_property, &property, 0);
+ if (!property) {
+ fprintf(stderr, "Malformed set message has no body.\n");
+ return NULL;
+ }
+
+ if (property->type != uris->atom_URID) {
+ fprintf(stderr, "Malformed set message has non-URID property.\n");
+ return NULL;
+ }
+
+ if (((const LV2_Atom_URID*)property)->body != uris->eg_sample) {
+ fprintf(stderr, "Set message for unknown property.\n");
+ return NULL;
+ }
+
+ /* Get value. */
+ const LV2_Atom* value = NULL;
+ lv2_atom_object_get(obj, uris->patch_value, &value, 0);
+ if (!value) {
+ fprintf(stderr, "Malformed set message has no value.\n");
+ return NULL;
+ }
+
+ if (value->type != uris->atom_Path) {
+ fprintf(stderr, "Set message value is not a Path.\n");
+ return NULL;
+ }
+
+ return (const char*)LV2_ATOM_BODY_CONST(value);
}
-#endif /* SAMPLER_URIS_H */
+#endif /* SAMPLER_URIS_H */
diff --git a/plugins/eg-sampler.lv2/waf b/plugins/eg-sampler.lv2/waf
deleted file mode 120000
index 59a1ac9..0000000
--- a/plugins/eg-sampler.lv2/waf
+++ /dev/null
@@ -1 +0,0 @@
-../../waf \ No newline at end of file
diff --git a/plugins/eg-sampler.lv2/wscript b/plugins/eg-sampler.lv2/wscript
deleted file mode 100644
index 8c640c1..0000000
--- a/plugins/eg-sampler.lv2/wscript
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-sampler.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2 >= 1.2.1', uselib_store='LV2')
- conf.check_pkg('sndfile >= 1.0.0', uselib_store='SNDFILE')
- conf.check_pkg('gtk+-2.0 >= 2.18.0',
- uselib_store='GTK2',
- system=True,
- mandatory=False)
- conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False)
-
-def build(bld):
- bundle = 'eg-sampler.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- bld(features = 'subst',
- source = 'manifest.ttl.in',
- target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Copy other data files to build bundle (build/eg-sampler.lv2)
- for i in ['sampler.ttl', 'click.wav']:
- bld(features = 'subst',
- is_copy = True,
- source = i,
- target = 'lv2/%s/%s' % (bundle, i),
- install_path = '${LV2DIR}/%s' % bundle)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'sampler.c',
- name = 'sampler',
- target = 'lv2/%s/sampler' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = ['M', 'SNDFILE', 'LV2'])
-
- # Build UI library
- if bld.env.HAVE_GTK2:
- obj = bld(features = 'c cshlib lv2lib',
- source = 'sampler_ui.c',
- name = 'sampler_ui',
- target = 'lv2/%s/sampler_ui' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = ['GTK2', 'LV2'])
diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c
index a4f5f3f..e3bb53b 100644
--- a/plugins/eg-scope.lv2/examploscope.c
+++ b/plugins/eg-scope.lv2/examploscope.c
@@ -1,19 +1,6 @@
-/*
- Copyright 2016 David Robillard <d@drobilla.net>
- Copyright 2013 Robin Gareus <robin@gareus.org>
-
- 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.
-*/
+// Copyright 2016 David Robillard <d@drobilla.net>
+// Copyright 2013 Robin Gareus <robin@gareus.org>
+// SPDX-License-Identifier: ISC
#include "./uris.h"
@@ -42,40 +29,40 @@
UI using atom messages via a sequence port, similarly to MIDI I/O.
*/
typedef struct {
- // Port buffers
- float* input[2];
- float* output[2];
- const LV2_Atom_Sequence* control;
- LV2_Atom_Sequence* notify;
-
- // Atom forge and URI mapping
- LV2_URID_Map* map;
- ScoLV2URIs uris;
- LV2_Atom_Forge forge;
- LV2_Atom_Forge_Frame frame;
-
- // Log feature and convenience API
- LV2_Log_Logger logger;
-
- // Instantiation settings
- uint32_t n_channels;
- double rate;
-
- // UI state
- bool ui_active;
- bool send_settings_to_ui;
- float ui_amp;
- uint32_t ui_spp;
+ // Port buffers
+ float* input[2];
+ float* output[2];
+ const LV2_Atom_Sequence* control;
+ LV2_Atom_Sequence* notify;
+
+ // Atom forge and URI mapping
+ LV2_URID_Map* map;
+ ScoLV2URIs uris;
+ LV2_Atom_Forge forge;
+ LV2_Atom_Forge_Frame frame;
+
+ // Log feature and convenience API
+ LV2_Log_Logger logger;
+
+ // Instantiation settings
+ uint32_t n_channels;
+ double rate;
+
+ // UI state
+ bool ui_active;
+ bool send_settings_to_ui;
+ float ui_amp;
+ uint32_t ui_spp;
} EgScope;
/** ==== Port Indices ==== */
typedef enum {
- SCO_CONTROL = 0, // Event input
- SCO_NOTIFY = 1, // Event output
- SCO_INPUT0 = 2, // Audio input 0
- SCO_OUTPUT0 = 3, // Audio output 0
- SCO_INPUT1 = 4, // Audio input 1 (stereo variant)
- SCO_OUTPUT1 = 5, // Audio input 2 (stereo variant)
+ SCO_CONTROL = 0, // Event input
+ SCO_NOTIFY = 1, // Event output
+ SCO_INPUT0 = 2, // Audio input 0
+ SCO_OUTPUT0 = 3, // Audio output 0
+ SCO_INPUT1 = 4, // Audio input 1 (stereo variant)
+ SCO_OUTPUT1 = 5, // Audio input 2 (stereo variant)
} PortIndex;
/** ==== Instantiate Method ==== */
@@ -85,82 +72,83 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
- (void)descriptor; // Unused variable
- (void)bundle_path; // Unused variable
-
- // Allocate and initialise instance structure.
- EgScope* self = (EgScope*)calloc(1, sizeof(EgScope));
- if (!self) {
- return NULL;
- }
-
- // Get host features
- const char* missing = lv2_features_query(
- features,
- LV2_LOG__log, &self->logger.log, false,
- LV2_URID__map, &self->map, true,
- NULL);
- lv2_log_logger_set_map(&self->logger, self->map);
- if (missing) {
- lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
- free(self);
- return NULL;
- }
-
- // Decide which variant to use depending on the plugin URI
- if (!strcmp(descriptor->URI, SCO_URI "#Stereo")) {
- self->n_channels = 2;
- } else if (!strcmp(descriptor->URI, SCO_URI "#Mono")) {
- self->n_channels = 1;
- } else {
- free(self);
- return NULL;
- }
-
- // Initialise local variables
- self->ui_active = false;
- self->send_settings_to_ui = false;
- self->rate = rate;
-
- // Set default UI settings
- self->ui_spp = 50;
- self->ui_amp = 1.0;
-
- // Map URIs and initialise forge/logger
- map_sco_uris(self->map, &self->uris);
- lv2_atom_forge_init(&self->forge, self->map);
-
- return (LV2_Handle)self;
+ (void)descriptor; // Unused variable
+ (void)bundle_path; // Unused variable
+
+ // Allocate and initialise instance structure.
+ EgScope* self = (EgScope*)calloc(1, sizeof(EgScope));
+ if (!self) {
+ return NULL;
+ }
+
+ // Get host features
+ // clang-format off
+ const char* missing = lv2_features_query(
+ features,
+ LV2_LOG__log, &self->logger.log, false,
+ LV2_URID__map, &self->map, true,
+ NULL);
+ // clang-format on
+
+ lv2_log_logger_set_map(&self->logger, self->map);
+ if (missing) {
+ lv2_log_error(&self->logger, "Missing feature <%s>\n", missing);
+ free(self);
+ return NULL;
+ }
+
+ // Decide which variant to use depending on the plugin URI
+ if (!strcmp(descriptor->URI, SCO_URI "#Stereo")) {
+ self->n_channels = 2;
+ } else if (!strcmp(descriptor->URI, SCO_URI "#Mono")) {
+ self->n_channels = 1;
+ } else {
+ free(self);
+ return NULL;
+ }
+
+ // Initialise local variables
+ self->ui_active = false;
+ self->send_settings_to_ui = false;
+ self->rate = rate;
+
+ // Set default UI settings
+ self->ui_spp = 50;
+ self->ui_amp = 1.0f;
+
+ // Map URIs and initialise forge/logger
+ map_sco_uris(self->map, &self->uris);
+ lv2_atom_forge_init(&self->forge, self->map);
+
+ return (LV2_Handle)self;
}
/** ==== Connect Port Method ==== */
static void
-connect_port(LV2_Handle handle,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle handle, uint32_t port, void* data)
{
- EgScope* self = (EgScope*)handle;
-
- switch ((PortIndex)port) {
- case SCO_CONTROL:
- self->control = (const LV2_Atom_Sequence*)data;
- break;
- case SCO_NOTIFY:
- self->notify = (LV2_Atom_Sequence*)data;
- break;
- case SCO_INPUT0:
- self->input[0] = (float*)data;
- break;
- case SCO_OUTPUT0:
- self->output[0] = (float*)data;
- break;
- case SCO_INPUT1:
- self->input[1] = (float*)data;
- break;
- case SCO_OUTPUT1:
- self->output[1] = (float*)data;
- break;
- }
+ EgScope* self = (EgScope*)handle;
+
+ switch ((PortIndex)port) {
+ case SCO_CONTROL:
+ self->control = (const LV2_Atom_Sequence*)data;
+ break;
+ case SCO_NOTIFY:
+ self->notify = (LV2_Atom_Sequence*)data;
+ break;
+ case SCO_INPUT0:
+ self->input[0] = (float*)data;
+ break;
+ case SCO_OUTPUT0:
+ self->output[0] = (float*)data;
+ break;
+ case SCO_INPUT1:
+ self->input[1] = (float*)data;
+ break;
+ case SCO_OUTPUT1:
+ self->output[1] = (float*)data;
+ break;
+ }
}
/**
@@ -171,9 +159,9 @@ connect_port(LV2_Handle handle,
[source,turtle]
--------
[]
- a sco:RawAudio ;
- sco:channelID 0 ;
- sco:audioData [ 0.0, 0.0, ... ] .
+ a sco:RawAudio ;
+ sco:channelID 0 ;
+ sco:audioData [ 0.0, 0.0, ... ] .
--------
where the value of the `sco:audioData` property, `[ 0.0, 0.0, ... ]`, is a
@@ -187,134 +175,132 @@ tx_rawaudio(LV2_Atom_Forge* forge,
const size_t n_samples,
const float* data)
{
- LV2_Atom_Forge_Frame frame;
+ LV2_Atom_Forge_Frame frame;
- // Forge container object of type 'RawAudio'
- lv2_atom_forge_frame_time(forge, 0);
- lv2_atom_forge_object(forge, &frame, 0, uris->RawAudio);
+ // Forge container object of type 'RawAudio'
+ lv2_atom_forge_frame_time(forge, 0);
+ lv2_atom_forge_object(forge, &frame, 0, uris->RawAudio);
- // Add integer 'channelID' property
- lv2_atom_forge_key(forge, uris->channelID);
- lv2_atom_forge_int(forge, channel);
+ // Add integer 'channelID' property
+ lv2_atom_forge_key(forge, uris->channelID);
+ lv2_atom_forge_int(forge, channel);
- // Add vector of floats 'audioData' property
- lv2_atom_forge_key(forge, uris->audioData);
- lv2_atom_forge_vector(
- forge, sizeof(float), uris->atom_Float, n_samples, data);
+ // Add vector of floats 'audioData' property
+ lv2_atom_forge_key(forge, uris->audioData);
+ lv2_atom_forge_vector(
+ forge, sizeof(float), uris->atom_Float, n_samples, data);
- // Close off object
- lv2_atom_forge_pop(forge, &frame);
+ // Close off object
+ lv2_atom_forge_pop(forge, &frame);
}
/** ==== Run Method ==== */
static void
run(LV2_Handle handle, uint32_t n_samples)
{
- EgScope* self = (EgScope*)handle;
-
- /* Ensure notify port buffer is large enough to hold all audio-samples and
- configuration settings. A minimum size was requested in the .ttl file,
- but check here just to be sure.
-
- TODO: Explain these magic numbers.
- */
- const size_t size = (sizeof(float) * n_samples + 64) * self->n_channels;
- const uint32_t space = self->notify->atom.size;
- if (space < size + 128) {
- /* Insufficient space, report error and do nothing. Note that a
- real-time production plugin mustn't call log functions in run(), but
- this can be useful for debugging and example purposes.
- */
- lv2_log_error(&self->logger, "Buffer size is insufficient\n");
- return;
- }
-
- // Prepare forge buffer and initialize atom-sequence
- lv2_atom_forge_set_buffer(&self->forge, (uint8_t*)self->notify, space);
- lv2_atom_forge_sequence_head(&self->forge, &self->frame, 0);
-
- /* Send settings to UI
-
- The plugin can continue to run while the UI is closed and re-opened.
- The state and settings of the UI are kept here and transmitted to the UI
- every time it asks for them or if the user initializes a 'load preset'.
- */
- if (self->send_settings_to_ui && self->ui_active) {
- self->send_settings_to_ui = false;
- // Forge container object of type 'ui_state'
- LV2_Atom_Forge_Frame frame;
- lv2_atom_forge_frame_time(&self->forge, 0);
- lv2_atom_forge_object(&self->forge, &frame, 0, self->uris.ui_State);
-
- // Add UI state as properties
- lv2_atom_forge_key(&self->forge, self->uris.ui_spp);
- lv2_atom_forge_int(&self->forge, self->ui_spp);
- lv2_atom_forge_key(&self->forge, self->uris.ui_amp);
- lv2_atom_forge_float(&self->forge, self->ui_amp);
- lv2_atom_forge_key(&self->forge, self->uris.param_sampleRate);
- lv2_atom_forge_float(&self->forge, self->rate);
- lv2_atom_forge_pop(&self->forge, &frame);
- }
-
- // Process incoming events from GUI
- if (self->control) {
- const LV2_Atom_Event* ev = lv2_atom_sequence_begin(
- &(self->control)->body);
- // For each incoming message...
- while (!lv2_atom_sequence_is_end(
- &self->control->body, self->control->atom.size, ev)) {
- // If the event is an atom:Blank object
- if (lv2_atom_forge_is_object_type(&self->forge, ev->body.type)) {
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
- if (obj->body.otype == self->uris.ui_On) {
- // If the object is a ui-on, the UI was activated
- self->ui_active = true;
- self->send_settings_to_ui = true;
- } else if (obj->body.otype == self->uris.ui_Off) {
- // If the object is a ui-off, the UI was closed
- self->ui_active = false;
- } else if (obj->body.otype == self->uris.ui_State) {
- // If the object is a ui-state, it's the current UI settings
- const LV2_Atom* spp = NULL;
- const LV2_Atom* amp = NULL;
- lv2_atom_object_get(obj, self->uris.ui_spp, &spp,
- self->uris.ui_amp, &amp,
- 0);
- if (spp) {
- self->ui_spp = ((const LV2_Atom_Int*)spp)->body;
- }
- if (amp) {
- self->ui_amp = ((const LV2_Atom_Float*)amp)->body;
- }
- }
- }
- ev = lv2_atom_sequence_next(ev);
- }
- }
-
- // Process audio data
- for (uint32_t c = 0; c < self->n_channels; ++c) {
- if (self->ui_active) {
- // If UI is active, send raw audio data to UI
- tx_rawaudio(&self->forge, &self->uris, c, n_samples, self->input[c]);
- }
- // If not processing audio in-place, forward audio
- if (self->input[c] != self->output[c]) {
- memcpy(self->output[c], self->input[c], sizeof(float) * n_samples);
- }
- }
-
- // Close off sequence
- lv2_atom_forge_pop(&self->forge, &self->frame);
+ EgScope* self = (EgScope*)handle;
+
+ /* Ensure notify port buffer is large enough to hold all audio-samples and
+ configuration settings. A minimum size was requested in the .ttl file,
+ but check here just to be sure.
+
+ TODO: Explain these magic numbers.
+ */
+ const size_t size = (sizeof(float) * n_samples + 64) * self->n_channels;
+ const uint32_t space = self->notify->atom.size;
+ if (space < size + 128) {
+ /* Insufficient space, report error and do nothing. Note that a
+ real-time production plugin mustn't call log functions in run(), but
+ this can be useful for debugging and example purposes.
+ */
+ lv2_log_error(&self->logger, "Buffer size is insufficient\n");
+ return;
+ }
+
+ // Prepare forge buffer and initialize atom-sequence
+ lv2_atom_forge_set_buffer(&self->forge, (uint8_t*)self->notify, space);
+ lv2_atom_forge_sequence_head(&self->forge, &self->frame, 0);
+
+ /* Send settings to UI
+
+ The plugin can continue to run while the UI is closed and re-opened.
+ The state and settings of the UI are kept here and transmitted to the UI
+ every time it asks for them or if the user initializes a 'load preset'.
+ */
+ if (self->send_settings_to_ui && self->ui_active) {
+ self->send_settings_to_ui = false;
+ // Forge container object of type 'ui_state'
+ LV2_Atom_Forge_Frame frame;
+ lv2_atom_forge_frame_time(&self->forge, 0);
+ lv2_atom_forge_object(&self->forge, &frame, 0, self->uris.ui_State);
+
+ // Add UI state as properties
+ lv2_atom_forge_key(&self->forge, self->uris.ui_spp);
+ lv2_atom_forge_int(&self->forge, (int32_t)self->ui_spp);
+ lv2_atom_forge_key(&self->forge, self->uris.ui_amp);
+ lv2_atom_forge_float(&self->forge, self->ui_amp);
+ lv2_atom_forge_key(&self->forge, self->uris.param_sampleRate);
+ lv2_atom_forge_float(&self->forge, (float)self->rate);
+ lv2_atom_forge_pop(&self->forge, &frame);
+ }
+
+ // Process incoming events from GUI
+ if (self->control) {
+ const LV2_Atom_Event* ev = lv2_atom_sequence_begin(&(self->control)->body);
+ // For each incoming message...
+ while (!lv2_atom_sequence_is_end(
+ &self->control->body, self->control->atom.size, ev)) {
+ // If the event is an atom:Blank object
+ if (lv2_atom_forge_is_object_type(&self->forge, ev->body.type)) {
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body;
+ if (obj->body.otype == self->uris.ui_On) {
+ // If the object is a ui-on, the UI was activated
+ self->ui_active = true;
+ self->send_settings_to_ui = true;
+ } else if (obj->body.otype == self->uris.ui_Off) {
+ // If the object is a ui-off, the UI was closed
+ self->ui_active = false;
+ } else if (obj->body.otype == self->uris.ui_State) {
+ // If the object is a ui-state, it's the current UI settings
+ const LV2_Atom* spp = NULL;
+ const LV2_Atom* amp = NULL;
+ lv2_atom_object_get(
+ obj, self->uris.ui_spp, &spp, self->uris.ui_amp, &amp, 0);
+ if (spp) {
+ self->ui_spp = ((const LV2_Atom_Int*)spp)->body;
+ }
+ if (amp) {
+ self->ui_amp = ((const LV2_Atom_Float*)amp)->body;
+ }
+ }
+ }
+ ev = lv2_atom_sequence_next(ev);
+ }
+ }
+
+ // Process audio data
+ for (uint32_t c = 0; c < self->n_channels; ++c) {
+ if (self->ui_active) {
+ // If UI is active, send raw audio data to UI
+ tx_rawaudio(
+ &self->forge, &self->uris, (int32_t)c, n_samples, self->input[c]);
+ }
+ // If not processing audio in-place, forward audio
+ if (self->input[c] != self->output[c]) {
+ memcpy(self->output[c], self->input[c], sizeof(float) * n_samples);
+ }
+ }
+
+ // Close off sequence
+ lv2_atom_forge_pop(&self->forge, &self->frame);
}
static void
cleanup(LV2_Handle handle)
{
- free(handle);
+ free(handle);
}
-
/**
==== State Methods ====
@@ -331,22 +317,26 @@ state_save(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- EgScope* self = (EgScope*)instance;
- if (!self) {
- return LV2_STATE_SUCCESS;
- }
-
- store(handle, self->uris.ui_spp,
- (void*)&self->ui_spp, sizeof(uint32_t),
- self->uris.atom_Int,
- LV2_STATE_IS_POD);
-
- store(handle, self->uris.ui_amp,
- (void*)&self->ui_amp, sizeof(float),
- self->uris.atom_Float,
- LV2_STATE_IS_POD);
-
- return LV2_STATE_SUCCESS;
+ EgScope* self = (EgScope*)instance;
+ if (!self) {
+ return LV2_STATE_SUCCESS;
+ }
+
+ store(handle,
+ self->uris.ui_spp,
+ (void*)&self->ui_spp,
+ sizeof(uint32_t),
+ self->uris.atom_Int,
+ LV2_STATE_IS_POD);
+
+ store(handle,
+ self->uris.ui_amp,
+ (void*)&self->ui_amp,
+ sizeof(float),
+ self->uris.atom_Float,
+ LV2_STATE_IS_POD);
+
+ return LV2_STATE_SUCCESS;
}
static LV2_State_Status
@@ -356,72 +346,68 @@ state_restore(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- EgScope* self = (EgScope*)instance;
-
- size_t size;
- uint32_t type;
- uint32_t valflags;
-
- const void* spp = retrieve(
- handle, self->uris.ui_spp, &size, &type, &valflags);
- if (spp && size == sizeof(uint32_t) && type == self->uris.atom_Int) {
- self->ui_spp = *((const uint32_t*)spp);
- self->send_settings_to_ui = true;
- }
-
- const void* amp = retrieve(
- handle, self->uris.ui_amp, &size, &type, &valflags);
- if (amp && size == sizeof(float) && type == self->uris.atom_Float) {
- self->ui_amp = *((const float*)amp);
- self->send_settings_to_ui = true;
- }
-
- return LV2_STATE_SUCCESS;
+ EgScope* self = (EgScope*)instance;
+
+ size_t size = 0;
+ uint32_t type = 0;
+ uint32_t valflags = 0;
+
+ const void* spp =
+ retrieve(handle, self->uris.ui_spp, &size, &type, &valflags);
+ if (spp && size == sizeof(uint32_t) && type == self->uris.atom_Int) {
+ self->ui_spp = *((const uint32_t*)spp);
+ self->send_settings_to_ui = true;
+ }
+
+ const void* amp =
+ retrieve(handle, self->uris.ui_amp, &size, &type, &valflags);
+ if (amp && size == sizeof(float) && type == self->uris.atom_Float) {
+ self->ui_amp = *((const float*)amp);
+ self->send_settings_to_ui = true;
+ }
+
+ return LV2_STATE_SUCCESS;
}
static const void*
extension_data(const char* uri)
{
- static const LV2_State_Interface state = { state_save, state_restore };
- if (!strcmp(uri, LV2_STATE__interface)) {
- return &state;
- }
- return NULL;
+ static const LV2_State_Interface state = {state_save, state_restore};
+ if (!strcmp(uri, LV2_STATE__interface)) {
+ return &state;
+ }
+ return NULL;
}
/** ==== Plugin Descriptors ==== */
-static const LV2_Descriptor descriptor_mono = {
- SCO_URI "#Mono",
- instantiate,
- connect_port,
- NULL,
- run,
- NULL,
- cleanup,
- extension_data
-};
-
-static const LV2_Descriptor descriptor_stereo = {
- SCO_URI "#Stereo",
- instantiate,
- connect_port,
- NULL,
- run,
- NULL,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor_mono = {SCO_URI "#Mono",
+ instantiate,
+ connect_port,
+ NULL,
+ run,
+ NULL,
+ cleanup,
+ extension_data};
+
+static const LV2_Descriptor descriptor_stereo = {SCO_URI "#Stereo",
+ instantiate,
+ connect_port,
+ NULL,
+ run,
+ NULL,
+ cleanup,
+ extension_data};
LV2_SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor_mono;
- case 1:
- return &descriptor_stereo;
- default:
- return NULL;
- }
+ switch (index) {
+ case 0:
+ return &descriptor_mono;
+ case 1:
+ return &descriptor_stereo;
+ default:
+ return NULL;
+ }
}
diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c
index ce0000c..1c82d44 100644
--- a/plugins/eg-scope.lv2/examploscope_ui.c
+++ b/plugins/eg-scope.lv2/examploscope_ui.c
@@ -1,18 +1,5 @@
-/*
- Copyright 2013 Robin Gareus <robin@gareus.org>
-
- 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.
-*/
+// Copyright 2013 Robin Gareus <robin@gareus.org>
+// SPDX-License-Identifier: ISC
#include "./uris.h"
@@ -38,7 +25,7 @@
#include <string.h>
// Drawing area size
-#define DAWIDTH (640)
+#define DAWIDTH (640)
#define DAHEIGHT (200)
/**
@@ -53,96 +40,100 @@
given 'index' position.
*/
typedef struct {
- float data_min[DAWIDTH];
- float data_max[DAWIDTH];
+ float data_min[DAWIDTH];
+ float data_max[DAWIDTH];
- uint32_t idx;
- uint32_t sub;
+ uint32_t idx;
+ uint32_t sub;
} ScoChan;
typedef struct {
- LV2_Atom_Forge forge;
- LV2_URID_Map* map;
- ScoLV2URIs uris;
-
- LV2UI_Write_Function write;
- LV2UI_Controller controller;
-
- GtkWidget* hbox;
- GtkWidget* vbox;
- GtkWidget* sep[2];
- GtkWidget* darea;
- GtkWidget* btn_pause;
- GtkWidget* lbl_speed;
- GtkWidget* lbl_amp;
- GtkWidget* spb_speed;
- GtkWidget* spb_amp;
- GtkAdjustment* spb_speed_adj;
- GtkAdjustment* spb_amp_adj;
-
- ScoChan chn[2];
- uint32_t stride;
- uint32_t n_channels;
- bool paused;
- float rate;
- bool updating;
+ LV2_Atom_Forge forge;
+ LV2_URID_Map* map;
+ ScoLV2URIs uris;
+
+ LV2UI_Write_Function write;
+ LV2UI_Controller controller;
+
+ GtkWidget* hbox;
+ GtkWidget* vbox;
+ GtkWidget* sep[2];
+ GtkWidget* darea;
+ GtkWidget* btn_pause;
+ GtkWidget* lbl_speed;
+ GtkWidget* lbl_amp;
+ GtkWidget* spb_speed;
+ GtkWidget* spb_amp;
+ GtkAdjustment* spb_speed_adj;
+ GtkAdjustment* spb_amp_adj;
+
+ ScoChan chn[2];
+ uint32_t stride;
+ uint32_t n_channels;
+ bool paused;
+ float rate;
+ bool updating;
} EgScopeUI;
-
/** Send current UI settings to backend. */
static void
send_ui_state(LV2UI_Handle handle)
{
- EgScopeUI* ui = (EgScopeUI*)handle;
- const float gain = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_amp));
-
- // Use local buffer on the stack to build atom
- uint8_t obj_buf[1024];
- lv2_atom_forge_set_buffer(&ui->forge, obj_buf, sizeof(obj_buf));
-
- // Start a ui:State object
- LV2_Atom_Forge_Frame frame;
- LV2_Atom* msg = (LV2_Atom*)lv2_atom_forge_object(
- &ui->forge, &frame, 0, ui->uris.ui_State);
-
- // msg[samples-per-pixel] = integer
- lv2_atom_forge_key(&ui->forge, ui->uris.ui_spp);
- lv2_atom_forge_int(&ui->forge, ui->stride);
-
- // msg[amplitude] = float
- lv2_atom_forge_key(&ui->forge, ui->uris.ui_amp);
- lv2_atom_forge_float(&ui->forge, gain);
-
- // Finish ui:State object
- lv2_atom_forge_pop(&ui->forge, &frame);
-
- // Send message to plugin port '0'
- ui->write(ui->controller,
- 0,
- lv2_atom_total_size(msg),
- ui->uris.atom_eventTransfer,
- msg);
+ EgScopeUI* ui = (EgScopeUI*)handle;
+ const float gain = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_amp));
+
+ // Use local buffer on the stack to build atom
+ uint8_t obj_buf[1024];
+ lv2_atom_forge_set_buffer(&ui->forge, obj_buf, sizeof(obj_buf));
+
+ // Start a ui:State object
+ LV2_Atom_Forge_Frame frame;
+ LV2_Atom* msg =
+ (LV2_Atom*)lv2_atom_forge_object(&ui->forge, &frame, 0, ui->uris.ui_State);
+
+ assert(msg);
+
+ // msg[samples-per-pixel] = integer
+ lv2_atom_forge_key(&ui->forge, ui->uris.ui_spp);
+ lv2_atom_forge_int(&ui->forge, ui->stride);
+
+ // msg[amplitude] = float
+ lv2_atom_forge_key(&ui->forge, ui->uris.ui_amp);
+ lv2_atom_forge_float(&ui->forge, gain);
+
+ // Finish ui:State object
+ lv2_atom_forge_pop(&ui->forge, &frame);
+
+ // Send message to plugin port '0'
+ ui->write(ui->controller,
+ 0,
+ lv2_atom_total_size(msg),
+ ui->uris.atom_eventTransfer,
+ msg);
}
/** Notify backend that UI is closed. */
static void
send_ui_disable(LV2UI_Handle handle)
{
- EgScopeUI* ui = (EgScopeUI*)handle;
- send_ui_state(handle);
-
- uint8_t obj_buf[64];
- lv2_atom_forge_set_buffer(&ui->forge, obj_buf, sizeof(obj_buf));
-
- LV2_Atom_Forge_Frame frame;
- LV2_Atom* msg = (LV2_Atom*)lv2_atom_forge_object(
- &ui->forge, &frame, 0, ui->uris.ui_Off);
- lv2_atom_forge_pop(&ui->forge, &frame);
- ui->write(ui->controller,
- 0,
- lv2_atom_total_size(msg),
- ui->uris.atom_eventTransfer,
- msg);
+ EgScopeUI* ui = (EgScopeUI*)handle;
+ send_ui_state(handle);
+
+ uint8_t obj_buf[64];
+ lv2_atom_forge_set_buffer(&ui->forge, obj_buf, sizeof(obj_buf));
+
+ LV2_Atom_Forge_Frame frame;
+ LV2_Atom* msg =
+ (LV2_Atom*)lv2_atom_forge_object(&ui->forge, &frame, 0, ui->uris.ui_Off);
+
+ assert(msg);
+
+ lv2_atom_forge_pop(&ui->forge, &frame);
+ ui->write(ui->controller,
+ 0,
+ lv2_atom_total_size(msg),
+ ui->uris.atom_eventTransfer,
+ msg);
}
/**
@@ -153,32 +144,35 @@ send_ui_disable(LV2UI_Handle handle)
static void
send_ui_enable(LV2UI_Handle handle)
{
- EgScopeUI* ui = (EgScopeUI*)handle;
-
- uint8_t obj_buf[64];
- lv2_atom_forge_set_buffer(&ui->forge, obj_buf, sizeof(obj_buf));
-
- LV2_Atom_Forge_Frame frame;
- LV2_Atom* msg = (LV2_Atom*)lv2_atom_forge_object(
- &ui->forge, &frame, 0, ui->uris.ui_On);
- lv2_atom_forge_pop(&ui->forge, &frame);
- ui->write(ui->controller,
- 0,
- lv2_atom_total_size(msg),
- ui->uris.atom_eventTransfer,
- msg);
+ EgScopeUI* ui = (EgScopeUI*)handle;
+
+ uint8_t obj_buf[64];
+ lv2_atom_forge_set_buffer(&ui->forge, obj_buf, sizeof(obj_buf));
+
+ LV2_Atom_Forge_Frame frame;
+ LV2_Atom* msg =
+ (LV2_Atom*)lv2_atom_forge_object(&ui->forge, &frame, 0, ui->uris.ui_On);
+
+ assert(msg);
+
+ lv2_atom_forge_pop(&ui->forge, &frame);
+ ui->write(ui->controller,
+ 0,
+ lv2_atom_total_size(msg),
+ ui->uris.atom_eventTransfer,
+ msg);
}
/** Gtk widget callback. */
static gboolean
on_cfg_changed(GtkWidget* widget, gpointer data)
{
- EgScopeUI* ui = (EgScopeUI*)data;
- if (!ui->updating) {
- // Only send UI state if the change is from user interaction
- send_ui_state(data);
- }
- return TRUE;
+ EgScopeUI* ui = (EgScopeUI*)data;
+ if (!ui->updating) {
+ // Only send UI state if the change is from user interaction
+ send_ui_state(data);
+ }
+ return TRUE;
}
/**
@@ -189,128 +183,129 @@ on_cfg_changed(GtkWidget* widget, gpointer data)
static gboolean
on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
{
- EgScopeUI* ui = (EgScopeUI*)data;
- const float gain = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_amp));
-
- // Get cairo type for the gtk window
- cairo_t* cr;
- cr = gdk_cairo_create(ui->darea->window);
-
- // Limit cairo-drawing to exposed area
- cairo_rectangle(cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
- cairo_clip(cr);
-
- // Clear background
- cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0);
- cairo_rectangle(cr, 0, 0, DAWIDTH, DAHEIGHT * ui->n_channels);
- cairo_fill(cr);
-
- cairo_set_line_width(cr, 1.0);
-
- const uint32_t start = ev->area.x;
- const uint32_t end = ev->area.x + ev->area.width;
-
- assert(start < DAWIDTH);
- assert(end <= DAWIDTH);
- assert(start < end);
-
- for (uint32_t c = 0; c < ui->n_channels; ++c) {
- ScoChan* chn = &ui->chn[c];
-
- /* Drawing area Y-position of given sample-value.
- * Note: cairo-pixel at 0 spans -0.5 .. +0.5, hence (DAHEIGHT / 2.0 -0.5)
- * also the cairo Y-axis points upwards (hence 'minus value')
- *
- * == ( DAHEIGHT * (CHN) // channel offset
- * + (DAHEIGHT / 2) - 0.5 // vertical center -- '0'
- * - (DAHEIGHT / 2) * (VAL) * (GAIN)
- * )
- */
- const float chn_y_offset = DAHEIGHT * c + DAHEIGHT * 0.5f - 0.5f;
- const float chn_y_scale = DAHEIGHT * 0.5f * gain;
-
-#define CYPOS(VAL) (chn_y_offset - (VAL) * chn_y_scale)
-
- cairo_save(cr);
-
- /* Restrict drawing to current channel area, don't bleed drawing into
- neighboring channels. */
- cairo_rectangle(cr, 0, DAHEIGHT * c, DAWIDTH, DAHEIGHT);
- cairo_clip(cr);
-
- // Set color of wave-form
- cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 1.0);
-
- /* This is a somewhat 'smart' mechanism to plot audio data using
- alternating up/down line-directions. It works well for both cases:
- 1 pixel <= 1 sample and 1 pixel represents more than 1 sample, but
- is not ideal for either. */
- if (start == chn->idx) {
- cairo_move_to(cr, start - 0.5, CYPOS(0));
- } else {
- cairo_move_to(cr, start - 0.5, CYPOS(chn->data_max[start]));
- }
-
- uint32_t pathlength = 0;
- for (uint32_t i = start; i < end; ++i) {
- if (i == chn->idx) {
- continue;
- } else if (i % 2) {
- cairo_line_to(cr, i - .5, CYPOS(chn->data_min[i]));
- cairo_line_to(cr, i - .5, CYPOS(chn->data_max[i]));
- ++pathlength;
- } else {
- cairo_line_to(cr, i - .5, CYPOS(chn->data_max[i]));
- cairo_line_to(cr, i - .5, CYPOS(chn->data_min[i]));
- ++pathlength;
- }
-
- /** Limit the max cairo path length. This is an optimization trade
- off: too short path: high load CPU/GPU load. too-long path:
- bad anti-aliasing, or possibly lost points */
- if (pathlength > MAX_CAIRO_PATH) {
- pathlength = 0;
- cairo_stroke(cr);
- if (i % 2) {
- cairo_move_to(cr, i - .5, CYPOS(chn->data_max[i]));
- } else {
- cairo_move_to(cr, i - .5, CYPOS(chn->data_min[i]));
- }
- }
- }
-
- if (pathlength > 0) {
- cairo_stroke(cr);
- }
-
- // Draw current position vertical line if display is slow
- if (ui->stride >= ui->rate / 4800.0f || ui->paused) {
- cairo_set_source_rgba(cr, .9, .2, .2, .6);
- cairo_move_to(cr, chn->idx - .5, DAHEIGHT * c);
- cairo_line_to(cr, chn->idx - .5, DAHEIGHT * (c + 1));
- cairo_stroke(cr);
- }
-
- // Undo the 'clipping' restriction
- cairo_restore(cr);
-
- // Channel separator
- if (c > 0) {
- cairo_set_source_rgba(cr, .5, .5, .5, 1.0);
- cairo_move_to(cr, 0, DAHEIGHT * c - .5);
- cairo_line_to(cr, DAWIDTH, DAHEIGHT * c - .5);
- cairo_stroke(cr);
- }
-
- // Zero scale line
- cairo_set_source_rgba(cr, .3, .3, .7, .5);
- cairo_move_to(cr, 0, DAHEIGHT * (c + .5) - .5);
- cairo_line_to(cr, DAWIDTH, DAHEIGHT * (c + .5) - .5);
- cairo_stroke(cr);
- }
-
- cairo_destroy(cr);
- return TRUE;
+ EgScopeUI* ui = (EgScopeUI*)data;
+ const float gain = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_amp));
+
+ // Get cairo type for the gtk window
+ cairo_t* cr = gdk_cairo_create(ui->darea->window);
+
+ // Limit cairo-drawing to exposed area
+ cairo_rectangle(cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
+ cairo_clip(cr);
+
+ // Clear background
+ cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0);
+ cairo_rectangle(cr, 0, 0, DAWIDTH, DAHEIGHT * ui->n_channels);
+ cairo_fill(cr);
+
+ cairo_set_line_width(cr, 1.0);
+
+ const uint32_t start = ev->area.x;
+ const uint32_t end = ev->area.x + ev->area.width;
+
+ assert(start < DAWIDTH);
+ assert(end <= DAWIDTH);
+ assert(start < end);
+
+ for (uint32_t c = 0; c < ui->n_channels; ++c) {
+ ScoChan* chn = &ui->chn[c];
+
+ /* Drawing area Y-position of given sample-value.
+ * Note: cairo-pixel at 0 spans -0.5 .. +0.5, hence (DAHEIGHT / 2.0 -0.5)
+ * also the cairo Y-axis points upwards (hence 'minus value')
+ *
+ * == ( DAHEIGHT * (CHN) // channel offset
+ * + (DAHEIGHT / 2) - 0.5 // vertical center -- '0'
+ * - (DAHEIGHT / 2) * (VAL) * (GAIN)
+ * )
+ */
+ const float chn_y_offset = DAHEIGHT * c + DAHEIGHT * 0.5f - 0.5f;
+ const float chn_y_scale = DAHEIGHT * 0.5f * gain;
+
+#define CYPOS(VAL) (chn_y_offset - (VAL)*chn_y_scale)
+
+ cairo_save(cr);
+
+ /* Restrict drawing to current channel area, don't bleed drawing into
+ neighboring channels. */
+ cairo_rectangle(cr, 0, DAHEIGHT * c, DAWIDTH, DAHEIGHT);
+ cairo_clip(cr);
+
+ // Set color of wave-form
+ cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 1.0);
+
+ /* This is a somewhat 'smart' mechanism to plot audio data using
+ alternating up/down line-directions. It works well for both cases:
+ 1 pixel <= 1 sample and 1 pixel represents more than 1 sample, but
+ is not ideal for either. */
+ if (start == chn->idx) {
+ cairo_move_to(cr, start - 0.5, CYPOS(0));
+ } else {
+ cairo_move_to(cr, start - 0.5, CYPOS(chn->data_max[start]));
+ }
+
+ uint32_t pathlength = 0;
+ for (uint32_t i = start; i < end; ++i) {
+ if (i == chn->idx) {
+ continue;
+ }
+
+ if (i % 2) {
+ cairo_line_to(cr, i - .5, CYPOS(chn->data_min[i]));
+ cairo_line_to(cr, i - .5, CYPOS(chn->data_max[i]));
+ ++pathlength;
+ } else {
+ cairo_line_to(cr, i - .5, CYPOS(chn->data_max[i]));
+ cairo_line_to(cr, i - .5, CYPOS(chn->data_min[i]));
+ ++pathlength;
+ }
+
+ /** Limit the max cairo path length. This is an optimization trade
+ off: too short path: high load CPU/GPU load. too-long path:
+ bad anti-aliasing, or possibly lost points */
+ if (pathlength > MAX_CAIRO_PATH) {
+ pathlength = 0;
+ cairo_stroke(cr);
+ if (i % 2) {
+ cairo_move_to(cr, i - .5, CYPOS(chn->data_max[i]));
+ } else {
+ cairo_move_to(cr, i - .5, CYPOS(chn->data_min[i]));
+ }
+ }
+ }
+
+ if (pathlength > 0) {
+ cairo_stroke(cr);
+ }
+
+ // Draw current position vertical line if display is slow
+ if (ui->stride >= ui->rate / 4800.0f || ui->paused) {
+ cairo_set_source_rgba(cr, .9, .2, .2, .6);
+ cairo_move_to(cr, chn->idx - .5, DAHEIGHT * c);
+ cairo_line_to(cr, chn->idx - .5, DAHEIGHT * (c + 1));
+ cairo_stroke(cr);
+ }
+
+ // Undo the 'clipping' restriction
+ cairo_restore(cr);
+
+ // Channel separator
+ if (c > 0) {
+ cairo_set_source_rgba(cr, .5, .5, .5, 1.0);
+ cairo_move_to(cr, 0, DAHEIGHT * c - .5);
+ cairo_line_to(cr, DAWIDTH, DAHEIGHT * c - .5);
+ cairo_stroke(cr);
+ }
+
+ // Zero scale line
+ cairo_set_source_rgba(cr, .3, .3, .7, .5);
+ cairo_move_to(cr, 0, DAHEIGHT * (c + .5) - .5);
+ cairo_line_to(cr, DAWIDTH, DAHEIGHT * (c + .5) - .5);
+ cairo_stroke(cr);
+ }
+
+ cairo_destroy(cr);
+ return TRUE;
}
/**
@@ -339,27 +334,27 @@ process_channel(EgScopeUI* ui,
uint32_t* idx_start,
uint32_t* idx_end)
{
- int overflow = 0;
- *idx_start = chn->idx;
- for (size_t i = 0; i < n_elem; ++i) {
- if (data[i] < chn->data_min[chn->idx]) {
- chn->data_min[chn->idx] = data[i];
- }
- if (data[i] > chn->data_max[chn->idx]) {
- chn->data_max[chn->idx] = data[i];
- }
- if (++chn->sub >= ui->stride) {
- chn->sub = 0;
- chn->idx = (chn->idx + 1) % DAWIDTH;
- if (chn->idx == 0) {
- ++overflow;
- }
- chn->data_min[chn->idx] = 1.0;
- chn->data_max[chn->idx] = -1.0;
- }
- }
- *idx_end = chn->idx;
- return overflow;
+ int overflow = 0;
+ *idx_start = chn->idx;
+ for (size_t i = 0; i < n_elem; ++i) {
+ if (data[i] < chn->data_min[chn->idx]) {
+ chn->data_min[chn->idx] = data[i];
+ }
+ if (data[i] > chn->data_max[chn->idx]) {
+ chn->data_max[chn->idx] = data[i];
+ }
+ if (++chn->sub >= ui->stride) {
+ chn->sub = 0;
+ chn->idx = (chn->idx + 1) % DAWIDTH;
+ if (chn->idx == 0) {
+ ++overflow;
+ }
+ chn->data_min[chn->idx] = 1.0f;
+ chn->data_max[chn->idx] = -1.0f;
+ }
+ }
+ *idx_end = chn->idx;
+ return overflow;
}
/**
@@ -372,56 +367,57 @@ update_scope(EgScopeUI* ui,
const size_t n_elem,
float const* data)
{
- // Never trust input data which could lead to application failure.
- if (channel < 0 || (uint32_t)channel > ui->n_channels) {
- return;
- }
-
- // Update state in sync with 1st channel
- if (channel == 0) {
- ui->stride = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_speed));
- const bool paused = gtk_toggle_button_get_active(
- GTK_TOGGLE_BUTTON(ui->btn_pause));
-
- if (paused != ui->paused) {
- ui->paused = paused;
- gtk_widget_queue_draw(ui->darea);
- }
- }
- if (ui->paused) {
- return;
- }
-
- uint32_t idx_start; // Display pixel start
- uint32_t idx_end; // Display pixel end
- int overflow; // Received more audio-data than display-pixel
-
- // Process this channel's audio-data for display
- ScoChan* chn = &ui->chn[channel];
- overflow = process_channel(ui, chn, n_elem, data, &idx_start, &idx_end);
-
- // Signal gtk's main thread to redraw the widget after the last channel
- if ((uint32_t)channel + 1 == ui->n_channels) {
- if (overflow > 1) {
- // Redraw complete widget
- gtk_widget_queue_draw(ui->darea);
- } else if (idx_end > idx_start) {
- // Redraw area between start -> end pixel
- gtk_widget_queue_draw_area(ui->darea, idx_start - 2, 0, 3
- + idx_end - idx_start,
- DAHEIGHT * ui->n_channels);
- } else if (idx_end < idx_start) {
- // Wrap-around: redraw area between 0->start AND end->right-end
- gtk_widget_queue_draw_area(
- ui->darea,
- idx_start - 2, 0,
- 3 + DAWIDTH - idx_start, DAHEIGHT * ui->n_channels);
- gtk_widget_queue_draw_area(
- ui->darea,
- 0, 0,
- idx_end + 1, DAHEIGHT * ui->n_channels);
- }
- }
+ // Never trust input data which could lead to application failure.
+ if (channel < 0 || (uint32_t)channel > ui->n_channels) {
+ return;
+ }
+
+ // Update state in sync with 1st channel
+ if (channel == 0) {
+ ui->stride = gtk_spin_button_get_value(GTK_SPIN_BUTTON(ui->spb_speed));
+ const bool paused =
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ui->btn_pause));
+
+ if (paused != ui->paused) {
+ ui->paused = paused;
+ gtk_widget_queue_draw(ui->darea);
+ }
+ }
+ if (ui->paused) {
+ return;
+ }
+
+ uint32_t idx_start = 0; // Display pixel start
+ uint32_t idx_end = 0; // Display pixel end
+ int overflow = 0; // Received more audio-data than display-pixel
+
+ // Process this channel's audio-data for display
+ ScoChan* chn = &ui->chn[channel];
+ overflow = process_channel(ui, chn, n_elem, data, &idx_start, &idx_end);
+
+ // Signal gtk's main thread to redraw the widget after the last channel
+ if ((uint32_t)channel + 1 == ui->n_channels) {
+ if (overflow > 1) {
+ // Redraw complete widget
+ gtk_widget_queue_draw(ui->darea);
+ } else if (idx_end > idx_start) {
+ // Redraw area between start -> end pixel
+ gtk_widget_queue_draw_area(ui->darea,
+ idx_start - 2,
+ 0,
+ 3 + idx_end - idx_start,
+ DAHEIGHT * ui->n_channels);
+ } else if (idx_end < idx_start) {
+ // Wrap-around: redraw area between 0->start AND end->right-end
+ gtk_widget_queue_draw_area(ui->darea,
+ idx_start - 2,
+ 0,
+ 3 + DAWIDTH - idx_start,
+ DAHEIGHT * ui->n_channels);
+ gtk_widget_queue_draw_area(
+ ui->darea, 0, 0, idx_end + 1, DAHEIGHT * ui->n_channels);
+ }
+ }
}
static LV2UI_Handle
@@ -433,193 +429,191 @@ instantiate(const LV2UI_Descriptor* descriptor,
LV2UI_Widget* widget,
const LV2_Feature* const* features)
{
- EgScopeUI* ui = (EgScopeUI*)calloc(1, sizeof(EgScopeUI));
-
- if (!ui) {
- fprintf(stderr, "EgScope.lv2 UI: out of memory\n");
- return NULL;
- }
-
- ui->map = NULL;
- *widget = NULL;
-
- if (!strcmp(plugin_uri, SCO_URI "#Mono")) {
- ui->n_channels = 1;
- } else if (!strcmp(plugin_uri, SCO_URI "#Stereo")) {
- ui->n_channels = 2;
- } else {
- free(ui);
- return NULL;
- }
-
- for (int i = 0; features[i]; ++i) {
- if (!strcmp(features[i]->URI, LV2_URID_URI "#map")) {
- ui->map = (LV2_URID_Map*)features[i]->data;
- }
- }
-
- if (!ui->map) {
- fprintf(stderr, "EgScope.lv2 UI: Host does not support urid:map\n");
- free(ui);
- return NULL;
- }
-
- // Initialize private data structure
- ui->write = write_function;
- ui->controller = controller;
-
- ui->vbox = NULL;
- ui->hbox = NULL;
- ui->darea = NULL;
- ui->stride = 25;
- ui->paused = false;
- ui->rate = 48000;
-
- ui->chn[0].idx = 0;
- ui->chn[0].sub = 0;
- ui->chn[1].idx = 0;
- ui->chn[1].sub = 0;
- memset(ui->chn[0].data_min, 0, sizeof(float) * DAWIDTH);
- memset(ui->chn[0].data_max, 0, sizeof(float) * DAWIDTH);
- memset(ui->chn[1].data_min, 0, sizeof(float) * DAWIDTH);
- memset(ui->chn[1].data_max, 0, sizeof(float) * DAWIDTH);
-
- map_sco_uris(ui->map, &ui->uris);
- lv2_atom_forge_init(&ui->forge, ui->map);
-
- // Setup UI
- ui->hbox = gtk_hbox_new(FALSE, 0);
- ui->vbox = gtk_vbox_new(FALSE, 0);
-
- ui->darea = gtk_drawing_area_new();
- gtk_widget_set_size_request(ui->darea, DAWIDTH, DAHEIGHT * ui->n_channels);
-
- ui->lbl_speed = gtk_label_new("Samples/Pixel");
- ui->lbl_amp = gtk_label_new("Amplitude");
-
- ui->sep[0] = gtk_hseparator_new();
- ui->sep[1] = gtk_label_new("");
- ui->btn_pause = gtk_toggle_button_new_with_label("Pause");
-
- ui->spb_speed_adj = (GtkAdjustment*)gtk_adjustment_new(
- 25.0, 1.0, 1000.0, 1.0, 5.0, 0.0);
- ui->spb_speed = gtk_spin_button_new(ui->spb_speed_adj, 1.0, 0);
-
- ui->spb_amp_adj = (GtkAdjustment*)gtk_adjustment_new(
- 1.0, 0.1, 6.0, 0.1, 1.0, 0.0);
- ui->spb_amp = gtk_spin_button_new(ui->spb_amp_adj, 0.1, 1);
-
- gtk_box_pack_start(GTK_BOX(ui->hbox), ui->darea, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(ui->hbox), ui->vbox, FALSE, FALSE, 4);
-
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->lbl_speed, FALSE, FALSE, 2);
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->spb_speed, FALSE, FALSE, 2);
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->sep[0], FALSE, FALSE, 8);
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->lbl_amp, FALSE, FALSE, 2);
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->spb_amp, FALSE, FALSE, 2);
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->sep[1], TRUE, FALSE, 8);
- gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_pause, FALSE, FALSE, 2);
-
- g_signal_connect(G_OBJECT(ui->darea), "expose_event",
- G_CALLBACK(on_expose_event), ui);
- g_signal_connect(G_OBJECT(ui->spb_amp), "value-changed",
- G_CALLBACK(on_cfg_changed), ui);
- g_signal_connect(G_OBJECT(ui->spb_speed), "value-changed",
- G_CALLBACK(on_cfg_changed), ui);
-
- *widget = ui->hbox;
-
- /* Send UIOn message to plugin, which will request state and enable message
- transmission. */
- send_ui_enable(ui);
-
- return ui;
+ EgScopeUI* ui = (EgScopeUI*)calloc(1, sizeof(EgScopeUI));
+
+ if (!ui) {
+ fprintf(stderr, "EgScope.lv2 UI: out of memory\n");
+ return NULL;
+ }
+
+ ui->map = NULL;
+ *widget = NULL;
+
+ if (!strcmp(plugin_uri, SCO_URI "#Mono")) {
+ ui->n_channels = 1;
+ } else if (!strcmp(plugin_uri, SCO_URI "#Stereo")) {
+ ui->n_channels = 2;
+ } else {
+ free(ui);
+ return NULL;
+ }
+
+ for (int i = 0; features[i]; ++i) {
+ if (!strcmp(features[i]->URI, LV2_URID_URI "#map")) {
+ ui->map = (LV2_URID_Map*)features[i]->data;
+ }
+ }
+
+ if (!ui->map) {
+ fprintf(stderr, "EgScope.lv2 UI: Host does not support urid:map\n");
+ free(ui);
+ return NULL;
+ }
+
+ // Initialize private data structure
+ ui->write = write_function;
+ ui->controller = controller;
+
+ ui->vbox = NULL;
+ ui->hbox = NULL;
+ ui->darea = NULL;
+ ui->stride = 25;
+ ui->paused = false;
+ ui->rate = 48000;
+
+ ui->chn[0].idx = 0;
+ ui->chn[0].sub = 0;
+ ui->chn[1].idx = 0;
+ ui->chn[1].sub = 0;
+ memset(ui->chn[0].data_min, 0, sizeof(float) * DAWIDTH);
+ memset(ui->chn[0].data_max, 0, sizeof(float) * DAWIDTH);
+ memset(ui->chn[1].data_min, 0, sizeof(float) * DAWIDTH);
+ memset(ui->chn[1].data_max, 0, sizeof(float) * DAWIDTH);
+
+ map_sco_uris(ui->map, &ui->uris);
+ lv2_atom_forge_init(&ui->forge, ui->map);
+
+ // Setup UI
+ ui->hbox = gtk_hbox_new(FALSE, 0);
+ ui->vbox = gtk_vbox_new(FALSE, 0);
+
+ ui->darea = gtk_drawing_area_new();
+ gtk_widget_set_size_request(ui->darea, DAWIDTH, DAHEIGHT * ui->n_channels);
+
+ ui->lbl_speed = gtk_label_new("Samples/Pixel");
+ ui->lbl_amp = gtk_label_new("Amplitude");
+
+ ui->sep[0] = gtk_hseparator_new();
+ ui->sep[1] = gtk_label_new("");
+ ui->btn_pause = gtk_toggle_button_new_with_label("Pause");
+
+ ui->spb_speed_adj =
+ (GtkAdjustment*)gtk_adjustment_new(25.0, 1.0, 1000.0, 1.0, 5.0, 0.0);
+ ui->spb_speed = gtk_spin_button_new(ui->spb_speed_adj, 1.0, 0);
+
+ ui->spb_amp_adj =
+ (GtkAdjustment*)gtk_adjustment_new(1.0, 0.1, 6.0, 0.1, 1.0, 0.0);
+ ui->spb_amp = gtk_spin_button_new(ui->spb_amp_adj, 0.1, 1);
+
+ gtk_box_pack_start(GTK_BOX(ui->hbox), ui->darea, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(ui->hbox), ui->vbox, FALSE, FALSE, 4);
+
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->lbl_speed, FALSE, FALSE, 2);
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->spb_speed, FALSE, FALSE, 2);
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->sep[0], FALSE, FALSE, 8);
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->lbl_amp, FALSE, FALSE, 2);
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->spb_amp, FALSE, FALSE, 2);
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->sep[1], TRUE, FALSE, 8);
+ gtk_box_pack_start(GTK_BOX(ui->vbox), ui->btn_pause, FALSE, FALSE, 2);
+
+ g_signal_connect(
+ G_OBJECT(ui->darea), "expose_event", G_CALLBACK(on_expose_event), ui);
+ g_signal_connect(
+ G_OBJECT(ui->spb_amp), "value-changed", G_CALLBACK(on_cfg_changed), ui);
+ g_signal_connect(
+ G_OBJECT(ui->spb_speed), "value-changed", G_CALLBACK(on_cfg_changed), ui);
+
+ *widget = ui->hbox;
+
+ /* Send UIOn message to plugin, which will request state and enable message
+ transmission. */
+ send_ui_enable(ui);
+
+ return ui;
}
static void
cleanup(LV2UI_Handle handle)
{
- EgScopeUI* ui = (EgScopeUI*)handle;
- /* Send UIOff message to plugin, which will save state and disable message
- * transmission. */
- send_ui_disable(ui);
- gtk_widget_destroy(ui->darea);
- free(ui);
+ EgScopeUI* ui = (EgScopeUI*)handle;
+ /* Send UIOff message to plugin, which will save state and disable message
+ * transmission. */
+ send_ui_disable(ui);
+ gtk_widget_destroy(ui->darea);
+ free(ui);
}
static int
recv_raw_audio(EgScopeUI* ui, const LV2_Atom_Object* obj)
{
- const LV2_Atom* chan_val = NULL;
- const LV2_Atom* data_val = NULL;
- const int n_props = lv2_atom_object_get(
- obj,
- ui->uris.channelID, &chan_val,
- ui->uris.audioData, &data_val,
- NULL);
-
- if (n_props != 2 ||
- chan_val->type != ui->uris.atom_Int ||
- data_val->type != ui->uris.atom_Vector) {
- // Object does not have the required properties with correct types
- fprintf(stderr, "eg-scope.lv2 UI error: Corrupt audio message\n");
- return 1;
- }
-
- // Get the values we need from the body of the property value atoms
- const int32_t chn = ((const LV2_Atom_Int*)chan_val)->body;
- const LV2_Atom_Vector* vec = (const LV2_Atom_Vector*)data_val;
- if (vec->body.child_type != ui->uris.atom_Float) {
- return 1; // Vector has incorrect element type
- }
-
- // Number of elements = (total size - header size) / element size
- const size_t n_elem = ((data_val->size - sizeof(LV2_Atom_Vector_Body))
- / sizeof(float));
-
- // Float elements immediately follow the vector body header
- const float* data = (const float*)(&vec->body + 1);
-
- // Update display
- update_scope(ui, chn, n_elem, data);
- return 0;
+ const LV2_Atom* chan_val = NULL;
+ const LV2_Atom* data_val = NULL;
+ const int n_props = lv2_atom_object_get(
+ obj, ui->uris.channelID, &chan_val, ui->uris.audioData, &data_val, NULL);
+
+ if (n_props != 2 || chan_val->type != ui->uris.atom_Int ||
+ data_val->type != ui->uris.atom_Vector) {
+ // Object does not have the required properties with correct types
+ fprintf(stderr, "eg-scope.lv2 UI error: Corrupt audio message\n");
+ return 1;
+ }
+
+ // Get the values we need from the body of the property value atoms
+ const int32_t chn = ((const LV2_Atom_Int*)chan_val)->body;
+ const LV2_Atom_Vector* vec = (const LV2_Atom_Vector*)data_val;
+ if (vec->body.child_type != ui->uris.atom_Float) {
+ return 1; // Vector has incorrect element type
+ }
+
+ // Number of elements = (total size - header size) / element size
+ const size_t n_elem =
+ ((data_val->size - sizeof(LV2_Atom_Vector_Body)) / sizeof(float));
+
+ // Float elements immediately follow the vector body header
+ const float* data = (const float*)(&vec->body + 1);
+
+ // Update display
+ update_scope(ui, chn, n_elem, data);
+ return 0;
}
static int
recv_ui_state(EgScopeUI* ui, const LV2_Atom_Object* obj)
{
- const LV2_Atom* spp_val = NULL;
- const LV2_Atom* amp_val = NULL;
- const LV2_Atom* rate_val = NULL;
- const int n_props = lv2_atom_object_get(
- obj,
- ui->uris.ui_spp, &spp_val,
- ui->uris.ui_amp, &amp_val,
- ui->uris.param_sampleRate, &rate_val,
- NULL);
-
- if (n_props != 3 ||
- spp_val->type != ui->uris.atom_Int ||
- amp_val->type != ui->uris.atom_Float ||
- rate_val->type != ui->uris.atom_Float) {
- // Object does not have the required properties with correct types
- fprintf(stderr, "eg-scope.lv2 UI error: Corrupt state message\n");
- return 1;
- }
-
- // Get the values we need from the body of the property value atoms
- const int32_t spp = ((const LV2_Atom_Int*)spp_val)->body;
- const float amp = ((const LV2_Atom_Float*)amp_val)->body;
- const float rate = ((const LV2_Atom_Float*)rate_val)->body;
-
- // Disable transmission and update UI
- ui->updating = true;
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(ui->spb_speed), spp);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(ui->spb_amp), amp);
- ui->updating = false;
- ui->rate = rate;
-
- return 0;
+ const LV2_Atom* spp_val = NULL;
+ const LV2_Atom* amp_val = NULL;
+ const LV2_Atom* rate_val = NULL;
+
+ const int n_props = lv2_atom_object_get(obj,
+ ui->uris.ui_spp,
+ &spp_val,
+ ui->uris.ui_amp,
+ &amp_val,
+ ui->uris.param_sampleRate,
+ &rate_val,
+ NULL);
+
+ if (n_props != 3 || spp_val->type != ui->uris.atom_Int ||
+ amp_val->type != ui->uris.atom_Float ||
+ rate_val->type != ui->uris.atom_Float) {
+ // Object does not have the required properties with correct types
+ fprintf(stderr, "eg-scope.lv2 UI error: Corrupt state message\n");
+ return 1;
+ }
+
+ // Get the values we need from the body of the property value atoms
+ const int32_t spp = ((const LV2_Atom_Int*)spp_val)->body;
+ const float amp = ((const LV2_Atom_Float*)amp_val)->body;
+ const float rate = ((const LV2_Atom_Float*)rate_val)->body;
+
+ // Disable transmission and update UI
+ ui->updating = true;
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(ui->spb_speed), spp);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(ui->spb_amp), amp);
+ ui->updating = false;
+ ui->rate = rate;
+
+ return 0;
}
/**
@@ -637,40 +631,33 @@ port_event(LV2UI_Handle handle,
uint32_t format,
const void* buffer)
{
- EgScopeUI* ui = (EgScopeUI*)handle;
- const LV2_Atom* atom = (const LV2_Atom*)buffer;
-
- /* Check type of data received
- * - format == 0: Control port event (float)
- * - format > 0: Message (atom)
- */
- if (format == ui->uris.atom_eventTransfer &&
- lv2_atom_forge_is_object_type(&ui->forge, atom->type)) {
- const LV2_Atom_Object* obj = (const LV2_Atom_Object*)atom;
- if (obj->body.otype == ui->uris.RawAudio) {
- recv_raw_audio(ui, obj);
- } else if (obj->body.otype == ui->uris.ui_State) {
- recv_ui_state(ui, obj);
- }
- }
+ EgScopeUI* ui = (EgScopeUI*)handle;
+ const LV2_Atom* atom = (const LV2_Atom*)buffer;
+
+ /* Check type of data received
+ * - format == 0: Control port event (float)
+ * - format > 0: Message (atom)
+ */
+ if (format == ui->uris.atom_eventTransfer &&
+ lv2_atom_forge_is_object_type(&ui->forge, atom->type)) {
+ const LV2_Atom_Object* obj = (const LV2_Atom_Object*)atom;
+ if (obj->body.otype == ui->uris.RawAudio) {
+ recv_raw_audio(ui, obj);
+ } else if (obj->body.otype == ui->uris.ui_State) {
+ recv_ui_state(ui, obj);
+ }
+ }
}
-static const LV2UI_Descriptor descriptor = {
- SCO_URI "#ui",
- instantiate,
- cleanup,
- port_event,
- NULL
-};
+static const LV2UI_Descriptor descriptor = {SCO_URI "#ui",
+ instantiate,
+ cleanup,
+ port_event,
+ NULL};
LV2_SYMBOL_EXPORT
const LV2UI_Descriptor*
lv2ui_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index == 0 ? &descriptor : NULL;
}
diff --git a/plugins/eg-scope.lv2/manifest.ttl.in b/plugins/eg-scope.lv2/manifest.ttl.in
index a64aff1..66c3c9d 100644
--- a/plugins/eg-scope.lv2/manifest.ttl.in
+++ b/plugins/eg-scope.lv2/manifest.ttl.in
@@ -17,5 +17,5 @@
# ==== Gtk 2.0 UI ====
<http://lv2plug.in/plugins/eg-scope#ui>
a ui:GtkUI ;
- ui:binary <examploscope_ui@LIB_EXT@> ;
+ lv2:binary <examploscope_ui@LIB_EXT@> ;
rdfs:seeAlso <examploscope.ttl> .
diff --git a/plugins/eg-scope.lv2/meson.build b/plugins/eg-scope.lv2/meson.build
new file mode 100644
index 0000000..d776ee7
--- /dev/null
+++ b/plugins/eg-scope.lv2/meson.build
@@ -0,0 +1,62 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+plugin_sources = files('examploscope.c')
+ui_sources = files('examploscope_ui.c')
+bundle_name = 'eg-scope.lv2'
+data_filenames = ['manifest.ttl.in', 'examploscope.ttl.in']
+
+gtk2_dep = dependency(
+ 'gtk+-2.0',
+ include_type: 'system',
+ required: get_option('plugins'),
+ version: '>= 2.18.0',
+)
+
+module = shared_library(
+ 'examploscope',
+ plugin_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, m_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+)
+
+config = configuration_data(
+ {
+ 'LIB_EXT': '.' + module.full_path().split('.')[-1],
+ },
+)
+
+foreach filename : data_filenames
+ if filename.endswith('.in')
+ configure_file(
+ configuration: config,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename.substring(0, -3),
+ )
+ else
+ configure_file(
+ copy: true,
+ input: files(filename),
+ install_dir: lv2dir / bundle_name,
+ output: filename,
+ )
+ endif
+endforeach
+
+if gtk2_dep.found()
+ shared_library(
+ 'examploscope_ui',
+ ui_sources,
+ c_args: c_suppressions,
+ dependencies: [lv2_dep, gtk2_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+ )
+endif
diff --git a/plugins/eg-scope.lv2/uris.h b/plugins/eg-scope.lv2/uris.h
index 2ebaf4e..e2becae 100644
--- a/plugins/eg-scope.lv2/uris.h
+++ b/plugins/eg-scope.lv2/uris.h
@@ -1,71 +1,57 @@
-/*
- Copyright 2013 Robin Gareus <robin@gareus.org>
-
- 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.
-*/
+// Copyright 2013 Robin Gareus <robin@gareus.org>
+// SPDX-License-Identifier: ISC
#ifndef SCO_URIS_H
#define SCO_URIS_H
#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
#include "lv2/parameters/parameters.h"
#include "lv2/urid/urid.h"
#define SCO_URI "http://lv2plug.in/plugins/eg-scope"
typedef struct {
- // URIs defined in LV2 specifications
- LV2_URID atom_Vector;
- LV2_URID atom_Float;
- LV2_URID atom_Int;
- LV2_URID atom_eventTransfer;
- LV2_URID param_sampleRate;
-
- /* URIs defined for this plugin. It is best to re-use existing URIs as
- much as possible, but plugins may need more vocabulary specific to their
- needs. These are used as types and properties for plugin:UI
- communication, as well as for saving state. */
- LV2_URID RawAudio;
- LV2_URID channelID;
- LV2_URID audioData;
- LV2_URID ui_On;
- LV2_URID ui_Off;
- LV2_URID ui_State;
- LV2_URID ui_spp;
- LV2_URID ui_amp;
+ // URIs defined in LV2 specifications
+ LV2_URID atom_Vector;
+ LV2_URID atom_Float;
+ LV2_URID atom_Int;
+ LV2_URID atom_eventTransfer;
+ LV2_URID param_sampleRate;
+
+ /* URIs defined for this plugin. It is best to re-use existing URIs as
+ much as possible, but plugins may need more vocabulary specific to their
+ needs. These are used as types and properties for plugin:UI
+ communication, as well as for saving state. */
+ LV2_URID RawAudio;
+ LV2_URID channelID;
+ LV2_URID audioData;
+ LV2_URID ui_On;
+ LV2_URID ui_Off;
+ LV2_URID ui_State;
+ LV2_URID ui_spp;
+ LV2_URID ui_amp;
} ScoLV2URIs;
static inline void
map_sco_uris(LV2_URID_Map* map, ScoLV2URIs* uris)
{
- uris->atom_Vector = map->map(map->handle, LV2_ATOM__Vector);
- uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
- uris->atom_Int = map->map(map->handle, LV2_ATOM__Int);
- uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
- uris->param_sampleRate = map->map(map->handle, LV2_PARAMETERS__sampleRate);
-
- /* Note the convention that URIs for types are capitalized, and URIs for
- everything else (mainly properties) are not, just as in LV2
- specifications. */
- uris->RawAudio = map->map(map->handle, SCO_URI "#RawAudio");
- uris->audioData = map->map(map->handle, SCO_URI "#audioData");
- uris->channelID = map->map(map->handle, SCO_URI "#channelID");
- uris->ui_On = map->map(map->handle, SCO_URI "#UIOn");
- uris->ui_Off = map->map(map->handle, SCO_URI "#UIOff");
- uris->ui_State = map->map(map->handle, SCO_URI "#UIState");
- uris->ui_spp = map->map(map->handle, SCO_URI "#ui-spp");
- uris->ui_amp = map->map(map->handle, SCO_URI "#ui-amp");
+ uris->atom_Vector = map->map(map->handle, LV2_ATOM__Vector);
+ uris->atom_Float = map->map(map->handle, LV2_ATOM__Float);
+ uris->atom_Int = map->map(map->handle, LV2_ATOM__Int);
+ uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer);
+ uris->param_sampleRate = map->map(map->handle, LV2_PARAMETERS__sampleRate);
+
+ /* Note the convention that URIs for types are capitalized, and URIs for
+ everything else (mainly properties) are not, just as in LV2
+ specifications. */
+ uris->RawAudio = map->map(map->handle, SCO_URI "#RawAudio");
+ uris->audioData = map->map(map->handle, SCO_URI "#audioData");
+ uris->channelID = map->map(map->handle, SCO_URI "#channelID");
+ uris->ui_On = map->map(map->handle, SCO_URI "#UIOn");
+ uris->ui_Off = map->map(map->handle, SCO_URI "#UIOff");
+ uris->ui_State = map->map(map->handle, SCO_URI "#UIState");
+ uris->ui_spp = map->map(map->handle, SCO_URI "#ui-spp");
+ uris->ui_amp = map->map(map->handle, SCO_URI "#ui-amp");
}
-#endif /* SCO_URIS_H */
+#endif /* SCO_URIS_H */
diff --git a/plugins/eg-scope.lv2/wscript b/plugins/eg-scope.lv2/wscript
deleted file mode 100644
index 4333502..0000000
--- a/plugins/eg-scope.lv2/wscript
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-import re
-
-# Variables for 'waf dist'
-APPNAME = 'eg-scope.lv2'
-VERSION = '1.0.0'
-
-# Mandatory variables
-top = '.'
-out = 'build'
-
-def options(opt):
- opt.load('compiler_c')
- opt.load('lv2')
- autowaf.set_options(opt)
-
-def configure(conf):
- conf.load('compiler_c', cache=True)
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
-
- conf.check_pkg('lv2 >= 1.2.1', uselib_store='LV2')
- conf.check_pkg('cairo >= 1.8.10', uselib_store='CAIRO')
- conf.check_pkg('gtk+-2.0 >= 2.18.0',
- uselib_store='GTK2',
- system=True,
- mandatory=False)
-
-def build(bld):
- bundle = 'eg-scope.lv2'
-
- # Build manifest.ttl by substitution (for portable lib extension)
- for i in ['manifest.ttl', 'examploscope.ttl']:
- bld(features = 'subst',
- source = i + '.in',
- target = 'lv2/%s/%s' % (bundle, i),
- install_path = '${LV2DIR}/%s' % bundle,
- LIB_EXT = bld.env.LV2_LIB_EXT)
-
- # Build plugin library
- obj = bld(features = 'c cshlib lv2lib',
- source = 'examploscope.c',
- name = 'examploscope',
- target = 'lv2/%s/examploscope' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = 'LV2')
-
- # Build UI library
- if bld.env.HAVE_GTK2:
- obj = bld(features = 'c cshlib lv2lib',
- source = 'examploscope_ui.c',
- name = 'examploscope_ui',
- target = 'lv2/%s/examploscope_ui' % bundle,
- install_path = '${LV2DIR}/%s' % bundle,
- use = 'GTK2 CAIRO LV2')
diff --git a/plugins/literasc.py b/plugins/literasc.py
index 0bcd8f2..74b13a7 100755
--- a/plugins/literasc.py
+++ b/plugins/literasc.py
@@ -1,127 +1,143 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Literasc, a simple literate programming tool for C, C++, and Turtle.
-# Copyright 2012 David Robillard <d@drobilla.net>
-#
-# Unlike many LP tools, this tool uses normal source code as input, there is no
-# tangle/weave and no special file format. The literate parts of the program
-# are written in comments, which are emitted as paragraphs of regular text
-# interleaved with code. Asciidoc is both the comment and output syntax.
+#!/usr/bin/env python3
+
+# Copyright 2012-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
+"""
+A simple literate programming tool for C, C++, and Turtle.
+
+Unlike many LP tools, this tool uses normal source code as input, there is no
+tangle/weave and no special file format. The literate parts of the program are
+written in comments, which are emitted as paragraphs of regular text
+interleaved with code. Asciidoc is both the comment and output syntax.
+"""
import os
import re
import sys
+
def format_text(text):
- 'Format a text (comment) fragment and return it as a marked up string'
- return '\n\n' + re.sub('\n *', '\n', text.strip()) + '\n\n'
+ "Format a text (comment) fragment and return it as a marked up string."
+ return "\n\n" + re.sub("\n *", "\n", text.strip()) + "\n\n"
+
def format_code(lang, code):
- if code.strip() == '':
+ "Format a block of code and return it as a marked up string."
+
+ if code.strip() == "":
return code
- head = '[source,%s]' % lang
- sep = '-' * len(head) + '\n'
- return head + '\n' + sep + code.strip('\n') + '\n' + sep
+ head = f"[source,{lang}]"
+ code = code.strip("\n")
+ sep = "-" * len(head)
+ return "\n".join([head, sep, code, sep]) + "\n"
+
-def format_c_source(filename, file):
- output = '=== %s ===\n' % os.path.basename(filename)
- chunk = ''
- prev_c = 0
- in_comment = False
+def format_c_source(filename, in_file):
+ "Format an annotated C source file as a marked up string."
+
+ output = f"=== {os.path.basename(filename)} ===\n"
+ chunk = ""
+ prev_c = 0
+ in_comment = False
in_comment_start = False
- n_stars = 0
- code = ''
- for line in file:
- code += line
+ n_stars = 0
+ code = "".join(in_file)
# Skip initial license comment
- if code[0:2] == '/*':
- code = code[code.find('*/') + 2:]
+ if code[0:2] == "/*":
+ end = code.find("*/") + 2
+ code = code[end:]
- for c in code:
- if prev_c == '/' and c == '*':
+ def last_chunk(chunk):
+ length = len(chunk) - 1
+ return chunk[0:length]
+
+ for char in code:
+ if prev_c == "/" and char == "*":
in_comment_start = True
n_stars = 1
elif in_comment_start:
- if c == '*':
+ if char == "*":
n_stars += 1
else:
if n_stars > 1:
- output += format_code('c', chunk[0:len(chunk) - 1])
- chunk = ''
+ output += format_code("c", last_chunk(chunk))
+ chunk = ""
in_comment = True
else:
- chunk += '*' + c
+ chunk += "*" + char
in_comment_start = False
- elif in_comment and prev_c == '*' and c == '/':
+ elif in_comment and prev_c == "*" and char == "/":
if n_stars > 1:
- output += format_text(chunk[0:len(chunk) - 1])
+ output += format_text(last_chunk(chunk))
else:
- output += format_code('c', '/* ' + chunk[0:len(chunk) - 1] + '*/')
+ output += format_code("c", "/* " + last_chunk(chunk) + "*/")
in_comment = False
in_comment_start = False
- chunk = ''
- elif in_comment_start and c == '*':
- n_stars += 1
+ chunk = ""
else:
- chunk += c
- prev_c = c
+ chunk += char
+
+ prev_c = char
+
+ return output + format_code("c", chunk)
- return output + format_code('c', chunk)
-def format_ttl_source(filename, file):
- output = '=== %s ===\n' % os.path.basename(filename)
+def format_ttl_source(filename, in_file):
+ "Format an annotated Turtle source file as a marked up string."
+
+ output = f"=== {os.path.basename(filename)} ===\n"
in_comment = False
- chunk = ''
- for line in file:
- is_comment = line.strip().startswith('#')
+ chunk = ""
+ for line in in_file:
+ is_comment = line.strip().startswith("#")
if in_comment:
if is_comment:
- chunk += line.strip().lstrip('# ') + ' \n'
+ chunk += line.strip().lstrip("# ") + " \n"
else:
output += format_text(chunk)
in_comment = False
chunk = line
else:
if is_comment:
- output += format_code('turtle', chunk)
+ output += format_code("turtle", chunk)
in_comment = True
- chunk = line.strip().lstrip('# ') + ' \n'
+ chunk = line.strip().lstrip("# ") + " \n"
else:
chunk += line
if in_comment:
return output + format_text(chunk)
- else:
- return output + format_code('turtle', chunk)
+
+ return output + format_code("turtle", chunk)
+
def gen(out, filenames):
+ "Write markup generated from filenames to an output file."
+
for filename in filenames:
- file = open(filename)
- if not file:
- sys.stderr.write('Failed to open file %s\n' % filename)
- continue
-
- if filename.endswith('.c') or filename.endswith('.h'):
- out.write(format_c_source(filename, file))
- elif filename.endswith('.ttl') or filename.endswith('.ttl.in'):
- out.write(format_ttl_source(filename, file))
- elif filename.endswith('.txt'):
- for line in file:
- out.write(line)
- out.write('\n')
- else:
- sys.stderr.write("Unknown source format `%s'" % (
- filename[filename.find('.'):]))
+ with open(filename, "r", encoding="utf-8") as in_file:
+ if filename.endswith(".c") or filename.endswith(".h"):
+ out.write(format_c_source(filename, in_file))
+ elif filename.endswith(".ttl") or filename.endswith(".ttl.in"):
+ out.write(format_ttl_source(filename, in_file))
+ elif filename.endswith(".txt"):
+ for line in in_file:
+ out.write(line)
+ out.write("\n")
+ else:
+ sys.stderr.write(
+ f"Unknown source format `{filename.splitext()[1]}`\n"
+ )
- file.close()
if __name__ == "__main__":
if len(sys.argv) < 2:
- sys.stderr.write('Usage: %s FILENAME...\n' % sys.argv[1])
+ sys.stderr.write(f"Usage: {sys.argv[0]} OUT_FILE IN_FILE...\n")
sys.exit(1)
- gen(sys.argv[1:])
+ with open(sys.argv[1], "w", encoding="utf-8") as out_file:
+ gen(out_file, sys.argv[2:])
diff --git a/plugins/meson.build b/plugins/meson.build
new file mode 100644
index 0000000..ff70af1
--- /dev/null
+++ b/plugins/meson.build
@@ -0,0 +1,82 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+if not get_option('plugins').disabled()
+ m_dep = cc.find_library('m', required: false)
+
+ subdir('eg-amp.lv2')
+ subdir('eg-fifths.lv2')
+ subdir('eg-metro.lv2')
+ subdir('eg-midigate.lv2')
+ subdir('eg-params.lv2')
+ subdir('eg-sampler.lv2')
+ subdir('eg-scope.lv2')
+endif
+
+if not get_option('docs').disabled()
+ literasc_py = files('literasc.py')
+ asciidoc = find_program('asciidoc', required: get_option('docs'))
+
+ if asciidoc.found()
+ book_inputs = files('README.txt')
+ book_inputs += files(
+ 'eg-amp.lv2/README.txt',
+ 'eg-amp.lv2/amp.c',
+ 'eg-amp.lv2/amp.ttl',
+ 'eg-fifths.lv2/README.txt',
+ 'eg-fifths.lv2/fifths.c',
+ 'eg-fifths.lv2/fifths.ttl',
+ 'eg-fifths.lv2/uris.h',
+ 'eg-metro.lv2/README.txt',
+ 'eg-metro.lv2/metro.c',
+ 'eg-metro.lv2/metro.ttl',
+ 'eg-midigate.lv2/README.txt',
+ 'eg-midigate.lv2/midigate.c',
+ 'eg-midigate.lv2/midigate.ttl',
+ 'eg-params.lv2/README.txt',
+ 'eg-params.lv2/params.c',
+ 'eg-params.lv2/params.ttl',
+ 'eg-params.lv2/state_map.h',
+ 'eg-sampler.lv2/README.txt',
+ 'eg-sampler.lv2/atom_sink.h',
+ 'eg-sampler.lv2/peaks.h',
+ 'eg-sampler.lv2/sampler.c',
+ 'eg-sampler.lv2/sampler.ttl',
+ 'eg-sampler.lv2/sampler_ui.c',
+ 'eg-sampler.lv2/uris.h',
+ 'eg-scope.lv2/README.txt',
+ 'eg-scope.lv2/examploscope.c',
+ 'eg-scope.lv2/examploscope_ui.c',
+ 'eg-scope.lv2/uris.h',
+ )
+
+ # Compile book sources into book.txt asciidoc source
+ book_txt = custom_target(
+ 'book.txt',
+ command: [
+ literasc_py,
+ '@OUTPUT@',
+ '@INPUT@',
+ ],
+ input: book_inputs,
+ output: 'book.txt',
+ )
+
+ # Run asciidoc to generate book.html
+ book_html = custom_target(
+ 'book.html',
+ build_by_default: true,
+ command: [
+ asciidoc,
+ '-a', 'stylesdir=' + lv2_source_root / 'doc' / 'style',
+ '-a', 'source-highlighter=pygments',
+ '-a', 'pygments-style=' + lv2_source_root / 'doc' / 'style' / 'style.css',
+ '-b', 'html',
+ '-o', '@OUTPUT@',
+ '@INPUT@',
+ ],
+ input: book_txt,
+ output: 'book.html',
+ )
+ endif
+endif
diff --git a/plugins/wscript b/plugins/wscript
deleted file mode 100644
index f5f6571..0000000
--- a/plugins/wscript
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-import os
-
-from waflib.extras import autowaf as autowaf
-import waflib.Logs as Logs
-
-import literasc
-
-def confgure(conf):
- pass
-
-def bld_book_src(task):
- filenames = []
- for i in task.inputs:
- filenames += [i.abspath()]
-
- literasc.gen(open(task.outputs[0].abspath(), 'w'), filenames)
-
-def build(bld):
- files = [bld.path.find_node('README.txt')]
- for i in ['eg-amp.lv2',
- 'eg-midigate.lv2',
- 'eg-fifths.lv2',
- 'eg-metro.lv2',
- 'eg-sampler.lv2',
- 'eg-scope.lv2',
- 'eg-params.lv2']:
- files += bld.path.ant_glob('%s/*.txt' % i)
- files += bld.path.ant_glob('%s/manifest.ttl*' % i)
- files += bld.path.ant_glob('%s/*.ttl' % i)
- files += bld.path.ant_glob('%s/*.c' % i)
- files += bld.path.ant_glob('%s/*.h' % i)
-
- # Compile book sources into book.txt asciidoc source
- bld(rule = bld_book_src,
- source = files,
- target = 'book.txt')
-
- # Run asciidoc to generate book.html
- stylesdir = bld.path.find_node('../doc/').abspath()
- pygments_style = bld.path.find_node('../doc/style.css').abspath()
- bld(rule = 'asciidoc -a stylesdir=%s -a source-highlighter=pygments -a pygments-style=%s -b html -o ${TGT} ${SRC}' % (
- stylesdir, pygments_style),
- source = 'book.txt',
- target = 'book.html')
diff --git a/resources/logo/lv2.ipe b/resources/logo/lv2.ipe
new file mode 100644
index 0000000..9f9b1d6
--- /dev/null
+++ b/resources/logo/lv2.ipe
@@ -0,0 +1,291 @@
+<?xml version="1.0"?>
+<!DOCTYPE ipe SYSTEM "ipe.dtd">
+<ipe version="70206" creator="Ipe 7.2.7">
+<info created="D:20190111102815" modified="D:20190414171814" title="LV2" author="David Robillard"/>
+<ipestyle name="basic">
+<symbol name="arrow/arc(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/farc(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/ptarc(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/fptarc(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="mark/circle(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</symbol>
+<symbol name="mark/disk(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+</path>
+</symbol>
+<symbol name="mark/fdisk(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+0.5 0 0 0.5 0 0 e
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</group>
+</symbol>
+<symbol name="mark/box(sx)" transformations="translations">
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</symbol>
+<symbol name="mark/square(sx)" transformations="translations">
+<path fill="sym-stroke">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+</path>
+</symbol>
+<symbol name="mark/fsquare(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+-0.5 -0.5 m
+0.5 -0.5 l
+0.5 0.5 l
+-0.5 0.5 l
+h
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="mark/cross(sx)" transformations="translations">
+<group>
+<path fill="sym-stroke">
+-0.43 -0.57 m
+0.57 0.43 l
+0.43 0.57 l
+-0.57 -0.43 l
+h
+</path>
+<path fill="sym-stroke">
+-0.43 0.57 m
+0.57 -0.43 l
+0.43 -0.57 l
+-0.57 0.43 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="arrow/fnormal(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/pointed(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/fpointed(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/linear(spx)">
+<path stroke="sym-stroke" pen="sym-pen">
+-1 0.333 m
+0 0 l
+-1 -0.333 l
+</path>
+</symbol>
+<symbol name="arrow/fdouble(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/double(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<pen name="heavier" value="0.8"/>
+<pen name="fat" value="1.2"/>
+<pen name="ultrafat" value="2"/>
+<symbolsize name="large" value="5"/>
+<symbolsize name="small" value="2"/>
+<symbolsize name="tiny" value="1.1"/>
+<arrowsize name="large" value="10"/>
+<arrowsize name="small" value="5"/>
+<arrowsize name="tiny" value="3"/>
+<color name="red" value="1 0 0"/>
+<color name="green" value="0 1 0"/>
+<color name="blue" value="0 0 1"/>
+<color name="yellow" value="1 1 0"/>
+<color name="orange" value="1 0.647 0"/>
+<color name="gold" value="1 0.843 0"/>
+<color name="purple" value="0.627 0.125 0.941"/>
+<color name="gray" value="0.745"/>
+<color name="brown" value="0.647 0.165 0.165"/>
+<color name="navy" value="0 0 0.502"/>
+<color name="pink" value="1 0.753 0.796"/>
+<color name="seagreen" value="0.18 0.545 0.341"/>
+<color name="turquoise" value="0.251 0.878 0.816"/>
+<color name="violet" value="0.933 0.51 0.933"/>
+<color name="darkblue" value="0 0 0.545"/>
+<color name="darkcyan" value="0 0.545 0.545"/>
+<color name="darkgray" value="0.663"/>
+<color name="darkgreen" value="0 0.392 0"/>
+<color name="darkmagenta" value="0.545 0 0.545"/>
+<color name="darkorange" value="1 0.549 0"/>
+<color name="darkred" value="0.545 0 0"/>
+<color name="lightblue" value="0.678 0.847 0.902"/>
+<color name="lightcyan" value="0.878 1 1"/>
+<color name="lightgray" value="0.827"/>
+<color name="lightgreen" value="0.565 0.933 0.565"/>
+<color name="lightyellow" value="1 1 0.878"/>
+<dashstyle name="dashed" value="[4] 0"/>
+<dashstyle name="dotted" value="[1 3] 0"/>
+<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
+<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
+<textsize name="large" value="\large"/>
+<textsize name="small" value="\small"/>
+<textsize name="tiny" value="\tiny"/>
+<textsize name="Large" value="\Large"/>
+<textsize name="LARGE" value="\LARGE"/>
+<textsize name="huge" value="\huge"/>
+<textsize name="Huge" value="\Huge"/>
+<textsize name="footnote" value="\footnotesize"/>
+<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
+<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
+<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
+<gridsize name="4 pts" value="4"/>
+<gridsize name="8 pts (~3 mm)" value="8"/>
+<gridsize name="16 pts (~6 mm)" value="16"/>
+<gridsize name="32 pts (~12 mm)" value="32"/>
+<gridsize name="10 pts (~3.5 mm)" value="10"/>
+<gridsize name="20 pts (~7 mm)" value="20"/>
+<gridsize name="14 pts (~5 mm)" value="14"/>
+<gridsize name="28 pts (~10 mm)" value="28"/>
+<gridsize name="56 pts (~20 mm)" value="56"/>
+<anglesize name="90 deg" value="90"/>
+<anglesize name="60 deg" value="60"/>
+<anglesize name="45 deg" value="45"/>
+<anglesize name="30 deg" value="30"/>
+<anglesize name="22.5 deg" value="22.5"/>
+<opacity name="10%" value="0.1"/>
+<opacity name="30%" value="0.3"/>
+<opacity name="50%" value="0.5"/>
+<opacity name="75%" value="0.75"/>
+<tiling name="falling" angle="-60" step="4" width="1"/>
+<tiling name="rising" angle="30" step="4" width="1"/>
+</ipestyle>
+<page>
+<layer name="alpha"/>
+<view layers="alpha" active="alpha"/>
+<path layer="alpha" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+160 800 m
+256 448 l
+448 448 l
+413.091 320 l
+162.909 320 l
+32 800 l
+h
+</path>
+<path matrix="1 0 0 1 32 96" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+128 704 m
+224 352 l
+288 352 l
+384 704 l
+320 704 l
+256 469.333 l
+192 704 l
+h
+</path>
+<path matrix="1 0 0 1 32 96" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+288 352 m
+352 352 l
+448 704 l
+384 704 l
+h
+</path>
+<path matrix="1 0 0 1 96 96" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+288 352 m
+352 352 l
+448 704 l
+384 704 l
+h
+</path>
+</page>
+</ipe>
diff --git a/resources/logo/lv2_badge_metallic.svg b/resources/logo/lv2_badge_metallic.svg
new file mode 100644
index 0000000..0082c7c
--- /dev/null
+++ b/resources/logo/lv2_badge_metallic.svg
@@ -0,0 +1,25 @@
+<svg height="512" width="512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#999"/>
+ <stop offset="1" stop-color="#f9f9f9"/>
+ </linearGradient>
+ <linearGradient id="f" gradientUnits="userSpaceOnUse" x1="2937.115" x2="3097.115" xlink:href="#a" y1="-172.966" y2="179.034"/>
+ <linearGradient id="c" gradientUnits="userSpaceOnUse" x1="2716.025" x2="2969.115" xlink:href="#a" y1="-300.966" y2="179.034"/>
+ <linearGradient id="d" gradientUnits="userSpaceOnUse" x1="2809.115" x2="2969.115" xlink:href="#a" y1="-172.966" y2="179.034"/>
+ <linearGradient id="e" gradientUnits="userSpaceOnUse" x1="2873.115" x2="3033.115" xlink:href="#a" y1="-172.966" y2="179.034"/>
+ <linearGradient id="b" gradientUnits="userSpaceOnUse" x1="3033.349" x2="2649.479" y1="235.742" y2="-146.408">
+ <stop offset="0" stop-color="#464646"/>
+ <stop offset="1" stop-color="#d5d5d5"/>
+ </linearGradient>
+ <circle cx="2841.115" cy="44.966" r="188.926" transform="matrix(1.33333 0 0 1.33333 -3532.153 196.045)" stroke="#000" stroke-width="6.148" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" fill="url(#b)"/>
+ <g stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10">
+ <path d="M2713.115 179.034l96-352h192l-34.91-128h-250.18l-130.91 480z" fill="url(#c)" fill-rule="evenodd" stroke-width="12" transform="matrix(.68315 0 0 -.68315 -1684.916 245.093)"/>
+ <path d="M168.556 122.785l65.583 240.47h131.165l-23.848 87.444H170.544L81.113 122.785z" fill="none" stroke-width="1.3663"/>
+ <path d="M2713.115 179.034l96-352h64l96 352h-64l-64-234.668-64 234.668z" fill="url(#d)" fill-rule="evenodd" stroke-width="12" transform="matrix(.68315 0 0 -.68315 -1684.916 245.093)"/>
+ <path d="M168.556 122.785l65.583 240.47h43.722l65.583-240.47h-43.722L256 283.1l-43.722-160.314z" fill="none" stroke-width="1.3663"/>
+ <path d="M2873.115-172.966h64l96 352h-64z" fill="url(#e)" fill-rule="evenodd" stroke-width="12" transform="matrix(.68315 0 0 -.68315 -1684.916 245.093)"/>
+ <path d="M277.86 363.255h43.723l65.582-240.47h-43.721z" fill="none" stroke-width="1.3663"/>
+ </g>
+ <path d="M321.583 363.255h43.721l65.583-240.47h-43.722z" fill="#bebebe" fill-rule="evenodd"/>
+ <path d="M2937.115-172.966h64l96 352h-64z" stroke="#000" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" fill="url(#f)" transform="matrix(.68315 0 0 -.68315 -1684.916 245.093)"/>
+</svg>
diff --git a/resources/logo/lv2_flat_green.svg b/resources/logo/lv2_flat_green.svg
new file mode 100644
index 0000000..7874538
--- /dev/null
+++ b/resources/logo/lv2_flat_green.svg
@@ -0,0 +1,10 @@
+<svg height="512" width="512" xmlns="http://www.w3.org/2000/svg">
+ <path d="M128 16l96 352h192l-34.91 128H130.91L0 16z" fill="#546e00" fill-rule="evenodd"/>
+ <path d="M128 16l96 352h192l-34.91 128H130.91L0 16z" fill="none"/>
+ <path d="M128 16l96 352h64l96-352h-64l-64 234.668L192 16z" fill="#fff" fill-rule="evenodd"/>
+ <path d="M128 16l96 352h64l96-352h-64l-64 234.668L192 16z" fill="#b4c342"/>
+ <path d="M288 368h64l96-352h-64z" fill="#fff" fill-rule="evenodd"/>
+ <path d="M288 368h64l96-352h-64z" fill="#96ac00"/>
+ <path d="M352 368h64l96-352h-64z" fill="#fff" fill-rule="evenodd"/>
+ <path d="M352 368h64l96-352h-64z" fill="#859900"/>
+</svg>
diff --git a/resources/logo/lv2_flat_green_border.svg b/resources/logo/lv2_flat_green_border.svg
new file mode 100644
index 0000000..1908739
--- /dev/null
+++ b/resources/logo/lv2_flat_green_border.svg
@@ -0,0 +1,14 @@
+<svg height="512" width="512" xmlns="http://www.w3.org/2000/svg">
+ <g stroke="#202020" stroke-width="6.618">
+ <g stroke-linecap="round" stroke-linejoin="round">
+ <path d="M129.748 20.412l94.119 345.102h188.238l-34.226 125.492H132.6L4.256 20.412z" fill="#546e00" fill-rule="evenodd" stroke-width="8.82397794"/>
+ <path d="M129.748 20.412l94.119 345.102h188.238l-34.226 125.492H132.6L4.256 20.412z" fill="none" stroke-width="8.82397794"/>
+ <path d="M129.748 20.412l94.119 345.102h62.746l94.119-345.102h-62.746l-62.746 230.07-62.746-230.07z" fill="#fff" fill-rule="evenodd" stroke-width="8.82397794"/>
+ <path d="M129.748 20.412l94.119 345.102h62.746l94.119-345.102h-62.746l-62.746 230.07-62.746-230.07z" fill="#b4c342" stroke-width="8.82397794"/>
+ <path d="M286.613 365.514h62.746l94.119-345.102h-62.746z" fill="#fff" fill-rule="evenodd" stroke-width="8.82397794"/>
+ <path d="M286.613 365.514h62.746l94.119-345.102h-62.746z" fill="#96ac00" stroke-width="8.82397794"/>
+ </g>
+ <path d="M349.359 365.514h62.746l94.119-345.102h-62.746z" fill="#fff" fill-rule="evenodd" stroke-width="8.82397794"/>
+ <path d="M349.359 365.514h62.746l94.119-345.102h-62.746z" fill="#859900" stroke-linecap="round" stroke-linejoin="round" stroke-width="8.82397794"/>
+ </g>
+</svg>
diff --git a/resources/logo/lv2_flat_purple.svg b/resources/logo/lv2_flat_purple.svg
new file mode 100644
index 0000000..e12d4be
--- /dev/null
+++ b/resources/logo/lv2_flat_purple.svg
@@ -0,0 +1,10 @@
+<svg height="512" width="512" xmlns="http://www.w3.org/2000/svg">
+ <path d="M128 16l96 352h192l-34.91 128H130.91L0 16z" fill="#292961" fill-rule="evenodd"/>
+ <path d="M128 16l96 352h192l-34.91 128H130.91L0 16z" fill="none"/>
+ <path d="M128 16l96 352h64l96-352h-64l-64 234.668L192 16z" fill="#fff" fill-rule="evenodd"/>
+ <path d="M128 16l96 352h64l96-352h-64l-64 234.668L192 16z" fill="#5555c7"/>
+ <path d="M288 368h64l96-352h-64z" fill="#fff" fill-rule="evenodd"/>
+ <path d="M288 368h64l96-352h-64z" fill="#3f3f94"/>
+ <path d="M352 368h64l96-352h-64z" fill="#fff" fill-rule="evenodd"/>
+ <path d="M352 368h64l96-352h-64z" fill="#5555c7"/>
+</svg>
diff --git a/resources/logo/lv2_metallic.svg b/resources/logo/lv2_metallic.svg
new file mode 100644
index 0000000..153275b
--- /dev/null
+++ b/resources/logo/lv2_metallic.svg
@@ -0,0 +1,20 @@
+<svg height="512" width="512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#999"/>
+ <stop offset="1" stop-color="#f9f9f9"/>
+ </linearGradient>
+ <linearGradient id="e" gradientUnits="userSpaceOnUse" x1="2937.115" x2="3097.115" xlink:href="#a" y1="-172.966" y2="179.034"/>
+ <linearGradient id="b" gradientUnits="userSpaceOnUse" x1="2716.025" x2="2969.115" xlink:href="#a" y1="-300.966" y2="179.034"/>
+ <linearGradient id="c" gradientUnits="userSpaceOnUse" x1="2809.115" x2="2969.115" xlink:href="#a" y1="-172.966" y2="179.034"/>
+ <linearGradient id="d" gradientUnits="userSpaceOnUse" x1="2873.115" x2="3033.115" xlink:href="#a" y1="-172.966" y2="179.034"/>
+ <g stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10">
+ <path d="M2713.115 179.034l96-352h192l-34.91-128h-250.18l-130.91 480z" fill="url(#b)" fill-rule="evenodd" stroke-width="12" transform="matrix(.97789 0 0 -.97789 -2522.293 194.942)"/>
+ <path d="M130.83 19.867l93.878 344.217h187.754l-34.138 125.17H133.676L5.66 19.867z" fill="none" stroke-width="1.95578"/>
+ <path d="M2713.115 179.034l96-352h64l96 352h-64l-64-234.668-64 234.668z" fill="url(#c)" fill-rule="evenodd" stroke-width="12" transform="matrix(.97789 0 0 -.97789 -2522.293 194.942)"/>
+ <path d="M130.83 19.867l93.878 344.217h62.584L381.17 19.867h-62.585L256 249.347l-62.585-229.48z" fill="none" stroke-width="1.95578"/>
+ <path d="M2873.115-172.966h64l96 352h-64z" fill="url(#d)" fill-rule="evenodd" stroke-width="12" transform="matrix(.97789 0 0 -.97789 -2522.293 194.942)"/>
+ <path d="M287.292 364.084h62.585l93.878-344.217H381.17z" fill="none" stroke-width="1.95578"/>
+ </g>
+ <path d="M349.877 364.084h62.585L506.34 19.867h-62.584z" fill="#bebebe" fill-rule="evenodd"/>
+ <path d="M2937.115-172.966h64l96 352h-64z" stroke="#000" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" fill="url(#e)" transform="matrix(.97789 0 0 -.97789 -2522.293 194.942)"/>
+</svg>
diff --git a/resources/logo/lv2site.ipe b/resources/logo/lv2site.ipe
new file mode 100644
index 0000000..5ea5016
--- /dev/null
+++ b/resources/logo/lv2site.ipe
@@ -0,0 +1,295 @@
+<?xml version="1.0"?>
+<!DOCTYPE ipe SYSTEM "ipe.dtd">
+<ipe version="70206" creator="Ipe 7.2.7">
+<info created="D:20190111102815" modified="D:20190414172017" title="LV2" author="David Robillard"/>
+<ipestyle name="basic">
+<symbol name="arrow/arc(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/farc(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/ptarc(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/fptarc(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="mark/circle(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</symbol>
+<symbol name="mark/disk(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+</path>
+</symbol>
+<symbol name="mark/fdisk(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+0.5 0 0 0.5 0 0 e
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</group>
+</symbol>
+<symbol name="mark/box(sx)" transformations="translations">
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</symbol>
+<symbol name="mark/square(sx)" transformations="translations">
+<path fill="sym-stroke">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+</path>
+</symbol>
+<symbol name="mark/fsquare(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+-0.5 -0.5 m
+0.5 -0.5 l
+0.5 0.5 l
+-0.5 0.5 l
+h
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="mark/cross(sx)" transformations="translations">
+<group>
+<path fill="sym-stroke">
+-0.43 -0.57 m
+0.57 0.43 l
+0.43 0.57 l
+-0.57 -0.43 l
+h
+</path>
+<path fill="sym-stroke">
+-0.43 0.57 m
+0.57 -0.43 l
+0.43 -0.57 l
+-0.57 0.43 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="arrow/fnormal(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/pointed(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/fpointed(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/linear(spx)">
+<path stroke="sym-stroke" pen="sym-pen">
+-1 0.333 m
+0 0 l
+-1 -0.333 l
+</path>
+</symbol>
+<symbol name="arrow/fdouble(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/double(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<pen name="heavier" value="0.8"/>
+<pen name="fat" value="1.2"/>
+<pen name="ultrafat" value="2"/>
+<symbolsize name="large" value="5"/>
+<symbolsize name="small" value="2"/>
+<symbolsize name="tiny" value="1.1"/>
+<arrowsize name="large" value="10"/>
+<arrowsize name="small" value="5"/>
+<arrowsize name="tiny" value="3"/>
+<color name="red" value="1 0 0"/>
+<color name="green" value="0 1 0"/>
+<color name="blue" value="0 0 1"/>
+<color name="yellow" value="1 1 0"/>
+<color name="orange" value="1 0.647 0"/>
+<color name="gold" value="1 0.843 0"/>
+<color name="purple" value="0.627 0.125 0.941"/>
+<color name="gray" value="0.745"/>
+<color name="brown" value="0.647 0.165 0.165"/>
+<color name="navy" value="0 0 0.502"/>
+<color name="pink" value="1 0.753 0.796"/>
+<color name="seagreen" value="0.18 0.545 0.341"/>
+<color name="turquoise" value="0.251 0.878 0.816"/>
+<color name="violet" value="0.933 0.51 0.933"/>
+<color name="darkblue" value="0 0 0.545"/>
+<color name="darkcyan" value="0 0.545 0.545"/>
+<color name="darkgray" value="0.663"/>
+<color name="darkgreen" value="0 0.392 0"/>
+<color name="darkmagenta" value="0.545 0 0.545"/>
+<color name="darkorange" value="1 0.549 0"/>
+<color name="darkred" value="0.545 0 0"/>
+<color name="lightblue" value="0.678 0.847 0.902"/>
+<color name="lightcyan" value="0.878 1 1"/>
+<color name="lightgray" value="0.827"/>
+<color name="lightgreen" value="0.565 0.933 0.565"/>
+<color name="lightyellow" value="1 1 0.878"/>
+<dashstyle name="dashed" value="[4] 0"/>
+<dashstyle name="dotted" value="[1 3] 0"/>
+<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
+<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
+<textsize name="large" value="\large"/>
+<textsize name="small" value="\small"/>
+<textsize name="tiny" value="\tiny"/>
+<textsize name="Large" value="\Large"/>
+<textsize name="LARGE" value="\LARGE"/>
+<textsize name="huge" value="\huge"/>
+<textsize name="Huge" value="\Huge"/>
+<textsize name="footnote" value="\footnotesize"/>
+<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
+<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
+<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
+<gridsize name="4 pts" value="4"/>
+<gridsize name="8 pts (~3 mm)" value="8"/>
+<gridsize name="16 pts (~6 mm)" value="16"/>
+<gridsize name="32 pts (~12 mm)" value="32"/>
+<gridsize name="10 pts (~3.5 mm)" value="10"/>
+<gridsize name="20 pts (~7 mm)" value="20"/>
+<gridsize name="14 pts (~5 mm)" value="14"/>
+<gridsize name="28 pts (~10 mm)" value="28"/>
+<gridsize name="56 pts (~20 mm)" value="56"/>
+<anglesize name="90 deg" value="90"/>
+<anglesize name="60 deg" value="60"/>
+<anglesize name="45 deg" value="45"/>
+<anglesize name="30 deg" value="30"/>
+<anglesize name="22.5 deg" value="22.5"/>
+<opacity name="10%" value="0.1"/>
+<opacity name="30%" value="0.3"/>
+<opacity name="50%" value="0.5"/>
+<opacity name="75%" value="0.75"/>
+<tiling name="falling" angle="-60" step="4" width="1"/>
+<tiling name="rising" angle="30" step="4" width="1"/>
+</ipestyle>
+<page>
+<layer name="alpha"/>
+<view layers="alpha" active="alpha"/>
+<path layer="alpha" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+160 800 m
+256 448 l
+448 448 l
+413.091 320 l
+162.909 320 l
+32 800 l
+h
+</path>
+<path matrix="1 0 0 1 32 96" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+288 352 m
+352 352 l
+448 704 l
+384 704 l
+h
+</path>
+<path matrix="1 0 0 1 96 96" stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+288 352 m
+352 352 l
+448 704 l
+384 704 l
+h
+</path>
+<path stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+312.727 656 m
+376.727 656 l
+416 800 l
+352 800 l
+h
+</path>
+<path stroke="black" fill="gray" pen="ultrafat" cap="1" join="1">
+256 448 m
+320 448 l
+359.273 592 l
+295.273 592 l
+h
+</path>
+</page>
+</ipe>
diff --git a/resources/logo/lv2site_purple.svg b/resources/logo/lv2site_purple.svg
new file mode 100644
index 0000000..be90e2f
--- /dev/null
+++ b/resources/logo/lv2site_purple.svg
@@ -0,0 +1,9 @@
+<svg height="512" width="512" xmlns="http://www.w3.org/2000/svg">
+ <g fill-rule="evenodd">
+ <path d="M128 16l96 352h192l-34.91 128H130.91L0 16z" fill="#292961"/>
+ <path d="M288 368h64l96-352h-64z" fill="#3f3f94"/>
+ <g fill="#5555c7">
+ <path d="M352 368h64l96-352h-64zM280.727 160h64L384 16h-64zM224 368h64l39.273-144h-64z"/>
+ </g>
+ </g>
+</svg>
diff --git a/schemas.lv2/README b/schemas.lv2/README.txt
index 1395251..1395251 100644
--- a/schemas.lv2/README
+++ b/schemas.lv2/README.txt
diff --git a/schemas.lv2/dcs.ttl b/schemas.lv2/dcs.ttl
deleted file mode 100644
index 37b1e10..0000000
--- a/schemas.lv2/dcs.ttl
+++ /dev/null
@@ -1,272 +0,0 @@
-# This ontology.
-@prefix dcs: <http://ontologi.es/doap-changeset#> .
-
-# Related
-@prefix event: <http://purl.org/NET/c4dm/event.owl#> .
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix dbug: <http://ontologi.es/doap-bugs#> .
-
-# Stock imports.
-@prefix dct: <http://purl.org/dc/terms/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix owl: <http://www.w3.org/2002/07/owl#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
-
-<http://tobyinkster.co.uk/#i> a foaf:Person .
-
-dcs:
- a owl:Ontology ;
- rdfs:label "DOAP Change Sets"@en ;
- dct:description "An ontology that extends DOAP to describe changesets."@en ;
- dct:created "2010-01-08"^^xsd:date ;
- dct:issued "2010-01-08"^^xsd:date ;
- dct:modified "2010-01-08"^^xsd:date ,
- "2010-01-27"^^xsd:date ,
- "2011-02-15"^^xsd:date , # dcs:Documentation, dcs:Packaging, dcs:SecurityFix, dcs:SecurityRegression
- "2012-04-25"^^xsd:date , # dcs:thanks
- "2012-06-20"^^xsd:date , # dcs:released-by
- "2013-09-03"^^xsd:date , # dcs:Tests, dcs:BackCompat
- "2015-01-15"^^xsd:date , # Syntax errors, add description
- "2015-04-05"^^xsd:date ; # use dcterms, trim imports (drobilla, for LV2)
- dct:creator <http://tobyinkster.co.uk/#i> .
-
-<>
- a foaf:Document ;
- foaf:primaryTopic dcs: .
-
-dcs:ChangeSet
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Change Set"@en ;
- rdfs:comment "A collection of changes. Not necessarily disjoint with foaf:Document!"@en ;
- rdfs:subClassOf rdf:Bag .
-
-dcs:ToDoList
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "To-Do List"@en ;
- rdfs:comment "A collection of planned changes."@en ;
- rdfs:subClassOf _:FutureChangeSet .
-
-dcs:WishList
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Wish List"@en ;
- rdfs:comment "A collection of desired changes."@en ;
- rdfs:subClassOf _:FutureChangeSet .
-
-dcs:Change
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Change"@en ;
- rdfs:comment "A change to something. Use rdfs:label to briefly describe the change. Use rdfs:comment for additional information."@en .
-
-dcs:Addition
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Addition"@en ;
- rdfs:comment "A change that added a new feature."@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:Removal
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Addition"@en ;
- rdfs:comment "A change that removed a feature."@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:Bugfix
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Bugfix"@en ;
- rdfs:comment "A change that fixed a problem with an existing feature."@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:Update
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Update"@en ;
- rdfs:comment "A change that brought a feature into compliance with policy or other changes in the external world."@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:Regression
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Regression"@en ;
- rdfs:comment "A change that caused a problem with an existing feature."@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:Documentation
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Documentation Change"@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:Packaging
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Packaging Change"@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:SecurityFix
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Security Fix"@en ;
- rdfs:comment "A change that fixed or improved a security problem."@en ;
- rdfs:subClassOf dcs:Change .
-
-dcs:SecurityRegression
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Security Regression"@en ;
- rdfs:comment "A change that created or worsened a security problem."@en ;
- rdfs:subClassOf dcs:Change , dcs:Regression .
-
-dcs:Tests
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Tests"@en ;
- rdfs:comment "A change to the test suite."@en ;
- rdfs:subClassOf dcs:Change.
-
-dcs:BackCompat
- a owl:Class ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "Backwards Compatibility"@en ;
- rdfs:comment "A change that breaks backwards compatibility, changing documented or tested behaviour."@en ;
- rdfs:subClassOf dcs:Change.
-
-_:FutureChangeSet
- a owl:Class ;
- rdfs:subClassOf rdf:Bag , dcs:ChangeSet .
-
-_:VersionOrEvent
- a owl:Class ;
- owl:unionOf (doap:Version event:Event) .
-
-dcs:changeset
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "change set"@en ;
- rdfs:comment "A change set may be associated with a particular software version in which those changes were released; or with an event which caused those changes."@en ;
- rdfs:domain _:VersionOrEvent ;
- rdfs:range dcs:ChangeSet .
-
-dcs:versus
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "versus"@en ;
- rdfs:comment "The previous version or event which a changeset has changed from."@en ;
- rdfs:domain dcs:ChangeSet ;
- rdfs:range _:VersionOrEvent .
-
-dcs:item
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "item"@en ;
- rdfs:comment "A change within a change set."@en ;
- rdfs:domain dcs:ChangeSet ;
- rdfs:range dcs:Change ;
- rdfs:subPropertyOf rdfs:member .
-
-dcs:file
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "file"@en ;
- rdfs:comment "A file involved in the change."@en ;
- rdfs:domain dcs:Change .
-
-dbug:Issue a rdfs:Class .
-
-dcs:fixes
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "fixes"@en ;
- rdfs:comment "A bug fixed by the change."@en ;
- rdfs:domain dcs:Bugfix ;
- rdfs:range dbug:Issue .
-
-dcs:implements
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "implements"@en ;
- rdfs:domain dcs:Addition ;
- rdfs:range doap:Specification .
-
-dcs:restores
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "restores"@en ;
- rdfs:comment "An association between a regression and a later bugfix that fixes it."@en ;
- rdfs:domain dcs:Bugfix ;
- rdfs:range dcs:Regression .
-
-dcs:blame
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:subPropertyOf dcs:thanks ;
- rdfs:label "blame"@en .
-
-dcs:thanks
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "thanks"@en ;
- rdfs:comment "More general than dcs:blame - could be used e.g. to indicate who financially sponsored a new feature."@en ;
- rdfs:domain dcs:Change ;
- rdfs:range foaf:Agent .
-
-dcs:checkin
- a owl:DatatypeProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "checkin"@en ;
- rdfs:comment "The identifier used by the project's version control system that records when this change was made."@en ;
- rdfs:domain dcs:Change ;
- rdfs:range xsd:string .
-
-dcs:milestone
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "milestone"@en ;
- rdfs:domain _:FutureChangeSet ;
- rdfs:range _:VersionOrEvent .
-
-dcs:tasks
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "tasks"@en ;
- rdfs:domain foaf:Agent ;
- rdfs:range dcs:ToDoList .
-
-dcs:wishes
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "wishes"@en ;
- rdfs:domain foaf:Person ;
- rdfs:range dcs:WishList .
-
-dcs:requires
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "requires"@en ;
- rdfs:comment "Indicates that the subject Change cannot/could not be completed without the object Change."@en ;
- rdfs:domain dcs:Change ;
- rdfs:range dcs:Change .
-
-dcs:timescale
- a owl:DatatypeProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "timescale"@en ;
- rdfs:comment "Human-readable description of the approximate time a change/feature should be complete by."@en ;
- rdfs:domain dcs:Change ;
- rdfs:range xsd:string .
-
-dcs:released-by
- a owl:ObjectProperty ;
- rdfs:isDefinedBy dcs: ;
- rdfs:label "released by"@en ;
- rdfs:domain doap:Version ;
- rdfs:range foaf:Person .
diff --git a/schemas.lv2/dct.ttl b/schemas.lv2/dcterms.ttl
index 5cdd504..d8fd196 100644
--- a/schemas.lv2/dct.ttl
+++ b/schemas.lv2/dcterms.ttl
@@ -22,8 +22,7 @@ dcterms:AgentClass
dcterms:description "Examples of Agent Class include groups seen as classes, such as students, women, charities, lecturers."@en-us ;
rdfs:comment "A group of agents."@en-us ;
rdfs:isDefinedBy dcterms: ;
- rdfs:label "Agent Class"@en-us ;
- rdfs:subClassOf dcterms:AgentClass .
+ rdfs:label "Agent Class"@en-us .
dcterms:LicenseDocument
a rdfs:Class ;
diff --git a/schemas.lv2/doap.ttl b/schemas.lv2/doap.ttl
index 9067da5..160cda5 100644
--- a/schemas.lv2/doap.ttl
+++ b/schemas.lv2/doap.ttl
@@ -1,23 +1,20 @@
+@prefix dcterms: <http://purl.org/dc/terms/> .
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix owl: <http://www.w3.org/2002/07/owl#> .
-@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix doap: <http://usefulinc.com/ns/doap#> .
-@prefix dct: <http://purl.org/dc/terms/> .
-
-# dct:rights "Copyright © 2004-2009 Edd Dumbill"
doap:
a owl:Ontology ;
- dct:description "Das Vokabular \"Description of a Project (DOAP)\", beschrieben durch W3C RDF Schema and the Web Ontology Language."@de ,
+ rdfs:comment "Das Vokabular \"Description of a Project (DOAP)\", beschrieben durch W3C RDF Schema and the Web Ontology Language."@de ,
"""El vocabulario Description of a Project (DOAP, Descripción de un Proyecto), descrito usando RDF Schema de W3C
y Web Ontology Language."""@es ,
"""Le vocabulaire Description Of A Project (DOAP, Description D'Un Projet),
décrit en utilisant RDF Schema du W3C et OWL."""@fr ,
"Slovník Description of a Project (DOAP, Popis projektu), popsaný použitím W3C RDF Schema a Web Ontology Language."@cs ,
"The Description of a Project (DOAP) vocabulary, described using W3C RDF Schema and the Web Ontology Language." ;
- dct:title "Description of a Project (DOAP) vocabulary" ;
+ dcterms:title "Description of a Project (DOAP) vocabulary" ;
owl:imports foaf: ;
foaf:maker [
a foaf:Person ;
@@ -153,8 +150,7 @@ doap:Specification
a rdfs:Class ;
rdfs:comment """A specification of a system's aspects, technical or otherwise."""@en ;
rdfs:isDefinedBy doap: ;
- rdfs:label "Specification"@en ;
- rdfs:subClassOf rdfs:Resource .
+ rdfs:label "Specification"@en .
doap:Version
a rdfs:Class ;
@@ -170,40 +166,25 @@ doap:Version
"Versión"@es ,
"Verze"@cs .
-doap:anon-root
- a rdf:Property ;
- rdfs:comment "Dépôt pour accès anonyme."@fr ,
- "Repositorio para acceso anónimo."@es ,
- "Repository for anonymous access."@en ,
- "Repository für anonymen Zugriff"@de ,
- "Úložiště pro anonymní přístup."@cs ;
- rdfs:domain doap:Repository ;
- rdfs:isDefinedBy doap: ;
- rdfs:label "Anonymes Root"@de ,
- "anonymní kořen"@cs ,
- "anonymous root"@en ,
- "racine anonyme"@fr ,
- "raíz anónima"@es ;
- rdfs:range rdfs:Literal .
-
doap:audience
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "Description of target user base"@en ;
rdfs:domain doap:Project ;
rdfs:isDefinedBy doap: ;
- rdfs:label "audience"@en ;
- rdfs:range rdfs:Literal .
+ rdfs:label "audience"@en .
doap:blog
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "URI of a blog related to a project"@en ;
rdfs:domain doap:Project ;
rdfs:isDefinedBy doap: ;
- rdfs:label "blog"@en ;
- rdfs:range rdfs:Resource .
+ rdfs:label "blog"@en .
doap:browse
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Interface web au dépôt."@fr ,
"Interface web del repositorio."@es ,
"Web browser interface to repository."@en ,
@@ -218,7 +199,8 @@ doap:browse
"visualiser"@fr .
doap:bug-database
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Bug tracker for a project."@en ,
"Bug tracker para un proyecto."@es ,
"Fehlerdatenbank eines Projektes."@de ,
@@ -233,7 +215,8 @@ doap:bug-database
"suivi des bugs"@fr .
doap:category
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "A category of project."@en ,
"Eine Kategorie eines Projektes."@de ,
"Kategorie projektu."@cs ,
@@ -248,7 +231,8 @@ doap:category
"kategorie"@cs .
doap:created
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "Date when something was created, in YYYY-MM-DD form. e.g. 2004-04-05"@en ,
"Date à laquelle a été créé quelque chose, au format AAAA-MM-JJ (par ex. 2004-04-05)"@fr ,
"Datum, kdy bylo něco vytvořeno ve formátu RRRR-MM-DD, např. 2004-04-05"@cs ,
@@ -259,11 +243,11 @@ doap:created
"created"@en ,
"créé"@fr ,
"erstellt"@de ,
- "vytvořeno"@cs ;
- rdfs:range rdfs:Literal .
+ "vytvořeno"@cs .
doap:description
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "Beschreibung eines Projekts als einfacher Text mit der Länge von 2 bis 4 Sätzen."@de ,
"Descripción en texto plano de un proyecto, de 2 a 4 enunciados de longitud."@es ,
"Plain text description of a project, of 2-4 sentences in length."@en ,
@@ -274,11 +258,11 @@ doap:description
"descripción"@es ,
"description"@en ,
"description"@fr ,
- "popis"@cs ;
- rdfs:range rdfs:Literal .
+ "popis"@cs .
doap:developer
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Desarrollador de software para el proyecto."@es ,
"Developer of software for the project."@en ,
"Développeur pour le projet."@fr ,
@@ -294,7 +278,8 @@ doap:developer
rdfs:range foaf:Person .
doap:documenter
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Collaborateur à la documentation du projet."@fr ,
"Contributor of documentation to the project."@en ,
"Mitarbeiter an der Dokumentation eines Projektes."@de ,
@@ -310,7 +295,8 @@ doap:documenter
rdfs:range foaf:Person .
doap:download-mirror
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Miroir de la page de téléchargement du programme."@fr ,
"Mirror de la página web de descarga."@es ,
"Mirror of software download web page."@en ,
@@ -325,7 +311,8 @@ doap:download-mirror
"zrcadlo stránky pro stažení"@cs .
doap:download-page
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Page web à partir de laquelle on peut télécharger le programme."@fr ,
"Página web de la cuál se puede bajar el software."@es ,
"Web page from which the project software can be downloaded."@en ,
@@ -340,7 +327,8 @@ doap:download-page
"stránka pro stažení"@cs .
doap:file-release
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "URI adresa stažení asociované s revizí."@cs ,
"URI of download associated with this release."@en ;
rdfs:domain doap:Version ;
@@ -349,7 +337,8 @@ doap:file-release
"soubor revize"@cs .
doap:helper
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Colaborador del proyecto."@es ,
"Collaborateur au projet."@fr ,
"Project contributor."@en ,
@@ -386,7 +375,8 @@ doap:homepage
rdfs:subPropertyOf foaf:homepage .
doap:implements
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "A specification that a project implements. Could be a standard, API or legally defined level of conformance."@en ;
rdfs:domain doap:Project ;
rdfs:isDefinedBy doap: ;
@@ -394,12 +384,12 @@ doap:implements
rdfs:range doap:Specification .
doap:language
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "ISO language code a project has been translated into"@en ;
rdfs:domain doap:Project ;
rdfs:isDefinedBy doap: ;
- rdfs:label "language"@en ;
- rdfs:range rdfs:Literal .
+ rdfs:label "language"@en .
doap:license
a rdf:Property ;
@@ -416,7 +406,8 @@ doap:license
"license"@en .
doap:location
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment """Emplacement d'un dépôt."""@fr ,
"Location of a repository."@en ,
"Lokation eines Repositorys."@de ,
@@ -431,7 +422,8 @@ doap:location
"umístění úložiště"@cs .
doap:mailing-list
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Domovská stránka nebo e–mailová adresa e–mailové diskuse."@cs ,
"Homepage der Mailing Liste oder E-Mail Adresse."@de ,
"Mailing list home page or email address."@en ,
@@ -446,7 +438,8 @@ doap:mailing-list
"mailing list"@en .
doap:maintainer
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Desarrollador principal de un proyecto, un líder de proyecto."@es ,
"""Développeur principal d'un projet, un meneur du projet."""@fr ,
"Hauptentwickler eines Projektes, der Projektleiter"@de ,
@@ -462,7 +455,8 @@ doap:maintainer
rdfs:range foaf:Person .
doap:module
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Jméno modulu v CVS, BitKeeper nebo Arch úložišti."@cs ,
"Modul-Name eines Subversion, CVS, BitKeeper oder Arch Repositorys."@de ,
"Module name of a Subversion, CVS, BitKeeper or Arch repository."@en ,
@@ -484,7 +478,8 @@ doap:module
"módulo"@es .
doap:name
- a rdf:Property ;
+ a rdf:Property ,
+ owl:AnnotationProperty ;
rdfs:comment "A name of something."@en ,
"Der Name von Irgendwas"@de ,
"El nombre de algo."@es ,
@@ -496,7 +491,6 @@ doap:name
"name"@en ,
"nom"@fr ,
"nombre"@es ;
- rdfs:range rdfs:Literal ;
rdfs:subPropertyOf rdfs:label .
doap:old-homepage
@@ -521,7 +515,8 @@ doap:old-homepage
rdfs:subPropertyOf foaf:homepage .
doap:os
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "Betriebssystem auf dem das Projekt eingesetzt werden kann. Diese Eigenschaft kann ausgelassen werden, wenn das Projekt nicht BS-spezifisch ist."@de ,
"Operating system that a project is limited to. Omit this property if the project is not OS-specific."@en ,
"Operační systém, na jehož použití je projekt limitován. Vynechejte tuto vlastnost, pokud je projekt nezávislý na operačním systému."@cs ,
@@ -536,20 +531,20 @@ doap:os
"operating system"@en ,
"operační systém"@cs ,
"sistema operativo"@es ,
- """système d'exploitation"""@fr ;
- rdfs:range rdfs:Literal .
+ """système d'exploitation"""@fr .
doap:platform
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "Indicator of software platform (non-OS specific), e.g. Java, Firefox, ECMA CLR"@en ;
rdfs:domain doap:Project ,
doap:Version ;
rdfs:isDefinedBy doap: ;
- rdfs:label "platform"@en ;
- rdfs:range rdfs:Literal .
+ rdfs:label "platform"@en .
doap:programming-language
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment """Langage de programmation avec lequel un projet est implémenté,
ou avec lequel il est prévu de l'utiliser."""@fr ,
"Lenguaje de programación en el que un proyecto es implementado o con el cuál pretende usarse."@es ,
@@ -562,11 +557,11 @@ doap:programming-language
"langage de programmation"@fr ,
"lenguaje de programación"@es ,
"programming language"@en ,
- "programovací jazyk"@cs ;
- rdfs:range rdfs:Literal .
+ "programovací jazyk"@cs .
doap:release
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "A project release."@en ,
"Ein Release (Version) eines Projekts."@de ,
"Relase (verze) projektu."@cs ,
@@ -582,7 +577,8 @@ doap:release
rdfs:range doap:Version .
doap:repository
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Dépôt du code source."@fr ,
"Quellcode-Versionierungssystem."@de ,
"Repositorio del código fuente."@es ,
@@ -598,7 +594,8 @@ doap:repository
rdfs:range doap:Repository .
doap:revision
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment """Identifiant de révision d'une release du programme."""@fr ,
"Identifikátor zpřístupněné revize softwaru."@cs ,
"Indentificador de la versión de un release de software."@es ,
@@ -610,11 +607,11 @@ doap:revision
"revision"@en ,
"révision"@fr ,
"versión"@es ,
- "verze"@cs ;
- rdfs:range rdfs:Literal .
+ "verze"@cs .
doap:screenshots
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment """Page web avec des captures d'écran du projet."""@fr ,
"Página web con capturas de pantalla del proyecto."@es ,
"Web page with screenshots of project."@en ,
@@ -629,15 +626,16 @@ doap:screenshots
"snímek obrazovky"@cs .
doap:service-endpoint
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "The URI of a web service endpoint where software as a service may be accessed"@en ;
rdfs:domain doap:Project ;
rdfs:isDefinedBy doap: ;
- rdfs:label "service endpoint"@en ;
- rdfs:range rdfs:Resource .
+ rdfs:label "service endpoint"@en .
doap:shortdesc
- a rdf:Property ;
+ a rdf:Property ,
+ owl:DatatypeProperty ;
rdfs:comment "Descripción corta (8 o 9 palabras) en texto plano de un proyecto."@es ,
"Krátký (8 nebo 9 slov) čistě textový popis projektu."@cs ,
"Kurzbeschreibung (8 oder 9 Wörter) eines Projects als einfacher Text."@de ,
@@ -648,11 +646,11 @@ doap:shortdesc
"descripción corta"@es ,
"description courte"@fr ,
"krátký popis"@cs ,
- "short description"@en ;
- rdfs:range rdfs:Literal .
+ "short description"@en .
doap:tester
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "A tester or other quality control contributor."@en ,
"Ein Tester oder anderer Mitarbeiter der Qualitätskontrolle."@de ,
"Tester nebo jiný spoluautor kontrolující kvalitu."@cs ,
@@ -668,7 +666,8 @@ doap:tester
rdfs:range foaf:Person .
doap:translator
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Collaborateur à la traduction du projet."@fr ,
"Contributor of translations to the project."@en ,
"Mitarbeiter an den Übersetzungen eines Projektes."@de ,
@@ -684,7 +683,8 @@ doap:translator
rdfs:range foaf:Person .
doap:vendor
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment "Vendor organization: commercial, free or otherwise"@en ;
rdfs:domain doap:Project ;
rdfs:isDefinedBy doap: ;
@@ -692,7 +692,8 @@ doap:vendor
rdfs:range foaf:Organization .
doap:wiki
- a rdf:Property ;
+ a rdf:Property ,
+ owl:ObjectProperty ;
rdfs:comment """L'URL du Wiki pour la discussion collaborative sur le projet."""@fr ,
"URL adresa wiki projektu pro společné diskuse."@cs ,
"URL del Wiki para discusión colaborativa del proyecto."@es ,
diff --git a/schemas.lv2/foaf.ttl b/schemas.lv2/foaf.ttl
index 1ae75aa..5aec41e 100644
--- a/schemas.lv2/foaf.ttl
+++ b/schemas.lv2/foaf.ttl
@@ -2,578 +2,610 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dct: <http://purl.org/dc/terms/> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
-<http://xmlns.com/foaf/0.1/>
- a owl:Ontology ;
- dct:description "The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language." ;
- dct:title "Friend of a Friend (FOAF) vocabulary" ;
+foaf:
+ a owl:Ontology ;
+ dcterms:description "The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language." ;
+ dcterms:title "Friend of a Friend (FOAF) vocabulary" ;
rdfs:comment "This version of the FOAF vocabulary has been slightly trimmed for LV2." .
foaf:Agent
- a rdfs:Class, owl:Class ;
- rdfs:comment "An agent (eg. person, group, software or physical artifact)." ;
- rdfs:label "Agent" ;
- owl:equivalentClass <http://purl.org/dc/terms/Agent> .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An agent (eg. person, group, software or physical artifact)." ;
+ rdfs:label "Agent" ;
+ owl:equivalentClass dcterms:Agent .
foaf:Document
- a rdfs:Class, owl:Class ;
- rdfs:comment "A document." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Document" ;
- owl:disjointWith foaf:Organization, foaf:Project .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "A document." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Document" ;
+ owl:disjointWith foaf:Organization ,
+ foaf:Project .
foaf:Group
- a rdfs:Class, owl:Class ;
- rdfs:comment "A class of Agents." ;
- rdfs:label "Group" ;
- rdfs:subClassOf foaf:Agent .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "A class of Agents." ;
+ rdfs:label "Group" ;
+ rdfs:subClassOf foaf:Agent .
foaf:Image
- a rdfs:Class, owl:Class ;
- rdfs:comment "An image." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Image" ;
- rdfs:subClassOf foaf:Document .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An image." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Image" ;
+ rdfs:subClassOf foaf:Document .
foaf:LabelProperty
- a rdfs:Class, owl:Class ;
- rdfs:comment "A foaf:LabelProperty is any RDF property with texual values that serve as labels." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Label Property" .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "A foaf:LabelProperty is any RDF property with textual values that serve as labels." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Label Property" .
foaf:OnlineAccount
- a rdfs:Class, owl:Class ;
- rdfs:comment "An online account." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Online Account" ;
- rdfs:subClassOf owl:Thing .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An online account." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Online Account" ;
+ rdfs:subClassOf owl:Thing .
foaf:OnlineChatAccount
- a rdfs:Class, owl:Class ;
- rdfs:comment "An online chat account." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Online Chat Account" ;
- rdfs:subClassOf foaf:OnlineAccount .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An online chat account." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Online Chat Account" ;
+ rdfs:subClassOf foaf:OnlineAccount .
foaf:OnlineEcommerceAccount
- a rdfs:Class, owl:Class ;
- rdfs:comment "An online e-commerce account." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Online E-commerce Account" ;
- rdfs:subClassOf foaf:OnlineAccount .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An online e-commerce account." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Online E-commerce Account" ;
+ rdfs:subClassOf foaf:OnlineAccount .
foaf:OnlineGamingAccount
- a rdfs:Class, owl:Class ;
- rdfs:comment "An online gaming account." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Online Gaming Account" ;
- rdfs:subClassOf foaf:OnlineAccount .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An online gaming account." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Online Gaming Account" ;
+ rdfs:subClassOf foaf:OnlineAccount .
foaf:Organization
- a rdfs:Class, owl:Class ;
- rdfs:comment "An organization." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Organization" ;
- rdfs:subClassOf foaf:Agent ;
- owl:disjointWith foaf:Document, foaf:Person .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "An organization." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Organization" ;
+ rdfs:subClassOf foaf:Agent ;
+ owl:disjointWith foaf:Document ,
+ foaf:Person .
foaf:Person
- a rdfs:Class, owl:Class ;
- rdfs:comment "A person." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Person" ;
- rdfs:subClassOf foaf:Agent ;
- owl:disjointWith foaf:Organization, foaf:Project .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "A person." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Person" ;
+ rdfs:subClassOf foaf:Agent ;
+ owl:disjointWith foaf:Organization ,
+ foaf:Project .
foaf:PersonalProfileDocument
- a rdfs:Class, owl:Class ;
- rdfs:comment "A personal profile RDF document." ;
- rdfs:label "PersonalProfileDocument" ;
- rdfs:subClassOf foaf:Document .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "A personal profile RDF document." ;
+ rdfs:label "PersonalProfileDocument" ;
+ rdfs:subClassOf foaf:Document .
foaf:Project
- a rdfs:Class, owl:Class ;
- rdfs:comment "A project (a collective endeavour of some kind)." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Project" ;
- owl:disjointWith foaf:Document, foaf:Person .
+ a rdfs:Class ,
+ owl:Class ;
+ rdfs:comment "A project (a collective endeavour of some kind)." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Project" ;
+ owl:disjointWith foaf:Document ,
+ foaf:Person .
foaf:account
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "Indicates an account held by this agent." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "account" ;
- rdfs:range foaf:OnlineAccount .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "Indicates an account held by this agent." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "account" ;
+ rdfs:range foaf:OnlineAccount .
foaf:accountName
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "Indicates the name (identifier) associated with this online account." ;
- rdfs:domain foaf:OnlineAccount ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "account name" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "Indicates the name (identifier) associated with this online account." ;
+ rdfs:domain foaf:OnlineAccount ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "account name" ;
+ rdfs:range rdfs:Literal .
foaf:accountServiceHomepage
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "Indicates a homepage of the service provide for this online account." ;
- rdfs:domain foaf:OnlineAccount ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "account service homepage" ;
- rdfs:range foaf:Document .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "Indicates a homepage of the service provide for this online account." ;
+ rdfs:domain foaf:OnlineAccount ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "account service homepage" ;
+ rdfs:range foaf:Document .
foaf:age
- a rdf:Property, owl:DatatypeProperty, owl:FunctionalProperty ;
- rdfs:comment "The age in years of some agent." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "age" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:FunctionalProperty ;
+ rdfs:comment "The age in years of some agent." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "age" ;
+ rdfs:range rdfs:Literal .
foaf:aimChatID
- a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;
- rdfs:comment "An AIM chat ID" ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "AIM chat ID" ;
- rdfs:range rdfs:Literal ;
- rdfs:subPropertyOf foaf:nick .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "An AIM chat ID" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "AIM chat ID" ;
+ rdfs:range rdfs:Literal ;
+ rdfs:subPropertyOf foaf:nick .
foaf:birthday
- a rdf:Property, owl:DatatypeProperty, owl:FunctionalProperty ;
- rdfs:comment "The birthday of this Agent, represented in mm-dd string form, eg. '12-31'." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "birthday" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:FunctionalProperty ;
+ rdfs:comment """The birthday of this Agent, represented in mm-dd string form, eg. '12-31'.""" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "birthday" ;
+ rdfs:range rdfs:Literal .
foaf:currentProject
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A current project this person works on." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "current project" ;
- rdfs:range owl:Thing .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A current project this person works on." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "current project" ;
+ rdfs:range owl:Thing .
foaf:depiction
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A depiction of some thing." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "depiction" ;
- rdfs:range foaf:Image ;
- owl:inverseOf foaf:depicts .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A depiction of some thing." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "depiction" ;
+ rdfs:range foaf:Image ;
+ owl:inverseOf foaf:depicts .
foaf:depicts
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A thing depicted in this representation." ;
- rdfs:domain foaf:Image ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "depicts" ;
- rdfs:range owl:Thing ;
- owl:inverseOf foaf:depiction .
-
-foaf:dnaChecksum
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A checksum for the DNA of some thing. Joke." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "DNA checksum" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A thing depicted in this representation." ;
+ rdfs:domain foaf:Image ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "depicts" ;
+ rdfs:range owl:Thing ;
+ owl:inverseOf foaf:depiction .
foaf:familyName
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "The family name of some person." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "familyName" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "The family name of some person." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "familyName" ;
+ rdfs:range rdfs:Literal .
foaf:firstName
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "The first name of a person." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "firstName" ;
- rdfs:range rdfs:Literal .
-
-foaf:fundedBy
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "An organization funding a project or person." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "funded by" ;
- rdfs:range owl:Thing .
-
-foaf:geekcode
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A textual geekcode for this person, see http://www.geekcode.com/geek.html" ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "geekcode" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "The first name of a person." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "firstName" ;
+ rdfs:range rdfs:Literal .
foaf:gender
- a rdf:Property, owl:DatatypeProperty, owl:FunctionalProperty ;
- rdfs:comment "The gender of this Agent (typically but not necessarily 'male' or 'female')." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "gender" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:FunctionalProperty ;
+ rdfs:comment """The gender of this Agent (typically but not necessarily 'male' or 'female').""" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "gender" ;
+ rdfs:range rdfs:Literal .
foaf:givenName
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "The given name of some person." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Given name" .
-
-foaf:givenname
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "The given name of some person." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Given name" .
-
-foaf:holdsAccount
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "Indicates an account held by this agent." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "account" ;
- rdfs:range foaf:OnlineAccount .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "The given name of some person." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Given name" .
foaf:homepage
- a rdf:Property, owl:InverseFunctionalProperty, owl:ObjectProperty ;
- rdfs:comment "A homepage for some thing." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "homepage" ;
- rdfs:range foaf:Document ;
- rdfs:subPropertyOf foaf:isPrimaryTopicOf, foaf:page .
+ a rdf:Property ,
+ owl:InverseFunctionalProperty ,
+ owl:ObjectProperty ;
+ rdfs:comment "A homepage for some thing." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "homepage" ;
+ rdfs:range foaf:Document ;
+ rdfs:subPropertyOf foaf:isPrimaryTopicOf ,
+ foaf:page .
foaf:icqChatID
- a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;
- rdfs:comment "An ICQ chat ID" ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "ICQ chat ID" ;
- rdfs:range rdfs:Literal ;
- rdfs:subPropertyOf foaf:nick .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "An ICQ chat ID" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "ICQ chat ID" ;
+ rdfs:range rdfs:Literal ;
+ rdfs:subPropertyOf foaf:nick .
foaf:img
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage)." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "image" ;
- rdfs:range foaf:Image ;
- rdfs:subPropertyOf foaf:depiction .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment """An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage).""" ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "image" ;
+ rdfs:range foaf:Image ;
+ rdfs:subPropertyOf foaf:depiction .
foaf:interest
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A page about a topic of interest to this person." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "interest" ;
- rdfs:range foaf:Document .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A page about a topic of interest to this person." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "interest" ;
+ rdfs:range foaf:Document .
foaf:isPrimaryTopicOf
- a rdf:Property, owl:InverseFunctionalProperty ;
- rdfs:comment "A document that this thing is the primary topic of." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "is primary topic of" ;
- rdfs:range foaf:Document ;
- rdfs:subPropertyOf foaf:page ;
- owl:inverseOf foaf:primaryTopic .
+ a rdf:Property ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "A document that this thing is the primary topic of." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "is primary topic of" ;
+ rdfs:range foaf:Document ;
+ rdfs:subPropertyOf foaf:page ;
+ owl:inverseOf foaf:primaryTopic .
foaf:jabberID
- a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;
- rdfs:comment "A jabber ID for something." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "jabber ID" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "A jabber ID for something." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "jabber ID" ;
+ rdfs:range rdfs:Literal .
foaf:knows
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A person known by this person (indicating some level of reciprocated interaction between the parties)." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "knows" ;
- rdfs:range foaf:Person .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A person known by this person (indicating some level of reciprocated interaction between the parties)." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "knows" ;
+ rdfs:range foaf:Person .
foaf:lastName
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "The last name of a person." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "lastName" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "The last name of a person." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "lastName" ;
+ rdfs:range rdfs:Literal .
foaf:logo
- a rdf:Property, owl:InverseFunctionalProperty, owl:ObjectProperty ;
- rdfs:comment "A logo representing some thing." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "logo" ;
- rdfs:range owl:Thing .
+ a rdf:Property ,
+ owl:InverseFunctionalProperty ,
+ owl:ObjectProperty ;
+ rdfs:comment "A logo representing some thing." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "logo" ;
+ rdfs:range owl:Thing .
foaf:made
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "Something that was made by this agent." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "made" ;
- rdfs:range owl:Thing ;
- owl:inverseOf foaf:maker .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "Something that was made by this agent." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "made" ;
+ rdfs:range owl:Thing ;
+ owl:inverseOf foaf:maker .
foaf:maker
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "An agent that made this thing." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "maker" ;
- rdfs:range foaf:Agent ;
- owl:equivalentProperty <http://purl.org/dc/terms/creator> ;
- owl:inverseOf foaf:made .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "An agent that made this thing." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "maker" ;
+ rdfs:range foaf:Agent ;
+ owl:equivalentProperty dcterms:creator ;
+ owl:inverseOf foaf:made .
foaf:mbox
- a rdf:Property, owl:InverseFunctionalProperty, owl:ObjectProperty ;
- rdfs:comment "A personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that there is (across time and change) at most one individual that ever has any particular value for foaf:mbox." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "personal mailbox" ;
- rdfs:range owl:Thing .
+ a rdf:Property ,
+ owl:InverseFunctionalProperty ,
+ owl:ObjectProperty ;
+ rdfs:comment """A personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that there is (across time and change) at most one individual that ever has any particular value for foaf:mbox.""" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "personal mailbox" ;
+ rdfs:range owl:Thing .
foaf:mbox_sha1sum
- a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;
- rdfs:comment "The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the first owner of the mailbox." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "sha1sum of a personal mailbox URI name" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the first owner of the mailbox." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "sha1sum of a personal mailbox URI name" ;
+ rdfs:range rdfs:Literal .
foaf:member
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "Indicates a member of a Group" ;
- rdfs:domain foaf:Group ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "member" ;
- rdfs:range foaf:Agent .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "Indicates a member of a Group" ;
+ rdfs:domain foaf:Group ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "member" ;
+ rdfs:range foaf:Agent .
foaf:membershipClass
- a rdf:Property, owl:AnnotationProperty ;
- rdfs:comment "Indicates the class of individuals that are a member of a Group" ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "membershipClass" .
+ a rdf:Property ,
+ owl:AnnotationProperty ;
+ rdfs:comment "Indicates the class of individuals that are a member of a Group" ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "membershipClass" .
foaf:msnChatID
- a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;
- rdfs:comment "An MSN chat ID" ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "MSN chat ID" ;
- rdfs:range rdfs:Literal ;
- rdfs:subPropertyOf foaf:nick .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "An MSN chat ID" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "MSN chat ID" ;
+ rdfs:range rdfs:Literal ;
+ rdfs:subPropertyOf foaf:nick .
foaf:myersBriggs
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A Myers Briggs (MBTI) personality classification." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "myersBriggs" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A Myers Briggs (MBTI) personality classification." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "myersBriggs" ;
+ rdfs:range rdfs:Literal .
foaf:name
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A name for some thing." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "name" ;
- rdfs:range rdfs:Literal ;
- rdfs:subPropertyOf rdfs:label .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A name for some thing." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "name" ;
+ rdfs:range rdfs:Literal ;
+ rdfs:subPropertyOf rdfs:label .
foaf:nick
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames)." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "nickname" .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames)." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "nickname" .
foaf:openid
- a rdf:Property, owl:InverseFunctionalProperty, owl:ObjectProperty ;
- rdfs:comment "An OpenID for an Agent." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "openid" ;
- rdfs:range foaf:Document ;
- rdfs:subPropertyOf foaf:isPrimaryTopicOf .
+ a rdf:Property ,
+ owl:InverseFunctionalProperty ,
+ owl:ObjectProperty ;
+ rdfs:comment "An OpenID for an Agent." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "openid" ;
+ rdfs:range foaf:Document ;
+ rdfs:subPropertyOf foaf:isPrimaryTopicOf .
foaf:page
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A page or document about this thing." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "page" ;
- rdfs:range foaf:Document ;
- owl:inverseOf foaf:topic .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A page or document about this thing." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "page" ;
+ rdfs:range foaf:Document ;
+ owl:inverseOf foaf:topic .
foaf:pastProject
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A project this person has previously worked on." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "past project" ;
- rdfs:range owl:Thing .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A project this person has previously worked on." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "past project" ;
+ rdfs:range owl:Thing .
foaf:phone
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A phone, specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel)." ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "phone" .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A phone, specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel)." ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "phone" .
foaf:plan
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A .plan comment, in the tradition of finger and '.plan' files." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "plan" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment """A .plan comment, in the tradition of finger and '.plan' files.""" ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "plan" ;
+ rdfs:range rdfs:Literal .
foaf:primaryTopic
- a rdf:Property, owl:FunctionalProperty, owl:ObjectProperty ;
- rdfs:comment "The primary topic of some page or document." ;
- rdfs:domain foaf:Document ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "primary topic" ;
- rdfs:range owl:Thing ;
- owl:inverseOf foaf:isPrimaryTopicOf .
+ a rdf:Property ,
+ owl:FunctionalProperty ,
+ owl:ObjectProperty ;
+ rdfs:comment "The primary topic of some page or document." ;
+ rdfs:domain foaf:Document ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "primary topic" ;
+ rdfs:range owl:Thing ;
+ owl:inverseOf foaf:isPrimaryTopicOf .
foaf:publications
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A link to the publications of this person." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "publications" ;
- rdfs:range foaf:Document .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A link to the publications of this person." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "publications" ;
+ rdfs:range foaf:Document .
foaf:schoolHomepage
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A homepage of a school attended by the person." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "schoolHomepage" ;
- rdfs:range foaf:Document .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A homepage of a school attended by the person." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "schoolHomepage" ;
+ rdfs:range foaf:Document .
foaf:sha1
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A sha1sum hash, in hex." ;
- rdfs:domain foaf:Document ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "sha1sum (hex)" .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A sha1sum hash, in hex." ;
+ rdfs:domain foaf:Document ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "sha1sum (hex)" .
foaf:skypeID
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A Skype ID" ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Skype ID" ;
- rdfs:range rdfs:Literal ;
- rdfs:subPropertyOf foaf:nick .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A Skype ID" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Skype ID" ;
+ rdfs:range rdfs:Literal ;
+ rdfs:subPropertyOf foaf:nick .
foaf:status
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "A string expressing what the user is happy for the general public (normally) to know about their current activity." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "status" ;
- rdfs:range rdfs:Literal .
-
-foaf:surname
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "The surname of some person." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Surname" ;
- rdfs:range rdfs:Literal .
-
-foaf:theme
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A theme." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "theme" ;
- rdfs:range owl:Thing .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A string expressing what the user is happy for the general public (normally) to know about their current activity." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "status" ;
+ rdfs:range rdfs:Literal .
foaf:thumbnail
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A derived thumbnail image." ;
- rdfs:domain foaf:Image ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "thumbnail" ;
- rdfs:range foaf:Image .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A derived thumbnail image." ;
+ rdfs:domain foaf:Image ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "thumbnail" ;
+ rdfs:range foaf:Image .
foaf:tipjar
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A tipjar document for this agent, describing means for payment and reward." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "tipjar" ;
- rdfs:range foaf:Document ;
- rdfs:subPropertyOf foaf:page .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A tipjar document for this agent, describing means for payment and reward." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "tipjar" ;
+ rdfs:range foaf:Document ;
+ rdfs:subPropertyOf foaf:page .
foaf:title
- a rdf:Property, owl:DatatypeProperty ;
- rdfs:comment "Title (Mr, Mrs, Ms, Dr. etc)" ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "title" .
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "Title (Mr, Mrs, Ms, Dr. etc)" ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "title" .
foaf:topic
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A topic of some page or document." ;
- rdfs:domain foaf:Document ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "topic" ;
- rdfs:range owl:Thing ;
- owl:inverseOf foaf:page .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A topic of some page or document." ;
+ rdfs:domain foaf:Document ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "topic" ;
+ rdfs:range owl:Thing ;
+ owl:inverseOf foaf:page .
foaf:topic_interest
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A thing of interest to this person." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "topic_interest" ;
- rdfs:range owl:Thing .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A thing of interest to this person." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "topic_interest" ;
+ rdfs:range owl:Thing .
foaf:weblog
- a rdf:Property, owl:InverseFunctionalProperty, owl:ObjectProperty ;
- rdfs:comment "A weblog of some thing (whether person, group, company etc.)." ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "weblog" ;
- rdfs:range foaf:Document ;
- rdfs:subPropertyOf foaf:page .
+ a rdf:Property ,
+ owl:InverseFunctionalProperty ,
+ owl:ObjectProperty ;
+ rdfs:comment "A weblog of some thing (whether person, group, company etc.)." ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "weblog" ;
+ rdfs:range foaf:Document ;
+ rdfs:subPropertyOf foaf:page .
foaf:workInfoHomepage
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A work info homepage of some person; a page about their work for some organization." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "work info homepage" ;
- rdfs:range foaf:Document .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A work info homepage of some person; a page about their work for some organization." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "work info homepage" ;
+ rdfs:range foaf:Document .
foaf:workplaceHomepage
- a rdf:Property, owl:ObjectProperty ;
- rdfs:comment "A workplace homepage of some person; the homepage of an organization they work for." ;
- rdfs:domain foaf:Person ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "workplace homepage" ;
- rdfs:range foaf:Document .
+ a rdf:Property ,
+ owl:ObjectProperty ;
+ rdfs:comment "A workplace homepage of some person; the homepage of an organization they work for." ;
+ rdfs:domain foaf:Person ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "workplace homepage" ;
+ rdfs:range foaf:Document .
foaf:yahooChatID
- a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;
- rdfs:comment "A Yahoo chat ID" ;
- rdfs:domain foaf:Agent ;
- rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> ;
- rdfs:label "Yahoo chat ID" ;
- rdfs:range rdfs:Literal ;
- rdfs:subPropertyOf foaf:nick .
+ a rdf:Property ,
+ owl:DatatypeProperty ,
+ owl:InverseFunctionalProperty ;
+ rdfs:comment "A Yahoo chat ID" ;
+ rdfs:domain foaf:Agent ;
+ rdfs:isDefinedBy foaf: ;
+ rdfs:label "Yahoo chat ID" ;
+ rdfs:range rdfs:Literal ;
+ rdfs:subPropertyOf foaf:nick .
diff --git a/schemas.lv2/manifest.ttl b/schemas.lv2/manifest.ttl
index 2dbcbd4..813d254 100644
--- a/schemas.lv2/manifest.ttl
+++ b/schemas.lv2/manifest.ttl
@@ -1,13 +1,9 @@
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-<http://ontologi.es/doap-changeset#>
- a owl:Ontology ;
- rdfs:seeAlso <dcs.ttl> .
-
<http://purl.org/dc/terms/>
a owl:Ontology ;
- rdfs:seeAlso <dct.ttl> .
+ rdfs:seeAlso <dcterms.ttl> .
<http://usefulinc.com/ns/doap#>
a owl:Ontology ;
@@ -21,7 +17,7 @@
a owl:Ontology ;
rdfs:seeAlso <owl.ttl> .
-<http://www.w3.org/2000/01/rdf-schema#>
+rdfs:
a owl:Ontology ;
rdfs:seeAlso <rdfs.ttl> .
diff --git a/schemas.lv2/meson.build b/schemas.lv2/meson.build
new file mode 100644
index 0000000..8a0d36b
--- /dev/null
+++ b/schemas.lv2/meson.build
@@ -0,0 +1,15 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+schema_data = files(
+ 'dcterms.ttl',
+ 'doap.ttl',
+ 'foaf.ttl',
+ 'manifest.ttl',
+ 'owl.ttl',
+ 'rdf.ttl',
+ 'rdfs.ttl',
+ 'xsd.ttl',
+)
+
+install_data(schema_data, install_dir: lv2dir / 'schemas.lv2')
diff --git a/schemas.lv2/owl.ttl b/schemas.lv2/owl.ttl
index 3f1c86e..e5f4fa2 100644
--- a/schemas.lv2/owl.ttl
+++ b/schemas.lv2/owl.ttl
@@ -2,12 +2,12 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
-@prefix dct: <http://purl.org/dc/terms/> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
<http://www.w3.org/2002/07/owl>
- dct:title "The OWL 2 Schema vocabulary (OWL 2)" ;
- a owl:Ontology ;
- rdfs:comment """
+ dcterms:title "The OWL 2 Schema vocabulary (OWL 2)" ;
+ a owl:Ontology ;
+ rdfs:comment """
This ontology partially describes the built-in classes and
properties that together form the basis of the RDF/XML syntax of OWL 2.
The content of this ontology is based on Tables 6.1 and 6.2
@@ -25,591 +25,596 @@
will cause it to become an OWL 2 Full ontology and may have other,
unexpected, consequences.
""" ;
- rdfs:isDefinedBy <http://www.w3.org/TR/owl2-mapping-to-rdf/>, <http://www.w3.org/TR/owl2-rdf-based-semantics/>, <http://www.w3.org/TR/owl2-syntax/> ;
- rdfs:seeAlso <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes>, <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties> ;
- owl:imports rdfs: ;
- owl:versionIRI <http://www.w3.org/2002/07/owl> ;
- owl:versionInfo "$Date: 2009/11/15 10:54:12 $" .
+ rdfs:isDefinedBy <http://www.w3.org/TR/owl2-mapping-to-rdf/> ,
+ <http://www.w3.org/TR/owl2-rdf-based-semantics/> ,
+ <http://www.w3.org/TR/owl2-syntax/> ;
+ rdfs:seeAlso <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes> ,
+ <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties> ;
+ owl:imports rdfs: ;
+ owl:versionIRI <http://www.w3.org/2002/07/owl> ;
+ owl:versionInfo "$Date: 2009/11/15 10:54:12 $" .
owl:AllDifferent
- a rdfs:Class ;
- rdfs:comment "The class of collections of pairwise different individuals." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "AllDifferent" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of collections of pairwise different individuals." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "AllDifferent" ;
+ rdfs:subClassOf rdfs:Resource .
owl:AllDisjointClasses
- a rdfs:Class ;
- rdfs:comment "The class of collections of pairwise disjoint classes." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "AllDisjointClasses" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of collections of pairwise disjoint classes." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "AllDisjointClasses" ;
+ rdfs:subClassOf rdfs:Resource .
owl:AllDisjointProperties
- a rdfs:Class ;
- rdfs:comment "The class of collections of pairwise disjoint properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "AllDisjointProperties" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of collections of pairwise disjoint properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "AllDisjointProperties" ;
+ rdfs:subClassOf rdfs:Resource .
owl:Annotation
- a rdfs:Class ;
- rdfs:comment "The class of annotated annotations for which the RDF serialization consists of an annotated subject, predicate and object." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Annotation" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of annotated annotations for which the RDF serialization consists of an annotated subject, predicate and object." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Annotation" ;
+ rdfs:subClassOf rdfs:Resource .
owl:AnnotationProperty
- a rdfs:Class ;
- rdfs:comment "The class of annotation properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "AnnotationProperty" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment "The class of annotation properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "AnnotationProperty" ;
+ rdfs:subClassOf rdf:Property .
owl:AsymmetricProperty
- a rdfs:Class ;
- rdfs:comment "The class of asymmetric properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "AsymmetricProperty" ;
- rdfs:subClassOf owl:ObjectProperty .
+ a rdfs:Class ;
+ rdfs:comment "The class of asymmetric properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "AsymmetricProperty" ;
+ rdfs:subClassOf owl:ObjectProperty .
owl:Axiom
- a rdfs:Class ;
- rdfs:comment "The class of annotated axioms for which the RDF serialization consists of an annotated subject, predicate and object." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Axiom" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of annotated axioms for which the RDF serialization consists of an annotated subject, predicate and object." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Axiom" ;
+ rdfs:subClassOf rdfs:Resource .
owl:Class
- a rdfs:Class ;
- rdfs:comment "The class of OWL classes." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Class" ;
- rdfs:subClassOf rdfs:Class .
+ a rdfs:Class ;
+ rdfs:comment "The class of OWL classes." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Class" ;
+ rdfs:subClassOf rdfs:Class .
owl:DatatypeProperty
- a rdfs:Class ;
- rdfs:comment "The class of data properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "DatatypeProperty" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment "The class of data properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "DatatypeProperty" ;
+ rdfs:subClassOf rdf:Property .
owl:DeprecatedClass
- a rdfs:Class ;
- rdfs:comment "The class of deprecated classes." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "DeprecatedClass" ;
- rdfs:subClassOf rdfs:Class .
+ a rdfs:Class ;
+ rdfs:comment "The class of deprecated classes." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "DeprecatedClass" ;
+ rdfs:subClassOf rdfs:Class .
owl:DeprecatedProperty
- a rdfs:Class ;
- rdfs:comment "The class of deprecated properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "DeprecatedProperty" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment "The class of deprecated properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "DeprecatedProperty" ;
+ rdfs:subClassOf rdf:Property .
owl:FunctionalProperty
- a rdfs:Class ;
- rdfs:comment "The class of functional properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "FunctionalProperty" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment "The class of functional properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "FunctionalProperty" ;
+ rdfs:subClassOf rdf:Property .
owl:InverseFunctionalProperty
- a rdfs:Class ;
- rdfs:comment "The class of inverse-functional properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "InverseFunctionalProperty" ;
- rdfs:subClassOf owl:ObjectProperty .
+ a rdfs:Class ;
+ rdfs:comment "The class of inverse-functional properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "InverseFunctionalProperty" ;
+ rdfs:subClassOf owl:ObjectProperty .
owl:IrreflexiveProperty
- a rdfs:Class ;
- rdfs:comment "The class of irreflexive properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "IrreflexiveProperty" ;
- rdfs:subClassOf owl:ObjectProperty .
+ a rdfs:Class ;
+ rdfs:comment "The class of irreflexive properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "IrreflexiveProperty" ;
+ rdfs:subClassOf owl:ObjectProperty .
owl:NamedIndividual
- a rdfs:Class ;
- rdfs:comment "The class of named individuals." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "NamedIndividual" ;
- rdfs:subClassOf owl:Thing .
+ a rdfs:Class ;
+ rdfs:comment "The class of named individuals." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "NamedIndividual" ;
+ rdfs:subClassOf owl:Thing .
owl:NegativePropertyAssertion
- a rdfs:Class ;
- rdfs:comment "The class of negative property assertions." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "NegativePropertyAssertion" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of negative property assertions." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "NegativePropertyAssertion" ;
+ rdfs:subClassOf rdfs:Resource .
owl:Nothing
- a owl:Class ;
- rdfs:comment "This is the empty class." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Nothing" ;
- rdfs:subClassOf owl:Thing .
+ a owl:Class ;
+ rdfs:comment "This is the empty class." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Nothing" ;
+ rdfs:subClassOf owl:Thing .
owl:ObjectProperty
- a rdfs:Class ;
- rdfs:comment "The class of object properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "ObjectProperty" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment "The class of object properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "ObjectProperty" ;
+ rdfs:subClassOf rdf:Property .
owl:Ontology
- a rdfs:Class ;
- rdfs:comment "The class of ontologies." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Ontology" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of ontologies." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Ontology" ;
+ rdfs:subClassOf rdfs:Resource .
owl:OntologyProperty
- a rdfs:Class ;
- rdfs:comment "The class of ontology properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "OntologyProperty" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment "The class of ontology properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "OntologyProperty" ;
+ rdfs:subClassOf rdf:Property .
owl:ReflexiveProperty
- a rdfs:Class ;
- rdfs:comment "The class of reflexive properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "ReflexiveProperty" ;
- rdfs:subClassOf owl:ObjectProperty .
+ a rdfs:Class ;
+ rdfs:comment "The class of reflexive properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "ReflexiveProperty" ;
+ rdfs:subClassOf owl:ObjectProperty .
owl:Restriction
- a rdfs:Class ;
- rdfs:comment "The class of property restrictions." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Restriction" ;
- rdfs:subClassOf owl:Class .
+ a rdfs:Class ;
+ rdfs:comment "The class of property restrictions." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Restriction" ;
+ rdfs:subClassOf owl:Class .
owl:SymmetricProperty
- a rdfs:Class ;
- rdfs:comment "The class of symmetric properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "SymmetricProperty" ;
- rdfs:subClassOf owl:ObjectProperty .
+ a rdfs:Class ;
+ rdfs:comment "The class of symmetric properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "SymmetricProperty" ;
+ rdfs:subClassOf owl:ObjectProperty .
owl:Thing
- a owl:Class ;
- rdfs:comment "The class of OWL individuals." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "Thing" .
+ a owl:Class ;
+ rdfs:comment "The class of OWL individuals." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "Thing" .
owl:TransitiveProperty
- a rdfs:Class ;
- rdfs:comment "The class of transitive properties." ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "TransitiveProperty" ;
- rdfs:subClassOf owl:ObjectProperty .
+ a rdfs:Class ;
+ rdfs:comment "The class of transitive properties." ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "TransitiveProperty" ;
+ rdfs:subClassOf owl:ObjectProperty .
owl:allValuesFrom
- a rdf:Property ;
- rdfs:comment "The property that determines the class that a universal property restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "all values from" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the class that a universal property restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "all values from" ;
+ rdfs:range rdfs:Class .
owl:annotatedProperty
- a rdf:Property ;
- rdfs:comment "The property that determines the predicate of an annotated axiom or annotated annotation." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "annotated property" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the predicate of an annotated axiom or annotated annotation." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "annotated property" ;
+ rdfs:range rdfs:Resource .
owl:annotatedSource
- a rdf:Property ;
- rdfs:comment "The property that determines the subject of an annotated axiom or annotated annotation." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "annotated source" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the subject of an annotated axiom or annotated annotation." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "annotated source" ;
+ rdfs:range rdfs:Resource .
owl:annotatedTarget
- a rdf:Property ;
- rdfs:comment "The property that determines the object of an annotated axiom or annotated annotation." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "annotated target" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the object of an annotated axiom or annotated annotation." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "annotated target" ;
+ rdfs:range rdfs:Resource .
owl:assertionProperty
- a rdf:Property ;
- rdfs:comment "The property that determines the predicate of a negative property assertion." ;
- rdfs:domain owl:NegativePropertyAssertion ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "assertion property" ;
- rdfs:range rdf:Property .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the predicate of a negative property assertion." ;
+ rdfs:domain owl:NegativePropertyAssertion ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "assertion property" ;
+ rdfs:range rdf:Property .
owl:backwardCompatibleWith
- a owl:AnnotationProperty, owl:OntologyProperty ;
- rdfs:comment "The annotation property that indicates that a given ontology is backward compatible with another ontology." ;
- rdfs:domain owl:Ontology ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "backward compatible with" ;
- rdfs:range owl:Ontology .
+ a owl:AnnotationProperty ,
+ owl:OntologyProperty ;
+ rdfs:comment "The annotation property that indicates that a given ontology is backward compatible with another ontology." ;
+ rdfs:domain owl:Ontology ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "backward compatible with" ;
+ rdfs:range owl:Ontology .
owl:bottomDataProperty
- a owl:DatatypeProperty ;
- rdfs:comment "The data property that does not relate any individual to any data value." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "bottom data property" ;
- rdfs:range rdfs:Literal .
+ a owl:DatatypeProperty ;
+ rdfs:comment "The data property that does not relate any individual to any data value." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "bottom data property" ;
+ rdfs:range rdfs:Literal .
owl:bottomObjectProperty
- a owl:ObjectProperty ;
- rdfs:comment "The object property that does not relate any two individuals." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "bottom object property" ;
- rdfs:range owl:Thing .
+ a owl:ObjectProperty ;
+ rdfs:comment "The object property that does not relate any two individuals." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "bottom object property" ;
+ rdfs:range owl:Thing .
owl:cardinality
- a rdf:Property ;
- rdfs:comment "The property that determines the cardinality of an exact cardinality restriction." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "cardinality" ;
- rdfs:range xsd:nonNegativeInteger .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the cardinality of an exact cardinality restriction." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "cardinality" ;
+ rdfs:range xsd:nonNegativeInteger .
owl:complementOf
- a rdf:Property ;
- rdfs:comment "The property that determines that a given class is the complement of another class." ;
- rdfs:domain owl:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "complement of" ;
- rdfs:range owl:Class .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that a given class is the complement of another class." ;
+ rdfs:domain owl:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "complement of" ;
+ rdfs:range owl:Class .
owl:datatypeComplementOf
- a rdf:Property ;
- rdfs:comment "The property that determines that a given data range is the complement of another data range with respect to the data domain." ;
- rdfs:domain rdfs:Datatype ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "datatype complement of" ;
- rdfs:range rdfs:Datatype .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that a given data range is the complement of another data range with respect to the data domain." ;
+ rdfs:domain rdfs:Datatype ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "datatype complement of" ;
+ rdfs:range rdfs:Datatype .
owl:deprecated
- a owl:AnnotationProperty ;
- rdfs:comment "The annotation property that indicates that a given entity has been deprecated." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "deprecated" ;
- rdfs:range rdfs:Resource .
+ a owl:AnnotationProperty ;
+ rdfs:comment "The annotation property that indicates that a given entity has been deprecated." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "deprecated" ;
+ rdfs:range rdfs:Resource .
owl:differentFrom
- a rdf:Property ;
- rdfs:comment "The property that determines that two given individuals are different." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "different from" ;
- rdfs:range owl:Thing .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given individuals are different." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "different from" ;
+ rdfs:range owl:Thing .
owl:disjointUnionOf
- a rdf:Property ;
- rdfs:comment "The property that determines that a given class is equivalent to the disjoint union of a collection of other classes." ;
- rdfs:domain owl:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "disjoint union of" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that a given class is equivalent to the disjoint union of a collection of other classes." ;
+ rdfs:domain owl:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "disjoint union of" ;
+ rdfs:range rdf:List .
owl:disjointWith
- a rdf:Property ;
- rdfs:comment "The property that determines that two given classes are disjoint." ;
- rdfs:domain owl:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "disjoint with" ;
- rdfs:range owl:Class .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given classes are disjoint." ;
+ rdfs:domain owl:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "disjoint with" ;
+ rdfs:range owl:Class .
owl:distinctMembers
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of pairwise different individuals in a owl:AllDifferent axiom." ;
- rdfs:domain owl:AllDifferent ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "distinct members" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of pairwise different individuals in a owl:AllDifferent axiom." ;
+ rdfs:domain owl:AllDifferent ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "distinct members" ;
+ rdfs:range rdf:List .
owl:equivalentClass
- a rdf:Property ;
- rdfs:comment "The property that determines that two given classes are equivalent, and that is used to specify datatype definitions." ;
- rdfs:domain rdfs:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "equivalent class" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given classes are equivalent, and that is used to specify datatype definitions." ;
+ rdfs:domain rdfs:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "equivalent class" ;
+ rdfs:range rdfs:Class .
owl:equivalentProperty
- a rdf:Property ;
- rdfs:comment "The property that determines that two given properties are equivalent." ;
- rdfs:domain rdf:Property ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "equivalent property" ;
- rdfs:range rdf:Property .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given properties are equivalent." ;
+ rdfs:domain rdf:Property ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "equivalent property" ;
+ rdfs:range rdf:Property .
owl:hasKey
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of properties that jointly build a key." ;
- rdfs:domain owl:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "has key" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of properties that jointly build a key." ;
+ rdfs:domain owl:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "has key" ;
+ rdfs:range rdf:List .
owl:hasSelf
- a rdf:Property ;
- rdfs:comment "The property that determines the property that a self restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "has self" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the property that a self restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "has self" ;
+ rdfs:range rdfs:Resource .
owl:hasValue
- a rdf:Property ;
- rdfs:comment "The property that determines the individual that a has-value restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "has value" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the individual that a has-value restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "has value" ;
+ rdfs:range rdfs:Resource .
owl:imports
- a owl:OntologyProperty ;
- rdfs:comment "The property that is used for importing other ontologies into a given ontology." ;
- rdfs:domain owl:Ontology ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "imports" ;
- rdfs:range owl:Ontology .
+ a owl:OntologyProperty ;
+ rdfs:comment "The property that is used for importing other ontologies into a given ontology." ;
+ rdfs:domain owl:Ontology ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "imports" ;
+ rdfs:range owl:Ontology .
owl:incompatibleWith
- a owl:AnnotationProperty, owl:OntologyProperty ;
- rdfs:comment "The annotation property that indicates that a given ontology is incompatible with another ontology." ;
- rdfs:domain owl:Ontology ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "incompatible with" ;
- rdfs:range owl:Ontology .
+ a owl:AnnotationProperty ,
+ owl:OntologyProperty ;
+ rdfs:comment "The annotation property that indicates that a given ontology is incompatible with another ontology." ;
+ rdfs:domain owl:Ontology ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "incompatible with" ;
+ rdfs:range owl:Ontology .
owl:intersectionOf
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of classes or data ranges that build an intersection." ;
- rdfs:domain rdfs:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "intersection of" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of classes or data ranges that build an intersection." ;
+ rdfs:domain rdfs:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "intersection of" ;
+ rdfs:range rdf:List .
owl:inverseOf
- a rdf:Property ;
- rdfs:comment "The property that determines that two given properties are inverse." ;
- rdfs:domain owl:ObjectProperty ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "inverse of" ;
- rdfs:range owl:ObjectProperty .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given properties are inverse." ;
+ rdfs:domain owl:ObjectProperty ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "inverse of" ;
+ rdfs:range owl:ObjectProperty .
owl:maxCardinality
- a rdf:Property ;
- rdfs:comment "The property that determines the cardinality of a maximum cardinality restriction." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "max cardinality" ;
- rdfs:range xsd:nonNegativeInteger .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the cardinality of a maximum cardinality restriction." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "max cardinality" ;
+ rdfs:range xsd:nonNegativeInteger .
owl:maxQualifiedCardinality
- a rdf:Property ;
- rdfs:comment "The property that determines the cardinality of a maximum qualified cardinality restriction." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "max qualified cardinality" ;
- rdfs:range xsd:nonNegativeInteger .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the cardinality of a maximum qualified cardinality restriction." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "max qualified cardinality" ;
+ rdfs:range xsd:nonNegativeInteger .
owl:members
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "members" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "members" ;
+ rdfs:range rdf:List .
owl:minCardinality
- a rdf:Property ;
- rdfs:comment "The property that determines the cardinality of a minimum cardinality restriction." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "min cardinality" ;
- rdfs:range xsd:nonNegativeInteger .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the cardinality of a minimum cardinality restriction." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "min cardinality" ;
+ rdfs:range xsd:nonNegativeInteger .
owl:minQualifiedCardinality
- a rdf:Property ;
- rdfs:comment "The property that determines the cardinality of a minimum qualified cardinality restriction." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "min qualified cardinality" ;
- rdfs:range xsd:nonNegativeInteger .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the cardinality of a minimum qualified cardinality restriction." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "min qualified cardinality" ;
+ rdfs:range xsd:nonNegativeInteger .
owl:onClass
- a rdf:Property ;
- rdfs:comment "The property that determines the class that a qualified object cardinality restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "on class" ;
- rdfs:range owl:Class .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the class that a qualified object cardinality restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "on class" ;
+ rdfs:range owl:Class .
owl:onDataRange
- a rdf:Property ;
- rdfs:comment "The property that determines the data range that a qualified data cardinality restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "on data range" ;
- rdfs:range rdfs:Datatype .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the data range that a qualified data cardinality restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "on data range" ;
+ rdfs:range rdfs:Datatype .
owl:onDatatype
- a rdf:Property ;
- rdfs:comment "The property that determines the datatype that a datatype restriction refers to." ;
- rdfs:domain rdfs:Datatype ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "on datatype" ;
- rdfs:range rdfs:Datatype .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the datatype that a datatype restriction refers to." ;
+ rdfs:domain rdfs:Datatype ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "on datatype" ;
+ rdfs:range rdfs:Datatype .
owl:onProperties
- a rdf:Property ;
- rdfs:comment "The property that determines the n-tuple of properties that a property restriction on an n-ary data range refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "on properties" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the n-tuple of properties that a property restriction on an n-ary data range refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "on properties" ;
+ rdfs:range rdf:List .
owl:onProperty
- a rdf:Property ;
- rdfs:comment "The property that determines the property that a property restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "on property" ;
- rdfs:range rdf:Property .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the property that a property restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "on property" ;
+ rdfs:range rdf:Property .
owl:oneOf
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of individuals or data values that build an enumeration." ;
- rdfs:domain rdfs:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "one of" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of individuals or data values that build an enumeration." ;
+ rdfs:domain rdfs:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "one of" ;
+ rdfs:range rdf:List .
owl:priorVersion
- a owl:AnnotationProperty, owl:OntologyProperty ;
- rdfs:comment "The annotation property that indicates the predecessor ontology of a given ontology." ;
- rdfs:domain owl:Ontology ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "prior version" ;
- rdfs:range owl:Ontology .
+ a owl:AnnotationProperty ,
+ owl:OntologyProperty ;
+ rdfs:comment "The annotation property that indicates the predecessor ontology of a given ontology." ;
+ rdfs:domain owl:Ontology ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "prior version" ;
+ rdfs:range owl:Ontology .
owl:propertyChainAxiom
- a rdf:Property ;
- rdfs:comment "The property that determines the n-tuple of properties that build a sub property chain of a given property." ;
- rdfs:domain owl:ObjectProperty ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "property chain axiom" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the n-tuple of properties that build a sub property chain of a given property." ;
+ rdfs:domain owl:ObjectProperty ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "property chain axiom" ;
+ rdfs:range rdf:List .
owl:propertyDisjointWith
- a rdf:Property ;
- rdfs:comment "The property that determines that two given properties are disjoint." ;
- rdfs:domain rdf:Property ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "property disjoint with" ;
- rdfs:range rdf:Property .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given properties are disjoint." ;
+ rdfs:domain rdf:Property ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "property disjoint with" ;
+ rdfs:range rdf:Property .
owl:qualifiedCardinality
- a rdf:Property ;
- rdfs:comment "The property that determines the cardinality of an exact qualified cardinality restriction." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "qualified cardinality" ;
- rdfs:range xsd:nonNegativeInteger .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the cardinality of an exact qualified cardinality restriction." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "qualified cardinality" ;
+ rdfs:range xsd:nonNegativeInteger .
owl:sameAs
- a rdf:Property ;
- rdfs:comment "The property that determines that two given individuals are equal." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "same as" ;
- rdfs:range owl:Thing .
+ a rdf:Property ;
+ rdfs:comment "The property that determines that two given individuals are equal." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "same as" ;
+ rdfs:range owl:Thing .
owl:someValuesFrom
- a rdf:Property ;
- rdfs:comment "The property that determines the class that an existential property restriction refers to." ;
- rdfs:domain owl:Restriction ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "some values from" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the class that an existential property restriction refers to." ;
+ rdfs:domain owl:Restriction ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "some values from" ;
+ rdfs:range rdfs:Class .
owl:sourceIndividual
- a rdf:Property ;
- rdfs:comment "The property that determines the subject of a negative property assertion." ;
- rdfs:domain owl:NegativePropertyAssertion ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "source individual" ;
- rdfs:range owl:Thing .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the subject of a negative property assertion." ;
+ rdfs:domain owl:NegativePropertyAssertion ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "source individual" ;
+ rdfs:range owl:Thing .
owl:targetIndividual
- a rdf:Property ;
- rdfs:comment "The property that determines the object of a negative object property assertion." ;
- rdfs:domain owl:NegativePropertyAssertion ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "target individual" ;
- rdfs:range owl:Thing .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the object of a negative object property assertion." ;
+ rdfs:domain owl:NegativePropertyAssertion ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "target individual" ;
+ rdfs:range owl:Thing .
owl:targetValue
- a rdf:Property ;
- rdfs:comment "The property that determines the value of a negative data property assertion." ;
- rdfs:domain owl:NegativePropertyAssertion ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "target value" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the value of a negative data property assertion." ;
+ rdfs:domain owl:NegativePropertyAssertion ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "target value" ;
+ rdfs:range rdfs:Literal .
owl:topDataProperty
- a owl:DatatypeProperty ;
- rdfs:comment "The data property that relates every individual to every data value." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "top data property" ;
- rdfs:range rdfs:Literal .
+ a owl:DatatypeProperty ;
+ rdfs:comment "The data property that relates every individual to every data value." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "top data property" ;
+ rdfs:range rdfs:Literal .
owl:topObjectProperty
- a owl:ObjectProperty ;
- rdfs:comment "The object property that relates every two individuals." ;
- rdfs:domain owl:Thing ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "top object property" ;
- rdfs:range owl:Thing .
+ a owl:ObjectProperty ;
+ rdfs:comment "The object property that relates every two individuals." ;
+ rdfs:domain owl:Thing ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "top object property" ;
+ rdfs:range owl:Thing .
owl:unionOf
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of classes or data ranges that build a union." ;
- rdfs:domain rdfs:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "union of" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of classes or data ranges that build a union." ;
+ rdfs:domain rdfs:Class ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "union of" ;
+ rdfs:range rdf:List .
owl:versionIRI
- a owl:OntologyProperty ;
- rdfs:comment "The property that identifies the version IRI of an ontology." ;
- rdfs:domain owl:Ontology ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "version IRI" ;
- rdfs:range owl:Ontology .
+ a owl:OntologyProperty ;
+ rdfs:comment "The property that identifies the version IRI of an ontology." ;
+ rdfs:domain owl:Ontology ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "version IRI" ;
+ rdfs:range owl:Ontology .
owl:versionInfo
- a owl:AnnotationProperty ;
- rdfs:comment "The annotation property that provides version information for an ontology or another OWL construct." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "version info" ;
- rdfs:range rdfs:Resource .
+ a owl:AnnotationProperty ;
+ rdfs:comment "The annotation property that provides version information for an ontology or another OWL construct." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "version info" ;
+ rdfs:range rdfs:Resource .
owl:withRestrictions
- a rdf:Property ;
- rdfs:comment "The property that determines the collection of facet-value pairs that define a datatype restriction." ;
- rdfs:domain rdfs:Datatype ;
- rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
- rdfs:label "with restrictions" ;
- rdfs:range rdf:List .
-
+ a rdf:Property ;
+ rdfs:comment "The property that determines the collection of facet-value pairs that define a datatype restriction." ;
+ rdfs:domain rdfs:Datatype ;
+ rdfs:isDefinedBy owl: ;
+ rdfs:label "with restrictions" ;
+ rdfs:range rdf:List .
diff --git a/schemas.lv2/rdf.ttl b/schemas.lv2/rdf.ttl
index a4dd8ef..0fdeed0 100644
--- a/schemas.lv2/rdf.ttl
+++ b/schemas.lv2/rdf.ttl
@@ -1,129 +1,128 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
-@prefix dct: <http://purl.org/dc/terms/> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
-<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
- dct:description "This is the RDF Schema for the RDF vocabulary defined in the RDF namespace." ;
- dct:title "The RDF Vocabulary (RDF)" ;
- a owl:Ontology ;
- rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
+rdf:
+ a owl:Ontology ;
+ dcterms:description "This is the RDF Schema for the RDF vocabulary defined in the RDF namespace." ;
+ dcterms:title "The RDF Vocabulary (RDF)" ;
+ rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
rdf:Alt
- a rdfs:Class ;
- rdfs:comment "The class of containers of alternatives." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "Alt" ;
- rdfs:subClassOf rdfs:Container .
+ a rdfs:Class ;
+ rdfs:comment "The class of containers of alternatives." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "Alt" ;
+ rdfs:subClassOf rdfs:Container .
rdf:Bag
- a rdfs:Class ;
- rdfs:comment "The class of unordered containers." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "Bag" ;
- rdfs:subClassOf rdfs:Container .
+ a rdfs:Class ;
+ rdfs:comment "The class of unordered containers." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "Bag" ;
+ rdfs:subClassOf rdfs:Container .
rdf:List
- a rdfs:Class ;
- rdfs:comment "The class of RDF Lists." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "List" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of RDF Lists." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "List" ;
+ rdfs:subClassOf rdfs:Resource .
rdf:PlainLiteral
- a rdfs:Datatype ;
- rdfs:comment "The class of plain (i.e. untyped) literal values." ;
- rdfs:isDefinedBy <http://www.w3.org/TR/rdf-plain-literal/> ;
- rdfs:label "Plain Literal" ;
- rdfs:subClassOf rdfs:Literal .
+ a rdfs:Datatype ;
+ rdfs:comment "The class of plain (i.e. untyped) literal values." ;
+ rdfs:isDefinedBy <http://www.w3.org/TR/rdf-plain-literal/> ;
+ rdfs:label "Plain Literal" ;
+ rdfs:subClassOf rdfs:Literal .
rdf:Property
- a rdfs:Class ;
- rdfs:comment "The class of RDF properties." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "Property" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of RDF properties." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "Property" ;
+ rdfs:subClassOf rdfs:Resource .
rdf:Seq
- a rdfs:Class ;
- rdfs:comment "The class of ordered containers." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "Seq" ;
- rdfs:subClassOf rdfs:Container .
+ a rdfs:Class ;
+ rdfs:comment "The class of ordered containers." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "Seq" ;
+ rdfs:subClassOf rdfs:Container .
rdf:Statement
- a rdfs:Class ;
- rdfs:comment "The class of RDF statements." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "Statement" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of RDF statements." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "Statement" ;
+ rdfs:subClassOf rdfs:Resource .
rdf:XMLLiteral
- a rdfs:Datatype ;
- rdfs:comment "The class of XML literal values." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "XML Literal" ;
- rdfs:subClassOf rdfs:Literal .
+ a rdfs:Datatype ;
+ rdfs:comment "The class of XML literal values." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "XML Literal" ;
+ rdfs:subClassOf rdfs:Literal .
rdf:first
- a rdf:Property ;
- rdfs:comment "The first item in the subject RDF list." ;
- rdfs:domain rdf:List ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "first" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The first item in the subject RDF list." ;
+ rdfs:domain rdf:List ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "first" ;
+ rdfs:range rdfs:Resource .
rdf:nil
- a rdf:List ;
- rdfs:comment "The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it." ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "nil" .
+ a rdf:List ;
+ rdfs:comment "The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it." ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "nil" .
rdf:object
- a rdf:Property ;
- rdfs:comment "The object of the subject RDF statement." ;
- rdfs:domain rdf:Statement ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "object" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The object of the subject RDF statement." ;
+ rdfs:domain rdf:Statement ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "object" ;
+ rdfs:range rdfs:Resource .
rdf:predicate
- a rdf:Property ;
- rdfs:comment "The predicate of the subject RDF statement." ;
- rdfs:domain rdf:Statement ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "predicate" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The predicate of the subject RDF statement." ;
+ rdfs:domain rdf:Statement ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "predicate" ;
+ rdfs:range rdfs:Resource .
rdf:rest
- a rdf:Property ;
- rdfs:comment "The rest of the subject RDF list after the first item." ;
- rdfs:domain rdf:List ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "rest" ;
- rdfs:range rdf:List .
+ a rdf:Property ;
+ rdfs:comment "The rest of the subject RDF list after the first item." ;
+ rdfs:domain rdf:List ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "rest" ;
+ rdfs:range rdf:List .
rdf:subject
- a rdf:Property ;
- rdfs:comment "The subject of the subject RDF statement." ;
- rdfs:domain rdf:Statement ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "subject" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "The subject of the subject RDF statement." ;
+ rdfs:domain rdf:Statement ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "subject" ;
+ rdfs:range rdfs:Resource .
rdf:type
- a rdf:Property ;
- rdfs:comment "The subject is an instance of a class." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "type" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "The subject is an instance of a class." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "type" ;
+ rdfs:range rdfs:Class .
rdf:value
- a rdf:Property ;
- rdfs:comment "Idiomatic property used for structured values." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
- rdfs:label "value" ;
- rdfs:range rdfs:Resource .
-
+ a rdf:Property ;
+ rdfs:comment "Idiomatic property used for structured values." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdf: ;
+ rdfs:label "value" ;
+ rdfs:range rdfs:Resource .
diff --git a/schemas.lv2/rdfs.ttl b/schemas.lv2/rdfs.ttl
index 078d7c8..09ba907 100644
--- a/schemas.lv2/rdfs.ttl
+++ b/schemas.lv2/rdfs.ttl
@@ -1,124 +1,123 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
-@prefix dct: <http://purl.org/dc/terms/> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
-<http://www.w3.org/2000/01/rdf-schema#>
- dct:title "The RDF Schema vocabulary (RDFS)" ;
- a owl:Ontology ;
- rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
+rdfs:
+ a owl:Ontology ;
+ dcterms:title "The RDF Schema vocabulary (RDFS)" ;
+ rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
rdfs:Class
- a rdfs:Class ;
- rdfs:comment "The class of classes." ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "Class" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of classes." ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "Class" ;
+ rdfs:subClassOf rdfs:Resource .
rdfs:Container
- a rdfs:Class ;
- rdfs:comment "The class of RDF containers." ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "Container" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of RDF containers." ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "Container" ;
+ rdfs:subClassOf rdfs:Resource .
rdfs:ContainerMembershipProperty
- a rdfs:Class ;
- rdfs:comment "The class of container membership properties, rdf:_1, rdf:_2, ..., all of which are sub-properties of 'member'." ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "Container Membership Property" ;
- rdfs:subClassOf rdf:Property .
+ a rdfs:Class ;
+ rdfs:comment """The class of container membership properties, rdf:_1, rdf:_2, ..., all of which are sub-properties of 'member'.""" ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "Container Membership Property" ;
+ rdfs:subClassOf rdf:Property .
rdfs:Datatype
- a rdfs:Class ;
- rdfs:comment "The class of RDF datatypes." ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "Datatype" ;
- rdfs:subClassOf rdfs:Class .
+ a rdfs:Class ;
+ rdfs:comment "The class of RDF datatypes." ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "Datatype" ;
+ rdfs:subClassOf rdfs:Class .
rdfs:Literal
- a rdfs:Class ;
- rdfs:comment "The class of literal values, eg. textual strings and integers." ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "Literal" ;
- rdfs:subClassOf rdfs:Resource .
+ a rdfs:Class ;
+ rdfs:comment "The class of literal values, eg. textual strings and integers." ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "Literal" ;
+ rdfs:subClassOf rdfs:Resource .
rdfs:Resource
- a rdfs:Class ;
- rdfs:comment "The class resource, everything." ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "Resource" .
+ a rdfs:Class ;
+ rdfs:comment "The class resource, everything." ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "Resource" .
rdfs:comment
- a rdf:Property ;
- rdfs:comment "A description of the subject resource." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "comment" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ;
+ rdfs:comment "A description of the subject resource." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "comment" ;
+ rdfs:range rdfs:Literal .
rdfs:domain
- a rdf:Property ;
- rdfs:comment "A domain of the subject property." ;
- rdfs:domain rdf:Property ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "domain" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "A domain of the subject property." ;
+ rdfs:domain rdf:Property ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "domain" ;
+ rdfs:range rdfs:Class .
rdfs:isDefinedBy
- a rdf:Property ;
- rdfs:comment "The defininition of the subject resource." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "is defined by" ;
- rdfs:range rdfs:Resource ;
- rdfs:subPropertyOf rdfs:seeAlso .
+ a rdf:Property ;
+ rdfs:comment "The definition of the subject resource." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "is defined by" ;
+ rdfs:range rdfs:Resource ;
+ rdfs:subPropertyOf rdfs:seeAlso .
rdfs:label
- a rdf:Property ;
- rdfs:comment "A human-readable name for the subject." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "label" ;
- rdfs:range rdfs:Literal .
+ a rdf:Property ;
+ rdfs:comment "A human-readable name for the subject." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "label" ;
+ rdfs:range rdfs:Literal .
rdfs:member
- a rdf:Property ;
- rdfs:comment "A member of the subject resource." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "member" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "A member of the subject resource." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "member" ;
+ rdfs:range rdfs:Resource .
rdfs:range
- a rdf:Property ;
- rdfs:comment "A range of the subject property." ;
- rdfs:domain rdf:Property ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "range" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "A range of the subject property." ;
+ rdfs:domain rdf:Property ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "range" ;
+ rdfs:range rdfs:Class .
rdfs:seeAlso
- a rdf:Property ;
- rdfs:comment "Further information about the subject resource." ;
- rdfs:domain rdfs:Resource ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "see also" ;
- rdfs:range rdfs:Resource .
+ a rdf:Property ;
+ rdfs:comment "Further information about the subject resource." ;
+ rdfs:domain rdfs:Resource ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "see also" ;
+ rdfs:range rdfs:Resource .
rdfs:subClassOf
- a rdf:Property ;
- rdfs:comment "The subject is a subclass of a class." ;
- rdfs:domain rdfs:Class ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "sub-class of" ;
- rdfs:range rdfs:Class .
+ a rdf:Property ;
+ rdfs:comment "The subject is a subclass of a class." ;
+ rdfs:domain rdfs:Class ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "sub-class of" ;
+ rdfs:range rdfs:Class .
rdfs:subPropertyOf
- a rdf:Property ;
- rdfs:comment "The subject is a subproperty of a property." ;
- rdfs:domain rdf:Property ;
- rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
- rdfs:label "sub-property of" ;
- rdfs:range rdf:Property .
-
+ a rdf:Property ;
+ rdfs:comment "The subject is a subproperty of a property." ;
+ rdfs:domain rdf:Property ;
+ rdfs:isDefinedBy rdfs: ;
+ rdfs:label "sub-property of" ;
+ rdfs:range rdf:Property .
diff --git a/schemas.lv2/xsd.ttl b/schemas.lv2/xsd.ttl
index 54d3ad8..38bae58 100644
--- a/schemas.lv2/xsd.ttl
+++ b/schemas.lv2/xsd.ttl
@@ -8,51 +8,14 @@ xsd:
rdfs:comment "XML Schema Datatypes" .
xsd:anySimpleType
- a rdfs:Datatype .
-
-xsd:ENTITY
- a rdfs:Datatype ;
- owl:onDatatype xsd:NCName .
-
-xsd:ID
- a rdfs:Datatype ;
- owl:onDatatype xsd:NCName .
-
-xsd:IDREF
a rdfs:Datatype ;
- owl:onDatatype xsd:NCName .
-
-xsd:NCName
- a rdfs:Datatype ;
- owl:onDatatype xsd:Name .
-
-xsd:NMTOKEN
- a rdfs:Datatype ;
- owl:onDatatype xsd:token .
-
-xsd:Name
- a rdfs:Datatype ;
- owl:onDatatype xsd:token .
-
-xsd:QName
- a rdfs:Datatype ;
- rdfs:label "XML qualified name" ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
+ rdfs:comment "The base class of any primitive XSD dataype." ;
+ rdfs:label "any simple type" .
xsd:anyURI
a rdfs:Datatype ;
- rdfs:label "URI reference" ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
+ rdfs:label "any URI" ;
+ owl:onDatatype xsd:anySimpleType .
xsd:base64Binary
a rdfs:Datatype ;
@@ -61,9 +24,7 @@ xsd:base64Binary
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "(([A-Za-z0-9+/] *[A-Za-z0-9+/] *[A-Za-z0-9+/] *[A-Za-z0-9+/] *)*(([A-Za-z0-9+/] *[A-Za-z0-9+/] *[A-Za-z0-9+/] *[A-Za-z0-9+/])|([A-Za-z0-9+/] *[A-Za-z0-9+/] *[AEIMQUYcgkosw048] *=)|([A-Za-z0-9+/] *[AQgw] *= *=)))?"
]
) .
@@ -73,9 +34,7 @@ xsd:boolean
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "(true|false)"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "(true|false|0|1)"
]
) .
@@ -85,9 +44,10 @@ xsd:byte
owl:onDatatype xsd:short ;
owl:withRestrictions (
[
- xsd:minInclusive -128
- ] [
- xsd:maxInclusive 127
+ xsd:maxInclusive "127"^^xsd:byte
+ ]
+ [
+ xsd:minInclusive "-128"^^xsd:byte
]
) .
@@ -97,9 +57,7 @@ xsd:date
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "-?[0-9][0-9][0-9][0-9][0-9]*-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|[-+][0-2][0-9]:[0-5][0-9])?"
]
) .
@@ -109,9 +67,7 @@ xsd:dateTime
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]+)?|(24:00:00(\\.0+)?))(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "-?[0-9][0-9][0-9][0-9][0-9]*-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([0-1][0-9])|(2[0-4])):[0-5][0-9]:[0-5][0-9](.[0-9]+)?(Z|[-+][0-2][0-9]:[0-5][0-9])?"
]
) .
@@ -122,9 +78,7 @@ xsd:decimal
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "[+-]?[0-9]*\\.?[0-9]*"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "-?INF|NaN|[+-]?(([0-9]+[.]?[0-9]*)|([0-9]*[.]?[0-9]+))([eE][-+]?[0-9]+)?"
]
) .
@@ -135,9 +89,7 @@ xsd:double
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "[+-]?[0-9]*\\.?[0-9]*([eE][-+]?[0-9]+)?"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "-?INF|NaN|[+-]?(([0-9]+[.]?[0-9]*)|([0-9]*[.]?[0-9]+))([eE][-+]?[0-9]+)?"
]
) .
@@ -147,6 +99,9 @@ xsd:duration
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
+ xsd:pattern "-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?)?"
+ ]
+ [
xsd:whiteSpace "collapse"
]
) .
@@ -158,64 +113,20 @@ xsd:float
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "[+-]?[0-9]*\\.?[0-9]*([eE][-+]?[0-9]+)?"
- ] [
+ xsd:pattern "-?INF|NaN|[+-]?(([0-9]+[.]?[0-9]*)|([0-9]*[.]?[0-9]+))([eE][-+]?[0-9]+)?"
+ ]
+ [
xsd:whiteSpace "collapse"
]
) .
xsd:fractionDigits
a rdf:Property ,
- owl:DatatypeProperty ;
+ owl:DatatypeProperty ;
rdfs:comment "The total number of digits to the right of the decimal point required to represent a value." ;
rdfs:label "fraction digits" ;
rdfs:range xsd:nonNegativeInteger .
-xsd:gDay
- a rdfs:Datatype ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
-
-xsd:gMonth
- a rdfs:Datatype ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
-
-xsd:gMonthDay
- a rdfs:Datatype ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
-
-xsd:gYear
- a rdfs:Datatype ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
-
-xsd:gYearMonth
- a rdfs:Datatype ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
-
xsd:hexBinary
a rdfs:Datatype ;
rdfs:comment "Hex-encoded arbitrary binary data." ;
@@ -223,9 +134,7 @@ xsd:hexBinary
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "[0-9A-F]*"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "([0-9A-Fa-f][0-9A-Fa-f])*"
]
) .
@@ -235,9 +144,10 @@ xsd:int
owl:onDatatype xsd:long ;
owl:withRestrictions (
[
- xsd:minInclusive -2147483648
- ] [
- xsd:maxInclusive 2147483647
+ xsd:maxInclusive "2147483647"^^xsd:int
+ ]
+ [
+ xsd:minInclusive "-2147483648"^^xsd:int
]
) .
@@ -248,7 +158,8 @@ xsd:integer
owl:withRestrictions (
[
xsd:pattern "[-+]?[0-9]+"
- ] [
+ ]
+ [
xsd:fractionDigits 0
]
) .
@@ -259,7 +170,7 @@ xsd:language
owl:onDatatype xsd:token ;
owl:withRestrictions (
[
- xsd:pattern "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"
+ xsd:pattern "[a-zA-Z][a-zA-Z]?[a-zA-Z]?[a-zA-Z]?[a-zA-Z]?[a-zA-Z]?[a-zA-Z]?[a-zA-Z]?(-[a-zA-Z0-9][a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]?[a-zA-Z0-9]?)*"
]
) .
@@ -269,33 +180,34 @@ xsd:long
owl:onDatatype xsd:integer ;
owl:withRestrictions (
[
- xsd:minInclusive -9223372036854775808
- ] [
- xsd:maxInclusive 9223372036854775807
+ xsd:maxInclusive "9223372036854775807"^^xsd:long
+ ]
+ [
+ xsd:minInclusive "-9223372036854775808"^^xsd:long
]
) .
xsd:maxExclusive
a rdf:Property ,
- owl:DatatypeProperty ;
+ owl:DatatypeProperty ;
rdfs:comment "The exclusive upper bound of an ordered datatype." ;
rdfs:label "max exclusive" .
xsd:maxInclusive
a rdf:Property ,
- owl:DatatypeProperty ;
+ owl:DatatypeProperty ;
rdfs:comment "The inclusive upper bound of an ordered datatype." ;
rdfs:label "max inclusive" .
xsd:minExclusive
a rdf:Property ,
- owl:DatatypeProperty ;
+ owl:DatatypeProperty ;
rdfs:comment "The exclusive lower bound of an ordered datatype." ;
rdfs:label "min exclusive" .
xsd:minInclusive
a rdf:Property ,
- owl:DatatypeProperty ;
+ owl:DatatypeProperty ;
rdfs:comment "The inclusive lower bound of an ordered datatype." ;
rdfs:label "min inclusive" .
@@ -315,8 +227,9 @@ xsd:nonNegativeInteger
owl:onDatatype xsd:integer ;
owl:withRestrictions (
[
- xsd:pattern "[0-9]*"
- ] [
+ xsd:pattern "[+]?[0-9]+"
+ ]
+ [
xsd:minInclusive 0
]
) .
@@ -328,7 +241,8 @@ xsd:nonPositiveInteger
owl:withRestrictions (
[
xsd:pattern "(0|-[0-9]+)"
- ] [
+ ]
+ [
xsd:maxInclusive 0
]
) .
@@ -337,42 +251,23 @@ xsd:normalizedString
a rdfs:Datatype ;
rdfs:comment "The set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters." ;
rdfs:label "normalized string" ;
- owl:onDatatype xsd:string ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "replace"
- ]
- ) .
+ owl:onDatatype xsd:string .
xsd:pattern
a rdf:Property ,
- owl:DatatypeProperty ;
+ owl:DatatypeProperty ;
rdfs:comment "A regular expression that matches complete valid literals." ;
rdfs:label "pattern" .
-xsd:whiteSpace
- a rdf:Property ,
- owl:DatatypeProperty ;
- rdfs:comment "A string that describes whitespace normalization for a string type." ;
- rdfs:label "white space" ;
- rdfs:range [
- a rdfs:Datatype ;
- owl:onDatatype xsd:string ;
- owl:withRestrictions (
- [
- xsd:pattern "(preserve|replace|collapse)"
- ]
- )
- ] .
-
xsd:positiveInteger
a rdfs:Datatype ;
rdfs:label "positive integer" ;
owl:onDatatype xsd:nonNegativeInteger ;
owl:withRestrictions (
[
- xsd:pattern "[+]?[0-9]+"
- ] [
+ xsd:pattern "[+]?[0-9]*[1-9]+[0-9]*"
+ ]
+ [
xsd:minInclusive 1
]
) .
@@ -383,9 +278,10 @@ xsd:short
owl:onDatatype xsd:int ;
owl:withRestrictions (
[
- xsd:minInclusive -32768
- ] [
- xsd:maxInclusive 32767
+ xsd:maxInclusive "32767"^^xsd:short
+ ]
+ [
+ xsd:minInclusive "-32768"^^xsd:short
]
) .
@@ -393,12 +289,7 @@ xsd:string
a rdfs:Datatype ;
rdfs:comment "A character string." ;
rdfs:label "string" ;
- owl:onDatatype xsd:anySimpleType ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "preserve"
- ]
- ) .
+ owl:onDatatype xsd:anySimpleType .
xsd:time
a rdfs:Datatype ;
@@ -406,9 +297,7 @@ xsd:time
owl:onDatatype xsd:anySimpleType ;
owl:withRestrictions (
[
- xsd:pattern "[1-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]"
- ] [
- xsd:whiteSpace "collapse"
+ xsd:pattern "(([0-1][0-9])|(2[0-4])):[0-5][0-9]:[0-5][0-9](.[0-9]+)?(Z|[-+][0-2][0-9]:[0-5][0-9])?"
]
) .
@@ -416,19 +305,7 @@ xsd:token
a rdfs:Datatype ;
rdfs:comment "The set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces." ;
rdfs:label "token" ;
- owl:onDatatype xsd:normalizedString ;
- owl:withRestrictions (
- [
- xsd:whiteSpace "collapse"
- ]
- ) .
-
-xsd:totalDigits
- a rdf:Property ,
- owl:DatatypeProperty ;
- rdfs:comment "The maximum number of decimal digits required to represent a value." ;
- rdfs:label "total digits" ;
- rdfs:range xsd:positiveInteger .
+ owl:onDatatype xsd:normalizedString .
xsd:unsignedByte
a rdfs:Datatype ;
@@ -436,7 +313,7 @@ xsd:unsignedByte
owl:onDatatype xsd:unsignedShort ;
owl:withRestrictions (
[
- xsd:maxInclusive 255
+ xsd:maxInclusive "255"^^xsd:unsignedByte
]
) .
@@ -446,7 +323,7 @@ xsd:unsignedInt
owl:onDatatype xsd:unsignedLong ;
owl:withRestrictions (
[
- xsd:maxInclusive 4294967295
+ xsd:maxInclusive "4294967295"^^xsd:unsignedInt
]
) .
@@ -456,7 +333,7 @@ xsd:unsignedLong
owl:onDatatype xsd:nonNegativeInteger ;
owl:withRestrictions (
[
- xsd:maxInclusive 18446744073709551615
+ xsd:maxInclusive "18446744073709551615"^^xsd:unsignedLong
]
) .
@@ -466,7 +343,21 @@ xsd:unsignedShort
owl:onDatatype xsd:unsignedInt ;
owl:withRestrictions (
[
- xsd:maxInclusive 65535
+ xsd:maxInclusive "65535"^^xsd:unsignedShort
]
) .
+xsd:whiteSpace
+ a rdf:Property ,
+ owl:DatatypeProperty ;
+ rdfs:comment "A string that describes whitespace normalization for a string type." ;
+ rdfs:label "white space" ;
+ rdfs:range [
+ a rdfs:Datatype ;
+ owl:onDatatype xsd:string ;
+ owl:withRestrictions (
+ [
+ xsd:pattern "(preserve|replace|collapse)"
+ ]
+ )
+ ] .
diff --git a/scripts/lv2_build_index.py b/scripts/lv2_build_index.py
new file mode 100755
index 0000000..6e4ebea
--- /dev/null
+++ b/scripts/lv2_build_index.py
@@ -0,0 +1,207 @@
+#!/usr/bin/env python3
+
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
+"""
+Write an HTML index for a set of LV2 specifications.
+"""
+
+import json
+import os
+import sys
+import argparse
+import subprocess
+
+import rdflib
+
+
+doap = rdflib.Namespace("http://usefulinc.com/ns/doap#")
+lv2 = rdflib.Namespace("http://lv2plug.in/ns/lv2core#")
+owl = rdflib.Namespace("http://www.w3.org/2002/07/owl#")
+rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
+
+
+def _subst_file(template_path, output_file, substitutions):
+ "Replace keys with values in a template file and write the result."
+
+ with open(template_path, "r", encoding="utf-8") as template:
+ for line in template:
+ for key, value in substitutions.items():
+ line = line.replace(key, value)
+
+ output_file.write(line)
+
+
+def _load_ttl(data_paths, exclude=None):
+ "Load an RDF model from a Turtle file."
+
+ model = rdflib.ConjunctiveGraph()
+ for path in data_paths:
+ if exclude is None or path not in exclude:
+ try:
+ model.parse(path, format="n3")
+ except SyntaxError as error:
+ sys.stderr.write(f"error: Failed to parse {path}\n")
+ raise error
+
+ return model
+
+
+def _warn(message):
+ "Load a warning message."
+
+ assert not message.startswith("warning: ")
+ assert not message.endswith("\n")
+ sys.stderr.write(message)
+ sys.stderr.write("\n")
+
+
+def _spec_target(spec, root, online=False):
+ "Return the relative link target for a specification."
+
+ target = spec.replace(root, "") if spec.startswith(root) else spec
+
+ return target if online else target + ".html"
+
+
+def _spec_link_columns(spec, root, name, online):
+ "Return the first two link columns in a spec row as an HTML string."
+
+ # Find relative link target and stem
+ target = _spec_target(spec, root, online)
+ stem = os.path.splitext(os.path.basename(target))[0]
+
+ # Prefix with a comment to act as a sort key for the row
+ col = f"<!-- {stem} -->"
+
+ # Specification
+ col += f'<td><a rel="rdfs:seeAlso" href="{target}">{name}</a></td>'
+
+ # API
+ col += '<td><a rel="rdfs:seeAlso"'
+ col += f' href="../c/html/group__{stem}.html">{name}'
+ col += "</a></td>"
+
+ return col
+
+
+def _spec_description_column(model, spec):
+ "Return the description column in a spec row as an HTML string."
+
+ shortdesc = model.value(spec, doap.shortdesc, None, any=False)
+
+ return "<td>" + str(shortdesc) + "</td>" if shortdesc else "<td></td>"
+
+
+def index_row(model, spec, root_uri, online):
+ "Return the row for a spec as an HTML string."
+
+ # Get version
+ minor = 0
+ micro = 0
+ try:
+ minor = int(model.value(spec, lv2.minorVersion, None, any=False))
+ micro = int(model.value(spec, lv2.microVersion, None, any=False))
+ except rdflib.exceptions.UniquenessError:
+ _warn(f"{spec} has no unique valid version")
+ return ""
+
+ row = "<tr>"
+
+ # Specification and API
+ row += _spec_link_columns(
+ spec,
+ root_uri,
+ model.value(spec, doap.name, None).replace("LV2 ", ""),
+ online,
+ )
+
+ # Description
+ row += _spec_description_column(model, spec)
+
+ # Version
+ row += f"<td>{minor}.{micro}</td>"
+
+ # Status
+ deprecated = model.value(spec, owl.deprecated, None)
+ deprecated = deprecated and str(deprecated) not in ["0", "false"]
+ if minor == 0:
+ row += '<td><span class="error">Experimental</span></td>'
+ elif deprecated:
+ row += '<td><span class="warning">Deprecated</span></td>'
+ elif micro % 2 == 0:
+ row += '<td><span class="success">Stable</span></td>'
+ else:
+ row += '<td><span class="warning">Development</span></td>'
+
+ row += "</tr>"
+
+ return row
+
+
+def build_index(
+ lv2_source_root,
+ lv2_version,
+ input_paths,
+ root_uri,
+ online,
+):
+ "Build the LV2 specification index and write it to stdout."
+
+ model = _load_ttl(input_paths)
+
+ rows = []
+ for spec in model.triples([None, rdf.type, lv2.Specification]):
+ rows += [index_row(model, spec[0], root_uri, online)]
+
+ _subst_file(
+ os.path.join(lv2_source_root, "doc", "index.html.in"),
+ sys.stdout,
+ {
+ "@ROWS@": "\n".join(sorted(rows)),
+ "@LV2_VERSION@": lv2_version,
+ },
+ )
+
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser(
+ usage="%(prog)s [OPTION]... INPUT_PATH...",
+ description=__doc__,
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+
+ ap.add_argument("--lv2-version", help="LV2 release version")
+ ap.add_argument("--lv2-source-root", help="path to LV2 source root")
+ ap.add_argument(
+ "--root-uri",
+ default="http://lv2plug.in/ns/",
+ help="root URI for specifications",
+ )
+ ap.add_argument(
+ "--online",
+ action="store_true",
+ default=False,
+ help="build online documentation",
+ )
+ ap.add_argument("input_paths", nargs="+", help="path to Turtle input file")
+
+ args = ap.parse_args(sys.argv[1:])
+
+ if args.lv2_version is None or args.lv2_source_root is None:
+ introspect_command = ["meson", "introspect", "-a"]
+ project_info = json.loads(
+ subprocess.check_output(introspect_command).decode("utf-8")
+ )
+
+ if args.lv2_version is None:
+ args.lv2_version = project_info["projectinfo"]["version"]
+
+ if args.lv2_source_root is None:
+ meson_build_path = project_info["buildsystem_files"][0]
+ args.lv2_source_root = os.path.relpath(
+ os.path.dirname(meson_build_path)
+ )
+
+ build_index(**vars(args))
diff --git a/scripts/lv2_check_specification.py b/scripts/lv2_check_specification.py
new file mode 100755
index 0000000..41611ef
--- /dev/null
+++ b/scripts/lv2_check_specification.py
@@ -0,0 +1,248 @@
+#!/usr/bin/env python3
+
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
+"""
+Check an LV2 specification for issues.
+"""
+
+import argparse
+import os
+import sys
+
+import rdflib
+
+foaf = rdflib.Namespace("http://xmlns.com/foaf/0.1/")
+lv2 = rdflib.Namespace("http://lv2plug.in/ns/lv2core#")
+owl = rdflib.Namespace("http://www.w3.org/2002/07/owl#")
+rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
+rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#")
+
+
+class Checker:
+ "A callable that checks conditions and records pass/fail counts."
+
+ def __init__(self, verbose=False):
+ self.num_checks = 0
+ self.num_errors = 0
+ self.verbose = verbose
+
+ def __call__(self, condition, name):
+ if not condition:
+ sys.stderr.write(f"error: Unmet condition: {name}\n")
+ self.num_errors += 1
+ elif self.verbose:
+ sys.stderr.write(f"note: {name}\n")
+
+ self.num_checks += 1
+ return condition
+
+ def print_summary(self):
+ "Print a summary (if verbose) when all checks are finished."
+
+ if self.verbose:
+ if self.num_errors:
+ sys.stderr.write(f"note: Failed {self.num_errors}/")
+ else:
+ sys.stderr.write("note: Passed all ")
+
+ sys.stderr.write(f"{self.num_checks} checks\n")
+
+
+def _check(condition, name):
+ "Check that condition is true, returning 1 on failure."
+
+ if not condition:
+ sys.stderr.write(f"error: Unmet condition: {name}\n")
+ return 1
+
+ return 0
+
+
+def _has_statement(model, pattern):
+ "Return true if model contains a triple matching pattern."
+
+ for _ in model.triples(pattern):
+ return True
+
+ return False
+
+
+def _has_property(model, subject, predicate):
+ "Return true if subject has any value for predicate in model."
+
+ return model.value(subject, predicate, None) is not None
+
+
+def _check_version(checker, model, spec, is_stable):
+ "Check that the version of a specification is present and valid."
+
+ minor = model.value(spec, lv2.minorVersion, None, any=False)
+ checker(minor is not None, f"{spec} has a lv2:minorVersion")
+
+ micro = model.value(spec, lv2.microVersion, None, any=False)
+ checker(micro is not None, f"{spec} has a lv2:microVersion")
+
+ if is_stable:
+ checker(int(minor) > 0, f"{spec} has a non-zero minor version")
+ checker(int(micro) % 2 == 0, f"{spec} has an even micro version")
+
+
+def _check_specification(checker, spec_dir, is_stable=False):
+ "Check all specification data for errors and omissions."
+
+ # Load manifest
+ manifest_path = os.path.join(spec_dir, "manifest.ttl")
+ model = rdflib.Graph()
+ model.parse(manifest_path, format="n3")
+
+ # Get the specification URI from the manifest
+ spec_uri = model.value(None, rdf.type, lv2.Specification, any=False)
+ if not checker(
+ spec_uri is not None,
+ manifest_path + " declares an lv2:Specification",
+ ):
+ return 1
+
+ # Check that the manifest declares a valid version
+ _check_version(checker, model, spec_uri, is_stable)
+
+ # Get the link to the main document from the manifest
+ document = model.value(spec_uri, rdfs.seeAlso, None, any=False)
+ if not checker(
+ document is not None,
+ manifest_path + " has one rdfs:seeAlso link to the definition",
+ ):
+ return 1
+
+ # Load main document into the model
+ model.parse(document, format="n3")
+
+ # Check that the main data files aren't bloated with extended documentation
+ checker(
+ not _has_statement(model, [None, lv2.documentation, None]),
+ f"{document} has no lv2:documentation",
+ )
+
+ # Load all other directly linked data files (for any other subjects)
+ for link in sorted(model.triples([None, rdfs.seeAlso, None])):
+ if link[2] != document and link[2].endswith(".ttl"):
+ model.parse(link[2], format="n3")
+
+ # Check that all properties have a more specific type
+ for typing in sorted(model.triples([None, rdf.type, rdf.Property])):
+ subject = typing[0]
+
+ checker(isinstance(subject, rdflib.term.URIRef), f"{subject} is a URI")
+
+ if str(subject) == "http://lv2plug.in/ns/ext/patch#value":
+ continue # patch:value is just a "promiscuous" rdf:Property
+
+ types = list(model.objects(subject, rdf.type))
+
+ checker(
+ (owl.DatatypeProperty in types)
+ or (owl.ObjectProperty in types)
+ or (owl.AnnotationProperty in types),
+ f"{subject} is a Datatype, Object, or Annotation property",
+ )
+
+ # Get all subjects that have an explicit rdf:type
+ typed_subjects = set()
+ for subject in model.subjects(rdf.type, None):
+ typed_subjects.add(subject)
+
+ # Check that all named and typed resources have labels and comments
+ for subject in typed_subjects:
+ if isinstance(
+ subject, rdflib.term.BNode
+ ) or foaf.Person in model.objects(subject, rdf.type):
+ continue
+
+ if checker(
+ _has_property(model, subject, rdfs.label),
+ f"{subject} has a rdfs:label",
+ ):
+ label = str(model.value(subject, rdfs.label, None))
+
+ checker(
+ not label.endswith("."),
+ f"{subject} label has no trailing '.'",
+ )
+ checker(
+ label.find("\n") == -1,
+ f"{subject} label is a single line",
+ )
+ checker(
+ label == label.strip(),
+ f"{subject} label has stripped whitespace",
+ )
+
+ if checker(
+ _has_property(model, subject, rdfs.comment),
+ f"{subject} has a rdfs:comment",
+ ):
+ comment = str(model.value(subject, rdfs.comment, None))
+
+ checker(
+ comment.endswith("."),
+ f"{subject} comment has a trailing '.'",
+ )
+ checker(
+ comment.find("\n") == -1 and comment.find("\r"),
+ f"{subject} comment is a single line",
+ )
+ checker(
+ comment == comment.strip(),
+ f"{subject} comment has stripped whitespace",
+ )
+
+ # Check that lv2:documentation, if present, is proper Markdown
+ documentation = model.value(subject, lv2.documentation, None)
+ if documentation is not None:
+ checker(
+ documentation.datatype == lv2.Markdown,
+ f"{subject} documentation is explicitly Markdown",
+ )
+ checker(
+ str(documentation).startswith("\n\n"),
+ f"{subject} documentation starts with blank line",
+ )
+ checker(
+ str(documentation).endswith("\n\n"),
+ f"{subject} documentation ends with blank line",
+ )
+
+ return checker.num_errors
+
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser(
+ usage="%(prog)s [OPTION]... BUNDLE",
+ description=__doc__,
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+
+ ap.add_argument(
+ "--stable",
+ action="store_true",
+ help="enable checks for stable release versions",
+ )
+
+ ap.add_argument(
+ "-v", "--verbose", action="store_true", help="print successful checks"
+ )
+
+ ap.add_argument(
+ "BUNDLE", help="path to specification bundle or manifest.ttl"
+ )
+
+ args = ap.parse_args(sys.argv[1:])
+
+ if os.path.basename(args.BUNDLE):
+ args.BUNDLE = os.path.dirname(args.BUNDLE)
+
+ sys.exit(
+ _check_specification(Checker(args.verbose), args.BUNDLE, args.stable)
+ )
diff --git a/scripts/lv2_check_syntax.py b/scripts/lv2_check_syntax.py
new file mode 100755
index 0000000..391e4e1
--- /dev/null
+++ b/scripts/lv2_check_syntax.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python3
+
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
+"""
+Check that a Turtle file has valid syntax and strict formatting.
+
+This is a strict tool that enforces machine formatting with serdi.
+"""
+
+import argparse
+import difflib
+import filecmp
+import sys
+import tempfile
+import os
+import subprocess
+
+
+def _show_diff(from_lines, to_lines, from_path, to_path):
+ "Show a diff between two files, returning non-zero if they differ."
+
+ differences = False
+ for line in difflib.unified_diff(
+ from_lines,
+ to_lines,
+ fromfile=from_path,
+ tofile=to_path,
+ ):
+ sys.stderr.write(line)
+ differences = True
+
+ return int(differences)
+
+
+def _check_file_equals(patha, pathb):
+ "Check that two files are equal, returning non-zero if they differ."
+
+ for path in (patha, pathb):
+ if not os.access(path, os.F_OK):
+ sys.stderr.write(f"error: missing file {path}")
+ return 1
+
+ if filecmp.cmp(patha, pathb, shallow=False):
+ return 0
+
+ with open(patha, "r", encoding="utf-8") as in_a:
+ with open(pathb, "r", encoding="utf-8") as in_b:
+ return _show_diff(in_a.readlines(), in_b.readlines(), patha, pathb)
+
+
+def run(serdi, filenames):
+ "Check that every file in filenames has valid formatted syntax."
+
+ status = 0
+
+ for filename in filenames:
+ rel_path = os.path.relpath(filename)
+ with tempfile.NamedTemporaryFile(mode="w", delete=False) as out:
+ out_name = out.name
+ command = [serdi, "-o", "turtle", rel_path]
+ subprocess.check_call(command, stdout=out)
+
+ if _check_file_equals(rel_path, out_name):
+ status = 1
+
+ os.remove(out_name)
+
+ return status
+
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser(
+ usage="%(prog)s [OPTION]... TURTLE_FILE...",
+ description=__doc__,
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+
+ ap.add_argument("--serdi", default="serdi", help="path to serdi")
+ ap.add_argument("TURTLE_FILE", nargs="+", help="input file to check")
+
+ args = ap.parse_args(sys.argv[1:])
+
+ sys.exit(run(args.serdi, args.TURTLE_FILE))
diff --git a/scripts/meson.build b/scripts/meson.build
new file mode 100644
index 0000000..1a77ab7
--- /dev/null
+++ b/scripts/meson.build
@@ -0,0 +1,8 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+lv2_scripts = files(
+ 'lv2_build_index.py',
+ 'lv2_check_specification.py',
+ 'lv2_check_syntax.py',
+)
diff --git a/test/.clang-tidy b/test/.clang-tidy
new file mode 100644
index 0000000..f6fe1d6
--- /dev/null
+++ b/test/.clang-tidy
@@ -0,0 +1,15 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+Checks: >
+ -*-else-after-return,
+ -bugprone-easily-swappable-parameters,
+ -bugprone-suspicious-include,
+ -cert-err33-c,
+ -clang-diagnostic-unused-parameter,
+ -cppcoreguidelines-avoid-non-const-global-variables,
+ -llvmlibc-implementation-in-namespace,
+ -misc-unused-parameters,
+ -modernize-use-trailing-return-type,
+ -readability-function-cognitive-complexity,
+InheritParentConfig: true
diff --git a/test/atom_test_utils.c b/test/atom_test_utils.c
new file mode 100644
index 0000000..e7d45d0
--- /dev/null
+++ b/test/atom_test_utils.c
@@ -0,0 +1,60 @@
+// Copyright 2012-2018 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#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 <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+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/test/cpp/.clang-tidy b/test/cpp/.clang-tidy
new file mode 100644
index 0000000..02d730c
--- /dev/null
+++ b/test/cpp/.clang-tidy
@@ -0,0 +1,26 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+Checks: >
+ -*-avoid-c-arrays,
+ -*-deprecated-headers,
+ -*-no-malloc,
+ -*-use-auto,
+ -bugprone-reserved-identifier,
+ -cert-dcl37-c,
+ -cert-dcl50-cpp,
+ -cert-dcl51-cpp,
+ -cppcoreguidelines-macro-usage,
+ -cppcoreguidelines-owning-memory,
+ -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
+ -cppcoreguidelines-pro-bounds-pointer-arithmetic,
+ -cppcoreguidelines-pro-type-cstyle-cast,
+ -cppcoreguidelines-pro-type-vararg,
+ -hicpp-no-array-decay,
+ -hicpp-vararg,
+ -llvmlibc-callee-namespace,
+ -modernize-use-nullptr,
+ -modernize-use-using,
+ -readability-implicit-bool-conversion,
+InheritParentConfig: true
+
diff --git a/test/cpp/test_build.cpp b/test/cpp/test_build.cpp
new file mode 100644
index 0000000..c8b2ca0
--- /dev/null
+++ b/test/cpp/test_build.cpp
@@ -0,0 +1,54 @@
+// Copyright 2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#if defined(__clang__)
+_Pragma("clang diagnostic push")
+_Pragma("clang diagnostic ignored \"-Wold-style-cast\"")
+_Pragma("clang diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
+#elif defined(__GNUC__)
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+#endif
+
+#include "lv2/atom/atom.h" // IWYU pragma: keep
+#include "lv2/atom/forge.h" // IWYU pragma: keep
+#include "lv2/atom/util.h" // IWYU pragma: keep
+#include "lv2/buf-size/buf-size.h" // IWYU pragma: keep
+#include "lv2/core/attributes.h" // IWYU pragma: keep
+#include "lv2/core/lv2.h" // IWYU pragma: keep
+#include "lv2/core/lv2_util.h" // IWYU pragma: keep
+#include "lv2/data-access/data-access.h" // IWYU pragma: keep
+#include "lv2/dynmanifest/dynmanifest.h" // IWYU pragma: keep
+#include "lv2/event/event-helpers.h" // IWYU pragma: keep
+#include "lv2/event/event.h" // IWYU pragma: keep
+#include "lv2/instance-access/instance-access.h" // IWYU pragma: keep
+#include "lv2/log/log.h" // IWYU pragma: keep
+#include "lv2/log/logger.h" // IWYU pragma: keep
+#include "lv2/midi/midi.h" // IWYU pragma: keep
+#include "lv2/morph/morph.h" // IWYU pragma: keep
+#include "lv2/options/options.h" // IWYU pragma: keep
+#include "lv2/parameters/parameters.h" // IWYU pragma: keep
+#include "lv2/patch/patch.h" // IWYU pragma: keep
+#include "lv2/port-groups/port-groups.h" // IWYU pragma: keep
+#include "lv2/port-props/port-props.h" // IWYU pragma: keep
+#include "lv2/presets/presets.h" // IWYU pragma: keep
+#include "lv2/resize-port/resize-port.h" // IWYU pragma: keep
+#include "lv2/state/state.h" // IWYU pragma: keep
+#include "lv2/time/time.h" // IWYU pragma: keep
+#include "lv2/ui/ui.h" // IWYU pragma: keep
+#include "lv2/units/units.h" // IWYU pragma: keep
+#include "lv2/uri-map/uri-map.h" // IWYU pragma: keep
+#include "lv2/urid/urid.h" // IWYU pragma: keep
+#include "lv2/worker/worker.h" // IWYU pragma: keep
+
+int
+main()
+{
+ return 0;
+}
+
+#if defined(__clang__)
+_Pragma("clang diagnostic pop")
+#elif defined(__GNUC__)
+_Pragma("GCC diagnostic pop")
+#endif
diff --git a/test/headers/.clang-tidy b/test/headers/.clang-tidy
new file mode 100644
index 0000000..dd0b95f
--- /dev/null
+++ b/test/headers/.clang-tidy
@@ -0,0 +1,22 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+Checks: >
+ *,
+ -*-magic-numbers,
+ -altera-*,
+ -bugprone-assignment-in-if-condition,
+ -bugprone-easily-swappable-parameters,
+ -bugprone-macro-parentheses,
+ -llvmlibc-restrict-system-libc-headers,
+ -modernize-macro-to-enum,
+ -performance-no-int-to-ptr,
+ -readability-identifier-length,
+CheckOptions:
+ - key: hicpp-uppercase-literal-suffix.NewSuffixes
+ value: L;U;f
+ - key: readability-uppercase-literal-suffix.NewSuffixes
+ value: L;U;f
+FormatStyle: file
+HeaderFilterRegex: 'lv2/.*\.h'
+WarningsAsErrors: '*'
diff --git a/test/headers/meson.build b/test/headers/meson.build
new file mode 100644
index 0000000..b1ec805
--- /dev/null
+++ b/test/headers/meson.build
@@ -0,0 +1,68 @@
+# Copyright 2020-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+header_c_suppressions = []
+
+if get_option('warning_level') == 'everything'
+ if cc.get_id() == 'clang'
+ header_c_suppressions += [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-declaration-after-statement',
+ '-Wno-padded',
+ '-Wno-unsafe-buffer-usage',
+ ]
+
+ if not meson.is_cross_build()
+ header_c_suppressions += [
+ '-Wno-poison-system-directories',
+ ]
+ endif
+
+ if host_machine.system() == 'windows'
+ header_c_suppressions += [
+ '-Wno-format-nonliteral',
+ ]
+ endif
+
+ elif cc.get_id() == 'gcc'
+ header_c_suppressions += [
+ '-Wno-cast-align',
+ '-Wno-cast-qual',
+ '-Wno-padded',
+ '-Wno-sign-conversion',
+ '-Wno-suggest-attribute=format',
+ '-Wno-unused-const-variable',
+ ]
+
+ if host_machine.system() == 'windows'
+ header_c_suppressions += [
+ '-Wno-sign-conversion',
+ ]
+ endif
+
+ elif cc.get_id() == 'msvc'
+ header_c_suppressions += [
+ '/wd4820', # padding added after construct
+ ]
+ endif
+endif
+
+if cc.get_id() == 'clang'
+ header_c_suppressions += [
+ '-Wno-nullability-extension',
+ ]
+endif
+
+header_c_suppressions = cc.get_supported_arguments(header_c_suppressions)
+
+test(
+ 'headers',
+ executable(
+ 'test_headers',
+ files('test_headers.c'),
+ c_args: header_c_suppressions,
+ dependencies: [lv2_dep],
+ ),
+ suite: 'unit',
+)
diff --git a/test/headers/test_headers.c b/test/headers/test_headers.c
new file mode 100644
index 0000000..5736b44
--- /dev/null
+++ b/test/headers/test_headers.c
@@ -0,0 +1,42 @@
+// Copyright 2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#include "lv2/atom/atom.h" // IWYU pragma: keep
+#include "lv2/atom/forge.h" // IWYU pragma: keep
+#include "lv2/atom/util.h" // IWYU pragma: keep
+#include "lv2/buf-size/buf-size.h" // IWYU pragma: keep
+#include "lv2/core/attributes.h" // IWYU pragma: keep
+#include "lv2/core/lv2.h" // IWYU pragma: keep
+#include "lv2/core/lv2_util.h" // IWYU pragma: keep
+#include "lv2/data-access/data-access.h" // IWYU pragma: keep
+#include "lv2/dynmanifest/dynmanifest.h" // IWYU pragma: keep
+#include "lv2/event/event-helpers.h" // IWYU pragma: keep
+#include "lv2/event/event.h" // IWYU pragma: keep
+#include "lv2/instance-access/instance-access.h" // IWYU pragma: keep
+#include "lv2/log/log.h" // IWYU pragma: keep
+#include "lv2/log/logger.h" // IWYU pragma: keep
+#include "lv2/midi/midi.h" // IWYU pragma: keep
+#include "lv2/morph/morph.h" // IWYU pragma: keep
+#include "lv2/options/options.h" // IWYU pragma: keep
+#include "lv2/parameters/parameters.h" // IWYU pragma: keep
+#include "lv2/patch/patch.h" // IWYU pragma: keep
+#include "lv2/port-groups/port-groups.h" // IWYU pragma: keep
+#include "lv2/port-props/port-props.h" // IWYU pragma: keep
+#include "lv2/presets/presets.h" // IWYU pragma: keep
+#include "lv2/resize-port/resize-port.h" // IWYU pragma: keep
+#include "lv2/state/state.h" // IWYU pragma: keep
+#include "lv2/time/time.h" // IWYU pragma: keep
+#include "lv2/ui/ui.h" // IWYU pragma: keep
+#include "lv2/units/units.h" // IWYU pragma: keep
+#include "lv2/uri-map/uri-map.h" // IWYU pragma: keep
+#include "lv2/urid/urid.h" // IWYU pragma: keep
+#include "lv2/worker/worker.h" // IWYU pragma: keep
+
+#ifdef __GNUC__
+__attribute__((const))
+#endif
+int
+main(void)
+{
+ return 0;
+}
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..4790a48
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,172 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+########
+# Data #
+########
+
+if get_option('lint')
+ # Check for spelling errors
+ codespell = find_program('codespell', required: get_option('tests'))
+ if codespell.found()
+ ignore = [
+ lv2_source_root / 'doc' / 'style' / 'pygments.css',
+ lv2_source_root / 'lv2specgen' / 'DTD',
+ lv2_source_root / 'schemas.lv2' / 'doap.ttl',
+ ]
+
+ test(
+ 'codespell',
+ codespell,
+ args: [
+ '-d',
+ ['-q', '3'],
+ ['-S', ','.join(ignore)],
+ lv2_source_root / 'doc',
+ lv2_source_root / 'lv2',
+ lv2_source_root / 'lv2specgen',
+ lv2_source_root / 'plugins',
+ lv2_source_root / 'schemas.lv2',
+ ],
+ suite: 'data',
+ )
+ endif
+
+ # Check that specification data is strictly formatted
+ serdi = find_program(
+ 'serdi',
+ required: get_option('tests'),
+ version: '>= 0.31.5',
+ )
+ native_build = (
+ not meson.is_cross_build()
+ and host_machine.system() != 'windows'
+ )
+ if serdi.found() and native_build
+ lv2_check_syntax = files(
+ lv2_source_root / 'scripts' / 'lv2_check_syntax.py',
+ )
+
+ test(
+ 'syntax',
+ lv2_check_syntax,
+ args: ['--serdi', serdi.full_path()] + spec_files + schema_data,
+ suite: 'data',
+ )
+ endif
+
+ # Check that specification data validates
+ sord_validate = find_program('sord_validate', required: get_option('tests'))
+ if sord_validate.found()
+ test('valid', sord_validate, args: spec_files + schema_data, suite: 'data')
+ endif
+endif
+
+########
+# Code #
+########
+
+# Check that all the headers compile cleanly in C
+test(
+ 'c',
+ executable(
+ 'test_build_c',
+ files('test_build.c'),
+ c_args: c_suppressions,
+ dependencies: [lv2_dep],
+ ),
+ suite: 'build',
+)
+
+# Check that all the headers compile cleanly in C++
+if is_variable('cpp')
+ test(
+ 'cpp',
+ executable(
+ 'test_build_cpp',
+ files('cpp/test_build.cpp'),
+ cpp_args: cpp_suppressions,
+ dependencies: [lv2_dep],
+ ),
+ suite: 'build',
+ )
+endif
+
+##########
+# Python #
+##########
+
+if get_option('lint')
+ # Scripts that don't pass with pylint
+ lax_python_scripts = files(
+ '../lv2specgen/lv2docgen.py',
+ '../lv2specgen/lv2specgen.py',
+ )
+
+ # Scripts that pass with everything including pylint
+ strict_python_scripts = lv2_scripts + files('../plugins/literasc.py')
+
+ all_python_scripts = lax_python_scripts + strict_python_scripts
+
+ # Check script formatting
+ black = find_program('black', required: get_option('tests'))
+ if black.found()
+ black_opts = ['-l', '79', '-q', '--check']
+ test(
+ 'black',
+ black,
+ args: black_opts + all_python_scripts,
+ suite: 'scripts',
+ )
+ endif
+
+ # Check scripts for errors with flake8
+ flake8 = find_program('flake8', required: get_option('tests'))
+ if flake8.found()
+ test('flake8', flake8, args: all_python_scripts, suite: 'scripts')
+ endif
+
+ # Check scripts for errors with pylint
+ pylint = find_program('pylint', required: get_option('tests'))
+ if pylint.found()
+ pymod = import('python')
+ lint_py = pymod.find_installation(
+ 'python3',
+ modules: ['pygments', 'rdflib'],
+ required: false,
+ )
+
+ if lint_py.found()
+ test('pylint', pylint, args: strict_python_scripts, suite: 'scripts')
+ endif
+ endif
+endif
+
+###################
+# Header Warnings #
+###################
+
+subdir('headers')
+
+##############
+# Unit Tests #
+##############
+
+test_names = [
+ 'atom',
+ 'forge_overflow',
+]
+
+# Build and run tests
+foreach test_name : test_names
+ test(
+ test_name,
+ executable(
+ test_name,
+ files('test_@0@.c'.format(test_name)),
+ c_args: c_suppressions,
+ dependencies: [lv2_dep],
+ ),
+ suite: 'unit',
+ )
+endforeach
diff --git a/test/test_atom.c b/test/test_atom.c
new file mode 100644
index 0000000..beac05c
--- /dev/null
+++ b/test/test_atom.c
@@ -0,0 +1,354 @@
+// Copyright 2012-2015 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#include "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 <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+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<Int>)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<Int>)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/test/test_build.c b/test/test_build.c
new file mode 100644
index 0000000..bdc47f6
--- /dev/null
+++ b/test/test_build.c
@@ -0,0 +1,39 @@
+// Copyright 2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#include "lv2/atom/atom.h" // IWYU pragma: keep
+#include "lv2/atom/forge.h" // IWYU pragma: keep
+#include "lv2/atom/util.h" // IWYU pragma: keep
+#include "lv2/buf-size/buf-size.h" // IWYU pragma: keep
+#include "lv2/core/attributes.h" // IWYU pragma: keep
+#include "lv2/core/lv2.h" // IWYU pragma: keep
+#include "lv2/core/lv2_util.h" // IWYU pragma: keep
+#include "lv2/data-access/data-access.h" // IWYU pragma: keep
+#include "lv2/dynmanifest/dynmanifest.h" // IWYU pragma: keep
+#include "lv2/event/event-helpers.h" // IWYU pragma: keep
+#include "lv2/event/event.h" // IWYU pragma: keep
+#include "lv2/instance-access/instance-access.h" // IWYU pragma: keep
+#include "lv2/log/log.h" // IWYU pragma: keep
+#include "lv2/log/logger.h" // IWYU pragma: keep
+#include "lv2/midi/midi.h" // IWYU pragma: keep
+#include "lv2/morph/morph.h" // IWYU pragma: keep
+#include "lv2/options/options.h" // IWYU pragma: keep
+#include "lv2/parameters/parameters.h" // IWYU pragma: keep
+#include "lv2/patch/patch.h" // IWYU pragma: keep
+#include "lv2/port-groups/port-groups.h" // IWYU pragma: keep
+#include "lv2/port-props/port-props.h" // IWYU pragma: keep
+#include "lv2/presets/presets.h" // IWYU pragma: keep
+#include "lv2/resize-port/resize-port.h" // IWYU pragma: keep
+#include "lv2/state/state.h" // IWYU pragma: keep
+#include "lv2/time/time.h" // IWYU pragma: keep
+#include "lv2/ui/ui.h" // IWYU pragma: keep
+#include "lv2/units/units.h" // IWYU pragma: keep
+#include "lv2/uri-map/uri-map.h" // IWYU pragma: keep
+#include "lv2/urid/urid.h" // IWYU pragma: keep
+#include "lv2/worker/worker.h" // IWYU pragma: keep
+
+int
+main(void)
+{
+ return 0;
+}
diff --git a/test/test_forge_overflow.c b/test/test_forge_overflow.c
new file mode 100644
index 0000000..95e9b87
--- /dev/null
+++ b/test/test_forge_overflow.c
@@ -0,0 +1,223 @@
+// Copyright 2019 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#include "atom_test_utils.c"
+
+#include "lv2/atom/atom.h"
+#include "lv2/atom/forge.h"
+#include "lv2/urid/urid.h"
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+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/util/lv2_validate.in b/util/lv2_validate.in
index d30cd85..c26bb30 100755
--- a/util/lv2_validate.in
+++ b/util/lv2_validate.in
@@ -1,5 +1,8 @@
#!/bin/sh
+# Copyright 2017-2020 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
LV2DIR="@LV2DIR@"
if [ "$#" -eq "0" ]; then
@@ -14,23 +17,15 @@ sord_validate \
"$LV2DIR/patch.lv2/manifest.ttl" \
"$LV2DIR/patch.lv2/patch.meta.ttl" \
"$LV2DIR/patch.lv2/patch.ttl" \
- "$LV2DIR/eg-amp.lv2/manifest.ttl" \
- "$LV2DIR/eg-amp.lv2/amp.ttl" \
- "$LV2DIR/eg-fifths.lv2/manifest.ttl" \
- "$LV2DIR/eg-fifths.lv2/fifths.ttl" \
"$LV2DIR/port-props.lv2/manifest.ttl" \
"$LV2DIR/port-props.lv2/port-props.meta.ttl" \
"$LV2DIR/port-props.lv2/port-props.ttl" \
- "$LV2DIR/eg-midigate.lv2/manifest.ttl" \
- "$LV2DIR/eg-midigate.lv2/midigate.ttl" \
"$LV2DIR/worker.lv2/worker.meta.ttl" \
"$LV2DIR/worker.lv2/manifest.ttl" \
"$LV2DIR/worker.lv2/worker.ttl" \
"$LV2DIR/buf-size.lv2/manifest.ttl" \
"$LV2DIR/buf-size.lv2/buf-size.meta.ttl" \
"$LV2DIR/buf-size.lv2/buf-size.ttl" \
- "$LV2DIR/eg-scope.lv2/manifest.ttl" \
- "$LV2DIR/eg-scope.lv2/examploscope.ttl" \
"$LV2DIR/midi.lv2/midi.meta.ttl" \
"$LV2DIR/midi.lv2/manifest.ttl" \
"$LV2DIR/midi.lv2/midi.ttl" \
@@ -55,8 +50,6 @@ sord_validate \
"$LV2DIR/port-groups.lv2/manifest.ttl" \
"$LV2DIR/port-groups.lv2/port-groups.ttl" \
"$LV2DIR/port-groups.lv2/port-groups.meta.ttl" \
- "$LV2DIR/eg-sampler.lv2/manifest.ttl" \
- "$LV2DIR/eg-sampler.lv2/sampler.ttl" \
"$LV2DIR/ui.lv2/manifest.ttl" \
"$LV2DIR/ui.lv2/ui.ttl" \
"$LV2DIR/ui.lv2/ui.meta.ttl" \
@@ -77,13 +70,9 @@ sord_validate \
"$LV2DIR/core.lv2/lv2core.doap.ttl" \
"$LV2DIR/core.lv2/meta.ttl" \
"$LV2DIR/core.lv2/people.ttl" \
- "$LV2DIR/eg-metro.lv2/manifest.ttl" \
- "$LV2DIR/eg-metro.lv2/metro.ttl" \
"$LV2DIR/presets.lv2/manifest.ttl" \
"$LV2DIR/presets.lv2/presets.ttl" \
"$LV2DIR/presets.lv2/presets.meta.ttl" \
- "$LV2DIR/eg-params.lv2/manifest.ttl" \
- "$LV2DIR/eg-params.lv2/params.ttl" \
"$LV2DIR/urid.lv2/manifest.ttl" \
"$LV2DIR/urid.lv2/urid.ttl" \
"$LV2DIR/urid.lv2/urid.meta.ttl" \
@@ -99,10 +88,9 @@ sord_validate \
"$LV2DIR/schemas.lv2/xsd.ttl" \
"$LV2DIR/schemas.lv2/manifest.ttl" \
"$LV2DIR/schemas.lv2/rdf.ttl" \
- "$LV2DIR/schemas.lv2/dct.ttl" \
+ "$LV2DIR/schemas.lv2/dcterms.ttl" \
"$LV2DIR/schemas.lv2/doap.ttl" \
"$LV2DIR/schemas.lv2/rdfs.ttl" \
- "$LV2DIR/schemas.lv2/dcs.ttl" \
"$LV2DIR/schemas.lv2/foaf.ttl" \
"$LV2DIR/schemas.lv2/owl.ttl" \
"$LV2DIR/uri-map.lv2/manifest.ttl" \
diff --git a/util/meson.build b/util/meson.build
new file mode 100644
index 0000000..58cf5e4
--- /dev/null
+++ b/util/meson.build
@@ -0,0 +1,12 @@
+# Copyright 2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+config = configuration_data({'LV2DIR': lv2dir})
+
+lv2_validate = configure_file(
+ configuration: config,
+ input: files('lv2_validate.in'),
+ install_dir: get_option('bindir'),
+ install_mode: 'rwxr-xr-x',
+ output: 'lv2_validate',
+)
diff --git a/waf b/waf
deleted file mode 100755
index 58d14c3..0000000
--- a/waf
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-
-# Minimal waf script for projects that include waflib directly
-
-import sys
-import inspect
-import os
-
-try:
- from waflib import Context, Scripting
-except Exception as e:
- sys.stderr.write('error: Failed to import waf (%s)\n' % e)
- if os.path.exists('.git'):
- sys.stderr.write("Are submodules up to date? "
- "Try 'git submodule update --init --recursive'\n")
-
- sys.exit(1)
-
-
-def main():
- script_path = os.path.abspath(inspect.getfile(inspect.getmodule(main)))
- project_path = os.path.dirname(os.path.realpath(script_path))
- Scripting.waf_entry_point(os.getcwd(), Context.WAFVERSION, project_path)
-
-
-if __name__ == '__main__':
- main()
diff --git a/waflib b/waflib
deleted file mode 160000
-Subproject 6321098e6b5b5c684d26a4de49c916733c5ea94
diff --git a/wscript b/wscript
deleted file mode 100644
index 081f031..0000000
--- a/wscript
+++ /dev/null
@@ -1,827 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import re
-import sys
-
-from waflib import Build, Context, Logs, Options, Scripting, Utils
-from waflib.extras import autowaf as autowaf
-
-# Mandatory waf variables
-APPNAME = 'lv2' # Package name for waf dist
-VERSION = '1.18.1' # Package version for waf dist
-top = '.' # Source directory
-out = 'build' # Build directory
-
-# Release variables
-title = 'LV2'
-uri = 'http://lv2plug.in/ns/lv2'
-dist_pattern = 'http://lv2plug.in/spec/lv2-%d.%d.%d.tar.bz2'
-post_tags = []
-
-# Links for documentation
-list_email = 'devel@lists.lv2plug.in'
-list_page = 'http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in'
-
-# Map of specification base name to old URI-style include path
-spec_map = {
- 'atom': 'lv2/lv2plug.in/ns/ext/atom',
- 'buf-size': 'lv2/lv2plug.in/ns/ext/buf-size',
- 'core': 'lv2/lv2plug.in/ns/lv2core',
- 'data-access': 'lv2/lv2plug.in/ns/ext/data-access',
- 'dynmanifest': 'lv2/lv2plug.in/ns/ext/dynmanifest',
- 'event': 'lv2/lv2plug.in/ns/ext/event',
- 'instance-access': 'lv2/lv2plug.in/ns/ext/instance-access',
- 'log': 'lv2/lv2plug.in/ns/ext/log',
- 'midi': 'lv2/lv2plug.in/ns/ext/midi',
- 'morph': 'lv2/lv2plug.in/ns/ext/morph',
- 'options': 'lv2/lv2plug.in/ns/ext/options',
- 'parameters': 'lv2/lv2plug.in/ns/ext/parameters',
- 'patch': 'lv2/lv2plug.in/ns/ext/patch',
- 'port-groups': 'lv2/lv2plug.in/ns/ext/port-groups',
- 'port-props': 'lv2/lv2plug.in/ns/ext/port-props',
- 'presets': 'lv2/lv2plug.in/ns/ext/presets',
- 'resize-port': 'lv2/lv2plug.in/ns/ext/resize-port',
- 'state': 'lv2/lv2plug.in/ns/ext/state',
- 'time': 'lv2/lv2plug.in/ns/ext/time',
- 'ui': 'lv2/lv2plug.in/ns/extensions/ui',
- 'units': 'lv2/lv2plug.in/ns/extensions/units',
- 'uri-map': 'lv2/lv2plug.in/ns/ext/uri-map',
- 'urid': 'lv2/lv2plug.in/ns/ext/urid',
- 'worker': 'lv2/lv2plug.in/ns/ext/worker'}
-
-
-def options(ctx):
- ctx.load('compiler_c')
- ctx.load('compiler_cxx')
- ctx.load('lv2')
- ctx.add_flags(
- ctx.configuration_options(),
- {'no-coverage': 'Do not use gcov for code coverage',
- 'online-docs': 'Build documentation for web hosting',
- 'no-check-links': 'Do not check documentation for broken links',
- 'no-plugins': 'Do not build example plugins',
- 'copy-headers': 'Copy headers instead of linking to bundle'})
-
-
-def configure(conf):
- try:
- conf.load('compiler_c', cache=True)
- except Exception:
- Options.options.build_tests = False
- Options.options.no_plugins = True
-
- try:
- conf.load('compiler_cxx', cache=True)
- except Exception:
- pass
-
- if Options.options.online_docs:
- Options.options.docs = True
-
- conf.load('lv2', cache=True)
- conf.load('autowaf', cache=True)
- autowaf.set_c_lang(conf, 'c99')
-
- if Options.options.strict:
- # Check for programs used by lint target
- conf.find_program("flake8", var="FLAKE8", mandatory=False)
- conf.find_program("clang-tidy", var="CLANG_TIDY", mandatory=False)
- conf.find_program("iwyu_tool", var="IWYU_TOOL", mandatory=False)
-
- if Options.options.ultra_strict:
- autowaf.add_compiler_flags(conf.env, 'c', {
- 'gcc': [
- '-Wno-bad-function-cast',
- ],
- 'clang': [
- '-Wno-bad-function-cast',
- ]
- })
-
- autowaf.add_compiler_flags(conf.env, '*', {
- 'clang': [
- '-Wno-cast-align',
- '-Wno-cast-qual',
- '-Wno-documentation-unknown-command',
- '-Wno-double-promotion',
- '-Wno-float-conversion',
- '-Wno-float-equal',
- '-Wno-implicit-float-conversion',
- '-Wno-padded',
- '-Wno-reserved-id-macro',
- '-Wno-shorten-64-to-32',
- '-Wno-sign-conversion',
- '-Wno-switch-enum',
- '-Wno-unused-parameter',
- ],
- 'gcc': [
- '-Wno-cast-align',
- '-Wno-cast-qual',
- '-Wno-conversion',
- '-Wno-double-promotion',
- '-Wno-float-equal',
- '-Wno-inline',
- '-Wno-padded',
- '-Wno-parentheses',
- '-Wno-suggest-attribute=const',
- '-Wno-suggest-attribute=malloc',
- '-Wno-suggest-attribute=pure',
- '-Wno-switch-enum',
- '-Wno-unused-parameter',
- ],
- 'msvc': [
- '/wd4061', # enumerator in switch is not explicitly handled
- '/wd4100', # unreferenced formal parameter
- '/wd4244', # conversion with possible loss of data
- '/wd4267', # conversion from size_t to a smaller type
- '/wd4310', # cast truncates constant value
- '/wd4365', # signed/unsigned mismatch
- '/wd4464', # relative include path contains ".."
- '/wd4514', # unreferenced inline function has been removed
- '/wd4706', # assignment within conditional expression
- '/wd4710', # function not inlined
- '/wd4711', # function selected for automatic inline expansion
- '/wd4820', # padding added after construct
- '/wd5045', # will insert Spectre mitigation for memory load
- ]
- })
-
- autowaf.add_compiler_flags(conf.env, 'cxx', {
- 'gcc': [
- '-Wno-useless-cast',
- '-Wno-zero-as-null-pointer-constant',
- ],
- 'clang': [
- '-Wno-old-style-cast',
- '-Wno-zero-as-null-pointer-constant',
- ]
- })
-
- if 'mingw' in conf.env.CC[0]:
- autowaf.add_compiler_flags(conf.env, '*', {
- 'gcc': [
- '-Wno-format',
- '-Wno-suggest-attribute=format',
- ],
- })
-
- if conf.env.DEST_OS == 'win32' or not hasattr(os.path, 'relpath'):
- Logs.warn('System does not support linking headers, copying')
- Options.options.copy_headers = True
-
- conf.env.BUILD_TESTS = Options.options.build_tests
- conf.env.BUILD_PLUGINS = not Options.options.no_plugins
- conf.env.COPY_HEADERS = Options.options.copy_headers
- conf.env.ONLINE_DOCS = Options.options.online_docs
-
- if conf.env.DOCS or conf.env.ONLINE_DOCS:
- try:
- conf.find_program('asciidoc')
- conf.env.BUILD_BOOK = True
- except Exception:
- Logs.warn('Asciidoc not found, book will not be built')
-
- if not Options.options.no_check_links:
- if not conf.find_program('linkchecker',
- var='LINKCHECKER', mandatory=False):
- Logs.warn('Documentation will not be checked for broken links')
-
- # Check for gcov library (for test coverage)
- if (conf.env.BUILD_TESTS and
- not Options.options.no_coverage and
- not conf.is_defined('HAVE_GCOV')):
- conf.check_cc(lib='gcov', define_name='HAVE_GCOV', mandatory=False)
-
- if conf.env.BUILD_TESTS:
- conf.find_program('serdi', mandatory=False)
- conf.find_program('sord_validate', mandatory=False)
-
- autowaf.set_lib_env(conf, 'lv2', VERSION, has_objects=False)
- autowaf.set_local_lib(conf, 'lv2', has_objects=False)
-
- conf.run_env.append_unique('LV2_PATH',
- [os.path.join(conf.path.abspath(), 'lv2')])
-
- if conf.env.BUILD_PLUGINS:
- for i in ['eg-amp.lv2',
- 'eg-fifths.lv2',
- 'eg-metro.lv2',
- 'eg-midigate.lv2',
- 'eg-params.lv2',
- 'eg-sampler.lv2',
- 'eg-scope.lv2']:
- try:
- path = os.path.join('plugins', i)
- conf.recurse(path)
- conf.env.LV2_BUILD += [path]
- conf.run_env.append_unique(
- 'LV2_PATH', [conf.build_path('plugins/%s/lv2' % i)])
- except Exception as e:
- Logs.warn('Configuration of %s failed (%s)' % (i, e))
-
- autowaf.display_summary(
- conf,
- {'Bundle directory': conf.env.LV2DIR,
- 'Copy (not link) headers': bool(conf.env.COPY_HEADERS),
- 'Version': VERSION})
-
-
-def chop_lv2_prefix(s):
- if s.startswith('lv2/lv2plug.in/'):
- return s[len('lv2/lv2plug.in/'):]
- return s
-
-
-def subst_file(template, output, dict):
- i = open(template, 'r')
- o = open(output, 'w')
- for line in i:
- for key in dict:
- line = line.replace(key, dict[key])
- o.write(line)
- i.close()
- o.close()
-
-
-def specdirs(path):
- return (path.ant_glob('lv2/*', dir=True) +
- path.ant_glob('plugins/*.lv2', dir=True))
-
-
-def ttl_files(path, specdir):
- def abspath(node):
- return node.abspath()
-
- return map(abspath,
- path.ant_glob(specdir.path_from(path) + '/*.ttl'))
-
-
-def load_ttl(files, exclude = []):
- import rdflib
- model = rdflib.ConjunctiveGraph()
- for f in files:
- if f not in exclude:
- model.parse(f, format='n3')
- return model
-
-
-# Task to build extension index
-def build_index(task):
- src_dir = task.inputs[0].parent.parent
- sys.path.append(str(src_dir.find_node('lv2specgen')))
- import rdflib
-
- doap = rdflib.Namespace('http://usefulinc.com/ns/doap#')
-
- model = load_ttl([str(src_dir.find_node('lv2/core/meta.ttl')),
- str(src_dir.find_node('lv2/core/people.ttl'))])
-
- # Get date for this version, and list of all LV2 distributions
- proj = rdflib.URIRef('http://lv2plug.in/ns/lv2')
- date = None
- dists = []
- for r in model.triples([proj, doap.release, None]):
- revision = model.value(r[2], doap.revision, None)
- created = model.value(r[2], doap.created, None)
- if str(revision) == VERSION:
- date = created
-
- dist = model.value(r[2], doap['file-release'], None)
- if dist and created:
- dists += [(created, dist)]
- else:
- print('warning: %s has no file release\n' % proj)
-
- rows = []
- for f in task.inputs:
- if not f.abspath().endswith('index.html.in'):
- rowfile = open(f.abspath(), 'r')
- rows += rowfile.readlines()
- rowfile.close()
-
- if date is None:
- import datetime
- import time
- now = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
- date = datetime.datetime.utcfromtimestamp(now).strftime('%F')
-
- subst_file(task.inputs[0].abspath(), task.outputs[0].abspath(),
- {'@ROWS@': ''.join(rows),
- '@LV2_VERSION@': VERSION,
- '@DATE@': date})
-
-
-def build_spec(bld, path):
- name = os.path.basename(path)
- bundle_dir = os.path.join(bld.env.LV2DIR, name + '.lv2')
- include_dir = os.path.join(bld.env.INCLUDEDIR, path)
- old_include_dir = os.path.join(bld.env.INCLUDEDIR, spec_map[name])
-
- # Build test program if applicable
- for test in bld.path.ant_glob(os.path.join(path, '*-test.c')):
- test_lib = []
- test_cflags = ['']
- test_linkflags = ['']
- if bld.is_defined('HAVE_GCOV'):
- test_lib += ['gcov']
- test_cflags += ['--coverage']
- test_linkflags += ['--coverage']
- if bld.env.DEST_OS not in ['darwin', 'win32']:
- test_lib += ['rt']
-
- # Unit test program
- bld(features = 'c cprogram',
- source = test,
- lib = test_lib,
- uselib = 'LV2',
- target = os.path.splitext(str(test.get_bld()))[0],
- install_path = None,
- cflags = test_cflags,
- linkflags = test_linkflags)
-
- # Install bundle
- bld.install_files(bundle_dir,
- bld.path.ant_glob(path + '/?*.*', excl='*.in'))
-
- # Install URI-like includes
- headers = bld.path.ant_glob(path + '/*.h')
- if headers:
- for d in [include_dir, old_include_dir]:
- if bld.env.COPY_HEADERS:
- bld.install_files(d, headers)
- else:
- bld.symlink_as(d,
- os.path.relpath(bundle_dir, os.path.dirname(d)))
-
-
-def build(bld):
- specs = (bld.path.ant_glob('lv2/*', dir=True))
-
- # Copy lv2.h to include directory for backwards compatibility
- old_lv2_h_path = os.path.join(bld.env.INCLUDEDIR, 'lv2.h')
- if bld.env.COPY_HEADERS:
- bld.install_files(os.path.dirname(old_lv2_h_path), 'lv2/core/lv2.h')
- else:
- bld.symlink_as(old_lv2_h_path, 'lv2/core/lv2.h')
-
- # LV2 pkgconfig file
- bld(features = 'subst',
- source = 'lv2.pc.in',
- target = 'lv2.pc',
- install_path = '${LIBDIR}/pkgconfig',
- PREFIX = bld.env.PREFIX,
- INCLUDEDIR = bld.env.INCLUDEDIR,
- VERSION = VERSION)
-
- # Validator
- bld(features = 'subst',
- source = 'util/lv2_validate.in',
- target = 'lv2_validate',
- chmod = Utils.O755,
- install_path = '${BINDIR}',
- LV2DIR = bld.env.LV2DIR)
-
- # Build extensions
- for spec in specs:
- build_spec(bld, spec.path_from(bld.path))
-
- # Build plugins
- for plugin in bld.env.LV2_BUILD:
- bld.recurse(plugin)
-
- # Install lv2specgen
- bld.install_files('${DATADIR}/lv2specgen/',
- ['lv2specgen/style.css',
- 'lv2specgen/template.html'])
- bld.install_files('${DATADIR}/lv2specgen/DTD/',
- bld.path.ant_glob('lv2specgen/DTD/*'))
- bld.install_files('${BINDIR}', 'lv2specgen/lv2specgen.py',
- chmod=Utils.O755)
-
- # Install schema bundle
- bld.install_files('${LV2DIR}/schemas.lv2/',
- bld.path.ant_glob('schemas.lv2/*.ttl'))
-
- if bld.env.ONLINE_DOCS:
- # Generate .htaccess files
- for d in ('ns', 'ns/ext', 'ns/extensions'):
- path = os.path.join(str(bld.path.get_bld()), d)
- bld(features = 'subst',
- source = 'doc/htaccess.in',
- target = os.path.join(path, '.htaccess'),
- install_path = None,
- BASE = '/' + d)
-
- if bld.env.DOCS or bld.env.ONLINE_DOCS:
- # Copy spec files to build dir
- for spec in specs:
- srcpath = spec.path_from(bld.path)
- basename = os.path.basename(srcpath)
- full_path = spec_map[basename]
- name = 'lv2core' if basename == 'core' else basename
- path = chop_lv2_prefix(full_path)
-
- bld(features = 'subst',
- is_copy = True,
- source = os.path.join(srcpath, name + '.ttl'),
- target = path + '.ttl')
-
- # Copy stylesheets to build directory
- for i in ['style.css', 'pygments.css']:
- bld(features = 'subst',
- is_copy = True,
- name = 'copy',
- source = 'doc/%s' % i,
- target = 'aux/%s' % i)
-
- # Build Doxygen documentation (and tags file)
- autowaf.build_dox(bld, 'LV2', VERSION, top, out, 'doc', False)
- bld.add_group()
-
- index_files = []
- for spec in specs:
- # Call lv2specgen to generate spec docs
- srcpath = spec.path_from(bld.path)
- basename = os.path.basename(srcpath)
- full_path = spec_map[basename]
- name = 'lv2core' if basename == 'core' else basename
- ttl_name = name + '.ttl'
- index_file = bld.path.get_bld().make_node('index_rows/' + name)
- index_files += [index_file]
- chopped_path = chop_lv2_prefix(full_path)
-
- assert chopped_path.startswith('ns/')
- root_path = os.path.relpath('/', os.path.dirname(chopped_path[2:]))
- html_path = '%s.html' % chopped_path
- out_dir = os.path.dirname(html_path)
- style_uri = os.path.relpath('aux/style.css', out_dir)
-
- cmd = (str(bld.path.find_node('lv2specgen/lv2specgen.py')) +
- ' --root-uri=http://lv2plug.in/ns/'
- ' --root-path=' + root_path +
- ' --list-email=' + list_email +
- ' --list-page=' + list_page +
- ' --style-uri=' + style_uri +
- ' --docdir=' + os.path.relpath('doc/html', out_dir) +
- ' --tags=%s' % bld.path.get_bld().make_node('doc/tags') +
- ' --index=' + str(index_file) +
- (' --online' if bld.env.ONLINE_DOCS else '') +
- ' ${SRC} ${TGT}')
-
- bld(rule = cmd,
- source = os.path.join(srcpath, ttl_name),
- target = [html_path, index_file],
- shell = False)
-
- # Install documentation
- bld.install_files(
- os.path.join('${DOCDIR}', 'lv2', os.path.dirname(html_path)),
- html_path)
-
- index_files.sort(key=lambda x: x.path_from(bld.path))
- bld.add_group()
-
- # Build extension index
- bld(rule = build_index,
- name = 'index',
- source = ['doc/index.html.in'] + index_files,
- target = 'ns/index.html')
-
- # Install main documentation files
- bld.install_files('${DOCDIR}/lv2/aux/', 'aux/style.css')
- bld.install_files('${DOCDIR}/lv2/ns/', 'ns/index.html')
-
- def check_links(ctx):
- import subprocess
- if ctx.env.LINKCHECKER:
- if subprocess.call([ctx.env.LINKCHECKER[0],
- '--no-status', out]):
- ctx.fatal('Documentation contains broken links')
-
- if bld.cmd == 'build':
- bld.add_post_fun(check_links)
-
- if bld.env.BUILD_TESTS:
- # Generate a compile test file that includes all headers
- def gen_build_test(task):
- with open(task.outputs[0].abspath(), 'w') as out:
- for i in task.inputs:
- out.write('#include "%s"\n' % i.bldpath())
- out.write('int main(void) { return 0; }\n')
-
- bld(rule = gen_build_test,
- source = bld.path.ant_glob('lv2/**/*.h'),
- target = 'build-test.c',
- install_path = None)
-
- bld(features = 'c cprogram',
- source = bld.path.get_bld().make_node('build-test.c'),
- target = 'build-test',
- includes = '.',
- uselib = 'LV2',
- install_path = None)
-
- if 'COMPILER_CXX' in bld.env:
- bld(rule = gen_build_test,
- source = bld.path.ant_glob('lv2/**/*.h'),
- target = 'build-test.cpp',
- install_path = None)
-
- bld(features = 'cxx cxxprogram',
- source = bld.path.get_bld().make_node('build-test.cpp'),
- target = 'build-test-cpp',
- includes = '.',
- uselib = 'LV2',
- install_path = None)
-
- if bld.env.BUILD_BOOK:
- # Build "Programming LV2 Plugins" book from plugin examples
- bld.recurse('plugins')
-
-
-class LintContext(Build.BuildContext):
- fun = cmd = 'lint'
-
-
-def lint(ctx):
- "checks code for style issues"
- import subprocess
- import glob
-
- st = 0
-
- if "FLAKE8" in ctx.env:
- Logs.info("Running flake8")
- st = subprocess.call([ctx.env.FLAKE8[0],
- "wscript",
- "--ignore",
- "E101,E129,W191,E221,W504,E251,E241,E741"])
- else:
- Logs.warn("Not running flake8")
-
- if "IWYU_TOOL" in ctx.env:
- Logs.info("Running include-what-you-use")
- cmd = [ctx.env.IWYU_TOOL[0], "-o", "clang", "-p", "build"]
- output = subprocess.check_output(cmd).decode('utf-8')
- if 'error: ' in output:
- sys.stdout.write(output)
- st += 1
- else:
- Logs.warn("Not running include-what-you-use")
-
- if "CLANG_TIDY" in ctx.env and "clang" in ctx.env.CC[0]:
- Logs.info("Running clang-tidy")
- sources = glob.glob('**/*.h', recursive=True)
- sources = list(map(os.path.abspath, sources))
- procs = []
- for source in sources:
- cmd = [ctx.env.CLANG_TIDY[0], "--quiet", "-p=.", source]
- procs += [subprocess.Popen(cmd, cwd="build")]
-
- for proc in procs:
- stdout, stderr = proc.communicate()
- st += proc.returncode
- else:
- Logs.warn("Not running clang-tidy")
-
- if st != 0:
- sys.exit(st)
-
-
-def test_vocabularies(check, specs, files):
- import rdflib
-
- foaf = rdflib.Namespace('http://xmlns.com/foaf/0.1/')
- lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#')
- owl = rdflib.Namespace('http://www.w3.org/2002/07/owl#')
- rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
- rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#')
-
- # Check if this is a stable LV2 release to enable additional tests
- version_tuple = tuple(map(int, VERSION.split(".")))
- is_stable = version_tuple[1] % 2 == 0 and version_tuple[2] % 2 == 0
-
- # Check that extended documentation is not in main specification file
- for spec in specs:
- path = str(spec.abspath())
- name = os.path.basename(path)
- name = 'lv2core' if name == 'core' else name
- vocab = os.path.join(path, name + '.ttl')
-
- spec_model = rdflib.ConjunctiveGraph()
- spec_model.parse(vocab, format='n3')
-
- def has_statement(s, p, o):
- for t in spec_model.triples([s, p, o]):
- return True
-
- return False
-
- check(lambda: not has_statement(None, lv2.documentation, None),
- name = name + ".ttl does not contain lv2:documentation")
-
- # Check specification manifests
- for spec in specs:
- path = str(spec.abspath())
- manifest_path = os.path.join(path, 'manifest.ttl')
- manifest_model = rdflib.ConjunctiveGraph()
- manifest_model.parse(manifest_path, format='n3')
-
- uri = manifest_model.value(None, rdf.type, lv2.Specification)
- minor = manifest_model.value(uri, lv2.minorVersion, None)
- micro = manifest_model.value(uri, lv2.microVersion, None)
- check(lambda: uri is not None,
- name = manifest_path + " has a lv2:Specification")
- check(lambda: minor is not None,
- name = manifest_path + " has a lv2:minorVersion")
- check(lambda: micro is not None,
- name = manifest_path + " has a lv2:microVersion")
-
- if is_stable:
- check(lambda: int(minor) > 0,
- name = manifest_path + " has even non-zero minor version")
- check(lambda: int(micro) % 2 == 0,
- name = manifest_path + " has even micro version")
-
- # Load everything into one big model
- model = rdflib.ConjunctiveGraph()
- for f in files:
- model.parse(f, format='n3')
-
- # Check that all named and typed resources have labels and comments
- for r in sorted(model.triples([None, rdf.type, None])):
- subject = r[0]
- if (type(subject) == rdflib.term.BNode or
- foaf.Person in model.objects(subject, rdf.type)):
- continue
-
- def has_property(subject, prop):
- return model.value(subject, prop, None) is not None
-
- check(lambda: has_property(subject, rdfs.label),
- name = '%s has rdfs:label' % subject)
-
- if check(lambda: has_property(subject, rdfs.comment),
- name = '%s has rdfs:comment' % subject):
- comment = str(model.value(subject, rdfs.comment, None))
-
- check(lambda: comment.endswith('.'),
- name = "%s comment ends in '.'" % subject)
- check(lambda: comment.find('\n') == -1,
- name = "%s comment contains no newlines" % subject)
- check(lambda: comment == comment.strip(),
- name = "%s comment has stripped whitespace" % subject)
-
- # Check that lv2:documentation, if present, is proper Markdown
- documentation = model.value(subject, lv2.documentation, None)
- if documentation is not None:
- check(lambda: documentation.datatype == lv2.Markdown,
- name = "%s documentation is explicitly Markdown" % subject)
- check(lambda: str(documentation).startswith('\n\n'),
- name = "%s documentation starts with blank line" % subject)
- check(lambda: str(documentation).endswith('\n\n'),
- name = "%s documentation ends with blank line" % subject)
-
- # Check that all properties are either datatype or object properties
- for r in sorted(model.triples([None, rdf.type, rdf.Property])):
- subject = r[0]
- types = list(model.objects(subject, rdf.type))
-
- check(lambda: ((owl.DatatypeProperty in types) or
- (owl.ObjectProperty in types) or
- (owl.AnnotationProperty in types)),
- name = "%s is a Datatype/Object/Annotation property" % subject)
-
-
-def test(tst):
- import tempfile
-
- with tst.group("Data") as check:
- specs = (tst.path.ant_glob('lv2/*', dir=True))
- schemas = list(map(str, tst.path.ant_glob("schemas.lv2/*.ttl")))
- spec_files = list(map(str, tst.path.ant_glob("lv2/**/*.ttl")))
- plugin_files = list(map(str, tst.path.ant_glob("plugins/**/*.ttl")))
- bld_files = list(map(str, tst.path.get_bld().ant_glob("**/*.ttl")))
-
- if "SERDI" in tst.env and sys.platform != 'win32':
- for f in spec_files:
- with tempfile.NamedTemporaryFile(mode="w") as tmp:
- base_dir = os.path.dirname(f)
- cmd = tst.env.SERDI + ["-o", "turtle", f, base_dir]
- check(cmd, stdout=tmp.name)
- check.file_equals(f, tmp.name)
-
- if "SORD_VALIDATE" in tst.env:
- all_files = schemas + spec_files + plugin_files + bld_files
- check(tst.env.SORD_VALIDATE + all_files)
-
- try:
- test_vocabularies(check, specs, spec_files)
- except ImportError as e:
- Logs.warn('Not running vocabulary tests (%s)' % e)
-
- with tst.group('Unit') as check:
- pattern = tst.env.cprogram_PATTERN % '**/*-test'
- for test in tst.path.get_bld().ant_glob(pattern):
- check([str(test)])
-
-
-class Dist(Scripting.Dist):
- def execute(self):
- 'Execute but do not call archive() since dist() has already done so.'
- self.recurse([os.path.dirname(Context.g_module.root_path)])
-
- def get_tar_path(self, node):
- 'Resolve symbolic links to avoid broken links in tarball.'
- return os.path.realpath(node.abspath())
-
-
-class DistCheck(Dist, Scripting.DistCheck):
- def execute(self):
- Dist.execute(self)
- self.check()
-
- def archive(self):
- Dist.archive(self)
-
-
-def _get_news_entries(ctx):
- from waflib.extras import autoship
-
- # Get project-level news entries
- lv2_entries = autoship.read_ttl_news('lv2',
- ['lv2/core/meta.ttl',
- 'lv2/core/people.ttl'],
- dist_pattern = dist_pattern)
-
- release_pattern = r'http://lv2plug.in/spec/lv2-([0-9\.]*).tar.bz2'
- current_version = sorted(lv2_entries.keys(), reverse=True)[0]
-
- # Add items from every specification
- for specdir in specdirs(ctx.path):
- name = os.path.basename(specdir.abspath())
- files = list(ttl_files(ctx.path, specdir))
- if name == "core":
- files = [f for f in files if (not f.endswith('/meta.ttl') and
- not f.endswith('/people.ttl') and
- not f.endswith('/manifest.ttl'))]
-
- entries = autoship.read_ttl_news(name, files)
-
- def add_items(lv2_version, name, items):
- for item in items:
- lv2_entries[lv2_version]["items"] += ["%s: %s" % (name, item)]
-
- if entries:
- latest_revision = sorted(entries.keys(), reverse=True)[0]
- for revision, entry in entries.items():
- if "dist" in entry:
- match = re.match(release_pattern, entry["dist"])
- if match:
- # Append news items to corresponding LV2 version
- version = tuple(map(int, match.group(1).split('.')))
- add_items(version, name, entry["items"])
-
- elif revision == latest_revision:
- # Not-yet-released development version, append to current
- add_items(current_version, name, entry["items"])
-
- # Sort news items in each versions
- for revision, entry in lv2_entries.items():
- entry["items"].sort()
-
- return lv2_entries
-
-
-def posts(ctx):
- "generates news posts in Pelican Markdown format"
-
- from waflib.extras import autoship
-
- try:
- os.mkdir(os.path.join(out, 'posts'))
- except Exception:
- pass
-
- autoship.write_posts(_get_news_entries(ctx),
- os.path.join(out, 'posts'),
- {'Author': 'drobilla'})
-
-
-def news(ctx):
- """write an amalgamated NEWS file to the source directory"""
-
- from waflib.extras import autoship
-
- autoship.write_news(_get_news_entries(ctx), 'NEWS')
-
-
-def dist(ctx):
- news(ctx)
- ctx.archive()
-
-
-def distcheck(ctx):
- news(ctx)
- ctx.archive()