Ignore:
Timestamp:
01/07/12 19:13:15 (3 years ago)
Author:
drobilla
Message:

Add file support to state implementation.
Use cleaner and more consistent names for world URIs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lilv/lilv/lilv.h

    r3912 r3918  
    11421142   @param plugin The plugin this state applies to. 
    11431143   @param instance An instance of @c plugin. 
     1144   @param dir Directory containing files created by plugin (or NULL). 
    11441145   @param flags Bitwise OR of LV2_State_Flags values. 
    11451146   @param features Features to pass LV2_State_Interface.save(). 
    11461147   @return A new LilvState which must be freed with lilv_state_free(). 
    11471148 
    1148    The returned state will have all properties set from the plugin, but no port 
    1149    values set (since it is impossible for Lilv to do this in general).  To get 
    1150    a complete snapshot of plugin state, call this function, then set the 
    1151    appropriate port values with lilv_state_set_port_value. 
    1152  
    11531149   This function may be called simultaneously with any instance function 
    11541150   (except discovery functions) unless the threading class of that function 
    11551151   explicitly disallows this. 
    11561152 
     1153   If supported (via state:makePath passed to LV2_Descriptor::instantiate()), 
     1154   @c dir should be the directory where any plugin-created files are stored. 
     1155   Lilv will assume any files within this directory (recursively) are created 
     1156   by the plugin and all other files are immutable.  This function creates a 
     1157   new LilvState, but does not save state to disk.  To save the state 
     1158   permanently, use lilv_state_save(). 
     1159 
    11571160   See <a href="http://lv2plug.in/ns/ext/state/state.h">state.h</a> from the 
    11581161   LV2 State extension for details on the @c flags and @c features parameters. 
     
    11621165lilv_state_new_from_instance(const LilvPlugin*          plugin, 
    11631166                             LilvInstance*              instance, 
     1167                             LV2_URID_Map*              map, 
     1168                             const char*                dir, 
    11641169                             LilvGetPortValueFunc       get_value, 
    11651170                             void*                      user_data, 
     
    12531258   @param state State to save. 
    12541259   @param uri URI of state, may be NULL. 
    1255    @param path Path of file to save state to, may be NULL. 
    1256    @param manifest_path Path of manifest file to add entry to, may be NULL. 
     1260   @param dir Path of the bundle directory to save into, may be NULL. 
     1261   @param filename Filename for the state file (no extension), may be NULL. 
     1262   @param features Host provided features. 
    12571263 
    12581264   The format of state on disk is compatible with that defined in the LV2 
    12591265   preset extension, i.e. this function may be used to save presets which can 
    1260    be loaded by any host.  If @c path is NULL, then the default user preset 
    1261    bundle (~/.lv2/presets.lv2) is used.  In this case, the label of @c state 
    1262    MUST be set since it is used to generate a filename. 
     1266   be loaded by any host.  If @c dir is NULL, then the default user preset 
     1267   bundle (~/.lv2/presets.lv2) is used.  If @c filename is NULL, one will be 
     1268   generated from the state's label, so it must be set. 
    12631269 
    12641270   If @c uri is NULL, the state will be saved without an absolute URI (but 
     
    12671273LILV_API 
    12681274int 
    1269 lilv_state_save(LilvWorld*       world, 
    1270                 LV2_URID_Unmap*  unmap, 
    1271                 const LilvState* state, 
    1272                 const char*      uri, 
    1273                 const char*      path, 
    1274                 const char*      manifest_path); 
     1275lilv_state_save(LilvWorld*                 world, 
     1276                LV2_URID_Unmap*            unmap, 
     1277                const LilvState*           state, 
     1278                const char*                uri, 
     1279                const char*                dir, 
     1280                const char*                filename, 
     1281                const LV2_Feature *const * features); 
    12751282 
    12761283/** 
Note: See TracChangeset for help on using the changeset viewer.