LMMS
Loading...
Searching...
No Matches
calf_plugins::preset_list Struct Reference

A single list of presets (usually there are two -. More...

#include <preset.h>

Classes

struct  plugin_snapshot
 Plugin list item. More...

Public Types

enum  parser_state {
  START , LIST , PRESET , VALUE ,
  VAR , PLUGIN , RACK , AUTOMATION_ENTRY
}
 Parser states. More...

Public Member Functions

bool load_defaults (bool builtin, const std::string *pkglibdir_path=NULL)
 Load default preset list (built-in or user-defined).
void parse (const std::string &data, bool in_rack_mode)
 Load preset list from an in-memory XML string.
void load (const char *filename, bool in_rack_mode)
 Load preset list from XML file.
void save (const char *filename)
 Save preset list as XML file.
void add (const plugin_preset &sp)
 Append or replace a preset (replaces a preset with the same plugin and preset name).
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).

Static Public Member Functions

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.

Public Attributes

enum calf_plugins::preset_list::parser_state state
preset_vector presets
 Contained presets (usually for all plugins).
plugin_preset parser_preset
 Temporary preset used during parsing process.
plugin_snapshot parser_plugin
 Temporary plugin desc used during parsing process.
std::map< std::string, intlast_preset_ids
 Preset number counters for DSSI (currently broken).
std::string current_key
 The key used in current tag (for state == VAR).
bool rack_mode
 The file is loaded in rack mode (and rack/plugin elements are expected).
std::vector< plugin_snapshotplugins
 List of plugin states for rack mode.

Static Protected Member Functions

static void xml_start_element_handler (void *user_data, const char *name, const char *attrs[])
 Internal function: start element handler for expat.
static void xml_end_element_handler (void *user_data, const char *name)
 Internal function: end element handler for expat.
static void xml_character_data_handler (void *user_data, const char *data, int len)
 Internal function: character data (tag text content) handler for expat.

Detailed Description

A single list of presets (usually there are two -.

See also
get_builtin_presets(), get_user_presets() )

Member Enumeration Documentation

◆ parser_state

Parser states.

Enumerator
START 

Beginning of parsing process (before root element).

LIST 

Inside root element.

PRESET 

Inside preset definition.

VALUE 

Inside (empty) param tag.

VAR 

Inside (non-empty) var tag.

PLUGIN 

Inside plugin element (calfjackhost snapshots only).

RACK 

Inside rack element (calfjackhost snapshots only).

AUTOMATION_ENTRY 

inside automation element (calfjackhost snapshots only, always an empty element)

Member Function Documentation

◆ add()

void preset_list::add ( const plugin_preset & sp)

Append or replace a preset (replaces a preset with the same plugin and preset name).

◆ get_for_plugin()

void preset_list::get_for_plugin ( preset_vector & vec,
const char * plugin )

Get a sublist of presets for a given plugin (those with plugin_preset::plugin == plugin).

◆ get_preset_filename()

string calf_plugins::preset_list::get_preset_filename ( bool builtin,
const std::string * pkglibdir_path = NULL )
static

Return the name of the built-in or user-defined preset file.

◆ load()

void preset_list::load ( const char * filename,
bool in_rack_mode )

Load preset list from XML file.

◆ load_defaults()

bool preset_list::load_defaults ( bool builtin,
const std::string * pkglibdir_path = NULL )

Load default preset list (built-in or user-defined).

◆ parse()

void preset_list::parse ( const std::string & data,
bool in_rack_mode )

Load preset list from an in-memory XML string.

◆ save()

void preset_list::save ( const char * filename)

Save preset list as XML file.

◆ xml_character_data_handler()

void preset_list::xml_character_data_handler ( void * user_data,
const char * data,
int len )
staticprotected

Internal function: character data (tag text content) handler for expat.

◆ xml_end_element_handler()

void preset_list::xml_end_element_handler ( void * user_data,
const char * name )
staticprotected

Internal function: end element handler for expat.

◆ xml_start_element_handler()

void preset_list::xml_start_element_handler ( void * user_data,
const char * name,
const char * attrs[] )
staticprotected

Internal function: start element handler for expat.

Member Data Documentation

◆ current_key

std::string calf_plugins::preset_list::current_key

The key used in current tag (for state == VAR).

◆ last_preset_ids

std::map<std::string, int> calf_plugins::preset_list::last_preset_ids

Preset number counters for DSSI (currently broken).

◆ parser_plugin

plugin_snapshot calf_plugins::preset_list::parser_plugin

Temporary plugin desc used during parsing process.

◆ parser_preset

plugin_preset calf_plugins::preset_list::parser_preset

Temporary preset used during parsing process.

◆ plugins

std::vector<plugin_snapshot> calf_plugins::preset_list::plugins

List of plugin states for rack mode.

◆ presets

preset_vector calf_plugins::preset_list::presets

Contained presets (usually for all plugins).

◆ rack_mode

bool calf_plugins::preset_list::rack_mode

The file is loaded in rack mode (and rack/plugin elements are expected).

◆ state

enum calf_plugins::preset_list::parser_state calf_plugins::preset_list::state

The documentation for this struct was generated from the following files: