Ardour  8.12
rc_configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2018 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2009-2014 David Robillard <d@drobilla.net>
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_rc_configuration_h__
22 #define __ardour_rc_configuration_h__
23 
24 #include <map>
25 #include <string>
26 
27 #include "temporal/types.h"
28 
30 #include "ardour/types.h"
31 #include "ardour/utils.h"
32 #include "ardour/types_convert.h"
33 
34 #include "pbd/configuration.h"
35 
36 class XMLNode;
37 
38 namespace ARDOUR {
39 
41 {
42  public:
45 
46  void map_parameters (boost::function<void (std::string)>&);
47  int set_state (XMLNode const &, int version);
48  XMLNode& get_state () const;
49  XMLNode& get_variables (std::string const & nodename) const;
50  void set_variables (XMLNode const &);
51 
52  int load_state ();
53  int save_state ();
54 
58  XMLNode * instant_xml (const std::string& str);
59 
60  XMLNode* control_protocol_state () { return _control_protocol_state; }
61  XMLNode* transport_master_state () { return _transport_master_state; }
62 
63  std::map<std::string,PBD::ConfigVariableBase*> _my_variables;
64 
65  /* define accessor methods */
66 
67 #undef CONFIG_VARIABLE
68 #undef CONFIG_VARIABLE_SPECIAL
69 #define CONFIG_VARIABLE(Type,var,name,value) \
70  Type get_##var () const { return var.get(); } \
71  bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
72 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
73  Type get_##var () const { return var.get(); } \
74  bool set_##var (Type val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
76 #undef CONFIG_VARIABLE
77 #undef CONFIG_VARIABLE_SPECIAL
78 
79  private:
80 
81  /* declare variables */
82 
83 #undef CONFIG_VARIABLE
84 #undef CONFIG_VARIABLE_SPECIAL
85 #define CONFIG_VARIABLE(Type,var,name,value) PBD::ConfigVariable<Type> var;
86 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) PBD::ConfigVariableWithMutation<Type> var;
88 #undef CONFIG_VARIABLE
89 #undef CONFIG_VARIABLE_SPECIAL
90 
93 
94  void build_metadata ();
95 };
96 
97 /* XXX: rename this */
99 LIBARDOUR_API extern gain_t speed_quietning; /* see comment in configuration.cc */
100 
101 } // namespace ARDOUR
102 
103 #endif /* __ardour_configuration_h__ */
void add_instant_xml(XMLNode &)
XMLNode * transport_master_state()
XMLNode * instant_xml(const std::string &str)
void set_variables(XMLNode const &)
XMLNode * control_protocol_state()
XMLNode & get_variables(std::string const &nodename) const
int set_state(XMLNode const &, int version)
XMLNode & get_state() const
std::map< std::string, PBD::ConfigVariableBase * > _my_variables
void map_parameters(boost::function< void(std::string)> &)
Definition: xml++.h:114
#define LIBARDOUR_API
gain_t speed_quietning
RCConfiguration * Config