Make shuttle colour a configuration option.
authorDavid Robillard <d@drobilla.net>
Wed, 18 May 2011 05:32:41 +0000 (05:32 +0000)
committerDavid Robillard <d@drobilla.net>
Wed, 18 May 2011 05:32:41 +0000 (05:32 +0000)
Make default shuttle colour match clock text green.

This is a bit odd, since it is a "canvas variable", except not... all the other colours are in this section though.  Maybe they're more appropriately named "colours", but it's too late for that now, or maybe this option belongs elsewhere, but when we need new mechanism for that...

git-svn-id: svn://localhost/ardour2/branches/3.0@9553 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour3_ui_default.conf
gtk2_ardour/canvas_vars.h
gtk2_ardour/shuttle_control.cc

index e2ee309d97c989e5021eda43f87e5973952523dd..f20d94266533344d60fdc0082fa996a601898a15 100644 (file)
@@ -93,6 +93,7 @@
     <Option name="recorded waveform fill" value="ffffffff"/>
     <Option name="recorded waveform outline" value="0f0f1fff"/>
     <Option name="rubber band rect" value="c6c6c659"/>
+    <Option name="shuttle" value="6bb620ff"/>
     <Option name="silence" value="9efffd7a"/>
     <Option name="silence text" value="0e066cff"/>
     <Option name="selected crossfade editor line" value="00dbdbff"/>
index 2c0d6c234bc81468ec80cb6ce722b64a3c04e37e..b8bb1f86081c0fca2bafcc2cfe9aa8659ba7b6b9 100644 (file)
@@ -94,6 +94,7 @@ CANVAS_VARIABLE(canvasvar_SelectedWaveFormFill, "selected waveform fill")
 CANVAS_VARIABLE(canvasvar_SelectedWaveForm, "selected waveform outline")
 CANVAS_VARIABLE(canvasvar_SelectionRect, "selection rect")
 CANVAS_VARIABLE(canvasvar_Selection, "selection")
+CANVAS_VARIABLE(canvasvar_Shuttle, "shuttle")
 CANVAS_VARIABLE(canvasvar_Silence, "silence")
 CANVAS_VARIABLE(canvasvar_SilenceText, "silence text")
 CANVAS_VARIABLE(canvasvar_MonoPannerOutline, "mono panner outline")
index 3a0572cd69ec17fdd9043db2b1d1bf790213e930..c4c1da6aebc881213e14b1c147a5375793f00a91 100644 (file)
@@ -29,6 +29,7 @@
 #include "gtkmm2ext/gui_thread.h"
 
 #include "ardour_ui.h"
+#include "rgb_macros.h"
 #include "shuttle_control.h"
 
 #include "i18n.h"
@@ -103,8 +104,13 @@ ShuttleControl::on_size_allocate (Gtk::Allocation& alloc)
        
        /* add 3 color stops */
 
+       uint32_t col = ARDOUR_UI::config()->canvasvar_Shuttle.get();
+
+       int r,b,g,a;
+       UINT_TO_RGBA(col, &r, &g, &b, &a);
+
        cairo_pattern_add_color_stop_rgb (pattern, 0.0, 0, 0, 0);
-       cairo_pattern_add_color_stop_rgb (pattern, 0.5, 0.0, 0.0, 1.0);
+       cairo_pattern_add_color_stop_rgb (pattern, 0.5, r/255.0, g/255.0, b/255.0);
        cairo_pattern_add_color_stop_rgb (pattern, 1.0, 0, 0, 0);
 
        DrawingArea::on_size_allocate (alloc);