# LV2 Presets Extension
# Copyright 2009-2011 David Robillard <d@drobilla.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

@prefix dcs:  <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2:  <http://lv2plug.in/ns/lv2core#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .

<http://drobilla.net/drobilla#me>
	a foaf:Person ;
	foaf:name "David Robillard" ;
	foaf:mbox <mailto:d@drobilla.net> ;
	rdfs:seeAlso <http://drobilla.net/drobilla> .

<http://lv2plug.in/ns/ext/presets>
	a lv2:Specification ;
	doap:license <http://opensource.org/licenses/isc> ;
	doap:name "LV2 Presets" ;
	doap:shortdesc "Presets for LV2 plugins. " ;
	doap:developer <http://drobilla.net/drobilla#me> ;
	doap:release [
		doap:revision "2.3" ;
		doap:created "2012-03-22" ;
		dcs:blame <http://drobilla.net/drobilla#me> ;
		dcs:changeset [
			dcs:item [
				rdfs:label "Add pset:preset property for describing the preset currently applied to a plugin instance."
			]
		]
	] , [
		doap:revision "2.2" ;
		doap:created "2011-11-21" ;
		doap:file-release <http://lv2plug.in/spec/lv2-presets-2.2.tar.bz2> ;
		dcs:blame <http://drobilla.net/drobilla#me> ;
		dcs:changeset [
			dcs:item [
				rdfs:label "Update packaging."
			] , [
				rdfs:label "Improve documentation."
			]
		]
	] , [
		doap:revision "2.0" ;
		doap:created "2010-10-04" ;
		doap:file-release <http://lv2plug.in/spec/lv2-presets-2.0.tar.gz> ;
		dcs:blame <http://drobilla.net/drobilla#me> ;
		dcs:changeset [
			dcs:item [
				rdfs:label "Initial release."
			]
		]
	] ;
	lv2:documentation """
<p>This extension describes a format for presets (i.e. named sets of control
values and possibly other state) for LV2 plugins.  The structure of a
pset:Preset is deliberately identical to that of an lv2:Plugin, and can be
thought of as a plugin template or overlay.  For example:</p>

<pre class="turtle-code">
@prefix eg: &lt;http://example.org/&gt; .

eg:mypreset
    a pset:Preset ;
    rdfs:label "One louder" ;
    pset:appliesTo eg:myplugin ;
    lv2:port [
        lv2:symbol "volume1" ;
        pset:value 11.0
    ] , [
        lv2:symbol "volume2" ;
        pset:value 11.0
    ] .
</pre>

<p>Presets may be defined in any bundle, including the plugin's bundle,
separate third party preset bundles, or user preset bundles saved by hosts.
Since preset data tends to be large, it is recommended that plugins describe
presets in a separate file(s) to avoid slowing down hosts.  The manifest.ttl of
a bundle containing presets should list the presets like so:</p>

<pre class="turtle-code">
eg:mypreset
    a              pset:Preset ;
    pset:appliesTo eg:myplugin ;
    rdfs:seeAlso   &lt;mypreset.ttl&gt; .
</pre>
""" .

pset:Preset
	a rdfs:Class ;
	rdfs:subClassOf lv2:PluginBase ;
	rdfs:label "LV2 Preset" ;
	rdfs:subClassOf [
		a owl:Restriction ;
		owl:onProperty rdfs:label ;
		owl:someValuesFrom xsd:string ;
		rdfs:comment "A Preset MUST have at least one string rdfs:label."
	] ;
	lv2:documentation """
<p>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.</p>

<p>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.</p>
""" .

pset:appliesTo
	a rdf:Property ;
	rdfs:domain pset:Preset ;
	rdfs:range lv2:Plugin ;
	rdfs:label "Applies to" ;
	lv2:documentation """
<p>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.</p>

<p>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.</p>
""" .

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.
""" .

pset:preset
	a rdf:Property ;
	rdfs:domain lv2:PluginBase ;
	rdfs:range pset:Preset ;
	rdfs:label "Preset" ;
	lv2:documentation """
<p>Specifies the preset currently applied to a plugin instance.  This property
may be useful for saving state, or notifying a plugin instance at run-time
about a preset change.</p>
""" .