13
0

fix "locked" + "locked to video" bug.

previously if some audio region was locked and locked to video,
the audio-region always stayed put and the video could only be
moved forward.

TODO: add an "unlock all" option.
This commit is contained in:
Robin Gareus 2015-08-20 02:24:27 +02:00
parent b8b6f61d6c
commit 89b0817f83
2 changed files with 16 additions and 0 deletions

View File

@ -2502,11 +2502,15 @@ VideoTimeLineDrag::VideoTimeLineDrag (Editor* e, ArdourCanvas::Item* i)
_editor->get_regions_after(rs, (framepos_t) 0, empty);
std::list<RegionView*> views = rs.by_layer();
_stuck = false;
for (list<RegionView*>::iterator i = views.begin(); i != views.end(); ++i) {
RegionView* rv = (*i);
if (!rv->region()->video_locked()) {
continue;
}
if (!rv->region()->position_locked()) {
_stuck = true;
}
_views.push_back (AVDraggingView (rv));
}
}
@ -2518,6 +2522,10 @@ VideoTimeLineDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
if (_editor->session() == 0) {
return;
}
if (_stuck) {
show_verbose_cursor_text (_("One or more Audio Regions\nare both Locked and\nLocked to Video.\nThe video cannot me moved."));
return;
}
_startdrag_video_offset=ARDOUR_UI::instance()->video_timeline->get_offset();
_max_backwards_drag = (
@ -2549,6 +2557,10 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move)
if (ARDOUR_UI::instance()->video_timeline->is_offset_locked()) {
return;
}
if (_stuck) {
show_verbose_cursor_text (_("One or more Audio Regions\nare both Locked and\nLocked to Video.\nThe video cannot me moved."));
return;
}
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(_startdrag_video_offset+dt) - _startdrag_video_offset;
@ -2595,6 +2607,9 @@ VideoTimeLineDrag::finished (GdkEvent * /*event*/, bool movement_occurred)
if (ARDOUR_UI::instance()->video_timeline->is_offset_locked()) {
return;
}
if (_stuck) {
return;
}
if (!movement_occurred || ! _editor->session()) {
return;

View File

@ -645,6 +645,7 @@ protected:
private:
ARDOUR::frameoffset_t _startdrag_video_offset;
ARDOUR::frameoffset_t _max_backwards_drag;
bool _stuck;
};
/** Drag to trim region(s) */