diff options
350 files changed, 41089 insertions, 12442 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..2ded658 --- /dev/null +++ b/.clang-format @@ -0,0 +1,34 @@ +--- +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 new file mode 100644 index 0000000..342cf5a --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,27 @@ +Checks: > + *, + -*-else-after-return, + -*-magic-numbers, + -*-uppercase-literal-suffix, + -altera-*, + -bugprone-easily-swappable-parameters, + -bugprone-macro-parentheses, + -bugprone-suspicious-include, + -bugprone-suspicious-string-compare, + -cert-err33-c, + -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, + -clang-diagnostic-empty-translation-unit, + -clang-diagnostic-unused-function, + -clang-diagnostic-unused-macros, + -hicpp-signed-bitwise, + -llvm-header-guard, + -llvmlibc-*, + -misc-unused-parameters, + -modernize-redundant-void-arg, + -modernize-use-trailing-return-type, + -performance-no-int-to-ptr, + -readability-function-cognitive-complexity, + -readability-identifier-length, +WarningsAsErrors: '*' +HeaderFilterRegex: '.*' +FormatStyle: file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b532cce --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# generated files and folders +/build +*.pyc +NEWS + +# misc editor/tools +*.swp +cscope.* +tags diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..92ff3ef --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,165 @@ +arm32_dbg: + image: lv2plugin/debian-arm32 + script: + - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +arm32_rel: + image: lv2plugin/debian-arm32 + script: + - meson setup build --cross-file=/usr/share/meson/cross/arm-linux-gnueabihf.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +arm64_dbg: + image: lv2plugin/debian-arm64 + script: + - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +arm64_rel: + image: lv2plugin/debian-arm64 + script: + - meson setup build --cross-file=/usr/share/meson/cross/aarch64-linux-gnu.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +x32_dbg: + image: lv2plugin/debian-x32 + script: + - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +x32_rel: + image: lv2plugin/debian-x32 + script: + - meson setup build --cross-file=/usr/share/meson/cross/i686-linux-gnu.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +x64_dbg: + image: lv2plugin/debian-x64 + script: + - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true -Db_coverage=true + - ninja -C build test + - ninja -C build coverage-html + coverage: '/ *lines\.*: \d+\.\d+.*/' + artifacts: + paths: + - build/meson-logs/coveragereport + +x64_rel: + image: lv2plugin/debian-x64 + script: + - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +x64_static: + image: lv2plugin/debian-x64 + script: + - meson setup build -Ddefault_library=static -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +x64_sanitize: + image: lv2plugin/debian-x64-clang + script: + - meson setup build -Db_lundef=false -Dbuildtype=plain -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + variables: + 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" + + +freebsd_dbg: + tags: [freebsd,meson] + script: + - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +freebsd_rel: + tags: [freebsd,meson] + script: + - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +mingw32_dbg: + image: lv2plugin/debian-mingw32 + script: + - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +mingw32_rel: + image: lv2plugin/debian-mingw32 + script: + - meson setup build --cross-file=/usr/share/meson/cross/i686-w64-mingw32.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +mingw64_dbg: + image: lv2plugin/debian-mingw64 + script: + - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +mingw64_rel: + image: lv2plugin/debian-mingw64 + script: + - meson setup build --cross-file=/usr/share/meson/cross/x86_64-w64-mingw32.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +mac_dbg: + tags: [macos] + script: + - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true + - ninja -C build test + +mac_rel: + tags: [macos] + script: + - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true + - ninja -C build test + + +win_dbg: + tags: [windows,meson] + script: + - meson setup build -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + +win_rel: + tags: [windows,meson] + script: + - meson setup build -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddocs=disabled + - ninja -C build test + + +wasm_dbg: + image: lv2plugin/debian-wasm + script: + - meson setup build --cross-file=/usr/share/meson/cross/wasm.ini -Dbuildtype=debug -Dstrict=true -Dwerror=true -Ddefault_library=static -Ddocs=disabled -Dplugins=disabled + - ninja -C build test + +wasm_rel: + image: lv2plugin/debian-wasm + script: + - meson setup build --cross-file=/usr/share/meson/cross/wasm.ini -Dbuildtype=release -Dstrict=true -Dwerror=true -Ddefault_library=static -Ddocs=disabled -Dplugins=disabled + - ninja -C build test + + +pages: + stage: deploy + script: + - mkdir -p public + - mv build/meson-logs/coveragereport/ public/coverage + dependencies: + - x64_dbg + artifacts: + paths: + - public + only: + - master 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" + } +} @@ -0,0 +1,16 @@ +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. diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index 26b72bd..0000000 --- a/Doxyfile +++ /dev/null @@ -1,1532 +0,0 @@ -# Doxyfile 1.5.9 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = LV2 - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = build/default/doc/doc - -# 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 will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) 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. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" 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. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = 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, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. 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 that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = YES - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -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 (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -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. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = YES - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The 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. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = NO - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = NO - -# If WARN_IF_DOC_ERROR 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. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -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 stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = \ - doc/mainpage.dox \ - core.lv2/lv2.h \ - ext/atom.lv2/atom.h \ - ext/contexts.lv2/contexts.h \ - ext/data-access.lv2/data-access.h \ - ext/dyn-manifest.lv2/dyn-manifest.h \ - ext/event.lv2/event-helpers.h \ - ext/event.lv2/event.h \ - ext/files.lv2/files.h \ - ext/instance-access.lv2/instance-access.h \ - ext/osc.lv2/osc-print.h \ - ext/osc.lv2/osc.h \ - ext/persist.lv2/persist.h \ - ext/polymorphic-port.lv2/polymorphic-port.h \ - ext/string-port.lv2/string-port.h \ - ext/uri-map.lv2/uri-map.h \ - extensions/ui.lv2/ui.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, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (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 - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -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 one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# 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 the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# 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, 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 http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, 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). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, 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. - -QHG_LOCATION = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to FRAME, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. Other possible values -# for this tag are: HIERARCHIES, which will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list; -# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which -# disables this behavior completely. For backwards compatibility with previous -# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE -# respectively. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = 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. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -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. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# 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. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE 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. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need 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. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are 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 -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -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). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES 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 this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Options related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO - diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..400391f --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,72 @@ +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/" + +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/ @@ -1,37 +0,0 @@ -This is a repository of all the extensions, scripts, and other useful LV2 -related tools at <http://lv2plug.in/>. Contributions are welcome, please -send patches to the LV2 mailing list (see admin page at -<http://lists.lv2plug.in/> to subscribe or browse archives). - -Note that many components of this repository are experimental, and NOT -suitable for release or packaging. Release tarballs suitable for -distribution can be found in build/default/spec after running gendoc.py. - -The build system and documentation generation requires only Python -and Doxygen. - - -** Installing Core/Extension Bundles ** - -./waf configure -./waf -sudo ./waf install - -The installation directory can be modified with the --lv2-dir or ---lv2-user options to ./waf configure, e.g.: - -./waf configure --lv2-dir /path/to/dir/to/place/bundles/under - -or - -./waf configure --lv2-user - -which will install to the default user LV2 directory (e.g. ~/.lv2). - - - -** Generating Core/Extension Documentation ** - -./gendoc.py - -Documentation output will be in build/default/doc. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f4c438 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +LV2 +=== + +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 +------------ + +See the [installation instructions](INSTALL.md) for details on how to +configure, build, and install LV2 with meson. + +By default, everything is installed within the `prefix` with a UNIX-style +hierarchy, and LV2 bundles are installed in the "lv2" subdirectory of the +`libdir`. The bundle installation directory can be overridden with the +`lv2dir` option. For example, standard system-wide values for various +operating systems are: + + meson configure -Dlv2dir=/Library/Audio/Plug-Ins/LV2 + meson configure -Dlv2dir=/boot/common/add-ons/lv2 + meson configure -Dlv2dir=C:/Program Files/Common/LV2 + +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. + +Headers +------- + +The `lv2/` include namespace is reserved for this LV2 distribution. +Other projects may extend LV2, but must place their headers elsewhere. + +Headers are installed to `includedir` with paths like: + + #include "lv2/urid/urid.h" + +For backwards compatibility, if the `old_headers` option is set, then headers +are also installed to the older URI-based paths: + + #include "lv2/lv2plug.in/ns/ext/urid/urid.h" + +Projects still using this style are encourated to migrate to the shorter style +above. diff --git a/autowaf.py b/autowaf.py deleted file mode 100644 index 7e8790a..0000000 --- a/autowaf.py +++ /dev/null @@ -1,438 +0,0 @@ -#!/usr/bin/env python -# Waf utilities for easily building standard unixey packages/libraries -# Licensed under the GNU GPL v2 or later, see COPYING file for details. -# Copyright (C) 2008 David Robillard -# Copyright (C) 2008 Nedko Arnaudov - -import Configure -import Options -import Utils -import misc -import os -import subprocess -import sys -from TaskGen import feature, before, after - -global g_is_child -g_is_child = False - -# Only run autowaf hooks once (even if sub projects call several times) -global g_step -g_step = 0 - -# Compute dependencies globally -#import preproc -#preproc.go_absolute = True - -@feature('cc', 'cxx') -@after('apply_lib_vars') -@before('apply_obj_vars_cc', 'apply_obj_vars_cxx') -def include_config_h(self): - self.env.append_value('INC_PATHS', self.bld.srcnode) - -def set_options(opt): - "Add standard autowaf options if they havn't been added yet" - global g_step - if g_step > 0: - return - opt.tool_options('compiler_cc') - opt.tool_options('compiler_cxx') - opt.add_option('--debug', action='store_true', default=False, dest='debug', - help="Build debuggable binaries [Default: False]") - opt.add_option('--strict', action='store_true', default=False, dest='strict', - help="Use strict compiler flags and show all warnings [Default: False]") - opt.add_option('--docs', action='store_true', default=False, dest='docs', - help="Build documentation - requires doxygen [Default: False]") - opt.add_option('--bundle', action='store_true', default=False, - help="Build a self-contained bundle [Default: False]") - opt.add_option('--bindir', type='string', - help="Executable programs [Default: PREFIX/bin]") - opt.add_option('--libdir', type='string', - help="Libraries [Default: PREFIX/lib]") - opt.add_option('--includedir', type='string', - help="Header files [Default: PREFIX/include]") - opt.add_option('--datadir', type='string', - help="Shared data [Default: PREFIX/share]") - opt.add_option('--configdir', type='string', - help="Configuration data [Default: PREFIX/etc]") - opt.add_option('--mandir', type='string', - help="Manual pages [Default: DATADIR/man]") - opt.add_option('--htmldir', type='string', - help="HTML documentation [Default: DATADIR/doc/PACKAGE]") - opt.add_option('--lv2-user', action='store_true', default=False, dest='lv2_user', - help="Install LV2 bundles to user-local location [Default: False]") - if sys.platform == "darwin": - opt.add_option('--lv2dir', type='string', - help="LV2 bundles [Default: /Library/Audio/Plug-Ins/LV2]") - else: - opt.add_option('--lv2dir', type='string', - help="LV2 bundles [Default: LIBDIR/lv2]") - g_step = 1 - -def check_header(conf, name, define='', mandatory=False): - "Check for a header iff it hasn't been checked for yet" - if type(conf.env['AUTOWAF_HEADERS']) != dict: - conf.env['AUTOWAF_HEADERS'] = {} - - checked = conf.env['AUTOWAF_HEADERS'] - if not name in checked: - checked[name] = True - includes = '' # search default system include paths - if sys.platform == "darwin": - includes = '/opt/local/include' - if define != '': - conf.check(header_name=name, includes=includes, define_name=define, mandatory=mandatory) - else: - conf.check(header_name=name, includes=includes, mandatory=mandatory) - -def nameify(name): - return name.replace('/', '_').replace('++', 'PP').replace('-', '_').replace('.', '_') - -def check_pkg(conf, name, **args): - if not 'mandatory' in args: - args['mandatory'] = True - "Check for a package iff it hasn't been checked for yet" - var_name = 'HAVE_' + nameify(args['uselib_store']) - check = not var_name in conf.env - if not check and 'atleast_version' in args: - # Re-check if version is newer than previous check - checked_version = conf.env['VERSION_' + name] - if checked_version and checked_version < args['atleast_version']: - check = True; - if check: - conf.check_cfg(package=name, args="--cflags --libs", **args) - found = bool(conf.env[var_name]) - if found: - conf.define(var_name, int(found)) - if 'atleast_version' in args: - conf.env['VERSION_' + name] = args['atleast_version'] - else: - conf.undefine(var_name) - if args['mandatory'] == True: - conf.fatal("Required package " + name + " not found") - -def configure(conf): - global g_step - if g_step > 1: - return - def append_cxx_flags(vals): - conf.env.append_value('CCFLAGS', vals.split()) - conf.env.append_value('CXXFLAGS', vals.split()) - display_header('Global Configuration') - conf.check_tool('misc') - conf.check_tool('compiler_cc') - conf.check_tool('compiler_cxx') - conf.env['DOCS'] = Options.options.docs - conf.env['DEBUG'] = Options.options.debug - conf.env['STRICT'] = Options.options.strict - conf.env['PREFIX'] = os.path.abspath(os.path.expanduser(os.path.normpath(conf.env['PREFIX']))) - if Options.options.bundle: - conf.env['BUNDLE'] = True - conf.define('BUNDLE', 1) - conf.env['BINDIR'] = conf.env['PREFIX'] - conf.env['INCLUDEDIR'] = os.path.join(conf.env['PREFIX'], 'Headers') - conf.env['LIBDIR'] = os.path.join(conf.env['PREFIX'], 'Libraries') - conf.env['DATADIR'] = os.path.join(conf.env['PREFIX'], 'Resources') - conf.env['HTMLDIR'] = os.path.join(conf.env['PREFIX'], 'Resources/Documentation') - conf.env['MANDIR'] = os.path.join(conf.env['PREFIX'], 'Resources/Man') - conf.env['LV2DIR'] = os.path.join(conf.env['PREFIX'], 'PlugIns') - else: - conf.env['BUNDLE'] = False - if Options.options.bindir: - conf.env['BINDIR'] = Options.options.bindir - else: - conf.env['BINDIR'] = os.path.join(conf.env['PREFIX'], 'bin') - if Options.options.includedir: - conf.env['INCLUDEDIR'] = Options.options.includedir - else: - conf.env['INCLUDEDIR'] = os.path.join(conf.env['PREFIX'], 'include') - if Options.options.libdir: - conf.env['LIBDIR'] = Options.options.libdir - else: - conf.env['LIBDIR'] = os.path.join(conf.env['PREFIX'], 'lib') - if Options.options.datadir: - conf.env['DATADIR'] = Options.options.datadir - else: - conf.env['DATADIR'] = os.path.join(conf.env['PREFIX'], 'share') - if Options.options.configdir: - conf.env['CONFIGDIR'] = Options.options.configdir - else: - conf.env['CONFIGDIR'] = os.path.join(conf.env['PREFIX'], 'etc') - if Options.options.htmldir: - conf.env['HTMLDIR'] = Options.options.htmldir - else: - conf.env['HTMLDIR'] = os.path.join(conf.env['DATADIR'], 'doc', Utils.g_module.APPNAME) - if Options.options.mandir: - conf.env['MANDIR'] = Options.options.mandir - else: - conf.env['MANDIR'] = os.path.join(conf.env['DATADIR'], 'man') - if Options.options.lv2dir: - conf.env['LV2DIR'] = Options.options.lv2dir - else: - if Options.options.lv2_user: - if sys.platform == "darwin": - conf.env['LV2DIR'] = os.path.join(os.getenv('HOME'), 'Library/Audio/Plug-Ins/LV2') - else: - conf.env['LV2DIR'] = os.path.join(os.getenv('HOME'), '.lv2') - else: - if sys.platform == "darwin": - conf.env['LV2DIR'] = '/Library/Audio/Plug-Ins/LV2' - else: - conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'lv2') - - conf.env['BINDIRNAME'] = os.path.basename(conf.env['BINDIR']) - conf.env['LIBDIRNAME'] = os.path.basename(conf.env['LIBDIR']) - conf.env['DATADIRNAME'] = os.path.basename(conf.env['DATADIR']) - conf.env['CONFIGDIRNAME'] = os.path.basename(conf.env['CONFIGDIR']) - conf.env['LV2DIRNAME'] = os.path.basename(conf.env['LV2DIR']) - - if Options.options.docs: - doxygen = conf.find_program('doxygen') - if not doxygen: - conf.fatal("Doxygen is required to build documentation, configure without --docs") - - dot = conf.find_program('dot') - if not dot: - conf.fatal("Graphviz (dot) is required to build documentation, configure without --docs") - - if Options.options.debug: - conf.env['CCFLAGS'] = [ '-O0', '-g' ] - conf.env['CXXFLAGS'] = [ '-O0', '-g' ] - else: - append_cxx_flags('-DNDEBUG') - - if Options.options.strict: - conf.env.append_value('CCFLAGS', [ '-std=c99', '-pedantic' ]) - conf.env.append_value('CXXFLAGS', [ '-ansi', '-Woverloaded-virtual', '-Wnon-virtual-dtor']) - append_cxx_flags('-Wall -Wextra -Wno-unused-parameter') - - append_cxx_flags('-fPIC -DPIC -fshow-column') - - display_msg(conf, "Install prefix", conf.env['PREFIX']) - display_msg(conf, "Debuggable build", str(conf.env['DEBUG'])) - display_msg(conf, "Strict compiler flags", str(conf.env['STRICT'])) - display_msg(conf, "Build documentation", str(conf.env['DOCS'])) - print - - g_step = 2 - -def set_local_lib(conf, name, has_objects): - conf.define('HAVE_' + nameify(name.upper()), 1) - if has_objects: - if type(conf.env['AUTOWAF_LOCAL_LIBS']) != dict: - conf.env['AUTOWAF_LOCAL_LIBS'] = {} - conf.env['AUTOWAF_LOCAL_LIBS'][name.lower()] = True - else: - if type(conf.env['AUTOWAF_LOCAL_HEADERS']) != dict: - conf.env['AUTOWAF_LOCAL_HEADERS'] = {} - conf.env['AUTOWAF_LOCAL_HEADERS'][name.lower()] = True - -def use_lib(bld, obj, libs): - abssrcdir = os.path.abspath('.') - libs_list = libs.split() - for l in libs_list: - in_headers = l.lower() in bld.env['AUTOWAF_LOCAL_HEADERS'] - in_libs = l.lower() in bld.env['AUTOWAF_LOCAL_LIBS'] - if in_libs: - if hasattr(obj, 'uselib_local'): - obj.uselib_local += ' lib' + l.lower() + ' ' - else: - obj.uselib_local = 'lib' + l.lower() + ' ' - - if in_headers or in_libs: - inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower()) - for f in ['CCFLAGS', 'CXXFLAGS']: - if not inc_flag in bld.env[f]: - bld.env.append_value(f, inc_flag) - else: - if hasattr(obj, 'uselib'): - obj.uselib += ' ' + l - else: - obj.uselib = l - - -def display_header(title): - Utils.pprint('BOLD', title) - -def display_msg(conf, msg, status = None, color = None): - color = 'CYAN' - if type(status) == bool and status or status == "True": - color = 'GREEN' - elif type(status) == bool and not status or status == "False": - color = 'YELLOW' - Utils.pprint('BOLD', "%s :" % msg.ljust(conf.line_just), sep='') - Utils.pprint(color, status) - -def link_flags(env, lib): - return ' '.join(map(lambda x: env['LIB_ST'] % x, env['LIB_' + lib])) - -def compile_flags(env, lib): - return ' '.join(map(lambda x: env['CPPPATH_ST'] % x, env['CPPPATH_' + lib])) - -def set_recursive(): - global g_is_child - g_is_child = True - -def is_child(): - global g_is_child - return g_is_child - -# Pkg-config file -def build_pc(bld, name, version, libs): - '''Build a pkg-config file for a library. - name -- uppercase variable name (e.g. 'SOMENAME') - version -- version string (e.g. '1.2.3') - libs -- string/list of dependencies (e.g. 'LIBFOO GLIB') - ''' - - obj = bld.new_task_gen('subst') - obj.source = name.lower() + '.pc.in' - obj.target = name.lower() + '.pc' - obj.install_path = '${PREFIX}/${LIBDIRNAME}/pkgconfig' - pkg_prefix = bld.env['PREFIX'] - if pkg_prefix[-1] == '/': - pkg_prefix = pkg_prefix[:-1] - obj.dict = { - 'prefix' : pkg_prefix, - 'exec_prefix' : '${prefix}', - 'libdir' : '${prefix}/' + bld.env['LIBDIRNAME'], - 'includedir' : '${prefix}/include', - name + '_VERSION' : version, - } - if type(libs) != list: - libs = libs.split() - for i in libs: - obj.dict[i + '_LIBS'] = link_flags(bld.env, i) - obj.dict[i + '_CFLAGS'] = compile_flags(bld.env, i) - -# Doxygen API documentation -def build_dox(bld, name, version, srcdir, blddir): - if not bld.env['DOCS']: - return - obj = bld.new_task_gen('subst') - obj.source = 'doc/reference.doxygen.in' - obj.target = 'doc/reference.doxygen' - if is_child(): - src_dir = os.path.join(srcdir, name.lower()) - doc_dir = os.path.join(blddir, 'default', name.lower(), 'doc') - else: - src_dir = srcdir - doc_dir = os.path.join(blddir, 'default', 'doc') - obj.dict = { - name + '_VERSION' : version, - name + '_SRCDIR' : os.path.abspath(src_dir), - name + '_DOC_DIR' : os.path.abspath(doc_dir) - } - obj.install_path = '' - out1 = bld.new_task_gen('command-output') - out1.dependencies = [obj] - out1.stdout = '/doc/doxygen.out' - out1.stdin = '/doc/reference.doxygen' # whatever.. - out1.command = 'doxygen' - out1.argv = [os.path.abspath(doc_dir) + '/reference.doxygen'] - out1.command_is_external = True - -# Version code file generation -def build_version_files(header_path, source_path, domain, major, minor, micro): - header_path = os.path.abspath(header_path) - source_path = os.path.abspath(source_path) - text = "int " + domain + "_major_version = " + str(major) + ";\n" - text += "int " + domain + "_minor_version = " + str(minor) + ";\n" - text += "int " + domain + "_micro_version = " + str(micro) + ";\n" - try: - o = file(source_path, 'w') - o.write(text) - o.close() - except IOError: - print "Could not open", source_path, " for writing\n" - sys.exit(-1) - - text = "#ifndef __" + domain + "_version_h__\n" - text += "#define __" + domain + "_version_h__\n" - text += "extern const char* " + domain + "_revision;\n" - text += "extern int " + domain + "_major_version;\n" - text += "extern int " + domain + "_minor_version;\n" - text += "extern int " + domain + "_micro_version;\n" - text += "#endif /* __" + domain + "_version_h__ */\n" - try: - o = file(header_path, 'w') - o.write(text) - o.close() - except IOError: - print "Could not open", header_path, " for writing\n" - sys.exit(-1) - - return None - -def run_tests(ctx, appname, tests): - orig_dir = os.path.abspath(os.curdir) - failures = 0 - base = '..' - - top_level = os.path.abspath(ctx.curdir) != os.path.abspath(os.curdir) - if top_level: - os.chdir('./build/default/' + appname) - base = '../..' - else: - os.chdir('./build/default') - - lcov = True - lcov_log = open('lcov.log', 'w') - try: - # Clear coverage data - subprocess.call('lcov -d ./src -z'.split(), - stdout=lcov_log, stderr=lcov_log) - except: - lcov = False - print "Failed to run lcov, no coverage report will be generated" - - - # Run all tests - for i in tests: - print - Utils.pprint('BOLD', 'Running %s test %s' % (appname, i)) - if subprocess.call(i) == 0: - Utils.pprint('GREEN', 'Passed %s %s' % (appname, i)) - else: - failures += 1 - Utils.pprint('RED', 'Failed %s %s' % (appname, i)) - - if lcov: - # Generate coverage data - coverage_lcov = open('coverage.lcov', 'w') - subprocess.call(('lcov -c -d ./src -d ./test -b ' + base).split(), - stdout=coverage_lcov, stderr=lcov_log) - coverage_lcov.close() - - # Strip out unwanted stuff - coverage_stripped_lcov = open('coverage-stripped.lcov', 'w') - subprocess.call('lcov --remove coverage.lcov *boost* c++*'.split(), - stdout=coverage_stripped_lcov, stderr=lcov_log) - coverage_stripped_lcov.close() - - # Generate HTML coverage output - if not os.path.isdir('./coverage'): - os.makedirs('./coverage') - subprocess.call('genhtml -o coverage coverage-stripped.lcov'.split(), - stdout=lcov_log, stderr=lcov_log) - - lcov_log.close() - - print - Utils.pprint('BOLD', 'Summary:', sep=''), - if failures == 0: - Utils.pprint('GREEN', 'All ' + appname + ' tests passed') - else: - Utils.pprint('RED', str(failures) + ' ' + appname + ' test(s) failed') - - Utils.pprint('BOLD', 'Coverage:', sep='') - print os.path.abspath('coverage/index.html') - - os.chdir(orig_dir) - -def shutdown(): - # This isn't really correct (for packaging), but people asking is annoying - if Options.commands['install']: - try: os.popen("/sbin/ldconfig") - except: pass - diff --git a/core.lv2/AUTHORS b/core.lv2/AUTHORS deleted file mode 100644 index 8708976..0000000 --- a/core.lv2/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -The LV2 header (lv2.h) and core bundle (lv2core.lv2) are maintained by - -David Robillard <d@drobilla.net> -Steve Harris <steve@plugin.org.uk> - -with the input and help of many others. - -Thanks to all members of the free software community who made LV2 possible. diff --git a/core.lv2/COPYING b/core.lv2/COPYING deleted file mode 100644 index c2d62e3..0000000 --- a/core.lv2/COPYING +++ /dev/null @@ -1,6 +0,0 @@ -The LV2 header lv2.h is licensed under the GNU Lesser General Public License, -version 2.1 or later. See the included file COPYING.LGPL for details. - -The LV2 data file lv2.ttl is licensed under a BSD-style license, see the -header at the top of lv2.ttl for details. - diff --git a/core.lv2/ChangeLog b/core.lv2/ChangeLog deleted file mode 100644 index 82ef5d6..0000000 --- a/core.lv2/ChangeLog +++ /dev/null @@ -1,16 +0,0 @@ -lv2core (4.0) unstable; urgency=low - - * Make doap:license suggested, but not required (for wrappers) - * Loosen domain restriction of lv2:optionalFeature and lv2:requiredFeature - (to allow re-use in extensions) - - -- David Robillard <d@drobilla.net> Fri, 10 Jul 2009 17:27:57 -0400 - -lv2core (3.0) unstable; urgency=low - - * Require that serialisations refer to ports by symbol rather than index. - * Minor stylistic changes to lv2.ttl - * No header changes - - -- David Robillard <d@drobilla.net> Sat, 08 Nov 2008 14:27:10 -0500 - diff --git a/core.lv2/Doxyfile b/core.lv2/Doxyfile deleted file mode 100644 index 17a9e90..0000000 --- a/core.lv2/Doxyfile +++ /dev/null @@ -1,1515 +0,0 @@ -# Doxyfile 1.5.9 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = LV2 Core - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 4 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = ../upload/doc - -# 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 will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) 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. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" 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. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = 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, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. 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 that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -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 (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -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. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = YES - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The 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. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = NO - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = NO - -# If WARN_IF_DOC_ERROR 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. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -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 stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = lv2.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, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (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 - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -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 one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# 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 the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# 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, 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 http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, 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). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, 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. - -QHG_LOCATION = - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to FRAME, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. Other possible values -# for this tag are: HIERARCHIES, which will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list; -# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which -# disables this behavior completely. For backwards compatibility with previous -# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE -# respectively. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = 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. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -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. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# 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. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE 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. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need 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. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are 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 -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -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). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES 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 this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Options related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO - diff --git a/core.lv2/INSTALL b/core.lv2/INSTALL deleted file mode 100644 index da0ae59..0000000 --- a/core.lv2/INSTALL +++ /dev/null @@ -1,52 +0,0 @@ -This software requires only Python to build. - -= LV2 Core package instructions = - -This package contains a header file, pkg-config file, and an LV2 bundle; -there is no code that requires compiling (i.e. this is NOT a library). -Accordingly, the versioning scheme is simpler than a library: the major -number is the version number of the LV2 specification, and the minor -number is the version of this package. There is no 'micro' number. - -The configure option --bundle-only can be used to install only the bundle. -This can be used in conjunction with the --lv2-user option to install -only the bundle to the user-specific (i.e. in your home directory) LV2 -path, if you do not have write access to the system. - -Distribution packages should install everything, as apps may depend -on 'lv2core' (via pkg-config) to ensure both the header and data -bundle are present. - - -= Generic waf instructions = - -Like an auto* project, building has three phases: - - -* Configure: ./waf configure [OPTIONS] - - Example: - ./waf configure --prefix=/some/where - - The default prefix is /usr/local - - -* Build: ./waf [OPTIONS] - - Example: - ./waf - - -* Install: ./waf install [OPTIONS] - - The environment variable DESTDIR can be used to add any prefix to - the install paths (useful for packaging). Example: - - DESTDIR=/home/drobilla/packages ./waf install - - -*** IMPORTANT: You must use absolute paths everywhere - - -Run './waf --help' for detailed option information. - diff --git a/core.lv2/README b/core.lv2/README deleted file mode 100644 index ebb33a0..0000000 --- a/core.lv2/README +++ /dev/null @@ -1,30 +0,0 @@ -LV2 ---- - -LV2 is a standard for plugins and matching host applications, primarily -targeted at audio processing and generation. - -LV2 is a successor to LADSPA, created to address the limitations of LADSPA -which many applications have outgrown. Compared to LADSPA, all plugin data -is moved from the code to a separate data file, and the code has been made as -generic as possible. As a result, LV2 can be independently extended -(retaining compatibility wherever possible), and virtually any feasible -plugin features can be implemented in an LV2 plugin. - -More information about LV2 can be found at <http://lv2plug.in>. - -This package is the "core" LV2 specification in usual source package form. -The major version of this package refers to the LV2 specification revision -contained, while the minor version refers only to this package. - -Application authors aren't required to depend on this package (including lv2.h -in source distributions is acceptable) but any system with LV2 plugins should -have the LV2 bundle contained in this package installed somewhere in the LV2 -path (it contains plugin classes and other useful information). - -Please see README file for installation instructions (this package doesn't -really fit into the usual 'library', 'program', etc. categories). - -Distributions are encouraged to include this package. - - -- David Robillard <d@drobilla.net> diff --git a/core.lv2/autowaf.py b/core.lv2/autowaf.py deleted file mode 120000 index 4410d0d..0000000 --- a/core.lv2/autowaf.py +++ /dev/null @@ -1 +0,0 @@ -../autowaf.py
\ No newline at end of file diff --git a/core.lv2/lv2.h b/core.lv2/lv2.h deleted file mode 100644 index f1758cf..0000000 --- a/core.lv2/lv2.h +++ /dev/null @@ -1,305 +0,0 @@ -/* LV2 - An audio plugin interface specification - * Revision 4 - * - * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, - * Stefan Westerfeld. - * Copyright (C) 2006-2010 Steve Harris, David Robillard. - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, - * or (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - * USA. - */ - -/** @file lv2.h - * C header for the LV2 specification <http://lv2plug.in/ns/lv2core>. - * Revision: 4 - */ - -#ifndef LV2_H_INCLUDED -#define LV2_H_INCLUDED - -#include <stdint.h> - -#ifdef __cplusplus -extern "C" { -#endif - - -/** Plugin Handle. - * - * This plugin handle indicates a particular instance of the plugin - * concerned. It is valid to compare this to NULL (0 for C++) but - * otherwise the host MUST NOT attempt to interpret it. The plugin - * may use it to reference internal instance data. */ -typedef void * LV2_Handle; - - -/** Feature data. - * - * These are passed to a plugin's instantiate method to represent a special - * feature the host has which the plugin may depend on. This is to allow - * extensions to the LV2 specification without causing any breakage. - * Extensions may specify what data needs to be passed here. The base - * LV2 specification does not define any features; hosts are not required - * to use this facility. */ -typedef struct _LV2_Feature { - - /** A globally unique, case-sensitive identifier for this feature. - * - * This MUST be defined in the specification of any LV2 extension which - * defines a host feature. */ - const char * URI; - - /** Pointer to arbitrary data. - * - * This is to allow hosts to pass data to a plugin (simple values, data - * structures, function pointers, etc) as part of a 'feature'. The LV2 - * specification makes no restrictions on the contents of this data. - * The data here MUST be cleary defined by the LV2 extension which defines - * this feature. - * If no data is required, this may be set to NULL. */ - void * data; - -} LV2_Feature; - - -/** Descriptor for a Plugin. - * - * This structure is used to describe a plugin type. It provides a number - * of functions to instantiate it, link it to buffers and run it. */ -typedef struct _LV2_Descriptor { - - /** A globally unique, case-sensitive identifier for this plugin type. - * - * All plugins with the same URI MUST be compatible in terms of 'port - * signature', meaning they have the same number of ports, same port - * shortnames, and roughly the same functionality. URIs should - * probably contain a version number (or similar) for this reason. - * - * Rationale: When serializing session/patch/etc files, hosts MUST - * refer to a loaded plugin by the plugin URI only. In the future - * loading a plugin with this URI MUST yield a plugin with the - * same ports (etc) which is 100% compatible. */ - const char * URI; - - /** Function pointer that instantiates a plugin. - * - * A handle is returned indicating the new plugin instance. The - * instantiation function accepts a sample rate as a parameter as well - * as the plugin descriptor from which this instantiate function was - * found. This function must return NULL if instantiation fails. - * - * bundle_path is a string of the path to the LV2 bundle which contains - * this plugin binary. It MUST include the trailing directory separator - * (e.g. '/') so that BundlePath + filename gives the path to a file - * in the bundle. - * - * features is 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 - * SHOULD NOT use this as a discovery mechanism, instead reading the - * data file before attempting to instantiate the plugin). This array - * must always exist; if a host has no features, it MUST pass a single - * element array containing NULL (to simplify plugins). - * - * 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. */ - LV2_Handle (*instantiate)(const struct _LV2_Descriptor * descriptor, - double sample_rate, - const char * bundle_path, - const LV2_Feature *const * features); - - /** Function pointer that connects a port on a plugin instance to a memory - * location where the block of data for the port will be read/written. - * - * The data location is expected to be of the type defined in the - * plugin's data file (e.g. an array of float for an lv2:AudioPort). - * Memory issues are managed by the host. The plugin must read/write - * the data at these locations every time run() is called, data - * present at the time of this connection call MUST NOT be - * considered meaningful. - * - * The host MUST NOT try to connect a data buffer to a port index - * that is not defined in the RDF data for the plugin. If it does, - * the plugin's behaviour is undefined. - * - * 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. Note that there may be realtime constraints - * on connect_port (see lv2:hardRTCapable in lv2.ttl). - * - * connect_port() MUST be called at least once for each port before - * run() is called. The plugin must pay careful attention to the block - * size passed to the run function as the block allocated may only just - * be large enough to contain the block of data (typically samples), and - * is not guaranteed to be constant. - * - * 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). - * However, overlapped buffers or use of a single buffer for both - * audio and control data may result in unexpected behaviour. - * - * 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 lv2.ttl). */ - void (*connect_port)(LV2_Handle instance, - uint32_t port, - void * data_location); - - /** Function pointer that initialises a plugin instance and activates - * 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 the plugin writer may provide - * a NULL rather than an empty function. - * - * 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(). activate() may not be called again - * unless deactivate() is called first (after which activate() may be - * called again, followed by deactivate, etc. etc.). 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 a call to - * activate(). */ - void (*activate)(LV2_Handle instance); - - /** Function pointer that runs a plugin instance for a block. - * - * Two parameters are required: the first is a handle to the particular - * instance to be run and the second indicates the block size (in - * samples) for which the plugin instance may run. - * - * Note that if an activate() function exists then it must be called - * before run(). If deactivate() is called for a plugin instance then - * the plugin instance may not be reused 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 lv2.ttl). */ - void (*run)(LV2_Handle instance, - uint32_t sample_count); - - /** This is the counterpart to activate() (see above). If there is - * nothing for deactivate() to do then the plugin writer may provide - * a NULL rather than an empty function. - * - * Hosts must deactivate all activated units 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. Note that connect_port() may be called before or - * after a call to deactivate(). - * - * Note that deactivation is not similar to pausing as the plugin - * instance will be reinitialised when activate() is called to reuse it. - * Hosts MUST NOT call deactivate() unless activate() was previously - * called. */ - void (*deactivate)(LV2_Handle instance); - - /** This is the counterpart to instantiate() (see above). Once an instance - * of a plugin has been finished with it can 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); - - /** Function pointer that can be used to return additional instance data for - * a plugin defined by some extenion (e.g. a struct containing additional - * function pointers). - * - * The actual type and meaning of the returned object MUST be specified - * precisely by the extension if it defines any extra data. If a particular - * extension does not define extra instance data, this function MUST return - * NULL for that extension's URI. If a plugin does not support any - * extensions that define extra instance data, this function pointer may be - * set to NULL rather than providing an empty function. - * - * The only parameter is the URI of the extension. The plugin MUST return - * NULL if it does not support the extension, but hosts SHOULD NOT use this - * as a discovery method (e.g. hosts should only call this function for - * extensions known to be supported by the plugin from the data file). - * - * The host is never responsible for freeing the returned value. - * - * NOTE: This function should return a struct (likely containing function - * pointers) and NOT a direct function pointer. Standard C and C++ do not - * allow type casts from void* to a function pointer type. To provide - * additional functions a struct should be returned containing the extra - * function pointers (which is valid standard code, and a much better idea - * for extensibility anyway). */ - const void* (*extension_data)(const char * uri); - -} LV2_Descriptor; - - -/** Accessing Plugins. - * - * The exact mechanism by which plugins are loaded is host and system - * dependent, however all hosts need to know is the URI of the plugin they - * wish to load. Documentation on best practices for plugin discovery can - * be found at <http://lv2plug.in>, however it is expected that hosts use - * a library to provide this functionality. - * - * A plugin programmer MUST include a function called "lv2_descriptor" - * with the following function prototype within the shared object - * file. This function will have C-style linkage (if you are using - * C++ this is taken care of by the 'extern "C"' clause at the top of - * this file). - * - * A host will find the plugin shared object file by one means or another, - * find the lv2_descriptor() function, call it, and proceed from there. - * - * Plugin types are accessed by index (not ID) using values from 0 - * upwards. Out of range indexes MUST result in this function returning - * NULL, so the plugin count can be determined by checking for the least - * index that results in NULL being returned. Index has no meaning, - * hosts MUST NOT depend on it remaining constant (e.g. when serialising) - * in any way. */ -const LV2_Descriptor * lv2_descriptor(uint32_t index); - - -/** Datatype corresponding to the lv2_descriptor() function. */ -typedef const LV2_Descriptor * -(*LV2_Descriptor_Function)(uint32_t index); - - -/* Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded - * by the host as a symbol from the dynamic library. */ -#ifdef WIN32 -#define LV2_SYMBOL_EXPORT __declspec(dllexport) -#else -#define LV2_SYMBOL_EXPORT -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* LV2_H_INCLUDED */ diff --git a/core.lv2/lv2.ttl b/core.lv2/lv2.ttl deleted file mode 100644 index c3abdbf..0000000 --- a/core.lv2/lv2.ttl +++ /dev/null @@ -1,811 +0,0 @@ -# RDF Schema for LV2 plugins -# PROVISIONAL Revision 4 -# -# This document describes the classes and properties that are defined by the -# core LV2 specification. See <http://lv2plug.in> for more information. -# -# Copyright (C) 2006-2009 Steve Harris, David Robillard -# -# 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. - -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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 xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -#################### -## Resource Class ## -#################### - -lv2:Resource a rdfs:Class ; - rdfs:comment """ -An LV2 Resource (e.g. plugin, specification, or any other LV2 related thing) -""" . - - -######################### -## Specification Class ## -######################### - -lv2:Specification a rdfs:Class ; - rdfs:subClassOf lv2:Resource ; - rdfs:comment """ -An LV2 specification (i.e. this specification, or an LV2 "extension"). - -Specification data, like plugin data, is distributed in standardized bundles -so hosts may discover all present LV2 data. See http://lv2plug.in/docs for -more details. -""" . - - -####################### -## LV2 Specification ## -####################### - -<http://lv2plug.in/ns/lv2core> - a doap:Project , lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2" ; - doap:homepage <http://lv2plug.in> ; - doap:created "2004-04-21" ; - doap:shortdesc "An audio plugin interface specification" ; - doap:programming-language "C" ; - doap:release [ - doap:revision "4" ; - doap:created "2009-08-16" - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Steve Harris" ; - foaf:homepage <http://plugin.org.uk/> ; - rdfs:seeAlso <http://plugin.org.uk/swh.xrdf> - ] , [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; rdfs:comment """ -<h4>Overview</h4> -There are a large number of open source and free software synthesis packages in -use or development at this time. This API ("LV2") attempts to give programmers -the ability to write simple "plugin" audio processors in C/C++ and link -them dynamically ("plug" them) into a range of these packages ("hosts"). -It should be possible for any host and any plugin to communicate completely -through this interface. - -This API is deliberately as short and simple as possible. The information -required to use a plugin is in a companion data (RDF) file. The shared -library portion of the API does not contain enough information to make use -of the plugin possible; the data file is mandatory. - -Plugins can operate on any type of data. Plugins have "ports" that are -inputs or outputs and each plugin is "run" for a "block" corresponding to -a short time interval measured in samples. The plugin may assume that all -its input and output ports have been connected to the relevant data location -(using the connect_port() function) before it is asked to run, unless the -port has been set "connection optional" in the plugin's data file. - -This "core" specification defines two types of port data, equivalent to those -in LADSPA: control rate and audio rate. Audio rate data is communicated using -arrays with one <code>float</code> element per sample processed, allowing -a block of audio to be processed by the plugin in a single pass. Control -rate data is communicated using single <code>float</code> values. Control -rate data has a single value at the start of a call to the run() function -which is considered valid for the duration of the call to run(). Thus the -"control rate" is determined by the block size, controlled by the host. - -Plugins reside in shared object files suitable for dynamic linking (e.g. by -dlopen() and family). This file provides one or many plugins via the -lv2_descriptor() function. These plugins can be instantiated to create -"plugin instances", which can be connected together to perform tasks. - -This API contains very limited error-handling. - -<h4>Threading Rules</h4> Certain hosts may need to call the functions -provided by a plugin from multiple threads. For this to be safe, the plugin -must be written so that those functions can be executed simultaneously -without problems. To facilitate this, the functions provided by a plugin -are divided into classes: - -<dl> -<dt>Discovery Class</dt> -<dd>lv2_descriptor(), extension_data()</dd> -<dt>Instantiation Class</dt> -<dd>instantiate(), cleanup(), activate(), deactivate()</dd> -<dt>Audio Class</dt> -<dd>run(), connect_port()</dd> -</dl> - -Extensions to this specification which add new functions MUST declare in -which of these classes the functions belong, or define new classes for them. -The rules that hosts MUST follow are: - -<ul> -<li>When a function is running for a plugin instance, no other - function in the same class may run for that instance.</li> -<li>When a function from the Discovery class is running, no other - functions in the same shared object file may run.</li> -<li>When a function from the Instantiation class is running for a plugin - instance, no other functions for that instance may run.</li> -</ul> -Any simultaneous calls that are not explicitly forbidden by these rules -are allowed. For example, a host may call run() for two different plugin -instances simultaneously. -""" . - - - -############################# -## Template/Plugin Classes ## -############################# - -lv2:Template a rdfs:Class ; - rdfs:subClassOf lv2:Resource ; - rdfs:comment """ -An abstract plugin-like resource that may not actually be an LV2 plugin -(e.g. may not actually have a plugin binary). A Template is a Resource -that may have ports, and otherwise mimic the structure of a plugin. -This should be subclassed by extensions that define such things. -""" . - -lv2:Plugin a rdfs:Class ; - rdfs:subClassOf lv2:Template ; - rdfs:label "Plugin" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty rdf:type ; - owl:hasValue lv2:Plugin ; - rdfs:comment """ -A Plugin MUST have at least one rdf:type that is lv2:Plugin. -""" ] , [ - a owl:Restriction ; - owl:onProperty doap:name ; - owl:someValuesFrom xsd:string ; - rdfs:comment """ -A Plugin MUST have at least one doap:name that is a string -with no language tag. -""" ] ; - rdfs:comment """ -The class which represents an LV2 plugin. - -Plugins SHOULD have a doap:license property whenever possible. -The doap:name property should be at most a few words in length using title -capitalization, e.g. "Tape Delay Unit". Use doap:shortdesc or -doap:description for more detailed descriptions. -""" . - - - -################## -## Port Classes ## -################## - -lv2:Port a rdfs:Class ; - rdfs:subClassOf lv2:Resource ; - rdfs:label "Port" ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty rdf:type ; - owl:someValuesFrom [ - a owl:DataRange ; - owl:oneOf ( lv2:Port lv2:InputPort lv2:OutputPort ) - ] ; - rdfs:comment """ -A Port MUST have at least one rdf:type with object either lv2:Port, -lv2:InputPort, or lv2:OutputPort. -""" ] , [ - a owl:Restriction ; - owl:onProperty rdf:type ; - owl:minCardinality 2 ; - rdfs:comment """ -A Port MUST have at least two rdf:type properties with objects that are some -subclass of lv2:Port (one for lv2:Port, lv2:InputPort, or lv2:OutputPort, -and another to describe the specific data type, e.g. lv2:AudioPort). -""" ] , [ - a owl:Restriction ; - owl:onProperty lv2:index ; - owl:someValuesFrom xsd:decimal ; - owl:cardinality 1 ; - rdfs:comment """ -A port MUST have a single lv2:index which is of type xsd:decimal (e.g. a -literal integer in Turtle). -""" ] , [ - a owl:Restriction ; - owl:onProperty lv2:symbol ; - owl:someValuesFrom xsd:string ; - rdfs:comment """ -A port MUST have a single lv2:symbol which is of type xsd:string with no -language tag. -""" ] , [ - a owl:Restriction ; - owl:onProperty lv2:name ; - owl:someValuesFrom xsd:string ; - rdfs:comment """ -A port MUST have at least one lv2:name which is of type xsd:string. -""" ] ; - rdfs:comment """ -The class which represents an LV2 port. - -In order for it to be used by a host it MUST have at least -the following properties: - rdf:type (with object one of lv2:Port, lv2:InputPort, lv2:OutputPort) - rdf:type (more specific port class, see below) - lv2:index - lv2:symbol - lv2:name - -All LV2 port descriptions MUST have a property rdf:type where the object is -one of lv2:Port lv2:InputPort or lv2:OutputPort. Additionally there MUST -be at least one other rdf:type property which more specifically describes -type of the port (e.g. lv2:AudioPort). - -Hosts that do not support a specific port class MUST NOT instantiate the -plugin, unless that port has the connectionOptional property set (in which case -the host can simply "connect" that port to NULL). If a host is interested -in plugins to insert in a certain signal path (e.g. stereo audio), it SHOULD -consider all the classes of a port to determine which ports are most suitable -for connection (e.g. by ignoring ports with additional classes the host does -not recognize). - -A port has two identifiers - a (numeric) index, and a (textual) symbol. -The index can be used as an identifier at run-time, but persistent references -to ports (e.g. in a saved preset) MUST use the symbol. A symbol is guaranteed -to refer to the same port on all plugins with a given URI. An index does NOT -necessarily refer to the same port on all plugins with a given URI (i.e. the -index for a port may differ between plugin binaries). -""" . - -lv2:InputPort a rdfs:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Input port" ; - rdfs:comment """ -Ports of this type will be connected to a pointer to some value, which will -be read by the plugin during their run method. -""" . - -lv2:OutputPort a rdfs:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Output port" ; - rdfs:comment """ -Ports of this type will be connected to a pointer to some value, which will -be written to by the plugin during their run method. -""" . - -lv2:ControlPort a rdfs:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Control port" ; - rdfs:comment """ -Ports of this type will be connected to a pointer to a single value conforming -to the 32bit IEEE-754 floating point specification. -""" . - -lv2:AudioPort a rdfs:Class ; - rdfs:subClassOf lv2:Port ; - rdfs:label "Audio port" ; - rdfs:comment """ -Ports of this type will be connected to an array of length SampleCount -conforming to the 32bit IEEE-754 floating point specification. -""" . - - -##################################### -## Mandatory Plugin RDF Properties ## -##################################### - -lv2:port a rdf:Property ; - rdfs:domain lv2:Template ; - rdfs:range lv2:Port ; - rdfs:label "port" ; - rdfs:comment "Relates a Template or Plugin to the Ports it contains" . - -lv2:revision a rdf:Property ; - rdfs:domain lv2:Resource ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "revision" ; - rdfs:comment """ -The revision of an LV2 Resource. If a plugin's port indices change, the -revision of the plugin MUST be increased. Note that if port symbols -change or are removed, the plugin URI MUST be changed, the revision acts -as a 'minor version' to distinguish otherwise compatible revisions of -a plugin. A plugin that has changed indices MUST have a lv2:revision -property, if a plugin has no revision property it is assumed to be 0. - -Anything that refers to a specific revision of a plugin (e.g. a serialisation -that depends on specific port indices) MUST refer to the plugin by URI along -with the revision. - -This property may be used for other objects, in this case it should be -used in a similar way to represent a 'minor version', and NOT as a major -version to distinguish incompatible objects (use the URI for that). -""" . - - -#################################### -## Optional Plugin RDF Properties ## -#################################### - -lv2:basicXHTML a rdfs:Class ; - rdfs:seeAlso <http://www.w3.org/TR/xhtml1/> ; - rdfs:seeAlso <http://www.w3.org/TR/xhtml-modularization/> ; - rdfs:comment """ -A very basic subset of XHTML for use with lv2:documentation, intended to be -reasonable for hosts to support for styled inline documentation. - -A literal with this data type is an XHTML 1.0 fragment containing only -tags from the following XHTML modules: text, hypertext, list, basic tables, -image, presentation. See the XHTML and XHTML Modularization specifications -for details. A literal with this data type must be legal to insert as the -body of a <div> tag (free text is allowed). - -If only basicXHTML documentation is given but a host has no facilities for -handling tags, simply stripping tags and inserting newlines after appropriate -tags will yield a somewhat readable plain text version of the documentation. -""" . - -lv2:documentation a rdf:Property ; - rdfs:domain lv2:Resource ; - rdfs:label "documentation" ; - rdfs:comment """ -Relates a Plugin to some text/audio/video documentation either online or -included with the plugin package. The value of this property may be either a -URL, or a literal of any type. Literal documentation SHOULD be either plain -text, or lv2:basicXHTML. More advanced documentation should be linked to instead. -""" . - - - -################################### -## Mandatory Port RDF Properties ## -################################### - -lv2:index a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "index" ; - rdfs:comment """ -Specifies the index of the port, passed as an argument to the connect port -function. The index uniqely identifies the port on an instance of the plugin. -""" . - -lv2:symbol a rdf:Property ; - rdfs:domain lv2:Resource ; - rdfs:label "symbol" ; - rdfs:comment """ -A short name used as a machine and human readable identifier. - -The first character must be one of _, a-z or A-Z and subsequenct characters can -be from _, a-z, A-Z and 0-9. - -A language tag MUST NOT be used on this property. The symbol uniquely -identifies the port on a plugin with a given URI (i.e. the plugin author MUST -change the plugin URI if a port symbol is changed or removed). -""" . - -lv2:name a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:label "name" ; - rdfs:comment """ -A display name for labeling the Port in a user interface. - -This property is required for Ports, but MUST NOT be used by the host for -port identification. The plugin author may change the values of this -property without changing the Plugin URI. -""" . - - - -################################## -## Optional Port RDF Properties ## -################################## - -lv2:Point a rdfs:Class ; - rdfs:label "Port value point" ; - rdfs:comment """ -Used to describe interesting values in a Port's range. To be valid it -requires two properties: rdfs:label and rdf:value. - -There are 3 specially defined Points in the LV2 specification (default, -minimum, and maximum), though future extensions may define more. -""" . - -lv2:ScalePoint a rdfs:Class ; - rdfs:subClassOf lv2:Point ; - rdfs:comment "A single lv2:float Point (for control inputs)" . - -lv2:scalePoint a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range lv2:ScalePoint ; - rdfs:label "Scale point" ; - rdfs:comment "Relates a Port to its ScalePoints." . - -lv2:default a rdf:Property ; - rdfs:subPropertyOf lv2:scalePoint ; - rdfs:label "Default value" ; - rdfs:comment """ -The default value that the host SHOULD set this port to when there is no -other information available. -""" . - -lv2:minimum a rdf:Property ; - rdfs:subPropertyOf lv2:scalePoint ; - rdfs:label "Minimum value" ; - rdfs:comment """ -A hint to the host for the minimum useful value that the port will use. -This is a "soft" limit - the plugin is required to gracefully accept all -values in the range of lv2:float. -""" . - -lv2:maximum a rdf:Property ; - rdfs:subPropertyOf lv2:scalePoint ; - rdfs:label "Maximum value" ; - rdfs:comment """ -A hint to the host for the maximum useful value that the port will use. -This is a "soft" limit - the plugin is required to gracefully accept all -values in the range of lv2:float. -""" . - - - -############## -## Features ## -############## - -lv2:Feature a rdfs:Class ; - rdfs:subClassOf lv2:Resource ; - rdfs:label "Feature" ; - rdfs:comment "An additional feature which a plugin may use or require.". - -lv2:optionalFeature a rdf:Property ; - rdfs:domain lv2:Resource ; - rdfs:range lv2:Feature ; - rdfs:label "Optional feature" ; - rdfs:comment """ -Signifies that a plugin or other resource supports a certain features. -If the host supports this feature, it MUST pass its URI and any additional -data to the plugin in the instantiate() function. The plugin MUST NOT fail to -instantiate if an optional feature is not supported by the host. -This predicate may be used by extensions for any type of subject. -""" . - -lv2:requiredFeature a rdf:Property ; - rdfs:domain lv2:Resource ; - rdfs:range lv2:Feature ; - rdfs:label "Required feature" ; - rdfs:comment """ -Signifies that a plugin or other resource requires a certain feature. -If the host supports this feature, it MUST pass its URI and any additional -data to the plugin in the instantiate() function. The plugin MUST fail to -instantiate if a required feature is not present; hosts SHOULD always check -this before attempting to instantiate a plugin (i.e. discovery by attempting -to instantiate is strongly discouraged). -This predicate may be used by extensions for any type of subject. -""" . - - -#################### -## PortProperties ## -#################### - -lv2:PortProperty a rdfs:Class ; - rdfs:label "Port property" ; - rdfs:comment """ -A port property - a useful piece of information that allows a host to make more -sensible decisions (e.g. to provide a better interface). -""" . - -lv2:portProperty a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range lv2:PortProperty ; - rdfs:label "Port property" ; - rdfs:comment """ -Relates Ports to PortProperties. The PortProperty may be ignored without -catastrophic effects, though it may be useful e.g. for providing a sensible -interface for the port. -""" . - - -####################### -## Standard Features ## -####################### - -lv2:isLive a lv2:Feature ; - rdfs:label "Has a live (realtime) dependency" ; - rdfs:comment """ -Indicates that the plugin has a real-time dependency (e.g. queues data from -a socket) and so its output must not be cached or subject to significant -latency, and calls to the run method should be done in rapid succession. -This property is not related to "hard real-time" execution requirements -(see lv2:hardRTCapable). -""" . - -lv2:inPlaceBroken a lv2:Feature ; - rdfs:label "in-place broken" ; - rdfs:comment """ -Indicates that the plugin may cease to work correctly if the host elects -to use the same data location for both audio input and audio output. -Plugins that will fail to work correctly if ANY input buffer for a port of -the class lv2:AudioPort is set to the same location as ANY output buffer for -a port of the same class (with connect_port()) MUST require this Feature. -Doing so should be avoided as it makes it impossible for hosts to use the -plugin to process audio "in-place". -""" . - -lv2:hardRTCapable a lv2:Feature ; - rdfs:label "Hard realtime capable" ; - rdfs:comment """ -Indicates that the plugin is capable of running not only in a conventional host -but also in a "hard real-time" environment. To qualify for this the plugin MUST -satisfy all of the following: - - (1) The plugin must not use malloc(), free() or other heap memory - management within its Audio class functions. All new memory used in - Audio class functions must be managed via the stack. These restrictions - only apply to the Audio class functions. - - (2) The plugin will not attempt to make use of any library - functions in its Audio class functions, with the exceptions of functions - in the ANSI standard C and C maths libraries, which the host is expected to - provide. - - (3) The plugin will not access files, devices, pipes, sockets, IPC - or any other mechanism that might result in process or thread - blocking within its Audio class functions. - - (4) The plugin will take an amount of time to execute a run() call - approximately of form (A+B*SampleCount) where A and B depend on the - machine and host in use. This amount of time may not depend on input - signals or plugin state. The host is left the responsibility to perform - timings to estimate upper bounds for A and B. The plugin will also take an - approximately constant amount of time to execute a connect_port() call. -""" . - - -############################# -## Standard PortProperties ## -############################# - -lv2:connectionOptional a lv2:PortProperty ; - rdfs:label "Optionally connected port" ; - rdfs:comment """ -Indicates that this port does not have to be connected to valid data by the -host. If it is to be disconnected then the port MUST set to NULL with a call -to the connectPort method. -""" . - -lv2:reportsLatency a lv2:PortProperty ; - rdfs:label "Latency reporting port" ; - rdfs:comment """ -Indicates that the port is used to express the processing latency incurred by -the plugin, expressed in samples. The latency may be affected by the current -sample rate, plugin settings, or other factors, and may be changed by the -plugin at any time. Where the latency is frequency dependent the plugin may -choose any appropriate value. If a plugin introduces latency it MUST provide -EXACTLY ONE port with this property set which informs the host of the "correct" -latency. In "fuzzy" cases the value output should be the most reasonable based -on user expectation of input/output alignment (eg. musical delay/echo plugins -should not report their delay as latency, as it is an intentional effect). -""" . - -lv2:toggled a lv2:PortProperty ; - rdfs:label "Toggled" ; - rdfs:comment """ -Indicates that the data item should be considered a Boolean toggle. Data less -than or equal to zero should be considered "off" or "false", and data above -zero should be considered "on" or "true". -""" . - -lv2:sampleRate a lv2:PortProperty ; - rdfs:label "Sample rate" ; - rdfs:comment """ -Indicates that any bounds specified should be interpreted as multiples of the -sample rate. For instance, a frequency range from 0Hz to the Nyquist frequency -(half the sample rate) could be requested by this property in conjunction with -lv2:minimum 0.0 and lv2:maximum 0.5. -Hosts that support bounds at all MUST support this property. -""" . - -lv2:integer a lv2:PortProperty ; - rdfs:label "Integer" ; - rdfs:comment """ -Indicates that a port's reasonable values are integers (eg. a user interface -would likely wish to provide a stepped control allowing only integer input). -A plugin MUST operate reasonably even if such a port has a non-integer input. -""" . - -lv2:enumeration a lv2:PortProperty ; - rdfs:label "Enumeration" ; - rdfs:comment """ -Indicates that a port's only reasonable values are the scale points defined for -that port. Though a host SHOULD NOT allow a user to set the value of such a -port to anything other than a scale point. A plugin MUST operate reasonably -even if such a port has an input that is not a scale point, preferably by -simply choosing the largest enumeration value less than or equal to the -actual input value (i.e. round the input value down). -""" . - - - -#################### -## Plugin Classes ## -#################### - -lv2:GeneratorPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Generator" ; - rdfs:comment """ -Any plugin that generates sound internally, rather than processing its input. -""" . - -lv2:InstrumentPlugin a rdfs:Class ; - rdfs:subClassOf lv2:GeneratorPlugin ; - rdfs:label "Instrument" ; - rdfs:comment """ -Any plugin that is intended to be played as a musical instrument. -""" . - -lv2:OscillatorPlugin a rdfs:Class ; - rdfs:subClassOf lv2:GeneratorPlugin ; - rdfs:label "Oscillator" . - -lv2:UtilityPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Utility" ; - rdfs:comment """ -Includes things like mathematical functions and non-musical delays. -""" . - -lv2:ConverterPlugin a rdfs:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Converter" ; - rdfs:comment """ -Any plugin that converts some form of input into a different form of output. -""" . - -lv2:AnalyserPlugin a rdfs:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Analyser" ; - rdfs:comment """ -Any plugin that analyses input to output some useful information. -""" . - -lv2:MixerPlugin a rdfs:Class ; - rdfs:subClassOf lv2:UtilityPlugin ; - rdfs:label "Mixer" ; - rdfs:comment """ -A plugin which mixes some number of inputs into some number of outputs. -""" . - -lv2:SimulatorPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Simulator" ; - rdfs:comment """ -Plugins that aim to duplicate the effect of some environmental effect or -musical equipment. -""" . - -lv2:DelayPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Delay" ; - rdfs:comment """ -Plugins that intentionally delay their input signal as an effect. -""" . - -lv2:ModulatorPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Modulator" . - -lv2:ReverbPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:subClassOf lv2:SimulatorPlugin ; - rdfs:subClassOf lv2:DelayPlugin ; - rdfs:label "Reverb" . - -lv2:PhaserPlugin a rdfs:Class ; - rdfs:subClassOf lv2:ModulatorPlugin ; - rdfs:label "Phaser" . - -lv2:FlangerPlugin a rdfs:Class ; - rdfs:subClassOf lv2:ModulatorPlugin ; - rdfs:label "Flanger" . - -lv2:ChorusPlugin a rdfs:Class ; - rdfs:subClassOf lv2:ModulatorPlugin ; - rdfs:label "Chorus" . - -lv2:FilterPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Filter" . - -lv2:LowpassPlugin a rdfs:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Lowpass" . - -lv2:BandpassPlugin a rdfs:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Bandpass" . - -lv2:HighpassPlugin a rdfs:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Highpass" . - -lv2:CombPlugin a rdfs:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Comb" . - -lv2:AllpassPlugin a rdfs:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Allpass" . - -lv2:EQPlugin a rdfs:Class ; - rdfs:subClassOf lv2:FilterPlugin ; - rdfs:label "Equaliser" . - -lv2:ParaEQPlugin a rdfs:Class ; - rdfs:subClassOf lv2:EQPlugin ; - rdfs:label "Parametric" . - -lv2:MultiEQPlugin a rdfs:Class ; - rdfs:subClassOf lv2:EQPlugin ; - rdfs:label "Multiband" . - -lv2:SpectralPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Spectral Processor" . - -lv2:PitchPlugin a rdfs:Class ; - rdfs:subClassOf lv2:SpectralPlugin ; - rdfs:label "Pitch Shifter" . - -lv2:AmplifierPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Amplifier" . - -lv2:DistortionPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Distortion" . - -lv2:WaveshaperPlugin a rdfs:Class ; - rdfs:subClassOf lv2:DistortionPlugin ; - rdfs:label "Waveshaper" . - -lv2:DynamicsPlugin a rdfs:Class ; - rdfs:subClassOf lv2:Plugin ; - rdfs:label "Dynamics Processor" ; - rdfs:comment """ -Plugins that alter the envelope or dynamic range of the processed audio. -""" . - -lv2:CompressorPlugin a rdfs:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Compressor" . - -lv2:ExpanderPlugin a rdfs:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Expander" . - -lv2:LimiterPlugin a rdfs:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Limiter" . - -lv2:GatePlugin a rdfs:Class ; - rdfs:subClassOf lv2:DynamicsPlugin ; - rdfs:label "Gate" . diff --git a/core.lv2/lv2core.pc.in b/core.lv2/lv2core.pc.in deleted file mode 100644 index 5c06f73..0000000 --- a/core.lv2/lv2core.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: lv2core -Version: @LV2CORE_VERSION@ -Description: LV2 plugin header and core bundle -Libs: -Cflags: -I${includedir} diff --git a/core.lv2/manifest.ttl b/core.lv2/manifest.ttl deleted file mode 100644 index fabe17e..0000000 --- a/core.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#>. -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. - -<http://lv2plug.in/ns/lv2core> - a lv2:Specification ; - rdfs:seeAlso <lv2.ttl> . - diff --git a/core.lv2/waf b/core.lv2/waf deleted file mode 120000 index 9770e60..0000000 --- a/core.lv2/waf +++ /dev/null @@ -1 +0,0 @@ -../waf
\ No newline at end of file diff --git a/core.lv2/wscript b/core.lv2/wscript deleted file mode 100644 index b6f3daf..0000000 --- a/core.lv2/wscript +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -import sys -import autowaf -import Options - -# Version of this package (even if built as a child) -LV2CORE_VERSION = '4.0' - -# Variables for 'waf dist' -APPNAME = 'lv2core' -VERSION = LV2CORE_VERSION - -# Mandatory variables -srcdir = '.' -blddir = 'build' - -def set_options(opt): - opt.add_option('--bundle-only', action='store_true', default=False, dest='bundle_only', - help="Only install LV2 bundle (not header or pkg-config file)") - autowaf.set_options(opt) - -def configure(conf): - autowaf.configure(conf) - -def build(bld): - # Header "library" - obj = bld.new_task_gen() - obj.export_incdirs = ['.'] - obj.name = 'liblv2core' - obj.target = 'lv2core' - - if not Options.options.bundle_only: - # Header - bld.install_files('${INCLUDEDIR}', 'lv2.h') - - # Pkgconfig file - autowaf.build_pc(bld, 'LV2CORE', LV2CORE_VERSION, []) - - # Bundle (data) - bld.install_files('${LV2DIR}/lv2core.lv2', 'lv2.ttl manifest.ttl') - -def dist(): - import Scripting - Scripting.g_gz = 'gz' - Scripting.dist() diff --git a/doc/c/doxy-style.css b/doc/c/doxy-style.css new file mode 100644 index 0000000..b44675e --- /dev/null +++ b/doc/c/doxy-style.css @@ -0,0 +1,1087 @@ +html { + background: #FFF; + color: #222; +} + +body { + font-style: normal; + line-height: 1.6em; + margin-left: auto; + margin-right: auto; + padding: 1em; + max-width: 60em; + font-family: "SF Pro Text", Verdana, "DejaVu Sans", sans-serif; + text-rendering: optimizeLegibility; +} + +h1 { + font-size: 1.68em; + font-weight: 500; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + line-height: 2em; + margin: 0 0 0.25em 0; +} + +h2 { + line-height: 1.68em; + font-size: 1.41em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 1.25em 0 0.5em 0; +} + +h3 { + line-height: 1.41em; + font-size: 1.18em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 1.25em 0 0.5em 0; +} + +h4 { + line-height: 1.18em; + font-size: 1em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 1.25em 0 0.5em 0; +} + +h5, h6 { + font-size: 0.7em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 1.25em 0 0.5em 0; +} + +a { + color: #546E00; + text-decoration: none; +} + +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { + color: #444; +} + +a:hover { + text-decoration: underline; +} + +h1 a:link, h2 a:link, h3 a:link, h4 a:link, h5 a:link, h6 a:link { + color: #444; +} + +h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { + color: #444; +} + +p { + margin: 0.5em 0 0.5em 0; +} + +dt { + font-weight: 600; +} + +dd { + margin-left: 2em; +} + +caption { + font-weight: 700; +} + +.title, #projectname { + line-height: 1.0125em; + margin: 0.75em 0 0 0; +} + +.titlearea .header .titlebox, #projectname { + font-size: 1.68em; + font-weight: 400; + margin-bottom: 0.25em; + margin-top: 0; +} + +#header { + padding: 0 0 0.5em 0; + border-bottom: 1px solid #EEE; +} + +.header .headertitle .title { + line-height: 1.68em; + font-size: 1.68em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; +} + +.ingroups { + display: none; +} + +.title .ingroups a { + font-size: small; + margin-left: 1em; +} + +#titlebox, #metabox { + display: inline-block; +} + +#titlebox { + display: inline-block; + width: 75%; + left: 0; + top: 0; +} + +#title { + margin-bottom: 0.25em; + line-height: 1.25em; + font-size: 2.5em; + color: #333; + font-weight: 600; +} + +.PageDoc { + margin-top: 1.5em; +} + +.PageDoc .header .headertitle .title { + display: none; +} + +#shortdesc { + margin: 0; + color: #666; + display: inline-block; + font-style: italic; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + padding: 0; +} + +#titlearea { + margin: 0.25em auto 0 auto; + padding: 0; + position: relative; + clear: both; + line-height: 1em; +} + +.legend { + font-size: small; + text-align: center; +} + +.version { + font-size: small; + text-align: center; +} + +div.qindex,div.navtab { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.navtab { + margin-right: 15px; +} + +a.qindexHL { + background-color: #9CAFD4; + color: #FFF; + border: 1px double #869DCA; +} + +code { + color: #444; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; +} + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; +} + +pre.fragment { + border: 1px solid #C4C4C4; + background-color: #F9F9F9; + padding: 0.5em; + overflow: auto; +} + +div.ah { + background-color: #000; + font-weight: 700; + color: #FFF; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: thin solid #333; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: 700; +} + +h2.groupheader { + line-height: 1.18em; + font-size: 1em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 1.25em 0 0.5em 0; +} + +a + h2.groupheader { + display: none; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +div.contents, #content { + max-width: 60em; + margin-left: auto; + margin-right: auto; +} + +.groupheader + p { + font-style: italic; + color: #666; + margin: 0 0 1em 0; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: 700; + border: 1px solid #C4CFE5; + margin: 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0; +} + +table.memname { + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; + border-spacing: 0; +} + +table.memname tbody tr:last-child { + display: none; +} + +table.memname tbody tr:only-child { + display: table-cell; +} + +table.memname tbody tr:nth-last-child(2)::after { + content: ")"; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0; + margin-bottom: 0; + padding: 0; +} + +div.center img { + border: 0; +} + +address.footer { + text-align: right; +} + +img.footer { + border: 0; + vertical-align: middle; +} + +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; +} + +td.tiny { + font-size: x-small; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: 700; +} + +hr { + height: 0; + border: none; + border-top: 1px solid #DDD; + margin: 2em 0; +} + +#footer { + bottom: 0; + clear: both; + font-size: x-small; + margin: 2em 0 0; + padding: 0 1em 1em 1em; + vertical-align: top; + color: #888; +} + +td.ititle { + padding-bottom: 0.75em; +} + +table.memberdecls { + border-spacing: 0.125em; + line-height: 1.3em; +} + +table.memberdecls h3 { + line-height: 1.18em; + font-size: 1em; + font-weight: 600; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 1.25em 0 0.5em 0; +} + +tr.inherit_header td { + padding: 1em 0 0.5em 0; +} + +.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,.memTemplItemLeft,.memTemplItemRight,.memTemplParams { + margin: 0; + padding: 0; +} + +.mdescLeft,.mdescRight { + color: #555; +} + +.memItemLeft,.memItemRight,.memTemplParams { + border: 0; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; +} + +.memItemLeft,.memTemplItemLeft { + white-space: nowrap; + padding-left: 2em; +} + +.memItemLeft a.el { + font-weight: bold; +} + +.memTemplParams { + color: #464646; + white-space: nowrap; +} + +td.memSeparator { + display: none; +} + +td.mlabels-left { + margin-left: 0; + padding-left: 0; +} + +td.mlabels-right { + color: #B4C342; + font-weight: normal; + margin-left: 1em; + vertical-align: bottom; +} + +.memtitle { + border-bottom: 1px solid #EEE; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + font-size: 1.18em; + font-weight: 600; + line-height: 1.41em; + margin: 1.5em 0 0 0; +} + +.permalink { + display: none; +} + +.memtemplate { + color: #888; + font-style: italic; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; + font-size: small; +} + +.memnav { + background-color: #EEE; + border: 1px solid #B4C342; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin: 0 0 3em 0; +} + +.memproto { + border-bottom: 1px solid #EEE; + border-left: 1px solid #EEE; + color: #444; + float: right; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; + font-size: small; + margin-bottom: 1em; + margin-left: 1em; + padding: 0.25em 0 0.25em 0.25em; +} + +.memproto .paramname { + font-style: normal; + padding-right: 0.25em; +} + +.mlabels { + padding-left: 0; + padding-right: 0; +} + +.memdoc { + padding: 0; +} + +.memdoc > p:first-child, .memdoc .textblock > p:first-child { + font-style: italic; + color: #444; + margin-bottom: 0.75em; + margin-top: 0; + padding-top: 0.25em; + font-weight: normal; +} + +.memdoc > p:first-child, .memdoc .textblock > h3:first-child { + color: #444; + margin-bottom: 0.75em; + margin-top: 0; + padding-top: 0.25em; + font-weight: normal; + font-size: 0.9em; +} + +.paramkey { + text-align: right; +} + +.paramtype { + color: #666; + padding: 0 0.25em 0 0.25em; + white-space: nowrap; +} + +.params .paramname { + color: #111; + white-space: nowrap; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; + font-style: italic; + padding-right: 0.5em; + vertical-align: top; +} + +.fieldname { + color: #000; +} + +.fieldtable { + margin-top: 1em; + border-collapse: collapse; +} + +.fieldtable tbody tr:first-child { + display: none; +} + +td.fieldname { + vertical-align: top; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; +} + +td.fielddoc { + padding: 0.125em 0.5em 0 0.5em; + vertical-align: top; +} + +.fieldtable tbody tr td { + border-top: 1px dashed #DDD; + border-bottom: 1px dashed #DDD; +} + +td.fieldtype { + color: #666; + padding: 0 0.5em 0 0; + vertical-align: top; + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; +} + +td.fielddoc p { + margin: 0; + padding: 0 0.5em 0 0; +} + +p.reference { + font-size: x-small; + font-style: italic; +} + +.ftvtree { + font-family: "DejaVu Sans", Verdana, Helvetica, Arial, sans-serif; + margin: 0; +} + +.directory { + margin: 0.5em; +} + +.directory h3 { + margin: 0; + margin-top: 1em; + font-size: 11pt; +} + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0; +} + +.directory img { + vertical-align: -30%; +} + +td.entry { + font-family: "DejaVu Sans", Verdana, Helvetica, Arial, sans-serif; + font-weight: 400; + padding-right: 1em; +} + +.arrow { + color: #CCC; + user-select: none; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; + vertical-align: top; + visibility: hidden; +} + +td.entry b { + font-family: "DejaVu Sans", Verdana, Helvetica, Arial, sans-serif; + font-weight: 400; + font-size: 130%; +} + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0; +} + +.directory-alt img { + vertical-align: -30%; +} + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #444; +} + +table.doxtable { + border-collapse: collapse; + margin: 0.5em; +} + +table.doxtable td,table.doxtable th { + border: 1px solid #DDD; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #F3F3F3; + color: #000; + padding-bottom: 4px; + padding-top: 5px; + text-align: left; + font-weight: bold; +} + +.tabsearch { + top: 0; + left: 10px; + height: 36px; + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +div.navpath { + color: #DDD; +} + +.navpath ul { + overflow: hidden; + margin: 0; + padding: 0; +} + +.navpath li { + float: left; + padding-left: 0; + margin-left: 0.5em; + padding-right: 1em; +} + +.navpath a { + display: block; + text-decoration: none; + outline: none; +} + +div.summary { + font-size: small; + font-family: "DejaVu Sans", Verdana, Helvetica, Arial, sans-serif; + margin: 0; + padding: 0.25em 0; + display: none; +} + +div.summary a { + white-space: nowrap; +} + +#metabox { + display: inline-block; + font-size: x-small; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + position: absolute; + right: 0; + bottom: 0.25em; + color: #666; + font-style: italic; +} + +#meta { + border-style: hidden; + margin-right: 0.25em; +} + +#meta tr, #meta th, #meta td { + background-color: transparent; + border: 0; + margin: 0; + font-weight: normal; +} + +#meta th { + text-align: right; +} + +#meta th::after { + content: ":"; +} + +div.line { + font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace, fixed; + line-height: 1.4em; + white-space: pre-wrap; +} + +.glow { + background-color: #2AA198; + box-shadow: 0 0 10px #2AA198; +} + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #546E00; + background-color: #E8E8E8; + white-space: pre; +} + +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +.tabs, .tabs2, .navpath { + padding: 0.25em 0; + font-size: small; + font-family: Helvetica, Arial, "DejaVu Sans Condensed", Verdana, sans-serif; + margin: 0; +} + +th { + text-align: left; + font-size: 110%; + font-weight: 500; +} + +.mlabel { + padding: 0.125em; +} + +#navrow1, #navrow2 { + /* Disable menu from Doxygen 1.8.15, it is faked in the template */ + display: none; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + display: table-cell; + line-height: 2em; + list-style: none; + border-bottom: 0; +} + +.tablist a { + display: block; + padding: 0 1em 0 0; + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist li.current a { + color: #222; +} + +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/c/footer.html b/doc/c/footer.html new file mode 100644 index 0000000..0dc6919 --- /dev/null +++ b/doc/c/footer.html @@ -0,0 +1,20 @@ +<!-- HTML footer for doxygen 1.8.15--> +<!-- start footer part --> +<!--BEGIN GENERATE_TREEVIEW--> +<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> + <ul> + $navpath + <li class="footer">$generatedby + <a href="http://www.doxygen.org/index.html">Doxygen $doxygenversion</li> + </ul> +</div> +<!--END GENERATE_TREEVIEW--> +<!--BEGIN !GENERATE_TREEVIEW--> +<div id="footer"> + <address class="footer">$generatedby + <a href="http://www.doxygen.org/">Doxygen</a> $doxygenversion + </address> +</div> +<!--END !GENERATE_TREEVIEW--> +</body> +</html> diff --git a/doc/c/header.html b/doc/c/header.html new file mode 100644 index 0000000..2e419e3 --- /dev/null +++ b/doc/c/header.html @@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> + <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> + <!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME--> + <link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" /> + $extrastylesheet + </head> + <body> + <div id="top"><!-- do not remove this div, it is closed by doxygen! --> + + <!--BEGIN TITLEAREA--> + <div id="titlearea"> + <div id="header"> + <div id="titlebox"> + <!--BEGIN PROJECT_LOGO--> + <div id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></div> + <!--END PROJECT_LOGO--> + <!--BEGIN PROJECT_NAME--> + <h1 id="title">$projectname</h1> + <!--END PROJECT_NAME--> + <!--BEGIN PROJECT_BRIEF--> + <div id="shortdesc">$projectbrief</div> + <!--END PROJECT_BRIEF--> + </div> + <div id="metabox"> + <table id="meta"> + <!--BEGIN PROJECT_NUMBER--> + <tr><th>Version</th><td>$projectnumber</td></tr> + <!--END PROJECT_NUMBER--> + </table> + </div> + </div> + </div> + <!--END TITLEAREA--> + <!-- end header part --> diff --git a/doc/c/layout.xml b/doc/c/layout.xml new file mode 100644 index 0000000..938dbce --- /dev/null +++ b/doc/c/layout.xml @@ -0,0 +1,168 @@ +<doxygenlayout version="1.0"> + <!-- Generated by doxygen 1.8.17 --> + <!-- Navigation index tabs for HTML output --> + <navindex> + <tab type="mainpage" visible="yes" title=""/> + <tab type="pages" visible="yes" title="" intro=""/> + <tab type="modules" visible="yes" title="" intro=""/> + <tab type="namespaces" visible="yes" title=""> + <tab type="namespacelist" visible="yes" title="" intro=""/> + <tab type="namespacemembers" 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="files" visible="yes" title=""> + <tab type="filelist" visible="yes" title="" intro=""/> + <tab type="globals" visible="yes" title="" intro=""/> + </tab> + <tab type="examples" visible="yes" title="" intro=""/> + </navindex> + + <!-- Layout definition for a class page --> + <class> + <briefdescription visible="yes"/> + <detaileddescription title=""/> + <includes visible="$SHOW_INCLUDE_FILES"/> + <inheritancegraph visible="$CLASS_GRAPH"/> + <collaborationgraph visible="$COLLABORATION_GRAPH"/> + <memberdecl> + <nestedclasses visible="yes" title=""/> + <publictypes title=""/> + <services title=""/> + <publicslots title=""/> + <signals title=""/> + <publicmethods title=""/> + <publicstaticmethods title=""/> + <publicattributes title=""/> + <publicstaticattributes title=""/> + <protectedtypes title=""/> + <protectedslots title=""/> + <protectedmethods title=""/> + <protectedstaticmethods title=""/> + <protectedattributes title=""/> + <protectedstaticattributes title=""/> + <packagetypes title=""/> + <packagemethods title=""/> + <packagestaticmethods title=""/> + <packageattributes title=""/> + <packagestaticattributes title=""/> + <properties title=""/> + <events title=""/> + <privatetypes title=""/> + <privateslots title=""/> + <privatemethods title=""/> + <privatestaticmethods title=""/> + <privateattributes title=""/> + <privatestaticattributes title=""/> + <friends title=""/> + <related title="" subtitle=""/> + <membergroups visible="yes"/> + </memberdecl> + <memberdef> + <inlineclasses title=""/> + <typedefs title=""/> + <enums title=""/> + <services title=""/> + <constructors title=""/> + <functions title=""/> + <related title=""/> + <variables title=""/> + <properties title=""/> + <events title=""/> + </memberdef> + <allmemberslink visible="yes"/> + <usedfiles visible="$SHOW_USED_FILES"/> + <authorsection visible="yes"/> + </class> + + <!-- Layout definition for a file page --> + <file> + <briefdescription visible="yes"/> + <detaileddescription title=""/> + <includes visible="$SHOW_INCLUDE_FILES"/> + <includegraph visible="$INCLUDE_GRAPH"/> + <includedbygraph visible="$INCLUDED_BY_GRAPH"/> + <sourcelink visible="yes"/> + <memberdecl> + <classes visible="yes" title=""/> + <namespaces visible="yes" title=""/> + <constantgroups visible="yes" title=""/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <functions title=""/> + <variables title=""/> + <membergroups visible="yes"/> + </memberdecl> + <memberdef> + <inlineclasses title=""/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <functions title=""/> + <variables title=""/> + </memberdef> + <authorsection/> + </file> + + <!-- Layout definition for a group page --> + <group> + <briefdescription visible="yes"/> + <detaileddescription title=""/> + <groupgraph visible="$GROUP_GRAPHS"/> + <memberdecl> + <nestedgroups visible="yes" title=""/> + <dirs visible="yes" title=""/> + <files visible="yes" title=""/> + <namespaces visible="yes" title=""/> + <classes visible="yes" title=""/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <enumvalues title=""/> + <functions title=""/> + <variables title=""/> + <signals title=""/> + <publicslots title=""/> + <protectedslots title=""/> + <privateslots title=""/> + <events title=""/> + <properties title=""/> + <friends title=""/> + <membergroups visible="yes"/> + </memberdecl> + <memberdef> + <pagedocs/> + <inlineclasses title=""/> + <defines title=""/> + <typedefs title=""/> + <enums title=""/> + <enumvalues title=""/> + <functions title=""/> + <variables title=""/> + <signals title=""/> + <publicslots title=""/> + <protectedslots title=""/> + <privateslots title=""/> + <events title=""/> + <properties title=""/> + <friends title=""/> + </memberdef> + <authorsection visible="yes"/> + </group> + + <!-- Layout definition for a directory page --> + <directory> + <briefdescription visible="yes"/> + <detaileddescription title=""/> + <directorygraph visible="yes"/> + <memberdecl> + <dirs visible="yes"/> + <files visible="yes"/> + </memberdecl> + </directory> +</doxygenlayout> diff --git a/doc/c/mainpage.md b/doc/c/mainpage.md new file mode 100644 index 0000000..561bc93 --- /dev/null +++ b/doc/c/mainpage.md @@ -0,0 +1,3 @@ +This is the API documentation for LV2. + +For an index and higher level documentation, see the corresponding [specification documentation](../../ns/index.html). diff --git a/doc/c/meson.build b/doc/c/meson.build new file mode 100644 index 0000000..3ce7fdc --- /dev/null +++ b/doc/c/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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, + 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/c/reference.doxygen.in b/doc/c/reference.doxygen.in new file mode 100644 index 0000000..0b87d49 --- /dev/null +++ b/doc/c/reference.doxygen.in @@ -0,0 +1,2458 @@ +# Doxyfile 1.9.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = LV2 + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @LV2_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "An open and extensible audio plugin standard" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +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 +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# 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. +# The default value is: YES. + +BRIEF_MEMBER_DESC = NO + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "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:". 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 = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = 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++, 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). 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. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# 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: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = YES + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = YES + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = YES + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = 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 + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = YES + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if <section_label> ... \endif and \cond <section_label> +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# 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. 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/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 +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: 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 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 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. 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 + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +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). 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 = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +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/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. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# 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++, *.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 = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (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, +# 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/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# <filter> <input-file> +# +# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (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/c/mainpage.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# 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 +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# 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/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 +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what 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. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 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. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 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. + +HTML_COLORSTYLE_SAT = 30 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# 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, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# ~/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. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +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 +# 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 +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (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. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +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: +# 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. + +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: +# 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. + +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: +# 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: +# 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: +# 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 (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 = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# 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 (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. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 1 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# 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 +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# 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. 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. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# 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: +# - 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/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. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use <access key> + S +# (what the <access key> is depends on the OS and browser, but it is typically +# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down +# key> to jump into the search results window, the results can be navigated +# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel +# the search. The filter options can be selected when the cursor is inside the +# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> +# to select a filter and <Enter> or <escape> to activate or cancel the filter +# option. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# 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 +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SERVER_BASED_SEARCH = NO + +# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP +# script for searching. Instead the search results are written to an XML file +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain the +# search results. +# +# 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. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH = NO + +# The SEARCHENGINE_URL should point to a search engine hosted by a web server +# which will return the search results when EXTERNAL_SEARCH is enabled. +# +# 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. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHENGINE_URL = + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed +# search data is written to a file for indexing by an external tool. With the +# SEARCHDATA_FILE tag the name of this file can be specified. +# The default file is: searchdata.xml. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of +# to a relative location where the documentation can be found. The format is: +# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. +# The default value is: YES. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. +# +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate +# index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). +# The default file is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +MAKEINDEX_CMD_NAME = 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. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used by the +# printer. +# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x +# 14 inches) and executive (7.25 x 10.5 inches). +# The default value is: a4. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} +# If left blank no extra packages will be included. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +EXTRA_PACKAGES = + +# 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! +# 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 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. 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 = + +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the LATEX_OUTPUT output +# directory. Note that the files will be copied as-is; there are no commands or +# markers available. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_FILES = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is +# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will +# contain links (just like the HTML output) instead of page references. This +# makes the output suitable for online browsing using a PDF viewer. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PDF_HYPERLINKS = YES + +# 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. + +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. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BATCHMODE = NO + +# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the +# index chapters (such as File Index, Compound Index, etc.) in the output. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HIDE_INDICES = 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. +# The default value is: plain. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +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 + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# RTF output is optimized for Word 97 and may not look too pretty with other RTF +# readers/editors. +# The default value is: NO. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: rtf. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will +# contain hyperlink fields. The RTF file will contain links (just like the HTML +# output) instead of page references. This makes the output suitable for online +# browsing using Word or some other Word compatible readers that support those +# fields. +# +# Note: WordPad (write) and others do not support links. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. +# +# See also section "Doxygen usage" for information on how to generate the +# default style sheet that doxygen normally uses. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an RTF document. Syntax is +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# classes and files. +# The default value is: NO. + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. A directory man3 will be created inside the directory specified by +# MAN_OUTPUT. +# The default directory is: man. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to the generated +# man pages. In case the manual section does not start with a number, the number +# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is +# optional. +# The default value is: .3. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_EXTENSION = .3 + +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + +# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it +# will generate one additional man file for each entity documented in the real +# man page(s). These additional files only source the real man page, but without +# them the man command would be unable to find the correct page. +# The default value is: NO. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# captures the structure of the code including all documentation. +# The default value is: NO. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: xml. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_OUTPUT = xml + +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# listings (including syntax highlighting and cross-referencing information) to +# the XML output. Note that enabling this will significantly increase the size +# of the XML output. +# The default value is: YES. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# that can be used to generate PDF. +# The default value is: NO. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. +# The default directory is: docbook. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_OUTPUT = docbook + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# file that captures the structure of the code including all documentation. +# +# Note that this feature is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI +# output from the Perl module output. +# The default value is: NO. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# formatted so it can be parsed by a human reader. This is useful if you want to +# understand what is going on. On the other hand, if this tag is set to NO, the +# size of the Perl module output will be much smaller and Perl will parse it +# just the same. +# The default value is: YES. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file are +# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful +# so different doxyrules.make files included by the same Makefile don't +# overwrite each other's variables. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all +# C-preprocessor directives found in the sources and include files. +# The default value is: YES. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be +# performed. Macro expansion can be done in a controlled way by setting +# EXPAND_ONLY_PREDEF to YES. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then +# the macro expansion is limited to the macros specified with the PREDEFINED and +# EXPAND_AS_DEFINED tags. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES, the include files in the +# INCLUDE_PATH will be searched if a #include is found. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by the +# preprocessor. +# This tag requires that the tag SEARCH_INCLUDES is set to YES. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will be +# used. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that are +# defined before the preprocessor is started (similar to the -D option of e.g. +# gcc). The argument of the tag is a list of macros of the form: name or +# name=definition (no spaces). If the definition and the "=" are omitted, "=1" +# is assumed. To prevent a macro definition from being undefined via #undef or +# recursively expanded use the := operator instead of the = operator. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +PREDEFINED = LV2_DISABLE_DEPRECATION_WARNINGS + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this +# tag can be used to specify a list of macro names that should be expanded. The +# macro definition that is found in the sources will be used. Use the PREDEFINED +# tag if you want to use a different macro definition that overrules the +# definition found in the source code. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not +# removed. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tag files. For each tag +# file the location of the external documentation should be added. The format of +# a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where loc1 and loc2 can be relative or absolute paths or URLs. See the +# section "Linking to external documentation" for more information about the use +# of tag files. +# Note: Each tag file must have a unique name (where the name does NOT include +# the path). If a tag file is not located in the directory in which doxygen is +# run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create a +# 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 = @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 +# listed. +# The default value is: NO. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be +# listed. +# The default value is: YES. + +EXTERNAL_GROUPS = YES + +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in +# the related pages index. If set to NO, only the current project's pages will +# be listed. +# The default value is: YES. + +EXTERNAL_PAGES = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# 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. +# If left empty dia is assumed to be found in the default search path. + +DIA_PATH = + +# If set to YES the inheritance and collaboration graphs will hide inheritance +# and usage relations if the target is undocumented or is not a class. +# The default value is: YES. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz (see: +# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# Bell Labs. The other options in this section have no effect if this option is +# set to NO +# The default value is: NO. + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed +# to run in parallel. When set to 0 doxygen will base this on the number of +# processors available in the system. You can set it explicitly to a value +# larger than 0 to get control over the balance between CPU load and processing +# speed. +# Minimum value: 0, maximum value: 32, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +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. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTPATH = + +# 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. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a +# graph for each documented class showing the direct and indirect implementation +# dependencies (inheritance, containment, and class references variables) of the +# class with other documented classes. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for +# groups, showing the direct groups dependencies. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside the +# class node. If there are many fields or methods and many nodes the graph may +# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the +# number of items for each type to make the size more manageable. Set this to 0 +# for no limit. Note that the threshold may be exceeded by 50% before the limit +# is enforced. So when you set the threshold to 10, up to 15 fields may appear, +# 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 UML_LOOK is set to YES. + +UML_LIMIT_NUM_FIELDS = 10 + +# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and +# collaboration graphs will show the relations between templates and their +# instances. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +TEMPLATE_RELATIONS = YES + +# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to +# YES then doxygen will generate a graph for each documented file showing the +# direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDE_GRAPH = NO + +# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are +# set to YES then doxygen will generate a graph for each documented file showing +# the direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH tag is set to YES then doxygen will generate a call +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical +# hierarchy of all classes instead of a textual one. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the +# dependencies a directory has on other directories in a graphical way. The +# dependency relations are determined by the #include relations between the +# files in the directories. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). +# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order +# to make the SVG files visible in IE 9+ (other browsers do not have this +# requirement). +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. +# The default value is: png. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# +# Note that this requires a modern browser other than Internet Explorer. Tested +# and working are Firefox, Chrome, Safari, and Opera. +# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make +# the SVG files visible. Older versions of IE do not have SVG support. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +INTERACTIVE_SVG = NO + +# The DOT_PATH tag can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the \dotfile +# command). +# This tag requires that the tag HAVE_DOT is set to YES. + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = + +# The DIAFILE_DIRS tag can be used to specify one or more directories that +# contain dia files that are included in the documentation (see the \diafile +# command). + +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 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 = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes +# that will be shown in the graph. If the number of nodes in a graph becomes +# larger than this value, doxygen will truncate the graph, which is visualized +# by representing a node as a red box. Note that doxygen if the number of direct +# children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that +# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. +# Minimum value: 0, maximum value: 10000, default value: 50. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs +# generated by dot. A depth value of 3 means that only nodes reachable from the +# root by following a path via at most 3 edges will be shown. Nodes that lay +# further from the root node will be omitted. Note that setting this option to 1 +# or 2 may greatly reduce the computation time needed for large code bases. Also +# note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. +# Minimum value: 0, maximum value: 1000, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +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 +# this, this feature is disabled by default. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +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 +# 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. + +DOT_CLEANUP = YES diff --git a/doc/htaccess.in b/doc/htaccess.in new file mode 100644 index 0000000..ae5affe --- /dev/null +++ b/doc/htaccess.in @@ -0,0 +1,25 @@ +# Turn off MultiViews +Options -MultiViews + +# Ensure *.ttl files are served as appropriate content type and encoding +AddType 'text/turtle; charset=UTF-8' .ttl + +# Rewrite engine setup +RewriteEngine On +RewriteBase @BASE@ + +# Rewrite rule to serve HTML content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml) +RewriteCond %{HTTP_ACCEPT} text/html [OR] +RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR] +RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.* +RewriteRule ^([^.]+)$ $1.html [L] + +# Rewrite rule to serve Turtle content from the vocabulary URI if requested +RewriteCond %{HTTP_ACCEPT} text/turtle [OR] +RewriteCond %{HTTP_ACCEPT} application/x-turtle +RewriteRule ^([^.]*)$ $1.ttl [L] + +# Serve HTML page by default +RewriteRule ^$ index.html [L] +RewriteRule ^([^.]+)$ $1.html [L] diff --git a/doc/index.html.in b/doc/index.html.in new file mode 100644 index 0000000..6f3e0f9 --- /dev/null +++ b/doc/index.html.in @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>LV2 Specifications</title> + <meta http-equiv="Content-Type" + content="application/xhtml+xml;charset=utf-8" /> + <link rel="stylesheet" type="text/css" + href="../style/style.css" /> + </head> + <body> + + <!-- HEADER --> + <div id="topbar"> + <div id="header"> + <div id="titlebox"> + <h1 id="title">LV2 Specifications</h1> + </div> + <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> + <a href="http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in">(subscribe)</a> + </td> + </tr> + </table> + </div> + </div> + </div> + + <div id="content"> + + <!-- INDEX --> + <div class="section"> + <a id="sec-index"></a> + <table class="index" summary="An index of LV2 specifications"> + <thead> + <tr> + <th>Specification</th> + <th>API</th> + <th>Description</th> + <th>Version</th> + <th>Status</th> + </tr> + </thead> + <tbody> + @ROWS@ + </tbody> + </table> + </div> + + <!-- FOOTER --> + <div id="footer"> + <div> + This document is available under the + <a about="" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"> + Creative Commons Attribution-ShareAlike License + </a> + </div> + <div> + Valid + <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="dcterms:conformsTo" resource="http://www.w3.org/TR/CSS2" + href="http://jigsaw.w3.org/css-validator/check/referer"> + CSS + </a> + generated from the LV2 source distribution. + </div> + </div> + + </div> + </body> +</html> diff --git a/doc/index.php b/doc/index.php deleted file mode 100644 index e6cdd10..0000000 --- a/doc/index.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -# Content-type negotiation for LV2 specification bundles - -$rdfxml = accepts("application\/rdf\+xml"); -$turtle = accepts("application\/turtle"); -$x_turtle = accepts("application\/x-turtle"); -$text_turtle = accepts("text\/turtle"); -$json = accepts("application\/json"); -$html = accepts("text\/html"); -$xhtml = accepts("application\/xhtml\+xml"); -$text_plain = accepts("text\/plain"); - -$name = basename($_SERVER['REQUEST_URI']); - -# Return Turtle ontology -if ($turtle or $x_turtle or $text_turtle) { - header("Content-Type: application/x-turtle"); - passthru("cat ./$name.ttl"); - -# Return ontology translated into rdf+xml -} else if ($rdfxml) { - header("Content-Type: application/rdf+xml"); - passthru("~/bin/rapper -q -i turtle -o rdfxml-abbrev ./$name.ttl"); - -} else if ($json) { - header("Content-Type: application/json"); - passthru("~/bin/rapper -q -i turtle -o json ./$name.ttl"); - -# Return HTML documentation -} else if ($html or $xhtml) { - if ($html) { - header("Content-Type: text/html"); - } else { - header("Content-Type: application/xhtml+xml"); - } - $name = basename($_SERVER['REQUEST_URI']); - passthru("cat ./$name.html | sed ' -s/<\/body>/<div style=\"font-size: smaller; color: gray; text-align: right; margin: 1ex;\">This document is content-negotiated. If you request it with <code>Accept: application\/x-turtle<\/code> you will get the description in Turtle. Also supported: <code>application\/rdf+xml<\/code>, <code>application\/json<\/code>, <code>text\/plain<\/code><\/div><\/body>/'"); - -# Return NTriples (text/plain) -} else if ($text_plain) { - header("Content-Type: text/plain"); - passthru("~/bin/rapper -q -i turtle -o ntriples ./$name.ttl"); - -# Return Turtle ontology by default -} else { - header("Content-Type: application/x-turtle"); - passthru("cat ./$name.ttl"); -} - -function accepts($type) { - global $_SERVER; - if (preg_match("/$type(;q=(\d+\.\d+))?/i", $_SERVER['HTTP_ACCEPT'], $matches)) { - return isset($matches[2]) ? $matches[2] : 1; - } else { - return 0; - } -} - -?> diff --git a/doc/mainpage.dox b/doc/mainpage.dox deleted file mode 100644 index f8f0827..0000000 --- a/doc/mainpage.dox +++ /dev/null @@ -1,24 +0,0 @@ -/** @mainpage - * - * This is the documentation for the LV2 specification and its - * extensions hosted at http://lv2plug.in. - * - * An LV2 extension generally has two parts: the specification in - * <a href="http://www.w3.org/TeamSubmission/turtle/">Turtle</a> - * (e.g. ext.lv2/ext.ttl), and an accompanying - * <a href="http://en.wikipedia.org/wiki/C99">C</a> header (e.g. ext.lv2/ext.h). - * The header documentation is generated with <a href="http://doxygen.org"> - * Doxygen</a> and hyperlinked (in both directions) with the extension - * documentation generated from Turtle with - * <a href="http://drobilla.net/software/lv2specgen">lv2specgen</a>. - * - * \par Header Documentation - * \li <a href="annotated.html">Data Structures Index</a> - * \li <a href="files.html">Files Index</a> - * - * \par Extension Documentation - * \li <a href="../../lv2core">LV2 core documentation</a> - * \li <a href="../../ext">Extensions at lv2plug.in/ns/ext</a> - * \li <a href="../../extensions">Extensions at lv2plug.in/ns/extensions</a> - */ - diff --git a/doc/ns/ext/meson.build b/doc/ns/ext/meson.build new file mode 100644 index 0000000..f6ad06b --- /dev/null +++ b/doc/ns/ext/meson.build @@ -0,0 +1,67 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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..5a25184 --- /dev/null +++ b/doc/ns/extensions/meson.build @@ -0,0 +1,48 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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..aa41464 --- /dev/null +++ b/doc/ns/meson.build @@ -0,0 +1,80 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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/style.css b/doc/style.css deleted file mode 100644 index 055a707..0000000 --- a/doc/style.css +++ /dev/null @@ -1,180 +0,0 @@ -body { - color: black; - background: white; - margin: 0; -} - -:link { - color: #00C; - background: transparent; -} - -:visited { - color: #609; - background: transparent; -} - -a:active { - color: #C00; - background: transparent; -} - -h1, h2, h3, h4, h5, h6 { - text-align: left; -} - -h1, h2 { - background-color: #f2f2f2; - margin-top: 0; - color: #000; - border-bottom: 1px solid #cccccc; -} - -h1 { - padding: 1ex; - margin-bottom: 0; -} - -h2 { - border-bottom: 1px solid #b2c0dd; - padding: 0.5ex; -} - -h3 { - padding: 0; - margin: 0 0 0.75ex 0; -} - -h2 { - margin: 3ex 0 1ex 0; -} - -ul, ol { - margin: 0 1ex 2ex 1ex; -} - -.content { - margin-left: 1.5em; - margin-right: 1.5em; -} - -.label { - font-style: italic; - margin: 1ex 0 1ex 0; - } - -.index { - margin-left: 1em; -} - -.restriction { - margin: 0.5ex 0 2ex 4ex; - background-color: #eee; - padding: 0.25ex; - border: 1px solid #ddd; -} - -.description { - margin-bottom: 2ex; -} - -.blankdesc { - background-color: #eee; - margin: 0.5em; - border: 1px solid #ddd; -} - -.blankterm { - padding-right: 0.5em; -} - -.specterm { - margin-top: 1ex; - padding: 1ex; - background-color: #fafafa; - border: 1px solid #ddd; -} - -.footer { - margin-top: 3ex; - padding: 1ex; - border-top: solid #4a6aaa 1px; - text-align: right; -} - -.footer-text { - font-size: small; - color: #2a3c61; - vertical-align: top; -} - -dl { - padding: 0; - margin: 0; -} - -dt { - font-weight: bold ; - margin-top: 0.75ex; -} - -hr { - color: silver; - background-color: silver; - height: 1px; - border: 0; - margin-top: 1.5ex; - margin-bottom: 1.5ex; -} - -div.head { - margin-bottom: 1em; -} - -div.head h1 { - margin-top: 2em; - clear: both; -} - -div.head table { - margin-left: 2em; - margin-top: 2em; -} - -th { - text-align: left; -} - -td { - padding-right: 2ex; -} - -.meta { - background-color: #f9fafc; - font-size: small; - margin: 0 0 2ex 0; - padding: 1ex 0 1ex 2ex; - border-bottom: 1px solid #c4cfe5; -} - -.metahead { - padding-right: 1ex; -} - -pre { - margin-left: 2em; - color: #373; -} - -code { - color: #373; -} - -@media aural { - dt { - pause-before: 20% - } - pre { - speak-punctuation: code - } -} diff --git a/doc/style/asciidoc.css b/doc/style/asciidoc.css new file mode 100644 index 0000000..2e64544 --- /dev/null +++ b/doc/style/asciidoc.css @@ -0,0 +1,534 @@ +/* Shared CSS for AsciiDoc xhtml11 and html5 backends */ + +/* Default font. */ +body { + font-family: serif; +} + +/* Title font. */ +h1, h2, h3, h4, h5, h6, +div.title, caption.title, +thead, p.table.header, +#toctitle, +#author, #revnumber, #revdate, #revremark, +#footer { + font-family: sans-serif; +} + +body { + margin: 1em 5% 1em 5%; +} + +a { + /* color: blue; */ + color: #5e72a5; + text-decoration: underline; +} +a:visited { + color: #4c3b5b; +} + +em { + font-style: italic; + color: navy; +} + +strong { + font-weight: bold; + color: #083194; +} + +h1, h2, h3, h4, h5, h6 { + color: black; + margin-top: 1.2em; + margin-bottom: 0.5em; + line-height: 1.3; +} + +h1, h2, h3 { + border-bottom: 2px solid silver; +} +h2 { + padding-top: 0.5em; +} +h3 { + float: left; +} +h3 + * { + clear: left; +} +h5 { + font-size: 1.0em; +} + +div.sectionbody { + margin-left: 0; +} + +hr { + border: 1px solid silver; +} + +p { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +ul, ol, li > p { + margin-top: 0; +} +ul > li { color: #aaa; } +ul > li > * { color: black; } + +.monospaced, code, pre { + font-family: monospace; + font-size: inherit; + color: black; + padding: 0; + margin: 0; +} +pre { + white-space: pre-wrap; +} + +#author { + color: black; + font-weight: bold; + font-size: 1.1em; +} +#email { +} +#revnumber, #revdate, #revremark { +} + +#footer { + font-size: small; + border-top: 2px solid silver; + padding-top: 0.5em; + margin-top: 4.0em; +} +#footer-text { + float: left; + padding-bottom: 0.5em; +} +#footer-badges { + float: right; + padding-bottom: 0.5em; +} + +#preamble { + margin-top: 1.5em; + margin-bottom: 1.5em; +} +div.imageblock, div.exampleblock, div.verseblock, +div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, +div.admonitionblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.admonitionblock { + margin-top: 2.0em; + margin-bottom: 2.0em; + margin-right: 10%; + color: #606060; +} + +div.content { /* Block element content. */ + padding: 0; +} + +/* Block element titles. */ +div.title, caption.title { + color: #527bbd; + font-weight: bold; + text-align: left; + margin-top: 1.0em; + margin-bottom: 0.5em; +} +div.title + * { + margin-top: 0; +} + +td div.title:first-child { + margin-top: 0.0em; +} +div.content div.title:first-child { + margin-top: 0.0em; +} +div.content + div.title { + margin-top: 0.0em; +} + +div.sidebarblock > div.content { + background: #ffffee; + border: 1px solid #dddddd; + border-left: 4px solid #f0f0f0; + padding: 0.5em; +} + +div.listingblock > div.content { + border: 1px solid #dddddd; + border-left: 5px solid #f0f0f0; + background: #f8f8f8; + padding: 0.5em; +} + +div.quoteblock, div.verseblock { + padding-left: 1.0em; + margin-left: 1.0em; + margin-right: 10%; + border-left: 5px solid #f0f0f0; + color: #888; +} + +div.quoteblock > div.attribution { + padding-top: 0.5em; + text-align: right; +} + +div.verseblock > pre.content { + font-family: inherit; + font-size: inherit; +} +div.verseblock > div.attribution { + padding-top: 0.75em; + text-align: left; +} +/* DEPRECATED: Pre version 8.2.7 verse style literal block. */ +div.verseblock + div.attribution { + text-align: left; +} + +div.admonitionblock .icon { + vertical-align: top; + font-size: 1.1em; + font-weight: bold; + text-decoration: underline; + color: #527bbd; + padding-right: 0.5em; +} +div.admonitionblock td.content { + padding-left: 0.5em; + border-left: 3px solid #dddddd; +} + +div.exampleblock > div.content { + border-left: 3px solid #dddddd; + padding-left: 0.5em; +} + +div.imageblock div.content { padding-left: 0; } +span.image img { border-style: none; vertical-align: text-bottom; } +a.image:visited { color: white; } + +dl { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +dt { + margin-top: 0.5em; + margin-bottom: 0; + font-style: normal; + color: navy; +} +dd > *:first-child { + margin-top: 0.1em; +} + +ul, ol { + list-style-position: outside; +} +ol.arabic { + list-style-type: decimal; +} +ol.loweralpha { + list-style-type: lower-alpha; +} +ol.upperalpha { + list-style-type: upper-alpha; +} +ol.lowerroman { + list-style-type: lower-roman; +} +ol.upperroman { + list-style-type: upper-roman; +} + +div.compact ul, div.compact ol, +div.compact p, div.compact p, +div.compact div, div.compact div { + margin-top: 0.1em; + margin-bottom: 0.1em; +} + +tfoot { + font-weight: bold; +} +td > div.verse { + white-space: pre; +} + +div.hdlist { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +div.hdlist tr { + padding-bottom: 15px; +} +dt.hdlist1.strong, td.hdlist1.strong { + font-weight: bold; +} +td.hdlist1 { + vertical-align: top; + font-style: normal; + padding-right: 0.8em; + color: navy; +} +td.hdlist2 { + vertical-align: top; +} +div.hdlist.compact tr { + margin: 0; + padding-bottom: 0; +} + +.comment { + background: yellow; +} + +.footnote, .footnoteref { + font-size: 0.8em; +} + +span.footnote, span.footnoteref { + vertical-align: super; +} + +#footnotes { + margin: 20px 0 20px 0; + padding: 7px 0 0 0; +} + +#footnotes div.footnote { + margin: 0 0 5px 0; +} + +#footnotes hr { + border: none; + border-top: 1px solid silver; + height: 1px; + text-align: left; + margin-left: 0; + width: 20%; + min-width: 100px; +} + +div.colist td { + padding-right: 0.5em; + padding-bottom: 0.3em; + vertical-align: top; +} +div.colist td img { + margin-top: 0.3em; +} + +@media print { + #footer-badges { display: none; } +} + +#toc { + margin-bottom: 2.5em; +} + +#toctitle { + color: black; + font-size: 1.1em; + font-weight: bold; + margin-top: 1.0em; + margin-bottom: 0.1em; +} + +div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { + margin-top: 0; + margin-bottom: 0; +} +div.toclevel2 { + margin-left: 2em; + font-size: 0.9em; +} +div.toclevel3 { + margin-left: 4em; + font-size: 0.9em; +} +div.toclevel4 { + margin-left: 6em; + font-size: 0.9em; +} + +span.aqua { color: aqua; } +span.black { color: black; } +span.blue { color: blue; } +span.fuchsia { color: fuchsia; } +span.gray { color: gray; } +span.green { color: green; } +span.lime { color: lime; } +span.maroon { color: maroon; } +span.navy { color: navy; } +span.olive { color: olive; } +span.purple { color: purple; } +span.red { color: red; } +span.silver { color: silver; } +span.teal { color: teal; } +span.white { color: white; } +span.yellow { color: yellow; } + +span.aqua-background { background: aqua; } +span.black-background { background: black; } +span.blue-background { background: blue; } +span.fuchsia-background { background: fuchsia; } +span.gray-background { background: gray; } +span.green-background { background: green; } +span.lime-background { background: lime; } +span.maroon-background { background: maroon; } +span.navy-background { background: navy; } +span.olive-background { background: olive; } +span.purple-background { background: purple; } +span.red-background { background: red; } +span.silver-background { background: silver; } +span.teal-background { background: teal; } +span.white-background { background: white; } +span.yellow-background { background: yellow; } + +span.big { font-size: 2em; } +span.small { font-size: 0.6em; } + +span.underline { text-decoration: underline; } +span.overline { text-decoration: overline; } +span.line-through { text-decoration: line-through; } + +div.unbreakable { page-break-inside: avoid; } + + +/* + * xhtml11 specific + * + * */ + +div.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.tableblock > table { + border: 1px dashed #ccc; +} +thead, p.table.header { + font-weight: bold; + color: #527bbd; +} +p.table { + margin-top: 0; +} +th.tableblock { + font-weight: bold; + border: 1px dashed #ccc; +} +td.tableblock, th.tableblock { + border: 1px dashed #ccc; +} +/* Because the table frame attribute is overridden by CSS in most browsers. */ +div.tableblock > table[frame="void"] { + border-style: none; +} +div.tableblock > table[frame="hsides"] { + border-left-style: none; + border-right-style: none; +} +div.tableblock > table[frame="vsides"] { + border-top-style: none; + border-bottom-style: none; +} + + +/* + * html5 specific + * + * */ + +table.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +thead, p.tableblock.header { + font-weight: bold; + color: black; +} +p.tableblock { + margin-top: 0; +} +table.tableblock { + border: 0; + border-spacing: 0px; + border-style: hidden; + border-color: #ccc; + border-collapse: collapse; +} +th.tableblock, td.tableblock { + border-width: 1px; + padding: 4px; + border: 1px dashed #ccc; +} + +table.tableblock.frame-topbot { + border-left-style: hidden; + border-right-style: hidden; +} +table.tableblock.frame-sides { + border-top-style: hidden; + border-bottom-style: hidden; +} +table.tableblock.frame-none { + border-style: hidden; +} + +th.tableblock.halign-left, td.tableblock.halign-left { + text-align: left; +} +th.tableblock.halign-center, td.tableblock.halign-center { + text-align: center; +} +th.tableblock.halign-right, td.tableblock.halign-right { + text-align: right; +} + +th.tableblock.valign-top, td.tableblock.valign-top { + vertical-align: top; +} +th.tableblock.valign-middle, td.tableblock.valign-middle { + vertical-align: middle; +} +th.tableblock.valign-bottom, td.tableblock.valign-bottom { + vertical-align: bottom; +} + + +/* + * manpage specific + * + * */ + +body.manpage h1 { + padding-top: 0.5em; + padding-bottom: 0.5em; + border-top: 2px solid silver; + border-bottom: 2px solid silver; +} +body.manpage h2 { + border-style: none; +} +body.manpage div.sectionbody { + margin-left: 3em; +} + +@media print { + body.manpage div#toc { display: none; } +} diff --git a/doc/style/meson.build b/doc/style/meson.build new file mode 100644 index 0000000..7ae9a04 --- /dev/null +++ b/doc/style/meson.build @@ -0,0 +1,16 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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/style.css b/doc/style/style.css new file mode 100644 index 0000000..fca399e --- /dev/null +++ b/doc/style/style.css @@ -0,0 +1,805 @@ +@import "./pygments.css"; + +/* Generic page style */ + +html { + background: #FFF; + color: #222; +} + +body { + font-family: "DejaVu Sans", "SF Pro Text", Verdana, sans-serif; + font-style: normal; + line-height: 1.6em; + margin-left: auto; + margin-right: auto; + max-width: 60em; + padding: 1em; +} + +h1 { + font-family: "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; + font-size: 2.38em; + font-weight: 600; + line-height: 1.41em; + margin: 0 0 0.25em; +} + +h2 { + font-family: "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; + font-size: 1.68em; + font-weight: 600; + line-height: 1.3em; + margin: 1.25em 0 0.5em; +} + +h3 { + font-family: "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; + font-size: 1.41em; + font-weight: 600; + line-height: 1.19em; + margin: 1.25em 0 0.5em; +} + +h4 { + font-family: "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; + font-size: 1.19em; + font-weight: 600; + line-height: 1.09em; + margin: 1.25em 0 0.5em; +} + +h5, h6 { + font-family: "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; + font-size: 1em; + font-weight: 600; + line-height: 1em; + margin: 1.25em 0 0.5em; +} + +a { + color: #546E00; + text-decoration: none; +} + +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { + color: #222; +} + +a:link { + color: #546E00; + text-decoration: none; +} + +a:visited { + color: #546E00; +} + +a:hover { + text-decoration: underline; +} + +h1 a:link, h2 a:link, h3 a:link, h4 a:link, h5 a:link, h6 a:link { + color: #222; +} + +h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { + color: #222; +} + +img { + border: 0; +} + +p { + margin: 0.5em 0; +} + +blockquote { + border-left: 1px solid #CCC; + margin-left: 1em; + padding-left: 1em; +} + +pre, code, kbd, samp { + color: #444; + font-family: "DejaVu Sans Mono", "SF Mono", Consolas, monospace; + margin: 1em 0; + white-space: pre; +} + +ul, ol { + margin: 0 0 0.5em; + padding-top: 0; +} + +dt { + font-weight: 600; + margin: 0.75em 0 0.125em; +} + +dt::after { + content: ": "; + margin-right: 0.5em; +} + +hr { + background-color: #EEE; + border: 0; + color: #666; + height: 1px; + margin-bottom: 1.5ex; + margin-top: 1.5ex; +} + +table { + border-collapse: collapse; + border-spacing: 1em 1em; + border-style: hidden; + border: 0; + margin: 0; +} + +th { + border: 1px solid #EEE; + padding: 0.25em 0.5em; + text-align: left; +} + +table tbody tr th { + text-align: left; +} + +td { + border: 1px solid #EEE; + padding: 0.25em 0.5em; + vertical-align: top; +} + +caption { + caption-side: bottom; + font-size: small; + font-style: italic; + margin: 0.75em 0; +} + +footer { + color: #444; + font-size: small; +} + +/* Specgen style */ + +#titlebox { + display: inline-block; + max-width: 60%; + left: 0; + top: 0; +} + +#metabox { + display: inline-block; + font-size: x-small; + font-family: "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; + position: absolute; + right: 0; + bottom: 0.25em; + color: #666; + font-style: italic; +} + +#meta { + border-style: hidden; +} + +#meta tr, #meta th, #meta td { + border: 0; + font-weight: normal; + padding: 0 0 0.125em; + background-color: transparent; +} + +#meta th { + padding-right: 0.5em; + text-align: right; +} + +#meta th::after { + content: ": "; +} + +#subtitle { + font-size: small; +} + +#shortdesc { + padding: 0; + margin: 0 0 0.5em; + font-style: italic; + color: #666; + display: inline-block; +} + +#logo { + height: 63px; + margin-left: 1em; + margin-top: 10px; + width: 100px; +} + +#titlesep { + color: #EEE; +} + +#content-body { + border-bottom: 0; + display: block; + font-size: 75%; + left: 0; + margin-left: 2em; + min-width: 660px; + padding: 3px 10px 0 0; + position: absolute; + top: 63px; + width: 93.9%; + z-index: 0; +} + +#menu { + font-size: 75%; + margin-bottom: 5px; + padding: 0; + width: 16em; +} + +#menu ul { + border: 0; + list-style: none; + margin: 0; + padding: 0; +} + +#menu a { + text-decoration: none; +} + +#menu ul.level-one a { + background-color: #F5F5F5; + border: 1px solid #DADADA; + color: #4B5A6A; + display: block; + margin: 0 0 4px 1.4em; + padding: 2px 2px 2px 4px; + text-transform: uppercase; + width: 13.4em !important; +} + +#menu ul.level-two a { + background: none; + background-color: transparent; + border: 0; + border-top: 1px solid #DDD; + color: #3C4B7B; + display: block; + margin: 0 3em 0 1.5em; + padding: 0.1em; + text-transform: none; + width: 11em !important; +} + +#menu ul.level-three a { + border: 0; + color: #5E72A5; + display: block; + font-size: 95%; + margin: 0 3em 0 1.8em; + padding: 0.1em 0.1em 0.1em 1em; + width: 10em !important; +} + +#menu ul.level-one a:hover, +#menu ul.level-two a:hover, +#menu ul.level-three a:hover { + color: #000; + text-decoration: underline; +} + +#menu ul.level-one a.selected { + background-color: #FFF; + border-left: 3px solid #FFDB4C; + color: #000; +} + +#menu ul.level-two a:visited { + color: #4C3B5B; +} + +#menu ul.level-two li:first-child a { + border-top: 0; +} + +#menu ul.level-one ul.level-two a.selected { + background-color: #FFF; + border-left: 0; + color: #000; + font-weight: 700; +} + +#menu li ul { + margin-bottom: 7px; +} + +#menu ul.level-three li.selected a.selected { + color: #000; + font-weight: 400; +} + +#menu ul.level-three { + margin-top: 5px; +} + +#searchbox { + font-weight: 700; + position: absolute; + right: 0; + text-align: right; + top: 0; + vertical-align: middle; + white-space: nowrap; + width: 28.1em; +} + +#search { + color: #A38E60; + padding: 5px 5px 0 0; +} + +#search .input-text { + background-color: #FFF; + border: 1px solid #C4CCCC; + font-size: 116%; + font-weight: 400; + margin-top: 3px; + vertical-align: top; + width: 11em; +} + +#search .input-button { + background-color: #F8F7F7; + border-bottom: 1px solid #6F7777; + border-left: 1px solid #C4CCCC; + border-right: 1px solid #6F7777; + border-top: 1px solid #C4CCCC; + color: #234; + font-weight: 700; + margin: 3px 0.4em 0; + padding: 0 0.2em; + vertical-align: text-top; +} + +input.formbutton { + background-color: #F8F7F7; + border-bottom: 1px solid #6F7777; + border-left: 1px solid #C4CCCC; + border-right: 1px solid #6F7777; + border-top: 1px solid #C4CCCC; + color: #234; + font-weight: 700; + vertical-align: text-top; +} + +.formtextinput { + background-color: #FFF; + border: 1px solid #C4CCCC; + font-size: 116%; + font-weight: 400; + vertical-align: top; +} + +#content table { + clear: right; +} + +.content-section { + margin-top: 15px; +} + +.content-section h1 { + margin: 0 0 10px; +} + +.content-section p { + margin: 0 0 5px; + padding-left: 12px; +} + +.content-section .pubdate { + color: #696969; + margin: 0 0 8px; + padding: 0 0 0 12px; +} + +#footer { + bottom: 0; + clear: both; + font-size: x-small; + margin: 2em 0 0; + padding: 0; + color: #888; +} + +#searchbox a.reference, #searchbox span.reference { + color: #339; + font-size: 85%; + font-weight: 400; + position: absolute; + right: 8.3em; + text-decoration: none; + top: 2.9em; +} + +#topbar { + line-height: 1em; + border-bottom: 1px solid #EEE; +} + +@media print { + #topbar { + color: #000; + margin: 0.25em auto; + padding: 0.25em 0.5em 0.5em; + max-width: 60em; + position: relative; + } + + #contentsbox { + display: none; + } + + #topbar a, #title a, #topbar a:visited, #title a:visited { + color: #000; + } + + #contents { + display: none; + } +} + +@media screen { + #topbar { + margin: 0.25em auto; + padding: 0; + max-width: 60em; + position: relative; + } + + #contentsbox { + color: #546E00; + font-size: small; + margin: 0 0 1.5em; + } + + #contents { + display: inline; + padding: 0; + } + + #contents li { + display: inline; + list-style-type: none; + margin-left: 0; + margin-right: 0.5em; + padding: 0.25ex 0.25ex 0.25ex 0; + } +} + +#content { + clear: both; + padding: 0; + max-width: 60em; + margin-left: auto; + margin-right: auto; +} + +.section { + clear: right; + padding: 0 0 1.5em; +} + +.category { + font-size: small; + color: #AAA; + float: right; + vertical-align: bottom; + padding: 0; + margin: 0; + padding-right: 0.25em; +} + +.label { + font-style: italic; + margin-top: 0.25em; + color: #666; +} + +table.index { + border: 0; + line-height: 1.5em; + margin-top: 2em; +} + +.index ul { + padding-left: 1.25em; + margin-left: 0; + list-style-type: circle; +} + +.index ul li { + padding-left: 0; + color: #888; +} + +.prop { + margin: 0; + padding: 0; +} + +.description { + margin-top: 0; + margin-bottom: 0.75em; +} + +.blankdesc, .blankdef { + border-spacing: 0; + margin: 0; + padding-left: 0; + padding-right: 0; +} + +.blankdesc tbody tr td, .blankdef { + border: 0 !important; +} + +.blankdesc td { + padding-right: 0.5em; +} + +.blankdesc tbody tr td:first-child { + border-left: 1px solid #BBB; + text-align: right; +} + +.terminfo, .restriction { + border-collapse: collapse; + border-spacing: 0; + font-size: small; + color: #666; + border-radius: 0; + border-bottom-left-radius: 6px; +} + +table.terminfo { + border-top: 0; + border-collapse: collapse; + margin: -1px 0 2em 2em; + padding: 0.25em 0; + float: right; + border-bottom: 1px solid #EEE; + border-left: 1px solid #EEE; + border-bottom-left-radius: 6px; + max-width: 50%; + line-height: 1.4em; + min-width: 25%; +} + +table.terminfo td { + padding: 0 0.5em; +} + +.restriction { + border-style: hidden; + margin: 0 0 0.5ex; + padding: 0; + vertical-align: text-top; +} + +.restriction td { + vertical-align: text-top; +} + +.terminfo th { + padding: 0 0.5em; + text-align: right; + vertical-align: top; +} + +.specterm { + border: 0; + margin: 0; + padding: 1em 0; + clear: both; +} + +.specterm h3 { + display: inline-block; + margin-bottom: 0.25em; + width: 80%; +} + +.spectermtype { + color: #888; + display: inline-block; + font-size: small; + font-style: italic; + box-sizing: border-box; + margin: 0; + padding: 0 0.25em 0 0; + text-align: right; + vertical-align: bottom; + width: 20%; +} + +.spectermbody { + border-top: 1px solid #EEE; + padding: 0; +} + +.spectermbody .description .comment > p:first-child { + color: #444; + font-style: italic; + margin-bottom: 0.75em; +} + +dl { + margin: 0; + padding: 0; +} + +div.head { + margin-bottom: 1em; +} + +div.head h1 { + clear: both; + margin-top: 2em; +} + +div.head table { + margin-left: 2em; + margin-top: 2em; +} + +#menu li { + display: inline; +} + +.error { + color: #990A1B; +} + +.warning { + color: #7B6000; +} + +.success { + color: #546E00; +} + +.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/ext/atom-port.lv2/atom-port.ttl b/ext/atom-port.lv2/atom-port.ttl deleted file mode 100644 index 7533606..0000000 --- a/ext/atom-port.lv2/atom-port.ttl +++ /dev/null @@ -1,127 +0,0 @@ -# LV2 Atom Port Extension -# Copyright (C) 2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix aport: <http://lv2plug.in/ns/ext/atom-port#> . -@prefix atom: <http://lv2plug.in/ns/ext/atom#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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://lv2plug.in/ns/ext/atom-port> - a lv2:Specification ; - doap:name "LV2 Atom Port" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This extension describes port types that hold polymorphic values -(<a href="http://lv2plug.in/ns/ext/atom#Atom">atom:Atom</a>). There are -two such port types with equivalent buffer formats but different semantics: -value ports (aport:ValuePort) and message ports (aport:MessagePort). -""" . - - -aport:AtomPort a rdfs:Class ; - rdfs:label "Atom Port" ; - rdfs:subClassOf lv2:Port ; - rdfs:comment """ -A port which contains a polymorphic value, or "atom". -Ports of this type will be connected to a 32-bit aligned <a -href="http://lv2plug.in/ns/ext/atom#Atom">atom:Atom</a> (i.e. a uint32_t type, -immediately followed by a uint32_t size, immediately followed by that many -bytes of data). - -This is an abstract port type. A port that is a aport:AtomPort MUST also -have a more descriptive type that is a subClassOf aport:AtomPort which -defines the port's semantics (typically aport:ValuePort or aport:MessagePort). - -Before calling a method on the plugin that writes to an AtomPort output, -the host MUST set the size of the Atom in that output to the amount of -available memory immediately following the Atom header. The plugin MUST -write a valid Atom to that port (leaving it untouched is illegal). If there -is no reasonable value to write to the port, the plugin MUST write null -(the atom with both type and size equal to zero). -""" . - - -#aport:respondsWith a rdf:Property ; -# rdfs:domain aport:MessagePort ; -# rdfs:range lv2:Symbol ; -# rdfs:label "responds with" ; -# rdfs:comment """ -#Indicates that a message port responds to messages via the port with the -#given symbol on the same plugin instance. If -#<pre>input aport:respondsWith output</pre> then after running the plugin with -#a message <em>m</em> in <code>input</code> the host SHOULD interpret the aport: -#in <code>output</code> as the response to <em>m</em>. -#""" . - - -aport:ValuePort a rdfs:Class ; - rdfs:label "Value Port" ; - rdfs:subClassOf aport:AtomPort ; - rdfs:comment """ -An AtomPort that interprets its data as a persistent and time-independent -"value". -<ul> -<li>If a plugin has fixed input values for all ports, all ValuePort outputs -are also fixed regardless of the number of times the plugin is run.</li> -<li>If a plugin has fixed input values for all ports except a ValuePort, -each value V of that ValuePort corresponds to a single set of outputs -for all ports.</li> -<li>If an aport:ValuePort contains a reference then the blob it refers to is -constant; plugin MUST NOT modify the blob in any way.</li> -</ul> -Value ports can be thought of as purely functional ports: if a plugin -callback has only value ports, then the plugin callback is a pure function. -""" . - - -aport:MessagePort a rdfs:Class ; - rdfs:label "Message Port" ; - rdfs:subClassOf aport:AtomPort ; - rdfs:comment """ -An AtomPort that consumes or executes its value as a "message". The contents -of a MessagePort are considered transient and/or time-dependent, and only -apply for a single run invocation. Unlike a ValuePort, a MessagePort may -be used to manipulate and access internal plugin state. - -Intuitively, a MessagePort contains a "command" or "event" (which is reacted -to), NOT a "value" or "signal" (which is computed with). -""" . - -aport:supports a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range atom:AtomType ; - rdfs:label "supports" ; - rdfs:comment """ -Indicates that an atom port supports a certain value type. This is distinct -from the port type - e.g. the port type ValuePort can hold atoms with many -different types. This property is used to describe which atom types -a port ``understands''. -""" . - diff --git a/ext/atom-port.lv2/manifest.ttl b/ext/atom-port.lv2/manifest.ttl deleted file mode 100644 index e681793..0000000 --- a/ext/atom-port.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/atom-port> - a lv2:Specification ; - rdfs:seeAlso <atom-port.ttl> . - diff --git a/ext/atom.lv2/atom.h b/ext/atom.lv2/atom.h deleted file mode 100644 index 51fb817..0000000 --- a/ext/atom.lv2/atom.h +++ /dev/null @@ -1,232 +0,0 @@ -/* lv2_atom.h - C header file for the LV2 Atom extension. - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header for the LV2 Atom extension <http://lv2plug.in/ns/ext/atom>. - * This extension defines convenience structs that - * should match the definition of the built-in types of the atom extension. - * The layout of atoms in this header must match the description in RDF. - * The RDF description of an atom type should be considered normative. - * This header is a non-normative (but hopefully accurate) implementation - * of that specification. - */ - -#ifndef LV2_ATOM_H -#define LV2_ATOM_H - -#define LV2_ATOM_URI "http://lv2plug.in/ns/ext/atom" -#define LV2_BLOB_SUPPORT_URI "http://lv2plug.in/ns/ext/atom#blobSupport" - -#define LV2_ATOM_REFERENCE_TYPE 0 - -#include <stdint.h> -#include <stddef.h> - -#define LV2_ATOM_FROM_EVENT(ev) ((LV2_Atom*)&((LV2_Event*)ev)->type) - -/** An LV2 Atom. - * - * An "Atom" is a generic chunk of memory with a given type and size. - * The type field defines how to interpret an atom. - * - * All atoms are by definition Plain Old Data (POD) and may be safely - * copied (e.g. with memcpy) using the size field, except atoms with type 0. - * An atom with type 0 is a reference, and may only be used via the functions - * provided in LV2_Blob_Support (e.g. it MUST NOT be manually copied). - * - * Note that an LV2_Atom is the latter two fields of an LV2_Event as defined - * by the <a href="http://lv2plug.in/ns/ext/event">LV2 events extension</a>. - * The host MAY marshal an Event to an Atom simply by pointing to the offset - * of the 'type' field of the LV2_Event, which is also the type field (i.e. start) - * of a valid LV2_Atom. The macro LV2_ATOM_FROM_EVENT is provided in this - * header for this purpose. - */ -typedef struct _LV2_Atom { - - /** The type of this atom. This number represents a URI, mapped to an - * integer using the extension <http://lv2plug.in/ns/ext/uri-map> - * with "http://lv2plug.in/ns/ext/atom" as the 'map' argument. - * Type 0 is a special case which indicates this atom - * is a reference and MUST NOT be copied manually. - */ - uint16_t type; - - /** The size of this atom, not including this header, in bytes. */ - uint16_t size; - - /** Size bytes of data follow here */ - uint8_t body[]; - -} LV2_Atom; - -/** Reference, an LV2_Atom with type 0 */ -typedef LV2_Atom LV2_Reference; - -/** The body of an LV2_Atom with type atom:Vector - */ -typedef struct _LV2_Vector_Body { - - /** The size of each element in the vector */ - uint16_t elem_count; - - /** The type of each element in the vector */ - uint16_t elem_type; - - /** Elements follow here */ - uint8_t elems[]; - -} LV2_Vector_Body; - - -/** The body of an LV2_Atom with type atom:Triple - */ -typedef struct _LV2_Triple_Body { - uint32_t subject; - uint32_t predicate; - LV2_Atom object; -} LV2_Triple_Body; - - -/** The body of an LV2_Atom with type atom:Message - */ -typedef struct _LV2_Message_Body { - uint32_t selector; /***< Selector URI mapped to integer */ - LV2_Atom triples; /***< Always an atom:Triples */ -} LV2_Message_Body; - - -/* Everything below here is related to blobs, which are dynamically allocated - * atoms that are not necessarily POD. This functionality is optional, - * hosts may support atoms without implementing blob support. - * Blob support is an LV2 Feature. - */ - - -typedef void* LV2_Blob_Data; - -/** Dynamically Allocated LV2 Blob. - * - * This is a blob of data of any type, dynamically allocated in memory. - * Unlike an LV2_Atom, a blob is not necessarily POD. Plugins may only - * refer to blobs via a Reference (an LV2_Atom with type 0), there is no - * way for a plugin to directly create, copy, or destroy a Blob. - */ -typedef struct _LV2_Blob { - - /** Pointer to opaque data. - * - * Plugins MUST NOT interpret this data in any way. Hosts may store - * whatever information they need to associate with references here. - */ - LV2_Blob_Data data; - - /** Get blob's type as a URI mapped to an integer. - * - * The return value may be any type URI, mapped to an integer with the - * URI Map extension. If this type is an LV2_Atom type, get returns - * a pointer to the LV2_Atom header (e.g. a blob with type atom:Int32 - * does NOT return a pointer to a int32_t). - */ - uint32_t (*type)(struct _LV2_Blob* blob); - - /** Get blob's body. - * - * Returns a pointer to the start of the blob data. The format of this - * data is defined by the return value of the type method. It MUST NOT - * be used in any way by code which does not understand that type. - */ - void* (*get)(struct _LV2_Blob* blob); - -} LV2_Blob; - - -typedef void* LV2_Blob_Support_Data; - -typedef void (*LV2_Blob_Destroy)(LV2_Blob* blob); - -/** The data field of the LV2_Feature for the LV2 Atom extension. - * - * A host which supports this extension must pass an LV2_Feature struct to the - * plugin's instantiate method with 'URI' "http://lv2plug.in/ns/ext/atom" and - * 'data' pointing to an instance of this struct. All fields of this struct, - * MUST be set to non-NULL values by the host (except possibly data). - */ -typedef struct { - - /** Pointer to opaque data. - * - * The plugin MUST pass this to any call to functions in this struct. - * Otherwise, it must not be interpreted in any way. - */ - LV2_Blob_Support_Data data; - - /** The size of a reference, in bytes. - * - * This value is provided by the host so plugins can allocate large - * enough chunks of memory to store references. - */ - size_t reference_size; - - /** Initialize a reference to point to a newly allocated Blob. - * - * @param data Must be the data member of this struct. - * @param reference Pointer to an area of memory at least as large as - * the reference_size field of this struct. On return, this will - * be the unique reference to the new blob which is owned by the - * caller. Caller MUST NOT pass a valid reference. - * @param destroy Function to destroy a blob of this type. This function - * MUST clean up any resources contained in the blob, but MUST NOT - * attempt to free the memory pointed to by its LV2_Blob* parameter. - * @param type Type of blob to allocate (URI mapped integer). - * @param size Size of blob to allocate in bytes. - */ - void (*lv2_blob_new)(LV2_Blob_Support_Data data, - LV2_Reference* reference, - LV2_Blob_Destroy destroy_func, - uint32_t type, - size_t size); - - /** Return a pointer to the Blob referred to by @a ref. - * - * The returned value MUST NOT be used in any way other than by calling - * methods defined in LV2_Blob (e.g. it MUST NOT be copied or destroyed). - */ - LV2_Blob* (*lv2_reference_get)(LV2_Blob_Support_Data data, - LV2_Reference* ref); - - /** Copy a reference. - * This copies a reference but not the blob it refers to, - * i.e. after this call @a dst and @a src refer to the same LV2_Blob. - */ - void (*lv2_reference_copy)(LV2_Blob_Support_Data data, - LV2_Reference* dst, - LV2_Reference* src); - - /** Reset (release) a reference. - * After this call, @a ref is invalid. Use of this function is only - * necessary if a plugin makes a copy of a reference it does not later - * send to an output (which transfers ownership to the host). - */ - void (*lv2_reference_reset)(LV2_Blob_Support_Data data, - LV2_Reference* ref); - -} LV2_Blob_Support; - - -#endif /* LV2_ATOM_H */ - diff --git a/ext/atom.lv2/atom.ttl b/ext/atom.lv2/atom.ttl deleted file mode 100644 index 0173d51..0000000 --- a/ext/atom.lv2/atom.ttl +++ /dev/null @@ -1,268 +0,0 @@ -# LV2 Atom Extension -# Copyright (C) 2007-2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix atom: <http://lv2plug.in/ns/ext/atom#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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://lv2plug.in/ns/ext/atom> - a lv2:Specification ; - doap:name "LV2 Atom" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This extension defines a generic format for a typed piece of data, called an -"atom" (e.g. integers, strings, buffers, data structures, etc). Atoms allow -LV2 plugins and host to communicate and store values of any type and size via -a generic mechanism (e.g. port buffers, event payloads, shared data, etc.). -Atoms are simple a chunk of memory with a type and a size, and are (with -one exception) Plain Old Data (POD) and may be safely copied (e.g. with a -simple call to <code>memcpy</code>). Because they are POD, hosts and plugins -can communicate atoms of any type, even if they do not understand that type. -This allows two plugins that both understand some type to be used together in -a host that does not itself understand that type, or allows a host to send -atoms "through" a plugin that does not understand them (for e.g. routing, -delaying, or buffering plugins). - -Atoms as defined by this extension can be trivially constructed in-place -from events as defined by the <a href="http://lv2plug.in/ns/ext/event">LV2 -Event</a> extension. A valid LV2_Atom (see atom.h) is contained within -any valid LV2_Event (see event.h). An LV2_Event is simply an LV2_Atom -with a time stamp header prepended. Atoms SHOULD be used anywhere a "value" -needs to be stored or communicated, to allow implementations to be -polymorphic and extensible. - -Optionally, the host MAY support "Blobs", which are dynamically allocated -chunks of memory that (unlike Atoms) are not necessarily POD. Blobs are -accessed via references, which are a special case of Atom that always have -type 0, are not POD, and can only be copied using host provided functions. -This allows plugins and hosts to work with data of any type at all. -Blob data MUST NOT be used in any way by an implementation that does not -understand that blob type (unlike other Atoms, meaningful type-oblivious use -of a Blob is impossible). - -This extension requires the host to support the <a -href="http://lv2plug.in/ns/ext/uri-map">LV2 URI Map</a> extension. -""" . - - -atom:AtomType a rdfs:Class ; - rdfs:label "LV2 Atom Type" ; - rdfs:comment """ -Base class for all types of LV2 Atom. - -All Atom types (instances of this class, which are themselves classes) -must define a precise binary layout for that type of atom, which dictates -the format of the data following the LV2_Atom header. - -The URIs of subclasses of atom:AtomType are mapped to integers and used as -the type field of an LV2_Atom. If a plugin or host does not understand -the type of an LV2_Atom, that atom SHOULD simply be ignored (though it -MAY be simply copied if it is not a reference). - -All atoms are POD by definition, except references, which have type 0. -An atom MUST NOT contain a reference. It is safe to copy any type of -atom except type 0 with a simple memcpy using the size field, even if the -implementation does not understand the actual type of that atom. -""" . - - -atom:Reference a atom:AtomType ; - rdfs:label "Reference" ; - rdfs:comment """ -Reference to a blob. The actual contents of a reference are opaque and host -specific, and must not be copied, serialized, or otherwise interpreted by -a plugin, except by using functions provided by the host. - -References are a special case: a reference atom always has type 0. -The NULL reference is the unique atom with type 0 and size 0. -""" . - - -atom:String a atom:AtomType ; - rdfs:label "String" ; - rdfs:comment """ -A UTF-8 encoded string, where LV2_Atom.size refers to the length of the -string in bytes (not characters). -""" . - - -atom:URIInt a atom:AtomType ; - rdfs:label "URI mapped to an integer" ; - rdfs:comment """ -A uint32_t interpreted as a URI mapped to an integer using the LV2 -URI map extension <http://lv2plug.in/ns/ext/uri-map>. Size is -always 4. -""" . - - -atom:Message a atom:AtomType ; - rdfs:label "Message" ; - rdfs:comment """ -A message is a communication from one component to another. Messages -consist of a selector URI, and a set of RDF triples. The selector URI -dictates how the triples are to be interpreted (e.g. the selector can -be used as a "verb" to build commands). - -The payload of a message is always an atom:Triples so hosts and plugins can -always work with message data (e.g. to serialise for saved state or an undo -stack), even if they do not specifically understand a particular message. - -In memory, a Message is simply a uint32_t selector (a URI mapped integer) -followed by an atom:Triples. -""" . - - -atom:Vector a atom:AtomType ; - rdfs:label "Vector" ; - rdfs:comment """ -A POD homogeneous sequence of atoms with equivalent type and size. - -The body of a vector begins with -<pre> -uint16_t elem_count; // The number of elements in the vector -uint16_t elem_type; // The type of each element -</pre> -followed by <code>elem_count</code> bodies of atoms of type -<code>elem_type</code>, each with equivalent size. For variably sized -content types, this size can be calculated using the total byte size of the -vector, e.g. -<pre> -uint16_t elem_size = (vector.size - (2 * sizeof(uint16_t))) / vector.count); -</pre> -Note that it is possible to construct a valid Atom for each element of the -vector, even by an implementation which does not understand <code>type</code>. - -For example, an atom:Vector containing 42 elements of type atom:Int32 looks -like this in memory: -<pre> -uint16_t atom_type = uri_map(atom:Vector) -uint16_t atom_size = (2 * sizeof(uint16_t)) + (42 * sizeof(int32_t)) -uint16_t elem_count = 42 -uint16_t elem_type = uri_map(atom:Int32) -int32_t contents[42] = ... -</pre> -""" . - - -atom:Triple a atom:AtomType ; - rdfs:label "RDF triple" ; - rdfs:comment """ -A single RDF triple. - -The subject and predicate of an RDF triple are implicitly URIs, thus in an -atom:Triple they are stored as URI mapped integers with type tags and sizes -omitted. - -An atom:Triple in memory is two uint32_t's followed by an LV2_Atom: -<pre> -uint32_t subject; -uint32_t predicate; -LV2_Atom object; -</pre> -""" . - - -atom:Triples a atom:AtomType ; - rdfs:label "RDF triple set" ; - rdfs:comment """ -A description in RDF (i.e. a set of triples). - -An atom:Triples contains any number of RDF triples, describing one or -several resources. The subject and predicate of all triples are implicitly -URI mapped integers, type tags are omitted. The object of triples may be -any atom. - -An atom:Triples in memory is a sequence of atom:Triple where each atom:Triple -is immediately followed by the next (without time stamps or sizes), with -padding to ensure each subject is 32-bit aligned, e.g.: -<pre> -uint32_t subject1; -uint32_t predicate1; -LV2_Atom object1; -uint8_t pad[1]; /* e.g. if object1.size == 3 */ -uint32_t subject2; -uint32_t predicate2; -LV2_Atom object2; -... -</pre> -""" . - - -atom:Blank a atom:AtomType ; - rdfs:label "Blank (anonymous resource)" ; - rdfs:comment """ -A description of an RDF resource with no URI (a resource with blank node -ID), e.g. the resource of type ex:Thing in the following Turtle description: -<code><> ex:hasThing [ a ex:Thing ]</code> - -An atom:Blank is conceptually a dictionary where keys (RDF predicates) are -URI mapped integers, and values (RDF objects) are any atom. - -An atom:Blank in memory is like an atom:Triples, but with subjects omitted: -<pre> -uint32_t predicate1; -LV2_Atom object1; -uint32_t predicate2; -LV2_Atom object2; -... -</pre> -""" . - - -atom:Bang a atom:AtomType ; rdfs:label "Bang (generic activity), size=0" . -atom:Byte a atom:AtomType ; rdfs:label "A byte" . -atom:Int32 a atom:AtomType ; rdfs:label "Signed 32-bit Integer" . -atom:Bool a atom:AtomType ; rdfs:label "atom:Int32 where 0=false, 1=true" . -atom:Float32 a atom:AtomType ; rdfs:label "32-bit Floating Point Number" . -atom:Float64 a atom:AtomType ; rdfs:label "64-bit Floating Point Number" . - - -atom:blobSupport a lv2:Feature ; - rdfs:label "Blob support" ; - rdfs:comment """ -Support for dynamically allocated blobs. If a host supports this feature, it -MUST pass an LV2_Feature with URI http://lv2plug.in/ns/ext/atom#blobSupport -and a pointer to LV2_Blob_Support as data to the plugin's instantiate method. -See atom.h for details. -""" . - - -atom:BlobType a rdfs:Class ; - rdfs:label "Blob Type" ; - rdfs:comment """ -Base class for all types of dynamically allocated LV2 blobs. Blobs can be of -any type at all, there are no restrictions on the binary format or contents -of a blob. Blobs are dynamically allocated by the host (or a plugin via -the host), and unlike Atoms are not necessarily POD. - -The type of a blob MAY be a atom:AtomType, in which case the start of the -blob data is the start of the Atom header (LV2_Atom). -""" . - diff --git a/ext/command.lv2/command.ttl b/ext/command.lv2/command.ttl deleted file mode 100644 index ab8b82b..0000000 --- a/ext/command.lv2/command.ttl +++ /dev/null @@ -1,73 +0,0 @@ -# LV2 Command Extension -# Copyright (C) 2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix cmd: <http://lv2plug.in/ns/ext/command#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/command> - a lv2:Specification ; - doap:name "LV2 Command" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This extension defines special port types used for controlling and inspecting a -plugin instance by sending messages/commands and receiving responses to them. -It also allows plugins to send status updates to the host. The port types in -this extension only define an abstract notion of plugin control, not actual -data types and/or message semantics. They must be used with some other port -data type (e.g. event) to define the actual data format of port buffers. -As a result, this extension can be used in conjunction with any extension -that defines a port type suitable for controlling plugins. -""" . - -cmd:CommandPort a rdfs:Class ; - rdfs:label "Command Port" ; - rdfs:subClassOf lv2:Port ; - rdfs:comment """ -An input port used to control a plugin instance. A plugin has -at most 1 CommandPort. A CommandPort is always an lv2:InputPort. Hosts or -UIs send messages to the command port in order to control a plugin instance -in any way. This is an abstract port class, the actual format and semantics -of the port buffer (and messages) are defined by some other port type. -""" . - -cmd:StatusPort a rdfs:Class ; - rdfs:label "Command Port" ; - rdfs:subClassOf lv2:Port ; - rdfs:comment """ -An output port used to notify the host about changes to a plugin instance and -responses to commands. A plugin has at most 1 StatusPort. A StatusPort is -always an lv2:OutputPort. Any response to a command sent to the CommandPort -of the plugin will appear in the StatusPort output. The plugin may also emit -other messages (i.e. the contents of a StatusPort are not necessarily responses -to commands). This is an abstract port class, the actual format and semantics -of the port buffer (and messages) are defined by some other port type. -""" . - diff --git a/ext/command.lv2/manifest.ttl b/ext/command.lv2/manifest.ttl deleted file mode 100644 index 0590b62..0000000 --- a/ext/command.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/command> - a lv2:Specification ; - rdfs:seeAlso <command.ttl> . - diff --git a/ext/contexts.lv2/contexts.h b/ext/contexts.lv2/contexts.h deleted file mode 100644 index c6e8ef2..0000000 --- a/ext/contexts.lv2/contexts.h +++ /dev/null @@ -1,72 +0,0 @@ -/* LV2 Contexts Extension - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** @file - * C header for the LV2 Contexts extension - * <http://lv2plug.in/ns/ext/contexts>. - */ - -#ifndef LV2_CONTEXTS_H -#define LV2_CONTEXTS_H - -#include <stdint.h> - -#define LV2_CONTEXTS_URI "http://lv2plug.in/ns/ext/contexts" - -#define LV2_CONTEXT_MESSAGE "http://lv2plug.in/ns/ext/contexts#MessageContext" - -static inline void -lv2_contexts_set_port_valid(void* flags, uint32_t index) { - ((uint8_t*)flags)[index / 8] |= 1 << (index % 8); -} - -static inline void -lv2_contexts_unset_port_valid(void* flags, uint32_t index) { - ((uint8_t*)flags)[index / 8] &= ~(1 << (index % 8)); -} - -static inline int -lv2_contexts_port_is_valid(const void* flags, uint32_t index) { - return (((uint8_t*)flags)[index / 8] & (1 << (index % 8))) != 0; -} - -#include "lv2.h" - - -typedef struct { - - /** The message run function. This is called once to process a set of - * inputs and produce a set of outputs. - * - * Before calling the host MUST set valid_inputs such that the bit - * corresponding to each input port is 1 iff data is present. The plugin - * MUST only inspect bits corresponding to ports in the message thread. - * - * Similarly, before returning the plugin MUST set valid_outputs such that - * the bit corresponding to each output port of the message context is 1 - * iff the value at that port has changed. - * The plugin must return 1 if outputs have been written, 0 otherwise. - */ - uint32_t (*message_run)(LV2_Handle instance, - const void* valid_inputs, - void* valid_outputs); - -} LV2_Contexts_MessageContext; - -#endif /* LV2_CONTEXTS_H */ - diff --git a/ext/contexts.lv2/contexts.ttl b/ext/contexts.lv2/contexts.ttl deleted file mode 100644 index 59c4cb1..0000000 --- a/ext/contexts.lv2/contexts.ttl +++ /dev/null @@ -1,202 +0,0 @@ -# LV2 Contexts Extension -# -# Allows for an LV2 plugin to have several independent contexts, each with its -# own run callback and associated ports. -# -# Copyright (C) 2007 David Robillard -# -# 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. - -@prefix ctx: <http://lv2plug.in/ns/ext/contexts#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/contexts> - a lv2:Specification ; - a lv2:Feature ; - doap:name "LV2 Contexts" ; - rdfs:comment """ -An extension for LV2 plugins which have several execution contexts. - -Any host which supports this extension must pass an LV2_Feature to -the plugin's instantiate method with URI http://lv2plug.in/ns/ext/contexts -and a pointer to a -<pre> -struct { - void* host_handle; - void (*request_run)(void* host_handle, const char* context_uri); -} -</pre> -where the plugin may call request_run with the given host_handle (from any -context) to demand immediate execution of the context specified. - -If the host does not support blocking contexts, request_run may be set to NULL, -but plugins which have a :BlockingContext which is :mandatory MUST NOT be -instantiated. If the plugin has ANY context which is :hardRTCapable, -request_run must be realtime safe (as defined by lv2:hardRTCapable). - -Unless otherwise stated, each context (defined by some URI) adds a new -threading class similar to the Audio class defined by LV2. Each context has a -run callback and a connect_port callback both in the same class (i.e. can't be -called concurrently), but may be called concurrently with functions for other -contexts (excluding the Instantiation class). Context properties such as -ctx:hardRTCapable apply to both functions. -The host MUST only call the correct connect_port function associated with the -context for that port, i.e. it is an error to use the main LV2 connect_port -function on a port with a context other than the main LV2 run function. -"""^^lv2:basicXHTML . - - -########################## -## Context Base Classes ## -########################## - -ctx:Context a rdfs:Class ; - rdfs:label "LV2 Context" ; - rdfs:comment """ -A potentially concurrent context (callback) on a plugin. - -If a plugin supports a context (specified with the :optionalContext or -ctx:requiredContext plugin properties) its extension_data function, called with -the URI for that context, should return a context descriptor as defined by the -specification of the context URI. If a plugin has any contexts, it MUST specify -the associated context of ALL ports, with the :context port property.""" . - - -ctx:RollingContext a rdfs:Class ; - rdfs:subClassOf ctx:Context ; - rdfs:comment """ -A context which is is continually executed in blocks (like the standard LV2 -run callback). Extension data is a pointer to a - -struct { - void (*run)(LV2Handle instance, uint32_t sample_count); - void (*connect_port)(LV2_Handle instance, uint32_t port, void* data); -} - -When run is called, sample_count frames worth of input/output should be -read from/written to all ports associated with this context. -""" . - - -ctx:BlockingContext a rdfs:Class ; - rdfs:subClassOf ctx:Context ; - rdfs:comment """ -A context which is executed only when there is work to be done -(e.g. a message is received). Extension data is a pointer to a - -struct LV2BlockingContext { - bool (*run)(LV2Handle instance, uint8_t* valid_inputs, uint8_t* valid_outputs) - void (*connect_port)(LV2_Handle instance, uint32_t port, void* data); -} - -When run is called, any pending input in ports associated with this context -should be read, and true returned iff output was written (meaning plugins -connected to ports where output has been written should be executed). - -Before calling run, the host MUST set the nth bit of valid_inputs to 1 if the -input port with index n has valid input that should be processed, otherwise 0. -Before returning from run, the plugin MUST set the nth bit of valid_outputs -to 1 if the port with index n was written to, otherwise 0. -The header lv2_contexts.h provides utility functions for these purposes. -The plugin MUST NOT touch any bits corresponding to ports on another context. -""" . - - -####################### -## Plugin Properties ## -####################### - -ctx:optionalContext a rdf:Property ; - rdfs:domain lv2:Plugin ; - rdfs:range ctx:Context ; - rdfs:label "Has an optional context" ; - rdfs:comment """ -Signifies a Plugin supports a certain context, defined by a URI, which may -be ignored by the host.""" . - -ctx:requiredContext a rdf:Property ; - rdfs:domain lv2:Plugin ; - rdfs:range ctx:Context ; - rdfs:label "Has a required context" ; - rdfs:comment """ -Signifies a Plugin supports a certain context, defined by a URI, which must be -supported by the host for the plugin to function.""" . - - -##################### -## Port Properties ## -##################### - -ctx:context a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range ctx:Context ; - rdfs:label "Is used by context" ; - rdfs:comment """ -The context a particular port is associated with; the port will only be -connected/read/written by that context. - -If no context is specified, the port is considered part of the default LV2 -audio context.""" . - - -################################## -## Specific context definitions ## -################################## - - -ctx:AudioContext a rdfs:Class ; - rdfs:subClassOf ctx:Context ; - rdfs:comment """ -The context of the core LV2 run method (LV2_Descriptor::run). -""" . - - -ctx:StatelessAudioContext a rdfs:Class ; - rdfs:subClassOf ctx:Context ; - rdfs:comment """ -The usual LV2 run context (ctx:AudioContext), with the additional property -that the plugin has no internal state whatsoever (other than the sample rate -and the locations ports are currently connected to). On a plugin with a -ctx:StatelessAudioContext, the nframes parameter to run is meaningless and -ignored by the plugin, and the host may assume that any call to run with -a given set of inputs will produce the exact same set of outputs (i.e. -the plugin's run method is purely functional). This context inherently -conflicts with lv2:isLive, a plugin MUST NOT have both a -ctx:StatelessAudioContext and the lv2:isLive feature. - -For easy compatibility with hosts that don't care whether the audio context -is stateless or not, this context should be listed as a ctx:optionalContext -(since the default LV2 context is implicitly present). -""" . - - -ctx:MessageContext a rdfs:Class ; - rdfs:subClassOf ctx:BlockingContext ; - rdfs:comment """ -A blocking context for on-demand message-like processing. The plugin's -lv2:hardRTCapable property does not apply to the message context, there are -no realtime restrictions on the plugin's message context, and no -syncronisation guarantees between the message context and any other context. -""" . - diff --git a/ext/contexts.lv2/manifest.ttl b/ext/contexts.lv2/manifest.ttl deleted file mode 100644 index 373b8f6..0000000 --- a/ext/contexts.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/contexts> - a lv2:Specification ; - rdfs:seeAlso <contexts.ttl> . - diff --git a/ext/contexts.lv2/test.c b/ext/contexts.lv2/test.c deleted file mode 100644 index f55cdd6..0000000 --- a/ext/contexts.lv2/test.c +++ /dev/null @@ -1,65 +0,0 @@ -#include <stdio.h> -#include <limits.h> -#include <assert.h> -#include <unistd.h> -#include "lv2_contexts.h" - -#define TEST_ASSERT(check) do {\ - if (!(check)) {\ - fprintf(stderr, "Failure at line %d: %s\n", __LINE__, #check);\ - assert(false);\ - _exit(1);\ - }\ -} while (0) - -#define NUM_PORTS 64 - -void -print_flags(void* flags) -{ - for (int i = NUM_PORTS; i >= 0; --i) - printf((lv2_contexts_port_is_valid(flags, i)) ? "1" : "0"); - printf("\n"); -} - - -int -main() -{ - uint64_t flags = 0; - print_flags(&flags); - - lv2_contexts_set_port_valid(&flags, 16); - print_flags(&flags); - for (int i = 0; i < NUM_PORTS; ++i) { - if (i == 16) { - TEST_ASSERT(lv2_contexts_port_is_valid(&flags, i)); - } else { - TEST_ASSERT(!lv2_contexts_port_is_valid(&flags, i)); - } - } - - lv2_contexts_set_port_valid(&flags, 46); - lv2_contexts_set_port_valid(&flags, 0); - print_flags(&flags); - for (int i = 0; i < NUM_PORTS; ++i) { - if (i == 0 || i == 16 || i == 46) { - TEST_ASSERT(lv2_contexts_port_is_valid(&flags, i)); - } else { - TEST_ASSERT(!lv2_contexts_port_is_valid(&flags, i)); - } - } - - lv2_contexts_unset_port_valid(&flags, 16); - print_flags(&flags); - for (int i = 0; i < NUM_PORTS; ++i) { - if (i == 0 || i == 46) { - TEST_ASSERT(lv2_contexts_port_is_valid(&flags, i)); - } else { - TEST_ASSERT(!lv2_contexts_port_is_valid(&flags, i)); - } - } - - return 0; -} - diff --git a/ext/data-access.lv2/data-access.h b/ext/data-access.lv2/data-access.h deleted file mode 100644 index aa87723..0000000 --- a/ext/data-access.lv2/data-access.h +++ /dev/null @@ -1,57 +0,0 @@ -/* lv2_data_access.h - C header file for the LV2 Data Access extension. - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header for the LV2 Extension Data extension - * <http://lv2plug.in/ns/ext/data-access>. - * - * This extension defines a method for (e.g.) plugin UIs to have (possibly - * marshalled) access to the extension_data function on a plugin instance. - */ - -#ifndef LV2_DATA_ACCESS_H -#define LV2_DATA_ACCESS_H - -#define LV2_DATA_ACCESS_URI "http://lv2plug.in/ns/ext/data-access" - -/** 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; - - -#endif /* LV2_DATA_ACCESS_H */ - diff --git a/ext/data-access.lv2/data-access.ttl b/ext/data-access.lv2/data-access.ttl deleted file mode 100644 index ce5c849..0000000 --- a/ext/data-access.lv2/data-access.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# LV2 Data Access Extension -# Copyright (C) 2008 David Robillard <d@drobilla.net> -# -# 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. - -@prefix da: <http://lv2plug.in/ns/ext/data-access#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/data-access> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Data Access" ; - doap:release [ - doap:revision "1" ; - doap:created "2008-08-11" ; - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.xrdf> - ] ; - rdfs:comment """ -This extension defines a method for (e.g.) plugin UIs to have (possibly -marshalled) access to the extension_data function on a plugin instance. -""" . diff --git a/ext/dyn-manifest.lv2/Makefile b/ext/dyn-manifest.lv2/Makefile deleted file mode 100644 index c575035..0000000 --- a/ext/dyn-manifest.lv2/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -PREFIX = /usr/local -LV2_DIR = $(PREFIX)/lib/lv2 -INCLUDE_DIR = $(PREFIX)/include - -all: - @echo "There's nothing to build here, just 'make install'" - @echo - @echo "The variables PREFIX, LV2_DIR, and INCLUDE_DIR are used, e.g.:" - @echo "make PREFIX=/usr LV2_DIR=/usr/lib/lv2 INCLUDE_DIR=/usr/include" - @echo - @echo "Defaults:" - @echo " PREFIX = /usr/local" - @echo " LV2_DIR = PREFIX/lib/lv2" - @echo " INCLUDE_DIR = PREFIX/include" - -install: - install -d $(LV2_DIR)/lv2_dyn_manifest.lv2 - install -m 0644 lv2_dyn_manifest.ttl $(LV2_DIR)/lv2_dyn_manifest.lv2/ - install -d $(INCLUDE_DIR)/ - install -m 0644 lv2_dyn_manifest.h $(INCLUDE_DIR)/ diff --git a/ext/dyn-manifest.lv2/dyn-manifest.h b/ext/dyn-manifest.lv2/dyn-manifest.h deleted file mode 100644 index 00e46fd..0000000 --- a/ext/dyn-manifest.lv2/dyn-manifest.h +++ /dev/null @@ -1,245 +0,0 @@ -/* Dynamic manifest specification for LV2 - * Revision 1 - * - * Copyright (C) 2008, 2009 Stefano D'Angelo <zanga.mail@gmail.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef LV2_DYN_MANIFEST_H_INCLUDED -#define LV2_DYN_MANIFEST_H_INCLUDED - -#include <stdio.h> -#include "lv2.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ************************************************************************* */ - - -/** @file - * C header for the LV2 Dynamic Manifest extension - * <http://lv2plug.in/ns/ext/dyn-manifest>. - * Revision: 1 - * - * == Overview == - * - * The LV2 API, on its own, cannot be used to write plugin libraries where - * data is dynamically generated at runtime (e.g. API wrappers), since LV2 - * requires needed information to be provided in one or more static data (RDF) - * files. This API addresses this limitation by extending the LV2 API. - * - * A host implementing support for this API should first detect that the plugin - * library implements a dynamic manifest generator by examining its static - * manifest file, then fetch data from the shared object file by accessing it as - * usual (dlopen() and family) and using this API. - * - * The host is allowed to request regeneration of the dynamic manifest multiple - * times, and the plugin library is expected to provide updated data if/when - * possible. All data and references provided via this API before the last - * regeneration of the dynamic manifest is to be considered invalid by the - * host, including plugin descriptors whose URIs were discovered using this API. - * - * This API is extensible in a similar fashion as the LV2 plugin API. - * - * == Threading rules == - * - * This specification defines threading rule classes, similarly to the LV2 - * specification. - * - * The functions defined by this API belong to: - * - * - Dynamic manifest open class: lv2_dyn_manifest_open() - * - Dynamic manifest close class: lv2_dyn_manifest_close() - * - Dynamic manifest file class: lv2_dyn_manifest_get_subjects(), - * lv2_dyn_manifest_get_data() - * - * The rules that hosts must follow are these: - * - * - When a function from the Dynamic manifest open or the Dynamic manifest - * close class is running, no other functions in the same shared object file - * may run. - * - When a function from the Dynamic manifest file class is called, no other - * functions from the same class may run if they are given at least one - * FILE * argument with the same value. - * - A function from the Dynamic manifest open class may not run after a - * successful call to a function from the same class, in case a function from - * the Dynamic manifest close class was not successfully called in the - * meanwhile. - * - A function from the Dynamic manifest close class may only run after a - * successful call to a function from the Dynamic manifest open class. - * - A function from the Dynamic manifest file class may only run beetween a - * successful call to a function from the Dynamic manifest open class and the - * following successful call to a function from the Dynamic manifest close - * class. - * - * Extensions to this specification which add new functions MUST declare in - * which of these classes the functions belong, or define new classes for them; - * furthermore, classes defined by such extensions MUST only allow calls after - * a successful call to a function from the Dynamic manifest open class and - * before the following successful call to a function from the Dynamic manifest - * close class. - * - * Any simultaneous calls that are not explicitly forbidden by these rules are - * allowed. - */ - - -/* ************************************************************************* */ - - -/** Dynamic manifest generator handle. - * - * This handle indicates a particular status of a dynamic manifest generator. - * The host MUST NOT attempt to interpret it and, unlikely LV2_Handle, it is NOT - * even valid to compare this to NULL. The dynamic manifest generator may use it - * to reference internal data. */ -typedef void * LV2_Dyn_Manifest_Handle; - - -/* ************************************************************************* */ - - -/** Accessing data. - * - * Whenever a host wants to access data using this API, it could: - * - * 1. Call lv2_dyn_manifest_open(); - * 2. Create an empty resource identified by a FILE *; - * 3. Get a "list" of exposed subject URIs using - * lv2_dyn_manifest_get_subjects(); - * 4. Call lv2_dyn_manifest_get_data() for each URI of interest, in order to - * get data related to that URI (either by calling the function subsequently - * with the same FILE * resource, or by creating more FILE * resources to - * perform parallel calls); - * 5. Call lv2_dyn_manifest_close(); - * 6. Parse the content of the FILE * resource(s). - * 7. Free/delete/unlink the FILE * resource(s). - * - * The content of the FILE * resources has to be interpreted by the host as a - * regular file in Turtle syntax. This also means that each FILE * resource - * should also contain needed prefix definitions, in case any are used. - * - * Each call to lv2_dyn_manifest_open() automatically implies the (re)generation - * of the dynamic manifest on the library side. - * - * When such calls are made, data fetched from the involved library using this - * API before such call is to be considered no more valid. - * - * In case the library uses this same API to access other dynamic manifests, it - * MUST implement some mechanism to avoid potentially endless loops (such as A - * loads B, B loads A, etc.) in functions from the Dynamic manifest open class - * (the open-like operation MUST fail). For this purpose, use of a static - * boolean flag is suggested. - */ - -/** Function that (re)generates the dynamic manifest. - * - * handle is a pointer to an uninitialized dynamic manifest generator handle. - * - * features is a NULL terminated array of LV2_Feature structs which - * represent the features the host supports. The dynamic manifest geenrator may - * refuse to (re)generate the dynamic manifest if required features are not - * found here (however hosts SHOULD NOT use this as a discovery mechanism, - * instead of reading the static manifest file). This array must always exist; - * if a host has no features, it MUST pass a single element array containing - * NULL. - * - * This function MUST return 0 on success, otherwise a non-zero error code, and - * the host SHOULD evaluate the result of the operation by examining the - * returned value, rather than try to interpret the value of handle. - */ -int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle, - const LV2_Feature *const * features); - -/** Function that fetches a "list" of subject URIs exposed by the dynamic - * manifest generator. - * - * handle is the dynamic manifest generator handle. - * - * fp is the FILE * identifying the resource the host has to set up for the - * dynamic manifest generator. The host MUST pass a writable, empty resource to - * this function, and the dynamic manifest generator MUST ONLY perform write - * operations on it at the end of the stream (e.g. use only fprintf(), fwrite() - * and similar). - * - * The dynamic manifest generator has to fill the resource only with the needed - * triples to make the host aware of the "objects" it wants to expose. For - * example, if the library exposes a regular LV2 plugin, it should output only a - * triple like the following: - * - * <http://www.example.com/plugin/uri> a lv2:Plugin; - * - * This function MUST return 0 on success, otherwise a non-zero error code. - */ -int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, - FILE * fp); - -/** Function that fetches data related to a specific URI. - * - * handle is the dynamic manifest generator handle. - * - * fp is the FILE * identifying the resource the host has to set up for the - * dynamic manifest generator. The host MUST pass a writable resource to this - * function, and the dynamic manifest generator MUST ONLY perform write - * operations on it at the current position of the stream (e.g. use only - * fprintf(), fwrite() and similar). - * - * uri is the URI to get data about (in the "plain" form, a.k.a. without RDF - * prefixes). - * - * The dynamic manifest generator has to fill the resource with data related to - * the URI. For example, if the library exposes a regular LV2 plugin whose URI, - * as retrieved by the host using lv2_dyn_manifest_get_subjects() is - * http://www.example.com/plugin/uri, it should output something like: - * - * <http://www.example.com/plugin/uri> a lv2:Plugin; - * lv2:binary <mylib.so>; - * doap:name "My Plugin"; - * ... etc... - * - * This function MUST return 0 on success, otherwise a non-zero error code. - */ -int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, - FILE * fp, - const char * uri); - -/** Function that ends the operations on the dynamic manifest generator. - * - * handle is the dynamic manifest generator handle. - * - * This function should be used by the dynamic manifest generator to perform - * cleanup operations, etc. - */ -void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); - -#ifdef __cplusplus -} -#endif - -#endif /* LV2_DYN_MANIFEST_H_INCLUDED */ - diff --git a/ext/dyn-manifest.lv2/dyn-manifest.ttl b/ext/dyn-manifest.lv2/dyn-manifest.ttl deleted file mode 100644 index 84e8f5a..0000000 --- a/ext/dyn-manifest.lv2/dyn-manifest.ttl +++ /dev/null @@ -1,109 +0,0 @@ -# Dynamic manifest specification for LV2 -# Revision 1 -# -# Copyright (C) 2008, 2009 Stefano D'Angelo <zanga.mail@gmail.com> -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -@prefix dman: <http://lv2plug.in/ns/ext/dyn-manifest#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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 xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/dyn-manifest> - a doap:Project ; - a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/bsd> ; - doap:name "LV2 Dynamic Manifest" ; - doap:homepage <http://naspro.atheme.org> ; - doap:created "2009-06-13" ; - doap:shortdesc "An LV2-based specification for dynamic data generation." ; - doap:programming-language "C" ; - doap:release [ - doap:revision "1" ; - doap:created "2009-06-13" - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Stefano D'Angelo" ; - ] . - -###################################### -## Dynamic manifest generator class ## -###################################### - -dman:DynManifest a rdfs:Class ; - rdfs:label "Dynamic manifest generator" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty rdf:type ; - owl:hasValue dman:DynManifest ; - rdfs:comment "A DynManifest has rdf:type dman:DynManifest." - ] , [ a owl:Restriction ; - owl:onProperty lv2:binary ; - owl:minCardinality 1 ; - rdfs:comment """A DynManifest has at least 1 lv2:binary. -The binary must be a library with at least the functions described in -lv2_dyn_manifest.h implemented. -""" ] ; - rdfs:comment """ -The class which represents a dynamic manifest generator. - -There MUST NOT be any instances of :DynManifest in the generated manifest. - -All relative URIs in the generated data MUST be relative to the base path -that would be used to parse a normal LV2 manifest (the bundle path). -""" . - -############## -## Features ## -############## - -dman:optionalFeature a rdf:Property ; - rdfs:domain dman:DynManifest ; - rdfs:range lv2:Feature ; - rdfs:label "Optional feature" ; - rdfs:comment """ -Signifies that a dynamic manifest generator is able to make use of or provide a -certain feature. If the host supports this feature, it MUST pass its URI and any -additional data to the dynamic manifest generator in the lv2_dyn_manifest_open() -function. The dynamic manifest generator MUST NOT fail because an optional -feature is possibly not supported by the host.""" . - -dman:requiredFeature a rdf:Property ; - rdfs:domain dman:DynManifest ; - rdfs:range lv2:Feature ; - rdfs:label "Required feature" ; - rdfs:comment """ -Signifies that a dynamic manifest generator requires a certain feature in order -to function. If the host supports this feature, it MUST pass its URI and any -additional data to the dynamic manifest generator in the lv2_dyn_manifest_open() -function. The dynamic manifest generator MUST fail if a required feature is not -present; hosts SHOULD always check this before attempting to perform futher -operations on the dynamic manifest generator. -""" . - diff --git a/ext/dyn-manifest.lv2/manifest.ttl b/ext/dyn-manifest.lv2/manifest.ttl deleted file mode 100644 index e5d09b4..0000000 --- a/ext/dyn-manifest.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/dyn-manifest> - a lv2:Specification ; - rdfs:seeAlso <dyn-manifest.ttl> . - diff --git a/ext/event.lv2/event-helpers.h b/ext/event.lv2/event-helpers.h deleted file mode 100644 index 37ca451..0000000 --- a/ext/event.lv2/event-helpers.h +++ /dev/null @@ -1,243 +0,0 @@ -/* lv2_event_helpers.h - Helper functions for the LV2 events extension. - * - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -#ifndef LV2_EVENT_HELPERS_H -#define LV2_EVENT_HELPERS_H - -#include <stdint.h> -#include <stdbool.h> -#include <string.h> -#include <stdlib.h> -#include <assert.h> -#include "lv2/http/lv2plug.in/ns/ext/event/event.h" - -/** @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 (size + 7) & (~7); -} - - -/** 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) -{ - LV2_Event_Buffer* buf = (LV2_Event_Buffer*)malloc(sizeof(LV2_Event_Buffer) + capacity); - if (buf != NULL) { - buf->capacity = capacity; - lv2_event_buffer_reset(buf, stamp_type, (uint8_t *)(buf + 1)); - return buf; - } else { - 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 (e.g. RW Lock). */ -typedef struct { - LV2_Event_Buffer* buf; - uint32_t offset; -} LV2_Event_Iterator; - - -/** Reset an iterator to point to the start of @a buf. - * @return True if @a 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 @a iter is valid.. - * @return True if @a iter is valid, otherwise false (past end of buffer) */ -static inline bool -lv2_event_is_valid(LV2_Event_Iterator* iter) -{ - return (iter->offset < iter->buf->size); -} - - -/** Advance @a iter forward one event. - * @a iter must be valid. - * @return True if @a iter is valid, otherwise false (reached end of buffer) */ -static inline bool -lv2_event_increment(LV2_Event_Iterator* iter) -{ - assert(lv2_event_is_valid(iter)); - - LV2_Event* const ev = (LV2_Event*)( - (uint8_t*)iter->buf->data + iter->offset); - - iter->offset += lv2_event_pad_size(sizeof(LV2_Event) + ev->size); - - return true; -} - - -/** Dereference an event iterator (get the event currently pointed at). - * @a iter must be valid. - * @a data if non-NULL, will be set to point to the contents of the event - * returned. - * @return A Pointer to the event @a iter is currently pointing at, or NULL - * if the end of the buffer is reached (in which case @a data is - * also set to NULL). */ -static inline LV2_Event* -lv2_event_get(LV2_Event_Iterator* iter, - uint8_t** data) -{ - assert(lv2_event_is_valid(iter)); - - LV2_Event* const ev = (LV2_Event*)( - (uint8_t*)iter->buf->data + iter->offset); - - if (data) - *data = (uint8_t*)ev + sizeof(LV2_Event); - - return ev; -} - - -/** Write an event at @a iter. - * The event (if any) pointed to by @iter will be overwritten, and @a 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->capacity - iter->buf->size < sizeof(LV2_Event) + size) - return false; - - LV2_Event* const ev = (LV2_Event*)( - (uint8_t*)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(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) -{ - size = lv2_event_pad_size(size); - if (iter->buf->capacity - iter->buf->size < sizeof(LV2_Event) + size) - return NULL; - - LV2_Event* const ev = (LV2_Event*)((uint8_t*)iter->buf->data + - iter->offset); - - ev->frames = frames; - ev->subframes = subframes; - ev->type = type; - ev->size = size; - ++iter->buf->event_count; - - size = lv2_event_pad_size(sizeof(LV2_Event) + size); - iter->buf->size += size; - iter->offset += size; - - return (uint8_t*)ev + sizeof(LV2_Event); -} - - -/** Write an event at @a iter. - * The event (if any) pointed to by @iter will be overwritten, and @a 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) -{ - if (iter->buf->capacity - iter->buf->size < sizeof(LV2_Event) + ev->size) - return false; - - LV2_Event* const write_ev = (LV2_Event*)( - (uint8_t*)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 size = lv2_event_pad_size(sizeof(LV2_Event) + ev->size); - iter->buf->size += size; - iter->offset += size; - - return true; -} - -#endif /* LV2_EVENT_HELPERS_H */ - diff --git a/ext/event.lv2/event.h b/ext/event.lv2/event.h deleted file mode 100644 index 7fb189c..0000000 --- a/ext/event.lv2/event.h +++ /dev/null @@ -1,259 +0,0 @@ -/* lv2_event.h - C header file for the LV2 events extension. - * - * Copyright (C) 2006-2007 Lars Luthman <lars.luthman@gmail.com> - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -#ifndef LV2_EVENT_H -#define LV2_EVENT_H - -#define LV2_EVENT_URI "http://lv2plug.in/ns/ext/event" -#define LV2_EVENT_AUDIO_STAMP 0 - -#include <stdint.h> - -/** @file - * C header for the LV2 Event extension <http://lv2plug.in/ns/ext/event>. - * - * This extension is a generic transport mechanism for time stamped events - * of any type (e.g. MIDI, OSC, ramps, etc). Each port can transport mixed - * events of any type; the type of events and timestamps are defined by a URI - * which is mapped to an integer by the host for performance reasons. - * - * This extension requires the host to support the LV2 URI Map extension. - * Any host which supports this extension MUST guarantee that any call to - * the LV2 URI Map uri_to_id function with the URI of this extension as the - * 'map' argument returns a value within the range of uint16_t. - */ - - -/** The best Pulses Per Quarter Note for tempo-based uint32_t timestmaps. - * 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. - */ -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) - */ -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 (e.g. 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 | ... - */ -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. */ -typedef void* LV2_Event_Callback_Data; - - -/** The data field of the LV2_Feature for this extension. - * - * 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. - */ -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 @a 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 @a 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; - - -#endif /* LV2_EVENT_H */ - diff --git a/ext/event.lv2/event.ttl b/ext/event.lv2/event.ttl deleted file mode 100644 index 4f939a4..0000000 --- a/ext/event.lv2/event.ttl +++ /dev/null @@ -1,192 +0,0 @@ -# LV2 Events Extension -# Copyright (C) 2008 David Robillard <d@drobilla.net> -# -# 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. - -@prefix ev: <http://lv2plug.in/ns/ext/event#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/event> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Events" ; - rdfs:seeAlso "event-helpers.h" ; - doap:release [ - doap:revision "1" ; - doap:created "2008-04-04" ; - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.xrdf> - ] , [ - a foaf:Person ; - foaf:name "Lars Luthman" ; - ] ; - rdfs:comment """ -This extension defines a generic time-stamped event port type, which can be -used to create plugins that read and write real-time events, such as MIDI, -OSC, or any other type of event payload. The type(s) of event supported by -a port is defined in the data file for a plugin, for example: -<pre> -<http://example.org/some-plugin> - lv2:port [ - a ev:EventPort, lv2:InputPort ; - lv2:index 0 ; - ev:supportsEvent <http://lv2plug.in/ns/ext/midi#MidiEvent> ; - lv2:symbol "midi_input" ; - lv2:name "MIDI input" ; - ] . -</pre> -""" . - -ev:EventPort a rdfs:Class ; - rdfs:label "Event port" ; - rdfs:subClassOf lv2:Port ; - rdfs:comment """ -Ports of this type will be connected to a struct of type LV2_Event_Buffer, -defined in event.h. These ports contain a sequence of generic events -(possibly several types mixed in a single stream), the specific types of -which are defined by some URI in another LV2 extension. -""" . - - -ev:Event a rdfs:Class ; - rdfs:label "LV2 event" ; - rdfs:comment """ -A single generic time-stamped event. - -An lv2ev:EventPort contains an LV2_Event_Buffer which contains a sequence -of these events. The binary format of LV2 events is defined by the -LV2_Event struct in event.h. - -Specific event types (e.g. MIDI, OSC) are defined by extensions, and should -be rdfs:subClassOf this class. -""" . - - -ev:TimeStamp a rdfs:Class ; - rdfs:label "LV2 event time stamp" ; - rdfs:comment """ -The time stamp of an Event. - -This defines the meaning of the 'frames' and 'subframes' fields of an -LV2_Event (both unsigned 32-bit integers). -""" . - - -ev:FrameStamp a rdfs:Class ; - rdfs:subClassOf ev:TimeStamp ; - rdfs:label "Audio frame time stamp" ; - rdfs:comment """ -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 1/UINT32_MAX of a frame. -""" . - - -ev:generic a lv2:PortProperty ; - rdfs:label "Generic event port" ; - rdfs:comment """ -Indicates that this port does something meaningful for any event type -(e.g. event mixers, delays, serialisers, etc). If this property is set, hosts -should consider the port suitable for any type of event. Otherwise, hosts -should consider the port 'appropriate' only for the specific event types -listed with :supportsEvent. Note that plugins must gracefully handle unknown -event types whether or not this property is present. -""" . - - -ev:supportsEvent a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range ev:Event ; - rdfs:label "Supports event type" ; - rdfs:comment """ -Indicates that this port supports or "understands" a certain event type. -For input ports, this means the plugin understands and does something useful -with events of this type. For output ports, this means the plugin may generate -events of this type. If the plugin never actually generates events of this type, -but might pass them through from an input, this property should not be set (use -ev:inheritsEvent for that). -Plugins with event input ports must always gracefully handle any type of event, -even if it does not 'support' it. This property should always be set for -event types the plugin understands/generates so hosts can discover plugins -appropriate for a given scenario (e.g. plugins with a MIDI input). -Hosts are not expected to consider event ports suitable for some type of -event if the relevant :supportsEvent property is not set, unless the -lv2ev:generic property for that port is also set. -""" . - - -ev:inheritsEvent a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range lv2:Port ; - rdfs:label "Inherits event type" ; - rdfs:comment """ -Indicates that this output port might pass through events that arrived at some -other input port (or generate an event of the same type as events arriving at -that input). The host must always check the stamp type of all outputs when -connecting an input, but this property should be set whenever it applies. -""" . - - -ev:supportsTimeStamp a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range ev:TimeStamp ; - rdfs:label "Supports time stamp type" ; - rdfs:comment """ -Indicates that this port supports or "understands" a certain time stamp type. -Meaningful only for input ports, the host must never connect a port to an -event buffer with a time stamp type that isn't supported by the port. -""" . - - -ev:generatesTimeStamp a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range ev:TimeStamp ; - rdfs:label "Outputs time stamp type" ; - rdfs:comment """ -Indicates that this port may output a certain time stamp type, regardless of -the time stamp type of any input ports. If the port outputs stamps based on -what type inputs are connected to, this property should not be set (use the -ev:inheritsTimeStamp property for that). Hosts MUST check the time_stamp value -of any output port buffers after a call to connect_port on ANY event input -port on the plugin. If the plugin changes the stamp_type field of an output -event buffer during a call to run(), the plugin must call the -stamp_type_changed function provided by the host in the LV2_Event_Feature -struct, if it is non-NULL. -""" . - - -ev:inheritsTimeStamp a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range lv2:Port ; - rdfs:label "Inherits time stamp type" ; - rdfs:comment """ -Indicates that this port follows the time stamp type of an input port. -This property is not necessary, but it should be set for outputs that -base their output type on an input port so the host can make more sense -of the plugin and provide a more sensible interface. -""" . - diff --git a/ext/event.lv2/lv2_event.pc.in b/ext/event.lv2/lv2_event.pc.in deleted file mode 100644 index 6d556ef..0000000 --- a/ext/event.lv2/lv2_event.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: lv2_event -Version: @LV2_EVENT_VERSION@ -Description: LV2 events extension -Libs: -Cflags: -I${includedir} diff --git a/ext/files.lv2/files.h b/ext/files.lv2/files.h deleted file mode 100644 index 4f0564f..0000000 --- a/ext/files.lv2/files.h +++ /dev/null @@ -1,61 +0,0 @@ -/* lv2_files.h - C header file for the LV2 Files extension. - * Copyright (C) 2010 Leonard Ritter <paniq@paniq.org> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header for the LV2 Files extension <http://lv2plug.in/ns/ext/files>. - */ - -#ifndef LV2_FILES_H -#define LV2_FILES_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define LV2_FILES_URI "http://lv2plug.in/ns/ext/files" - -typedef void* LV2_Files_FileSupport_Data; - -/** Feature structure passed by host to instantiate with feature URI - * <http://lv2plug.in/ns/ext/files#fileSupport>. - */ -typedef struct { - - LV2_Files_FileSupport_Data data; - - /** Return the full path that should be used for a file owned by this - * plugin called @a name. The plugin can assume @a name belongs to a - * namespace dedicated to that plugin instance (i.e. hosts MUST ensure - * this, e.g. by giving each plugin its own directory for files, or - * mangling filenames somehow). - * - * @param data MUST be the @a data member of this struct. - * @param name The name of the file. - * @return A newly allocated path which the plugin may use to create a new - * file. The plugin is responsible for freeing the returned string. - */ - char* new_file_path(LV2_Files_FileSupport_Data data, - const char* name); - -} LV2_Files_FileSupport; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV2_FILES_H */ diff --git a/ext/files.lv2/files.ttl b/ext/files.lv2/files.ttl deleted file mode 100644 index a83889d..0000000 --- a/ext/files.lv2/files.ttl +++ /dev/null @@ -1,94 +0,0 @@ -# LV2 Files Extension -# Copyright (C) 2010 Leonard Ritter <paniq@paniq.org> -# Copyright (C) 2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix files: <http://lv2plug.in/ns/ext/files#> . -@prefix atom: <http://lv2plug.in/ns/ext/atom#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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://lv2plug.in/ns/ext/files> - a lv2:Specification ; - doap:name "LV2 Files" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This extension provides a mechanism for plugins to create new files for -storing arbitrary data (e.g. waveforms), which can be persisted using -the <a href="http://lv2plug.in/ns/ext/persist">LV2 Persist</a> extension. -This allows plugins to work with potentially very large data via files, -and save/restore these files. - -The motivating idea behind this extension is that all details of file -management must be handled by the host in whatever way is most appropriate for -that host. Plugins MUST NOT make any assumption about filesystem locations -beyond what is explicitly guaranteed by this extension. - -To create a new file, plugins request a filename from the host. This way, -the host is aware of files used by the plugin and can use an appropriate -location for them that the plugin alone could not know (e.g. using an -appropriate disk volume for recording). - -Plugins may also use pre-existing files from elsewhere on the filesystem. -Using the LV2 Persist extension, the host can save both these types of files -in an appropriate way (by e.g. storing a link, or copying the file to export -or archive a project). - -""" . - -files:fileSupport a lv2:Feature ; - rdfs:label "Support for plugin-created files" ; - rdfs:comment """ -This feature allows plugins to use pre-existing or newly created files, -and files them (e.g. across project saves and restores). If a host supports -this feature it passes a LV2_Files_FileSupport structure to the plugins -instantiate method as a feature (with URI -http://lv2plug.in/ns/ext/files#FileSupport). This structure provides -a function the plugin can use to create new file names. If and only if the -host supports this feature, the plugin MAY files and restore values of -type LV2_FILES_FILENAME. - -A plugin SHOULD use this facility to create any new files it may need -(e.g. samples, waveforms for recording). Plugins MUST NOT expect their -state to be correctly restored if they do not use this mechanism to -create new files. -""" . - -files:FilePath a atom:AtomType ; - rdfs:label "File Path" ; - rdfs:comment """ -The full path to a file on the local filesystem. The format of a -files:filePath is a C string (escaped or otherwise restricted in whatever way -necessary for the system). This URI (http://lv2plug.in/ns/ext/files#FilePath), -mapped to an integer, should be used as the <code>type</code> parameter with -the LV2 Persist extension to persist a file. When persisting a files:FilePath, -the plugin MUST NOT assume that the same path will be restored (i.e. the -host MAY choose to store the file elsewhere). The plugin may, of course, -assume that the actual contents of the file are equivalent when restored. -""" . diff --git a/ext/files.lv2/manifest.ttl b/ext/files.lv2/manifest.ttl deleted file mode 100644 index 7f572d9..0000000 --- a/ext/files.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/files> - a lv2:Specification ; - rdfs:seeAlso <files.ttl> . - diff --git a/ext/host-info.lv2/host-info.ttl b/ext/host-info.lv2/host-info.ttl deleted file mode 100644 index 2aac2fc..0000000 --- a/ext/host-info.lv2/host-info.ttl +++ /dev/null @@ -1,116 +0,0 @@ -# LV2 Host Info Extension -# PROVISIONAL -# Copyright (C) 2009 David Robillard <d@drobilla.net> -# -# 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. - -@prefix hi: <http://lv2plug.in/ns/ext/host-info#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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 xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix amb: <http://ambisonics.ch/standards/channels/> . - -<http://lv2plug.in/ns/ext/host-info> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Host Info" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This specification defines various properties to represent useful information -about LV2 hosts. Currently, the primary use of this specification is to describe which -extensions are supported by a given host. - -The extensions supported by a host can be described like this: -<pre> -@prefix hi: <http://lv2plug.in/ns/ext/host-info#> . - -<http://example.org/some-host> a hi:Host ; - doap:name "Foo Rack" ; - hi:supportsExtension [ - hi:extension <http://example.org/some-extension> ; - hi:sinceVersion "1.2.0" - ] . -</pre> -"""^^lv2:basicXHTML . - - -## Core Classes / Properties - -hi:Host a rdfs:Class ; - rdfs:label "LV2 Host" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty doap:name ; - owl:someValuesFrom xsd:string ; - owl:minCardinality 1 ; - rdfs:comment "A hi:Host MUST have at least one string doap:name" - ] ; - rdfs:comment """ -An application that supports loading LV2 plugins, or performs other -LV2 related functionality. -""" . - -hi:supportsExtension a rdf:Property ; - rdfs:domain hi:Host ; - rdfs:range hi:ExtensionSupport ; - rdfs:label "supports extension" ; - rdfs:comment "Relates a Host to its ExtensionSupport" . - -hi:ExtensionSupport a rdfs:Class ; - rdfs:label "Extension Support" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty hi:sinceVersion ; - owl:someValuesFrom xsd:string ; - owl:minCardinality 1 ; - rdfs:comment """ -A hi:ExtensionSupport MUST have at least one string hi:sinceVersion -""" ] ; - rdfs:comment "A description of the support for an extension by a Host" . - -hi:extension a rdf:Property ; - rdfs:domain hi:ExtensionSupport ; - rdfs:range lv2:Specification ; - rdfs:label "extension" ; - rdfs:comment "Indicates the extension supported by a host." . - -hi:sinceVersion a rdf:Property ; - rdfs:domain hi:ExtensionSupport ; - rdfs:range xsd:string ; - rdfs:label "since version" ; - rdfs:comment """ -The initial version of a host which supported an extension. -This property MUST always be given -""" . - -hi:untilVersion a rdf:Property ; - rdfs:domain hi:ExtensionSupport ; - rdfs:range xsd:string ; - rdfs:label "until version" ; - rdfs:comment """ -The final version of a host which supported an extension. This property can -be used if support for an extension was discontinued in a host for some reason. -""" . - diff --git a/ext/host-info.lv2/manifest.ttl b/ext/host-info.lv2/manifest.ttl deleted file mode 100644 index a431711..0000000 --- a/ext/host-info.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/host-info> - a lv2:Specification ; - rdfs:seeAlso <host-info.ttl> . - diff --git a/ext/instance-access.lv2/instance-access.h b/ext/instance-access.lv2/instance-access.h deleted file mode 100644 index e8b833f..0000000 --- a/ext/instance-access.lv2/instance-access.h +++ /dev/null @@ -1,39 +0,0 @@ -/* lv2_extension_data.h - C header file for the LV2 Instance Access extension. - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -#ifndef LV2_INSTANCE_ACCESS_H -#define LV2_INSTANCE_ACCESS_H - -#define LV2_INSTANCE_ACCESS_URI "http://lv2plug.in/ns/ext/instance-access" - - -/** @file - * C header for the LV2 Instance Access extension - * <http://lv2plug.in/ns/ext/instance-access>. - * - * This extension defines a method for (e.g.) plugin UIs to get a direct - * handle to an LV2 plugin instance (LV2_Handle), if possible. - * - * To support this feature the host must pass an LV2_Feature struct to the - * UI instantiate method with URI "http://lv2plug.in/ns/ext/instance-access" - * and data pointed directly to the LV2_Handle of the plugin instance. - */ - - -#endif /* LV2_INSTANCE_ACCESS_H */ - diff --git a/ext/instance-access.lv2/instance-access.ttl b/ext/instance-access.lv2/instance-access.ttl deleted file mode 100644 index 0646478..0000000 --- a/ext/instance-access.lv2/instance-access.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# LV2 Data Access Extension -# Copyright (C) 2008 David Robillard <d@drobilla.net> -# -# 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. - -@prefix ia: <http://lv2plug.in/ns/ext/instance-access#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/instance-access> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Instance Access" ; - doap:release [ - doap:revision "1" ; - doap:created "2008-08-11" ; - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.xrdf> - ] ; - rdfs:comment """ -This extension defines a method for (e.g.) plugin UIs to get a direct -handle to an LV2 plugin instance (LV2_Handle), if possible. -""" . diff --git a/ext/midi.lv2/midi.ttl b/ext/midi.lv2/midi.ttl deleted file mode 100644 index 12725ad..0000000 --- a/ext/midi.lv2/midi.ttl +++ /dev/null @@ -1,87 +0,0 @@ -# LV2 MIDI Extension -# Copyright (C) 2008 David Robillard <d@drobilla.net> -# -# Based on lv2-midiport.h: -# Copyright (C) 2006 Lars Luthman <lars.luthman@gmail.com> -# -# 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. - -@prefix midi: <http://lv2plug.in/ns/ext/midi#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix lv2ev: <http://lv2plug.in/ns/ext/events#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/midi> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 MIDI Events" ; - rdfs:comment "Defines an LV2 event type for standard raw MIDI" ; - doap:release [ - doap:revision "1" ; - doap:created "2008-08-11" ; - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.xrdf> - ] , [ - a foaf:Person ; - foaf:name "Lars Luthman" ; - ] . - - -midi:MidiEvent a rdfs:Class ; - rdfs:label "LV2 MIDI event" ; - rdfs:subClassOf lv2ev:Event ; - rdfs:comment """ -A single raw (sequence of bytes) MIDI event. - -These events are equivalent to standard MIDI events, with the following -restrictions to ease the burden on plugin authors: -<ul> - <li>Running status is not allowed. Every event must have its own status - byte.</li> - - <li>Note On events with velocity 0 are not allowed. These events are - equivalent to Note Off in standard MIDI streams, but in order to make - plugins and hosts easier to write, as well as more efficient, only proper - Note Off events are allowed as Note Off.</li> - - <li>"Realtime events" (status bytes 0xF8 to 0xFF) are allowed, but may - not occur inside other events like they are allowed to in hardware MIDI - streams.</li> - - <li>All events must be fully contained in a single data buffer, i.e. events - may not "wrap around" by storing the first few bytes in one buffer and - then wait for the next run() call to store the rest of the event. If - there isn't enough space in the current data buffer to store an event, - the event will either have to wait until next run() call, be ignored, - or compensated for in some more clever way.</li> - - <li>All events must be valid MIDI events. This means for example that - only the first byte in each event (the status byte) may have the eighth - bit set, that Note On and Note Off events are always 3 bytes long etc. - The MIDI writer (host or plugin) is responsible for writing valid MIDI - events to the buffer, and the MIDI reader (plugin or host) can assume that - all events are valid.</li> -</ul> -"""^^lv2:basicXHTML . - diff --git a/ext/osc.lv2/lv2_osc.c b/ext/osc.lv2/lv2_osc.c deleted file mode 100644 index 0c1d1e0..0000000 --- a/ext/osc.lv2/lv2_osc.c +++ /dev/null @@ -1,314 +0,0 @@ -/* LV2 OSC Messages Extension - * Copyright (C) 2007-2009 David Robillard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <errno.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include "lv2_osc.h" -#include "lv2_osc_print.h" - -/*#ifndef BIG_ENDIAN - #ifndef LITTLE_ENDIAN - #warning This code requires BIG_ENDIAN or LITTLE_ENDIAN to be defined - #warning Assuming little endian. THIS MAY BREAK HORRIBLY! - #endif -#endif*/ - -#define lv2_osc_swap32(x) \ -({ \ - uint32_t __x = (x); \ - ((uint32_t)( \ - (((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \ - (((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \ - (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \ - (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \ -}) - -#define lv2_osc_swap64(x) \ -({ \ - uint64_t __x = (x); \ - ((uint64_t)( \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \ - (uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \ -}) - - -/** Pad a size to a multiple of 32 bits */ -inline static uint32_t -lv2_osc_pad_size(uint32_t size) -{ - return size + 3 - ((size-1) % 4); -} - - -inline static uint32_t -lv2_osc_string_size(const char *s) -{ - return lv2_osc_pad_size((uint32_t)strlen(s) + 1); -} - - -static inline uint32_t -lv2_osc_blob_size(const void* blob) -{ - return sizeof(uint32_t) + lv2_osc_pad_size(*((uint32_t*)blob)); -} - - -uint32_t -lv2_osc_arg_size(char type, const LV2_OSC_Argument* arg) -{ - switch (type) { - case 'c': - case 'i': - case 'f': - return 4; - - case 'h': - case 'd': - return 8; - - case 's': - return lv2_osc_string_size(&arg->s); - - /*case 'S': - return lv2_osc_string_size(&arg->S);*/ - - case 'b': - return lv2_osc_blob_size(&arg->b); - - default: - fprintf(stderr, "Warning: unknown OSC type '%c'.", type); - return 0; - } -} - - -void -lv2_osc_argument_swap_byte_order(char type, LV2_OSC_Argument* arg) -{ - switch (type) { - case 'i': - case 'f': - case 'b': - case 'c': - *(int32_t*)arg = lv2_osc_swap32(*(int32_t*)arg); - break; - - case 'h': - case 'd': - *(int64_t*)arg = lv2_osc_swap64(*(int64_t*)arg); - break; - } -} - - -/** Convert a message from network byte order to host byte order. */ -void -lv2_osc_message_swap_byte_order(LV2_OSC_Event* msg) -{ - const char* const types = lv2_osc_get_types(msg); - - for (uint32_t i=0; i < msg->argument_count; ++i) - lv2_osc_argument_swap_byte_order(types[i], lv2_osc_get_argument(msg, i)); -} - - -/** Not realtime safe, returned value must be free()'d by caller. */ -LV2_OSC_Event* -lv2_osc_message_new(const char* path, const char* types, ...) -{ - /* FIXME: path only */ - - LV2_OSC_Event* result = malloc(sizeof(LV2_OSC_Event) - + 4 + lv2_osc_string_size(path)); - - const uint32_t path_size = lv2_osc_string_size(path); - result->data_size = path_size + 4; // 4 for types - result->argument_count = 0; - result->types_offset = lv2_osc_string_size(path) + 1; - (&result->data)[result->types_offset - 1] = ','; - (&result->data)[result->types_offset] = '\0'; - - memcpy(&result->data, path, strlen(path) + 1); - - return result; -} - - -/** Create a new LV2_OSC_Event from a raw OSC message. - * - * If \a out_buf is NULL, new memory will be allocated. Otherwise the returned - * value will be equal to buf, unless there is insufficient space in which - * case NULL is returned. - */ -LV2_OSC_Event* -lv2_osc_message_from_raw(uint32_t out_buf_size, - void* out_buf, - uint32_t raw_msg_size, - void* raw_msg) -{ - const uint32_t message_header_size = (sizeof(uint32_t) * 4); - - const uint32_t path_size = lv2_osc_string_size((char*)raw_msg); - const uint32_t types_len = strlen((char*)(raw_msg + path_size + 1)); - uint32_t index_size = types_len * sizeof(uint32_t); - - if (out_buf == NULL) { - out_buf_size = message_header_size + index_size + raw_msg_size; - out_buf = malloc((size_t)out_buf_size); - } else if (out_buf && out_buf_size < message_header_size + raw_msg_size) { - return NULL; - } - - LV2_OSC_Event* write_loc = (LV2_OSC_Event*)(out_buf); - write_loc->argument_count = types_len; - write_loc->data_size = index_size + raw_msg_size; - - // Copy raw message - memcpy(&write_loc->data + index_size, raw_msg, raw_msg_size); - - write_loc->types_offset = index_size + path_size + 1; - const char* const types = lv2_osc_get_types(write_loc); - - // Calculate/Write index - uint32_t args_base_offset = write_loc->types_offset + lv2_osc_string_size(types) - 1; - uint32_t arg_offset = 0; - - for (uint32_t i=0; i < write_loc->argument_count; ++i) { - ((uint32_t*)&write_loc->data)[i] = args_base_offset + arg_offset; - const LV2_OSC_Argument* const arg = (LV2_OSC_Argument*)(&write_loc->data + args_base_offset + arg_offset); - // Special case because size is still big-endian -#ifndef BIG_ENDIAN - if (types[i] == 'b') // special case because size is still big-endian - arg_offset += lv2_osc_swap32(*((int32_t*)arg)); - else -#endif - arg_offset += lv2_osc_arg_size(types[i], arg); - } - - /*printf("Index:\n"); - for (uint32_t i=0; i < write_loc->argument_count; ++i) { - printf("%u ", ((uint32_t*)&write_loc->data)[i]); - } - printf("\n"); - - printf("Data:\n"); - for (uint32_t i=0; i < (write_loc->argument_count * 4) + size; ++i) { - printf("%3u", i % 10); - } - printf("\n"); - for (uint32_t i=0; i < (write_loc->argument_count * 4) + size; ++i) { - char c = *(((char*)&write_loc->data) + i); - if (c >= 32 && c <= 126) - printf("%3c", c); - else - printf("%3d", (int)c); - } - printf("\n");*/ - - // Swap to host byte order if necessary -#ifndef BIG_ENDIAN - lv2_osc_message_swap_byte_order(write_loc); -#endif - - printf("Created message:\n"); - lv2_osc_message_print(write_loc); - - return write_loc; -} - - -#if 0 -/** Allocate a new LV2OSCBuffer. - * - * This function is NOT realtime safe. - */ -LV2_OSCBuffer* -lv2_osc_buffer_new(uint32_t capacity) -{ - LV2OSCBuffer* buf = (LV2OSCBuffer*)malloc((sizeof(uint32_t) * 3) + capacity); - buf->capacity = capacity; - buf->size = 0; - buf->message_count = 0; - memset(&buf->data, 0, capacity); - return buf; -} - - -void -lv2_osc_buffer_clear(LV2OSCBuffer* buf) -{ - buf->size = 0; - buf->message_count = 0; -} - -int -lv2_osc_buffer_append_message(LV2OSCBuffer* buf, LV2_OSC_Event* msg) -{ - const uint32_t msg_size = lv2_message_get_size(msg); - - if (buf->capacity - buf->size - ((buf->message_count + 1) * sizeof(uint32_t)) < msg_size) - return ENOBUFS; - - char* write_loc = &buf->data + buf->size; - - memcpy(write_loc, msg, msg_size); - - // Index is written backwards, starting at end of data - uint32_t* index_end = (uint32_t*)(&buf->data + buf->capacity - sizeof(uint32_t)); - *(index_end - buf->message_count) = buf->size; - - ++buf->message_count; - - buf->size += msg_size; - - return 0; -} - -int -lv2_osc_buffer_append(LV2OSCBuffer* buf, double time, const char* path, const char* types, ...) -{ - // FIXME: crazy unsafe - LV2_OSC_Event* write_msg = (LV2_OSC_Event*)(&buf->data + buf->size); - - write_msg->time = time; - write_msg->data_size = 0; - write_msg->argument_count = 0; - write_msg->types_offset = strlen(path) + 1; - - memcpy(&write_msg->data, path, write_msg->types_offset); - - /*fprintf(stderr, "Append message:\n"); - lv2_osc_message_print(write_msg); - fprintf(stderr, "\n");*/ - - uint32_t msg_size = lv2_message_get_size(write_msg); - buf->size += msg_size; - buf->message_count++; - - return 0; -} -#endif - diff --git a/ext/osc.lv2/lv2_osc.pc.in b/ext/osc.lv2/lv2_osc.pc.in deleted file mode 100644 index 0424836..0000000 --- a/ext/osc.lv2/lv2_osc.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: lv2_osc -Version: @LV2_OSC_VERSION@ -Description: LV2 OSC message events extension -Libs: -Cflags: -I${includedir} diff --git a/ext/osc.lv2/lv2_osc_print.c b/ext/osc.lv2/lv2_osc_print.c deleted file mode 100644 index 5282d46..0000000 --- a/ext/osc.lv2/lv2_osc_print.c +++ /dev/null @@ -1,66 +0,0 @@ -/* LV2 OSC Messages Extension - Pretty printing methods - * Copyright (C) 2007-2009 David Robillard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <stdio.h> -#include "lv2_osc_print.h" - -void -lv2_osc_argument_print(char type, const LV2_OSC_Argument* arg) -{ - int32_t blob_size; - - switch (type) { - case 'c': - printf("%c", arg->c); break; - case 'i': - printf("%d", arg->i); break; - case 'f': - printf("%f", arg->f); break; - case 'h': - printf("%ld", arg->h); break; - case 'd': - printf("%f", arg->d); break; - case 's': - printf("\"%s\"", &arg->s); break; - /*case 'S': - printf("\"%s\"", &arg->S); break;*/ - case 'b': - blob_size = *((int32_t*)arg); - printf("{ "); - for (int32_t i=0; i < blob_size; ++i) - printf("%X, ", (&arg->b)[i+4]); - printf(" }"); - break; - default: - printf("?"); - } -} - - -void -lv2_osc_print(const LV2_OSC_Event* msg) -{ - const char* const types = lv2_osc_get_types(msg); - - printf("%s (%s) ", lv2_osc_get_path(msg), types); - for (uint32_t i=0; i < msg->argument_count; ++i) { - lv2_osc_argument_print(types[i], lv2_osc_get_argument(msg, i)); - printf(" "); - } - printf("\n"); -} - diff --git a/ext/osc.lv2/lv2_osc_test.c b/ext/osc.lv2/lv2_osc_test.c deleted file mode 100644 index 3f76d41..0000000 --- a/ext/osc.lv2/lv2_osc_test.c +++ /dev/null @@ -1,55 +0,0 @@ -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <lo/lo.h> -#include "lv2_osc.h" -#include "lv2_osc_print.h" - -int -main() -{ - lo_message lo_msg = lo_message_new(); - //lo_message_add_symbol(lo_msg, "a_sym"); - lo_message_add_string(lo_msg, "Hello World"); - lo_message_add_char(lo_msg, 'a'); - lo_message_add_int32(lo_msg, 1234); - lo_message_add_float(lo_msg, 0.1234); - lo_message_add_int64(lo_msg, 5678); - lo_message_add_double(lo_msg, 0.5678); - - - /*unsigned char blob_data[] = { 0,1,2,3,4,5,6,7,8,9 }; - lo_blob blob = lo_blob_new(10, blob_data); - lo_message_add_blob(lo_msg, blob);*/ - - /* Leaks like a sieve */ - - size_t raw_msg_size = 0; - void* raw_msg = lo_message_serialise(lo_msg, "/foo/bar", NULL, &raw_msg_size); - - LV2Message* msg = lv2_osc_message_from_raw(0.0, 0, NULL, raw_msg_size, raw_msg); - assert(msg); - - LV2OSCBuffer* buf = lv2_osc_buffer_new(1024); - - int ret = lv2_osc_buffer_append_message(buf, msg); - if (ret) - fprintf(stderr, "Message append failed: %s", strerror(ret)); - - lo_message lo_msg_2 = lo_message_new(); - lo_message_add_string(lo_msg_2, "Another message"); - - raw_msg = lo_message_serialise(lo_msg_2, "/baz", NULL, &raw_msg_size); - - msg = lv2_osc_message_from_raw(0.0, 0, NULL, raw_msg_size, raw_msg); - assert(msg); - - ret = lv2_osc_buffer_append_message(buf, msg); - if (ret) - fprintf(stderr, "Message append failed: %s", strerror(ret)); - - printf("\nBuffer contents:\n\n"); - lv2_osc_buffer_print(buf); - - return 0; -} diff --git a/ext/osc.lv2/manifest.ttl b/ext/osc.lv2/manifest.ttl deleted file mode 100644 index dc7c310..0000000 --- a/ext/osc.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/osc> - a lv2:Specification ; - rdfs:seeAlso <osc.ttl> . - diff --git a/ext/osc.lv2/osc-print.h b/ext/osc.lv2/osc-print.h deleted file mode 100644 index 8e34882..0000000 --- a/ext/osc.lv2/osc-print.h +++ /dev/null @@ -1,42 +0,0 @@ -/* LV2 OSC Messages Extension - Pretty printing methods - * Copyright (C) 2007-2009 David Robillard - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/** @file - * Helper functions for printing LV2 OSC messages as defined by the - * LV2 OSC extension <http://lv2plug.in/ns/ext/osc>. - */ - -#ifndef LV2_OSC_PRINT_H -#define LV2_OSC_PRINT_H - -#include "lv2/http/lv2plug.in/ns/ext/osc/osc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void -lv2_osc_argument_print(char type, const LV2_OSC_Argument* arg); - -void -lv2_osc_message_print(const LV2_OSC_Event* msg); - -#ifdef __cplusplus -} -#endif - -#endif /* LV2_OSC_PRINT_H */ diff --git a/ext/osc.lv2/osc.h b/ext/osc.lv2/osc.h deleted file mode 100644 index 23e49a9..0000000 --- a/ext/osc.lv2/osc.h +++ /dev/null @@ -1,123 +0,0 @@ -/* LV2 OSC Messages Extension - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef LV2_OSC_H -#define LV2_OSC_H - -#include <stdint.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/** @file - * C header for the LV2 OSC extension <http://lv2plug.in/ns/ext/osc>. - * This extension uses (raw) OSC messages - * and a buffer format which contains a sequence of timestamped messages. - * Additional (ie beyond raw OSC) indexing information is stored in the buffer - * for performance, so that accessors for messages and arguments are very fast: - * O(1) and realtime safe, unless otherwise noted. - */ - - -/** Argument (in a message). - * - * The name of the element in this union directly corresponds to the OSC - * type tag character in LV2_Event::types. - */ -typedef union { - /* Standard OSC types */ - int32_t i; /**< 32 bit signed integer */ - float f; /**< 32 bit IEEE-754 floating point number ("float") */ - char s; /**< Standard C, NULL terminated string */ - uint8_t b; /**< Blob (int32 size then size bytes padded to 32 bits) */ - - /* "Nonstandard" OSC types (defined in the OSC standard) */ - int64_t h; /* 64 bit signed integer */ - // t /* OSC-timetag */ - double d; /* 64 bit IEEE 754 floating point number ("double") */ - // S /* Symbol, represented as an OSC-string */ - int32_t c; /* Character, represented as a 32-bit integer */ - // r /* 32 bit RGBA color */ - // m /* 4 byte MIDI message. Bytes from MSB to LSB are: port id, status byte, data1, data2 */ - // T /* True. No bytes are allocated in the argument data. */ - // F /* False. No bytes are allocated in the argument data. */ - // N /* Nil. No bytes are allocated in the argument data. */ - // I /* Infinitum. No bytes are allocated in the argument data. */ - // [ /* The beginning of an array. */ - // ] /* The end of an array. */ -} LV2_OSC_Argument; - - - -/** Message. - * - * This is an OSC message at heart, but with some additional cache information - * to allow fast access to parameters. This is the payload of an LV2_Event, - * time stamp and size (being generic) are in the containing header. - */ -typedef struct { - uint32_t data_size; /**< Total size of data, in bytes */ - uint32_t argument_count; /**< Number of arguments in data */ - uint32_t types_offset; /**< Offset of types string in data */ - - /** Take the address of this member to get a pointer to the remaining data. - * - * Contents are an argument index: - * uint32_t argument_index[argument_count] - * - * followed by a standard OSC message: - * char path[path_length] (padded OSC string) - * char types[argument_count] (padded OSC string) - * void data[data_size] - */ - char data; - -} LV2_OSC_Event; - -LV2_OSC_Event* lv2_osc_event_new(const char* path, const char* types, ...); - -LV2_OSC_Event* lv2_osc_event_from_raw(uint32_t out_buf_size, void* out_buf, - uint32_t raw_msg_size, void* raw_msg); - -static inline uint32_t lv2_osc_get_osc_message_size(const LV2_OSC_Event* msg) - { return (msg->argument_count * sizeof(char) + 1) + msg->data_size; } - -static inline const void* lv2_osc_get_osc_message(const LV2_OSC_Event* msg) - { return (const void*)(&msg->data + (sizeof(uint32_t) * msg->argument_count)); } - -static inline const char* lv2_osc_get_path(const LV2_OSC_Event* msg) - { return (const char*)(&msg->data + (sizeof(uint32_t) * msg->argument_count)); } - -static inline const char* lv2_osc_get_types(const LV2_OSC_Event* msg) - { return (const char*)(&msg->data + msg->types_offset); } - -static inline LV2_OSC_Argument* lv2_osc_get_argument(const LV2_OSC_Event* msg, uint32_t i) - { return (LV2_OSC_Argument*)(&msg->data + ((uint32_t*)&msg->data)[i]); } - -/* -int lv2_osc_buffer_append_message(LV2_Event_Buffer* buf, LV2_Event* msg); -int lv2_osc_buffer_append(LV2_Event_Buffer* buf, double time, const char* path, const char* types, ...); -void lv2_osc_buffer_compact(LV2_Event_Buffer* buf); -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* LV2_OSC_H */ diff --git a/ext/osc.lv2/osc.ttl b/ext/osc.lv2/osc.ttl deleted file mode 100644 index 1cacdab..0000000 --- a/ext/osc.lv2/osc.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# LV2 OSC Messages Extension -# Copyright (C) 2007 David Robillard <d@drobilla.net> -# -# 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. - -@prefix osc: <http://lv2plug.in/ns/ext/osc#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/osc> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 OSC Events" ; - rdfs:comment "Defines an LV2 event type for standard raw OSC" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.xrdf> - ] . - - -####################### -## Plugin Properties ## -####################### - -osc:interfacePort a rdf:Property ; - rdfs:domain lv2:Plugin ; - rdfs:range lv2:Port ; - rdfs:label "Has a main OSC control port" ; - rdfs:comment """ -Specifies a port that can be used as the OSC interface for the plugin as a -whole. For example, if a host is providing an OSC interface to a plugin at -/some/osc/path/someplugin and a message /some/osc/path/someplugin/foo is -received, the message /foo should be sent to this port. -""" . - diff --git a/ext/parameter.lv2/manifest.ttl b/ext/parameter.lv2/manifest.ttl deleted file mode 100644 index 04e511d..0000000 --- a/ext/parameter.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/parameter> - a lv2:Specification ; - rdfs:seeAlso <parameter.ttl> . - diff --git a/ext/parameter.lv2/parameter.ttl b/ext/parameter.lv2/parameter.ttl deleted file mode 100644 index 5970844..0000000 --- a/ext/parameter.lv2/parameter.ttl +++ /dev/null @@ -1,110 +0,0 @@ -# LV2 Parameter Extension -# Copyright (C) 2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix atom: <http://lv2plug.in/ns/ext/atom#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix param: <http://lv2plug.in/ns/ext/parameter#> . -@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://lv2plug.in/ns/ext/parameter> - a lv2:Specification ; - doap:name "LV2 Parameter" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -""" . - - -param:Parameter a rdfs:Class ; a lv2:Resource ; - rdfs:label "Parameter" ; - rdfs:comment """ -A parameter on an LV2 plugin. Parameters can be manipulated to alter the -behaviour or output of a plugin. Unlike lv2:ControlPort: -<ul> -<li>A parameter may have any data type</li> -<li>Parameters can be dynamically added or removed</li> -<li>Parameter values can be manipulated by the plugin</li> -</ul> - -Note that plugins are not required to support this potential functionality, -parameters can be used to provide a basic LADSPA-like set of floating point -parameters in a more extensible manner. - -Parameters are essentially controls that are not 1:1 associated with ports -(manipulation of parameters can be accomplished by e.g. sending messages -to a command port). -""" . - - -param:supportsType a rdf:Property ; - rdfs:domain param:Parameter ; - rdfs:range atom:AtomType ; - rdfs:label "supports type" ; - rdfs:comment """ -Indicates that a Parameter has values of a particular type. A Parameter -may support many types. Parameter values are always LV2 Atoms as defined -by the LV2 Atom Extension <http://lv2plug.in/ns/ext/atom#>. Any type -of LV2 Atom may be used as a parameter value. -""" . - - -param:value a rdf:Property ; - rdfs:domain param:Parameter ; - rdfs:label "value" ; - rdfs:comment """ -Indicates that a Parameter has a certain value. A Parameter has at most -one value at any given time. The type of the value specified must be -one of the types specified by param:supportsType. When used in a plugin -data file this property specifies the default value of a parameter. -""" . - - -param:minimum a rdf:Property ; - rdfs:domain param:Parameter ; - rdfs:label "minimum" ; - rdfs:comment """ -Specifies the minimum value of a Parameter (for Parameters with comparable -types for which this makes sense). The type of the minimum must be one of -the types specified by param:supportsType. The host MAY attempt to set a -parameter to any value (of a legal type), i.e. the plugin MUST NOT assume -attempts to change a parameter are within range and SHOULD clamp accordingly. -""" . - - -param:maximum a rdf:Property ; - rdfs:domain param:Parameter ; - rdfs:label "maximum" ; - rdfs:comment """ -Specifies the maximum value of a Parameter (for Parameters with comparable -types for which this makes sense). The type of the maximum must be one of -the types specified by param:supportsType. The host MAY attempt to set a -parameter to any value (of a legal type), i.e. the plugin MUST NOT assume -attempts to change a parameter are within range and SHOULD clamp accordingly. -""" . - diff --git a/ext/persist.lv2/manifest.ttl b/ext/persist.lv2/manifest.ttl deleted file mode 100644 index f1a7ecd..0000000 --- a/ext/persist.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/persist> - a lv2:Specification ; - rdfs:seeAlso <persist.ttl> . - diff --git a/ext/persist.lv2/persist.h b/ext/persist.lv2/persist.h deleted file mode 100644 index 928a297..0000000 --- a/ext/persist.lv2/persist.h +++ /dev/null @@ -1,177 +0,0 @@ -/* lv2_persist.h - C header file for the LV2 Persist extension. - * Copyright (C) 2010 Leonard Ritter <paniq@paniq.org> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header for the LV2 Persist extension <http://lv2plug.in/ns/ext/persist>. - */ - -#ifndef LV2_PERSIST_H -#define LV2_PERSIST_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define LV2_PERSIST_URI "http://lv2plug.in/ns/ext/persist" - -/** Causes the host to store a value under a given key. - * - * This callback is passed by the host to LV2_Persist.save(). - * @param callback_data Must be the callback_data passed to LV2_Persist.save(). - * @param key The URI key (RDF predicate) under which the value is to be stored. - * @param value Pointer to the value (RDF object) to be stored. - * @param size The size of the data at @a value in bytes. - * @param type The type of @a value, as a URI mapped to an integer. - * - * Unless @a type is 0, @a value is guaranteed to be POD (i.e. a region - * of memory that does not contain pointers and can safely be copied - * and persisted indefinitely with a simple memcpy). If @a type is 0, - * then @a value is a reference, as defined by the LV2 Atom extension - * <http://lv2plug.in/ns/ext/atom/>. Hosts are not required to support - * references, a plugin MUST NOT expect a host to persist references unless - * the host supports the feature <http://lv2plug.in/ns/ext/atom#blobSupport>. - * - * Note that @a size MUST be > 0, and @a value MUST point to a valid region of - * memory @a size bytes long (this is required to make restore unambiguous). - * If only the key is of interest, store the empty string (which has size 1). - */ -typedef void (*LV2_Persist_Store_Function)( - void* callback_data, - const char* key, - const void* value, - size_t size, - uint32_t type); - -/** Causes the host to retrieve a value under a given key. - * - * This callback is passed by the host to LV2_Persist.restore(). - * @param callback_data Must be the callback_data passed to LV2_Persist.restore(). - * @param key The URI key (RDF predicate) under which a value has been stored. - * @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. - * @return A pointer to the restored value (RDF object), or NULL if no value - * has been stored under @a key. - * - * The returned value MUST remain valid until LV2_Persist.restore() returns. The plugin - * MUST NOT attempt to access a returned pointer outside of the LV2_Persist.restore() - * context (it MUST make a copy in order to do so). - */ -typedef const void* (*LV2_Persist_Retrieve_Function)( - void* callback_data, - const char* key, - size_t* size, - uint32_t* type); - -/** When the plugin's extension_data is called with argument LV2_PERSIST_URI, - * the plugin MUST return an LV2_Persist 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 - * for the given function are met). - * - * The typical use case is to save the plugin's state when a project is - * saved, and to restore the state when a project has been loaded. Other - * uses are possible (e.g. cloning plugin instances or taking a snapshot - * of plugin state). - * - * 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 a plugin's ports change). Plugin - * authors should consider this possibility, and always store sensible data - * with meaningful types to avoid such compatibility issues in the future. - */ -typedef struct _LV2_Persist { - /** Causes the plugin to save state data using a host-provided - * @a store callback. - * - * @param instance The instance handle of the plugin. - * @param store The host-provided store callback. - * @param callback_data An opaque pointer to host data, e.g. the map or - * file where the values are to be stored. If @a store is called, - * this MUST be passed as its callback_data parameter. - * - * The plugin is expected to store everything necessary to completely - * restore its state later (possibly much later, in a different - * process, on a completely different machine, etc.) - * - * The @a callback_data pointer and @a 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 (e.g. 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 point in time. The simplest way to do this is to modify a - * copy of the state map and atomically swap a pointer to the entire - * map once the changes are complete (for very large state maps, - * a purely functional map data structure would be more appropriate - * since a complete copy is not necessary). - */ - void (*save)(LV2_Handle instance, - LV2_Persist_Store_Function store, - void* callback_data); - - /** Causes the plugin to restore state data using a host-provided - * @a retrieve callback. - * - * @param instance The instance handle of the plugin. - * @param retrieve The host-provided retrieve callback. - * @param callback_data An opaque pointer to host data, e.g. the map or - * file from which the values are to be restored. If @a retrieve is - * called, this MUST be passed as its callback_data parameter. - * - * The plugin MAY assume a restored value was set by a previous call to - * LV2_Persist.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 @a callback_data pointer and @a 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. - */ - void (*restore)(LV2_Handle instance, - LV2_Persist_Retrieve_Function retrieve, - void* callback_data); - -} LV2_Persist; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* LV2_PERSIST_H */ diff --git a/ext/persist.lv2/persist.ttl b/ext/persist.lv2/persist.ttl deleted file mode 100644 index 1cbbdb7..0000000 --- a/ext/persist.lv2/persist.ttl +++ /dev/null @@ -1,121 +0,0 @@ -# LV2 Persist Extension -# Copyright (C) 2010 Leonard Ritter <paniq@paniq.org> -# Copyright (C) 2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix persist: <http://lv2plug.in/ns/ext/persist#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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://lv2plug.in/ns/ext/persist> - a lv2:Specification ; - doap:name "LV2 Persist" ; - doap:developer [ - a foaf:Person ; - foaf:name "Leonard Ritter" ; - foaf:homepage <http://paniq.org> ; - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This extension provides a mechanism for plugins to save and restore state -across instances, allowing hosts to save configuration/state/data with a -project or fully clone a plugin instance (including internal state). - -The motivating idea behind this extension is that a plugin instance's state -is entirely represented by port values and a single key/value dictionary. -This makes state well-defined and easily manageable by hosts. Keys are URIs, -avoiding conflicts and allowing the same dictionary to be used to store plugin -state in any context. Values are typed tagged (by URI mapped integers), -but otherwise are simple binary blobs. - -This extension defines plugin instance state and provides a mechanism -for saving/restoring it, but otherwise makes no restrictions on how a -plugin works with state. For example, other extensions may define dynamic -ways to control plugin state at runtime. The idea is that <em>all</em> -plugin state can be represented with a single (conceptual) dictionary. -This state representation is tried-and-true, universal, and works well with -many existing technologies. Accordingly, plugins/extensions that deal with -instance state in any way SHOULD represent it in a way compatible with this -extension, i.e. URI keys with URI-typed values. Similarly, plugins SHOULD NOT -use any other mechanism to store/restore state; this <strong>will</strong> -cause serious problems, don't do it! Note that you can store values of any -format whatsoever, so if you have an existing state representation to use -(e.g. XML), simply store it as a single value under some key. - -Files may be persisted using this extension in conjunction with the -<a href="http://lv2plug.in/ns/ext/files">LV2 Files</a> extension. - -Instance state as defined by this extension is RDF compatible, allowing for -simple and seamless integration with existing technology (LV2 or otherwise). -An obvious benefit of this is that plugin state can be elegantly described -in Turtle files; the persist:instanceState predicate is provided for this -purpose. RDF compatibility is also convenient since LV2 hosts are likely -to already have mechanisms for working with RDF-style data. Note, however, -that hosts may store state in any way, and are not required to use any -specific technology or file format to support this extension. -""" . - -persist:InstanceState - a rdfs:Class ; - rdfs:label "Plugin Instance State" ; - rdfs:comment """ -This class is used to express a plugin instance's state in RDF. The key/value -properties of the instance form the predicate/object (respectively) of triples -with a persist:InstanceState as the subject (see persist:instanceState -for an example). This may be used wherever it is useful to express a -plugin instance's state in RDF (e.g. for serialisation, storing in a model, or -transmitting over a network). Note that this class is provided because it -may be useful for hosts, plugins, or extensions that work with instance state, -but its use is not required to support the LV2 Persist extension. -""" . - - -persist:instanceState - a rdf:Property ; - rdfs:range persist:InstanceState ; - rdfs:comment """ -Predicate to relate a plugin instance to an InstanceState. This may be used -wherever the state of a particular plugin instance needs to be represented. -Note that the domain of this property is unspecified, since LV2 does not -define any RDF class for plugin instance. This predicate may be used -wherever it makes sense to do so, e.g.: -<pre> -@prefix eg: <http://example.org/> . - -<plugininstance> persist:instanceState [ - eg:somekey "some value" ; - eg:someotherkey "some other value" ; - eg:favouritenumber 2 . -] -</pre> -Note that this property is provided because it may be useful for hosts, -plugins, or extensions that work with instance state, but its use is not -required to support the LV2 Persist extension. -""" . -
\ No newline at end of file diff --git a/ext/polymorphic-port.lv2/manifest.ttl b/ext/polymorphic-port.lv2/manifest.ttl deleted file mode 100644 index abe3788..0000000 --- a/ext/polymorphic-port.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/polymorphic-port> - a lv2:Specification ; - rdfs:seeAlso <polymorphic-port.ttl> . - diff --git a/ext/polymorphic-port.lv2/polymorphic-port.h b/ext/polymorphic-port.lv2/polymorphic-port.h deleted file mode 100644 index 98d691e..0000000 --- a/ext/polymorphic-port.lv2/polymorphic-port.h +++ /dev/null @@ -1,63 +0,0 @@ -/* lv2_data_access.h - C header file for the LV2 Data Access extension. - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header for the LV2 Polymorphic Port extension - * <http://lv2plug.in/ns/ext/polymorphic-port>. - * - * This extension defines a buffer format for ports that can take on - * various types dynamically at runtime. - */ - -#ifndef LV2_POLYMORPHIC_PORT_H -#define LV2_POLYMORPHIC_PORT_H - -#define LV2_POLYMORPHIC_PORT_URI "http://lv2plug.in/ns/ext/polymorphic-port" - -/** 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/polymorphic-port" - * and data pointed to an instance of this struct. - */ -typedef struct { - - /** Set the type of a polymorphic port. - * If the plugin specifies constraints on port types, the host MUST NOT - * call the run method until all port types have been set to a valid - * configuration. Whenever the type for a port is changed, the host - * MUST call connect_port before the next call to the run method. - * The return value of this function SHOULD be ignored by hosts at this - * time (future revisions of this extension may specify return values). - * Plugins which do not know of any future revision or extension that - * dictates otherwise MUST return 0 from this function. - * @param port Index of the port to connect (same as LV2 connect_port) - * @param type Mapped URI for the type of data being connected - * @param type_data Type specific data defined by type URI (may be NULL) - * @return Unused at this time - */ - uint32_t (*set_type)(LV2_Handle instance, - uint32_t port, - uint32_t type, - void* type_data); - -} LV2_Polymorphic_Feature; - - -#endif /* LV2_POLYMORPHIC_PORT_H */ - diff --git a/ext/polymorphic-port.lv2/polymorphic-port.ttl b/ext/polymorphic-port.lv2/polymorphic-port.ttl deleted file mode 100644 index b3d1b37..0000000 --- a/ext/polymorphic-port.lv2/polymorphic-port.ttl +++ /dev/null @@ -1,71 +0,0 @@ -# LV2 Polymorphic Port Extension -# Copyright (C) 2008 David Robillard <d@drobilla.net> -# -# 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. - -@prefix polym: <http://lv2plug.in/ns/ext/polymorphic-port#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/polymorphic-port> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Polymorphic Ports" ; - rdfs:comment "Defines LV2 ports which can dynamically change type" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] . - - -polym:PolymorphicPort a rdfs:Class ; - rdfs:label "Polymorphic port" ; - rdfs:subClassOf lv2:Port ; - rdfs:comment """ -Ports of this type may be connected to buffers of several types. The plugin -provides a set_type function for the host to specify which type a port is -currently connected to. - -A Port specifies the types it supports using the :supportsType property. -The type specific in the normal LV2 manner (<port> a <sometype>) -is the "default type". If the port is connected without set_type being called -for that port, the type of the buffer is assumed to be the default type. -In this way polymorphic plugins are backwards compatible and may be used by -hosts which are not aware of the polymorphic port extension. -""" . - -polym:generic a lv2:PortProperty ; - rdfs:label "Generic polymorphic port" ; - rdfs:comment """ -Indicates that this port can be connected to a buffer of any type. -""" . - -polym:supportsType a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:label "Supports data type" ; - rdfs:comment """ -Indicates that this port supports or "understands" a certain data type. -Hosts MUST NOT connect a port to a buffer unless the port is :generic, -or is described as supporting the type of that buffer with this property. -""" . - diff --git a/ext/port-groups.lv2/port-groups.ttl b/ext/port-groups.lv2/port-groups.ttl deleted file mode 100644 index e0512db..0000000 --- a/ext/port-groups.lv2/port-groups.ttl +++ /dev/null @@ -1,489 +0,0 @@ -# LV2 Port Groups Extension -# PROVISIONAL -# Copyright (C) 2009 David Robillard <d@drobilla.net> -# Copyright (C) 2008-2009 Lars Luthman <lars.luthman@gmail.com> -# -# 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. - -@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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 xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix amb: <http://ambisonics.ch/standards/channels/> . - -<http://lv2plug.in/ns/ext/port-groups> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Port Groups" ; - rdfs:comment "Defines semantic groupings of LV2 ports" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Lars Luthman" ; - foaf:mbox <mailto:lars.luthman@gmail.com> - ] , [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] . - - -## Core Classes / Properties - -pg:Group a rdfs:Class ; - rdfs:label "LV2 Port Group" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty lv2:symbol ; - owl:someValuesFrom xsd:string ; - owl:cardinality 1 ; - rdfs:comment """ -A pg:Group MUST have exactly one string lv2:symbol. This symbol must be -unique according to the same rules as the lv2:symbol for an lv2:Port, where -group symbols and port symbols reside in the same namespace. In other words, -a group on a plugin MUST NOT have the same symbol as another group or a port -on that plugin. Rationale: Hosts or bindings may find it useful to construct -an identifier to refer to groups for the same reasons this is useful for ports. -""" - ] ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty pg:hasRole ; - owl:someValuesFrom pg:RoleAssignment ; - owl:minCardinality 1 ; - rdfs:comment "A Group MUST have at least one role assignment" - ] ; - rdfs:comment """ -A grouping of ports that can be logically considered a single "stream", e.g. -two audio ports in a group may form a stereo stream. The pg:source predicate -can also be used to describe this correspondence between separate ports/groups. -""" . - -pg:index a rdf:Property ; - rdfs:domain pg:RoleAssignment ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:label "index" ; - rdfs:comment "Index of a role within some group" . - -pg:RoleAssignment a rdfs:Class ; - rdfs:label "Role Assignment" ; - rdfs:comment "A numbered role within some Group." ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty pg:index ; - owl:cardinality 1 ; - rdfs:comment """ -A RoleAssignment MUST have exactly one index. -""" ] ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onProperty pg:role ; - owl:cardinality 1 ; - rdfs:comment """ -A RoleAssignment MUST have exactly one role. -""" ] ; - rdfs:comment """ -All group definitions MUST define the order of channels. Note that this -does not have anything to do with port indices, this information is only -defined here for use by other extensions. For simply assigning groups -and roles to a basic LV2 plugin, index is irrelevant. -""" . - -pg:hasChannel a rdf:Property ; - rdfs:domain pg:Group ; - rdfs:range pg:Channel ; - rdfs:label "Has port with role" ; - rdfs:comment """ -Indicates that a group always has a port with a particular role. -""" . - -pg:sideChainOf a rdf:Property ; - rdfs:domain pg:Group , lv2:Port ; - rdfs:range pg:Group , lv2:Port ; - rdfs:label "Side-chain of" ; - rdfs:comment """ -Indicates that this port or group should be considered a "side chain" of -some other port or group. The precise definition of "side chain" depends -on the plugin, but in general this group should be considered a modifier to -some other group, rather than an independent input itself. -""" . - -pg:subGroupOf a rdf:Property ; - rdfs:domain pg:Group ; - rdfs:range pg:Group ; - rdfs:label "Sub-group of" ; - rdfs:comment """ -Indicates that this group is a child of another group. This property has -no meaning with respect to plugin execution, but the host may find this -information useful (e.g. to provide a compact user interface). Note that -all groups on a plugin MUST have a unique symbol with respect to the plugin -as documented for pg:Group, i.e. sub-groups must have a unique symbol among -all groups and ports on the plugin. -""" . - -pg:source a rdf:Property ; - rdfs:domain pg:Group , lv2:Port ; - rdfs:range pg:Group , lv2:Port ; - rdfs:label "Source group" ; - rdfs:comment """ -Indicates that this port or group should be considered the "result" of -some other port or group. This property only makes sense on groups with -outputs when the source is a group with inputs. This can be used to convey -a relationship between corresponding input and output groups with different -types, e.g. a mono->stereo plugin. -""" . - -pg:mainGroup a rdf:Property ; - rdfs:domain lv2:Plugin ; - rdfs:range pg:Group ; - rdfs:label "Main port group" ; - rdfs:comment """ -Indicates that this group should be considered the "main" inputs/outputs of -the plugin, e.g. it probably makes sense to just connect main groups and set -some controls. A plugin MUST NOT have more than one :mainGroup property. -High-level hosts that simply want to insert an plugin in a given stream -should use this property to determine where the plugin 'fits'. -""" . - -pg:inGroup a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range pg:Group ; - rdfs:label "In port group" ; - rdfs:comment """ -Indicates that this port is a part of a group of ports on the plugin. -Ports that have a meaningful "role" that may be useful to hosts SHOULD also -have a :role property, otherwise ports in the group have no meaningful order. -""" . - -pg:Role a rdfs:Class ; - rdfs:label "Port role" ; - rdfs:comment """ -The role of a port with respect to its plugin or group. If the port is a -member of a group (has an :inGroup property) the role is relevant with respect -to that group. Otherwise the role is relevant with respect to the plugin. -""" . - -pg:role a rdf:Property ; - rdfs:domain pg:Port , pg:RoleAssignment; - rdfs:range pg:Role ; - rdfs:label "Role" ; - rdfs:comment """ -Indicates that this port has a particular role with respect to its enclosing -plugin or group (whichever is smaller). A port may have several roles if it -makes sense to do so (though some Role or Group definition may forbid this). -""" . - - -# Discrete - -pg:DiscreteGroup a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:comment """ -"Discrete" channel configurations. These groups are divided into channels -where each represents a particular speaker location. The position of sound -in one of these groups depends on a particular speaker configuration. -""" . - -pg:leftChannel a pg:Role ; rdfs:label "Left" . -pg:rightChannel a pg:Role ; rdfs:label "Right" . -pg:centerChannel a pg:Role ; rdfs:label "Center" . -pg:sideChannel a pg:Role ; rdfs:label "Side" . -pg:centerLeftChannel a pg:Role ; rdfs:label "Center Left" . -pg:centerRightChannel a pg:Role ; rdfs:label "Center Right" . -pg:sideLeftChannel a pg:Role ; rdfs:label "Side Left" . -pg:sideRightChannel a pg:Role ; rdfs:label "Side Right" . -pg:rearLeftChannel a pg:Role ; rdfs:label "Rear Left" . -pg:rearRightChannel a pg:Role ; rdfs:label "Rear Right" . -pg:rearCenterChannel a pg:Role ; rdfs:label "Rear Center" . -pg:lfeChannel a pg:Role ; rdfs:label "Sub (LFE)" . - -pg:MonoGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "Mono" ; - pg:hasRole [ pg:index 0; pg:role pg:centerChannel ] . - -pg:StereoGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "Stereo" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:rightChannel ] . - -pg:MidSideGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "Mid-Side Stereo" ; - pg:hasRole [ pg:index 0; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:sideChannel ] . - -pg:ThreePointZeroGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "3.0 Surround" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:rearCenterChannel ] . - -pg:FourPointZeroGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "4.0 Surround (Quadraphonic)" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 3; pg:role pg:rearCenterChannel ] . - -pg:FivePointZeroGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "5.0 Surround (3-2 stereo)" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 3; pg:role pg:rearLeftChannel ] ; - pg:hasRole [ pg:index 4; pg:role pg:rearRightChannel ] . - -pg:FivePointOneGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "5.1 Surround (3-2 stereo)" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 3; pg:role pg:rearLeftChannel ] ; - pg:hasRole [ pg:index 4; pg:role pg:rearRightChannel ] ; - pg:hasRole [ pg:index 5; pg:role pg:lfeChannel ] . - -pg:SixPointOneGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "6.1 Surround" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 3; pg:role pg:sideLeftChannel ] ; - pg:hasRole [ pg:index 4; pg:role pg:sideRightChannel ] ; - pg:hasRole [ pg:index 5; pg:role pg:rearCenterChannel ] ; - pg:hasRole [ pg:index 6; pg:role pg:lfeChannel ] . - -pg:SevenPointOneGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "7.1 Surround" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 3; pg:role pg:sideLeftChannel ] ; - pg:hasRole [ pg:index 4; pg:role pg:sideRightChannel ] ; - pg:hasRole [ pg:index 5; pg:role pg:rearLeftChannel ] ; - pg:hasRole [ pg:index 6; pg:role pg:rearRightChannel ] ; - pg:hasRole [ pg:index 7; pg:role pg:lfeChannel ] . - -pg:SevenPointOneWideGroup a rdfs:Class ; - rdfs:subClassOf pg:DiscreteGroup ; - rdfs:label "7.1 Surround (Wide)" ; - pg:hasRole [ pg:index 0; pg:role pg:leftChannel ] ; - pg:hasRole [ pg:index 1; pg:role pg:centerLeftChannel ] ; - pg:hasRole [ pg:index 2; pg:role pg:centerChannel ] ; - pg:hasRole [ pg:index 3; pg:role pg:centerRightChannel ] ; - pg:hasRole [ pg:index 4; pg:role pg:rightChannel ] ; - pg:hasRole [ pg:index 5; pg:role pg:leftRearChannel ] ; - pg:hasRole [ pg:index 6; pg:role pg:rightRearChannel ] ; - pg:hasRole [ pg:index 7; pg:role pg:lfeChannel ] . - - -# Ambisonic - -pg:AmbisonicGroup a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:comment """ -"Ambisonic" channel configurations. These groups are divided into channels -which together represent a position in an abstract n-dimensional space. -The position of sound in one of these groups does not depend on a particular -speaker configuration; a decoder can be used to convert an ambisonic stream -for any speaker configuration. -""" . - -#amb:ACN0 a pg:Role ; rdfs:label "ACN 0 (W)" . -#amb:ACN1 a pg:Role ; rdfs:label "ACN 1 (Y)" . -#amb:ACN2 a pg:Role ; rdfs:label "ACN 2 (Z)" . -#amb:ACN3 a pg:Role ; rdfs:label "ACN 3 (X)" . -#amb:ACN4 a pg:Role ; rdfs:label "ACN 4 (V)" . -#amb:ACN5 a pg:Role ; rdfs:label "ACN 5 (T)" . -#amb:ACN6 a pg:Role ; rdfs:label "ACN 6 (R)" . -#amb:ACN7 a pg:Role ; rdfs:label "ACN 7 (S)" . -#amb:ACN8 a pg:Role ; rdfs:label "ACN 8 (U)" . -#amb:ACN9 a pg:Role ; rdfs:label "ACN 9 (Q)" . -#amb:ACN10 a pg:Role ; rdfs:label "ACN 10 (O)" . -#amb:ACN11 a pg:Role ; rdfs:label "ACN 11 (M)" . -#amb:ACN12 a pg:Role ; rdfs:label "ACN 12 (K)" . -#amb:ACN13 a pg:Role ; rdfs:label "ACN 13 (L)" . -#amb:ACN14 a pg:Role ; rdfs:label "ACN 14 (N)" . -#amb:ACN15 a pg:Role ; rdfs:label "ACN 15 (P)" . - -pg:AmbisonicBH1P0Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 1 and peripheral order 0." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN3 ] . - -pg:AmbisonicBH1P1Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 1 and peripheral order 1." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN2 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN3 ] . - -pg:AmbisonicBH2P0Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 2 and peripheral order 0." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN8 ] . - -pg:AmbisonicBH2P1Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 2 and peripheral order 1." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN2 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 5; pg:role amb:ACN8 ] . - -pg:AmbisonicBH2P2Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 2 and peripheral order 2." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN2 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 5; pg:role amb:ACN5 ] ; - pg:hasRole [ pg:index 6; pg:role amb:ACN6 ] ; - pg:hasRole [ pg:index 7; pg:role amb:ACN7 ] ; - pg:hasRole [ pg:index 8; pg:role amb:ACN8 ] . - -pg:AmbisonicBH3P0Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 0." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN8 ] ; - pg:hasRole [ pg:index 5; pg:role amb:ACN9 ] ; - pg:hasRole [ pg:index 6; pg:role amb:ACN15 ] . - -pg:AmbisonicBH3P1Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 1." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN2 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 5; pg:role amb:ACN8 ] ; - pg:hasRole [ pg:index 6; pg:role amb:ACN9 ] ; - pg:hasRole [ pg:index 7; pg:role amb:ACN15 ] . - -pg:AmbisonicBH3P2Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 2." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN2 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 5; pg:role amb:ACN5 ] ; - pg:hasRole [ pg:index 6; pg:role amb:ACN6 ] ; - pg:hasRole [ pg:index 7; pg:role amb:ACN7 ] ; - pg:hasRole [ pg:index 8; pg:role amb:ACN8 ] ; - pg:hasRole [ pg:index 9; pg:role amb:ACN9 ] ; - pg:hasRole [ pg:index 10; pg:role amb:ACN15 ] . - -pg:AmbisonicBH3P3Group a rdfs:Class ; - rdfs:subClassOf pg:AmbisonicGroup ; - rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 3." ; - pg:hasRole [ pg:index 0; pg:role amb:ACN0 ] ; - pg:hasRole [ pg:index 1; pg:role amb:ACN1 ] ; - pg:hasRole [ pg:index 2; pg:role amb:ACN2 ] ; - pg:hasRole [ pg:index 3; pg:role amb:ACN3 ] ; - pg:hasRole [ pg:index 4; pg:role amb:ACN4 ] ; - pg:hasRole [ pg:index 5; pg:role amb:ACN5 ] ; - pg:hasRole [ pg:index 6; pg:role amb:ACN6 ] ; - pg:hasRole [ pg:index 7; pg:role amb:ACN7 ] ; - pg:hasRole [ pg:index 8; pg:role amb:ACN8 ] ; - pg:hasRole [ pg:index 9; pg:role amb:ACN9 ] ; - pg:hasRole [ pg:index 10; pg:role amb:ACN10 ] ; - pg:hasRole [ pg:index 11; pg:role amb:ACN11 ] ; - pg:hasRole [ pg:index 12; pg:role amb:ACN12 ] ; - pg:hasRole [ pg:index 13; pg:role amb:ACN13 ] ; - pg:hasRole [ pg:index 14; pg:role amb:ACN14 ] ; - pg:hasRole [ pg:index 15; pg:role amb:ACN15 ] . - - -# Controls - -pg:ControlGroup a rdfs:Class ; - rdfs:subClassOf pg:Group ; - rdfs:comment """ -A group representing a set of associated controls. -""" . - -pg:amplitude a pg:Role ; rdfs:label "Amplitude" . -pg:attack a pg:Role ; rdfs:label "Attack" . -pg:cutoffFrequency a pg:Role ; rdfs:label "Cutoff Frequency" . -pg:decay a pg:Role ; rdfs:label "Decay" . -pg:delay a pg:Role ; rdfs:label "Delay" . -pg:frequency a pg:Role ; rdfs:label "Frequency" . -pg:hold a pg:Role ; rdfs:label "Hold" . -pg:pulseWidth a pg:Role ; rdfs:label "Pulse Width" . -pg:ratio a pg:Role ; rdfs:label "Ratio" . -pg:release a pg:Role ; rdfs:label "Release" . -pg:resonance a pg:Role ; rdfs:label "Resonance" . -pg:sustain a pg:Role ; rdfs:label "Sustain" . -pg:threshold a pg:Role ; rdfs:label "Threshold" . -pg:waveform a pg:Role ; rdfs:label "Waveform" . - -pg:EnvelopeControlGroup a rdfs:Class ; - rdfs:subClassOf pg:ControlGroup ; - rdfs:label "Controls for a DAHDSR envelope." ; - pg:mayHavePort pg:delay ; - pg:mayHavePort pg:attack ; - pg:mayHavePort pg:hold ; - pg:mayHavePort pg:decay ; - pg:mayHavePort pg:sustain ; - pg:mayHavePort pg:release . - -pg:OscillatorControlGroup a rdfs:Class ; - rdfs:subClassOf pg:ControlGroup ; - rdfs:label "Controls for an oscillator." ; - pg:mayHavePort pg:frequency ; - pg:mayHavePort pg:amplitude ; - pg:mayHavePort pg:waveform ; - pg:mayHavePort pg:pulseWidth . - -pg:FilterControlGroup a rdfs:Class ; - rdfs:subClassOf pg:ControlGroup ; - rdfs:label "Controls for a filter." ; - pg:mayHavePort pg:cutoffFrequency ; - pg:mayHavePort pg:resonance . - -pg:CompressorControlGroup a rdfs:Class ; - rdfs:subClassOf pg:ControlGroup ; - rdfs:label "Controls for a compressor." ; - pg:mayHavePort pg:threshold ; - pg:mayHavePort pg:ratio . - diff --git a/ext/presets.lv2/presets.ttl b/ext/presets.lv2/presets.ttl deleted file mode 100644 index 804e187..0000000 --- a/ext/presets.lv2/presets.ttl +++ /dev/null @@ -1,88 +0,0 @@ -# LV2 Presets Extension -# PROVISIONAL -# Copyright (C) 2009 David Robillard <d@drobilla.net> -# -# 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. - -@prefix pset: <http://lv2plug.in/ns/ext/presets#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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 xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/presets> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Presets" ; - doap:release [ - doap:revision "2" ; - doap:created "2010-03-02" - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -Defines presets (e.g. named sets of control values) for LV2 plugins. -""" . - -pset:Preset a rdfs:Class ; - rdfs:subClassOf lv2:Template ; - rdfs:label "LV2 Preset" ; - rdfs:comment """ -A Preset for an LV2 Plugin. A preset can be considered an "overlay" on a -Plugin. Rather than attempting to define all valid predicates for a Preset -(which is not possible since presets may need to specify values for things -defined in other extensions), the presets extension simply provides this -class which can be augmented with any data in the exact same fashion as the -definition of a Plugin. - -A Preset SHOULD have at least one pset:appliesTo property. -Each Port on a Preset MUST have at least a lv2:symbol property and a -pset:value property. -""" . - -pset:appliesTo a rdf:Property ; - rdfs:domain pset:Preset ; - rdfs:range lv2:Plugin ; - rdfs:label "Applies to" ; - rdfs:comment """ -Specifies the Plugin(s) a Preset may be applied to. When a Preset applies -to a Plugin, that Preset SHOULD have ports for every control port on that -plugin, each of which SHOULD have a pset:value property. If the Preset is -missing ports, or refers to ports which do not exist on the Plugin, then -the host SHOULD apply all the values in the preset that do match the Plugin. - -The Preset MAY have any other values that should be applied to the Plugin -in some way. The host SHOULD simply ignore any values on a Preset it does -not understand. -""" . - -pset:value a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:label "Has value" ; - rdfs:comment """ -Specifies the value of a Port on some Preset. This property is used -in a similar way to e.g. lv2:default. -""" . - diff --git a/ext/resize-port.lv2/resize-port.h b/ext/resize-port.lv2/resize-port.h deleted file mode 100644 index 4ba533b..0000000 --- a/ext/resize-port.lv2/resize-port.h +++ /dev/null @@ -1,46 +0,0 @@ -/* LV2 Resize Port Extension - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef LV2_RESIZE_PORT_H -#define LV2_RESIZE_PORT_H - -#include <stdint.h> -#include <stdbool.h> - -#define LV2_RESIZE_PORT_URI "http://lv2plug.in/ns/ext/resize-port" - -typedef void* LV2_Resize_Port_Feature_Data; - -typedef struct { - - LV2_Resize_Port_Feature_Data data; - - /** Resize a port buffer to at least @a size bytes. - * - * This function MAY return false, 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. - */ - bool (*resize_port)(LV2_Resize_Port_Feature_Data data, - uint32_t index, - size_t size); - -} LV2_Resize_Port_Feature; - -#endif /* LV2_RESIZE_PORT_H */ - diff --git a/ext/resize-port.lv2/resize-port.ttl b/ext/resize-port.lv2/resize-port.ttl deleted file mode 100644 index d6bbb35..0000000 --- a/ext/resize-port.lv2/resize-port.ttl +++ /dev/null @@ -1,85 +0,0 @@ -# LV2 Contexts Extension -# -# Allows for an LV2 plugin to have several independent contexts, each with its -# own run callback and associated ports. -# -# Copyright (C) 2007 David Robillard -# -# 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. - -@prefix rsz: <http://lv2plug.in/ns/ext/resize-port#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/resize-port> - a lv2:Specification ; - a lv2:Feature ; - doap:name "LV2 Resize Port Extension" ; - rdfs:comment """ -An extension that allows LV2 plugins to request a resize of an output port. - -Any host which supports this extension must pass an LV2_Feature to -the plugin's instantiate method with URI http://lv2plug.in/ns/ext/resize-port -and a pointer to a -<pre> -struct { - void* host_handle; - void (*resize_port)(void* host_handle, uint32_t index); -} -</pre> -where the plugin may call resize_port with the given host_handle from any -context to demand the resize of an output port buffer. The plugin MUST call -this function from the context of the given port. - -This function MAY return NULL at any time, plugins MUST gracefully handle -this situation. -""" . - -rsz:asLargeAs a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range lv2:Symbol ; - rdfs:label "as large as" ; - rdfs:comment """ -Indicates that a port requires at least as much buffer space as the port -with the given symbol on the same plugin instance. This may be used for -any ports, but is generally most useful to indicate an output port must -be at least as large as some input port (because it will copy from it). -If a port is asLargeAs several ports, it is asLargeAs the largest such port -(not the sum of those ports' sizes). - -The host guarantees that whenever an ObjectPort's run method is called, -any output O that is obj:asLargeAs an input I is connected to a buffer large -enough to copy I, or NULL if the port is lv2:connectionOptional. -""" . - -rsz:minimumSize a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range lv2:Symbol ; - rdfs:label "minimum size" ; - rdfs:comment """ -Indicates that a port requires a buffer at least this large, in bytes. -Any host that supports the resize-port feature MUST connect any port with a -minimumSize specified to a buffer at least as large as the value given for -this property. Any host, especially those that do NOT support dynamic port -resizing, SHOULD do so or reduced functionality may result. -""" . diff --git a/ext/string-port.lv2/manifest.ttl b/ext/string-port.lv2/manifest.ttl deleted file mode 100644 index c7ba4e1..0000000 --- a/ext/string-port.lv2/manifest.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/string-port> - a lv2:Specification ; - rdfs:seeAlso <string-port.ttl> . diff --git a/ext/string-port.lv2/string-port.h b/ext/string-port.lv2/string-port.h deleted file mode 100644 index e7fc8c7..0000000 --- a/ext/string-port.lv2/string-port.h +++ /dev/null @@ -1,58 +0,0 @@ -/* lv2_string_port.h - C header file for LV2 string port extension. - * Draft Revision 3 - * Copyright (C) 2008 Krzysztof Foltman <wdev@foltman.com> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header for the LV2 String Port extension - * <http://lv2plug.in/ns/ext/string-port#StringTransfer>. - */ - -#ifndef LV2_STRING_PORT_H -#define LV2_STRING_PORT_H - -#include <stdint.h> - -/** URI for the string port transfer mechanism feature */ -#define LV2_STRING_PORT_URI "http://lv2plug.in/ns/ext/string-port#StringTransfer" - -/** Flag: port data has been updated; for input ports, this flag is set by -the host. For output ports, this flag is set by the plugin. */ -#define LV2_STRING_DATA_CHANGED_FLAG 1 - -/** structure for string port data */ -typedef struct -{ - /** Buffer for UTF-8 encoded zero-terminated string value; host-allocated */ - char *data; - - /** Length in bytes (not characters), not including zero byte */ - size_t len; - - /** Output ports: storage space in bytes; must be >= RDF-specified requirements */ - size_t storage; - - /** Flags defined above */ - uint32_t flags; - - /** Undefined (pad to 8 bytes) */ - uint32_t pad; - -} LV2_String_Data; - -#endif - diff --git a/ext/string-port.lv2/string-port.ttl b/ext/string-port.lv2/string-port.ttl deleted file mode 100644 index e6adfc2..0000000 --- a/ext/string-port.lv2/string-port.ttl +++ /dev/null @@ -1,105 +0,0 @@ -# LV2 String Port Extension. -# Draft Revision 3 -# Copyright (C) 2008 Krzysztof Foltman -# -# 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. - -@prefix sp: <http://lv2plug.in/ns/ext/string-port#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/string-port> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 String Ports" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Krzysztof Foltman" ; - ] ; - rdfs:comment """ -Defines ports which contain string data. - -<h4>UI issues</h4> -When using port_event / write_port (and possible other communication -mechanisms), the format parameter should contain the numeric value of URI -LV2_STRING_PORT_URI (mapped with http://lv2plug.in/ns/extensions/ui specified -as map URI). - -It's probably possible to use ports belonging to message context -<http://lv2plug.in/ns/ext/contexts#MessageContext> for transfer. However, -contexts mechanism does not offer any way to notify the message recipient -about which ports have been changed. To remedy that, this extension defines -a flag LV2_STRING_DATA_CHANGED_FLAG that carries that information inside a -port value structure. - -<h4>Storage</h4> -The value of string port are assumed to be "persistent": if a host saves -and restores a state of a plugin (e.g. control port values), the values -of input string ports should also be assumed to belong to that state. This -also applies to message context: if a session is being restored, the host -MUST resend the last value that was sent to the port before session has been -saved. In other words, string port values "stick" to message ports. -""" . - -sp:StringTransfer a lv2:Feature ; - rdfs:label "String data transfer via LV2_String_Data" . - -sp:StringPort a lv2:Port ; - rdfs:label "String port" ; - rdfs:comment """ -Indicates that the port data points to a LV2_String_Data structure -as defined in accompanying header file. - -<h4>Input Port Semantics</h4> -If the port does not have a context specified (it runs in the default, -realtime audio processing context), the values in the structure and the actual -string data MUST remain unchanged for the time a run() function of a plugin -is executed. However, if the port belongs to a different context, the same -data MUST remain unchanged only for the time a run() or message_process() -function of a given context is executed. - -<h4>Output Port Semantics</h4> -The plugin may only change the string or length in a run() function (if -the port belongs to default context) or in context-defined counterparts -(if the port belongs to another context). Because of that, using default -context output string ports is contraindicated for longer strings. -""" . - -sp:default a rdf:Property ; - rdfs:label "Default value" ; - rdfs:domain sp:StringPort ; - rdfs:range xsd:string ; - rdfs:comment """ -Gives a default value for a string port. -""" . - -sp:requiredSpace a rdf:Property ; - rdfs:label "Required storage space in bytes" ; - rdfs:domain sp:StringPort ; - rdfs:range xsd:nonNegativeInteger ; - rdfs:comment """ -Specifies required buffer space for output string ports and those of -input string ports that are meant to be GUI-controlled. The host MUST -allocate a buffer of at least required size to accommodate for all values -that can be produced by the plugin. -""" . - diff --git a/ext/uri-map.lv2/uri-map.h b/ext/uri-map.lv2/uri-map.h deleted file mode 100644 index d0d04e4..0000000 --- a/ext/uri-map.lv2/uri-map.h +++ /dev/null @@ -1,87 +0,0 @@ -/* lv2_uri_map.h - C header file for the LV2 URI Map extension. - * - * Copyright (C) 2008-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this header; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA - */ - -/** @file - * C header 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" - -#include <stdint.h> - - -/** Opaque pointer to host data. */ -typedef void* LV2_URI_Map_Callback_Data; - - -/** The data field of the LV2_Feature for this extension. - * - * 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. - */ -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. - * @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 means an ID for that URI could not - * be created for whatever reason. Extensions may define more precisely - * what this means, but in general plugins should gracefully handle 0 - * and consider whatever they wanted the URI for "unsupported". - */ - uint32_t (*uri_to_id)(LV2_URI_Map_Callback_Data callback_data, - const char* map, - const char* uri); - -} LV2_URI_Map_Feature; - - -#endif /* LV2_URI_MAP_H */ - diff --git a/ext/uri-map.lv2/uri-map.ttl b/ext/uri-map.lv2/uri-map.ttl deleted file mode 100644 index 0c557d0..0000000 --- a/ext/uri-map.lv2/uri-map.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# LV2 Data Access Extension -# Copyright (C) 2008 David Robillard <d@drobilla.net> -# -# 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. - -@prefix umap: <http://lv2plug.in/ns/ext/uri-map#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/ext/uri-map> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 URI Map" ; - doap:release [ - doap:revision "1" ; - doap:created "2008-04-16" - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.xrdf> - ] , [ - a foaf:Person ; - foaf:name "Lars Luthman" ; - ] ; - rdfs:comment """ -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). -""" . diff --git a/ext/variables.lv2/manifest.ttl b/ext/variables.lv2/manifest.ttl deleted file mode 100644 index a8e3306..0000000 --- a/ext/variables.lv2/manifest.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . - -<http://lv2plug.in/ns/ext/variables> - a lv2:Specification ; - rdfs:seeAlso <variables.ttl> . - diff --git a/ext/variables.lv2/variables-private.h b/ext/variables.lv2/variables-private.h deleted file mode 100644 index 451aeb2..0000000 --- a/ext/variables.lv2/variables-private.h +++ /dev/null @@ -1,48 +0,0 @@ -/* LV2 Plugin Variables Extension (Private Implementation) - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "lv2_variables.h" - -/** An LV2 Plugin Variable (Private) */ -struct _LV2Var_Variable { - char* key; /**< Lookup key of variable, full URI */ - char* type; /**< Type of value, full URI, may be NULL */ - char* value; /**< Variable value (string literal or URI) */ -}; - - -static const char* -lv2var_variable_key(const LV2Var_Variable var) -{ - return var->key; -} - - -static const char* -lv2var_variable_type(const LV2Var_Variable var) -{ - return var->type; -} - - -static const char* -lv2var_variable_value(const LV2Var_Variable var) -{ - return var->value; -} - diff --git a/ext/variables.lv2/variables.h b/ext/variables.lv2/variables.h deleted file mode 100644 index 5c51be7..0000000 --- a/ext/variables.lv2/variables.h +++ /dev/null @@ -1,144 +0,0 @@ -/* LV2 Plugin Variables Extension - * Copyright (C) 2007-2009 David Robillard <http://drobilla.net> - * - * This header is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This header is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef LV2_VARIABLES_H -#define LV2_VARIABLES_H - -#include <stdint.h> - -#ifdef __cplusplus -extern "C" { -#endif - - -/** @file - * This is an LV2 extension allowing plugin instances to have a set of - * dynamic named/typed variables (ie key/value metadata). - * - * Plugin variable values are always in string form (if numeric - * variable values are requires in realtime run callbacks, it is assumed - * the plugin will cache the converted value). - * - * Keys are strings, either free-form locally unique strings, or URIs. - * Types are URIs (corresponding to some type defined somewhere, e.g. in an - * XML namespace or RDF ontology). - * - * The goal is to provide a powerful key/value system for plugins, which is - * useful for setting run-time values (analogous to DSSI's "configure" calls) - * which is typed and ideal for serializing to RDF (which means variable - * values can be stored in the same file as the plugin's definition) or - * network transmission/control. - */ - - -/** An LV2 Plugin Variable */ -typedef struct _LV2Var_Variable* LV2Var_Variable; - -static const char* lv2var_variable_key(const LV2Var_Variable var); -static const char* lv2var_variable_type(const LV2Var_Variable var); -static const char* lv2var_variable_value(const LV2Var_Variable var); - - - -/** Plugin extension data for plugin variables. - * - * The extension_data function on a plugin (which supports this extension) - * will return a pointer to a struct of this type, when called with the URI - * http://drobilla.net/ns/lv2/variables - */ -typedef struct _LV2Var_Descriptor { - - /** Get the value of a plugin variable (O(log(n), non-blocking). - * - * @param key_uri Key of variable to look up - * @param type_uri Output, set to (shared) type of value (full URI, may be NULL) - * @param value Output, set to (shared) value of variable - * - * @return 0 if variable was found and type, value have been set accordingly, - * otherwise non-zero. - */ - int32_t (*get_value)(const char* key_uri, - const char** type_uri, - const char** value); - - - /** Set a plugin variable to a typed literal value (O(log(n), allocates memory). - * - * Note that this function is NOT realtime safe. - * - * String parameters are copied. The key is the sole unique identifier - * for variables; if a variable exists with the given key, it will be - * overwritten with the new type and value. - * - * To set a variable's value to a URI, use rdfs:Resource - * (http://www.w3.org/2000/01/rdf-schema#Resource) for the value type. - * - * @param key_uri Key of variable to set (MUST be a full URI) - * @param type_uri Type of value (MUST be a full URI, may be NULL) - * @param value Value of variable to set - */ - void (*set_value)(const char* key_uri, - const char* type_uri, - const char* value); - - - /** Unset (erase) a variable (O(log(n), deallocates memory). - * - * Note that this function is NOT realtime safe. - * - * @param key Key of variable to erase - */ - void (*unset)(const char* key_uri); - - - /** Clear (erase) all set variables (O(1), deallocates memory). - * - * Note that this function is NOT realtime safe. - */ - void (*clear)(); - - - /** Get all variables of a plugin (O(log(n), allocates memory). - * - * @param variables Output, set to a shared array of all set variables - * - * @return The number of variables found - */ - uint32_t (*get_all_variables)(const LV2Var_Variable** variables); - - - /** Get the value of a plugin variable (O(log(n), non-blocking). - * - * @param key_uri Key of variable to look up - * @param variable Output, set to point at (shared) variable - * - * @return 0 if variable was found and variable has been set accordingly, - * otherwise non-zero. - */ - int32_t (*get_variable)(const char* key_uri, - const LV2Var_Variable** variable); - -} LV2Var_Descriptor; - - -#ifdef __cplusplus -} -#endif - -#endif /* LV2_VARIABLES_H */ - diff --git a/ext/variables.lv2/variables.ttl b/ext/variables.lv2/variables.ttl deleted file mode 100644 index b7d1b8c..0000000 --- a/ext/variables.lv2/variables.ttl +++ /dev/null @@ -1,118 +0,0 @@ -# LV2 Variables Extension -# Copyright (C) 2008 David Robillard -# -# 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. - -@prefix var: <http://lv2plug.in/ns/ext/instance-var#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . - -<http://lv2plug.in/ns/ext/instance-var> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 Instance Variables" ; - doap:created "2008-08-18" ; - doap:maintainer [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -An extension for setting named/typed variables on an instance of an -LV2 Plugin (or anything else). A "variable" is really just a (reified) -RDF statement with an implicit subject (e.g. the plugin instance). - -Variables serve as a portable, network transparent, and serialisable -mechanism for clients (e.g. user interfaces, programs) to control any -parameter of a running plugin instance. Because variables are 'keyed' -by URI (the predicate), future extensions can define variables with -specific meanings or restricted/extended types. -The value (rdf:value) of a variable may be anything, but hosts or plugins -aren't guaranteed to support anything other than simple typed literals. -Serialisation and code access to complex variables is considered outside -the scope of this extension. - -Hosts and plugins SHOULD use the following types for appropriate values: - -<table> -<tr><th>RDF Type</th><th>Data Type</th></tr> -<tr><td>xsd:string</td><td>string</td></tr> -<tr><td>xsd:decimal</td><td>floating point number</td></tr> -<tr><td>xsd:integer</td><td>integer number</td></tr> -<tr><td>xsd:boolean</td><td>boolean value</td></tr> -</table> - -This extension does not currently define a code mechanism for access -to variables. A future revision, or a different extension, may. - -An example of a plugin with several variables: -<pre> -<http://example.org/plugin> a lv2:Plugin ; - lv2var:variable [ - rdf:predicate <http://example.org/greetingology#Greeting> ; - rdf:value "Hello, cruel world." - ] , [ - rdf:predicate <http://example.org/matheybits#Coeff> ; - rdf:value 1.23456 - ] , [ - rdf:predicate <http://example.org/databits#BigValue> ; - rdf:value [ - a somext:Something ; - someext:foo "Foo?" ; - someext:bar "Bar." ; - someext:baz 1234.0 - ] - ] . -</pre> -""" . - - -var:Variable a rdfs:Class ; - rdfs:label "LV2 Variable" ; - rdfs:comment "A typed instance variable." ; - - rdfs:subClassOf [ - a owl:Restriction ; - rdfs:comment "Must have exactly one rdf:predicate which is a resource" ; - owl:onProperty rdf:predicate ; - owl:cardinality 1 ; - owl:allValuesFrom rdfs:Resource - ], [ - a owl:Restriction ; - rdfs:comment "Must have exactly one rdf:value (of any type)" ; - owl:onProperty rdf:value ; - owl:cardinality 1 - ] . - - -var:variable a owl:ObjectProperty ; - rdfs:label "Has a Variable" ; - rdfs:range var:Variable ; - rdfs:comment """ -Relates an LV2 Variable to some Resource, usually a plugin instance. -The domain of this property is not restricted, it may be used for anything. -The range is implicitly an lv2var:Variable, the 'a lv2var:Variable' triple -is not mandatory. -""" . - diff --git a/extensions/ui.lv2/ui.h b/extensions/ui.lv2/ui.h deleted file mode 100644 index cedb895..0000000 --- a/extensions/ui.lv2/ui.h +++ /dev/null @@ -1,241 +0,0 @@ -/* LV2 UI Extension
- * Copyright (C) 2006-2008 Lars Luthman <lars.luthman@gmail.com>
- * Copyright (C) 2009-2010 David Robillard <d@drobilla.net>
- *
- * Based on lv2.h, which was
- * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis,
- * Stefan Westerfeld
- * Copyright (C) 2006 Steve Harris, David Robillard.
- *
- * This header is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License,
- * or (at your option) any later version.
- *
- * This header is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
- * USA.
- *
- */
-
-/** @file
- * C header for the LV2 UI extension <http://lv2plug.in/ns/extensions/ui>.
- */
-
-#ifndef LV2_UI_H
-#define LV2_UI_H
-
-#include "lv2.h"
-
-#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/** A pointer to some widget or other type of UI handle.
- The actual type is defined by the type URI of the UI.
- All the functionality provided by this extension is toolkit
- independent, the host only needs to pass the necessary callbacks and
- display the widget, if possible. Plugins may have several UIs, in various
- toolkits. */
-typedef void* LV2UI_Widget;
-
-
-/** A pointer to a particular instance of a UI.
- It is valid to compare this to NULL (0 for C++) but otherwise the
- host MUST not attempt to interpret it. The UI plugin may use it to
- reference internal instance data. */
-typedef void* LV2UI_Handle;
-
-
-/** A pointer to a particular plugin controller, provided by the host.
- It is valid to compare this to NULL (0 for C++) but otherwise the
- UI plugin MUST not attempt to interpret it. The host may use it to
- reference internal instance data. */
-typedef void* LV2UI_Controller;
-
-
-/** The type of the host-provided function that the UI can use to
- send data to a plugin's input ports. The @c buffer parameter must point
- to a block of data, @c buffer_size bytes large. The contents of this buffer
- and what the host should do with it depends on the value of the @c format
- parameter.
-
- The @c format parameter should either be 0 or a numeric ID for a "Transfer
- mechanism". Transfer mechanisms are Features and may be defined in
- meta-extensions. They specify how to translate the data buffers passed
- to this function to input data for the plugin ports. If a UI wishes to
- write data to an input port, it must list a transfer mechanism Feature
- for that port's class as an optional or required feature (depending on
- whether the UI will work without being able to write to that port or not).
- The only exception is when the UI wants to write single float values to
- input ports of the class lv2:ControlPort, in which case @c buffer_size
- should always be 4, the buffer should always contain a single IEEE-754
- float, and @c format should be 0.
-
- The numeric IDs for the transfer mechanisms are provided by a
- URI-to-integer mapping function provided by the host, using the URI Map
- feature <http://lv2plug.in/ns/ext/uri-map> with the map URI
- "http://lv2plug.in/ns/extensions/ui". Thus a UI that requires transfer
- mechanism features also requires the URI Map feature, but this is
- implicit - the UI does not have to list the URI map feature as a required
- or optional feature in it's RDF data.
-
- An UI MUST NOT pass a @c format parameter value (except 0) that has not
- been returned by the host-provided URI mapping function for a
- host-supported transfer mechanism feature URI.
-
- The UI MUST NOT try to write to a port for which there is no specified
- transfer mechanism, or to an output port. The UI is responsible for
- allocating the buffer and deallocating it after the call.
-*/
-typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller,
- uint32_t port_index,
- uint32_t buffer_size,
- uint32_t format,
- const void* buffer);
-
-
-/** This struct contains the implementation of a 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 object and return a handle to it. This function works
- similarly to the instantiate() member in LV2_Descriptor.
-
- @param descriptor The descriptor for the UI that you want to instantiate.
- @param plugin_uri The URI of the plugin that this UI will control.
- @param bundle_path The path to the bundle containing the RDF data file
- that references this shared object file, including the
- trailing '/'.
- @param write_function A function provided by the host that the UI can
- use to send data to the plugin's input ports.
- @param controller A handle for the plugin instance that should be passed
- as the first parameter of @c write_function.
- @param widget A pointer to an LV2UI_Widget. The UI will write a
- widget pointer to this location (what type of widget
- depends on the RDF class of the UI) that will be the
- main UI widget.
- @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, just like in the LV2 plugin
- instantiate() function. Note that UI features and plugin
- features are NOT necessarily the same, they just share
- the same data structure - this will probably not be the
- same array as the one the plugin host passes to a
- plugin.
- */
- 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 object and the associated widget. 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 the buffer passed to this
- function is defined by the @c format parameter, which has the same
- meaning as in LV2UI_Write_Function. The only exception is ports of the
- class lv2:ControlPort, for which this function should be called
- when the port value changes (it does not have to be called for every
- single change if the host's UI thread has problems keeping up with the
- thread the plugin is running in), @c buffer_size should be 4, the buffer
- should contain a single IEEE-754 float, and @c format should be 0.
-
- By default, the host should only call this function for input ports of
- the lv2:ControlPort class. However, the default setting can be modified
- by using the following URIs in the UI's RDF data:
- <pre>
- uiext:portNotification
- uiext:noPortNotification
- uiext:plugin
- uiext:portIndex
- </pre>
- For example, if you want the UI with uri
- <code><http://my.pluginui></code> for the plugin with URI
- <code><http://my.plugin></code> to get notified when the value of the
- output control port with index 4 changes, you would use the following
- in the RDF for your UI:
- <pre>
- <http://my.pluginui> uiext:portNotification [ uiext:plugin <http://my.plugin> ;
- uiext:portIndex 4 ] .
- </pre>
- and similarly with <code>uiext:noPortNotification</code> if you wanted
- to prevent notifications for a port for which it would be on by default
- otherwise. The UI is not allowed to request notifications for ports of
- types for which no transfer mechanism is specified, if it does it should
- be considered broken and the host should not load it.
-
- The @c buffer is only valid during the time of this function call, so if
- the UI wants to keep it for later use it has to copy the contents to an
- internal buffer.
-
- This member may be set to 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);
-
- /** Returns a data structure associated with an extension URI, for example
- a struct containing additional function pointers. Avoid returning
- function pointers directly since standard C/C++ has no valid way of
- casting a void* to a function pointer. This member may be set to NULL
- if the UI is not interested in supporting any extensions. This is similar
- to the extension_data() member in LV2_Descriptor.
- */
- const void* (*extension_data)(const char* uri);
-
-} LV2UI_Descriptor;
-
-
-
-/** A plugin UI programmer must include a function called "lv2ui_descriptor"
- with the following function prototype within the shared object
- file. This function will have C-style linkage (if you are using
- C++ this is taken care of by the 'extern "C"' clause at the top of
- the file). This function will be accessed by the UI host using the
- @c dlsym() function and called to get a LV2UI_UIDescriptor for the
- wanted plugin.
-
- Just like lv2_descriptor(), this function takes an index parameter. The
- index should only be used for enumeration and not as any sort of ID number -
- the host should just iterate from 0 and upwards until the function returns
- NULL or a descriptor with an URI matching the one the host is looking for.
-*/
-const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index);
-
-
-/** This is the type of the lv2ui_descriptor() function. */
-typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/extensions/ui.lv2/ui.ttl b/extensions/ui.lv2/ui.ttl deleted file mode 100644 index 1c32272..0000000 --- a/extensions/ui.lv2/ui.ttl +++ /dev/null @@ -1,217 +0,0 @@ -# LV2 UI Extension -# Copyright (C) 2006-2008 Lars Luthman <lars.luthman@gmail.com> -# Copyright (C) 2009-2010 David Robillard <d@drobilla.net> -# -# 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. - -@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@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 xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/extensions/ui> a lv2:Specification ; - doap:license <http://usefulinc.com/doap/licenses/mit> ; - doap:name "LV2 UI" ; - doap:release [ - doap:revision "2" ; - doap:created "2010-05-10" - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Lars Luthman" ; - foaf:mbox <mailto:lars.luthman@gmail.com> - ] , [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - rdfs:comment """ -This extension defines an interface that can be used in LV2 plugins and hosts -to create UIs for plugins. The UIs are similar to plugins and reside in shared object -files in an LV2 bundle. UIs are associated with a plugin in RDF using the triples -<pre> -@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . - -<http://my.plugin> ui:ui <http://my.pluginui> . -<http://my.pluginui> a ui:GtkUI ; - ui:binary <myui.so> . -</pre> -where <http://my.plugin> is the URI of the plugin, -<http://my.pluginui> is the URI of the plugin UI and <myui.so> -is the relative URI to the shared object file. - -While it is possible to have the plugin UI and the plugin in the same shared -object file it is probably a good idea to keep them separate so that hosts -that don't want UIs don't have to load the UI code. A UI MUST specify its -class in the RDF data (ui:GtkUI in the above example). The class defines what -type the UI is, e.g. what graphics toolkit it uses. Any type of UI class can -be defined separately from this extension. - -(Note: the prefix above is used throughout this file for the same URI) - -It is possible to have multiple UIs for the same plugin, or to have the UI -for a plugin in a different bundle from the actual plugin - this way people -other than the plugin author can write plugin UIs independently without -editing the original plugin bundle. - -Note that the process that loads the shared object file containing the UI -code and the process that loads the shared object file containing the actual -plugin implementation are not necessarily the same process (and not even -necessarily on the same machine). This means that plugin and UI code can -<b>not</b> use singletons and global variables and expect them to refer to -the same objects in the UI and the actual plugin. The function callback -interface defined in this header is the only method of communication between -UIs and plugin instances (extensions may define more, though this is -discouraged unless absolutely necessary since the significant benefits of -network transparency and serialisability are lost). - -Since the LV2 specification itself allows for extensions that may add new -functionality that could be useful to control with a UI, this extension -allows for meta-extensions that can extend the interface between the UI and -the host. These extensions mirror the extensions used for plugins - there are -required and optional "features" that you declare in the RDF data for the UI as -<pre> -<http://my.pluginui> lv2:requiredFeature <http://my.feature> . -<http://my.pluginui> lv2:optionalFeature <http://my.feature> . -</pre> -The rules for a UI with a required or optional feature are identical to those -of lv2:Plugin instances: if a UI declares a feature as required, the host is -NOT allowed to load it unless it supports that feature; and if it does support -a feature, it MUST pass an appropriate LV2_Feature struct to the UI's -instantiate() method. These features may be used to specify how to pass -specific types of data between the UI and the plugin port buffers -(see LV2UI_Write_Function for details). - -UIs written to this specification do not need to be threadsafe - the -functions defined below may only be called in the same thread the UI -main loop is running in. - -Note that this UI extension is NOT a lv2:Feature. There is no way for a -plugin to know whether the host that loads it supports UIs or not, and -the plugin must always work without the UI (although it may be rather -useless unless it has been configured using the UI in a previous session). -From the plugin perspective, control from a UI is the same as control -from anywhere else (e.g. the host, the user): via ports. - -A UI does not have to be a graphical widget, it could just as well be a -server listening for OSC input or an interface to some sort of hardware -device, depending on the RDF class of the UI. -""" . - - -ui:UI a rdfs:Class ; - rdfs:subClassOf lv2:Resource ; - rdfs:label "LV2 UI" ; - rdfs:comment "A UI for an LV2 plugin" . - -ui:GtkUI a rdfs:Class ; - rdfs:subClassOf ui:UI ; - rdfs:comment """ -A UI where the LV2_Widget is a pointer to a Gtk+ 2.0 compatible GtkWidget, -and the host guarantees that the Gtk+ library has been initialised and the -Glib main loop is running before an UI of this type is instantiated.""" . - -ui:makeSONameResident a lv2:Feature ; - rdfs:comment """ -This feature is ELF specific - it should only be used by UIs that -use the ELF file format for the UI shared object files (e.g. on Linux). -If it is required by an UI the UI should also list a number of SO names -(shared object names) for libraries that the UI shared object -depends on and that may not be unloaded during the lifetime of the host -process, using the predicate @c ui:residentSONames, like this: -<pre> -<http://my.pluginui> ui:residentSONames "libgtkmm-2.4.so.1", "libfoo.so.0" -</pre> -The host MUST then make sure that the shared libraries with the given ELF -SO names are not unloaded when the plugin UI is, but stay loaded during -the entire lifetime of the host process. On Linux this can be accomplished -by calling dlopen() on the shared library file with that SO name and never -calling a matching dlclose(). However, if a plugin UI requires the -@c ui:makeSONameResident feature, it MUST ALWAYS be safe for the host to -just never unload the shared object containing the UI implementation, i.e. -act as if the UI required the @c ui:makeResident feature instead. Thus -the host only needs to find the shared library files corresponding to the -given SO names if it wants to save RAM by unloading the UI shared object -file when it is no longer needed. The data pointer for the LV2_Feature for -this feature should always be set to NULL. -"""^^lv2:basicXHTML . - -ui:noUserResize a lv2:Feature ; - rdfs:comment """ -If a UI requires this feature it indicates that it does not make sense -to let the user resize the main widget, and the host should prevent that. -This feature may not make sense for all UI types. The data pointer for the -LV2_Feature for this feature should always be set to NULL. -""" . - -ui:fixedSize a lv2:Feature ; - rdfs:comment """ -If a UI requires this feature it indicates the same thing as -ui:noUserResize, and additionally it means that the UI will not resize -the main widget on its own - it will always remain the same size (e.g. a -pixmap based GUI). This feature may not make sense for all UI types. -The data pointer for the LV2_Feature for this feature should always be set -to NULL. -""" . - -ui:PortNotification a rdfs:Class ; - rdfs:subClassOf [ - a owl:Restriction ; - owl:onProperty ui:plugin ; - owl:someValuesFrom lv2:Plugin ; - owl:cardinality 1 ; - rdfs:comment """ -A PortNotification MUST have exactly one ui:plugin which is a lv2:Plugin. -""" ] , [ - a owl:Restriction ; - owl:onProperty ui:portIndex ; - owl:someValuesFrom xsd:decimal ; - owl:cardinality 1 ; - rdfs:comment """ -A PortNotification MUST have exactly one ui:portIndex which is an xsd:decimal. -""" ] ; - rdfs:comment "Port Notification" . - -ui:portNotification a rdf:Property ; - rdfs:domain ui:UI ; - rdfs:range ui:PortNotification ; - rdfs:comment """ -Indicates that a UI should receive notification (via port_event on -LV2UI_Descriptor) when a particular port's value changes. -""" . - -ui:plugin a rdf:Property ; - rdfs:domain ui:PortNotification ; - rdfs:range lv2:Plugin ; - rdfs:comment """ -The plugin a portNotification applies to. -""" . - -ui:portIndex a rdf:Property ; - rdfs:domain ui:PortNotification ; - rdfs:range xsd:decimal ; - rdfs:comment """ -The index of the port a portNotification applies to. -""" . - diff --git a/extensions/units.lv2/units.ttl b/extensions/units.lv2/units.ttl deleted file mode 100644 index 52e20f6..0000000 --- a/extensions/units.lv2/units.ttl +++ /dev/null @@ -1,350 +0,0 @@ -# LV2 Units Extension -# Copyright (C) 2007 Steve Harris -# Copyright (C) 2009 David Robillard -# -# 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. - -@prefix units: <http://lv2plug.in/ns/extensions/units#> . -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . - -<http://lv2plug.in/ns/extensions/units> - a lv2:Specification ; - doap:created "2007-02-06" ; - doap:homepage <http://lv2plug.in/ns/extensions/units> ; - doap:release [ - doap:revision "5" ; - doap:created "2009-11-10" - ] ; - doap:maintainer [ - a foaf:Person ; - rdfs:seeAlso <http://plugin.org.uk/swh.xrdf> ; - foaf:homepage <http://plugin.org.uk/> ; - foaf:mbox_sha1sum "44bc4fed584a2d1ac8fc55206db67656165d67fd" ; - foaf:name "Steve Harris" - ], [ - a foaf:Person ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> ; - foaf:homepage <http://drobilla.net/> ; - foaf:name "David Robillard" - ] ; - doap:name "LV2 Units extension" ; - rdfs:comment """ -This extension defines a number of units for use in audio processing. - -For example, to say that the port use the gain unit defined as units:db (decibels): -<pre> -@prefix : <http://lv2plug.in/ns/extensions/units#> . - -lv2:port [ - a lv2:ControlRateInputPort ; - lv2:datatype lv2:Float ; - lv2:index 0 ; - lv2:symbol "gain" ; - lv2:name "gain" ; - :unit :db -] -</pre> - -Using the same form, plugins may also specify one-off units inline, to give -better display hints to hosts: -<pre> -lv2:port [ - a lv2:ControlRateInputPort ; - lv2:datatype lv2:Float ; - lv2:index 0 ; - lv2:symbol "frob" ; - lv2:name "frob level" ; - units:unit [ - a units:NonSIUnit ; - units:name "frobnication" ; - units:symbol "fr" ; - units:render "%f f" - ] -] -</pre> -Units are defined by a number of properties: - -<dl> -<dt>units:name</dt> -<dd>A display name for the unit (eg. decibels)</dd> -<dt>units:symbol</dt> -<dd>The abbreviated symbol for the unit (eg. dB)</dd> -<dt>units:render</dt> -<dd>A printf(3) string to be used to render the numerical value (eg. \"%f dB\")</dd> -<dt>units:conversion</dt> -<dd>Defines a conversion into another unit, commonly the SI unit for the -unit class (eg. units:conversion [ units:to units:m ; units:factor 1000 ]). -conversions are expressed as either factors (multiplicand for the conversion) -or offsets (addend for the conversion).</dd> -</dl> -""" ^^ lv2:basicXHTML . - -units:Unit a rdfs:Class ; - rdfs:comment "A unit for LV2 port data" . - -units:unit - a rdf:Property ; - rdfs:domain lv2:Port ; - rdfs:range units:Unit ; - rdfs:comment "Relates a port to the unit of its data" . - -units:s a units:Unit ; - units:conversion [ - units:factor 0.0166666666 ; - units:to units:min - ] ; - units:name "second" ; - units:prefixConversion [ - units:factor 1000 ; - units:to units:ms - ] ; - units:render "%f s" ; - units:symbol "s" . - -units:ms a units:Unit ; - units:name "millisecond" ; - units:prefixConversion [ - units:factor 0.001 ; - units:to units:s - ] ; - units:render "%f ms" ; - units:symbol "ms" . - -units:min a units:Unit ; - units:conversion [ - units:factor 60.0 ; - units:to units:s - ] ; - units:name "minute" ; - units:render "%f mins" ; - units:symbol "min" . - -units:bar a units:Unit ; - units:name "bar" ; - units:render "%f bars" ; - units:symbol "bars" . - -units:beat a units:Unit ; - units:name "beat" ; - units:render "%f beats" ; - units:symbol "beats" . - -units:m a units:Unit ; - units:conversion [ - units:factor 39.37 ; - units:to units:inch - ] ; - units:name "metre" ; - units:prefixConversion [ - units:factor 100 ; - units:to units:cm - ], [ - units:factor 1000 ; - units:to units:mm - ], [ - units:factor 0.001 ; - units:to units:km - ] ; - units:render "%f m" ; - units:symbol "m" . - -units:cm a units:Unit ; - units:conversion [ - units:factor 0.3937 ; - units:to units:inch - ] ; - units:name "centimetre" ; - units:prefixConversion [ - units:factor 0.01 ; - units:to units:m - ], [ - units:factor 10 ; - units:to units:mm - ], [ - units:factor 0.00001 ; - units:to units:km - ] ; - units:render "%f cm" ; - units:symbol "cm" . - -units:mm a units:Unit ; - units:conversion [ - units:factor 0.03937 ; - units:to units:inch - ] ; - units:name "millimetre" ; - units:prefixConversion [ - units:factor 0.001 ; - units:to units:m - ], [ - units:factor 0.1 ; - units:to units:cm - ], [ - units:factor 0.000001 ; - units:to units:km - ] ; - units:render "%f mm" ; - units:symbol "mm" . - -units:km a units:Unit ; - units:conversion [ - units:factor 0.62138818 ; - units:to units:mile - ] ; - units:name "kilometre" ; - units:prefixConversion [ - units:factor 1000 ; - units:to units:m - ], [ - units:factor 100000 ; - units:to units:cm - ], [ - units:factor 1000000 ; - units:to units:mm - ] ; - units:render "%f km" ; - units:symbol "km" . - -units:inch a units:Unit ; - units:conversion [ - units:factor 2.54 ; - units:to units:cm - ] ; - units:name "inch" ; - units:render "%f\"" ; - units:symbol "in" . - -units:mile a units:Unit ; - units:conversion [ - units:factor 1.6093 ; - units:to units:km - ] ; - units:name "mile" ; - units:render "%f mi" ; - units:symbol "mi" . - -units:db a units:Unit ; - units:name "decibel" ; - units:render "%f dB" ; - units:symbol "dB" . - -units:pc a units:Unit ; - units:conversion [ - units:factor 0.01 ; - units:to units:coef - ] ; - units:name "percent" ; - units:render "%f%%" ; - units:symbol "%" . - -units:coef a units:Unit ; - units:conversion [ - units:factor 100 ; - units:to units:pc - ] ; - units:name "coefficient" ; - units:render "* %f" ; - units:symbol "" . - -units:hz a units:Unit ; - units:name "hertz" ; - units:prefixConversion [ - units:factor 0.001 ; - units:to units:khz - ], [ - units:factor 0.000001 ; - units:to units:mhz - ] ; - units:render "%f Hz" ; - units:symbol "Hz" . - -units:khz a units:Unit ; - units:name "kilohertz" ; - units:prefixConversion [ - units:factor 1000 ; - units:to units:hz - ], [ - units:factor 0.001 ; - units:to units:mhz - ] ; - units:render "%f kHz" ; - units:symbol "kHz" . - -units:mhz a units:Unit ; - units:name "megahertz" ; - units:prefixConversion [ - units:factor 1000000 ; - units:to units:hz - ], [ - units:factor 0.001 ; - units:to units:khz - ] ; - units:render "%f MHz" ; - units:symbol "MHz" . - -units:bpm a units:Unit ; - units:name "beats per minute" ; - units:prefixConversion [ - units:factor 0.0166666666 ; - units:to units:hz - ] ; - units:render "%f BPM" ; - units:symbol "BPM" . - -units:oct a units:Unit ; - units:conversion [ - units:factor 12.0 ; - units:to units:semitone12TET - ] ; - units:name "octaves" ; - units:render "%f octaves" ; - units:symbol "oct" . - -units:cent a units:Unit ; - units:conversion [ - units:factor 0.01 ; - units:to units:semitone12TET - ] ; - units:name "cent" ; - units:render "%f ct" ; - units:symbol "ct" . - -units:semitone12TET a units:Unit ; - units:conversion [ - units:factor 0.083333333 ; - units:to units:oct - ] ; - units:name "semitone" ; - units:render "%f semi" ; - units:symbol "semi" . - -units:degree a units:Unit ; - units:name "degree" ; - units:render "%f deg" ; - units:symbol "deg" . - -units:midiNote a units:Unit ; - units:name "MIDI note" ; - units:render "MIDI note %d" ; - units:symbol "note" . - diff --git a/gendoc.py b/gendoc.py deleted file mode 100755 index 00a7cae..0000000 --- a/gendoc.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env python - -import os -import shutil -import subprocess -import glob -import re -import datetime - -out_base = os.path.join('build', 'default', 'doc') -try: - shutil.rmtree(out_base) -except: - pass - -os.makedirs(out_base) - -URIPREFIX = 'http://lv2plug.in/ns/' -SPECGENDIR = './specgen' - -release_dir = os.path.join('build', 'default', 'spec') -try: - os.mkdir(release_dir) -except: - pass - -print '** Generating core documentation' - -lv2_outdir = os.path.join(out_base, 'lv2core') -os.mkdir(lv2_outdir) -shutil.copy('core.lv2/lv2.h', lv2_outdir) -shutil.copy('core.lv2/lv2.ttl', lv2_outdir) -shutil.copy('core.lv2/manifest.ttl', lv2_outdir) -shutil.copy('doc/index.php', lv2_outdir) - -devnull = open(os.devnull, 'w') - -def gendoc(specgen_dir, bundle_dir, ttl_filename, html_filename): - subprocess.call([os.path.join(specgen_dir, 'lv2specgen.py'), - os.path.join(bundle_dir, ttl_filename), - os.path.join(specgen_dir, 'template.html'), - os.path.join(specgen_dir, 'style.css'), - os.path.join(out_base, html_filename), - os.path.join('..', 'doc'), - '-i']) - -gendoc('./lv2specgen', 'core.lv2', 'lv2.ttl', 'lv2core/lv2core.html') - -style = open('./lv2specgen/style.css', 'r') -footer = open('./lv2specgen/footer.html', 'r') - -# Generate main (ontology) documentation and indices -for dir in ['ext', 'extensions']: - print "** Generating %s%s documentation" % (URIPREFIX, dir) - - outdir = os.path.join(out_base, dir) - - shutil.copytree(dir, outdir, ignore = lambda src, names: '.svn') - - index_html = """<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8"/> -<title>LV2 Extensions</title> -<style type="text/css"> -""" - - index_html += style.read() - - index_html += """ -</style></head> -<body><h1>LV2 Extensions</h1> -<h2>""" + URIPREFIX + dir + "/</h2><ul>\n" - - extensions = [] - - for bundle in glob.glob(os.path.join(dir, '*.lv2')): - b = bundle.replace('.lv2', '') - b = b[b.find('/') + 1:] - - # Get extension URI - ext = subprocess.Popen(['roqet', '-q', '-e', """ -PREFIX lv2: <http://lv2plug.in/ns/lv2core#> -SELECT ?ext FROM <%s.lv2/%s.ttl> WHERE { ?ext a lv2:Specification } -""" % (os.path.join(dir, b), b)], stdout=subprocess.PIPE).communicate()[0] - - if ext == "": - continue - - ext = re.sub('^result: \[ext=uri<', '', ext) - ext = re.sub('>\]$', '', ext).strip() - - # Get revision - query = """ -PREFIX lv2: <http://lv2plug.in/ns/lv2core#> -PREFIX doap: <http://usefulinc.com/ns/doap#> -SELECT ?rev FROM <%s.lv2/%s.ttl> WHERE { <%s> doap:release [ doap:revision ?rev ] } -""" % (os.path.join(dir, b), b, ext) - - rev = subprocess.Popen(['roqet', '-q', '-e', query], - stdout=subprocess.PIPE).communicate()[0] - - if rev != '': - rev = re.sub('^result: \[rev=string\("', '', rev) - rev = re.sub('"\)\]$', '', rev).strip() - else: - rev = '0' - - if rev != '0': - path = os.path.join(release_dir, 'lv2-%s-%s.0.tar.gz' % (b, rev)) - subprocess.call(['tar', '-czf', path, os.path.join(outdir, '%s.lv2' % b)]) - - specgendir = '../../../../lv2specgen/' - if (os.access(outdir + '/%s.lv2/%s.ttl' % (b, b), os.R_OK)): - print ' * Calling lv2specgen for %s%s/%s' %(URIPREFIX, dir, b) - subprocess.call([specgendir + 'lv2specgen.py', - '%s.lv2/%s.ttl' % (b, b), - specgendir + 'template.html', - specgendir + 'style.css', - '%s.lv2/%s.html' % (b, b), - os.path.join('..', '..', 'doc'), - '-i'], cwd=outdir); - - li = '<li>' - if rev == '0': - li += '<span style="color: red;">Experimental: </span>' - li += '<a rel="rdfs:seeAlso" href="%s">%s</a>' % (b, b) - li += '</li>' - - extensions.append(li) - - shutil.copy('doc/index.php', os.path.join(outdir, b + '.lv2', 'index.php')) - - # Remove .lv2 suffix from bundle name (to make URI resolvable) - os.rename(outdir + '/%s.lv2' % b, outdir + '/%s' % b) - - extensions.sort() - for i in extensions: - index_html += i + '\n' - - index_html += '</ul>\n' - - index_html += '<div class="footer">' - index_html += '<span class="footer-text">Generated on ' - index_html += datetime.datetime.utcnow().strftime('%F %H:%M UTC') - index_html += ' by LV2 gendoc.py</span>' - index_html += footer.read() + '</div>' - - index_html += '</body></html>\n' - - index_file = open(os.path.join(outdir, 'index.html'), 'w') - print >>index_file, index_html - index_file.close() - -# Generate code (headers) documentation -print "** Generating header documentation" -#shutil.copy('Doxyfile', os.path.join('upload', 'Doxyfile')) -print ' * Calling doxygen in ' + os.getcwd() -subprocess.call('doxygen', stdout=devnull) - -devnull.close() -style.close() -footer.close() diff --git a/include/lv2/atom/atom.h b/include/lv2/atom/atom.h new file mode 100644 index 0000000..b090c1e --- /dev/null +++ b/include/lv2/atom/atom.h @@ -0,0 +1,260 @@ +/* + Copyright 2008-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. +*/ + +#ifndef LV2_ATOM_H +#define LV2_ATOM_H + +/** + @defgroup atom Atom + @ingroup lv2 + + A generic value container and several data types. + + See <http://lv2plug.in/ns/ext/atom> for details. + + @{ +*/ + +#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# + +#define LV2_ATOM__Atom LV2_ATOM_PREFIX "Atom" ///< http://lv2plug.in/ns/ext/atom#Atom +#define LV2_ATOM__AtomPort LV2_ATOM_PREFIX "AtomPort" ///< http://lv2plug.in/ns/ext/atom#AtomPort +#define LV2_ATOM__Blank LV2_ATOM_PREFIX "Blank" ///< http://lv2plug.in/ns/ext/atom#Blank +#define LV2_ATOM__Bool LV2_ATOM_PREFIX "Bool" ///< http://lv2plug.in/ns/ext/atom#Bool +#define LV2_ATOM__Chunk LV2_ATOM_PREFIX "Chunk" ///< http://lv2plug.in/ns/ext/atom#Chunk +#define LV2_ATOM__Double LV2_ATOM_PREFIX "Double" ///< http://lv2plug.in/ns/ext/atom#Double +#define LV2_ATOM__Event LV2_ATOM_PREFIX "Event" ///< http://lv2plug.in/ns/ext/atom#Event +#define LV2_ATOM__Float LV2_ATOM_PREFIX "Float" ///< http://lv2plug.in/ns/ext/atom#Float +#define LV2_ATOM__Int LV2_ATOM_PREFIX "Int" ///< http://lv2plug.in/ns/ext/atom#Int +#define LV2_ATOM__Literal LV2_ATOM_PREFIX "Literal" ///< http://lv2plug.in/ns/ext/atom#Literal +#define LV2_ATOM__Long LV2_ATOM_PREFIX "Long" ///< http://lv2plug.in/ns/ext/atom#Long +#define LV2_ATOM__Number LV2_ATOM_PREFIX "Number" ///< http://lv2plug.in/ns/ext/atom#Number +#define LV2_ATOM__Object LV2_ATOM_PREFIX "Object" ///< http://lv2plug.in/ns/ext/atom#Object +#define LV2_ATOM__Path LV2_ATOM_PREFIX "Path" ///< http://lv2plug.in/ns/ext/atom#Path +#define LV2_ATOM__Property LV2_ATOM_PREFIX "Property" ///< http://lv2plug.in/ns/ext/atom#Property +#define LV2_ATOM__Resource LV2_ATOM_PREFIX "Resource" ///< http://lv2plug.in/ns/ext/atom#Resource +#define LV2_ATOM__Sequence LV2_ATOM_PREFIX "Sequence" ///< http://lv2plug.in/ns/ext/atom#Sequence +#define LV2_ATOM__Sound LV2_ATOM_PREFIX "Sound" ///< http://lv2plug.in/ns/ext/atom#Sound +#define LV2_ATOM__String LV2_ATOM_PREFIX "String" ///< http://lv2plug.in/ns/ext/atom#String +#define LV2_ATOM__Tuple LV2_ATOM_PREFIX "Tuple" ///< http://lv2plug.in/ns/ext/atom#Tuple +#define LV2_ATOM__URI LV2_ATOM_PREFIX "URI" ///< http://lv2plug.in/ns/ext/atom#URI +#define LV2_ATOM__URID LV2_ATOM_PREFIX "URID" ///< http://lv2plug.in/ns/ext/atom#URID +#define LV2_ATOM__Vector LV2_ATOM_PREFIX "Vector" ///< http://lv2plug.in/ns/ext/atom#Vector +#define LV2_ATOM__atomTransfer LV2_ATOM_PREFIX "atomTransfer" ///< http://lv2plug.in/ns/ext/atom#atomTransfer +#define LV2_ATOM__beatTime LV2_ATOM_PREFIX "beatTime" ///< http://lv2plug.in/ns/ext/atom#beatTime +#define LV2_ATOM__bufferType LV2_ATOM_PREFIX "bufferType" ///< http://lv2plug.in/ns/ext/atom#bufferType +#define LV2_ATOM__childType LV2_ATOM_PREFIX "childType" ///< http://lv2plug.in/ns/ext/atom#childType +#define LV2_ATOM__eventTransfer LV2_ATOM_PREFIX "eventTransfer" ///< http://lv2plug.in/ns/ext/atom#eventTransfer +#define LV2_ATOM__frameTime LV2_ATOM_PREFIX "frameTime" ///< http://lv2plug.in/ns/ext/atom#frameTime +#define LV2_ATOM__supports LV2_ATOM_PREFIX "supports" ///< http://lv2plug.in/ns/ext/atom#supports +#define LV2_ATOM__timeUnit LV2_ATOM_PREFIX "timeUnit" ///< http://lv2plug.in/ns/ext/atom#timeUnit + +// clang-format on + +#define LV2_ATOM_REFERENCE_TYPE 0 ///< The special type for a reference atom + +#ifdef __cplusplus +extern "C" { +#endif + +/** @cond */ +/** This expression will fail to compile if double does not fit in 64 bits. */ +typedef char lv2_atom_assert_double_fits_in_64_bits + [((sizeof(double) <= sizeof(uint64_t)) * 2) - 1]; +/** @endcond */ + +/** + Return a pointer to the contents of an Atom. The "contents" of an atom + is the data past the complete type-specific header. + @param type The type of the atom, for example LV2_Atom_String. + @param atom A variable-sized atom. +*/ +#define LV2_ATOM_CONTENTS(type, atom) ((void*)((uint8_t*)(atom) + sizeof(type))) + +/** + Const version of LV2_ATOM_CONTENTS. +*/ +#define LV2_ATOM_CONTENTS_CONST(type, atom) \ + ((const void*)((const uint8_t*)(atom) + sizeof(type))) + +/** + Return a pointer to the body of an Atom. The "body" of an atom is the + data just past the LV2_Atom head (i.e. the same offset for all types). +*/ +#define LV2_ATOM_BODY(atom) LV2_ATOM_CONTENTS(LV2_Atom, atom) + +/** + Const version of LV2_ATOM_BODY. +*/ +#define LV2_ATOM_BODY_CONST(atom) LV2_ATOM_CONTENTS_CONST(LV2_Atom, atom) + +/** The header of an atom:Atom. */ +typedef struct { + uint32_t size; /**< Size in bytes, not including type and size. */ + uint32_t type; /**< Type of this atom (mapped URI). */ +} LV2_Atom; + +/** An atom:Int or atom:Bool. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + int32_t body; /**< Integer value. */ +} LV2_Atom_Int; + +/** An atom:Long. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + int64_t body; /**< Integer value. */ +} LV2_Atom_Long; + +/** An atom:Float. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + float body; /**< Floating point value. */ +} LV2_Atom_Float; + +/** An atom:Double. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + double body; /**< Floating point value. */ +} LV2_Atom_Double; + +/** An atom:Bool. May be cast to LV2_Atom. */ +typedef LV2_Atom_Int LV2_Atom_Bool; + +/** An atom:URID. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + uint32_t body; /**< URID. */ +} LV2_Atom_URID; + +/** An atom:String. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + /* Contents (a null-terminated UTF-8 string) follow here. */ +} LV2_Atom_String; + +/** The body of an atom:Literal. */ +typedef struct { + uint32_t datatype; /**< Datatype URID. */ + uint32_t lang; /**< Language URID. */ + /* Contents (a null-terminated UTF-8 string) follow here. */ +} LV2_Atom_Literal_Body; + +/** An atom:Literal. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + LV2_Atom_Literal_Body body; /**< Body. */ +} LV2_Atom_Literal; + +/** An atom:Tuple. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + /* Contents (a series of complete atoms) follow here. */ +} LV2_Atom_Tuple; + +/** The body of an atom:Vector. */ +typedef struct { + uint32_t child_size; /**< The size of each element in the vector. */ + uint32_t child_type; /**< The type of each element in the vector. */ + /* Contents (a series of packed atom bodies) follow here. */ +} LV2_Atom_Vector_Body; + +/** An atom:Vector. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + LV2_Atom_Vector_Body body; /**< Body. */ +} LV2_Atom_Vector; + +/** The body of an atom:Property (typically in an atom:Object). */ +typedef struct { + uint32_t key; /**< Key (predicate) (mapped URI). */ + uint32_t context; /**< Context URID (may be, and generally is, 0). */ + LV2_Atom value; /**< Value atom header. */ + /* Value atom body follows here. */ +} LV2_Atom_Property_Body; + +/** An atom:Property. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + LV2_Atom_Property_Body body; /**< Body. */ +} LV2_Atom_Property; + +/** The body of an atom:Object. May be cast to LV2_Atom. */ +typedef struct { + uint32_t id; /**< URID, or 0 for blank. */ + uint32_t otype; /**< Type URID (same as rdf:type, for fast dispatch). */ + /* Contents (a series of property bodies) follow here. */ +} LV2_Atom_Object_Body; + +/** An atom:Object. May be cast to LV2_Atom. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + LV2_Atom_Object_Body body; /**< Body. */ +} LV2_Atom_Object; + +/** The header of an atom:Event. Note this type is NOT an LV2_Atom. */ +typedef struct { + /** Time stamp. Which type is valid is determined by context. */ + union { + int64_t frames; /**< Time in audio frames. */ + double beats; /**< Time in beats. */ + } time; + LV2_Atom body; /**< Event body atom header. */ + /* Body atom contents follow here. */ +} LV2_Atom_Event; + +/** + The body of an atom:Sequence (a sequence of events). + + The unit field is either a URID that described an appropriate time stamp + type, or may be 0 where a default stamp type is known. For + LV2_Descriptor::run(), the default stamp type is audio frames. + + The contents of a sequence is a series of LV2_Atom_Event, each aligned + to 64-bits, for example: + <pre> + | Event 1 (size 6) | Event 2 + | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + |FRAMES |TYPE |SIZE |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. */ +} LV2_Atom_Sequence_Body; + +/** An atom:Sequence. */ +typedef struct { + LV2_Atom atom; /**< Atom header. */ + LV2_Atom_Sequence_Body body; /**< Body. */ +} LV2_Atom_Sequence; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/** + @} +*/ + +#endif /* LV2_ATOM_H */ diff --git a/include/lv2/atom/forge.h b/include/lv2/atom/forge.h new file mode 100644 index 0000000..280bd53 --- /dev/null +++ b/include/lv2/atom/forge.h @@ -0,0 +1,683 @@ +/* + Copyright 2008-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. +*/ + +/** + @file forge.h An API for constructing LV2 atoms. + + This file provides an API for constructing Atoms which makes it relatively + simple to build nested atoms of arbitrary complexity without requiring + dynamic memory allocation. + + The API is based on successively appending the appropriate pieces to build a + complete Atom. The size of containers is automatically updated. Functions + that begin a container return (via their frame argument) a stack frame which + must be popped when the container is finished. + + All output is written to a user-provided buffer or sink function. This + makes it possible to create atoms on the stack, on the heap, in LV2 port + buffers, in a ringbuffer, or elsewhere, all using the same API. + + This entire API is realtime safe if used with a buffer or a realtime safe + sink, except lv2_atom_forge_init() which is only realtime safe if the URI + map function is. + + Note these functions are all static inline, do not take their address. + + This header is non-normative, it is provided for convenience. +*/ + +#ifndef LV2_ATOM_FORGE_H +#define LV2_ATOM_FORGE_H + +/** + @defgroup forge Forge + @ingroup atom + + An API for constructing LV2 atoms. + + @{ +*/ + +#include "lv2/atom/atom.h" +#include "lv2/atom/util.h" +#include "lv2/core/attributes.h" +#include "lv2/urid/urid.h" + +#include <assert.h> +#include <stdbool.h> +#include <stdint.h> +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// Disable deprecation warnings for Blank and Resource +LV2_DISABLE_DEPRECATION_WARNINGS + +/** Handle for LV2_Atom_Forge_Sink. */ +typedef void* LV2_Atom_Forge_Sink_Handle; + +/** A reference to a chunk of written output. */ +typedef intptr_t LV2_Atom_Forge_Ref; + +/** Sink function for writing output. See lv2_atom_forge_set_sink(). */ +typedef LV2_Atom_Forge_Ref (*LV2_Atom_Forge_Sink)( + LV2_Atom_Forge_Sink_Handle handle, + const void* buf, + uint32_t size); + +/** Function for resolving a reference. See lv2_atom_forge_set_sink(). */ +typedef LV2_Atom* (*LV2_Atom_Forge_Deref_Func)( + LV2_Atom_Forge_Sink_Handle handle, + LV2_Atom_Forge_Ref ref); + +/** A stack frame used for keeping track of nested Atom containers. */ +typedef struct LV2_Atom_Forge_Frame { + struct LV2_Atom_Forge_Frame* parent; + LV2_Atom_Forge_Ref ref; +} LV2_Atom_Forge_Frame; + +/** A "forge" for creating atoms by appending to a buffer. */ +typedef struct { + uint8_t* buf; + uint32_t offset; + uint32_t size; + + LV2_Atom_Forge_Sink sink; + LV2_Atom_Forge_Deref_Func deref; + LV2_Atom_Forge_Sink_Handle handle; + + LV2_Atom_Forge_Frame* stack; + + LV2_URID Blank LV2_DEPRECATED; + LV2_URID Bool; + LV2_URID Chunk; + LV2_URID Double; + LV2_URID Float; + LV2_URID Int; + LV2_URID Long; + LV2_URID Literal; + LV2_URID Object; + LV2_URID Path; + LV2_URID Property; + LV2_URID Resource LV2_DEPRECATED; + LV2_URID Sequence; + LV2_URID String; + LV2_URID Tuple; + LV2_URID URI; + LV2_URID URID; + LV2_URID Vector; +} LV2_Atom_Forge; + +static inline void +lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size); + +/** + Initialise `forge`. + + URIs will be mapped using `map` and stored, a reference to `map` itself is + not held. +*/ +static inline void +lv2_atom_forge_init(LV2_Atom_Forge* forge, LV2_URID_Map* map) +{ + lv2_atom_forge_set_buffer(forge, NULL, 0); + forge->Blank = map->map(map->handle, LV2_ATOM__Blank); + forge->Bool = map->map(map->handle, LV2_ATOM__Bool); + forge->Chunk = map->map(map->handle, LV2_ATOM__Chunk); + forge->Double = map->map(map->handle, LV2_ATOM__Double); + forge->Float = map->map(map->handle, LV2_ATOM__Float); + forge->Int = map->map(map->handle, LV2_ATOM__Int); + forge->Long = map->map(map->handle, LV2_ATOM__Long); + forge->Literal = map->map(map->handle, LV2_ATOM__Literal); + forge->Object = map->map(map->handle, LV2_ATOM__Object); + forge->Path = map->map(map->handle, LV2_ATOM__Path); + forge->Property = map->map(map->handle, LV2_ATOM__Property); + forge->Resource = map->map(map->handle, LV2_ATOM__Resource); + forge->Sequence = map->map(map->handle, LV2_ATOM__Sequence); + forge->String = map->map(map->handle, LV2_ATOM__String); + forge->Tuple = map->map(map->handle, LV2_ATOM__Tuple); + forge->URI = map->map(map->handle, LV2_ATOM__URI); + forge->URID = map->map(map->handle, LV2_ATOM__URID); + forge->Vector = map->map(map->handle, LV2_ATOM__Vector); +} + +/** Access the Atom pointed to by a reference. */ +static inline LV2_Atom* +lv2_atom_forge_deref(LV2_Atom_Forge* forge, LV2_Atom_Forge_Ref ref) +{ + return forge->buf ? (LV2_Atom*)ref : forge->deref(forge->handle, ref); +} + +/** + @name Object Stack + @{ +*/ + +/** + Push a stack frame. + This is done automatically by container functions (which take a stack frame + pointer), but may be called by the user to push the top level container when + writing to an existing Atom. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_push(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Frame* frame, + LV2_Atom_Forge_Ref ref) +{ + frame->parent = forge->stack; + frame->ref = ref; + + if (ref) { + forge->stack = frame; // Don't push, so walking the stack is always safe + } + + return ref; +} + +/** Pop a stack frame. This must be called when a container is finished. */ +static inline void +lv2_atom_forge_pop(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame) +{ + if (frame->ref) { + // If frame has a valid ref, it must be the top of the stack + assert(frame == forge->stack); + forge->stack = frame->parent; + } + // Otherwise, frame was not pushed because of overflow, do nothing +} + +/** Return true iff the top of the stack has the given type. */ +static inline bool +lv2_atom_forge_top_is(LV2_Atom_Forge* forge, uint32_t type) +{ + return forge->stack && forge->stack->ref && + (lv2_atom_forge_deref(forge, forge->stack->ref)->type == type); +} + +/** Return true iff `type` is an atom:Object. */ +static inline bool +lv2_atom_forge_is_object_type(const LV2_Atom_Forge* forge, uint32_t type) +{ + return (type == forge->Object || type == forge->Blank || + type == forge->Resource); +} + +/** Return true iff `type` is an atom:Object with a blank ID. */ +static inline bool +lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge, + uint32_t type, + const LV2_Atom_Object_Body* body) +{ + return (type == forge->Blank || (type == forge->Object && body->id == 0)); +} + +/** + @} + @name Output Configuration + @{ +*/ + +/** Set the output buffer where `forge` will write atoms. */ +static inline void +lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size) +{ + forge->buf = buf; + forge->size = (uint32_t)size; + forge->offset = 0; + forge->deref = NULL; + forge->sink = NULL; + forge->handle = NULL; + forge->stack = NULL; +} + +/** + Set the sink function where `forge` will write output. + + The return value of forge functions is an LV2_Atom_Forge_Ref which is an + integer type safe to use as a pointer but is otherwise opaque. The sink + function must return a ref that can be dereferenced to access as least + sizeof(LV2_Atom) bytes of the written data, so sizes can be updated. For + ringbuffers, this should be possible as long as the size of the buffer is a + multiple of sizeof(LV2_Atom), since atoms are always aligned. + + Note that 0 is an invalid reference, so if you are using a buffer offset be + sure to offset it such that 0 is never a valid reference. You will get + confusing errors otherwise. +*/ +static inline void +lv2_atom_forge_set_sink(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Sink sink, + LV2_Atom_Forge_Deref_Func deref, + LV2_Atom_Forge_Sink_Handle handle) +{ + forge->buf = NULL; + forge->size = forge->offset = 0; + forge->deref = deref; + forge->sink = sink; + forge->handle = handle; + forge->stack = NULL; +} + +/** + @} + @name Low Level Output + @{ +*/ + +/** + Write raw output. This is used internally, but is also useful for writing + atom types not explicitly supported by the forge API. Note the caller is + responsible for ensuring the output is appropriately padded. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_raw(LV2_Atom_Forge* forge, const void* data, uint32_t size) +{ + LV2_Atom_Forge_Ref out = 0; + if (forge->sink) { + out = forge->sink(forge->handle, data, size); + } else { + out = (LV2_Atom_Forge_Ref)forge->buf + forge->offset; + uint8_t* mem = forge->buf + forge->offset; + if (forge->offset + size > forge->size) { + return 0; + } + forge->offset += size; + memcpy(mem, data, size); + } + for (LV2_Atom_Forge_Frame* f = forge->stack; f; f = f->parent) { + lv2_atom_forge_deref(forge, f->ref)->size += size; + } + return out; +} + +/** Pad output accordingly so next write is 64-bit aligned. */ +static inline void +lv2_atom_forge_pad(LV2_Atom_Forge* forge, uint32_t written) +{ + const uint64_t pad = 0; + const uint32_t pad_size = lv2_atom_pad_size(written) - written; + lv2_atom_forge_raw(forge, &pad, pad_size); +} + +/** Write raw output, padding to 64-bits as necessary. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_write(LV2_Atom_Forge* forge, const void* data, uint32_t size) +{ + LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, data, size); + if (out) { + lv2_atom_forge_pad(forge, size); + } + return out; +} + +/** Write a null-terminated string body. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_string_body(LV2_Atom_Forge* forge, const char* str, uint32_t len) +{ + LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, str, len); + if (out && (out = lv2_atom_forge_raw(forge, "", 1))) { + lv2_atom_forge_pad(forge, len + 1); + } + return out; +} + +/** + @} + @name Atom Output + @{ +*/ + +/** Write an atom:Atom header. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_atom(LV2_Atom_Forge* forge, uint32_t size, uint32_t type) +{ + const LV2_Atom a = {size, type}; + return lv2_atom_forge_raw(forge, &a, sizeof(a)); +} + +/** Write a primitive (fixed-size) atom. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_primitive(LV2_Atom_Forge* forge, const LV2_Atom* a) +{ + return ( + lv2_atom_forge_top_is(forge, forge->Vector) + ? lv2_atom_forge_raw(forge, LV2_ATOM_BODY_CONST(a), a->size) + : lv2_atom_forge_write(forge, a, (uint32_t)sizeof(LV2_Atom) + a->size)); +} + +/** Write an atom:Int. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_int(LV2_Atom_Forge* forge, int32_t val) +{ + const LV2_Atom_Int a = {{sizeof(val), forge->Int}, val}; + return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); +} + +/** Write an atom:Long. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_long(LV2_Atom_Forge* forge, int64_t val) +{ + const LV2_Atom_Long a = {{sizeof(val), forge->Long}, val}; + return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); +} + +/** Write an atom:Float. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_float(LV2_Atom_Forge* forge, float val) +{ + const LV2_Atom_Float a = {{sizeof(val), forge->Float}, val}; + return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); +} + +/** Write an atom:Double. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_double(LV2_Atom_Forge* forge, double val) +{ + const LV2_Atom_Double a = {{sizeof(val), forge->Double}, val}; + return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); +} + +/** Write an atom:Bool. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_bool(LV2_Atom_Forge* forge, bool val) +{ + const LV2_Atom_Bool a = {{sizeof(int32_t), forge->Bool}, val ? 1 : 0}; + return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); +} + +/** Write an atom:URID. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_urid(LV2_Atom_Forge* forge, LV2_URID id) +{ + const LV2_Atom_URID a = {{sizeof(id), forge->URID}, id}; + return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a); +} + +/** Write an atom compatible with atom:String. Used internally. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_typed_string(LV2_Atom_Forge* forge, + uint32_t type, + const char* str, + uint32_t len) +{ + const LV2_Atom_String a = {{len + 1, type}}; + LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, &a, sizeof(a)); + if (out) { + if (!lv2_atom_forge_string_body(forge, str, len)) { + LV2_Atom* atom = lv2_atom_forge_deref(forge, out); + atom->size = atom->type = 0; + out = 0; + } + } + return out; +} + +/** Write an atom:String. Note that `str` need not be NULL terminated. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_string(LV2_Atom_Forge* forge, const char* str, uint32_t len) +{ + return lv2_atom_forge_typed_string(forge, forge->String, str, len); +} + +/** + Write an atom:URI. Note that `uri` need not be NULL terminated. + This does not map the URI, but writes the complete URI string. To write + a mapped URI, use lv2_atom_forge_urid(). +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_uri(LV2_Atom_Forge* forge, const char* uri, uint32_t len) +{ + return lv2_atom_forge_typed_string(forge, forge->URI, uri, len); +} + +/** Write an atom:Path. Note that `path` need not be NULL terminated. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_path(LV2_Atom_Forge* forge, const char* path, uint32_t len) +{ + return lv2_atom_forge_typed_string(forge, forge->Path, path, len); +} + +/** Write an atom:Literal. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_literal(LV2_Atom_Forge* forge, + const char* str, + uint32_t len, + uint32_t datatype, + uint32_t lang) +{ + const LV2_Atom_Literal a = { + {(uint32_t)(sizeof(LV2_Atom_Literal) - sizeof(LV2_Atom) + len + 1), + forge->Literal}, + {datatype, lang}}; + LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, &a, sizeof(a)); + if (out) { + if (!lv2_atom_forge_string_body(forge, str, len)) { + LV2_Atom* atom = lv2_atom_forge_deref(forge, out); + atom->size = atom->type = 0; + out = 0; + } + } + return out; +} + +/** Start an atom:Vector. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_vector_head(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Frame* frame, + uint32_t child_size, + uint32_t child_type) +{ + const LV2_Atom_Vector a = {{sizeof(LV2_Atom_Vector_Body), forge->Vector}, + {child_size, child_type}}; + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); +} + +/** Write a complete atom:Vector. */ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_vector(LV2_Atom_Forge* forge, + uint32_t child_size, + uint32_t child_type, + uint32_t n_elems, + const void* elems) +{ + const LV2_Atom_Vector a = { + {(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size, + forge->Vector}, + {child_size, child_type}}; + LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a)); + if (out) { + lv2_atom_forge_write(forge, elems, child_size * n_elems); + } + return out; +} + +/** + Write the header of an atom:Tuple. + + The passed frame will be initialised to represent this tuple. To complete + the tuple, write a sequence of atoms, then pop the frame with + lv2_atom_forge_pop(). + + For example: + @code + // Write tuple (1, 2.0) + LV2_Atom_Forge_Frame frame; + LV2_Atom* tup = (LV2_Atom*)lv2_atom_forge_tuple(forge, &frame); + lv2_atom_forge_int(forge, 1); + lv2_atom_forge_float(forge, 2.0); + lv2_atom_forge_pop(forge, &frame); + @endcode +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_tuple(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame) +{ + const LV2_Atom_Tuple a = {{0, forge->Tuple}}; + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); +} + +/** + Write the header of an atom:Object. + + The passed frame will be initialised to represent this object. To complete + the object, write a sequence of properties, then pop the frame with + lv2_atom_forge_pop(). + + For example: + @code + LV2_URID eg_Cat = map("http://example.org/Cat"); + LV2_URID eg_name = map("http://example.org/name"); + + // Start object with type eg_Cat and blank ID + LV2_Atom_Forge_Frame frame; + lv2_atom_forge_object(forge, &frame, 0, eg_Cat); + + // Append property eg:name = "Hobbes" + lv2_atom_forge_key(forge, eg_name); + lv2_atom_forge_string(forge, "Hobbes", strlen("Hobbes")); + + // Finish object + lv2_atom_forge_pop(forge, &frame); + @endcode +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_object(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Frame* frame, + LV2_URID id, + LV2_URID otype) +{ + const LV2_Atom_Object a = { + {(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Object}, {id, otype}}; + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); +} + +/** + The same as lv2_atom_forge_object(), but for object:Resource. + + This function is deprecated and should not be used in new code. + Use lv2_atom_forge_object() directly instead. +*/ +LV2_DEPRECATED +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_resource(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Frame* frame, + LV2_URID id, + LV2_URID otype) +{ + const LV2_Atom_Object a = { + {(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource}, {id, otype}}; + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); +} + +/** + The same as lv2_atom_forge_object(), but for object:Blank. + + This function is deprecated and should not be used in new code. + Use lv2_atom_forge_object() directly instead. +*/ +LV2_DEPRECATED +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_blank(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Frame* frame, + uint32_t id, + LV2_URID otype) +{ + const LV2_Atom_Object a = { + {(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank}, {id, otype}}; + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); +} + +/** + Write a property key in an Object, to be followed by the value. + + See lv2_atom_forge_object() documentation for an example. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_key(LV2_Atom_Forge* forge, LV2_URID key) +{ + const LV2_Atom_Property_Body a = {key, 0, {0, 0}}; + return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t)); +} + +/** + Write the header for a property body in an object, with context. + + If you do not need the context, which is almost certainly the case, + use the simpler lv2_atom_forge_key() instead. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_property_head(LV2_Atom_Forge* forge, + LV2_URID key, + LV2_URID context) +{ + const LV2_Atom_Property_Body a = {key, context, {0, 0}}; + return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t)); +} + +/** + Write the header for a Sequence. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge, + LV2_Atom_Forge_Frame* frame, + uint32_t unit) +{ + const LV2_Atom_Sequence a = { + {(uint32_t)sizeof(LV2_Atom_Sequence_Body), forge->Sequence}, {unit, 0}}; + return lv2_atom_forge_push( + forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); +} + +/** + Write the time stamp header of an Event (in a Sequence) in audio frames. + After this, call the appropriate forge method(s) to write the body. Note + the returned reference is to an LV2_Event which is NOT an Atom. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_frame_time(LV2_Atom_Forge* forge, int64_t frames) +{ + return lv2_atom_forge_write(forge, &frames, sizeof(frames)); +} + +/** + Write the time stamp header of an Event (in a Sequence) in beats. After + this, call the appropriate forge method(s) to write the body. Note the + returned reference is to an LV2_Event which is NOT an Atom. +*/ +static inline LV2_Atom_Forge_Ref +lv2_atom_forge_beat_time(LV2_Atom_Forge* forge, double beats) +{ + return lv2_atom_forge_write(forge, &beats, sizeof(beats)); +} + +LV2_RESTORE_WARNINGS + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/** + @} + @} +*/ + +#endif /* LV2_ATOM_FORGE_H */ diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h new file mode 100644 index 0000000..16d2c00 --- /dev/null +++ b/include/lv2/atom/util.h @@ -0,0 +1,523 @@ +/* + Copyright 2008-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. +*/ + +#ifndef LV2_ATOM_UTIL_H +#define LV2_ATOM_UTIL_H + +/** + @file util.h Helper functions for the LV2 Atom extension. + + Note these functions are all static inline, do not take their address. + + This header is non-normative, it is provided for convenience. +*/ + +/** + @defgroup util Utilities + @ingroup atom + + Utilities for working with atoms. + + @{ +*/ + +#include "lv2/atom/atom.h" + +#include <stdarg.h> +#include <stdbool.h> +#include <stdint.h> +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** Pad a size to 64 bits. */ +static inline uint32_t +lv2_atom_pad_size(uint32_t size) +{ + return (size + 7U) & (~7U); +} + +/** Return the total size of `atom`, including the header. */ +static inline uint32_t +lv2_atom_total_size(const LV2_Atom* atom) +{ + return (uint32_t)sizeof(LV2_Atom) + atom->size; +} + +/** Return true iff `atom` is null. */ +static inline bool +lv2_atom_is_null(const LV2_Atom* atom) +{ + return !atom || (atom->type == 0 && atom->size == 0); +} + +/** Return true iff `a` is equal to `b`. */ +static inline bool +lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b) +{ + return (a == b) || ((a->type == b->type) && (a->size == b->size) && + !memcmp(a + 1, b + 1, a->size)); +} + +/** + @name Sequence Iterator + @{ +*/ + +/** Get an iterator pointing to the first event in a Sequence body. */ +static inline LV2_Atom_Event* +lv2_atom_sequence_begin(const LV2_Atom_Sequence_Body* body) +{ + return (LV2_Atom_Event*)(body + 1); +} + +/** Get an iterator pointing to the end of a Sequence body. */ +static inline LV2_Atom_Event* +lv2_atom_sequence_end(const LV2_Atom_Sequence_Body* body, uint32_t size) +{ + return (LV2_Atom_Event*)((const uint8_t*)body + lv2_atom_pad_size(size)); +} + +/** Return true iff `i` has reached the end of `body`. */ +static inline bool +lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body, + uint32_t size, + const LV2_Atom_Event* i) +{ + return (const uint8_t*)i >= ((const uint8_t*)body + size); +} + +/** Return an iterator to the element following `i`. */ +static inline LV2_Atom_Event* +lv2_atom_sequence_next(const LV2_Atom_Event* i) +{ + return (LV2_Atom_Event*)((const uint8_t*)i + sizeof(LV2_Atom_Event) + + lv2_atom_pad_size(i->body.size)); +} + +/** + A macro for iterating over all events in a Sequence. + @param seq The sequence to iterate over + @param iter The name of the iterator + + This macro is used similarly to a for loop (which it expands to), for + example: + + @code + LV2_ATOM_SEQUENCE_FOREACH(sequence, ev) { + // Do something with ev (an LV2_Atom_Event*) here... + } + @endcode +*/ +#define LV2_ATOM_SEQUENCE_FOREACH(seq, iter) \ + for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(&(seq)->body); \ + !lv2_atom_sequence_is_end(&(seq)->body, (seq)->atom.size, (iter)); \ + (iter) = lv2_atom_sequence_next(iter)) + +/** Like LV2_ATOM_SEQUENCE_FOREACH but for a headerless sequence body. */ +#define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \ + for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(body); \ + !lv2_atom_sequence_is_end(body, size, (iter)); \ + (iter) = lv2_atom_sequence_next(iter)) + +/** + @} + @name Sequence Utilities + @{ +*/ + +/** + Clear all events from `sequence`. + + This simply resets the size field, the other fields are left untouched. +*/ +static inline void +lv2_atom_sequence_clear(LV2_Atom_Sequence* seq) +{ + seq->atom.size = sizeof(LV2_Atom_Sequence_Body); +} + +/** + Append an event at the end of `sequence`. + + @param seq Sequence to append to. + @param capacity Total capacity of the sequence atom + (as set by the host for sequence output ports). + @param event Event to write. + + @return A pointer to the newly written event in `seq`, + or NULL on failure (insufficient space). +*/ +static inline LV2_Atom_Event* +lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq, + uint32_t capacity, + const LV2_Atom_Event* event) +{ + const uint32_t total_size = (uint32_t)sizeof(*event) + event->body.size; + if (capacity - seq->atom.size < total_size) { + return NULL; + } + + LV2_Atom_Event* e = lv2_atom_sequence_end(&seq->body, seq->atom.size); + memcpy(e, event, total_size); + + seq->atom.size += lv2_atom_pad_size(total_size); + + return e; +} + +/** + @} + @name Tuple Iterator + @{ +*/ + +/** Get an iterator pointing to the first element in `tup`. */ +static inline LV2_Atom* +lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup) +{ + return (LV2_Atom*)(LV2_ATOM_BODY(tup)); +} + +/** Return true iff `i` has reached the end of `body`. */ +static inline bool +lv2_atom_tuple_is_end(const void* body, uint32_t size, const LV2_Atom* i) +{ + return (const uint8_t*)i >= ((const uint8_t*)body + size); +} + +/** Return an iterator to the element following `i`. */ +static inline LV2_Atom* +lv2_atom_tuple_next(const LV2_Atom* i) +{ + return (LV2_Atom*)((const uint8_t*)i + sizeof(LV2_Atom) + + lv2_atom_pad_size(i->size)); +} + +/** + A macro for iterating over all properties of a Tuple. + @param tuple The tuple to iterate over + @param iter The name of the iterator + + This macro is used similarly to a for loop (which it expands to), for + example: + + @code + LV2_ATOM_TUPLE_FOREACH(tuple, elem) { + // Do something with elem (an LV2_Atom*) here... + } + @endcode +*/ +#define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ + for (LV2_Atom * iter = lv2_atom_tuple_begin(tuple); \ + !lv2_atom_tuple_is_end( \ + LV2_ATOM_BODY(tuple), (tuple)->atom.size, (iter)); \ + (iter) = lv2_atom_tuple_next(iter)) + +/** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */ +#define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \ + for (LV2_Atom * iter = (LV2_Atom*)(body); \ + !lv2_atom_tuple_is_end(body, size, (iter)); \ + (iter) = lv2_atom_tuple_next(iter)) + +/** + @} + @name Object Iterator + @{ +*/ + +/** Return a pointer to the first property in `body`. */ +static inline LV2_Atom_Property_Body* +lv2_atom_object_begin(const LV2_Atom_Object_Body* body) +{ + return (LV2_Atom_Property_Body*)(body + 1); +} + +/** Return true iff `i` has reached the end of `obj`. */ +static inline bool +lv2_atom_object_is_end(const LV2_Atom_Object_Body* body, + uint32_t size, + const LV2_Atom_Property_Body* i) +{ + return (const uint8_t*)i >= ((const uint8_t*)body + size); +} + +/** Return an iterator to the property following `i`. */ +static inline LV2_Atom_Property_Body* +lv2_atom_object_next(const LV2_Atom_Property_Body* i) +{ + const LV2_Atom* const value = + (const LV2_Atom*)((const uint8_t*)i + 2 * sizeof(uint32_t)); + return (LV2_Atom_Property_Body*)((const uint8_t*)i + + lv2_atom_pad_size( + (uint32_t)sizeof(LV2_Atom_Property_Body) + + value->size)); +} + +/** + A macro for iterating over all properties of an Object. + @param obj The object to iterate over + @param iter The name of the iterator + + This macro is used similarly to a for loop (which it expands to), for + example: + + @code + LV2_ATOM_OBJECT_FOREACH(object, i) { + // Do something with i (an LV2_Atom_Property_Body*) here... + } + @endcode +*/ +#define LV2_ATOM_OBJECT_FOREACH(obj, iter) \ + for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(&(obj)->body); \ + !lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \ + (iter) = lv2_atom_object_next(iter)) + +/** Like LV2_ATOM_OBJECT_FOREACH but for a headerless object body. */ +#define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \ + for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(body); \ + !lv2_atom_object_is_end(body, size, (iter)); \ + (iter) = lv2_atom_object_next(iter)) + +/** + @} + @name Object Query + @{ +*/ + +/** A single entry in an Object query. */ +typedef struct { + uint32_t key; /**< Key to query (input set by user) */ + const LV2_Atom** value; /**< Found value (output set by query function) */ +} LV2_Atom_Object_Query; + +/** Sentinel for lv2_atom_object_query(). */ +static const LV2_Atom_Object_Query LV2_ATOM_OBJECT_QUERY_END = {0, NULL}; + +/** + Get an object's values for various keys. + + The value pointer of each item in `query` will be set to the location of + the corresponding value in `object`. Every value pointer in `query` MUST + be initialised to NULL. This function reads `object` in a single linear + sweep. By allocating `query` on the stack, objects can be "queried" + quickly without allocating any memory. This function is realtime safe. + + This function can only do "flat" queries, it is not smart enough to match + variables in nested objects. + + For example: + @code + const LV2_Atom* name = NULL; + const LV2_Atom* age = NULL; + LV2_Atom_Object_Query q[] = { + { urids.eg_name, &name }, + { urids.eg_age, &age }, + LV2_ATOM_OBJECT_QUERY_END + }; + lv2_atom_object_query(obj, q); + // name and age are now set to the appropriate values in obj, or NULL. + @endcode +*/ +static inline int +lv2_atom_object_query(const LV2_Atom_Object* object, + LV2_Atom_Object_Query* query) +{ + int matches = 0; + int n_queries = 0; + + /* Count number of query keys so we can short-circuit when done */ + for (LV2_Atom_Object_Query* q = query; q->key; ++q) { + ++n_queries; + } + + LV2_ATOM_OBJECT_FOREACH (object, prop) { + for (LV2_Atom_Object_Query* q = query; q->key; ++q) { + if (q->key == prop->key && !*q->value) { + *q->value = &prop->value; + if (++matches == n_queries) { + return matches; + } + break; + } + } + } + return matches; +} + +/** + Body only version of lv2_atom_object_get(). +*/ +static inline int +lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) +{ + int matches = 0; + int n_queries = 0; + + /* Count number of keys so we can short-circuit when done */ + va_list args; + va_start(args, body); + for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { + if (!va_arg(args, const LV2_Atom**)) { + va_end(args); + return -1; + } + } + va_end(args); + + LV2_ATOM_OBJECT_BODY_FOREACH (body, size, prop) { + va_start(args, body); + for (int i = 0; i < n_queries; ++i) { + uint32_t qkey = va_arg(args, uint32_t); + const LV2_Atom** qval = va_arg(args, const LV2_Atom**); + if (qkey == prop->key && !*qval) { + *qval = &prop->value; + if (++matches == n_queries) { + va_end(args); + return matches; + } + break; + } + } + va_end(args); + } + return matches; +} + +/** + Variable argument version of lv2_atom_object_query(). + + This is nicer-looking in code, but a bit more error-prone since it is not + type safe and the argument list must be terminated. + + The arguments should be a series of uint32_t key and const LV2_Atom** value + pairs, terminated by a zero key. The value pointers MUST be initialized to + NULL. For example: + + @code + const LV2_Atom* name = NULL; + const LV2_Atom* age = NULL; + lv2_atom_object_get(obj, + uris.name_key, &name, + uris.age_key, &age, + 0); + @endcode +*/ +static inline int +lv2_atom_object_get(const LV2_Atom_Object* object, ...) +{ + int matches = 0; + int n_queries = 0; + + /* Count number of keys so we can short-circuit when done */ + va_list args; + va_start(args, object); + for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { + if (!va_arg(args, const LV2_Atom**)) { + va_end(args); + return -1; + } + } + va_end(args); + + LV2_ATOM_OBJECT_FOREACH (object, prop) { + va_start(args, object); + for (int i = 0; i < n_queries; ++i) { + uint32_t qkey = va_arg(args, uint32_t); + const LV2_Atom** qval = va_arg(args, const LV2_Atom**); + if (qkey == prop->key && !*qval) { + *qval = &prop->value; + if (++matches == n_queries) { + va_end(args); + return matches; + } + break; + } + } + va_end(args); + } + return matches; +} + +/** + Variable argument version of lv2_atom_object_query() with types. + + This is like lv2_atom_object_get(), but each entry has an additional + parameter to specify the required type. Only atoms with a matching type + will be selected. + + The arguments should be a series of uint32_t key, const LV2_Atom**, uint32_t + type triples, terminated by a zero key. The value pointers MUST be + initialized to NULL. For example: + + @code + const LV2_Atom_String* name = NULL; + const LV2_Atom_Int* age = NULL; + lv2_atom_object_get(obj, + uris.name_key, &name, uris.atom_String, + uris.age_key, &age, uris.atom_Int + 0); + @endcode +*/ +static inline int +lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...) +{ + int matches = 0; + int n_queries = 0; + + /* Count number of keys so we can short-circuit when done */ + va_list args; + va_start(args, object); + for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { + if (!va_arg(args, const LV2_Atom**) || !va_arg(args, uint32_t)) { + va_end(args); + return -1; + } + } + va_end(args); + + LV2_ATOM_OBJECT_FOREACH (object, prop) { + va_start(args, object); + for (int i = 0; i < n_queries; ++i) { + const uint32_t qkey = va_arg(args, uint32_t); + const LV2_Atom** qval = va_arg(args, const LV2_Atom**); + const uint32_t qtype = va_arg(args, uint32_t); + if (!*qval && qkey == prop->key && qtype == prop->value.type) { + *qval = &prop->value; + if (++matches == n_queries) { + va_end(args); + return matches; + } + break; + } + } + va_end(args); + } + return matches; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/** + @} + @} +*/ + +#endif /* LV2_ATOM_UTIL_H */ diff --git a/include/lv2/buf-size/buf-size.h b/include/lv2/buf-size/buf-size.h new file mode 100644 index 0000000..d96e17d --- /dev/null +++ b/include/lv2/buf-size/buf-size.h @@ -0,0 +1,51 @@ +/* + Copyright 2007-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. +*/ + +#ifndef LV2_BUF_SIZE_H +#define LV2_BUF_SIZE_H + +/** + @defgroup buf-size Buffer Size + @ingroup lv2 + + Access to, and restrictions on, buffer sizes. + + See <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# + +#define LV2_BUF_SIZE__boundedBlockLength LV2_BUF_SIZE_PREFIX "boundedBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#boundedBlockLength +#define LV2_BUF_SIZE__coarseBlockLength LV2_BUF_SIZE_PREFIX "coarseBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#coarseBlockLength +#define LV2_BUF_SIZE__fixedBlockLength LV2_BUF_SIZE_PREFIX "fixedBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#fixedBlockLength +#define LV2_BUF_SIZE__maxBlockLength LV2_BUF_SIZE_PREFIX "maxBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#maxBlockLength +#define LV2_BUF_SIZE__minBlockLength LV2_BUF_SIZE_PREFIX "minBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#minBlockLength +#define LV2_BUF_SIZE__nominalBlockLength LV2_BUF_SIZE_PREFIX "nominalBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#nominalBlockLength +#define LV2_BUF_SIZE__powerOf2BlockLength LV2_BUF_SIZE_PREFIX "powerOf2BlockLength" ///< http://lv2plug.in/ns/ext/buf-size#powerOf2BlockLength +#define LV2_BUF_SIZE__sequenceSize LV2_BUF_SIZE_PREFIX "sequenceSize" ///< http://lv2plug.in/ns/ext/buf-size#sequenceSize + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_BUF_SIZE_H */ diff --git a/include/lv2/core/attributes.h b/include/lv2/core/attributes.h new file mode 100644 index 0000000..81791a2 --- /dev/null +++ b/include/lv2/core/attributes.h @@ -0,0 +1,59 @@ +/* + Copyright 2018 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. +*/ + +#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/include/lv2/core/lv2.h b/include/lv2/core/lv2.h new file mode 100644 index 0000000..84c40a5 --- /dev/null +++ b/include/lv2/core/lv2.h @@ -0,0 +1,485 @@ +/* + LV2 - An audio plugin interface specification. + Copyright 2006-2012 Steve Harris, David Robillard. + + Based on LADSPA, Copyright 2000-2002 Richard W.E. Furse, + Paul Barton-Davis, Stefan Westerfeld. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifndef LV2_H_INCLUDED +#define LV2_H_INCLUDED + +/** + @defgroup lv2 LV2 + + The LV2 specification. + + @{ +*/ + +/** + @defgroup lv2core LV2 Core + + Core LV2 specification. + + See <http://lv2plug.in/ns/lv2core> for details. + + @{ +*/ + +#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# + +#define LV2_CORE__AllpassPlugin LV2_CORE_PREFIX "AllpassPlugin" ///< http://lv2plug.in/ns/lv2core#AllpassPlugin +#define LV2_CORE__AmplifierPlugin LV2_CORE_PREFIX "AmplifierPlugin" ///< http://lv2plug.in/ns/lv2core#AmplifierPlugin +#define LV2_CORE__AnalyserPlugin LV2_CORE_PREFIX "AnalyserPlugin" ///< http://lv2plug.in/ns/lv2core#AnalyserPlugin +#define LV2_CORE__AudioPort LV2_CORE_PREFIX "AudioPort" ///< http://lv2plug.in/ns/lv2core#AudioPort +#define LV2_CORE__BandpassPlugin LV2_CORE_PREFIX "BandpassPlugin" ///< http://lv2plug.in/ns/lv2core#BandpassPlugin +#define LV2_CORE__CVPort LV2_CORE_PREFIX "CVPort" ///< http://lv2plug.in/ns/lv2core#CVPort +#define LV2_CORE__ChorusPlugin LV2_CORE_PREFIX "ChorusPlugin" ///< http://lv2plug.in/ns/lv2core#ChorusPlugin +#define LV2_CORE__CombPlugin LV2_CORE_PREFIX "CombPlugin" ///< http://lv2plug.in/ns/lv2core#CombPlugin +#define LV2_CORE__CompressorPlugin LV2_CORE_PREFIX "CompressorPlugin" ///< http://lv2plug.in/ns/lv2core#CompressorPlugin +#define LV2_CORE__ConstantPlugin LV2_CORE_PREFIX "ConstantPlugin" ///< http://lv2plug.in/ns/lv2core#ConstantPlugin +#define LV2_CORE__ControlPort LV2_CORE_PREFIX "ControlPort" ///< http://lv2plug.in/ns/lv2core#ControlPort +#define LV2_CORE__ConverterPlugin LV2_CORE_PREFIX "ConverterPlugin" ///< http://lv2plug.in/ns/lv2core#ConverterPlugin +#define LV2_CORE__DelayPlugin LV2_CORE_PREFIX "DelayPlugin" ///< http://lv2plug.in/ns/lv2core#DelayPlugin +#define LV2_CORE__DistortionPlugin LV2_CORE_PREFIX "DistortionPlugin" ///< http://lv2plug.in/ns/lv2core#DistortionPlugin +#define LV2_CORE__DynamicsPlugin LV2_CORE_PREFIX "DynamicsPlugin" ///< http://lv2plug.in/ns/lv2core#DynamicsPlugin +#define LV2_CORE__EQPlugin LV2_CORE_PREFIX "EQPlugin" ///< http://lv2plug.in/ns/lv2core#EQPlugin +#define LV2_CORE__EnvelopePlugin LV2_CORE_PREFIX "EnvelopePlugin" ///< http://lv2plug.in/ns/lv2core#EnvelopePlugin +#define LV2_CORE__ExpanderPlugin LV2_CORE_PREFIX "ExpanderPlugin" ///< http://lv2plug.in/ns/lv2core#ExpanderPlugin +#define LV2_CORE__ExtensionData LV2_CORE_PREFIX "ExtensionData" ///< http://lv2plug.in/ns/lv2core#ExtensionData +#define LV2_CORE__Feature LV2_CORE_PREFIX "Feature" ///< http://lv2plug.in/ns/lv2core#Feature +#define LV2_CORE__FilterPlugin LV2_CORE_PREFIX "FilterPlugin" ///< http://lv2plug.in/ns/lv2core#FilterPlugin +#define LV2_CORE__FlangerPlugin LV2_CORE_PREFIX "FlangerPlugin" ///< http://lv2plug.in/ns/lv2core#FlangerPlugin +#define LV2_CORE__FunctionPlugin LV2_CORE_PREFIX "FunctionPlugin" ///< http://lv2plug.in/ns/lv2core#FunctionPlugin +#define LV2_CORE__GatePlugin LV2_CORE_PREFIX "GatePlugin" ///< http://lv2plug.in/ns/lv2core#GatePlugin +#define LV2_CORE__GeneratorPlugin LV2_CORE_PREFIX "GeneratorPlugin" ///< http://lv2plug.in/ns/lv2core#GeneratorPlugin +#define LV2_CORE__HighpassPlugin LV2_CORE_PREFIX "HighpassPlugin" ///< http://lv2plug.in/ns/lv2core#HighpassPlugin +#define LV2_CORE__InputPort LV2_CORE_PREFIX "InputPort" ///< http://lv2plug.in/ns/lv2core#InputPort +#define LV2_CORE__InstrumentPlugin LV2_CORE_PREFIX "InstrumentPlugin" ///< http://lv2plug.in/ns/lv2core#InstrumentPlugin +#define LV2_CORE__LimiterPlugin LV2_CORE_PREFIX "LimiterPlugin" ///< http://lv2plug.in/ns/lv2core#LimiterPlugin +#define LV2_CORE__LowpassPlugin LV2_CORE_PREFIX "LowpassPlugin" ///< http://lv2plug.in/ns/lv2core#LowpassPlugin +#define LV2_CORE__MixerPlugin LV2_CORE_PREFIX "MixerPlugin" ///< http://lv2plug.in/ns/lv2core#MixerPlugin +#define LV2_CORE__ModulatorPlugin LV2_CORE_PREFIX "ModulatorPlugin" ///< http://lv2plug.in/ns/lv2core#ModulatorPlugin +#define LV2_CORE__MultiEQPlugin LV2_CORE_PREFIX "MultiEQPlugin" ///< http://lv2plug.in/ns/lv2core#MultiEQPlugin +#define LV2_CORE__OscillatorPlugin LV2_CORE_PREFIX "OscillatorPlugin" ///< http://lv2plug.in/ns/lv2core#OscillatorPlugin +#define LV2_CORE__OutputPort LV2_CORE_PREFIX "OutputPort" ///< http://lv2plug.in/ns/lv2core#OutputPort +#define LV2_CORE__ParaEQPlugin LV2_CORE_PREFIX "ParaEQPlugin" ///< http://lv2plug.in/ns/lv2core#ParaEQPlugin +#define LV2_CORE__PhaserPlugin LV2_CORE_PREFIX "PhaserPlugin" ///< http://lv2plug.in/ns/lv2core#PhaserPlugin +#define LV2_CORE__PitchPlugin LV2_CORE_PREFIX "PitchPlugin" ///< http://lv2plug.in/ns/lv2core#PitchPlugin +#define LV2_CORE__Plugin LV2_CORE_PREFIX "Plugin" ///< http://lv2plug.in/ns/lv2core#Plugin +#define LV2_CORE__PluginBase LV2_CORE_PREFIX "PluginBase" ///< http://lv2plug.in/ns/lv2core#PluginBase +#define LV2_CORE__Point LV2_CORE_PREFIX "Point" ///< http://lv2plug.in/ns/lv2core#Point +#define LV2_CORE__Port LV2_CORE_PREFIX "Port" ///< http://lv2plug.in/ns/lv2core#Port +#define LV2_CORE__PortProperty LV2_CORE_PREFIX "PortProperty" ///< http://lv2plug.in/ns/lv2core#PortProperty +#define LV2_CORE__Resource LV2_CORE_PREFIX "Resource" ///< http://lv2plug.in/ns/lv2core#Resource +#define LV2_CORE__ReverbPlugin LV2_CORE_PREFIX "ReverbPlugin" ///< http://lv2plug.in/ns/lv2core#ReverbPlugin +#define LV2_CORE__ScalePoint LV2_CORE_PREFIX "ScalePoint" ///< http://lv2plug.in/ns/lv2core#ScalePoint +#define LV2_CORE__SimulatorPlugin LV2_CORE_PREFIX "SimulatorPlugin" ///< http://lv2plug.in/ns/lv2core#SimulatorPlugin +#define LV2_CORE__SpatialPlugin LV2_CORE_PREFIX "SpatialPlugin" ///< http://lv2plug.in/ns/lv2core#SpatialPlugin +#define LV2_CORE__Specification LV2_CORE_PREFIX "Specification" ///< http://lv2plug.in/ns/lv2core#Specification +#define LV2_CORE__SpectralPlugin LV2_CORE_PREFIX "SpectralPlugin" ///< http://lv2plug.in/ns/lv2core#SpectralPlugin +#define LV2_CORE__UtilityPlugin LV2_CORE_PREFIX "UtilityPlugin" ///< http://lv2plug.in/ns/lv2core#UtilityPlugin +#define LV2_CORE__WaveshaperPlugin LV2_CORE_PREFIX "WaveshaperPlugin" ///< http://lv2plug.in/ns/lv2core#WaveshaperPlugin +#define LV2_CORE__appliesTo LV2_CORE_PREFIX "appliesTo" ///< http://lv2plug.in/ns/lv2core#appliesTo +#define LV2_CORE__binary LV2_CORE_PREFIX "binary" ///< http://lv2plug.in/ns/lv2core#binary +#define LV2_CORE__connectionOptional LV2_CORE_PREFIX "connectionOptional" ///< http://lv2plug.in/ns/lv2core#connectionOptional +#define LV2_CORE__control LV2_CORE_PREFIX "control" ///< http://lv2plug.in/ns/lv2core#control +#define LV2_CORE__default LV2_CORE_PREFIX "default" ///< http://lv2plug.in/ns/lv2core#default +#define LV2_CORE__designation LV2_CORE_PREFIX "designation" ///< http://lv2plug.in/ns/lv2core#designation +#define LV2_CORE__documentation LV2_CORE_PREFIX "documentation" ///< http://lv2plug.in/ns/lv2core#documentation +#define LV2_CORE__enabled LV2_CORE_PREFIX "enabled" ///< http://lv2plug.in/ns/lv2core#enabled +#define LV2_CORE__enumeration LV2_CORE_PREFIX "enumeration" ///< http://lv2plug.in/ns/lv2core#enumeration +#define LV2_CORE__extensionData LV2_CORE_PREFIX "extensionData" ///< http://lv2plug.in/ns/lv2core#extensionData +#define LV2_CORE__freeWheeling LV2_CORE_PREFIX "freeWheeling" ///< http://lv2plug.in/ns/lv2core#freeWheeling +#define LV2_CORE__hardRTCapable LV2_CORE_PREFIX "hardRTCapable" ///< http://lv2plug.in/ns/lv2core#hardRTCapable +#define LV2_CORE__inPlaceBroken LV2_CORE_PREFIX "inPlaceBroken" ///< http://lv2plug.in/ns/lv2core#inPlaceBroken +#define LV2_CORE__index LV2_CORE_PREFIX "index" ///< http://lv2plug.in/ns/lv2core#index +#define LV2_CORE__integer LV2_CORE_PREFIX "integer" ///< http://lv2plug.in/ns/lv2core#integer +#define LV2_CORE__isLive LV2_CORE_PREFIX "isLive" ///< http://lv2plug.in/ns/lv2core#isLive +#define LV2_CORE__latency LV2_CORE_PREFIX "latency" ///< http://lv2plug.in/ns/lv2core#latency +#define LV2_CORE__maximum LV2_CORE_PREFIX "maximum" ///< http://lv2plug.in/ns/lv2core#maximum +#define LV2_CORE__microVersion LV2_CORE_PREFIX "microVersion" ///< http://lv2plug.in/ns/lv2core#microVersion +#define LV2_CORE__minimum LV2_CORE_PREFIX "minimum" ///< http://lv2plug.in/ns/lv2core#minimum +#define LV2_CORE__minorVersion LV2_CORE_PREFIX "minorVersion" ///< http://lv2plug.in/ns/lv2core#minorVersion +#define LV2_CORE__name LV2_CORE_PREFIX "name" ///< http://lv2plug.in/ns/lv2core#name +#define LV2_CORE__optionalFeature LV2_CORE_PREFIX "optionalFeature" ///< http://lv2plug.in/ns/lv2core#optionalFeature +#define LV2_CORE__port LV2_CORE_PREFIX "port" ///< http://lv2plug.in/ns/lv2core#port +#define LV2_CORE__portProperty LV2_CORE_PREFIX "portProperty" ///< http://lv2plug.in/ns/lv2core#portProperty +#define LV2_CORE__project LV2_CORE_PREFIX "project" ///< http://lv2plug.in/ns/lv2core#project +#define LV2_CORE__prototype LV2_CORE_PREFIX "prototype" ///< http://lv2plug.in/ns/lv2core#prototype +#define LV2_CORE__reportsLatency LV2_CORE_PREFIX "reportsLatency" ///< http://lv2plug.in/ns/lv2core#reportsLatency +#define LV2_CORE__requiredFeature LV2_CORE_PREFIX "requiredFeature" ///< http://lv2plug.in/ns/lv2core#requiredFeature +#define LV2_CORE__sampleRate LV2_CORE_PREFIX "sampleRate" ///< http://lv2plug.in/ns/lv2core#sampleRate +#define LV2_CORE__scalePoint LV2_CORE_PREFIX "scalePoint" ///< http://lv2plug.in/ns/lv2core#scalePoint +#define LV2_CORE__symbol LV2_CORE_PREFIX "symbol" ///< http://lv2plug.in/ns/lv2core#symbol +#define LV2_CORE__toggled LV2_CORE_PREFIX "toggled" ///< http://lv2plug.in/ns/lv2core#toggled + +// clang-format on + +#ifdef __cplusplus +extern "C" { +#endif + +/** + Plugin Instance Handle. + + This is a handle for one particular instance of a plugin. It is valid to + compare to NULL (or 0 for C++) but otherwise the host MUST NOT attempt to + interpret it. +*/ +typedef void* LV2_Handle; + +/** + Feature. + + Features allow hosts to make additional functionality available to plugins + without requiring modification to the LV2 API. Extensions may define new + features and specify the `URI` and `data` to be used if necessary. + Some features, such as lv2:isLive, do not require the host to pass data. +*/ +typedef struct { + /** + A globally unique, case-sensitive identifier (URI) for this feature. + + This MUST be a valid URI string as defined by RFC 3986. + */ + const char* URI; + + /** + Pointer to arbitrary data. + + The format of this data is defined by the extension which describes the + feature with the given `URI`. + */ + void* data; +} LV2_Feature; + +/** + Plugin Descriptor. + + This structure provides the core functions necessary to instantiate and use + a plugin. +*/ +typedef struct LV2_Descriptor { + /** + A globally unique, case-sensitive identifier for this plugin. + + This MUST be a valid URI string as defined by RFC 3986. All plugins with + the same URI MUST be compatible to some degree, see + http://lv2plug.in/ns/lv2core for details. + */ + const char* URI; + + /** + Instantiate the plugin. + + Note that instance initialisation should generally occur in activate() + rather than here. If a host calls instantiate(), it MUST call cleanup() + at some point in the future. + + @param descriptor Descriptor of the plugin to instantiate. + + @param sample_rate Sample rate, in Hz, for the new plugin instance. + + @param bundle_path Path to the LV2 bundle which contains this plugin + binary. It MUST include the trailing directory separator so that simply + appending a filename will yield the path to that file in the bundle. + + @param features A NULL terminated array of LV2_Feature structs which + represent the features the host supports. Plugins may refuse to + instantiate if required features are not found here. However, hosts MUST + NOT use this as a discovery mechanism: instead, use the RDF data to + determine which features are required and do not attempt to instantiate + unsupported plugins at all. This parameter MUST NOT be NULL, i.e. a host + that supports no features MUST pass a single element array containing + NULL. + + @return A handle for the new plugin instance, or NULL if instantiation + has failed. + */ + LV2_Handle (*instantiate)(const struct LV2_Descriptor* descriptor, + double sample_rate, + const char* bundle_path, + const LV2_Feature* const* features); + + /** + Connect a port on a plugin instance to a memory location. + + Plugin writers should be aware that the host may elect to use the same + buffer for more than one port and even use the same buffer for both + input and output (see lv2:inPlaceBroken in lv2.ttl). + + If the plugin has the feature lv2:hardRTCapable then there are various + things that the plugin MUST NOT do within the connect_port() function; + see lv2core.ttl for details. + + connect_port() MUST be called at least once for each port before run() + is called, unless that port is lv2:connectionOptional. The plugin must + pay careful attention to the block size passed to run() since the block + allocated may only just be large enough to contain the data, and is not + guaranteed to remain constant between run() calls. + + connect_port() may be called more than once for a plugin instance to + allow the host to change the buffers that the plugin is reading or + writing. These calls may be made before or after activate() or + deactivate() calls. + + @param instance Plugin instance containing the port. + + @param port Index of the port to connect. The host MUST NOT try to + connect a port index that is not defined in the plugin's RDF data. If + it does, the plugin's behaviour is undefined (a crash is likely). + + @param data_location Pointer to data of the type defined by the port + type in the plugin's RDF data (for example, an array of float for an + lv2:AudioPort). This pointer must be stored by the plugin instance and + used to read/write data when run() is called. Data present at the time + of the connect_port() call MUST NOT be considered meaningful. + */ + void (*connect_port)(LV2_Handle instance, uint32_t port, void* data_location); + + /** + Initialise a plugin instance and activate it for use. + + This is separated from instantiate() to aid real-time support and so + that hosts can reinitialise a plugin instance by calling deactivate() + and then activate(). In this case the plugin instance MUST reset all + state information dependent on the history of the plugin instance except + for any data locations provided by connect_port(). If there is nothing + for activate() to do then this field may be NULL. + + When present, hosts MUST call this function once before run() is called + for the first time. This call SHOULD be made as close to the run() call + as possible and indicates to real-time plugins that they are now live, + however plugins MUST NOT rely on a prompt call to run() after + activate(). + + The host MUST NOT call activate() again until deactivate() has been + called first. If a host calls activate(), it MUST call deactivate() at + some point in the future. Note that connect_port() may be called before + or after activate(). + */ + void (*activate)(LV2_Handle instance); + + /** + Run a plugin instance for a block. + + Note that if an activate() function exists then it must be called before + run(). If deactivate() is called for a plugin instance then run() may + not be called until activate() has been called again. + + If the plugin has the feature lv2:hardRTCapable then there are various + things that the plugin MUST NOT do within the run() function (see + lv2core.ttl for details). + + As a special case, when `sample_count` is 0, the plugin should update + any output ports that represent a single instant in time (for example, + control ports, but not audio ports). This is particularly useful for + latent plugins, which should update their latency output port so hosts + can pre-roll plugins to compute latency. Plugins MUST NOT crash when + `sample_count` is 0. + + @param instance Instance to be run. + + @param sample_count The block size (in samples) for which the plugin + instance must run. + */ + void (*run)(LV2_Handle instance, uint32_t sample_count); + + /** + Deactivate a plugin instance (counterpart to activate()). + + Hosts MUST deactivate all activated instances after they have been run() + for the last time. This call SHOULD be made as close to the last run() + call as possible and indicates to real-time plugins that they are no + longer live, however plugins MUST NOT rely on prompt deactivation. If + there is nothing for deactivate() to do then this field may be NULL + + Deactivation is not similar to pausing since the plugin instance will be + reinitialised by activate(). However, deactivate() itself MUST NOT fully + reset plugin state. For example, the host may deactivate a plugin, then + store its state (using some extension to do so). + + Hosts MUST NOT call deactivate() unless activate() was previously + called. Note that connect_port() may be called before or after + deactivate(). + */ + void (*deactivate)(LV2_Handle instance); + + /** + Clean up a plugin instance (counterpart to instantiate()). + + Once an instance of a plugin has been finished with it must be deleted + using this function. The instance handle passed ceases to be valid after + this call. + + If activate() was called for a plugin instance then a corresponding call + to deactivate() MUST be made before cleanup() is called. Hosts MUST NOT + call cleanup() unless instantiate() was previously called. + */ + void (*cleanup)(LV2_Handle instance); + + /** + Return additional plugin data defined by some extension. + + A typical use of this facility is to return a struct containing function + pointers to extend the LV2_Descriptor API. + + The actual type and meaning of the returned object MUST be specified + precisely by the extension. This function MUST return NULL for any + unsupported URI. If a plugin does not support any extension data, this + field may be NULL. + + The host is never responsible for freeing the returned value. + */ + const void* (*extension_data)(const char* uri); +} LV2_Descriptor; + +/** + Helper macro needed for LV2_SYMBOL_EXPORT when using C++. +*/ +#ifdef __cplusplus +# define LV2_SYMBOL_EXTERN extern "C" +#else +# define LV2_SYMBOL_EXTERN +#endif + +/** + Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded + by the host as a symbol from the dynamic library. +*/ +#ifdef _WIN32 +# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport) +#else +# define LV2_SYMBOL_EXPORT \ + LV2_SYMBOL_EXTERN __attribute__((visibility("default"))) +#endif + +/** + Prototype for plugin accessor function. + + Plugins are discovered by hosts using RDF data (not by loading libraries). + See http://lv2plug.in for details on the discovery process, though most + hosts should use an existing library to implement this functionality. + + This is the simple plugin discovery API, suitable for most statically + defined plugins. Advanced plugins that need access to their bundle during + discovery can use lv2_lib_descriptor() instead. Plugin libraries MUST + include a function called "lv2_descriptor" or "lv2_lib_descriptor" with + C-style linkage, but SHOULD provide "lv2_descriptor" wherever possible. + + When it is time to load a plugin (designated by its URI), the host loads the + plugin's library, gets the lv2_descriptor() function from it, and uses this + function to find the LV2_Descriptor for the desired plugin. Plugins are + accessed by index using values from 0 upwards. This function MUST return + NULL for out of range indices, so the host can enumerate plugins by + increasing `index` until NULL is returned. + + Note that `index` has no meaning, hosts MUST NOT depend on it remaining + consistent between loads of the plugin library. +*/ +LV2_SYMBOL_EXPORT +const LV2_Descriptor* +lv2_descriptor(uint32_t index); + +/** + Type of the lv2_descriptor() function in a library (old discovery API). +*/ +typedef const LV2_Descriptor* (*LV2_Descriptor_Function)(uint32_t index); + +/** + Handle for a library descriptor. +*/ +typedef void* LV2_Lib_Handle; + +/** + Descriptor for a plugin library. + + To access a plugin library, the host creates an LV2_Lib_Descriptor via the + lv2_lib_descriptor() function in the shared object. +*/ +typedef struct { + /** + Opaque library data which must be passed as the first parameter to all + the methods of this struct. + */ + LV2_Lib_Handle handle; + + /** + The total size of this struct. This allows for this struct to be + expanded in the future if necessary. This MUST be set by the library to + sizeof(LV2_Lib_Descriptor). The host MUST NOT access any fields of this + struct beyond get_plugin() unless this field indicates they are present. + */ + uint32_t size; + + /** + Destroy this library descriptor and free all related resources. + */ + void (*cleanup)(LV2_Lib_Handle handle); + + /** + Plugin accessor. + + Plugins are accessed by index using values from 0 upwards. Out of range + indices MUST result in this function returning NULL, so the host can + enumerate plugins by increasing `index` until NULL is returned. + */ + const LV2_Descriptor* (*get_plugin)(LV2_Lib_Handle handle, uint32_t index); +} LV2_Lib_Descriptor; + +/** + Prototype for library accessor function. + + This is the more advanced discovery API, which allows plugin libraries to + access their bundles during discovery, which makes it possible for plugins to + be dynamically defined by files in their bundle. This API also has an + explicit cleanup function, removing any need for non-portable shared library + destructors. Simple plugins that do not require these features may use + lv2_descriptor() instead. + + This is the entry point for a plugin library. Hosts load this symbol from + the library and call this function to obtain a library descriptor which can + be used to access all the contained plugins. The returned object must not + be destroyed (using LV2_Lib_Descriptor::cleanup()) until all plugins loaded + from that library have been destroyed. +*/ +LV2_SYMBOL_EXPORT +const LV2_Lib_Descriptor* +lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features); + +/** + Type of the lv2_lib_descriptor() function in an LV2 library. +*/ +typedef const LV2_Lib_Descriptor* (*LV2_Lib_Descriptor_Function)( + const char* bundle_path, + const LV2_Feature* const* features); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/** + @} + @} +*/ + +#endif /* LV2_H_INCLUDED */ diff --git a/include/lv2/core/lv2_util.h b/include/lv2/core/lv2_util.h new file mode 100644 index 0000000..f3766aa --- /dev/null +++ b/include/lv2/core/lv2_util.h @@ -0,0 +1,103 @@ +/* + 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. +*/ + +/** + @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 = (bool)va_arg(args, int); + + *data = lv2_features_data(features, uri); + if (required && !*data) { + va_end(args); + return uri; + } + } + + va_end(args); + return NULL; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/** + @} +*/ diff --git a/include/lv2/data-access/data-access.h b/include/lv2/data-access/data-access.h new file mode 100644 index 0000000..de3b6b6 --- /dev/null +++ b/include/lv2/data-access/data-access.h @@ -0,0 +1,73 @@ +/* + Copyright 2008-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. +*/ + +#ifndef LV2_DATA_ACCESS_H +#define LV2_DATA_ACCESS_H + +/** + @defgroup data-access Data Access + @ingroup lv2 + + Access to plugin extension_data() for UIs. + + See <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_H */ diff --git a/include/lv2/dynmanifest/dynmanifest.h b/include/lv2/dynmanifest/dynmanifest.h new file mode 100644 index 0000000..674577b --- /dev/null +++ b/include/lv2/dynmanifest/dynmanifest.h @@ -0,0 +1,160 @@ +/* + 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. +*/ + +#ifndef LV2_DYN_MANIFEST_H_INCLUDED +#define LV2_DYN_MANIFEST_H_INCLUDED + +/** + @defgroup dynmanifest Dynamic Manifest + @ingroup lv2 + + Support for dynamic data generation. + + See <http://lv2plug.in/ns/ext/dynmanifest> for details. + + @{ +*/ + +#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 + +/** + Dynamic manifest generator handle. + + This handle indicates a particular status of a dynamic manifest generator. + The host MUST NOT attempt to interpret it and, unlikely LV2_Handle, it is + NOT even valid to compare this to NULL. The dynamic manifest generator MAY + use it to reference internal data. +*/ +typedef void* LV2_Dyn_Manifest_Handle; + +/** + Generate the dynamic manifest. + + @param handle Pointer to an uninitialized dynamic manifest generator handle. + + @param features NULL terminated array of LV2_Feature structs which represent + the features the host supports. The dynamic manifest generator may refuse to + (re)generate the dynamic manifest if required features are not found here + (however hosts SHOULD NOT use this as a discovery mechanism, instead of + reading the static manifest file). This array must always exist; if a host + has no features, it MUST pass a single element array containing NULL. + + @return 0 on success, otherwise a non-zero error code. The host SHOULD + evaluate the result of the operation by examining the returned value and + MUST NOT try to interpret the value of handle. +*/ +int +lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle, + const LV2_Feature* const* features); + +/** + Fetch a "list" of subject URIs described in the dynamic manifest. + + The dynamic manifest generator has to fill the resource only with the needed + triples to make the host aware of the "objects" it wants to expose. For + example, if the plugin library exposes a regular LV2 plugin, it should + output only a triple like the following: + + <http://example.org/plugin> a lv2:Plugin . + + The objects that are eligible for exposure are those that would need to be + represented by a subject node in a static manifest. + + @param handle Dynamic manifest generator handle. + + @param fp FILE * identifying the resource the host has to set up for the + dynamic manifest generator. The host MUST pass a writable, empty resource to + this function, and the dynamic manifest generator MUST ONLY perform write + operations on it at the end of the stream (for example, using only + fprintf(), fwrite() and similar). + + @return 0 on success, otherwise a non-zero error code. +*/ +int +lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp); + +/** + Function that fetches data related to a specific URI. + + The dynamic manifest generator has to fill the resource with data related to + object represented by the given URI. For example, if the library exposes a + regular LV2 plugin whose URI, as retrieved by the host using + lv2_dyn_manifest_get_subjects() is http://example.org/plugin then it + should output something like: + + <pre> + <http://example.org/plugin> + a lv2:Plugin ; + doap:name "My Plugin" ; + lv2:binary <mylib.so> ; + etc:etc "..." . + </pre> + + @param handle Dynamic manifest generator handle. + + @param fp FILE * identifying the resource the host has to set up for the + dynamic manifest generator. The host MUST pass a writable resource to this + function, and the dynamic manifest generator MUST ONLY perform write + operations on it at the current position of the stream (for example, using + only fprintf(), fwrite() and similar). + + @param uri URI to get data about (in the "plain" form, i.e., absolute URI + without Turtle prefixes). + + @return 0 on success, otherwise a non-zero error code. +*/ +int +lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, + FILE* fp, + const char* uri); + +/** + Function that ends the operations on the dynamic manifest generator. + + This function SHOULD be used by the dynamic manifest generator to perform + cleanup operations, etc. + + Once this function is called, referring to handle will cause undefined + behavior. + + @param handle Dynamic manifest generator handle. +*/ +void +lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/** + @} +*/ + +#endif /* LV2_DYN_MANIFEST_H_INCLUDED */ diff --git a/include/lv2/event/event-helpers.h b/include/lv2/event/event-helpers.h new file mode 100644 index 0000000..bf1b885 --- /dev/null +++ b/include/lv2/event/event-helpers.h @@ -0,0 +1,255 @@ +/* + Copyright 2008-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. +*/ + +#ifndef LV2_EVENT_HELPERS_H +#define LV2_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_HELPERS_H */ diff --git a/include/lv2/event/event.h b/include/lv2/event/event.h new file mode 100644 index 0000000..ed5adde --- /dev/null +++ b/include/lv2/event/event.h @@ -0,0 +1,298 @@ +/* + Copyright 2008-2016 David Robillard <d@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. +*/ + +#ifndef LV2_EVENT_H +#define LV2_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_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..2986f69 --- /dev/null +++ b/include/lv2/instance-access/instance-access.h @@ -0,0 +1,41 @@ +/* + Copyright 2008-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. +*/ + +#ifndef LV2_INSTANCE_ACCESS_H +#define LV2_INSTANCE_ACCESS_H + +/** + @defgroup instance-access Instance Access + @ingroup lv2 + + Access to the LV2_Handle of a plugin for UIs. + + See <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_H */ diff --git a/include/lv2/log/log.h b/include/lv2/log/log.h new file mode 100644 index 0000000..cc62bef --- /dev/null +++ b/include/lv2/log/log.h @@ -0,0 +1,113 @@ +/* + 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. +*/ + +#ifndef LV2_LOG_H +#define LV2_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_H */ diff --git a/include/lv2/log/logger.h b/include/lv2/log/logger.h new file mode 100644 index 0000000..d6919a2 --- /dev/null +++ b/include/lv2/log/logger.h @@ -0,0 +1,157 @@ +/* + 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. +*/ + +#ifndef LV2_ATOM_LOGGER_H +#define LV2_ATOM_LOGGER_H + +/** + @defgroup logger Logger + @ingroup log + + Convenience API for easy logging in plugin code. This API provides simple + wrappers for logging from a plugin, which automatically fall back to + printing to stderr if host support is unavailable. + + @{ +*/ + +#include "lv2/log/log.h" +#include "lv2/urid/urid.h" + +#include <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; + 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/include/lv2/midi/midi.h b/include/lv2/midi/midi.h new file mode 100644 index 0000000..f7e0500 --- /dev/null +++ b/include/lv2/midi/midi.h @@ -0,0 +1,248 @@ +/* + 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. +*/ + +#ifndef LV2_MIDI_H +#define LV2_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_H */ diff --git a/include/lv2/morph/morph.h b/include/lv2/morph/morph.h new file mode 100644 index 0000000..370937a --- /dev/null +++ b/include/lv2/morph/morph.h @@ -0,0 +1,48 @@ +/* + 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. +*/ + +#ifndef LV2_MORPH_H +#define LV2_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_H */ diff --git a/include/lv2/options/options.h b/include/lv2/options/options.h new file mode 100644 index 0000000..06e5db4 --- /dev/null +++ b/include/lv2/options/options.h @@ -0,0 +1,149 @@ +/* + 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. +*/ + +#ifndef LV2_OPTIONS_H +#define LV2_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_H */ diff --git a/include/lv2/parameters/parameters.h b/include/lv2/parameters/parameters.h new file mode 100644 index 0000000..66a7561 --- /dev/null +++ b/include/lv2/parameters/parameters.h @@ -0,0 +1,68 @@ +/* + 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. +*/ + +#ifndef LV2_PARAMETERS_H +#define LV2_PARAMETERS_H + +/** + @defgroup parameters Parameters + @ingroup lv2 + + Common parameters for audio processing. + + See <http://lv2plug.in/ns/ext/parameters> for details. + + @{ +*/ + +// clang-format off + +#define LV2_PARAMETERS_URI "http://lv2plug.in/ns/ext/parameters" ///< http://lv2plug.in/ns/ext/parameters +#define LV2_PARAMETERS_PREFIX LV2_PARAMETERS_URI "#" ///< http://lv2plug.in/ns/ext/parameters# + +#define LV2_PARAMETERS__CompressorControls LV2_PARAMETERS_PREFIX "CompressorControls" ///< http://lv2plug.in/ns/ext/parameters#CompressorControls +#define LV2_PARAMETERS__ControlGroup LV2_PARAMETERS_PREFIX "ControlGroup" ///< http://lv2plug.in/ns/ext/parameters#ControlGroup +#define LV2_PARAMETERS__EnvelopeControls LV2_PARAMETERS_PREFIX "EnvelopeControls" ///< http://lv2plug.in/ns/ext/parameters#EnvelopeControls +#define LV2_PARAMETERS__FilterControls LV2_PARAMETERS_PREFIX "FilterControls" ///< http://lv2plug.in/ns/ext/parameters#FilterControls +#define LV2_PARAMETERS__OscillatorControls LV2_PARAMETERS_PREFIX "OscillatorControls" ///< http://lv2plug.in/ns/ext/parameters#OscillatorControls +#define LV2_PARAMETERS__amplitude LV2_PARAMETERS_PREFIX "amplitude" ///< http://lv2plug.in/ns/ext/parameters#amplitude +#define LV2_PARAMETERS__attack LV2_PARAMETERS_PREFIX "attack" ///< http://lv2plug.in/ns/ext/parameters#attack +#define LV2_PARAMETERS__bypass LV2_PARAMETERS_PREFIX "bypass" ///< http://lv2plug.in/ns/ext/parameters#bypass +#define LV2_PARAMETERS__cutoffFrequency LV2_PARAMETERS_PREFIX "cutoffFrequency" ///< http://lv2plug.in/ns/ext/parameters#cutoffFrequency +#define LV2_PARAMETERS__decay LV2_PARAMETERS_PREFIX "decay" ///< http://lv2plug.in/ns/ext/parameters#decay +#define LV2_PARAMETERS__delay LV2_PARAMETERS_PREFIX "delay" ///< http://lv2plug.in/ns/ext/parameters#delay +#define LV2_PARAMETERS__dryLevel LV2_PARAMETERS_PREFIX "dryLevel" ///< http://lv2plug.in/ns/ext/parameters#dryLevel +#define LV2_PARAMETERS__frequency LV2_PARAMETERS_PREFIX "frequency" ///< http://lv2plug.in/ns/ext/parameters#frequency +#define LV2_PARAMETERS__gain LV2_PARAMETERS_PREFIX "gain" ///< http://lv2plug.in/ns/ext/parameters#gain +#define LV2_PARAMETERS__hold LV2_PARAMETERS_PREFIX "hold" ///< http://lv2plug.in/ns/ext/parameters#hold +#define LV2_PARAMETERS__pulseWidth LV2_PARAMETERS_PREFIX "pulseWidth" ///< http://lv2plug.in/ns/ext/parameters#pulseWidth +#define LV2_PARAMETERS__ratio LV2_PARAMETERS_PREFIX "ratio" ///< http://lv2plug.in/ns/ext/parameters#ratio +#define LV2_PARAMETERS__release LV2_PARAMETERS_PREFIX "release" ///< http://lv2plug.in/ns/ext/parameters#release +#define LV2_PARAMETERS__resonance LV2_PARAMETERS_PREFIX "resonance" ///< http://lv2plug.in/ns/ext/parameters#resonance +#define LV2_PARAMETERS__sampleRate LV2_PARAMETERS_PREFIX "sampleRate" ///< http://lv2plug.in/ns/ext/parameters#sampleRate +#define LV2_PARAMETERS__sustain LV2_PARAMETERS_PREFIX "sustain" ///< http://lv2plug.in/ns/ext/parameters#sustain +#define LV2_PARAMETERS__threshold LV2_PARAMETERS_PREFIX "threshold" ///< http://lv2plug.in/ns/ext/parameters#threshold +#define LV2_PARAMETERS__waveform LV2_PARAMETERS_PREFIX "waveform" ///< http://lv2plug.in/ns/ext/parameters#waveform +#define LV2_PARAMETERS__wetDryRatio LV2_PARAMETERS_PREFIX "wetDryRatio" ///< http://lv2plug.in/ns/ext/parameters#wetDryRatio +#define LV2_PARAMETERS__wetLevel LV2_PARAMETERS_PREFIX "wetLevel" ///< http://lv2plug.in/ns/ext/parameters#wetLevel + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_PARAMETERS_H */ diff --git a/include/lv2/patch/patch.h b/include/lv2/patch/patch.h new file mode 100644 index 0000000..4db2abb --- /dev/null +++ b/include/lv2/patch/patch.h @@ -0,0 +1,73 @@ +/* + 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. +*/ + +#ifndef LV2_PATCH_H +#define LV2_PATCH_H + +/** + @defgroup patch Patch + @ingroup lv2 + + Messages for accessing and manipulating properties. + + Note the patch extension is purely data, this header merely defines URIs for + convenience. + + See <http://lv2plug.in/ns/ext/patch> for details. + + @{ +*/ + +// clang-format off + +#define LV2_PATCH_URI "http://lv2plug.in/ns/ext/patch" ///< http://lv2plug.in/ns/ext/patch +#define LV2_PATCH_PREFIX LV2_PATCH_URI "#" ///< http://lv2plug.in/ns/ext/patch# + +#define LV2_PATCH__Ack LV2_PATCH_PREFIX "Ack" ///< http://lv2plug.in/ns/ext/patch#Ack +#define LV2_PATCH__Delete LV2_PATCH_PREFIX "Delete" ///< http://lv2plug.in/ns/ext/patch#Delete +#define LV2_PATCH__Copy LV2_PATCH_PREFIX "Copy" ///< http://lv2plug.in/ns/ext/patch#Copy +#define LV2_PATCH__Error LV2_PATCH_PREFIX "Error" ///< http://lv2plug.in/ns/ext/patch#Error +#define LV2_PATCH__Get LV2_PATCH_PREFIX "Get" ///< http://lv2plug.in/ns/ext/patch#Get +#define LV2_PATCH__Message LV2_PATCH_PREFIX "Message" ///< http://lv2plug.in/ns/ext/patch#Message +#define LV2_PATCH__Move LV2_PATCH_PREFIX "Move" ///< http://lv2plug.in/ns/ext/patch#Move +#define LV2_PATCH__Patch LV2_PATCH_PREFIX "Patch" ///< http://lv2plug.in/ns/ext/patch#Patch +#define LV2_PATCH__Post LV2_PATCH_PREFIX "Post" ///< http://lv2plug.in/ns/ext/patch#Post +#define LV2_PATCH__Put LV2_PATCH_PREFIX "Put" ///< http://lv2plug.in/ns/ext/patch#Put +#define LV2_PATCH__Request LV2_PATCH_PREFIX "Request" ///< http://lv2plug.in/ns/ext/patch#Request +#define LV2_PATCH__Response LV2_PATCH_PREFIX "Response" ///< http://lv2plug.in/ns/ext/patch#Response +#define LV2_PATCH__Set LV2_PATCH_PREFIX "Set" ///< http://lv2plug.in/ns/ext/patch#Set +#define LV2_PATCH__accept LV2_PATCH_PREFIX "accept" ///< http://lv2plug.in/ns/ext/patch#accept +#define LV2_PATCH__add LV2_PATCH_PREFIX "add" ///< http://lv2plug.in/ns/ext/patch#add +#define LV2_PATCH__body LV2_PATCH_PREFIX "body" ///< http://lv2plug.in/ns/ext/patch#body +#define LV2_PATCH__context LV2_PATCH_PREFIX "context" ///< http://lv2plug.in/ns/ext/patch#context +#define LV2_PATCH__destination LV2_PATCH_PREFIX "destination" ///< http://lv2plug.in/ns/ext/patch#destination +#define LV2_PATCH__property LV2_PATCH_PREFIX "property" ///< http://lv2plug.in/ns/ext/patch#property +#define LV2_PATCH__readable LV2_PATCH_PREFIX "readable" ///< http://lv2plug.in/ns/ext/patch#readable +#define LV2_PATCH__remove LV2_PATCH_PREFIX "remove" ///< http://lv2plug.in/ns/ext/patch#remove +#define LV2_PATCH__request LV2_PATCH_PREFIX "request" ///< http://lv2plug.in/ns/ext/patch#request +#define LV2_PATCH__subject LV2_PATCH_PREFIX "subject" ///< http://lv2plug.in/ns/ext/patch#subject +#define LV2_PATCH__sequenceNumber LV2_PATCH_PREFIX "sequenceNumber" ///< http://lv2plug.in/ns/ext/patch#sequenceNumber +#define LV2_PATCH__value LV2_PATCH_PREFIX "value" ///< http://lv2plug.in/ns/ext/patch#value +#define LV2_PATCH__wildcard LV2_PATCH_PREFIX "wildcard" ///< http://lv2plug.in/ns/ext/patch#wildcard +#define LV2_PATCH__writable LV2_PATCH_PREFIX "writable" ///< http://lv2plug.in/ns/ext/patch#writable + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_PATCH_H */ diff --git a/include/lv2/port-groups/port-groups.h b/include/lv2/port-groups/port-groups.h new file mode 100644 index 0000000..0ff25c7 --- /dev/null +++ b/include/lv2/port-groups/port-groups.h @@ -0,0 +1,77 @@ +/* + 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. +*/ + +#ifndef LV2_PORT_GROUPS_H +#define LV2_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. + + @{ +*/ + +// clang-format off + +#define LV2_PORT_GROUPS_URI "http://lv2plug.in/ns/ext/port-groups" ///< http://lv2plug.in/ns/ext/port-groups +#define LV2_PORT_GROUPS_PREFIX LV2_PORT_GROUPS_URI "#" ///< http://lv2plug.in/ns/ext/port-groups# + +#define LV2_PORT_GROUPS__DiscreteGroup LV2_PORT_GROUPS_PREFIX "DiscreteGroup" ///< http://lv2plug.in/ns/ext/port-groups#DiscreteGroup +#define LV2_PORT_GROUPS__Element LV2_PORT_GROUPS_PREFIX "Element" ///< http://lv2plug.in/ns/ext/port-groups#Element +#define LV2_PORT_GROUPS__FivePointOneGroup LV2_PORT_GROUPS_PREFIX "FivePointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#FivePointOneGroup +#define LV2_PORT_GROUPS__FivePointZeroGroup LV2_PORT_GROUPS_PREFIX "FivePointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#FivePointZeroGroup +#define LV2_PORT_GROUPS__FourPointZeroGroup LV2_PORT_GROUPS_PREFIX "FourPointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#FourPointZeroGroup +#define LV2_PORT_GROUPS__Group LV2_PORT_GROUPS_PREFIX "Group" ///< http://lv2plug.in/ns/ext/port-groups#Group +#define LV2_PORT_GROUPS__InputGroup LV2_PORT_GROUPS_PREFIX "InputGroup" ///< http://lv2plug.in/ns/ext/port-groups#InputGroup +#define LV2_PORT_GROUPS__MidSideGroup LV2_PORT_GROUPS_PREFIX "MidSideGroup" ///< http://lv2plug.in/ns/ext/port-groups#MidSideGroup +#define LV2_PORT_GROUPS__MonoGroup LV2_PORT_GROUPS_PREFIX "MonoGroup" ///< http://lv2plug.in/ns/ext/port-groups#MonoGroup +#define LV2_PORT_GROUPS__OutputGroup LV2_PORT_GROUPS_PREFIX "OutputGroup" ///< http://lv2plug.in/ns/ext/port-groups#OutputGroup +#define LV2_PORT_GROUPS__SevenPointOneGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#SevenPointOneGroup +#define LV2_PORT_GROUPS__SevenPointOneWideGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneWideGroup" ///< http://lv2plug.in/ns/ext/port-groups#SevenPointOneWideGroup +#define LV2_PORT_GROUPS__SixPointOneGroup LV2_PORT_GROUPS_PREFIX "SixPointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#SixPointOneGroup +#define LV2_PORT_GROUPS__StereoGroup LV2_PORT_GROUPS_PREFIX "StereoGroup" ///< http://lv2plug.in/ns/ext/port-groups#StereoGroup +#define LV2_PORT_GROUPS__ThreePointZeroGroup LV2_PORT_GROUPS_PREFIX "ThreePointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#ThreePointZeroGroup +#define LV2_PORT_GROUPS__center LV2_PORT_GROUPS_PREFIX "center" ///< http://lv2plug.in/ns/ext/port-groups#center +#define LV2_PORT_GROUPS__centerLeft LV2_PORT_GROUPS_PREFIX "centerLeft" ///< http://lv2plug.in/ns/ext/port-groups#centerLeft +#define LV2_PORT_GROUPS__centerRight LV2_PORT_GROUPS_PREFIX "centerRight" ///< http://lv2plug.in/ns/ext/port-groups#centerRight +#define LV2_PORT_GROUPS__element LV2_PORT_GROUPS_PREFIX "element" ///< http://lv2plug.in/ns/ext/port-groups#element +#define LV2_PORT_GROUPS__group LV2_PORT_GROUPS_PREFIX "group" ///< http://lv2plug.in/ns/ext/port-groups#group +#define LV2_PORT_GROUPS__left LV2_PORT_GROUPS_PREFIX "left" ///< http://lv2plug.in/ns/ext/port-groups#left +#define LV2_PORT_GROUPS__lowFrequencyEffects LV2_PORT_GROUPS_PREFIX "lowFrequencyEffects" ///< http://lv2plug.in/ns/ext/port-groups#lowFrequencyEffects +#define LV2_PORT_GROUPS__mainInput LV2_PORT_GROUPS_PREFIX "mainInput" ///< http://lv2plug.in/ns/ext/port-groups#mainInput +#define LV2_PORT_GROUPS__mainOutput LV2_PORT_GROUPS_PREFIX "mainOutput" ///< http://lv2plug.in/ns/ext/port-groups#mainOutput +#define LV2_PORT_GROUPS__rearCenter LV2_PORT_GROUPS_PREFIX "rearCenter" ///< http://lv2plug.in/ns/ext/port-groups#rearCenter +#define LV2_PORT_GROUPS__rearLeft LV2_PORT_GROUPS_PREFIX "rearLeft" ///< http://lv2plug.in/ns/ext/port-groups#rearLeft +#define LV2_PORT_GROUPS__rearRight LV2_PORT_GROUPS_PREFIX "rearRight" ///< http://lv2plug.in/ns/ext/port-groups#rearRight +#define LV2_PORT_GROUPS__right LV2_PORT_GROUPS_PREFIX "right" ///< http://lv2plug.in/ns/ext/port-groups#right +#define LV2_PORT_GROUPS__side LV2_PORT_GROUPS_PREFIX "side" ///< http://lv2plug.in/ns/ext/port-groups#side +#define LV2_PORT_GROUPS__sideChainOf LV2_PORT_GROUPS_PREFIX "sideChainOf" ///< http://lv2plug.in/ns/ext/port-groups#sideChainOf +#define LV2_PORT_GROUPS__sideLeft LV2_PORT_GROUPS_PREFIX "sideLeft" ///< http://lv2plug.in/ns/ext/port-groups#sideLeft +#define LV2_PORT_GROUPS__sideRight LV2_PORT_GROUPS_PREFIX "sideRight" ///< http://lv2plug.in/ns/ext/port-groups#sideRight +#define LV2_PORT_GROUPS__source LV2_PORT_GROUPS_PREFIX "source" ///< http://lv2plug.in/ns/ext/port-groups#source +#define LV2_PORT_GROUPS__subGroupOf LV2_PORT_GROUPS_PREFIX "subGroupOf" ///< http://lv2plug.in/ns/ext/port-groups#subGroupOf + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_PORT_GROUPS_H */ diff --git a/include/lv2/port-props/port-props.h b/include/lv2/port-props/port-props.h new file mode 100644 index 0000000..ff4adcd --- /dev/null +++ b/include/lv2/port-props/port-props.h @@ -0,0 +1,53 @@ +/* + 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. +*/ + +#ifndef LV2_PORT_PROPS_H +#define LV2_PORT_PROPS_H + +/** + @defgroup port-props Port Properties + @ingroup lv2 + + Various port properties. + + @{ +*/ + +// clang-format off + +#define LV2_PORT_PROPS_URI "http://lv2plug.in/ns/ext/port-props" ///< http://lv2plug.in/ns/ext/port-props +#define LV2_PORT_PROPS_PREFIX LV2_PORT_PROPS_URI "#" ///< http://lv2plug.in/ns/ext/port-props# + +#define LV2_PORT_PROPS__causesArtifacts LV2_PORT_PROPS_PREFIX "causesArtifacts" ///< http://lv2plug.in/ns/ext/port-props#causesArtifacts +#define LV2_PORT_PROPS__continuousCV LV2_PORT_PROPS_PREFIX "continuousCV" ///< http://lv2plug.in/ns/ext/port-props#continuousCV +#define LV2_PORT_PROPS__discreteCV LV2_PORT_PROPS_PREFIX "discreteCV" ///< http://lv2plug.in/ns/ext/port-props#discreteCV +#define LV2_PORT_PROPS__displayPriority LV2_PORT_PROPS_PREFIX "displayPriority" ///< http://lv2plug.in/ns/ext/port-props#displayPriority +#define LV2_PORT_PROPS__expensive LV2_PORT_PROPS_PREFIX "expensive" ///< http://lv2plug.in/ns/ext/port-props#expensive +#define LV2_PORT_PROPS__hasStrictBounds LV2_PORT_PROPS_PREFIX "hasStrictBounds" ///< http://lv2plug.in/ns/ext/port-props#hasStrictBounds +#define LV2_PORT_PROPS__logarithmic LV2_PORT_PROPS_PREFIX "logarithmic" ///< http://lv2plug.in/ns/ext/port-props#logarithmic +#define LV2_PORT_PROPS__notAutomatic LV2_PORT_PROPS_PREFIX "notAutomatic" ///< http://lv2plug.in/ns/ext/port-props#notAutomatic +#define LV2_PORT_PROPS__notOnGUI LV2_PORT_PROPS_PREFIX "notOnGUI" ///< http://lv2plug.in/ns/ext/port-props#notOnGUI +#define LV2_PORT_PROPS__rangeSteps LV2_PORT_PROPS_PREFIX "rangeSteps" ///< http://lv2plug.in/ns/ext/port-props#rangeSteps +#define LV2_PORT_PROPS__supportsStrictBounds LV2_PORT_PROPS_PREFIX "supportsStrictBounds" ///< http://lv2plug.in/ns/ext/port-props#supportsStrictBounds +#define LV2_PORT_PROPS__trigger LV2_PORT_PROPS_PREFIX "trigger" ///< http://lv2plug.in/ns/ext/port-props#trigger + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_PORT_PROPS_H */ diff --git a/include/lv2/presets/presets.h b/include/lv2/presets/presets.h new file mode 100644 index 0000000..716ab32 --- /dev/null +++ b/include/lv2/presets/presets.h @@ -0,0 +1,48 @@ +/* + 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. +*/ + +#ifndef LV2_PRESETS_H +#define LV2_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_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..a3a11c4 --- /dev/null +++ b/include/lv2/resize-port/resize-port.h @@ -0,0 +1,89 @@ +/* + Copyright 2007-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. +*/ + +#ifndef LV2_RESIZE_PORT_H +#define LV2_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_H */ diff --git a/include/lv2/state/state.h b/include/lv2/state/state.h new file mode 100644 index 0000000..01ec598 --- /dev/null +++ b/include/lv2/state/state.h @@ -0,0 +1,392 @@ +/* + Copyright 2010-2016 David Robillard <d@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. +*/ + +#ifndef LV2_STATE_H +#define LV2_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_H */ diff --git a/include/lv2/time/time.h b/include/lv2/time/time.h new file mode 100644 index 0000000..1dce219 --- /dev/null +++ b/include/lv2/time/time.h @@ -0,0 +1,59 @@ +/* + 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. +*/ + +#ifndef LV2_TIME_H +#define LV2_TIME_H + +/** + @defgroup time Time + @ingroup lv2 + + Properties for describing time. + + Note the time extension is purely data, this header merely defines URIs for + convenience. + + See <http://lv2plug.in/ns/ext/time> for details. + + @{ +*/ + +// clang-format off + +#define LV2_TIME_URI "http://lv2plug.in/ns/ext/time" ///< http://lv2plug.in/ns/ext/time +#define LV2_TIME_PREFIX LV2_TIME_URI "#" ///< http://lv2plug.in/ns/ext/time# + +#define LV2_TIME__Time LV2_TIME_PREFIX "Time" ///< http://lv2plug.in/ns/ext/time#Time +#define LV2_TIME__Position LV2_TIME_PREFIX "Position" ///< http://lv2plug.in/ns/ext/time#Position +#define LV2_TIME__Rate LV2_TIME_PREFIX "Rate" ///< http://lv2plug.in/ns/ext/time#Rate +#define LV2_TIME__position LV2_TIME_PREFIX "position" ///< http://lv2plug.in/ns/ext/time#position +#define LV2_TIME__barBeat LV2_TIME_PREFIX "barBeat" ///< http://lv2plug.in/ns/ext/time#barBeat +#define LV2_TIME__bar LV2_TIME_PREFIX "bar" ///< http://lv2plug.in/ns/ext/time#bar +#define LV2_TIME__beat LV2_TIME_PREFIX "beat" ///< http://lv2plug.in/ns/ext/time#beat +#define LV2_TIME__beatUnit LV2_TIME_PREFIX "beatUnit" ///< http://lv2plug.in/ns/ext/time#beatUnit +#define LV2_TIME__beatsPerBar LV2_TIME_PREFIX "beatsPerBar" ///< http://lv2plug.in/ns/ext/time#beatsPerBar +#define LV2_TIME__beatsPerMinute LV2_TIME_PREFIX "beatsPerMinute" ///< http://lv2plug.in/ns/ext/time#beatsPerMinute +#define LV2_TIME__frame LV2_TIME_PREFIX "frame" ///< http://lv2plug.in/ns/ext/time#frame +#define LV2_TIME__framesPerSecond LV2_TIME_PREFIX "framesPerSecond" ///< http://lv2plug.in/ns/ext/time#framesPerSecond +#define LV2_TIME__speed LV2_TIME_PREFIX "speed" ///< http://lv2plug.in/ns/ext/time#speed + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_TIME_H */ diff --git a/include/lv2/ui/ui.h b/include/lv2/ui/ui.h new file mode 100644 index 0000000..fb41d90 --- /dev/null +++ b/include/lv2/ui/ui.h @@ -0,0 +1,543 @@ +/* + 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. +*/ + +#ifndef LV2_UI_H +#define LV2_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_H */ diff --git a/include/lv2/units/units.h b/include/lv2/units/units.h new file mode 100644 index 0000000..09ae16b --- /dev/null +++ b/include/lv2/units/units.h @@ -0,0 +1,75 @@ +/* + 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. +*/ + +#ifndef LV2_UNITS_H +#define LV2_UNITS_H + +/** + @defgroup units Units + @ingroup lv2 + + Units for LV2 values. + + See <http://lv2plug.in/ns/extensions/units> for details. + + @{ +*/ + +// clang-format off + +#define LV2_UNITS_URI "http://lv2plug.in/ns/extensions/units" ///< http://lv2plug.in/ns/extensions/units +#define LV2_UNITS_PREFIX LV2_UNITS_URI "#" ///< http://lv2plug.in/ns/extensions/units# + +#define LV2_UNITS__Conversion LV2_UNITS_PREFIX "Conversion" ///< http://lv2plug.in/ns/extensions/units#Conversion +#define LV2_UNITS__Unit LV2_UNITS_PREFIX "Unit" ///< http://lv2plug.in/ns/extensions/units#Unit +#define LV2_UNITS__bar LV2_UNITS_PREFIX "bar" ///< http://lv2plug.in/ns/extensions/units#bar +#define LV2_UNITS__beat LV2_UNITS_PREFIX "beat" ///< http://lv2plug.in/ns/extensions/units#beat +#define LV2_UNITS__bpm LV2_UNITS_PREFIX "bpm" ///< http://lv2plug.in/ns/extensions/units#bpm +#define LV2_UNITS__cent LV2_UNITS_PREFIX "cent" ///< http://lv2plug.in/ns/extensions/units#cent +#define LV2_UNITS__cm LV2_UNITS_PREFIX "cm" ///< http://lv2plug.in/ns/extensions/units#cm +#define LV2_UNITS__coef LV2_UNITS_PREFIX "coef" ///< http://lv2plug.in/ns/extensions/units#coef +#define LV2_UNITS__conversion LV2_UNITS_PREFIX "conversion" ///< http://lv2plug.in/ns/extensions/units#conversion +#define LV2_UNITS__db LV2_UNITS_PREFIX "db" ///< http://lv2plug.in/ns/extensions/units#db +#define LV2_UNITS__degree LV2_UNITS_PREFIX "degree" ///< http://lv2plug.in/ns/extensions/units#degree +#define LV2_UNITS__frame LV2_UNITS_PREFIX "frame" ///< http://lv2plug.in/ns/extensions/units#frame +#define LV2_UNITS__hz LV2_UNITS_PREFIX "hz" ///< http://lv2plug.in/ns/extensions/units#hz +#define LV2_UNITS__inch LV2_UNITS_PREFIX "inch" ///< http://lv2plug.in/ns/extensions/units#inch +#define LV2_UNITS__khz LV2_UNITS_PREFIX "khz" ///< http://lv2plug.in/ns/extensions/units#khz +#define LV2_UNITS__km LV2_UNITS_PREFIX "km" ///< http://lv2plug.in/ns/extensions/units#km +#define LV2_UNITS__m LV2_UNITS_PREFIX "m" ///< http://lv2plug.in/ns/extensions/units#m +#define LV2_UNITS__mhz LV2_UNITS_PREFIX "mhz" ///< http://lv2plug.in/ns/extensions/units#mhz +#define LV2_UNITS__midiNote LV2_UNITS_PREFIX "midiNote" ///< http://lv2plug.in/ns/extensions/units#midiNote +#define LV2_UNITS__mile LV2_UNITS_PREFIX "mile" ///< http://lv2plug.in/ns/extensions/units#mile +#define LV2_UNITS__min LV2_UNITS_PREFIX "min" ///< http://lv2plug.in/ns/extensions/units#min +#define LV2_UNITS__mm LV2_UNITS_PREFIX "mm" ///< http://lv2plug.in/ns/extensions/units#mm +#define LV2_UNITS__ms LV2_UNITS_PREFIX "ms" ///< http://lv2plug.in/ns/extensions/units#ms +#define LV2_UNITS__name LV2_UNITS_PREFIX "name" ///< http://lv2plug.in/ns/extensions/units#name +#define LV2_UNITS__oct LV2_UNITS_PREFIX "oct" ///< http://lv2plug.in/ns/extensions/units#oct +#define LV2_UNITS__pc LV2_UNITS_PREFIX "pc" ///< http://lv2plug.in/ns/extensions/units#pc +#define LV2_UNITS__prefixConversion LV2_UNITS_PREFIX "prefixConversion" ///< http://lv2plug.in/ns/extensions/units#prefixConversion +#define LV2_UNITS__render LV2_UNITS_PREFIX "render" ///< http://lv2plug.in/ns/extensions/units#render +#define LV2_UNITS__s LV2_UNITS_PREFIX "s" ///< http://lv2plug.in/ns/extensions/units#s +#define LV2_UNITS__semitone12TET LV2_UNITS_PREFIX "semitone12TET" ///< http://lv2plug.in/ns/extensions/units#semitone12TET +#define LV2_UNITS__symbol LV2_UNITS_PREFIX "symbol" ///< http://lv2plug.in/ns/extensions/units#symbol +#define LV2_UNITS__unit LV2_UNITS_PREFIX "unit" ///< http://lv2plug.in/ns/extensions/units#unit + +// clang-format on + +/** + @} +*/ + +#endif /* LV2_UNITS_H */ diff --git a/include/lv2/uri-map/uri-map.h b/include/lv2/uri-map/uri-map.h new file mode 100644 index 0000000..47cde1c --- /dev/null +++ b/include/lv2/uri-map/uri-map.h @@ -0,0 +1,121 @@ +/* + Copyright 2008-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. +*/ + +#ifndef LV2_URI_MAP_H +#define LV2_URI_MAP_H + +/** + @defgroup uri-map URI Map + @ingroup lv2 + + A feature for mapping URIs to integers. + + This extension defines a simple mechanism for plugins to map URIs to + integers, usually for performance reasons (e.g. processing events typed by + URIs in real time). The expected use case is for plugins to map URIs to + integers for things they 'understand' at instantiation time, and store those + values for use in the audio thread without doing any string comparison. + This allows the extensibility of RDF with the performance of integers (or + centrally defined enumerations). + + See <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_H */ diff --git a/include/lv2/urid/urid.h b/include/lv2/urid/urid.h new file mode 100644 index 0000000..b537d14 --- /dev/null +++ b/include/lv2/urid/urid.h @@ -0,0 +1,140 @@ +/* + Copyright 2008-2016 David Robillard <d@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. +*/ + +#ifndef LV2_URID_H +#define LV2_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_H */ diff --git a/include/lv2/worker/worker.h b/include/lv2/worker/worker.h new file mode 100644 index 0000000..4fd89f9 --- /dev/null +++ b/include/lv2/worker/worker.h @@ -0,0 +1,183 @@ +/* + 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. +*/ + +#ifndef LV2_WORKER_H +#define LV2_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_H */ diff --git a/lv2/atom.lv2/atom.meta.ttl b/lv2/atom.lv2/atom.meta.ttl new file mode 100644 index 0000000..adab5f4 --- /dev/null +++ b/lv2/atom.lv2/atom.meta.ttl @@ -0,0 +1,552 @@ +@prefix atom: <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#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/atom> + a doap:Project ; + doap:name "LV2 Atom" ; + doap:shortdesc "A generic value container and several data types." ; + doap:license <http://opensource.org/licenses/isc> ; + doap:created "2007-00-00" ; + doap:developer <http://drobilla.net/drobilla#me> ; + doap:release [ + doap:revision "2.4" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + 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 +Old Data (POD). An Atom can contain simple primitive types like integers, +floating point numbers, and strings; as well as structured data like lists and +dictionary-like <q>Objects</q>. Since Atoms are POD, they can be easily copied +(for example, with `memcpy()`) anywhere and are suitable for use in real-time +code. + +Every atom starts with an LV2_Atom header, followed by the contents. This +allows code to process atoms without requiring special code for every type of +data. For example, plugins that mutually understand a type can be used +together in a host that does not understand that type, because the host is only +required to copy atoms, not interpret their contents. Similarly, plugins (such +as routers, delays, or data structures) can meaningfully process atoms of a +type unknown to them. + +Atoms should be used anywhere values of various types must be stored or +transmitted. An atom:AtomPort can be used to transmit atoms via ports. An +atom:AtomPort that contains a atom:Sequence can be used for sample accurate +communication of events, such as MIDI. + +### Serialisation + +Each Atom type defines a binary format for use at runtime, but also a +serialisation that is natural to express in Turtle format. Thus, this +specification defines a powerful real-time appropriate data model, as well as a +portable way to serialise any data in that model. This is particularly useful +for inter-process communication, saving/restoring state, and describing values +in plugin data files. + +### Custom Atom Types + +While it is possible to define new Atom types for any binary format, the +standard types defined here are powerful enough to describe almost anything. +Implementations SHOULD build structures out of the types provided here, rather +than define new binary formats (for example, using atom:Object rather than a +new C `struct` type). Host and tool implementations have support for +serialising all standard types, so new binary formats are an implementation +burden which harms interoperabilty. In particular, plugins SHOULD NOT expect +UI communication or state saving with custom binary types to work. In general, +new Atom types should only be defined where absolutely necessary due to +performance reasons and serialisation is not a concern. + +"""^^lv2:Markdown . + +atom:Atom + lv2:documentation """ + +An LV2_Atom has a 32-bit `size` and `type`, followed by a body of `size` bytes. +Atoms MUST be 64-bit aligned. + +All concrete Atom types (subclasses of this class) MUST define a precise binary +layout for their body. + +The `type` field is the URI of an Atom type mapped to an integer. +Implementations SHOULD gracefully pass through, or ignore, atoms with unknown +types. + +All atoms are POD by definition except references, which as a special case have +`type` 0. An Atom MUST NOT contain a Reference. It is safe to copy any +non-reference Atom with a simple `memcpy`, even if the implementation does not +understand `type`. Though this extension reserves the type 0 for references, +the details of reference handling are currently unspecified. A future revision +of this extension, or a different extension, may define how to use non-POD data +and references. Implementations MUST NOT send references to another +implementation unless the receiver is explicitly known to support references +(e.g. by supporting a feature). + +The special case of a null atom with both `type` and `size` 0 is not considered +a reference. + +"""^^lv2:Markdown . + +atom:Chunk + lv2:documentation """ + +This type is used to indicate a certain amount of space is available. For +example, output ports with a variably sized type are connected to a Chunk so +the plugin knows the size of the buffer available for writing. + +The use of a Chunk should be constrained to a local scope, since +interpreting it is impossible without context. However, if serialised to RDF, +a Chunk may be represented directly as an xsd:base64Binary string, for example: + + :::turtle + [] eg:someChunk "vu/erQ=="^^xsd:base64Binary . + +"""^^lv2:Markdown . + +atom:String + lv2:documentation """ + +The body of an LV2_Atom_String is a C string in UTF-8 encoding, i.e. an array +of bytes (`uint8_t`) terminated with a NULL byte (`'\\0'`). + +This type is for free-form strings, but SHOULD NOT be used for typed data or +text in any language. Use atom:Literal unless translating the string does not +make sense and the string has no meaningful datatype. + +"""^^lv2:Markdown . + +atom:Literal + lv2:documentation """ + +This type is compatible with rdfs:Literal and is capable of expressing a +string in any language or a value of any type. A Literal has a +`datatype` and `lang` followed by string data in UTF-8 +encoding. The length of the string data in bytes is `size - +sizeof(LV2_Atom_Literal)`, including the terminating NULL character. The +`lang` field SHOULD be a URI of the form +`http://lexvo.org/id/iso639-3/LANG` or +`http://lexvo.org/id/iso639-1/LANG` where LANG is a 3-character ISO 693-3 +language code, or a 2-character ISO 693-1 language code, respectively. + +A Literal may have a `datatype` or a `lang`, but never both. + +For example, a Literal can be <q>Hello</q> in English: + + :::c + void set_to_hello_in_english(LV2_Atom_Literal* lit) { + lit->atom.type = map(expand("atom:Literal")); + lit->atom.size = 14; + lit->body.datatype = 0; + lit->body.lang = map("http://lexvo.org/id/iso639-1/en"); + memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit), + "Hello", + sizeof("Hello")); // Assumes enough space + } + +or a Turtle string: + + :::c + void set_to_turtle_string(LV2_Atom_Literal* lit, const char* ttl) { + lit->atom.type = map(expand("atom:Literal")); + lit->atom.size = 64; + lit->body.datatype = map("http://www.w3.org/2008/turtle#turtle"); + lit->body.lang = 0; + memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit), + ttl, + strlen(ttl) + 1); // Assumes enough space + } + +"""^^lv2:Markdown . + +atom:Path + lv2:documentation """ + +A Path is a URI reference with only a path component: no scheme, authority, +query, or fragment. In particular, paths to files in the same bundle may be +cleanly written in Turtle files as a relative URI. However, implementations +may assume any binary Path (e.g. in an event payload) is a valid file path +which can passed to system functions like fopen() directly, without any +character encoding or escape expansion required. + +Any implementation that creates a Path atom to transmit to another is +responsible for ensuring it is valid. A Path SHOULD always be absolute, unless +there is some mechanism in place that defines a base path. Since this is not +the case for plugin instances, effectively any Path sent to or received from a +plugin instance MUST be absolute. + +"""^^lv2:Markdown . + +atom:URI + lv2:documentation """ + +This is useful when a URI is needed but mapping is inappropriate, for example +with temporary or relative URIs. Since the ability to distinguish URIs from +plain strings is often necessary, URIs MUST NOT be transmitted as atom:String. + +This is not strictly a URI, since UTF-8 is allowed. Escaping and related +issues are the host's responsibility. + +"""^^lv2:Markdown . + +atom:URID + lv2:documentation """ + +A URID is typically generated with the LV2_URID_Map provided by the host . + +"""^^lv2:Markdown . + +atom:Vector + lv2:documentation """ + +A homogeneous series of atom bodies with equivalent type and size. + +An LV2_Atom_Vector is a 32-bit `child_size` and `child_type` followed by `size +/ child_size` atom bodies. + +For example, an atom:Vector containing 42 elements of type atom:Float: + + :::c + struct VectorOf42Floats { + uint32_t size; // sizeof(LV2_Atom_Vector_Body) + (42 * sizeof(float); + uint32_t type; // map(expand("atom:Vector")) + uint32_t child_size; // sizeof(float) + uint32_t child_type; // map(expand("atom:Float")) + float elems[42]; + }; + +Note that it is possible to construct a valid Atom for each element of the +vector, even by an implementation which does not understand `child_type`. + +If serialised to RDF, a Vector SHOULD have the form: + + :::turtle + eg:someVector + a atom:Vector ; + atom:childType atom:Int ; + rdf:value ( + "1"^^xsd:int + "2"^^xsd:int + "3"^^xsd:int + "4"^^xsd:int + ) . + +"""^^lv2:Markdown . + +atom:Tuple + lv2:documentation """ + +The body of a Tuple is simply a series of complete atoms, each aligned to +64 bits. + +If serialised to RDF, a Tuple SHOULD have the form: + + :::turtle + eg:someVector + a atom:Tuple ; + rdf:value ( + "1"^^xsd:int + "3.5"^^xsd:float + "etc" + ) . + +"""^^lv2:Markdown . + +atom:Property + lv2:documentation """ + +An LV2_Atom_Property has a URID `key` and `context`, and an Atom `value`. This +corresponds to an RDF Property, where the <q>key</q> is the <q>predicate</q> +and the <q>value</q> is the object. + +The `context` field can be used to specify a different context for each +property, where this is useful. Otherwise, it may be 0. + +Properties generally only exist as part of an atom:Object. Accordingly, +they will typically be represented directly as properties in RDF (see +atom:Object). If this is not possible, they may be expressed as partial +reified statements, for example: + + :::turtle + eg:someProperty + rdf:predicate eg:theKey ; + rdf:object eg:theValue . + +"""^^lv2:Markdown . + +atom:Object + lv2:documentation """ + +An <q>Object</q> is an atom with a set of properties. This corresponds to an +RDF Resource, and can be thought of as a dictionary with URID keys. + +An LV2_Atom_Object body has a uint32_t `id` and `type`, followed by a series of +atom:Property bodies (LV2_Atom_Property_Body). The LV2_Atom_Object_Body::otype +field is equivalent to a property with key rdf:type, but is included in the +structure to allow for fast dispatching. + +Code SHOULD check for objects using lv2_atom_forge_is_object() or +lv2_atom_forge_is_blank() if a forge is available, rather than checking the +atom type directly. This will correctly handle the deprecated atom:Resource +and atom:Blank types. + +When serialised to RDF, an Object is represented as a resource, for example: + + :::turtle + eg:someObject + eg:firstPropertyKey "first property value" ; + eg:secondPropertyKey "first loser" ; + eg:andSoOn "and so on" . + +"""^^lv2:Markdown . + +atom:Resource + lv2:documentation """ + +This class is deprecated. Use atom:Object directly instead. + +An atom:Object where the <code>id</code> field is a URID, that is, an Object +with a URI. + +"""^^lv2:Markdown . + +atom:Blank + lv2:documentation """ + +This class is deprecated. Use atom:Object with ID 0 instead. + +An atom:Object where the LV2_Atom_Object::id is a blank node ID (NOT a URI). +The ID of a Blank is valid only within the context the Blank appears in. For +ports this is the context of the associated run() call, i.e. all ports share +the same context so outputs can contain IDs that correspond to IDs of blanks in +the input. + +"""^^lv2:Markdown . + +atom:Sound + lv2:documentation """ + +The format of a atom:Sound is the same as the buffer format for lv2:AudioPort +(except the size may be arbitrary). An atom:Sound inherently depends on the +sample rate, which is assumed to be known from context. Because of this, +directly serialising an atom:Sound is probably a bad idea, use a standard +format like WAV instead. + +"""^^lv2:Markdown . + +atom:Event + lv2:documentation """ + +An Event is typically an element of an atom:Sequence. Note that this is not an Atom type since it begins with a timestamp, not an atom header. + +"""^^lv2:Markdown . + +atom:Sequence + lv2:documentation """ + +A flat sequence of atom:Event, that is, a series of time-stamped Atoms. + +LV2_Atom_Sequence_Body.unit describes the time unit for the contained atoms. +If the unit is known from context (e.g. run() stamps are always audio frames), +this field may be zero. Otherwise, it SHOULD be either units:frame or +units:beat, in which case ev.time.frames or ev.time.beats is valid, +respectively. + +If serialised to RDF, a Sequence has a similar form to atom:Vector, but for +brevity the elements may be assumed to be atom:Event, for example: + + :::turtle + eg:someSequence + a atom:Sequence ; + rdf:value ( + [ + atom:frameTime 1 ; + rdf:value "901A01"^^midi:MidiEvent + ] [ + atom:frameTime 3 ; + rdf:value "902B02"^^midi:MidiEvent + ] + ) . + +"""^^lv2:Markdown . + +atom:AtomPort + lv2:documentation """ + +Ports of this type are connected to an LV2_Atom with a type specified by +atom:bufferType. + +Output ports with a variably sized type MUST be initialised by the host before +every run() to an atom:Chunk with size set to the available space. The plugin +reads this size to know how much space is available for writing. In all cases, +the plugin MUST write a complete atom (including header) to outputs. However, +to be robust, hosts SHOULD initialise output ports to a safe sentinel (e.g. the +null Atom) before calling run(). + +"""^^lv2:Markdown . + +atom:bufferType + lv2:documentation """ + +Indicates that an AtomPort may be connected to a certain Atom type. A port MAY +support several buffer types. The host MUST NOT connect a port to an Atom with +a type not explicitly listed with this property. The value of this property +MUST be a sub-class of atom:Atom. For example, an input port that is connected +directly to an LV2_Atom_Double value is described like so: + + :::turtle + <plugin> + lv2:port [ + a lv2:InputPort , atom:AtomPort ; + atom:bufferType atom:Double ; + ] . + +This property only describes the types a port may be directly connected to. It +says nothing about the expected contents of containers. For that, use +atom:supports. + +"""^^lv2:Markdown . + +atom:supports + lv2:documentation """ + +This property is defined loosely, it may be used to indicate that anything +<q>supports</q> an Atom type, wherever that may be useful. It applies +<q>recursively</q> where collections are involved. + +In particular, this property can be used to describe which event types are +expected by a port. For example, a port that receives MIDI events is described +like so: + + :::turtle + <plugin> + lv2:port [ + a lv2:InputPort , atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports midi:MidiEvent ; + ] . + +"""^^lv2:Markdown . + +atom:eventTransfer + lv2:documentation """ + +Transfer of individual events in a port buffer. Useful as the `format` for a +LV2UI_Write_Function. + +This protocol applies to ports which contain events, usually in an +atom:Sequence. The host must transfer each individual event to the recipient. +The format of the received data is an LV2_Atom, there is no timestamp header. + +"""^^lv2:Markdown . + +atom:atomTransfer + lv2:documentation """ + +Transfer of the complete atom in a port buffer. Useful as the `format` for a +LV2UI_Write_Function. + +This protocol applies to atom ports. The host must transfer the complete atom +contained in the port, including header. + +"""^^lv2:Markdown . + diff --git a/lv2/atom.lv2/atom.ttl b/lv2/atom.lv2/atom.ttl new file mode 100644 index 0000000..bdeaebf --- /dev/null +++ b/lv2/atom.lv2/atom.ttl @@ -0,0 +1,247 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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 ui: <http://lv2plug.in/ns/extensions/ui#> . +@prefix units: <http://lv2plug.in/ns/extensions/units#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/ns/ext/atom> + a owl:Ontology ; + rdfs:seeAlso <atom.meta.ttl> ; + rdfs:label "LV2 Atom" ; + 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 , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "C type" ; + rdfs:comment "The C type that describes the binary representation of an Atom type." ; + rdfs:domain rdfs:Class ; + rdfs:range lv2:Symbol . + +atom:Atom + a rdfs:Class ; + rdfs:label "Atom" ; + rdfs:comment "Abstract base class for all atoms." ; + atom:cType "LV2_Atom" . + +atom:Chunk + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Chunk" ; + rdfs:comment "A chunk of memory with undefined contents." ; + owl:onDatatype xsd:base64Binary . + +atom:Number + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Number" ; + rdfs:comment "Base class for numeric types." . + +atom:Int + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Int" ; + rdfs:comment "A native `int32_t`." ; + atom:cType "LV2_Atom_Int" ; + owl:onDatatype xsd:int . + +atom:Long + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Long" ; + rdfs:comment "A native `int64_t`." ; + atom:cType "LV2_Atom_Long" ; + owl:onDatatype xsd:long . + +atom:Float + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Float" ; + rdfs:comment "A native `float`." ; + atom:cType "LV2_Atom_Float" ; + owl:onDatatype xsd:float . + +atom:Double + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Number ; + rdfs:label "Double" ; + rdfs:comment "A native `double`." ; + atom:cType "LV2_Atom_Double" ; + owl:onDatatype xsd:double . + +atom:Bool + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Bool" ; + rdfs:comment "An atom:Int where 0 is false and any other value is true." ; + atom:cType "LV2_Atom_Bool" ; + owl:onDatatype xsd:boolean . + +atom:String + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:Atom ; + rdfs:label "String" ; + rdfs:comment "A UTF-8 string." ; + atom:cType "LV2_Atom_String" ; + owl:onDatatype xsd:string . + +atom:Literal + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Literal" ; + rdfs:comment "A UTF-8 string literal with optional datatype or language." ; + atom:cType "LV2_Atom_Literal" . + +atom:Path + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:URI ; + owl:onDatatype atom:URI ; + rdfs:label "Path" ; + rdfs:comment "A local file path." . + +atom:URI + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf atom:String ; + owl:onDatatype xsd:anyURI ; + rdfs:label "URI" ; + rdfs:comment "A URI string." . + +atom:URID + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "URID" ; + rdfs:comment "An unsigned 32-bit integer ID for a URI." ; + atom:cType "LV2_Atom_URID" . + +atom:Vector + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Vector" ; + rdfs:comment "A homogeneous sequence of atom bodies with equivalent type and size." ; + atom:cType "LV2_Atom_Vector" . + +atom:Tuple + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Tuple" ; + rdfs:comment "A sequence of atoms with varying type and size." . + +atom:Property + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Property" ; + rdfs:comment "A property of an atom:Object." ; + atom:cType "LV2_Atom_Property" . + +atom:Object + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Object" ; + rdfs:comment "A collection of properties." ; + atom:cType "LV2_Atom_Object" . + +atom:Resource + a rdfs:Class ; + rdfs:subClassOf atom:Object ; + rdfs:label "Resource" ; + rdfs:comment "A named collection of properties with a URI." ; + owl:deprecated "true"^^xsd:boolean ; + atom:cType "LV2_Atom_Object" . + +atom:Blank + a rdfs:Class ; + rdfs:subClassOf atom:Object ; + rdfs:label "Blank" ; + rdfs:comment "An anonymous collection of properties without a URI." ; + owl:deprecated "true"^^xsd:boolean ; + atom:cType "LV2_Atom_Object" . + +atom:Sound + a rdfs:Class ; + rdfs:subClassOf atom:Vector ; + rdfs:label "Sound" ; + rdfs:comment "A atom:Vector of atom:Float which represents an audio waveform." ; + atom:cType "LV2_Atom_Vector" . + +atom:frameTime + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:range xsd:decimal ; + rdfs:label "frame time" ; + rdfs:comment "A time stamp in audio frames." . + +atom:beatTime + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:range xsd:decimal ; + rdfs:label "beat time" ; + rdfs:comment "A time stamp in beats." . + +atom:Event + a rdfs:Class ; + rdfs:label "Event" ; + atom:cType "LV2_Atom_Event" ; + rdfs:comment "An atom with a time stamp prefix in a sequence." . + +atom:Sequence + a rdfs:Class ; + rdfs:subClassOf atom:Atom ; + rdfs:label "Sequence" ; + atom:cType "LV2_Atom_Sequence" ; + rdfs:comment "A sequence of events." . + +atom:AtomPort + a rdfs:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Atom Port" ; + rdfs:comment "A port which contains an atom:Atom." . + +atom:bufferType + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain atom:AtomPort ; + rdfs:range rdfs:Class ; + rdfs:label "buffer type" ; + rdfs:comment "An atom type that a port may be connected to." . + +atom:childType + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "child type" ; + rdfs:comment "The type of children in a container." . + +atom:supports + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "supports" ; + rdfs:comment "A supported atom type." ; + rdfs:range rdfs:Class . + +atom:eventTransfer + a ui:PortProtocol ; + rdfs:label "event transfer" ; + rdfs:comment "A port protocol for transferring events." . + +atom:atomTransfer + a ui:PortProtocol ; + rdfs:label "atom transfer" ; + rdfs:comment "A port protocol for transferring atoms." . + diff --git a/ext/atom.lv2/manifest.ttl b/lv2/atom.lv2/manifest.ttl index 65a4e6e..3cb5134 100644 --- a/ext/atom.lv2/manifest.ttl +++ b/lv2/atom.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/atom> a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 4 ; rdfs:seeAlso <atom.ttl> . diff --git a/lv2/buf-size.lv2/buf-size.meta.ttl b/lv2/buf-size.lv2/buf-size.meta.ttl new file mode 100644 index 0000000..b1d8011 --- /dev/null +++ b/lv2/buf-size.lv2/buf-size.meta.ttl @@ -0,0 +1,157 @@ +@prefix bufsz: <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#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/buf-size> + a doap:Project ; + doap:name "LV2 Buf Size" ; + 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 +block length (the sample_count parameter of LV2_Descriptor::run) and port +buffer sizes, as well as several features which can be used to restrict the +block length. + +This extension defines features and properties but has no special purpose +API of its own. The host provides all the relevant information to the plugin +as [options](options.html). + +To require restrictions on the block length, plugins can require additional +features: bufsz:boundedBlockLength, bufsz:powerOf2BlockLength, and +bufsz:fixedBlockLength. These features are data-only, that is they merely +indicate a restriction and do not carry any data or API. + +"""^^lv2:Markdown . + +bufsz:boundedBlockLength + lv2:documentation """ + +A feature that indicates the host will provide both the bufsz:minBlockLength +and bufsz:maxBlockLength options to the plugin. Plugins that copy data from +audio inputs can require this feature to ensure they know how much space is +required for auxiliary buffers. Note the minimum may be zero, this feature is +mainly useful to ensure a maximum is available. + +All hosts SHOULD support this feature, since it is simple to support and +necessary for any plugins that may need to copy the input. + +"""^^lv2:Markdown . + +bufsz:fixedBlockLength + lv2:documentation """ + +A feature that indicates the host will always call LV2_Descriptor::run() with +the same value for sample_count. This length MUST be provided as the value of +both the bufsz:minBlockLength and bufsz:maxBlockLength options. + +Note that requiring this feature may severely limit the number of hosts capable +of running the plugin. + +"""^^lv2:Markdown . + +bufsz:powerOf2BlockLength + lv2:documentation """ + +A feature that indicates the host will always call LV2_Descriptor::run() with a +power of two sample_count. Note that this feature does not guarantee the value +is the same each call, to guarantee a fixed power of two block length plugins +must require both this feature and bufsz:fixedBlockLength. + +Note that requiring this feature may severely limit the number of hosts capable +of running the plugin. + +"""^^lv2:Markdown . + +bufsz:coarseBlockLength + lv2:documentation """ + +A feature that indicates the plugin prefers coarse, regular block lengths. For +example, plugins that do not implement sample-accurate control use this feature +to indicate that the host should not split the run cycle because controls have +changed. + +Note that this feature is merely a hint, and does not guarantee a fixed block +length. The run cycle may be split for other reasons, and the blocksize itself +may change anytime. + +"""^^lv2:Markdown . + +bufsz:maxBlockLength + lv2:documentation """ + +The maximum block length the host will ever request the plugin to process at +once, that is, the maximum `sample_count` parameter that will ever be passed to +LV2_Descriptor::run(). + +"""^^lv2:Markdown . + +bufsz:minBlockLength + lv2:documentation """ + +The minimum block length the host will ever request the plugin to process at +once, that is, the minimum `sample_count` parameter that will ever be passed to +LV2_Descriptor::run(). + +"""^^lv2:Markdown . + +bufsz:nominalBlockLength + lv2:documentation """ + +The typical block length the host will request the plugin to process at once, +that is, the typical `sample_count` parameter that will be passed to +LV2_Descriptor::run(). This will usually be equivalent, or close to, the +maximum block length, but there are no strong guarantees about this value +whatsoever. Plugins may use this length for optimization purposes, but MUST +NOT assume the host will always process blocks of this length. In particular, +the host MAY process longer blocks. + +"""^^lv2:Markdown . + +bufsz:sequenceSize + lv2:documentation """ + +This should be provided as an option by hosts that support event ports +(including but not limited to MIDI), so plugins have the ability to allocate +auxiliary buffers large enough to copy the input. + +"""^^lv2:Markdown . + diff --git a/lv2/buf-size.lv2/buf-size.ttl b/lv2/buf-size.lv2/buf-size.ttl new file mode 100644 index 0000000..4f6bd52 --- /dev/null +++ b/lv2/buf-size.lv2/buf-size.ttl @@ -0,0 +1,68 @@ +@prefix bufsz: <http://lv2plug.in/ns/ext/buf-size#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix opts: <http://lv2plug.in/ns/ext/options#> . +@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://lv2plug.in/ns/ext/buf-size> + a owl:Ontology ; + rdfs:label "LV2 Buf Size" ; + rdfs:comment "Access to, and restrictions on, buffer sizes." ; + rdfs:seeAlso <buf-size.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> , + <http://lv2plug.in/ns/ext/options> . + +bufsz:boundedBlockLength + a lv2:Feature ; + rdfs:label "bounded block length" ; + rdfs:comment "Block length has lower and upper bounds." . + +bufsz:fixedBlockLength + a lv2:Feature ; + rdfs:label "fixed block length" ; + rdfs:comment "Block length never changes." . + +bufsz:powerOf2BlockLength + a lv2:Feature ; + rdfs:label "power of 2 block length" ; + rdfs:comment "Block length is a power of 2." . + +bufsz:coarseBlockLength + a lv2:Feature ; + rdfs:label "coarse block length" ; + rdfs:comment "Plugin prefers coarse block length without buffer splitting." . + +bufsz:maxBlockLength + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "maximum block length" ; + rdfs:comment "Block length has an upper bound." ; + rdfs:range xsd:nonNegativeInteger . + +bufsz:minBlockLength + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "minimum block length" ; + rdfs:comment "Block length has a lower bound." ; + rdfs:range xsd:nonNegativeInteger . + +bufsz:nominalBlockLength + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "nominal block length" ; + rdfs:comment "Typical block length that will most often be processed." ; + rdfs:range xsd:nonNegativeInteger . + +bufsz:sequenceSize + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "sequence size" ; + rdfs:comment "The maximum size of a sequence, in bytes." ; + rdfs:range xsd:nonNegativeInteger . + diff --git a/lv2/buf-size.lv2/manifest.ttl b/lv2/buf-size.lv2/manifest.ttl new file mode 100644 index 0000000..d242f97 --- /dev/null +++ b/lv2/buf-size.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/buf-size> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso <buf-size.ttl> . + diff --git a/lv2/core.lv2/lv2core.meta.ttl b/lv2/core.lv2/lv2core.meta.ttl new file mode 100644 index 0000000..bb7b185 --- /dev/null +++ b/lv2/core.lv2/lv2core.meta.ttl @@ -0,0 +1,835 @@ +@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#> . + +<http://lv2plug.in/ns/lv2core> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2" ; + doap:homepage <http://lv2plug.in> ; + doap:created "2004-04-21" ; + doap:shortdesc "An extensible open standard for audio plugins" ; + doap:programming-language "C" ; + 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.6" ; + doap:created "2022-08-12" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.8.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix inconsistent plugin class labels." + ] + ] + ] , [ + doap:revision "18.4" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +LV2 is an interface for writing audio plugins in C or compatible languages, +which can be dynamically loaded into many _host_ applications. This core +specification is simple and minimal, but is designed so that _extensions_ can +be defined to add more advanced features, making it possible to implement +nearly any feature. + +LV2 maintains a strong distinction between code and data. Plugin code is in a +shared library, while data is in a companion data file written in +[Turtle](https://www.w3.org/TR/turtle/). Code, data, and any other resources +(such as waveforms) are shipped together in a bundle directory. The code +contains only the executable portions of the plugin. All other data is +provided in the data file(s). This makes plugin data flexible and extensible, +and allows the host to do everything but run the plugin without loading or +executing any code. Among other advantages, this makes hosts more robust +(broken plugins can't crash a host during discovery) and allows generic tools +written in any language to work with LV2 data. The LV2 specification itself is +distributed in a similar way. + +An LV2 plugin library is suitable for dynamic loading (for example with +`dlopen()`) and provides one or more plugin descriptors via `lv2_descriptor()` +or `lv2_lib_descriptor()`. These can be instantiated to create plugin +instances, which can be run directly on data or connected together to perform +advanced signal processing tasks. + +Plugins communicate via _ports_, which can transmit any type of data. Data is +processed by first connecting each port to a buffer, then repeatedly calling +the `run()` method to process blocks of data. + +This core specification defines two types of port, equivalent to those in +[LADSPA](http://www.ladspa.org/), lv2:ControlPort and lv2:AudioPort, as well as +lv2:CVPort which has the same format as an audio port but is interpreted as +non-audible control data. Audio ports contain arrays with one `float` element +per sample, allowing a block of audio to be processed in a single call to +`run()`. Control ports contain single `float` values, which are fixed and +valid for the duration of the call to `run()`. Thus the _control rate_ is +determined by the block size, which is controlled by the host (and not +necessarily constant). + +### Threading Rules + +To facilitate use in multi-threaded programs, LV2 functions are partitioned into +several threading classes: + +| Discovery Class | Instantiation Class | Audio Class | +|----------------------------------|-------------------------------|------------------------------- | +| lv2_descriptor() | LV2_Descriptor::instantiate() | LV2_Descriptor::run() | +| lv2_lib_descriptor() | LV2_Descriptor::cleanup() | LV2_Descriptor::connect_port() | +| LV2_Descriptor::extension_data() | LV2_Descriptor::activate() | | +| | LV2_Descriptor::deactivate() | | + +Hosts MUST guarantee that: + + * A function in any class is never called concurrently with another function + in that class. + + * A _Discovery_ function is never called concurrently with any other function + in the same shared object file. + + * An _Instantiation_ function for an instance is never called concurrently + with any other function for that instance. + +Any simultaneous calls that are not explicitly forbidden by these rules are +allowed. For example, a host may call `run()` for two different plugin +instances simultaneously. + +Plugin functions in any class MUST NOT manipulate any state which might affect +other plugins or the host (beyond the contract of that function), for example +by using non-reentrant global functions. + +Extensions to this specification which add new functions MUST declare in which +of these classes the functions belong, define new classes for them, or +otherwise precisely describe their threading rules. + +"""^^lv2:Markdown . + +lv2:Specification + lv2:documentation """ + +An LV2 specification typically contains a vocabulary description, C headers to +define an API, and any other resources that may be useful. Specifications, +like plugins, are distributed and installed as bundles so that hosts may +discover them. + +"""^^lv2:Markdown . + +lv2:Markdown + lv2:documentation """ + +This datatype is typically used for documentation in +[Markdown](https://daringfireball.net/projects/markdown/syntax) syntax. + +Generally, documentation with this datatype should stay as close to readable +plain text as possible, but may use core Markdown syntax for nicer +presentation. Documentation can assume that basic extensions like codehilite +and tables are available. + +"""^^lv2:Markdown . + +lv2:documentation + lv2:documentation """ + +Relates a Resource to extended documentation. + +LV2 specifications are documented using this property with an lv2:Markdown +datatype. + +If the value has no explicit datatype, it is assumed to be a valid XHTML Basic +1.1 fragment suitable for use as the content of the `body` element of a page. + +XHTML Basic is a W3C Recommendation which defines a simplified subset of XHTML +intended to be reasonable to implement with limited resources, for exampe on +embedded devices. See [XHTML Basic, Section +3](http://www.w3.org/TR/xhtml-basic/#s_xhtmlmodules) for a list of valid tags. + +"""^^lv2:Markdown . + +lv2:PluginBase + lv2:documentation """ + +An abstract plugin-like resource that may not actually be an LV2 plugin, for +example that may not have a lv2:binary. This is useful for describing things +that share common structure with a plugin, but are not themselves an actual +plugin, such as presets. + +"""^^lv2:Markdown . + +lv2:Plugin + lv2:documentation """ + +To be discovered by hosts, plugins MUST explicitly have an rdf:type of lv2:Plugin +in their bundle's manifest, for example: + + :::turtle + <http://example.org/my-plugin> a lv2:Plugin . + +Plugins should have a doap:name property that is at most a few words in length +using title capitalization, for example <q>Tape Delay Unit</q>. + +"""^^lv2:Markdown . + +lv2:PortBase + lv2:documentation """ + +Similar to lv2:PluginBase, this is an abstract port-like resource that may not +be a fully specified LV2 port. For example, this is used for preset "ports" +which do not specify an index. + +"""^^lv2:Markdown . + +lv2:Port + lv2:documentation """ + +All LV2 port descriptions MUST have a rdf:type that is one of lv2:Port, +lv2:InputPort or lv2:OutputPort. Additionally, there MUST be at least one +other rdf:type which more precisely describes type of the port, for example +lv2:AudioPort. + +Hosts that do not support a specific port class MUST NOT instantiate the +plugin, unless that port has the lv2:connectionOptional property set. + +A port has two identifiers: a (numeric) index, and a (textual) symbol. The +index can be used as an identifier at run-time, but persistent references to +ports (for example in presets or save files) MUST use the symbol. Only the +symbol is guaranteed to refer to the same port on all plugins with a given URI, +that is the index for a port may differ between plugin binaries. + +"""^^lv2:Markdown . + +lv2:AudioPort + lv2:documentation """ + +Ports of this type are connected to a buffer of `float` audio samples, which +the host guarantees have `sample_count` elements in any call to +LV2_Descriptor::run(). + +Audio samples are normalized between -1.0 and 1.0, though there is no +requirement for samples to be strictly within this range. + +"""^^lv2:Markdown . + +lv2:CVPort + lv2:documentation """ + +Ports of this type have the same buffer format as an lv2:AudioPort, except the +buffer represents audio-rate control data rather than audio. Like a +lv2:ControlPort, a CV port SHOULD have properties describing its value, in +particular lv2:minimum, lv2:maximum, and lv2:default. + +Hosts may present CV ports to users as controls in the same way as control +ports. Conceptually, aside from the buffer format, a CV port is the same as a +control port, so hosts can use all the same properties and expectations. + +In particular, this port type does not imply any range, unit, or meaning for +its values. However, if there is no inherent unit to the values, for example +if the port is used to modulate some other value, then plugins SHOULD use a +normalized range, either from -1.0 to 1.0, or from 0.0 to 1.0. + +It is generally safe to connect an audio output to a CV input, but not +vice-versa. Hosts must take care to prevent data from a CVPort port from being +used as audio. + +"""^^lv2:Markdown . + +lv2:project + lv2:documentation """ + +This property provides a way to group plugins and/or related resources. A +project may have useful metadata common to all plugins (such as homepage, +author, version history) which would be wasteful to list separately for each +plugin. + +Grouping via projects also allows users to find plugins in hosts by project, +which is often how they are remembered. For this reason, a project that +contains plugins SHOULD always have a doap:name. It is also a good idea for +each plugin and the project itself to have an lv2:symbol property, which allows +nice quasi-global identifiers for plugins, for example `myproj.superamp` which +can be useful for display or fast user entry. + +"""^^lv2:Markdown . + +lv2:prototype + lv2:documentation """ + +This property can be used to <q>include</q> common properties in several +descriptions, serving as a sort of template mechanism. If a plugin has a +prototype, then the host must load all the properties for the prototype as if +they were properties of the plugin. That is, if `:plug lv2:prototype :prot`, +then for each triple `:prot p o`, the triple `:plug p o` should be loaded. + +This facility is useful for distributing data-only plugins that rely on a +common binary, for example those where the internal state is loaded from some +other file. Such plugins can refer to a prototype in a template LV2 bundle +which is installed by the corresponding software. + +"""^^lv2:Markdown . + +lv2:minorVersion + lv2:documentation """ + +This, along with lv2:microVersion, is used to distinguish between different +versions of the <q>same</q> resource, for example to load only the bundle with +the most recent version of a plugin. An LV2 version has a minor and micro +number with the usual semantics: + + * The minor version MUST be incremented when backwards (but not forwards) + compatible additions are made, for example the addition of a port to a + plugin. + + * The micro version is incremented for changes which do not affect + compatibility at all, for example bug fixes or documentation updates. + +Note that there is deliberately no major version: all versions with the same +URI are compatible by definition. Replacing a resource with a newer version of +that resource MUST NOT break anything. If a change violates this rule, then +the URI of the resource (which serves as the major version) MUST be changed. + +Plugins and extensions MUST adhere to at least the following rules: + + * All versions of a plugin with a given URI MUST have the <q>same</q> set of + mandatory (not lv2:connectionOptional) ports with respect to lv2:symbol and + rdf:type. In other words, every port on a particular version is guaranteed + to exist on a future version with same lv2:symbol and at least those + rdf:types. + + * New ports MAY be added without changing the plugin URI if and only if they + are lv2:connectionOptional and the minor version is incremented. + + * The minor version MUST be incremented if the index of any port (identified + by its symbol) is changed. + + * All versions of a specification MUST be compatible in the sense that an + implementation of the new version can interoperate with an implementation + of any previous version. + +Anything that depends on a specific version of a plugin (including referencing +ports by index) MUST refer to the plugin by both URI and version. However, +implementations should be tolerant where possible. + +When hosts discover several installed versions of a resource, they SHOULD warn +the user and load only the most recent version. + +An odd minor _or_ micro version, or minor version zero, indicates that the +resource is a development version. Hosts and tools SHOULD clearly indicate +this wherever appropriate. Minor version zero is a special case for +pre-release development of plugins, or experimental plugins that are not +intended for stable use at all. Hosts SHOULD NOT expect such a plugin to +remain compatible with any future version. Where feasible, hosts SHOULD NOT +expose such plugins to users by default, but may provide an option to display +them. + +"""^^lv2:Markdown . + +lv2:microVersion + lv2:documentation """ + +Releases of plugins and extensions MUST be explicitly versioned. Correct +version numbers MUST always be maintained for any versioned resource that is +published. For example, after a release, if a change is made in the development +version in source control, the micro version MUST be incremented (to an odd +number) to distinguish this modified version from the previous release. + +This property describes half of a resource version. For detailed documentation +on LV2 resource versioning, see lv2:minorVersion. + +"""^^lv2:Markdown . + +lv2:binary + lv2:documentation """ + +The value of this property must be the URI of a shared library object, +typically in the same bundle as the data file which contains this property. +The actual type of the library is platform specific. + +This is a required property of a lv2:Plugin which MUST be included in the +bundle's `manifest.ttl` file. The lv2:binary of a lv2:Plugin is the shared +object containing the lv2_descriptor() or lv2_lib_descriptor() function. This +probably may also be used similarly by extensions to relate other resources to +their implementations (it is not implied that a lv2:binary on an arbitrary +resource is an LV2 plugin library). + +"""^^lv2:Markdown . + +lv2:appliesTo + lv2:documentation """ + +This is primarily intended for discovery purposes: bundles that describe +resources that work with particular plugins (like presets or user interfaces) +SHOULD specify this in their `manifest.ttl` so the host can associate them with +the correct plugin. For example: + + :::turtle + <thing> + a ext:Thing ; + lv2:appliesTo <plugin> ; + rdfs:seeAlso <thing.ttl> . + +Using this pattern is preferable for large amounts of data, since the host may +choose whether/when to load the data. + +"""^^lv2:Markdown . + +lv2:Symbol + lv2:documentation """ + +The first character of a symbol must be one of `_`, `a-z` or `A-Z`, and +subsequent characters may additionally be `0-9`. This is, among other things, +a valid C identifier, and generally compatible in most contexts which have +restrictions on string identifiers, such as file paths. + +"""^^lv2:Markdown . + +lv2:symbol + lv2:documentation """ + +The value of this property MUST be a valid lv2:Symbol, and MUST NOT have a +language tag. + +A symbol is a unique identifier with respect to the parent, for example a +port's symbol is a unique identifiers with respect to its plugin. The plugin +author MUST change the plugin URI if any port symbol is changed or removed. + +"""^^lv2:Markdown . + +lv2:name + lv2:documentation """ + +Unlike lv2:symbol, this is unrestricted, may be translated, and is not relevant +for compatibility. The name is not necessarily unique and MUST NOT be used as +an identifier. + +"""^^lv2:Markdown . + +lv2:shortName + lv2:documentation """ + +This is the same as lv2:name, with the additional requirement that the value is +shorter than 16 characters. + +"""^^lv2:Markdown . + +lv2:Designation + lv2:documentation """ + +A designation is metadata that describes the meaning or role of something. By +assigning a designation to a port using lv2:designation, the port's content +becomes meaningful and can be used more intelligently by the host. + +"""^^lv2:Markdown . + +lv2:Channel + lv2:documentation """ + +A specific channel, for example the <q>left</q> channel of a stereo stream. A +channel may be audio, or another type such as a MIDI control stream. + +"""^^lv2:Markdown . + +lv2:Parameter + lv2:documentation """ + +A parameter is a designation for a control. + +A parameter defines the meaning of a control, not the method of conveying its +value. For example, a parameter could be controlled via a lv2:ControlPort, +messages, or both. + +A lv2:ControlPort can be associated with a parameter using lv2:designation. + +"""^^lv2:Markdown . + +lv2:designation + lv2:documentation """ + +This property is used to give a port's contents a well-defined meaning. For +example, if a port has the designation `eg:gain`, then the value of that port +represents the `eg:gain` of the plugin instance. + +Ports should be given designations whenever possible, particularly if a +suitable designation is already defined. This allows the host to act more +intelligently and provide a more effective user interface. For example, if the +plugin has a BPM parameter, the host may automatically set that parameter to +the current tempo. + +"""^^lv2:Markdown . + +lv2:freeWheeling + lv2:documentation """ + +If true, this means that all processing is happening as quickly as possible, +not in real-time. When free-wheeling there is no relationship between the +passage of real wall-clock time and the passage of time in the data being +processed. + +"""^^lv2:Markdown . + +lv2:enabled + lv2:documentation """ + +If this value is greater than zero, the plugin processes normally. If this +value is zero, the plugin is expected to bypass all signals unmodified. The +plugin must provide a click-free transition between the enabled and disabled +(bypassed) states. + +Values less than zero are reserved for future use (such as click-free +insertion/removal of latent plugins), and should be treated like zero +(bypassed) by current implementations. + +"""^^lv2:Markdown . + +lv2:control + lv2:documentation """ + +This should be used as the lv2:designation of ports that are used to send +commands and receive responses. Typically this will be an event port that +supports some protocol, for example MIDI or LV2 Atoms. + +"""^^lv2:Markdown . + +lv2:Point + lv2:documentation """ + + * A Point MUST have at least one rdfs:label which is a string. + + * A Point MUST have exactly one rdf:value with a type that is compatible with + the type of the corresponding Port. + +"""^^lv2:Markdown . + +lv2:default + lv2:documentation """ + +The host SHOULD set the port to this value initially, and in any situation +where the port value should be cleared or reset. + +"""^^lv2:Markdown . + +lv2:minimum + lv2:documentation """ + +This is a soft limit: the plugin is required to gracefully accept all values in +the range of a port's data type. + +"""^^lv2:Markdown . + +lv2:maximum + lv2:documentation """ + +This is a soft limit: the plugin is required to gracefully accept all values in +the range of a port's data type. + +"""^^lv2:Markdown . + +lv2:optionalFeature + lv2:documentation """ + +To support this feature, the host MUST pass its URI and any additional data to +the plugin in LV2_Descriptor::instantiate(). + +The plugin MUST NOT fail to instantiate if an optional feature is not supported +by the host. + +"""^^lv2:Markdown . + +lv2:requiredFeature + lv2:documentation """ + +To support this feature, the host MUST pass its URI and any additional data to +the plugin in LV2_Descriptor::instantiate(). + +The host MUST check this property before attempting to instantiate a plugin, +and not attempt to instantiate plugins which require features it does not +support. The plugin MUST fail to instantiate if a required feature is not +supported by the host. Note that these rules are intentionally redundant for +resilience: neither host nor plugin should assume that the other does not +violate them. + +"""^^lv2:Markdown . + +lv2:ExtensionData + lv2:documentation """ + +This is additional data that a plugin may return from +LV2_Descriptor::extension_data(). This is generally used to add APIs to extend +that defined by LV2_Descriptor. + +"""^^lv2:Markdown . + +lv2:extensionData + lv2:documentation """ + +If a plugin has a value for this property, it must be a URI that defines the +extension data. The plugin should return the appropriate data when +LV2_Descriptor::extension_data() is called with that URI as a parameter. + +"""^^lv2:Markdown . + +lv2:isLive + lv2:documentation """ + +This feature is for plugins that have time-sensitive internals, for example +communicating in real time over a socket. It indicates to the host that its +input and output must not be cached or subject to significant latency, and that +calls to LV2_Descriptor::run() should be made at a rate that roughly +corresponds to wall clock time (according to the `sample_count` parameter). + +Note that this feature is not related to <q>hard real-time</q> execution +requirements (see lv2:hardRTCapable). + +"""^^lv2:Markdown . + +lv2:inPlaceBroken + lv2:documentation """ + +This feature indicates that the plugin may not work correctly if the host +elects to use the same data location for both input and output. Plugins that +will fail to work correctly if ANY input port is connected to the same location +as ANY output port MUST require this feature. Doing so should be avoided +whenever possible since it prevents hosts from running the plugin on data +<q>in-place</q>. + +"""^^lv2:Markdown . + +lv2:hardRTCapable + lv2:documentation """ + +This feature indicates that the plugin is capable of running in a <q>hard +real-time</q> environment. This should be the case for most audio processors, +so most plugins are expected to have this feature. + +To support this feature, plugins MUST adhere to the following in all of their +audio class functions (LV2_Descriptor::run() and +LV2_Descriptor::connect_port()): + + * There is no use of `malloc()`, `free()` or any other heap memory management + functions. + + * There is no use of any library functions which do not adhere to these + rules. The plugin may assume that the standard C math library functions + are safe. + + * There is no access to files, devices, pipes, sockets, system calls, or any + other mechanism that might result in the process or thread blocking. + + * The maximum amount of time for a `run()` call is bounded by some expression + of the form `A + B * sample_count`, where `A` and `B` are platform specific + constants. Note that this bound does not depend on input signals or plugin + state. + +"""^^lv2:Markdown . + +lv2:portProperty + lv2:documentation """ + +States that a port has a particular lv2:PortProperty. This may be ignored +without catastrophic effects, though it may be useful, for example to provide a +sensible user interface for the port. + +"""^^lv2:Markdown . + +lv2:connectionOptional + lv2:documentation """ + +This property means that the port does not have to be connected to valid data +by the host. To leave a port <q>unconnected</q>, the host MUST explicitly +connect the port to `NULL`. + +"""^^lv2:Markdown . + +lv2:reportsLatency + lv2:documentation """ + +This property indicates that the port is used to express the processing latency +incurred by the plugin, expressed in samples. The latency may be affected by +the current sample rate, plugin settings, or other factors, and may be changed +by the plugin at any time. Where the latency is frequency dependent the plugin +may choose any appropriate value. If a plugin introduces latency it MUST +provide EXACTLY ONE port with this property set. In <q>fuzzy</q> cases the +value should be the most reasonable one based on user expectation of +input/output alignment. For example, musical delay plugins should not report +their delay as latency, since it is an intentional effect that the host should +not compensate for. + +This property is deprecated, use a lv2:designation of lv2:latency instead, +following the same rules as above: + + :::turtle + <http://example.org/plugin> + lv2:port [ + a lv2:OutputPort , lv2:ControlPort ; + lv2:designation lv2:latency ; + lv2:symbol "latency" ; + ] + +"""^^lv2:Markdown . + +lv2:toggled + lv2:documentation """ + +Indicates that the data item should be considered a boolean toggle. Data less +than or equal to zero should be considered <q>off</q> or <q>false</q>, and data +above zero should be considered <q>on</q> or <q>true</q>. + +"""^^lv2:Markdown . + +lv2:sampleRate + lv2:documentation """ + +Indicates that any specified bounds should be interpreted as multiples of the +sample rate. For example, a frequency range from 0 Hz to the Nyquist frequency +(half the sample rate) can be specified by using this property with lv2:minimum +0.0 and lv2:maximum 0.5. Hosts that support bounds at all MUST support this +property. + +"""^^lv2:Markdown . + +lv2:integer + lv2:documentation """ + +Indicates that all the reasonable values for a port are integers. For such +ports, a user interface should provide a stepped control that only allows +choosing integer values. + +Note that this is only a hint, and that the plugin MUST operate reasonably even +if such a port has a non-integer value. + +"""^^lv2:Markdown . + +lv2:enumeration + lv2:documentation """ + +Indicates that all the rasonable values for a port are defined by +lv2:scalePoint properties. For such ports, a user interface should provide a selector that allows the user to choose any of the scale point values by name. It is recommended to show the value as well if possible. + +Note that this is only a hint, and that the plugin MUST operate reasonably even +if such a port has a value that does not correspond to a scale point. + +"""^^lv2:Markdown . + +lv2:isSideChain + lv2:documentation """ + +Indicates that a port is a <q>sidechain</q>, which affects the output somehow +but should not be considered a part of the main signal chain. Sidechain ports +SHOULD be lv2:connectionOptional, and may be ignored by hosts. + +"""^^lv2:Markdown . + diff --git a/lv2/core.lv2/lv2core.ttl b/lv2/core.lv2/lv2core.ttl new file mode 100644 index 0000000..7722cac --- /dev/null +++ b/lv2/core.lv2/lv2core.ttl @@ -0,0 +1,673 @@ +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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://lv2plug.in/ns/lv2core> + a owl:Ontology ; + rdfs:label "LV2" ; + rdfs:comment "An extensible open standard for audio plugins." ; + rdfs:seeAlso <lv2core.meta.ttl> ; + owl:imports doap: . + +lv2:Specification + a rdfs:Class , + owl:Class ; + rdfs:subClassOf doap:Project ; + rdfs:label "Specification" ; + rdfs:comment "An LV2 specifiation." . + +lv2:Markdown + a rdfs:Datatype ; + owl:onDatatype xsd:string ; + rdfs:label "Markdown" ; + rdfs:comment "A string in Markdown syntax." . + +lv2:documentation + a rdf:Property , + owl:AnnotationProperty ; + rdfs:range rdfs:Literal ; + rdfs:label "documentation" ; + rdfs:comment "Extended documentation." ; + rdfs:seeAlso <http://www.w3.org/TR/xhtml-basic/> . + +lv2:PluginBase + a rdfs:Class , + owl:Class ; + rdfs:label "Plugin Base" ; + rdfs:comment "Base class for a plugin-like resource." . + +lv2:Plugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:PluginBase ; + rdfs:label "Plugin" ; + rdfs:comment "An LV2 plugin." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty doap:name ; + owl:someValuesFrom rdf:PlainLiteral ; + rdfs:comment "A plugin MUST have at least one untranslated doap:name." + ] , [ + a owl:Restriction ; + owl:onProperty lv2:port ; + owl:allValuesFrom lv2:Port ; + rdfs:comment "All ports on a plugin MUST be fully specified lv2:Port instances." + ] . + +lv2:PortBase + a rdfs:Class , + owl:Class ; + rdfs:label "Port Base" ; + rdfs:comment "Base class for a port-like resource." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:symbol ; + owl:cardinality 1 ; + rdfs:comment "A port MUST have exactly one lv2:symbol." + ] . + +lv2:Port + a rdfs:Class , + owl:Class ; + rdfs:label "Port" ; + rdfs:comment "An LV2 plugin port." ; + rdfs:subClassOf lv2:PortBase , + [ + a owl:Restriction ; + owl:onProperty lv2:name ; + owl:minCardinality 1 ; + rdfs:comment "A port MUST have at least one lv2:name." + ] . + +lv2:InputPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Input Port" ; + rdfs:comment "A port connected to constant data which is read during `run()`." . + +lv2:OutputPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Output Port" ; + rdfs:comment "A port connected to data which is written during `run()`." . + +lv2:ControlPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Control Port" ; + rdfs:comment "A port connected to a single `float`." . + +lv2:AudioPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Audio Port" ; + rdfs:comment "A port connected to an array of float audio samples." . + +lv2:CVPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "CV Port" ; + rdfs:comment "A port connected to an array of float control values." . + +lv2:port + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:PluginBase ; + rdfs:range lv2:PortBase ; + rdfs:label "port" ; + rdfs:comment "A port (input or output) on this plugin." . + +lv2:project + a rdf:Property , + owl:ObjectProperty ; + rdfs:range doap:Project ; + rdfs:label "project" ; + rdfs:comment "The project this is a part of." . + +lv2:prototype + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "prototype" ; + rdfs:comment "The prototype to inherit properties from." . + +lv2:minorVersion + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "minor version" ; + rdfs:comment "The minor version of this resource." . + +lv2:microVersion + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "micro version" ; + rdfs:comment "The micro version of this resource." . + +lv2:binary + a rdf:Property , + owl:ObjectProperty ; + rdfs:range owl:Thing ; + rdfs:label "binary" ; + rdfs:comment "The binary of this resource." . + +lv2:appliesTo + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:Plugin ; + rdfs:label "applies to" ; + rdfs:comment "The plugin this resource is related to." . + +lv2:index + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:range xsd:unsignedInt ; + rdfs:label "index" ; + rdfs:comment "A non-negative zero-based 32-bit index." . + +lv2:Symbol + a rdfs:Datatype ; + owl:onDatatype xsd:string ; + owl:withRestrictions ( + [ + xsd:pattern "[_a-zA-Z][_a-zA-Z0-9]*" + ] + ) ; + rdfs:label "Symbol" ; + rdfs:comment "A short restricted name used as a strong identifier." . + +lv2:symbol + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "symbol" ; + rdfs:range lv2:Symbol , + rdf:PlainLiteral ; + rdfs:comment "The symbol that identifies this resource in the context of its parent." . + +lv2:name + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "name" ; + rdfs:range xsd:string ; + rdfs:comment "A display name for labeling in a user interface." . + +lv2:shortName + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "short name" ; + rdfs:range xsd:string ; + rdfs:comment "A short display name for labeling in a user interface." . + +lv2:Designation + a rdfs:Class , + owl:Class ; + rdfs:subClassOf rdf:Property ; + rdfs:label "Designation" ; + rdfs:comment "A designation which defines the meaning of some data." . + +lv2:Channel + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Designation ; + rdfs:label "Channel" ; + rdfs:comment "An individual channel, such as left or right." . + +lv2:Parameter + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Designation , + rdf:Property ; + rdfs:label "Parameter" ; + rdfs:comment "A property that is a plugin parameter." . + +lv2:designation + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:range rdf:Property ; + rdfs:label "designation" ; + rdfs:comment "The designation that defines the meaning of this input or output." . + +lv2:latency + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "latency" ; + rdfs:comment "The latency introduced, in frames." . + +lv2:freeWheeling + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "free-wheeling" ; + rdfs:range xsd:boolean ; + rdfs:comment "Whether processing is currently free-wheeling." . + +lv2:enabled + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "enabled" ; + rdfs:range xsd:int ; + rdfs:comment "Whether processing is currently enabled (not bypassed)." . + +lv2:control + a lv2:Channel ; + rdfs:label "control" ; + rdfs:comment "The primary control channel." . + +lv2:Point + a rdfs:Class , + owl:Class ; + rdfs:label "Point" ; + rdfs:comment "An interesting point in a value range." . + +lv2:ScalePoint + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Point ; + rdfs:label "Scale Point" ; + rdfs:comment "A single `float` Point for control inputs." . + +lv2:scalePoint + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:ScalePoint ; + rdfs:label "scale point" ; + rdfs:comment "A scale point of a port or parameter." . + +lv2:default + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "default" ; + rdfs:comment "The default value for this control." . + +lv2:minimum + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "minimum" ; + rdfs:comment "The minimum value for this control." . + +lv2:maximum + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "maximum" ; + rdfs:comment "The maximum value for this control." . + +lv2:Feature + a rdfs:Class , + owl:Class ; + rdfs:label "Feature" ; + rdfs:comment "An additional feature which may be used or required." . + +lv2:optionalFeature + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:Feature ; + rdfs:label "optional feature" ; + rdfs:comment "An optional feature that is supported if available." . + +lv2:requiredFeature + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:Feature ; + rdfs:label "required feature" ; + rdfs:comment "A required feature that must be available to run." . + +lv2:ExtensionData + a rdfs:Class , + owl:Class ; + rdfs:label "Extension Data" ; + rdfs:comment "Additional data defined by an extension." . + +lv2:extensionData + a rdf:Property , + owl:ObjectProperty ; + rdfs:range lv2:ExtensionData ; + rdfs:label "extension data" ; + rdfs:comment "Extension data provided by a plugin or other binary." . + +lv2:isLive + a lv2:Feature ; + rdfs:label "is live" ; + rdfs:comment "Plugin has a real-time dependency." . + +lv2:inPlaceBroken + a lv2:Feature ; + rdfs:label "in-place broken" ; + rdfs:comment "Plugin requires separate locations for input and output." . + +lv2:hardRTCapable + a lv2:Feature ; + rdfs:label "hard real-time capable" ; + rdfs:comment "Plugin is capable of running in a hard real-time environment." . + +lv2:PortProperty + a rdfs:Class , + owl:Class ; + rdfs:label "Port Property" ; + rdfs:comment "A particular property that a port has." . + +lv2:portProperty + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:Port ; + rdfs:range lv2:PortProperty ; + rdfs:label "port property" ; + rdfs:comment "A property of this port hosts may find useful." . + +lv2:connectionOptional + a lv2:PortProperty ; + rdfs:label "connection optional" ; + rdfs:comment "The property that this port may be connected to NULL." . + +lv2:reportsLatency + a lv2:PortProperty ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "reports latency" ; + rdfs:comment "Control port value is the plugin latency in frames." . + +lv2:toggled + a lv2:PortProperty ; + rdfs:label "toggled" ; + rdfs:comment "Control port value is considered a boolean toggle." . + +lv2:sampleRate + a lv2:PortProperty ; + rdfs:label "sample rate" ; + rdfs:comment "Control port bounds are interpreted as multiples of the sample rate." . + +lv2:integer + a lv2:PortProperty ; + rdfs:label "integer" ; + rdfs:comment "Control port values are treated as integers." . + +lv2:enumeration + a lv2:PortProperty ; + rdfs:label "enumeration" ; + rdfs:comment "Control port scale points represent all useful values." . + +lv2:isSideChain + a lv2:PortProperty ; + rdfs:label "is side-chain" ; + rdfs:comment "Signal for port should not be considered a main input or output." . + +lv2:GeneratorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Generator Plugin" ; + rdfs:comment "A plugin that generates new sound internally." . + +lv2:InstrumentPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:GeneratorPlugin ; + rdfs:label "Instrument Plugin" ; + rdfs:comment "A plugin intended to be played as a musical instrument." . + +lv2:OscillatorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:GeneratorPlugin ; + rdfs:label "Oscillator Plugin" ; + rdfs:comment "A plugin that generates output with an oscillator." . + +lv2:UtilityPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Utility Plugin" ; + rdfs:comment "A utility plugin that is not a typical audio effect or generator." . + +lv2:ConverterPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Converter Plugin" ; + rdfs:comment "A plugin that converts its input into a different form." . + +lv2:AnalyserPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Analyser Plugin" ; + rdfs:comment "A plugin that analyses its input and emits some useful information." . + +lv2:MixerPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Mixer Plugin" ; + rdfs:comment "A plugin that mixes some number of inputs into some number of outputs." . + +lv2:SimulatorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Simulator Plugin" ; + rdfs:comment "A plugin that aims to emulate some environmental effect or musical equipment." . + +lv2:DelayPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Delay Plugin" ; + rdfs:comment "An effect that intentionally delays its input as an effect." . + +lv2:ModulatorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Modulator Plugin" ; + rdfs:comment "An effect that modulats its input as an effect." . + +lv2:ReverbPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin , + lv2:SimulatorPlugin , + lv2:DelayPlugin ; + rdfs:label "Reverb Plugin" ; + rdfs:comment "An effect that adds reverberation to its input." . + +lv2:PhaserPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:ModulatorPlugin ; + rdfs:label "Phaser Plugin" ; + rdfs:comment "An effect that periodically sweeps a filter over its input." . + +lv2:FlangerPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:ModulatorPlugin ; + rdfs:label "Flanger Plugin" ; + rdfs:comment "An effect that mixes slightly delayed copies of its input." . + +lv2:ChorusPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:ModulatorPlugin ; + rdfs:label "Chorus Plugin" ; + rdfs:comment "An effect that mixes significantly delayed copies of its input." . + +lv2:FilterPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Filter Plugin" ; + rdfs:comment "An effect that manipulates the frequency spectrum of its input." . + +lv2:LowpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Lowpass Filter Plugin" ; + rdfs:comment "A filter that attenuates frequencies above some cutoff." . + +lv2:BandpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Bandpass Filter Plugin" ; + rdfs:comment "A filter that attenuates frequencies outside of some band." . + +lv2:HighpassPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Highpass Filter Plugin" ; + rdfs:comment "A filter that attenuates frequencies below some cutoff." . + +lv2:CombPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:FilterPlugin ; + rdfs:label "Comb 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 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 "EQ Plugin" ; + rdfs:comment "A plugin that adjusts the balance between frequency components." . + +lv2:ParaEQPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:EQPlugin ; + rdfs:label "Parametric EQ Plugin" ; + rdfs:comment "A plugin that adjusts the balance between configurable frequency components." . + +lv2:MultiEQPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:EQPlugin ; + rdfs:label "Multiband EQ Plugin" ; + rdfs:comment "A plugin that adjusts the balance between a fixed set of frequency components." . + +lv2:SpatialPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Spatial Plugin" ; + rdfs:comment "A plugin that manipulates the position of audio in space." . + +lv2:SpectralPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Spectral Plugin" ; + rdfs:comment "A plugin that alters the spectral properties of audio." . + +lv2:PitchPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:SpectralPlugin ; + rdfs:label "Pitch Shifter Plugin" ; + rdfs:comment "A plugin that shifts the pitch of its input." . + +lv2:AmplifierPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Amplifier Plugin" ; + rdfs:comment "A plugin that primarily changes the volume of its input." . + +lv2:EnvelopePlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Envelope Plugin" ; + rdfs:comment "A plugin that applies an envelope to its input." . + +lv2:DistortionPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Distortion Plugin" ; + rdfs:comment "A plugin that adds distortion to its input." . + +lv2:WaveshaperPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DistortionPlugin ; + rdfs:label "Waveshaper Plugin" ; + rdfs:comment "An effect that alters the shape of input waveforms." . + +lv2:DynamicsPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "Dynamics Plugin" ; + rdfs:comment "A plugin that alters the envelope or dynamic range of its input." . + +lv2:CompressorPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Compressor Plugin" ; + rdfs:comment "A plugin that reduces the dynamic range of its input." . + +lv2:ExpanderPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Expander Plugin" ; + rdfs:comment "A plugin that expands the dynamic range of its input." . + +lv2:LimiterPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Limiter Plugin" ; + rdfs:comment "A plugin that limits its input to some maximum level." . + +lv2:GatePlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:DynamicsPlugin ; + rdfs:label "Gate Plugin" ; + rdfs:comment "A plugin that attenuates signals below some threshold." . + +lv2:FunctionPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:UtilityPlugin ; + rdfs:label "Function Plugin" ; + rdfs:comment "A plugin whose output is a mathematical function of its input." . + +lv2:ConstantPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:GeneratorPlugin ; + rdfs:label "Constant Plugin" ; + rdfs:comment "A plugin that emits constant values." . + +lv2:MIDIPlugin + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Plugin ; + rdfs:label "MIDI Plugin" ; + rdfs:comment "A plugin that primarily processes MIDI messages." . + diff --git a/lv2/core.lv2/manifest.ttl b/lv2/core.lv2/manifest.ttl new file mode 100644 index 0000000..7f5e37e --- /dev/null +++ b/lv2/core.lv2/manifest.ttl @@ -0,0 +1,15 @@ +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/lv2core> + a lv2:Specification ; + lv2:minorVersion 18 ; + 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..31500b3 --- /dev/null +++ b/lv2/core.lv2/meta.ttl @@ -0,0 +1,253 @@ +@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: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.8" ; + doap:created "2022-08-12" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.8.tar.xz> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "lv2specgen: Fix installed data paths." + ] , [ + rdfs:label "Fix documentation build with meson 0.56.2." + ] , [ + rdfs:label "Fix lv2.h missing from installation." + ] , [ + rdfs:label "Fix documentation build with Python 3.7." + ] , [ + rdfs:label "eg-midigate: Fix output timing." + ] , [ + rdfs:label "eg-sampler: Add resampling via libsamplerate." + ] , [ + rdfs:label "eg-sampler: Fix potentially corrupt notification events." + ] + ] + ] , [ + doap:revision "1.18.6" ; + doap:created "2022-07-07" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.6.tar.xz> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix or avoid new compiler and tool warnings." + ] , [ + rdfs:label "Add dark mode style for documentation." + ] , [ + rdfs:label "Clean up and modernize Python support code." + ] , [ + rdfs:label "Remove archaic properties from foaf vocabulary." + ] , [ + rdfs:label "Replace canonical dcs ontology with a minimal version for LV2." + ] , [ + rdfs:label "Switch to Meson build system." + ] , [ + rdfs:label "Separate API headers from data." + ] , [ + rdfs:label "Rearrange source tree to be directly usable by dependants." + ] + ] + ] , [ + doap:revision "1.18.4" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] , [ + rdfs:label "Fix build issues with newer toolchains." + ] + ] + ] , [ + doap:revision "1.18.2" ; + doap:created "2021-01-07" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.2.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "eg-sampler: Save and restore gain parameter value." + ] , [ + rdfs:label "Various code cleanups and infrastructure improvements." + ] + ] + ] , [ + doap:revision "1.18.0" ; + doap:created "2020-04-26" ; + doap:file-release <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/core.lv2/people.ttl b/lv2/core.lv2/people.ttl new file mode 100644 index 0000000..52d0384 --- /dev/null +++ b/lv2/core.lv2/people.ttl @@ -0,0 +1,51 @@ +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix meta: <http://lv2plug.in/ns/meta#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://drobilla.net/drobilla#me> + a foaf:Person ; + foaf:name "David Robillard" ; + foaf:mbox <mailto:d@drobilla.net> ; + rdfs:seeAlso <http://drobilla.net/drobilla> . + +<http://plugin.org.uk/swh.xrdf#me> + a foaf:Person ; + foaf:name "Steve Harris" ; + foaf:mbox <mailto:steve@plugin.org.uk> ; + rdfs:seeAlso <http://plugin.org.uk/swh.xrdf> . + +meta:larsl + a foaf:Person ; + foaf:name "Lars Luthman" ; + foaf:mbox <mailto:lars.luthman@gmail.com> . + +meta:gabrbedd + a foaf:Person ; + foaf:name "Gabriel M. Beddingfield" ; + foaf:mbox <mailto:gabrbedd@gmail.com> . + +meta:daste + a foaf:Person ; + foaf:name """Stefano D'Angelo""" ; + foaf:mbox <mailto:zanga.mail@gmail.com> . + +meta:kfoltman + a foaf:Person ; + foaf:name "Krzysztof Foltman" ; + foaf:mbox <mailto:wdev@foltman.com> . + +meta:paniq + a foaf:Person ; + foaf:name "Leonard Ritter" ; + foaf:mbox <mailto:paniq@paniq.org> . + +meta:harry + a foaf:Person ; + foaf:name "Harry van Haaren" ; + foaf:mbox <harryhaaren@gmail.com> . + +meta:bmwiedemann + a foaf:Person ; + foaf:name "Bernhard M. Wiedemann" ; + foaf:mbox <bwiedemann@suse.de> . + diff --git a/lv2/data-access.lv2/data-access.meta.ttl b/lv2/data-access.lv2/data-access.meta.ttl new file mode 100644 index 0000000..f3a3d19 --- /dev/null +++ b/lv2/data-access.lv2/data-access.meta.ttl @@ -0,0 +1,42 @@ +@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#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/data-access> + a doap:Project ; + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a feature, LV2_Extension_Data_Feature, which provides +access to LV2_Descriptor::extension_data() for plugin UIs or other potentially +remote users of a plugin. + +Note that the use of this extension by UIs violates the important principle of +UI/plugin separation, and is potentially a source of many problems. +Accordingly, **use of this extension is highly discouraged**, and plugins +should not expect hosts to support it, since it is often impossible to do so. + +To support this feature the host must pass an LV2_Feature struct to +LV2_Descriptor::extension_data() with URI LV2_DATA_ACCESS_URI and data pointed +to an instance of LV2_Extension_Data_Feature. + +"""^^lv2:Markdown . + diff --git a/lv2/data-access.lv2/data-access.ttl b/lv2/data-access.lv2/data-access.ttl new file mode 100644 index 0000000..b0dc6f4 --- /dev/null +++ b/lv2/data-access.lv2/data-access.ttl @@ -0,0 +1,10 @@ +@prefix da: <http://lv2plug.in/ns/ext/data-access#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/data-access> + a lv2:Feature ; + rdfs:label "data access" ; + rdfs:comment "A feature that provides access to plugin extension data." ; + rdfs:seeAlso <data-access.meta.ttl> . + diff --git a/ext/data-access.lv2/manifest.ttl b/lv2/data-access.lv2/manifest.ttl index 11b6e52..9585a5e 100644 --- a/ext/data-access.lv2/manifest.ttl +++ b/lv2/data-access.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/data-access> a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; rdfs:seeAlso <data-access.ttl> . diff --git a/lv2/dynmanifest.lv2/dynmanifest.meta.ttl b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl new file mode 100644 index 0000000..2391678 --- /dev/null +++ b/lv2/dynmanifest.lv2/dynmanifest.meta.ttl @@ -0,0 +1,111 @@ +@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/> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/dynmanifest> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 Dynamic Manifest" ; + doap:homepage <http://naspro.atheme.org> ; + doap:created "2009-06-13" ; + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +The LV2 API, on its own, cannot be used to write plugin libraries where data is +dynamically generated at runtime, since LV2 requires needed information to be +provided in one or more static data (RDF) files. This API addresses this +limitation by extending the LV2 API. + +To detect that a plugin library implements a dynamic manifest generator, the +host checks its static manifest for a description like: + + :::turtle + <http://example.org/my-dynamic-manifest> + a dman:DynManifest ; + lv2:binary <mydynmanifest.so> . + +To load the data, the host loads the library (`mydynmanifest.so` in this +example) as usual and fetches the dynamic Turtle data from it using this API. + +The host is allowed to request regeneration of the dynamic manifest multiple +times, and the plugin library is expected to provide updated data if/when +possible. All data and references provided via this API before the last +regeneration of the dynamic manifest is to be considered invalid by the host, +including plugin descriptors whose URIs were discovered using this API. + +### Accessing Data + +To access data using this API, the host must: + + 1. Call lv2_dyn_manifest_open(). + + 2. Create a `FILE` for functions to write data to (for example with `tmpfile()`). + + 3. Get a list of exposed subject URIs using lv2_dyn_manifest_get_subjects(). + + 4. Call lv2_dyn_manifest_get_data() for each URI of interest to write the + related data to the file. + + 5. Call lv2_dyn_manifest_close(). + + 6. Parse the content of the file(s). + + 7. Remove the file(s). + +Each call to the above mentioned dynamic manifest functions MUST write a +complete, valid Turtle document (including all needed prefix definitions) to +the output FILE. + +Each call to lv2_dyn_manifest_open() causes the (re)generation of the dynamic +manifest data, and invalidates all data fetched before the call. + +In case the plugin library uses this same API to access other dynamic +manifests, it MUST implement some mechanism to avoid potentially endless loops +(such as A loads B, B loads A, etc.) and, in case such a loop is detected, the +operation MUST fail. For this purpose, use of a static boolean flag is +suggested. + +### Threading Rules + +All of the functions defined by this specification belong to the Discovery +class. + + +"""^^lv2:Markdown . + +dman:DynManifest + lv2:documentation """ + +There MUST NOT be any instances of dman:DynManifest in the generated manifest. + +All relative URIs in the generated data MUST be relative to the base path that +would be used to parse a normal LV2 manifest (the bundle path). + +"""^^lv2:Markdown . + diff --git a/lv2/dynmanifest.lv2/dynmanifest.ttl b/lv2/dynmanifest.lv2/dynmanifest.ttl new file mode 100644 index 0000000..b46d694 --- /dev/null +++ b/lv2/dynmanifest.lv2/dynmanifest.ttl @@ -0,0 +1,24 @@ +@prefix dman: <http://lv2plug.in/ns/ext/dynmanifest#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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://lv2plug.in/ns/ext/dynmanifest> + a owl:Ontology ; + rdfs:label "LV2 Dyn Manifest" ; + rdfs:comment "Support for dynamic manifest data generation." ; + rdfs:seeAlso <dynmanifest.meta.ttl> . + +dman:DynManifest + a rdfs:Class ; + rdfs:label "Dynamic Manifest" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:binary ; + owl:minCardinality 1 ; + rdfs:comment "A DynManifest MUST have at least one lv2:binary." + ] ; + rdfs:comment "Dynamic manifest for an LV2 binary." . + diff --git a/lv2/dynmanifest.lv2/manifest.ttl b/lv2/dynmanifest.lv2/manifest.ttl new file mode 100644 index 0000000..db27a73 --- /dev/null +++ b/lv2/dynmanifest.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/dynmanifest> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso <dynmanifest.ttl> . + diff --git a/lv2/event.lv2/event.meta.ttl b/lv2/event.lv2/event.meta.ttl new file mode 100644 index 0000000..d8b734a --- /dev/null +++ b/lv2/event.lv2/event.meta.ttl @@ -0,0 +1,218 @@ +@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/> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/event> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 Event" ; + doap:shortdesc "A port-based real-time generic event interface." ; + doap:created "2008-00-00" ; + doap:developer <http://drobilla.net/drobilla#me> , + <http://lv2plug.in/ns/meta#larsl> ; + doap:release [ + doap:revision "1.14" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +<span class="warning">This extension is deprecated.</span> New implementations +should use <a href="atom.html">LV2 Atom</a> instead. + +This extension defines a generic time-stamped event port type, which can be +used to create plugins that read and write real-time events, such as MIDI, +OSC, or any other type of event payload. The type(s) of event supported by +a port is defined in the data file for a plugin, for example: + + :::turtle + <http://example.org/some-plugin> + lv2:port [ + a ev:EventPort, lv2:InputPort ; + lv2:index 0 ; + ev:supportsEvent <http://lv2plug.in/ns/ext/midi#MidiEvent> ; + lv2:symbol "midi_input" ; + lv2:name "MIDI input" ; + ] . + +"""^^lv2:Markdown . + +ev:EventPort + lv2:documentation """ + +Ports of this type will be connected to a struct of type LV2_Event_Buffer, +defined in event.h. These ports contain a sequence of generic events (possibly +several types mixed in a single stream), the specific types of which are +defined by some URI in another LV2 extension. + +"""^^lv2:Markdown . + +ev:Event + a rdfs:Class ; + rdfs:label "Event" ; + lv2:documentation """ + +An ev:EventPort contains an LV2_Event_Buffer which contains a sequence of these +events. The binary format of LV2 events is defined by the LV2_Event struct in +event.h. + +Specific event types (such as MIDI or OSC) are defined by extensions, and +should be rdfs:subClassOf this class. + +"""^^lv2:Markdown . + +ev:TimeStamp + lv2:documentation """ + +This defines the meaning of the 'frames' and 'subframes' fields of an LV2_Event +(both unsigned 32-bit integers). + +"""^^lv2:Markdown . + +ev:FrameStamp + lv2:documentation """ + +The default time stamp unit for an LV2 event: the frames field represents audio +frames (in the sample rate passed to instantiate), and the subframes field is +1/UINT32_MAX of a frame. + +"""^^lv2:Markdown . + +ev:generic + lv2:documentation """ + +Indicates that this port does something meaningful for any event type. This is +useful for things like event mixers, delays, serialisers, and so on. + +If this property is set, hosts should consider the port suitable for any type +of event. Otherwise, hosts should consider the port 'appropriate' only for the +specific event types listed with :supportsEvent. Note that plugins must +gracefully handle unknown event types whether or not this property is present. + +"""^^lv2:Markdown . + +ev:supportsEvent + lv2:documentation """ + +Indicates that this port supports or "understands" a certain event type. + +For input ports, this means the plugin understands and does something useful +with events of this type. For output ports, this means the plugin may generate +events of this type. If the plugin never actually generates events of this +type, but might pass them through from an input, this property should not be +set (use ev:inheritsEvent for that). + +Plugins with event input ports must always gracefully handle any type of event, +even if it does not 'support' it. This property should always be set for event +types the plugin understands/generates so hosts can discover plugins +appropriate for a given scenario (for example, plugins with a MIDI input). +Hosts are not expected to consider event ports suitable for some type of event +if the relevant :supportsEvent property is not set, unless the ev:generic +property for that port is also set. + + +"""^^lv2:Markdown . + +ev:inheritsEvent + lv2:documentation """ + +Indicates that this output port might pass through events that arrived at some +other input port (or generate an event of the same type as events arriving at +that input). The host must always check the stamp type of all outputs when +connecting an input, but this property should be set whenever it applies. + + +"""^^lv2:Markdown . + +ev:supportsTimeStamp + lv2:documentation """ + +Indicates that this port supports or "understands" a certain time stamp type. +Meaningful only for input ports, the host must never connect a port to an event +buffer with a time stamp type that isn't supported by the port. + +"""^^lv2:Markdown . + +ev:generatesTimeStamp + lv2:documentation """ + +Indicates that this port may output a certain time stamp type, regardless of +the time stamp type of any input ports. + +If the port outputs stamps based on what type inputs are connected to, this +property should not be set (use the ev:inheritsTimeStamp property for that). +Hosts MUST check the time_stamp value of any output port buffers after a call +to connect_port on ANY event input port on the plugin. + +If the plugin changes the stamp_type field of an output event buffer during a +call to run(), the plugin must call the stamp_type_changed function provided by +the host in the LV2_Event_Feature struct, if it is non-NULL. + +"""^^lv2:Markdown . + +ev:inheritsTimeStamp + lv2:documentation """ + +Indicates that this port follows the time stamp type of an input port. + +This property is not necessary, but it should be set for outputs that base +their output type on an input port so the host can make more sense of the +plugin and provide a more sensible interface. + +"""^^lv2:Markdown . + diff --git a/lv2/event.lv2/event.ttl b/lv2/event.lv2/event.ttl new file mode 100644 index 0000000..2d871f6 --- /dev/null +++ b/lv2/event.lv2/event.ttl @@ -0,0 +1,85 @@ +@prefix ev: <http://lv2plug.in/ns/ext/event#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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#> . + +<http://lv2plug.in/ns/ext/event> + a owl:Ontology ; + owl:deprecated true ; + rdfs:label "LV2 Event" ; + rdfs:comment "A port-based real-time generic event interface." ; + rdfs:seeAlso <event.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +ev:EventPort + a rdfs:Class ; + rdfs:label "Event Port" ; + rdfs:subClassOf lv2:Port ; + rdfs:comment "An LV2 event port." . + +ev:Event + a rdfs:Class ; + rdfs:label "Event" ; + rdfs:comment "A single generic time-stamped event." . + +ev:TimeStamp + a rdfs:Class ; + rdfs:label "Event Time Stamp" ; + rdfs:comment "The time stamp of an Event." . + +ev:FrameStamp + a rdfs:Class ; + rdfs:subClassOf ev:TimeStamp ; + rdfs:label "Audio Frame Time Stamp" ; + rdfs:comment "The default time stamp unit for an event." . + +ev:generic + a lv2:PortProperty ; + rdfs:label "generic event port" ; + rdfs:comment "Port works with generic events." . + +ev:supportsEvent + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort ; + rdfs:range rdfs:Class ; + rdfs:label "supports event type" ; + rdfs:comment "An event type supported by this port." . + +ev:inheritsEvent + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:OutputPort ; + rdfs:range lv2:Port ; + rdfs:label "inherits event type" ; + rdfs:comment "Output port inherits event types from an input port." . + +ev:supportsTimeStamp + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:InputPort ; + rdfs:range rdfs:Class ; + rdfs:label "supports time stamp type" ; + rdfs:comment "A time stamp type supported by this input port." . + +ev:generatesTimeStamp + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:OutputPort ; + rdfs:range rdfs:Class ; + rdfs:label "generates time stamp type" ; + rdfs:comment "A time stamp type generated by this input port." . + +ev:inheritsTimeStamp + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ev:EventPort , + lv2:OutputPort ; + rdfs:range lv2:Port ; + rdfs:label "inherits time stamp type" ; + rdfs:comment "Output port inherits time stamp types from an input port." . + diff --git a/ext/event.lv2/manifest.ttl b/lv2/event.lv2/manifest.ttl index 8f17311..230fe73 100644 --- a/ext/event.lv2/manifest.ttl +++ b/lv2/event.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/event> a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 14 ; rdfs:seeAlso <event.ttl> . 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..1106334 --- /dev/null +++ b/lv2/instance-access.lv2/instance-access.meta.ttl @@ -0,0 +1,41 @@ +@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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a feature which allows plugin UIs to get a direct handle +to an LV2 plugin instance (LV2_Handle), if possible. + +Note that the use of this extension by UIs violates the important principle of +UI/plugin separation, and is potentially a source of many problems. +Accordingly, **use of this extension is highly discouraged**, and plugins +should not expect hosts to support it, since it is often impossible to do so. + +To support this feature the host must pass an LV2_Feature struct to the UI +instantiate method with URI LV2_INSTANCE_ACCESS_URI and data pointed directly +to the LV2_Handle of the plugin instance. + +"""^^lv2:Markdown . + diff --git a/lv2/instance-access.lv2/instance-access.ttl b/lv2/instance-access.lv2/instance-access.ttl new file mode 100644 index 0000000..637f4e0 --- /dev/null +++ b/lv2/instance-access.lv2/instance-access.ttl @@ -0,0 +1,10 @@ +@prefix ia: <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 lv2:Feature ; + rdfs:label "instance access" ; + rdfs:comment "A feature that provides access to a plugin instance." ; + rdfs:seeAlso <instance-access.meta.ttl> . + diff --git a/ext/instance-access.lv2/manifest.ttl b/lv2/instance-access.lv2/manifest.ttl index e1f154b..e6c8810 100644 --- a/ext/instance-access.lv2/manifest.ttl +++ b/lv2/instance-access.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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 lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; rdfs:seeAlso <instance-access.ttl> . diff --git a/lv2/log.lv2/log.meta.ttl b/lv2/log.lv2/log.meta.ttl new file mode 100644 index 0000000..87cff43 --- /dev/null +++ b/lv2/log.lv2/log.meta.ttl @@ -0,0 +1,126 @@ +@prefix dcs: <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#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/log> + a doap:Project ; + doap:name "LV2 Log" ; + 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 +messages with an API similar to the standard C `printf` function. This allows, +for example, plugin logs to be nicely presented to the user in a graphical user +interface. + +Different log levels are defined by URI and passed as an LV2_URID. This +extensions defines standard levels which are expected to be understood by all +implementations and should be sufficient in most cases, but advanced +implementations may define and use additional levels to suit their needs. + +"""^^lv2:Markdown . + +log:Entry + a rdfs:Class ; + rdfs:label "Log Entry" ; + lv2:documentation """ + +Subclasses of this are passed as the `type` parameter to LV2_Log_Log methods to +describe the nature of the log entry. + +"""^^lv2:Markdown . + +log:Error + lv2:documentation """ + +An error should only be posted when a serious unexpected error occurs, and +should be actively shown to the user by the host. + +"""^^lv2:Markdown . + +log:Note + lv2:documentation """ + +A note records some useful piece of information, but may be ignored. The host +should provide passive access to note entries to the user. + +"""^^lv2:Markdown . + +log:Warning + lv2:documentation """ + +A warning should be posted when an unexpected, but non-critical, error occurs. +The host should provide passive access to warnings entries to the user, but may +also choose to actively show them. + +"""^^lv2:Markdown . + +log:Trace + lv2:documentation """ + +A trace should not be displayed during normal operation, but the host may +implement an option to display them for debugging purposes. + +This entry type is special in that one may be posted in a real-time thread. It +is assumed that if debug tracing is enabled, real-time performance is not a +concern. However, the host MUST guarantee that posting a trace _is_ real-time +safe if debug tracing is not enabled (for example, by simply ignoring the call +as early as possible). + +"""^^lv2:Markdown . + +log:log + lv2:documentation """ + +A feature which plugins may use to log messages. To support this feature, +the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI +LV2_LOG__log and data pointed to an instance of LV2_Log_Log. + +"""^^lv2:Markdown . + diff --git a/lv2/log.lv2/log.ttl b/lv2/log.lv2/log.ttl new file mode 100644 index 0000000..0b334ed --- /dev/null +++ b/lv2/log.lv2/log.ttl @@ -0,0 +1,48 @@ +@prefix log: <http://lv2plug.in/ns/ext/log#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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://lv2plug.in/ns/ext/log> + a owl:Ontology ; + rdfs:label "LV2 Log" ; + rdfs:comment "A feature for writing log messages." ; + rdfs:seeAlso <log.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +log:Entry + a rdfs:Class ; + rdfs:label "Entry" ; + rdfs:comment "A log entry." . + +log:Error + a rdfs:Class ; + rdfs:label "Error" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "An error message." . + +log:Note + a rdfs:Class ; + rdfs:label "Note" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "An informative message." . + +log:Warning + a rdfs:Class ; + rdfs:label "Warning" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "A warning message." . + +log:Trace + a rdfs:Class ; + rdfs:label "Trace" ; + rdfs:subClassOf log:Entry ; + rdfs:comment "A debugging trace message." . + +log:log + a lv2:Feature ; + rdfs:label "log" ; + rdfs:comment "Logging feature." . + diff --git a/lv2/log.lv2/manifest.ttl b/lv2/log.lv2/manifest.ttl new file mode 100644 index 0000000..bcaeff3 --- /dev/null +++ b/lv2/log.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/log> + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 4 ; + rdfs:seeAlso <log.ttl> . + diff --git a/ext/midi.lv2/manifest.ttl b/lv2/midi.lv2/manifest.ttl index f243e8a..f141936 100644 --- a/ext/midi.lv2/manifest.ttl +++ b/lv2/midi.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/midi> a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 10 ; rdfs:seeAlso <midi.ttl> . diff --git a/lv2/midi.lv2/midi.meta.ttl b/lv2/midi.lv2/midi.meta.ttl new file mode 100644 index 0000000..6dc80d6 --- /dev/null +++ b/lv2/midi.lv2/midi.meta.ttl @@ -0,0 +1,115 @@ +@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 midi: <http://lv2plug.in/ns/ext/midi#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/midi> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 MIDI" ; + doap:shortdesc "A normalised definition of raw MIDI." ; + doap:maintainer <http://drobilla.net/drobilla#me> ; + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +This specification defines a data type for a MIDI message, midi:MidiEvent, +which is normalised for fast and convenient real-time processing. MIDI is the +<q>Musical Instrument Digital Interface</q>, a ubiquitous binary standard for +controlling digital music devices. + +For plugins that process MIDI (or other situations where MIDI is sent via a +generic transport) the main type defined here, midi:MidiEvent, can be mapped to +an integer and used as the type of an LV2 [Atom](atom.html#Atom) or +[Event](event.html#Event). + +This specification also defines a complete vocabulary for the MIDI standard, +except for standard controller numbers. These descriptions are detailed enough +to express any MIDI message as properties. + +"""^^lv2:Markdown . + +midi:MidiEvent + lv2:documentation """ + +A single raw MIDI message (a sequence of bytes). + +This is equivalent to a standard MIDI messages, except with the following +restrictions to simplify handling: + + * Running status is not allowed, every message must have its own status byte. + + * Note On messages with velocity 0 are not allowed. These messages are + equivalent to Note Off in standard MIDI streams, but here only proper Note + Off messages are allowed. + + * "Realtime messages" (status bytes 0xF8 to 0xFF) are allowed, but may not + occur inside other messages like they can in standard MIDI streams. + + * All messages are complete valid MIDI messages. This means, for example, + that only the first byte in each event (the status byte) may have the + eighth bit set, that Note On and Note Off events are always 3 bytes long, + etc. + +Where messages are communicated, the writer is responsible for writing valid +messages, and the reader may assume that all events are valid. + +If a midi:MidiEvent is serialised to a string, the format should be +xsd:hexBinary, for example: + + :::turtle + [] eg:someEvent "901A01"^^midi:MidiEvent . + +"""^^lv2:Markdown . + +midi:statusMask + lv2:documentation """ + +This is a status byte with the lower nibble set to zero. + +"""^^lv2:Markdown . + diff --git a/lv2/midi.lv2/midi.ttl b/lv2/midi.lv2/midi.ttl new file mode 100644 index 0000000..4a0e8c9 --- /dev/null +++ b/lv2/midi.lv2/midi.ttl @@ -0,0 +1,365 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix ev: <http://lv2plug.in/ns/ext/event#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix midi: <http://lv2plug.in/ns/ext/midi#> . +@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://lv2plug.in/ns/ext/midi> + a owl:Ontology ; + rdfs:label "LV2 MIDI" ; + rdfs:comment "A normalised definition of raw MIDI." ; + rdfs:seeAlso <midi.meta.ttl> . + +midi:ActiveSense + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Active Sense" ; + rdfs:comment "MIDI active sense message." ; + midi:status "FE"^^xsd:hexBinary . + +midi:Aftertouch + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Aftertouch" ; + rdfs:comment "MIDI aftertouch message." ; + midi:statusMask "A0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:noteNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:pressure + ] . + +midi:Bender + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Bender" ; + rdfs:comment "MIDI bender message." ; + midi:statusMask "E0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 , + 1 ; + midi:property midi:benderValue + ] . + +midi:ChannelPressure + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Channel Pressure" ; + rdfs:comment "MIDI channel pressure message." ; + midi:statusMask "D0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:pressure + ] . + +midi:Chunk + a rdfs:Class ; + rdfs:label "Chunk" ; + rdfs:comment "A sequence of contiguous bytes in a MIDI message." . + +midi:Clock + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Clock" ; + rdfs:comment "MIDI clock message." ; + midi:status "F8"^^xsd:hexBinary . + +midi:Continue + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Continue" ; + rdfs:comment "MIDI continue message." ; + midi:status "FB"^^xsd:hexBinary . + +midi:Controller + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Controller" ; + rdfs:comment "MIDI controller change message." ; + midi:statusMask "B0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:controllerNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:controllerValue + ] . + +midi:HexByte + a rdfs:Datatype ; + owl:onDatatype xsd:hexBinary ; + owl:withRestrictions ( + [ + xsd:maxInclusive "FF" + ] + ) ; + rdfs:label "Hex Byte" ; + rdfs:comment "A hexadecimal byte, which has a value <= FF." . + +midi:MidiEvent + a rdfs:Class , + rdfs:Datatype ; + rdfs:subClassOf ev:Event , + atom:Atom ; + owl:onDatatype xsd:hexBinary ; + rdfs:label "MIDI Message" ; + rdfs:comment "A single raw MIDI message." . + +midi:NoteOff + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Note Off" ; + rdfs:comment "MIDI note off message." ; + midi:statusMask "80"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:noteNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:velocity + ] . + +midi:NoteOn + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Note On" ; + rdfs:comment "MIDI note on message." ; + midi:statusMask "90"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:noteNumber + ] , [ + midi:byteNumber 1 ; + midi:property midi:velocity + ] . + +midi:ProgramChange + a rdfs:Class ; + rdfs:subClassOf midi:VoiceMessage ; + rdfs:label "Program Change" ; + rdfs:comment "MIDI program change message." ; + midi:statusMask "C0"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 ; + midi:property midi:programNumber + ] . + +midi:QuarterFrame + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Quarter Frame" ; + rdfs:comment "MIDI quarter frame message." ; + midi:status "F1"^^xsd:hexBinary . + +midi:Reset + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Reset" ; + rdfs:comment "MIDI reset message." ; + midi:status "FF"^^xsd:hexBinary . + +midi:SongPosition + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Song Position" ; + rdfs:comment "MIDI song position pointer message." ; + midi:status "F2"^^xsd:hexBinary ; + midi:chunk [ + midi:byteNumber 0 , + 1 ; + midi:property midi:songPosition + ] . + +midi:SongSelect + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Song Select" ; + rdfs:comment "MIDI song select message." ; + midi:status "F3"^^xsd:hexBinary . + +midi:Start + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Start" ; + rdfs:comment "MIDI start message." ; + midi:status "FA"^^xsd:hexBinary . + +midi:Stop + a rdfs:Class ; + rdfs:subClassOf midi:SystemRealtime ; + rdfs:label "Stop" ; + rdfs:comment "MIDI stop message." ; + midi:status "FC"^^xsd:hexBinary . + +midi:SystemCommon + a rdfs:Class ; + rdfs:subClassOf midi:SystemMessage ; + rdfs:label "System Common" ; + rdfs:comment "MIDI system common message." . + +midi:SystemExclusive + a rdfs:Class ; + rdfs:subClassOf midi:SystemMessage ; + rdfs:label "System Exclusive" ; + rdfs:comment "MIDI system exclusive message." ; + midi:status "F0"^^xsd:hexBinary . + +midi:SystemMessage + a rdfs:Class ; + rdfs:subClassOf midi:MidiEvent ; + rdfs:label "System Message" ; + rdfs:comment "MIDI system message." ; + midi:statusMask "F0"^^xsd:hexBinary . + +midi:SystemRealtime + a rdfs:Class ; + rdfs:subClassOf midi:SystemMessage ; + rdfs:label "System Realtime" ; + rdfs:comment "MIDI system realtime message." . + +midi:TuneRequest + a rdfs:Class ; + rdfs:subClassOf midi:SystemCommon ; + rdfs:label "Tune Request" ; + rdfs:comment "MIDI tune request message." ; + midi:status "F6"^^xsd:hexBinary . + +midi:VoiceMessage + a rdfs:Class ; + rdfs:subClassOf midi:MidiEvent ; + rdfs:label "Voice Message" ; + rdfs:comment "MIDI voice message." ; + midi:statusMask "F0"^^xsd:hexBinary . + +midi:benderValue + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "bender value" ; + rdfs:range xsd:short ; + rdfs:comment "MIDI pitch bender message (-8192 to 8192)." . + +midi:binding + a rdf:Property , + owl:ObjectProperty ; + rdfs:range midi:MidiEvent ; + rdfs:label "binding" ; + rdfs:comment "The MIDI event to bind a parameter to." . + +midi:byteNumber + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "byte number" ; + rdfs:domain midi:Chunk ; + rdfs:range xsd:unsignedByte ; + rdfs:comment "The 0-based index of a byte which is part of this chunk." . + +midi:channel + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "MIDI channel" ; + rdfs:range xsd:unsignedByte ; + rdfs:comment "The channel number of a MIDI message." . + +midi:chunk + a rdf:Property , + owl:ObjectProperty ; + rdfs:range midi:Chunk ; + rdfs:label "MIDI chunk" ; + rdfs:comment "A chunk of a MIDI message." . + +midi:controllerNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "MIDI controller number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a controller (0 to 127)." . + +midi:controllerValue + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "MIDI controller value" ; + rdfs:range xsd:byte ; + rdfs:comment "The value of a controller (0 to 127)." . + +midi:noteNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "note number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a note (0 to 127)." . + +midi:pressure + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "key pressure" ; + rdfs:range xsd:byte ; + rdfs:comment "Key pressure (0 to 127)." . + +midi:programNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "program number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a program (0 to 127)." . + +midi:property + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:label "property" ; + rdfs:domain midi:Chunk ; + rdfs:range rdf:Property ; + rdfs:comment "The property this chunk represents." . + +midi:songNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "song number" ; + rdfs:range xsd:byte ; + rdfs:comment "The numeric ID of a song (0 to 127)." . + +midi:songPosition + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "song position" ; + rdfs:range xsd:short ; + rdfs:comment "Song position in MIDI beats (16th notes) (-8192 to 8192)." . + +midi:status + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "status byte" ; + rdfs:range midi:HexByte ; + rdfs:comment "The exact status byte for a message of this type." . + +midi:statusMask + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "status mask" ; + rdfs:range midi:HexByte ; + rdfs:comment "The status byte for a message of this type on channel 1." . + +midi:velocity + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "velocity" ; + rdfs:range midi:HexByte ; + rdfs:comment "The velocity of a note message (0 to 127)." . + diff --git a/lv2/morph.lv2/manifest.ttl b/lv2/morph.lv2/manifest.ttl new file mode 100644 index 0000000..7c85cfd --- /dev/null +++ b/lv2/morph.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/morph> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; + rdfs:seeAlso <morph.ttl> . + diff --git a/lv2/morph.lv2/morph.meta.ttl b/lv2/morph.lv2/morph.meta.ttl new file mode 100644 index 0000000..c247783 --- /dev/null +++ b/lv2/morph.lv2/morph.meta.ttl @@ -0,0 +1,90 @@ +@prefix dcs: <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 morph: <http://lv2plug.in/ns/ext/morph#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/morph> + a doap:Project ; + doap:name "LV2 Morph" ; + 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 +host-configurable type, and morph:AutoMorphPort, which may automatically change +type when a MorphPort's type is changed. These ports always have a default +type and work normally work in hosts that are unaware of this extension. Thus, +this extension provides a backwards compatibility mechanism which allows +plugins to use new port types but gracefully fall back to a default type in +hosts that do not support them. + +This extension only defines port types and properties for describing morph +ports. The actual run-time switching is done via the opts:interface API. + +"""^^lv2:Markdown . + +morph:MorphPort + lv2:documentation """ + +Ports of this type MUST have another type which defines the default buffer +format (for example lv2:ControlPort) but can be dynamically changed to a +different type in hosts that support opts:interface. + +The host may change the type of a MorphPort by setting its morph:currentType +with LV2_Options_Interface::set(). If the plugin has any morph:AutoMorphPort +ports, the host MUST check their types after changing any port type since they +may have changed. + +"""^^lv2:Markdown . + +morph:AutoMorphPort + lv2:documentation """ + +Ports of this type MUST have another type which defines the default buffer +format (for example, lv2:ControlPort) but may dynamically change types based on +the configured types of any morph:MorphPort ports on the same plugin instance. + +The type of a port may only change in response to a host call to +LV2_Options_Interface::set(). Whenever any port type on the instance changes, +the host MUST check the type of all morph:AutoMorphPort ports with +LV2_Options_Interface::get() before calling run() again, since they may have +changed. If the type of any port is zero, it means the current configuration +is invalid and the plugin may not be run (unless that port is +lv2:connectionOptional and connected to NULL). + +This is mainly useful for outputs whose type depends on the type of +corresponding inputs. + +"""^^lv2:Markdown . + +morph:supportsType + lv2:documentation """ + +Indicates that a port supports being switched to a certain type. A MorphPort +MUST list each type it supports being switched to in the plugin data using this +property. + +"""^^lv2:Markdown . + +morph:currentType + lv2:documentation """ + +The currently active type of the port. This is for dynamic use as an option +and SHOULD NOT be listed in the static plugin data. + +"""^^lv2:Markdown . + diff --git a/lv2/morph.lv2/morph.ttl b/lv2/morph.lv2/morph.ttl new file mode 100644 index 0000000..9b8ef51 --- /dev/null +++ b/lv2/morph.lv2/morph.ttl @@ -0,0 +1,46 @@ +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix morph: <http://lv2plug.in/ns/ext/morph#> . +@prefix opts: <http://lv2plug.in/ns/ext/options#> . +@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://lv2plug.in/ns/ext/morph> + a owl:Ontology ; + rdfs:label "LV2 Morph" ; + rdfs:comment "Ports that can dynamically change type." ; + rdfs:seeAlso <morph.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +morph:MorphPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Morph Port" ; + rdfs:comment "A port which can be switched to another type." . + +morph:AutoMorphPort + a rdfs:Class , + owl:Class ; + rdfs:subClassOf lv2:Port ; + rdfs:label "Auto Morph Port" ; + rdfs:comment "A port that can change its type based on that of another." . + +morph:supportsType + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain morph:MorphPort ; + rdfs:label "supports type" ; + rdfs:comment "A type that a port supports being switched to." . + +morph:currentType + a rdf:Property , + opts:Option , + owl:ObjectProperty ; + rdfs:domain morph:MorphPort ; + rdfs:label "current type" ; + rdfs:comment "The currently active type of the port." . + diff --git a/lv2/options.lv2/manifest.ttl b/lv2/options.lv2/manifest.ttl new file mode 100644 index 0000000..18db448 --- /dev/null +++ b/lv2/options.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/options> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso <options.ttl> . + diff --git a/lv2/options.lv2/options.meta.ttl b/lv2/options.lv2/options.meta.ttl new file mode 100644 index 0000000..838b0b9 --- /dev/null +++ b/lv2/options.lv2/options.meta.ttl @@ -0,0 +1,129 @@ +@prefix dcs: <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 opts: <http://lv2plug.in/ns/ext/options#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/options> + a doap:Project ; + doap:name "LV2 Options" ; + 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 +passes to a plugin or UI at run time. + +There are two facilities for passing options to an instance: opts:options +allows passing options at instantiation time, and the opts:interface interface +allows options to be dynamically set and retrieved after instantiation. + +Note that this extension is only for allowing hosts to configure plugins, and +is not a <q>live</q> control mechanism. For real-time control, use event-based +control via an atom:AtomPort with an atom:Sequence buffer. + +Instances may indicate they require an option with the opts:requiredOption +property, or that they optionally support an option with the +opts:supportedOption property. + +"""^^lv2:Markdown . + +opts:Option + lv2:documentation """ + +It is not required for a property to explicitly be an Option in order to be +used as such. However, properties which are primarily intended for use as +options, or are at least particularly useful as options, should be explicitly +given this type for documentation purposes, and to assist hosts in discovering +option definitions. + +"""^^lv2:Markdown . + +opts:interface + lv2:documentation """ + +An interface (LV2_Options_Interface) for dynamically setting and getting +options. Note that this is intended for use by the host for configuring +plugins only, and is not a <q>live</q> plugin control mechanism. + +The plugin data file should advertise this interface like so: + + :::turtle + @prefix opts: <http://lv2plug.in/ns/ext/options#> . + + <plugin> + a lv2:Plugin ; + lv2:extensionData opts:interface . + +"""^^lv2:Markdown . + +opts:options + lv2:documentation """ + +To implement this feature, hosts MUST pass an LV2_Feature to the appropriate +instantiate method with this URI and data pointed to an array of +LV2_Options_Option terminated by an element with both key and value set to +zero. The instance should cast this data pointer to `const +LV2_Options_Option*` and scan the array for any options of interest. The +instance MUST NOT modify the options array in any way. + +Note that requiring this feature may reduce the number of compatible hosts. +Unless some options are strictly required by the instance, this feature SHOULD +be listed as an lv2:optionalFeature. + +"""^^lv2:Markdown . + +opts:requiredOption + lv2:documentation """ + +The host MUST pass a value for the specified option via opts:options during +instantiation. + +Note that use of this property may reduce the number of compatible hosts. +Wherever possible, it is better to list options with opts:supportedOption and +fall back to a reasonable default value if it is not provided. + +"""^^lv2:Markdown . + +opts:supportedOption + lv2:documentation """ + +The host SHOULD provide a value for the specified option if one is known, or +provide the user an opportunity to specify one if possible. + +"""^^lv2:Markdown . + diff --git a/lv2/options.lv2/options.ttl b/lv2/options.lv2/options.ttl new file mode 100644 index 0000000..5f9fcc9 --- /dev/null +++ b/lv2/options.lv2/options.ttl @@ -0,0 +1,44 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix opts: <http://lv2plug.in/ns/ext/options#> . +@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://lv2plug.in/ns/ext/options> + a owl:Ontology ; + rdfs:label "LV2 Options" ; + rdfs:comment "Runtime options for LV2 plugins and UIs." ; + rdfs:seeAlso <options.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +opts:Option + a rdfs:Class ; + rdfs:label "Option" ; + rdfs:subClassOf rdf:Property ; + rdfs:comment "A value for a static option passed to an instance." . + +opts:interface + a lv2:ExtensionData ; + rdfs:label "interface" ; + rdfs:comment "An interface for dynamically setting and getting options." . + +opts:options + a lv2:Feature ; + rdfs:label "options" ; + rdfs:comment "The feature used to provide options to an instance." . + +opts:requiredOption + a rdf:Property , + owl:ObjectProperty ; + rdfs:range rdf:Property ; + rdfs:label "required option" ; + rdfs:comment "An option required by the instance to function at all." . + +opts:supportedOption + a rdf:Property , + owl:ObjectProperty ; + rdfs:range rdf:Property ; + rdfs:label "supported option" ; + rdfs:comment "An option supported or by the instance." . + diff --git a/lv2/parameters.lv2/manifest.ttl b/lv2/parameters.lv2/manifest.ttl new file mode 100644 index 0000000..57f5d2e --- /dev/null +++ b/lv2/parameters.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/parameters> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso <parameters.ttl> . + diff --git a/lv2/parameters.lv2/parameters.meta.ttl b/lv2/parameters.lv2/parameters.meta.ttl new file mode 100644 index 0000000..9d7c623 --- /dev/null +++ b/lv2/parameters.lv2/parameters.meta.ttl @@ -0,0 +1,75 @@ +@prefix dcs: <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 param: <http://lv2plug.in/ns/ext/parameters#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<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> ; + doap:developer <http://lv2plug.in/ns/meta#larsl> ; + lv2:documentation """ + +This is a vocabulary for parameters that are common in audio processing +software. A <q>parameter</q> is purely a metadata concept, unrelated to any +particular code mechanism. Parameters are used to assign meaning to controls +(for example, using lv2:designation for ports) so they can be used more +intelligently or presented to the user more efficiently. + +"""^^lv2:Markdown . + +param:wetDryRatio + a lv2:Parameter ; + rdfs:label "wet/dry ratio" ; + lv2:documentation """ + +The ratio between processed and bypass components in output signal. The dry +and wet percentages can be calculated from the following equations: + + :::c + dry = (wetDryRatio.maximum - wetDryRatio.value) / wetDryRatio.maximum + wet = wetDryRatio.value / wetDryRatio.maximum + +Typically, maximum value of 1 or 100 and minimum value of 0 should be used. + +"""^^lv2:Markdown . + diff --git a/lv2/parameters.lv2/parameters.ttl b/lv2/parameters.lv2/parameters.ttl new file mode 100644 index 0000000..9987812 --- /dev/null +++ b/lv2/parameters.lv2/parameters.ttl @@ -0,0 +1,205 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix param: <http://lv2plug.in/ns/ext/parameters#> . +@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix units: <http://lv2plug.in/ns/extensions/units#> . + +<http://lv2plug.in/ns/ext/parameters> + a owl:Ontology ; + rdfs:label "LV2 Parameters" ; + rdfs:comment "Common parameters for audio processing." ; + 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 ; + rdfs:subClassOf pg:Group ; + rdfs:label "Control Group" ; + rdfs:comment "A group representing a set of associated controls." . + +param:amplitude + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "amplitude" ; + rdfs:comment "An amplitude as a factor, where 0 is silent and 1 is unity." . + +param:attack + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "attack" ; + rdfs:comment "The duration of an envelope attack stage." . + +param:cutoffFrequency + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "cutoff frequency" ; + rdfs:comment "The cutoff frequency, typically in Hz, for a filter." . + +param:decay + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "decay" ; + rdfs:comment "The duration of an envelope decay stage." . + +param:delay + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "delay" ; + rdfs:comment "The duration of an envelope delay stage." . + +param:frequency + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "frequency" ; + rdfs:comment "A frequency, typically in Hz." . + +param:hold + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "hold" ; + rdfs:comment "The duration of an envelope hold stage." . + +param:pulseWidth + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "pulse width" ; + rdfs:comment "The width of a pulse of a rectangular waveform." . + +param:ratio + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "ratio" ; + rdfs:comment "Compression ratio." . + +param:release + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "release" ; + rdfs:comment "The duration of an envelope release stage." . + +param:resonance + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "resonance" ; + rdfs:comment "The resonance of a filter." . + +param:sustain + a lv2:Parameter ; + rdfs:label "sustain" ; + rdfs:range atom:Float ; + rdfs:comment "The level of an envelope sustain stage as a factor." . + +param:threshold + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "threshold" ; + rdfs:comment "Compression threshold." . + +param:waveform + a lv2:Parameter ; + rdfs:range atom:Float ; + rdfs:label "waveform" ; + rdfs:comment """The waveform "fader" for oscillators or modulators that have several.""" . + +param:gain + a lv2:Parameter ; + rdfs:range atom:Float ; + lv2:default 0.0 ; + lv2:minimum -20.0 ; + lv2:maximum 20.0 ; + units:unit units:db ; + rdfs:label "gain" ; + rdfs:comment "Gain in decibels." . + +param:wetDryRatio + a lv2:Parameter ; + rdfs:label "wet/dry ratio" ; + rdfs:comment "The ratio between processed and bypassed levels in the output." . + +param:wetLevel + a lv2:Parameter ; + rdfs:label "wet level" ; + rdfs:comment "The level of the processed component of a signal." . + +param:dryLevel + a lv2:Parameter ; + rdfs:label "dry level" ; + rdfs:comment "The level of the unprocessed component of a signal." . + +param:bypass + a lv2:Parameter ; + rdfs:label "bypass" ; + rdfs:comment "A boolean parameter that disables processing if true." . + +param:sampleRate + a lv2:Parameter ; + rdfs:label "sample rate" ; + rdfs:comment "A sample rate in Hz." . + +param:EnvelopeControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Envelope Controls" ; + rdfs:comment "Typical controls for a DAHDSR envelope." ; + pg:element [ + lv2:index 0 ; + lv2:designation param:delay + ] , [ + lv2:index 1 ; + lv2:designation param:attack + ] , [ + lv2:index 2 ; + lv2:designation param:hold + ] , [ + lv2:index 3 ; + lv2:designation param:decay + ] , [ + lv2:index 4 ; + lv2:designation param:sustain + ] , [ + lv2:index 5 ; + lv2:designation param:release + ] . + +param:OscillatorControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Oscillator Controls" ; + rdfs:comment "Typical controls for an oscillator." ; + pg:element [ + lv2:designation param:frequency + ] , [ + lv2:designation param:amplitude + ] , [ + lv2:designation param:waveform + ] , [ + lv2:designation param:pulseWidth + ] . + +param:FilterControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Filter Controls" ; + rdfs:comment "Typical controls for a filter." ; + pg:element [ + lv2:designation param:cutoffFrequency + ] , [ + lv2:designation param:resonance + ] . + +param:CompressorControls + a rdfs:Class ; + rdfs:subClassOf param:ControlGroup ; + rdfs:label "Compressor Controls" ; + rdfs:comment "Typical controls for a compressor." ; + pg:element [ + lv2:designation param:threshold + ] , [ + lv2:designation param:ratio + ] . + diff --git a/lv2/patch.lv2/manifest.ttl b/lv2/patch.lv2/manifest.ttl new file mode 100644 index 0000000..4bf9cfb --- /dev/null +++ b/lv2/patch.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/patch> + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 10 ; + rdfs:seeAlso <patch.ttl> . + diff --git a/lv2/patch.lv2/patch.meta.ttl b/lv2/patch.lv2/patch.meta.ttl new file mode 100644 index 0000000..12cb6c6 --- /dev/null +++ b/lv2/patch.lv2/patch.meta.ttl @@ -0,0 +1,388 @@ +@prefix dcs: <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 patch: <http://lv2plug.in/ns/ext/patch#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/patch> + a doap:Project ; + doap:created "2012-02-09" ; + doap:license <http://opensource.org/licenses/isc> ; + 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.10" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] , [ + rdfs:label "Make the type of patch:wildcard more precise." + ] , [ + rdfs:label "Fix type and range of patch:value." + ] + ] + ] , [ + doap:revision "2.8" ; + doap:created "2020-04-26" ; + doap:file-release <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 receiver. This can be used by UIs to get an initial description of a plugin." + ] , [ + rdfs:label "Add patch:Copy method." + ] + ] + ] , [ + doap:revision "2.2" ; + doap:created "2014-08-08" ; + doap:file-release <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. +It can be used as a dynamic control interface for plugins, +or anything else with a property-based model. + +The key underlying concept here is to control things by manipulating arbitrary properties, +rather than by calling application-specific methods. +This allows implementations to understand what messages do +(at least in a mechanical sense), +which makes things like caching, proxying, or undo relatively straightforward to implement. +Note, however, that this is only conceptual: +there is no requirement to implement a general property store. +Typically, a plugin will understand a fixed set of properties that represent its parameters or other internal state, and ignore everything else. + +This protocol is syntax-agnostic, +and [homoiconic](https://en.wikipedia.org/wiki/Homoiconicity) +in the sense that the messages use the same format as the data they manipulate. +In particular, messages can be serialised as a binary [Object](atom.html#Object) for realtime plugin control, +or as Turtle for saving to a file, +sending over a network, +printing for debugging purposes, +and so on. + +This specification only defines a semantic protocol, +there is no corresponding API. +It can be used with the [Atom](atom.html) extension to control plugins which support message-based parameters as defined by the [Parameters](parameters.html) extension. + +For example, if a plugin defines a `eg:volume` parameter, it can be controlled by the host by sending a patch:Set message to the plugin instance: + + :::turtle + [ + a patch:Set ; + patch:property eg:volume ; + patch:value 11.0 ; + ] + +Similarly, the host could get the current value for this parameter by sending a patch:Get message: + + :::turtle + [ + a patch:Get ; + patch:property eg:volume ; + ] + +The plugin would then respond with the same patch:Set message as above. +In this case, the plugin instance is implicitly the patch:subject, +but a specific subject can also be given for deeper control. + +"""^^lv2:Markdown . + +patch:Copy + lv2:documentation """ + +After this, the destination has the same description as the subject, +and the subject is unchanged. + +It is an error if the subject does not exist, +or if the destination already exists. + +Multiple subjects may be given if the destination is a container, +but the semantics of this case are application-defined. + +"""^^lv2:Markdown . + +patch:Get + lv2:documentation """ + +If a patch:property is given, +then the receiver should respond with a patch:Set message that gives only that property. + +Otherwise, it should respond with a [concise bounded description](http://www.w3.org/Submission/CBD/) in a patch:Put message, +that is, a description that recursively includes any blank node values. + +If a patch:subject is given, then the response should have the same subject. +If no subject is given, then the receiver is implicitly the subject. + +If a patch:request node or a patch:sequenceNumber is given, +then the response should be a patch:Response and have the same property. +If neither is given, then the receiver can respond with a simple patch:Put message. +For example: + + :::turtle + [] + a patch:Get ; + patch:subject eg:something . + +Could result in: + + :::turtle + [] + a patch:Put ; + patch:subject eg:something ; + patch:body [ + eg:name "Something" ; + eg:ratio 1.6180339887 ; + ] . + +"""^^lv2:Markdown . + +patch:Insert + lv2:documentation """ + +If the subject does not exist, it is created. If the subject does already +exist, it is added to. + +This request only adds properties, it never removes them. The user must take +care that multiple values are not set for properties which should only have +one. + +"""^^lv2:Markdown . + +patch:Message + lv2:documentation """ + +This is an abstract base class for all patch messages. Concrete messages are +either a patch:Request or a patch:Response. + +"""^^lv2:Markdown . + +patch:Move + lv2:documentation """ + +After this, the destination has the description that the subject had, and the +subject no longer exists. + +It is an error if the subject does not exist, or if the destination already +exists. + +"""^^lv2:Markdown . + +patch:Patch + lv2:documentation """ + +This method always has at least one subject, and exactly one patch:add and +patch:remove property. The value of patch:add and patch:remove are nodes which +have the properties to add or remove from the subject(s), respectively. The +special value patch:wildcard may be used as the value of a remove property to +remove all properties with the given predicate. For example: + + :::turtle + [] + a patch:Patch ; + patch:subject <something> ; + patch:add [ + eg:name "New name" ; + eg:age 42 ; + ] ; + patch:remove [ + eg:name "Old name" ; + eg:age patch:wildcard ; # Remove all old eg:age properties + ] . + +"""^^lv2:Markdown . + +patch:Put + lv2:documentation """ + +If the subject does not already exist, it is created. If the subject does +already exist, the patch:body is considered an updated version of it, and the +previous version is replaced. + + :::turtle + [] + a patch:Put ; + patch:subject <something> ; + patch:body [ + eg:name "New name" ; + eg:age 42 ; + ] . + +"""^^lv2:Markdown . + +patch:Request + a rdfs:Class ; + rdfs:label "Request" ; + rdfs:subClassOf patch:Message ; + lv2:documentation """ + +A request may have a patch:subject property, which specifies the resource that +the request applies to. The subject may be omitted in contexts where it is +implicit, for example if the recipient is the subject. + +"""^^lv2:Markdown . + +patch:Set + lv2:documentation """ + +This is equivalent to a patch:Patch which removes _all_ pre-existing values for +the property before setting the new value. For example: + + :::turtle + [] + a patch:Set ; + patch:subject <something> ; + patch:property eg:name ; + patch:value "New name" . + +Which is equivalent to: + + :::turtle + [] + a patch:Patch ; + patch:subject <something> ; + patch:add [ + eg:name "New name" ; + ] ; + patch:remove [ + eg:name patch:wildcard ; + ] . + +"""^^lv2:Markdown . + +patch:body + lv2:documentation """ + +The details of this property's value depend on the type of message it is a part +of. + +"""^^lv2:Markdown . + +patch:context + lv2:documentation """ + +For example, a plugin may have a special context for ephemeral properties which +are only relevant during the lifetime of the instance and should not be saved +in state. + +The specific uses for contexts are application specific. However, the context +MUST be a URI, and can be interpreted as the ID of a data model where +properties should be stored. Implementations MAY have special support for +contexts, for example by storing in a quad store or serializing to a format +that supports multiple RDF graphs such as TriG. + +"""^^lv2:Markdown . + +patch:readable + lv2:documentation """ + +See the similar patch:writable property for details. + +"""^^lv2:Markdown . + +patch:request + lv2:documentation """ + +This can be used if referring directly to the URI or blank node ID of the +request is possible. Otherwise, use patch:sequenceNumber. + +"""^^lv2:Markdown . + +patch:sequenceNumber + lv2:documentation """ + +This property is used to associate replies with requests when it is not +feasible to refer to request URIs with patch:request. A patch:Response with a +given sequence number is the reply to the previously send patch:Request with +the same sequence number. + +The special sequence number 0 means that no reply is desired. + +"""^^lv2:Markdown . + +patch:wildcard + lv2:documentation """ + +This makes it possible to describe the removal of all values for a given +property. + +"""^^lv2:Markdown . + +patch:writable + lv2:documentation """ + +This is used to list properties that can be changed, for example to allow user +interfaces to present appropriate controls. For example: + + :::turtle + @prefix eg: <http://example.org/> . + @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#> . + + eg:title + a rdf:Property ; + rdfs:label "title" ; + rdfs:range xsd:string . + + eg:plugin + patch:writable eg:title . + +"""^^lv2:Markdown . + diff --git a/lv2/patch.lv2/patch.ttl b/lv2/patch.lv2/patch.ttl new file mode 100644 index 0000000..33d04d1 --- /dev/null +++ b/lv2/patch.lv2/patch.ttl @@ -0,0 +1,248 @@ +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix patch: <http://lv2plug.in/ns/ext/patch#> . +@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://lv2plug.in/ns/ext/patch> + a owl:Ontology ; + rdfs:seeAlso <patch.meta.ttl> ; + rdfs:label "LV2 Patch" ; + rdfs:comment "A protocol for accessing and manipulating properties." . + +patch:Ack + a rdfs:Class ; + rdfs:subClassOf patch:Response ; + rdfs:label "Ack" ; + rdfs:comment "An acknowledgement that a request was successful." . + +patch:Copy + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Copy" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:minCardinality 1 ; + owl:onProperty patch:subject + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:destination + ] ; + rdfs:comment "A request to copy the patch:subject to the patch:destination." . + +patch:Delete + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Delete" ; + rdfs:comment "Request that the patch:subject or subjects be deleted." . + +patch:Error + a rdfs:Class ; + rdfs:subClassOf patch:Response ; + rdfs:label "Error" ; + rdfs:comment "A response indicating an error processing a request." . + +patch:Get + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Get" ; + rdfs:comment "A request for a description of the patch:subject." . + +patch:Insert + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Insert" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:subject + ] ; + rdfs:comment "A request to insert a patch:body into the patch:subject." . + +patch:Message + a rdfs:Class ; + rdfs:label "Patch Message" ; + rdfs:comment "A patch message." . + +patch:Move + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Move" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:subject + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:destination + ] ; + rdfs:comment "A request to move the patch:subject to the patch:destination." . + +patch:Patch + a rdfs:Class ; + rdfs:subClassOf patch:Request , + [ + a owl:Restriction ; + owl:minCardinality 1 ; + owl:onProperty patch:subject + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:add + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:remove + ] ; + rdfs:label "Patch" ; + rdfs:comment "A request to add and/or remove properties of the patch:subject." . + +patch:Put + a rdfs:Class ; + rdfs:subClassOf patch:Request ; + rdfs:label "Put" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:subject + ] ; + rdfs:comment "A request to put the patch:body as the patch:subject." . + +patch:Request + a rdfs:Class ; + rdfs:label "Request" ; + rdfs:subClassOf patch:Message ; + rdfs:comment "A patch request message." . + +patch:Response + a rdfs:Class ; + rdfs:subClassOf patch:Message ; + rdfs:label "Response" ; + rdfs:comment "A response to a patch:Request." . + +patch:Set + a rdfs:Class ; + rdfs:label "Set" ; + rdfs:subClassOf patch:Request , + [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:property + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:value + ] ; + rdfs:comment "A compact request to set a property to a value." . + +patch:accept + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "accept" ; + rdfs:domain patch:Request ; + rdfs:range rdfs:Class ; + rdfs:comment "An accepted type for a response." . + +patch:add + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Patch ; + rdfs:range rdfs:Resource ; + rdfs:label "add" ; + rdfs:comment "The properties to add to the subject." . + +patch:body + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message ; + rdfs:label "body" ; + rdfs:comment "The body of a message." . + +patch:context + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain patch:Message ; + rdfs:label "context" ; + rdfs:comment "The context of properties in this message." . + +patch:destination + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message ; + rdfs:label "destination" ; + rdfs:comment "The destination to move the patch:subject to." . + +patch:property + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "property" ; + rdfs:domain patch:Message ; + rdfs:range rdf:Property ; + rdfs:comment "The property for a patch:Set or patch:Get message." . + +patch:readable + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "readable" ; + rdfs:range rdf:Property ; + rdfs:comment "A property that can be read with a patch:Get message." . + +patch:remove + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:label "remove" ; + rdfs:domain patch:Patch ; + rdfs:range rdfs:Resource ; + rdfs:comment "The properties to remove from the subject." . + +patch:request + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:label "request" ; + rdfs:domain patch:Response ; + rdfs:range patch:Request ; + rdfs:comment "The request this is a response to." . + +patch:sequenceNumber + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:label "sequence number" ; + rdfs:domain patch:Message ; + rdfs:range xsd:int ; + rdfs:comment "The sequence number of a request or response." . + +patch:subject + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message ; + rdfs:label "subject" ; + rdfs:comment "The subject this message applies to." . + +patch:value + a rdf:Property ; + rdfs:label "value" ; + rdfs:domain patch:Set ; + rdfs:comment "The value of a property in a patch:Set message." . + +patch:wildcard + a owl:Thing ; + rdfs:label "wildcard" ; + rdfs:comment "A wildcard that matches any resource." . + +patch:writable + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "writable" ; + rdfs:range rdf:Property ; + rdfs:comment "A property that can be set with a patch:Set or patch:Patch message." . + diff --git a/ext/port-groups.lv2/manifest.ttl b/lv2/port-groups.lv2/manifest.ttl index 4f6c01c..a887cb0 100644 --- a/ext/port-groups.lv2/manifest.ttl +++ b/lv2/port-groups.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/port-groups> a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; rdfs:seeAlso <port-groups.ttl> . diff --git a/lv2/port-groups.lv2/port-groups.meta.ttl b/lv2/port-groups.lv2/port-groups.meta.ttl new file mode 100644 index 0000000..67408ec --- /dev/null +++ b/lv2/port-groups.lv2/port-groups.meta.ttl @@ -0,0 +1,144 @@ +@prefix dcs: <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 pg: <http://lv2plug.in/ns/ext/port-groups#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/port-groups> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 Port Groups" ; + 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." + ] + ] + ] . + +pg:Group + lv2:documentation """ + +A group logically combines ports which should be considered part of the same +stream. For example, two audio ports in a group may form a stereo stream. + +Like ports, groups have a lv2:symbol that is unique within the context of the +plugin, where group symbols and port symbols reside in the same namespace. In +other words, a group on a plugin MUST NOT have the same symbol as any other +group or port on that plugin. This makes it possible to uniquely reference a +port or group on a plugin with a single identifier and no context. + +Group definitions may be shared across plugins for brevity. For example, a +plugin collection may define a single URI for a pg:StereoGroup with the symbol +"input" and use it in many plugins. + +"""^^lv2:Markdown . + +pg:sideChainOf + lv2:documentation """ + +Indicates that this port or group should be considered a "side chain" of some +other port or group. The precise definition of "side chain" depends on the +plugin, but in general this group should be considered a modifier to some other +group, rather than an independent input itself. + +"""^^lv2:Markdown . + +pg:subGroupOf + lv2:documentation """ + +Indicates that this group is a child of another group. This property has no +meaning with respect to plugin execution, but the host may find this +information useful to provide a better user interface. Note that being a +sub-group does not relax the restriction that the group MUST have a unique +symbol with respect to the plugin. + +"""^^lv2:Markdown . + +pg:source + lv2:documentation """ + +Indicates that this port or group should be considered the "result" of some +other port or group. This property only makes sense on groups with outputs +when the source is a group with inputs. This can be used to convey a +relationship between corresponding input and output groups with different +types, for example in a mono to stereo plugin. + +"""^^lv2:Markdown . + +pg:mainInput + lv2:documentation """ + +Indicates that this group should be considered the "main" input, i.e. the +primary task is processing the signal in this group. A plugin MUST NOT have +more than one pg:mainInput property. + +"""^^lv2:Markdown . + +pg:mainOutput + lv2:documentation """ + +Indicates that this group should be considered the "main" output. The main +output group SHOULD have the main input group as a pg:source. + +"""^^lv2:Markdown . + +pg:group + lv2:documentation """ + +Indicates that this port is a part of a group of ports on the plugin. The port +should also have an lv2:designation property to define its designation within +that group. + +"""^^lv2:Markdown . + +pg:DiscreteGroup + lv2:documentation """ + +These groups are divided into channels where each represents a particular +speaker location. The position of sound in one of these groups depends on a +particular speaker configuration. + +"""^^lv2:Markdown . + +pg:AmbisonicGroup + lv2:documentation """ + +These groups are divided into channels which together represent a position in +an abstract n-dimensional space. The position of sound in one of these groups +does not depend on a particular speaker configuration; a decoder can be used to +convert an ambisonic stream for any speaker configuration. + +"""^^lv2:Markdown . + diff --git a/lv2/port-groups.lv2/port-groups.ttl b/lv2/port-groups.lv2/port-groups.ttl new file mode 100644 index 0000000..2806821 --- /dev/null +++ b/lv2/port-groups.lv2/port-groups.ttl @@ -0,0 +1,808 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> . +@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://lv2plug.in/ns/ext/port-groups> + a owl:Ontology ; + rdfs:label "LV2 Port Groups" ; + rdfs:comment "Multi-channel groups of LV2 ports." ; + rdfs:seeAlso <port-groups.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +pg:Group + a rdfs:Class ; + rdfs:label "Port Group" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:symbol ; + owl:cardinality 1 ; + rdfs:comment "A Group MUST have exactly one string lv2:symbol." + ] ; + rdfs:comment "A set of ports that are logically grouped together." . + +pg:InputGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Input Group" ; + rdfs:comment "A group which contains exclusively inputs." . + +pg:OutputGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Output Group" ; + rdfs:comment "A group which contains exclusively outputs." . + +pg:Element + a rdfs:Class ; + rdfs:label "Element" ; + rdfs:comment "An ordered element of a group." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty lv2:designation ; + owl:cardinality 1 ; + rdfs:comment "An element MUST have exactly one lv2:designation." + ] ; + rdfs:comment "An element of a group, with a designation and optional index." . + +pg:element + a rdf:Property , + owl:ObjectProperty ; + rdfs:range pg:Element ; + rdfs:label "element" ; + rdfs:comment "An element within a port group." . + +pg:sideChainOf + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "side-chain of" ; + rdfs:comment "Port or group is a side chain of another." . + +pg:subGroupOf + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain pg:Group ; + rdfs:range pg:Group ; + rdfs:label "sub-group of" ; + rdfs:comment "Group is a child of another group." . + +pg:source + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain pg:OutputGroup ; + rdfs:range pg:InputGroup ; + rdfs:label "source" ; + rdfs:comment "Port or group that this group is the output of." . + +pg:mainInput + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Plugin ; + rdfs:range pg:InputGroup ; + rdfs:label "main input" ; + rdfs:comment "Input group that is the primary input of the plugin." . + +pg:mainOutput + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Plugin ; + rdfs:range pg:OutputGroup ; + rdfs:label "main output" ; + rdfs:comment "Output group that is the primary output of the plugin." . + +pg:group + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Port ; + rdfs:range pg:Group ; + rdfs:label "group" ; + rdfs:comment "Group that this port is a part of." . + +pg:DiscreteGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Discrete Group" ; + rdfs:comment "A group of discrete channels." . + +pg:left + a lv2:Channel ; + rdfs:label "left" ; + rdfs:comment "The left channel of a stereo audio group." . + +pg:right + a lv2:Channel ; + rdfs:label "right" ; + rdfs:comment "The right channel of a stereo audio group." . + +pg:center + a lv2:Channel ; + rdfs:label "center" ; + rdfs:comment "The center channel of a discrete audio group." . + +pg:side + a lv2:Channel ; + rdfs:label "side" ; + rdfs:comment "The side channel of a mid-side audio group." . + +pg:centerLeft + a lv2:Channel ; + rdfs:label "center left" ; + rdfs:comment "The center-left channel of a 7.1 wide surround sound group." . + +pg:centerRight + a lv2:Channel ; + rdfs:label "center right" ; + rdfs:comment "The center-right channel of a 7.1 wide surround sound group." . + +pg:sideLeft + a lv2:Channel ; + rdfs:label "side left" ; + rdfs:comment "The side-left channel of a 6.1 or 7.1 surround sound group." . + +pg:sideRight + a lv2:Channel ; + rdfs:label "side right" ; + rdfs:comment "The side-right channel of a 6.1 or 7.1 surround sound group." . + +pg:rearLeft + a lv2:Channel ; + rdfs:label "rear left" ; + rdfs:comment "The rear-left channel of a surround sound group." . + +pg:rearRight + a lv2:Channel ; + rdfs:label "rear right" ; + rdfs:comment "The rear-right channel of a surround sound group." . + +pg:rearCenter + a lv2:Channel ; + rdfs:label "rear center" ; + rdfs:comment "The rear-center channel of a surround sound group." . + +pg:lowFrequencyEffects + a lv2:Channel ; + rdfs:label "low-frequency effects" ; + rdfs:comment "The LFE channel of a *.1 surround sound group." . + +pg:MonoGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "Mono" ; + rdfs:comment "A single channel audio group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:center + ] . + +pg:StereoGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "Stereo" ; + rdfs:comment "A 2-channel discrete stereo audio group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:right + ] . + +pg:MidSideGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "Mid-Side Stereo" ; + rdfs:comment "A 2-channel mid-side stereo audio group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:center + ] , [ + lv2:index 1 ; + lv2:designation pg:side + ] . + +pg:ThreePointZeroGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "3.0 Surround" ; + rdfs:comment "A 3.0 discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:right + ] , [ + lv2:index 2 ; + lv2:designation pg:rearCenter + ] . + +pg:FourPointZeroGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "4.0 Surround" ; + rdfs:comment "A 4.0 (Quadraphonic) discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:rearCenter + ] . + +pg:FivePointZeroGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "5.0 Surround" ; + rdfs:comment "A 5.0 (3-2 stereo) discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:rearRight + ] . + +pg:FivePointOneGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "5.1 Surround" ; + rdfs:comment "A 5.1 (3-2 stereo with sub) discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:rearRight + ] , [ + lv2:index 5 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:SixPointOneGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "6.1 Surround" ; + rdfs:comment "A 6.1 discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:sideLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:sideRight + ] , [ + lv2:index 5 ; + lv2:designation pg:rearCenter + ] , [ + lv2:index 6 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:SevenPointOneGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "7.1 Surround" ; + rdfs:comment "A 7.1 discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:center + ] , [ + lv2:index 2 ; + lv2:designation pg:right + ] , [ + lv2:index 3 ; + lv2:designation pg:sideLeft + ] , [ + lv2:index 4 ; + lv2:designation pg:sideRight + ] , [ + lv2:index 5 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 6 ; + lv2:designation pg:rearRight + ] , [ + lv2:index 7 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:SevenPointOneWideGroup + a rdfs:Class ; + rdfs:subClassOf pg:DiscreteGroup ; + rdfs:label "7.1 Surround (Wide)" ; + rdfs:comment "A 7.1 wide discrete surround sound group." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:left + ] , [ + lv2:index 1 ; + lv2:designation pg:centerLeft + ] , [ + lv2:index 2 ; + lv2:designation pg:center + ] , [ + lv2:index 3 ; + lv2:designation pg:centerRight + ] , [ + lv2:index 4 ; + lv2:designation pg:right + ] , [ + lv2:index 5 ; + lv2:designation pg:rearLeft + ] , [ + lv2:index 6 ; + lv2:designation pg:rearRight + ] , [ + lv2:index 7 ; + lv2:designation pg:lowFrequencyEffects + ] . + +pg:letterCode + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Channel ; + rdfs:range rdf:PlainLiteral ; + rdfs:label "ambisonic letter code" ; + rdfs:comment "The YuMa letter code for an Ambisonic channel." . + +pg:harmonicDegree + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Channel ; + rdfs:range xsd:integer ; + rdfs:label "harmonic degree" ; + rdfs:comment "The degree coefficient (l) of the spherical harmonic for an Ambisonic channel." . + +pg:harmonicIndex + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Channel ; + rdfs:range xsd:integer ; + rdfs:label "harmonic index" ; + rdfs:comment "The index coefficient (m) of the spherical harmonic for an Ambisonic channel." . + +pg:ACN0 + a lv2:Channel ; + pg:letterCode "W" ; + pg:harmonicDegree 0 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN0" ; + rdfs:comment "Ambisonic channel 0 (W): degree 0, index 0." . + +pg:ACN1 + a lv2:Channel ; + pg:letterCode "Y" ; + pg:harmonicDegree 1 ; + pg:harmonicIndex -1 ; + rdfs:label "ACN1" ; + rdfs:comment "Ambisonic channel 1 (Y): degree 1, index -1." . + +pg:ACN2 + a lv2:Channel ; + pg:letterCode "Z" ; + pg:harmonicDegree 1 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN2" ; + rdfs:comment "Ambisonic channel 2 (Z): degree 1, index 0." . + +pg:ACN3 + a lv2:Channel ; + pg:letterCode "X" ; + pg:harmonicDegree 1 ; + pg:harmonicIndex 1 ; + rdfs:label "ACN3" ; + rdfs:comment "Ambisonic channel 3 (X): degree 1, index 1." . + +pg:ACN4 + a lv2:Channel ; + pg:letterCode "V" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex -2 ; + rdfs:label "ACN4" ; + rdfs:comment "Ambisonic channel 4 (V): degree 2, index -2." . + +pg:ACN5 + a lv2:Channel ; + pg:letterCode "T" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex -1 ; + rdfs:label "ACN5" ; + rdfs:comment "Ambisonic channel 5 (T): degree 2, index -1." . + +pg:ACN6 + a lv2:Channel ; + pg:letterCode "R" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN6" ; + rdfs:comment "Ambisonic channel 6 (R): degree 2, index 0." . + +pg:ACN7 + a lv2:Channel ; + pg:letterCode "S" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex 1 ; + rdfs:label "ACN7" ; + rdfs:comment "Ambisonic channel 7 (S): degree 2, index 1." . + +pg:ACN8 + a lv2:Channel ; + pg:letterCode "U" ; + pg:harmonicDegree 2 ; + pg:harmonicIndex 2 ; + rdfs:label "ACN8" ; + rdfs:comment "Ambisonic channel 8 (U): degree 2, index 2." . + +pg:ACN9 + a lv2:Channel ; + pg:letterCode "Q" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex -3 ; + rdfs:label "ACN9" ; + rdfs:comment "Ambisonic channel 9 (Q): degree 3, index -3." . + +pg:ACN10 + a lv2:Channel ; + pg:letterCode "O" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex -2 ; + rdfs:label "ACN10" ; + rdfs:comment "Ambisonic channel 10 (O): degree 3, index -2." . + +pg:ACN11 + a lv2:Channel ; + pg:letterCode "M" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex -1 ; + rdfs:label "ACN11" ; + rdfs:comment "Ambisonic channel 11 (M): degree 3, index -1." . + +pg:ACN12 + a lv2:Channel ; + pg:letterCode "K" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 0 ; + rdfs:label "ACN12" ; + rdfs:comment "Ambisonic channel 12 (K): degree 3, index 0." . + +pg:ACN13 + a lv2:Channel ; + pg:letterCode "L" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 1 ; + rdfs:label "ACN13" ; + rdfs:comment "Ambisonic channel 13 (L): degree 3, index 1." . + +pg:ACN14 + a lv2:Channel ; + pg:letterCode "N" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 2 ; + rdfs:label "ACN14" ; + rdfs:comment "Ambisonic channel 14 (N): degree 3, index 2." . + +pg:ACN15 + a lv2:Channel ; + pg:letterCode "P" ; + pg:harmonicDegree 3 ; + pg:harmonicIndex 3 ; + rdfs:label "ACN15" ; + rdfs:comment "Ambisonic channel 15 (P): degree 3, index 3." . + +pg:AmbisonicGroup + a rdfs:Class ; + rdfs:subClassOf pg:Group ; + rdfs:label "Ambisonic Group" ; + rdfs:comment "A group of Ambisonic channels." . + +pg:AmbisonicBH1P0Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH1P0" ; + rdfs:comment "Ambisonic B stream of horizontal order 1 and peripheral order 0." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN3 + ] . + +pg:AmbisonicBH1P1Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH1P1" ; + rdfs:comment "Ambisonic B stream of horizontal order 1 and peripheral order 1." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] . + +pg:AmbisonicBH2P0Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH2P0" ; + rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 0." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN8 + ] . + +pg:AmbisonicBH2P1Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH2P1" ; + rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 1." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN8 + ] . + +pg:AmbisonicBH2P2Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH2P2" ; + rdfs:comment "Ambisonic B stream of horizontal order 2 and peripheral order 2." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN5 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN6 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN7 + ] , [ + lv2:index 8 ; + lv2:designation pg:ACN8 + ] . + +pg:AmbisonicBH3P0Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P0" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 0." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN15 + ] . + +pg:AmbisonicBH3P1Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P1" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 1." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN15 + ] . + +pg:AmbisonicBH3P2Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P2" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 2." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN5 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN6 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN7 + ] , [ + lv2:index 8 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 9 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 10 ; + lv2:designation pg:ACN15 + ] . + +pg:AmbisonicBH3P3Group + a rdfs:Class ; + rdfs:subClassOf pg:AmbisonicGroup ; + rdfs:label "Ambisonic BH3P3" ; + rdfs:comment "Ambisonic B stream of horizontal order 3 and peripheral order 3." ; + pg:element [ + lv2:index 0 ; + lv2:designation pg:ACN0 + ] , [ + lv2:index 1 ; + lv2:designation pg:ACN1 + ] , [ + lv2:index 2 ; + lv2:designation pg:ACN2 + ] , [ + lv2:index 3 ; + lv2:designation pg:ACN3 + ] , [ + lv2:index 4 ; + lv2:designation pg:ACN4 + ] , [ + lv2:index 5 ; + lv2:designation pg:ACN5 + ] , [ + lv2:index 6 ; + lv2:designation pg:ACN6 + ] , [ + lv2:index 7 ; + lv2:designation pg:ACN7 + ] , [ + lv2:index 8 ; + lv2:designation pg:ACN8 + ] , [ + lv2:index 9 ; + lv2:designation pg:ACN9 + ] , [ + lv2:index 10 ; + lv2:designation pg:ACN10 + ] , [ + lv2:index 11 ; + lv2:designation pg:ACN11 + ] , [ + lv2:index 12 ; + lv2:designation pg:ACN12 + ] , [ + lv2:index 13 ; + lv2:designation pg:ACN13 + ] , [ + lv2:index 14 ; + lv2:designation pg:ACN14 + ] , [ + lv2:index 15 ; + lv2:designation pg:ACN15 + ] . + diff --git a/lv2/port-props.lv2/manifest.ttl b/lv2/port-props.lv2/manifest.ttl new file mode 100644 index 0000000..45f598d --- /dev/null +++ b/lv2/port-props.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/port-props> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 2 ; + rdfs:seeAlso <port-props.ttl> . + diff --git a/lv2/port-props.lv2/port-props.meta.ttl b/lv2/port-props.lv2/port-props.meta.ttl new file mode 100644 index 0000000..7077e4b --- /dev/null +++ b/lv2/port-props.lv2/port-props.meta.ttl @@ -0,0 +1,202 @@ +@prefix dcs: <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 pprops: <http://lv2plug.in/ns/ext/port-props#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/port-props> + a doap:Project ; + doap:name "LV2 Port Properties" ; + doap:created "2009-01-01" ; + 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 +to better describe how a plugin can be controlled. Using this metadata, hosts +can build better UIs for plugins, and provide more advanced automatic +functionality. + +"""^^lv2:Markdown . + +pprops:trigger + lv2:documentation """ + +Indicates that the data item corresponds to a momentary event that has been +detected (control output ports) or is to be triggered (control input ports). +For input ports, the port needs to be reset to lv2:default value after run() +function of the plugin has returned. If the control port is assigned a GUI +widget by the host, the widget should be of auto-off (momentary, one-shot) type +- for example, a push button if the port is also declared as lv2:toggled, or a +series of push button or auto-clear input box with a "Send" button if the port +is also lv2:integer. + +"""^^lv2:Markdown . + +pprops:supportsStrictBounds + lv2:documentation """ + +Indicates use of host support for pprops:hasStrictBounds port property. A +plugin that specifies it as optional feature can omit value clamping for +hasStrictBounds ports, if the feature is supported by the host. When specified +as required feature, it indicates that the plugin does not do any clamping for +input ports that have a pprops:hasStrictBounds property. + +"""^^lv2:Markdown . + +pprops:hasStrictBounds + lv2:documentation """ + +For hosts that support pprops:supportsStrictBounds, this indicates that the +value of the port should never exceed the port's minimum and maximum control +points. For input ports, it moves the responsibility for limiting the range of +values to host, if it supports pprops:supportsStrictBounds. For output ports, +it indicates that values within specified range are to be expected, and +breaking that should be considered by the host as error in plugin +implementation. + +"""^^lv2:Markdown . + +pprops:expensive + lv2:documentation """ + +Input ports only. Indicates that any changes to the port value may trigger +expensive background calculation (for example, regeneration of lookup tables in +a background thread). Any value changes may have not have immediate effect, or +may cause silence or diminished-quality version of the output until background +processing is finished. Ports having this property are typically not well +suited for connection to outputs of other plugins, and should not be offered as +connection targets or for automation by default. + +"""^^lv2:Markdown . + +pprops:causesArtifacts + lv2:documentation """ + +Input ports only. Indicates that any changes to the port value may produce +slight artifacts to produced audio signals (zipper noise and other results of +signal discontinuities). Connecting ports of this type to continuous signals +is not recommended, and when presenting a list of automation targets, those +ports may be marked as artifact-producing. + +"""^^lv2:Markdown . + +pprops:continuousCV + lv2:documentation """ + +Indicates that the port carries a "smooth" modulation signal. Control input +ports of this type are well-suited for being connected to sources of smooth +signals (knobs with smoothing, modulation rate oscillators, output ports with +continuousCV type, etc.). Typically, the plugin with ports which have this +property will implement appropriate smoothing to avoid audio artifacts. For +output ports, this property suggests the value of the port is likely to change +frequently, and describes a smooth signal (so successive values may be +considered points along a curve). + +"""^^lv2:Markdown . + +pprops:discreteCV + lv2:documentation """ + +Indicates that the port carries a "discrete" modulation signal. Input ports of +this type are well-suited for being connected to sources of discrete signals +(switches, buttons, classifiers, event detectors, etc.). May be combined with +pprops:trigger property. For output ports, this property suggests the value of +the port describe discrete values that should be interpreted as steps (and not +points along a curve). + +"""^^lv2:Markdown . + +pprops:logarithmic + lv2:documentation """ + +Indicates that port value behaviour within specified range (bounds) is a value +using logarithmic scale. The lower and upper bounds must be specified, and +must be of the same sign. + +"""^^lv2:Markdown . + +pprops:notAutomatic + lv2:documentation """ + +Indicates that the port is not primarily intended to be fed with modulation +signals from external sources (other plugins, etc.). It is merely a UI hint +and hosts may allow the user to override it. + +"""^^lv2:Markdown . + +pprops:notOnGUI + lv2:documentation """ + +Indicates that the port is not primarily intended to be represented by a +separate control in the user interface window (or any similar mechanism used +for direct, immediate control of control ports). It is merely a UI hint and +hosts may allow the user to override it. + +"""^^lv2:Markdown . + +pprops:displayPriority + lv2:documentation """ + +Indicates how important a port is to controlling the plugin. If a host can +only display some ports of a plugin, it should prefer ports with a higher +display priority. Priorities do not need to be unique, and are only meaningful +when compared to each other. + +"""^^lv2:Markdown . + +pprops:rangeSteps + lv2:documentation """ + +This value indicates into how many evenly-divided points the (control) port +range should be divided for step-wise control. This may be used for changing +the value with step-based controllers like arrow keys, mouse wheel, rotary +encoders, and so on. + +Note that when used with a pprops:logarithmic port, the steps are logarithmic +too, and port value can be calculated as: + + :::c + value = lower * pow(upper / lower, step / (steps - 1)) + +and the step from value is: + + :::c + step = (steps - 1) * log(value / lower) / log(upper / lower) + +where: + + * `value` is the port value. + + * `step` is the step number (0..steps). + + * `steps` is the number of steps (= value of :rangeSteps property). + + * `lower` and <code>upper</code> are the bounds. + +"""^^lv2:Markdown . + diff --git a/lv2/port-props.lv2/port-props.ttl b/lv2/port-props.lv2/port-props.ttl new file mode 100644 index 0000000..ea25c6b --- /dev/null +++ b/lv2/port-props.lv2/port-props.ttl @@ -0,0 +1,80 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix pprops: <http://lv2plug.in/ns/ext/port-props#> . +@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://lv2plug.in/ns/ext/port-props> + a owl:Ontology ; + rdfs:label "LV2 Port Properties" ; + rdfs:comment "Various properties for LV2 plugin ports." ; + rdfs:seeAlso <port-props.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +pprops:trigger + a lv2:PortProperty ; + rdfs:label "trigger" ; + rdfs:comment "Port is a momentary trigger." . + +pprops:supportsStrictBounds + a lv2:Feature ; + rdfs:label "supports strict bounds" ; + rdfs:comment "A feature indicating plugin support for strict port bounds." . + +pprops:hasStrictBounds + a lv2:PortProperty ; + rdfs:label "has strict bounds" ; + rdfs:comment "Port has strict bounds which are not internally clamped." . + +pprops:expensive + a lv2:PortProperty ; + rdfs:label "changes are expensive" ; + rdfs:comment "Input port is expensive to change." . + +pprops:causesArtifacts + a lv2:PortProperty ; + rdfs:label "changes cause artifacts" ; + rdfs:comment "Input port causes audible artifacts when changed." . + +pprops:continuousCV + a lv2:PortProperty ; + rdfs:label "smooth modulation signal" ; + rdfs:comment "Port carries a smooth modulation signal." . + +pprops:discreteCV + a lv2:PortProperty ; + rdfs:label "discrete modulation signal" ; + rdfs:comment "Port carries a discrete modulation signal." . + +pprops:logarithmic + a lv2:PortProperty ; + rdfs:label "logarithmic" ; + rdfs:comment "Port value is logarithmic." . + +pprops:notAutomatic + a lv2:PortProperty ; + rdfs:label "not automatic" ; + rdfs:comment "Port that is not intended to be fed with a modulation signal." . + +pprops:notOnGUI + a lv2:PortProperty ; + rdfs:label "not on GUI" ; + rdfs:comment "Port that should not be displayed on a GUI." . + +pprops:displayPriority + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Port ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "display priority" ; + rdfs:comment "A priority ranking this port in importance to its plugin." . + +pprops:rangeSteps + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Port ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "range steps" ; + rdfs:comment "The number of even steps the range should be divided into." . + diff --git a/ext/presets.lv2/manifest.ttl b/lv2/presets.lv2/manifest.ttl index 9f82f88..b9cacf5 100644 --- a/ext/presets.lv2/manifest.ttl +++ b/lv2/presets.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/presets> a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 8 ; rdfs:seeAlso <presets.ttl> . diff --git a/lv2/presets.lv2/presets.meta.ttl b/lv2/presets.lv2/presets.meta.ttl new file mode 100644 index 0000000..b7611de --- /dev/null +++ b/lv2/presets.lv2/presets.meta.ttl @@ -0,0 +1,106 @@ +@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 pset: <http://lv2plug.in/ns/ext/presets#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/presets> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 Presets" ; + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +This is a vocabulary for LV2 plugin presets, that is, named sets of control +values and possibly other state. The structure of a pset:Preset is +deliberately identical to that of an lv2:Plugin, and can be thought of as a +plugin template or overlay. + +Presets may be defined in any bundle, including the plugin's bundle, separate +third party preset bundles, or user preset bundles saved by hosts. Since +preset data tends to be large, it is recommended that plugins describe presets +in a separate file(s) to avoid slowing down hosts. The `manifest.ttl` of a +bundle containing presets should list them like so: + + :::turtle + eg:mypreset + a pset:Preset ; + lv2:appliesTo eg:myplugin ; + rdfs:seeAlso <mypreset.ttl> . + +"""^^lv2:Markdown . + +pset:Preset + lv2:documentation """ + +The structure of a Preset deliberately mirrors that of a plugin, so existing +predicates can be used to describe any data associated with the preset. For +example: + + :::turtle + @prefix eg: <http://example.org/> . + + eg:mypreset + a pset:Preset ; + rdfs:label "One louder" ; + lv2:appliesTo eg:myplugin ; + lv2:port [ + lv2:symbol "volume1" ; + pset:value 11.0 + ] , [ + lv2:symbol "volume2" ; + pset:value 11.0 + ] . + +A Preset SHOULD have at least one lv2:appliesTo property. Each Port on a +Preset MUST have at least a lv2:symbol property and a pset:value property. + +Hosts SHOULD save user presets to a bundle in the user-local LV2 directory (for +example `~/.lv2`) with a name like `<Plugin_Name>_<Preset_Name>.preset.lv2` +(for example `LV2_Amp_At_Eleven.preset.lv2`), where names are transformed to be +valid LV2 symbols for maximum compatibility. + +"""^^lv2:Markdown . + +pset:value + lv2:documentation """ + +This property is used in a similar way to lv2:default. + +"""^^lv2:Markdown . + +pset:preset + lv2:documentation """ + +Specifies the preset currently applied to a plugin instance. This property may +be useful for saving state, or notifying a plugin instance at run-time about a +preset change. + +"""^^lv2:Markdown . + diff --git a/lv2/presets.lv2/presets.ttl b/lv2/presets.lv2/presets.ttl new file mode 100644 index 0000000..60189ea --- /dev/null +++ b/lv2/presets.lv2/presets.ttl @@ -0,0 +1,61 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix pset: <http://lv2plug.in/ns/ext/presets#> . +@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://lv2plug.in/ns/ext/presets> + a owl:Ontology ; + rdfs:label "LV2 Presets" ; + rdfs:comment "Presets for LV2 plugins." ; + rdfs:seeAlso <presets.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +pset:Bank + a rdfs:Class ; + rdfs:label "Bank" ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty rdfs:label ; + owl:minCardinality 1 ; + rdfs:comment "A Bank MUST have at least one string rdfs:label." + ] ; + rdfs:comment "A bank of presets." . + +pset:Preset + a rdfs:Class ; + rdfs:subClassOf lv2:PluginBase ; + rdfs:label "Preset" ; + rdfs:comment "A preset for an LV2 plugin." ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty rdfs:label ; + owl:minCardinality 1 ; + rdfs:comment "A Preset MUST have at least one string rdfs:label." + ] . + +pset:bank + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain pset:Preset ; + rdfs:range pset:Bank ; + rdfs:label "bank" ; + rdfs:comment "The bank this preset belongs to." . + +pset:value + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:PortBase ; + rdfs:label "value" ; + rdfs:comment "The value of a port in a preset." . + +pset:preset + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:PluginBase ; + rdfs:range pset:Preset ; + rdfs:label "preset" ; + rdfs:comment "The preset currently applied to a plugin instance." . + diff --git a/ext/resize-port.lv2/manifest.ttl b/lv2/resize-port.lv2/manifest.ttl index 0f2179b..9fae8b8 100644 --- a/ext/resize-port.lv2/manifest.ttl +++ b/lv2/resize-port.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/resize-port> a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 0 ; rdfs:seeAlso <resize-port.ttl> . diff --git a/lv2/resize-port.lv2/resize-port.meta.ttl b/lv2/resize-port.lv2/resize-port.meta.ttl new file mode 100644 index 0000000..d44620c --- /dev/null +++ b/lv2/resize-port.lv2/resize-port.meta.ttl @@ -0,0 +1,74 @@ +@prefix dcs: <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 rsz: <http://lv2plug.in/ns/ext/resize-port#> . + +<http://lv2plug.in/ns/ext/resize-port> + a doap:Project ; + doap:name "LV2 Resize Port" ; + 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 +dynamically resize their output port buffers. + +In addition to the dynamic feature, there are properties which describe the +space required for a particular port buffer which can be used statically in +data files. + +"""^^lv2:Markdown . + +rsz:resize + lv2:documentation """ + +A feature to resize output port buffers in LV2_Plugin_Descriptor::run(). + +To support this feature, the host must pass an LV2_Feature to the plugin's +instantiate method with URI LV2_RESIZE_PORT__resize and a pointer to a +LV2_Resize_Port_Resize structure. This structure provides a resize_port +function which plugins may use to resize output port buffers as necessary. + +"""^^lv2:Markdown . + +rsz:asLargeAs + lv2:documentation """ + +Indicates that a port requires at least as much buffer space as the port with +the given symbol on the same plugin instance. This may be used for any ports, +but is generally most useful to indicate an output port must be at least as +large as some input port (because it will copy from it). If a port is +asLargeAs several ports, it is asLargeAs the largest such port (not the sum of +those ports' sizes). + +The host guarantees that whenever an ObjectPort's run method is called, any +output `O` that is rsz:asLargeAs an input `I` is connected to a buffer large +enough to copy `I`, or `NULL` if the port is lv2:connectionOptional. + +"""^^lv2:Markdown . + +rsz:minimumSize + lv2:documentation """ + +Indicates that a port requires a buffer at least this large, in bytes. Any +host that supports the resize-port feature MUST connect any port with a +minimumSize specified to a buffer at least as large as the value given for this +property. Any host, especially those that do NOT support dynamic port +resizing, SHOULD do so or reduced functionality may result. + +"""^^lv2:Markdown . + diff --git a/lv2/resize-port.lv2/resize-port.ttl b/lv2/resize-port.lv2/resize-port.ttl new file mode 100644 index 0000000..6f42c8f --- /dev/null +++ b/lv2/resize-port.lv2/resize-port.ttl @@ -0,0 +1,36 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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 rsz: <http://lv2plug.in/ns/ext/resize-port#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/ns/ext/resize-port> + a owl:Ontology ; + rdfs:label "LV2 Resize Port" ; + rdfs:comment "Dynamically sized LV2 port buffers." ; + rdfs:seeAlso <resize-port.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +rsz:resize + a lv2:Feature ; + rdfs:label "resize" ; + rdfs:comment "A feature for resizing output port buffers." . + +rsz:asLargeAs + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain lv2:Port ; + rdfs:range lv2:Symbol ; + rdfs:label "as large as" ; + rdfs:comment "Port that this port must have at least as much buffer space as." . + +rsz:minimumSize + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain lv2:Port ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "minimum size" ; + rdfs:comment "Minimum buffer size required by a port, in bytes." . + diff --git a/lv2/state.lv2/manifest.ttl b/lv2/state.lv2/manifest.ttl new file mode 100644 index 0000000..e56c4e5 --- /dev/null +++ b/lv2/state.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/state> + a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 10 ; + rdfs:seeAlso <state.ttl> . + diff --git a/lv2/state.lv2/state.meta.ttl b/lv2/state.lv2/state.meta.ttl new file mode 100644 index 0000000..cebe0ac --- /dev/null +++ b/lv2/state.lv2/state.meta.ttl @@ -0,0 +1,477 @@ +@prefix dcs: <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 state: <http://lv2plug.in/ns/ext/state#> . + +<http://lv2plug.in/ns/ext/state> + a doap:Project ; + doap:created "2010-11-09" ; + doap:name "LV2 State" ; + doap:shortdesc "An interface for LV2 plugins to save and restore state." ; + doap:license <http://opensource.org/licenses/isc> ; + 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.10" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] + ] + ] , [ + doap:revision "2.8" ; + doap:created "2021-01-07" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.2.tar.bz2> ; + 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 +a plugin instance's state. The goal is for an instance's state to be +completely described by port values and a simple dictionary. + +The <q>state</q> defined here is conceptually a key:value dictionary, with URI keys +and values of any type. For performance reasons the key and value type are +actually a "URID", a URI mapped to an integer. A single key:value pair is +called a "property". + +This state model is simple yet has many benefits: + + * Both fast and extensible thanks to URID keys. + + * No limitations on possible value types. + + * Easy to serialise in almost any format. + + * Easy to store in a typical "map" or "dictionary" data structure. + + * Elegantly described in Turtle, so state can be described in LV2 data files + (including presets). + + * Does not impose any file formats, data structures, or file system + requirements. + + * Suitable for portable persistent state as well as fast in-memory snapshots. + + * Keys _may_ be well-defined and used meaningfully across several + implementations. + + * State _may_ be dynamic, but plugins are not required to have a dynamic + dictionary data structure available. + +To implement state, the plugin provides a state:interface to the host. To save +or restore, the host calls LV2_State_Interface::save() or +LV2_State_Interface::restore(), passing a callback to be used for handling a +single property. The host is free to implement property storage and retrieval +in any way. + +Since value types are defined by URI, any type is possible. However, a set of +standard types is defined by the [LV2 Atom](atom.html) extension. Use of these +types is recommended. Hosts MUST implement at least +[atom:String](atom.html#String), which is simply a C string. + +### Referring to Files + +Plugins may need to refer to existing files (such as loaded samples) in their +state. This is done by storing the file's path as a property just like any +other value. However, there are some rules which MUST be followed when storing +paths, see state:mapPath for details. Plugins MUST use the type +[atom:Path](atom.html#Path) for all paths in their state. + +Plugins are strongly encouraged to avoid creating files, instead storing all +state as properties. However, occasionally the ability to create files is +necessary. To make this possible, the host can provide the feature +state:makePath which allocates paths for plugin-created files. Plugins MUST +NOT create files in any other locations. + +### Plugin Code Example + + :::c + + /* Namespace for this plugin's keys. This SHOULD be something that could be + published as a document, even if that document does not exist right now. + */ + #define NS_MY "http://example.org/myplugin/schema#" + + #define DEFAULT_GREETING "Hello" + + LV2_Handle + my_instantiate(...) + { + MyPlugin* plugin = ...; + plugin->uris.atom_String = map_uri(LV2_ATOM__String); + plugin->uris.my_greeting = map_uri(NS_MY "greeting"); + plugin->state.greeting = strdup(DEFAULT_GREETING); + return plugin; + } + + LV2_State_Status + my_save(LV2_Handle instance, + LV2_State_Store_Function store, + LV2_State_Handle handle, + uint32_t flags, + const LV2_Feature *const * features) + { + MyPlugin* plugin = (MyPlugin*)instance; + const char* greeting = plugin->state.greeting; + + store(handle, + plugin->uris.my_greeting, + greeting, + strlen(greeting) + 1, // Careful! Need space for terminator + plugin->uris.atom_String, + LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE); + + return LV2_STATE_SUCCESS; + } + + LV2_State_Status + my_restore(LV2_Handle instance, + LV2_State_Retrieve_Function retrieve, + LV2_State_Handle handle, + uint32_t flags, + const LV2_Feature *const * features) + { + MyPlugin* plugin = (MyPlugin*)instance; + + size_t size; + uint32_t type; + uint32_t flags; + const char* greeting = retrieve( + handle, plugin->uris.my_greeting, &size, &type, &flags); + + if (greeting) { + free(plugin->state->greeting); + plugin->state->greeting = strdup(greeting); + } else { + plugin->state->greeting = strdup(DEFAULT_GREETING); + } + + return LV2_STATE_SUCCESS; + } + + const void* + my_extension_data(const char* uri) + { + static const LV2_State_Interface state_iface = { my_save, my_restore }; + if (!strcmp(uri, LV2_STATE__interface)) { + return &state_iface; + } + } + +### Host Code Example + + :::c + LV2_State_Status + store_callback(LV2_State_Handle handle, + uint32_t key, + const void* value, + size_t size, + uint32_t type, + uint32_t flags) + { + if ((flags & LV2_STATE_IS_POD)) { + // We only care about POD since we're keeping state in memory only. + // Disk or network use would also require LV2_STATE_IS_PORTABLE. + Map* state_map = (Map*)handle; + state_map->insert(key, Value(copy(value), size, type)); + return LV2_STATE_SUCCESS;; + } else { + return LV2_STATE_ERR_BAD_FLAGS; // Non-POD events are unsupported + } + } + + Map + get_plugin_state(LV2_Handle instance) + { + LV2_State* state = instance.extension_data(LV2_STATE__interface); + + // Request a fast/native/POD save, since we're just copying in memory + Map state_map; + state.save(instance, store_callback, &state_map, + LV2_STATE_IS_POD|LV2_STATE_IS_NATIVE); + + return state_map; + } + +### Extensions to this Specification + +It is likely that other interfaces for working with plugin state will be +developed as needed. This is encouraged, however everything SHOULD work within +the state _model_ defined here. That is, **do not complicate the state +model**. Implementations can assume the following: + + * The current port values and state dictionary completely describe a plugin + instance, at least well enough that saving and restoring will yield an + "identical" instance from the user's perspective. + + * Hosts are not expected to save and/or restore any other attributes of a + plugin instance. + +### The "Property Principle" + +The main benefit of this meaningful state model is that it can double as a +plugin control/query mechanism. For plugins that require more advanced control +than simple control ports, instead of defining a set of commands, define +properties whose values can be set appropriately. This provides both a way to +control and save that state "for free", since there is no need to define +commands _and_ a set of properties for storing their effects. In particular, +this is a good way for UIs to achieve more advanced control of plugins. + +This "property principle" is summed up in the phrase: "Don't stop; set playing +to false". + +This extension does not define a dynamic mechanism for state access and +manipulation. The [LV2 Patch](patch.html) extension defines a generic set of +messages which can be used to access or manipulate properties, and the [LV2 +Atom](atom.html) extension defines a port type and data container capable of +transmitting those messages. + +"""^^lv2:Markdown . + +state:interface + lv2:documentation """ + +A structure (LV2_State_Interface) which contains functions to be called by the +host to save and restore state. In order to support this extension, the plugin +must return a valid LV2_State_Interface from LV2_Descriptor::extension_data() +when it is called with URI LV2_STATE__interface. + +The plugin data file should describe this like so: + + :::turtle + @prefix state: <http://lv2plug.in/ns/ext/state#> . + + <plugin> + a lv2:Plugin ; + lv2:extensionData state:interface . + +"""^^lv2:Markdown . + +state:State + lv2:documentation """ + +This type should be used wherever instance state is described. The properties +of a resource with this type correspond directly to the properties of the state +dictionary (except the property that states it has this type). + +"""^^lv2:Markdown . + +state:loadDefaultState + lv2:documentation """ + +This feature indicates that the plugin has default state listed with the +state:state property which should be loaded by the host before running the +plugin. Requiring this feature allows plugins to implement a single state +loading mechanism which works for initialisation as well as restoration, +without having to hard-code default state. + +To support this feature, the host MUST restore the default state after +instantiating the plugin but before calling run(). + +"""^^lv2:Markdown . + +state:state + lv2:documentation """ + +This property may be used anywhere a state needs to be described, for example: + + :::turtle + @prefix eg: <http://example.org/> . + + <plugin-instance> + state:state [ + eg:somekey "some value" ; + eg:someotherkey "some other value" ; + eg:favourite-number 2 + ] . + +"""^^lv2:Markdown . + +state:mapPath + lv2:documentation """ + +This feature maps absolute paths to/from <q>abstract paths</q> which are stored +in state. To support this feature a host must pass an LV2_Feature with URI +LV2_STATE__mapPath and data pointed to an LV2_State_Map_Path to the plugin's +LV2_State_Interface methods. + +The plugin MUST map _all_ paths stored in its state (including those inside any +files). This is necessary so that hosts can handle file system references +correctly, for example to share common files, or bundle state for distribution +or archival. + +For example, a plugin may write a path to a state file like so: + + :::c + void write_path(LV2_State_Map_Path* map_path, FILE* myfile, const char* path) + { + char* abstract_path = map_path->abstract_path(map_path->handle, path); + fprintf(myfile, "%s", abstract_path); + free(abstract_path); + } + +Then, later reload the path like so: + + :::c + char* read_path(LV2_State_Map_Path* map_path, FILE* myfile) + { + /* Obviously this is not production quality code! */ + char abstract_path[1024]; + fscanf(myfile, "%s", abstract_path); + return map_path->absolute_path(map_path->handle, abstract_path); + } + +"""^^lv2:Markdown . + +state:makePath + lv2:documentation """ + +This feature allows plugins to create new files and/or directories. To support +this feature the host passes an LV2_Feature with URI LV2_STATE__makePath and +data pointed to an LV2_State_Make_Path to the plugin. The host may make this +feature available only during save by passing it to +LV2_State_Interface::save(), or available any time by passing it to +LV2_Descriptor::instantiate(). If passed to LV2_State_Interface::save(), the +feature MUST NOT be used beyond the scope of that call. + +The plugin is guaranteed a hierarchical namespace unique to that plugin +instance, and may expect the returned path to have the requested path as a +suffix. There is one such namespace, even if the feature is passed to both +LV2_Descriptor::instantiate() and LV2_State_Interface::save(). Beyond this, +the plugin MUST NOT make any assumptions about the returned paths. + +Like any other paths, the plugin MUST map these paths using state:mapPath +before storing them in state. The plugin MUST NOT assume these paths will be +available across a save/restore otherwise, that is, only mapped paths saved to +state are persistent, any other created paths are temporary. + +For example, a plugin may create a file in a subdirectory like so: + + :::c + char* save_myfile(LV2_State_Make_Path* make_path) + { + char* path = make_path->path(make_path->handle, "foo/bar/myfile.txt"); + FILE* myfile = fopen(path, 'w'); + fprintf(myfile, "I am some data"); + fclose(myfile); + return path; + } + +"""^^lv2:Markdown . + +state:threadSafeRestore + lv2:documentation """ + +If a plugin supports this feature, its LV2_State_Interface::restore method is +thread-safe and may be called concurrently with audio class functions. + +To support this feature, the host MUST pass a +[work:schedule](worker.html#schedule) feature to the restore method, which will +be used to complete the state restoration. The usual mechanics of the worker +apply: the host will call the plugin's work method, which emits a response +which is later applied in the audio thread. + +The host is not required to block audio processing while restore() and work() +load the state, so this feature allows state to be restored without dropouts. + +"""^^lv2:Markdown . + +state:freePath + lv2:documentation """ + +This feature provides a function that can be used by plugins to free paths that +were allocated by the host via other state features (state:mapPath and +state:makePath). + +"""^^lv2:Markdown . + +state:StateChanged + lv2:documentation """ + +A notification that the internal state of the plugin has been changed in a way +that the host can not otherwise know about. + +This is a one-way notification, intended to be used as the type of an +[Object](atom.html#Object) sent from plugins when necessary. + +Plugins SHOULD emit such an event whenever a change has occurred that would +result in a different state being saved, but not when the host explicitly makes +a change which it knows is likely to have that effect, such as changing a +parameter. + +"""^^lv2:Markdown . + diff --git a/lv2/state.lv2/state.ttl b/lv2/state.lv2/state.ttl new file mode 100644 index 0000000..463fdb9 --- /dev/null +++ b/lv2/state.lv2/state.ttl @@ -0,0 +1,60 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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 state: <http://lv2plug.in/ns/ext/state#> . + +<http://lv2plug.in/ns/ext/state> + a owl:Ontology ; + rdfs:label "LV2 State" ; + rdfs:comment "An interface for LV2 plugins to save and restore state." ; + rdfs:seeAlso <state.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +state:interface + a lv2:ExtensionData ; + rdfs:label "interface" ; + rdfs:comment "A plugin interface for saving and restoring state." . + +state:State + a rdfs:Class ; + rdfs:label "State" ; + rdfs:comment "LV2 plugin state." . + +state:loadDefaultState + a lv2:Feature ; + rdfs:label "load default state" ; + rdfs:comment "A feature indicating that the plugin has default state." . + +state:state + a rdf:Property , + owl:ObjectProperty ; + rdfs:label "state" ; + rdfs:range state:State ; + rdfs:comment "The state of an LV2 plugin instance." . + +state:mapPath + a lv2:Feature ; + rdfs:label "map path" ; + rdfs:comment "A feature for mapping between absolute and abstract file paths." . + +state:makePath + a lv2:Feature ; + rdfs:label "make path" ; + rdfs:comment "A feature for creating new files and directories." . + +state:threadSafeRestore + a lv2:Feature ; + rdfs:label "thread-safe restore" ; + rdfs:comment "A feature indicating support for thread-safe state restoration." . + +state:freePath + a lv2:Feature ; + rdfs:label "free path" ; + rdfs:comment "A feature for freeing paths allocated by the host." . + +state:StateChanged + a rdfs:Class ; + rdfs:label "State Changed" ; + rdfs:comment "A notification that the internal state of the plugin has changed." . + diff --git a/lv2/time.lv2/manifest.ttl b/lv2/time.lv2/manifest.ttl new file mode 100644 index 0000000..d80aa75 --- /dev/null +++ b/lv2/time.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/time> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; + rdfs:seeAlso <time.ttl> . + diff --git a/lv2/time.lv2/time.meta.ttl b/lv2/time.lv2/time.meta.ttl new file mode 100644 index 0000000..2b99cb7 --- /dev/null +++ b/lv2/time.lv2/time.meta.ttl @@ -0,0 +1,112 @@ +@prefix dcs: <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 time: <http://lv2plug.in/ns/ext/time#> . + +<http://lv2plug.in/ns/ext/time> + a doap:Project ; + doap:name "LV2 Time" ; + 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 +passage, in both real and musical terms. + +In addition to real time (based on seconds), two units of time are used: +_frames_ and _beats_. A frame is a numbered quantum of time. Frame time is +related to real-time by the _frame rate_ or _sample rate_, +time:framesPerSecond. A beat is a single pulse of musical time. Beat time is +related to real-time by the _tempo_, time:beatsPerMinute. + +Musical time additionally has a _meter_ which describes passage of time in +terms of musical _bars_. A bar is a higher level grouping of beats. The meter +describes how many beats are in one bar. + +"""^^lv2:Markdown . + +time:Position + lv2:documentation """ + +A point in time and/or the speed at which time is passing. A position is both +a point and a speed, which precisely defines a time within a timeline. + +"""^^lv2:Markdown . + +time:Rate + lv2:documentation """ + +The rate of passage of time in terms of one unit with respect to another. + +"""^^lv2:Markdown . + +time:beat + lv2:documentation """ + +This is not the beat within a bar like time:barBeat, but relative to the same +origin as time:bar and monotonically increases unless the transport is +repositioned. + +"""^^lv2:Markdown . + +time:beatUnit + lv2:documentation """ + +Beat unit, the note value that counts as one beat. This is the bottom number +in a time signature: 2 for half note, 4 for quarter note, and so on. + +"""^^lv2:Markdown . + +time:speed + lv2:documentation """ + +The rate of the progress of time as a fraction of normal speed. For example, a +rate of 0.0 is stopped, 1.0 is rolling at normal speed, 0.5 is rolling at half +speed, -1.0 is reverse, and so on. + +"""^^lv2:Markdown . + diff --git a/lv2/time.lv2/time.ttl b/lv2/time.lv2/time.ttl new file mode 100644 index 0000000..f3da9b0 --- /dev/null +++ b/lv2/time.lv2/time.ttl @@ -0,0 +1,121 @@ +@prefix owl: <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 time: <http://lv2plug.in/ns/ext/time#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/ns/ext/time> + a owl:Ontology ; + rdfs:label "LV2 Time" ; + rdfs:comment "A vocabulary for describing musical time." ; + rdfs:seeAlso <time.meta.ttl> . + +time:Time + a rdfs:Class , + owl:Class ; + rdfs:subClassOf time:Position ; + rdfs:label "Time" ; + rdfs:comment "A point in time in some unit/dimension." . + +time:Position + a rdfs:Class , + owl:Class ; + rdfs:label "Position" ; + rdfs:comment "A point in time and/or the speed at which time is passing." . + +time:Rate + a rdfs:Class , + owl:Class ; + rdfs:subClassOf time:Position ; + rdfs:label "Rate" ; + rdfs:comment "The rate of passage of time." . + +time:position + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:range time:Position ; + rdfs:label "position" ; + rdfs:comment "A musical position." . + +time:barBeat + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:float ; + rdfs:label "beat within bar" ; + rdfs:comment "The beat number within the bar, from 0 to time:beatsPerBar." . + +time:bar + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:long ; + rdfs:label "bar" ; + rdfs:comment "A musical bar or measure." . + +time:beat + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:double ; + rdfs:label "beat" ; + rdfs:comment "The global running beat number." . + +time:beatUnit + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:nonNegativeInteger ; + rdfs:label "beat unit" ; + rdfs:comment "The note value that counts as one beat." . + +time:beatsPerBar + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "beats per bar" ; + rdfs:comment "The number of beats in one bar." . + +time:beatsPerMinute + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "beats per minute" ; + rdfs:comment "Tempo in beats per minute." . + +time:frame + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Time ; + rdfs:range xsd:long ; + rdfs:label "frame" ; + rdfs:comment "A time stamp in audio frames." . + +time:framesPerSecond + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "frames per second" ; + rdfs:comment "Frame rate in frames per second." . + +time:speed + a rdf:Property , + owl:DatatypeProperty , + owl:FunctionalProperty ; + rdfs:domain time:Rate ; + rdfs:range xsd:float ; + rdfs:label "speed" ; + rdfs:comment "The rate of the progress of time as a fraction of normal speed." . + diff --git a/extensions/ui.lv2/manifest.ttl b/lv2/ui.lv2/manifest.ttl index c8f4c66..d3b12b5 100644 --- a/extensions/ui.lv2/manifest.ttl +++ b/lv2/ui.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/extensions/ui> a lv2:Specification ; + lv2:minorVersion 2 ; + lv2:microVersion 24 ; rdfs:seeAlso <ui.ttl> . diff --git a/lv2/ui.lv2/ui.meta.ttl b/lv2/ui.lv2/ui.meta.ttl new file mode 100644 index 0000000..ce4c095 --- /dev/null +++ b/lv2/ui.lv2/ui.meta.ttl @@ -0,0 +1,587 @@ +@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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . + +<http://lv2plug.in/ns/extensions/ui> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 UI" ; + doap:shortdesc "User interfaces for LV2 plugins." ; + 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.24" ; + doap:created "2022-05-26" ; + doap:file-release <http://lv2plug.in/spec/lv2-1.18.4.tar.bz2> ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Fix spelling errors." + ] , [ + rdfs:label "Deprecate ui:resize." + ] + ] + ] , [ + doap:revision "2.22" ; + doap:created "2020-04-26" ; + doap:file-release <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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +This extension makes it possible to create user interfaces for LV2 plugins. + +UIs are implemented as an LV2UI_Descriptor loaded via lv2ui_descriptor() in a +shared library, and are distributed in bundles just like plugins. + +UIs are associated with plugins in data: + + :::turtle + @prefix ui: <http://lv2plug.in/ns/extensions/ui#> . + + <http://my.plugin> ui:ui <http://my.pluginui> . + <http://my.pluginui> a ui:X11UI ; + lv2:binary <myui.so> . + +where `http://my.plugin` is the URI of the plugin, `http://my.pluginui` is the +URI of the plugin UI and `myui.so` is the relative URI to the shared object +file. + +While it is possible to have the plugin UI and the plugin in the same shared +object file, it is a good idea to keep them separate so that hosts can avoid +loading the UI code if they do not need it. A UI MUST specify its class in the +RDF data (`ui:X11UI` in the above example). The class defines what type the UI +is, for example what graphics toolkit it uses. Any type of UI class can be +defined separately from this extension. + +It is possible to have multiple UIs for the same plugin, or to have the UI for +a plugin in a different bundle from the actual plugin. This allows plugin UIs +to be written independently. + +Note that the process that loads the shared object file containing the UI code +and the process that loads the shared object file containing the actual plugin +implementation are not necessarily the same process (and not even necessarily +on the same machine). This means that plugin and UI code MUST NOT use +singletons and global variables and expect them to refer to the same objects in +the UI and the actual plugin. The function callback interface defined in this +header is the only method of communication between UIs and plugin instances +(extensions may define more, though this is discouraged unless absolutely +necessary since the significant benefits of network transparency and +serialisability are lost). + +UI functionality may be extended via features, much like plugins: + + :::turtle + <http://my.pluginui> lv2:requiredFeature <http://my.feature> . + <http://my.pluginui> lv2:optionalFeature <http://my.feature> . + +The rules for a UI with a required or optional feature are identical to those +of lv2:Plugin instances: if a UI declares a feature as required, the host is +NOT allowed to load it unless it supports that feature; and if it does support +a feature, it MUST pass an appropriate LV2_Feature struct to the UI's +instantiate() method. This extension defines several standard features for +common functionality. + +UIs written to this specification do not need to be thread-safe. All functions +may only be called in the <q>UI thread</q>. There is only one UI thread (for +toolkits, the one the UI main loop runs in). There is no requirement that a +<q>UI</q> actually be a graphical widget. + +Note that UIs are completely separate from plugins. From the plugin's +perspective, control from a UI is indistinguishable from any other control, as +it all occurs via ports. + +"""^^lv2:Markdown . + +ui:GtkUI + lv2:documentation """ + +The host must guarantee that the Gtk+ 2 library has been initialised and the +Glib main loop is running before the UI is instantiated. Note that this UI +type is not suitable for binary distribution since multiple versions of Gtk can +not be used in the same process. + +"""^^lv2:Markdown . + +ui:Gtk3UI + lv2:documentation """ + +The host must guarantee that the Gtk+ 3 library has been initialised and the +Glib main loop is running before the UI is instantiated. Note that this UI +type is not suitable for binary distribution since multiple versions of Gtk can +not be used in the same process. + +"""^^lv2:Markdown . + +ui:Qt4UI + lv2:documentation """ + +The host must guarantee that the Qt4 library has been initialised and the Qt4 +main loop is running before the UI is instantiated. Note that this UI type is +not suitable for binary distribution since multiple versions of Qt can not be +used in the same process. + +"""^^lv2:Markdown . + +ui:Qt5UI + lv2:documentation """ + +The host must guarantee that the Qt5 library has been initialised and the Qt5 +main loop is running before the UI is instantiated. Note that this UI type is +not suitable for binary distribution since multiple versions of Qt can not be +used in the same process. + +"""^^lv2:Markdown . + +ui:X11UI + lv2:documentation """ + +Note that the LV2UI_Widget for this type of UI is not a pointer, but should be +interpreted directly as an X11 `Window` ID. This is the native UI type on most +POSIX systems. + +"""^^lv2:Markdown . + +ui:WindowsUI + lv2:documentation """ + +Note that the LV2UI_Widget for this type of UI is not a pointer, but should be +interpreted directly as a `HWND`. This is the native UI type on Microsoft +Windows. + +"""^^lv2:Markdown . + +ui:CocoaUI + lv2:documentation """ + +This is the native UI type on Mac OS X. + +"""^^lv2:Markdown . + +ui:binary + lv2:documentation """ + +This property is redundant and deprecated: new UIs should use lv2:binary +instead, however hosts must still support ui:binary. + +"""^^lv2:Markdown . + +ui:makeSONameResident + lv2:documentation """ + +This feature was intended to support UIs that link against toolkit libraries +which may not be unloaded during the lifetime of the host. This is better +achieved by using the appropriate flags when linking the UI, for example `gcc +-Wl,-z,nodelete`. + +"""^^lv2:Markdown . + +ui:noUserResize + lv2:documentation """ + +If a UI has this feature, it indicates that it does not make sense to let the +user resize the main widget, and the host should prevent that. This feature +may not make sense for all UI types. The data pointer for this feature should +always be set to NULL. + +"""^^lv2:Markdown . + +ui:fixedSize + lv2:documentation """ + +If a UI has this feature, it indicates the same thing as ui:noUserResize, and +additionally that the UI will not resize itself on its own. That is, the UI +will always remain the same size. This feature may not make sense for all UI +types. The data pointer for this feature should always be set to NULL. + +"""^^lv2:Markdown . + +ui:scaleFactor + lv2:documentation """ + +HiDPI (High Dots Per Inch) displays have a high resolution on a relatively +small form factor. Many systems use a scale factor to compensate for this, so +for example, a scale factor of 2 means things are drawn twice as large as +normal. + +Hosts can pass this as an option to UIs to communicate this information, so +that the UI can draw at an appropriate scale. + +"""^^lv2:Markdown . + +ui:backgroundColor + lv2:documentation """ + +The background color of the host's UI. The host can pass this as an option so +that UIs can integrate nicely with the host window around it. + +Hosts should pass this as an option to UIs with an integer RGBA32 color value. +If the value is a 32-bit integer, it is guaranteed to be in RGBA32 format, but +the UI must check the value type and not assume this, to allow for other types +of color in the future. + +"""^^lv2:Markdown . + +ui:foregroundColor + lv2:documentation """ + +The foreground color of the host's UI. The host can pass this as an option so +that UIs can integrate nicely with the host window around it. + +Hosts should pass this as an option to UIs with an integer RGBA32 color value. +If the value is a 32-bit integer, it is guaranteed to be in RGBA32 format, but +the UI must check the value type and not assume this, to allow for other types +of color in the future. + +"""^^lv2:Markdown . + +ui:parent + lv2:documentation """ + +This feature can be used to pass a parent that the UI should be a child of. +The format of data pointer of this feature is determined by the UI type, and is +generally the same type as the LV2UI_Widget that the UI would return. For +example, for a ui:X11UI, the parent should be a `Window`. This is particularly +useful for embedding, where the parent often must be known at construction time +for embedding to work correctly. + +UIs should not _require_ this feature unless it is necessary for them to work +at all, but hosts should provide it whenever possible. + +"""^^lv2:Markdown . + +ui:PortNotification + lv2:documentation """ + +This describes which ports the host must send notifications to the UI about. +The port must be specific either by index, using the ui:portIndex property, or +symbol, using the lv2:symbol property. Since port indices are not guaranteed +to be stable, using the symbol is recommended, and the inde MUST NOT be used +except by UIs that are shipped in the same bundle as the corresponding plugin. + +"""^^lv2:Markdown . + +ui:portNotification + lv2:documentation """ + +Specifies that a UI should receive notifications about changes to a particular +port's value via LV2UI_Descriptor::port_event(). + +For example: + + :::turtle + eg:ui + a ui:X11UI ; + ui:portNotification [ + ui:plugin eg:plugin ; + lv2:symbol "gain" ; + ui:protocol ui:floatProtocol + ] . + +"""^^lv2:Markdown . + +ui:notifyType + lv2:documentation """ + +Specifies a particular type that the UI should be notified of. + +This is useful for message-based ports where several types of data can be +present, but only some are interesting to the UI. For example, if UI control +is multiplexed in the same port as MIDI, this property can be used to ensure +that only the relevant events are forwarded to the UI, and not potentially high +frequency MIDI data. + +"""^^lv2:Markdown . + +ui:resize + lv2:documentation """ + +This feature corresponds to the LV2UI_Resize struct, which should be passed +with the URI LV2_UI__resize. This struct may also be provided by the UI as +extension data using the same URI, in which case it is used by the host to +request that the UI change its size. + +"""^^lv2:Markdown . + +ui:portMap + lv2:documentation """ + +This makes it possible to implement and distribute UIs separately from the +plugin binaries they control. + +This feature corresponds to the LV2UI_Port_Index struct, which should be passed +with the URI LV2_UI__portIndex. + +"""^^lv2:Markdown . + +ui:portSubscribe + lv2:documentation """ + +This makes it possible for a UI to explicitly request a particular style of +update from a port at run-time, in a more flexible and powerful way than +listing subscriptions statically allows. + +This feature corresponds to the LV2UI_Port_Subscribe struct, which should be +passed with the URI LV2_UI__portSubscribe. + +"""^^lv2:Markdown . + +ui:touch + lv2:documentation """ + +This is useful for automation, so the host can allow the user to take control +of a port, even if that port would otherwise be automated (much like grabbing a +physical motorised fader). + +It can also be used for MIDI learn or in any other situation where the host +needs to do something with a particular control and it would be convenient for +the user to select it directly from the plugin UI. + +This feature corresponds to the LV2UI_Touch struct, which should be passed with +the URI LV2_UI__touch. + +"""^^lv2:Markdown . + +ui:requestValue + lv2:documentation """ + +This allows a plugin UI to request a new parameter value using the host's UI, +for example by showing a dialog or integrating with the host's built-in content +browser. This should only be used for complex parameter types where the plugin +UI is not capable of showing the expected native platform or host interface to +choose a value, such as file path parameters. + +This feature corresponds to the LV2UI_Request_Value struct, which should be +passed with the URI LV2_UI__requestValue. + +"""^^lv2:Markdown . + +ui:idleInterface + lv2:documentation """ + +To support this feature, the UI should list it as a lv2:optionalFeature or +lv2:requiredFeature in its data, and also as lv2:extensionData. When the UI's +extension_data() is called with this URI (LV2_UI__idleInterface), it should +return a pointer to an LV2UI_Idle_Interface. + +To indicate support, the host should pass a feature to instantiate() with this +URI, with NULL for data. + +"""^^lv2:Markdown . + +ui:showInterface + lv2:documentation """ + +This allows UIs to gracefully degrade to separate windows when the host is +unable to embed the UI widget for whatever reason. When the UI's +extension_data() is called with this URI (LV2_UI__showInterface), it should +return a pointer to an LV2UI_Show_Interface. + +"""^^lv2:Markdown . + +ui:PortProtocol + lv2:documentation """ + +A PortProtocol MUST define: + +Port Type +: Which plugin port types the buffer type is valid for. + +Feature Data +: What data (if any) should be passed in the LV2_Feature. + +A PortProtocol for an output port MUST define: + +Update Frequency +: When the host should call port_event(). + +Update Format +: The format of the data in the buffer passed to port_event(). + +Options +: The format of the options passed to subscribe() and unsubscribe(). + +A PortProtocol for an input port MUST define: + +Write Format +: The format of the data in the buffer passed to write_port(). + +Write Effect +: What happens when the UI calls write_port(). + +For an example, see ui:floatProtocol or ui:peakProtocol. + +PortProtocol is a subclass of lv2:Feature, so UIs use lv2:optionalFeature and +lv2:requiredFeature to specify which PortProtocols they want to use. + +"""^^lv2:Markdown . + +ui:floatProtocol + lv2:documentation """ + +A protocol for transferring single floating point values. The rules for this +protocol are: + +Port Type +: lv2:ControlPort + +Feature Data +: None. + +Update Frequency +: The host SHOULD call port_event() as soon as possible when the port value has + changed, but there are no timing guarantees. + +Update Format +: A single <code>float</code>. + +Options +: None. + +Write Format +: A single <code>float</code>. + +Write Effect +: The host SHOULD set the port to the received value as soon as possible, but + there is no guarantee that run() actually sees this value. + +"""^^lv2:Markdown . + +ui:peakProtocol + lv2:documentation """ + +This port protocol defines a way for the host to send continuous peak +measurements of the audio signal at a certain port to the UI. The intended use +is visualisation, for example an animated meter widget that shows the level of +the audio input or output. + +A contiguous sequence of audio samples for which a peak value has been computed +is called a _measurement period_. + +The rules for this protocol are: + +Port Type +: lv2:AudioPort + +Feature Data +: None. + +Update Frequency +: The host SHOULD call port_event() at regular intervals. The measurement + periods used for calls to port_event() for the same port SHOULD be + contiguous (i.e. the measurement period for one call should begin right + after the end of the measurement period for the previous call ends) unless + the UI has removed and re-added the port subscription between those calls. + However, UIs MUST NOT depend on either the regularity of the calls or the + contiguity of the measurement periods; hosts may change the call rate or + skip calls for performance or other reasons. Measurement periods for + different calls to port_event() for the same port MUST NOT overlap. + +Update Format +: A single LV2UI_Peak_Data object. + +Options +: None. + +Write Format +: None. + +Write Effect +: None. + +"""^^lv2:Markdown . + diff --git a/lv2/ui.lv2/ui.ttl b/lv2/ui.lv2/ui.ttl new file mode 100644 index 0000000..1c2e455 --- /dev/null +++ b/lv2/ui.lv2/ui.ttl @@ -0,0 +1,249 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix opts: <http://lv2plug.in/ns/ext/options#> . +@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 ui: <http://lv2plug.in/ns/extensions/ui#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/ns/extensions/ui> + a owl:Ontology ; + rdfs:label "LV2 UI" ; + rdfs:comment "User interfaces for LV2 plugins." ; + rdfs:seeAlso <ui.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> , + <http://lv2plug.in/ns/ext/options> . + +ui:UI + a rdfs:Class , + owl:Class ; + rdfs:label "User Interface" ; + rdfs:comment "A UI for an LV2 plugin." . + +ui:GtkUI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "GTK2 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Gtk+ 2.0 GtkWidget." . + +ui:Gtk3UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "GTK3 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Gtk+ 3.0 GtkWidget." . + +ui:Qt4UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Qt4 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Qt4 QWidget." . + +ui:Qt5UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Qt5 UI" ; + rdfs:comment "A UI where the widget is a pointer to a Qt5 QWidget." . + +ui:X11UI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "X11 UI" ; + rdfs:comment "A UI where the widget is an X11 Window window ID." . + +ui:WindowsUI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Windows UI" ; + rdfs:comment "A UI where the widget is a Windows HWND window ID." . + +ui:CocoaUI + a rdfs:Class , + owl:Class ; + rdfs:subClassOf ui:UI ; + rdfs:label "Cocoa UI" ; + rdfs:comment "A UI where the widget is a pointer to a NSView." . + +ui:ui + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain lv2:Plugin ; + rdfs:range ui:UI ; + rdfs:label "user interface" ; + rdfs:comment "Relates a plugin to a UI that applies to it." . + +ui:binary + a rdf:Property , + owl:ObjectProperty ; + owl:sameAs lv2:binary ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "binary" ; + rdfs:comment "The shared library that a UI resides in." . + +ui:makeSONameResident + a lv2:Feature ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "make SO name resident" ; + rdfs:comment "UI binary must not be unloaded." . + +ui:noUserResize + a lv2:Feature ; + rdfs:label "no user resize" ; + rdfs:comment "Non-resizable UI." . + +ui:fixedSize + a lv2:Feature ; + rdfs:label "fixed size" ; + rdfs:comment "Non-resizable UI that will never resize itself." . + +ui:scaleFactor + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:range xsd:float ; + rdfs:label "scale factor" ; + rdfs:comment "Scale factor for high resolution screens." . + +ui:backgroundColor + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "background color" ; + rdfs:comment """The background color of the host's UI.""" . + +ui:foregroundColor + a rdf:Property , + owl:DatatypeProperty , + opts:Option ; + rdfs:label "foreground color" ; + rdfs:comment """The foreground color of the host's UI.""" . + +ui:parent + a lv2:Feature ; + rdfs:label "parent" ; + rdfs:comment "The parent for a UI." . + +ui:PortNotification + a rdfs:Class , + owl:Class ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty ui:plugin ; + owl:cardinality 1 ; + rdfs:comment "A PortNotification MUST have exactly one ui:plugin." + ] ; + rdfs:label "Port Notification" ; + rdfs:comment "A description of port updates that a host must send a UI." . + +ui:portNotification + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:UI ; + rdfs:range ui:PortNotification ; + rdfs:label "port notification" ; + rdfs:comment "Specifies a port notification that is required by a UI." . + +ui:plugin + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:PortNotification ; + rdfs:range lv2:Plugin ; + rdfs:label "plugin" ; + rdfs:comment "The plugin a portNotification applies to." . + +ui:portIndex + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain ui:PortNotification ; + rdfs:range xsd:decimal ; + rdfs:label "port index" ; + rdfs:comment "The index of the port a portNotification applies to." . + +ui:notifyType + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:PortNotification ; + rdfs:label "notify type" ; + rdfs:comment "A particular type that the UI should be notified of." . + +ui:resize + a lv2:Feature , + lv2:ExtensionData ; + owl:deprecated "true"^^xsd:boolean ; + rdfs:label "resize" ; + rdfs:comment """A feature that provides control of, and notifications about, a UI's size.""" . + +ui:portMap + a lv2:Feature ; + rdfs:label "port map" ; + rdfs:comment "A feature for accessing the index of a port by symbol." . + +ui:portSubscribe + a lv2:Feature ; + rdfs:label "port subscribe" ; + rdfs:comment "A feature for dynamically subscribing to updates from a port." . + +ui:touch + a lv2:Feature ; + rdfs:label "touch" ; + rdfs:comment "A feature to notify that the user has grabbed a port control." . + +ui:requestValue + a lv2:Feature ; + rdfs:label "request value" ; + rdfs:comment "A feature to request a parameter value from the user via the host." . + +ui:idleInterface + a lv2:Feature , + lv2:ExtensionData ; + rdfs:label "idle interface" ; + rdfs:comment "A feature that provides a callback for the host to drive the UI." . + +ui:showInterface + a lv2:ExtensionData ; + rdfs:label "show interface" ; + rdfs:comment "An interface for showing and hiding a window for a UI." . + +ui:windowTitle + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:string ; + rdfs:label "window title" ; + rdfs:comment "The title for the window shown by LV2UI_Show_Interface." . + +ui:updateRate + a rdf:Property , + owl:DatatypeProperty ; + rdfs:range xsd:float ; + rdfs:label "update rate" ; + rdfs:comment "The target rate, in Hz, to send updates to the UI." . + +ui:protocol + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain ui:PortNotification ; + rdfs:range ui:PortProtocol ; + rdfs:label "protocol" ; + rdfs:comment "The protocol to be used for this notification." . + +ui:PortProtocol + a rdfs:Class ; + rdfs:subClassOf lv2:Feature ; + rdfs:label "Port Protocol" ; + rdfs:comment "A method to communicate port data between a UI and plugin." . + +ui:floatProtocol + a ui:PortProtocol ; + rdfs:label "float protocol" ; + rdfs:comment "A protocol for transferring single floating point values." . + +ui:peakProtocol + a ui:PortProtocol ; + rdfs:label "peak protocol" ; + rdfs:comment "A protocol for sending continuous peak measurements of an audio signal." . + diff --git a/extensions/units.lv2/manifest.ttl b/lv2/units.lv2/manifest.ttl index f3a7605..c6c9286 100644 --- a/extensions/units.lv2/manifest.ttl +++ b/lv2/units.lv2/manifest.ttl @@ -1,7 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/extensions/units> a lv2:Specification ; + 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..bd300a4 --- /dev/null +++ b/lv2/units.lv2/units.meta.ttl @@ -0,0 +1,106 @@ +@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 "Initial unified release." + ] + ] + ] ; + 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.lv2/units.ttl b/lv2/units.lv2/units.ttl new file mode 100644 index 0000000..21a1898 --- /dev/null +++ b/lv2/units.lv2/units.ttl @@ -0,0 +1,378 @@ +@prefix owl: <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 units: <http://lv2plug.in/ns/extensions/units#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/ns/extensions/units> + a owl:Ontology ; + rdfs:label "LV2 Units" ; + rdfs:comment "Units for LV2 values." ; + rdfs:seeAlso <units.meta.ttl> . + +units:Unit + a rdfs:Class , + owl:Class ; + rdfs:label "Unit" ; + rdfs:comment "A unit for a control value." . + +units:unit + a rdf:Property , + owl:ObjectProperty ; + rdfs:range units:Unit ; + rdfs:label "unit" ; + rdfs:comment "The unit used by the value of a port or parameter." . + +units:render + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "unit format string" ; + rdfs:domain units:Unit ; + rdfs:range xsd:string ; + rdfs:comment """A printf format string for rendering a value (e.g., "%f dB").""" . + +units:symbol + a rdf:Property , + owl:DatatypeProperty ; + rdfs:label "unit symbol" ; + rdfs:domain units:Unit ; + rdfs:range xsd:string ; + rdfs:comment """The abbreviated symbol for this unit (e.g., "dB").""" . + +units:Conversion + a rdfs:Class , + owl:Class ; + rdfs:subClassOf [ + a owl:Restriction ; + owl:onProperty units:to ; + owl:cardinality 1 ; + rdfs:comment "A conversion MUST have exactly 1 units:to property." + ] ; + rdfs:label "Conversion" ; + rdfs:comment "A conversion from one unit to another." . + +units:conversion + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain units:Unit ; + rdfs:range units:Conversion ; + rdfs:label "conversion" ; + rdfs:comment "A conversion from this unit to another." . + +units:prefixConversion + a rdf:Property , + owl:ObjectProperty ; + rdfs:subPropertyOf units:conversion ; + rdfs:domain units:Unit ; + rdfs:range units:Conversion ; + rdfs:label "prefix conversion" ; + rdfs:comment "A conversion from this unit to another with the same base but a different prefix." . + +units:to + a rdf:Property , + owl:ObjectProperty ; + rdfs:domain units:Conversion ; + rdfs:range units:Unit ; + rdfs:label "conversion target" ; + rdfs:comment "The target unit this conversion converts to." . + +units:factor + a rdf:Property , + owl:DatatypeProperty ; + rdfs:domain units:Conversion ; + rdfs:label "conversion factor" ; + rdfs:comment "The factor to multiply the source value by in order to convert to the target unit." . + +units:s + a units:Unit ; + units:conversion [ + units:factor 0.0166666666 ; + units:to units:min + ] ; + rdfs:label "seconds" ; + rdfs:comment "Seconds, the SI base unit for time." ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:ms + ] ; + units:render "%f s" ; + units:symbol "s" . + +units:ms + a units:Unit ; + rdfs:label "milliseconds" ; + rdfs:comment "Milliseconds (thousandths of seconds)." ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:s + ] ; + units:render "%f ms" ; + units:symbol "ms" . + +units:min + a units:Unit ; + units:conversion [ + units:factor 60.0 ; + units:to units:s + ] ; + rdfs:label "minutes" ; + rdfs:comment "Minutes (60s of seconds and 60ths of an hour)." ; + units:render "%f mins" ; + units:symbol "min" . + +units:bar + a units:Unit ; + rdfs:label "bars" ; + rdfs:comment "Musical bars or measures." ; + units:render "%f bars" ; + units:symbol "bars" . + +units:beat + a units:Unit ; + rdfs:label "beats" ; + rdfs:comment "Musical beats." ; + units:render "%f beats" ; + units:symbol "beats" . + +units:frame + a units:Unit ; + rdfs:label "audio frames" ; + rdfs:comment "Audio frames or samples." ; + units:render "%f frames" ; + units:symbol "frames" . + +units:m + a units:Unit ; + units:conversion [ + units:factor 39.37 ; + units:to units:inch + ] ; + rdfs:label "metres" ; + rdfs:comment "Metres, the SI base unit for length." ; + units:prefixConversion [ + units:factor 100 ; + units:to units:cm + ] , [ + units:factor 1000 ; + units:to units:mm + ] , [ + units:factor 0.001 ; + units:to units:km + ] ; + units:render "%f m" ; + units:symbol "m" . + +units:cm + a units:Unit ; + units:conversion [ + units:factor 0.3937 ; + units:to units:inch + ] ; + rdfs:label "centimetres" ; + rdfs:comment "Centimetres (hundredths of metres)." ; + units:prefixConversion [ + units:factor 0.01 ; + units:to units:m + ] , [ + units:factor 10 ; + units:to units:mm + ] , [ + units:factor 0.00001 ; + units:to units:km + ] ; + units:render "%f cm" ; + units:symbol "cm" . + +units:mm + a units:Unit ; + units:conversion [ + units:factor 0.03937 ; + units:to units:inch + ] ; + rdfs:label "millimetres" ; + rdfs:comment "Millimetres (thousandths of metres)." ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:m + ] , [ + units:factor 0.1 ; + units:to units:cm + ] , [ + units:factor 0.000001 ; + units:to units:km + ] ; + units:render "%f mm" ; + units:symbol "mm" . + +units:km + a units:Unit ; + units:conversion [ + units:factor 0.62138818 ; + units:to units:mile + ] ; + rdfs:label "kilometres" ; + rdfs:comment "Kilometres (thousands of metres)." ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:m + ] , [ + units:factor 100000 ; + units:to units:cm + ] , [ + units:factor 1000000 ; + units:to units:mm + ] ; + units:render "%f km" ; + units:symbol "km" . + +units:inch + a units:Unit ; + units:conversion [ + units:factor 0.0254 ; + units:to units:m + ] ; + rdfs:label "inches" ; + rdfs:comment "An inch, defined as exactly 0.0254 metres." ; + units:render "%f\"" ; + units:symbol "in" . + +units:mile + a units:Unit ; + units:conversion [ + units:factor 1609.344 ; + units:to units:m + ] ; + rdfs:label "miles" ; + rdfs:comment "A mile, defined as exactly 1609.344 metres." ; + units:render "%f mi" ; + units:symbol "mi" . + +units:db + a units:Unit ; + rdfs:label "decibels" ; + rdfs:comment "Decibels, a logarithmic relative unit where 0 is unity." ; + units:render "%f dB" ; + units:symbol "dB" . + +units:pc + a units:Unit ; + units:conversion [ + units:factor 0.01 ; + units:to units:coef + ] ; + rdfs:label "percent" ; + rdfs:comment "Percentage, a ratio as a fraction of 100." ; + units:render "%f%%" ; + units:symbol "%" . + +units:coef + a units:Unit ; + units:conversion [ + units:factor 100 ; + units:to units:pc + ] ; + rdfs:label "coefficient" ; + rdfs:comment "A scale coefficient where 1 is unity, or 100 percent." ; + units:render "* %f" ; + units:symbol "" . + +units:hz + a units:Unit ; + rdfs:label "hertz" ; + rdfs:comment "Hertz, or inverse seconds, the SI derived unit for frequency." ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:khz + ] , [ + units:factor 0.000001 ; + units:to units:mhz + ] ; + units:render "%f Hz" ; + units:symbol "Hz" . + +units:khz + a units:Unit ; + rdfs:label "kilohertz" ; + rdfs:comment "Kilohertz (thousands of Hertz)." ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:hz + ] , [ + units:factor 0.001 ; + units:to units:mhz + ] ; + units:render "%f kHz" ; + units:symbol "kHz" . + +units:mhz + a units:Unit ; + rdfs:label "megahertz" ; + rdfs:comment "Megahertz (millions of Hertz)." ; + units:prefixConversion [ + units:factor 1000000 ; + units:to units:hz + ] , [ + units:factor 0.001 ; + units:to units:khz + ] ; + units:render "%f MHz" ; + units:symbol "MHz" . + +units:bpm + a units:Unit ; + rdfs:label "beats per minute" ; + rdfs:comment "Beats Per Minute (BPM), the standard unit for musical tempo." ; + units:prefixConversion [ + units:factor 0.0166666666 ; + units:to units:hz + ] ; + units:render "%f BPM" ; + units:symbol "BPM" . + +units:oct + a units:Unit ; + units:conversion [ + units:factor 12.0 ; + units:to units:semitone12TET + ] ; + rdfs:label "octaves" ; + rdfs:comment "Octaves, relative musical pitch where +1 octave doubles the frequency." ; + units:render "%f octaves" ; + units:symbol "oct" . + +units:cent + a units:Unit ; + units:conversion [ + units:factor 0.01 ; + units:to units:semitone12TET + ] ; + rdfs:label "cents" ; + rdfs:comment "Cents (hundredths of semitones)." ; + units:render "%f ct" ; + units:symbol "ct" . + +units:semitone12TET + a units:Unit ; + units:conversion [ + units:factor 0.083333333 ; + units:to units:oct + ] ; + rdfs:label "semitones" ; + rdfs:comment "A semitone in the 12-tone equal temperament scale." ; + units:render "%f semi" ; + units:symbol "semi" . + +units:degree + a units:Unit ; + rdfs:label "degrees" ; + rdfs:comment "An angle where 360 degrees is one full rotation." ; + units:render "%f deg" ; + units:symbol "deg" . + +units:midiNote + a units:Unit ; + rdfs:label "MIDI note" ; + rdfs:comment "A MIDI note number." ; + units:render "MIDI note %d" ; + units:symbol "note" . + diff --git a/ext/uri-map.lv2/manifest.ttl b/lv2/uri-map.lv2/manifest.ttl index 62d0bb6..a64e4fb 100644 --- a/ext/uri-map.lv2/manifest.ttl +++ b/lv2/uri-map.lv2/manifest.ttl @@ -1,6 +1,9 @@ -@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <http://lv2plug.in/ns/ext/uri-map> a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 6 ; rdfs:seeAlso <uri-map.ttl> . + diff --git a/lv2/uri-map.lv2/uri-map.meta.ttl b/lv2/uri-map.lv2/uri-map.meta.ttl new file mode 100644 index 0000000..d66c289 --- /dev/null +++ b/lv2/uri-map.lv2/uri-map.meta.ttl @@ -0,0 +1,41 @@ +@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#> . + +<http://lv2plug.in/ns/ext/uri-map> + a doap:Project ; + doap:maintainer <http://drobilla.net/drobilla#me> ; + doap:created "2008-00-00" ; + doap:developer <http://lv2plug.in/ns/meta#larsl> , + <http://drobilla.net/drobilla#me> ; + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +<span class="warning">This extension is deprecated.</span> New implementations +should use [LV2 URID](urid.html) instead. + +This extension defines a simple mechanism for plugins to map URIs to integers, +usually for performance reasons (e.g. processing events typed by URIs in real +time). The expected use case is for plugins to map URIs to integers for things +they 'understand' at instantiation time, and store those values for use in the +audio thread without doing any string comparison. This allows the +extensibility of RDF with the performance of integers (or centrally defined +enumerations). + +"""^^lv2:Markdown . + diff --git a/lv2/uri-map.lv2/uri-map.ttl b/lv2/uri-map.lv2/uri-map.ttl new file mode 100644 index 0000000..7a7d6e3 --- /dev/null +++ b/lv2/uri-map.lv2/uri-map.ttl @@ -0,0 +1,13 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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 umap: <http://lv2plug.in/ns/ext/uri-map#> . + +<http://lv2plug.in/ns/ext/uri-map> + a lv2:Feature ; + owl:deprecated true ; + rdfs:label "LV2 URI Map" ; + rdfs:comment "A feature for mapping URIs to integers." ; + rdfs:seeAlso <uri-map.meta.ttl> . + diff --git a/lv2/urid.lv2/manifest.ttl b/lv2/urid.lv2/manifest.ttl new file mode 100644 index 0000000..772e2b6 --- /dev/null +++ b/lv2/urid.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/urid> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 4 ; + rdfs:seeAlso <urid.ttl> . + diff --git a/lv2/urid.lv2/urid.meta.ttl b/lv2/urid.lv2/urid.meta.ttl new file mode 100644 index 0000000..1f10752 --- /dev/null +++ b/lv2/urid.lv2/urid.meta.ttl @@ -0,0 +1,72 @@ +@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 urid: <http://lv2plug.in/ns/ext/urid#> . + +<http://lv2plug.in/ns/ext/urid> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2 URID" ; + doap:shortdesc "Features for mapping URIs to and from integers." ; + 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 "Initial unified release." + ] + ] + ] ; + lv2:documentation """ + +This extension defines a simple mechanism for plugins to map URIs to and from +integers. This is usually used for performance reasons, for example for +processing events with URI types in real-time audio code). Typically, plugins +map URIs to integers for things they "understand" at instantiation time, and +store those values for use in the audio thread without doing any string +comparison. This allows for the extensibility of RDF but with the performance +of integers. + +This extension is intended as an improved and simplified replacement for the +[uri-map](uri-map.html) extension, since the `map` context parameter there has +proven problematic. This extension is functionally equivalent to the uri-map +extension with a NULL context. New implementations are encouraged to use this +extension for URI mapping. + +"""^^lv2:Markdown . + +urid:map + lv2:documentation """ + +To support this feature, the host must pass an LV2_Feature to +LV2_Descriptor::instantiate() with URI LV2_URID__map and data pointed to an +instance of LV2_URID_Map. + +"""^^lv2:Markdown . + +urid:unmap + lv2:documentation """ + +To support this feature, the host must pass an LV2_Feature to +LV2_Descriptor::instantiate() with URI LV2_URID__unmap and data pointed to an +instance of LV2_URID_Unmap. + +"""^^lv2:Markdown . + diff --git a/lv2/urid.lv2/urid.ttl b/lv2/urid.lv2/urid.ttl new file mode 100644 index 0000000..6ce666a --- /dev/null +++ b/lv2/urid.lv2/urid.ttl @@ -0,0 +1,22 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . + +<http://lv2plug.in/ns/ext/urid> + a owl:Ontology ; + rdfs:label "LV2 URID" ; + rdfs:comment "Features for mapping URIs to and from integers." ; + rdfs:seeAlso <urid.meta.ttl> ; + owl:imports <http://lv2plug.in/ns/lv2core> . + +urid:map + a lv2:Feature ; + rdfs:label "map" ; + rdfs:comment "A feature to map URI strings to integer URIDs." . + +urid:unmap + a lv2:Feature ; + rdfs:label "unmap" ; + rdfs:comment "A feature to unmap URIDs back to strings." . + diff --git a/lv2/worker.lv2/manifest.ttl b/lv2/worker.lv2/manifest.ttl new file mode 100644 index 0000000..692720d --- /dev/null +++ b/lv2/worker.lv2/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/worker> + a lv2:Specification ; + lv2:minorVersion 1 ; + lv2:microVersion 2 ; + rdfs:seeAlso <worker.ttl> . + diff --git a/lv2/worker.lv2/worker.meta.ttl b/lv2/worker.lv2/worker.meta.ttl new file mode 100644 index 0000000..2fc51bc --- /dev/null +++ b/lv2/worker.lv2/worker.meta.ttl @@ -0,0 +1,82 @@ +@prefix dcs: <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 work: <http://lv2plug.in/ns/ext/worker#> . + +<http://lv2plug.in/ns/ext/worker> + a doap:Project ; + doap:name "LV2 Worker" ; + 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 +another thread. Plugins can use this interface to safely perform work that is +not real-time safe, and receive the result in the run context. The details of +threading are managed by the host, allowing plugins to be simple and portable +while using resources more efficiently. + +This interface is designed to gracefully support single-threaded synchronous +execution, which allows the same code to work with sample accuracy for offline +rendering. For example, a sampler plugin may schedule a sample to be loaded +from disk in another thread. During live execution, the host will call the +plugin's work method from another thread, and deliver the result to the audio +thread when it is finished. However, during offline export, the +<q>scheduled</q> load would be executed immediately in the same thread. This +enables reproducible offline rendering, where any changes affect the output +immediately regardless of how long the work takes to execute. + +"""^^lv2:Markdown . + +work:interface + lv2:documentation """ + +The work interface provided by a plugin, LV2_Worker_Interface. + + :::turtle + + @prefix work: <http://lv2plug.in/ns/ext/worker#> . + + <plugin> + a lv2:Plugin ; + lv2:extensionData work:interface . + +"""^^lv2:Markdown . + +work:schedule + lv2:documentation """ + +The work scheduling feature provided by a host, LV2_Worker_Schedule. + +If the host passes this feature to LV2_Descriptor::instantiate, the plugin MAY +use it to schedule work in the audio thread, and MUST NOT call it in any other +context. Hosts MAY pass this feature to other functions as well, in which case +the plugin MAY use it to schedule work in the calling context. The plugin MUST +NOT assume any relationship between different schedule features. + +"""^^lv2:Markdown . + diff --git a/lv2/worker.lv2/worker.ttl b/lv2/worker.lv2/worker.ttl new file mode 100644 index 0000000..581be71 --- /dev/null +++ b/lv2/worker.lv2/worker.ttl @@ -0,0 +1,24 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@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 work: <http://lv2plug.in/ns/ext/worker#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/ns/ext/worker> + a owl:Ontology ; + rdfs:label "LV2 Worker" ; + rdfs:comment "Support for doing non-realtime work in plugins." ; + owl:imports <http://lv2plug.in/ns/lv2core> ; + rdfs:seeAlso <worker.meta.ttl> . + +work:interface + a lv2:ExtensionData ; + rdfs:label "work interface" ; + rdfs:comment "The work interface provided by a plugin." . + +work:schedule + a lv2:Feature ; + rdfs:label "work schedule" ; + rdfs:comment "The work scheduling feature provided by a host." . + diff --git a/lv2compatgen/lv2compatgen.py b/lv2compatgen/lv2compatgen.py deleted file mode 100755 index 7b91444..0000000 --- a/lv2compatgen/lv2compatgen.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# lv2compatgen -# Generates compatiblity documentation for LV2 hosts and plugins. -# Copyright (c) 2009 David Robillard <d@drobilla.net> -# -# 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. - -__authors__ = "David Robillard" -__license__ = "MIT License <http://www.opensource.org/licenses/mit-license.php>" -__contact__ = "devel@lists.lv2plug.in" -__date__ = "2009-11-08" - -import os -import sys -import datetime -import re -import urllib -import RDF - -rdf = RDF.NS('http://www.w3.org/1999/02/22-rdf-syntax-ns#') -rdfs = RDF.NS('http://www.w3.org/2000/01/rdf-schema#') -owl = RDF.NS('http://www.w3.org/2002/07/owl#') -vs = RDF.NS('http://www.w3.org/2003/06/sw-vocab-status/ns#') -lv2 = RDF.NS('http://lv2plug.in/ns/lv2core#') -doap = RDF.NS('http://usefulinc.com/ns/doap#') -foaf = RDF.NS('http://xmlns.com/foaf/0.1/') - -def usage(): - print """Usage: lv2compatgen.py DATA - -DATA must be a Redland RDF store containing all relevant LV2 data -(a file would be too slow to parse). - -You can create one with something like this: - -find /usr/lib/lv2 /usr/local/lib/lv2 ~/.lv2 -name '*.ttl' >> lv2_files.txt -for i in `cat lv2_files.txt`; do - rapper -g $i -o turtle >> lv2_all.ttl; -done -rdfproc ./data parse lv2_all.ttl turtle -""" - -if len(sys.argv) != 2: - usage() - sys.exit(1) - -store_name = sys.argv[1] - -storage = RDF.HashStorage(store_name, options="hash-type='bdb'") -model = RDF.Model(storage=storage) - -class Plugin: - def __init__(self): - self.name = "" - self.optional = [] - self.required = [] - -class Feature: - def __init__(self): - self.name = "" - -# Find plugins and their required and optional features -plugins = {} -features = {} -for i in model.find_statements(RDF.Statement(None, rdf.type, lv2.Plugin)): - plug = Plugin() - for j in model.find_statements(RDF.Statement(i.subject, lv2.requiredFeature, None)): - plug.required += [j.object.uri] - if not j.object.uri in features: - features[j.object.uri] = Feature() - for j in model.find_statements(RDF.Statement(i.subject, lv2.optionalFeature, None)): - plug.optional += [j.object.uri] - if not j.object.uri in features: - features[j.object.uri] = Feature() - for j in model.find_statements(RDF.Statement(i.subject, doap.name, None)): - plug.name = str(j.object) - plugins[i.subject.uri] = plug - -# Find feature names -for uri, feature in features.items(): - for j in model.find_statements(RDF.Statement(uri, doap.name, None)): - feature.name = j.object.literal_value['string'] - for j in model.find_statements(RDF.Statement(uri, rdfs.label, None)): - print "LABEL:", j.object - -# Generate body -body = '<table><tr><td></td>' -for uri, feature in features.items(): - if feature.name != "": - body += '<td>%s</td>' % feature.name - else: - body += '<td>%s</td>' % uri - -for uri, plug in plugins.items(): - #body += '<tr><td>%s</td>' % uri - body += '<tr><td>%s</td>' % plug.name - for e in features.keys(): - if e in plug.required: - body += '<td class="required">Required</td>' - elif e in plug.optional: - body += '<td class="optional">Optional</td>' - else: - body += '<td></td>' - body += '</tr>\n' -body += '</table>' - -# Load output template -temploc = 'template.html' -template = None -try: - f = open(temploc, "r") - template = f.read() -except Exception, e: - print 'Error reading template:', str(e) - sys.exit(2) - -# Load style -styleloc = 'style.css' -style = '' -try: - f = open(styleloc, "r") - style = f.read() -except Exception, e: - print "Error reading from style \"" + styleloc + "\": " + str(e) - usage() - -# Replace tokens in template -template = template.replace('@STYLE@', style) -template = template.replace('@BODY@', body) -template = template.replace('@TIME@', datetime.datetime.utcnow().strftime('%F %H:%M UTC')) - -# Write output -output = open('./compat.html', 'w') -print >>output, template -output.close() diff --git a/lv2compatgen/style.css b/lv2compatgen/style.css deleted file mode 120000 index f320096..0000000 --- a/lv2compatgen/style.css +++ /dev/null @@ -1 +0,0 @@ -../doc/style.css
\ No newline at end of file diff --git a/lv2compatgen/template.html b/lv2compatgen/template.html deleted file mode 100644 index 2948759..0000000 --- a/lv2compatgen/template.html +++ /dev/null @@ -1,26 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xml:lang="en"> - <head> - <title>LV2 Feature Support</title> - <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" /> - <meta name="generator" content="lv2specgen" /> - <style type="text/css"> - @STYLE@ - </style> - </head> - <body> - <h1 id="title">LV2 Feature Support</h1> - - @BODY@ - - <div> - <br /> - <span>Automatically generated - by <a href="http://drobilla.net/software/lv2compatgen">lv2compatgen</a> - at @TIME@</span> - </div> - - </body> -</html> - diff --git a/lv2include/lv2include.py b/lv2include/lv2include.py deleted file mode 100755 index 8786411..0000000 --- a/lv2include/lv2include.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -"""A program (and Python module) to generate a tree of symlinks to LV2 -extension bundles, where the path of the symlink corresponds to the URI of -the extension. This allows including extension headers in code without using -the bundle name. Including extension headers in this way is much better, -since there is no dependency on the (meaningless and non-persistent) bundle -name in the code using the header. - -For example, after running lv2includegen (and setting the compiler include -path appropriately), LV2 headers could be included like so: - -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" -#include "lv2/lv2plug.in/ns/ext/event/event.h" -#include "lv2/example.org/foo/foo.h" - -Where the initial "lv2" is arbitrary; in this case lv2includegen's output -directory was "lv2", and that directory's parent was added to the compiler -include search path. It is a good idea to use such a prefix directory so -domain names do not conflict with anything else in the include path. -""" - -__authors__ = 'David Robillard' -__license = 'GNU GPL v3 or later <http://www.gnu.org/licenses/gpl.html>' -__contact__ = 'devel@lists.lv2plug.in' -__date__ = '2010-10-05' - -import errno -import glob -import os -import stat -import sys - -import RDF - -rdf = RDF.NS('http://www.w3.org/1999/02/22-rdf-syntax-ns#') -lv2 = RDF.NS('http://lv2plug.in/ns/lv2core#') - -def lv2_path(): - "Return the LV2 search path (LV2_PATH in the environment, or a default)." - if 'LV2_PATH' in os.environ: - return os.environ['LV2_PATH'] - else: - ret = '/usr/lib/lv2' + os.pathsep + '/usr/local/lib/lv2' - print 'LV2_PATH unset, using default ' + ret - return ret - -def __bundles(search_path): - "Return a list of all LV2 bundles found in search_path." - dirs = search_path.split(os.pathsep) - bundles = [] - for dir in dirs: - bundles += glob.glob(os.path.join(dir, '*.lv2')) - return bundles - -def __usage(): - script = os.path.basename(sys.argv[0]) - print """Usage: - %s OUTDIR - - OUTDIR : Directory to build include tree - -Example: - %s /usr/local/include/lv2 -""" % (script, script) - -def __mkdir_p(path): - "Equivalent of UNIX mkdir -p" - try: - os.makedirs(path) - except OSError as e: - if e.errno == errno.EEXIST: - pass - else: - raise - -def build_tree(search_path, outdir): - """Build a directory tree under outdir containing symlinks to all LV2 - extensions found in search_path, such that the symlink paths correspond to - the extension URIs.""" - for bundle in __bundles(search_path): - # Load manifest into model - manifest = RDF.Model() - parser = RDF.Parser(name="guess") - parser.parse_into_model(manifest, 'file://' + os.path.join(bundle, 'manifest.ttl')) - - # Query extension URI - results = manifest.find_statements(RDF.Statement(None, rdf.type, lv2.Specification)) - for r in results: - ext_uri = str(r.subject.uri) - ext_scheme = ext_uri[0:ext_uri.find(':')] - ext_path = os.path.normpath(ext_uri[ext_uri.find(':') + 1:].lstrip('/')) - ext_dir = os.path.join(outdir, ext_scheme, ext_path) - - # Make parent directories - __mkdir_p(os.path.dirname(ext_dir)) - - # Remove existing symlink if necessary - if os.access(ext_dir, os.F_OK): - mode = os.lstat(ext_dir)[stat.ST_MODE] - if stat.S_ISLNK(mode): - os.remove(ext_dir) - else: - raise Exception(ext_dir + " exists and is not a link") - - # Make symlink to bundle directory - os.symlink(bundle, ext_dir) - -if __name__ == "__main__": - args = sys.argv[1:] - if len(args) != 1: - __usage() - sys.exit(1) - - outdir = args[0] - print "Building LV2 include tree at", outdir - - build_tree(lv2_path(), outdir) diff --git a/lv2specgen/DTD/xhtml-attribs-1.mod b/lv2specgen/DTD/xhtml-attribs-1.mod new file mode 100644 index 0000000..dbfe42e --- /dev/null +++ b/lv2specgen/DTD/xhtml-attribs-1.mod @@ -0,0 +1,142 @@ +<!-- ...................................................................... --> +<!-- XHTML Common Attributes Module ...................................... --> +<!-- file: xhtml-attribs-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-attribs-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Common Attributes + + This module declares many of the common attributes for the XHTML DTD. + %NS.decl.attrib; is declared in the XHTML Qname module. + + Note that this file was extended in XHTML Modularization 1.1 to + include declarations of "global" versions of the attribute collections. + The global versions of the attributes are for use on elements in other + namespaces. The global version of "common" includes the xmlns declaration + for the prefixed version of the xhtml namespace. If you are only using a + specific attribute or an individual attribute collection, you must also + include the XHTML.xmlns.attrib.prefixed PE on your elements. +--> + +<!ENTITY % id.attrib + "id ID #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.id.attrib + "%XHTML.prefix;:id ID #IMPLIED" +> +]]> + +<!ENTITY % class.attrib + "class NMTOKENS #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.class.attrib + "%XHTML.prefix;:class NMTOKENS #IMPLIED" +> +]]> + +<!ENTITY % title.attrib + "title %Text.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.title.attrib + "%XHTML.prefix;:title %Text.datatype; #IMPLIED" +> +]]> + +<!ENTITY % Core.extra.attrib "" > + +<!ENTITY % Core.attrib + "%XHTML.xmlns.attrib; + %id.attrib; + %class.attrib; + %title.attrib; + xml:space ( preserve ) #FIXED 'preserve' + %Core.extra.attrib;" +> + +<!ENTITY % XHTML.global.core.extra.attrib "" > + +<![%XHTML.global.attrs.prefixed;[ + +<!ENTITY % XHTML.global.core.attrib + "%XHTML.global.id.attrib; + %XHTML.global.class.attrib; + %XHTML.global.title.attrib; + %XHTML.global.core.extra.attrib;" +> +]]> + +<!ENTITY % XHTML.global.core.attrib "" > + + +<!ENTITY % lang.attrib + "xml:lang %LanguageCode.datatype; #IMPLIED" +> + +<![%XHTML.bidi;[ +<!ENTITY % dir.attrib + "dir ( ltr | rtl ) #IMPLIED" +> + +<!ENTITY % I18n.attrib + "%dir.attrib; + %lang.attrib;" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY XHTML.global.i18n.attrib + "%XHTML.prefix;:dir ( ltr | rtl ) #IMPLIED + %lang.attrib;" +> +]]> +<!ENTITY XHTML.global.i18n.attrib "" > + +]]> +<!ENTITY % I18n.attrib + "%lang.attrib;" +> +<!ENTITY % XHTML.global.i18n.attrib + "%lang.attrib;" +> + +<!ENTITY % Common.extra.attrib "" > +<!ENTITY % XHTML.global.common.extra.attrib "" > + +<!-- intrinsic event attributes declared previously +--> +<!ENTITY % Events.attrib "" > + +<!ENTITY % XHTML.global.events.attrib "" > + +<!ENTITY % Common.attrib + "%Core.attrib; + %I18n.attrib; + %Events.attrib; + %Common.extra.attrib;" +> + +<!ENTITY % XHTML.global.common.attrib + "%XHTML.xmlns.attrib.prefixed; + %XHTML.global.core.attrib; + %XHTML.global.i18n.attrib; + %XHTML.global.events.attrib; + %XHTML.global.common.extra.attrib;" +> + +<!-- end of xhtml-attribs-1.mod --> diff --git a/lv2specgen/DTD/xhtml-base-1.mod b/lv2specgen/DTD/xhtml-base-1.mod new file mode 100644 index 0000000..ba47b40 --- /dev/null +++ b/lv2specgen/DTD/xhtml-base-1.mod @@ -0,0 +1,53 @@ +<!-- ...................................................................... --> +<!-- XHTML Base Element Module ........................................... --> +<!-- file: xhtml-base-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-base-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Base element + + base + + This module declares the base element type and its attributes, + used to define a base URI against which relative URIs in the + document will be resolved. + + Note that this module also redeclares the content model for + the head element to include the base element. +--> + +<!-- base: Document Base URI ........................... --> + +<!ENTITY % base.element "INCLUDE" > +<![%base.element;[ +<!ENTITY % base.content "EMPTY" > +<!ENTITY % base.qname "base" > +<!ELEMENT %base.qname; %base.content; > +<!-- end of base.element -->]]> + +<!ENTITY % base.attlist "INCLUDE" > +<![%base.attlist;[ +<!ATTLIST %base.qname; + %XHTML.xmlns.attrib; + href %URI.datatype; #REQUIRED +> +<!-- end of base.attlist -->]]> + +<!ENTITY % head.content + "( %HeadOpts.mix;, + ( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? ) + | ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))" +> + +<!-- end of xhtml-base-1.mod --> diff --git a/lv2specgen/DTD/xhtml-basic-table-1.mod b/lv2specgen/DTD/xhtml-basic-table-1.mod new file mode 100644 index 0000000..acbd046 --- /dev/null +++ b/lv2specgen/DTD/xhtml-basic-table-1.mod @@ -0,0 +1,167 @@ +<!-- ....................................................................... --> +<!-- XHTML Basic Table Module ............................................. --> +<!-- file: xhtml-basic-table-1.mod + + This is XHTML Basic, a proper subset of XHTML. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-basic-table-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-basic-table-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Basic Tables + + table, caption, tr, th, td + + This table module declares elements and attributes defining + a table model based fundamentally on features found in the + widely-deployed HTML 3.2 table model. While this module + mimics the content model and table attributes of HTML 3.2 + tables, the element types declared herein also includes all + HTML 4 common and most of the HTML 4 table attributes. +--> + +<!-- declare qualified element type names: +--> +<!ENTITY % table.qname "table" > +<!ENTITY % caption.qname "caption" > +<!ENTITY % tr.qname "tr" > +<!ENTITY % th.qname "th" > +<!ENTITY % td.qname "td" > + +<!-- horizontal alignment attributes for cell contents +--> +<!ENTITY % CellHAlign.attrib + "align ( left + | center + | right ) #IMPLIED" +> + +<!-- vertical alignment attributes for cell contents +--> +<!ENTITY % CellVAlign.attrib + "valign ( top + | middle + | bottom ) #IMPLIED" +> + +<!-- scope is simpler than axes attribute for common tables +--> +<!ENTITY % scope.attrib + "scope ( row | col ) #IMPLIED" +> + +<!-- table: Table Element .............................. --> + +<!ENTITY % table.element "INCLUDE" > +<![%table.element;[ +<!ENTITY % table.content + "( %caption.qname;?, %tr.qname;+ )" +> +<!ELEMENT %table.qname; %table.content; > +<!-- end of table.element -->]]> + +<!ENTITY % table.attlist "INCLUDE" > +<![%table.attlist;[ +<!ATTLIST %table.qname; + %Common.attrib; + summary %Text.datatype; #IMPLIED + width %Length.datatype; #IMPLIED +> +<!-- end of table.attlist -->]]> + +<!-- caption: Table Caption ............................ --> + +<!ENTITY % caption.element "INCLUDE" > +<![%caption.element;[ +<!ENTITY % caption.content + "( #PCDATA | %Inline.mix; )*" +> +<!ELEMENT %caption.qname; %caption.content; > +<!-- end of caption.element -->]]> + +<!ENTITY % caption.attlist "INCLUDE" > +<![%caption.attlist;[ +<!ATTLIST %caption.qname; + %Common.attrib; +> +<!-- end of caption.attlist -->]]> + +<!-- tr: Table Row ..................................... --> + +<!ENTITY % tr.element "INCLUDE" > +<![%tr.element;[ +<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" > +<!ELEMENT %tr.qname; %tr.content; > +<!-- end of tr.element -->]]> + +<!ENTITY % tr.attlist "INCLUDE" > +<![%tr.attlist;[ +<!ATTLIST %tr.qname; + %Common.attrib; + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of tr.attlist -->]]> + +<!-- th: Table Header Cell ............................. --> + +<!-- th is for header cells, td for data, + but for cells acting as both use td +--> + +<!ENTITY % th.element "INCLUDE" > +<![%th.element;[ +<!ENTITY % th.content + "( #PCDATA | %FlowNoTable.mix; )*" +> +<!ELEMENT %th.qname; %th.content; > +<!-- end of th.element -->]]> + +<!ENTITY % th.attlist "INCLUDE" > +<![%th.attlist;[ +<!ATTLIST %th.qname; + %Common.attrib; + abbr %Text.datatype; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + %scope.attrib; + rowspan %Number.datatype; '1' + colspan %Number.datatype; '1' + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of th.attlist -->]]> + +<!-- td: Table Data Cell ............................... --> + +<!ENTITY % td.element "INCLUDE" > +<![%td.element;[ +<!ENTITY % td.content + "( #PCDATA | %FlowNoTable.mix; )*" +> +<!ELEMENT %td.qname; %td.content; > +<!-- end of td.element -->]]> + +<!ENTITY % td.attlist "INCLUDE" > +<![%td.attlist;[ +<!ATTLIST %td.qname; + %Common.attrib; + abbr %Text.datatype; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + %scope.attrib; + rowspan %Number.datatype; '1' + colspan %Number.datatype; '1' + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of td.attlist -->]]> + +<!-- end of xhtml-basic-table-1.mod --> diff --git a/lv2specgen/DTD/xhtml-basic11-model-1.mod b/lv2specgen/DTD/xhtml-basic11-model-1.mod new file mode 100644 index 0000000..d2a59e2 --- /dev/null +++ b/lv2specgen/DTD/xhtml-basic11-model-1.mod @@ -0,0 +1,169 @@ +<!-- ....................................................................... --> +<!-- XHTML Basic 1.1 Document Model Module .................................... --> +<!-- file: xhtml-basic11-model-1.mod + + This is XHTML Basic, a proper subset of XHTML. + Copyright 1998-2007 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-basic11-model-1.mod,v 1.6 2009/11/18 19:25:00 smccarro Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Basic 1.1 Document Model 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-basic11-model-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- XHTML Basic Document Model + + This module describes the groupings of elements that make up + common content models for XHTML elements. +--> + +<!-- Optional Elements in head .............. --> + +<!ENTITY % HeadOpts.mix + "( %script.qname; | %style.qname; | %meta.qname; + | %link.qname; | %object.qname; )*" > + +<!-- script and noscript are used to contain scripts + and alternative content +--> +<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" > + +<!-- Miscellaneous Elements ................. --> + +<!ENTITY % Misc.extra "" > + +<!-- These elements are neither block nor inline, and can + essentially be used anywhere in the document body. +--> +<!ENTITY % Misc.class + "%Script.class; + %Misc.extra;" +> + +<!-- Inline Elements ........................ --> + +<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" > + +<!ENTITY % InlPhras.class + "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname; + | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname; + | %abbr.qname; | %acronym.qname; | %q.qname;" > + +<!ENTITY % InlPres.class + "| %tt.qname; | %i.qname; | %b.qname; | %big.qname; + | %small.qname; | %sub.qname; | %sup.qname;" > + +<!ENTITY % I18n.class "" > + +<!ENTITY % Anchor.class "| %a.qname;" > + +<!ENTITY % InlSpecial.class "| %img.qname; | %object.qname;" > + +<!ENTITY % InlForm.class + "| %input.qname; | %select.qname; | %textarea.qname; + | %label.qname; | %button.qname;" > + +<!ENTITY % Inline.extra "" > + +<!ENTITY % Inline.class + "%InlStruct.class; + %InlPhras.class; + %InlPres.class; + %Anchor.class; + %InlSpecial.class; + %InlForm.class; + %Inline.extra;" +> + +<!ENTITY % InlNoAnchor.class + "%InlStruct.class; + %InlPhras.class; + %InlPres.class; + %InlSpecial.class; + %InlForm.class; + %Inline.extra;" +> + +<!ENTITY % InlNoAnchor.mix + "%InlNoAnchor.class; + %Misc.class;" +> + +<!ENTITY % Inline.mix + "%Inline.class; + %Misc.class;" +> + +<!-- Block Elements ......................... --> + +<!ENTITY % Heading.class + "%h1.qname; | %h2.qname; | %h3.qname; + | %h4.qname; | %h5.qname; | %h6.qname;" +> +<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" > + +<!ENTITY % Table.class "| %table.qname;" > + +<!ENTITY % Form.class "| %form.qname;" > + +<!ENTITY % Fieldset.class "| %fieldset.qname;" > + +<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" > + +<!ENTITY % BlkPhras.class + "| %pre.qname; | %blockquote.qname; | %address.qname;" +> + +<!ENTITY % BlkPres.class "| %hr.qname;" > + +<!ENTITY % BlkSpecial.class + "%Table.class; + %Form.class; + %Fieldset.class;" +> + +<!ENTITY % Block.extra "" > + +<!ENTITY % Block.class + "%BlkStruct.class; + %BlkPhras.class; + %BlkPres.class; + %BlkSpecial.class; + %Block.extra;" +> + +<!ENTITY % Block.mix + "%Heading.class; + | %List.class; + | %Block.class; + %Misc.class;" +> + +<!-- All Content Elements ................... --> + +<!-- declares all content except tables +--> +<!ENTITY % FlowNoTable.mix + "%Heading.class; + | %List.class; + | %BlkStruct.class; + %BlkPhras.class; + %Form.class; + %Block.extra; + | %Inline.class; + %Misc.class;" +> + +<!ENTITY % Flow.mix + "%Heading.class; + | %List.class; + | %Block.class; + | %Inline.class; + %Misc.class;" +> + +<!-- end of xhtml-basic11-model-1.mod --> diff --git a/lv2specgen/DTD/xhtml-basic11.dtd b/lv2specgen/DTD/xhtml-basic11.dtd new file mode 100644 index 0000000..ea7b3d6 --- /dev/null +++ b/lv2specgen/DTD/xhtml-basic11.dtd @@ -0,0 +1,221 @@ +<!-- XHTML Basic 1.1 DTD ...................................................... --> +<!-- file: xhtml-basic10.dtd --> + +<!-- XHTML Basic 1.1 DTD + + This is XHTML Basic, a proper subset of XHTML. + + The Extensible HyperText Markup Language (XHTML) + Copyright 1998-2005 World Wide Web Consortium + (Massachusetts Institute of Technology, European Research Consortium + for Informatics and Mathematics, Keio University). + All Rights Reserved. + + Permission to use, copy, modify and distribute the XHTML Basic DTD + and its accompanying documentation for any purpose and without fee is + hereby granted in perpetuity, provided that the above copyright notice + and this paragraph appear in all copies. The copyright holders make + no representation about the suitability of the DTD for any purpose. + + It is provided "as is" without expressed or implied warranty. + + Editors: Murray M. Altheim <mailto:altheim@eng.sun.com> + Peter Stark <mailto:Peter.Stark@ecs.ericsson.se> + Revision: $Id: xhtml-basic11.dtd,v 1.1 2007-03-16 04:00:58 ot Exp $ SMI + +--> +<!-- This is the driver file for version 1.1 of the XHTML Basic DTD. + + This DTD is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC: "-//W3C//DTD XHTML Basic 1.1//EN" + SYSTEM: "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd" +--> +<!ENTITY % XHTML.version "-//W3C//DTD XHTML Basic 1.1//EN" > + +<!-- Use this URI to identify the default namespace: + + "http://www.w3.org/1999/xhtml" + + See the Qualified Names module for information + on the use of namespace prefixes in the DTD. +--> +<!ENTITY % NS.prefixed "IGNORE" > +<!ENTITY % XHTML.prefix "" > + +<!-- Reserved for use with the XLink namespace: +--> +<!ENTITY % XLINK.xmlns "" > +<!ENTITY % XLINK.xmlns.attrib "" > + +<!-- For example, if you are using XHTML Basic 1.1 directly, use + the public identifier in the DOCTYPE declaration, with the namespace + declaration on the document element to identify the default namespace: + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" + "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd" > + <html xmlns="http://www.w3.org/1999/xhtml" + xml:lang="en" > + ... + </html> +--> + +<!-- reserved for future use with document profiles --> +<!ENTITY % XHTML.profile "" > + +<!-- Bidirectional Text features + This feature-test entity is used to declare elements + and attributes used for bidirectional text support. +--> +<!ENTITY % XHTML.bidi "IGNORE" > + +<?doc type="doctype" role="title" { XHTML Basic 1.1 } ?> + +<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> + +<!ENTITY % xhtml-events.module "INCLUDE" > +<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" > + +<!ENTITY % xhtml-model.mod + PUBLIC "-//W3C//ENTITIES XHTML Basic 1.1 Document Model 1.0//EN" + "xhtml-basic11-model-1.mod" > + +<!ENTITY % xhtml-framework.mod + PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN" + "xhtml-framework-1.mod" > +%xhtml-framework.mod; + +<!ENTITY % pre.content + "( #PCDATA + | %InlStruct.class; + %InlPhras.class; + %Anchor.class; + %Inline.extra; )*" +> + +<!ENTITY % xhtml-text.mod + PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN" + "xhtml-text-1.mod" > +%xhtml-text.mod; + +<!ENTITY % xhtml-hypertext.mod + PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN" + "xhtml-hypertext-1.mod" > +%xhtml-hypertext.mod; + +<!ENTITY % xhtml-list.mod + PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN" + "xhtml-list-1.mod" > +%xhtml-list.mod; + +<!-- Add in the value attribute to the li element --> +<!ATTLIST %li.qname; + value %Number.datatype; #IMPLIED +> + +<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> + +<!-- Scripting Module ........................................... --> +<!ENTITY % xhtml-script.module "INCLUDE" > +<![%xhtml-script.module;[ +<!ENTITY % xhtml-script.mod + PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN" + "xhtml-script-1.mod" > +%xhtml-script.mod;]]> + +<!-- Style Sheets Module ......................................... --> +<!ENTITY % xhtml-style.module "INCLUDE" > +<![%xhtml-style.module;[ +<!ENTITY % xhtml-style.mod + PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN" + "xhtml-style-1.mod" > +%xhtml-style.mod;]]> + +<!-- Image Module ............................................... --> +<!ENTITY % xhtml-image.module "INCLUDE" > +<![%xhtml-image.module;[ +<!ENTITY % xhtml-image.mod + PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN" + "xhtml-image-1.mod" > +%xhtml-image.mod;]]> + +<!-- Tables Module ............................................... --> +<!ENTITY % xhtml-table.module "INCLUDE" > +<![%xhtml-table.module;[ +<!ENTITY % xhtml-table.mod + PUBLIC "-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN" + "xhtml-basic-table-1.mod" > +%xhtml-table.mod;]]> + +<!-- Forms Module ............................................... --> +<!ENTITY % xhtml-form.module "INCLUDE" > +<![%xhtml-form.module;[ +<!ENTITY % xhtml-form.mod + PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN" + "xhtml-form-1.mod" > +%xhtml-form.mod;]]> + +<!-- Link Element Module ........................................ --> +<!ENTITY % xhtml-link.module "INCLUDE" > +<![%xhtml-link.module;[ +<!ENTITY % xhtml-link.mod + PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN" + "xhtml-link-1.mod" > +%xhtml-link.mod;]]> + +<!-- Document Metainformation Module ............................ --> +<!ENTITY % xhtml-meta.module "INCLUDE" > +<![%xhtml-meta.module;[ +<!ENTITY % xhtml-meta.mod + PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN" + "xhtml-meta-1.mod" > +%xhtml-meta.mod;]]> + +<!-- Base Element Module ........................................ --> +<!ENTITY % xhtml-base.module "INCLUDE" > +<![%xhtml-base.module;[ +<!ENTITY % xhtml-base.mod + PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN" + "xhtml-base-1.mod" > +%xhtml-base.mod;]]> + +<!-- Param Element Module ....................................... --> +<!ENTITY % xhtml-param.module "INCLUDE" > +<![%xhtml-param.module;[ +<!ENTITY % xhtml-param.mod + PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN" + "xhtml-param-1.mod" > +%xhtml-param.mod;]]> + +<!-- Embedded Object Module ..................................... --> +<!ENTITY % xhtml-object.module "INCLUDE" > +<![%xhtml-object.module;[ +<!ENTITY % xhtml-object.mod + PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN" + "xhtml-object-1.mod" > +%xhtml-object.mod;]]> + +<!-- Inputmode Attribute Module .................................. --> +<!ENTITY % xhtml-inputmode.module "INCLUDE" > +<![%xhtml-inputmode.module;[ +<!ENTITY % xhtml-inputmode.mod + PUBLIC "-//W3C//ELEMENTS XHTML Inputmode 1.0//EN" + "xhtml-inputmode-1.mod" > +%xhtml-inputmode.mod;]]> + +<!-- Target Attribute Module .................................... --> +<!ENTITY % xhtml-target.module "INCLUDE" > +<![%xhtml-target.module;[ +<!ENTITY % xhtml-target.mod + PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN" + "xhtml-target-1.mod" > +%xhtml-target.mod;]]> + + +<!ENTITY % xhtml-struct.mod + PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN" + "xhtml-struct-1.mod" > +%xhtml-struct.mod; + +<!-- end of XHTML Basic 1.1 DTD ........................................... --> diff --git a/lv2specgen/DTD/xhtml-bdo-1.mod b/lv2specgen/DTD/xhtml-bdo-1.mod new file mode 100644 index 0000000..f5f093f --- /dev/null +++ b/lv2specgen/DTD/xhtml-bdo-1.mod @@ -0,0 +1,47 @@ +<!-- ...................................................................... --> +<!-- XHTML BDO Element Module ............................................. --> +<!-- file: xhtml-bdo-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-bdo-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML BDO Element 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Bidirectional Override (bdo) Element + + This modules declares the element 'bdo', used to override the + Unicode bidirectional algorithm for selected fragments of text. + + DEPENDENCIES: + Relies on the conditional section keyword %XHTML.bidi; declared + as "INCLUDE". Bidirectional text support includes both the bdo + element and the 'dir' attribute. +--> + +<!ENTITY % bdo.element "INCLUDE" > +<![%bdo.element;[ +<!ENTITY % bdo.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % bdo.qname "bdo" > +<!ELEMENT %bdo.qname; %bdo.content; > +<!-- end of bdo.element -->]]> + +<!ENTITY % bdo.attlist "INCLUDE" > +<![%bdo.attlist;[ +<!ATTLIST %bdo.qname; + %Core.attrib; + xml:lang %LanguageCode.datatype; #IMPLIED + dir ( ltr | rtl ) #REQUIRED +> +]]> + +<!-- end of xhtml-bdo-1.mod --> diff --git a/lv2specgen/DTD/xhtml-blkphras-1.mod b/lv2specgen/DTD/xhtml-blkphras-1.mod new file mode 100644 index 0000000..3ab40bd --- /dev/null +++ b/lv2specgen/DTD/xhtml-blkphras-1.mod @@ -0,0 +1,164 @@ +<!-- ...................................................................... --> +<!-- XHTML Block Phrasal Module .......................................... --> +<!-- file: xhtml-blkphras-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-blkphras-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Block Phrasal + + address, blockquote, pre, h1, h2, h3, h4, h5, h6 + + This module declares the elements and their attributes used to + support block-level phrasal markup. +--> + +<!ENTITY % address.element "INCLUDE" > +<![%address.element;[ +<!ENTITY % address.content + "( #PCDATA | %Inline.mix; )*" > +<!ENTITY % address.qname "address" > +<!ELEMENT %address.qname; %address.content; > +<!-- end of address.element -->]]> + +<!ENTITY % address.attlist "INCLUDE" > +<![%address.attlist;[ +<!ATTLIST %address.qname; + %Common.attrib; +> +<!-- end of address.attlist -->]]> + +<!ENTITY % blockquote.element "INCLUDE" > +<![%blockquote.element;[ +<!ENTITY % blockquote.content + "( %Block.mix; )*" +> +<!ENTITY % blockquote.qname "blockquote" > +<!ELEMENT %blockquote.qname; %blockquote.content; > +<!-- end of blockquote.element -->]]> + +<!ENTITY % blockquote.attlist "INCLUDE" > +<![%blockquote.attlist;[ +<!ATTLIST %blockquote.qname; + %Common.attrib; + cite %URI.datatype; #IMPLIED +> +<!-- end of blockquote.attlist -->]]> + +<!ENTITY % pre.element "INCLUDE" > +<![%pre.element;[ +<!ENTITY % pre.content + "( #PCDATA + | %InlStruct.class; + %InlPhras.class; + | %tt.qname; | %i.qname; | %b.qname; + %I18n.class; + %Anchor.class; + | %map.qname; + %Misc.class; + %Inline.extra; )*" +> +<!ENTITY % pre.qname "pre" > +<!ELEMENT %pre.qname; %pre.content; > +<!-- end of pre.element -->]]> + +<!ENTITY % pre.attlist "INCLUDE" > +<![%pre.attlist;[ +<!ATTLIST %pre.qname; + %Common.attrib; +> +<!-- end of pre.attlist -->]]> + +<!-- ................... Heading Elements ................... --> + +<!ENTITY % Heading.content "( #PCDATA | %Inline.mix; )*" > + +<!ENTITY % h1.element "INCLUDE" > +<![%h1.element;[ +<!ENTITY % h1.qname "h1" > +<!ELEMENT %h1.qname; %Heading.content; > +<!-- end of h1.element -->]]> + +<!ENTITY % h1.attlist "INCLUDE" > +<![%h1.attlist;[ +<!ATTLIST %h1.qname; + %Common.attrib; +> +<!-- end of h1.attlist -->]]> + +<!ENTITY % h2.element "INCLUDE" > +<![%h2.element;[ +<!ENTITY % h2.qname "h2" > +<!ELEMENT %h2.qname; %Heading.content; > +<!-- end of h2.element -->]]> + +<!ENTITY % h2.attlist "INCLUDE" > +<![%h2.attlist;[ +<!ATTLIST %h2.qname; + %Common.attrib; +> +<!-- end of h2.attlist -->]]> + +<!ENTITY % h3.element "INCLUDE" > +<![%h3.element;[ +<!ENTITY % h3.qname "h3" > +<!ELEMENT %h3.qname; %Heading.content; > +<!-- end of h3.element -->]]> + +<!ENTITY % h3.attlist "INCLUDE" > +<![%h3.attlist;[ +<!ATTLIST %h3.qname; + %Common.attrib; +> +<!-- end of h3.attlist -->]]> + +<!ENTITY % h4.element "INCLUDE" > +<![%h4.element;[ +<!ENTITY % h4.qname "h4" > +<!ELEMENT %h4.qname; %Heading.content; > +<!-- end of h4.element -->]]> + +<!ENTITY % h4.attlist "INCLUDE" > +<![%h4.attlist;[ +<!ATTLIST %h4.qname; + %Common.attrib; +> +<!-- end of h4.attlist -->]]> + +<!ENTITY % h5.element "INCLUDE" > +<![%h5.element;[ +<!ENTITY % h5.qname "h5" > +<!ELEMENT %h5.qname; %Heading.content; > +<!-- end of h5.element -->]]> + +<!ENTITY % h5.attlist "INCLUDE" > +<![%h5.attlist;[ +<!ATTLIST %h5.qname; + %Common.attrib; +> +<!-- end of h5.attlist -->]]> + +<!ENTITY % h6.element "INCLUDE" > +<![%h6.element;[ +<!ENTITY % h6.qname "h6" > +<!ELEMENT %h6.qname; %Heading.content; > +<!-- end of h6.element -->]]> + +<!ENTITY % h6.attlist "INCLUDE" > +<![%h6.attlist;[ +<!ATTLIST %h6.qname; + %Common.attrib; +> +<!-- end of h6.attlist -->]]> + +<!-- end of xhtml-blkphras-1.mod --> diff --git a/lv2specgen/DTD/xhtml-blkpres-1.mod b/lv2specgen/DTD/xhtml-blkpres-1.mod new file mode 100644 index 0000000..4263f76 --- /dev/null +++ b/lv2specgen/DTD/xhtml-blkpres-1.mod @@ -0,0 +1,40 @@ +<!-- ...................................................................... --> +<!-- XHTML Block Presentation Module ..................................... --> +<!-- file: xhtml-blkpres-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-blkpres-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkpres-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Block Presentational Elements + + hr + + This module declares the elements and their attributes used to + support block-level presentational markup. +--> + +<!ENTITY % hr.element "INCLUDE" > +<![%hr.element;[ +<!ENTITY % hr.content "EMPTY" > +<!ENTITY % hr.qname "hr" > +<!ELEMENT %hr.qname; %hr.content; > +<!-- end of hr.element -->]]> + +<!ENTITY % hr.attlist "INCLUDE" > +<![%hr.attlist;[ +<!ATTLIST %hr.qname; + %Common.attrib; +> +<!-- end of hr.attlist -->]]> + +<!-- end of xhtml-blkpres-1.mod --> diff --git a/lv2specgen/DTD/xhtml-blkstruct-1.mod b/lv2specgen/DTD/xhtml-blkstruct-1.mod new file mode 100644 index 0000000..4ecfc11 --- /dev/null +++ b/lv2specgen/DTD/xhtml-blkstruct-1.mod @@ -0,0 +1,57 @@ +<!-- ...................................................................... --> +<!-- XHTML Block Structural Module ....................................... --> +<!-- file: xhtml-blkstruct-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-blkstruct-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-blkstruct-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Block Structural + + div, p + + This module declares the elements and their attributes used to + support block-level structural markup. +--> + +<!ENTITY % div.element "INCLUDE" > +<![%div.element;[ +<!ENTITY % div.content + "( #PCDATA | %Flow.mix; )*" +> +<!ENTITY % div.qname "div" > +<!ELEMENT %div.qname; %div.content; > +<!-- end of div.element -->]]> + +<!ENTITY % div.attlist "INCLUDE" > +<![%div.attlist;[ +<!ATTLIST %div.qname; + %Common.attrib; +> +<!-- end of div.attlist -->]]> + +<!ENTITY % p.element "INCLUDE" > +<![%p.element;[ +<!ENTITY % p.content + "( #PCDATA | %Inline.mix; )*" > +<!ENTITY % p.qname "p" > +<!ELEMENT %p.qname; %p.content; > +<!-- end of p.element -->]]> + +<!ENTITY % p.attlist "INCLUDE" > +<![%p.attlist;[ +<!ATTLIST %p.qname; + %Common.attrib; +> +<!-- end of p.attlist -->]]> + +<!-- end of xhtml-blkstruct-1.mod --> diff --git a/lv2specgen/DTD/xhtml-charent-1.mod b/lv2specgen/DTD/xhtml-charent-1.mod new file mode 100644 index 0000000..1ea7016 --- /dev/null +++ b/lv2specgen/DTD/xhtml-charent-1.mod @@ -0,0 +1,38 @@ +<!-- ...................................................................... --> +<!-- XHTML Character Entities Module ......................................... --> +<!-- file: xhtml-charent-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved. + Revision: $Id: xhtml-charent-1.mod,v 1.1 2001/02/13 12:24:22 ht Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN" + SYSTEM "http://www.w3.org/TR/xhtml-modulatization/DTD/xhtml-charent-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Character Entities for XHTML + + This module declares the set of character entities for XHTML, + including the Latin 1, Symbol and Special character collections. +--> + +<!ENTITY % xhtml-lat1 + PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" + "xhtml-lat1.ent" > +<!ENTITY % xhtml-symbol + PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" + "xhtml-symbol.ent" > +<!ENTITY % xhtml-special + PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" + "xhtml-special.ent" > + +%xhtml-lat1; +%xhtml-symbol; +%xhtml-special; + +<!-- end of xhtml-charent-1.mod --> diff --git a/lv2specgen/DTD/xhtml-csismap-1.mod b/lv2specgen/DTD/xhtml-csismap-1.mod new file mode 100644 index 0000000..686eee2 --- /dev/null +++ b/lv2specgen/DTD/xhtml-csismap-1.mod @@ -0,0 +1,114 @@ +<!-- ...................................................................... --> +<!-- XHTML Client-side Image Map Module .................................. --> +<!-- file: xhtml-csismap-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-csismap-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Client-side Image Maps + + area, map + + This module declares elements and attributes to support client-side + image maps. This requires that the Image Module (or a module + declaring the img element type) be included in the DTD. + + These can be placed in the same document or grouped in a + separate document, although the latter isn't widely supported +--> + +<!ENTITY % area.element "INCLUDE" > +<![%area.element;[ +<!ENTITY % area.content "EMPTY" > +<!ENTITY % area.qname "area" > +<!ELEMENT %area.qname; %area.content; > +<!-- end of area.element -->]]> + +<!ENTITY % Shape.datatype "( rect | circle | poly | default )"> +<!ENTITY % Coords.datatype "CDATA" > + +<!ENTITY % area.attlist "INCLUDE" > +<![%area.attlist;[ +<!ATTLIST %area.qname; + %Common.attrib; + href %URI.datatype; #IMPLIED + shape %Shape.datatype; 'rect' + coords %Coords.datatype; #IMPLIED + nohref ( nohref ) #IMPLIED + alt %Text.datatype; #REQUIRED + tabindex %Number.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED +> +<!-- end of area.attlist -->]]> + +<!-- modify anchor attribute definition list + to allow for client-side image maps +--> +<!ATTLIST %a.qname; + shape %Shape.datatype; 'rect' + coords %Coords.datatype; #IMPLIED +> + +<!-- modify img attribute definition list + to allow for client-side image maps +--> +<!ATTLIST %img.qname; + usemap IDREF #IMPLIED +> + +<!-- modify form input attribute definition list + to allow for client-side image maps +--> +<!ATTLIST %input.qname; + usemap IDREF #IMPLIED +> + +<!-- modify object attribute definition list + to allow for client-side image maps +--> +<!ATTLIST %object.qname; + usemap IDREF #IMPLIED +> + +<!-- 'usemap' points to the 'id' attribute of a <map> element, + which must be in the same document; support for external + document maps was not widely supported in HTML and is + eliminated in XHTML. + + It is considered an error for the element pointed to by + a usemap IDREF to occur in anything but a <map> element. +--> + +<!ENTITY % map.element "INCLUDE" > +<![%map.element;[ +<!ENTITY % map.content + "(( %Block.mix; ) | %area.qname; )+" +> +<!ENTITY % map.qname "map" > +<!ELEMENT %map.qname; %map.content; > +<!-- end of map.element -->]]> + +<!ENTITY % map.attlist "INCLUDE" > +<![%map.attlist;[ +<!ATTLIST %map.qname; + %XHTML.xmlns.attrib; + id ID #REQUIRED + %class.attrib; + %title.attrib; + %Core.extra.attrib; + %I18n.attrib; + %Events.attrib; +> +<!-- end of map.attlist -->]]> + +<!-- end of xhtml-csismap-1.mod --> diff --git a/lv2specgen/DTD/xhtml-datatypes-1.mod b/lv2specgen/DTD/xhtml-datatypes-1.mod new file mode 100644 index 0000000..2da3445 --- /dev/null +++ b/lv2specgen/DTD/xhtml-datatypes-1.mod @@ -0,0 +1,85 @@ +<!-- ...................................................................... --> +<!-- XHTML Datatypes Module .............................................. --> +<!-- file: xhtml-datatypes-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-datatypes-1.mod,v 4.1 2001/04/06 19:23:32 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Datatypes + + defines containers for the following datatypes, many of + these imported from other specifications and standards. +--> + +<!-- Length defined for cellpadding/cellspacing --> + +<!-- nn for pixels or nn% for percentage length --> +<!ENTITY % Length.datatype "CDATA" > + +<!-- space-separated list of link types --> +<!ENTITY % LinkTypes.datatype "NMTOKENS" > + +<!-- single or comma-separated list of media descriptors --> +<!ENTITY % MediaDesc.datatype "CDATA" > + +<!-- pixel, percentage, or relative --> +<!ENTITY % MultiLength.datatype "CDATA" > + +<!-- one or more digits (NUMBER) --> +<!ENTITY % Number.datatype "CDATA" > + +<!-- integer representing length in pixels --> +<!ENTITY % Pixels.datatype "CDATA" > + +<!-- script expression --> +<!ENTITY % Script.datatype "CDATA" > + +<!-- textual content --> +<!ENTITY % Text.datatype "CDATA" > + +<!-- Imported Datatypes ................................ --> + +<!-- a single character from [ISO10646] --> +<!ENTITY % Character.datatype "CDATA" > + +<!-- a character encoding, as per [RFC2045] --> +<!ENTITY % Charset.datatype "CDATA" > + +<!-- a space separated list of character encodings, as per [RFC2045] --> +<!ENTITY % Charsets.datatype "CDATA" > + +<!-- Color specification using color name or sRGB (#RRGGBB) values --> +<!ENTITY % Color.datatype "CDATA" > + +<!-- media type, as per [RFC2045] --> +<!ENTITY % ContentType.datatype "CDATA" > + +<!-- comma-separated list of media types, as per [RFC2045] --> +<!ENTITY % ContentTypes.datatype "CDATA" > + +<!-- date and time information. ISO date format --> +<!ENTITY % Datetime.datatype "CDATA" > + +<!-- formal public identifier, as per [ISO8879] --> +<!ENTITY % FPI.datatype "CDATA" > + +<!-- a language code, as per [RFC3066] or its successor --> +<!ENTITY % LanguageCode.datatype "CDATA" > + +<!-- a Uniform Resource Identifier, see [URI] --> +<!ENTITY % URI.datatype "CDATA" > + +<!-- a space-separated list of Uniform Resource Identifiers, see [URI] --> +<!ENTITY % URIs.datatype "CDATA" > + +<!-- end of xhtml-datatypes-1.mod --> diff --git a/lv2specgen/DTD/xhtml-datatypes-1.mod.1 b/lv2specgen/DTD/xhtml-datatypes-1.mod.1 new file mode 100644 index 0000000..dde43e8 --- /dev/null +++ b/lv2specgen/DTD/xhtml-datatypes-1.mod.1 @@ -0,0 +1,103 @@ +<!-- ...................................................................... --> +<!-- XHTML Datatypes Module .............................................. --> +<!-- file: xhtml-datatypes-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-datatypes-1.mod,v 4.1 2001/04/06 19:23:32 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Datatypes + + defines containers for the following datatypes, many of + these imported from other specifications and standards. +--> + +<!-- Length defined for cellpadding/cellspacing --> + +<!-- nn for pixels or nn% for percentage length --> +<!ENTITY % Length.datatype "CDATA" > + +<!-- space-separated list of link types --> +<!ENTITY % LinkTypes.datatype "NMTOKENS" > + +<!-- single or comma-separated list of media descriptors --> +<!ENTITY % MediaDesc.datatype "CDATA" > + +<!-- pixel, percentage, or relative --> +<!ENTITY % MultiLength.datatype "CDATA" > + +<!-- one or more digits (NUMBER) --> +<!ENTITY % Number.datatype "CDATA" > + +<!-- integer representing length in pixels --> +<!ENTITY % Pixels.datatype "CDATA" > + +<!-- script expression --> +<!ENTITY % Script.datatype "CDATA" > + +<!-- textual content --> +<!ENTITY % Text.datatype "CDATA" > + +<!-- Placeholder Compact URI-related types --> +<!ENTITY % CURIE.datatype "CDATA" > +<!ENTITY % CURIEs.datatype "CDATA" > +<!ENTITY % SafeCURIE.datatype "CDATA" > +<!ENTITY % SafeCURIEs.datatype "CDATA" > +<!ENTITY % URIorSafeCURIE.datatype "CDATA" > +<!ENTITY % URIorSafeCURIEs.datatype "CDATA" > + +<!-- Imported Datatypes ................................ --> + +<!-- a single character from [ISO10646] --> +<!ENTITY % Character.datatype "CDATA" > + +<!-- a character encoding, as per [RFC2045] --> +<!ENTITY % Charset.datatype "CDATA" > + +<!-- a space separated list of character encodings, as per [RFC2045] --> +<!ENTITY % Charsets.datatype "CDATA" > + +<!-- Color specification using color name or sRGB (#RRGGBB) values --> +<!ENTITY % Color.datatype "CDATA" > + +<!-- media type, as per [RFC2045] --> +<!ENTITY % ContentType.datatype "CDATA" > + +<!-- comma-separated list of media types, as per [RFC2045] --> +<!ENTITY % ContentTypes.datatype "CDATA" > + +<!-- date and time information. ISO date format --> +<!ENTITY % Datetime.datatype "CDATA" > + +<!-- formal public identifier, as per [ISO8879] --> +<!ENTITY % FPI.datatype "CDATA" > + +<!-- a language code, as per [RFC3066] or its successor --> +<!ENTITY % LanguageCode.datatype "CDATA" > + +<!-- a comma separated list of language code ranges --> +<!ENTITY % LanguageCodes.datatype "CDATA" > + +<!-- a qualified name , as per [XMLNS] or its successor --> +<!ENTITY % QName.datatype "CDATA" > +<!ENTITY % QNames.datatype "CDATA" > + +<!-- a Uniform Resource Identifier, see [URI] --> +<!ENTITY % URI.datatype "CDATA" > + +<!-- a space-separated list of Uniform Resource Identifiers, see [URI] --> +<!ENTITY % URIs.datatype "CDATA" > + +<!-- a relative URI reference consisting of an initial '#' and a fragment ID --> +<!ENTITY % URIREF.datatype "CDATA" > + +<!-- end of xhtml-datatypes-1.mod --> diff --git a/lv2specgen/DTD/xhtml-edit-1.mod b/lv2specgen/DTD/xhtml-edit-1.mod new file mode 100644 index 0000000..d3c6282 --- /dev/null +++ b/lv2specgen/DTD/xhtml-edit-1.mod @@ -0,0 +1,66 @@ +<!-- ...................................................................... --> +<!-- XHTML Editing Elements Module ....................................... --> +<!-- file: xhtml-edit-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-edit-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Editing Markup 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Editing Elements + + ins, del + + This module declares element types and attributes used to indicate + inserted and deleted content while editing a document. +--> + +<!-- ins: Inserted Text ............................... --> + +<!ENTITY % ins.element "INCLUDE" > +<![%ins.element;[ +<!ENTITY % ins.content + "( #PCDATA | %Flow.mix; )*" +> +<!ENTITY % ins.qname "ins" > +<!ELEMENT %ins.qname; %ins.content; > +<!-- end of ins.element -->]]> + +<!ENTITY % ins.attlist "INCLUDE" > +<![%ins.attlist;[ +<!ATTLIST %ins.qname; + %Common.attrib; + cite %URI.datatype; #IMPLIED + datetime %Datetime.datatype; #IMPLIED +> +<!-- end of ins.attlist -->]]> + +<!-- del: Deleted Text ................................ --> + +<!ENTITY % del.element "INCLUDE" > +<![%del.element;[ +<!ENTITY % del.content + "( #PCDATA | %Flow.mix; )*" +> +<!ENTITY % del.qname "del" > +<!ELEMENT %del.qname; %del.content; > +<!-- end of del.element -->]]> + +<!ENTITY % del.attlist "INCLUDE" > +<![%del.attlist;[ +<!ATTLIST %del.qname; + %Common.attrib; + cite %URI.datatype; #IMPLIED + datetime %Datetime.datatype; #IMPLIED +> +<!-- end of del.attlist -->]]> + +<!-- end of xhtml-edit-1.mod --> diff --git a/lv2specgen/DTD/xhtml-events-1.mod b/lv2specgen/DTD/xhtml-events-1.mod new file mode 100644 index 0000000..35589e0 --- /dev/null +++ b/lv2specgen/DTD/xhtml-events-1.mod @@ -0,0 +1,135 @@ +<!-- ...................................................................... --> +<!-- XHTML Intrinsic Events Module ....................................... --> +<!-- file: xhtml-events-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-events-1.mod,v 1.4 2008/10/08 21:02:30 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-events-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Intrinsic Event Attributes + + These are the event attributes defined in HTML 4, + Section 18.2.3 "Intrinsic Events". This module must be + instantiated prior to the Attributes Module but after + the Datatype Module in the Modular Framework module. + + "Note: Authors of HTML documents are advised that changes + are likely to occur in the realm of intrinsic events + (e.g., how scripts are bound to events). Research in + this realm is carried on by members of the W3C Document + Object Model Working Group (see the W3C Web site at + http://www.w3.org/ for more information)." +--> +<!-- NOTE: Because the ATTLIST declarations in this module occur + before their respective ELEMENT declarations in other + modules, there may be a dependency on this module that + should be considered if any of the parameter entities used + for element type names (eg., %a.qname;) are redeclared. +--> + +<!ENTITY % Events.attrib + "onclick %Script.datatype; #IMPLIED + ondblclick %Script.datatype; #IMPLIED + onmousedown %Script.datatype; #IMPLIED + onmouseup %Script.datatype; #IMPLIED + onmouseover %Script.datatype; #IMPLIED + onmousemove %Script.datatype; #IMPLIED + onmouseout %Script.datatype; #IMPLIED + onkeypress %Script.datatype; #IMPLIED + onkeydown %Script.datatype; #IMPLIED + onkeyup %Script.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.events.attrib + "%XHTML.prefix;:onclick %Script.datatype; #IMPLIED + %XHTML.prefix;:ondblclick %Script.datatype; #IMPLIED + %XHTML.prefix;:onmousedown %Script.datatype; #IMPLIED + %XHTML.prefix;:onmouseup %Script.datatype; #IMPLIED + %XHTML.prefix;:onmouseover %Script.datatype; #IMPLIED + %XHTML.prefix;:onmousemove %Script.datatype; #IMPLIED + %XHTML.prefix;:onmouseout %Script.datatype; #IMPLIED + %XHTML.prefix;:onkeypress %Script.datatype; #IMPLIED + %XHTML.prefix;:onkeydown %Script.datatype; #IMPLIED + %XHTML.prefix;:onkeyup %Script.datatype; #IMPLIED" +> +]]> + +<!-- additional attributes on anchor element +--> +<!ATTLIST %a.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED +> + +<!-- additional attributes on form element +--> +<!ATTLIST %form.qname; + onsubmit %Script.datatype; #IMPLIED + onreset %Script.datatype; #IMPLIED +> + +<!-- additional attributes on label element +--> +<!ATTLIST %label.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED +> + +<!-- additional attributes on input element +--> +<!ATTLIST %input.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED + onselect %Script.datatype; #IMPLIED + onchange %Script.datatype; #IMPLIED +> + +<!-- additional attributes on select element +--> +<!ATTLIST %select.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED + onchange %Script.datatype; #IMPLIED +> + +<!-- additional attributes on textarea element +--> +<!ATTLIST %textarea.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED + onselect %Script.datatype; #IMPLIED + onchange %Script.datatype; #IMPLIED +> + +<!-- additional attributes on button element +--> +<!ATTLIST %button.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED +> + +<!-- additional attributes on body element +--> +<!ATTLIST %body.qname; + onload %Script.datatype; #IMPLIED + onunload %Script.datatype; #IMPLIED +> + +<!-- additional attributes on area element +--> +<!ATTLIST %area.qname; + onfocus %Script.datatype; #IMPLIED + onblur %Script.datatype; #IMPLIED +> + +<!-- end of xhtml-events-1.mod --> diff --git a/lv2specgen/DTD/xhtml-form-1.mod b/lv2specgen/DTD/xhtml-form-1.mod new file mode 100644 index 0000000..de68a75 --- /dev/null +++ b/lv2specgen/DTD/xhtml-form-1.mod @@ -0,0 +1,292 @@ +<!-- ...................................................................... --> +<!-- XHTML Forms Module .................................................. --> +<!-- file: xhtml-form-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-form-1.mod,v 4.1 2001/04/10 09:42:30 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Forms + + form, label, input, select, optgroup, option, + textarea, fieldset, legend, button + + This module declares markup to provide support for online + forms, based on the features found in HTML 4 forms. +--> + +<!-- declare qualified element type names: +--> +<!ENTITY % form.qname "form" > +<!ENTITY % label.qname "label" > +<!ENTITY % input.qname "input" > +<!ENTITY % select.qname "select" > +<!ENTITY % optgroup.qname "optgroup" > +<!ENTITY % option.qname "option" > +<!ENTITY % textarea.qname "textarea" > +<!ENTITY % fieldset.qname "fieldset" > +<!ENTITY % legend.qname "legend" > +<!ENTITY % button.qname "button" > + +<!-- %BlkNoForm.mix; includes all non-form block elements, + plus %Misc.class; +--> +<!ENTITY % BlkNoForm.mix + "%Heading.class; + | %List.class; + | %BlkStruct.class; + %BlkPhras.class; + %BlkPres.class; + %Table.class; + %Block.extra; + %Misc.class;" +> + +<!-- form: Form Element ................................ --> + +<!ENTITY % form.element "INCLUDE" > +<![%form.element;[ +<!ENTITY % form.content + "( %BlkNoForm.mix; + | %fieldset.qname; )+" +> +<!ELEMENT %form.qname; %form.content; > +<!-- end of form.element -->]]> + +<!ENTITY % form.attlist "INCLUDE" > +<![%form.attlist;[ +<!ATTLIST %form.qname; + %Common.attrib; + action %URI.datatype; #REQUIRED + method ( get | post ) 'get' + name CDATA #IMPLIED + enctype %ContentType.datatype; 'application/x-www-form-urlencoded' + accept-charset %Charsets.datatype; #IMPLIED + accept %ContentTypes.datatype; #IMPLIED +> +<!-- end of form.attlist -->]]> + +<!-- label: Form Field Label Text ...................... --> + +<!-- Each label must not contain more than ONE field +--> + +<!ENTITY % label.element "INCLUDE" > +<![%label.element;[ +<!ENTITY % label.content + "( #PCDATA + | %input.qname; | %select.qname; | %textarea.qname; | %button.qname; + | %InlStruct.class; + %InlPhras.class; + %I18n.class; + %InlPres.class; + %Anchor.class; + %InlSpecial.class; + %Inline.extra; + %Misc.class; )*" +> +<!ELEMENT %label.qname; %label.content; > +<!-- end of label.element -->]]> + +<!ENTITY % label.attlist "INCLUDE" > +<![%label.attlist;[ +<!ATTLIST %label.qname; + %Common.attrib; + for IDREF #IMPLIED + accesskey %Character.datatype; #IMPLIED +> +<!-- end of label.attlist -->]]> + +<!-- input: Form Control ............................... --> + +<!ENTITY % input.element "INCLUDE" > +<![%input.element;[ +<!ENTITY % input.content "EMPTY" > +<!ELEMENT %input.qname; %input.content; > +<!-- end of input.element -->]]> + +<!ENTITY % input.attlist "INCLUDE" > +<![%input.attlist;[ +<!ENTITY % InputType.class + "( text | password | checkbox | radio | submit + | reset | file | hidden | image | button )" +> +<!-- attribute 'name' required for all but submit & reset +--> +<!ATTLIST %input.qname; + %Common.attrib; + type %InputType.class; 'text' + name CDATA #IMPLIED + value CDATA #IMPLIED + checked ( checked ) #IMPLIED + disabled ( disabled ) #IMPLIED + readonly ( readonly ) #IMPLIED + size %Number.datatype; #IMPLIED + maxlength %Number.datatype; #IMPLIED + src %URI.datatype; #IMPLIED + alt %Text.datatype; #IMPLIED + tabindex %Number.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED + accept %ContentTypes.datatype; #IMPLIED +> +<!-- end of input.attlist -->]]> + +<!-- select: Option Selector ........................... --> + +<!ENTITY % select.element "INCLUDE" > +<![%select.element;[ +<!ENTITY % select.content + "( %optgroup.qname; | %option.qname; )+" +> +<!ELEMENT %select.qname; %select.content; > +<!-- end of select.element -->]]> + +<!ENTITY % select.attlist "INCLUDE" > +<![%select.attlist;[ +<!ATTLIST %select.qname; + %Common.attrib; + name CDATA #IMPLIED + size %Number.datatype; #IMPLIED + multiple ( multiple ) #IMPLIED + disabled ( disabled ) #IMPLIED + tabindex %Number.datatype; #IMPLIED +> +<!-- end of select.attlist -->]]> + +<!-- optgroup: Option Group ............................ --> + +<!ENTITY % optgroup.element "INCLUDE" > +<![%optgroup.element;[ +<!ENTITY % optgroup.content "( %option.qname; )+" > +<!ELEMENT %optgroup.qname; %optgroup.content; > +<!-- end of optgroup.element -->]]> + +<!ENTITY % optgroup.attlist "INCLUDE" > +<![%optgroup.attlist;[ +<!ATTLIST %optgroup.qname; + %Common.attrib; + disabled ( disabled ) #IMPLIED + label %Text.datatype; #REQUIRED +> +<!-- end of optgroup.attlist -->]]> + +<!-- option: Selectable Choice ......................... --> + +<!ENTITY % option.element "INCLUDE" > +<![%option.element;[ +<!ENTITY % option.content "( #PCDATA )" > +<!ELEMENT %option.qname; %option.content; > +<!-- end of option.element -->]]> + +<!ENTITY % option.attlist "INCLUDE" > +<![%option.attlist;[ +<!ATTLIST %option.qname; + %Common.attrib; + selected ( selected ) #IMPLIED + disabled ( disabled ) #IMPLIED + label %Text.datatype; #IMPLIED + value CDATA #IMPLIED +> +<!-- end of option.attlist -->]]> + +<!-- textarea: Multi-Line Text Field ................... --> + +<!ENTITY % textarea.element "INCLUDE" > +<![%textarea.element;[ +<!ENTITY % textarea.content "( #PCDATA )" > +<!ELEMENT %textarea.qname; %textarea.content; > +<!-- end of textarea.element -->]]> + +<!ENTITY % textarea.attlist "INCLUDE" > +<![%textarea.attlist;[ +<!ATTLIST %textarea.qname; + %Common.attrib; + name CDATA #IMPLIED + rows %Number.datatype; #REQUIRED + cols %Number.datatype; #REQUIRED + disabled ( disabled ) #IMPLIED + readonly ( readonly ) #IMPLIED + tabindex %Number.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED +> +<!-- end of textarea.attlist -->]]> + +<!-- fieldset: Form Control Group ...................... --> + +<!-- #PCDATA is to solve the mixed content problem, + per specification only whitespace is allowed +--> + +<!ENTITY % fieldset.element "INCLUDE" > +<![%fieldset.element;[ +<!ENTITY % fieldset.content + "( #PCDATA | %legend.qname; | %Flow.mix; )*" +> +<!ELEMENT %fieldset.qname; %fieldset.content; > +<!-- end of fieldset.element -->]]> + +<!ENTITY % fieldset.attlist "INCLUDE" > +<![%fieldset.attlist;[ +<!ATTLIST %fieldset.qname; + %Common.attrib; +> +<!-- end of fieldset.attlist -->]]> + +<!-- legend: Fieldset Legend ........................... --> + +<!ENTITY % legend.element "INCLUDE" > +<![%legend.element;[ +<!ENTITY % legend.content + "( #PCDATA | %Inline.mix; )*" +> +<!ELEMENT %legend.qname; %legend.content; > +<!-- end of legend.element -->]]> + +<!ENTITY % legend.attlist "INCLUDE" > +<![%legend.attlist;[ +<!ATTLIST %legend.qname; + %Common.attrib; + accesskey %Character.datatype; #IMPLIED +> +<!-- end of legend.attlist -->]]> + +<!-- button: Push Button ............................... --> + +<!ENTITY % button.element "INCLUDE" > +<![%button.element;[ +<!ENTITY % button.content + "( #PCDATA + | %BlkNoForm.mix; + | %InlStruct.class; + %InlPhras.class; + %InlPres.class; + %I18n.class; + %InlSpecial.class; + %Inline.extra; )*" +> +<!ELEMENT %button.qname; %button.content; > +<!-- end of button.element -->]]> + +<!ENTITY % button.attlist "INCLUDE" > +<![%button.attlist;[ +<!ATTLIST %button.qname; + %Common.attrib; + name CDATA #IMPLIED + value CDATA #IMPLIED + type ( button | submit | reset ) 'submit' + disabled ( disabled ) #IMPLIED + tabindex %Number.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED +> +<!-- end of button.attlist -->]]> + +<!-- end of xhtml-form-1.mod --> diff --git a/lv2specgen/DTD/xhtml-framework-1.mod b/lv2specgen/DTD/xhtml-framework-1.mod new file mode 100644 index 0000000..7d9d972 --- /dev/null +++ b/lv2specgen/DTD/xhtml-framework-1.mod @@ -0,0 +1,97 @@ +<!-- ...................................................................... --> +<!-- XHTML Modular Framework Module ...................................... --> +<!-- file: xhtml-framework-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-framework-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Modular Framework + + This required module instantiates the modules needed + to support the XHTML modularization model, including: + + + datatypes + + namespace-qualified names + + common attributes + + document model + + character entities + + The Intrinsic Events module is ignored by default but + occurs in this module because it must be instantiated + prior to Attributes but after Datatypes. +--> + +<!ENTITY % xhtml-arch.module "IGNORE" > +<![%xhtml-arch.module;[ +<!ENTITY % xhtml-arch.mod + PUBLIC "-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN" + "xhtml-arch-1.mod" > +%xhtml-arch.mod;]]> + +<!ENTITY % xhtml-notations.module "IGNORE" > +<![%xhtml-notations.module;[ +<!ENTITY % xhtml-notations.mod + PUBLIC "-//W3C//NOTATIONS XHTML Notations 1.0//EN" + "xhtml-notations-1.mod" > +%xhtml-notations.mod;]]> + +<!ENTITY % xhtml-datatypes.module "INCLUDE" > +<![%xhtml-datatypes.module;[ +<!ENTITY % xhtml-datatypes.mod + PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN" + "xhtml-datatypes-1.mod" > +%xhtml-datatypes.mod;]]> + +<!-- placeholder for XLink support module --> +<!ENTITY % xhtml-xlink.mod "" > +%xhtml-xlink.mod; + +<!ENTITY % xhtml-qname.module "INCLUDE" > +<![%xhtml-qname.module;[ +<!ENTITY % xhtml-qname.mod + PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN" + "xhtml-qname-1.mod" > +%xhtml-qname.mod;]]> + +<!ENTITY % xhtml-events.module "IGNORE" > +<![%xhtml-events.module;[ +<!ENTITY % xhtml-events.mod + PUBLIC "-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN" + "xhtml-events-1.mod" > +%xhtml-events.mod;]]> + +<!ENTITY % xhtml-attribs.module "INCLUDE" > +<![%xhtml-attribs.module;[ +<!ENTITY % xhtml-attribs.mod + PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN" + "xhtml-attribs-1.mod" > +%xhtml-attribs.mod;]]> + +<!-- placeholder for content model redeclarations --> +<!ENTITY % xhtml-model.redecl "" > +%xhtml-model.redecl; + +<!ENTITY % xhtml-model.module "INCLUDE" > +<![%xhtml-model.module;[ +<!-- instantiate the Document Model module declared in the DTD driver +--> +%xhtml-model.mod;]]> + +<!ENTITY % xhtml-charent.module "INCLUDE" > +<![%xhtml-charent.module;[ +<!ENTITY % xhtml-charent.mod + PUBLIC "-//W3C//ENTITIES XHTML Character Entities 1.0//EN" + "xhtml-charent-1.mod" > +%xhtml-charent.mod;]]> + +<!-- end of xhtml-framework-1.mod --> diff --git a/lv2specgen/DTD/xhtml-hypertext-1.mod b/lv2specgen/DTD/xhtml-hypertext-1.mod new file mode 100644 index 0000000..7a7d8ca --- /dev/null +++ b/lv2specgen/DTD/xhtml-hypertext-1.mod @@ -0,0 +1,54 @@ +<!-- ...................................................................... --> +<!-- XHTML Hypertext Module .............................................. --> +<!-- file: xhtml-hypertext-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-hypertext-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Hypertext + + a + + This module declares the anchor ('a') element type, which + defines the source of a hypertext link. The destination + (or link 'target') is identified via its 'id' attribute + rather than the 'name' attribute as was used in HTML. +--> + +<!-- ............ Anchor Element ............ --> + +<!ENTITY % a.element "INCLUDE" > +<![%a.element;[ +<!ENTITY % a.content + "( #PCDATA | %InlNoAnchor.mix; )*" +> +<!ENTITY % a.qname "a" > +<!ELEMENT %a.qname; %a.content; > +<!-- end of a.element -->]]> + +<!ENTITY % a.attlist "INCLUDE" > +<![%a.attlist;[ +<!ATTLIST %a.qname; + %Common.attrib; + href %URI.datatype; #IMPLIED + charset %Charset.datatype; #IMPLIED + type %ContentType.datatype; #IMPLIED + hreflang %LanguageCode.datatype; #IMPLIED + rel %LinkTypes.datatype; #IMPLIED + rev %LinkTypes.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED + tabindex %Number.datatype; #IMPLIED +> +<!-- end of a.attlist -->]]> + +<!-- end of xhtml-hypertext-1.mod --> diff --git a/lv2specgen/DTD/xhtml-image-1.mod b/lv2specgen/DTD/xhtml-image-1.mod new file mode 100644 index 0000000..8561761 --- /dev/null +++ b/lv2specgen/DTD/xhtml-image-1.mod @@ -0,0 +1,51 @@ +<!-- ...................................................................... --> +<!-- XHTML Images Module ................................................. --> +<!-- file: xhtml-image-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Rovision: $Id: xhtml-image-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Images + + img + + This module provides markup to support basic image embedding. +--> + +<!-- To avoid problems with text-only UAs as well as to make + image content understandable and navigable to users of + non-visual UAs, you need to provide a description with + the 'alt' attribute, and avoid server-side image maps. +--> + +<!ENTITY % img.element "INCLUDE" > +<![%img.element;[ +<!ENTITY % img.content "EMPTY" > +<!ENTITY % img.qname "img" > +<!ELEMENT %img.qname; %img.content; > +<!-- end of img.element -->]]> + +<!ENTITY % img.attlist "INCLUDE" > +<![%img.attlist;[ +<!ATTLIST %img.qname; + %Common.attrib; + src %URI.datatype; #REQUIRED + alt %Text.datatype; #REQUIRED + longdesc %URI.datatype; #IMPLIED + name CDATA #IMPLIED + height %Length.datatype; #IMPLIED + width %Length.datatype; #IMPLIED +> +<!-- end of img.attlist -->]]> + +<!-- end of xhtml-image-1.mod --> diff --git a/lv2specgen/DTD/xhtml-inlphras-1.mod b/lv2specgen/DTD/xhtml-inlphras-1.mod new file mode 100644 index 0000000..0d26daa --- /dev/null +++ b/lv2specgen/DTD/xhtml-inlphras-1.mod @@ -0,0 +1,203 @@ +<!-- ...................................................................... --> +<!-- XHTML Inline Phrasal Module ......................................... --> +<!-- file: xhtml-inlphras-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-inlphras-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlphras-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Inline Phrasal + + abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + + This module declares the elements and their attributes used to + support inline-level phrasal markup. +--> + +<!ENTITY % abbr.element "INCLUDE" > +<![%abbr.element;[ +<!ENTITY % abbr.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % abbr.qname "abbr" > +<!ELEMENT %abbr.qname; %abbr.content; > +<!-- end of abbr.element -->]]> + +<!ENTITY % abbr.attlist "INCLUDE" > +<![%abbr.attlist;[ +<!ATTLIST %abbr.qname; + %Common.attrib; +> +<!-- end of abbr.attlist -->]]> + +<!ENTITY % acronym.element "INCLUDE" > +<![%acronym.element;[ +<!ENTITY % acronym.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % acronym.qname "acronym" > +<!ELEMENT %acronym.qname; %acronym.content; > +<!-- end of acronym.element -->]]> + +<!ENTITY % acronym.attlist "INCLUDE" > +<![%acronym.attlist;[ +<!ATTLIST %acronym.qname; + %Common.attrib; +> +<!-- end of acronym.attlist -->]]> + +<!ENTITY % cite.element "INCLUDE" > +<![%cite.element;[ +<!ENTITY % cite.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % cite.qname "cite" > +<!ELEMENT %cite.qname; %cite.content; > +<!-- end of cite.element -->]]> + +<!ENTITY % cite.attlist "INCLUDE" > +<![%cite.attlist;[ +<!ATTLIST %cite.qname; + %Common.attrib; +> +<!-- end of cite.attlist -->]]> + +<!ENTITY % code.element "INCLUDE" > +<![%code.element;[ +<!ENTITY % code.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % code.qname "code" > +<!ELEMENT %code.qname; %code.content; > +<!-- end of code.element -->]]> + +<!ENTITY % code.attlist "INCLUDE" > +<![%code.attlist;[ +<!ATTLIST %code.qname; + %Common.attrib; +> +<!-- end of code.attlist -->]]> + +<!ENTITY % dfn.element "INCLUDE" > +<![%dfn.element;[ +<!ENTITY % dfn.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % dfn.qname "dfn" > +<!ELEMENT %dfn.qname; %dfn.content; > +<!-- end of dfn.element -->]]> + +<!ENTITY % dfn.attlist "INCLUDE" > +<![%dfn.attlist;[ +<!ATTLIST %dfn.qname; + %Common.attrib; +> +<!-- end of dfn.attlist -->]]> + +<!ENTITY % em.element "INCLUDE" > +<![%em.element;[ +<!ENTITY % em.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % em.qname "em" > +<!ELEMENT %em.qname; %em.content; > +<!-- end of em.element -->]]> + +<!ENTITY % em.attlist "INCLUDE" > +<![%em.attlist;[ +<!ATTLIST %em.qname; + %Common.attrib; +> +<!-- end of em.attlist -->]]> + +<!ENTITY % kbd.element "INCLUDE" > +<![%kbd.element;[ +<!ENTITY % kbd.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % kbd.qname "kbd" > +<!ELEMENT %kbd.qname; %kbd.content; > +<!-- end of kbd.element -->]]> + +<!ENTITY % kbd.attlist "INCLUDE" > +<![%kbd.attlist;[ +<!ATTLIST %kbd.qname; + %Common.attrib; +> +<!-- end of kbd.attlist -->]]> + +<!ENTITY % q.element "INCLUDE" > +<![%q.element;[ +<!ENTITY % q.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % q.qname "q" > +<!ELEMENT %q.qname; %q.content; > +<!-- end of q.element -->]]> + +<!ENTITY % q.attlist "INCLUDE" > +<![%q.attlist;[ +<!ATTLIST %q.qname; + %Common.attrib; + cite %URI.datatype; #IMPLIED +> +<!-- end of q.attlist -->]]> + +<!ENTITY % samp.element "INCLUDE" > +<![%samp.element;[ +<!ENTITY % samp.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % samp.qname "samp" > +<!ELEMENT %samp.qname; %samp.content; > +<!-- end of samp.element -->]]> + +<!ENTITY % samp.attlist "INCLUDE" > +<![%samp.attlist;[ +<!ATTLIST %samp.qname; + %Common.attrib; +> +<!-- end of samp.attlist -->]]> + +<!ENTITY % strong.element "INCLUDE" > +<![%strong.element;[ +<!ENTITY % strong.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % strong.qname "strong" > +<!ELEMENT %strong.qname; %strong.content; > +<!-- end of strong.element -->]]> + +<!ENTITY % strong.attlist "INCLUDE" > +<![%strong.attlist;[ +<!ATTLIST %strong.qname; + %Common.attrib; +> +<!-- end of strong.attlist -->]]> + +<!ENTITY % var.element "INCLUDE" > +<![%var.element;[ +<!ENTITY % var.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % var.qname "var" > +<!ELEMENT %var.qname; %var.content; > +<!-- end of var.element -->]]> + +<!ENTITY % var.attlist "INCLUDE" > +<![%var.attlist;[ +<!ATTLIST %var.qname; + %Common.attrib; +> +<!-- end of var.attlist -->]]> + +<!-- end of xhtml-inlphras-1.mod --> diff --git a/lv2specgen/DTD/xhtml-inlpres-1.mod b/lv2specgen/DTD/xhtml-inlpres-1.mod new file mode 100644 index 0000000..e8c9e39 --- /dev/null +++ b/lv2specgen/DTD/xhtml-inlpres-1.mod @@ -0,0 +1,138 @@ +<!-- ...................................................................... --> +<!-- XHTML Inline Presentation Module .................................... --> +<!-- file: xhtml-inlpres-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-inlpres-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlpres-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Inline Presentational Elements + + b, big, i, small, sub, sup, tt + + This module declares the elements and their attributes used to + support inline-level presentational markup. +--> + +<!ENTITY % b.element "INCLUDE" > +<![%b.element;[ +<!ENTITY % b.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % b.qname "b" > +<!ELEMENT %b.qname; %b.content; > +<!-- end of b.element -->]]> + +<!ENTITY % b.attlist "INCLUDE" > +<![%b.attlist;[ +<!ATTLIST %b.qname; + %Common.attrib; +> +<!-- end of b.attlist -->]]> + +<!ENTITY % big.element "INCLUDE" > +<![%big.element;[ +<!ENTITY % big.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % big.qname "big" > +<!ELEMENT %big.qname; %big.content; > +<!-- end of big.element -->]]> + +<!ENTITY % big.attlist "INCLUDE" > +<![%big.attlist;[ +<!ATTLIST %big.qname; + %Common.attrib; +> +<!-- end of big.attlist -->]]> + +<!ENTITY % i.element "INCLUDE" > +<![%i.element;[ +<!ENTITY % i.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % i.qname "i" > +<!ELEMENT %i.qname; %i.content; > +<!-- end of i.element -->]]> + +<!ENTITY % i.attlist "INCLUDE" > +<![%i.attlist;[ +<!ATTLIST %i.qname; + %Common.attrib; +> +<!-- end of i.attlist -->]]> + +<!ENTITY % small.element "INCLUDE" > +<![%small.element;[ +<!ENTITY % small.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % small.qname "small" > +<!ELEMENT %small.qname; %small.content; > +<!-- end of small.element -->]]> + +<!ENTITY % small.attlist "INCLUDE" > +<![%small.attlist;[ +<!ATTLIST %small.qname; + %Common.attrib; +> +<!-- end of small.attlist -->]]> + +<!ENTITY % sub.element "INCLUDE" > +<![%sub.element;[ +<!ENTITY % sub.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % sub.qname "sub" > +<!ELEMENT %sub.qname; %sub.content; > +<!-- end of sub.element -->]]> + +<!ENTITY % sub.attlist "INCLUDE" > +<![%sub.attlist;[ +<!ATTLIST %sub.qname; + %Common.attrib; +> +<!-- end of sub.attlist -->]]> + +<!ENTITY % sup.element "INCLUDE" > +<![%sup.element;[ +<!ENTITY % sup.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % sup.qname "sup" > +<!ELEMENT %sup.qname; %sup.content; > +<!-- end of sup.element -->]]> + +<!ENTITY % sup.attlist "INCLUDE" > +<![%sup.attlist;[ +<!ATTLIST %sup.qname; + %Common.attrib; +> +<!-- end of sup.attlist -->]]> + +<!ENTITY % tt.element "INCLUDE" > +<![%tt.element;[ +<!ENTITY % tt.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % tt.qname "tt" > +<!ELEMENT %tt.qname; %tt.content; > +<!-- end of tt.element -->]]> + +<!ENTITY % tt.attlist "INCLUDE" > +<![%tt.attlist;[ +<!ATTLIST %tt.qname; + %Common.attrib; +> +<!-- end of tt.attlist -->]]> + +<!-- end of xhtml-inlpres-1.mod --> diff --git a/lv2specgen/DTD/xhtml-inlstruct-1.mod b/lv2specgen/DTD/xhtml-inlstruct-1.mod new file mode 100644 index 0000000..2b86422 --- /dev/null +++ b/lv2specgen/DTD/xhtml-inlstruct-1.mod @@ -0,0 +1,62 @@ +<!-- ...................................................................... --> +<!-- XHTML Inline Structural Module ...................................... --> +<!-- file: xhtml-inlstruct-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-inlstruct-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstruct-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Inline Structural + + br, span + + This module declares the elements and their attributes + used to support inline-level structural markup. +--> + +<!-- br: forced line break ............................. --> + +<!ENTITY % br.element "INCLUDE" > +<![%br.element;[ + +<!ENTITY % br.content "EMPTY" > +<!ENTITY % br.qname "br" > +<!ELEMENT %br.qname; %br.content; > + +<!-- end of br.element -->]]> + +<!ENTITY % br.attlist "INCLUDE" > +<![%br.attlist;[ +<!ATTLIST %br.qname; + %Core.attrib; +> +<!-- end of br.attlist -->]]> + +<!-- span: generic inline container .................... --> + +<!ENTITY % span.element "INCLUDE" > +<![%span.element;[ +<!ENTITY % span.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % span.qname "span" > +<!ELEMENT %span.qname; %span.content; > +<!-- end of span.element -->]]> + +<!ENTITY % span.attlist "INCLUDE" > +<![%span.attlist;[ +<!ATTLIST %span.qname; + %Common.attrib; +> +<!-- end of span.attlist -->]]> + +<!-- end of xhtml-inlstruct-1.mod --> diff --git a/lv2specgen/DTD/xhtml-inlstyle-1.mod b/lv2specgen/DTD/xhtml-inlstyle-1.mod new file mode 100644 index 0000000..85a2ca4 --- /dev/null +++ b/lv2specgen/DTD/xhtml-inlstyle-1.mod @@ -0,0 +1,34 @@ +<!-- ...................................................................... --> +<!-- XHTML Inline Style Module ........................................... --> +<!-- file: xhtml-inlstyle-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-inlstyle-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Inline Style 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Inline Style + + This module declares the 'style' attribute, used to support inline + style markup. This module must be instantiated prior to the XHTML + Common Attributes module in order to be included in %Core.attrib;. +--> + +<!ENTITY % style.attrib + "style CDATA #IMPLIED" +> + + +<!ENTITY % Core.extra.attrib + "%style.attrib;" +> + +<!-- end of xhtml-inlstyle-1.mod --> diff --git a/lv2specgen/DTD/xhtml-inputmode-1.mod b/lv2specgen/DTD/xhtml-inputmode-1.mod new file mode 100644 index 0000000..36f1d36 --- /dev/null +++ b/lv2specgen/DTD/xhtml-inputmode-1.mod @@ -0,0 +1,39 @@ +<!-- ...................................................................... --> +<!-- XHTML Inputmode Module .............................................. --> +<!-- file: xhtml-inputmode-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2007 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-inputmode-1.mod,v 1.2 2007/07/13 14:37:53 jigsaw Exp $ + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Inputmode 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-inputmode-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Inputmode + + inputmode + + This module declares the 'inputmode' attribute used for suggesting the + input mode associated with an input or textarea element. +--> + +<!-- render in this frame --> +<!ENTITY % Inputmode.datatype "CDATA" > + +<!-- add 'inputmode' attribute to 'input' element --> +<!ATTLIST %input.qname; + inputmode %Inputmode.datatype; #IMPLIED +> + +<!-- add 'inputmode' attribute to 'textarea' element --> +<!ATTLIST %textarea.qname; + inputmode %Inputmode.datatype; #IMPLIED +> + +<!-- end of xhtml-inputmode-1.mod --> diff --git a/lv2specgen/DTD/xhtml-lat1.ent b/lv2specgen/DTD/xhtml-lat1.ent new file mode 100644 index 0000000..6f1dd65 --- /dev/null +++ b/lv2specgen/DTD/xhtml-lat1.ent @@ -0,0 +1,235 @@ +<!-- ...................................................................... --> +<!-- XML-compatible ISO Latin 1 Character Entity Set for XHTML ............ --> +<!-- file: xhtml-lat1.ent + + Typical invocation: + + <!ENTITY % xhtml-lat1 + PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" > + %xhtml-lat1; + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" + + Revision: $Id: xhtml-lat1.ent,v 1.1 2001/02/13 12:24:22 ht Exp $ SMI + + Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with conforming + SGML systems and applications as defined in ISO 8879, provided + this notice is included in all copies. +--> + +<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, + U+00A0 ISOnum --> +<!ENTITY iexcl "¡" ><!-- inverted exclamation mark, + U+00A1 ISOnum --> +<!ENTITY cent "¢" ><!-- cent sign, + U+00A2 ISOnum --> +<!ENTITY pound "£" ><!-- pound sign, + U+00A3 ISOnum --> +<!ENTITY curren "¤" ><!-- currency sign, + U+00A4 ISOnum --> +<!ENTITY yen "¥" ><!-- yen sign = yuan sign, + U+00A5 ISOnum --> +<!ENTITY brvbar "¦" ><!-- broken bar = broken vertical bar, + U+00A6 ISOnum --> +<!ENTITY sect "§" ><!-- section sign, + U+00A7 ISOnum --> +<!ENTITY uml "¨" ><!-- diaeresis = spacing diaeresis, + U+00A8 ISOdia --> +<!ENTITY copy "©" ><!-- copyright sign, + U+00A9 ISOnum --> +<!ENTITY ordf "ª" ><!-- feminine ordinal indicator, + U+00AA ISOnum --> +<!ENTITY laquo "«" ><!-- left-pointing double angle quotation mark + = left pointing guillemet, + U+00AB ISOnum --> +<!ENTITY not "¬" ><!-- not sign, + U+00AC ISOnum --> +<!ENTITY shy "­" ><!-- soft hyphen = discretionary hyphen, + U+00AD ISOnum --> +<!ENTITY reg "®" ><!-- registered sign = registered trade mark sign, + U+00AE ISOnum --> +<!ENTITY macr "¯" ><!-- macron = spacing macron = overline + = APL overbar, + U+00AF ISOdia --> +<!ENTITY deg "°" ><!-- degree sign, + U+00B0 ISOnum --> +<!ENTITY plusmn "±" ><!-- plus-minus sign = plus-or-minus sign, + U+00B1 ISOnum --> +<!ENTITY sup2 "²" ><!-- superscript two = superscript digit two + = squared, + U+00B2 ISOnum --> +<!ENTITY sup3 "³" ><!-- superscript three = superscript digit three + = cubed, + U+00B3 ISOnum --> +<!ENTITY acute "´" ><!-- acute accent = spacing acute, + U+00B4 ISOdia --> +<!ENTITY micro "µ" ><!-- micro sign, + U+00B5 ISOnum --> +<!ENTITY para "¶" ><!-- pilcrow sign = paragraph sign, + U+00B6 ISOnum --> +<!ENTITY middot "·" ><!-- middle dot = Georgian comma + = Greek middle dot, + U+00B7 ISOnum --> +<!ENTITY cedil "¸" ><!-- cedilla = spacing cedilla, + U+00B8 ISOdia --> +<!ENTITY sup1 "¹" ><!-- superscript one = superscript digit one, + U+00B9 ISOnum --> +<!ENTITY ordm "º" ><!-- masculine ordinal indicator, + U+00BA ISOnum --> +<!ENTITY raquo "»" ><!-- right-pointing double angle quotation mark + = right pointing guillemet, + U+00BB ISOnum --> +<!ENTITY frac14 "¼" ><!-- vulgar fraction one quarter + = fraction one quarter, + U+00BC ISOnum --> +<!ENTITY frac12 "½" ><!-- vulgar fraction one half + = fraction one half, + U+00BD ISOnum --> +<!ENTITY frac34 "¾" ><!-- vulgar fraction three quarters + = fraction three quarters, + U+00BE ISOnum --> +<!ENTITY iquest "¿" ><!-- inverted question mark + = turned question mark, + U+00BF ISOnum --> +<!ENTITY Agrave "À" ><!-- latin capital letter A with grave + = latin capital letter A grave, + U+00C0 ISOlat1 --> +<!ENTITY Aacute "Á" ><!-- latin capital letter A with acute, + U+00C1 ISOlat1 --> +<!ENTITY Acirc "Â" ><!-- latin capital letter A with circumflex, + U+00C2 ISOlat1 --> +<!ENTITY Atilde "Ã" ><!-- latin capital letter A with tilde, + U+00C3 ISOlat1 --> +<!ENTITY Auml "Ä" ><!-- latin capital letter A with diaeresis, + U+00C4 ISOlat1 --> +<!ENTITY Aring "Å" ><!-- latin capital letter A with ring above + = latin capital letter A ring, + U+00C5 ISOlat1 --> +<!ENTITY AElig "Æ" ><!-- latin capital letter AE + = latin capital ligature AE, + U+00C6 ISOlat1 --> +<!ENTITY Ccedil "Ç" ><!-- latin capital letter C with cedilla, + U+00C7 ISOlat1 --> +<!ENTITY Egrave "È" ><!-- latin capital letter E with grave, + U+00C8 ISOlat1 --> +<!ENTITY Eacute "É" ><!-- latin capital letter E with acute, + U+00C9 ISOlat1 --> +<!ENTITY Ecirc "Ê" ><!-- latin capital letter E with circumflex, + U+00CA ISOlat1 --> +<!ENTITY Euml "Ë" ><!-- latin capital letter E with diaeresis, + U+00CB ISOlat1 --> +<!ENTITY Igrave "Ì" ><!-- latin capital letter I with grave, + U+00CC ISOlat1 --> +<!ENTITY Iacute "Í" ><!-- latin capital letter I with acute, + U+00CD ISOlat1 --> +<!ENTITY Icirc "Î" ><!-- latin capital letter I with circumflex, + U+00CE ISOlat1 --> +<!ENTITY Iuml "Ï" ><!-- latin capital letter I with diaeresis, + U+00CF ISOlat1 --> +<!ENTITY ETH "Ð" ><!-- latin capital letter ETH, + U+00D0 ISOlat1 --> +<!ENTITY Ntilde "Ñ" ><!-- latin capital letter N with tilde, + U+00D1 ISOlat1 --> +<!ENTITY Ograve "Ò" ><!-- latin capital letter O with grave, + U+00D2 ISOlat1 --> +<!ENTITY Oacute "Ó" ><!-- latin capital letter O with acute, + U+00D3 ISOlat1 --> +<!ENTITY Ocirc "Ô" ><!-- latin capital letter O with circumflex, + U+00D4 ISOlat1 --> +<!ENTITY Otilde "Õ" ><!-- latin capital letter O with tilde, + U+00D5 ISOlat1 --> +<!ENTITY Ouml "Ö" ><!-- latin capital letter O with diaeresis, + U+00D6 ISOlat1 --> +<!ENTITY times "×" ><!-- multiplication sign, + U+00D7 ISOnum --> +<!ENTITY Oslash "Ø" ><!-- latin capital letter O with stroke + = latin capital letter O slash, + U+00D8 ISOlat1 --> +<!ENTITY Ugrave "Ù" ><!-- latin capital letter U with grave, + U+00D9 ISOlat1 --> +<!ENTITY Uacute "Ú" ><!-- latin capital letter U with acute, + U+00DA ISOlat1 --> +<!ENTITY Ucirc "Û" ><!-- latin capital letter U with circumflex, + U+00DB ISOlat1 --> +<!ENTITY Uuml "Ü" ><!-- latin capital letter U with diaeresis, + U+00DC ISOlat1 --> +<!ENTITY Yacute "Ý" ><!-- latin capital letter Y with acute, + U+00DD ISOlat1 --> +<!ENTITY THORN "Þ" ><!-- latin capital letter THORN, + U+00DE ISOlat1 --> +<!ENTITY szlig "ß" ><!-- latin small letter sharp s = ess-zed, + U+00DF ISOlat1 --> +<!ENTITY agrave "à" ><!-- latin small letter a with grave + = latin small letter a grave, + U+00E0 ISOlat1 --> +<!ENTITY aacute "á" ><!-- latin small letter a with acute, + U+00E1 ISOlat1 --> +<!ENTITY acirc "â" ><!-- latin small letter a with circumflex, + U+00E2 ISOlat1 --> +<!ENTITY atilde "ã" ><!-- latin small letter a with tilde, + U+00E3 ISOlat1 --> +<!ENTITY auml "ä" ><!-- latin small letter a with diaeresis, + U+00E4 ISOlat1 --> +<!ENTITY aring "å" ><!-- latin small letter a with ring above + = latin small letter a ring, + U+00E5 ISOlat1 --> +<!ENTITY aelig "æ" ><!-- latin small letter ae + = latin small ligature ae, + U+00E6 ISOlat1 --> +<!ENTITY ccedil "ç" ><!-- latin small letter c with cedilla, + U+00E7 ISOlat1 --> +<!ENTITY egrave "è" ><!-- latin small letter e with grave, + U+00E8 ISOlat1 --> +<!ENTITY eacute "é" ><!-- latin small letter e with acute, + U+00E9 ISOlat1 --> +<!ENTITY ecirc "ê" ><!-- latin small letter e with circumflex, + U+00EA ISOlat1 --> +<!ENTITY euml "ë" ><!-- latin small letter e with diaeresis, + U+00EB ISOlat1 --> +<!ENTITY igrave "ì" ><!-- latin small letter i with grave, + U+00EC ISOlat1 --> +<!ENTITY iacute "í" ><!-- latin small letter i with acute, + U+00ED ISOlat1 --> +<!ENTITY icirc "î" ><!-- latin small letter i with circumflex, + U+00EE ISOlat1 --> +<!ENTITY iuml "ï" ><!-- latin small letter i with diaeresis, + U+00EF ISOlat1 --> +<!ENTITY eth "ð" ><!-- latin small letter eth, + U+00F0 ISOlat1 --> +<!ENTITY ntilde "ñ" ><!-- latin small letter n with tilde, + U+00F1 ISOlat1 --> +<!ENTITY ograve "ò" ><!-- latin small letter o with grave, + U+00F2 ISOlat1 --> +<!ENTITY oacute "ó" ><!-- latin small letter o with acute, + U+00F3 ISOlat1 --> +<!ENTITY ocirc "ô" ><!-- latin small letter o with circumflex, + U+00F4 ISOlat1 --> +<!ENTITY otilde "õ" ><!-- latin small letter o with tilde, + U+00F5 ISOlat1 --> +<!ENTITY ouml "ö" ><!-- latin small letter o with diaeresis, + U+00F6 ISOlat1 --> +<!ENTITY divide "÷" ><!-- division sign, + U+00F7 ISOnum --> +<!ENTITY oslash "ø" ><!-- latin small letter o with stroke, + = latin small letter o slash, + U+00F8 ISOlat1 --> +<!ENTITY ugrave "ù" ><!-- latin small letter u with grave, + U+00F9 ISOlat1 --> +<!ENTITY uacute "ú" ><!-- latin small letter u with acute, + U+00FA ISOlat1 --> +<!ENTITY ucirc "û" ><!-- latin small letter u with circumflex, + U+00FB ISOlat1 --> +<!ENTITY uuml "ü" ><!-- latin small letter u with diaeresis, + U+00FC ISOlat1 --> +<!ENTITY yacute "ý" ><!-- latin small letter y with acute, + U+00FD ISOlat1 --> +<!ENTITY thorn "þ" ><!-- latin small letter thorn with, + U+00FE ISOlat1 --> +<!ENTITY yuml "ÿ" ><!-- latin small letter y with diaeresis, + U+00FF ISOlat1 --> +<!-- end of xhtml-lat1.ent --> diff --git a/lv2specgen/DTD/xhtml-legacy-1.mod b/lv2specgen/DTD/xhtml-legacy-1.mod new file mode 100644 index 0000000..ebf11f7 --- /dev/null +++ b/lv2specgen/DTD/xhtml-legacy-1.mod @@ -0,0 +1,400 @@ +<!-- ...................................................................... --> +<!-- XHTML Legacy Markup Module ........................................... --> +<!-- file: xhtml-legacy-1.mod + + This is an extension of XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-legacy-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-legacy-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- HTML Legacy Markup + + font, basefont, center, s, strike, u, dir, menu, isindex + + (plus additional datatypes and attributes) + + This optional module declares additional markup for simple + presentation-related markup based on features found in the + HTML 4 Transitional and Frameset DTDs. This relies on + inclusion of the Legacy Redeclarations module. This module + also declares the frames, inline frames and object modules. + + This is to allow XHTML 1.1 documents to be transformed for + display on HTML browsers where CSS support is inconsistent + or unavailable. +--> +<!-- Constructing a Legacy DTD + + To construct a DTD driver obtaining a close approximation + of the HTML 4 Transitional and Frameset DTDs, declare the + Legacy Redeclarations module as the pre-framework redeclaration + parameter entity (%xhtml-prefw-redecl.mod;) and INCLUDE its + conditional section: + + ... + <!ENTITY % xhtml-prefw-redecl.module "INCLUDE" > + <![%xhtml-prefw-redecl.module;[ + <!ENTITY % xhtml-prefw-redecl.mod + PUBLIC "-//W3C//ELEMENTS XHTML Legacy Redeclarations 1.0//EN" + "xhtml-legacy-redecl-1.mod" > + %xhtml-prefw-redecl.mod;]]> + + Such a DTD should be named with a variant FPI and redeclare + the value of the %XHTML.version; parameter entity to that FPI: + + "-//Your Name Here//DTD XHTML Legacy 1.1//EN" + + IMPORTANT: see also the notes included in the Legacy Redeclarations + Module for information on how to construct a DTD using this module. +--> + + +<!-- Additional Element Types .................................... --> + +<!-- font: Local Font Modifier ........................ --> + +<!ENTITY % font.element "INCLUDE" > +<![%font.element;[ +<!ENTITY % font.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % font.qname "font" > +<!ELEMENT %font.qname; %font.content; > +<!-- end of font.element -->]]> + +<!ENTITY % font.attlist "INCLUDE" > +<![%font.attlist;[ +<!ATTLIST %font.qname; + %Core.attrib; + %I18n.attrib; + size CDATA #IMPLIED + color %Color.datatype; #IMPLIED + face CDATA #IMPLIED +> +<!-- end of font.attlist -->]]> + +<!-- basefont: Base Font Size ......................... --> + +<!ENTITY % basefont.element "INCLUDE" > +<![%basefont.element;[ +<!ENTITY % basefont.content "EMPTY" > +<!ENTITY % basefont.qname "basefont" > +<!ELEMENT %basefont.qname; %basefont.content; > +<!-- end of basefont.element -->]]> + +<!ENTITY % basefont.attlist "INCLUDE" > +<![%basefont.attlist;[ +<!ATTLIST %basefont.qname; + %id.attrib; + size CDATA #REQUIRED + color %Color.datatype; #IMPLIED + face CDATA #IMPLIED +> +<!-- end of basefont.attlist -->]]> + +<!-- center: Center Alignment ......................... --> + +<!ENTITY % center.element "INCLUDE" > +<![%center.element;[ +<!ENTITY % center.content + "( #PCDATA | %Flow.mix; )*" +> +<!ENTITY % center.qname "center" > +<!ELEMENT %center.qname; %center.content; > +<!-- end of center.element -->]]> + +<!ENTITY % center.attlist "INCLUDE" > +<![%center.attlist;[ +<!ATTLIST %center.qname; + %Common.attrib; +> +<!-- end of center.attlist -->]]> + +<!-- s: Strike-Thru Text Style ........................ --> + +<!ENTITY % s.element "INCLUDE" > +<![%s.element;[ +<!ENTITY % s.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % s.qname "s" > +<!ELEMENT %s.qname; %s.content; > +<!-- end of s.element -->]]> + +<!ENTITY % s.attlist "INCLUDE" > +<![%s.attlist;[ +<!ATTLIST %s.qname; + %Common.attrib; +> +<!-- end of s.attlist -->]]> + +<!-- strike: Strike-Thru Text Style ....................--> + +<!ENTITY % strike.element "INCLUDE" > +<![%strike.element;[ +<!ENTITY % strike.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % strike.qname "strike" > +<!ELEMENT %strike.qname; %strike.content; > +<!-- end of strike.element -->]]> + +<!ENTITY % strike.attlist "INCLUDE" > +<![%strike.attlist;[ +<!ATTLIST %strike.qname; + %Common.attrib; +> +<!-- end of strike.attlist -->]]> + +<!-- u: Underline Text Style ...........................--> + +<!ENTITY % u.element "INCLUDE" > +<![%u.element;[ +<!ENTITY % u.content + "( #PCDATA | %Inline.mix; )*" +> +<!ENTITY % u.qname "u" > +<!ELEMENT %u.qname; %u.content; > +<!-- end of u.element -->]]> + +<!ENTITY % u.attlist "INCLUDE" > +<![%u.attlist;[ +<!ATTLIST %u.qname; + %Common.attrib; +> +<!-- end of u.attlist -->]]> + +<!-- dir: Directory List .............................. --> + +<!-- NOTE: the content model for <dir> in HTML 4 excluded %Block.mix; +--> +<!ENTITY % dir.element "INCLUDE" > +<![%dir.element;[ +<!ENTITY % dir.content + "( %li.qname; )+" +> +<!ENTITY % dir.qname "dir" > +<!ELEMENT %dir.qname; %dir.content; > +<!-- end of dir.element -->]]> + +<!ENTITY % dir.attlist "INCLUDE" > +<![%dir.attlist;[ +<!ATTLIST %dir.qname; + %Common.attrib; + compact ( compact ) #IMPLIED +> +<!-- end of dir.attlist -->]]> + +<!-- menu: Menu List .................................. --> + +<!-- NOTE: the content model for <menu> in HTML 4 excluded %Block.mix; +--> +<!ENTITY % menu.element "INCLUDE" > +<![%menu.element;[ +<!ENTITY % menu.content + "( %li.qname; )+" +> +<!ENTITY % menu.qname "menu" > +<!ELEMENT %menu.qname; %menu.content; > +<!-- end of menu.element -->]]> + +<!ENTITY % menu.attlist "INCLUDE" > +<![%menu.attlist;[ +<!ATTLIST %menu.qname; + %Common.attrib; + compact ( compact ) #IMPLIED +> +<!-- end of menu.attlist -->]]> + +<!-- isindex: Single-Line Prompt ...................... --> + +<!ENTITY % isindex.element "INCLUDE" > +<![%isindex.element;[ +<!ENTITY % isindex.content "EMPTY" > +<!ENTITY % isindex.qname "isindex" > +<!ELEMENT %isindex.qname; %isindex.content; > +<!-- end of isindex.element -->]]> + +<!ENTITY % isindex.attlist "INCLUDE" > +<![%isindex.attlist;[ +<!ATTLIST %isindex.qname; + %Core.attrib; + %I18n.attrib; + prompt %Text.datatype; #IMPLIED +> +<!-- end of isindex.attlist -->]]> + + +<!-- Additional Attributes ....................................... --> + +<!-- Alignment attribute for Transitional use in HTML browsers + (this functionality is generally well-supported in CSS, + except within some contexts) +--> +<!ENTITY % align.attrib + "align ( left | center | right | justify ) #IMPLIED" +> + +<!ATTLIST %applet.qname; + align ( top | middle | bottom | left | right ) #IMPLIED + hspace %Pixels.datatype; #IMPLIED + vspace %Pixels.datatype; #IMPLIED +> + +<!ATTLIST %body.qname; + background %URI.datatype; #IMPLIED + bgcolor %Color.datatype; #IMPLIED + text %Color.datatype; #IMPLIED + link %Color.datatype; #IMPLIED + vlink %Color.datatype; #IMPLIED + alink %Color.datatype; #IMPLIED +> + +<!ATTLIST %br.qname; + clear ( left | all | right | none ) 'none' +> + +<!ATTLIST %caption.qname; + align ( top | bottom | left | right ) #IMPLIED +> + +<!ATTLIST %div.qname; + %align.attrib; +> + +<!ATTLIST %h1.qname; + %align.attrib; +> + +<!ATTLIST %h2.qname; + %align.attrib; +> + +<!ATTLIST %h3.qname; + %align.attrib; +> + +<!ATTLIST %h4.qname; + %align.attrib; +> + +<!ATTLIST %h5.qname; + %align.attrib; +> + +<!ATTLIST %h6.qname; + %align.attrib; +> + +<!ATTLIST %hr.qname; + align ( left | center | right ) #IMPLIED + noshade ( noshade ) #IMPLIED + size %Pixels.datatype; #IMPLIED + width %Length.datatype; #IMPLIED +> + +<!ATTLIST %img.qname; + align ( top | middle | bottom | left | right ) #IMPLIED + border %Pixels.datatype; #IMPLIED + hspace %Pixels.datatype; #IMPLIED + vspace %Pixels.datatype; #IMPLIED +> + +<!ATTLIST %input.qname; + align ( top | middle | bottom | left | right ) #IMPLIED +> + +<!ATTLIST %legend.qname; + align ( top | bottom | left | right ) #IMPLIED +> + +<!ATTLIST %li.qname; + type CDATA #IMPLIED + value %Number.datatype; #IMPLIED +> + +<!ATTLIST %object.qname; + align ( top | middle | bottom | left | right ) #IMPLIED + border %Pixels.datatype; #IMPLIED + hspace %Pixels.datatype; #IMPLIED + vspace %Pixels.datatype; #IMPLIED +> + +<!ATTLIST %dl.qname; + compact ( compact ) #IMPLIED +> + +<!ATTLIST %ol.qname; + type CDATA #IMPLIED + compact ( compact ) #IMPLIED + start %Number.datatype; #IMPLIED +> + +<!ATTLIST %p.qname; + %align.attrib; +> + +<!ATTLIST %pre.qname; + width %Length.datatype; #IMPLIED +> + +<!ATTLIST %script.qname; + language %ContentType.datatype; #IMPLIED +> + +<!ATTLIST %table.qname; + align ( left | center | right ) #IMPLIED + bgcolor %Color.datatype; #IMPLIED +> + +<!ATTLIST %tr.qname; + bgcolor %Color.datatype; #IMPLIED +> + +<!ATTLIST %th.qname; + nowrap ( nowrap ) #IMPLIED + bgcolor %Color.datatype; #IMPLIED + width %Length.datatype; #IMPLIED + height %Length.datatype; #IMPLIED +> + +<!ATTLIST %td.qname; + nowrap ( nowrap ) #IMPLIED + bgcolor %Color.datatype; #IMPLIED + width %Length.datatype; #IMPLIED + height %Length.datatype; #IMPLIED +> + +<!ATTLIST %ul.qname; + type CDATA #IMPLIED + compact ( compact ) #IMPLIED +> + +<!-- Frames Module ............................................... --> +<!ENTITY % xhtml-frames.module "IGNORE" > +<![%xhtml-frames.module;[ +<!ENTITY % xhtml-frames.mod + PUBLIC "-//W3C//ELEMENTS XHTML Frames 1.0//EN" + "xhtml-frames-1.mod" > +%xhtml-frames.mod;]]> + +<!-- Inline Frames Module ........................................ --> +<!ENTITY % xhtml-iframe.module "INCLUDE" > +<![%xhtml-iframe.module;[ +<!ATTLIST %iframe.qname; + align ( top | middle | bottom | left | right ) #IMPLIED +> +<!ENTITY % xhtml-iframe.mod + PUBLIC "-//W3C//ELEMENTS XHTML Inline Frame Element 1.0//EN" + "xhtml-iframe-1.mod" > +%xhtml-iframe.mod;]]> + +<!-- end of xhtml-legacy-1.mod --> diff --git a/lv2specgen/DTD/xhtml-link-1.mod b/lv2specgen/DTD/xhtml-link-1.mod new file mode 100644 index 0000000..2b4f92c --- /dev/null +++ b/lv2specgen/DTD/xhtml-link-1.mod @@ -0,0 +1,59 @@ +<!-- ...................................................................... --> +<!-- XHTML Link Element Module ........................................... --> +<!-- file: xhtml-link-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-link-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Link element + + link + + This module declares the link element type and its attributes, + which could (in principle) be used to define document-level links + to external resources such as: + + a) for document specific toolbars/menus, e.g. start, contents, + previous, next, index, end, help + b) to link to a separate style sheet (rel="stylesheet") + c) to make a link to a script (rel="script") + d) by style sheets to control how collections of html nodes are + rendered into printed documents + e) to make a link to a printable version of this document + e.g. a postscript or pdf version (rel="alternate" media="print") +--> + +<!-- link: Media-Independent Link ...................... --> + +<!ENTITY % link.element "INCLUDE" > +<![%link.element;[ +<!ENTITY % link.content "EMPTY" > +<!ENTITY % link.qname "link" > +<!ELEMENT %link.qname; %link.content; > +<!-- end of link.element -->]]> + +<!ENTITY % link.attlist "INCLUDE" > +<![%link.attlist;[ +<!ATTLIST %link.qname; + %Common.attrib; + charset %Charset.datatype; #IMPLIED + href %URI.datatype; #IMPLIED + hreflang %LanguageCode.datatype; #IMPLIED + type %ContentType.datatype; #IMPLIED + rel %LinkTypes.datatype; #IMPLIED + rev %LinkTypes.datatype; #IMPLIED + media %MediaDesc.datatype; #IMPLIED +> +<!-- end of link.attlist -->]]> + +<!-- end of xhtml-link-1.mod --> diff --git a/lv2specgen/DTD/xhtml-list-1.mod b/lv2specgen/DTD/xhtml-list-1.mod new file mode 100644 index 0000000..6c85f20 --- /dev/null +++ b/lv2specgen/DTD/xhtml-list-1.mod @@ -0,0 +1,129 @@ +<!-- ...................................................................... --> +<!-- XHTML Lists Module .................................................. --> +<!-- file: xhtml-list-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-list-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Lists + + dl, dt, dd, ol, ul, li + + This module declares the list-oriented element types + and their attributes. +--> + +<!ENTITY % dl.qname "dl" > +<!ENTITY % dt.qname "dt" > +<!ENTITY % dd.qname "dd" > +<!ENTITY % ol.qname "ol" > +<!ENTITY % ul.qname "ul" > +<!ENTITY % li.qname "li" > + +<!-- dl: Definition List ............................... --> + +<!ENTITY % dl.element "INCLUDE" > +<![%dl.element;[ +<!ENTITY % dl.content "( %dt.qname; | %dd.qname; )+" > +<!ELEMENT %dl.qname; %dl.content; > +<!-- end of dl.element -->]]> + +<!ENTITY % dl.attlist "INCLUDE" > +<![%dl.attlist;[ +<!ATTLIST %dl.qname; + %Common.attrib; +> +<!-- end of dl.attlist -->]]> + +<!-- dt: Definition Term ............................... --> + +<!ENTITY % dt.element "INCLUDE" > +<![%dt.element;[ +<!ENTITY % dt.content + "( #PCDATA | %Inline.mix; )*" +> +<!ELEMENT %dt.qname; %dt.content; > +<!-- end of dt.element -->]]> + +<!ENTITY % dt.attlist "INCLUDE" > +<![%dt.attlist;[ +<!ATTLIST %dt.qname; + %Common.attrib; +> +<!-- end of dt.attlist -->]]> + +<!-- dd: Definition Description ........................ --> + +<!ENTITY % dd.element "INCLUDE" > +<![%dd.element;[ +<!ENTITY % dd.content + "( #PCDATA | %Flow.mix; )*" +> +<!ELEMENT %dd.qname; %dd.content; > +<!-- end of dd.element -->]]> + +<!ENTITY % dd.attlist "INCLUDE" > +<![%dd.attlist;[ +<!ATTLIST %dd.qname; + %Common.attrib; +> +<!-- end of dd.attlist -->]]> + +<!-- ol: Ordered List (numbered styles) ................ --> + +<!ENTITY % ol.element "INCLUDE" > +<![%ol.element;[ +<!ENTITY % ol.content "( %li.qname; )+" > +<!ELEMENT %ol.qname; %ol.content; > +<!-- end of ol.element -->]]> + +<!ENTITY % ol.attlist "INCLUDE" > +<![%ol.attlist;[ +<!ATTLIST %ol.qname; + %Common.attrib; +> +<!-- end of ol.attlist -->]]> + +<!-- ul: Unordered List (bullet styles) ................ --> + +<!ENTITY % ul.element "INCLUDE" > +<![%ul.element;[ +<!ENTITY % ul.content "( %li.qname; )+" > +<!ELEMENT %ul.qname; %ul.content; > +<!-- end of ul.element -->]]> + +<!ENTITY % ul.attlist "INCLUDE" > +<![%ul.attlist;[ +<!ATTLIST %ul.qname; + %Common.attrib; +> +<!-- end of ul.attlist -->]]> + +<!-- li: List Item ..................................... --> + +<!ENTITY % li.element "INCLUDE" > +<![%li.element;[ +<!ENTITY % li.content + "( #PCDATA | %Flow.mix; )*" +> +<!ELEMENT %li.qname; %li.content; > +<!-- end of li.element -->]]> + +<!ENTITY % li.attlist "INCLUDE" > +<![%li.attlist;[ +<!ATTLIST %li.qname; + %Common.attrib; +> +<!-- end of li.attlist -->]]> + +<!-- end of xhtml-list-1.mod --> diff --git a/lv2specgen/DTD/xhtml-meta-1.mod b/lv2specgen/DTD/xhtml-meta-1.mod new file mode 100644 index 0000000..24a0b22 --- /dev/null +++ b/lv2specgen/DTD/xhtml-meta-1.mod @@ -0,0 +1,47 @@ +<!-- ...................................................................... --> +<!-- XHTML Document Metainformation Module ............................... --> +<!-- file: xhtml-meta-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-meta-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Meta Information + + meta + + This module declares the meta element type and its attributes, + used to provide declarative document metainformation. +--> + +<!-- meta: Generic Metainformation ..................... --> + +<!ENTITY % meta.element "INCLUDE" > +<![%meta.element;[ +<!ENTITY % meta.content "EMPTY" > +<!ENTITY % meta.qname "meta" > +<!ELEMENT %meta.qname; %meta.content; > +<!-- end of meta.element -->]]> + +<!ENTITY % meta.attlist "INCLUDE" > +<![%meta.attlist;[ +<!ATTLIST %meta.qname; + %XHTML.xmlns.attrib; + %I18n.attrib; + http-equiv NMTOKEN #IMPLIED + name NMTOKEN #IMPLIED + content CDATA #REQUIRED + scheme CDATA #IMPLIED +> +<!-- end of meta.attlist -->]]> + +<!-- end of xhtml-meta-1.mod --> diff --git a/lv2specgen/DTD/xhtml-metaAttributes-1.mod b/lv2specgen/DTD/xhtml-metaAttributes-1.mod new file mode 100644 index 0000000..b434e39 --- /dev/null +++ b/lv2specgen/DTD/xhtml-metaAttributes-1.mod @@ -0,0 +1,154 @@ +<!-- ...................................................................... --> +<!-- XHTML MetaAttributes Module ......................................... --> +<!-- file: xhtml-metaAttributes-1.mod + + This is XHTML-RDFa, modules to annotate XHTML family documents. + Copyright 2007-2008 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-metaAttributes-1.mod,v 1.6 2008/08/01 20:01:00 smccarro Exp $ + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML MetaAttributes 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-metaAttributes-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!ENTITY % XHTML.global.attrs.prefixed "IGNORE" > + +<!-- Placeholder Compact URI-related types --> +<!ENTITY % CURIE.datatype "CDATA" > +<!ENTITY % CURIEs.datatype "CDATA" > +<!ENTITY % SafeCURIE.datatype "CDATA" > +<!ENTITY % SafeCURIEs.datatype "CDATA" > +<!ENTITY % URIorSafeCURIE.datatype "CDATA" > +<!ENTITY % URIorSafeCURIEs.datatype "CDATA" > + +<!-- Common Attributes + + This module declares a collection of meta-information related + attributes. + + %NS.decl.attrib; is declared in the XHTML Qname module. + + This file also includes declarations of "global" versions of the + attributes. The global versions of the attributes are for use on + elements in other namespaces. +--> + +<!ENTITY % about.attrib + "about %URIorSafeCURIE.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.about.attrib + "%XHTML.prefix;:about %URIorSafeCURIE.datatype; #IMPLIED" +> +]]> + +<!ENTITY % typeof.attrib + "typeof %CURIEs.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.typeof.attrib + "%XHTML.prefix;:typeof %CURIEs.datatype; #IMPLIED" +> +]]> + +<!ENTITY % property.attrib + "property %CURIEs.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.property.attrib + "%XHTML.prefix;:property %CURIEs.datatype; #IMPLIED" +> +]]> + +<!ENTITY % resource.attrib + "resource %URIorSafeCURIE.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.resource.attrib + "%XHTML.prefix;:resource %URIorSafeCURIE.datatype; #IMPLIED" +> +]]> + +<!ENTITY % content.attrib + "content CDATA #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.content.attrib + "%XHTML.prefix;:content CDATA #IMPLIED" +> +]]> + +<!ENTITY % datatype.attrib + "datatype %CURIE.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.datatype.attrib + "%XHTML.prefix;:datatype %CURIE.datatype; #IMPLIED" +> +]]> + +<!ENTITY % rel.attrib + "rel %CURIEs.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.rel.attrib + "%XHTML.prefix;:rel %CURIEs.datatype; #IMPLIED" +> +]]> + +<!ENTITY % rev.attrib + "rev %CURIEs.datatype; #IMPLIED" +> + +<![%XHTML.global.attrs.prefixed;[ +<!ENTITY % XHTML.global.rev.attrib + "%XHTML.prefix;:rev %CURIEs.datatype; #IMPLIED" +> +]]> + +<!ENTITY % Metainformation.extra.attrib "" > + +<!ENTITY % Metainformation.attrib + "%about.attrib; + %content.attrib; + %datatype.attrib; + %typeof.attrib; + %property.attrib; + %rel.attrib; + %resource.attrib; + %rev.attrib; + %Metainformation.extra.attrib;" +> + +<!ENTITY % XHTML.global.metainformation.extra.attrib "" > + +<![%XHTML.global.attrs.prefixed;[ + +<!ENTITY % XHTML.global.metainformation.attrib + "%XHTML.global.about.attrib; + %XHTML.global.content.attrib; + %XHTML.global.datatype.attrib; + %XHTML.global.typeof.attrib; + %XHTML.global.property.attrib; + %XHTML.global.rel.attrib; + %XHTML.global.resource.attrib; + %XHTML.global.rev.attrib; + %XHTML.global.metainformation.extra.attrib;" +> +]]> + +<!ENTITY % XHTML.global.metainformation.attrib "" > + + +<!-- end of xhtml-metaAttributes-1.mod --> diff --git a/lv2specgen/DTD/xhtml-object-1.mod b/lv2specgen/DTD/xhtml-object-1.mod new file mode 100644 index 0000000..0d14cc5 --- /dev/null +++ b/lv2specgen/DTD/xhtml-object-1.mod @@ -0,0 +1,60 @@ +<!-- ...................................................................... --> +<!-- XHTML Embedded Object Module ........................................ --> +<!-- file: xhtml-object-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-object-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Embedded Objects + + object + + This module declares the object element type and its attributes, used + to embed external objects as part of XHTML pages. In the document, + place param elements prior to other content within the object element. + + Note that use of this module requires instantiation of the Param + Element Module. +--> + +<!-- object: Generic Embedded Object ................... --> + +<!ENTITY % object.element "INCLUDE" > +<![%object.element;[ +<!ENTITY % object.content + "( #PCDATA | %Flow.mix; | %param.qname; )*" +> +<!ENTITY % object.qname "object" > +<!ELEMENT %object.qname; %object.content; > +<!-- end of object.element -->]]> + +<!ENTITY % object.attlist "INCLUDE" > +<![%object.attlist;[ +<!ATTLIST %object.qname; + %Common.attrib; + declare ( declare ) #IMPLIED + classid %URI.datatype; #IMPLIED + codebase %URI.datatype; #IMPLIED + data %URI.datatype; #IMPLIED + type %ContentType.datatype; #IMPLIED + codetype %ContentType.datatype; #IMPLIED + archive %URIs.datatype; #IMPLIED + standby %Text.datatype; #IMPLIED + height %Length.datatype; #IMPLIED + width %Length.datatype; #IMPLIED + name CDATA #IMPLIED + tabindex %Number.datatype; #IMPLIED +> +<!-- end of object.attlist -->]]> + +<!-- end of xhtml-object-1.mod --> diff --git a/lv2specgen/DTD/xhtml-param-1.mod b/lv2specgen/DTD/xhtml-param-1.mod new file mode 100644 index 0000000..c101bed --- /dev/null +++ b/lv2specgen/DTD/xhtml-param-1.mod @@ -0,0 +1,48 @@ +<!-- ...................................................................... --> +<!-- XHTML Param Element Module ..................................... --> +<!-- file: xhtml-param-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-param-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Parameters for Java Applets and Embedded Objects + + param + + This module provides declarations for the param element, + used to provide named property values for the applet + and object elements. +--> + +<!-- param: Named Property Value ....................... --> + +<!ENTITY % param.element "INCLUDE" > +<![%param.element;[ +<!ENTITY % param.content "EMPTY" > +<!ENTITY % param.qname "param" > +<!ELEMENT %param.qname; %param.content; > +<!-- end of param.element -->]]> + +<!ENTITY % param.attlist "INCLUDE" > +<![%param.attlist;[ +<!ATTLIST %param.qname; + %XHTML.xmlns.attrib; + %id.attrib; + name CDATA #REQUIRED + value CDATA #IMPLIED + valuetype ( data | ref | object ) 'data' + type %ContentType.datatype; #IMPLIED +> +<!-- end of param.attlist -->]]> + +<!-- end of xhtml-param-1.mod --> diff --git a/lv2specgen/DTD/xhtml-pres-1.mod b/lv2specgen/DTD/xhtml-pres-1.mod new file mode 100644 index 0000000..df0a9eb --- /dev/null +++ b/lv2specgen/DTD/xhtml-pres-1.mod @@ -0,0 +1,38 @@ +<!-- ...................................................................... --> +<!-- XHTML Presentation Module ............................................ --> +<!-- file: xhtml-pres-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-pres-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Presentational Elements + + This module defines elements and their attributes for + simple presentation-related markup. +--> + +<!ENTITY % xhtml-inlpres.module "INCLUDE" > +<![%xhtml-inlpres.module;[ +<!ENTITY % xhtml-inlpres.mod + PUBLIC "-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN" + "xhtml-inlpres-1.mod" > +%xhtml-inlpres.mod;]]> + +<!ENTITY % xhtml-blkpres.module "INCLUDE" > +<![%xhtml-blkpres.module;[ +<!ENTITY % xhtml-blkpres.mod + PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN" + "xhtml-blkpres-1.mod" > +%xhtml-blkpres.mod;]]> + +<!-- end of xhtml-pres-1.mod --> diff --git a/lv2specgen/DTD/xhtml-qname-1.mod b/lv2specgen/DTD/xhtml-qname-1.mod new file mode 100644 index 0000000..9a4ba76 --- /dev/null +++ b/lv2specgen/DTD/xhtml-qname-1.mod @@ -0,0 +1,318 @@ +<!-- ....................................................................... --> +<!-- XHTML Qname Module ................................................... --> +<!-- file: xhtml-qname-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-qname-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-qname-1.mod" + + Revisions: + #2000-10-22: added qname declarations for ruby elements + ....................................................................... --> + +<!-- XHTML Qname (Qualified Name) Module + + This module is contained in two parts, labeled Section 'A' and 'B': + + Section A declares parameter entities to support namespace- + qualified names, namespace declarations, and name prefixing + for XHTML and extensions. + + Section B declares parameter entities used to provide + namespace-qualified names for all XHTML element types: + + %applet.qname; the xmlns-qualified name for <applet> + %base.qname; the xmlns-qualified name for <base> + ... + + XHTML extensions would create a module similar to this one. + Included in the XHTML distribution is a template module + ('template-qname-1.mod') suitable for this purpose. +--> + +<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: --> + +<!-- 1. Declare a %XHTML.prefixed; conditional section keyword, used + to activate namespace prefixing. The default value should + inherit '%NS.prefixed;' from the DTD driver, so that unless + overridden, the default behaviour follows the overall DTD + prefixing scheme. +--> +<!ENTITY % NS.prefixed "IGNORE" > +<!ENTITY % XHTML.prefixed "%NS.prefixed;" > + +<!-- By default, we always permit XHTML attribute collections to have + namespace-qualified prefixes as well. +--> +<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" > +<!-- By default, we allow the XML Schema attributes on the root + element. +--> +<!ENTITY % XHTML.xsi.attrs "INCLUDE" > + +<!-- 2. Declare a parameter entity (eg., %XHTML.xmlns;) containing + the URI reference used to identify the XHTML namespace: +--> +<!ENTITY % XHTML.xmlns "http://www.w3.org/1999/xhtml" > + +<!-- 3. Declare parameter entities (eg., %XHTML.prefix;) containing + the default namespace prefix string(s) to use when prefixing + is enabled. This may be overridden in the DTD driver or the + internal subset of an document instance. If no default prefix + is desired, this may be declared as an empty string. + + NOTE: As specified in [XMLNAMES], the namespace prefix serves + as a proxy for the URI reference, and is not in itself significant. +--> +<!ENTITY % XHTML.prefix "xhtml" > + +<!-- 4. Declare parameter entities (eg., %XHTML.pfx;) containing the + colonized prefix(es) (eg., '%XHTML.prefix;:') used when + prefixing is active, an empty string when it is not. +--> +<![%XHTML.prefixed;[ +<!ENTITY % XHTML.pfx "%XHTML.prefix;:" > +]]> +<!ENTITY % XHTML.pfx "" > + +<!-- declare qualified name extensions here ............ --> +<!ENTITY % xhtml-qname-extra.mod "" > +%xhtml-qname-extra.mod; + +<!-- 5. The parameter entity %XHTML.xmlns.extra.attrib; may be + redeclared to contain any non-XHTML namespace declaration + attributes for namespaces embedded in XHTML. The default + is an empty string. XLink should be included here if used + in the DTD. +--> +<!ENTITY % XHTML.xmlns.extra.attrib "" > + +<!-- The remainder of Section A is only followed in XHTML, not extensions. --> + +<!-- Declare a parameter entity %NS.decl.attrib; containing + all XML Namespace declarations used in the DTD, plus the + xmlns declaration for XHTML, its form dependent on whether + prefixing is active. +--> +<!ENTITY % XHTML.xmlns.attrib.prefixed + "xmlns:%XHTML.prefix; %URI.datatype; #FIXED '%XHTML.xmlns;'" +> +<![%XHTML.prefixed;[ +<!ENTITY % NS.decl.attrib + "%XHTML.xmlns.attrib.prefixed; + %XHTML.xmlns.extra.attrib;" +> +]]> +<!ENTITY % NS.decl.attrib + "%XHTML.xmlns.extra.attrib;" +> + +<!-- Declare a parameter entity %XSI.prefix as a prefix to use for XML + Schema Instance attributes. +--> +<!ENTITY % XSI.prefix "xsi" > + +<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" > + +<!-- Declare a parameter entity %XSI.xmlns.attrib as support for the + schemaLocation attribute, since this is legal throughout the DTD. +--> +<!ENTITY % XSI.xmlns.attrib + "xmlns:%XSI.prefix; %URI.datatype; #FIXED '%XSI.xmlns;'" > + +<!-- This is a placeholder for future XLink support. +--> +<!ENTITY % XLINK.xmlns.attrib "" > + +<!-- This is the attribute for the XML Schema namespace - XHTML + Modularization is also expressed in XML Schema, and it needs to + be legal to declare the XML Schema namespace and the + schemaLocation attribute on the root element of XHTML family + documents. +--> +<![%XHTML.xsi.attrs;[ +<!ENTITY % XSI.prefix "xsi" > +<!ENTITY % XSI.pfx "%XSI.prefix;:" > +<!ENTITY % XSI.xmlns "http://www.w3.org/2001/XMLSchema-instance" > + +<!ENTITY % XSI.xmlns.attrib + "xmlns:%XSI.prefix; %URI.datatype; #FIXED '%XSI.xmlns;'" +> +]]> +<!ENTITY % XSI.prefix "" > +<!ENTITY % XSI.pfx "" > +<!ENTITY % XSI.xmlns.attrib "" > + + +<!-- Declare a parameter entity %NS.decl.attrib; containing all + XML namespace declaration attributes used by XHTML, including + a default xmlns attribute when prefixing is inactive. +--> +<![%XHTML.prefixed;[ +<!ENTITY % XHTML.xmlns.attrib + "%NS.decl.attrib; + %XSI.xmlns.attrib; + %XLINK.xmlns.attrib;" +> +]]> +<!ENTITY % XHTML.xmlns.attrib + "xmlns %URI.datatype; #FIXED '%XHTML.xmlns;' + %NS.decl.attrib; + %XSI.xmlns.attrib; + %XLINK.xmlns.attrib;" +> + +<!-- placeholder for qualified name redeclarations --> +<!ENTITY % xhtml-qname.redecl "" > +%xhtml-qname.redecl; + +<!-- Section B: XHTML Qualified Names ::::::::::::::::::::::::::::: --> + +<!-- 6. This section declares parameter entities used to provide + namespace-qualified names for all XHTML element types. +--> + +<!-- module: xhtml-applet-1.mod --> +<!ENTITY % applet.qname "%XHTML.pfx;applet" > + +<!-- module: xhtml-base-1.mod --> +<!ENTITY % base.qname "%XHTML.pfx;base" > + +<!-- module: xhtml-bdo-1.mod --> +<!ENTITY % bdo.qname "%XHTML.pfx;bdo" > + +<!-- module: xhtml-blkphras-1.mod --> +<!ENTITY % address.qname "%XHTML.pfx;address" > +<!ENTITY % blockquote.qname "%XHTML.pfx;blockquote" > +<!ENTITY % pre.qname "%XHTML.pfx;pre" > +<!ENTITY % h1.qname "%XHTML.pfx;h1" > +<!ENTITY % h2.qname "%XHTML.pfx;h2" > +<!ENTITY % h3.qname "%XHTML.pfx;h3" > +<!ENTITY % h4.qname "%XHTML.pfx;h4" > +<!ENTITY % h5.qname "%XHTML.pfx;h5" > +<!ENTITY % h6.qname "%XHTML.pfx;h6" > + +<!-- module: xhtml-blkpres-1.mod --> +<!ENTITY % hr.qname "%XHTML.pfx;hr" > + +<!-- module: xhtml-blkstruct-1.mod --> +<!ENTITY % div.qname "%XHTML.pfx;div" > +<!ENTITY % p.qname "%XHTML.pfx;p" > + +<!-- module: xhtml-edit-1.mod --> +<!ENTITY % ins.qname "%XHTML.pfx;ins" > +<!ENTITY % del.qname "%XHTML.pfx;del" > + +<!-- module: xhtml-form-1.mod --> +<!ENTITY % form.qname "%XHTML.pfx;form" > +<!ENTITY % label.qname "%XHTML.pfx;label" > +<!ENTITY % input.qname "%XHTML.pfx;input" > +<!ENTITY % select.qname "%XHTML.pfx;select" > +<!ENTITY % optgroup.qname "%XHTML.pfx;optgroup" > +<!ENTITY % option.qname "%XHTML.pfx;option" > +<!ENTITY % textarea.qname "%XHTML.pfx;textarea" > +<!ENTITY % fieldset.qname "%XHTML.pfx;fieldset" > +<!ENTITY % legend.qname "%XHTML.pfx;legend" > +<!ENTITY % button.qname "%XHTML.pfx;button" > + +<!-- module: xhtml-hypertext-1.mod --> +<!ENTITY % a.qname "%XHTML.pfx;a" > + +<!-- module: xhtml-image-1.mod --> +<!ENTITY % img.qname "%XHTML.pfx;img" > + +<!-- module: xhtml-inlphras-1.mod --> +<!ENTITY % abbr.qname "%XHTML.pfx;abbr" > +<!ENTITY % acronym.qname "%XHTML.pfx;acronym" > +<!ENTITY % cite.qname "%XHTML.pfx;cite" > +<!ENTITY % code.qname "%XHTML.pfx;code" > +<!ENTITY % dfn.qname "%XHTML.pfx;dfn" > +<!ENTITY % em.qname "%XHTML.pfx;em" > +<!ENTITY % kbd.qname "%XHTML.pfx;kbd" > +<!ENTITY % q.qname "%XHTML.pfx;q" > +<!ENTITY % samp.qname "%XHTML.pfx;samp" > +<!ENTITY % strong.qname "%XHTML.pfx;strong" > +<!ENTITY % var.qname "%XHTML.pfx;var" > + +<!-- module: xhtml-inlpres-1.mod --> +<!ENTITY % b.qname "%XHTML.pfx;b" > +<!ENTITY % big.qname "%XHTML.pfx;big" > +<!ENTITY % i.qname "%XHTML.pfx;i" > +<!ENTITY % small.qname "%XHTML.pfx;small" > +<!ENTITY % sub.qname "%XHTML.pfx;sub" > +<!ENTITY % sup.qname "%XHTML.pfx;sup" > +<!ENTITY % tt.qname "%XHTML.pfx;tt" > + +<!-- module: xhtml-inlstruct-1.mod --> +<!ENTITY % br.qname "%XHTML.pfx;br" > +<!ENTITY % span.qname "%XHTML.pfx;span" > + +<!-- module: xhtml-ismap-1.mod (also csismap, ssismap) --> +<!ENTITY % map.qname "%XHTML.pfx;map" > +<!ENTITY % area.qname "%XHTML.pfx;area" > + +<!-- module: xhtml-link-1.mod --> +<!ENTITY % link.qname "%XHTML.pfx;link" > + +<!-- module: xhtml-list-1.mod --> +<!ENTITY % dl.qname "%XHTML.pfx;dl" > +<!ENTITY % dt.qname "%XHTML.pfx;dt" > +<!ENTITY % dd.qname "%XHTML.pfx;dd" > +<!ENTITY % ol.qname "%XHTML.pfx;ol" > +<!ENTITY % ul.qname "%XHTML.pfx;ul" > +<!ENTITY % li.qname "%XHTML.pfx;li" > + +<!-- module: xhtml-meta-1.mod --> +<!ENTITY % meta.qname "%XHTML.pfx;meta" > + +<!-- module: xhtml-param-1.mod --> +<!ENTITY % param.qname "%XHTML.pfx;param" > + +<!-- module: xhtml-object-1.mod --> +<!ENTITY % object.qname "%XHTML.pfx;object" > + +<!-- module: xhtml-script-1.mod --> +<!ENTITY % script.qname "%XHTML.pfx;script" > +<!ENTITY % noscript.qname "%XHTML.pfx;noscript" > + +<!-- module: xhtml-struct-1.mod --> +<!ENTITY % html.qname "%XHTML.pfx;html" > +<!ENTITY % head.qname "%XHTML.pfx;head" > +<!ENTITY % title.qname "%XHTML.pfx;title" > +<!ENTITY % body.qname "%XHTML.pfx;body" > + +<!-- module: xhtml-style-1.mod --> +<!ENTITY % style.qname "%XHTML.pfx;style" > + +<!-- module: xhtml-table-1.mod --> +<!ENTITY % table.qname "%XHTML.pfx;table" > +<!ENTITY % caption.qname "%XHTML.pfx;caption" > +<!ENTITY % thead.qname "%XHTML.pfx;thead" > +<!ENTITY % tfoot.qname "%XHTML.pfx;tfoot" > +<!ENTITY % tbody.qname "%XHTML.pfx;tbody" > +<!ENTITY % colgroup.qname "%XHTML.pfx;colgroup" > +<!ENTITY % col.qname "%XHTML.pfx;col" > +<!ENTITY % tr.qname "%XHTML.pfx;tr" > +<!ENTITY % th.qname "%XHTML.pfx;th" > +<!ENTITY % td.qname "%XHTML.pfx;td" > + +<!-- module: xhtml-ruby-1.mod --> + +<!ENTITY % ruby.qname "%XHTML.pfx;ruby" > +<!ENTITY % rbc.qname "%XHTML.pfx;rbc" > +<!ENTITY % rtc.qname "%XHTML.pfx;rtc" > +<!ENTITY % rb.qname "%XHTML.pfx;rb" > +<!ENTITY % rt.qname "%XHTML.pfx;rt" > +<!ENTITY % rp.qname "%XHTML.pfx;rp" > + +<!-- Provisional XHTML 2.0 Qualified Names ...................... --> + +<!-- module: xhtml-image-2.mod --> +<!ENTITY % alt.qname "%XHTML.pfx;alt" > + +<!-- end of xhtml-qname-1.mod --> diff --git a/lv2specgen/DTD/xhtml-rdfa-1.dtd b/lv2specgen/DTD/xhtml-rdfa-1.dtd new file mode 100644 index 0000000..bd3479e --- /dev/null +++ b/lv2specgen/DTD/xhtml-rdfa-1.dtd @@ -0,0 +1,454 @@ +<!-- ....................................................................... --> +<!-- XHTML 1.1 + RDFa DTD ................................................. --> +<!-- file: xhtml-rdfa-1.dtd +--> + +<!-- XHTML 1.1 + RDFa DTD + + This is an example markup language combining XHTML 1.1 and the RDFa + modules. + + XHTML+RDFa + Copyright 1998-2008 World Wide Web Consortium + (Massachusetts Institute of Technology, European Research Consortium + for Informatics and Mathematics, Keio University). + All Rights Reserved. + + Permission to use, copy, modify and distribute the XHTML DTD and its + accompanying documentation for any purpose and without fee is hereby + granted in perpetuity, provided that the above copyright notice and + this paragraph appear in all copies. The copyright holders make no + representation about the suitability of the DTD for any purpose. + + It is provided "as is" without expressed or implied warranty. + +--> +<!-- This is the driver file for version 1 of the XHTML + RDFa DTD. + + Please use this public identifier to identify it: + + "-//W3C//DTD XHTML+RDFa 1.0//EN" +--> +<!ENTITY % XHTML.version "XHTML+RDFa 1.0" > + +<!-- Use this URI to identify the default namespace: + + "http://www.w3.org/1999/xhtml" + + See the Qualified Names module for information + on the use of namespace prefixes in the DTD. + + Note that XHTML namespace elements are not prefixed by default, + but the XHTML namespace prefix is defined as "xhtml" so that + other markup languages can extend this one and use the XHTML + prefixed global attributes if required. + +--> +<!ENTITY % NS.prefixed "IGNORE" > +<!ENTITY % XHTML.prefix "xhtml" > + +<!-- Be sure to include prefixed global attributes - we don't need + them, but languages that extend XHTML 1.1 might. +--> +<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" > + +<!-- Reserved for use with the XLink namespace: +--> +<!ENTITY % XLINK.xmlns "" > +<!ENTITY % XLINK.xmlns.attrib "" > + +<!-- For example, if you are using XHTML 1.1 directly, use the public + identifier in the DOCTYPE declaration, with the namespace declaration + on the document element to identify the default namespace: + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" + "xhtml-rdfa-1.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" + xml:lang="en"> + ... + </html> + + Revisions: + (none) +--> + +<!-- reserved for future use with document profiles --> +<!ENTITY % XHTML.profile "" > + +<!-- ensure XHTML Notations are disabled --> +<!ENTITY % xhtml-notations.module "IGNORE" > + +<!-- Bidirectional Text features + This feature-test entity is used to declare elements + and attributes used for bidirectional text support. +--> +<!ENTITY % XHTML.bidi "INCLUDE" > + +<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> + +<!-- Pre-Framework Redeclaration placeholder .................... --> +<!-- this serves as a location to insert markup declarations + into the DTD prior to the framework declarations. +--> +<!ENTITY % xhtml-prefw-redecl.module "IGNORE" > +<!ENTITY % xhtml-prefw-redecl.mod "" > +<![%xhtml-prefw-redecl.module;[ +%xhtml-prefw-redecl.mod; +<!-- end of xhtml-prefw-redecl.module -->]]> + +<!-- we need the datatypes now --> +<!ENTITY % xhtml-datatypes.module "INCLUDE" > +<![%xhtml-datatypes.module;[ +<!ENTITY % xhtml-datatypes.mod + PUBLIC "-//W3C//ENTITIES XHTML Datatypes 1.0//EN" + "xhtml-datatypes-1.mod" > +%xhtml-datatypes.mod;]]> + +<!-- bring in the RDFa attributes cause we need them in Common --> +<!ENTITY % xhtml-metaAttributes.module "INCLUDE" > +<![%xhtml-metaAttributes.module;[ +<!ENTITY % xhtml-metaAttributes.mod + PUBLIC "-//W3C//ENTITIES XHTML MetaAttributes 1.0//EN" + "xhtml-metaAttributes-1.mod" > +%xhtml-metaAttributes.mod;]]> + +<!ENTITY % xhtml-events.module "INCLUDE" > + +<!ENTITY % Common.extra.attrib + "href %URI.datatype; #IMPLIED + %Metainformation.attrib;" +> +<!-- adding the lang attribute into the I18N collection --> + +<!ENTITY % lang.attrib + "xml:lang %LanguageCode.datatype; #IMPLIED + lang %LanguageCode.datatype; #IMPLIED" +> + +<!-- Inline Style Module ........................................ --> +<!ENTITY % xhtml-inlstyle.module "INCLUDE" > +<![%xhtml-inlstyle.module;[ +<!ENTITY % xhtml-inlstyle.mod + PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN" + "xhtml-inlstyle-1.mod" > +%xhtml-inlstyle.mod;]]> + +<!-- declare Document Model module instantiated in framework +--> +<!ENTITY % xhtml-model.mod + PUBLIC "-//W3C//ENTITIES XHTML+RDFa Document Model 1.0//EN" + "xhtml-rdfa-model-1.mod" > + +<!-- Modular Framework Module (required) ......................... --> +<!ENTITY % xhtml-framework.module "INCLUDE" > +<![%xhtml-framework.module;[ +<!ENTITY % xhtml-framework.mod + PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN" + "xhtml-framework-1.mod" > +%xhtml-framework.mod;]]> + +<!-- Post-Framework Redeclaration placeholder ................... --> +<!-- this serves as a location to insert markup declarations + into the DTD following the framework declarations. +--> +<!ENTITY % xhtml-postfw-redecl.module "IGNORE" > +<!ENTITY % xhtml-postfw-redecl.mod ""> +<![%xhtml-postfw-redecl.module;[ +%xhtml-postfw-redecl.mod; +<!-- end of xhtml-postfw-redecl.module -->]]> + + + +<!-- Text Module (Required) ..................................... --> +<!ENTITY % xhtml-text.module "INCLUDE" > +<![%xhtml-text.module;[ +<!ENTITY % xhtml-text.mod + PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN" + "xhtml-text-1.mod" > +%xhtml-text.mod;]]> + +<!-- Hypertext Module (required) ................................. --> +<!ENTITY % a.attlist "IGNORE" > +<!ENTITY % xhtml-hypertext.module "INCLUDE" > +<![%xhtml-hypertext.module;[ +<!ENTITY % xhtml-hypertext.mod + PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN" + "xhtml-hypertext-1.mod" > +%xhtml-hypertext.mod;]]> +<!ATTLIST %a.qname; + %Common.attrib; + charset %Charset.datatype; #IMPLIED + type %ContentType.datatype; #IMPLIED + hreflang %LanguageCode.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED + tabindex %Number.datatype; #IMPLIED +> + +<!-- Lists Module (required) .................................... --> +<!ENTITY % xhtml-list.module "INCLUDE" > +<![%xhtml-list.module;[ +<!ENTITY % xhtml-list.mod + PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN" + "xhtml-list-1.mod" > +%xhtml-list.mod;]]> + +<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> + +<!-- Edit Module ................................................ --> +<!ENTITY % xhtml-edit.module "INCLUDE" > +<![%xhtml-edit.module;[ +<!ENTITY % xhtml-edit.mod + PUBLIC "-//W3C//ELEMENTS XHTML Editing Elements 1.0//EN" + "xhtml-edit-1.mod" > +%xhtml-edit.mod;]]> + +<!-- BIDI Override Module ....................................... --> +<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" > +<![%xhtml-bdo.module;[ +<!ENTITY % xhtml-bdo.mod + PUBLIC "-//W3C//ELEMENTS XHTML BIDI Override Element 1.0//EN" + "xhtml-bdo-1.mod" > +%xhtml-bdo.mod;]]> + +<!-- Ruby Module ................................................ --> +<!ENTITY % Ruby.common.attlists "INCLUDE" > +<!ENTITY % Ruby.common.attrib "%Common.attrib;" > +<!ENTITY % xhtml-ruby.module "INCLUDE" > +<![%xhtml-ruby.module;[ +<!ENTITY % xhtml-ruby.mod + PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN" + "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod" > +%xhtml-ruby.mod;]]> + +<!-- Presentation Module ........................................ --> +<!ENTITY % xhtml-pres.module "INCLUDE" > +<![%xhtml-pres.module;[ +<!ENTITY % xhtml-pres.mod + PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN" + "xhtml-pres-1.mod" > +%xhtml-pres.mod;]]> + +<!ENTITY % link.attlist "IGNORE" > +<!-- Link Element Module ........................................ --> +<!ENTITY % xhtml-link.module "INCLUDE" > +<![%xhtml-link.module;[ +<!ENTITY % xhtml-link.mod + PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN" + "xhtml-link-1.mod" > +%xhtml-link.mod;]]> + +<!ATTLIST %link.qname; + %Common.attrib; + charset %Charset.datatype; #IMPLIED + hreflang %LanguageCode.datatype; #IMPLIED + type %ContentType.datatype; #IMPLIED + media %MediaDesc.datatype; #IMPLIED +> + +<!-- Document Metainformation Module ............................ --> +<!ENTITY % meta.attlist "IGNORE" > +<!ENTITY % xhtml-meta.module "INCLUDE" > +<![%xhtml-meta.module;[ +<!ENTITY % xhtml-meta.mod + PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN" + "xhtml-meta-1.mod" > +%xhtml-meta.mod;]]> +<!ATTLIST %meta.qname; + %Common.attrib; + http-equiv NMTOKEN #IMPLIED + name NMTOKEN #IMPLIED + scheme CDATA #IMPLIED +> + +<!-- Base Element Module ........................................ --> +<!ENTITY % xhtml-base.module "INCLUDE" > +<![%xhtml-base.module;[ +<!ENTITY % xhtml-base.mod + PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN" + "xhtml-base-1.mod" > +%xhtml-base.mod;]]> + +<!-- Scripting Module ........................................... --> +<!ENTITY % script.attlist "IGNORE" > +<!ENTITY % xhtml-script.module "INCLUDE" > +<![%xhtml-script.module;[ +<!ENTITY % xhtml-script.mod + PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN" + "xhtml-script-1.mod" > +%xhtml-script.mod;]]> + +<!ATTLIST %script.qname; + %XHTML.xmlns.attrib; + %id.attrib; + %Metainformation.attrib; + href %URI.datatype; #IMPLIED + xml:space ( preserve ) #FIXED 'preserve' + charset %Charset.datatype; #IMPLIED + type %ContentType.datatype; #REQUIRED + src %URI.datatype; #IMPLIED + defer ( defer ) #IMPLIED +> + +<!-- Style Sheets Module ......................................... --> +<!ENTITY % style.attlist "IGNORE" > +<!ENTITY % xhtml-style.module "INCLUDE" > +<![%xhtml-style.module;[ +<!ENTITY % xhtml-style.mod + PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN" + "xhtml-style-1.mod" > +%xhtml-style.mod;]]> +<!ATTLIST %style.qname; + %XHTML.xmlns.attrib; + %id.attrib; + %title.attrib; + %I18n.attrib; + %Metainformation.attrib; + href %URI.datatype; #IMPLIED + xml:space ( preserve ) #FIXED 'preserve' + type %ContentType.datatype; #REQUIRED + media %MediaDesc.datatype; #IMPLIED +> + +<!-- Image Module ............................................... --> +<!ENTITY % xhtml-image.module "INCLUDE" > +<![%xhtml-image.module;[ +<!ENTITY % xhtml-image.mod + PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN" + "xhtml-image-1.mod" > +%xhtml-image.mod;]]> + +<!-- Client-side Image Map Module ............................... --> +<!ENTITY % area.attlist "IGNORE" > + +<!ENTITY % xhtml-csismap.module "INCLUDE" > +<![%xhtml-csismap.module;[ +<!ENTITY % xhtml-csismap.mod + PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN" + "xhtml-csismap-1.mod" > +%xhtml-csismap.mod;]]> + +<!ATTLIST %area.qname; + %Common.attrib; + shape %Shape.datatype; 'rect' + coords %Coords.datatype; #IMPLIED + nohref ( nohref ) #IMPLIED + alt %Text.datatype; #REQUIRED + tabindex %Number.datatype; #IMPLIED + accesskey %Character.datatype; #IMPLIED +> + +<!-- Server-side Image Map Module ............................... --> +<!ENTITY % xhtml-ssismap.module "INCLUDE" > +<![%xhtml-ssismap.module;[ +<!ENTITY % xhtml-ssismap.mod + PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN" + "xhtml-ssismap-1.mod" > +%xhtml-ssismap.mod;]]> + +<!-- Param Element Module ....................................... --> +<!ENTITY % param.attlist "IGNORE" > +<!ENTITY % xhtml-param.module "INCLUDE" > +<![%xhtml-param.module;[ +<!ENTITY % xhtml-param.mod + PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN" + "xhtml-param-1.mod" > +%xhtml-param.mod;]]> + +<!ATTLIST %param.qname; + %XHTML.xmlns.attrib; + %id.attrib; + %Metainformation.attrib; + href %URI.datatype; #IMPLIED + name CDATA #REQUIRED + value CDATA #IMPLIED + valuetype ( data | ref | object ) 'data' + type %ContentType.datatype; #IMPLIED +> +<!-- Embedded Object Module ..................................... --> +<!ENTITY % xhtml-object.module "INCLUDE" > +<![%xhtml-object.module;[ +<!ENTITY % xhtml-object.mod + PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN" + "xhtml-object-1.mod" > +%xhtml-object.mod;]]> + +<!-- Tables Module ............................................... --> +<!ENTITY % xhtml-table.module "INCLUDE" > +<![%xhtml-table.module;[ +<!ENTITY % xhtml-table.mod + PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN" + "xhtml-table-1.mod" > +%xhtml-table.mod;]]> + +<!-- Forms Module ............................................... --> +<!ENTITY % xhtml-form.module "INCLUDE" > +<![%xhtml-form.module;[ +<!ENTITY % xhtml-form.mod + PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN" + "xhtml-form-1.mod" > +%xhtml-form.mod;]]> + +<!-- Target Attribute Module .................................... --> +<!ENTITY % xhtml-target.module "INCLUDE" > +<![%xhtml-target.module;[ +<!ENTITY % xhtml-target.mod + PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN" + "xhtml-target-1.mod" > +%xhtml-target.mod;]]> + +<!-- Legacy Markup ............................................... --> +<!ENTITY % xhtml-legacy.module "IGNORE" > +<![%xhtml-legacy.module;[ +<!ENTITY % xhtml-legacy.mod + PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN" + "xhtml-legacy-1.mod" > +%xhtml-legacy.mod;]]> + +<!-- Document Structure Module (required) ....................... --> +<!ENTITY % html.attlist "IGNORE" > +<!ENTITY % head.attlist "IGNORE" > +<!ENTITY % title.attlist "IGNORE" > +<!ENTITY % xhtml-struct.module "INCLUDE" > +<![%xhtml-struct.module;[ +<!ENTITY % xhtml-struct.mod + PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN" + "xhtml-struct-1.mod" > +%xhtml-struct.mod;]]> +<!ENTITY % profile.attrib + "profile %URI.datatype; '%XHTML.profile;'" +> +<!ENTITY % XHTML.version.attrib + "version %FPI.datatype; #FIXED '%XHTML.version;'" +> +<!ATTLIST %html.qname; + %Common.attrib; + %XSI.schemaLocation.attrib; + %XHTML.version.attrib; +> +<!ATTLIST %head.qname; + %Common.attrib; + %profile.attrib; +> +<!ATTLIST %title.qname; + %Common.attrib; +> + +<!-- end of XHTML-RDFa DTD ................................................ --> +<!-- ....................................................................... --> + +<!-- 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:dcs 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:xsd CDATA #IMPLIED> diff --git a/lv2specgen/DTD/xhtml-rdfa-model-1.mod b/lv2specgen/DTD/xhtml-rdfa-model-1.mod new file mode 100644 index 0000000..ad010ee --- /dev/null +++ b/lv2specgen/DTD/xhtml-rdfa-model-1.mod @@ -0,0 +1,249 @@ +<!-- ....................................................................... --> +<!-- XHTML+RDFa Document Model Module ..................................... --> +<!-- file: xhtml-rdfa-model-1.mod + + This is XHTML+RDFa. + Copyright 1998-2008 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-rdfa-model-1.mod,v 1.4 2009/06/26 14:05:13 smccarro Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES XHTML+RDFa Document Model 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-model-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- XHTML+RDFa Document Model + + This module describes the groupings of elements that make up + common content models for XHTML elements. + + XHTML has three basic content models: + + %Inline.mix; character-level elements + %Block.mix; block-like elements, eg., paragraphs and lists + %Flow.mix; any block or inline elements + + Any parameter entities declared in this module may be used + to create element content models, but the above three are + considered 'global' (insofar as that term applies here). + + The reserved word '#PCDATA' (indicating a text string) is now + included explicitly with each element declaration that is + declared as mixed content, as XML requires that this token + occur first in a content model specification. +--> +<!-- Extending the Model + + While in some cases this module may need to be rewritten to + accommodate changes to the document model, minor extensions + may be accomplished by redeclaring any of the three *.extra; + parameter entities to contain extension element types as follows: + + %Misc.extra; whose parent may be any block or + inline element. + + %Inline.extra; whose parent may be any inline element. + + %Block.extra; whose parent may be any block element. + + If used, these parameter entities must be an OR-separated + list beginning with an OR separator ("|"), eg., "| a | b | c" + + All block and inline *.class parameter entities not part + of the *struct.class classes begin with "| " to allow for + exclusion from mixes. +--> + +<!-- .............. Optional Elements in head .................. --> + +<!ENTITY % HeadOpts.mix + "( %script.qname; | %style.qname; | %meta.qname; + | %link.qname; | %object.qname; )*" +> + +<!-- ................. Miscellaneous Elements .................. --> + +<!-- ins and del are used to denote editing changes +--> +<!ENTITY % Edit.class "| %ins.qname; | %del.qname;" > + +<!-- script and noscript are used to contain scripts + and alternative content +--> +<!ENTITY % Script.class "| %script.qname; | %noscript.qname;" > + +<!ENTITY % Misc.extra "" > + +<!-- These elements are neither block nor inline, and can + essentially be used anywhere in the document body. +--> +<!ENTITY % Misc.class + "%Edit.class; + %Script.class; + %Misc.extra;" +> + +<!-- .................... Inline Elements ...................... --> + +<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" > + +<!ENTITY % InlPhras.class + "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname; + | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname; + | %abbr.qname; | %acronym.qname; | %q.qname;" > + +<!ENTITY % InlPres.class + "| %tt.qname; | %i.qname; | %b.qname; | %big.qname; + | %small.qname; | %sub.qname; | %sup.qname;" > + +<!ENTITY % I18n.class "| %bdo.qname;" > + +<!ENTITY % Anchor.class "| %a.qname;" > + +<!ENTITY % InlSpecial.class + "| %img.qname; | %map.qname; + | %object.qname;" > + +<!ENTITY % InlForm.class + "| %input.qname; | %select.qname; | %textarea.qname; + | %label.qname; | %button.qname;" > + +<!ENTITY % Inline.extra "" > + +<!ENTITY % Ruby.class "| %ruby.qname;" > + +<!-- %Inline.class; includes all inline elements, + used as a component in mixes +--> +<!ENTITY % Inline.class + "%InlStruct.class; + %InlPhras.class; + %InlPres.class; + %I18n.class; + %Anchor.class; + %InlSpecial.class; + %InlForm.class; + %Ruby.class; + %Inline.extra;" +> + +<!-- %InlNoRuby.class; includes all inline elements + except ruby, used as a component in mixes +--> +<!ENTITY % InlNoRuby.class + "%InlStruct.class; + %InlPhras.class; + %InlPres.class; + %I18n.class; + %Anchor.class; + %InlSpecial.class; + %InlForm.class; + %Inline.extra;" +> + +<!-- %NoRuby.content; includes all inlines except ruby +--> +<!ENTITY % NoRuby.content + "( #PCDATA + | %InlNoRuby.class; + %Misc.class; )*" +> + +<!-- %InlNoAnchor.class; includes all non-anchor inlines, + used as a component in mixes +--> +<!ENTITY % InlNoAnchor.class + "%InlStruct.class; + %InlPhras.class; + %InlPres.class; + %I18n.class; + %InlSpecial.class; + %InlForm.class; + %Ruby.class; + %Inline.extra;" +> + +<!-- %InlNoAnchor.mix; includes all non-anchor inlines +--> +<!ENTITY % InlNoAnchor.mix + "%InlNoAnchor.class; + %Misc.class;" +> + +<!-- %Inline.mix; includes all inline elements, including %Misc.class; +--> +<!ENTITY % Inline.mix + "%Inline.class; + %Misc.class;" +> + +<!-- ..................... Block Elements ...................... --> + +<!-- In the HTML 4.0 DTD, heading and list elements were included + in the %block; parameter entity. The %Heading.class; and + %List.class; parameter entities must now be included explicitly + on element declarations where desired. +--> + +<!ENTITY % Heading.class + "%h1.qname; | %h2.qname; | %h3.qname; + | %h4.qname; | %h5.qname; | %h6.qname;" > + +<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" > + +<!ENTITY % Table.class "| %table.qname;" > + +<!ENTITY % Form.class "| %form.qname;" > + +<!ENTITY % Fieldset.class "| %fieldset.qname;" > + +<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" > + +<!ENTITY % BlkPhras.class + "| %pre.qname; | %blockquote.qname; | %address.qname;" > + +<!ENTITY % BlkPres.class "| %hr.qname; " > + +<!ENTITY % BlkSpecial.class + "%Table.class; + %Form.class; + %Fieldset.class;" +> + +<!ENTITY % Block.extra "" > + +<!-- %Block.class; includes all block elements, + used as an component in mixes +--> +<!ENTITY % Block.class + "%BlkStruct.class; + %BlkPhras.class; + %BlkPres.class; + %BlkSpecial.class; + %Block.extra;" +> + +<!-- %Block.mix; includes all block elements plus %Misc.class; +--> +<!ENTITY % Block.mix + "%Heading.class; + | %List.class; + | %Block.class; + %Misc.class;" +> + +<!-- ................ All Content Elements .................. --> + +<!-- %Flow.mix; includes all text content, block and inline +--> +<!ENTITY % Flow.mix + "%Heading.class; + | %List.class; + | %Block.class; + | %Inline.class; + %Misc.class;" +> +<!-- end of xhtml-rdfa-model-1.mod --> diff --git a/lv2specgen/DTD/xhtml-script-1.mod b/lv2specgen/DTD/xhtml-script-1.mod new file mode 100644 index 0000000..aa702f1 --- /dev/null +++ b/lv2specgen/DTD/xhtml-script-1.mod @@ -0,0 +1,67 @@ +<!-- ...................................................................... --> +<!-- XHTML Document Scripting Module ..................................... --> +<!-- file: xhtml-script-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-script-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Scripting + + script, noscript + + This module declares element types and attributes used to provide + support for executable scripts as well as an alternate content + container where scripts are not supported. +--> + +<!-- script: Scripting Statement ....................... --> + +<!ENTITY % script.element "INCLUDE" > +<![%script.element;[ +<!ENTITY % script.content "( #PCDATA )" > +<!ENTITY % script.qname "script" > +<!ELEMENT %script.qname; %script.content; > +<!-- end of script.element -->]]> + +<!ENTITY % script.attlist "INCLUDE" > +<![%script.attlist;[ +<!ATTLIST %script.qname; + %XHTML.xmlns.attrib; + %id.attrib; + xml:space ( preserve ) #FIXED 'preserve' + charset %Charset.datatype; #IMPLIED + type %ContentType.datatype; #REQUIRED + src %URI.datatype; #IMPLIED + defer ( defer ) #IMPLIED +> +<!-- end of script.attlist -->]]> + +<!-- noscript: No-Script Alternate Content ............. --> + +<!ENTITY % noscript.element "INCLUDE" > +<![%noscript.element;[ +<!ENTITY % noscript.content + "( %Block.mix; )+" +> +<!ENTITY % noscript.qname "noscript" > +<!ELEMENT %noscript.qname; %noscript.content; > +<!-- end of noscript.element -->]]> + +<!ENTITY % noscript.attlist "INCLUDE" > +<![%noscript.attlist;[ +<!ATTLIST %noscript.qname; + %Common.attrib; +> +<!-- end of noscript.attlist -->]]> + +<!-- end of xhtml-script-1.mod --> diff --git a/lv2specgen/DTD/xhtml-special.ent b/lv2specgen/DTD/xhtml-special.ent new file mode 100644 index 0000000..e76ce90 --- /dev/null +++ b/lv2specgen/DTD/xhtml-special.ent @@ -0,0 +1,89 @@ +<!-- ...................................................................... -->
+<!-- XML-compatible ISO Special Character Entity Set for XHTML ............ -->
+<!-- file: xhtml-lat1.ent
+
+ Typical invocation:
+
+ <!ENTITY % xhtml-special
+ PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" >
+ %xhtml-special;
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
+ SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"
+
+ Revision: $Id: xhtml-special.ent,v 1.1 2001/02/13 12:24:22 ht Exp $ SMI
+
+ Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with conforming
+ SGML systems and applications as defined in ISO 8879, provided
+ this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. CDATA values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode 2.0 names.
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!--<!ENTITY quot """ >--> <!-- quotation mark = APL quote, U+0022 ISOnum -->
+<!--<!ENTITY amp "&" >--> <!-- ampersand, U+0026 ISOnum -->
+<!--<!ENTITY lt "<" >--> <!-- less-than sign, U+003C ISOnum -->
+<!--<!ENTITY gt ">" >--> <!-- greater-than sign, U+003E ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig "Œ" ><!-- latin capital ligature OE, U+0152 ISOlat2 -->
+<!ENTITY oelig "œ" ><!-- latin small ligature oe, U+0153 ISOlat2 -->
+
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron "Š" ><!-- latin capital letter S with caron,
+ U+0160 ISOlat2 -->
+<!ENTITY scaron "š" ><!-- latin small letter s with caron,
+ U+0161 ISOlat2 -->
+<!ENTITY Yuml "Ÿ" ><!-- latin capital letter Y with diaeresis,
+ U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ "ˆ" ><!-- modifier letter circumflex accent,
+ U+02C6 ISOpub -->
+<!ENTITY tilde "˜" ><!-- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp " " ><!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp " " ><!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp " " ><!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj "‌" ><!-- zero width non-joiner,
+ U+200C NEW RFC 2070 -->
+<!ENTITY zwj "‍" ><!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm "‎" ><!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm "‏" ><!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash "–" ><!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash "—" ><!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo "‘" ><!-- left single quotation mark,
+ U+2018 ISOnum -->
+<!ENTITY rsquo "’" ><!-- right single quotation mark,
+ U+2019 ISOnum -->
+<!ENTITY sbquo "‚" ><!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo "“" ><!-- left double quotation mark,
+ U+201C ISOnum -->
+<!ENTITY rdquo "”" ><!-- right double quotation mark,
+ U+201D ISOnum -->
+<!ENTITY bdquo "„" ><!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger "†" ><!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger "‡" ><!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil "‰" ><!-- per mille sign, U+2030 ISOtech -->
+
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY lsaquo "‹" ><!-- single left-pointing angle quotation mark,
+ U+2039 ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo "›" ><!-- single right-pointing angle quotation mark,
+ U+203A ISO proposed -->
+<!ENTITY euro "€" ><!-- euro sign, U+20AC NEW -->
+
+<!-- end of xhtml-special.ent -->
diff --git a/lv2specgen/DTD/xhtml-ssismap-1.mod b/lv2specgen/DTD/xhtml-ssismap-1.mod new file mode 100644 index 0000000..ebc4468 --- /dev/null +++ b/lv2specgen/DTD/xhtml-ssismap-1.mod @@ -0,0 +1,32 @@ +<!-- ...................................................................... --> +<!-- XHTML Server-side Image Map Module .................................. --> +<!-- file: xhtml-ssismap-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-ssismap-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod" + + Revisions: +#2000-10-22: added declaration for 'ismap' on <input> + ....................................................................... --> + +<!-- Server-side Image Maps + + This adds the 'ismap' attribute to the img and input elements + to support server-side processing of a user selection. +--> + +<!ATTLIST %img.qname; + ismap ( ismap ) #IMPLIED +> + +<!ATTLIST %input.qname; + ismap ( ismap ) #IMPLIED +> + +<!-- end of xhtml-ssismap-1.mod --> diff --git a/lv2specgen/DTD/xhtml-struct-1.mod b/lv2specgen/DTD/xhtml-struct-1.mod new file mode 100644 index 0000000..4bb420e --- /dev/null +++ b/lv2specgen/DTD/xhtml-struct-1.mod @@ -0,0 +1,136 @@ +<!-- ...................................................................... --> +<!-- XHTML Structure Module .............................................. --> +<!-- file: xhtml-struct-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-struct-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Document Structure + + title, head, body, html + + The Structure Module defines the major structural elements and + their attributes. + + Note that the content model of the head element type is redeclared + when the Base Module is included in the DTD. + + The parameter entity containing the XML namespace URI value used + for XHTML is '%XHTML.xmlns;', defined in the Qualified Names module. +--> + +<!-- title: Document Title ............................. --> + +<!-- The title element is not considered part of the flow of text. + It should be displayed, for example as the page header or + window title. Exactly one title is required per document. +--> + +<!ENTITY % title.element "INCLUDE" > +<![%title.element;[ +<!ENTITY % title.content "( #PCDATA )" > +<!ENTITY % title.qname "title" > +<!ELEMENT %title.qname; %title.content; > +<!-- end of title.element -->]]> + +<!ENTITY % title.attlist "INCLUDE" > +<![%title.attlist;[ +<!ATTLIST %title.qname; + %XHTML.xmlns.attrib; + %I18n.attrib; +> +<!-- end of title.attlist -->]]> + +<!-- head: Document Head ............................... --> + +<!ENTITY % head.element "INCLUDE" > +<![%head.element;[ +<!ENTITY % head.content + "( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )" +> +<!ENTITY % head.qname "head" > +<!ELEMENT %head.qname; %head.content; > +<!-- end of head.element -->]]> + +<!ENTITY % head.attlist "INCLUDE" > +<![%head.attlist;[ +<!-- reserved for future use with document profiles +--> +<!ENTITY % profile.attrib + "profile %URIs.datatype; #IMPLIED" +> + +<!ATTLIST %head.qname; + %XHTML.xmlns.attrib; + %I18n.attrib; + %profile.attrib; + %id.attrib; +> +<!-- end of head.attlist -->]]> + +<!-- body: Document Body ............................... --> + +<!ENTITY % body.element "INCLUDE" > +<![%body.element;[ +<!ENTITY % body.content + "( %Block.mix; )*" +> +<!ENTITY % body.qname "body" > +<!ELEMENT %body.qname; %body.content; > +<!-- end of body.element -->]]> + +<!ENTITY % body.attlist "INCLUDE" > +<![%body.attlist;[ +<!ATTLIST %body.qname; + %Common.attrib; +> +<!-- end of body.attlist -->]]> + +<!-- html: XHTML Document Element ...................... --> + +<!ENTITY % html.element "INCLUDE" > +<![%html.element;[ +<!ENTITY % html.content "( %head.qname;, %body.qname; )" > +<!ENTITY % html.qname "html" > +<!ELEMENT %html.qname; %html.content; > +<!-- end of html.element -->]]> + +<![%XHTML.xsi.attrs;[ +<!-- define a parameter for the XSI schemaLocation attribute --> +<!ENTITY % XSI.schemaLocation.attrib + "%XSI.pfx;schemaLocation %URIs.datatype; #IMPLIED" +> +]]> +<!ENTITY % XSI.schemaLocation.attrib ""> + +<!ENTITY % html.attlist "INCLUDE" > +<![%html.attlist;[ +<!-- version attribute value defined in driver +--> +<!ENTITY % XHTML.version.attrib + "version %FPI.datatype; #FIXED '%XHTML.version;'" +> + +<!-- see the Qualified Names module for information + on how to extend XHTML using XML namespaces +--> +<!ATTLIST %html.qname; + %XHTML.xmlns.attrib; + %XSI.schemaLocation.attrib; + %XHTML.version.attrib; + %I18n.attrib; + %id.attrib; +> +<!-- end of html.attlist -->]]> + +<!-- end of xhtml-struct-1.mod --> diff --git a/lv2specgen/DTD/xhtml-style-1.mod b/lv2specgen/DTD/xhtml-style-1.mod new file mode 100644 index 0000000..3105b2a --- /dev/null +++ b/lv2specgen/DTD/xhtml-style-1.mod @@ -0,0 +1,48 @@ +<!-- ...................................................................... --> +<!-- XHTML Document Style Sheet Module ................................... --> +<!-- file: xhtml-style-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-style-1.mod,v 4.1 2001/04/05 06:57:40 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//DTD XHTML Style Sheets 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Style Sheets + + style + + This module declares the style element type and its attributes, + used to embed style sheet information in the document head element. +--> + +<!-- style: Style Sheet Information .................... --> + +<!ENTITY % style.element "INCLUDE" > +<![%style.element;[ +<!ENTITY % style.content "( #PCDATA )" > +<!ENTITY % style.qname "style" > +<!ELEMENT %style.qname; %style.content; > +<!-- end of style.element -->]]> + +<!ENTITY % style.attlist "INCLUDE" > +<![%style.attlist;[ +<!ATTLIST %style.qname; + %XHTML.xmlns.attrib; + %id.attrib; + %title.attrib; + %I18n.attrib; + xml:space ( preserve ) #FIXED 'preserve' + type %ContentType.datatype; #REQUIRED + media %MediaDesc.datatype; #IMPLIED +> +<!-- end of style.attlist -->]]> + +<!-- end of xhtml-style-1.mod --> diff --git a/lv2specgen/DTD/xhtml-symbol.ent b/lv2specgen/DTD/xhtml-symbol.ent new file mode 100644 index 0000000..f72df1f --- /dev/null +++ b/lv2specgen/DTD/xhtml-symbol.ent @@ -0,0 +1,235 @@ +<!-- ...................................................................... --> +<!-- ISO Math, Greek and Symbolic Character Entity Set for XHTML .......... --> +<!-- file: xhtml-lat1.ent + + Typical invocation: + + <!ENTITY % xhtml-symbol + PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" > + %xhtml-symbol; + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" + + Revision: $Id: xhtml-symbol.ent,v 1.1 2001/02/13 12:24:23 ht Exp $ SMI + + Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with conforming + SGML systems and applications as defined in ISO 8879, provided + this notice is included in all copies. +--> + +<!-- Relevant ISO entity set is given unless names are newly introduced. + New names (i.e., not in ISO 8879 list) do not clash with any + existing ISO 8879 entity names. ISO 10646 character numbers + are given for each character, in hex. CDATA values are decimal + conversions of the ISO 10646 values and refer to the document + character set. Names are Unicode 2.0 names. +--> + +<!-- Latin Extended-B --> +<!ENTITY fnof "ƒ" ><!-- latin small f with hook = function + = florin, U+0192 ISOtech --> + +<!-- Greek --> +<!ENTITY Alpha "Α" ><!-- greek capital letter alpha, U+0391 --> +<!ENTITY Beta "Β" ><!-- greek capital letter beta, U+0392 --> +<!ENTITY Gamma "Γ" ><!-- greek capital letter gamma, U+0393 ISOgrk3 --> +<!ENTITY Delta "Δ" ><!-- greek capital letter delta, U+0394 ISOgrk3 --> +<!ENTITY Epsilon "Ε" ><!-- greek capital letter epsilon, U+0395 --> +<!ENTITY Zeta "Ζ" ><!-- greek capital letter zeta, U+0396 --> +<!ENTITY Eta "Η" ><!-- greek capital letter eta, U+0397 --> +<!ENTITY Theta "Θ" ><!-- greek capital letter theta, U+0398 ISOgrk3 --> +<!ENTITY Iota "Ι" ><!-- greek capital letter iota, U+0399 --> +<!ENTITY Kappa "Κ" ><!-- greek capital letter kappa, U+039A --> +<!ENTITY Lambda "Λ" ><!-- greek capital letter lambda, U+039B ISOgrk3 --> +<!ENTITY Mu "Μ" ><!-- greek capital letter mu, U+039C --> +<!ENTITY Nu "Ν" ><!-- greek capital letter nu, U+039D --> +<!ENTITY Xi "Ξ" ><!-- greek capital letter xi, U+039E ISOgrk3 --> +<!ENTITY Omicron "Ο" ><!-- greek capital letter omicron, U+039F --> +<!ENTITY Pi "Π" ><!-- greek capital letter pi, U+03A0 ISOgrk3 --> +<!ENTITY Rho "Ρ" ><!-- greek capital letter rho, U+03A1 --> +<!-- there is no Sigmaf, and no U+03A2 character either --> +<!ENTITY Sigma "Σ" ><!-- greek capital letter sigma, U+03A3 ISOgrk3 --> +<!ENTITY Tau "Τ" ><!-- greek capital letter tau, U+03A4 --> +<!ENTITY Upsilon "Υ" ><!-- greek capital letter upsilon, + U+03A5 ISOgrk3 --> +<!ENTITY Phi "Φ" ><!-- greek capital letter phi, U+03A6 ISOgrk3 --> +<!ENTITY Chi "Χ" ><!-- greek capital letter chi, U+03A7 --> +<!ENTITY Psi "Ψ" ><!-- greek capital letter psi, U+03A8 ISOgrk3 --> +<!ENTITY Omega "Ω" ><!-- greek capital letter omega, U+03A9 ISOgrk3 --> +<!ENTITY alpha "α" ><!-- greek small letter alpha, U+03B1 ISOgrk3 --> +<!ENTITY beta "β" ><!-- greek small letter beta, U+03B2 ISOgrk3 --> +<!ENTITY gamma "γ" ><!-- greek small letter gamma, U+03B3 ISOgrk3 --> +<!ENTITY delta "δ" ><!-- greek small letter delta, U+03B4 ISOgrk3 --> +<!ENTITY epsilon "ε" ><!-- greek small letter epsilon, U+03B5 ISOgrk3 --> +<!ENTITY zeta "ζ" ><!-- greek small letter zeta, U+03B6 ISOgrk3 --> +<!ENTITY eta "η" ><!-- greek small letter eta, U+03B7 ISOgrk3 --> +<!ENTITY theta "θ" ><!-- greek small letter theta, U+03B8 ISOgrk3 --> +<!ENTITY iota "ι" ><!-- greek small letter iota, U+03B9 ISOgrk3 --> +<!ENTITY kappa "κ" ><!-- greek small letter kappa, U+03BA ISOgrk3 --> +<!ENTITY lambda "λ" ><!-- greek small letter lambda, U+03BB ISOgrk3 --> +<!ENTITY mu "μ" ><!-- greek small letter mu, U+03BC ISOgrk3 --> +<!ENTITY nu "ν" ><!-- greek small letter nu, U+03BD ISOgrk3 --> +<!ENTITY xi "ξ" ><!-- greek small letter xi, U+03BE ISOgrk3 --> +<!ENTITY omicron "ο" ><!-- greek small letter omicron, U+03BF NEW --> +<!ENTITY pi "π" ><!-- greek small letter pi, U+03C0 ISOgrk3 --> +<!ENTITY rho "ρ" ><!-- greek small letter rho, U+03C1 ISOgrk3 --> +<!ENTITY sigmaf "ς" ><!-- greek small letter final sigma, + U+03C2 ISOgrk3 --> +<!ENTITY sigma "σ" ><!-- greek small letter sigma, U+03C3 ISOgrk3 --> +<!ENTITY tau "τ" ><!-- greek small letter tau, U+03C4 ISOgrk3 --> +<!ENTITY upsilon "υ" ><!-- greek small letter upsilon, + U+03C5 ISOgrk3 --> +<!ENTITY phi "φ" ><!-- greek small letter phi, U+03C6 ISOgrk3 --> +<!ENTITY chi "χ" ><!-- greek small letter chi, U+03C7 ISOgrk3 --> +<!ENTITY psi "ψ" ><!-- greek small letter psi, U+03C8 ISOgrk3 --> +<!ENTITY omega "ω" ><!-- greek small letter omega, U+03C9 ISOgrk3 --> +<!ENTITY thetasym "ϑ" ><!-- greek small letter theta symbol, + U+03D1 NEW --> +<!ENTITY upsih "ϒ" ><!-- greek upsilon with hook symbol, + U+03D2 NEW --> +<!ENTITY piv "ϖ" ><!-- greek pi symbol, U+03D6 ISOgrk3 --> + +<!-- General Punctuation --> +<!ENTITY bull "•" ><!-- bullet = black small circle, + U+2022 ISOpub --> +<!-- bullet is NOT the same as bullet operator, U+2219 --> +<!ENTITY hellip "…" ><!-- horizontal ellipsis = three dot leader, + U+2026 ISOpub --> +<!ENTITY prime "′" ><!-- prime = minutes = feet, U+2032 ISOtech --> +<!ENTITY Prime "″" ><!-- double prime = seconds = inches, + U+2033 ISOtech --> +<!ENTITY oline "‾" ><!-- overline = spacing overscore, + U+203E NEW --> +<!ENTITY frasl "⁄" ><!-- fraction slash, U+2044 NEW --> + +<!-- Letterlike Symbols --> +<!ENTITY weierp "℘" ><!-- script capital P = power set + = Weierstrass p, U+2118 ISOamso --> +<!ENTITY image "ℑ" ><!-- blackletter capital I = imaginary part, + U+2111 ISOamso --> +<!ENTITY real "ℜ" ><!-- blackletter capital R = real part symbol, + U+211C ISOamso --> +<!ENTITY trade "™" ><!-- trade mark sign, U+2122 ISOnum --> +<!ENTITY alefsym "ℵ" ><!-- alef symbol = first transfinite cardinal, + U+2135 NEW --> +<!-- alef symbol is NOT the same as hebrew letter alef, + U+05D0 although the same glyph could be used to depict both characters --> + +<!-- Arrows --> +<!ENTITY larr "←" ><!-- leftwards arrow, U+2190 ISOnum --> +<!ENTITY uarr "↑" ><!-- upwards arrow, U+2191 ISOnum--> +<!ENTITY rarr "→" ><!-- rightwards arrow, U+2192 ISOnum --> +<!ENTITY darr "↓" ><!-- downwards arrow, U+2193 ISOnum --> +<!ENTITY harr "↔" ><!-- left right arrow, U+2194 ISOamsa --> +<!ENTITY crarr "↵" ><!-- downwards arrow with corner leftwards + = carriage return, U+21B5 NEW --> +<!ENTITY lArr "⇐" ><!-- leftwards double arrow, U+21D0 ISOtech --> +<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow + but also does not have any other character for that function. So ? lArr can + be used for 'is implied by' as ISOtech suggests --> +<!ENTITY uArr "⇑" ><!-- upwards double arrow, U+21D1 ISOamsa --> +<!ENTITY rArr "⇒" ><!-- rightwards double arrow, + U+21D2 ISOtech --> +<!-- Unicode does not say this is the 'implies' character but does not have + another character with this function so ? + rArr can be used for 'implies' as ISOtech suggests --> +<!ENTITY dArr "⇓" ><!-- downwards double arrow, U+21D3 ISOamsa --> +<!ENTITY hArr "⇔" ><!-- left right double arrow, + U+21D4 ISOamsa --> + +<!-- Mathematical Operators --> +<!ENTITY forall "∀" ><!-- for all, U+2200 ISOtech --> +<!ENTITY part "∂" ><!-- partial differential, U+2202 ISOtech --> +<!ENTITY exist "∃" ><!-- there exists, U+2203 ISOtech --> +<!ENTITY empty "∅" ><!-- empty set = null set = diameter, + U+2205 ISOamso --> +<!ENTITY nabla "∇" ><!-- nabla = backward difference, + U+2207 ISOtech --> +<!ENTITY isin "∈" ><!-- element of, U+2208 ISOtech --> +<!ENTITY notin "∉" ><!-- not an element of, U+2209 ISOtech --> +<!ENTITY ni "∋" ><!-- contains as member, U+220B ISOtech --> +<!-- should there be a more memorable name than 'ni'? --> +<!ENTITY prod "∏" ><!-- n-ary product = product sign, + U+220F ISOamsb --> +<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though + the same glyph might be used for both --> +<!ENTITY sum "∑" ><!-- n-ary sumation, U+2211 ISOamsb --> +<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma' + though the same glyph might be used for both --> +<!ENTITY minus "−" ><!-- minus sign, U+2212 ISOtech --> +<!ENTITY lowast "∗" ><!-- asterisk operator, U+2217 ISOtech --> +<!ENTITY radic "√" ><!-- square root = radical sign, + U+221A ISOtech --> +<!ENTITY prop "∝" ><!-- proportional to, U+221D ISOtech --> +<!ENTITY infin "∞" ><!-- infinity, U+221E ISOtech --> +<!ENTITY ang "∠" ><!-- angle, U+2220 ISOamso --> +<!ENTITY and "∧" ><!-- logical and = wedge, U+2227 ISOtech --> +<!ENTITY or "∨" ><!-- logical or = vee, U+2228 ISOtech --> +<!ENTITY cap "∩" ><!-- intersection = cap, U+2229 ISOtech --> +<!ENTITY cup "∪" ><!-- union = cup, U+222A ISOtech --> +<!ENTITY int "∫" ><!-- integral, U+222B ISOtech --> +<!ENTITY there4 "∴" ><!-- therefore, U+2234 ISOtech --> +<!ENTITY sim "∼" ><!-- tilde operator = varies with = similar to, + U+223C ISOtech --> +<!-- tilde operator is NOT the same character as the tilde, U+007E, + although the same glyph might be used to represent both --> +<!ENTITY cong "≅" ><!-- approximately equal to, U+2245 ISOtech --> +<!ENTITY asymp "≈" ><!-- almost equal to = asymptotic to, + U+2248 ISOamsr --> +<!ENTITY ne "≠" ><!-- not equal to, U+2260 ISOtech --> +<!ENTITY equiv "≡" ><!-- identical to, U+2261 ISOtech --> +<!ENTITY le "≤" ><!-- less-than or equal to, U+2264 ISOtech --> +<!ENTITY ge "≥" ><!-- greater-than or equal to, + U+2265 ISOtech --> +<!ENTITY sub "⊂" ><!-- subset of, U+2282 ISOtech --> +<!ENTITY sup "⊃" ><!-- superset of, U+2283 ISOtech --> +<!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol + font encoding and is not included. Should it be, for symmetry? + It is in ISOamsn --> +<!ENTITY nsub "⊄" ><!-- not a subset of, U+2284 ISOamsn --> +<!ENTITY sube "⊆" ><!-- subset of or equal to, U+2286 ISOtech --> +<!ENTITY supe "⊇" ><!-- superset of or equal to, + U+2287 ISOtech --> +<!ENTITY oplus "⊕" ><!-- circled plus = direct sum, + U+2295 ISOamsb --> +<!ENTITY otimes "⊗" ><!-- circled times = vector product, + U+2297 ISOamsb --> +<!ENTITY perp "⊥" ><!-- up tack = orthogonal to = perpendicular, + U+22A5 ISOtech --> +<!ENTITY sdot "⋅" ><!-- dot operator, U+22C5 ISOamsb --> +<!-- dot operator is NOT the same character as U+00B7 middle dot --> + +<!-- Miscellaneous Technical --> +<!ENTITY lceil "⌈" ><!-- left ceiling = apl upstile, + U+2308 ISOamsc --> +<!ENTITY rceil "⌉" ><!-- right ceiling, U+2309 ISOamsc --> +<!ENTITY lfloor "⌊" ><!-- left floor = apl downstile, + U+230A ISOamsc --> +<!ENTITY rfloor "⌋" ><!-- right floor, U+230B ISOamsc --> +<!ENTITY lang "〈" ><!-- left-pointing angle bracket = bra, + U+2329 ISOtech --> +<!-- lang is NOT the same character as U+003C 'less than' + or U+2039 'single left-pointing angle quotation mark' --> +<!ENTITY rang "〉" ><!-- right-pointing angle bracket = ket, + U+232A ISOtech --> +<!-- rang is NOT the same character as U+003E 'greater than' + or U+203A 'single right-pointing angle quotation mark' --> + +<!-- Geometric Shapes --> +<!ENTITY loz "◊" ><!-- lozenge, U+25CA ISOpub --> + +<!-- Miscellaneous Symbols --> +<!ENTITY spades "♠" ><!-- black spade suit, U+2660 ISOpub --> +<!-- black here seems to mean filled as opposed to hollow --> +<!ENTITY clubs "♣" ><!-- black club suit = shamrock, + U+2663 ISOpub --> +<!ENTITY hearts "♥" ><!-- black heart suit = valentine, + U+2665 ISOpub --> +<!ENTITY diams "♦" ><!-- black diamond suit, U+2666 ISOpub --> + +<!-- end of xhtml-symbol.ent --> diff --git a/lv2specgen/DTD/xhtml-table-1.mod b/lv2specgen/DTD/xhtml-table-1.mod new file mode 100644 index 0000000..4a59c35 --- /dev/null +++ b/lv2specgen/DTD/xhtml-table-1.mod @@ -0,0 +1,333 @@ +<!-- ...................................................................... --> +<!-- XHTML Table Module .................................................. --> +<!-- file: xhtml-table-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-table-1.mod,v 1.4 2008/10/08 21:02:31 jules Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Tables + + table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td + + This module declares element types and attributes used to provide + table markup similar to HTML 4, including features that enable + better accessibility for non-visual user agents. +--> + +<!-- declare qualified element type names: +--> +<!ENTITY % table.qname "table" > +<!ENTITY % caption.qname "caption" > +<!ENTITY % thead.qname "thead" > +<!ENTITY % tfoot.qname "tfoot" > +<!ENTITY % tbody.qname "tbody" > +<!ENTITY % colgroup.qname "colgroup" > +<!ENTITY % col.qname "col" > +<!ENTITY % tr.qname "tr" > +<!ENTITY % th.qname "th" > +<!ENTITY % td.qname "td" > + +<!-- The frame attribute specifies which parts of the frame around + the table should be rendered. The values are not the same as + CALS to avoid a name clash with the valign attribute. +--> +<!ENTITY % frame.attrib + "frame ( void + | above + | below + | hsides + | lhs + | rhs + | vsides + | box + | border ) #IMPLIED" +> + +<!-- The rules attribute defines which rules to draw between cells: + + If rules is absent then assume: + + "none" if border is absent or border="0" otherwise "all" +--> +<!ENTITY % rules.attrib + "rules ( none + | groups + | rows + | cols + | all ) #IMPLIED" +> + +<!-- horizontal alignment attributes for cell contents +--> +<!ENTITY % CellHAlign.attrib + "align ( left + | center + | right + | justify + | char ) #IMPLIED + char %Character.datatype; #IMPLIED + charoff %Length.datatype; #IMPLIED" +> + +<!-- vertical alignment attribute for cell contents +--> +<!ENTITY % CellVAlign.attrib + "valign ( top + | middle + | bottom + | baseline ) #IMPLIED" +> + +<!-- scope is simpler than axes attribute for common tables +--> +<!ENTITY % scope.attrib + "scope ( row + | col + | rowgroup + | colgroup ) #IMPLIED" +> + +<!-- table: Table Element .............................. --> + +<!ENTITY % table.element "INCLUDE" > +<![%table.element;[ +<!ENTITY % table.content + "( %caption.qname;?, ( %col.qname;* | %colgroup.qname;* ), + (( %thead.qname;?, %tfoot.qname;?, %tbody.qname;+ ) | ( %tr.qname;+ )))" +> +<!ELEMENT %table.qname; %table.content; > +<!-- end of table.element -->]]> + +<!ENTITY % table.attlist "INCLUDE" > +<![%table.attlist;[ +<!ATTLIST %table.qname; + %Common.attrib; + summary %Text.datatype; #IMPLIED + width %Length.datatype; #IMPLIED + border %Pixels.datatype; #IMPLIED + %frame.attrib; + %rules.attrib; + cellspacing %Length.datatype; #IMPLIED + cellpadding %Length.datatype; #IMPLIED +> +<!-- end of table.attlist -->]]> + +<!-- caption: Table Caption ............................ --> + +<!ENTITY % caption.element "INCLUDE" > +<![%caption.element;[ +<!ENTITY % caption.content + "( #PCDATA | %Inline.mix; )*" +> +<!ELEMENT %caption.qname; %caption.content; > +<!-- end of caption.element -->]]> + +<!ENTITY % caption.attlist "INCLUDE" > +<![%caption.attlist;[ +<!ATTLIST %caption.qname; + %Common.attrib; +> +<!-- end of caption.attlist -->]]> + +<!-- thead: Table Header ............................... --> + +<!-- Use thead to duplicate headers when breaking table + across page boundaries, or for static headers when + tbody sections are rendered in scrolling panel. +--> + +<!ENTITY % thead.element "INCLUDE" > +<![%thead.element;[ +<!ENTITY % thead.content "( %tr.qname; )+" > +<!ELEMENT %thead.qname; %thead.content; > +<!-- end of thead.element -->]]> + +<!ENTITY % thead.attlist "INCLUDE" > +<![%thead.attlist;[ +<!ATTLIST %thead.qname; + %Common.attrib; + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of thead.attlist -->]]> + +<!-- tfoot: Table Footer ............................... --> + +<!-- Use tfoot to duplicate footers when breaking table + across page boundaries, or for static footers when + tbody sections are rendered in scrolling panel. +--> + +<!ENTITY % tfoot.element "INCLUDE" > +<![%tfoot.element;[ +<!ENTITY % tfoot.content "( %tr.qname; )+" > +<!ELEMENT %tfoot.qname; %tfoot.content; > +<!-- end of tfoot.element -->]]> + +<!ENTITY % tfoot.attlist "INCLUDE" > +<![%tfoot.attlist;[ +<!ATTLIST %tfoot.qname; + %Common.attrib; + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of tfoot.attlist -->]]> + +<!-- tbody: Table Body ................................. --> + +<!-- Use multiple tbody sections when rules are needed + between groups of table rows. +--> + +<!ENTITY % tbody.element "INCLUDE" > +<![%tbody.element;[ +<!ENTITY % tbody.content "( %tr.qname; )+" > +<!ELEMENT %tbody.qname; %tbody.content; > +<!-- end of tbody.element -->]]> + +<!ENTITY % tbody.attlist "INCLUDE" > +<![%tbody.attlist;[ +<!ATTLIST %tbody.qname; + %Common.attrib; + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of tbody.attlist -->]]> + +<!-- colgroup: Table Column Group ...................... --> + +<!-- colgroup groups a set of col elements. It allows you + to group several semantically-related columns together. +--> + +<!ENTITY % colgroup.element "INCLUDE" > +<![%colgroup.element;[ +<!ENTITY % colgroup.content "( %col.qname; )*" > +<!ELEMENT %colgroup.qname; %colgroup.content; > +<!-- end of colgroup.element -->]]> + +<!ENTITY % colgroup.attlist "INCLUDE" > +<![%colgroup.attlist;[ +<!ATTLIST %colgroup.qname; + %Common.attrib; + span %Number.datatype; '1' + width %MultiLength.datatype; #IMPLIED + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of colgroup.attlist -->]]> + +<!-- col: Table Column ................................. --> + +<!-- col elements define the alignment properties for + cells in one or more columns. + + The width attribute specifies the width of the + columns, e.g. + + width="64" width in screen pixels + width="0.5*" relative width of 0.5 + + The span attribute causes the attributes of one + col element to apply to more than one column. +--> + +<!ENTITY % col.element "INCLUDE" > +<![%col.element;[ +<!ENTITY % col.content "EMPTY" > +<!ELEMENT %col.qname; %col.content; > +<!-- end of col.element -->]]> + +<!ENTITY % col.attlist "INCLUDE" > +<![%col.attlist;[ +<!ATTLIST %col.qname; + %Common.attrib; + span %Number.datatype; '1' + width %MultiLength.datatype; #IMPLIED + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of col.attlist -->]]> + +<!-- tr: Table Row ..................................... --> + +<!ENTITY % tr.element "INCLUDE" > +<![%tr.element;[ +<!ENTITY % tr.content "( %th.qname; | %td.qname; )+" > +<!ELEMENT %tr.qname; %tr.content; > +<!-- end of tr.element -->]]> + +<!ENTITY % tr.attlist "INCLUDE" > +<![%tr.attlist;[ +<!ATTLIST %tr.qname; + %Common.attrib; + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of tr.attlist -->]]> + +<!-- th: Table Header Cell ............................. --> + +<!-- th is for header cells, td for data, + but for cells acting as both use td +--> + +<!ENTITY % th.element "INCLUDE" > +<![%th.element;[ +<!ENTITY % th.content + "( #PCDATA | %Flow.mix; )*" +> +<!ELEMENT %th.qname; %th.content; > +<!-- end of th.element -->]]> + +<!ENTITY % th.attlist "INCLUDE" > +<![%th.attlist;[ +<!ATTLIST %th.qname; + %Common.attrib; + abbr %Text.datatype; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + %scope.attrib; + rowspan %Number.datatype; '1' + colspan %Number.datatype; '1' + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of th.attlist -->]]> + +<!-- td: Table Data Cell ............................... --> + +<!ENTITY % td.element "INCLUDE" > +<![%td.element;[ +<!ENTITY % td.content + "( #PCDATA | %Flow.mix; )*" +> +<!ELEMENT %td.qname; %td.content; > +<!-- end of td.element -->]]> + +<!ENTITY % td.attlist "INCLUDE" > +<![%td.attlist;[ +<!ATTLIST %td.qname; + %Common.attrib; + abbr %Text.datatype; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + %scope.attrib; + rowspan %Number.datatype; '1' + colspan %Number.datatype; '1' + %CellHAlign.attrib; + %CellVAlign.attrib; +> +<!-- end of td.attlist -->]]> + +<!-- end of xhtml-table-1.mod --> diff --git a/lv2specgen/DTD/xhtml-target-1.mod b/lv2specgen/DTD/xhtml-target-1.mod new file mode 100644 index 0000000..3739ef1 --- /dev/null +++ b/lv2specgen/DTD/xhtml-target-1.mod @@ -0,0 +1,53 @@ +<!-- ...................................................................... --> +<!-- XHTML Target Module ................................................. --> +<!-- file: xhtml-target-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-target-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Target + + target + + This module declares the 'target' attribute used for opening windows +--> + +<!-- render in this frame --> +<!ENTITY % FrameTarget.datatype "CDATA" > + +<!-- add 'target' attribute to 'a' element --> +<!ATTLIST %a.qname; + target %FrameTarget.datatype; #IMPLIED +> + +<!-- add 'target' attribute to 'area' element --> +<!ATTLIST %area.qname; + target %FrameTarget.datatype; #IMPLIED +> + +<!-- add 'target' attribute to 'link' element --> +<!ATTLIST %link.qname; + target %FrameTarget.datatype; #IMPLIED +> + +<!-- add 'target' attribute to 'form' element --> +<!ATTLIST %form.qname; + target %FrameTarget.datatype; #IMPLIED +> + +<!-- add 'target' attribute to 'base' element --> +<!ATTLIST %base.qname; + target %FrameTarget.datatype; #IMPLIED +> + +<!-- end of xhtml-target-1.mod --> diff --git a/lv2specgen/DTD/xhtml-text-1.mod b/lv2specgen/DTD/xhtml-text-1.mod new file mode 100644 index 0000000..07ccb81 --- /dev/null +++ b/lv2specgen/DTD/xhtml-text-1.mod @@ -0,0 +1,52 @@ +<!-- ...................................................................... --> +<!-- XHTML Text Module ................................................... --> +<!-- file: xhtml-text-1.mod + + This is XHTML, a reformulation of HTML as a modular XML application. + Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved. + Revision: $Id: xhtml-text-1.mod,v 4.0 2001/04/02 22:42:49 altheim Exp $ SMI + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN" + SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod" + + Revisions: + (none) + ....................................................................... --> + +<!-- Textual Content + + The Text module includes declarations for all core + text container elements and their attributes. +--> + +<!ENTITY % xhtml-inlstruct.module "INCLUDE" > +<![%xhtml-inlstruct.module;[ +<!ENTITY % xhtml-inlstruct.mod + PUBLIC "-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN" + "xhtml-inlstruct-1.mod" > +%xhtml-inlstruct.mod;]]> + +<!ENTITY % xhtml-inlphras.module "INCLUDE" > +<![%xhtml-inlphras.module;[ +<!ENTITY % xhtml-inlphras.mod + PUBLIC "-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN" + "xhtml-inlphras-1.mod" > +%xhtml-inlphras.mod;]]> + +<!ENTITY % xhtml-blkstruct.module "INCLUDE" > +<![%xhtml-blkstruct.module;[ +<!ENTITY % xhtml-blkstruct.mod + PUBLIC "-//W3C//ELEMENTS XHTML Block Structural 1.0//EN" + "xhtml-blkstruct-1.mod" > +%xhtml-blkstruct.mod;]]> + +<!ENTITY % xhtml-blkphras.module "INCLUDE" > +<![%xhtml-blkphras.module;[ +<!ENTITY % xhtml-blkphras.mod + PUBLIC "-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN" + "xhtml-blkphras-1.mod" > +%xhtml-blkphras.mod;]]> + +<!-- end of xhtml-text-1.mod --> diff --git a/lv2specgen/footer.html b/lv2specgen/footer.html deleted file mode 100644 index 5259e4c..0000000 --- a/lv2specgen/footer.html +++ /dev/null @@ -1,22 +0,0 @@ - <span about="" resource="http://www.w3.org/TR/rdfa-syntax" - rel="dct:conformsTo"> - <a href="http://validator.w3.org/check?uri=referer"> - <img style="border:0;width:88px;height:31px" - src="http://www.w3.org/Icons/valid-xhtml-rdfa-blue" - alt="Valid XHTML + RDFa"/> - </a> - </span> - <span about="" resource="http://www.w3.org/TR/CSS2" - rel="dct:conformsTo"> - <a href="http://jigsaw.w3.org/css-validator/check/referer"> - <img style="border:0;width:88px;height:31px" - src="http://jigsaw.w3.org/css-validator/images/vcss-blue" - alt="Valid CSS"/></a> - </span> - <span about=""> - <a about="" rel="license" href="http://creativecommons.org/licenses/by/3.0/"> - <img alt="Creative Commons Attribution 3.0 Unported License" - style="border-width:0;width:88px;height:31px" - src="http://i.creativecommons.org/l/by/3.0/88x31.png" /> - </a> - </span> diff --git a/lv2specgen/lv2docgen.py b/lv2specgen/lv2docgen.py new file mode 100755 index 0000000..c5e13a7 --- /dev/null +++ b/lv2specgen/lv2docgen.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# lv2docgen, a documentation generator for LV2 plugins +# 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. + +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" + +try: + import rdflib +except ImportError: + 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#") + + +def uri_to_path(uri): + 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 "" + + +def port_doc(model, port): + name = model.value(port, lv2.name, None) + html = '<div class="specterm"><h3>%s</h3>' % name + html += get_doc(model, port) + html += "</div>" + return html + + +def plugin_doc(model, plugin, style_uri): + uri = str(plugin) + name = model.value(plugin, doap.name, None) + + 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, + dtd, + ) + + 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, + ) + + html += """ + <!-- HEADER --> + <div id="header"> + <h1 id="title">%s</h1> + <table id="meta"> + <tr><th>URI</th><td><a href="%s">%s</a></td></tr> + <tr><th>Version</th><td>%s</td></tr> + </table> + </div> +""" % ( + name, + uri, + uri, + "0.0.0", + ) + + html += get_doc(model, plugin) + + ports_html = "" + for p in model.triples([plugin, lv2.port, None]): + ports_html += port_doc(model, p[2]) + + if len(ports_html): + html += ( + """ + <h2 class="sec">Ports</h2> + <div class="content"> +%s + </div>""" + % ports_html + ) + + html += " </body></html>" + return html + + +if __name__ == "__main__": + "LV2 plugin documentation generator" + + if len(sys.argv) < 2: + 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") + + 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") + try: + os.makedirs(os.path.dirname(outpath)) + except OSError: + e = sys.exc_info()[1] + if e.errno == errno.EEXIST: + pass + else: + raise + + 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 bb901f9..3345b5a 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -1,27 +1,27 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# lv2specgen, an LV2 extension specification page generator -# Copyright (c) 2009 David Robillard <d@drobilla.net> +# lv2specgen, a documentation generator for LV2 specifications. +# Copyright (c) 2009-2014 David Robillard <d@drobilla.net> # # 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 @@ -30,462 +30,890 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -__version__ = "1.0.0" -__authors__ = "Christopher Schmidt, Uldis Bojars, Sergio Fernández, David Robillard" -__license__ = "MIT License <http://www.opensource.org/licenses/mit-license.php>" -__contact__ = "devel@lists.lv2plug.in" -__date__ = "2009-06-11" - -import os -import sys import datetime +import markdown +import markdown.extensions +import optparse +import os import re -import urllib +import sys +import time +import xml.sax.saxutils +import xml.dom +import xml.dom.minidom + +__date__ = "2011-10-26" +__version__ = __date__.replace("-", ".") +__authors__ = """ +Christopher Schmidt, +Uldis Bojars, +Sergio Fernández, +David Robillard""" +__license__ = "MIT License <http://www.opensource.org/licenses/mit>" +__contact__ = "devel@lists.lv2plug.in" + +try: + from lxml import etree + + have_lxml = True +except Exception: + have_lxml = False try: - import RDF - import Redland + import pygments + import pygments.lexers + import pygments.lexers.rdf + import pygments.formatters + + have_pygments = True except ImportError: - version = sys.version.split(" ")[0] - if version.startswith("2.5"): - sys.path.append("/usr/lib/python2.4/site-packages/") - else: - sys.path.append("/usr/lib/python2.5/site-packages/") - try: - import RDF - except: - sys.exit("Error importing Redland bindings for Python; check if it is installed correctly") + print("Error importing pygments, syntax highlighting disabled") + have_pygments = False + +try: + import rdflib +except ImportError: + sys.exit("Error importing rdflib") -#global vars +# Global Variables classranges = {} classdomains = {} +linkmap = {} spec_url = None spec_ns_str = None spec_ns = None spec_pre = None -ns_list = { "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" - } - -rdf = RDF.NS('http://www.w3.org/1999/02/22-rdf-syntax-ns#') -rdfs = RDF.NS('http://www.w3.org/2000/01/rdf-schema#') -owl = RDF.NS('http://www.w3.org/2002/07/owl#') -lv2 = RDF.NS('http://lv2plug.in/ns/lv2core#') -doap = RDF.NS('http://usefulinc.com/ns/doap#') -foaf = RDF.NS('http://xmlns.com/foaf/0.1/') +spec_bundle = None +specgendir = None +ns_list = { + "http://ontologi.es/doap-changeset#": "dcs", + "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/2001/XMLSchema#": "xsd", +} + +rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") +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/") + + +def findStatements(model, s, p, o): + return model.triples([s, p, o]) + + +def findOne(m, s, p, o): + triples = findStatements(m, s, p, o) + try: + return sorted(triples)[0] + except Exception: + return None + + +def getSubject(s): + return s[0] + + +def getPredicate(s): + return s[1] + + +def getObject(s): + return s[2] + + +def getLiteralString(s): + return s + + +def isResource(n): + return type(n) == rdflib.URIRef + + +def isBlank(n): + return type(n) == rdflib.BNode + + +def isLiteral(n): + return type(n) == rdflib.Literal def niceName(uri): - regexp = re.compile( "^(.*[/#])([^/#]+)$" ) - rez = regexp.search( uri ) + global spec_bundle + if uri.startswith(spec_ns_str): + return uri.replace(spec_ns_str, "") + elif uri == str(rdfs.seeAlso): + return "See also" + + regexp = re.compile("^(.*[/#])([^/#]+)$") + rez = regexp.search(uri) if not rez: return uri pref = rez.group(1) - if ns_list.has_key(pref): + if pref in ns_list: return ns_list.get(pref, pref) + ":" + rez.group(2) else: return uri -def return_name(m, urinode): +def termName(m, urinode): "Trims the namespace out of a term to give a name to the term." - return str(urinode.uri).replace(spec_ns_str, "") - - -def get_rdfs(m, urinode): - "Returns label and comment given an RDF.Node with a URI in it" - comment = '' - label = '' - if (type(urinode)==str): - urinode = RDF.Uri(urinode) - l = m.find_statements(RDF.Statement(urinode, rdfs.label, None)) - if l.current(): - label = l.current().object.literal_value['string'] - c = m.find_statements(RDF.Statement(urinode, rdfs.comment, None)) - if c.current(): - comment = c.current().object.literal_value['string'] - return label, comment - - -def owlVersionInfo(m): - v = m.find_statements(RDF.Statement(None, owl.versionInfo, None)) - if v.current(): - return v.current().object.literal_value['string'] + return str(urinode).replace(spec_ns_str, "") + + +def getLabel(m, urinode): + statement = findOne(m, urinode, rdfs.label, None) + if statement: + return getLiteralString(getObject(statement)) + else: + return "" + + +def linkifyCodeIdentifiers(string): + "Add links to code documentation for identifiers like LV2_Type" + + if linkmap == {}: + return string + + if string in linkmap.keys(): + # Exact match for complete string + return linkmap[string] + + rgx = re.compile( + "([^a-zA-Z0-9_:])(" + + "|".join(map(re.escape, linkmap)) + + ")([^a-zA-Z0-9_:])" + ) + + def translateCodeLink(match): + return match.group(1) + linkmap[match.group(2)] + match.group(3) + + return rgx.sub(translateCodeLink, string) + + +def linkifyVocabIdentifiers(m, string, classlist, proplist, instalist): + "Add links to vocabulary documentation for prefixed names like eg:Thing" + + rgx = re.compile("([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)") + namespaces = getNamespaces(m) + + def translateLink(match): + text = match.group(0) + prefix = match.group(1) + name = match.group(2) + uri = rdflib.URIRef(spec_ns + name) + if prefix == spec_pre: + if not ( + (classlist and uri in classlist) + or (instalist and uri in instalist) + or (proplist and uri in proplist) + ): + print("warning: Link to undefined resource <%s>\n" % text) + return '<a href="#%s">%s</a>' % (name, name) + elif prefix in namespaces: + return '<a href="%s">%s</a>' % ( + namespaces[match.group(1)] + match.group(2), + match.group(0), + ) + else: + return text + + return rgx.sub(translateLink, string) + + +def prettifyHtml(m, markup, subject, classlist, proplist, instalist): + # Syntax highlight all C code + if have_pygments: + code_re = re.compile('<pre class="c-code">(.*?)</pre>', re.DOTALL) + while True: + code = code_re.search(markup) + if not code: + break + match_str = xml.sax.saxutils.unescape(code.group(1)) + code_str = pygments.highlight( + match_str, + pygments.lexers.CLexer(), + pygments.formatters.HtmlFormatter(), + ) + markup = code_re.sub(code_str, markup, 1) + + # Syntax highlight all Turtle code + if have_pygments: + code_re = re.compile('<pre class="turtle-code">(.*?)</pre>', re.DOTALL) + while True: + code = code_re.search(markup) + if not code: + break + match_str = xml.sax.saxutils.unescape(code.group(1)) + code_str = pygments.highlight( + match_str, + pygments.lexers.rdf.TurtleLexer(), + pygments.formatters.HtmlFormatter(), + ) + markup = code_re.sub(code_str, markup, 1) + + # Add links to code documentation for identifiers + markup = linkifyCodeIdentifiers(markup) + + # Add internal links for known prefixed names + markup = linkifyVocabIdentifiers(m, markup, classlist, proplist, instalist) + + # Transform names like #foo into links into this spec if possible + rgx = re.compile("([ \t\n\r\f\v^]+)#([a-zA-Z0-9_-]+)") + + def translateLocalLink(match): + text = match.group(0) + space = match.group(1) + name = match.group(2) + uri = rdflib.URIRef(spec_ns + name) + if ( + (classlist and uri in classlist) + or (instalist and uri in instalist) + or (proplist and uri in proplist) + ): + return '%s<a href="#%s">%s</a>' % (space, name, name) + else: + print("warning: Link to undefined resource <%s>\n" % name) + return text + + markup = rgx.sub(translateLocalLink, markup) + + if not have_lxml: + print("warning: No Python lxml module found, output may be invalid") + else: + try: + # Parse and validate documentation as XHTML Basic 1.1 + doc = ( + """<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" + "DTD/xhtml-basic11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head xml:lang="en" profile="profile"> + <title>Validation Skeleton Document</title> + </head> + <body> +""" + + markup + + """ + </body> +</html>""" + ) + + oldcwd = os.getcwd() + os.chdir(specgendir) + parser = etree.XMLParser(dtd_validation=True, no_network=True) + etree.fromstring(doc.encode("utf-8"), parser) + except Exception as e: + print("Invalid documentation for %s\n%s" % (subject, e)) + line_num = 1 + for line in doc.split("\n"): + print("%3d: %s" % (line_num, line)) + line_num += 1 + finally: + os.chdir(oldcwd) + + return markup + + +def formatDoc(m, urinode, literal, classlist, proplist, instalist): + string = getLiteralString(literal) + + if literal.datatype == lv2.Markdown: + ext = [ + "markdown.extensions.codehilite", + "markdown.extensions.tables", + "markdown.extensions.def_list", + ] + + doc = markdown.markdown(string, extensions=ext) + + # Hack to make tables valid XHTML Basic 1.1 + for tag in ["thead", "tbody"]: + doc = doc.replace("<%s>\n" % tag, "") + doc = doc.replace("</%s>\n" % tag, "") + + return prettifyHtml(m, doc, urinode, classlist, proplist, instalist) + else: + doc = xml.sax.saxutils.escape(string) + doc = linkifyCodeIdentifiers(doc) + doc = linkifyVocabIdentifiers(m, doc, classlist, proplist, instalist) + return "<p>%s</p>" % doc + + +def getComment(m, subject, classlist, proplist, instalist): + c = findOne(m, subject, rdfs.comment, None) + if c: + comment = getObject(c) + return formatDoc(m, subject, comment, classlist, proplist, instalist) + + return "" + + +def getDetailedDocumentation(m, subject, classlist, proplist, instalist): + markup = "" + + d = findOne(m, subject, lv2.documentation, None) + if d: + doc = getObject(d) + if doc.datatype == lv2.Markdown: + markup += formatDoc( + m, subject, doc, classlist, proplist, instalist + ) + else: + html = getLiteralString(doc) + markup += prettifyHtml( + m, html, subject, classlist, proplist, instalist + ) + + return markup + + +def getFullDocumentation(m, subject, classlist, proplist, instalist): + # Use rdfs:comment for first summary line + markup = getComment(m, subject, classlist, proplist, instalist) + + # Use lv2:documentation for further details + markup += getDetailedDocumentation( + m, subject, classlist, proplist, instalist + ) + + return markup + + +def getProperty(val, first=True): + "Return a string representing a property value in a property table" + doc = "" + if not first: + doc += "<tr><th></th>" # Empty cell in header column + doc += "<td>%s</td></tr>\n" % val + return doc + + +def endProperties(first): + if first: + return "</tr>" else: return "" -def rdfsPropertyInfo(term,m): +def rdfsPropertyInfo(term, m): """Generate HTML for properties: Domain, range""" global classranges global classdomains doc = "" - range = "" - domain = "" + + label = getLabel(m, term) + if label != "": + doc += "<tr><th>Label</th><td>%s</td></tr>" % label # Find subPropertyOf information - o = m.find_statements( RDF.Statement(term, rdfs.subPropertyOf, None) ) - if o.current(): - rlist = '' - for st in o: - k = getTermLink(str(st.object.uri), term, rdfs.subPropertyOf) - rlist += "<dd>%s</dd>" % k - doc += "<dt>Sub-property of</dt> %s" % rlist + rlist = "" + first = True + for st in findStatements(m, term, rdfs.subPropertyOf, None): + k = getTermLink(getObject(st), term, rdfs.subPropertyOf) + rlist += getProperty(k, first) + first = False + if rlist != "": + doc += "<tr><th>Sub-property of</th>" + rlist # Domain stuff - domains = m.find_statements(RDF.Statement(term, rdfs.domain, None)) + domains = findStatements(m, term, rdfs.domain, None) domainsdoc = "" - for d in domains: - collection = m.find_statements(RDF.Statement(d.object, owl.unionOf, None)) - if collection.current(): - uris = parseCollection(m, collection) + first = True + for d in sorted(domains): + union = findOne(m, getObject(d), owl.unionOf, None) + if union: + uris = parseCollection(m, getObject(union)) for uri in uris: - domainsdoc += "<dd>%s</dd>" % getTermLink(uri, term, rdfs.domain) - add(classdomains, uri, term.uri) + domainsdoc += getProperty( + getTermLink(uri, term, rdfs.domain), first + ) + add(classdomains, uri, term) else: - if not d.object.is_blank(): - domainsdoc += "<dd>%s</dd>" % getTermLink(str(d.object.uri), term, rdfs.domain) - if (len(domainsdoc)>0): - doc += "<dt>Domain</dt> %s" % domainsdoc + if not isBlank(getObject(d)): + domainsdoc += getProperty( + getTermLink(getObject(d), term, rdfs.domain), first + ) + first = False + if len(domainsdoc) > 0: + doc += "<tr><th>Domain</th>%s" % domainsdoc # Range stuff - ranges = m.find_statements(RDF.Statement(term, rdfs.range, None)) + ranges = findStatements(m, term, rdfs.range, None) rangesdoc = "" - for r in ranges: - collection = m.find_statements(RDF.Statement(r.object, owl.unionOf, None)) - if collection.current(): - uris = parseCollection(m, collection) + first = True + for r in sorted(ranges): + union = findOne(m, getObject(r), owl.unionOf, None) + if union: + uris = parseCollection(m, getObject(union)) for uri in uris: - rangesdoc += "<dd>%s</dd>" % getTermLink(uri, term, rdfs.range) - add(classranges, uri, term.uri) + rangesdoc += getProperty( + getTermLink(uri, term, rdfs.range), first + ) + add(classranges, uri, term) + first = False else: - if not r.object.is_blank(): - rangesdoc += "<dd>%s</dd>" % getTermLink(str(r.object.uri), term, rdfs.range) - if (len(rangesdoc)>0): - doc += "<dt>Range</dt> %s" % rangesdoc + if not isBlank(getObject(r)): + rangesdoc += getProperty( + getTermLink(getObject(r), term, rdfs.range), first + ) + first = False + if len(rangesdoc) > 0: + doc += "<tr><th>Range</th>%s" % rangesdoc return doc -def parseCollection(model, collection): +def parseCollection(model, node): uris = [] - rdflist = model.find_statements(RDF.Statement(collection.current().object, None, None)) - while rdflist and rdflist.current() and not rdflist.current().object.is_blank(): - one = rdflist.current() - if not one.object.is_blank(): - uris.append(str(one.object.uri)) - rdflist.next() - one = rdflist.current() - if one.predicate == rdf.rest: - rdflist = model.find_statements(RDF.Statement(one.object, None, None)) - + + while node: + first = findOne(model, node, rdf.first, None) + rest = findOne(model, node, rdf.rest, None) + if not first or not rest: + break + + uris.append(getObject(first)) + node = getObject(rest) + return uris def getTermLink(uri, subject=None, predicate=None): uri = str(uri) - extra = '' - if subject != None and predicate != None: - extra = 'about="%s" rel="%s" resource="%s"' % (str(subject.uri), niceName(str(predicate.uri)), uri) - if (uri.startswith(spec_ns_str)): - return '<a href="#%s" style="font-family: monospace;" %s>%s</a>' % (uri.replace(spec_ns_str, ""), extra, niceName(uri)) + extra = "" + if subject is not None and predicate is not None: + extra = 'about="%s" rel="%s" resource="%s"' % ( + str(subject), + niceName(str(predicate)), + uri, + ) + if uri.startswith(spec_ns_str): + return '<a href="#%s" %s>%s</a>' % ( + uri.replace(spec_ns_str, ""), + extra, + niceName(uri), + ) else: - return '<a href="%s" style="font-family: monospace;" %s>%s</a>' % (uri, extra, niceName(uri)) + return '<a href="%s" %s>%s</a>' % (uri, extra, niceName(uri)) + +def owlRestrictionInfo(term, m): + """Generate OWL restriction information for Classes""" + restrictions = [] + for s in findStatements(m, term, rdfs.subClassOf, None): + if findOne(m, getObject(s), rdf.type, owl.Restriction): + restrictions.append(getObject(s)) + + if not restrictions: + return "" -def rdfsClassInfo(term,m): + doc = "<dl>" + + for r in sorted(restrictions): + props = findStatements(m, r, None, None) + onProp = None + comment = None + for p in props: + if getPredicate(p) == owl.onProperty: + onProp = getObject(p) + elif getPredicate(p) == rdfs.comment: + comment = getObject(p) + if onProp is not None: + doc += "<dt>Restriction on %s</dt>\n" % getTermLink(onProp) + + prop_str = "" + for p in findStatements(m, r, None, None): + if ( + getPredicate(p) == owl.onProperty + or getPredicate(p) == rdfs.comment + or ( + getPredicate(p) == rdf.type + and getObject(p) == owl.Restriction + ) + or getPredicate(p) == lv2.documentation + ): + continue + + prop_str += getTermLink(getPredicate(p)) + + if isResource(getObject(p)): + prop_str += " " + getTermLink(getObject(p)) + elif isLiteral(getObject(p)): + prop_str += " " + getLiteralString(getObject(p)) + + if comment is not None: + prop_str += "\n<div>%s</div>\n" % getLiteralString(comment) + + doc += "<dd>%s</dd>" % prop_str if prop_str else "" + + doc += "</dl>" + return doc + + +def rdfsClassInfo(term, m): """Generate rdfs-type information for Classes: ranges, and domains.""" global classranges global classdomains doc = "" - # Find subClassOf information - o = m.find_statements( RDF.Statement(term, rdfs.subClassOf, None) ) - restrictions = [] - if o.current(): - superclasses = [] - for st in o: - if not st.object.is_blank(): - uri = str(st.object.uri) - if (not uri in superclasses): - superclasses.append(uri) - else: - meta_types = m.find_statements(RDF.Statement(o.current().object, rdf.type, None)) - restrictions.append(meta_types.current().subject) - - if len(superclasses) > 0: - doc += "\n<dt>Sub-class of</dt>" - for superclass in superclasses: - doc += "<dd>%s</dd>" % getTermLink(superclass) - - for r in restrictions: - props = m.find_statements(RDF.Statement(r, None, None)) - onProp = None - comment = None - for p in props: - if p.predicate == owl.onProperty: - onProp = p.object - elif p.predicate == rdfs.comment: - comment = p.object - if onProp != None: - doc += '<dt>Restriction on property %s</dt>\n' % getTermLink(onProp.uri) - doc += '<dd class="restriction">\n' - if comment != None: - doc += "<p>%s</p>\n" % comment - - prop_str = '' - for p in m.find_statements(RDF.Statement(r, None, None)): - if p.predicate != owl.onProperty and p.predicate != rdfs.comment and not( - p.predicate == rdf.type and p.object == owl.Restriction): - if p.object.is_resource(): - prop_str += '\n<dt>%s</dt><dd>%s</dd>\n' % ( - getTermLink(p.predicate.uri), getTermLink(p.object.uri)) - elif p.object.is_literal(): - prop_str += '\n<dt>%s</dt><dd>%s</dd>\n' % ( - getTermLink(p.predicate.uri), p.object.literal_value['string']) - if prop_str != '': - doc += '<dl class=\"prop\">%s</dl>\n' % prop_str - doc += '</dd>' + label = getLabel(m, term) + if label != "": + doc += "<tr><th>Label</th><td>%s</td></tr>" % label + + # Find superclasses + superclasses = set() + for st in findStatements(m, term, rdfs.subClassOf, None): + if not isBlank(getObject(st)): + uri = getObject(st) + superclasses |= set([uri]) + + if len(superclasses) > 0: + doc += "\n<tr><th>Subclass of</th>" + first = True + for superclass in sorted(superclasses): + doc += getProperty(getTermLink(superclass), first) + first = False + + # Find subclasses + subclasses = set() + for st in findStatements(m, None, rdfs.subClassOf, term): + if not isBlank(getObject(st)): + uri = getSubject(st) + subclasses |= set([uri]) + + if len(subclasses) > 0: + doc += "\n<tr><th>Superclass of</th>" + first = True + for superclass in sorted(subclasses): + doc += getProperty(getTermLink(superclass), first) + first = False # Find out about properties which have rdfs:domain of t - d = classdomains.get(str(term.uri), "") + d = classdomains.get(str(term), "") if d: - dlist = '' - for k in d: - dlist += "<dd>%s</dd>" % getTermLink(k) - doc += "<dt>In domain of</dt>" + dlist + dlist = "" + first = True + for k in sorted(d): + dlist += getProperty(getTermLink(k), first) + first = False + doc += "<tr><th>In domain of</th>%s" % dlist # Find out about properties which have rdfs:range of t - r = classranges.get(str(term.uri), "") + r = classranges.get(str(term), "") if r: - rlist = '' - for k in r: - rlist += "<dd>%s</dd>" % getTermLink(k) - doc += "<dt>In range of</dt>" + rlist + rlist = "" + first = True + for k in sorted(r): + rlist += getProperty(getTermLink(k), first) + first = False + doc += "<tr><th>In range of</th>%s" % rlist return doc def isSpecial(pred): - """Return True if the predicate is "special" and shouldn't be emitted generically""" - return pred == rdf.type or pred == rdfs.range or pred == rdfs.domain or pred == rdfs.label or pred == rdfs.comment or pred == rdfs.subClassOf - - -def blankNodeDesc(node,m): - properties = m.find_statements(RDF.Statement(node, None, None)) - doc = '' - last_pred = '' - for p in properties: - if isSpecial(p.predicate): + """Return True if `pred` shouldn't be documented generically""" + return pred in [ + rdf.type, + rdfs.range, + rdfs.domain, + rdfs.label, + rdfs.comment, + rdfs.subClassOf, + rdfs.subPropertyOf, + lv2.documentation, + owl.withRestrictions, + ] + + +def blankNodeDesc(node, m): + properties = findStatements(m, node, None, None) + doc = "" + for p in sorted(properties): + if isSpecial(getPredicate(p)): continue - doc += '<tr>' - doc += '<td class="blankterm">%s</td>\n' % getTermLink(str(p.predicate.uri)) - if p.object.is_resource(): - doc += '<td class="blankdef">%s</td>\n' % getTermLink(str(p.object.uri))#getTermLink(str(p.object.uri), node, p.predicate) - elif p.object.is_literal(): - doc += '<td class="blankdef">%s</td>\n' % str(p.object.literal_value['string']) - elif p.object.is_blank(): - doc += '<td class="blankdef">' + blankNodeDesc(p.object,m) + '</td>\n' + doc += "<tr>" + doc += '<td class="blankterm">%s</td>\n' % getTermLink(getPredicate(p)) + if isResource(getObject(p)): + doc += '<td class="blankdef">%s</td>\n' % getTermLink(getObject(p)) + # getTermLink(str(getObject(p)), node, getPredicate(p)) + elif isLiteral(getObject(p)): + doc += '<td class="blankdef">%s</td>\n' % getLiteralString( + getObject(p) + ) + elif isBlank(getObject(p)): + doc += ( + '<td class="blankdef">' + + blankNodeDesc(getObject(p), m) + + "</td>\n" + ) else: doc += '<td class="blankdef">?</td>\n' - doc += '</tr>' - if doc != '': + doc += "</tr>" + if doc != "": doc = '<table class="blankdesc">\n%s\n</table>\n' % doc return doc -def extraInfo(term,m): +def extraInfo(term, m): """Generate information about misc. properties of a term""" doc = "" - properties = m.find_statements(RDF.Statement(term, None, None)) - last_pred = '' - for p in properties: - if isSpecial(p.predicate): + properties = findStatements(m, term, None, None) + first = True + for p in sorted(properties): + if isSpecial(getPredicate(p)): continue - if p.predicate != last_pred: - doc += '<dt>%s</dt>\n' % getTermLink(str(p.predicate.uri)) - if p.object.is_resource(): - doc += '<dd>%s</dd>\n' % getTermLink(str(p.object.uri), term, p.predicate) - elif p.object.is_literal(): - doc += '<dd>%s</dd>\n' % str(p.object) - elif p.object.is_blank(): - doc += '<dd>' + blankNodeDesc(p.object,m) + '</dd>\n' + doc += "<tr><th>%s</th>\n" % getTermLink(getPredicate(p)) + if isResource(getObject(p)): + doc += getProperty( + getTermLink(getObject(p), term, getPredicate(p)), first + ) + elif isLiteral(getObject(p)): + doc += getProperty( + linkifyCodeIdentifiers(str(getObject(p))), first + ) + elif isBlank(getObject(p)): + doc += getProperty(str(blankNodeDesc(getObject(p), m)), first) else: - doc += '<dd>?</dd>\n' - last_pred = p.predicate + doc += getProperty("?", first) + + # doc += endProperties(first) + return doc -def rdfsInstanceInfo(term,m): +def rdfsInstanceInfo(term, m): """Generate rdfs-type information for instances""" doc = "" - - t = m.find_statements( RDF.Statement(term, rdf.type, None) ) - if t.current(): - doc += "<dt>Type</dt>" - while t.current(): - doc += "<dd>%s</dd>" % getTermLink(str(t.current().object.uri), term, rdf.type) - t.next() - doc += extraInfo(term, m) + label = getLabel(m, term) + if label != "": + doc += "<tr><th>Label</th><td>%s</td></tr>" % label + + first = True + types = "" + for match in sorted(findStatements(m, term, rdf.type, None)): + types += getProperty( + getTermLink(getObject(match), term, rdf.type), first + ) + first = False + + if types != "": + doc += "<tr><th>Type</th>" + types + + doc += endProperties(first) return doc -def owlInfo(term,m): - """Returns an extra information that is defined about a term (an RDF.Node()) using OWL.""" - res = '' +def owlInfo(term, m): + """Returns an extra information that is defined about a term using OWL.""" + res = "" # Inverse properties ( owl:inverseOf ) - o = m.find_statements(RDF.Statement(term, owl.inverseOf, None)) - if o.current(): - res += "<dt>Inverse:</dt>" - for st in o: - res += "<dd>%s</dd>" % getTermLink(str(st.object.uri)) - + first = True + for st in findStatements(m, term, owl.inverseOf, None): + res += getProperty(getTermLink(getObject(st)), first) + first = False + if res != "": + res += endProperties(first) + res = "<tr><th>Inverse:</th>\n" + res + def owlTypeInfo(term, propertyType, name): - o = m.find_statements(RDF.Statement(term, rdf.type, propertyType)) - if o.current(): - return "<dt>OWL Type</dt><dd>%s</dd>\n" % name + if findOne(m, term, rdf.type, propertyType): + return "<tr><th>Type</th><td>%s</td></tr>\n" % name else: return "" res += owlTypeInfo(term, owl.DatatypeProperty, "Datatype Property") res += owlTypeInfo(term, owl.ObjectProperty, "Object Property") res += owlTypeInfo(term, owl.AnnotationProperty, "Annotation Property") - res += owlTypeInfo(term, owl.InverseFunctionalProperty, "Inverse Functional Property") + res += owlTypeInfo( + term, owl.InverseFunctionalProperty, "Inverse Functional Property" + ) res += owlTypeInfo(term, owl.SymmetricProperty, "Symmetric Property") return res -def docTerms(category, list, m): +def isDeprecated(m, subject): + deprecated = findOne(m, subject, owl.deprecated, None) + return deprecated and (str(deprecated[2]).find("true") >= 0) + + +def docTerms(category, list, m, classlist, proplist, instalist): """ A wrapper class for listing all the terms in a specific class (either - Properties, or Classes. Category is 'Property' or 'Class', list is a - list of term names (strings), return value is a chunk of HTML. + Properties, or Classes. Category is 'Property' or 'Class', list is a + list of term URI strings, return value is a chunk of HTML. """ doc = "" - nspre = spec_pre - for t in list: - if (t.startswith(spec_ns_str)) and (len(t[len(spec_ns_str):].split("/"))<2): - term = t - t = t.split(spec_ns_str[-1])[1] - curie = "%s:%s" % (nspre, t) + for term in list: + if not term.startswith(spec_ns_str): + continue + + t = termName(m, term) + curie = term.split(spec_ns_str[-1])[1] + if t: + doc += '<div class="specterm" id="%s" about="%s">' % (t, term) else: - if t.startswith("http://"): - term = t - curie = getShortName(t) - t = getAnchor(t) - else: - term = spec_ns[t] - curie = "%s:%s" % (nspre, t) - - try: - term_uri = term.uri - except: - term_uri = term - - doc += """<div class="specterm" id="%s" about="%s">\n<h3>%s <a href="%s">%s</a></h3>\n""" % (t, term_uri, category, term_uri, curie) - - label, comment = get_rdfs(m, term) - if label!='' or comment != '': - doc += '<div class="description">' - if label!='': - doc += "<div property=\"rdfs:label\" class=\"label\">%s</div>" % label - if comment!='': - doc += "<div property=\"rdfs:comment\">%s</div>" % comment.replace('\n\n', '<br /><br />') - if label!='' or comment != '': - doc += "</div>" + 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 + + comment = getFullDocumentation(m, term, classlist, proplist, instalist) + is_deprecated = isDeprecated(m, term) + + doc += '<div class="spectermbody">' + terminfo = "" - if category=='Property': - terminfo += owlInfo(term,m) - terminfo += rdfsPropertyInfo(term,m) - if category=='Class': - terminfo += rdfsClassInfo(term,m) - if category=='Instance': - terminfo += rdfsInstanceInfo(term,m) - - terminfo += extraInfo(term,m) - - if (len(terminfo)>0): #to prevent empty list (bug #882) - doc += '\n<dl class="terminfo">%s</dl>\n' % terminfo - - doc += "\n\n</div>\n\n" - + extrainfo = "" + if category == "Property": + terminfo += rdfsPropertyInfo(term, m) + terminfo += owlInfo(term, m) + if category == "Class": + terminfo += rdfsClassInfo(term, m) + extrainfo += owlRestrictionInfo(term, m) + if category == "Instance": + terminfo += rdfsInstanceInfo(term, m) + + terminfo += extraInfo(term, m) + + if len(terminfo) > 0: # to prevent empty list (bug #882) + doc += '\n<table class="terminfo">%s</table>\n' % terminfo + + doc += '<div class="description">' + + if is_deprecated: + doc += '<div class="warning">Deprecated</div>' + + if comment != "": + doc += ( + '<div class="comment" property="rdfs:comment">%s</div>' + % comment + ) + + doc += extrainfo + + doc += "</div>" + + doc += "</div>" + doc += "\n</div>\n\n" + return doc def getShortName(uri): - if ("#" in uri): + uri = str(uri) + if "#" in uri: return uri.split("#")[-1] else: return uri.split("/")[-1] def getAnchor(uri): - if (uri.startswith(spec_ns_str)): - return uri[len(spec_ns_str):].replace("/","_") + uri = str(uri) + if uri.startswith(spec_ns_str): + return uri.replace(spec_ns_str, "").replace("/", "_") else: return getShortName(uri) -def buildIndex(classlist, proplist, instalist=None): - """ - Builds the A-Z list of terms. Args are a list of classes (strings) and - a list of props (strings) - """ +def buildIndex(m, classlist, proplist, instalist=None): + if not (classlist or proplist or instalist): + return "" - if len(classlist)==0 and len(proplist)==0 and (not instalist or len(instalist)==0): - return '' - - azlist = '<dl class="index">' - - if (len(classlist)>0): - azlist += "<dt>Classes</dt><dd>" - classlist.sort() - for c in classlist: - if c.startswith(spec_ns_str): - c = c.split(spec_ns_str[-1])[1] - azlist = """%s <a href="#%s">%s</a>, """ % (azlist, c, c) - azlist = """%s</dd>\n""" % azlist - - if (len(proplist)>0): - azlist += "<dt>Properties</dt><dd>" - proplist.sort() - for p in proplist: - if p.startswith(spec_ns_str): - p = p.split(spec_ns_str[-1])[1] - azlist = """%s <a href="#%s">%s</a>, """ % (azlist, p, p) - azlist = """%s</dd>\n""" % azlist - - if (instalist!=None and len(instalist)>0): - azlist += "<dt>Instances</dt><dd>" - for i in instalist: + head = "" + body = "" + + def termLink(m, t): + if str(t).startswith(spec_ns_str): + name = termName(m, t) + return '<a href="#%s">%s</a>' % (name, name) + else: + return '<a href="%s">%s</a>' % (str(t), str(t)) + + if len(classlist) > 0: + head += '<th><a href="#ref-classes" />Classes</th>' + body += "<td><ul>" + shown = {} + for c in sorted(classlist): + if c in shown: + continue + + # Skip classes that are subclasses of classes defined in this spec + local_subclass = False + for p in findStatements(m, c, rdfs.subClassOf, None): + parent = str(p[2]) + if parent.startswith(spec_ns_str): + local_subclass = True + if local_subclass: + continue + + shown[c] = True + body += "<li>" + termLink(m, c) + + def class_tree(c): + tree = "" + shown[c] = True + + subclasses = [] + for s in findStatements(m, None, rdfs.subClassOf, c): + subclasses += [getSubject(s)] + + for s in sorted(subclasses): + tree += "<li>" + termLink(m, s) + tree += class_tree(s) + tree += "</li>" + if tree != "": + tree = "<ul>" + tree + "</ul>" + return tree + + body += class_tree(c) + body += "</li>" + body += "</ul></td>\n" + + if len(proplist) > 0: + head += '<th><a href="#ref-properties" />Properties</th>' + body += "<td><ul>" + for p in sorted(proplist): + body += "<li>%s</li>" % termLink(m, p) + body += "</ul></td>\n" + + if instalist is not None and len(instalist) > 0: + head += '<th><a href="#ref-instances" />Instances</th>' + body += "<td><ul>" + for i in sorted(instalist): p = getShortName(i) anchor = getAnchor(i) - azlist = """%s <a href="#%s">%s</a>, """ % (azlist, anchor, p) - azlist = """%s</dd>\n""" % azlist + body += '<li><a href="#%s">%s</a></li>' % (anchor, p) + body += "</ul></td>\n" + + if head and body: + return """<table class="index"> +<thead><tr>%s</tr></thead> +<tbody><tr>%s</tr></tbody></table> +""" % ( + head, + body, + ) - azlist = """%s\n</dl>""" % azlist - return azlist + return "" def add(where, key, value): - if not where.has_key(key): + if key not in where: where[key] = [] - if not value in where[key]: + if value not in where[key]: where[key].append(value) @@ -499,94 +927,218 @@ def specInformation(m, ns): global classdomains # Find the class information: Ranges, domains, and list of all names. - classtypes = [rdfs.Class, owl.Class] + classtypes = [rdfs.Class, owl.Class, rdfs.Datatype] classlist = [] for onetype in classtypes: - for classStatement in m.find_statements(RDF.Statement(None, rdf.type, onetype)): - for range in m.find_statements(RDF.Statement(None, rdfs.range, classStatement.subject)): - if not m.contains_statement( RDF.Statement( range.subject, rdf.type, owl.DeprecatedProperty )): - if not classStatement.subject.is_blank(): - add(classranges, str(classStatement.subject.uri), str(range.subject.uri)) - for domain in m.find_statements(RDF.Statement(None, rdfs.domain, classStatement.subject)): - if not m.contains_statement( RDF.Statement( domain.subject, rdf.type, owl.DeprecatedProperty )): - if not classStatement.subject.is_blank(): - add(classdomains, str(classStatement.subject.uri), str(domain.subject.uri)) - if not classStatement.subject.is_blank(): - uri = str(classStatement.subject.uri) - name = return_name(m, classStatement.subject) - if name not in classlist and uri.startswith(ns): - classlist.append(return_name(m, classStatement.subject)) + for classStatement in findStatements(m, None, rdf.type, onetype): + for range in findStatements( + m, None, rdfs.range, getSubject(classStatement) + ): + if not isBlank(getSubject(classStatement)): + add( + classranges, + str(getSubject(classStatement)), + str(getSubject(range)), + ) + for domain in findStatements( + m, None, rdfs.domain, getSubject(classStatement) + ): + if not isBlank(getSubject(classStatement)): + add( + classdomains, + str(getSubject(classStatement)), + str(getSubject(domain)), + ) + if not isBlank(getSubject(classStatement)): + klass = getSubject(classStatement) + if klass not in classlist and str(klass).startswith(ns): + classlist.append(klass) # Create a list of properties in the schema. - proptypes = [rdf.Property, owl.ObjectProperty, owl.DatatypeProperty, owl.AnnotationProperty] + proptypes = [ + rdf.Property, + owl.ObjectProperty, + owl.DatatypeProperty, + owl.AnnotationProperty, + ] proplist = [] - for onetype in proptypes: - for propertyStatement in m.find_statements(RDF.Statement(None, rdf.type, onetype)): - uri = str(propertyStatement.subject.uri) - name = return_name(m, propertyStatement.subject) - if uri.startswith(ns) and not name in proplist: - proplist.append(name) + for onetype in proptypes: + for propertyStatement in findStatements(m, None, rdf.type, onetype): + prop = getSubject(propertyStatement) + if prop not in proplist and str(prop).startswith(ns): + proplist.append(prop) return classlist, proplist def specProperty(m, subject, predicate): "Return a property of the spec." - for c in m.find_statements(RDF.Statement(None, predicate, None)): - if c.subject.is_resource() and str(c.subject.uri) == str(subject): - return c.object.literal_value['string'] - return '' + for c in findStatements(m, subject, predicate, None): + return getLiteralString(getObject(c)) + return "" def specProperties(m, subject, predicate): "Return a property of the spec." - properties=[] - for c in m.find_statements(RDF.Statement(None, predicate, None)): - if c.subject.is_resource() and str(c.subject.uri) == str(subject): - properties += [c.object] + properties = [] + for c in findStatements(m, subject, predicate, None): + properties += [getObject(c)] return properties def specAuthors(m, subject): "Return an HTML description of the authors of the spec." - dev = '' - for i in m.find_statements(RDF.Statement(None, doap.developer, None)): - for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): - dev += '<div class="author" property="doap:developer">%s</div>' % j.object.literal_value['string'] - maint = '' - for i in m.find_statements(RDF.Statement(None, doap.maintainer, None)): - for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): - maint += '<div class="author" property="doap:maintainer">%s</div>' % j.object.literal_value['string'] + subjects = [subject] + p = findOne(m, subject, lv2.project, None) + if p: + subjects += [getObject(p)] + + dev = set() + for s in subjects: + for i in findStatements(m, s, doap.developer, None): + for j in findStatements(m, getObject(i), foaf.name, None): + dev.add(getLiteralString(getObject(j))) + + maint = set() + for s in subjects: + for i in findStatements(m, s, doap.maintainer, None): + for j in findStatements(m, getObject(i), foaf.name, None): + maint.add(getLiteralString(getObject(j))) + + doc = "" + + devdoc = "" + first = True + for d in sorted(dev): + if not first: + devdoc += ", " + + devdoc += f'<span class="author" property="doap:developer">{d}</span>' + first = False + if len(dev) == 1: + doc += f'<tr><th class="metahead">Developer</th><td>{devdoc}</td></tr>' + elif len(dev) > 0: + doc += ( + f'<tr><th class="metahead">Developers</th><td>{devdoc}</td></tr>' + ) + + maintdoc = "" + first = True + for m in sorted(maint): + if not first: + maintdoc += ", " + + maintdoc += ( + f'<span class="author" property="doap:maintainer">{m}</span>' + ) + first = False + 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 + elif int(rev.split(".")[-1]) % 2 == 0: + print("warning: %s %s has no file-release" % (subject, rev)) + + return entries - if dev == '' and maint == '': - return '' - ret = '' - if dev != '': - ret += '<tr><th class="metahead">Developer(s)</th><td>' + dev + '</td></tr>' - if maint != '': - ret += '<tr><th class="metahead">Maintainer(s)</th><td>' + maint + '</td></tr>' +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 "" - return ret +def specHistory(m, subject): + return specHistoryMarkup(specHistoryEntries(m, subject, {})) -def specRevision(m, subject): + +def specVersion(m, subject): """ - Return a (revision date) tuple, both strings, about the latest - release of the specification + Return a (minorVersion, microVersion, date) tuple """ - latest_revision = "" - latest_release = None - for i in m.find_statements(RDF.Statement(None, doap.release, None)): - for j in m.find_statements(RDF.Statement(i.object, doap.revision, None)): - revision = j.object.literal_value['string'] - if latest_revision == "" or revision > latest_revision: - latest_revision = revision - latest_release = i.object - if latest_release != None: - for i in m.find_statements(RDF.Statement(latest_release, doap.created, None)): - return (latest_revision, i.object.literal_value['string']) + # Get the date from the latest doap release + latest_doap_revision = "" + latest_doap_release = None + for i in findStatements(m, subject, doap.release, None): + for j in findStatements(m, getObject(i), doap.revision, None): + revision = getLiteralString(getObject(j)) + if latest_doap_revision == "" or revision > latest_doap_revision: + latest_doap_revision = revision + latest_doap_release = getObject(i) + date = "" + if latest_doap_release is not None: + for i in findStatements(m, latest_doap_release, doap.created, None): + date = getLiteralString(getObject(i)) + + # Get the LV2 version + minor_version = 0 + micro_version = 0 + for i in findStatements(m, None, lv2.minorVersion, None): + minor_version = int(getLiteralString(getObject(i))) + for i in findStatements(m, None, lv2.microVersion, None): + micro_version = int(getLiteralString(getObject(i))) + return (minor_version, micro_version, date) def getInstances(model, classes, properties): @@ -595,191 +1147,339 @@ def getInstances(model, classes, properties): (aka "everything that is not a class or a property") """ instances = [] - for one in classes: - for i in model.find_statements(RDF.Statement(None, rdf.type, spec_ns[one])): - uri = str(i.subject.uri) - if not uri in instances: - instances.append(uri) - for i in model.find_statements(RDF.Statement(None, rdf.type, None)): - if not i.subject.is_resource(): - continue; - full_uri = str(i.subject.uri) - if (full_uri.startswith(spec_ns_str)): - uri = full_uri[len(spec_ns_str):] - else: - uri = full_uri - if ((not full_uri in instances) and (not uri in classes) and (not uri in properties) and (full_uri != spec_url)): - instances.append(full_uri) + for c in classes: + for i in findStatements(model, None, rdf.type, c): + if not isResource(getSubject(i)): + continue + inst = getSubject(i) + if inst not in instances and str(inst) != spec_url: + instances.append(inst) + for i in findStatements(model, None, rdf.type, None): + if ( + (not isResource(getSubject(i))) + or (getSubject(i) in classes) + or (getSubject(i) in instances) + or (getSubject(i) in properties) + ): + continue + full_uri = str(getSubject(i)) + if full_uri.startswith(spec_ns_str): + instances.append(getSubject(i)) return instances - - -def specgen(specloc, docdir, template, instances=False, mode="spec"): + + +def load_tags(path, docdir): + "Build a (symbol => URI) map from a Doxygen tag file." + + if not path or not docdir: + return {} + + def getChildText(elt, tagname): + "Return the content of the first child node with a certain tag name." + for e in elt.childNodes: + if ( + e.nodeType == xml.dom.Node.ELEMENT_NODE + and e.tagName == tagname + ): + return e.firstChild.nodeValue + return "" + + def linkTo(filename, anchor, sym): + if anchor: + return '<span><a href="%s/%s#%s">%s</a></span>' % ( + docdir, + filename, + anchor, + sym, + ) + else: + return '<span><a href="%s/%s">%s</a></span>' % ( + docdir, + filename, + sym, + ) + + tagdoc = xml.dom.minidom.parse(path) + root = tagdoc.documentElement + linkmap = {} + for cn in root.childNodes: + if ( + cn.nodeType == xml.dom.Node.ELEMENT_NODE + and cn.tagName == "compound" + and cn.getAttribute("kind") != "page" + ): + + name = getChildText(cn, "name") + filename = getChildText(cn, "filename") + anchor = getChildText(cn, "anchor") + if not filename.endswith(".html"): + filename += ".html" + + if cn.getAttribute("kind") != "group": + linkmap[name] = linkTo(filename, anchor, name) + + prefix = "" + if cn.getAttribute("kind") == "struct": + prefix = name + "::" + + members = cn.getElementsByTagName("member") + for m in members: + mname = prefix + getChildText(m, "name") + mafile = getChildText(m, "anchorfile") + manchor = getChildText(m, "anchor") + linkmap[mname] = linkTo(mafile, manchor, mname) + + return linkmap + + +def specgen( + specloc, + template_path, + style_uri, + docdir, + tags, + opts, + instances=False, +): """The meat and potatoes: Everything starts here.""" + global spec_bundle global spec_url global spec_ns_str global spec_ns global spec_pre global ns_list - - m = RDF.Model() - p = RDF.Parser(name="guess") - try: - p.parse_into_model(m, specloc) - except IOError, e: - print "Error reading from ontology:", str(e) - usage() - except RDF.RedlandError, e: - print "Error parsing the ontology" + global specgendir + global linkmap + + spec_bundle = "file://%s/" % os.path.abspath(os.path.dirname(specloc)) + + # Template + 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") + m.parse(specloc, format="n3") spec_url = getOntologyNS(m) + spec = rdflib.URIRef(spec_url) + + # Load all seeAlso files recursively + seeAlso = set() + done = False + while not done: + done = True + for uri in specProperties(m, spec, rdfs.seeAlso): + if uri[:7] == "file://": + path = uri[7:] + if ( + path != os.path.abspath(specloc) + and path.endswith("ttl") + and path not in seeAlso + ): + seeAlso.add(path) + m.parse(path, format="n3") + done = False spec_ns_str = spec_url - if (spec_ns_str[-1]!="/" and spec_ns_str[-1]!="#"): + if spec_ns_str[-1] != "/" and spec_ns_str[-1] != "#": spec_ns_str += "#" - spec_ns = RDF.NS(spec_ns_str) - - namespaces = getNamespaces(p) - keys = namespaces.keys() - keys.sort() + spec_ns = rdflib.Namespace(spec_ns_str) + + namespaces = getNamespaces(m) + keys = sorted(namespaces.keys()) prefixes_html = "<span>" for i in keys: uri = namespaces[i] - if spec_pre is None and str(uri) == str(spec_url + '#'): + if uri.startswith("file:"): + continue + ns_list[str(uri)] = i + if ( + str(uri) == spec_url + "#" + or str(uri) == spec_url + "/" + or str(uri) == spec_url + ): spec_pre = i prefixes_html += '<a href="%s">%s</a> ' % (uri, i) prefixes_html += "</span>" - + if spec_pre is None: - print 'No namespace prefix for specification defined' + print("No namespace prefix for %s defined" % specloc) sys.exit(1) - + ns_list[spec_ns_str] = spec_pre classlist, proplist = specInformation(m, spec_ns_str) classlist = sorted(classlist) proplist = sorted(proplist) - + instalist = None if instances: - instalist = getInstances(m, classlist, proplist) - instalist.sort(lambda x, y: cmp(getShortName(x).lower(), getShortName(y).lower())) - - azlist = buildIndex(classlist, proplist, instalist) + instalist = sorted( + getInstances(m, classlist, proplist), + key=lambda x: getShortName(x).lower(), + ) + + azlist = buildIndex(m, classlist, proplist, instalist) # Generate Term HTML - termlist = docTerms('Property', proplist, m) - termlist = docTerms('Class', classlist, m) + termlist + classlist = docTerms("Class", classlist, m, classlist, proplist, instalist) + proplist = docTerms( + "Property", proplist, m, classlist, proplist, instalist + ) if instances: - termlist += docTerms('Instance', instalist, m) - - # Generate RDF from original namespace. - u = urllib.urlopen(specloc) - rdfdata = u.read() - rdfdata = re.sub(r"(<\?xml version.*\?>)", "", rdfdata) - rdfdata = re.sub(r"(<!DOCTYPE[^]]*]>)", "", rdfdata) - #rdfdata.replace("""<?xml version="1.0"?>""", "") - - # print template % (azlist.encode("utf-8"), termlist.encode("utf-8"), rdfdata.encode("ISO-8859-1")) - template = re.sub(r"^#format \w*\n", "", template) - template = re.sub(r"\$VersionInfo\$", owlVersionInfo(m).encode("utf-8"), template) - - template = template.replace('@NAME@', specProperty(m, spec_url, doap.name)) - template = template.replace('@URI@', spec_url) - 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)) + instlist = docTerms( + "Instance", instalist, m, classlist, proplist, instalist + ) + + termlist = "" + if classlist: + termlist += '<div class="section">' + termlist += '<h2><a id="ref-classes" />Classes</h2>' + classlist + termlist += "</div>" + + if proplist: + termlist += '<div class="section">' + termlist += '<h2><a id="ref-properties" />Properties</h2>' + proplist + termlist += "</div>" + + if instlist: + termlist += '<div class="section">' + termlist += '<h2><a id="ref-instances" />Instances</h2>' + instlist + termlist += "</div>" + + name = specProperty(m, spec, doap.name) + title = name + + template = template.replace("@TITLE@", title) + template = template.replace("@NAME@", name) + template = template.replace( + "@SHORT_DESC@", specProperty(m, spec, doap.shortdesc) + ) + template = template.replace("@URI@", spec) + template = template.replace("@PREFIX@", spec_pre) filename = os.path.basename(specloc) - basename = filename[0:filename.rfind('.')] - - template = template.replace('@PREFIXES@', str(prefixes_html)) - template = template.replace('@BASE@', spec_ns_str) - template = template.replace('@AUTHORS@', specAuthors(m, spec_url)) - template = template.replace('@INDEX@', azlist) - template = template.replace('@REFERENCE@', termlist.encode("utf-8")) - template = template.replace('@FILENAME@', filename) - template = template.replace('@HEADER@', basename + '.h') - template = template.replace('@MAIL@', 'devel@lists.lv2plug.in') - - revision = specRevision(m, spec_url) # (revision, date) - if revision: - template = template.replace('@REVISION@', revision[0] + " (" + revision[1] + ")") - else: - template = template.replace('@REVISION@', '<span style="color: red; font-weight: bold">EXPERIMENTAL</span>') - - bundle_path = os.path.split(specloc[specloc.find(':')+1:])[0] - header_path = bundle_path + '/' + basename + '.h' - - other_files = '' - if revision and revision[0] != '0': - release_name = "lv2-" + basename - if basename == "lv2": - release_name = "lv2core" - other_files += '<li><a href="http://lv2plug.in/spec/%s-%s.0.tar.gz">Release</a> (<a href="http://lv2plug.in/spec">all releases</a>)</li>\n' % (release_name, revision[0]) - if os.path.exists(os.path.abspath(header_path)): - other_files += '<li><a href="' + docdir + '/html/%s">Header Documentation</a></li>\n' % ( - basename + '_8h.html') - - other_files += '<li><a href="%s">Header</a> %s</li>' % (basename + '.h', basename + '.h') - - other_files += '<li><a href="%s">Ontology</a> %s</li>\n' % (filename, filename) - - see_also_files = specProperties(m, spec_url, rdfs.seeAlso) - for f in see_also_files: - other_files += '<li><a href="%s">%s</a></li>' % (f, f) - - template = template.replace('@FILES@', other_files); - - comment = specProperty(m, spec_url, rdfs.comment) - if not comment: - comment = specProperty(m, spec_url, doap.shortdesc) - #template = template.replace('@COMMENT@', '<p>' + comment.strip().replace('\n\n', '</p><p>') + '</p>') - template = template.replace('@COMMENT@', comment.strip().replace('\n\n', '<br /><br />')) - #template = template.replace('@COMMENT@', comment) - - template = template.replace('@TIME@', datetime.datetime.utcnow().strftime('%F %H:%M UTC')) + basename = os.path.splitext(filename)[0] + + template = template.replace("@STYLE_URI@", style_uri) + template = template.replace("@PREFIXES@", str(prefixes_html)) + template = template.replace("@BASE@", spec_ns_str) + template = template.replace("@AUTHORS@", specAuthors(m, spec)) + template = template.replace("@INDEX@", azlist) + 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: + mail_row = '<tr><th>Discuss</th><td><a href="mailto:%s">%s</a>' % ( + opts["list_email"], + opts["list_email"], + ) + if "list_page" in opts: + mail_row += ' <a href="%s">(subscribe)</a>' % opts["list_page"] + mail_row += "</td></tr>" + template = template.replace("@MAIL@", mail_row) + + version = specVersion(m, spec) # (minor, micro, date) + date_string = version[2] + if date_string == "": + date_string = "Undated" + + version_string = "%s.%s" % (version[0], version[1]) + experimental = version[0] == 0 or version[1] % 2 == 1 + if experimental: + version_string += ' <span class="warning">EXPERIMENTAL</span>' + + if isDeprecated(m, rdflib.URIRef(spec_url)): + version_string += ' <span class="warning">DEPRECATED</span>' + + template = template.replace("@VERSION@", version_string) + + content_links = "" + if docdir is not None: + content_links = '<li><a href="%s">API</a></li>' % os.path.join( + docdir, "group__%s.html" % basename + ) + + template = template.replace("@CONTENT_LINKS@", content_links) + + docs = getDetailedDocumentation( + m, rdflib.URIRef(spec_url), classlist, proplist, instalist + ) + template = template.replace("@DESCRIPTION@", docs) + + now = int(os.environ.get("SOURCE_DATE_EPOCH", time.time())) + build_date = datetime.datetime.utcfromtimestamp(now) + template = template.replace("@DATE@", build_date.strftime("%F")) + template = template.replace("@TIME@", build_date.strftime("%F %H:%M UTC")) + + # Validate complete output page + try: + oldcwd = os.getcwd() + os.chdir(specgendir) + etree.fromstring( + template.replace( + '"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"', + '"DTD/xhtml-rdfa-1.dtd"', + ).encode("utf-8"), + etree.XMLParser(dtd_validation=True, no_network=True), + ) + except Exception as e: + sys.stderr.write( + "error: Validation failed for %s: %s\n" % (specloc, e) + ) + finally: + os.chdir(oldcwd) return template def save(path, text): try: - f = open(path, "w") - f.write(text) - f.flush() - f.close() - except Exception, e: - print "Error writing to file \"" + path + "\": " + str(e) + 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)) -def getNamespaces(parser): +def getNamespaces(m): """Return a prefix:URI dictionary of all namespaces seen during parsing""" - count = Redland.librdf_parser_get_namespaces_seen_count(parser._parser) nspaces = {} - for index in range(0, count - 1): - prefix = Redland.librdf_parser_get_namespaces_seen_prefix(parser._parser, index) - uri_obj = Redland.librdf_parser_get_namespaces_seen_uri(parser._parser, index) - if uri_obj is None: - uri = None - else: - uri = RDF.Uri(from_object=uri_obj) - nspaces[prefix] = uri + for prefix, uri in m.namespaces(): + if not re.match("default[0-9]*", prefix) and not prefix == "xml": + # Skip silly default namespaces added by rdflib + nspaces[prefix] = uri return nspaces def getOntologyNS(m): ns = None - o = m.find_statements(RDF.Statement(None, rdf.type, lv2.Specification)) - if o.current(): - s = o.current().subject - if (not s.is_blank()): - ns = str(s.uri) - - if (ns == None): + s = findOne(m, None, rdf.type, lv2.Specification) + if not s: + s = findOne(m, None, rdf.type, owl.Ontology) + if s: + if not isBlank(getSubject(s)): + ns = str(getSubject(s)) + + if ns is None: sys.exit("Impossible to get ontology's namespace") else: return ns @@ -787,87 +1487,179 @@ def getOntologyNS(m): def usage(): script = os.path.basename(sys.argv[0]) - print """Usage: %s ONTOLOGY TEMPLATE STYLE OUTPUT [FLAGS] + 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 - ONTOLOGY : Path to ontology file - TEMPLATE : HTML template path - STYLE : CSS style path - OUTPUT : HTML output path - DOCDIR : Doxygen documentation directory - Optional flags: - -i : Document class/property instances (disabled by default) - -p PREFIX : Set ontology namespace prefix from command line +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)] -Example: - %s lv2_foos.ttl template.html style.css lv2_foos.html ../docs -i -p foos -""" % (script, script) - sys.exit(-1) + 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""" - - args = sys.argv[1:] - if (len(args) < 3): - usage() - else: - - # Ontology - specloc = "file:" + str(args[0]) - # Template - temploc = args[1] - template = None - try: - f = open(temploc, "r") - template = f.read() - except Exception, e: - print "Error reading from template \"" + temploc + "\": " + str(e) - usage() - - # Footer - footerloc = temploc.replace('template', 'footer') - footer = '' - try: - f = open(footerloc, "r") - footer = f.read() - except Exception, e: - print "Error reading from footer \"" + footerloc + "\": " + str(e) - usage() - - template = template.replace('@FOOTER@', footer) - - # Style - styleloc = args[2] - style = '' - try: - f = open(styleloc, "r") - style = f.read() - except Exception, e: - print "Error reading from style \"" + styleloc + "\": " + str(e) - usage() - - template = template.replace('@STYLE@', style) - - # Destination - dest = args[3] - - # Doxygen documentation directory - docdir = args[4] - - # Flags - instances = False - if len(args) > 4: - flags = args[4:] - i = 0 - while i < len(flags): - if flags[i] == '-i': - instances = True - elif flags[i] == '-p': - spec_pre = flags[i + 1] - i += 1 - i += 1 - - save(dest, specgen(specloc, docdir, template, instances=instances)) + 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(), + description="Write HTML documentation for an RDF ontology.", + ) + opt.add_option( + "--list-email", + type="string", + dest="list_email", + help="Mailing list email address", + ) + opt.add_option( + "--list-page", + type="string", + dest="list_page", + help="Mailing list info page address", + ) + opt.add_option( + "--template", + type="string", + 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", + type="string", + dest="style_uri", + default="style.css", + help="Stylesheet URI", + ) + opt.add_option( + "--docdir", + type="string", + dest="docdir", + default=None, + help="Doxygen output directory", + ) + opt.add_option( + "--tags", + type="string", + dest="tags", + default=None, + help="Doxygen tags file", + ) + opt.add_option( + "-p", + "--prefix", + type="string", + dest="prefix", + help="Specification Turtle prefix", + ) + opt.add_option( + "-i", + "--instances", + action="store_true", + dest="instances", + help="Document instances", + ) + opt.add_option( + "--copy-style", + action="store_true", + dest="copy_style", + help="Copy style from template directory to output directory", + ) + + (options, args) = opt.parse_args() + opts = vars(options) + + if len(args) < 2: + opt.print_help() + sys.exit(-1) + + spec_pre = options.prefix + ontology = "file:" + str(args[0]) + output = args[1] + docdir = options.docdir + tags = options.tags + + out = "." + spec = args[0] + path = os.path.dirname(spec) + outdir = os.path.abspath(os.path.join(out, path)) + + bundle = str(outdir) + b = os.path.basename(outdir) + + if not os.access(os.path.abspath(spec), os.R_OK): + sys.stderr.write("error: extension %s has no %s.ttl file\n" % (b, b)) + sys.exit(1) + # Generate spec documentation + specdoc = specgen( + spec, + opts["template"], + opts["style_uri"], + docdir, + tags, + opts, + instances=True, + ) + + # Save to HTML output file + save(output, specdoc) + + if opts["copy_style"]: + import shutil + + 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..9ecb8d4 --- /dev/null +++ b/lv2specgen/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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, +] + +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 3f4cff4..4eb3d96 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -1,102 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> <!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:dcs="http://ontologi.es/doap-changeset#" + 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>@NAME@</title> + <title>@TITLE@</title> <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" /> <meta name="generator" content="lv2specgen" /> - <style type="text/css"> -@STYLE@ - </style> + <link href="@STYLE_URI@" rel="stylesheet" type="text/css" /> </head> <body> - <h1 id="title">@NAME@</h1> - <div class="meta"> - <table> - <tr><th class="metahead">URI</th><td><a href="@URI@">@URI@</a></td></tr> - <tr><th class="metahead">Revision</th><td>@REVISION@</td></tr> - <tr><th class="metahead">Namespaces</th><td>@PREFIXES@</td></tr> - @AUTHORS@ - </table> - </div> - - - <!-- META --> - - <div class="content"> - <p>This document describes <a href="@URI@">@NAME@</a>, - an <a href="http://lv2plug.in/">LV2</a> related specification. - Comments are welcome, please direct discussion to <a - href="mailto:@MAIL@">@MAIL@</a>.</p> - </div> - - <h2 id="contents">Contents</h2> - <div class="content"> - <h3>This Document</h3> - <ol id="toc"> - <li><a href="#sec-description">Description</a></li> - <li><a href="#sec-index">Index</a></li> - <li><a href="#sec-documentation">Documentation</a></li> - <li><a href="#sec-references">References</a></li> - </ol> - <h3>Other Resources</h3> - <ul> - @FILES@ - </ul> - </div> - - - <!-- DESCRIPTION --> - - <h2 id="sec-description">1. Description</h2> - <div class="content">@COMMENT@</div> - - - <!-- INDEX --> - - <h2 id="sec-index">2. Index</h2> - <div class="content"> - @INDEX@ - </div> - - - <!-- REFERENCE --> - - <h2 id="sec-documentation">3. Documentation</h2> - <div class="content"> - @REFERENCE@ - </div> - - <!-- REFERENCES --> - - <h2 id="sec-references">4. References</h2> - <div class="content"> - <dl> - <dt class="label" id="ref-rfc2119">IETF RFC 2119</dt> - <dd> - <em> - <a href="http://www.ietf.org/rfc/rfc2119.txt"> - RFC 2119: Key words for use in RFCs to Indicate Requirement Levels</a> - </em>. Internet Engineering Task Force, 1997. - </dd> - </dl> - </div> - - - <!-- FOOTER --> - - <div class="footer"> - <span class="footer-text">Generated on @TIME@ from <a href="./@FILENAME@" class="footer-text">@FILENAME@</a> by <a href="http://drobilla.net/software/lv2specgen" class="footer-text">lv2specgen</a></span> - @FOOTER@ - </div> + <!-- HEADER --> + <div id="topbar"> + <div id="header"> + <div id="titlebox"> + <h1 id="title">@NAME@</h1> + <div id="shortdesc">@SHORT_DESC@</div> + </div> + <div id="metabox"> + <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> + </div> + </div> + </div> + + <div id="content"> + <div id="contentsbox"> + <!-- Contents: --> + <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> + + <!-- DESCRIPTION --> + <div class="section">@DESCRIPTION@</div> + + <!-- INDEX --> + <h2 id="sec-index">Index</h2> + <div class="section"> + @INDEX@ + </div> + + <!-- REFERENCE --> + <div class="section"> + @REFERENCE@ + </div> + + <!-- HISTORY --> + <h2 id="sec-history">History</h2> + <div class="section"> + @HISTORY@ + </div> + + <!-- FOOTER --> + <div id="footer"> + <div> + This document is available under the + <a about="" rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"> + Creative Commons Attribution-ShareAlike License + </a> + </div> + <div> + Valid + <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="dcterms:conformsTo" resource="http://www.w3.org/TR/CSS2" + href="http://jigsaw.w3.org/css-validator/check/referer"> + CSS + </a> + generated from @FILENAME@ by lv2specgen + </div> + </div> + + </div> </body> </html> - diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..0a0175c --- /dev/null +++ b/meson.build @@ -0,0 +1,375 @@ +# Copyright 2021-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +project('lv2', ['c'], + version: '1.18.8', + license: 'ISC', + meson_version: '>= 0.56.0', + default_options: [ + 'b_ndebug=if-release', + 'buildtype=release', + 'c_std=c99', + ]) + +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 +if get_option('strict') and not meson.is_subproject() + subdir('meson/warnings') +endif +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/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', + subdirs: ['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(), +) + +################## +# 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 +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() +endif + +# Run Doxygen first to generate tags +subdir('doc/c') + +# Set up lv2specgen and lv2specgen_command_prefix (which references tags) +subdir('lv2specgen') + +# 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 +subdir('test') + +######## +# News # +######## + +lv2_write_news_py = find_program('scripts' / 'lv2_write_news.py') + +write_news_command = [ + lv2_write_news_py, + '-t', 'http://lv2plug.in/ns/lv2', + files(lv2_source_root / 'lv2' / 'core.lv2' / 'people.ttl'), + files(lv2_source_root / 'lv2' / 'core.lv2' / 'meta.ttl'), + spec_files, +] + +custom_target( + 'NEWS', + capture: true, + command: write_news_command, + output: 'NEWS', +) + +if not meson.is_subproject() + # Generate NEWS file from data in distribution archive + meson.add_dist_script(write_news_command) + + summary('Tests', not get_option('tests').disabled(), bool_yn: true) + summary('Documentation', build_docs, bool_yn: true) + summary('Prefix', get_option('prefix'), section: 'Paths') + summary('LV2 bundles', lv2dir, section: 'Paths') + summary('Headers', get_option('prefix') / get_option('includedir'), section: 'Paths') +endif diff --git a/meson/library/meson.build b/meson/library/meson.build new file mode 100644 index 0000000..f50505f --- /dev/null +++ b/meson/library/meson.build @@ -0,0 +1,30 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +# General definitions for building libraries. +# +# These are essentially workarounds for meson and/or MSVC. Unfortunately, +# meson's default_library option doesn't support shared and static builds very +# well. In particular, it's often necessary to define different symbols for +# static and shared builds of libraries so that symbols can be exported. To +# work around this, we do not support default_library=both on Windows. On +# other platforms with GCC-like compilers, we can support both because symbols +# can safely be exported in the same way (giving them default visibility) in +# both static and shared builds. + +# Abort on Windows with default_library=both +if get_option('default_library') == 'both' + if host_machine.system() == 'windows' + error('default_library=both is not supported on Windows') + endif +endif + +# Set library_suffix to the suffix for libraries +if cc.get_id() == 'msvc' + # Meson appends a version to the name only on MS, which leads to inconsistent + # library names, like `mylib-1-1`. So, provide no suffix to ultimately get + # the same name as on other platforms, like `mylib-1`. + library_suffix = '' +else + library_suffix = '-@0@'.format(meson.project_version().split('.')[0]) +endif diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build new file mode 100644 index 0000000..e2170c0 --- /dev/null +++ b/meson/suppressions/meson.build @@ -0,0 +1,130 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +# Project-specific warning suppressions. +# +# This should be used in conjunction with the generic "warnings" sibling that +# enables all reasonable warnings for the compiler. It lives here just to keep +# the top-level meson.build more readable. + +##### +# C # +##### + +if is_variable('cc') + c_suppressions = [] + + if get_option('strict') + if cc.get_id() in ['clang', 'emscripten'] + c_suppressions += [ + '-Wno-cast-align', + '-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-unused-parameter', + ] + elif cc.get_id() == 'gcc' + c_suppressions += [ + '-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', + '-Wno-unused-parameter', + ] + + 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 + '/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 + '/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 + + c_suppressions = cc.get_supported_arguments(c_suppressions) +endif + +####### +# C++ # +####### + +if is_variable('cpp') + cpp_suppressions = [] + + if get_option('strict') + if cpp.get_id() in ['clang', 'emscripten'] + cpp_suppressions = [ + '-Wno-cast-align', + '-Wno-cast-qual', + '-Wno-documentation-unknown-command', + '-Wno-nullability-extension', + '-Wno-padded', + '-Wno-reserved-id-macro', + ] + + 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 + ] + endif + endif + + cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions) +endif diff --git a/meson/warnings/meson.build b/meson/warnings/meson.build new file mode 100644 index 0000000..e0051f9 --- /dev/null +++ b/meson/warnings/meson.build @@ -0,0 +1,256 @@ +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +# General code to enable approximately all warnings in GCC 12, clang, and MSVC. +# +# This is trivial for clang and MSVC, but GCC doesn't have an "everything" +# option, so we need to enable everything we want explicitly. Wall is assumed, +# but Wextra is not, for stability. +# +# These are collected from common.opt and c.opt in the GCC source, and manually +# curated with the help of the GCC documentation. Warnings that are +# application-specific, historical, or about compatibility between specific +# language revisions are omitted. The intent here is to have roughly the same +# meaning as clang's Weverything: extremely strict, but general. Specifically +# omitted are: +# +# General: +# +# Wabi= +# Waggregate-return +# Walloc-size-larger-than=BYTES +# Walloca-larger-than=BYTES +# Wframe-larger-than=BYTES +# Wlarger-than=BYTES +# Wstack-usage=BYTES +# Wsystem-headers +# Wtraditional +# Wtraditional-conversion +# Wtrampolines +# Wvla-larger-than=BYTES +# +# Build specific: +# +# Wpoison-system-directories +# +# C Specific: +# +# Wc11-c2x-compat +# Wc90-c99-compat +# Wc99-c11-compat +# Wdeclaration-after-statement +# Wtraditional +# Wtraditional-conversion +# +# C++ Specific: +# +# Wc++0x-compat +# Wc++1z-compat +# Wc++2a-compat +# Wctad-maybe-unsupported +# Wnamespaces +# Wtemplates + +# GCC warnings that apply to all C-family languages +gcc_common_warnings = [ + '-Walloc-zero', + '-Walloca', + '-Wanalyzer-too-complex', + '-Warith-conversion', + '-Warray-bounds=2', + '-Wattribute-alias=2', + '-Wbidi-chars=ucn', + '-Wcast-align=strict', + '-Wcast-function-type', + '-Wcast-qual', + '-Wclobbered', + '-Wconversion', + '-Wdate-time', + '-Wdisabled-optimization', + '-Wdouble-promotion', + '-Wduplicated-branches', + '-Wduplicated-cond', + '-Wempty-body', + '-Wendif-labels', + '-Wfloat-equal', + '-Wformat-overflow=2', + '-Wformat-signedness', + '-Wformat-truncation=2', + '-Wformat=2', + '-Wignored-qualifiers', + '-Wimplicit-fallthrough=3', + '-Winit-self', + '-Winline', + '-Winvalid-pch', + '-Wlogical-op', + '-Wmissing-declarations', + '-Wmissing-field-initializers', + '-Wmissing-include-dirs', + '-Wmultichar', + '-Wnormalized=nfc', + '-Wnull-dereference', + '-Wopenacc-parallelism', + '-Woverlength-strings', + '-Wpacked', + '-Wpacked-bitfield-compat', + '-Wpadded', + '-Wpointer-arith', + '-Wredundant-decls', + '-Wshadow', + '-Wshift-negative-value', + '-Wshift-overflow=2', + '-Wstack-protector', + '-Wstrict-aliasing=3', + '-Wstrict-overflow=5', + '-Wstring-compare', + '-Wstringop-overflow=3', + '-Wsuggest-attribute=cold', + '-Wsuggest-attribute=const', + '-Wsuggest-attribute=format', + '-Wsuggest-attribute=malloc', + '-Wsuggest-attribute=noreturn', + '-Wsuggest-attribute=pure', + '-Wswitch-default', + '-Wswitch-enum', + '-Wtrampolines', + '-Wtrivial-auto-var-init', + '-Wtype-limits', + '-Wundef', + '-Wuninitialized', + '-Wunsafe-loop-optimizations', + '-Wunused', + '-Wunused-const-variable=2', + '-Wunused-macros', + '-Wvector-operation-performance', + '-Wvla', + '-Wwrite-strings', +] + +##### +# C # +##### + +if is_variable('cc') and not is_variable('all_c_warnings') + # Set all_c_warnings for the current C compiler + all_c_warnings = [] + + if get_option('strict') + if cc.get_id() == 'clang' + all_c_warnings += ['-Weverything'] + + if not meson.is_cross_build() + all_c_warnings += [ + '-Wno-poison-system-directories', + ] + endif + + elif cc.get_id() == 'gcc' + all_c_warnings += gcc_common_warnings + [ + '-Wabsolute-value', + '-Wbad-function-cast', + '-Wc++-compat', + '-Wenum-conversion', + '-Wjump-misses-init', + '-Wmissing-parameter-type', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-declaration', + '-Wold-style-definition', + '-Woverride-init', + '-Wsign-compare', + '-Wstrict-prototypes', + '-Wunsuffixed-float-constants', + ] + + elif cc.get_id() == 'msvc' + all_c_warnings += [ + '/Wall', + '/experimental:external', + '/external:W0', + '/external:anglebrackets', + ] + endif + endif + + all_c_warnings = cc.get_supported_arguments(all_c_warnings) + add_global_arguments(all_c_warnings, language: ['c']) +endif + +####### +# C++ # +####### + +if is_variable('cpp') and not is_variable('all_cpp_warnings') + # Set all_cpp_warnings for the current C++ compiler + all_cpp_warnings = [] + + if get_option('strict') + if cpp.get_id() == 'clang' + all_cpp_warnings += [ + '-Weverything', + '-Wno-c++98-compat', + '-Wno-c++98-compat-pedantic', + ] + + if not meson.is_cross_build() + all_cpp_warnings += [ + '-Wno-poison-system-directories', + ] + endif + + elif cpp.get_id() == 'gcc' + all_cpp_warnings += gcc_common_warnings + [ + '-Wabi-tag', + '-Waligned-new=all', + '-Wcatch-value=3', + '-Wcomma-subscript', + '-Wconditionally-supported', + '-Wctor-dtor-privacy', + '-Wdelete-non-virtual-dtor', + '-Wdeprecated', + '-Wdeprecated-copy', + '-Wdeprecated-copy-dtor', + '-Wdeprecated-enum-enum-conversion', + '-Wdeprecated-enum-float-conversion', + '-Weffc++', + '-Wexpansion-to-defined', + '-Wextra-semi', + '-Wimport', + '-Winvalid-imported-macros', + '-Wmismatched-tags', + '-Wmultiple-inheritance', + '-Wnoexcept', + '-Wnoexcept-type', + '-Wnon-virtual-dtor', + '-Wold-style-cast', + '-Woverloaded-virtual', + '-Wplacement-new=2', + '-Wredundant-move', + '-Wredundant-tags', + '-Wregister', + '-Wsign-compare', + '-Wsign-promo', + '-Wsized-deallocation', + '-Wstrict-null-sentinel', + '-Wsuggest-final-methods', + '-Wsuggest-final-types', + '-Wsuggest-override', + '-Wuseless-cast', + '-Wvirtual-inheritance', + '-Wvolatile', + '-Wzero-as-null-pointer-constant', + ] + + elif cpp.get_id() == 'msvc' + all_cpp_warnings += [ + '/Wall', + '/experimental:external', + '/external:W0', + '/external:anglebrackets', + ] + endif + endif + + all_cpp_warnings = cpp.get_supported_arguments(all_cpp_warnings) + add_global_arguments(all_cpp_warnings, language: ['cpp']) +endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..089402e --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,23 @@ +option('docs', type: 'feature', value: 'auto', yield: true, + description: 'Build documentation') + +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('strict', type: 'boolean', value: false, yield: true, + description: 'Enable ultra-strict warnings') + +option('tests', type: 'feature', value: 'auto', yield: true, + description: 'Build tests') + +option('title', type: 'string', value: 'LV2', + description: 'Project title') diff --git a/plugins/README.txt b/plugins/README.txt new file mode 100644 index 0000000..361460d --- /dev/null +++ b/plugins/README.txt @@ -0,0 +1,26 @@ += Programming LV2 Plugins = +David Robillard <d@drobilla.net> +:Author Initials: DER +:toc: +:website: http://lv2plug.in/ +:doctype: book + +== Introduction == + +This is a series of well-documented example plugins that demonstrate the various features of LV2. +Starting with the most basic plugin possible, +each adds new functionality and explains the features used from a high level perspective. + +API and vocabulary reference documentation explains details, +but not the ``big picture''. +This book is intended to complement the reference documentation by providing good reference implementations of plugins, +while also conveying a higher-level understanding of LV2. + +The chapters/plugins are arranged so that each builds incrementally on its predecessor. +Reading this book front to back is a good way to become familiar with modern LV2 programming. +The reader is expected to be familiar with C, but otherwise no special knowledge is required; +the first plugin describes the basics in detail. + +This book is compiled from plugin source code into a single document for pleasant reading and ease of reference. +Each chapter corresponds to executable plugin code which can be found in the +plugins+ directory of the LV2 distribution. +If you prefer to read actual source code, all the content here is also available in the source code as comments. diff --git a/plugins/eg-amp.lv2/README.txt b/plugins/eg-amp.lv2/README.txt new file mode 100644 index 0000000..41683d3 --- /dev/null +++ b/plugins/eg-amp.lv2/README.txt @@ -0,0 +1,19 @@ +== Simple Amplifier == + +This plugin is a simple example of a basic LV2 plugin with no additional features. +It has audio ports which contain an array of `float`, +and a control port which contains a single `float`. + +LV2 plugins are defined in two parts: code and data. +The code is written in C, or any C compatible language such as C++. +Static data is described separately in the human and machine friendly http://www.w3.org/TeamSubmission/turtle/[Turtle] syntax. + +Generally, the goal is to keep code minimal, +and describe as much as possible in the static data. +There are several advantages to this approach: + + * Hosts can discover and inspect plugins without loading or executing any plugin code. + * Plugin data can be used from a wide range of generic tools like scripting languages and command line utilities. + * The standard data model allows the use of existing vocabularies to describe plugins and related information. + * The language is extensible, so authors may describe any data without requiring changes to the LV2 specification. + * Labels and documentation are translatable, and available to hosts for display in user interfaces. diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c new file mode 100644 index 0000000..5b9f577 --- /dev/null +++ b/plugins/eg-amp.lv2/amp.c @@ -0,0 +1,217 @@ +/* + 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. +*/ + +/** + LV2 headers are based on the URI of the specification they come from, so a + consistent convention can be used even for unofficial extensions. The URI + of the core LV2 specification is <http://lv2plug.in/ns/lv2core>, by + replacing `http:/` with `lv2` any header in the specification bundle can be + included, in this case `lv2.h`. +*/ +#include "lv2/core/lv2.h" + +/** Include standard C headers */ +#include <math.h> +#include <stdint.h> +#include <stdlib.h> + +/** + The URI is the identifier for a plugin, and how the host associates this + implementation in code with its description in data. In this plugin it is + only used once in the code, but defining the plugin URI at the top of the + file is a good convention to follow. If this URI does not match that used + in the data files, the host will fail to load the plugin. +*/ +#define AMP_URI "http://lv2plug.in/plugins/eg-amp" + +/** + 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; + +/** + Every plugin defines a private structure for the plugin instance. All data + associated with a plugin instance is stored here, and is available to + every instance method. In this simple plugin, only port buffers need to be + stored, since there is no additional instance data. +*/ +typedef struct { + // Port buffers + const float* gain; + const float* input; + float* output; +} Amp; + +/** + The `instantiate()` function is called by the host to create a new plugin + instance. The host passes the plugin descriptor, sample rate, and bundle + path for plugins that need to load additional resources (e.g. waveforms). + The features parameter contains host-provided features defined in LV2 + extensions, but this simple plugin does not use any. + + This function is in the ``instantiation'' threading class, so no other + methods on this instance will be called concurrently with it. +*/ +static LV2_Handle +instantiate(const LV2_Descriptor* descriptor, + double rate, + const char* bundle_path, + const LV2_Feature* const* features) +{ + Amp* amp = (Amp*)calloc(1, sizeof(Amp)); + + return (LV2_Handle)amp; +} + +/** + The `connect_port()` method is called by the host to connect a particular + port to a buffer. The plugin must store the data location, but data may not + be accessed except in run(). + + This method is in the ``audio'' threading class, and is called in the same + context as run(). +*/ +static void +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; + } +} + +/** + The `activate()` method is called by the host to initialise and prepare the + plugin instance for running. The plugin must reset all internal state + except for buffer locations set by `connect_port()`. Since this plugin has + no other internal state, 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 +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) + +/** + The `run()` method is the main process function of the plugin. It processes + a block of audio in the audio context. Since this plugin is + `lv2:hardRTCapable`, `run()` must be real-time safe, so blocking (e.g. with + a mutex) or memory allocation are not allowed. +*/ +static void +run(LV2_Handle instance, uint32_t n_samples) +{ + const Amp* amp = (const Amp*)instance; + + const float gain = *(amp->gain); + const float* const input = amp->input; + float* const output = amp->output; + + const float coef = DB_CO(gain); + + 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. + + 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()`). + + This method is in the ``instantiation'' threading class, so no other + methods on this instance will be called concurrently with it. +*/ +static void +cleanup(LV2_Handle instance) +{ + free(instance); +} + +/** + The `extension_data()` function returns any extension data supported by the + plugin. Note that this is not an instance method, but a function on the + plugin descriptor. It is usually used by plugins to implement additional + interfaces. This plugin does not have any extension data, so this function + returns NULL. + + This method is in the ``discovery'' threading class, so no other functions + or methods in this plugin library will be called concurrently with it. +*/ +static const void* +extension_data(const char* uri) +{ + return NULL; +} + +/** + Every plugin must define an `LV2_Descriptor`. It is best to define + 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}; + +/** + 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 + 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 + or methods in this plugin library will be called concurrently with it. +*/ +LV2_SYMBOL_EXPORT +const LV2_Descriptor* +lv2_descriptor(uint32_t index) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-amp.lv2/amp.ttl b/plugins/eg-amp.lv2/amp.ttl new file mode 100644 index 0000000..9f522a1 --- /dev/null +++ b/plugins/eg-amp.lv2/amp.ttl @@ -0,0 +1,90 @@ +# The full description of the plugin is in this file, which is linked to from +# `manifest.ttl`. This is done so the host only needs to scan the relatively +# small `manifest.ttl` files to quickly discover all plugins. + +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix units: <http://lv2plug.in/ns/extensions/units#> . + +# First the type of the plugin is described. All plugins must explicitly list +# `lv2:Plugin` as a type. A more specific type should also be given, where +# applicable, so hosts can present a nicer UI for loading plugins. Note that +# this URI is the identifier of the plugin, so if it does not match the one in +# `manifest.ttl`, the host will not discover the plugin data at all. +<http://lv2plug.in/plugins/eg-amp> + a lv2:Plugin , + lv2:AmplifierPlugin ; +# Plugins are associated with a project, where common information like +# developers, home page, and so on are described. This plugin is part of the +# LV2 project, which has URI <http://lv2plug.in/ns/lv2>, and is described +# elsewhere. Typical plugin collections will describe the project in +# manifest.ttl + lv2:project <http://lv2plug.in/ns/lv2> ; +# Every plugin must have a name, described with the doap:name property. +# Translations to various languages can be added by putting a language tag +# after strings as shown. + doap:name "Simple Amplifier" , + "简单放大器"@zh , + "Einfacher Verstärker"@de , + "Simple Amplifier"@en-gb , + "Amplificador Simple"@es , + "Amplificateur de Base"@fr , + "Amplificatore Semplice"@it , + "簡単なアンプ"@jp , + "Просто Усилитель"@ru ; + doap:license <http://opensource.org/licenses/isc> ; + lv2:optionalFeature lv2:hardRTCapable ; + lv2:port [ +# Every port must have at least two types, one that specifies direction +# (lv2:InputPort or lv2:OutputPort), and another to describe the data type. +# This port is a lv2:ControlPort, which means it contains a single float. + a lv2:InputPort , + lv2:ControlPort ; + lv2:index 0 ; + lv2:symbol "gain" ; + lv2:name "Gain" , + "收益"@zh , + "Verstärkung"@de , + "Gain"@en-gb , + "Aumento"@es , + "Gain"@fr , + "Guadagno"@it , + "利益"@jp , + "Увеличение"@ru ; +# An lv2:ControlPort should always describe its default value, and usually a +# minimum and maximum value. Defining a range is not strictly required, but +# should be done wherever possible to aid host support, particularly for UIs. + lv2:default 0.0 ; + lv2:minimum -90.0 ; + lv2:maximum 24.0 ; +# Ports can describe units and control detents to allow better UI generation +# and host automation. + units:unit units:db ; + lv2:scalePoint [ + rdfs:label "+5" ; + rdf:value 5.0 + ] , [ + rdfs:label "0" ; + rdf:value 0.0 + ] , [ + rdfs:label "-5" ; + rdf:value -5.0 + ] , [ + rdfs:label "-10" ; + rdf:value -10.0 + ] + ] , [ + a lv2:AudioPort , + lv2:InputPort ; + lv2:index 1 ; + lv2:symbol "in" ; + lv2:name "In" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 2 ; + lv2:symbol "out" ; + lv2:name "Out" + ] . diff --git a/plugins/eg-amp.lv2/manifest.ttl.in b/plugins/eg-amp.lv2/manifest.ttl.in new file mode 100644 index 0000000..4a22f95 --- /dev/null +++ b/plugins/eg-amp.lv2/manifest.ttl.in @@ -0,0 +1,68 @@ +# LV2 plugins are installed in a ``bundle'', a directory with a standard +# structure. Each bundle has a Turtle file named `manifest.ttl` which lists +# the contents of the bundle. +# +# Hosts typically read the manifest of every installed bundle to discover +# plugins on start-up, so it should be as small as possible for performance +# reasons. Details that are only useful if the host chooses to load the plugin +# are stored in other files and linked to from `manifest.ttl`. +# +# ==== URIs ==== +# +# LV2 makes use of URIs as globally-unique identifiers for resources. For +# example, the ID of the plugin described here is +# `<http://lv2plug.in/plugins/eg-amp>`. Note that URIs are only used as +# identifiers and don't necessarily imply that something can be accessed at +# that address on the web (though that may be the case). +# +# ==== Namespace Prefixes ==== +# +# Turtle files contain many URIs, but prefixes can be defined to improve +# readability. For example, with the `lv2:` prefix below, `lv2:Plugin` can be +# written instead of `<http://lv2plug.in/ns/lv2core#Plugin>`. + +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +# ==== Describing a Plugin ==== + +# Turtle files contain a set of ``statements'' which describe resources. +# This file contains 3 statements: +# [options="header"] +# |================================================================ +# | Subject | Predicate | Object +# | <http://lv2plug.in/plugins/eg-amp> | a | lv2:Plugin +# | <http://lv2plug.in/plugins/eg-amp> | lv2:binary | <amp.so> +# | <http://lv2plug.in/plugins/eg-amp> | rdfs:seeAlso | <amp.ttl> +# |================================================================ + +# Firstly, `<http://lv2plug.in/plugins/eg-amp>` is an LV2 plugin: +<http://lv2plug.in/plugins/eg-amp> a lv2:Plugin . + +# The predicate ```a`'' is a Turtle shorthand for `rdf:type`. + +# The binary of that plugin can be found at `<amp.ext>`: +<http://lv2plug.in/plugins/eg-amp> lv2:binary <amp@LIB_EXT@> . + +# This file is a template; the token `@LIB_EXT@` is replaced by the build +# system with the appropriate extension for the current platform before +# installation. For example, in the output `manifest.ttl`, the binary would be +# listed as `<amp.so>`. Relative URIs in manifests are relative to the bundle +# directory, so this refers to a binary with the given name in the same +# directory as this manifest. + +# Finally, more information about this plugin can be found in `<amp.ttl>`: +<http://lv2plug.in/plugins/eg-amp> rdfs:seeAlso <amp.ttl> . + +# ==== Abbreviation ==== +# +# This file shows these statements individually for instructive purposes, but +# the subject `<http://lv2plug.in/plugins/eg-amp>` is repetitive. Turtle +# allows the semicolon to be used as a delimiter that repeats the previous +# subject. For example, this manifest would more realistically be written like +# so: + +<http://lv2plug.in/plugins/eg-amp> + a lv2:Plugin ; + lv2:binary <amp@LIB_EXT@> ; + rdfs:seeAlso <amp.ttl> . diff --git a/plugins/eg-amp.lv2/meson.build b/plugins/eg-amp.lv2/meson.build new file mode 100644 index 0000000..2b15b01 --- /dev/null +++ b/plugins/eg-amp.lv2/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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-fifths.lv2/README.txt b/plugins/eg-fifths.lv2/README.txt new file mode 100644 index 0000000..2154321 --- /dev/null +++ b/plugins/eg-fifths.lv2/README.txt @@ -0,0 +1,3 @@ +== Fifths == + +This plugin demonstrates simple MIDI event reading and writing. diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c new file mode 100644 index 0000000..7527895 --- /dev/null +++ b/plugins/eg-fifths.lv2/fifths.c @@ -0,0 +1,182 @@ +/* + 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. +*/ + +#include "./uris.h" + +#include "lv2/atom/atom.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/midi/midi.h" +#include "lv2/urid/urid.h" + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +enum { FIFTHS_IN = 0, FIFTHS_OUT = 1 }; + +typedef struct { + // Features + LV2_URID_Map* map; + LV2_Log_Logger logger; + + // Ports + const LV2_Atom_Sequence* in_port; + LV2_Atom_Sequence* out_port; + + // URIs + FifthsURIs uris; +} Fifths; + +static void +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; + } +} + +static LV2_Handle +instantiate(const LV2_Descriptor* descriptor, + double rate, + 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 + // 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); +} + +static void +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; + } + } + } +} + +static const void* +extension_data(const char* uri) +{ + return NULL; +} + +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) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-fifths.lv2/fifths.ttl b/plugins/eg-fifths.lv2/fifths.ttl new file mode 100644 index 0000000..7f58a33 --- /dev/null +++ b/plugins/eg-fifths.lv2/fifths.ttl @@ -0,0 +1,30 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . +@prefix midi: <http://lv2plug.in/ns/ext/midi#> . + +<http://lv2plug.in/plugins/eg-fifths> + a lv2:Plugin ; + doap:name "Example Fifths" ; + doap:license <http://opensource.org/licenses/isc> ; + lv2:project <http://lv2plug.in/ns/lv2> ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature lv2:hardRTCapable ; + lv2:port [ + a lv2:InputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports midi:MidiEvent ; + lv2:index 0 ; + lv2:symbol "in" ; + lv2:name "In" + ] , [ + a lv2:OutputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports midi:MidiEvent ; + lv2:index 1 ; + lv2:symbol "out" ; + lv2:name "Out" + ] . diff --git a/plugins/eg-fifths.lv2/manifest.ttl.in b/plugins/eg-fifths.lv2/manifest.ttl.in new file mode 100644 index 0000000..f87f2c1 --- /dev/null +++ b/plugins/eg-fifths.lv2/manifest.ttl.in @@ -0,0 +1,8 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . + +<http://lv2plug.in/plugins/eg-fifths> + a lv2:Plugin ; + lv2:binary <fifths@LIB_EXT@> ; + rdfs:seeAlso <fifths.ttl> . diff --git a/plugins/eg-fifths.lv2/meson.build b/plugins/eg-fifths.lv2/meson.build new file mode 100644 index 0000000..fd38ee3 --- /dev/null +++ b/plugins/eg-fifths.lv2/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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 new file mode 100644 index 0000000..d26577e --- /dev/null +++ b/plugins/eg-fifths.lv2/uris.h @@ -0,0 +1,54 @@ +/* + 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. +*/ + +#ifndef FIFTHS_URIS_H +#define FIFTHS_URIS_H + +#include "lv2/atom/atom.h" +#include "lv2/midi/midi.h" +#include "lv2/patch/patch.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; +} 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); +} + +#endif /* FIFTHS_URIS_H */ diff --git a/plugins/eg-metro.lv2/README.txt b/plugins/eg-metro.lv2/README.txt new file mode 100644 index 0000000..5e9a84a --- /dev/null +++ b/plugins/eg-metro.lv2/README.txt @@ -0,0 +1,9 @@ +== Metronome == + +This plugin demonstrates tempo synchronisation by clicking on every beat. The +host sends this information to the plugin as events, so an event with new time +and tempo information will be received whenever there is a change. + +Time is assumed to continue rolling at the tempo and speed defined by the last +received tempo event, even across cycles, until a new tempo event is received +or the plugin is deactivated. diff --git a/plugins/eg-metro.lv2/manifest.ttl.in b/plugins/eg-metro.lv2/manifest.ttl.in new file mode 100644 index 0000000..bd93f66 --- /dev/null +++ b/plugins/eg-metro.lv2/manifest.ttl.in @@ -0,0 +1,7 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/plugins/eg-metro> + a lv2:Plugin ; + lv2:binary <metro@LIB_EXT@> ; + rdfs:seeAlso <metro.ttl> . diff --git a/plugins/eg-metro.lv2/meson.build b/plugins/eg-metro.lv2/meson.build new file mode 100644 index 0000000..f881eca --- /dev/null +++ b/plugins/eg-metro.lv2/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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 new file mode 100644 index 0000000..c89c542 --- /dev/null +++ b/plugins/eg-metro.lv2/metro.c @@ -0,0 +1,353 @@ +/* + 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. +*/ + +#include "lv2/atom/atom.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/time/time.h" +#include "lv2/urid/urid.h" + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifndef M_PI +# 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; +} MetroURIs; + +static const double attack_s = 0.005; +static const double decay_s = 0.075; + +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; + +/** + This plugin must keep track of more state than previous examples to be able + to render audio. The basic idea is to generate a single cycle of a sine + wave which is conceptually played continuously. The 'tick' is generated by + enveloping the amplitude so there is a short attack/decay peak around a + tick, and silence the rest of the time. + + This example uses a simple AD envelope with fixed parameters. A more + sophisticated implementation might use a more advanced envelope and allow + 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; +} Metro; + +static void +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; + } +} + +/** + The activate() method resets the state completely, so the wave offset is + zero and the envelope is off. +*/ +static void +activate(LV2_Handle instance) +{ + Metro* self = (Metro*)instance; + + self->elapsed_len = 0; + self->wave_offset = 0; + self->state = STATE_OFF; +} + +/** + This plugin does a bit more work in instantiate() than the previous + examples. The tempo updates from the host contain several URIs, so those + are mapped, and the sine wave to be played needs to be generated based on + the current sample rate. +*/ +static LV2_Handle +instantiate(const LV2_Descriptor* descriptor, + double rate, + 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 + // 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); +} + +/** + Play back audio for the range [begin..end) relative to this cycle. This is + called by run() in-between events to output audio up until the current time. +*/ +static void +play(Metro* self, uint32_t begin, uint32_t end) +{ + 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; + } + } +} + +/** + Update the current position based on a host message. This is called by + run() when a time:Position is received. +*/ +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; + 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, (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 +}; + +LV2_SYMBOL_EXPORT +const LV2_Descriptor* +lv2_descriptor(uint32_t index) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-metro.lv2/metro.ttl b/plugins/eg-metro.lv2/metro.ttl new file mode 100644 index 0000000..8b4af3d --- /dev/null +++ b/plugins/eg-metro.lv2/metro.ttl @@ -0,0 +1,30 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix time: <http://lv2plug.in/ns/ext/time#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . + +<http://lv2plug.in/plugins/eg-metro> + a lv2:Plugin ; + doap:name "Example Metronome" ; + doap:license <http://opensource.org/licenses/isc> ; + lv2:project <http://lv2plug.in/ns/lv2> ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature lv2:hardRTCapable ; + lv2:port [ + a lv2:InputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; +# Since this port supports time:Position, the host knows to deliver time and +# tempo information + atom:supports time:Position ; + lv2:index 0 ; + lv2:symbol "control" ; + lv2:name "Control" ; + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 1 ; + lv2:symbol "out" ; + lv2:name "Out" ; + ] . diff --git a/plugins/eg-midigate.lv2/README.txt b/plugins/eg-midigate.lv2/README.txt new file mode 100644 index 0000000..8f4a0f0 --- /dev/null +++ b/plugins/eg-midigate.lv2/README.txt @@ -0,0 +1,10 @@ +== MIDI Gate == + +This plugin demonstrates: + + * Receiving MIDI input + + * Processing audio based on MIDI events with sample accuracy + + * Supporting MIDI programs which the host can control/automate, or present a + user interface for with human readable labels diff --git a/plugins/eg-midigate.lv2/manifest.ttl.in b/plugins/eg-midigate.lv2/manifest.ttl.in new file mode 100644 index 0000000..d32f1dc --- /dev/null +++ b/plugins/eg-midigate.lv2/manifest.ttl.in @@ -0,0 +1,10 @@ +# The manifest.ttl file follows the same template as the previous example. + +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . + +<http://lv2plug.in/plugins/eg-midigate> + a lv2:Plugin ; + lv2:binary <midigate@LIB_EXT@> ; + rdfs:seeAlso <midigate.ttl> . diff --git a/plugins/eg-midigate.lv2/meson.build b/plugins/eg-midigate.lv2/meson.build new file mode 100644 index 0000000..0e35fd1 --- /dev/null +++ b/plugins/eg-midigate.lv2/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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 new file mode 100644 index 0000000..d98f670 --- /dev/null +++ b/plugins/eg-midigate.lv2/midigate.c @@ -0,0 +1,234 @@ +/* + 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. +*/ + +#include "lv2/atom/atom.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/midi/midi.h" +#include "lv2/urid/urid.h" + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MIDIGATE_URI "http://lv2plug.in/plugins/eg-midigate" + +typedef enum { + MIDIGATE_CONTROL = 0, + MIDIGATE_IN = 1, + MIDIGATE_OUT = 2 +} PortIndex; + +typedef struct { + // Port buffers + const LV2_Atom_Sequence* control; + const float* in; + float* out; + + // Features + LV2_URID_Map* map; + LV2_Log_Logger logger; + + struct { + LV2_URID midi_MidiEvent; + } uris; + + unsigned n_active_notes; + unsigned program; // 0 = normal, 1 = inverted +} Midigate; + +static LV2_Handle +instantiate(const LV2_Descriptor* descriptor, + double rate, + 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 + // 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) +{ + 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; +} + +/** + A function to write a chunk of output, to be called from run(). If the gate + is high, then the input will be passed through for this chunk, otherwise + silence is written. +*/ +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)); + } +} + +/** + This plugin works through the cycle in chunks starting at offset zero. The + +offset+ represents the current time within this this cycle, so + the output from 0 to +offset+ has already been written. + + MIDI events are read in a loop. In each iteration, the number of active + notes (on note on and note off) or the program (on program change) is + updated, then the output is written up until the current event time. Then + +offset+ is updated and the next event is processed. After the loop the + final chunk from the last event to the end of the cycle is emitted. + + There is currently no standard way to describe MIDI programs in LV2, so the + host has no way of knowing that these programs exist and should be presented + to the user. A future version of LV2 will address this shortcoming. + + This pattern of iterating over input events and writing output along the way + is a common idiom for writing sample accurate output based on event input. + + Note that this simple example simply writes input or zero for each sample + based on the gate. A serious implementation would need to envelope the + transition to avoid aliasing. +*/ +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) { + 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); +} + +/** + We have no resources to free on deactivation. + Note that the next call to activate will re-initialise the state, namely + self->n_active_notes, so there is no need to do so here. +*/ +static void +deactivate(LV2_Handle instance) +{} + +static void +cleanup(LV2_Handle instance) +{ + free(instance); +} + +/** + This plugin also has no extension data to return. +*/ +static const void* +extension_data(const char* uri) +{ + return NULL; +} + +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) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-midigate.lv2/midigate.ttl b/plugins/eg-midigate.lv2/midigate.ttl new file mode 100644 index 0000000..e14a329 --- /dev/null +++ b/plugins/eg-midigate.lv2/midigate.ttl @@ -0,0 +1,56 @@ +# The same set of namespace prefixes with two additions for LV2 extensions this +# plugin uses: atom and urid. + +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix midi: <http://lv2plug.in/ns/ext/midi#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . + +<http://lv2plug.in/plugins/eg-midigate> + a lv2:Plugin ; + doap:name "Example MIDI Gate" ; + doap:license <http://opensource.org/licenses/isc> ; + lv2:project <http://lv2plug.in/ns/lv2> ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature lv2:hardRTCapable ; +# This plugin has three ports. There is an audio input and output as before, +# as well as a new AtomPort. An AtomPort buffer contains an Atom, which is a +# generic container for any type of data. In this case, we want to receive +# MIDI events, so the (mandatory) +atom:bufferType+ is atom:Sequence, which is +# a series of events with time stamps. +# +# Events themselves are also generic and can contain any type of data, but in +# this case we are only interested in MIDI events. The (optional) +# +atom:supports+ property describes which event types are supported. Though +# not required, this information should always be given so the host knows what +# types of event it can expect the plugin to understand. +# +# The (optional) +lv2:designation+ of this port is +lv2:control+, which +# indicates that this is the "main" control port where the host should send +# events it expects to configure the plugin, in this case changing the MIDI +# program. This is necessary since it is possible to have several MIDI input +# ports, though typically it is best to have one. + lv2:port [ + a lv2:InputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports midi:MidiEvent ; + lv2:designation lv2:control ; + lv2:index 0 ; + lv2:symbol "control" ; + lv2:name "Control" + ] , [ + a lv2:AudioPort , + lv2:InputPort ; + lv2:index 1 ; + lv2:symbol "in" ; + lv2:name "In" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 2 ; + lv2:symbol "out" ; + lv2:name "Out" + ] . diff --git a/plugins/eg-params.lv2/README.txt b/plugins/eg-params.lv2/README.txt new file mode 100644 index 0000000..acf90c1 --- /dev/null +++ b/plugins/eg-params.lv2/README.txt @@ -0,0 +1,21 @@ +== Params == + +The basic LV2 mechanism for controls is +http://lv2plug.in/ns/lv2core#ControlPort[lv2:ControlPort], inherited from +LADSPA. Control ports are problematic because they are not sample accurate, +support only one type (`float`), and require that plugins poll to know when a +control has changed. + +Parameters can be used instead to address these issues. Parameters can be +thought of as properties of a plugin instance; they are identified by URI and +have a value of any type. This deliberately meshes with the concept of plugin +state defined by the http://lv2plug.in/ns/ext/state[LV2 state extension]. +The state extension allows plugins to save and restore their parameters (along +with other internal state information, if necessary). + +Parameters are accessed and manipulated using messages sent via a sequence +port. The http://lv2plug.in/ns/ext/patch[LV2 patch extension] defines the +standard messages for working with parameters. Typically, only two are used +for simple plugins: http://lv2plug.in/ns/ext/patch#Set[patch:Set] sets a +parameter to some value, and http://lv2plug.in/ns/ext/patch#Get[patch:Get] +requests that the plugin send a description of its parameters. diff --git a/plugins/eg-params.lv2/manifest.ttl.in b/plugins/eg-params.lv2/manifest.ttl.in new file mode 100644 index 0000000..913de7c --- /dev/null +++ b/plugins/eg-params.lv2/manifest.ttl.in @@ -0,0 +1,7 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/plugins/eg-params> + a lv2:Plugin ; + lv2:binary <params@LIB_EXT@> ; + rdfs:seeAlso <params.ttl> . diff --git a/plugins/eg-params.lv2/meson.build b/plugins/eg-params.lv2/meson.build new file mode 100644 index 0000000..4c1e576 --- /dev/null +++ b/plugins/eg-params.lv2/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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 new file mode 100644 index 0000000..052b43b --- /dev/null +++ b/plugins/eg-params.lv2/params.c @@ -0,0 +1,534 @@ +/* + 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. +*/ + +#include "state_map.h" + +#include "lv2/atom/atom.h" +#include "lv2/atom/forge.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/midi/midi.h" +#include "lv2/patch/patch.h" +#include "lv2/state/state.h" +#include "lv2/urid/urid.h" + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MAX_STRING 1024 + +#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; +} 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; +} 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); +} + +enum { PARAMS_IN = 0, PARAMS_OUT = 1 }; + +typedef struct { + // Features + LV2_URID_Map* map; + LV2_URID_Unmap* unmap; + LV2_Log_Logger log; + + // Forge for creating atoms + LV2_Atom_Forge forge; + + // Ports + const LV2_Atom_Sequence* in_port; + LV2_Atom_Sequence* out_port; + + // URIs + URIs uris; + + // Plugin state + StateMapItem props[N_PROPS]; + State state; + + // 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) +{ + 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 +instantiate(const LV2_Descriptor* descriptor, + double rate, + const char* path, + const LV2_Feature* const* features) +{ + // 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); +} + +/** 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); + } + + 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) +{ + 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 +set_parameter(Params* self, + LV2_URID key, + uint32_t size, + LV2_URID type, + 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; +} + +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; +} + +static LV2_State_Status +write_param_to_forge(LV2_State_Handle handle, + uint32_t key, + const void* value, + size_t size, + uint32_t type, + uint32_t flags) +{ + 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; + } + + return LV2_STATE_SUCCESS; +} + +static void +store_prop(Params* self, + LV2_State_Map_Path* map_path, + LV2_State_Status* save_status, + LV2_State_Store_Function store, + LV2_State_Handle handle, + LV2_URID key, + const LV2_Atom* value) +{ + 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; + } +} + +/** + State save method. + + This is used in the usual way when called by the host to save plugin state, + but also internally for writing messages in the audio thread by passing a + "store" function which actually writes the description to the forge. +*/ +static LV2_State_Status +save(LV2_Handle instance, + LV2_State_Store_Function store, + LV2_State_Handle handle, + 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); + + 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; +} + +static void +retrieve_prop(Params* self, + LV2_State_Status* restore_status, + LV2_State_Retrieve_Function retrieve, + LV2_State_Handle handle, + LV2_URID key) +{ + // 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. */ +static LV2_State_Status +restore(LV2_Handle instance, + LV2_State_Retrieve_Function retrieve, + LV2_State_Handle handle, + uint32_t flags, + const LV2_Feature* const* features) +{ + 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); + } + + 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)); +} + +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; + + // 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_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; +} diff --git a/plugins/eg-params.lv2/params.ttl b/plugins/eg-params.lv2/params.ttl new file mode 100644 index 0000000..931c826 --- /dev/null +++ b/plugins/eg-params.lv2/params.ttl @@ -0,0 +1,126 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix param: <http://lv2plug.in/ns/ext/parameters#> . +@prefix patch: <http://lv2plug.in/ns/ext/patch#> . +@prefix plug: <http://lv2plug.in/plugins/eg-params#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix state: <http://lv2plug.in/ns/ext/state#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +# An existing parameter or RDF property can be used as a parameter. The LV2 +# parameters extension <http://lv2plug.in/ns/ext/parameters> defines many +# common audio parameters. Where possible, existing parameters should be used +# so hosts can intelligently control plugins. + +# If no suitable parameter exists, one can be defined for the plugin like so: + +plug:int + a lv2:Parameter ; + rdfs:label "int" ; + rdfs:range atom:Int . + +plug:long + a lv2:Parameter ; + rdfs:label "long" ; + rdfs:range atom:Long . + +plug:float + a lv2:Parameter ; + rdfs:label "float" ; + rdfs:range atom:Float . + +plug:double + a lv2:Parameter ; + rdfs:label "double" ; + rdfs:range atom:Double . + +plug:bool + a lv2:Parameter ; + rdfs:label "bool" ; + rdfs:range atom:Bool . + +plug:string + a lv2:Parameter ; + rdfs:label "string" ; + rdfs:range atom:String . + +plug:path + a lv2:Parameter ; + rdfs:label "path" ; + rdfs:range atom:Path . + +plug:lfo + a lv2:Parameter ; + rdfs:label "LFO" ; + rdfs:range atom:Float ; + lv2:minimum -1.0 ; + lv2:maximum 1.0 . + +plug:spring + a lv2:Parameter ; + rdfs:label "spring" ; + rdfs:range atom:Float . + +# Most of the plugin description is similar to the others we have seen, but +# this plugin has only two ports, for receiving and sending messages used to +# manipulate and access parameters. +<http://lv2plug.in/plugins/eg-params> + a lv2:Plugin , + lv2:UtilityPlugin ; + doap:name "Example Parameters" ; + doap:license <http://opensource.org/licenses/isc> ; + lv2:project <http://lv2plug.in/ns/lv2> ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature lv2:hardRTCapable , + state:loadDefaultState ; + lv2:extensionData state:interface ; + lv2:port [ + a lv2:InputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports patch:Message ; + lv2:designation lv2:control ; + lv2:index 0 ; + lv2:symbol "in" ; + lv2:name "In" + ] , [ + a lv2:OutputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports patch:Message ; + lv2:designation lv2:control ; + lv2:index 1 ; + lv2:symbol "out" ; + lv2:name "Out" + ] ; +# The plugin must list all parameters that can be written (e.g. changed by the +# user) as patch:writable: + patch:writable plug:int , + plug:long , + plug:float , + plug:double , + plug:bool , + plug:string , + plug:path , + plug:spring ; +# Similarly, parameters that may change internally must be listed as patch:readable, +# meaning to host should watch for changes to the parameter's value: + patch:readable plug:lfo , + plug:spring ; +# Parameters map directly to properties of the plugin's state. So, we can +# specify initial parameter values with the state:state property. The +# state:loadDefaultState feature (required above) requires that the host loads +# the default state after instantiation but before running the plugin. + state:state [ + plug:int 0 ; + plug:long "0"^^xsd:long ; + plug:float "0.1234"^^xsd:float ; + plug:double "0e0"^^xsd:double ; + plug:bool false ; + plug:string "Hello, world" ; + plug:path <params.ttl> ; + plug:spring "0.0"^^xsd:float ; + plug:lfo "0.0"^^xsd:float + ] . diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h new file mode 100644 index 0000000..4a00d2f --- /dev/null +++ b/plugins/eg-params.lv2/state_map.h @@ -0,0 +1,116 @@ +/* + 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. +*/ + +#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; +} 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; + } + + if (kb->urid < ka->urid) { + return 1; + } + + return 0; +} + +/** Helper macro for terse state map initialisation. */ +#define STATE_MAP_INIT(type, ptr) \ + (LV2_ATOM__##type), (sizeof(*(ptr)) - sizeof(LV2_Atom)), (ptr) + +/** + Initialise a state map. + + The variable parameters list must be NULL terminated, and is a sequence of + const char* uri, const char* type, uint32_t size, LV2_Atom* value. The + value must point to a valid atom that resides elsewhere, the state map is + only an index and does not contain actual state values. The macro + STATE_MAP_INIT can be used to make simpler code when state is composed of + standard atom types, for example: + + struct Plugin { + LV2_URID_Map* map; + StateMapItem props[3]; + // ... + }; + + state_map_init( + self->props, self->map, self->map->handle, + PLUG_URI "#gain", STATE_MAP_INIT(Float, &state->gain), + PLUG_URI "#offset", STATE_MAP_INIT(Int, &state->offset), + PLUG_URI "#file", STATE_MAP_INIT(Path, &state->file), + 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 */...) +{ + // 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); +} + +/** + Retrieve an item from a state map by URID. + + This takes O(lg(n)) time, and is useful for implementing generic property + access with little code, for example to respond to patch:Get messages for a + specific property. +*/ +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); +} diff --git a/plugins/eg-sampler.lv2/README.txt b/plugins/eg-sampler.lv2/README.txt new file mode 100644 index 0000000..8d136fa --- /dev/null +++ b/plugins/eg-sampler.lv2/README.txt @@ -0,0 +1,14 @@ +== Sampler == + +This plugin loads a single sample from a .wav file and plays it back when a MIDI +note on is received. Any sample on the system can be loaded via another event. +A Gtk UI is included which does this, but the host can as well. + +This plugin illustrates: + +- UI <==> Plugin communication via events +- Use of the worker extension for non-realtime tasks (sample loading) +- Use of the log extension to print log messages via the host +- Saving plugin state via the state extension +- Dynamic plugin control via the same properties saved to state +- Network-transparent waveform display with incremental peak transmission diff --git a/plugins/eg-sampler.lv2/atom_sink.h b/plugins/eg-sampler.lv2/atom_sink.h new file mode 100644 index 0000000..57035e1 --- /dev/null +++ b/plugins/eg-sampler.lv2/atom_sink.h @@ -0,0 +1,47 @@ +/* + 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. +*/ + +#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. + + It is assumed that the handle points to an LV2_Atom large enough to store + the forge output. The forged result is in the body of the buffer atom. +*/ +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; +} + +/** + Dereference counterpart to atom_sink(). +*/ +static LV2_Atom* +atom_sink_deref(LV2_Atom_Forge_Sink_Handle handle, LV2_Atom_Forge_Ref ref) +{ + return (LV2_Atom*)((char*)handle + ref); +} diff --git a/plugins/eg-sampler.lv2/click.wav b/plugins/eg-sampler.lv2/click.wav Binary files differnew file mode 100644 index 0000000..520a18c --- /dev/null +++ b/plugins/eg-sampler.lv2/click.wav diff --git a/plugins/eg-sampler.lv2/manifest.ttl.in b/plugins/eg-sampler.lv2/manifest.ttl.in new file mode 100644 index 0000000..e688256 --- /dev/null +++ b/plugins/eg-sampler.lv2/manifest.ttl.in @@ -0,0 +1,19 @@ +# Unlike the previous examples, this manifest lists more than one resource: the +# plugin as usual, and the UI. The descriptions are similar, but have +# different types, so the host can decide from this file alone whether or not +# it is interested, and avoid following the `rdfs:seeAlso` link if not (though +# in this case both are described in the same file). + +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . + +<http://lv2plug.in/plugins/eg-sampler> + a lv2:Plugin ; + lv2:binary <sampler@LIB_EXT@> ; + rdfs:seeAlso <sampler.ttl> . + +<http://lv2plug.in/plugins/eg-sampler#ui> + a ui:GtkUI ; + 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..1283a8f --- /dev/null +++ b/plugins/eg-sampler.lv2/meson.build @@ -0,0 +1,48 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +plugin_sources = files('sampler.c') +bundle_name = 'eg-sampler.lv2' +data_filenames = ['manifest.ttl.in', 'sampler.ttl', 'click.wav'] + +samplerate_dep = dependency('samplerate', + version: '>= 0.1.0', + required: get_option('plugins')) + +sndfile_dep = dependency('sndfile', + version: '>= 1.0.0', + required: get_option('plugins')) + +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 +endif diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h new file mode 100644 index 0000000..7a5f3e3 --- /dev/null +++ b/plugins/eg-sampler.lv2/peaks.h @@ -0,0 +1,280 @@ +/* + 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. +*/ + +#ifndef PEAKS_H_INCLUDED +#define PEAKS_H_INCLUDED + +/** + This file defines utilities for sending and receiving audio peaks for + waveform display. The functionality is divided into two objects: + PeaksSender, for sending peaks updates from the plugin, and PeaksReceiver, + for receiving such updates and caching the peaks. + + This allows peaks for a waveform of any size at any resolution to be + requested, with reasonably sized incremental updates sent over plugin ports. +*/ + +#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" + +#ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +# 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; +} 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 +} PeaksSender; + +typedef struct { + PeaksURIs uris; ///< URIDs used in protocol + float* peaks; ///< Received peaks, or zeroes + uint32_t n_peaks; ///< Total number of peaks +} PeaksReceiver; + +/** + Map URIs used in the peaks protocol. +*/ +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); +} + +/** + Initialise peaks sender. The new sender is inactive and will do nothing + when `peaks_sender_send()` is called, until a transmission is started with + `peaks_sender_start()`. +*/ +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; +} + +/** + Prepare to start a new peaks transmission. After this is called, the peaks + can be sent with successive calls to `peaks_sender_send()`. +*/ +static inline void +peaks_sender_start(PeaksSender* sender, + const float* samples, + 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; +} + +/** + Forge a message which sends a range of peaks. Writes a peaks:PeakUpdate + object to `forge`, like: + + [source,turtle] + ---- + [] + a peaks:PeakUpdate ; + peaks:offset 256 ; + peaks:total 1024 ; + peaks:magnitudes [ 0.2f, 0.3f, ... ] . + ---- +*/ +static inline bool +peaks_sender_send(PeaksSender* sender, + LV2_Atom_Forge* forge, + 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, (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; +} + +/** + Initialise a peaks receiver. The receiver stores an array of all peaks, + which is updated incrementally with peaks_receiver_receive(). +*/ +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; +} + +/** + Clear stored peaks and free all memory. This should be called when the + peaks are to be updated with a different audio source. +*/ +static inline void +peaks_receiver_clear(PeaksReceiver* receiver) +{ + free(receiver->peaks); + receiver->peaks = NULL; + receiver->n_peaks = 0; +} + +/** + Handle PeakUpdate message. + + The stored peaks array is updated with the slice of peaks in `update`, + resizing if necessary while preserving contents. + + Returns 0 if peaks have been updated, negative on error. +*/ +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; + + // 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 new file mode 100644 index 0000000..c978d2b --- /dev/null +++ b/plugins/eg-sampler.lv2/sampler.c @@ -0,0 +1,710 @@ +/* + 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. +*/ + +#include "atom_sink.h" +#include "peaks.h" +#include "uris.h" + +#include "lv2/atom/atom.h" +#include "lv2/atom/forge.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/midi/midi.h" +#include "lv2/state/state.h" +#include "lv2/urid/urid.h" +#include "lv2/worker/worker.h" + +#include <samplerate.h> +#include <sndfile.h> + +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +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 +} 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; + float gain_dB; + sf_count_t frame; + bool play; + bool activated; + bool gain_changed; + bool sample_changed; + int sample_rate; +} Sampler; + +/** + An atom-like message used internally to apply/free samples. + + This is only used internally to communicate with the worker, it is never + sent to the outside world via a port since it is not POD. It is convenient + to use an Atom header so actual atoms can be easily sent through the same + ringbuffer. +*/ +typedef struct { + 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 + worker thread only. The sample is loaded and returned only, plugin state is + not modified. +*/ +static Sample* +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 (!(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); + } +} + +/** + Do work in a non-realtime thread. + + This is called for every piece of work scheduled in the audio thread using + self->schedule->schedule_work(). A reply can be sent back to the audio + thread using the provided `respond` function. +*/ +static LV2_Worker_Status +work(LV2_Handle instance, + LV2_Worker_Respond_Function respond, + LV2_Worker_Respond_Handle handle, + 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, self->sample_rate); + if (sample) { + // Send new sample to run() to be applied + respond(handle, sizeof(Sample*), &sample); + } + } + + return LV2_WORKER_SUCCESS; +} + +/** + Handle a response from work() in the audio thread. + + When running normally, this will be called by the host after run(). When + freewheeling, this will be called immediately at the point the work was + scheduled. +*/ +static LV2_Worker_Status +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; + + // Install the new sample + self->sample = *(Sample* const*)data; + + // Stop playing previous sample, which can be larger than new one + self->frame = 0; + self->play = false; + + // 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); + + // 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) +{ + 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 +instantiate(const LV2_Descriptor* descriptor, + double rate, + 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 + // 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); +} + +static void +activate(LV2_Handle instance) +{ + ((Sampler*)instance)->activated = true; +} + +static void +deactivate(LV2_Handle instance) +{ + ((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) + +/** + Handle an incoming event in the audio thread. + + This performs any actions triggered by an event, such as the start of sample + playback, a sample change, or responding to requests from the UI. +*/ +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; + + // 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); + } +} + +/** + Output audio for a slice of the current cycle. +*/ +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; + } +} + +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 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 +save(LV2_Handle instance, + LV2_State_Store_Function store, + LV2_State_Handle handle, + 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); + + // 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 +restore(LV2_Handle instance, + LV2_State_Retrieve_Function retrieve, + LV2_State_Handle handle, + 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; + + // 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; + } + + 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}; + +LV2_SYMBOL_EXPORT +const LV2_Descriptor* +lv2_descriptor(uint32_t index) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-sampler.lv2/sampler.ttl b/plugins/eg-sampler.lv2/sampler.ttl new file mode 100644 index 0000000..4a3c24c --- /dev/null +++ b/plugins/eg-sampler.lv2/sampler.ttl @@ -0,0 +1,73 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix param: <http://lv2plug.in/ns/ext/parameters#> . +@prefix patch: <http://lv2plug.in/ns/ext/patch#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix state: <http://lv2plug.in/ns/ext/state#> . +@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . +@prefix work: <http://lv2plug.in/ns/ext/worker#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . + +<http://lv2plug.in/plugins/eg-sampler#sample> + a lv2:Parameter ; + rdfs:label "sample" ; + rdfs:range atom:Path . + +<http://lv2plug.in/plugins/eg-sampler> + a lv2:Plugin ; + doap:name "Exampler" ; + doap:license <http://opensource.org/licenses/isc> ; + lv2:project <http://lv2plug.in/ns/lv2> ; + lv2:requiredFeature state:loadDefaultState , + urid:map , + work:schedule ; + lv2:optionalFeature lv2:hardRTCapable , + state:threadSafeRestore ; + lv2:extensionData state:interface , + work:interface ; + ui:ui <http://lv2plug.in/plugins/eg-sampler#ui> ; + patch:writable <http://lv2plug.in/plugins/eg-sampler#sample> , + param:gain ; + lv2:port [ + a lv2:InputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports <http://lv2plug.in/ns/ext/midi#MidiEvent> , + patch:Message ; + lv2:designation lv2:control ; + lv2:index 0 ; + lv2:symbol "control" ; + lv2:name "Control" + ] , [ + a lv2:OutputPort , + atom:AtomPort ; + atom:bufferType atom:Sequence ; + atom:supports patch:Message ; + lv2:designation lv2:control ; + lv2:index 1 ; + lv2:symbol "notify" ; + lv2:name "Notify" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 2 ; + lv2:symbol "out" ; + lv2:name "Out" + ] ; + state:state [ + <http://lv2plug.in/plugins/eg-sampler#sample> <click.wav> ; + param:gain "0.0"^^xsd:float + ] . + +<http://lv2plug.in/plugins/eg-sampler#ui> + a ui:GtkUI ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature ui:requestValue ; + lv2:extensionData ui:showInterface ; + ui:portNotification [ + ui:plugin <http://lv2plug.in/plugins/eg-sampler> ; + lv2:symbol "notify" ; + ui:notifyType atom:Blank + ] . diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c new file mode 100644 index 0000000..630fc22 --- /dev/null +++ b/plugins/eg-sampler.lv2/sampler_ui.c @@ -0,0 +1,473 @@ +/* + 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. +*/ + +#include "peaks.h" +#include "uris.h" + +#include "lv2/atom/atom.h" +#include "lv2/atom/forge.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/midi/midi.h" +#include "lv2/ui/ui.h" +#include "lv2/urid/urid.h" + +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> + +#include <assert.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#define SAMPLER_UI_URI "http://lv2plug.in/plugins/eg-sampler#ui" + +#define MIN_CANVAS_W 128 +#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; +} SamplerUI; + +static void +on_file_set(GtkFileChooserButton* widget, void* handle) +{ + SamplerUI* ui = (SamplerUI*)handle; + + // 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)); + + assert(msg); + + 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; + + 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, + ¬e_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; +} + +/** 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); +} + +static gboolean +on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data) +{ + SamplerUI* ui = (SamplerUI*)data; + + GtkAllocation size; + gtk_widget_get_allocation(widget, &size); + + 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_set_line_width(cr, 1.0); + cairo_translate(cr, 0.5, 0.5); + + 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); + + // 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); + } + + // 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); + + cairo_set_source_gdk(cr, widget->style->mid); + cairo_fill_preserve(cr); + + cairo_set_source_gdk(cr, widget->style->fg); + cairo_stroke(cr); + } + + 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; + } +} + +static gboolean +on_window_closed(GtkWidget* widget, GdkEvent* event, gpointer 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; + + return FALSE; +} + +static LV2UI_Handle +instantiate(const 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) +{ + 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); +} + +static void +port_event(LV2UI_Handle handle, + uint32_t port_index, + uint32_t buffer_size, + 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"); + } +} + +/* Optional non-embedded UI show interface. */ +static int +ui_show(LV2UI_Handle handle) +{ + SamplerUI* ui = (SamplerUI*)handle; + + 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; + } + + 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); + + gtk_widget_show_all(ui->window); + gtk_window_present(GTK_WINDOW(ui->window)); + + return 0; +} + +/* Optional non-embedded UI hide interface. */ +static int +ui_hide(LV2UI_Handle handle) +{ + SamplerUI* ui = (SamplerUI*)handle; + + if (ui->window) { + destroy_window(ui); + } + + 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; +} + +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; + } + + if (!strcmp(uri, LV2_UI__idleInterface)) { + return &idle; + } + + return NULL; +} + +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) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h new file mode 100644 index 0000000..d7201fa --- /dev/null +++ b/plugins/eg-sampler.lv2/uris.h @@ -0,0 +1,184 @@ +/* + 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. +*/ + +#ifndef SAMPLER_URIS_H +#define SAMPLER_URIS_H + +#include "lv2/atom/atom.h" +#include "lv2/atom/forge.h" +#include "lv2/atom/util.h" +#include "lv2/midi/midi.h" +#include "lv2/parameters/parameters.h" +#include "lv2/patch/patch.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__applySample EG_SAMPLER_URI "#applySample" +#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; +} 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); +} + +/** + 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; +} + +/** + Write a message like the following to `forge`: + [source,turtle] + ---- + [] + a patch:Set ; + patch:property eg:sample ; + patch:value </home/me/foo.wav> . + ---- +*/ +static inline LV2_Atom_Forge_Ref +write_set_file(LV2_Atom_Forge* forge, + const SamplerURIs* uris, + 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_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; +} + +/** + Get the file path from `obj` which is a message like: + [source,turtle] + ---- + [] + a patch:Set ; + patch:property eg:sample ; + patch:value </home/me/foo.wav> . + ---- +*/ +static inline const char* +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); +} + +#endif /* SAMPLER_URIS_H */ diff --git a/plugins/eg-scope.lv2/README.txt b/plugins/eg-scope.lv2/README.txt new file mode 100644 index 0000000..122794c --- /dev/null +++ b/plugins/eg-scope.lv2/README.txt @@ -0,0 +1,32 @@ +== Simple Oscilloscope == + +This plugin displays the waveform of an incoming audio signal using a simple +GTK+Cairo GUI. + +This plugin illustrates: + +- UI <==> Plugin communication via http://lv2plug.in/ns/ext/atom/[LV2 Atom] events +- Atom vector usage and resize-port extension +- Save/Restore UI state by communicating state to backend +- Saving simple key/value state via the http://lv2plug.in/ns/ext/state/[LV2 State] extension +- Cairo drawing and partial exposure + +This plugin intends to outline the basics for building visualization plugins +that rely on atom communication. The UI looks like an oscilloscope, but is not +a real oscilloscope implementation: + +- There is no display synchronisation, results will depend on LV2 host. +- It displays raw audio samples, which a proper scope must not do. +- The display itself just connects min/max line segments. +- No triggering or synchronization. +- No labels, no scale, no calibration, no markers, no numeric readout, etc. + +Addressing these issues is beyond the scope of this example. + +Please see http://lac.linuxaudio.org/2013/papers/36.pdf for scope design, +https://wiki.xiph.org/Videos/Digital_Show_and_Tell for background information, +and http://lists.lv2plug.in/pipermail/devel-lv2plug.in/2013-November/000545.html +for general LV2 related conceptual criticism regarding real-time visualizations. + +A proper oscilloscope based on this example can be found at +https://github.com/x42/sisco.lv2 diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c new file mode 100644 index 0000000..8bc4ca1 --- /dev/null +++ b/plugins/eg-scope.lv2/examploscope.c @@ -0,0 +1,426 @@ +/* + 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. +*/ + +#include "./uris.h" + +#include "lv2/atom/atom.h" +#include "lv2/atom/forge.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/core/lv2_util.h" +#include "lv2/log/log.h" +#include "lv2/log/logger.h" +#include "lv2/state/state.h" +#include "lv2/urid/urid.h" + +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/** + ==== Private Plugin Instance Structure ==== + + In addition to the usual port buffers and features, this plugin stores the + state of the UI here, so it can be opened and closed without losing the + current settings. The UI state is communicated between the plugin and the + 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; +} 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) +} PortIndex; + +/** ==== Instantiate Method ==== */ +static LV2_Handle +instantiate(const LV2_Descriptor* descriptor, + double rate, + 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 + // 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) +{ + 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; + } +} + +/** + ==== Utility Function: `tx_rawaudio` ==== + + This function forges a message for sending a vector of raw data. The object + is a http://lv2plug.in/ns/ext/atom#Blank[Blank] with a few properties, like: + [source,turtle] + -------- + [] + 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 + http://lv2plug.in/ns/ext/atom#Vector[Vector] of + http://lv2plug.in/ns/ext/atom#Float[Float]. +*/ +static void +tx_rawaudio(LV2_Atom_Forge* forge, + ScoLV2URIs* uris, + const int32_t channel, + const size_t n_samples, + const float* data) +{ + 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); + + // 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); + + // 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, (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, &, 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); +} + +/** + ==== State Methods ==== + + This plugin's state consists of two basic properties: one `int` and one + `float`. No files are used. Note these values are POD, but not portable, + since different machines may have a different integer endianness or floating + point format. However, since standard Atom types are used, a good host will + be able to save them portably as text anyway. +*/ +static LV2_State_Status +state_save(LV2_Handle instance, + LV2_State_Store_Function store, + LV2_State_Handle handle, + 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; +} + +static LV2_State_Status +state_restore(LV2_Handle instance, + LV2_State_Retrieve_Function retrieve, + LV2_State_Handle handle, + uint32_t flags, + const LV2_Feature* const* features) +{ + 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; +} + +/** ==== 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}; + +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; + } +} diff --git a/plugins/eg-scope.lv2/examploscope.ttl.in b/plugins/eg-scope.lv2/examploscope.ttl.in new file mode 100644 index 0000000..0b76962 --- /dev/null +++ b/plugins/eg-scope.lv2/examploscope.ttl.in @@ -0,0 +1,130 @@ +@prefix atom: <http://lv2plug.in/ns/ext/atom#> . +@prefix bufsz: <http://lv2plug.in/ns/ext/buf-size#> . +@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 ui: <http://lv2plug.in/ns/extensions/ui#> . +@prefix urid: <http://lv2plug.in/ns/ext/urid#> . +@prefix rsz: <http://lv2plug.in/ns/ext/resize-port#> . +@prefix state: <http://lv2plug.in/ns/ext/state#> . +@prefix egscope: <http://lv2plug.in/plugins/eg-scope#> . + +<http://gareus.org/rgareus#me> + a foaf:Person ; + foaf:name "Robin Gareus" ; + foaf:mbox <mailto:robin@gareus.org> ; + foaf:homepage <http://gareus.org/> . + +<http://lv2plug.in/plugins/eg-scope> + a doap:Project ; + doap:maintainer <http://gareus.org/rgareus#me> ; + doap:name "Example Scope" . + +egscope:Mono + a lv2:Plugin, lv2:AnalyserPlugin ; + doap:name "Example Scope (Mono)" ; + lv2:project <http://lv2plug.in/plugins/eg-scope> ; + doap:license <http://usefulinc.com/doap/licenses/gpl> ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature lv2:hardRTCapable ; + lv2:extensionData state:interface ; + ui:ui egscope:ui ; + lv2:port [ + a atom:AtomPort , + lv2:InputPort ; + atom:bufferType atom:Sequence ; + lv2:designation lv2:control ; + lv2:index 0 ; + lv2:symbol "control" ; + lv2:name "Control" + ] , [ + a atom:AtomPort , + lv2:OutputPort ; + atom:bufferType atom:Sequence ; + lv2:designation lv2:control ; + lv2:index 1 ; + lv2:symbol "notify" ; + lv2:name "Notify" ; + # 8192 * sizeof(float) + LV2-Atoms + rsz:minimumSize 32832; + ] , [ + a lv2:AudioPort , + lv2:InputPort ; + lv2:index 2 ; + lv2:symbol "in" ; + lv2:name "In" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 3 ; + lv2:symbol "out" ; + lv2:name "Out" + ] . + + +egscope:Stereo + a lv2:Plugin, lv2:AnalyserPlugin ; + doap:name "Example Scope (Stereo)" ; + lv2:project <http://lv2plug.in/plugins/eg-scope> ; + doap:license <http://usefulinc.com/doap/licenses/gpl> ; + lv2:requiredFeature urid:map ; + lv2:optionalFeature lv2:hardRTCapable ; + lv2:extensionData state:interface ; + ui:ui egscope:ui ; + lv2:port [ + a atom:AtomPort , + lv2:InputPort ; + atom:bufferType atom:Sequence ; + lv2:designation lv2:control ; + lv2:index 0 ; + lv2:symbol "control" ; + lv2:name "Control" + ] , [ + a atom:AtomPort , + lv2:OutputPort ; + atom:bufferType atom:Sequence ; + lv2:designation lv2:control ; + lv2:index 1 ; + lv2:symbol "notify" ; + lv2:name "Notify" ; + rsz:minimumSize 65664; + ] , [ + a lv2:AudioPort , + lv2:InputPort ; + lv2:index 2 ; + lv2:symbol "in0" ; + lv2:name "InL" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 3 ; + lv2:symbol "out0" ; + lv2:name "OutL" + ] , [ + a lv2:AudioPort , + lv2:InputPort ; + lv2:index 4 ; + lv2:symbol "in1" ; + lv2:name "InR" + ] , [ + a lv2:AudioPort , + lv2:OutputPort ; + lv2:index 5 ; + lv2:symbol "out1" ; + lv2:name "OutR" + ] . + + +egscope:ui + a ui:GtkUI ; + lv2:requiredFeature urid:map ; + ui:portNotification [ + ui:plugin egscope:Mono ; + lv2:symbol "notify" ; + ui:notifyType atom:Blank + ] , [ + ui:plugin egscope:Stereo ; + lv2:symbol "notify" ; + ui:notifyType atom:Blank + ] . diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c new file mode 100644 index 0000000..8a9b588 --- /dev/null +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -0,0 +1,676 @@ +/* + 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. +*/ + +#include "./uris.h" + +#include "lv2/atom/atom.h" +#include "lv2/atom/forge.h" +#include "lv2/atom/util.h" +#include "lv2/core/lv2.h" +#include "lv2/ui/ui.h" +#include "lv2/urid/urid.h" + +#include <cairo.h> +#include <gdk/gdk.h> +#include <glib-object.h> +#include <glib.h> +#include <gobject/gclosure.h> +#include <gtk/gtk.h> + +#include <assert.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +// Drawing area size +#define DAWIDTH (640) +#define DAHEIGHT (200) + +/** + Max continuous points on path. Many short-path segments are + expensive|inefficient long paths are not supported by all surfaces (usually + its a miter - not point - limit, depending on used cairo backend) +*/ +#define MAX_CAIRO_PATH (128) + +/** + Representation of the raw audio-data for display (min | max) values for a + given 'index' position. +*/ +typedef struct { + float data_min[DAWIDTH]; + float data_max[DAWIDTH]; + + 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; +} 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); + + 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); + + assert(msg); + + lv2_atom_forge_pop(&ui->forge, &frame); + ui->write(ui->controller, + 0, + lv2_atom_total_size(msg), + ui->uris.atom_eventTransfer, + msg); +} + +/** + Notify backend that UI is active. + + The plugin should send state and enable data transmission. +*/ +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); + + 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; +} + +/** + Gdk drawing area draw callback. + + Called in Gtk's main thread and uses Cairo to draw the 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 = 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; +} + +/** + Parse raw audio data and prepare for later drawing. + + Note this is a toy example, which is really a waveform display, not an + oscilloscope. A serious scope would not display samples as is. + + Signals above ~ 1/10 of the sampling-rate will not yield a useful visual + display and result in a rather unintuitive representation of the actual + waveform. + + Ideally the audio-data would be buffered and upsampled here and after that + written in a display buffer for later use. + + For more information, see + https://wiki.xiph.org/Videos/Digital_Show_and_Tell + http://lac.linuxaudio.org/2013/papers/36.pdf + and https://github.com/x42/sisco.lv2 +*/ +static int +process_channel(EgScopeUI* ui, + ScoChan* chn, + const size_t n_elem, + float const* data, + 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.0f; + chn->data_max[chn->idx] = -1.0f; + } + } + *idx_end = chn->idx; + return overflow; +} + +/** + Called via port_event() which is called by the host, typically at a rate of + around 25 FPS. +*/ +static void +update_scope(EgScopeUI* ui, + const int32_t channel, + 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 = 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 +instantiate(const 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) +{ + 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); +} + +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; +} + +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, + &_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; +} + +/** + Receive data from the DSP-backend. + + This is called by the host, typically at a rate of around 25 FPS. + + Ideally this happens regularly and with relatively low latency, but there + are no hard guarantees about message delivery. +*/ +static void +port_event(LV2UI_Handle handle, + uint32_t port_index, + uint32_t buffer_size, + 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); + } + } +} + +static const LV2UI_Descriptor descriptor = {SCO_URI "#ui", + instantiate, + cleanup, + port_event, + NULL}; + +LV2_SYMBOL_EXPORT +const LV2UI_Descriptor* +lv2ui_descriptor(uint32_t index) +{ + return index == 0 ? &descriptor : NULL; +} diff --git a/plugins/eg-scope.lv2/manifest.ttl.in b/plugins/eg-scope.lv2/manifest.ttl.in new file mode 100644 index 0000000..66c3c9d --- /dev/null +++ b/plugins/eg-scope.lv2/manifest.ttl.in @@ -0,0 +1,21 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . + +# ==== Mono plugin variant ==== +<http://lv2plug.in/plugins/eg-scope#Mono> + a lv2:Plugin ; + lv2:binary <examploscope@LIB_EXT@> ; + rdfs:seeAlso <examploscope.ttl> . + +# ==== Stereo plugin variant ==== +<http://lv2plug.in/plugins/eg-scope#Stereo> + a lv2:Plugin ; + lv2:binary <examploscope@LIB_EXT@> ; + rdfs:seeAlso <examploscope.ttl> . + +# ==== Gtk 2.0 UI ==== +<http://lv2plug.in/plugins/eg-scope#ui> + a ui:GtkUI ; + 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..ecf01b2 --- /dev/null +++ b/plugins/eg-scope.lv2/meson.build @@ -0,0 +1,41 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +plugin_sources = files('examploscope.c') +bundle_name = 'eg-scope.lv2' +data_filenames = ['manifest.ttl.in', 'examploscope.ttl.in'] + +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 diff --git a/plugins/eg-scope.lv2/uris.h b/plugins/eg-scope.lv2/uris.h new file mode 100644 index 0000000..8873786 --- /dev/null +++ b/plugins/eg-scope.lv2/uris.h @@ -0,0 +1,70 @@ +/* + 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. +*/ + +#ifndef SCO_URIS_H +#define SCO_URIS_H + +#include "lv2/atom/atom.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; +} 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"); +} + +#endif /* SCO_URIS_H */ diff --git a/plugins/literasc.py b/plugins/literasc.py new file mode 100755 index 0000000..74b13a7 --- /dev/null +++ b/plugins/literasc.py @@ -0,0 +1,143 @@ +#!/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" + + +def format_code(lang, code): + "Format a block of code and return it as a marked up string." + + if code.strip() == "": + return code + + head = f"[source,{lang}]" + code = code.strip("\n") + sep = "-" * len(head) + return "\n".join([head, sep, code, sep]) + "\n" + + +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 = "".join(in_file) + + # Skip initial license comment + if code[0:2] == "/*": + end = code.find("*/") + 2 + code = code[end:] + + 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 char == "*": + n_stars += 1 + else: + if n_stars > 1: + output += format_code("c", last_chunk(chunk)) + chunk = "" + in_comment = True + else: + chunk += "*" + char + in_comment_start = False + elif in_comment and prev_c == "*" and char == "/": + if n_stars > 1: + output += format_text(last_chunk(chunk)) + else: + output += format_code("c", "/* " + last_chunk(chunk) + "*/") + in_comment = False + in_comment_start = False + chunk = "" + else: + chunk += char + + prev_c = char + + return output + format_code("c", chunk) + + +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 in_file: + is_comment = line.strip().startswith("#") + if in_comment: + if is_comment: + chunk += line.strip().lstrip("# ") + " \n" + else: + output += format_text(chunk) + in_comment = False + chunk = line + else: + if is_comment: + output += format_code("turtle", chunk) + in_comment = True + chunk = line.strip().lstrip("# ") + " \n" + else: + chunk += line + + if in_comment: + return output + format_text(chunk) + + return output + format_code("turtle", chunk) + + +def gen(out, filenames): + "Write markup generated from filenames to an output file." + + for filename in filenames: + 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" + ) + + +if __name__ == "__main__": + if len(sys.argv) < 2: + sys.stderr.write(f"Usage: {sys.argv[0]} OUT_FILE IN_FILE...\n") + sys.exit(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..08b3feb --- /dev/null +++ b/plugins/meson.build @@ -0,0 +1,82 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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', + '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/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 new file mode 100644 index 0000000..1395251 --- /dev/null +++ b/schemas.lv2/README @@ -0,0 +1,12 @@ +This directory contains third-party vocabularies used in these LV2 +specifications. They are occasionally very slightly modified for validity, but +are otherwise equivalent to their original versions. + +These are included with LV2 and installed as a bundle to support validation and +more intelligent use of data by hosts. + +The XML schema description in xsd.ttl is an exception, it was mostly +hand-crafted since a good description of XSD in RDF did not seem to exist. The +way it uses xsd:pattern is questionable, but simple and supported by +sord_validate. + diff --git a/schemas.lv2/dcs.ttl b/schemas.lv2/dcs.ttl new file mode 100644 index 0000000..4c62ed9 --- /dev/null +++ b/schemas.lv2/dcs.ttl @@ -0,0 +1,67 @@ +@prefix dcs: <http://ontologi.es/doap-changeset#> . +@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 xsd: <http://www.w3.org/2001/XMLSchema#> . + +<> + rdfs:comment "Minimal DOAP Change Sets vocabulary used by LV2." . + +<http://tobyinkster.co.uk/#i> + a foaf:Person . + +dcs: + a owl:Ontology ; + dcterms:contributor <http://drobilla.net/drobilla#me> ; + dcterms:created "2010-01-08"^^xsd:date ; + dcterms:creator <http://tobyinkster.co.uk/#i> ; + dcterms:description "An ontology that extends DOAP to describe changesets." ; + dcterms:modified "2022-07-07"^^xsd:date ; + rdfs:label "DOAP Change Sets" . + +dcs:Change + a owl:Class ; + rdfs:comment "A change to something." ; + rdfs:label "Change" ; + rdfs:subClassOf [ + a owl:Restriction ; + rdfs:comment "A change must have a plain literal label." ; + owl:onProperty rdfs:label ; + owl:someValuesFrom rdf:PlainLiteral + ] . + +dcs:ChangeSet + a owl:Class ; + rdfs:comment "A collection of changes." ; + rdfs:label "Change Set" ; + rdfs:subClassOf rdf:Bag . + +dcs:blame + a owl:ObjectProperty ; + rdfs:label "blame" ; + rdfs:subPropertyOf dcs:thanks . + +dcs:changeset + a owl:ObjectProperty ; + rdfs:comment "The change set of a version." ; + rdfs:domain doap:Version ; + rdfs:label "change set" ; + rdfs:range dcs:ChangeSet . + +dcs:item + a owl:ObjectProperty ; + rdfs:comment "A change in a change set." ; + rdfs:domain dcs:ChangeSet ; + rdfs:label "item" ; + rdfs:range dcs:Change ; + rdfs:subPropertyOf rdfs:member . + +dcs:thanks + a owl:ObjectProperty ; + rdfs:domain dcs:Change ; + rdfs:label "thanks" ; + rdfs:range foaf:Agent . + diff --git a/schemas.lv2/dcterms.ttl b/schemas.lv2/dcterms.ttl new file mode 100644 index 0000000..f6a5d06 --- /dev/null +++ b/schemas.lv2/dcterms.ttl @@ -0,0 +1,340 @@ +@prefix dcterms: <http://purl.org/dc/terms/> . +@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#> . + +dcterms: + a owl:Ontology ; + dcterms:modified "2010-10-11" ; + dcterms:title "DCMI Metadata Terms"@en-us ; + rdfs:comment "This version of the DCMI Terms vocabulary has been heavily trimmed for LV2." . + +dcterms:Agent + a dcterms:AgentClass , + rdfs:Class ; + dcterms:description "Examples of Agent include person, organization, and software agent."@en-us ; + rdfs:comment "A resource that acts or has the power to act."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Agent"@en-us . + +dcterms:AgentClass + a rdfs:Class ; + 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 . + +dcterms:LicenseDocument + a rdfs:Class ; + rdfs:comment "A legal document giving official permission to do something with a Resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "License Document"@en-us ; + rdfs:subClassOf dcterms:RightsStatement . + +dcterms:LinguisticSystem + a rdfs:Class ; + dcterms:description "Examples include written, spoken, sign, and computer languages."@en-us ; + rdfs:comment "A system of signs, symbols, sounds, gestures, or rules used in communication."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Linguistic System"@en-us . + +dcterms:MediaType + a rdfs:Class ; + rdfs:comment "A file format or physical medium."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Media Type"@en-us ; + rdfs:subClassOf dcterms:MediaTypeOrExtent . + +dcterms:MediaTypeOrExtent + a rdfs:Class ; + rdfs:comment "A media type or extent."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Media Type or Extent"@en-us . + +dcterms:RightsStatement + a rdfs:Class ; + rdfs:comment "A statement about the intellectual property rights (IPR) held in or over a Resource, a legal document giving official permission to do something with a resource, or a statement about access rights."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Rights Statement"@en-us . + +dcterms:Standard + a rdfs:Class ; + rdfs:comment "A basis for comparison; a reference point against which other things can be evaluated."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Standard"@en-us . + +dcterms:URI + a rdfs:Datatype ; + rdfs:comment "The set of identifiers constructed according to the generic syntax for Uniform Resource Identifiers as specified by the Internet Engineering Task Force."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "URI"@en-us ; + rdfs:seeAlso <http://www.ietf.org/rfc/rfc3986.txt> . + +dcterms:W3CDTF + a rdfs:Datatype ; + rdfs:comment "The set of dates and times constructed according to the W3C Date and Time Formats Specification."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "W3C-DTF"@en-us ; + rdfs:seeAlso <http://www.w3.org/TR/NOTE-datetime> . + +dcterms:abstract + a rdf:Property ; + rdfs:comment "A summary of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "Abstract"@en-us ; + rdfs:subPropertyOf dcterms:description . + +dcterms:alternative + a rdf:Property ; + dcterms:description "The distinction between titles and alternative titles is application-specific."@en-us ; + rdfs:comment "An alternative name for the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "alternative title"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:title . + +dcterms:available + a rdf:Property ; + rdfs:comment "Date (often a range) that the resource became or will become available."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date available"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:conformsTo + a rdf:Property ; + rdfs:comment "An established standard to which the described resource conforms."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "conforms to"@en-us ; + rdfs:range dcterms:Standard ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:contributor + a rdf:Property ; + dcterms:description "Examples of a Contributor include a person, an organization, or a service."@en-us ; + rdfs:comment "An entity responsible for making contributions to the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "contributor"@en-us ; + rdfs:range dcterms:Agent . + +dcterms:created + a rdf:Property ; + rdfs:comment "Date of creation of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date created"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:creator + a rdf:Property ; + dcterms:description "Examples of a Creator include a person, an organization, or a service."@en-us ; + rdfs:comment "An entity primarily responsible for making the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "creator"@en-us ; + rdfs:range dcterms:Agent ; + rdfs:subPropertyOf dcterms:contributor ; + owl:equivalentProperty <http://xmlns.com/foaf/0.1/maker> . + +dcterms:date + a rdf:Property ; + dcterms:description "Date may be used to express temporal information at any level of granularity. Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF]."@en-us ; + rdfs:comment "A point or period of time associated with an event in the lifecycle of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date"@en-us ; + rdfs:range rdfs:Literal . + +dcterms:dateAccepted + a rdf:Property ; + dcterms:description "Examples of resources to which a Date Accepted may be relevant are a thesis (accepted by a university department) or an article (accepted by a journal)."@en-us ; + rdfs:comment "Date of acceptance of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date accepted"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:dateCopyrighted + a rdf:Property ; + rdfs:comment "Date of copyright."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date copyrighted"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:dateSubmitted + a rdf:Property ; + dcterms:description "Examples of resources to which a Date Submitted may be relevant are a thesis (submitted to a university department) or an article (submitted to a journal)."@en-us ; + rdfs:comment "Date of submission of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date submitted"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:description + a rdf:Property ; + dcterms:description "Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource."@en-us ; + rdfs:comment "An account of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "description"@en-us . + +dcterms:format + a rdf:Property ; + dcterms:description "Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME]."@en-us ; + rdfs:comment "The file format, physical medium, or dimensions of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "format"@en-us ; + rdfs:range dcterms:MediaTypeOrExtent . + +dcterms:hasFormat + a rdf:Property ; + rdfs:comment "A related resource that is substantially the same as the pre-existing described resource, but in another format."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "has format"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:hasPart + a rdf:Property ; + rdfs:comment "A related resource that is included either physically or logically in the described resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "has part"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:hasVersion + a rdf:Property ; + rdfs:comment "A related resource that is a version, edition, or adaptation of the described resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "has version"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:isFormatOf + a rdf:Property ; + rdfs:comment "A related resource that is substantially the same as the described resource, but in another format."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "is format of"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:isPartOf + a rdf:Property ; + rdfs:comment "A related resource in which the described resource is physically or logically included."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "is part of"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:isReferencedBy + a rdf:Property ; + rdfs:comment "A related resource that references, cites, or otherwise points to the described resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "is referenced by"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:isReplacedBy + a rdf:Property ; + rdfs:comment "A related resource that supplants, displaces, or supersedes the described resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "is replaced by"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:isRequiredBy + a rdf:Property ; + rdfs:comment "A related resource that requires the described resource to support its function, delivery, or coherence."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "is required by"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:isVersionOf + a rdf:Property ; + dcterms:description "Changes in version imply substantive changes in content rather than differences in format."@en-us ; + rdfs:comment "A related resource of which the described resource is a version, edition, or adaptation."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "is version of"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:issued + a rdf:Property ; + rdfs:comment "Date of formal issuance (e.g., publication) of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date issued"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:language + a rdf:Property ; + dcterms:description "Recommended best practice is to use a controlled vocabulary such as RFC 4646."@en-us ; + rdfs:comment "A language of the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "language"@en-us ; + rdfs:range dcterms:LinguisticSystem . + +dcterms:license + a rdf:Property ; + rdfs:comment "A legal document giving official permission to do something with the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "license"@en-us ; + rdfs:range dcterms:LicenseDocument ; + rdfs:subPropertyOf dcterms:rights . + +dcterms:modified + a rdf:Property ; + rdfs:comment "Date on which the resource was changed."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "date modified"@en-us ; + rdfs:range rdfs:Literal ; + rdfs:subPropertyOf dcterms:date . + +dcterms:publisher + a rdf:Property ; + dcterms:description "Examples of a Publisher include a person, an organization, or a service."@en-us ; + rdfs:comment "An entity responsible for making the resource available."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "publisher"@en-us ; + rdfs:range dcterms:Agent . + +dcterms:references + a rdf:Property ; + rdfs:comment "A related resource that is referenced, cited, or otherwise pointed to by the described resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "references"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:relation + a rdf:Property ; + dcterms:description "Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system. "@en-us ; + rdfs:comment "A related resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "relation"@en-us . + +dcterms:replaces + a rdf:Property ; + rdfs:comment "A related resource that is supplanted, displaced, or superseded by the described resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "replaces"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:requires + a rdf:Property ; + rdfs:comment "A related resource that is required by the described resource to support its function, delivery, or coherence."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "requires"@en-us ; + rdfs:subPropertyOf dcterms:relation . + +dcterms:rights + a rdf:Property ; + dcterms:description "Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights."@en-us ; + rdfs:comment "Information about rights held in and over the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "rights"@en-us ; + rdfs:range dcterms:RightsStatement . + +dcterms:rightsHolder + a rdf:Property ; + rdfs:comment "A person or organization owning or managing rights over the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "rights holder"@en-us ; + rdfs:range dcterms:Agent . + +dcterms:title + a rdf:Property ; + rdfs:comment "A name given to the resource."@en-us ; + rdfs:isDefinedBy dcterms: ; + rdfs:label "title"@en-us ; + rdfs:range rdfs:Literal . + diff --git a/schemas.lv2/doap.ttl b/schemas.lv2/doap.ttl new file mode 100644 index 0000000..b806d31 --- /dev/null +++ b/schemas.lv2/doap.ttl @@ -0,0 +1,709 @@ +@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#> . + +doap: + a owl:Ontology ; + 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." ; + dcterms:title "Description of a Project (DOAP) vocabulary" ; + owl:imports foaf: ; + foaf:maker [ + a foaf:Person ; + foaf:mbox <mailto:edd@usefulinc.com> ; + foaf:name "Edd Dumbill" + ] . + +doap:ArchRepository + a rdfs:Class , + owl:Class ; + rdfs:comment "Dépôt GNU Arch du code source."@fr , + "GNU Arch Quellcode-Versionierungssystem."@de , + "GNU Arch source code repository."@en , + "Repositorio GNU Arch del código fuente."@es , + "Úložiště zdrojových kódů GNU Arch."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "Dépôt GNU Arch"@fr , + "GNU Arch repository"@de , + "GNU Arch repository"@en , + "Repositorio GNU Arch"@es , + "Úložiště GNU Arch"@cs ; + rdfs:subClassOf doap:Repository . + +doap:BKRepository + a rdfs:Class , + owl:Class ; + rdfs:comment "BitKeeper Quellcode-Versionierungssystem."@de , + "BitKeeper source code repository."@en , + "Dépôt BitKeeper du code source."@fr , + "Repositorio BitKeeper del código fuente."@es , + "Úložiště zdrojových kódů BitKeeper."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "BitKeeper Repository"@de , + "BitKeeper Repository"@en , + "Dépôt BitKeeper"@fr , + "Repositorio BitKeeper"@es , + "Úložiště BitKeeper"@cs ; + rdfs:subClassOf doap:Repository . + +doap:BazaarBranch + a rdfs:Class ; + rdfs:comment "Bazaar source code branch."@en ; + rdfs:isDefinedBy doap: ; + rdfs:label "Bazaar Branch"@en ; + rdfs:subClassOf doap:Repository . + +doap:CVSRepository + a rdfs:Class , + owl:Class ; + rdfs:comment "CVS Quellcode-Versionierungssystem."@de , + "CVS source code repository."@en , + "Dépôt CVS du code source."@fr , + "Repositorio CVS del código fuente."@es , + "Úložiště zdrojových kódů CVS."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "CVS Repository"@de , + "CVS Repository"@en , + "Dépôt CVS"@fr , + "Repositorio CVS"@es , + "Úložiště CVS"@cs ; + rdfs:subClassOf doap:Repository . + +doap:DarcsRepository + a rdfs:Class ; + rdfs:comment "Dépôt darcs du code source."@fr , + "Repositorio darcs del código fuente."@es , + "darcs source code repository."@en ; + rdfs:isDefinedBy doap: ; + rdfs:label "Dépôt darcs"@fr , + "Repositorio darcs"@es , + "darcs Repository"@en ; + rdfs:subClassOf doap:Repository . + +doap:GitBranch + a rdfs:Class ; + rdfs:comment "Git source code branch."@en ; + rdfs:isDefinedBy doap: ; + rdfs:label "Git Branch"@en ; + rdfs:subClassOf doap:Repository . + +doap:HgRepository + a rdfs:Class ; + rdfs:comment "Mercurial source code repository."@en ; + rdfs:isDefinedBy doap: ; + rdfs:label "Mercurial Repository"@en ; + rdfs:subClassOf doap:Repository . + +doap:Project + a rdfs:Class ; + rdfs:comment "A project."@en , + "Ein Projekt."@de , + "Projekt."@cs , + "Un projet."@fr , + "Un proyecto."@es ; + rdfs:isDefinedBy doap: ; + rdfs:label "Prijekt"@de , + "Project"@en , + "Projekt"@cs , + "Projet"@fr , + "Proyecto"@es ; + rdfs:subClassOf foaf:Project . + +doap:Repository + a rdfs:Class ; + rdfs:comment "Dépôt du code source."@fr , + "Quellcode-Versionierungssystem."@de , + "Repositorio del código fuente."@es , + "Source code repository."@en , + "Úložiště zdrojových kódů."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "Dépôt"@fr , + "Repositorio"@es , + "Repository"@de , + "Repository"@en , + "Úložiště"@cs . + +doap:SVNRepository + a rdfs:Class ; + rdfs:comment "Dépôt Subversion du code source."@fr , + "Repositorio Subversion del código fuente."@es , + "Subversion Quellcode-Versionierungssystem."@de , + "Subversion source code repository."@en , + "Úložiště zdrojových kódů Subversion."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "Dépôt Subversion"@fr , + "Repositorio Subversion"@es , + "Subversion Repository"@de , + "Subversion Repository"@en , + "Úložiště Subversion"@cs ; + rdfs:subClassOf doap:Repository . + +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 . + +doap:Version + a rdfs:Class ; + rdfs:comment """Détails sur une version d'une realease d'un projet."""@fr , + "Informace o uvolněné verzi projektu."@cs , + "Información sobre la versión de un release del proyecto."@es , + "Version information of a project release."@en , + "Versionsinformation eines Projekt Releases."@de ; + rdfs:isDefinedBy doap: ; + rdfs:label "Version"@de , + "Version"@en , + "Version"@fr , + "Versión"@es , + "Verze"@cs . + +doap:audience + a rdf:Property , + owl:DatatypeProperty ; + rdfs:comment "Description of target user base"@en ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "audience"@en . + +doap:blog + 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 . + +doap:browse + 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 , + "Web-Browser Interface für das Repository."@de , + "Webové rozhraní pro prohlížení úložiště."@cs ; + rdfs:domain doap:Repository ; + rdfs:isDefinedBy doap: ; + rdfs:label "browse"@de , + "browse"@en , + "navegar"@es , + "prohlížeč"@cs , + "visualiser"@fr . + +doap:bug-database + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment "Bug tracker for a project."@en , + "Bug tracker para un proyecto."@es , + "Fehlerdatenbank eines Projektes."@de , + "Správa chyb projektu."@cs , + "Suivi des bugs pour un projet."@fr ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Fehlerdatenbank"@de , + "base de datos de bugs"@es , + "bug database"@en , + "databáze chyb"@cs , + "suivi des bugs"@fr . + +doap:category + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment "A category of project."@en , + "Eine Kategorie eines Projektes."@de , + "Kategorie projektu."@cs , + "Una categoría de proyecto."@es , + "Une catégorie de projet."@fr ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Kategorie"@de , + "category"@en , + "categoría"@es , + "catégorie"@fr , + "kategorie"@cs . + +doap:created + 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 , + "Erstellungsdatum von Irgendwas, angegeben im YYYY-MM-DD Format, z.B. 2004-04-05."@de , + "Fecha en la que algo fue creado, en formato AAAA-MM-DD. e.g. 2004-04-05"@es ; + rdfs:isDefinedBy doap: ; + rdfs:label "creado"@es , + "created"@en , + "créé"@fr , + "erstellt"@de , + "vytvořeno"@cs . + +doap:description + 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 , + """Texte descriptif d'un projet, long de 2 à 4 phrases."""@fr , + "Čistě textový, 2 až 4 věty dlouhý popis projektu."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "Beschreibung"@de , + "descripción"@es , + "description"@en , + "description"@fr , + "popis"@cs . + +doap:developer + 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 , + "Software-Entwickler für eine Projekt."@de , + "Vývojář softwaru projektu."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Entwickler"@de , + "desarrollador"@es , + "developer"@en , + "développeur"@fr , + "vývojář"@cs ; + rdfs:range foaf:Person . + +doap:documenter + 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 , + "Proveedor de documentación para el proyecto."@es , + "Spoluautor dokumentace projektu."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Dokumentator"@de , + "documenter"@en , + "dokumentarista"@cs , + "escritor de ayuda"@es , + """rédacteur de l'aide"""@fr ; + rdfs:range foaf:Person . + +doap:download-mirror + 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 , + "Spiegel der Seite von die Projekt-Software heruntergeladen werden kann."@de , + "Zrcadlo stránky pro stažení softwaru."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Spiegel der Seite zum Herunterladen"@de , + "download mirror"@en , + "miroir pour le téléchargement"@fr , + "mirror de descarga"@es , + "zrcadlo stránky pro stažení"@cs . + +doap:download-page + 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 , + "Web-Seite von der die Projekt-Software heruntergeladen werden kann."@de , + "Webová stránka, na které lze stáhnout projektový software."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Seite zum Herunterladen"@de , + "download page"@en , + "page de téléchargement"@fr , + "página de descarga"@es , + "stránka pro stažení"@cs . + +doap:file-release + 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 ; + rdfs:isDefinedBy doap: ; + rdfs:label "file-release"@en , + "soubor revize"@cs . + +doap:helper + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment "Colaborador del proyecto."@es , + "Collaborateur au projet."@fr , + "Project contributor."@en , + "Projekt-Mitarbeiter."@de , + "Spoluautor projektu."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Helfer"@de , + "colaborador"@es , + "collaborateur"@fr , + "helper"@en , + "spoluautor"@cs ; + rdfs:range foaf:Person . + +doap:homepage + a rdf:Property , + owl:InverseFunctionalProperty ; + rdfs:comment """El URL de la página de un proyecto, + asociada con exactamente un proyecto."""@es , + """L'URL de la page web d'un projet, + associée avec un unique projet."""@fr , + "URL adresa domovské stránky projektu asociované s právě jedním projektem."@cs , + """URL der Projekt-Homepage, + verbunden mit genau einem Projekt."""@de , + """URL of a project's homepage, + associated with exactly one project."""@en ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Homepage"@de , + "domovská stránka"@cs , + "homepage"@en , + "page web"@fr , + "página web"@es ; + rdfs:subPropertyOf foaf:homepage . + +doap:implements + 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: ; + rdfs:label "Implements specification"@en ; + rdfs:range doap:Specification . + +doap:language + 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 . + +doap:license + a rdf:Property ; + rdfs:comment "Die URI einer RDF-Beschreibung einer Lizenz unter der die Software herausgegeben wird."@de , + "El URI de una descripción RDF de la licencia bajo la cuál se distribuye el software."@es , + """L'URI d'une description RDF de la licence sous laquelle le programme est distribué."""@fr , + "The URI of an RDF description of the license the software is distributed under."@en , + "URI adresa RDF popisu licence, pod kterou je software distribuován."@cs ; + rdfs:isDefinedBy doap: ; + rdfs:label "Lizenz"@de , + "licence"@cs , + "licence"@fr , + "licencia"@es , + "license"@en . + +doap:location + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment """Emplacement d'un dépôt."""@fr , + "Location of a repository."@en , + "Lokation eines Repositorys."@de , + "Umístění úložiště."@cs , + "lugar de un repositorio."@es ; + rdfs:domain doap:Repository ; + rdfs:isDefinedBy doap: ; + rdfs:label "Repository Lokation"@de , + "emplacement du dépôt"@fr , + "lugar del respositorio"@es , + "repository location"@en , + "umístění úložiště"@cs . + +doap:mailing-list + 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 , + "Page web de la liste de diffusion, ou adresse de courriel."@fr , + "Página web de la lista de correo o dirección de correo."@es ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Mailing Liste"@de , + "e–mailová diskuse"@cs , + "lista de correo"@es , + "liste de diffusion"@fr , + "mailing list"@en . + +doap:maintainer + 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 , + "Maintainer of a project, a project leader."@en , + "Správce projektu, vedoucí projektu."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Projektverantwortlicher"@de , + "desarrollador principal"@es , + "développeur principal"@fr , + "maintainer"@en , + "správce"@cs ; + rdfs:range foaf:Person . + +doap:module + 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 , + """Nom du module d'un dépôt Subversion, CVS, BitKeeper ou Arch."""@fr , + "Nombre del módulo de un repositorio Subversion, CVS, BitKeeper o Arch."@es ; + rdfs:domain [ + a owl:Class ; + owl:unionOf ( + doap:CVSRepository + doap:ArchRepository + doap:BKRepository + ) + ] ; + rdfs:isDefinedBy doap: ; + rdfs:label "Modul"@de , + "modul"@cs , + "module"@en , + "module"@fr , + "módulo"@es . + +doap:name + a rdf:Property , + owl:AnnotationProperty ; + rdfs:comment "A name of something."@en , + "Der Name von Irgendwas"@de , + "El nombre de algo."@es , + "Jméno něčeho."@cs , + "Le nom de quelque chose."@fr ; + rdfs:isDefinedBy doap: ; + rdfs:label "Name"@de , + "jméno"@cs , + "name"@en , + "nom"@fr , + "nombre"@es ; + rdfs:subPropertyOf rdfs:label . + +doap:old-homepage + a rdf:Property , + owl:InverseFunctionalProperty ; + rdfs:comment """El URL de la antigua página de un proyecto, + asociada con exactamente un proyecto."""@es , + """L'URL d'une ancienne page web d'un + projet, associée avec un unique projet."""@fr , + "URL adresa předešlé domovské stránky projektu asociované s právě jedním projektem."@cs , + """URL der letzten Projekt-Homepage, + verbunden mit genau einem Projekt."""@de , + """URL of a project's past homepage, + associated with exactly one project."""@en ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Alte Homepage"@de , + "ancienne page web"@fr , + "old homepage"@en , + "página web antigua"@es , + "stará domovská stránka"@cs ; + rdfs:subPropertyOf foaf:homepage . + +doap:os + 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 , + """Sistema opertivo al cuál está limitado el proyecto. Omita esta propiedad si el proyecto no es específico + de un sistema opertaivo en particular."""@es , + """Système d'exploitation auquel est limité le projet. Omettez cette propriété si le + projet n'est pas limité à un système d'exploitation."""@fr ; + rdfs:domain doap:Project , + doap:Version ; + rdfs:isDefinedBy doap: ; + rdfs:label "Betriebssystem"@de , + "operating system"@en , + "operační systém"@cs , + "sistema operativo"@es , + """système d'exploitation"""@fr . + +doap:platform + 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 . + +doap:programming-language + 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 , + "Programmiersprache in der ein Projekt implementiert ist oder intendiert wird zu benutzen."@de , + "Programming language a project is implemented in or intended for use with."@en , + "Programovací jazyk, ve kterém je projekt implementován nebo pro který je zamýšlen k použití."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Programmiersprache"@de , + "langage de programmation"@fr , + "lenguaje de programación"@es , + "programming language"@en , + "programovací jazyk"@cs . + +doap:release + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment "A project release."@en , + "Ein Release (Version) eines Projekts."@de , + "Relase (verze) projektu."@cs , + "Un release (versión) de un proyecto."@es , + """Une release (révision) d'un projet."""@fr ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Release"@de , + "release"@cs , + "release"@en , + "release"@es , + "release"@fr ; + rdfs:range doap:Version . + +doap:repository + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment "Dépôt du code source."@fr , + "Quellcode-Versionierungssystem."@de , + "Repositorio del código fuente."@es , + "Source code repository."@en , + "Úložiště zdrojových kódů."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Repository"@de , + "dépôt"@fr , + "repositorio"@es , + "repository"@en , + "úložiště"@cs ; + rdfs:range doap:Repository . + +doap:revision + 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 , + "Revision identifier of a software release."@en , + "Versionsidentifikator eines Software-Releases."@de ; + rdfs:domain doap:Version ; + rdfs:isDefinedBy doap: ; + rdfs:label "Version"@de , + "revision"@en , + "révision"@fr , + "versión"@es , + "verze"@cs . + +doap:screenshots + 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 , + "Web-Seite mit Screenshots eines Projektes."@de , + "Webová stránka projektu se snímky obrazovky."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Screenshots"@de , + "capturas de pantalla"@es , + """captures d'écran"""@fr , + "screenshots"@en , + "snímek obrazovky"@cs . + +doap:service-endpoint + 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 . + +doap:shortdesc + 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 , + "Short (8 or 9 words) plain text description of a project."@en , + """Texte descriptif concis (8 ou 9 mots) d'un projet."""@fr ; + rdfs:isDefinedBy doap: ; + rdfs:label "Kurzbeschreibung"@de , + "descripción corta"@es , + "description courte"@fr , + "krátký popis"@cs , + "short description"@en . + +doap:tester + 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 , + "Un tester u otro proveedor de control de calidad."@es , + "Un testeur ou un collaborateur au contrôle qualité."@fr ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Tester"@de , + "tester"@cs , + "tester"@en , + "tester"@es , + "testeur"@fr ; + rdfs:range foaf:Person . + +doap:translator + 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 , + "Proveedor de traducciones al proyecto."@es , + "Spoluautor překladu projektu."@cs ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "překladatel"@cs , + "traducteur"@fr , + "traductor"@es , + "translator"@en , + "Übersetzer"@de ; + rdfs:range foaf:Person . + +doap:vendor + a rdf:Property , + owl:ObjectProperty ; + rdfs:comment "Vendor organization: commercial, free or otherwise"@en ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "vendor"@en ; + rdfs:range foaf:Organization . + +doap:wiki + 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 , + "URL of Wiki for collaborative discussion of project."@en , + "Wiki-URL für die kollaborative Dikussion eines Projektes."@de ; + rdfs:domain doap:Project ; + rdfs:isDefinedBy doap: ; + rdfs:label "Wiki"@de , + "wiki"@cs , + "wiki"@en , + "wiki"@es , + "wiki"@fr . + diff --git a/schemas.lv2/foaf.ttl b/schemas.lv2/foaf.ttl new file mode 100644 index 0000000..17dcc13 --- /dev/null +++ b/schemas.lv2/foaf.ttl @@ -0,0 +1,612 @@ +@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 foaf: <http://xmlns.com/foaf/0.1/> . +@prefix dcterms: <http://purl.org/dc/terms/> . + +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 dcterms:Agent . + +foaf:Document + 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 . + +foaf:Image + 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 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 foaf: ; + rdfs:label "Online Account" ; + rdfs:subClassOf owl:Thing . + +foaf:OnlineChatAccount + 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 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 foaf: ; + rdfs:label "Online Gaming Account" ; + rdfs:subClassOf foaf:OnlineAccount . + +foaf:Organization + 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 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 . + +foaf:Project + 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 foaf: ; + rdfs:label "sha1sum (hex)" . + +foaf:skypeID + 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 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 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 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 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 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 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 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 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 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 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 new file mode 100644 index 0000000..ed11c1a --- /dev/null +++ b/schemas.lv2/manifest.ttl @@ -0,0 +1,35 @@ +@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 <dcterms.ttl> . + +<http://usefulinc.com/ns/doap#> + a owl:Ontology ; + rdfs:seeAlso <doap.ttl> . + +<http://xmlns.com/foaf/0.1/> + a owl:Ontology ; + rdfs:seeAlso <foaf.ttl> . + +<http://www.w3.org/2002/07/owl> + a owl:Ontology ; + rdfs:seeAlso <owl.ttl> . + +rdfs: + a owl:Ontology ; + rdfs:seeAlso <rdfs.ttl> . + +<http://www.w3.org/1999/02/22-rdf-syntax-ns#> + a owl:Ontology ; + rdfs:seeAlso <rdf.ttl> . + +<http://www.w3.org/2001/XMLSchema#> + a owl:Ontology ; + rdfs:seeAlso <xsd.ttl> . + diff --git a/schemas.lv2/meson.build b/schemas.lv2/meson.build new file mode 100644 index 0000000..fb7bed5 --- /dev/null +++ b/schemas.lv2/meson.build @@ -0,0 +1,16 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +schema_data = files( + 'dcs.ttl', + '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 new file mode 100644 index 0000000..26bd0e8 --- /dev/null +++ b/schemas.lv2/owl.ttl @@ -0,0 +1,621 @@ +@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#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix dcterms: <http://purl.org/dc/terms/> . + +<http://www.w3.org/2002/07/owl> + 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 + in Section 6.4 of the OWL 2 RDF-Based Semantics specification, + available at http://www.w3.org/TR/owl2-rdf-based-semantics/. + Please note that those tables do not include the different annotations + (labels, comments and rdfs:isDefinedBy links) used in this file. + Also note that the descriptions provided in this ontology do not + provide a complete and correct formal description of either the syntax + or the semantics of the introduced terms (please see the OWL 2 + recommendations for the complete and normative specifications). + Furthermore, the information provided by this ontology may be + misleading if not used with care. This ontology SHOULD NOT be imported + into OWL ontologies. Importing this file into an OWL 2 DL ontology + 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 $" . + +owl:AllDifferent + 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 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 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 owl: ; + rdfs:label "Annotation" ; + rdfs:subClassOf rdfs:Resource . + +owl:AnnotationProperty + 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 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 owl: ; + rdfs:label "Axiom" ; + rdfs:subClassOf rdfs:Resource . + +owl: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 owl: ; + rdfs:label "DatatypeProperty" ; + rdfs:subClassOf rdf:Property . + +owl:DeprecatedClass + 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 owl: ; + rdfs:label "DeprecatedProperty" ; + rdfs:subClassOf rdf:Property . + +owl:FunctionalProperty + 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 owl: ; + rdfs:label "InverseFunctionalProperty" ; + rdfs:subClassOf owl:ObjectProperty . + +owl:IrreflexiveProperty + 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 owl: ; + rdfs:label "NamedIndividual" ; + rdfs:subClassOf owl:Thing . + +owl:NegativePropertyAssertion + 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 owl: ; + rdfs:label "Nothing" ; + rdfs:subClassOf owl:Thing . + +owl:ObjectProperty + 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 owl: ; + rdfs:label "Ontology" ; + rdfs:subClassOf rdfs:Resource . + +owl:OntologyProperty + 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 owl: ; + rdfs:label "ReflexiveProperty" ; + rdfs:subClassOf owl:ObjectProperty . + +owl:Restriction + 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 owl: ; + rdfs:label "SymmetricProperty" ; + rdfs:subClassOf owl:ObjectProperty . + +owl: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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 owl: ; + rdfs:label "with restrictions" ; + rdfs:range rdf:List . + diff --git a/schemas.lv2/rdf.ttl b/schemas.lv2/rdf.ttl new file mode 100644 index 0000000..cb758cb --- /dev/null +++ b/schemas.lv2/rdf.ttl @@ -0,0 +1,129 @@ +@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 dcterms: <http://purl.org/dc/terms/> . + +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 rdf: ; + rdfs:label "Alt" ; + rdfs:subClassOf rdfs:Container . + +rdf:Bag + 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 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 . + +rdf:Property + 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 rdf: ; + rdfs:label "Seq" ; + rdfs:subClassOf rdfs:Container . + +rdf:Statement + 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 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 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 rdf: ; + rdfs:label "nil" . + +rdf:object + 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 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 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 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 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 rdf: ; + rdfs:label "value" ; + rdfs:range rdfs:Resource . + diff --git a/schemas.lv2/rdfs.ttl b/schemas.lv2/rdfs.ttl new file mode 100644 index 0000000..10cfbb7 --- /dev/null +++ b/schemas.lv2/rdfs.ttl @@ -0,0 +1,124 @@ +@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 dcterms: <http://purl.org/dc/terms/> . + +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 rdfs: ; + rdfs:label "Class" ; + rdfs:subClassOf rdfs:Resource . + +rdfs:Container + 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 rdfs: ; + rdfs:label "Container Membership Property" ; + rdfs:subClassOf rdf:Property . + +rdfs:Datatype + 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 rdfs: ; + rdfs:label "Literal" ; + rdfs:subClassOf rdfs:Resource . + +rdfs: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 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 rdfs: ; + rdfs:label "domain" ; + rdfs:range rdfs:Class . + +rdfs:isDefinedBy + 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 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 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 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 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 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 rdfs: ; + rdfs:label "sub-property of" ; + rdfs:range rdf:Property . + diff --git a/schemas.lv2/xsd.ttl b/schemas.lv2/xsd.ttl new file mode 100644 index 0000000..cb98363 --- /dev/null +++ b/schemas.lv2/xsd.ttl @@ -0,0 +1,354 @@ +@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#> . + +xsd: + a owl:Ontology ; + rdfs:comment "XML Schema Datatypes" . + +xsd:anySimpleType + a rdfs:Datatype ; + rdfs:comment "The base class of any primitive XSD dataype." ; + rdfs:label "any simple type" . + +xsd:anyURI + a rdfs:Datatype ; + rdfs:label "any URI" ; + owl:onDatatype xsd:anySimpleType . + +xsd:base64Binary + a rdfs:Datatype ; + rdfs:comment "Base64-encoded arbitrary binary data." ; + rdfs:label "base64 binary" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + 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] *= *=)))?" + ] + ) . + +xsd:boolean + a rdfs:Datatype ; + rdfs:label "boolean" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + xsd:pattern "(true|false|0|1)" + ] + ) . + +xsd:byte + a rdfs:Datatype ; + rdfs:label "byte" ; + owl:onDatatype xsd:short ; + owl:withRestrictions ( + [ + xsd:maxInclusive "127"^^xsd:byte + ] [ + xsd:minInclusive "-128"^^xsd:byte + ] + ) . + +xsd:date + a rdfs:Datatype ; + rdfs:label "date" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + 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])?" + ] + ) . + +xsd:dateTime + a rdfs:Datatype ; + rdfs:label "date time" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + 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])?" + ] + ) . + +xsd:decimal + a rdfs:Datatype ; + rdfs:comment "A subset of the real numbers, which can be represented by decimal numerals." ; + rdfs:label "decimal" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + xsd:pattern "-?INF|NaN|[+-]?(([0-9]+[.]?[0-9]*)|([0-9]*[.]?[0-9]+))([eE][-+]?[0-9]+)?" + ] + ) . + +xsd:double + a rdfs:Datatype ; + rdfs:comment "IEEE double-precision 64-bit floating point." ; + rdfs:label "double" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + xsd:pattern "-?INF|NaN|[+-]?(([0-9]+[.]?[0-9]*)|([0-9]*[.]?[0-9]+))([eE][-+]?[0-9]+)?" + ] + ) . + +xsd:duration + a rdfs:Datatype ; + rdfs:label "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" + ] + ) . + +xsd:float + a rdfs:Datatype ; + rdfs:comment "IEEE single-precision 32-bit floating point." ; + rdfs:label "float" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + 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 ; + 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:hexBinary + a rdfs:Datatype ; + rdfs:comment "Hex-encoded arbitrary binary data." ; + rdfs:label "hex binary" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + xsd:pattern "([0-9A-Fa-f][0-9A-Fa-f])*" + ] + ) . + +xsd:int + a rdfs:Datatype ; + rdfs:label "int" ; + owl:onDatatype xsd:long ; + owl:withRestrictions ( + [ + xsd:maxInclusive "2147483647"^^xsd:int + ] [ + xsd:minInclusive "-2147483648"^^xsd:int + ] + ) . + +xsd:integer + a rdfs:Datatype ; + rdfs:label "integer" ; + owl:onDatatype xsd:decimal ; + owl:withRestrictions ( + [ + xsd:pattern "[-+]?[0-9]+" + ] [ + xsd:fractionDigits 0 + ] + ) . + +xsd:language + a rdfs:Datatype ; + rdfs:label "language" ; + owl:onDatatype xsd:token ; + owl:withRestrictions ( + [ + 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]?)*" + ] + ) . + +xsd:long + a rdfs:Datatype ; + rdfs:label "long" ; + owl:onDatatype xsd:integer ; + owl:withRestrictions ( + [ + xsd:maxInclusive "9223372036854775807"^^xsd:long + ] [ + xsd:minInclusive "-9223372036854775808"^^xsd:long + ] + ) . + +xsd:maxExclusive + a rdf:Property , + owl:DatatypeProperty ; + rdfs:comment "The exclusive upper bound of an ordered datatype." ; + rdfs:label "max exclusive" . + +xsd:maxInclusive + a rdf:Property , + owl:DatatypeProperty ; + rdfs:comment "The inclusive upper bound of an ordered datatype." ; + rdfs:label "max inclusive" . + +xsd:minExclusive + a rdf:Property , + owl:DatatypeProperty ; + rdfs:comment "The exclusive lower bound of an ordered datatype." ; + rdfs:label "min exclusive" . + +xsd:minInclusive + a rdf:Property , + owl:DatatypeProperty ; + rdfs:comment "The inclusive lower bound of an ordered datatype." ; + rdfs:label "min inclusive" . + +xsd:negativeInteger + a rdfs:Datatype ; + rdfs:label "negative integer" ; + owl:onDatatype xsd:nonPositiveInteger ; + owl:withRestrictions ( + [ + xsd:maxInclusive -1 + ] + ) . + +xsd:nonNegativeInteger + a rdfs:Datatype ; + rdfs:label "non-negative integer" ; + owl:onDatatype xsd:integer ; + owl:withRestrictions ( + [ + xsd:pattern "[+]?[0-9]+" + ] [ + xsd:minInclusive 0 + ] + ) . + +xsd:nonPositiveInteger + a rdfs:Datatype ; + rdfs:label "non-positive integer" ; + owl:onDatatype xsd:integer ; + owl:withRestrictions ( + [ + xsd:pattern "(0|-[0-9]+)" + ] [ + xsd:maxInclusive 0 + ] + ) . + +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 . + +xsd:pattern + a rdf:Property , + owl:DatatypeProperty ; + rdfs:comment "A regular expression that matches complete valid literals." ; + rdfs:label "pattern" . + +xsd:positiveInteger + a rdfs:Datatype ; + rdfs:label "positive integer" ; + owl:onDatatype xsd:nonNegativeInteger ; + owl:withRestrictions ( + [ + xsd:pattern "[+]?[0-9]*[1-9]+[0-9]*" + ] [ + xsd:minInclusive 1 + ] + ) . + +xsd:short + a rdfs:Datatype ; + rdfs:label "short" ; + owl:onDatatype xsd:int ; + owl:withRestrictions ( + [ + xsd:maxInclusive "32767"^^xsd:short + ] [ + xsd:minInclusive "-32768"^^xsd:short + ] + ) . + +xsd:string + a rdfs:Datatype ; + rdfs:comment "A character string." ; + rdfs:label "string" ; + owl:onDatatype xsd:anySimpleType . + +xsd:time + a rdfs:Datatype ; + rdfs:label "time" ; + owl:onDatatype xsd:anySimpleType ; + owl:withRestrictions ( + [ + 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])?" + ] + ) . + +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 . + +xsd:unsignedByte + a rdfs:Datatype ; + rdfs:label "unsigned byte" ; + owl:onDatatype xsd:unsignedShort ; + owl:withRestrictions ( + [ + xsd:maxInclusive "255"^^xsd:unsignedByte + ] + ) . + +xsd:unsignedInt + a rdfs:Datatype ; + rdfs:label "unsigned int" ; + owl:onDatatype xsd:unsignedLong ; + owl:withRestrictions ( + [ + xsd:maxInclusive "4294967295"^^xsd:unsignedInt + ] + ) . + +xsd:unsignedLong + a rdfs:Datatype ; + rdfs:label "unsigned long" ; + owl:onDatatype xsd:nonNegativeInteger ; + owl:withRestrictions ( + [ + xsd:maxInclusive "18446744073709551615"^^xsd:unsignedLong + ] + ) . + +xsd:unsignedShort + a rdfs:Datatype ; + rdfs:label "unsigned short" ; + owl:onDatatype xsd:unsignedInt ; + owl:withRestrictions ( + [ + 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..9a287e4 --- /dev/null +++ b/scripts/lv2_build_index.py @@ -0,0 +1,256 @@ +#!/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 datetime +import json +import os +import time +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_date(model, spec, minor, micro): + "Return the date for a release of a specification as an RDF node." + + # Get date + date = None + for release in model.objects(spec, doap.release): + revision = model.value(release, doap.revision, None, any=False) + if str(revision) == f"{minor}.{micro}": + date = model.value(release, doap.created, None) + break + + # Verify that this date is the latest + if date is not None: + for other_release in model.objects(spec, doap.release): + for other_date in model.objects(other_release, doap.created): + if other_date is None: + _warn(f"{spec} has no doap:created date") + elif other_date > date: + _warn(f"{spec} {minor}.{micro} ({date}) is an old release") + break + + return date + + +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="../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 "" + + # Check that date is present and valid + if _spec_date(model, spec, minor, micro) is None: + _warn(f"{spec} has no doap:created date") + 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) + + # Get date for this version, and list of all LV2 distributions + proj = rdflib.URIRef("http://lv2plug.in/ns/lv2") + date = None + for row in model.triples([proj, doap.release, None]): + revision = model.value(row[2], doap.revision, None) + created = model.value(row[2], doap.created, None) + if str(revision) == lv2_version: + date = created + + dist = model.value(row[2], doap["file-release"], None) + if not dist or not created: + _warn(f"{proj} has no file release") + + rows = [] + for spec in model.triples([None, rdf.type, lv2.Specification]): + rows += [index_row(model, spec[0], root_uri, online)] + + if date is None: + now = int(os.environ.get("SOURCE_DATE_EPOCH", time.time())) + date = datetime.datetime.utcfromtimestamp(now).strftime("%F") + + _subst_file( + os.path.join(lv2_source_root, "doc", "index.html.in"), + sys.stdout, + { + "@ROWS@": "\n".join(sorted(rows)), + "@LV2_VERSION@": lv2_version, + "@DATE@": date, + }, + ) + + +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..0cd296e --- /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 typing in model.triples([None, rdf.type, None]): + typed_subjects.add(typing[0]) + + # 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/lv2_write_news.py b/scripts/lv2_write_news.py new file mode 100755 index 0000000..6ce935c --- /dev/null +++ b/scripts/lv2_write_news.py @@ -0,0 +1,258 @@ +#!/usr/bin/env python3 + +# Copyright 2020-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: ISC + +""" +Write a NEWS file from RDF data. + +The output is in Debian changelog format, which can be parsed by +dpkg-parsechangelog, among other things. +""" + +import argparse +import os +import sys +import datetime +import textwrap +import urllib +import re + +import rdflib + +doap = rdflib.Namespace("http://usefulinc.com/ns/doap#") +dcs = rdflib.Namespace("http://ontologi.es/doap-changeset#") +rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#") +foaf = rdflib.Namespace("http://xmlns.com/foaf/0.1/") +rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") + + +def _is_release_version(version): + "Return true if `version` is a stable version number." + + if len(version) not in [2, 3] or version[0] == 0: + return False + + minor = version[len(version) - 2] + micro = version[len(version) - 1] + + return micro % 2 == 0 and (len(version) == 2 or minor % 2 == 0) + + +def _parse_datetime(string): + "Parse string as either a datetime or a date." + + try: + return datetime.datetime.strptime(string, "%Y-%m-%dT%H:%M:%S%z") + except ValueError: + return datetime.datetime.strptime(string, "%Y-%m-%d") + + +def _release_entry(graph, release): + "Return a news entry for a release." + + revision = graph.value(release, doap.revision, None) + date = graph.value(release, doap.created, None) + blamee = graph.value(release, dcs.blame, None) + changeset = graph.value(release, dcs.changeset, None) + dist = graph.value(release, doap["file-release"], None) + + if not revision or not date or not blamee or not changeset: + return None + + version = tuple(map(int, revision.split("."))) + + entry = { + "version": version, + "revision": str(revision), + "date": _parse_datetime(date), + "status": "stable" if _is_release_version(version) else "unstable", + "items": [], + } + + if dist is not None: + entry["dist"] = dist + + for j in graph.triples([changeset, dcs.item, None]): + item = str(graph.value(j[2], rdfs.label, None)) + entry["items"] += [item] + + entry["blamee_name"] = str(graph.value(blamee, foaf.name, None)) + entry["blamee_mbox"] = str(graph.value(blamee, foaf.mbox, None)) + return entry + + +def _project_entries(graph, project): + "Return a map from version to news entries for a project" + + entries = {} + for link in graph.triples([project, doap.release, None]): + entry = _release_entry(graph, link[2]) + if entry is not None: + entries[entry["version"]] = entry + else: + sys.stderr.write(f"warning: Ignored partial {project} release\n") + + return entries + + +def _read_turtle_news(in_files): + "Read news entries from Turtle." + + graph = rdflib.Graph() + + # Parse input files + for i in in_files: + graph.parse(i) + + # Read news for every project in the data + projects = {t[0] for t in graph.triples([None, rdf.type, doap.Project])} + entries_by_project = {} + for project in projects: + # Load any associated files + for uri in graph.triples([project, rdfs.seeAlso, None]): + if uri[2].endswith(".ttl"): + graph.parse(uri[2]) + + # Use the symbol from the URI as a name, or failing that, the doap:name + name = os.path.basename(urllib.parse.urlparse(str(project)).path) + if not name: + name = graph.value(project, doap.name, None) + + entries = _project_entries(graph, project) + for _, entry in entries.items(): + entry["name"] = name + + entries_by_project[str(project)] = entries + + return entries_by_project + + +def _write_news_item(out, item): + "Write a single item (change) in NEWS format." + + out.write("\n * " + "\n ".join(textwrap.wrap(item, width=74))) + + +def _write_news_entry(out, entry): + "Write an entry (version) to out in NEWS format." + + # Summary header + summary = f'{entry["name"]} ({entry["revision"]}) {entry["status"]}' + out.write(f"{summary}; urgency=medium\n") + + # Individual change items + for item in sorted(entry["items"]): + _write_news_item(out, item) + + # Trailer line + mbox = entry["blamee_mbox"].replace("mailto:", "") + author = f'{entry["blamee_name"]} <{mbox}>' + date = entry["date"] + if date.tzinfo is None: # Assume UTC (dpkg-parsechangelog requires it) + date = date.strftime("%a, %d %b %Y %H:%M:%S +0000") + else: + date = date.strftime("%a, %d %b %Y %H:%M:%S %z") + + out.write(f"\n\n -- {author} {date}\n") + + +def _write_single_project_news(out, entries): + "Write a NEWS file for entries of a single project to out." + + revisions = sorted(entries.keys(), reverse=True) + for revision in revisions: + entry = entries[revision] + out.write("\n" if revision != revisions[0] else "") + _write_news_entry(out, entry) + + +def _write_meta_project_news(out, top_project, entries_by_project): + "Write a NEWS file for a meta-project that contains others." + + top_name = os.path.basename(urllib.parse.urlparse(str(top_project)).path) + release_pattern = rf".*/{top_name}-([0-9\.]*).tar.bz2" + + # Pop the entries for the top project + top_entries = entries_by_project.pop(top_project) + + # Add items from the other projects to the corresponding top entry + for _, entries in entries_by_project.items(): + for version, entry in entries.items(): + if "dist" in entry: + match = re.match(release_pattern, entry["dist"]) + if match: + version = tuple(map(int, match.group(1).split("."))) + for item in entry["items"]: + top_entries[version]["items"] += [ + f'{entry["name"]}: {item}' + ] + + for version in sorted(top_entries.keys(), reverse=True): + out.write("\n" if version != max(top_entries.keys()) else "") + _write_news_entry(out, top_entries[version]) + + +def _write_text_news(out, entries_by_project, top_project=None): + "Write NEWS in standard Debian changelog format." + + if len(entries_by_project) > 1: + if top_project is None: + sys.stderr.write("error: --top is required for multi-projects\n") + return 1 + + _write_meta_project_news(out, top_project, entries_by_project) + else: + project = next(iter(entries_by_project)) + _write_single_project_news(out, entries_by_project[project]) + + return 0 + + +if __name__ == "__main__": + ap = argparse.ArgumentParser( + usage="%(prog)s [OPTION]... DATA_FILE...", + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + ap.add_argument( + "-o", + "--output", + metavar="OUTPUT_FILE", + help="output file path", + ) + + ap.add_argument( + "-t", + "--top-project", + metavar="OUTPUT_FILE", + help="URI of parent meta-project with file releases", + ) + + ap.add_argument( + "DATA_FILE", + nargs="+", + help="path to a Turtle file with release data", + ) + + args = ap.parse_args(sys.argv[1:]) + + if not args.output and "MESON_DIST_ROOT" in os.environ: + args.output = os.path.join(os.getenv("MESON_DIST_ROOT"), "NEWS") + + if not args.output: + sys.exit( + _write_text_news( + sys.stdout, _read_turtle_news(args.DATA_FILE), args.top_project + ) + ) + else: + with open(args.output, "w", encoding="utf-8") as output_file: + sys.exit( + _write_text_news( + output_file, + _read_turtle_news(args.DATA_FILE), + args.top_project, + ) + ) diff --git a/scripts/meson.build b/scripts/meson.build new file mode 100644 index 0000000..400d583 --- /dev/null +++ b/scripts/meson.build @@ -0,0 +1,9 @@ +# Copyright 2021-2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +lv2_scripts = files( + 'lv2_build_index.py', + 'lv2_check_specification.py', + 'lv2_check_syntax.py', + 'lv2_write_news.py', +) diff --git a/test/.clang-tidy b/test/.clang-tidy new file mode 100644 index 0000000..f73d7a6 --- /dev/null +++ b/test/.clang-tidy @@ -0,0 +1,20 @@ +Checks: > + *, + -*-else-after-return, + -*-magic-numbers, + -*-uppercase-literal-suffix, + -altera-*, + -bugprone-easily-swappable-parameters, + -bugprone-macro-parentheses, + -bugprone-suspicious-include, + -bugprone-suspicious-string-compare, + -llvm-header-guard, + -llvmlibc-implementation-in-namespace, + -llvmlibc-restrict-system-libc-headers, + -modernize-use-trailing-return-type, + -performance-no-int-to-ptr, + -readability-function-cognitive-complexity, + -readability-identifier-length, +WarningsAsErrors: '*' +HeaderFilterRegex: '.*' +FormatStyle: file diff --git a/test/atom_test_utils.c b/test/atom_test_utils.c new file mode 100644 index 0000000..ae368c8 --- /dev/null +++ b/test/atom_test_utils.c @@ -0,0 +1,73 @@ +/* + Copyright 2012-2018 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. +*/ + +#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/meson.build b/test/meson.build new file mode 100644 index 0000000..e6178dc --- /dev/null +++ b/test/meson.build @@ -0,0 +1,138 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 OR ISC + +######## +# Data # +######## + +# 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')) +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 + +######## +# 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('test_build.cpp'), + cpp_args: cpp_suppressions, + dependencies: lv2_dep, + ), + suite: 'build') +endif + +########## +# Python # +########## + +if get_option('strict') + flake8 = find_program('flake8', required: get_option('tests')) + pylint = find_program('pylint', required: get_option('tests')) + black = find_program('black', required: get_option('tests')) + + # 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 + + if is_variable('black') and black.found() + black_opts = ['-l', '79', '-q', '--check'] + test('black', black, args: black_opts + all_python_scripts, suite: 'scripts') + endif + + if is_variable('flake8') and flake8.found() + test('flake8', flake8, args: all_python_scripts, suite: 'scripts') + endif + + if is_variable('pylint') and pylint.found() + test('pylint', pylint, args: strict_python_scripts, suite: 'scripts') + endif +endif + +############## +# Unit Tests # +############## + +test_names = [ + 'atom', + 'forge_overflow', +] + +# Build and run tests +if not get_option('tests').disabled() + 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 +endif diff --git a/test/test_atom.c b/test/test_atom.c new file mode 100644 index 0000000..5771694 --- /dev/null +++ b/test/test_atom.c @@ -0,0 +1,367 @@ +/* + Copyright 2012-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. +*/ + +#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..146ad71 --- /dev/null +++ b/test/test_build.c @@ -0,0 +1,52 @@ +/* + Copyright 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, 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" // 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_build.cpp b/test/test_build.cpp new file mode 100644 index 0000000..dc269a6 --- /dev/null +++ b/test/test_build.cpp @@ -0,0 +1,67 @@ +/* + Copyright 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, 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. +*/ + +#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/test_forge_overflow.c b/test/test_forge_overflow.c new file mode 100644 index 0000000..e00b40d --- /dev/null +++ b/test/test_forge_overflow.c @@ -0,0 +1,236 @@ +/* + Copyright 2019 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. +*/ + +#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 new file mode 100755 index 0000000..66fee6b --- /dev/null +++ b/util/lv2_validate.in @@ -0,0 +1,97 @@ +#!/bin/sh + +LV2DIR="@LV2DIR@" + +if [ "$#" -eq "0" ]; then + echo "lv2_validate: missing operand" 1>&2; + echo "" 1>&2; + echo "Usage: lv2_validate [FILE]..." 1>&2; + echo "Validate the given ttl files against the installed LV2 spec" 1>&2; + exit 1 +fi + +sord_validate \ + "$LV2DIR/patch.lv2/manifest.ttl" \ + "$LV2DIR/patch.lv2/patch.meta.ttl" \ + "$LV2DIR/patch.lv2/patch.ttl" \ + "$LV2DIR/port-props.lv2/manifest.ttl" \ + "$LV2DIR/port-props.lv2/port-props.meta.ttl" \ + "$LV2DIR/port-props.lv2/port-props.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/midi.lv2/midi.meta.ttl" \ + "$LV2DIR/midi.lv2/manifest.ttl" \ + "$LV2DIR/midi.lv2/midi.ttl" \ + "$LV2DIR/atom.lv2/manifest.ttl" \ + "$LV2DIR/atom.lv2/atom.ttl" \ + "$LV2DIR/atom.lv2/atom.meta.ttl" \ + "$LV2DIR/dynmanifest.lv2/dynmanifest.meta.ttl" \ + "$LV2DIR/dynmanifest.lv2/manifest.ttl" \ + "$LV2DIR/dynmanifest.lv2/dynmanifest.ttl" \ + "$LV2DIR/options.lv2/manifest.ttl" \ + "$LV2DIR/options.lv2/options.meta.ttl" \ + "$LV2DIR/options.lv2/options.ttl" \ + "$LV2DIR/parameters.lv2/manifest.ttl" \ + "$LV2DIR/parameters.lv2/parameters.ttl" \ + "$LV2DIR/parameters.lv2/parameters.meta.ttl" \ + "$LV2DIR/instance-access.lv2/instance-access.ttl" \ + "$LV2DIR/instance-access.lv2/manifest.ttl" \ + "$LV2DIR/instance-access.lv2/instance-access.meta.ttl" \ + "$LV2DIR/state.lv2/manifest.ttl" \ + "$LV2DIR/state.lv2/state.meta.ttl" \ + "$LV2DIR/state.lv2/state.ttl" \ + "$LV2DIR/port-groups.lv2/manifest.ttl" \ + "$LV2DIR/port-groups.lv2/port-groups.ttl" \ + "$LV2DIR/port-groups.lv2/port-groups.meta.ttl" \ + "$LV2DIR/ui.lv2/manifest.ttl" \ + "$LV2DIR/ui.lv2/ui.ttl" \ + "$LV2DIR/ui.lv2/ui.meta.ttl" \ + "$LV2DIR/morph.lv2/manifest.ttl" \ + "$LV2DIR/morph.lv2/morph.ttl" \ + "$LV2DIR/morph.lv2/morph.meta.ttl" \ + "$LV2DIR/event.lv2/manifest.ttl" \ + "$LV2DIR/event.lv2/event.meta.ttl" \ + "$LV2DIR/event.lv2/event.ttl" \ + "$LV2DIR/resize-port.lv2/manifest.ttl" \ + "$LV2DIR/resize-port.lv2/resize-port.ttl" \ + "$LV2DIR/resize-port.lv2/resize-port.meta.ttl" \ + "$LV2DIR/log.lv2/log.ttl" \ + "$LV2DIR/log.lv2/manifest.ttl" \ + "$LV2DIR/log.lv2/log.meta.ttl" \ + "$LV2DIR/core.lv2/manifest.ttl" \ + "$LV2DIR/core.lv2/lv2core.ttl" \ + "$LV2DIR/core.lv2/lv2core.doap.ttl" \ + "$LV2DIR/core.lv2/meta.ttl" \ + "$LV2DIR/core.lv2/people.ttl" \ + "$LV2DIR/presets.lv2/manifest.ttl" \ + "$LV2DIR/presets.lv2/presets.ttl" \ + "$LV2DIR/presets.lv2/presets.meta.ttl" \ + "$LV2DIR/urid.lv2/manifest.ttl" \ + "$LV2DIR/urid.lv2/urid.ttl" \ + "$LV2DIR/urid.lv2/urid.meta.ttl" \ + "$LV2DIR/time.lv2/time.meta.ttl" \ + "$LV2DIR/time.lv2/manifest.ttl" \ + "$LV2DIR/time.lv2/time.ttl" \ + "$LV2DIR/data-access.lv2/manifest.ttl" \ + "$LV2DIR/data-access.lv2/data-access.meta.ttl" \ + "$LV2DIR/data-access.lv2/data-access.ttl" \ + "$LV2DIR/units.lv2/manifest.ttl" \ + "$LV2DIR/units.lv2/units.ttl" \ + "$LV2DIR/units.lv2/units.meta.ttl" \ + "$LV2DIR/schemas.lv2/xsd.ttl" \ + "$LV2DIR/schemas.lv2/manifest.ttl" \ + "$LV2DIR/schemas.lv2/rdf.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" \ + "$LV2DIR/uri-map.lv2/uri-map.ttl" \ + "$LV2DIR/uri-map.lv2/uri-map.meta.ttl" \ + $@ diff --git a/util/meson.build b/util/meson.build new file mode 100644 index 0000000..ed43f1e --- /dev/null +++ b/util/meson.build @@ -0,0 +1,12 @@ +# Copyright 2022 David Robillard <d@drobilla.net> +# SPDX-License-Identifier: CC0-1.0 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', +) Binary files differdiff --git a/wscript b/wscript deleted file mode 100644 index fa93bba..0000000 --- a/wscript +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -import datetime -import os -import autowaf - -# Version of this package (even if built as a child) -LV2EXT_VERSION = datetime.date.isoformat(datetime.datetime.now()).replace('-', '.') - -# Variables for 'waf dist' -APPNAME = 'lv2plug.in' -VERSION = LV2EXT_VERSION - -# Mandatory variables -srcdir = '.' -blddir = 'build' - -def set_options(opt): - autowaf.set_options(opt) - opt.tool_options('compiler_cc') - opt.tool_options('compiler_cxx') - -def configure(conf): - autowaf.configure(conf) - conf.check_tool('compiler_cc') - conf.check_tool('compiler_cxx') - conf.env.append_value('CCFLAGS', '-std=c99') - pat = conf.env['shlib_PATTERN'] - ext = pat[pat.rfind('.'):] - conf.env.append_value('shlib_EXTENSION', ext) - -def build_plugin(bld, lang, name): - ext = bld.env['shlib_EXTENSION'][0] - - penv = bld.env.copy() - penv['shlib_PATTERN'] = '%s' + ext - - # Library - ext = 'c' - if lang != 'cc': - ext = 'cpp' - - obj = bld.new_task_gen(lang, 'shlib') - obj.env = penv - obj.source = [ 'plugins/%s.lv2/%s.%s' % (name, name, ext) ] - obj.includes = ['.', './ext'] - obj.name = name - obj.target = name - obj.install_path = '${LV2DIR}/' + name + '.lv2' - - if lang == 'cxx': - obj.source += [ 'ext/lv2plugin.cpp' ] - - # Data - data_file = 'plugins/%s.lv2/%s.ttl' % (name, name) - manifest_file = 'plugins/%s.lv2/manifest.ttl' % (name) - bld.install_files('${LV2DIR}/' + name + '.lv2', data_file) - bld.install_files('${LV2DIR}/' + name + '.lv2', manifest_file) - -def build_extension(bld, name, dir): - data_file = '%s/%s.lv2/%s.ttl' % (dir, name, name) - manifest_file = '%s/%s.lv2/manifest.ttl' % (dir, name) - header_files = '%s/%s.lv2/*.h' % (dir, name) - bld.install_files('${LV2DIR}/' + name + '.lv2', data_file) - bld.install_files('${LV2DIR}/' + name + '.lv2', manifest_file) - bld.install_files('${LV2DIR}/' + name + '.lv2', header_files) - -def build(bld): - ext = ''' - atom - atom-port - command - contexts - data-access - dyn-manifest - event - host-info - instance-access - midi - osc - parameter - polymorphic-port - port-groups - presets - string-port - uri-map - variables - ''' - for e in ext.split(): - build_extension(bld, e, 'ext') - - extensions = ''' - ui - units - ''' - for e in extensions.split(): - build_extension(bld, e, 'extensions') - |