merged video and audio nodes into a single media node
They performed exactly the same function so I don't think we need the clutter. Also bumped the project version, but old projects are automatically converted.
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@
|
|||||||
namespace olive {
|
namespace olive {
|
||||||
|
|
||||||
Core* Core::instance_ = nullptr;
|
Core* Core::instance_ = nullptr;
|
||||||
const uint Core::kProjectVersion = 201003;
|
const uint Core::kProjectVersion = 201118;
|
||||||
|
|
||||||
Core::Core(const CoreParams& params) :
|
Core::Core(const CoreParams& params) :
|
||||||
main_window_(nullptr),
|
main_window_(nullptr),
|
||||||
|
|||||||
@@ -32,8 +32,7 @@
|
|||||||
#include "generator/text/text.h"
|
#include "generator/text/text.h"
|
||||||
#include "filter/blur/blur.h"
|
#include "filter/blur/blur.h"
|
||||||
#include "filter/stroke/stroke.h"
|
#include "filter/stroke/stroke.h"
|
||||||
#include "input/media/video/video.h"
|
#include "input/media/media.h"
|
||||||
#include "input/media/audio/audio.h"
|
|
||||||
#include "input/time/timeinput.h"
|
#include "input/time/timeinput.h"
|
||||||
#include "math/math/math.h"
|
#include "math/math/math.h"
|
||||||
#include "math/merge/merge.h"
|
#include "math/merge/merge.h"
|
||||||
@@ -183,10 +182,8 @@ Node *NodeFactory::CreateFromFactoryIndex(const NodeFactory::InternalID &id)
|
|||||||
return new PolygonGenerator();
|
return new PolygonGenerator();
|
||||||
case kMatrixGenerator:
|
case kMatrixGenerator:
|
||||||
return new MatrixGenerator();
|
return new MatrixGenerator();
|
||||||
case kVideoInput:
|
case kFootageInput:
|
||||||
return new VideoInput();
|
return new MediaInput();
|
||||||
case kAudioInput:
|
|
||||||
return new AudioInput();
|
|
||||||
case kTrackOutput:
|
case kTrackOutput:
|
||||||
return new TrackOutput();
|
return new TrackOutput();
|
||||||
case kViewerOutput:
|
case kViewerOutput:
|
||||||
|
|||||||
+1
-2
@@ -35,10 +35,9 @@ public:
|
|||||||
kViewerOutput,
|
kViewerOutput,
|
||||||
kClipBlock,
|
kClipBlock,
|
||||||
kGapBlock,
|
kGapBlock,
|
||||||
kAudioInput,
|
|
||||||
kPolygonGenerator,
|
kPolygonGenerator,
|
||||||
kMatrixGenerator,
|
kMatrixGenerator,
|
||||||
kVideoInput,
|
kFootageInput,
|
||||||
kTrackOutput,
|
kTrackOutput,
|
||||||
kAudioVolume,
|
kAudioVolume,
|
||||||
kAudioPanning,
|
kAudioPanning,
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
add_subdirectory(audio)
|
|
||||||
add_subdirectory(video)
|
|
||||||
|
|
||||||
set(OLIVE_SOURCES
|
set(OLIVE_SOURCES
|
||||||
${OLIVE_SOURCES}
|
${OLIVE_SOURCES}
|
||||||
node/input/media/media.h
|
node/input/media/media.h
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# Olive - Non-Linear Video Editor
|
|
||||||
# Copyright (C) 2020 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/>.
|
|
||||||
|
|
||||||
set(OLIVE_SOURCES
|
|
||||||
${OLIVE_SOURCES}
|
|
||||||
node/input/media/audio/audio.h
|
|
||||||
node/input/media/audio/audio.cpp
|
|
||||||
PARENT_SCOPE
|
|
||||||
)
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
/***
|
|
||||||
|
|
||||||
Olive - Non-Linear Video Editor
|
|
||||||
Copyright (C) 2020 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 "audio.h"
|
|
||||||
|
|
||||||
namespace olive {
|
|
||||||
|
|
||||||
Node *AudioInput::copy() const
|
|
||||||
{
|
|
||||||
return new AudioInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
Stream::Type AudioInput::type() const
|
|
||||||
{
|
|
||||||
return Stream::kAudio;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString AudioInput::Name() const
|
|
||||||
{
|
|
||||||
return tr("Audio Input");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString AudioInput::ShortName() const
|
|
||||||
{
|
|
||||||
return tr("Audio");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString AudioInput::id() const
|
|
||||||
{
|
|
||||||
return QStringLiteral("org.olivevideoeditor.Olive.audioinput");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString AudioInput::Description() const
|
|
||||||
{
|
|
||||||
return tr("Import an audio footage stream.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/***
|
|
||||||
|
|
||||||
Olive - Non-Linear Video Editor
|
|
||||||
Copyright (C) 2020 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 AUDIOINPUT_H
|
|
||||||
#define AUDIOINPUT_H
|
|
||||||
|
|
||||||
#include "../media.h"
|
|
||||||
|
|
||||||
namespace olive {
|
|
||||||
|
|
||||||
class AudioInput : public MediaInput
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
AudioInput() = default;
|
|
||||||
|
|
||||||
virtual Node* copy() const override;
|
|
||||||
|
|
||||||
virtual Stream::Type type() const override;
|
|
||||||
|
|
||||||
virtual QString Name() const override;
|
|
||||||
virtual QString ShortName() const override;
|
|
||||||
virtual QString id() const override;
|
|
||||||
virtual QString Description() const override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // AUDIOINPUT_H
|
|
||||||
@@ -57,7 +57,7 @@ bool MediaInput::IsMedia() const
|
|||||||
|
|
||||||
void MediaInput::Retranslate()
|
void MediaInput::Retranslate()
|
||||||
{
|
{
|
||||||
footage_input_->set_name(tr("Footage"));
|
footage_input_->set_name(tr("Media"));
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeValueTable MediaInput::Value(NodeValueDatabase &value) const
|
NodeValueTable MediaInput::Value(NodeValueDatabase &value) const
|
||||||
|
|||||||
@@ -36,7 +36,25 @@ class MediaInput : public Node
|
|||||||
public:
|
public:
|
||||||
MediaInput();
|
MediaInput();
|
||||||
|
|
||||||
virtual Stream::Type type() const = 0;
|
virtual QString Name() const override
|
||||||
|
{
|
||||||
|
return tr("Media");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual QString id() const override
|
||||||
|
{
|
||||||
|
return QStringLiteral("org.olivevideoeditor.Olive.mediainput");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual QString Description() const override
|
||||||
|
{
|
||||||
|
return tr("Import footage into the node graph.");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual Node* copy() const override
|
||||||
|
{
|
||||||
|
return new MediaInput();
|
||||||
|
}
|
||||||
|
|
||||||
virtual QVector<CategoryID> Category() const override;
|
virtual QVector<CategoryID> Category() const override;
|
||||||
|
|
||||||
@@ -45,7 +63,6 @@ public:
|
|||||||
|
|
||||||
virtual bool IsMedia() const override;
|
virtual bool IsMedia() const override;
|
||||||
|
|
||||||
|
|
||||||
virtual void Retranslate() override;
|
virtual void Retranslate() override;
|
||||||
|
|
||||||
virtual NodeValueTable Value(NodeValueDatabase& value) const override;
|
virtual NodeValueTable Value(NodeValueDatabase& value) const override;
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# Olive - Non-Linear Video Editor
|
|
||||||
# Copyright (C) 2020 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/>.
|
|
||||||
|
|
||||||
set(OLIVE_SOURCES
|
|
||||||
${OLIVE_SOURCES}
|
|
||||||
node/input/media/video/video.h
|
|
||||||
node/input/media/video/video.cpp
|
|
||||||
PARENT_SCOPE
|
|
||||||
)
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
/***
|
|
||||||
|
|
||||||
Olive - Non-Linear Video Editor
|
|
||||||
Copyright (C) 2020 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 "video.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QMatrix4x4>
|
|
||||||
#include <QOpenGLPixelTransferOptions>
|
|
||||||
|
|
||||||
#include "codec/ffmpeg/ffmpegdecoder.h"
|
|
||||||
#include "core.h"
|
|
||||||
#include "project/item/footage/footage.h"
|
|
||||||
|
|
||||||
namespace olive {
|
|
||||||
|
|
||||||
Node *VideoInput::copy() const
|
|
||||||
{
|
|
||||||
return new VideoInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
Stream::Type VideoInput::type() const
|
|
||||||
{
|
|
||||||
return Stream::kVideo;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VideoInput::Name() const
|
|
||||||
{
|
|
||||||
return tr("Video Input");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VideoInput::ShortName() const
|
|
||||||
{
|
|
||||||
return tr("Video");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VideoInput::id() const
|
|
||||||
{
|
|
||||||
return QStringLiteral("org.olivevideoeditor.Olive.videoinput");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VideoInput::Description() const
|
|
||||||
{
|
|
||||||
return tr("Import a video footage stream.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/***
|
|
||||||
|
|
||||||
Olive - Non-Linear Video Editor
|
|
||||||
Copyright (C) 2020 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 VIDEOINPUT_H
|
|
||||||
#define VIDEOINPUT_H
|
|
||||||
|
|
||||||
#include <QOpenGLTexture>
|
|
||||||
|
|
||||||
#include "../media.h"
|
|
||||||
#include "render/colormanager.h"
|
|
||||||
|
|
||||||
namespace olive {
|
|
||||||
|
|
||||||
class VideoInput : public MediaInput
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
VideoInput() = default;
|
|
||||||
|
|
||||||
virtual Node* copy() const override;
|
|
||||||
|
|
||||||
virtual Stream::Type type() const override;
|
|
||||||
|
|
||||||
virtual QString Name() const override;
|
|
||||||
virtual QString ShortName() const override;
|
|
||||||
virtual QString id() const override;
|
|
||||||
virtual QString Description() const override;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // VIDEOINPUT_H
|
|
||||||
@@ -42,7 +42,7 @@ QIcon Folder::icon()
|
|||||||
return icon::Folder;
|
return icon::Folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Folder::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const QAtomicInt *cancelled)
|
void Folder::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint version, const QAtomicInt *cancelled)
|
||||||
{
|
{
|
||||||
XMLAttributeLoop(reader, attr) {
|
XMLAttributeLoop(reader, attr) {
|
||||||
if (cancelled && *cancelled) {
|
if (cancelled && *cancelled) {
|
||||||
@@ -75,7 +75,7 @@ void Folder::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const QA
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_child(child);
|
add_child(child);
|
||||||
child->Load(reader, xml_node_data, cancelled);
|
child->Load(reader, xml_node_data, version, cancelled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
virtual QIcon icon() override;
|
virtual QIcon icon() override;
|
||||||
|
|
||||||
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, const QAtomicInt *cancelled) override;
|
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, uint version, const QAtomicInt *cancelled) override;
|
||||||
|
|
||||||
virtual void Save(QXmlStreamWriter* writer) const override;
|
virtual void Save(QXmlStreamWriter* writer) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Footage::~Footage()
|
|||||||
ClearStreams();
|
ClearStreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Footage::Load(QXmlStreamReader *reader, XMLNodeData &xml_node_data, const QAtomicInt* cancelled)
|
void Footage::Load(QXmlStreamReader *reader, XMLNodeData &xml_node_data, uint version, const QAtomicInt* cancelled)
|
||||||
{
|
{
|
||||||
while (XMLReadNextStartElement(reader)) {
|
while (XMLReadNextStartElement(reader)) {
|
||||||
if (cancelled && *cancelled) {
|
if (cancelled && *cancelled) {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Load function
|
* @brief Load function
|
||||||
*/
|
*/
|
||||||
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, const QAtomicInt *cancelled) override;
|
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, uint version, const QAtomicInt *cancelled) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Save function
|
* @brief Save function
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
|
|
||||||
DISABLE_COPY_MOVE(Item)
|
DISABLE_COPY_MOVE(Item)
|
||||||
|
|
||||||
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, const QAtomicInt *cancelled) = 0;
|
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, uint version, const QAtomicInt *cancelled) = 0;
|
||||||
|
|
||||||
virtual void Save(QXmlStreamWriter* writer) const = 0;
|
virtual void Save(QXmlStreamWriter* writer) const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Sequence::Sequence()
|
|||||||
AddNode(viewer_output_);
|
AddNode(viewer_output_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const QAtomicInt *cancelled)
|
void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint version, const QAtomicInt *cancelled)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
XMLAttributeLoop(reader, attr) {
|
XMLAttributeLoop(reader, attr) {
|
||||||
@@ -130,7 +130,16 @@ void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const
|
|||||||
{
|
{
|
||||||
XMLAttributeLoop(reader, attr) {
|
XMLAttributeLoop(reader, attr) {
|
||||||
if (attr.name() == QStringLiteral("id")) {
|
if (attr.name() == QStringLiteral("id")) {
|
||||||
node = NodeFactory::CreateFromID(attr.value().toString());
|
QString id = attr.value().toString();
|
||||||
|
if (version <= 201003) {
|
||||||
|
// After version 201003, the video and audio nodes were merged into one media node
|
||||||
|
if (id == QStringLiteral("org.olivevideoeditor.Olive.audioinput")
|
||||||
|
|| id == QStringLiteral("org.olivevideoeditor.Olive.videoinput")) {
|
||||||
|
id = QStringLiteral("org.olivevideoeditor.Olive.mediainput");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
node = NodeFactory::CreateFromID(id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Load function
|
* @brief Load function
|
||||||
*/
|
*/
|
||||||
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, const QAtomicInt* cancelled) override;
|
virtual void Load(QXmlStreamReader* reader, XMLNodeData &xml_node_data, uint version, const QAtomicInt* cancelled) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Save function
|
* @brief Save function
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ Project::Project() :
|
|||||||
this, &Project::DefaultColorSpaceChanged);
|
this, &Project::DefaultColorSpaceChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::Load(QXmlStreamReader *reader, MainWindowLayoutInfo* layout, const QAtomicInt* cancelled)
|
void Project::Load(QXmlStreamReader *reader, MainWindowLayoutInfo* layout, uint version, const QAtomicInt* cancelled)
|
||||||
{
|
{
|
||||||
XMLNodeData xml_node_data;
|
XMLNodeData xml_node_data;
|
||||||
|
|
||||||
while (XMLReadNextStartElement(reader)) {
|
while (XMLReadNextStartElement(reader)) {
|
||||||
if (reader->name() == QStringLiteral("root")) {
|
if (reader->name() == QStringLiteral("root")) {
|
||||||
|
|
||||||
root_.Load(reader, xml_node_data, cancelled);
|
root_.Load(reader, xml_node_data, version, cancelled);
|
||||||
|
|
||||||
} else if (reader->name() == QStringLiteral("colormanagement")) {
|
} else if (reader->name() == QStringLiteral("colormanagement")) {
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class Project : public QObject
|
|||||||
public:
|
public:
|
||||||
Project();
|
Project();
|
||||||
|
|
||||||
void Load(QXmlStreamReader* reader, MainWindowLayoutInfo *layout, const QAtomicInt* cancelled);
|
void Load(QXmlStreamReader* reader, MainWindowLayoutInfo *layout, uint version, const QAtomicInt* cancelled);
|
||||||
|
|
||||||
void Save(QXmlStreamWriter* writer) const;
|
void Save(QXmlStreamWriter* writer) const;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ PreCacheTask::PreCacheTask(VideoStreamPtr footage, Sequence* sequence) :
|
|||||||
viewer()->set_video_params(sequence->video_params());
|
viewer()->set_video_params(sequence->video_params());
|
||||||
viewer()->set_audio_params(sequence->audio_params());
|
viewer()->set_audio_params(sequence->audio_params());
|
||||||
|
|
||||||
video_node_ = new VideoInput();
|
video_node_ = new MediaInput();
|
||||||
video_node_->SetStream(footage);
|
video_node_->SetStream(footage);
|
||||||
|
|
||||||
NodeParam::ConnectEdge(video_node_->output(), viewer()->texture_input());
|
NodeParam::ConnectEdge(video_node_->output(), viewer()->texture_input());
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#ifndef PRECACHETASK_H
|
#ifndef PRECACHETASK_H
|
||||||
#define PRECACHETASK_H
|
#define PRECACHETASK_H
|
||||||
|
|
||||||
#include "node/input/media/video/video.h"
|
#include "node/input/media/media.h"
|
||||||
#include "project/item/footage/footage.h"
|
#include "project/item/footage/footage.h"
|
||||||
#include "project/item/sequence/sequence.h"
|
#include "project/item/sequence/sequence.h"
|
||||||
#include "task/render/render.h"
|
#include "task/render/render.h"
|
||||||
@@ -46,7 +46,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
VideoStreamPtr footage_;
|
VideoStreamPtr footage_;
|
||||||
|
|
||||||
VideoInput* video_node_;
|
MediaInput* video_node_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ ProjectLoadTask::ProjectLoadTask(const QString &filename) :
|
|||||||
bool ProjectLoadTask::Run()
|
bool ProjectLoadTask::Run()
|
||||||
{
|
{
|
||||||
QFile project_file(GetFilename());
|
QFile project_file(GetFilename());
|
||||||
|
uint project_version;
|
||||||
|
|
||||||
if (project_file.open(QFile::ReadOnly | QFile::Text)) {
|
if (project_file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
QXmlStreamReader reader(&project_file);
|
QXmlStreamReader reader(&project_file);
|
||||||
@@ -45,7 +46,7 @@ bool ProjectLoadTask::Run()
|
|||||||
if (reader.name() == QStringLiteral("olive")) {
|
if (reader.name() == QStringLiteral("olive")) {
|
||||||
while(XMLReadNextStartElement(&reader)) {
|
while(XMLReadNextStartElement(&reader)) {
|
||||||
if (reader.name() == QStringLiteral("version")) {
|
if (reader.name() == QStringLiteral("version")) {
|
||||||
uint project_version = reader.readElementText().toUInt();
|
project_version = reader.readElementText().toUInt();
|
||||||
|
|
||||||
if (project_version > Core::kProjectVersion) {
|
if (project_version > Core::kProjectVersion) {
|
||||||
// Project is newer than we support
|
// Project is newer than we support
|
||||||
@@ -63,7 +64,7 @@ bool ProjectLoadTask::Run()
|
|||||||
|
|
||||||
project_->set_filename(GetFilename());
|
project_->set_filename(GetFilename());
|
||||||
|
|
||||||
project_->Load(&reader, &layout_info_, &IsCancelled());
|
project_->Load(&reader, &layout_info_, project_version, &IsCancelled());
|
||||||
|
|
||||||
// Ensure project is in main thread
|
// Ensure project is in main thread
|
||||||
project_->moveToThread(qApp->thread());
|
project_->moveToThread(qApp->thread());
|
||||||
|
|||||||
@@ -29,8 +29,7 @@
|
|||||||
|
|
||||||
#include "node/block/clip/clip.h"
|
#include "node/block/clip/clip.h"
|
||||||
#include "node/block/gap/gap.h"
|
#include "node/block/gap/gap.h"
|
||||||
#include "node/input/media/audio/audio.h"
|
#include "node/input/media/media.h"
|
||||||
#include "node/input/media/video/video.h"
|
|
||||||
#include "project/item/folder/folder.h"
|
#include "project/item/folder/folder.h"
|
||||||
#include "project/item/sequence/sequence.h"
|
#include "project/item/sequence/sequence.h"
|
||||||
|
|
||||||
@@ -172,12 +171,10 @@ bool LoadOTIOTask::Run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (probed_item && probed_item->type() == Item::kFootage) {
|
if (probed_item && probed_item->type() == Item::kFootage) {
|
||||||
MediaInput* media;
|
MediaInput* media = new MediaInput();
|
||||||
if (track->track_type() == Timeline::kTrackTypeVideo) {
|
if (track->track_type() == Timeline::kTrackTypeVideo) {
|
||||||
media = new VideoInput();
|
|
||||||
media->SetStream(probed_item->get_first_stream_of_type(Stream::kVideo));
|
media->SetStream(probed_item->get_first_stream_of_type(Stream::kVideo));
|
||||||
} else {
|
} else {
|
||||||
media = new AudioInput();
|
|
||||||
media->SetStream(probed_item->get_first_stream_of_type(Stream::kAudio));
|
media->SetStream(probed_item->get_first_stream_of_type(Stream::kAudio));
|
||||||
}
|
}
|
||||||
sequence->AddNode(media);
|
sequence->AddNode(media);
|
||||||
|
|||||||
@@ -31,8 +31,7 @@
|
|||||||
#include "dialog/sequence/sequence.h"
|
#include "dialog/sequence/sequence.h"
|
||||||
#include "node/audio/volume/volume.h"
|
#include "node/audio/volume/volume.h"
|
||||||
#include "node/generator/matrix/matrix.h"
|
#include "node/generator/matrix/matrix.h"
|
||||||
#include "node/input/media/audio/audio.h"
|
#include "node/input/media/media.h"
|
||||||
#include "node/input/media/video/video.h"
|
|
||||||
#include "node/math/math/math.h"
|
#include "node/math/math/math.h"
|
||||||
#include "project/item/sequence/sequence.h"
|
#include "project/item/sequence/sequence.h"
|
||||||
#include "widget/nodeview/nodeviewundo.h"
|
#include "widget/nodeview/nodeviewundo.h"
|
||||||
@@ -416,7 +415,7 @@ void ImportTool::DropGhosts(bool insert)
|
|||||||
switch (footage_stream->type()) {
|
switch (footage_stream->type()) {
|
||||||
case Stream::kVideo:
|
case Stream::kVideo:
|
||||||
{
|
{
|
||||||
VideoInput* video_input = new VideoInput();
|
MediaInput* video_input = new MediaInput();
|
||||||
video_input->SetStream(footage_stream);
|
video_input->SetStream(footage_stream);
|
||||||
new NodeAddCommand(dst_graph, video_input, command);
|
new NodeAddCommand(dst_graph, video_input, command);
|
||||||
|
|
||||||
@@ -438,7 +437,7 @@ void ImportTool::DropGhosts(bool insert)
|
|||||||
}
|
}
|
||||||
case Stream::kAudio:
|
case Stream::kAudio:
|
||||||
{
|
{
|
||||||
AudioInput* audio_input = new AudioInput();
|
MediaInput* audio_input = new MediaInput();
|
||||||
audio_input->SetStream(footage_stream);
|
audio_input->SetStream(footage_stream);
|
||||||
new NodeAddCommand(dst_graph, audio_input, command);
|
new NodeAddCommand(dst_graph, audio_input, command);
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ FootageViewerWidget::FootageViewerWidget(QWidget *parent) :
|
|||||||
ViewerWidget(parent),
|
ViewerWidget(parent),
|
||||||
footage_(nullptr)
|
footage_(nullptr)
|
||||||
{
|
{
|
||||||
video_node_ = new VideoInput();
|
video_node_ = new MediaInput();
|
||||||
sequence_.AddNode(video_node_);
|
sequence_.AddNode(video_node_);
|
||||||
|
|
||||||
audio_node_ = new AudioInput();
|
audio_node_ = new MediaInput();
|
||||||
sequence_.AddNode(audio_node_);
|
sequence_.AddNode(audio_node_);
|
||||||
|
|
||||||
connect(display_widget(), &ViewerDisplayWidget::DragStarted, this, &FootageViewerWidget::StartFootageDrag);
|
connect(display_widget(), &ViewerDisplayWidget::DragStarted, this, &FootageViewerWidget::StartFootageDrag);
|
||||||
|
|||||||
@@ -21,8 +21,7 @@
|
|||||||
#ifndef FOOTAGEVIEWERWIDGET_H
|
#ifndef FOOTAGEVIEWERWIDGET_H
|
||||||
#define FOOTAGEVIEWERWIDGET_H
|
#define FOOTAGEVIEWERWIDGET_H
|
||||||
|
|
||||||
#include "node/input/media/audio/audio.h"
|
#include "node/input/media/media.h"
|
||||||
#include "node/input/media/video/video.h"
|
|
||||||
#include "node/output/viewer/viewer.h"
|
#include "node/output/viewer/viewer.h"
|
||||||
#include "viewer.h"
|
#include "viewer.h"
|
||||||
|
|
||||||
@@ -49,9 +48,9 @@ private:
|
|||||||
|
|
||||||
Sequence sequence_;
|
Sequence sequence_;
|
||||||
|
|
||||||
VideoInput* video_node_;
|
MediaInput* video_node_;
|
||||||
|
|
||||||
AudioInput* audio_node_;
|
MediaInput* audio_node_;
|
||||||
|
|
||||||
QHash<Footage*, int64_t> cached_timestamps_;
|
QHash<Footage*, int64_t> cached_timestamps_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user