summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-08 21:18:13 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-08 21:18:20 -0400
commit7015ece8ef8368439cb65adc107c926687093b73 (patch)
tree22b57a7d75c6834b34c866eaa6db341993b8fccc /gtk2_ardour/route_ui.cc
parentf0eef82364e0d24acc0fe737a3e3959541401374 (diff)
use 4.x and earlier route colors
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r--gtk2_ardour/route_ui.cc32
1 files changed, 31 insertions, 1 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 199f07d6d8..868d6cae09 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -1613,7 +1613,6 @@ RouteUI::choose_color ()
void
RouteUI::set_color (uint32_t c)
{
- cerr << "setting route color\n";
_route->presentation_info().set_color (c);
}
@@ -2227,10 +2226,41 @@ RouteUI::route_color () const
{
Gdk::Color c;
RouteGroup* g = _route->route_group ();
+ string p;
if (g && g->is_color()) {
set_color_from_rgba (c, GroupTabs::group_color (g));
} else {
+
+ /* deal with older 4.x color, which was stored in the GUI object state */
+
+ string p = ARDOUR_UI::instance()->gui_object_state->get_string (route_state_id(), X_("color"));
+
+ if (!p.empty()) {
+
+ /* old v4.x or earlier session. Use this information */
+
+ int component;
+ char colon;
+ PresentationInfo::color_t color = 0;
+
+ stringstream ss (p);
+
+ ss >> component;
+ ss >> colon;
+ color |= ((component >> 2) << 16);
+
+ ss >> component;
+ ss >> colon;
+ color |= ((component >> 2) << 8);
+
+ ss >> component;
+ ss >> colon;
+ color |= (component >> 2);
+
+ _route->presentation_info().set_color (color);
+ }
+
set_color_from_rgba (c, _route->presentation_info().color());
}