1 /* 2 * Copyright (C) 2008 Sakari Bergen <sakari.bergen@beatwaves.net> 3 * Copyright (C) 2009 David Robillard <d@drobilla.net> 4 * Copyright (C) 2011-2013 Paul Davis <paul@linuxaudiosystems.com> 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 along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 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 #include "ardour/libardour_visibility.h" 30 31 namespace ARDOUR 32 { 33 34 class Session; 35 36 class LIBARDOUR_API ExportPreset { 37 public: 38 ExportPreset (std::string filename, Session & s); 39 ~ExportPreset (); 40 id()41 PBD::UUID const & id () const { return _id; } name()42 std::string name () const { return _name; } 43 44 void set_name (std::string const & name); 45 46 // Note: The set_..._state functions take ownership of the XMLNode 47 void set_global_state (XMLNode & state); 48 void set_local_state (XMLNode & state); 49 get_global_state()50 XMLNode const * get_global_state () const { return global.root(); } get_local_state()51 XMLNode const * get_local_state () const { return local; } 52 53 void save (std::string const & filename); 54 void remove_local () const; 55 56 private: 57 58 void set_id (std::string const & id); 59 60 XMLNode * get_instant_xml () const; 61 void save_instant_xml () const; 62 void remove_instant_xml () const; 63 64 PBD::UUID _id; 65 std::string _name; 66 67 Session & session; 68 XMLTree global; 69 XMLNode * local; 70 71 }; 72 73 } // namespace ARDOUR 74 75 #endif // __ardour_export_preset_h__ 76