summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ui_config.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-06-13 10:54:12 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-13 12:22:39 -0400
commita50569e7870bed622537aeb137501e82e3d57e61 (patch)
tree7506019cb11c267d5429a04581369b445e9ddd54 /gtk2_ardour/ui_config.h
parentf2404a522d3914948caa357da792d8f84cec8456 (diff)
rename UIConfigVariable as ColorVariable since that is really it should be used for; use ARDOUR::ConfigVariable for everything else in UI config
Diffstat (limited to 'gtk2_ardour/ui_config.h')
-rw-r--r--gtk2_ardour/ui_config.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/gtk2_ardour/ui_config.h b/gtk2_ardour/ui_config.h
index 46dd8e9806..ec9e1ad940 100644
--- a/gtk2_ardour/ui_config.h
+++ b/gtk2_ardour/ui_config.h
@@ -28,12 +28,17 @@
#include "pbd/xml++.h"
#include "ardour/configuration_variable.h"
+/* This is very similar to ARDOUR::ConfigVariable but expects numeric values to
+ * be in hexadecimal. This is because it is intended for use with color
+ * specifications which are easier to scan for issues in "rrggbbaa" format than
+ * as decimals.
+ */
template<class T>
-class UIConfigVariable : public ARDOUR::ConfigVariableBase
+class ColorVariable : public ARDOUR::ConfigVariableBase
{
public:
- UIConfigVariable (std::string str) : ARDOUR::ConfigVariableBase (str) {}
- UIConfigVariable (std::string str, T val) : ARDOUR::ConfigVariableBase (str), value (val) {}
+ ColorVariable (std::string str) : ARDOUR::ConfigVariableBase (str) {}
+ ColorVariable (std::string str, T val) : ARDOUR::ConfigVariableBase (str), value (val) {}
bool set (T val) {
if (val == value) {
@@ -74,7 +79,7 @@ class UIConfiguration : public PBD::Stateful
UIConfiguration();
~UIConfiguration();
- std::map<std::string,UIConfigVariable<uint32_t> *> canvas_colors;
+ std::map<std::string,ColorVariable<uint32_t> *> canvas_colors;
bool dirty () const;
void set_dirty ();
@@ -117,13 +122,13 @@ class UIConfiguration : public PBD::Stateful
/* declare variables */
#undef UI_CONFIG_VARIABLE
-#define UI_CONFIG_VARIABLE(Type,var,name,value) UIConfigVariable<Type> var;
+#define UI_CONFIG_VARIABLE(Type,var,name,value) ARDOUR::ConfigVariable<Type> var;
#include "ui_config_vars.h"
#undef UI_CONFIG_VARIABLE
#undef CANVAS_VARIABLE
-#define CANVAS_VARIABLE(var,name) UIConfigVariable<uint32_t> var;
-#define CANVAS_STRING_VARIABLE(var,name) UIConfigVariable<std::string> var;
+#define CANVAS_VARIABLE(var,name) ColorVariable<uint32_t> var;
+#define CANVAS_STRING_VARIABLE(var,name) ARDOUR::ConfigVariable<std::string> var;
#include "canvas_vars.h"
#undef CANVAS_VARIABLE
#undef CANVAS_STRING_VARIABLE