From 9977d659105937112587e7eb68c59fae7169d945 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 18 Feb 2012 23:12:49 +0000 Subject: 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. --- lv2/lv2plug.in/ns/ext/state/state.h | 11 ++++++----- lv2/lv2plug.in/ns/ext/state/state.ttl | 23 +++-------------------- 2 files changed, 9 insertions(+), 25 deletions(-) (limited to 'lv2/lv2plug.in/ns/ext/state') 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_INTERFACE_URI LV2_STATE_URI "#Interface" -#define LV2_STATE_PATH_URI LV2_STATE_URI "#Path" -#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)

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 state:mapPath for details.

+paths, see state:mapPath for details. Plugins MUST +use the type atom:Path +for all paths in their state.

Creating New Files or Directories

@@ -267,7 +269,6 @@ state:mapPath a lv2:Feature ; rdfs:label "Support for storing paths in files" ; lv2:documentation """ -

This feature maps absolute paths to/from abstract paths 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 """ -

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) } """ . - -state:Path - a rdfs:Class ; - rdfs:label "Path" ; - lv2:documentation """ -

A path to a file or directory.

- -

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

- -

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.

-""" . -- cgit v1.2.1