2 Copyright (C) 2009 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_session_configuration_h__
21 #define __ardour_session_configuration_h__
23 #include "ardour/configuration.h"
27 class SessionConfiguration : public Configuration
30 SessionConfiguration ();
32 void map_parameters (boost::function<void (std::string)>&);
33 int set_state (XMLNode const &, int version);
34 XMLNode& get_state ();
35 XMLNode& get_variables ();
36 void set_variables (XMLNode const &);
38 /* define accessor methods */
40 #undef CONFIG_VARIABLE
41 #undef CONFIG_VARIABLE_SPECIAL
42 #define CONFIG_VARIABLE(Type,var,name,value) \
43 Type get_##var () const { return var.get(); } \
44 bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
45 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
46 Type get_##var () const { return var.get(); } \
47 bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
48 #include "ardour/session_configuration_vars.h"
49 #undef CONFIG_VARIABLE
50 #undef CONFIG_VARIABLE_SPECIAL
54 /* declare variables */
56 #undef CONFIG_VARIABLE
57 #undef CONFIG_VARIABLE_SPECIAL
58 #define CONFIG_VARIABLE(Type,var,name,value) ConfigVariable<Type> var;
59 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) ConfigVariableWithMutation<Type> var;
60 #include "ardour/session_configuration_vars.h"
61 #undef CONFIG_VARIABLE
62 #undef CONFIG_VARIABLE_SPECIAL