diff options
100 files changed, 12667 insertions, 0 deletions
diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..26b72bd --- /dev/null +++ b/Doxyfile @@ -0,0 +1,1532 @@ +# 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 + @@ -0,0 +1,36 @@ +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. + +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/autowaf.py b/autowaf.py new file mode 100644 index 0000000..7e8790a --- /dev/null +++ b/autowaf.py @@ -0,0 +1,438 @@ +#!/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 new file mode 100644 index 0000000..8708976 --- /dev/null +++ b/core.lv2/AUTHORS @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000..c2d62e3 --- /dev/null +++ b/core.lv2/COPYING @@ -0,0 +1,6 @@ +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 new file mode 100644 index 0000000..82ef5d6 --- /dev/null +++ b/core.lv2/ChangeLog @@ -0,0 +1,16 @@ +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 new file mode 100644 index 0000000..17a9e90 --- /dev/null +++ b/core.lv2/Doxyfile @@ -0,0 +1,1515 @@ +# 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 new file mode 100644 index 0000000..da0ae59 --- /dev/null +++ b/core.lv2/INSTALL @@ -0,0 +1,52 @@ +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 new file mode 100644 index 0000000..ebb33a0 --- /dev/null +++ b/core.lv2/README @@ -0,0 +1,30 @@ +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 new file mode 120000 index 0000000..4410d0d --- /dev/null +++ b/core.lv2/autowaf.py @@ -0,0 +1 @@ +../autowaf.py
\ No newline at end of file diff --git a/core.lv2/lv2.h b/core.lv2/lv2.h new file mode 100644 index 0000000..ded1512 --- /dev/null +++ b/core.lv2/lv2.h @@ -0,0 +1,392 @@ +/* LV2 - LADSPA (Linux Audio Developer's Simple Plugin API) Version 2 + * Revision 1 + * + * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, + * Stefan Westerfeld. + * Copyright (C) 2006-2008 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. + */ + +#ifndef LV2_H_INCLUDED +#define LV2_H_INCLUDED + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +/* ************************************************************************* */ + + +/** @file lv2.h + * C header for the LV2 specification <http://lv2plug.in/ns/lv2core>. + * Revision: 1 + * + * == Overview == + * + * 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') 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 (defined in this + * header) does not contain enough information to make use of the plugin + * possible - the data file is mandatory. + * + * Plugins are expected to distinguish between control rate and audio + * rate data (or other types of data defined by extensions). 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. Audio rate + * data is communicated using arrays with one 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 values. Control + * rate data has a single value at the start of a call to the 'run()' + * function, and may be considered to remain this value for its duration. + * Thus the 'control rate' is determined by the block size, controlled by + * the host. The plugin may assume that all its input and output ports have + * been connected to the relevant data location (see the 'connect_port()' + * function below) before it is asked to run, unless the port has been set + * 'connection optional' in the plugin's data file. + * + * Plugins will reside in shared object files suitable for dynamic linking + * by dlopen() and family. The file will provide a number of 'plugin + * types' that can be used to instantiate actual plugins (sometimes known + * as 'plugin instances') that can be connected together to perform tasks. + * The host can access these plugin types using the lv2_descriptor() + * function. + * + * This API contains very limited error-handling. + * + * == Threading rules == + * + * 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: + * + * - Discovery class: lv2_descriptor(), extension_data() + * - Instantiation class: instantiate(), cleanup(), activate(), deactivate() + * - Audio class: run(), connect_port() + * + * 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 these: + * + * - When a function from the Discovery class is running, no other + * functions in the same shared object file may run. + * - When a function from the Instantiation class is running for a plugin + * instance, no other functions for that instance may run. + * - When a function is running for a plugin instance, no other + * function in the same class may run 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 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 Type of 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 Plugin Types. + * + * The exact mechanism by which plugins are loaded is host-dependent, + * however all most hosts will need to know is the URI of the plugin they + * wish to load. The environment variable LV2_PATH, if present, should + * contain a colon-separated path indicating directories (containing + * plugin bundle subdirectories) that should be searched (in order) + * for plugins. It is expected that hosts will 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 + * the 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 (ie 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 new file mode 100644 index 0000000..23f014d --- /dev/null +++ b/core.lv2/lv2.ttl @@ -0,0 +1,744 @@ +# 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 processing plugin 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> + ] . + + + +############################# +## 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 new file mode 100644 index 0000000..5c06f73 --- /dev/null +++ b/core.lv2/lv2core.pc.in @@ -0,0 +1,10 @@ +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 new file mode 100644 index 0000000..fabe17e --- /dev/null +++ b/core.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 120000 index 0000000..9770e60 --- /dev/null +++ b/core.lv2/waf @@ -0,0 +1 @@ +../waf
\ No newline at end of file diff --git a/core.lv2/wscript b/core.lv2/wscript new file mode 100644 index 0000000..4c3b10e --- /dev/null +++ b/core.lv2/wscript @@ -0,0 +1,41 @@ +#!/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') + diff --git a/doc/index.php b/doc/index.php new file mode 100644 index 0000000..e6cdd10 --- /dev/null +++ b/doc/index.php @@ -0,0 +1,60 @@ +<?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 new file mode 100644 index 0000000..f8f0827 --- /dev/null +++ b/doc/mainpage.dox @@ -0,0 +1,24 @@ +/** @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/style.css b/doc/style.css new file mode 100644 index 0000000..de1ec1f --- /dev/null +++ b/doc/style.css @@ -0,0 +1,180 @@ +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, h4, h5, h6 { + 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/ext/atom-port.lv2/atom-port.ttl b/ext/atom-port.lv2/atom-port.ttl new file mode 100644 index 0000000..7533606 --- /dev/null +++ b/ext/atom-port.lv2/atom-port.ttl @@ -0,0 +1,127 @@ +# 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 new file mode 100644 index 0000000..e681793 --- /dev/null +++ b/ext/atom-port.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..fe7a373 --- /dev/null +++ b/ext/atom.lv2/atom.h @@ -0,0 +1,232 @@ +/* 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 new file mode 100644 index 0000000..ad957f3 --- /dev/null +++ b/ext/atom.lv2/atom.ttl @@ -0,0 +1,272 @@ +# 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, which allows 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 (meaningful type-oblivious use is impossible, +e.g. the blob pointer may not point to actual memory). + +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. Pedantically, this +class refers to the type of memory starting where the LV2_Atom header starts, +i.e. a chunk of memory with any type that is a subClassOf atom:AtomType by +definition starts with an LV2_Atom. The area after the header is referred +to as the atom's "body". + +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, this 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:Foo 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/atom.lv2/manifest.ttl b/ext/atom.lv2/manifest.ttl new file mode 100644 index 0000000..65a4e6e --- /dev/null +++ b/ext/atom.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <atom.ttl> . + diff --git a/ext/command.lv2/command.ttl b/ext/command.lv2/command.ttl new file mode 100644 index 0000000..ab8b82b --- /dev/null +++ b/ext/command.lv2/command.ttl @@ -0,0 +1,73 @@ +# 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 new file mode 100644 index 0000000..0590b62 --- /dev/null +++ b/ext/command.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..c6e8ef2 --- /dev/null +++ b/ext/contexts.lv2/contexts.h @@ -0,0 +1,72 @@ +/* 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 new file mode 100644 index 0000000..59c4cb1 --- /dev/null +++ b/ext/contexts.lv2/contexts.ttl @@ -0,0 +1,202 @@ +# 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 new file mode 100644 index 0000000..373b8f6 --- /dev/null +++ b/ext/contexts.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..f55cdd6 --- /dev/null +++ b/ext/contexts.lv2/test.c @@ -0,0 +1,65 @@ +#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 new file mode 100644 index 0000000..aa87723 --- /dev/null +++ b/ext/data-access.lv2/data-access.h @@ -0,0 +1,57 @@ +/* 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 new file mode 100644 index 0000000..ce5c849 --- /dev/null +++ b/ext/data-access.lv2/data-access.ttl @@ -0,0 +1,46 @@ +# 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/data-access.lv2/manifest.ttl b/ext/data-access.lv2/manifest.ttl new file mode 100644 index 0000000..11b6e52 --- /dev/null +++ b/ext/data-access.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <data-access.ttl> . + diff --git a/ext/dyn-manifest.lv2/Makefile b/ext/dyn-manifest.lv2/Makefile new file mode 100644 index 0000000..c575035 --- /dev/null +++ b/ext/dyn-manifest.lv2/Makefile @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000..00e46fd --- /dev/null +++ b/ext/dyn-manifest.lv2/dyn-manifest.h @@ -0,0 +1,245 @@ +/* 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 new file mode 100644 index 0000000..84e8f5a --- /dev/null +++ b/ext/dyn-manifest.lv2/dyn-manifest.ttl @@ -0,0 +1,109 @@ +# 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 new file mode 100644 index 0000000..e5d09b4 --- /dev/null +++ b/ext/dyn-manifest.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..14500b8 --- /dev/null +++ b/ext/event.lv2/event-helpers.h @@ -0,0 +1,243 @@ +/* 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 "event.lv2/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 new file mode 100644 index 0000000..7fb189c --- /dev/null +++ b/ext/event.lv2/event.h @@ -0,0 +1,259 @@ +/* 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 new file mode 100644 index 0000000..4f939a4 --- /dev/null +++ b/ext/event.lv2/event.ttl @@ -0,0 +1,192 @@ +# 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 new file mode 100644 index 0000000..6d556ef --- /dev/null +++ b/ext/event.lv2/lv2_event.pc.in @@ -0,0 +1,10 @@ +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/event.lv2/manifest.ttl b/ext/event.lv2/manifest.ttl new file mode 100644 index 0000000..8f17311 --- /dev/null +++ b/ext/event.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <event.ttl> . + diff --git a/ext/files.lv2/files.h b/ext/files.lv2/files.h new file mode 100644 index 0000000..4f0564f --- /dev/null +++ b/ext/files.lv2/files.h @@ -0,0 +1,61 @@ +/* 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 new file mode 100644 index 0000000..a83889d --- /dev/null +++ b/ext/files.lv2/files.ttl @@ -0,0 +1,94 @@ +# 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 new file mode 100644 index 0000000..7f572d9 --- /dev/null +++ b/ext/files.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..2aac2fc --- /dev/null +++ b/ext/host-info.lv2/host-info.ttl @@ -0,0 +1,116 @@ +# 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 new file mode 100644 index 0000000..a431711 --- /dev/null +++ b/ext/host-info.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..e8b833f --- /dev/null +++ b/ext/instance-access.lv2/instance-access.h @@ -0,0 +1,39 @@ +/* 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 new file mode 100644 index 0000000..0646478 --- /dev/null +++ b/ext/instance-access.lv2/instance-access.ttl @@ -0,0 +1,46 @@ +# 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/instance-access.lv2/manifest.ttl b/ext/instance-access.lv2/manifest.ttl new file mode 100644 index 0000000..e1f154b --- /dev/null +++ b/ext/instance-access.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <instance-access.ttl> . + diff --git a/ext/midi.lv2/manifest.ttl b/ext/midi.lv2/manifest.ttl new file mode 100644 index 0000000..f243e8a --- /dev/null +++ b/ext/midi.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <midi.ttl> . + diff --git a/ext/midi.lv2/midi.ttl b/ext/midi.lv2/midi.ttl new file mode 100644 index 0000000..12725ad --- /dev/null +++ b/ext/midi.lv2/midi.ttl @@ -0,0 +1,87 @@ +# 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 new file mode 100644 index 0000000..0c1d1e0 --- /dev/null +++ b/ext/osc.lv2/lv2_osc.c @@ -0,0 +1,314 @@ +/* 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 new file mode 100644 index 0000000..0424836 --- /dev/null +++ b/ext/osc.lv2/lv2_osc.pc.in @@ -0,0 +1,10 @@ +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 new file mode 100644 index 0000000..5282d46 --- /dev/null +++ b/ext/osc.lv2/lv2_osc_print.c @@ -0,0 +1,66 @@ +/* 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 new file mode 100644 index 0000000..3f76d41 --- /dev/null +++ b/ext/osc.lv2/lv2_osc_test.c @@ -0,0 +1,55 @@ +#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 new file mode 100644 index 0000000..dc7c310 --- /dev/null +++ b/ext/osc.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..7d590f3 --- /dev/null +++ b/ext/osc.lv2/osc-print.h @@ -0,0 +1,42 @@ +/* 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 "ext/osc.lv2/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 new file mode 100644 index 0000000..23e49a9 --- /dev/null +++ b/ext/osc.lv2/osc.h @@ -0,0 +1,123 @@ +/* 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 new file mode 100644 index 0000000..1cacdab --- /dev/null +++ b/ext/osc.lv2/osc.ttl @@ -0,0 +1,56 @@ +# 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 new file mode 100644 index 0000000..04e511d --- /dev/null +++ b/ext/parameter.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..5970844 --- /dev/null +++ b/ext/parameter.lv2/parameter.ttl @@ -0,0 +1,110 @@ +# 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 new file mode 100644 index 0000000..f1a7ecd --- /dev/null +++ b/ext/persist.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..928a297 --- /dev/null +++ b/ext/persist.lv2/persist.h @@ -0,0 +1,177 @@ +/* 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 new file mode 100644 index 0000000..f1dd86f --- /dev/null +++ b/ext/persist.lv2/persist.ttl @@ -0,0 +1,116 @@ +# 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: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 new file mode 100644 index 0000000..abe3788 --- /dev/null +++ b/ext/polymorphic-port.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..98d691e --- /dev/null +++ b/ext/polymorphic-port.lv2/polymorphic-port.h @@ -0,0 +1,63 @@ +/* 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 new file mode 100644 index 0000000..b3d1b37 --- /dev/null +++ b/ext/polymorphic-port.lv2/polymorphic-port.ttl @@ -0,0 +1,71 @@ +# 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/manifest.ttl b/ext/port-groups.lv2/manifest.ttl new file mode 100644 index 0000000..4f6c01c --- /dev/null +++ b/ext/port-groups.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <port-groups.ttl> . + diff --git a/ext/port-groups.lv2/port-groups.ttl b/ext/port-groups.lv2/port-groups.ttl new file mode 100644 index 0000000..e0512db --- /dev/null +++ b/ext/port-groups.lv2/port-groups.ttl @@ -0,0 +1,489 @@ +# 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/manifest.ttl b/ext/presets.lv2/manifest.ttl new file mode 100644 index 0000000..9f82f88 --- /dev/null +++ b/ext/presets.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <presets.ttl> . + diff --git a/ext/presets.lv2/presets.ttl b/ext/presets.lv2/presets.ttl new file mode 100644 index 0000000..804e187 --- /dev/null +++ b/ext/presets.lv2/presets.ttl @@ -0,0 +1,88 @@ +# 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/manifest.ttl b/ext/resize-port.lv2/manifest.ttl new file mode 100644 index 0000000..0f2179b --- /dev/null +++ b/ext/resize-port.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 ; + rdfs:seeAlso <resize-port.ttl> . + diff --git a/ext/resize-port.lv2/resize-port.h b/ext/resize-port.lv2/resize-port.h new file mode 100644 index 0000000..4ba533b --- /dev/null +++ b/ext/resize-port.lv2/resize-port.h @@ -0,0 +1,46 @@ +/* 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 new file mode 100644 index 0000000..d6bbb35 --- /dev/null +++ b/ext/resize-port.lv2/resize-port.ttl @@ -0,0 +1,85 @@ +# 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 new file mode 100644 index 0000000..c7ba4e1 --- /dev/null +++ b/ext/string-port.lv2/manifest.ttl @@ -0,0 +1,6 @@ +@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 new file mode 100644 index 0000000..e7fc8c7 --- /dev/null +++ b/ext/string-port.lv2/string-port.h @@ -0,0 +1,58 @@ +/* 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 new file mode 100644 index 0000000..e6adfc2 --- /dev/null +++ b/ext/string-port.lv2/string-port.ttl @@ -0,0 +1,105 @@ +# 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/manifest.ttl b/ext/uri-map.lv2/manifest.ttl new file mode 100644 index 0000000..62d0bb6 --- /dev/null +++ b/ext/uri-map.lv2/manifest.ttl @@ -0,0 +1,6 @@ +@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 ; + rdfs:seeAlso <uri-map.ttl> . diff --git a/ext/uri-map.lv2/uri-map.h b/ext/uri-map.lv2/uri-map.h new file mode 100644 index 0000000..d0d04e4 --- /dev/null +++ b/ext/uri-map.lv2/uri-map.h @@ -0,0 +1,87 @@ +/* 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 new file mode 100644 index 0000000..0c557d0 --- /dev/null +++ b/ext/uri-map.lv2/uri-map.ttl @@ -0,0 +1,54 @@ +# 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 new file mode 100644 index 0000000..a8e3306 --- /dev/null +++ b/ext/variables.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@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 new file mode 100644 index 0000000..451aeb2 --- /dev/null +++ b/ext/variables.lv2/variables-private.h @@ -0,0 +1,48 @@ +/* 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 new file mode 100644 index 0000000..5c51be7 --- /dev/null +++ b/ext/variables.lv2/variables.h @@ -0,0 +1,144 @@ +/* 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 new file mode 100644 index 0000000..b7d1b8c --- /dev/null +++ b/ext/variables.lv2/variables.ttl @@ -0,0 +1,118 @@ +# 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/manifest.ttl b/extensions/ui.lv2/manifest.ttl new file mode 100644 index 0000000..2c20933 --- /dev/null +++ b/extensions/ui.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/ui> + a lv2:Specification ; + rdfs:seeAlso <ui.ttl> . + diff --git a/extensions/ui.lv2/ui.h b/extensions/ui.lv2/ui.h new file mode 100644 index 0000000..cedb895 --- /dev/null +++ b/extensions/ui.lv2/ui.h @@ -0,0 +1,241 @@ +/* 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 new file mode 100644 index 0000000..496b625 --- /dev/null +++ b/extensions/ui.lv2/ui.ttl @@ -0,0 +1,217 @@ +# 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 "2pre" ; + 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/manifest.ttl b/extensions/units.lv2/manifest.ttl new file mode 100644 index 0000000..6af241d --- /dev/null +++ b/extensions/units.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/ext/units> + a lv2:Specification ; + rdfs:seeAlso <units.ttl> . + diff --git a/extensions/units.lv2/units.ttl b/extensions/units.lv2/units.ttl new file mode 100644 index 0000000..52e20f6 --- /dev/null +++ b/extensions/units.lv2/units.ttl @@ -0,0 +1,350 @@ +# 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 new file mode 100755 index 0000000..eca6c35 --- /dev/null +++ b/gendoc.py @@ -0,0 +1,160 @@ +#!/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' + +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') + os.mkdir(os.path.join(outdir, 'releases')) + + 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' + + subprocess.call(['tar', '-czf', outdir + '/releases/%s.lv2-%s.tgz' % (b, rev), + 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="content"><a href="./releases">Releases</a></div>\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/lv2compatgen/lv2compatgen.py b/lv2compatgen/lv2compatgen.py new file mode 100755 index 0000000..60bad70 --- /dev/null +++ b/lv2compatgen/lv2compatgen.py @@ -0,0 +1,154 @@ +#!/usr/bin/python +# -*- coding: utf8 -*- +# +# 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 print_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: + print_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 new file mode 120000 index 0000000..f320096 --- /dev/null +++ b/lv2compatgen/style.css @@ -0,0 +1 @@ +../doc/style.css
\ No newline at end of file diff --git a/lv2compatgen/template.html b/lv2compatgen/template.html new file mode 100644 index 0000000..2948759 --- /dev/null +++ b/lv2compatgen/template.html @@ -0,0 +1,26 @@ +<!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/lv2specgen/footer.html b/lv2specgen/footer.html new file mode 100644 index 0000000..5259e4c --- /dev/null +++ b/lv2specgen/footer.html @@ -0,0 +1,22 @@ + <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/lv2specgen.py b/lv2specgen/lv2specgen.py new file mode 100755 index 0000000..df13d05 --- /dev/null +++ b/lv2specgen/lv2specgen.py @@ -0,0 +1,856 @@ +#!/usr/bin/python +# -*- coding: utf8 -*- +# +# lv2specgen, an LV2 extension specification page generator +# Copyright (c) 2009 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 +# 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. + +__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 re +import urllib + +try: + import RDF + import Redland +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") + +#global vars +classranges = {} +classdomains = {} +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/') + + +def niceName(uri): + regexp = re.compile( "^(.*[/#])([^/#]+)$" ) + rez = regexp.search( uri ) + if not rez: + return uri + pref = rez.group(1) + if ns_list.has_key(pref): + return ns_list.get(pref, pref) + ":" + rez.group(2) + else: + return uri + + +def return_name(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'] + else: + return "" + + +def rdfsPropertyInfo(term,m): + """Generate HTML for properties: Domain, range""" + global classranges + global classdomains + doc = "" + range = "" + domain = "" + + # 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 + + # Domain stuff + domains = m.find_statements(RDF.Statement(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) + for uri in uris: + domainsdoc += "<dd>%s</dd>" % getTermLink(uri, term, rdfs.domain) + add(classdomains, uri, term.uri) + 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 + + # Range stuff + ranges = m.find_statements(RDF.Statement(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) + for uri in uris: + rangesdoc += "<dd>%s</dd>" % getTermLink(uri, term, rdfs.range) + add(classranges, uri, term.uri) + 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 + + return doc + + +def parseCollection(model, collection): + 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)) + + 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)) + else: + return '<a href="%s" style="font-family: monospace;" %s>%s</a>' % (uri, extra, niceName(uri)) + + +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>' + + # Find out about properties which have rdfs:domain of t + d = classdomains.get(str(term.uri), "") + if d: + dlist = '' + for k in d: + dlist += "<dd>%s</dd>" % getTermLink(k) + doc += "<dt>In domain of</dt>" + dlist + + # Find out about properties which have rdfs:range of t + r = classranges.get(str(term.uri), "") + if r: + rlist = '' + for k in r: + rlist += "<dd>%s</dd>" % getTermLink(k) + doc += "<dt>In range of</dt>" + 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): + 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' + else: + doc += '<td class="blankdef">?</td>\n' + doc += '</tr>' + if doc != '': + doc = '<table class="blankdesc">\n%s\n</table>\n' % doc + return doc + + +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): + 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' + else: + doc += '<dd>?</dd>\n' + last_pred = p.predicate + return doc + + +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) + + return doc + + +def owlInfo(term,m): + """Returns an extra information that is defined about a term (an RDF.Node()) 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)) + + 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 + 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.SymmetricProperty, "Symmetric Property") + + return res + + +def docTerms(category, list, m): + """ + 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. + """ + 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) + 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>" + 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" + + return doc + + +def getShortName(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("/","_") + 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) + """ + + 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: + p = getShortName(i) + anchor = getAnchor(i) + azlist = """%s <a href="#%s">%s</a>, """ % (azlist, anchor, p) + azlist = """%s</dd>\n""" % azlist + + azlist = """%s\n</dl>""" % azlist + return azlist + + +def add(where, key, value): + if not where.has_key(key): + where[key] = [] + if not value in where[key]: + where[key].append(value) + + +def specInformation(m, ns): + """ + Read through the spec (provided as a Redland model) and return classlist + and proplist. Global variables classranges and classdomains are also filled + as appropriate. + """ + global classranges + global classdomains + + # Find the class information: Ranges, domains, and list of all names. + classtypes = [rdfs.Class, owl.Class] + 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)) + + # Create a list of properties in the schema. + 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) + + 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 '' + + +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] + return properties + + +def specAuthors(m, subject): + "Return an HTML description of the authors of the spec." + ret = '' + 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)): + ret += '<div class="author" property="dc:creator">' + j.object.literal_value['string'] + '</div>' + return ret + + +def specRevision(m, subject): + """ + Return a (revision date) tuple, both strings, about the latest + release of the specification + """ + 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']) + + +def getInstances(model, classes, properties): + """ + Extract all resources instanced in the ontology + (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) + return instances + + +def specgen(specloc, docdir, template, instances=False, mode="spec"): + """The meat and potatoes: Everything starts here.""" + + 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" + + spec_url = getOntologyNS(m) + + spec_ns_str = spec_url + 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() + prefixes_html = "<span>" + for i in keys: + uri = namespaces[i] + if spec_pre is None and str(uri) == str(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' + 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) + + # Generate Term HTML + termlist = docTerms('Property', proplist, m) + termlist = docTerms('Class', classlist, m) + termlist + 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)) + + 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('@MAINTAINERS@', 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 = '<li><a href=".">Bundle</a></li>\n' + other_files += '<li><a href="../releases">Releases</a></li>\n' + 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')) + + 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) + + +def getNamespaces(parser): + """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 + 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): + sys.exit("Impossible to get ontology's namespace") + else: + return ns + + +def usage(): + script = os.path.basename(sys.argv[0]) + print """Usage: + %s ONTOLOGY TEMPLATE STYLE OUTPUT [FLAGS] + + 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 + +Example: + %s lv2_foos.ttl template.html style.css lv2_foos.html ../docs -i -p foos + +""" % (script, script) + sys.exit(-1) + + +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)) + diff --git a/lv2specgen/style.css b/lv2specgen/style.css new file mode 120000 index 0000000..f320096 --- /dev/null +++ b/lv2specgen/style.css @@ -0,0 +1 @@ +../doc/style.css
\ No newline at end of file diff --git a/lv2specgen/template.html b/lv2specgen/template.html new file mode 100644 index 0000000..c30c83c --- /dev/null +++ b/lv2specgen/template.html @@ -0,0 +1,102 @@ +<!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: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@ + xml:lang="en"> + <head> + <title>@NAME@</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">@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">Maintainer(s)</th><td>@MAINTAINERS@</td></tr> + <tr><th class="metahead">Namespaces</th><td>@PREFIXES@</td></tr> + </table> + </div> + + + <!-- META --> + + <div class="content"> + <p>This document describes <a href="@URI@">@NAME@</a>, + an <a href="http://lv2plug.in/ns/lv2core">LV2</a> extension. + 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> + + </body> +</html> + Binary files differ@@ -0,0 +1,93 @@ +#!/usr/bin/env python +import autowaf + +# Version of this package (even if built as a child) +LV2EXT_VERSION = '0.0.0' + +# Variables for 'waf dist' +APPNAME = 'lv2ext' +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) + bld.install_files('${LV2DIR}/' + name + '.lv2', data_file) + bld.install_files('${LV2DIR}/' + name + '.lv2', manifest_file) + +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') + |