finalized very, very basic OTIO support
Ironed out various project and footage loading issues, and a single cache invalidation issue.
This commit is contained in:
@@ -16,9 +16,6 @@
|
||||
|
||||
add_subdirectory(ffmpeg)
|
||||
add_subdirectory(oiio)
|
||||
if(OpenTimelineIO_FOUND)
|
||||
add_subdirectory(otio)
|
||||
endif()
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
|
||||
+14
-16
@@ -27,13 +27,13 @@
|
||||
#include "codec/ffmpeg/ffmpegcommon.h"
|
||||
#include "codec/ffmpeg/ffmpegdecoder.h"
|
||||
#include "codec/oiio/oiiodecoder.h"
|
||||
#ifdef USE_OTIO
|
||||
#include "codec/otio/otiodecoder.h"
|
||||
#endif
|
||||
#include "codec/waveinput.h"
|
||||
#include "codec/waveoutput.h"
|
||||
#include "common/filefunctions.h"
|
||||
#include "common/timecodefunctions.h"
|
||||
#ifdef USE_OTIO
|
||||
#include "task/project/loadotio/loadotio.h"
|
||||
#endif
|
||||
#include "task/taskmanager.h"
|
||||
#include "project/project.h"
|
||||
|
||||
@@ -92,16 +92,13 @@ QVector<DecoderPtr> ReceiveListOfAllDecoders() {
|
||||
|
||||
// The order in which these decoders are added is their priority when probing. Hence FFmpeg should usually be last,
|
||||
// since it supports so many formats and we presumably want to override those formats with a more specific decoder.
|
||||
#ifdef USE_OTIO
|
||||
decoders.append(std::make_shared<OTIODecoder>());
|
||||
#endif
|
||||
decoders.append(std::make_shared<OIIODecoder>());
|
||||
decoders.append(std::make_shared<FFmpegDecoder>());
|
||||
|
||||
return decoders;
|
||||
}
|
||||
|
||||
ItemPtr Decoder::ProbeMedia(const QString &filename, const QAtomicInt* cancelled)
|
||||
FootagePtr Decoder::ProbeMedia(Project* project, const QString &filename, const QAtomicInt* cancelled)
|
||||
{
|
||||
// Check for a valid filename
|
||||
if (filename.isEmpty()) {
|
||||
@@ -127,21 +124,22 @@ ItemPtr Decoder::ProbeMedia(const QString &filename, const QAtomicInt* cancelled
|
||||
|
||||
DecoderPtr decoder = decoder_list.at(i);
|
||||
|
||||
ItemPtr item = decoder->Probe(filename, cancelled);
|
||||
FootagePtr footage = decoder->Probe(filename, cancelled);
|
||||
|
||||
if (item) {
|
||||
if (footage) {
|
||||
QFileInfo file_info(filename);
|
||||
footage->set_name(file_info.fileName());
|
||||
footage->set_filename(filename);
|
||||
|
||||
if (item->type() == Item::kFootage) {
|
||||
// Attach the successful Decoder to this Footage object
|
||||
FootagePtr footage = std::static_pointer_cast<Footage>(item);
|
||||
footage->set_decoder(decoder->id());
|
||||
footage->SetValid();
|
||||
}
|
||||
footage->set_decoder(decoder->id());
|
||||
footage->set_project(project);
|
||||
footage->set_timestamp(file_info.lastModified().toMSecsSinceEpoch());
|
||||
|
||||
footage->SetValid();
|
||||
|
||||
// FIXME: Cache the results so we don't have to probe if this media is added a second time
|
||||
|
||||
return item;
|
||||
return footage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public:
|
||||
* TRUE if the Decoder was able to decode this file. FALSE if not. This function should have filled the Footage
|
||||
* object with metadata if it returns TRUE. Otherwise, the Footage object should be untouched.
|
||||
*/
|
||||
virtual ItemPtr Probe(const QString& filename, const QAtomicInt* cancelled) const = 0;
|
||||
virtual FootagePtr Probe(const QString& filename, const QAtomicInt* cancelled) const = 0;
|
||||
|
||||
/**
|
||||
* @brief Open media/allocate memory
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
*
|
||||
* TRUE if a Decoder was successfully able to parse and probe this file. FALSE if not.
|
||||
*/
|
||||
static ItemPtr ProbeMedia(const QString& filename, const QAtomicInt *cancelled);
|
||||
static FootagePtr ProbeMedia(Project *project, const QString& filename, const QAtomicInt *cancelled);
|
||||
|
||||
/**
|
||||
* @brief Create a Decoder instance using a Decoder ID
|
||||
|
||||
@@ -450,7 +450,7 @@ bool FFmpegDecoder::SupportsAudio()
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemPtr FFmpegDecoder::Probe(const QString& filename, const QAtomicInt* cancelled) const
|
||||
FootagePtr FFmpegDecoder::Probe(const QString& filename, const QAtomicInt* cancelled) const
|
||||
{
|
||||
// Variable for receiving errors from FFmpeg
|
||||
int error_code;
|
||||
@@ -578,7 +578,7 @@ ItemPtr FFmpegDecoder::Probe(const QString& filename, const QAtomicInt* cancelle
|
||||
|
||||
if (avstream->duration == AV_NOPTS_VALUE) {
|
||||
// Loop through stream until we get the whole duration
|
||||
FFmpegDecoderInstance instance(filename, i);
|
||||
FFmpegDecoderInstance instance(filename_c, i);
|
||||
|
||||
AVPacket* pkt = av_packet_alloc();
|
||||
AVFrame* frame = av_frame_alloc();
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
// Destructor
|
||||
virtual ~FFmpegDecoder() override;
|
||||
|
||||
virtual ItemPtr Probe(const QString& filename, const QAtomicInt* cancelled) const override;
|
||||
virtual FootagePtr Probe(const QString& filename, const QAtomicInt* cancelled) const override;
|
||||
|
||||
virtual bool Open() override;
|
||||
virtual FramePtr RetrieveVideo(const rational &timecode, const int& divider) override;
|
||||
|
||||
@@ -45,7 +45,7 @@ QString OIIODecoder::id()
|
||||
return QStringLiteral("oiio");
|
||||
}
|
||||
|
||||
ItemPtr OIIODecoder::Probe(const QString& filename, const QAtomicInt* cancelled) const
|
||||
FootagePtr OIIODecoder::Probe(const QString& filename, const QAtomicInt* cancelled) const
|
||||
{
|
||||
if (!FileTypeIsSupported(filename)) {
|
||||
return nullptr;
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
virtual QString id() override;
|
||||
|
||||
virtual ItemPtr Probe(const QString& filename, const QAtomicInt* cancelled) const override;
|
||||
virtual FootagePtr Probe(const QString& filename, const QAtomicInt* cancelled) const override;
|
||||
|
||||
virtual bool Open() override;
|
||||
virtual FramePtr RetrieveVideo(const rational &timecode, const int& divider) override;
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "otiodecoder.h"
|
||||
|
||||
#include <opentimelineio/clip.h>
|
||||
#include <opentimelineio/externalReference.h>
|
||||
#include <opentimelineio/timeline.h>
|
||||
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/block/gap/gap.h"
|
||||
#include "project/item/sequence/sequence.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
OTIODecoder::OTIODecoder()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString OTIODecoder::id()
|
||||
{
|
||||
return QStringLiteral("otio");
|
||||
}
|
||||
|
||||
ItemPtr OTIODecoder::Probe(const QString& filename, const QAtomicInt* cancelled) const
|
||||
{
|
||||
if (filename.endsWith(QStringLiteral(".otio"), Qt::CaseInsensitive)) {
|
||||
opentimelineio::v1_0::ErrorStatus es;
|
||||
|
||||
auto timeline = static_cast<opentimelineio::v1_0::Timeline*>(opentimelineio::v1_0::SerializableObjectWithMetadata::from_json_file(filename.toStdString(), &es));
|
||||
|
||||
if (es != opentimelineio::v1_0::ErrorStatus::OK) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SequencePtr sequence = std::make_shared<Sequence>();
|
||||
|
||||
// FIXME: As far as I know, OTIO doesn't store video/audio parameters?
|
||||
sequence->set_default_parameters();
|
||||
|
||||
sequence->set_name(QString::fromStdString(timeline->name()));
|
||||
|
||||
for (auto c : timeline->tracks()->children()) {
|
||||
auto otio_track = static_cast<opentimelineio::v1_0::Track*>(c.value);
|
||||
|
||||
// Create a new track
|
||||
TrackOutput* track = nullptr;
|
||||
|
||||
// Determine what kind of track it is
|
||||
if (otio_track->kind() == "Video") {
|
||||
track = sequence->viewer_output()->track_list(Timeline::kTrackTypeVideo)->AddTrack();
|
||||
} else if (otio_track->kind() == "Audio") {
|
||||
track = sequence->viewer_output()->track_list(Timeline::kTrackTypeAudio)->AddTrack();
|
||||
} else {
|
||||
qWarning() << "Found unknown track type:" << otio_track->kind().c_str();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get clips from track
|
||||
std::map<opentimelineio::v1_0::Composable*, opentimelineio::v1_0::TimeRange> clip_map = otio_track->range_of_all_children(&es);
|
||||
if (es != opentimelineio::v1_0::ErrorStatus::OK) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto it=clip_map.cbegin(); it!=clip_map.cend(); it++) {
|
||||
|
||||
Block* block = nullptr;
|
||||
|
||||
if (it->first->schema_name() == "Clip") {
|
||||
|
||||
block = new ClipBlock();
|
||||
|
||||
auto otio_clip = static_cast<opentimelineio::v1_0::Clip*>(it->first);
|
||||
|
||||
/*
|
||||
if (otio_clip->media_reference()->schema_name() == "ExternalReference") {
|
||||
QString footage_url = QString::fromStdString(static_cast<opentimelineio::v1_0::ExternalReference*>(otio_clip->media_reference())->target_url());
|
||||
ItemPtr footage = Decoder::ProbeMedia(footage_url, cancelled);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
} else if (it->first->schema_name() == "Gap") {
|
||||
|
||||
block = new GapBlock();
|
||||
|
||||
} else {
|
||||
qWarning() << "Found unknown block type:" << it->first->schema_name().c_str();
|
||||
}
|
||||
|
||||
block->SetLabel(QString::fromStdString(it->first->name()));
|
||||
block->set_length_and_media_out(rational::fromDouble(it->second.duration().to_seconds()));
|
||||
sequence->AddNode(block);
|
||||
track->AppendBlock(block);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return sequence;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
+68
-37
@@ -55,7 +55,8 @@
|
||||
#include "render/pixelformat.h"
|
||||
#include "render/shaderinfo.h"
|
||||
#ifdef USE_OTIO
|
||||
#include "task/project/exportotio/exportotiotask.h"
|
||||
#include "task/project/loadotio/loadotio.h"
|
||||
#include "task/project/saveotio/saveotio.h"
|
||||
#endif
|
||||
#include "task/project/import/import.h"
|
||||
#include "task/project/import/importerrordialog.h"
|
||||
@@ -273,28 +274,6 @@ void Core::CreateNewProject()
|
||||
AddOpenProject(std::make_shared<Project>());
|
||||
}
|
||||
|
||||
#ifdef USE_OTIO
|
||||
void Core::ExportActiveSequenceAsOTIO()
|
||||
{
|
||||
ProjectPtr project = GetActiveProject();
|
||||
|
||||
if (project) {
|
||||
QString fn = QFileDialog::getSaveFileName(main_window_,
|
||||
tr("Export as OpenTimelineIO"),
|
||||
QString(),
|
||||
tr("OpenTimelineIO (*.otio)"));
|
||||
|
||||
if (!fn.isEmpty()) {
|
||||
fn = FileFunctions::EnsureFilenameExtension(fn, QStringLiteral("otio"));
|
||||
|
||||
ExportOTIOTask* task = new ExportOTIOTask(project, fn);
|
||||
TaskDialog* dialog = new TaskDialog(task, tr("Export Sequence"), main_window_);
|
||||
dialog->open();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
const bool &Core::snapping() const
|
||||
{
|
||||
return snapping_;
|
||||
@@ -486,7 +465,7 @@ void Core::AddOpenProject(ProjectPtr p)
|
||||
|
||||
void Core::AddOpenProjectFromTask(Task *task)
|
||||
{
|
||||
ProjectLoadTask* load_task = static_cast<ProjectLoadTask*>(task);
|
||||
ProjectLoadBaseTask* load_task = static_cast<ProjectLoadBaseTask*>(task);
|
||||
|
||||
ProjectPtr project = load_task->GetLoadedProject();
|
||||
MainWindowLayoutInfo layout = load_task->GetLoadedLayout();
|
||||
@@ -719,7 +698,22 @@ void Core::StartGUI(bool full_screen)
|
||||
void Core::SaveProjectInternal(ProjectPtr project)
|
||||
{
|
||||
// Create save manager
|
||||
ProjectSaveTask* psm = new ProjectSaveTask(project);
|
||||
Task* psm;
|
||||
|
||||
if (project->filename().endsWith(QStringLiteral(".otio"), Qt::CaseInsensitive)) {
|
||||
#ifdef USE_OTIO
|
||||
psm = new SaveOTIOTask(project);
|
||||
#else
|
||||
QMessageBox::critical(main_window_,
|
||||
tr("Missing OpenTimelineIO Libraries"),
|
||||
tr("This build was compiled without OpenTimelineIO and therefore "
|
||||
"cannot open OpenTimelineIO files."));
|
||||
return;
|
||||
#endif
|
||||
} else {
|
||||
psm = new ProjectSaveTask(project);
|
||||
}
|
||||
|
||||
TaskDialog* task_dialog = new TaskDialog(psm, tr("Save Project"), main_window_);
|
||||
|
||||
connect(task_dialog, &TaskDialog::TaskSucceeded, this, &Core::ProjectSaveSucceeded);
|
||||
@@ -891,9 +885,24 @@ bool Core::CloseAllExceptActiveProject()
|
||||
return true;
|
||||
}
|
||||
|
||||
QString Core::GetProjectFilter()
|
||||
QString Core::GetProjectFilter(bool include_any_filter)
|
||||
{
|
||||
return QStringLiteral("%1 (*.ove)").arg(tr("Olive Project"));
|
||||
QString filters;
|
||||
|
||||
#ifdef USE_OTIO
|
||||
if (include_any_filter) {
|
||||
filters.append(QStringLiteral("All Supported Projects (*.ove *.otio);;"));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Append standard filter
|
||||
filters.append(QStringLiteral("%1 (*.ove)").arg(tr("Olive Project")));
|
||||
|
||||
#ifdef USE_OTIO
|
||||
filters.append(QStringLiteral(";;%2 (*.otio)").arg(tr("OpenTimelineIO")));
|
||||
#endif
|
||||
|
||||
return filters;
|
||||
}
|
||||
|
||||
QString Core::GetRecentProjectsFilePath()
|
||||
@@ -914,13 +923,19 @@ bool Core::SaveProject(ProjectPtr p)
|
||||
|
||||
bool Core::SaveProjectAs(ProjectPtr p)
|
||||
{
|
||||
QString fn = QFileDialog::getSaveFileName(main_window_,
|
||||
tr("Save Project As"),
|
||||
QString(),
|
||||
GetProjectFilter());
|
||||
QFileDialog fd(main_window_, tr("Save Project As"));
|
||||
|
||||
if (!fn.isEmpty()) {
|
||||
fn = FileFunctions::EnsureFilenameExtension(fn, QStringLiteral("ove"));
|
||||
fd.setNameFilter(GetProjectFilter(false));
|
||||
|
||||
if (fd.exec() == QDialog::Accepted) {
|
||||
QString fn = fd.selectedFiles().first();
|
||||
|
||||
// Somewhat hacky method of extracting the extension from the name filter
|
||||
const QString& name_filter = fd.selectedNameFilter();
|
||||
int ext_index = name_filter.indexOf(QStringLiteral("(*.")) + 3;
|
||||
QString extension = name_filter.mid(ext_index, name_filter.size() - ext_index - 1);
|
||||
|
||||
fn = FileFunctions::EnsureFilenameExtension(fn, extension);
|
||||
|
||||
p->set_filename(fn);
|
||||
|
||||
@@ -958,9 +973,25 @@ void Core::OpenProjectInternal(const QString &filename)
|
||||
}
|
||||
}
|
||||
|
||||
ProjectLoadTask* plm = new ProjectLoadTask(filename);
|
||||
Task* load_task;
|
||||
|
||||
TaskDialog* task_dialog = new TaskDialog(plm, tr("Load Project"), main_window());
|
||||
if (filename.endsWith(QStringLiteral(".otio"), Qt::CaseInsensitive)) {
|
||||
// Load OpenTimelineIO project
|
||||
#ifdef USE_OTIO
|
||||
load_task = new LoadOTIOTask(filename);
|
||||
#else
|
||||
QMessageBox::critical(main_window_,
|
||||
tr("Missing OpenTimelineIO Libraries"),
|
||||
tr("This build was compiled without OpenTimelineIO and therefore "
|
||||
"cannot open OpenTimelineIO files."));
|
||||
return;
|
||||
#endif
|
||||
} else {
|
||||
// Fallback to regular OVE project
|
||||
load_task = new ProjectLoadTask(filename);
|
||||
}
|
||||
|
||||
TaskDialog* task_dialog = new TaskDialog(load_task, tr("Load Project"), main_window());
|
||||
|
||||
connect(task_dialog, &TaskDialog::TaskSucceeded, this, &Core::AddOpenProjectFromTask);
|
||||
|
||||
@@ -1237,7 +1268,7 @@ bool Core::ValidateFootageInLoadedProject(ProjectPtr project, const QString& pro
|
||||
foreach (ItemPtr item, project_footage) {
|
||||
FootagePtr footage = std::static_pointer_cast<Footage>(item);
|
||||
|
||||
if (!QFileInfo::exists(footage->filename())) {
|
||||
if (!QFileInfo::exists(footage->filename()) && !project_saved_url.isEmpty()) {
|
||||
// If the footage doesn't exist, it might have moved with the project
|
||||
const QString& project_current_url = project->filename();
|
||||
|
||||
@@ -1285,7 +1316,7 @@ void Core::OpenProject()
|
||||
QString file = QFileDialog::getOpenFileName(main_window_,
|
||||
tr("Open Project"),
|
||||
QString(),
|
||||
GetProjectFilter());
|
||||
GetProjectFilter(true));
|
||||
|
||||
if (!file.isEmpty()) {
|
||||
OpenProjectInternal(file);
|
||||
|
||||
+1
-8
@@ -385,13 +385,6 @@ public slots:
|
||||
*/
|
||||
void CreateNewProject();
|
||||
|
||||
#ifdef USE_OTIO
|
||||
/**
|
||||
* @brief Exports the active sequence to OpenTimelineIO
|
||||
*/
|
||||
void ExportActiveSequenceAsOTIO();
|
||||
#endif
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when a project is opened
|
||||
@@ -426,7 +419,7 @@ private:
|
||||
/**
|
||||
* @brief Get the file filter than can be used with QFileDialog to open and save compatible projects
|
||||
*/
|
||||
static QString GetProjectFilter();
|
||||
static QString GetProjectFilter(bool include_any_filter);
|
||||
|
||||
/**
|
||||
* @brief Returns the filename where the recently opened/saved projects should be stored
|
||||
|
||||
@@ -51,7 +51,7 @@ QList<Footage *> FootageViewerPanel::GetSelectedFootage() const
|
||||
|
||||
void FootageViewerPanel::SetFootage(Footage *f)
|
||||
{
|
||||
if (!f->IsValid()) {
|
||||
if (f && !f->IsValid()) {
|
||||
// Do nothing if footage is invalid
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ bool Footage::CompareFootageToItsFilename(FootagePtr footage)
|
||||
} else {
|
||||
// Footage may have changed and we'll have to re-probe it. It also may not have, in which
|
||||
// case nothing needs to change.
|
||||
ItemPtr item = Decoder::ProbeMedia(footage->filename(), nullptr);
|
||||
ItemPtr item = Decoder::ProbeMedia(footage->project(), footage->filename(), nullptr);
|
||||
|
||||
if (item && item->type() == footage->type()) {
|
||||
// Item is the same type, that's a good sign. Let's look for any differences.
|
||||
|
||||
@@ -151,7 +151,7 @@ void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const
|
||||
|
||||
// Ensure this and all children are in the main thread
|
||||
// NOTE: It might be good to move the Item system to QObjects so they inherit their thread
|
||||
if (thread() != qApp->thread()) {
|
||||
if (QThread::currentThread() != qApp->thread()) {
|
||||
moveToThread(qApp->thread());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ RenderBackend::RenderBackend(QObject *parent) :
|
||||
generate_audio_previews_(false),
|
||||
render_mode_(RenderMode::kOnline),
|
||||
autocache_has_changed_(false),
|
||||
use_custom_autocache_range_(false)
|
||||
use_custom_autocache_range_(false),
|
||||
ignore_next_mouse_button_(false)
|
||||
{
|
||||
instance_lock_.lock();
|
||||
instances_.append(this);
|
||||
@@ -258,6 +259,11 @@ void RenderBackend::SetAudioParams(const AudioParams ¶ms)
|
||||
audio_params_ = params;
|
||||
}
|
||||
|
||||
void RenderBackend::IgnoreNextMouseButton()
|
||||
{
|
||||
ignore_next_mouse_button_ = true;
|
||||
}
|
||||
|
||||
std::list<TimeRange> RenderBackend::SplitRangeIntoChunks(const TimeRange &r)
|
||||
{
|
||||
// FIXME: Magic number
|
||||
@@ -523,7 +529,8 @@ void RenderBackend::AutoCacheVideoInvalidated(const TimeRange &range)
|
||||
ClearVideoQueue();
|
||||
|
||||
// Hash these frames since that should be relatively quick.
|
||||
if (!(qApp->mouseButtons() & Qt::LeftButton)) {
|
||||
if (ignore_next_mouse_button_ || !(qApp->mouseButtons() & Qt::LeftButton)) {
|
||||
ignore_next_mouse_button_ = false;
|
||||
RenderTicketWatcher* watcher = new RenderTicketWatcher();
|
||||
QVector<rational> frames = viewer_node_->video_frame_cache()->GetFrameListFromTimeRange({range});
|
||||
autocache_hash_tasks_.insert(watcher, frames);
|
||||
|
||||
@@ -141,6 +141,8 @@ public:
|
||||
video_download_matrix_ = mat;
|
||||
}
|
||||
|
||||
void IgnoreNextMouseButton();
|
||||
|
||||
static std::list<TimeRange> SplitRangeIntoChunks(const TimeRange& r);
|
||||
|
||||
public slots:
|
||||
@@ -223,6 +225,8 @@ private:
|
||||
|
||||
QVector<QByteArray> autocache_currently_caching_hashes_;
|
||||
|
||||
bool ignore_next_mouse_button_;
|
||||
|
||||
private slots:
|
||||
void WorkerFinished();
|
||||
|
||||
|
||||
@@ -39,24 +39,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void Invalidate(const TimeRange& r);
|
||||
|
||||
void InvalidateAll();
|
||||
|
||||
const rational& GetLength()
|
||||
{
|
||||
return length_;
|
||||
}
|
||||
|
||||
void SetLength(const rational& r);
|
||||
|
||||
bool IsFullyValidated()
|
||||
{
|
||||
return invalidated_.isEmpty();
|
||||
}
|
||||
|
||||
void Shift(const rational& from, const rational& to);
|
||||
|
||||
const TimeRangeList& GetInvalidatedRanges()
|
||||
{
|
||||
return invalidated_;
|
||||
@@ -69,6 +61,15 @@ public:
|
||||
|
||||
QString GetCacheDirectory() const;
|
||||
|
||||
public slots:
|
||||
void Invalidate(const TimeRange& r);
|
||||
|
||||
void InvalidateAll();
|
||||
|
||||
void SetLength(const rational& r);
|
||||
|
||||
void Shift(const rational& from, const rational& to);
|
||||
|
||||
signals:
|
||||
void Invalidated(const OLIVE_NAMESPACE::TimeRange& r);
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(OpenTimelineIO_FOUND)
|
||||
add_subdirectory(exportotio)
|
||||
add_subdirectory(loadotio)
|
||||
add_subdirectory(saveotio)
|
||||
endif()
|
||||
|
||||
add_subdirectory(import)
|
||||
|
||||
@@ -83,7 +83,8 @@ void ProjectImportTask::Import(Folder *folder, QFileInfoList import, int &counte
|
||||
// Strip out "." and ".." (for some reason QDir::NoDotAndDotDot doesn't work with entryInfoList, so we have to
|
||||
// check manually)
|
||||
for (int i=0;i<entry_list.size();i++) {
|
||||
if (entry_list.at(i).fileName() == "." || entry_list.at(i).fileName() == "..") {
|
||||
if (entry_list.at(i).fileName() == QStringLiteral(".")
|
||||
|| entry_list.at(i).fileName() == QStringLiteral("..")) {
|
||||
entry_list.removeAt(i);
|
||||
i--;
|
||||
}
|
||||
@@ -109,26 +110,12 @@ void ProjectImportTask::Import(Folder *folder, QFileInfoList import, int &counte
|
||||
|
||||
} else {
|
||||
|
||||
QString file_path = file_info.absoluteFilePath();
|
||||
|
||||
// FIXME: Probe will fail if a project isn't set because ImageStream and its derivatives
|
||||
// try to connect to the project's ColorManager instance
|
||||
ItemPtr item = Decoder::ProbeMedia(file_path, &IsCancelled());
|
||||
FootagePtr item = Decoder::ProbeMedia(model_->project(), file_info.absoluteFilePath(),
|
||||
&IsCancelled());
|
||||
|
||||
if (item) {
|
||||
// Setup metadata
|
||||
item->set_name(file_info.fileName());
|
||||
item->set_project(model_->project());
|
||||
|
||||
if (item->type() == Item::kFootage) {
|
||||
FootagePtr footage = std::static_pointer_cast<Footage>(item);
|
||||
|
||||
footage->set_filename(file_path);
|
||||
footage->set_timestamp(file_info.lastModified().toMSecsSinceEpoch());
|
||||
|
||||
// See if this footage is an image sequence
|
||||
ValidateImageSequence(footage, import, i);
|
||||
}
|
||||
// See if this footage is an image sequence
|
||||
ValidateImageSequence(item, import, i);
|
||||
|
||||
// Create undoable command that adds the items to the model
|
||||
new ProjectViewModel::AddItemCommand(model_,
|
||||
|
||||
@@ -18,5 +18,7 @@ set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
task/project/load/load.h
|
||||
task/project/load/load.cpp
|
||||
task/project/load/loadbasetask.h
|
||||
task/project/load/loadbasetask.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -30,14 +30,13 @@
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectLoadTask::ProjectLoadTask(const QString &filename) :
|
||||
filename_(filename)
|
||||
ProjectLoadBaseTask(filename)
|
||||
{
|
||||
SetTitle(tr("Loading '%1'").arg(filename));
|
||||
}
|
||||
|
||||
bool ProjectLoadTask::Run()
|
||||
{
|
||||
QFile project_file(filename_);
|
||||
QFile project_file(GetFilename());
|
||||
|
||||
if (project_file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
QXmlStreamReader reader(&project_file);
|
||||
@@ -62,7 +61,7 @@ bool ProjectLoadTask::Run()
|
||||
} else if (reader.name() == QStringLiteral("project")) {
|
||||
project_ = std::make_shared<Project>();
|
||||
|
||||
project_->set_filename(filename_);
|
||||
project_->set_filename(GetFilename());
|
||||
|
||||
project_->Load(&reader, &layout_info_, &IsCancelled());
|
||||
|
||||
@@ -95,7 +94,7 @@ bool ProjectLoadTask::Run()
|
||||
}
|
||||
|
||||
} else {
|
||||
SetError(tr("Failed to read file \"%1\" for reading.").arg(filename_));
|
||||
SetError(tr("Failed to read file \"%1\" for reading.").arg(GetFilename()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,50 +21,20 @@
|
||||
#ifndef PROJECTLOADMANAGER_H
|
||||
#define PROJECTLOADMANAGER_H
|
||||
|
||||
#include "project/project.h"
|
||||
#include "task/task.h"
|
||||
#include "loadbasetask.h"
|
||||
#include "window/mainwindow/mainwindowlayoutinfo.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class ProjectLoadTask : public Task
|
||||
class ProjectLoadTask : public ProjectLoadBaseTask
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProjectLoadTask(const QString& filename);
|
||||
|
||||
ProjectPtr GetLoadedProject() const
|
||||
{
|
||||
return project_;
|
||||
}
|
||||
|
||||
MainWindowLayoutInfo GetLoadedLayout() const
|
||||
{
|
||||
return layout_info_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the filename the project was saved as, but not necessarily where it is now
|
||||
*
|
||||
* May help for resolving relative paths.
|
||||
*/
|
||||
const QString& GetFilenameProjectWasSavedAs() const
|
||||
{
|
||||
return project_saved_url_;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
private:
|
||||
ProjectPtr project_;
|
||||
|
||||
MainWindowLayoutInfo layout_info_;
|
||||
|
||||
QString project_saved_url_;
|
||||
|
||||
QString filename_;
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "loadbasetask.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectLoadBaseTask::ProjectLoadBaseTask(const QString &filename) :
|
||||
project_(nullptr),
|
||||
filename_(filename)
|
||||
{
|
||||
SetTitle(tr("Loading '%1'").arg(filename));
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
@@ -0,0 +1,74 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PROJECTLOADBASETASK_H
|
||||
#define PROJECTLOADBASETASK_H
|
||||
|
||||
#include "project/project.h"
|
||||
#include "task/task.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class ProjectLoadBaseTask : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProjectLoadBaseTask(const QString& filename);
|
||||
|
||||
ProjectPtr GetLoadedProject() const
|
||||
{
|
||||
return project_;
|
||||
}
|
||||
|
||||
MainWindowLayoutInfo GetLoadedLayout() const
|
||||
{
|
||||
return layout_info_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the filename the project was saved as, but not necessarily where it is now
|
||||
*
|
||||
* May help for resolving relative paths.
|
||||
*/
|
||||
const QString& GetFilenameProjectWasSavedAs() const
|
||||
{
|
||||
return project_saved_url_;
|
||||
}
|
||||
|
||||
const QString& GetFilename() const
|
||||
{
|
||||
return filename_;
|
||||
}
|
||||
|
||||
protected:
|
||||
ProjectPtr project_;
|
||||
|
||||
MainWindowLayoutInfo layout_info_;
|
||||
|
||||
QString project_saved_url_;
|
||||
|
||||
private:
|
||||
QString filename_;
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // LOADBASETASK_H
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
codec/otio/otiodecoder.h
|
||||
codec/otio/otiodecoder.cpp
|
||||
task/project/loadotio/loadotio.h
|
||||
task/project/loadotio/loadotio.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -0,0 +1,212 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "loadotio.h"
|
||||
|
||||
#include <opentimelineio/clip.h>
|
||||
#include <opentimelineio/externalReference.h>
|
||||
#include <opentimelineio/gap.h>
|
||||
#include <opentimelineio/serializableCollection.h>
|
||||
#include <opentimelineio/timeline.h>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/block/gap/gap.h"
|
||||
#include "node/input/media/audio/audio.h"
|
||||
#include "node/input/media/video/video.h"
|
||||
#include "project/item/folder/folder.h"
|
||||
#include "project/item/sequence/sequence.h"
|
||||
|
||||
#define OTIO opentimelineio::v1_0
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
LoadOTIOTask::LoadOTIOTask(const QString& s) :
|
||||
ProjectLoadBaseTask(s)
|
||||
{
|
||||
}
|
||||
|
||||
bool LoadOTIOTask::Run()
|
||||
{
|
||||
OTIO::ErrorStatus es;
|
||||
|
||||
auto root = OTIO::SerializableObjectWithMetadata::from_json_file(GetFilename().toStdString(), &es);
|
||||
|
||||
if (es != OTIO::ErrorStatus::OK) {
|
||||
SetError(tr("Failed to load OpenTimelineIO from file \"%1\"").arg(GetFilename()));
|
||||
return false;
|
||||
}
|
||||
|
||||
project_ = std::make_shared<Project>();
|
||||
project_->set_filename(GetFilename());
|
||||
|
||||
std::vector<OTIO::Timeline*> timelines;
|
||||
|
||||
if (root->schema_name() == "SerializableCollection") {
|
||||
// This is a number of timelines
|
||||
std::vector<OTIO::SerializableObject::Retainer<OTIO::SerializableObject>>& root_children = static_cast<OTIO::SerializableCollection*>(root)->children();
|
||||
|
||||
timelines.resize(root_children.size());
|
||||
for (size_t j=0; j<root_children.size(); j++) {
|
||||
timelines[j] = static_cast<OTIO::Timeline*>(root_children[j].value);
|
||||
}
|
||||
} else if (root->schema_name() == "Timeline") {
|
||||
// This is a single timeline
|
||||
timelines.push_back(static_cast<OTIO::Timeline*>(root));
|
||||
} else {
|
||||
// Unknown root, we don't know what to do with this
|
||||
SetError(tr("Unknown OpenTimelineIO root element"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Keep track of imported footage
|
||||
QMap<QString, FootagePtr> imported_footage;
|
||||
|
||||
foreach (auto timeline, timelines) {
|
||||
SequencePtr sequence = std::make_shared<Sequence>();
|
||||
sequence->set_name(QString::fromStdString(timeline->name()));
|
||||
project_->root()->add_child(sequence);
|
||||
|
||||
ViewerOutput* seq_viewer = sequence->viewer_output();
|
||||
|
||||
// FIXME: As far as I know, OTIO doesn't store video/audio parameters?
|
||||
sequence->set_default_parameters();
|
||||
|
||||
for (auto c : timeline->tracks()->children()) {
|
||||
auto otio_track = static_cast<OTIO::Track*>(c.value);
|
||||
|
||||
// Create a new track
|
||||
TrackOutput* track = nullptr;
|
||||
|
||||
// Determine what kind of track it is
|
||||
if (otio_track->kind() == "Video") {
|
||||
track = seq_viewer->track_list(Timeline::kTrackTypeVideo)->AddTrack();
|
||||
|
||||
if (seq_viewer->track_list(Timeline::kTrackTypeVideo)->GetTrackCount() == 1) {
|
||||
// If this is the first track, connect it to the viewer
|
||||
NodeParam::ConnectEdge(track->output(), seq_viewer->texture_input());
|
||||
}
|
||||
} else if (otio_track->kind() == "Audio") {
|
||||
track = seq_viewer->track_list(Timeline::kTrackTypeAudio)->AddTrack();
|
||||
|
||||
if (seq_viewer->track_list(Timeline::kTrackTypeAudio)->GetTrackCount() == 1) {
|
||||
// If this is the first track, connect it to the viewer
|
||||
NodeParam::ConnectEdge(track->output(), seq_viewer->samples_input());
|
||||
}
|
||||
} else {
|
||||
qWarning() << "Found unknown track type:" << otio_track->kind().c_str();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get clips from track
|
||||
auto clip_map = otio_track->children();
|
||||
if (es != OTIO::ErrorStatus::OK) {
|
||||
SetError(tr("Failed to load clip"));
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto otio_block_retainer : clip_map) {
|
||||
|
||||
auto otio_block = otio_block_retainer.value;
|
||||
|
||||
Block* block = nullptr;
|
||||
|
||||
if (otio_block->schema_name() == "Clip") {
|
||||
|
||||
block = new ClipBlock();
|
||||
|
||||
} else if (otio_block->schema_name() == "Gap") {
|
||||
|
||||
block = new GapBlock();
|
||||
|
||||
} else {
|
||||
|
||||
// We don't know what this is yet, just create a gap for now so that *something* is there
|
||||
qWarning() << "Found unknown block type:" << otio_block->schema_name().c_str();
|
||||
block = new GapBlock();
|
||||
|
||||
}
|
||||
|
||||
block->SetLabel(QString::fromStdString(otio_block->name()));
|
||||
|
||||
rational start_time = rational::fromDouble(static_cast<OTIO::Item*>(otio_block)->source_range()->start_time().to_seconds());
|
||||
rational duration = rational::fromDouble(static_cast<OTIO::Item*>(otio_block)->source_range()->duration().to_seconds());
|
||||
|
||||
block->set_media_in(start_time);
|
||||
block->set_length_and_media_out(duration);
|
||||
sequence->AddNode(block);
|
||||
track->AppendBlock(block);
|
||||
|
||||
if (otio_block->schema_name() == "Clip") {
|
||||
auto otio_clip = static_cast<OTIO::Clip*>(otio_block);
|
||||
|
||||
if (otio_clip->media_reference()->schema_name() == "ExternalReference") {
|
||||
// Link footage
|
||||
QString footage_url = QString::fromStdString(static_cast<OTIO::ExternalReference*>(otio_clip->media_reference())->target_url());
|
||||
|
||||
FootagePtr probed_item;
|
||||
|
||||
if (imported_footage.contains(footage_url)) {
|
||||
probed_item = imported_footage.value(footage_url);
|
||||
} else {
|
||||
probed_item = Decoder::ProbeMedia(project_.get(), footage_url, &IsCancelled());
|
||||
imported_footage.insert(footage_url, probed_item);
|
||||
project_->root()->add_child(probed_item);
|
||||
}
|
||||
|
||||
if (probed_item && probed_item->type() == Item::kFootage) {
|
||||
MediaInput* media;
|
||||
if (track->track_type() == Timeline::kTrackTypeVideo) {
|
||||
media = new VideoInput();
|
||||
media->SetFootage(probed_item->get_first_stream_of_type(Stream::kVideo));
|
||||
} else {
|
||||
media = new AudioInput();
|
||||
media->SetFootage(probed_item->get_first_stream_of_type(Stream::kAudio));
|
||||
}
|
||||
sequence->AddNode(media);
|
||||
|
||||
NodeParam::ConnectEdge(media->output(), static_cast<ClipBlock*>(block)->texture_input());
|
||||
} else {
|
||||
// FIXME: Add to some kind of list that we couldn't find it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sequence->moveToThread(qApp->thread());
|
||||
}
|
||||
|
||||
// Ugly hack to move footage streams to main thread
|
||||
/*foreach (ItemPtr item, imported_footage) {
|
||||
if (item && item->type() == Item::kFootage) {
|
||||
foreach (StreamPtr stream, std::static_pointer_cast<Footage>(item)->streams()) {
|
||||
stream->moveToThread(qApp->thread());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
project_->moveToThread(qApp->thread());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
@@ -21,22 +21,19 @@
|
||||
#ifndef OTIODECODER_H
|
||||
#define OTIODECODER_H
|
||||
|
||||
#include "codec/decoder.h"
|
||||
#include "project/project.h"
|
||||
#include "task/project/load/loadbasetask.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class OTIODecoder : public Decoder
|
||||
class LoadOTIOTask : public ProjectLoadBaseTask
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
OTIODecoder();
|
||||
LoadOTIOTask(const QString& filename);
|
||||
|
||||
virtual QString id() override;
|
||||
|
||||
virtual bool Open() override {return false;}
|
||||
virtual void Close() override {}
|
||||
|
||||
virtual ItemPtr Probe(const QString& filename, const QAtomicInt* cancelled) const override;
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
};
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
task/project/exportotio/exportotiotask.h
|
||||
task/project/exportotio/exportotiotask.cpp
|
||||
task/project/saveotio/saveotio.h
|
||||
task/project/saveotio/saveotio.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
+9
-10
@@ -18,7 +18,7 @@
|
||||
|
||||
***/
|
||||
|
||||
#include "exportotiotask.h"
|
||||
#include "saveotio.h"
|
||||
|
||||
#include <opentimelineio/clip.h>
|
||||
#include <opentimelineio/externalReference.h>
|
||||
@@ -31,14 +31,13 @@
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ExportOTIOTask::ExportOTIOTask(ProjectPtr project, const QString &filename) :
|
||||
project_(project),
|
||||
filename_(filename)
|
||||
SaveOTIOTask::SaveOTIOTask(ProjectPtr project) :
|
||||
project_(project)
|
||||
{
|
||||
SetTitle(tr("Exporting project to OpenTimelineIO"));
|
||||
}
|
||||
|
||||
bool ExportOTIOTask::Run()
|
||||
bool SaveOTIOTask::Run()
|
||||
{
|
||||
QList<ItemPtr> sequences = project_->get_items_of_type(Item::kSequence);
|
||||
|
||||
@@ -75,12 +74,12 @@ bool ExportOTIOTask::Run()
|
||||
if (serialized.size() == 1) {
|
||||
// Serialize timeline on its own
|
||||
auto t = serialized.front();
|
||||
t->to_json_file(filename_.toStdString(), &es);
|
||||
t->to_json_file(project_->filename().toStdString(), &es);
|
||||
t->possibly_delete();
|
||||
} else {
|
||||
// Serialize all into a SerializableCollection
|
||||
auto collection = new opentimelineio::v1_0::SerializableCollection("Sequences", serialized);
|
||||
collection->to_json_file(filename_.toStdString(), &es);
|
||||
collection->to_json_file(project_->filename().toStdString(), &es);
|
||||
collection->possibly_delete();
|
||||
|
||||
// Delete all existing timelines
|
||||
@@ -92,7 +91,7 @@ bool ExportOTIOTask::Run()
|
||||
return (es == opentimelineio::v1_0::ErrorStatus::OK);
|
||||
}
|
||||
|
||||
opentimelineio::v1_0::Timeline *ExportOTIOTask::SerializeTimeline(SequencePtr sequence)
|
||||
opentimelineio::v1_0::Timeline *SaveOTIOTask::SerializeTimeline(SequencePtr sequence)
|
||||
{
|
||||
auto otio_timeline = new opentimelineio::v1_0::Timeline(sequence->name().toStdString());
|
||||
|
||||
@@ -105,7 +104,7 @@ opentimelineio::v1_0::Timeline *ExportOTIOTask::SerializeTimeline(SequencePtr se
|
||||
return otio_timeline;
|
||||
}
|
||||
|
||||
opentimelineio::v1_0::Track *ExportOTIOTask::SerializeTrack(TrackOutput *track)
|
||||
opentimelineio::v1_0::Track *SaveOTIOTask::SerializeTrack(TrackOutput *track)
|
||||
{
|
||||
auto otio_track = new opentimelineio::v1_0::Track();
|
||||
|
||||
@@ -185,7 +184,7 @@ fail:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ExportOTIOTask::SerializeTrackList(TrackList *list, opentimelineio::v1_0::Timeline* otio_timeline)
|
||||
bool SaveOTIOTask::SerializeTrackList(TrackList *list, opentimelineio::v1_0::Timeline* otio_timeline)
|
||||
{
|
||||
opentimelineio::v1_0::ErrorStatus es;
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class ExportOTIOTask : public Task
|
||||
class SaveOTIOTask : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExportOTIOTask(ProjectPtr project, const QString& filename);
|
||||
SaveOTIOTask(ProjectPtr project);
|
||||
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
@@ -47,8 +47,6 @@ private:
|
||||
|
||||
ProjectPtr project_;
|
||||
|
||||
QString filename_;
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
@@ -1166,6 +1166,9 @@ void ViewerWidget::UpdateRendererVideoParameters()
|
||||
|
||||
renderer_->SetVideoParams(GetConnectedNode()->video_params());
|
||||
|
||||
// In case the user is pressing the mouse at this exact moment
|
||||
renderer_->IgnoreNextMouseButton();
|
||||
|
||||
GetConnectedNode()->video_frame_cache()->InvalidateAll();
|
||||
|
||||
display_widget_->SetVideoParams(GetConnectedNode()->video_params());
|
||||
|
||||
@@ -62,10 +62,6 @@ MainMenu::MainMenu(MainWindow *parent) :
|
||||
file_menu_->addSeparator();
|
||||
file_export_menu_ = new Menu(file_menu_);
|
||||
file_export_media_item_ = file_export_menu_->AddItem("export", Core::instance(), &Core::DialogExportShow, "Ctrl+M");
|
||||
#ifdef USE_OTIO
|
||||
file_export_menu_->addSeparator();
|
||||
file_export_otio_item_ = file_export_menu_->AddItem("exportotio", Core::instance(), &Core::ExportActiveSequenceAsOTIO);
|
||||
#endif
|
||||
file_menu_->addSeparator();
|
||||
file_project_properties_item_ = file_menu_->AddItem("projectproperties", Core::instance(), &Core::DialogProjectPropertiesShow, "Shift+F10");
|
||||
file_menu_->addSeparator();
|
||||
@@ -606,9 +602,6 @@ void MainMenu::Retranslate()
|
||||
file_import_item_->setText(tr("&Import..."));
|
||||
file_export_menu_->setTitle(tr("&Export"));
|
||||
file_export_media_item_->setText(tr("&Media..."));
|
||||
#ifdef USE_OTIO
|
||||
file_export_otio_item_->setText(tr("&OpenTimelineIO..."));
|
||||
#endif
|
||||
file_project_properties_item_->setText(tr("&Project Properties..."));
|
||||
file_close_all_projects_item_->setText(tr("Close All Projects"));
|
||||
file_exit_item_->setText(tr("E&xit"));
|
||||
|
||||
@@ -192,9 +192,6 @@ private:
|
||||
QAction* file_import_item_;
|
||||
Menu* file_export_menu_;
|
||||
QAction* file_export_media_item_;
|
||||
#ifdef USE_OTIO
|
||||
QAction* file_export_otio_item_;
|
||||
#endif
|
||||
QAction* file_project_properties_item_;
|
||||
QAction* file_close_project_item_;
|
||||
QAction* file_close_all_projects_item_;
|
||||
|
||||
Reference in New Issue
Block a user