summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2017-02-27 20:51:04 -0600
committerBen Loftis <ben@harrisonconsoles.com>2017-02-27 20:51:17 -0600
commit1071c0e788cb8b87d9fd034862892bd30ab26ab6 (patch)
treee2f18cf1a1db06b6453c89de33bf728c88d5f0d3 /gtk2_ardour
parentd5fad959e648860bf22a22c54328dce6dc338f85 (diff)
Likely fix for bug: cannot change track colors in older 4.x sessions.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/route_ui.cc69
1 files changed, 35 insertions, 34 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index 1ce6114a3e..0e1a047833 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -259,6 +259,41 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
_route = rp;
+ if ( !_route->presentation_info().color_set() ) {
+ /* 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 red, green, blue;
+ char colon;
+
+ stringstream ss (p);
+
+ /* old color format version was:
+
+ 16bit value for red:16 bit value for green:16 bit value for blue
+
+ decode to rgb ..
+ */
+
+ ss >> red;
+ ss >> colon;
+ ss >> green;
+ ss >> colon;
+ ss >> blue;
+
+ red >>= 2;
+ green >>= 2;
+ blue >>= 2;
+
+ _route->presentation_info().set_color (RGBA_TO_UINT (red, green, blue, 255));
+ }
+ }
+
if (set_color_from_route()) {
set_color (gdk_color_to_rgba (AxisView::unique_random_color ()));
}
@@ -2175,40 +2210,6 @@ RouteUI::route_color () const
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 red, green, blue;
- char colon;
-
- stringstream ss (p);
-
- /* old color format version was:
-
- 16bit value for red:16 bit value for green:16 bit value for blue
-
- decode to rgb ..
- */
-
- ss >> red;
- ss >> colon;
- ss >> green;
- ss >> colon;
- ss >> blue;
-
- red >>= 2;
- green >>= 2;
- blue >>= 2;
-
- _route->presentation_info().set_color (RGBA_TO_UINT (red, green, blue, 255));
- }
-
set_color_from_rgba (c, _route->presentation_info().color());
}