add select all/none, layout shortcuts from all guis, docs tweaks + cv->gg
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / presets.h.sav
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef PRESETS_H
23 #define PRESETS_H
24
25
26 #include "arraylist.h"
27 #include "filexml.inc"
28 #include "keyframe.inc"
29
30
31 // Front end for a DB of presets for all plugins
32
33 // A single preset
34 class PresetsDBKeyframe
35 {
36 public:
37         PresetsDBKeyframe(const char *title);
38         ~PresetsDBKeyframe();
39
40         void set_data(char *data);
41
42         char *title;
43         char *data;
44 };
45
46 // Presets for a single plugin
47 class PresetsDBPlugin
48 {
49 public:
50         PresetsDBPlugin(const char *title);
51         ~PresetsDBPlugin();
52
53
54         void load(FileXML *file);
55         void save(FileXML *file);
56
57 // Get a preset by name
58         PresetsDBKeyframe* get_keyframe(const char *title);
59 // Create a new keyframe
60         PresetsDBKeyframe* new_keyframe(const char *title);
61         void delete_keyframe(const char *title);
62 // Load a preset into the keyframe
63         void load_preset(const char *preset_title, KeyFrame *keyframe);
64         int preset_exists(const char *preset_title);
65
66         ArrayList<PresetsDBKeyframe*> keyframes;
67         char *title;
68 };
69
70 class PresetsDB
71 {
72 public:
73         PresetsDB();
74
75 // Load the database from the file.
76         void load();
77 // Save the database to the file.
78         void save();
79
80 // Get the total number of presets for a plugin
81         int get_total_presets(char *plugin_title);
82 // Get the title of a preset
83         char* get_preset_title(char *plugin_title, int number);
84 // Get the data for a preset
85         char* get_preset_data(char *plugin_title, int number);
86 // Get a pluginDB by name
87         PresetsDBPlugin* get_plugin(const char *plugin_title);
88 // Create a pluginDB
89         PresetsDBPlugin* new_plugin(const char *plugin_title);
90         void save_preset(const char *plugin_title, const char *preset_title, char *data);
91         void delete_preset(const char *plugin_title, const char *preset_title);
92 // Load a preset into the keyframe
93         void load_preset(const char *plugin_title, const char *preset_title, KeyFrame *keyframe);
94         int preset_exists(const char *plugin_title, const char *preset_title);
95
96 private:
97 // Remove all plugin data
98         void clear();
99
100         ArrayList<PresetsDBPlugin*> plugins;
101 };
102
103
104
105 #endif
106
107
108