21#ifndef __CALF_PRESET_H
22#define __CALF_PRESET_H
143 void parse(
const std::string &
data,
bool in_rack_mode);
uint8_t sp
Definition Spc_Cpu.h:145
static char filename[]
Definition features.c:5
static const char * name
Definition pugl.h:1582
JSAMPIMAGE data
Definition jpeglib.h:945
Definition benchmark.cpp:53
preset_list & get_user_presets()
Return the current list of user-defined presets (these are loaded from ~/.calfpresets).
Definition preset.cpp:44
std::vector< plugin_preset > preset_vector
A vector of presets.
Definition preset.h:83
preset_list & get_builtin_presets()
Return the current list of built-in (factory) presets (these are loaded from system-wide file).
Definition preset.cpp:38
Interface for host-GUI-plugin interaction (should be really split in two, but ... meh).
Definition giface.h:389
Contents of single preset.
Definition preset.h:34
std::string to_xml()
Export preset as XML.
Definition preset.cpp:50
std::vector< float > values
Values of parameters.
Definition preset.h:46
plugin_preset()
Definition preset.h:50
void get_from(plugin_ctl_iface *plugin)
"Download" preset content from the plugin
Definition preset.cpp:116
std::string plugin
Name of the plugin the preset is for.
Definition preset.h:42
std::map< std::string, std::string > variables
DSSI configure-style variables.
Definition preset.h:48
int program
Program number of the preset (not used yet).
Definition preset.h:38
std::string name
Name of the preset.
Definition preset.h:40
std::vector< std::string > param_names
Names of parameters in values array (for each item in param_names there should be a counterpart in va...
Definition preset.h:44
void activate(plugin_ctl_iface *plugin)
"Upload" preset content to the plugin
Definition preset.cpp:79
int bank
Bank the preset belongs to (not used yet).
Definition preset.h:36
std::string get_safe_name()
Definition preset.cpp:68
std::string message
Definition preset.h:64
~preset_exception()
Definition preset.h:77
const char * what()
Definition preset.h:70
int error
Definition preset.h:65
preset_exception(const std::string &_message, const std::string &_param, int _error)
Definition preset.h:66
std::string param
Definition preset.h:64
std::string fulltext
Definition preset.h:64
Plugin list item.
Definition preset.h:90
int output_index
Index of the first output port.
Definition preset.h:100
int input_index
Index of the first input port.
Definition preset.h:98
int midi_index
Index of the first MIDI port.
Definition preset.h:102
std::string instance_name
Instance name.
Definition preset.h:96
std::string type
Plugin type.
Definition preset.h:94
int preset_offset
Preset offset.
Definition preset.h:92
std::vector< std::pair< std::string, std::string > > automation_entries
Automation assignments for this plugin.
Definition preset.h:104
void reset()
Reset to initial values.
Definition preset.cpp:152
A single list of presets (usually there are two -.
Definition preset.h:87
void load(const char *filename, bool in_rack_mode)
Load preset list from XML file.
Definition preset.cpp:384
std::map< std::string, int > last_preset_ids
Preset number counters for DSSI (currently broken).
Definition preset.h:130
plugin_preset parser_preset
Temporary preset used during parsing process.
Definition preset.h:126
std::string current_key
The key used in current tag (for state == VAR).
Definition preset.h:132
void parse(const std::string &data, bool in_rack_mode)
Load preset list from an in-memory XML string.
Definition preset.cpp:367
void add(const plugin_preset &sp)
Append or replace a preset (replaces a preset with the same plugin and preset name).
Definition preset.cpp:440
static void xml_start_element_handler(void *user_data, const char *name, const char *attrs[])
Internal function: start element handler for expat.
Definition preset.cpp:160
bool load_defaults(bool builtin, const std::string *pkglibdir_path=NULL)
Load default preset list (built-in or user-defined).
Definition preset.cpp:349
static void xml_end_element_handler(void *user_data, const char *name)
Internal function: end element handler for expat.
Definition preset.cpp:279
preset_vector presets
Contained presets (usually for all plugins).
Definition preset.h:124
plugin_snapshot parser_plugin
Temporary plugin desc used during parsing process.
Definition preset.h:128
enum calf_plugins::preset_list::parser_state state
void save(const char *filename)
Save preset list as XML file.
Definition preset.cpp:417
static void xml_character_data_handler(void *user_data, const char *data, int len)
Internal function: character data (tag text content) handler for expat.
Definition preset.cpp:338
std::vector< plugin_snapshot > plugins
List of plugin states for rack mode.
Definition preset.h:136
parser_state
Parser states.
Definition preset.h:112
@ PRESET
Inside preset definition.
Definition preset.h:115
@ PLUGIN
Inside plugin element (calfjackhost snapshots only).
Definition preset.h:118
@ START
Beginning of parsing process (before root element).
Definition preset.h:113
@ VALUE
Inside (empty) param tag.
Definition preset.h:116
@ RACK
Inside rack element (calfjackhost snapshots only).
Definition preset.h:119
@ LIST
Inside root element.
Definition preset.h:114
@ AUTOMATION_ENTRY
inside automation element (calfjackhost snapshots only, always an empty element)
Definition preset.h:120
@ VAR
Inside (non-empty) var tag.
Definition preset.h:117
void get_for_plugin(preset_vector &vec, const char *plugin)
Get a sublist of presets for a given plugin (those with plugin_preset::plugin == plugin).
Definition preset.cpp:431
static std::string get_preset_filename(bool builtin, const std::string *pkglibdir_path=NULL)
Return the name of the built-in or user-defined preset file.
Definition preset.cpp:137
bool rack_mode
The file is loaded in rack mode (and rack/plugin elements are expected).
Definition preset.h:134