_dirty (false),
aliases_modified (false),
colors_modified (false),
+ modifiers_modified (false),
block_save (0)
{
_instance = this;
UIConfiguration::store_color_theme ()
{
XMLNode* root;
- LocaleGuard lg (X_("POSIX"));
+ LocaleGuard lg (X_("C"));
root = new XMLNode("Ardour");
_dirty = false;
}
- if (aliases_modified || colors_modified) {
+ if (aliases_modified || colors_modified || modifiers_modified) {
if (store_color_theme ()) {
error << string_compose (_("Color file %1 not saved"), color_file.get()) << endmsg;
aliases_modified = false;
colors_modified = false;
+ modifiers_modified = false;
}
UIConfiguration::get_state ()
{
XMLNode* root;
- LocaleGuard lg (X_("POSIX"));
+ LocaleGuard lg (X_("C"));
root = new XMLNode("Ardour");
UIConfiguration::get_variables (std::string which_node)
{
XMLNode* node;
- LocaleGuard lg (X_("POSIX"));
+ LocaleGuard lg (X_("C"));
node = new XMLNode (which_node);
if (name && color) {
ArdourCanvas::Color c;
- c = strtol (color->value().c_str(), 0, 16);
+ c = strtoul (color->value().c_str(), 0, 16);
colors.insert (make_pair (name->value(), c));
}
}
void
UIConfiguration::load_modifiers (XMLNode const & node)
{
+ PBD::LocaleGuard lg ("C");
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"));
return SVAModifier ();
}
+ArdourCanvas::Color
+UIConfiguration::color_mod (std::string const & colorname, std::string const & modifiername) const
+{
+ return HSV (color (colorname)).mod (modifier (modifiername)).color ();
+}
+
+ArdourCanvas::Color
+UIConfiguration::color_mod (const ArdourCanvas::Color& color, std::string const & modifiername) const
+{
+ return HSV (color).mod (modifier (modifiername)).color ();
+}
+
ArdourCanvas::Color
UIConfiguration::color (const std::string& name, bool* failed) const
{
ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */
}
+void
+UIConfiguration::set_modifier (string const & name, SVAModifier svam)
+{
+ Modifiers::iterator m = modifiers.find (name);
+
+ if (m == modifiers.end()) {
+ return;
+ }
+
+ m->second = svam;
+ modifiers_modified = true;
+
+ ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */
+}
+
void
UIConfiguration::load_rc_file (bool themechange, bool allow_own)
{