summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ui_config.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-12-14 23:34:59 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-12-14 23:34:59 -0500
commit83326a06ca695878d91636200679a46fd10310e4 (patch)
treefb120595a678b23f4c9e98816c47f79b7ff03edf /gtk2_ardour/ui_config.cc
parent427b93055f87f2888fcf4157680953b0164ee09d (diff)
basic code to use SVModifier plus one definition in dark.colors
Diffstat (limited to 'gtk2_ardour/ui_config.cc')
-rw-r--r--gtk2_ardour/ui_config.cc41
1 files changed, 40 insertions, 1 deletions
diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc
index a22e79801c..d1395e671e 100644
--- a/gtk2_ardour/ui_config.cc
+++ b/gtk2_ardour/ui_config.cc
@@ -262,7 +262,16 @@ UIConfiguration::store_color_theme ()
parent->add_child_nocopy (*node);
}
root->add_child_nocopy (*parent);
-
+
+ parent = new XMLNode (X_("Modifiers"));
+ for (Modifiers::const_iterator i = modifiers.begin(); i != modifiers.end(); ++i) {
+ XMLNode* node = new XMLNode (X_("Modifier"));
+ node->add_property (X_("name"), i->first);
+ node->add_property (X_("modifier"), i->second.to_string());
+ parent->add_child_nocopy (*node);
+ }
+ root->add_child_nocopy (*parent);
+
XMLTree tree;
std::string colorfile = Glib::build_filename (user_config_directory(), (string ("my-") + color_file.get() + ".colors"));
@@ -435,6 +444,12 @@ UIConfiguration::set_state (const XMLNode& root, int /*version*/)
load_color_aliases (*aliases);
}
+ XMLNode* modifiers = find_named_node (root, X_("Modifiers"));
+
+ if (modifiers) {
+ load_modifiers (*modifiers);
+ }
+
return 0;
}
@@ -487,6 +502,30 @@ UIConfiguration::load_colors (XMLNode const & node)
}
void
+UIConfiguration::load_modifiers (XMLNode const & node)
+{
+ XMLNodeList const nlist = node.children();
+ XMLNodeConstIterator niter;
+ XMLProperty const *name;
+ XMLProperty const *mod;
+
+ modifiers.clear ();
+
+ for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+ if ((*niter)->name() != X_("Modifier")) {
+ continue;
+ }
+ name = (*niter)->property (X_("name"));
+ mod = (*niter)->property (X_("modifier"));
+
+ if (name && mod) {
+ SVAModifier svam (mod->value());
+ modifiers.insert (make_pair (name->value(), svam));
+ }
+ }
+}
+
+void
UIConfiguration::set_variables (const XMLNode& node)
{
#undef UI_CONFIG_VARIABLE