4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "arraylist.h"
27 #include "filexml.inc"
28 #include "keyframe.inc"
31 // Front end for a DB of presets for all plugins
34 class PresetsDBKeyframe
37 PresetsDBKeyframe(const char *title, int is_factory);
40 void set_data(char *data);
44 // is a factory preset
48 // Presets for a single plugin
52 PresetsDBPlugin(const char *title);
56 void load(FileXML *file, int is_factory);
57 void save(FileXML *file);
59 // Get a preset by name
60 PresetsDBKeyframe* get_keyframe(const char *title, int is_factory);
61 // Create a new keyframe
62 PresetsDBKeyframe* new_keyframe(const char *title);
63 void delete_keyframe(const char *title);
64 // Load a preset into the keyframe
65 void load_preset(const char *preset_title,
68 int preset_exists(const char *preset_title, int is_factory);
69 int get_total_presets(int user_only);
71 ArrayList<PresetsDBKeyframe*> keyframes;
80 // Load the database from the file.
81 void load_from_file(char *path, int is_factory, int clear_it);
82 // load the database from a string
83 void load_from_string(char *string, int is_factory, int clear_it);
84 void load_common(FileXML *file, int is_factory);
86 // Save the database to the file.
88 void sort(char *plugin_title);
90 // Get the total number of presets for a plugin
91 int get_total_presets(char *plugin_title, int user_only);
92 // Get the title of a preset
93 char* get_preset_title(char *plugin_title, int number);
94 int get_is_factory(char *plugin_title, int number);
95 // Get the data for a preset
96 char* get_preset_data(char *plugin_title, int number);
97 // Get a pluginDB by name
98 PresetsDBPlugin* get_plugin(const char *plugin_title);
100 PresetsDBPlugin* new_plugin(const char *plugin_title);
101 void save_preset(const char *plugin_title,
102 const char *preset_title,
104 void delete_preset(const char *plugin_title,
105 const char *preset_title,
107 // Load a preset into the keyframe
108 void load_preset(const char *plugin_title,
109 const char *preset_title,
112 int preset_exists(const char *plugin_title,
113 const char *preset_title,
117 // Remove all plugin data
120 ArrayList<PresetsDBPlugin*> plugins;