a better fix fpr that wierd XMLProperty botch
[ardour.git] / libs / ardour / ardour / export_preset.h
1 /*
2     Copyright (C) 2008 Paul Davis
3     Author: Sakari Bergen
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 */
20
21 #ifndef __ardour_export_preset_h__
22 #define __ardour_export_preset_h__
23
24 #include <string>
25
26 #include "pbd/uuid.h"
27 #include "pbd/xml++.h"
28
29 namespace ARDOUR
30 {
31
32 class Session;
33
34 class ExportPreset {
35   public:
36         ExportPreset (std::string filename, Session & s);
37         ~ExportPreset ();
38
39         PBD::UUID const & id () const { return _id; }
40         std::string name () const { return _name; }
41
42         void set_name (std::string const & name);
43
44         // Note: The set_..._state functions take ownership of the XMLNode
45         void set_global_state (XMLNode & state);
46         void set_local_state (XMLNode & state);
47
48         XMLNode const * get_global_state () const { return global.root(); }
49         XMLNode const * get_local_state () const { return local; }
50
51         void save (std::string const & filename);
52         void remove_local () const;
53
54   private:
55
56         void set_id (std::string const & id);
57
58         XMLNode * get_instant_xml () const;
59         void save_instant_xml () const;
60         void remove_instant_xml () const;
61
62         PBD::UUID  _id;
63         std::string _name;
64
65         Session &   session;
66         XMLTree     global;
67         XMLNode *   local;
68
69 };
70
71 } // namespace ARDOUR
72
73 #endif // __ardour_export_preset_h__