From b3c3fe0fc8fd95fec6b867fdcfcded50d987274f Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 18 Nov 2020 13:48:14 +1100 Subject: [PATCH] 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. --- app/core.cpp | 2 +- app/node/factory.cpp | 9 ++-- app/node/factory.h | 3 +- app/node/input/media/CMakeLists.txt | 3 -- app/node/input/media/audio/CMakeLists.txt | 22 -------- app/node/input/media/audio/audio.cpp | 55 -------------------- app/node/input/media/audio/audio.h | 47 ----------------- app/node/input/media/media.cpp | 2 +- app/node/input/media/media.h | 21 +++++++- app/node/input/media/video/CMakeLists.txt | 22 -------- app/node/input/media/video/video.cpp | 63 ----------------------- app/node/input/media/video/video.h | 50 ------------------ app/project/item/folder/folder.cpp | 4 +- app/project/item/folder/folder.h | 2 +- app/project/item/footage/footage.cpp | 2 +- app/project/item/footage/footage.h | 2 +- app/project/item/item.h | 2 +- app/project/item/sequence/sequence.cpp | 13 ++++- app/project/item/sequence/sequence.h | 2 +- app/project/project.cpp | 4 +- app/project/project.h | 2 +- app/task/precache/precachetask.cpp | 2 +- app/task/precache/precachetask.h | 4 +- app/task/project/load/load.cpp | 5 +- app/task/project/loadotio/loadotio.cpp | 7 +-- app/widget/timelinewidget/tool/import.cpp | 7 ++- app/widget/viewer/footageviewer.cpp | 4 +- app/widget/viewer/footageviewer.h | 7 ++- 28 files changed, 62 insertions(+), 306 deletions(-) delete mode 100644 app/node/input/media/audio/CMakeLists.txt delete mode 100644 app/node/input/media/audio/audio.cpp delete mode 100644 app/node/input/media/audio/audio.h delete mode 100644 app/node/input/media/video/CMakeLists.txt delete mode 100644 app/node/input/media/video/video.cpp delete mode 100644 app/node/input/media/video/video.h diff --git a/app/core.cpp b/app/core.cpp index 8017c8a10..0d545f41f 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -71,7 +71,7 @@ namespace olive { Core* Core::instance_ = nullptr; -const uint Core::kProjectVersion = 201003; +const uint Core::kProjectVersion = 201118; Core::Core(const CoreParams& params) : main_window_(nullptr), diff --git a/app/node/factory.cpp b/app/node/factory.cpp index a7efd6b2e..6a488f76f 100644 --- a/app/node/factory.cpp +++ b/app/node/factory.cpp @@ -32,8 +32,7 @@ #include "generator/text/text.h" #include "filter/blur/blur.h" #include "filter/stroke/stroke.h" -#include "input/media/video/video.h" -#include "input/media/audio/audio.h" +#include "input/media/media.h" #include "input/time/timeinput.h" #include "math/math/math.h" #include "math/merge/merge.h" @@ -183,10 +182,8 @@ Node *NodeFactory::CreateFromFactoryIndex(const NodeFactory::InternalID &id) return new PolygonGenerator(); case kMatrixGenerator: return new MatrixGenerator(); - case kVideoInput: - return new VideoInput(); - case kAudioInput: - return new AudioInput(); + case kFootageInput: + return new MediaInput(); case kTrackOutput: return new TrackOutput(); case kViewerOutput: diff --git a/app/node/factory.h b/app/node/factory.h index eeef59986..63f13f258 100644 --- a/app/node/factory.h +++ b/app/node/factory.h @@ -35,10 +35,9 @@ public: kViewerOutput, kClipBlock, kGapBlock, - kAudioInput, kPolygonGenerator, kMatrixGenerator, - kVideoInput, + kFootageInput, kTrackOutput, kAudioVolume, kAudioPanning, diff --git a/app/node/input/media/CMakeLists.txt b/app/node/input/media/CMakeLists.txt index a8e7169c5..3ff361000 100644 --- a/app/node/input/media/CMakeLists.txt +++ b/app/node/input/media/CMakeLists.txt @@ -14,9 +14,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -add_subdirectory(audio) -add_subdirectory(video) - set(OLIVE_SOURCES ${OLIVE_SOURCES} node/input/media/media.h diff --git a/app/node/input/media/audio/CMakeLists.txt b/app/node/input/media/audio/CMakeLists.txt deleted file mode 100644 index 02fbbb83b..000000000 --- a/app/node/input/media/audio/CMakeLists.txt +++ /dev/null @@ -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 . - -set(OLIVE_SOURCES - ${OLIVE_SOURCES} - node/input/media/audio/audio.h - node/input/media/audio/audio.cpp - PARENT_SCOPE -) diff --git a/app/node/input/media/audio/audio.cpp b/app/node/input/media/audio/audio.cpp deleted file mode 100644 index fe0faff7d..000000000 --- a/app/node/input/media/audio/audio.cpp +++ /dev/null @@ -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 . - -***/ - -#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."); -} - -} diff --git a/app/node/input/media/audio/audio.h b/app/node/input/media/audio/audio.h deleted file mode 100644 index 7a2b8a272..000000000 --- a/app/node/input/media/audio/audio.h +++ /dev/null @@ -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 . - -***/ - -#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 diff --git a/app/node/input/media/media.cpp b/app/node/input/media/media.cpp index a7ad7f953..ea9aefb6e 100644 --- a/app/node/input/media/media.cpp +++ b/app/node/input/media/media.cpp @@ -57,7 +57,7 @@ bool MediaInput::IsMedia() const void MediaInput::Retranslate() { - footage_input_->set_name(tr("Footage")); + footage_input_->set_name(tr("Media")); } NodeValueTable MediaInput::Value(NodeValueDatabase &value) const diff --git a/app/node/input/media/media.h b/app/node/input/media/media.h index c7b23ca08..4a84a7d3d 100644 --- a/app/node/input/media/media.h +++ b/app/node/input/media/media.h @@ -36,7 +36,25 @@ class MediaInput : public Node public: 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 Category() const override; @@ -45,7 +63,6 @@ public: virtual bool IsMedia() const override; - virtual void Retranslate() override; virtual NodeValueTable Value(NodeValueDatabase& value) const override; diff --git a/app/node/input/media/video/CMakeLists.txt b/app/node/input/media/video/CMakeLists.txt deleted file mode 100644 index 7ade38f4e..000000000 --- a/app/node/input/media/video/CMakeLists.txt +++ /dev/null @@ -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 . - -set(OLIVE_SOURCES - ${OLIVE_SOURCES} - node/input/media/video/video.h - node/input/media/video/video.cpp - PARENT_SCOPE -) diff --git a/app/node/input/media/video/video.cpp b/app/node/input/media/video/video.cpp deleted file mode 100644 index 3bcf98352..000000000 --- a/app/node/input/media/video/video.cpp +++ /dev/null @@ -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 . - -***/ - -#include "video.h" - -#include -#include -#include - -#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."); -} - -} diff --git a/app/node/input/media/video/video.h b/app/node/input/media/video/video.h deleted file mode 100644 index 0606ceece..000000000 --- a/app/node/input/media/video/video.h +++ /dev/null @@ -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 . - -***/ - -#ifndef VIDEOINPUT_H -#define VIDEOINPUT_H - -#include - -#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 diff --git a/app/project/item/folder/folder.cpp b/app/project/item/folder/folder.cpp index 6c8ec1916..69c0aaa82 100644 --- a/app/project/item/folder/folder.cpp +++ b/app/project/item/folder/folder.cpp @@ -42,7 +42,7 @@ QIcon Folder::icon() 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) { if (cancelled && *cancelled) { @@ -75,7 +75,7 @@ void Folder::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const QA } add_child(child); - child->Load(reader, xml_node_data, cancelled); + child->Load(reader, xml_node_data, version, cancelled); } } diff --git a/app/project/item/folder/folder.h b/app/project/item/folder/folder.h index 93eaa9f6c..fcd6a6d15 100644 --- a/app/project/item/folder/folder.h +++ b/app/project/item/folder/folder.h @@ -44,7 +44,7 @@ public: 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; diff --git a/app/project/item/footage/footage.cpp b/app/project/item/footage/footage.cpp index 01da128ef..c2d1b1c63 100644 --- a/app/project/item/footage/footage.cpp +++ b/app/project/item/footage/footage.cpp @@ -42,7 +42,7 @@ Footage::~Footage() 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)) { if (cancelled && *cancelled) { diff --git a/app/project/item/footage/footage.h b/app/project/item/footage/footage.h index ec59750d8..2ffd9e272 100644 --- a/app/project/item/footage/footage.h +++ b/app/project/item/footage/footage.h @@ -60,7 +60,7 @@ public: /** * @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 diff --git a/app/project/item/item.h b/app/project/item/item.h index 32ed1fb8a..efaaaf963 100644 --- a/app/project/item/item.h +++ b/app/project/item/item.h @@ -67,7 +67,7 @@ public: 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; diff --git a/app/project/item/sequence/sequence.cpp b/app/project/item/sequence/sequence.cpp index 02440f29a..d0a6d58c6 100644 --- a/app/project/item/sequence/sequence.cpp +++ b/app/project/item/sequence/sequence.cpp @@ -45,7 +45,7 @@ Sequence::Sequence() 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) { @@ -130,7 +130,16 @@ void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, const { XMLAttributeLoop(reader, attr) { 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; } } diff --git a/app/project/item/sequence/sequence.h b/app/project/item/sequence/sequence.h index d364c298d..aab7920df 100644 --- a/app/project/item/sequence/sequence.h +++ b/app/project/item/sequence/sequence.h @@ -45,7 +45,7 @@ public: /** * @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 diff --git a/app/project/project.cpp b/app/project/project.cpp index 839474b73..84f15dd8b 100644 --- a/app/project/project.cpp +++ b/app/project/project.cpp @@ -43,14 +43,14 @@ Project::Project() : 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; while (XMLReadNextStartElement(reader)) { 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")) { diff --git a/app/project/project.h b/app/project/project.h index e4075ca5d..c86bf6e64 100644 --- a/app/project/project.h +++ b/app/project/project.h @@ -47,7 +47,7 @@ class Project : public QObject public: 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; diff --git a/app/task/precache/precachetask.cpp b/app/task/precache/precachetask.cpp index fc033dac2..b26568063 100644 --- a/app/task/precache/precachetask.cpp +++ b/app/task/precache/precachetask.cpp @@ -31,7 +31,7 @@ PreCacheTask::PreCacheTask(VideoStreamPtr footage, Sequence* sequence) : viewer()->set_video_params(sequence->video_params()); viewer()->set_audio_params(sequence->audio_params()); - video_node_ = new VideoInput(); + video_node_ = new MediaInput(); video_node_->SetStream(footage); NodeParam::ConnectEdge(video_node_->output(), viewer()->texture_input()); diff --git a/app/task/precache/precachetask.h b/app/task/precache/precachetask.h index 7fb2483e7..5f3bf0b74 100644 --- a/app/task/precache/precachetask.h +++ b/app/task/precache/precachetask.h @@ -21,7 +21,7 @@ #ifndef 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/sequence/sequence.h" #include "task/render/render.h" @@ -46,7 +46,7 @@ protected: private: VideoStreamPtr footage_; - VideoInput* video_node_; + MediaInput* video_node_; }; diff --git a/app/task/project/load/load.cpp b/app/task/project/load/load.cpp index a246abbbc..1003ac2c6 100644 --- a/app/task/project/load/load.cpp +++ b/app/task/project/load/load.cpp @@ -37,6 +37,7 @@ ProjectLoadTask::ProjectLoadTask(const QString &filename) : bool ProjectLoadTask::Run() { QFile project_file(GetFilename()); + uint project_version; if (project_file.open(QFile::ReadOnly | QFile::Text)) { QXmlStreamReader reader(&project_file); @@ -45,7 +46,7 @@ bool ProjectLoadTask::Run() if (reader.name() == QStringLiteral("olive")) { while(XMLReadNextStartElement(&reader)) { if (reader.name() == QStringLiteral("version")) { - uint project_version = reader.readElementText().toUInt(); + project_version = reader.readElementText().toUInt(); if (project_version > Core::kProjectVersion) { // Project is newer than we support @@ -63,7 +64,7 @@ bool ProjectLoadTask::Run() project_->set_filename(GetFilename()); - project_->Load(&reader, &layout_info_, &IsCancelled()); + project_->Load(&reader, &layout_info_, project_version, &IsCancelled()); // Ensure project is in main thread project_->moveToThread(qApp->thread()); diff --git a/app/task/project/loadotio/loadotio.cpp b/app/task/project/loadotio/loadotio.cpp index beeb65b90..c8928ff5e 100644 --- a/app/task/project/loadotio/loadotio.cpp +++ b/app/task/project/loadotio/loadotio.cpp @@ -29,8 +29,7 @@ #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 "node/input/media/media.h" #include "project/item/folder/folder.h" #include "project/item/sequence/sequence.h" @@ -172,12 +171,10 @@ bool LoadOTIOTask::Run() } if (probed_item && probed_item->type() == Item::kFootage) { - MediaInput* media; + MediaInput* media = new MediaInput(); if (track->track_type() == Timeline::kTrackTypeVideo) { - media = new VideoInput(); media->SetStream(probed_item->get_first_stream_of_type(Stream::kVideo)); } else { - media = new AudioInput(); media->SetStream(probed_item->get_first_stream_of_type(Stream::kAudio)); } sequence->AddNode(media); diff --git a/app/widget/timelinewidget/tool/import.cpp b/app/widget/timelinewidget/tool/import.cpp index 80d610bad..61c07ed35 100644 --- a/app/widget/timelinewidget/tool/import.cpp +++ b/app/widget/timelinewidget/tool/import.cpp @@ -31,8 +31,7 @@ #include "dialog/sequence/sequence.h" #include "node/audio/volume/volume.h" #include "node/generator/matrix/matrix.h" -#include "node/input/media/audio/audio.h" -#include "node/input/media/video/video.h" +#include "node/input/media/media.h" #include "node/math/math/math.h" #include "project/item/sequence/sequence.h" #include "widget/nodeview/nodeviewundo.h" @@ -416,7 +415,7 @@ void ImportTool::DropGhosts(bool insert) switch (footage_stream->type()) { case Stream::kVideo: { - VideoInput* video_input = new VideoInput(); + MediaInput* video_input = new MediaInput(); video_input->SetStream(footage_stream); new NodeAddCommand(dst_graph, video_input, command); @@ -438,7 +437,7 @@ void ImportTool::DropGhosts(bool insert) } case Stream::kAudio: { - AudioInput* audio_input = new AudioInput(); + MediaInput* audio_input = new MediaInput(); audio_input->SetStream(footage_stream); new NodeAddCommand(dst_graph, audio_input, command); diff --git a/app/widget/viewer/footageviewer.cpp b/app/widget/viewer/footageviewer.cpp index 0cc0ef2c9..2dc2b2f7b 100644 --- a/app/widget/viewer/footageviewer.cpp +++ b/app/widget/viewer/footageviewer.cpp @@ -32,10 +32,10 @@ FootageViewerWidget::FootageViewerWidget(QWidget *parent) : ViewerWidget(parent), footage_(nullptr) { - video_node_ = new VideoInput(); + video_node_ = new MediaInput(); sequence_.AddNode(video_node_); - audio_node_ = new AudioInput(); + audio_node_ = new MediaInput(); sequence_.AddNode(audio_node_); connect(display_widget(), &ViewerDisplayWidget::DragStarted, this, &FootageViewerWidget::StartFootageDrag); diff --git a/app/widget/viewer/footageviewer.h b/app/widget/viewer/footageviewer.h index 9b76b6000..036a96c1f 100644 --- a/app/widget/viewer/footageviewer.h +++ b/app/widget/viewer/footageviewer.h @@ -21,8 +21,7 @@ #ifndef FOOTAGEVIEWERWIDGET_H #define FOOTAGEVIEWERWIDGET_H -#include "node/input/media/audio/audio.h" -#include "node/input/media/video/video.h" +#include "node/input/media/media.h" #include "node/output/viewer/viewer.h" #include "viewer.h" @@ -49,9 +48,9 @@ private: Sequence sequence_; - VideoInput* video_node_; + MediaInput* video_node_; - AudioInput* audio_node_; + MediaInput* audio_node_; QHash cached_timestamps_;