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 "pbd/configuration.h"
27 class LIBARDOUR_API SessionConfiguration : public PBD::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 &);
41 /* define accessor methods */
43 #undef CONFIG_VARIABLE
44 #undef CONFIG_VARIABLE_SPECIAL
45 #define CONFIG_VARIABLE(Type,var,name,value) \
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 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
49 Type get_##var () const { return var.get(); } \
50 bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
51 #include "ardour/session_configuration_vars.h"
52 #undef CONFIG_VARIABLE
53 #undef CONFIG_VARIABLE_SPECIAL
57 /* declare variables */
59 #undef CONFIG_VARIABLE
60 #undef CONFIG_VARIABLE_SPECIAL
61 #define CONFIG_VARIABLE(Type,var,name,value) PBD::ConfigVariable<Type> var;
62 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) PBD::ConfigVariableWithMutation<Type> var;
63 #include "ardour/session_configuration_vars.h"
64 #undef CONFIG_VARIABLE
65 #undef CONFIG_VARIABLE_SPECIAL