make knob respond to X & Y axis drags
[ardour.git] / gtk2_ardour / region_view.cc
index 93b8fa3321c7f3583150558784ce25d73f5e55df..be96cd4058bb0b4fbbec286abd7aaae57eecaacd 100644 (file)
@@ -238,7 +238,7 @@ RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*thr
 
        for (AudioIntervalResult::const_iterator i = silences.begin(); i != silences.end(); ++i) {
 
-               ArdourCanvas::Rectangle* cr = new ArdourCanvas::TimeRectangle (group);
+               ArdourCanvas::Rectangle* cr = new ArdourCanvas::Rectangle (group);
                cr->set_ignore_events (true);
                _silent_frames.push_back (cr);
 
@@ -514,11 +514,17 @@ void
 RegionView::set_colors ()
 {
        TimeAxisViewItem::set_colors ();
+       set_sync_mark_color ();
+}
 
+void
+RegionView::set_sync_mark_color ()
+{
        if (sync_mark) {
-               /* XXX: make these colours themable */
-               sync_mark->set_fill_color (ArdourCanvas::rgba_to_color (0, 1.0, 0, 1.0));
-               sync_line->set_outline_color (ArdourCanvas::rgba_to_color (0, 1.0, 0, 1.0));
+               ArdourCanvas::Color c = ARDOUR_UI::config()->color ("sync mark");
+               sync_mark->set_fill_color (c);
+               sync_mark->set_outline_color (c);
+               sync_line->set_outline_color (c);
        }
 }
 
@@ -619,11 +625,10 @@ RegionView::region_sync_changed ()
 
                sync_mark = new ArdourCanvas::Polygon (group);
                CANVAS_DEBUG_NAME (sync_mark, string_compose ("sync mark for %1", get_item_name()));
-               sync_mark->set_fill_color (ArdourCanvas::rgba_to_color (0, 1.0, 0, 1.0));    // FIXME make a themeable colour
-
                sync_line = new ArdourCanvas::Line (group);
                CANVAS_DEBUG_NAME (sync_line, string_compose ("sync mark for %1", get_item_name()));
-               sync_line->set_outline_color (ArdourCanvas::rgba_to_color (0, 1.0, 0, 1.0)); // FIXME make a themeable colour
+
+               set_sync_mark_color ();
        }
 
        /* this has to handle both a genuine change of position, a change of samples_per_pixel
@@ -779,7 +784,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
        bool me = false;
 
        /* the color that will be used to show parts of regions that will not be heard */
-       uint32_t const non_playing_color = ARDOUR_UI::config()->color_mod ("covered region", "region base");
+       uint32_t const non_playing_color = ARDOUR_UI::config()->color_mod ("covered region", "covered region base");
 
        while (t < end) {
 
@@ -795,7 +800,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
 
                /* start off any new rect, if required */
                if (cr == 0 || me != new_me) {
-                       cr = new ArdourCanvas::TimeRectangle (group);
+                       cr = new ArdourCanvas::Rectangle (group);
                        _coverage_frames.push_back (cr);
                        cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
                        cr->set_y0 (1);