From 8b8fd29712602c7352fee7763662f4fc103363a8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 26 Jan 2013 21:13:34 +0000 Subject: Add state:loadDefaultState feature. --- lv2/lv2plug.in/ns/ext/state/lv2-state.doap.ttl | 8 ++++++++ lv2/lv2plug.in/ns/ext/state/manifest.ttl | 2 +- lv2/lv2plug.in/ns/ext/state/state.ttl | 13 +++++++++++++ plugins/eg-sampler.lv2/sampler.ttl | 6 +++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lv2/lv2plug.in/ns/ext/state/lv2-state.doap.ttl b/lv2/lv2plug.in/ns/ext/state/lv2-state.doap.ttl index c26cba1..48fb89f 100644 --- a/lv2/lv2plug.in/ns/ext/state/lv2-state.doap.ttl +++ b/lv2/lv2plug.in/ns/ext/state/lv2-state.doap.ttl @@ -14,6 +14,14 @@ ; doap:maintainer ; doap:release [ + doap:revision "1.3" ; + doap:created "2013-01-16" ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add state:loadDefaultState feature so plugins can have their default state loaded without hard-coding default state as a special case." + ] + ] + ] , [ doap:revision "1.2" ; doap:created "2012-10-14" ; doap:file-release ; diff --git a/lv2/lv2plug.in/ns/ext/state/manifest.ttl b/lv2/lv2plug.in/ns/ext/state/manifest.ttl index c350e8f..4cc3b25 100644 --- a/lv2/lv2plug.in/ns/ext/state/manifest.ttl +++ b/lv2/lv2plug.in/ns/ext/state/manifest.ttl @@ -4,5 +4,5 @@ a lv2:Specification ; lv2:minorVersion 1 ; - lv2:microVersion 2 ; + lv2:microVersion 3 ; rdfs:seeAlso . diff --git a/lv2/lv2plug.in/ns/ext/state/state.ttl b/lv2/lv2plug.in/ns/ext/state/state.ttl index a9b997c..699ef45 100644 --- a/lv2/lv2plug.in/ns/ext/state/state.ttl +++ b/lv2/lv2plug.in/ns/ext/state/state.ttl @@ -240,6 +240,19 @@ the properties of the state dictionary (except the property that states it has this type).

""" . +state:loadDefaultState + a lv2:Feature ; + lv2:documentation """ +

This feature indicates that the plugin has default state listed with the +state:state property which should be loaded by the host before running the +plugin. Requiring this feature allows plugins to implement a single state +loading mechanism which works for initialisation as well as restoration, +without having to hard-code default state.

+ +

To support this feature, the host MUST restore the default state +after instantiating the plugin but before calling run().

+""" . + state:state a rdf:Property ; rdfs:label "state" ; diff --git a/plugins/eg-sampler.lv2/sampler.ttl b/plugins/eg-sampler.lv2/sampler.ttl index 446f5a3..072521a 100644 --- a/plugins/eg-sampler.lv2/sampler.ttl +++ b/plugins/eg-sampler.lv2/sampler.ttl @@ -38,7 +38,8 @@ lv2:project ; lv2:requiredFeature urid:map , work:schedule ; - lv2:optionalFeature lv2:hardRTCapable ; + lv2:optionalFeature lv2:hardRTCapable , + state:loadDefaultState ; lv2:extensionData state:interface , work:interface ; ui:ui ; @@ -68,6 +69,9 @@ lv2:index 2 ; lv2:symbol "out" ; lv2:name "Out" + ] ; + state:state [ + ] . -- cgit v1.2.1