timeline: jump playhead to end when inserting or overwriting
This commit is contained in:
@@ -582,14 +582,14 @@ void TimelineWidget::DecreaseTrackHeight()
|
||||
void TimelineWidget::InsertFootageAtPlayhead(const QVector<ViewerOutput*>& footage)
|
||||
{
|
||||
auto command = new MultiUndoCommand();
|
||||
import_tool_->PlaceAt(footage, GetConnectedNode()->GetPlayhead(), true, command);
|
||||
import_tool_->PlaceAt(footage, GetConnectedNode()->GetPlayhead(), true, command, 0, true);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
}
|
||||
|
||||
void TimelineWidget::OverwriteFootageAtPlayhead(const QVector<ViewerOutput *> &footage)
|
||||
{
|
||||
auto command = new MultiUndoCommand();
|
||||
import_tool_->PlaceAt(footage, GetConnectedNode()->GetPlayhead(), false, command);
|
||||
import_tool_->PlaceAt(footage, GetConnectedNode()->GetPlayhead(), false, command, 0, true);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ void ImportTool::DragDrop(TimelineViewMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void ImportTool::PlaceAt(const QVector<ViewerOutput *> &footage, const rational &start, bool insert, MultiUndoCommand *command, int track_offset)
|
||||
void ImportTool::PlaceAt(const QVector<ViewerOutput *> &footage, const rational &start, bool insert, MultiUndoCommand *command, int track_offset, bool jump_to_end)
|
||||
{
|
||||
DraggedFootageData refs;
|
||||
|
||||
@@ -200,10 +200,10 @@ void ImportTool::PlaceAt(const QVector<ViewerOutput *> &footage, const rational
|
||||
refs.append({f, f->GetEnabledStreamsAsReferences()});
|
||||
}
|
||||
|
||||
PlaceAt(refs, start, insert, command, track_offset);
|
||||
PlaceAt(refs, start, insert, command, track_offset, jump_to_end);
|
||||
}
|
||||
|
||||
void ImportTool::PlaceAt(const DraggedFootageData &footage, const rational &start, bool insert, MultiUndoCommand *command, int track_offset)
|
||||
void ImportTool::PlaceAt(const DraggedFootageData &footage, const rational &start, bool insert, MultiUndoCommand *command, int track_offset, bool jump_to_end)
|
||||
{
|
||||
dragged_footage_ = footage;
|
||||
|
||||
@@ -212,7 +212,19 @@ void ImportTool::PlaceAt(const DraggedFootageData &footage, const rational &star
|
||||
}
|
||||
|
||||
PrepGhosts(start, track_offset);
|
||||
|
||||
rational max(0);
|
||||
if (jump_to_end) {
|
||||
for (TimelineViewGhostItem* ghost : parent()->GetGhostItems()) {
|
||||
max = std::max(max, ghost->GetAdjustedOut());
|
||||
}
|
||||
}
|
||||
|
||||
DropGhosts(insert, command);
|
||||
|
||||
if (jump_to_end) {
|
||||
this->sequence()->SetPlayhead(max);
|
||||
}
|
||||
}
|
||||
|
||||
void ImportTool::FootageToGhosts(rational ghost_start, const DraggedFootageData &sorted, const rational& dest_tb, const int& track_start)
|
||||
|
||||
@@ -37,8 +37,8 @@ public:
|
||||
|
||||
using DraggedFootageData = QVector<QPair<ViewerOutput*, QVector<Track::Reference> > >;
|
||||
|
||||
void PlaceAt(const QVector<ViewerOutput *> &footage, const rational& start, bool insert, MultiUndoCommand *command, int track_offset = 0);
|
||||
void PlaceAt(const DraggedFootageData &footage, const rational& start, bool insert, MultiUndoCommand *command, int track_offset = 0);
|
||||
void PlaceAt(const QVector<ViewerOutput *> &footage, const rational& start, bool insert, MultiUndoCommand *command, int track_offset = 0, bool jump_to_end = false);
|
||||
void PlaceAt(const DraggedFootageData &footage, const rational& start, bool insert, MultiUndoCommand *command, int track_offset = 0, bool jump_to_end = false);
|
||||
|
||||
enum DropWithoutSequenceBehavior {
|
||||
kDWSAsk,
|
||||
|
||||
Reference in New Issue
Block a user