![]() |
SOUND4 IMPACT.CL Library [1.3.12]
|
This allows to provide a customized preset management. More...
Typedefs | |
| typedef wchar_t | fs_char |
| typedef char *(* | impact_storage_reader) (const fs_char *filename, void *userdata) |
| typedef void(* | impact_storage_reader_free) (char *content, void *userdata) |
| typedef int(* | impact_storage_writer) (const fs_char *filename, const char *content, void *userdata) |
| typedef int(* | impact_storage_exists) (const fs_char *filename, void *userdata) |
| typedef fs_char **(* | impact_storage_getall) (void *userdata) |
| typedef void(* | impact_storage_getall_free) (fs_char **all, void *userdata) |
| typedef int(* | impact_storage_remove) (const fs_char *filename, void *userdata) |
| typedef int(* | impact_storage_rename) (const fs_char *from, const fs_char *to, void *userdata) |
Enumerations | |
| enum | impact_PresetChange_Kind { change_kind_created = 1 , change_kind_modified , change_kind_deleted } |
Functions | |
| void | impact_SetPresetManager (struct impact_CParameters *params, impact_storage_reader reader, impact_storage_reader_free, impact_storage_writer writer, impact_storage_exists exists, impact_storage_getall getall, impact_storage_getall_free getall_free, impact_storage_remove remove, impact_storage_rename rename, int IsReadOnly, void *userdata) |
| void | impact_PresetManager_InformChange (struct impact_CInstance *instance, const fs_char *relative_path, enum impact_PresetChange_Kind change_kind) |
This allows to provide a customized storage for presets and settings.
By default, the library store data on disk or in memory (see save_path parameter in impact_InitProcess2), but you may use these functions to store data.
It can be used for remote storage, database storage, ...
Known files:
.pst are presetsstate.json is the instance state file, holding settings and unsaved preset changes.auth.json is the storage for web authentication settings.*.onair are used for sharing preset on air name between instances (see STATE_ONAIR in Parameters).STATE_FILENAME in parameters, see Parameters.File names are in OS native characters ( wchar_t for Windows, char in UTF-8 for others)
| typedef wchar_t fs_char |
Definition at line 476 of file sound4.impact.cl.h.
| typedef int(* impact_storage_exists) (const fs_char *filename, void *userdata) |
Function to call to test if a stored file exists.
| filename | the name of the file to test. |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 515 of file sound4.impact.cl.h.
| typedef fs_char **(* impact_storage_getall) (void *userdata) |
Function to call to get all stored files' name. Result has to be freed with impact_storage_getall_free callback
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 524 of file sound4.impact.cl.h.
| typedef void(* impact_storage_getall_free) (fs_char **all, void *userdata) |
Function to call to free the result of getall.
| all | the returned value from impact_storage_getall |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 532 of file sound4.impact.cl.h.
| typedef char *(* impact_storage_reader) (const fs_char *filename, void *userdata) |
Function to call to read a stored file, returning its content.
| filename | the name of the file to read. |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 488 of file sound4.impact.cl.h.
| typedef void(* impact_storage_reader_free) (char *content, void *userdata) |
Function to call to free the result of impact_storage_reader.
| content | the returned value from impact_storage_reader |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 496 of file sound4.impact.cl.h.
| typedef int(* impact_storage_remove) (const fs_char *filename, void *userdata) |
Function to call to remove a stored file.
| filename | the name of the file to remove. |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 541 of file sound4.impact.cl.h.
Function to call to rename a stored file.
| from | The source file name (must exist) |
| to | The destination file name (must not exist) |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 551 of file sound4.impact.cl.h.
| typedef int(* impact_storage_writer) (const fs_char *filename, const char *content, void *userdata) |
Function to call to write a stored file.
| filename | the name of the file to write. |
| content | the UTF-8 content to write to the file |
| userdata | the userdata passed to impact_SetPresetManager |
Definition at line 506 of file sound4.impact.cl.h.
Kind of change on a storage path
| Enumerator | |
|---|---|
| change_kind_created | Path has been created. |
| change_kind_modified | Path has been modified. |
| change_kind_deleted | Path has been deleted. |
Definition at line 584 of file sound4.impact.cl.h.
| void impact_PresetManager_InformChange | ( | struct impact_CInstance * | instance, |
| const fs_char * | relative_path, | ||
| enum impact_PresetChange_Kind | change_kind | ||
| ) |
Inform that a change happened in the storage. This must be used only in conjonction with impact_SetPresetManager
| instance | the processing instance |
| relative_path | The path which changed, relative to the root storage |
| change_kind | What happened to this path |
| void impact_SetPresetManager | ( | struct impact_CParameters * | params, |
| impact_storage_reader | reader, | ||
| impact_storage_reader_free | , | ||
| impact_storage_writer | writer, | ||
| impact_storage_exists | exists, | ||
| impact_storage_getall | getall, | ||
| impact_storage_getall_free | getall_free, | ||
| impact_storage_remove | remove, | ||
| impact_storage_rename | rename, | ||
| int | IsReadOnly, | ||
| void * | userdata | ||
| ) |
Setup a custom preset manager. This overrides the save_path in impact_InitProcess2
To dynamically update when storage change, see impact_PresetManager_InformChange
| params | The params to set up |
| reader | The function to read a file |
| writer | The function to write a file |
| exists | The function to test for a file presence |
| getall | The function to get all files in storage |
| getall_free | The function to free the result from getall |
| remove | The function to remove a file from storage |
| rename | The function to rename a file |
| IsReadOnly | Set to 1 if storage is read-only |
| userdata | The userdata parameter for callbacks |