path: root/lv2/lv2plug.in/ns/ext/state
diff options
authorDavid Robillard <d@drobilla.net>2012-02-18 23:12:49 +0000
committerDavid Robillard <d@drobilla.net>2012-02-18 23:12:49 +0000
commit9977d659105937112587e7eb68c59fae7169d945 (patch)
treebb702e76f01b79050a4cbf7cb7b8052e21d84fc6 /lv2/lv2plug.in/ns/ext/state
parent12c86dfba742f1ac3585846f52d5039e9854861c (diff)
Remove state:Path and use new atom:Path instead.
Remove suggestion to use file URIs in plugins, which is much too tedious. If plugins use standard atom types, hosts should be able to map paths in any way (which they may need to regardless). Unfortunately it's slightly less pretty in Turtle to have a special path type rather than a (possibly relative) URI. Factor out common write_set_filename_msg in sampler example. Establish common URI define convention LV2_EXTNAME__URILOCALNAME and define all URIs in state, message, and atom.
Diffstat (limited to 'lv2/lv2plug.in/ns/ext/state')
2 files changed, 9 insertions, 25 deletions
diff --git a/lv2/lv2plug.in/ns/ext/state/state.h b/lv2/lv2plug.in/ns/ext/state/state.h
index b450b93..aa272b7 100644
--- a/lv2/lv2plug.in/ns/ext/state/state.h
+++ b/lv2/lv2plug.in/ns/ext/state/state.h
@@ -36,10 +36,11 @@ extern "C" {
#define LV2_STATE_URI "http://lv2plug.in/ns/ext/state"
-#define LV2_STATE_MAP_PATH_URI LV2_STATE_URI "#mapPath"
-#define LV2_STATE_MAKE_PATH_URI LV2_STATE_URI "#makePath"
+#define LV2_STATE__Interface LV2_STATE_URI "#Interface"
+#define LV2_STATE__State LV2_STATE_URI "#State"
+#define LV2_STATE__state LV2_STATE_URI "#state"
+#define LV2_STATE__mapPath LV2_STATE_URI "#mapPath"
+#define LV2_STATE__makePath LV2_STATE_URI "#makePath"
typedef void* LV2_State_Handle;
typedef void* LV2_State_Map_Path_Handle;
@@ -315,7 +316,7 @@ typedef struct {
} LV2_State_Map_Path;
- Feature data for state:makePath (@ref LV2_STATE_MAKE_PATH_URI).
+ Feature data for state:makePath (@ref LV2_STATE__makePath).
typedef struct {
diff --git a/lv2/lv2plug.in/ns/ext/state/state.ttl b/lv2/lv2plug.in/ns/ext/state/state.ttl
index 6c0656a..4b86eb6 100644
--- a/lv2/lv2plug.in/ns/ext/state/state.ttl
+++ b/lv2/lv2plug.in/ns/ext/state/state.ttl
@@ -193,7 +193,9 @@ Map get_plugin_state(LV2_Handle instance)
<p>Plugins may need to refer to files (e.g. loaded samples) in their state.
This is done by storing the file's path as a property just like any other
value. However, there are some rules which MUST be followed when storing
-paths, see <a href="#mapPath">state:mapPath</a> for details.</p>
+paths, see <a href="#mapPath">state:mapPath</a> for details. Plugins MUST
+use the type <a href="http://lv2plug.in/ns/ext/atom#Path">atom:Path</a>
+for all paths in their state.</p>
<h3>Creating New Files or Directories</h3>
@@ -267,7 +269,6 @@ state:mapPath
a lv2:Feature ;
rdfs:label "Support for storing paths in files" ;
lv2:documentation """
<p>This feature maps absolute paths to/from <q>abstract paths</q> which are
stored in state. To support this feature a host must pass an LV2_Feature with
URI LV2_STATE_MAP_PATH_URI and data pointed to an LV2_State_Map_Path to the
@@ -305,7 +306,6 @@ state:makePath
a lv2:Feature ;
rdfs:label "Support for creating new files and directories" ;
lv2:documentation """
<p>This feature allows plugins to create new files and/or directories. To
support this feature the host passes an LV2_Feature with URI
LV2_STATE_MAKE_PATH_URI and data pointed to an LV2_State_Make_Path to the
@@ -340,20 +340,3 @@ char* save_myfile(LV2_State_Make_Path* make_path)
""" .
- a rdfs:Class ;
- rdfs:label "Path" ;
- lv2:documentation """
-<p>A path to a file or directory.</p>
-<p>The format of a state:Path is a C string, possibly escaped or otherwise
-restricted in a system-specific manner. This URI (LV2_STATE_PATH_URI), mapped
-to an integer, MUST be used as the <code>type</code> parameter for any files
-passed to the LV2_State_Store_Function; and will likewise be returned by the
-corresponding call to the LV2_State_Retrieve_Function.</p>
-<p>When storing and retrieving a path, the plugin MUST NOT assume the same path
-will be restored. However, the restored path will refer to a file with
-equivalent contents to the original.</p>
-""" .