Fix another bug wrt visual appearance of layered regions in
authorCarl Hetherington <carl@carlh.net>
Tue, 27 Dec 2011 21:10:20 +0000 (21:10 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 27 Dec 2011 21:10:20 +0000 (21:10 +0000)
overlaid mode.

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

gtk2_ardour/editor_drag.cc
gtk2_ardour/streamview.h

index bb59a4ad24ed9d38a07d1ce078047a9459541788..2d6c98b37325254f80566184f7a0445e67e877ba 100644 (file)
@@ -964,6 +964,7 @@ RegionMoveDrag::finished_no_copy (
 
        list<pair<boost::shared_ptr<Region>, double> > pending_explicit_relayers;
        Playlist::RegionList pending_implicit_relayers;
+       set<RouteTimeAxisView*> views_to_update;
 
        if (_brushing) {
                /* all changes were made during motion event handlers */
@@ -989,6 +990,8 @@ RegionMoveDrag::finished_no_copy (
                        continue;
                }
 
+               views_to_update.insert (dest_rtv);
+
                framepos_t where;
 
                if (changed_position && !_x_constrained) {
@@ -1134,6 +1137,17 @@ RegionMoveDrag::finished_no_copy (
        add_stateful_diff_commands_for_playlists (modified_playlists);
 
        _editor->commit_reversible_command ();
+
+       /* We have futzed with the layering of canvas items on our streamviews.
+          If any region changed layer, this will have resulted in the stream
+          views being asked to set up their region views, and all will be
+          well.  If not, we might now have badly-ordered region views.  Ask
+          the Streamviews involved to sort themselves out, just in case.
+       */
+       
+       for (set<RouteTimeAxisView*>::iterator i = views_to_update.begin(); i != views_to_update.end(); ++i) {
+               (*i)->view()->playlist_layered ((*i)->track ());
+       }
 }
 
 /** Remove a region from a playlist, clearing the diff history of the playlist first if necessary.
index 795fe0f68713cccf1daec8412c3d887297d6742f..349b380d9f645378e04b466a25c4082312a53e19 100644 (file)
@@ -118,6 +118,8 @@ public:
 
        void check_record_layers (boost::shared_ptr<ARDOUR::Region>, ARDOUR::framepos_t);
 
+       virtual void playlist_layered (boost::weak_ptr<ARDOUR::Track>);
+       
        sigc::signal<void, RegionView*> RegionViewAdded;
        sigc::signal<void> RegionViewRemoved;
 
@@ -141,7 +143,6 @@ protected:
        void         layer_regions ();
 
        virtual void playlist_switched (boost::weak_ptr<ARDOUR::Track>);
-       virtual void playlist_layered (boost::weak_ptr<ARDOUR::Track>);
 
        virtual void color_handler () = 0;