Fix up confusion with relayering after movement drags in
overlaid mode. git-svn-id: svn://localhost/ardour2/branches/3.0@11092 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8f46200449
commit
2db69318ce
@ -961,9 +961,9 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
RegionSelection new_views;
|
RegionSelection new_views;
|
||||||
PlaylistSet modified_playlists;
|
PlaylistSet modified_playlists;
|
||||||
PlaylistSet frozen_playlists;
|
PlaylistSet frozen_playlists;
|
||||||
PlaylistSet relayer_suspended_playlists;
|
|
||||||
|
|
||||||
list<pair<boost::shared_ptr<Region>, double> > pending_relayers;
|
list<pair<boost::shared_ptr<Region>, double> > pending_explicit_relayers;
|
||||||
|
Playlist::RegionList pending_implicit_relayers;
|
||||||
|
|
||||||
if (_brushing) {
|
if (_brushing) {
|
||||||
/* all changes were made during motion event handlers */
|
/* all changes were made during motion event handlers */
|
||||||
@ -1045,7 +1045,9 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
bool const explicit_relayer = dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded;
|
bool const explicit_relayer = dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded;
|
||||||
|
|
||||||
if (explicit_relayer) {
|
if (explicit_relayer) {
|
||||||
pending_relayers.push_back (make_pair (rv->region (), dest_layer));
|
pending_explicit_relayers.push_back (make_pair (rv->region (), dest_layer));
|
||||||
|
} else {
|
||||||
|
pending_implicit_relayers.push_back (rv->region ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* freeze playlist to avoid lots of relayering in the case of a multi-region drag */
|
/* freeze playlist to avoid lots of relayering in the case of a multi-region drag */
|
||||||
@ -1054,6 +1056,7 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
|
|
||||||
if (r.second) {
|
if (r.second) {
|
||||||
playlist->freeze ();
|
playlist->freeze ();
|
||||||
|
playlist->suspend_relayer ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this movement may result in a crossfade being modified, so we need to get undo
|
/* this movement may result in a crossfade being modified, so we need to get undo
|
||||||
@ -1065,9 +1068,6 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
}
|
}
|
||||||
|
|
||||||
relayer_suspended_playlists.insert (playlist);
|
|
||||||
playlist->suspend_relayer ();
|
|
||||||
|
|
||||||
rv->region()->set_position (where);
|
rv->region()->set_position (where);
|
||||||
|
|
||||||
_editor->session()->add_command (new StatefulDiffCommand (rv->region()));
|
_editor->session()->add_command (new StatefulDiffCommand (rv->region()));
|
||||||
@ -1112,18 +1112,24 @@ RegionMoveDrag::finished_no_copy (
|
|||||||
_editor->selection->set (new_views);
|
_editor->selection->set (new_views);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We can't use the normal mechanism for relayering, as some regions may require an explicit relayer
|
||||||
|
rather than an implicit one. So we thaw before resuming relayering, then do the relayers
|
||||||
|
that we require.
|
||||||
|
*/
|
||||||
|
|
||||||
for (PlaylistSet::iterator p = frozen_playlists.begin(); p != frozen_playlists.end(); ++p) {
|
for (PlaylistSet::iterator p = frozen_playlists.begin(); p != frozen_playlists.end(); ++p) {
|
||||||
(*p)->thaw();
|
(*p)->thaw();
|
||||||
}
|
|
||||||
|
|
||||||
for (PlaylistSet::iterator p = relayer_suspended_playlists.begin(); p != relayer_suspended_playlists.end(); ++p) {
|
|
||||||
(*p)->resume_relayer ();
|
(*p)->resume_relayer ();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (list<pair<boost::shared_ptr<Region>, double> >::iterator i = pending_relayers.begin(); i != pending_relayers.end(); ++i) {
|
for (list<pair<boost::shared_ptr<Region>, double> >::iterator i = pending_explicit_relayers.begin(); i != pending_explicit_relayers.end(); ++i) {
|
||||||
i->first->playlist()->relayer (i->first, i->second);
|
i->first->playlist()->relayer (i->first, i->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Playlist::RegionList::iterator i = pending_implicit_relayers.begin(); i != pending_implicit_relayers.end(); ++i) {
|
||||||
|
(*i)->playlist()->relayer (*i);
|
||||||
|
}
|
||||||
|
|
||||||
/* write commands for the accumulated diffs for all our modified playlists */
|
/* write commands for the accumulated diffs for all our modified playlists */
|
||||||
add_stateful_diff_commands_for_playlists (modified_playlists);
|
add_stateful_diff_commands_for_playlists (modified_playlists);
|
||||||
|
|
||||||
|
@ -225,6 +225,7 @@ public:
|
|||||||
framepos_t find_next_top_layer_position (framepos_t) const;
|
framepos_t find_next_top_layer_position (framepos_t) const;
|
||||||
uint32_t combine_ops() const { return _combine_ops; }
|
uint32_t combine_ops() const { return _combine_ops; }
|
||||||
|
|
||||||
|
void relayer (boost::shared_ptr<Region>);
|
||||||
void relayer (boost::shared_ptr<Region>, double);
|
void relayer (boost::shared_ptr<Region>, double);
|
||||||
void suspend_relayer ();
|
void suspend_relayer ();
|
||||||
void resume_relayer ();
|
void resume_relayer ();
|
||||||
@ -355,7 +356,6 @@ public:
|
|||||||
boost::shared_ptr<Playlist> cut (framepos_t start, framecnt_t cnt, bool result_is_hidden);
|
boost::shared_ptr<Playlist> cut (framepos_t start, framecnt_t cnt, bool result_is_hidden);
|
||||||
boost::shared_ptr<Playlist> copy (framepos_t start, framecnt_t cnt, bool result_is_hidden);
|
boost::shared_ptr<Playlist> copy (framepos_t start, framecnt_t cnt, bool result_is_hidden);
|
||||||
|
|
||||||
void relayer (boost::shared_ptr<Region>);
|
|
||||||
void relayer (RegionList const &);
|
void relayer (RegionList const &);
|
||||||
|
|
||||||
void begin_undo ();
|
void begin_undo ();
|
||||||
|
Loading…
Reference in New Issue
Block a user