reimplement footage viewer in new structure
This commit is contained in:
@@ -572,18 +572,25 @@ NodeValueTable Footage::Value(const QString &output, NodeValueDatabase &value) c
|
||||
if (QFileInfo(file).exists()) {
|
||||
FootageJob job(decoder_, filename(), ref.type());
|
||||
|
||||
rational length;
|
||||
|
||||
if (ref.type() == Stream::kVideo) {
|
||||
VideoParams vp = GetVideoParams(ref.index());
|
||||
|
||||
// Ensure the colorspace is valid and not empty
|
||||
vp.set_colorspace(GetColorspaceToUse(vp));
|
||||
length = Timecode::timestamp_to_time(vp.duration(), vp.time_base());
|
||||
|
||||
job.set_video_params(vp);
|
||||
} else {
|
||||
job.set_audio_params(GetAudioParams(ref.index()));
|
||||
AudioParams ap = GetAudioParams(ref.index());
|
||||
job.set_audio_params(ap);
|
||||
job.set_cache_path(project()->cache_path());
|
||||
length = Timecode::timestamp_to_time(ap.duration(), ap.time_base());
|
||||
}
|
||||
|
||||
table.Push(NodeValue::kRational, QVariant::fromValue(length), this, false, QStringLiteral("length"));
|
||||
|
||||
table.Push(NodeValue::kFootageJob, QVariant::fromValue(job), this);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@ Project::Project() :
|
||||
settings_->setParent(this);
|
||||
AddDefaultNode(settings_);
|
||||
|
||||
// Viewer node for connecting with the footage viewer
|
||||
footage_viewer_ = new ViewerOutput();
|
||||
footage_viewer_->setParent(this);
|
||||
AddDefaultNode(footage_viewer_);
|
||||
|
||||
// Folder root for project
|
||||
root_ = new Folder();
|
||||
root_->setParent(this);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "node/project/projectsettings/projectsettings.h"
|
||||
#include "node/output/viewer/viewer.h"
|
||||
#include "render/colormanager.h"
|
||||
#include "project/item/folder/folder.h"
|
||||
#include "window/mainwindow/mainwindowlayoutinfo.h"
|
||||
@@ -72,6 +73,11 @@ public:
|
||||
|
||||
QString cache_path() const;
|
||||
|
||||
ViewerOutput* footage_viewer()
|
||||
{
|
||||
return footage_viewer_;
|
||||
}
|
||||
|
||||
signals:
|
||||
void NameChanged();
|
||||
|
||||
@@ -86,6 +92,8 @@ private:
|
||||
|
||||
ProjectSettingsNode* settings_;
|
||||
|
||||
ViewerOutput* footage_viewer_;
|
||||
|
||||
bool is_modified_;
|
||||
|
||||
bool autorecovery_saved_;
|
||||
|
||||
Reference in New Issue
Block a user