2 Copyright (C) 2000-2007 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_ui_configuration_h__
21 #define __ardour_ui_configuration_h__
27 #include "pbd/stateful.h"
28 #include "pbd/xml++.h"
29 #include "ardour/configuration_variable.h"
32 class UIConfigVariable
: public ARDOUR::ConfigVariableBase
35 UIConfigVariable (std::string str
) : ARDOUR::ConfigVariableBase (str
) {}
36 UIConfigVariable (std::string str
, T val
) : ARDOUR::ConfigVariableBase (str
), value (val
) {}
50 std::string
get_as_string () const {
59 void set_from_string (std::string
const & s
) {
67 T
get_for_save() { return value
; }
71 class UIConfiguration
: public PBD::Stateful
77 std::vector
<UIConfigVariable
<uint32_t> *> canvas_colors
;
83 int set_state (const XMLNode
&, int version
);
84 XMLNode
& get_state (void);
85 XMLNode
& get_variables (std::string
);
86 void set_variables (const XMLNode
&);
87 void pack_canvasvars ();
89 sigc::signal
<void,const char*> ParameterChanged
;
91 #undef UI_CONFIG_VARIABLE
92 #undef CANVAS_VARIABLE
93 #define UI_CONFIG_VARIABLE(Type,var,name,val) UIConfigVariable<Type> var;
94 #define CANVAS_VARIABLE(var,name) UIConfigVariable<uint32_t> var;
95 #include "ui_config_vars.h"
96 #include "canvas_vars.h"
97 #undef UI_CONFIG_VARIABLE
98 #undef CANVAS_VARIABLE
105 #endif /* __ardour_ui_configuration_h__ */