Merge branch 'master' into nodeview-redux

This commit is contained in:
itsmattkc
2021-05-21 11:13:42 +10:00
66 changed files with 1066 additions and 569 deletions
+13 -1
View File
@@ -20,6 +20,7 @@
#include "add.h"
#include "core.h"
#include "node/block/subtitle/subtitle.h"
#include "node/factory.h"
#include "node/generator/solid/solid.h"
#include "node/generator/text/text.h"
@@ -54,6 +55,9 @@ void AddTool::MousePress(TimelineViewMouseEvent *event)
case olive::Tool::kAddableTone:
add_type = Track::kAudio;
break;
case olive::Tool::kAddableSubtitle:
add_type = Track::kSubtitle;
break;
case olive::Tool::kAddableEmpty:
// Leave as "none", which means this block can be placed on any track
break;
@@ -93,7 +97,12 @@ void AddTool::MouseRelease(TimelineViewMouseEvent *event)
if (!ghost_->GetAdjustedLength().isNull()) {
MultiUndoCommand* command = new MultiUndoCommand();
ClipBlock* clip = new ClipBlock();
ClipBlock* clip;
if (Core::instance()->GetSelectedAddableObject() == olive::Tool::kAddableSubtitle) {
clip = new SubtitleBlock();
} else {
clip = new ClipBlock();
}
clip->set_length_and_media_out(ghost_->GetAdjustedLength());
clip->SetLabel(olive::Tool::GetAddableObjectName(Core::instance()->GetSelectedAddableObject()));
@@ -140,6 +149,9 @@ void AddTool::MouseRelease(TimelineViewMouseEvent *event)
// Not implemented yet
qWarning() << "Unimplemented add object:" << Core::instance()->GetSelectedAddableObject();
break;
case olive::Tool::kAddableSubtitle:
// The block itself is the node we want
break;
case olive::Tool::kAddableCount:
// Invalid value, do nothing
break;