Make coverage frames work slightly better; jury is still out on whether they are...
authorCarl Hetherington <carl@carlh.net>
Fri, 30 Dec 2011 21:56:11 +0000 (21:56 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 30 Dec 2011 21:56:11 +0000 (21:56 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11121 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/region_view.cc
gtk2_ardour/streamview.cc

index ac16a28bf4a2d5b5a6644ba54970a07dbda2adf5..4db77f030dee75bddc5011506d76e3c820cd40c8 100644 (file)
@@ -779,8 +779,8 @@ RegionView::update_coverage_frames (LayerDisplay d)
        ArdourCanvas::SimpleRect* cr = 0;
        bool me = false;
 
-       uint32_t const color = frame->property_fill_color_rgba ();
-       uint32_t const base_alpha = UINT_RGBA_A (color);
+       /* the color that will be used to show parts of regions that will not be heard */
+       uint32_t non_playing_color = RGBA_TO_UINT (32, 32, 32, 192);
 
        while (t < end) {
 
@@ -802,12 +802,11 @@ RegionView::update_coverage_frames (LayerDisplay d)
                        cr->property_y1() = 1;
                        cr->property_y2() = _height + 1;
                        cr->property_outline_pixels() = 0;
-                       /* areas that will be played get a lower alpha */
-                       uint32_t alpha = base_alpha;
                        if (new_me) {
-                               alpha /= 2;
+                               cr->property_fill_color_rgba () = UINT_RGBA_CHANGE_A (non_playing_color, 0);
+                       } else {
+                               cr->property_fill_color_rgba () = non_playing_color;
                        }
-                       cr->property_fill_color_rgba () = UINT_RGBA_CHANGE_A (color, alpha);
                }
 
                t = pl->find_next_region_boundary (t, 1);
index 2fce87fa80b60c40717e15c025d2e2ed9042b85e..b9d577819f2dfa71f01ffa8c91f50a351fc21fd2 100644 (file)
@@ -324,21 +324,20 @@ StreamView::playlist_switched (boost::weak_ptr<Track> wtr)
        playlist_connections.drop_connections ();
        undisplay_track ();
 
+       /* draw it */
+
+       redisplay_track ();
+
        /* update layers count and the y positions and heights of our regions */
        _layers = tr->playlist()->top_layer() + 1;
        update_contents_height ();
        update_coverage_frames ();
 
-       /* draw it */
-
-       redisplay_track ();
-
        /* catch changes */
 
        tr->playlist()->LayeringChanged.connect (playlist_connections, invalidator (*this), boost::bind (&StreamView::playlist_layered, this, boost::weak_ptr<Track> (tr)), gui_context());
        tr->playlist()->RegionAdded.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::add_region_view, this, _1), gui_context());
        tr->playlist()->RegionRemoved.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::remove_region_view, this, _1), gui_context());
-       tr->playlist()->ContentsChanged.connect (playlist_connections, invalidator (*this), ui_bind (&StreamView::update_coverage_frames, this), gui_context());
 }
 
 void