This commit is contained in:
itsmattkc
2020-12-30 14:46:15 +11:00
105 changed files with 561 additions and 605 deletions
+13 -9
View File
@@ -224,7 +224,7 @@ void ImportTool::FootageToGhosts(rational ghost_start, const QList<DraggedFootag
quint64 enabled_streams = footage.streams();
// Loop through all streams in footage
foreach (StreamPtr stream, footage.footage()->streams()) {
foreach (Stream* stream, footage.footage()->streams()) {
Timeline::TrackType track_type = TrackTypeFromStreamType(stream->type());
quint64 cached_enabled_streams = enabled_streams;
@@ -239,7 +239,7 @@ void ImportTool::FootageToGhosts(rational ghost_start, const QList<DraggedFootag
TimelineViewGhostItem* ghost = new TimelineViewGhostItem();
if (stream->type() == Stream::kVideo
&& std::static_pointer_cast<VideoStream>(stream)->video_type() == VideoStream::kVideoTypeStill) {
&& static_cast<VideoStream*>(stream)->video_type() == VideoStream::kVideoTypeStill) {
// Stream is essentially length-less - we may use the default still image length in config,
// or we may use another stream's length depending on the circumstance
contains_image_stream = true;
@@ -260,7 +260,7 @@ void ImportTool::FootageToGhosts(rational ghost_start, const QList<DraggedFootag
// Increment track count for this track type
track_offsets[track_type]++;
ghost->SetData(TimelineViewGhostItem::kAttachedFootage, QVariant::fromValue(stream));
ghost->SetData(TimelineViewGhostItem::kAttachedFootage, Node::PtrToValue(stream));
ghost->SetMode(Timeline::kMove);
footage_ghosts.append(ghost);
@@ -353,7 +353,7 @@ void ImportTool::DropGhosts(bool insert)
Project* active_project = Core::instance()->GetActiveProject();
if (active_project) {
SequencePtr new_sequence = Core::instance()->CreateNewSequenceForProject(active_project);
Sequence* new_sequence = Core::instance()->CreateNewSequenceForProject(active_project);
new_sequence->set_default_parameters();
@@ -371,7 +371,7 @@ void ImportTool::DropGhosts(bool insert)
} else {
SequenceDialog sd(new_sequence.get(), SequenceDialog::kNew, parent());
SequenceDialog sd(new_sequence, SequenceDialog::kNew, parent());
sd.SetUndoable(false);
if (sd.exec() != QDialog::Accepted) {
@@ -390,11 +390,15 @@ void ImportTool::DropGhosts(bool insert)
FootageToGhosts(0, dragged_footage_, new_sequence->video_params().time_base(), 0);
dst_graph = new_sequence.get();
dst_graph = new_sequence;
viewer_node = new_sequence->viewer_output();
// Set this as the sequence to open
open_sequence = new_sequence.get();
open_sequence = new_sequence;
} else {
// If the sequence is valid, ownership is passed to AddItemCommand.
// Otherwise, we're responsible for deleting it.
delete new_sequence;
}
}
}
@@ -412,7 +416,7 @@ void ImportTool::DropGhosts(bool insert)
for (int i=0;i<parent()->GetGhostItems().size();i++) {
TimelineViewGhostItem* ghost = parent()->GetGhostItems().at(i);
StreamPtr footage_stream = ghost->GetData(TimelineViewGhostItem::kAttachedFootage).value<StreamPtr>();
Stream* footage_stream = Node::ValueToPtr<Stream>(ghost->GetData(TimelineViewGhostItem::kAttachedFootage));
ClipBlock* clip = new ClipBlock();
clip->set_media_in(ghost->GetMediaIn());
@@ -475,7 +479,7 @@ void ImportTool::DropGhosts(bool insert)
// Link any clips so far that share the same Footage with this one
for (int j=0;j<i;j++) {
StreamPtr footage_compare = parent()->GetGhostItems().at(j)->GetData(TimelineViewGhostItem::kAttachedFootage).value<StreamPtr>();
Stream* footage_compare = Node::ValueToPtr<Stream>(parent()->GetGhostItems().at(j)->GetData(TimelineViewGhostItem::kAttachedFootage));
if (footage_compare->footage() == footage_stream->footage()) {
Block::Link(block_items.at(j), clip);
+1 -1
View File
@@ -68,7 +68,7 @@ void ZoomTool::MouseRelease(TimelineViewMouseEvent *event)
// Normalize scale to 1.0 scale
double scene_width = (scene_right - scene_left) / parent()->GetScale();
double new_scale = qMin(TimelineViewBase::kMaximumScale, static_cast<double>(reference_view->viewport()->width()) / scene_width);
double new_scale = qMin(TimeBasedView::kMaximumScale, static_cast<double>(reference_view->viewport()->width()) / scene_width);
parent()->SetScale(new_scale);