summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r--gtk2_ardour/route_ui.cc80
1 files changed, 21 insertions, 59 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 525013ecaa..8d4ed07398 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -70,13 +70,6 @@ RouteUI::RouteUI (ARDOUR::Session* sess)
init ();
}
-RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session* sess)
- : AxisView(sess)
-{
- init ();
- set_route (rt);
-}
-
RouteUI::~RouteUI()
{
_route.reset (); /* drop reference to route, so that it can be cleaned up */
@@ -93,7 +86,6 @@ void
RouteUI::init ()
{
self_destruct = true;
- xml_node = 0;
mute_menu = 0;
solo_menu = 0;
sends_menu = 0;
@@ -173,11 +165,6 @@ RouteUI::reset ()
delete mute_menu;
mute_menu = 0;
- if (xml_node) {
- /* do not delete the node - its owned by the route */
- xml_node = 0;
- }
-
denormal_menu_item = 0;
}
@@ -1278,62 +1265,29 @@ RouteUI::set_color (const Gdk::Color & c)
_color = c;
- ensure_xml_node ();
snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue());
- xml_node->add_property ("color", buf);
-
+ set_gui_property ("color", buf);
_route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */
}
-
-void
-RouteUI::ensure_xml_node ()
+int
+RouteUI::set_color_from_route ()
{
- if (xml_node == 0) {
- if ((xml_node = _route->extra_xml ("GUI")) == 0) {
- xml_node = new XMLNode ("GUI");
- _route->add_extra_xml (*xml_node);
- } else {
- /* the Route has one; it may have been loaded */
- if (Stateful::loading_state_version != 0 && Stateful::loading_state_version < 3000) {
- /* the GUI extra XML is in 2.X format; we must convert it to the new
- format to avoid problems later
- */
-
- XMLNode* new_xml_node = new XMLNode (X_("GUI"));
- XMLPropertyList old_gui_props = xml_node->properties ();
- for (XMLPropertyIterator i = old_gui_props.begin(); i != old_gui_props.end(); ++i) {
- new_xml_node->add_property ((*i)->name().c_str (), (*i)->value().c_str ());
- }
+ const string str = gui_property ("color");
- /* we can't fix up the automation track nodes,
- * because the data is no longer stored
- * per-route, but per Controllable.
- */
-
- _route->add_extra_xml (*new_xml_node);
- xml_node = new_xml_node;
- }
- }
+ if (str.empty()) {
+ return 1;
}
-}
-int
-RouteUI::set_color_from_route ()
-{
- XMLProperty *prop;
+ int r, g, b;
- RouteUI::ensure_xml_node ();
+ sscanf (str.c_str(), "%d:%d:%d", &r, &g, &b);
- if ((prop = xml_node->property ("color")) != 0) {
- int r, g, b;
- sscanf (prop->value().c_str(), "%d:%d:%d", &r, &g, &b);
- _color.set_red(r);
- _color.set_green(g);
- _color.set_blue(b);
- return 0;
- }
- return 1;
+ _color.set_red (r);
+ _color.set_green (g);
+ _color.set_blue (b);
+
+ return 0;
}
void
@@ -1787,3 +1741,11 @@ RouteUI::set_invert_sensitive (bool yn)
(*b)->set_sensitive (yn);
}
}
+
+void
+RouteUI::request_redraw ()
+{
+ if (_route) {
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ }
+}