added some basic timeline functionality

This commit is contained in:
itsmattkc
2019-08-12 23:24:58 +10:00
parent 3eee9893f8
commit e9702aeb52
14 changed files with 264 additions and 59 deletions
+9 -1
View File
@@ -83,6 +83,14 @@ void TimelineView::ImportTool::DragEnter(QDragEnterEvent *event)
void TimelineView::ImportTool::DragMove(QDragMoveEvent *event)
{
if (parent()->HasGhosts()) {
// Move ghosts to the mouse cursor
foreach (TimelineViewGhostItem* ghost, parent()->ghost_items_) {
rational time = parent()->ScreenToTime(event->pos().x());
ghost->SetOut(ghost->Out() - ghost->In() + time);
ghost->SetIn(time);
}
event->accept();
} else {
event->ignore();
@@ -114,7 +122,7 @@ void TimelineView::ImportTool::DragDrop(QDropEvent *event)
// FIXME: If this doesn't have a TimelineOutput node attached, this is a memory leak. Maybe switching nodes to
// shared ptrs would be a better idea.
emit parent()->RequestInsertBlock(clip, 0);
emit parent()->RequestPlaceBlock(clip, ghost->In());
}
parent()->ClearGhosts();