otio: renamed ProjectSaveAsOTIOTask to ExportOTIOTask

This commit is contained in:
itsmattkc
2020-09-25 16:59:19 +10:00
parent a70f9f15a3
commit ab41333da9
4 changed files with 18 additions and 15 deletions
+1 -1
View File
@@ -14,10 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add_subdirectory(exportotio)
add_subdirectory(import)
add_subdirectory(load)
add_subdirectory(save)
add_subdirectory(saveotio)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
@@ -16,7 +16,7 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
task/project/saveotio/projectsaveasotiotask.h
task/project/saveotio/projectsaveasotiotask.cpp
task/project/exportotio/exportotiotask.h
task/project/exportotio/exportotiotask.cpp
PARENT_SCOPE
)
@@ -18,7 +18,7 @@
***/
#include "projectsaveasotiotask.h"
#include "exportotiotask.h"
#include <opentimelineio/clip.h>
#include <opentimelineio/gap.h>
@@ -29,21 +29,20 @@
OLIVE_NAMESPACE_ENTER
ProjectSaveAsOTIOTask::ProjectSaveAsOTIOTask(Sequence *sequence) :
sequence_(sequence)
ExportOTIOTask::ExportOTIOTask(ViewerOutput *sequence, const QString &filename) :
sequence_(sequence),
filename_(filename)
{
SetTitle(tr("Saving '%1' as OpenTimelineIO").arg(sequence->name()));
SetTitle(tr("Saving '%1' as OpenTimelineIO").arg(sequence_->media_name()));
}
bool ProjectSaveAsOTIOTask::Run()
bool ExportOTIOTask::Run()
{
auto otio_timeline = new opentimelineio::v1_0::Timeline();
ViewerOutput* viewer = sequence_->viewer_output();
opentimelineio::v1_0::ErrorStatus es;
foreach (TrackOutput* track, viewer->track_list(Timeline::kTrackTypeVideo)->GetTracks()) {
foreach (TrackOutput* track, sequence_->track_list(Timeline::kTrackTypeVideo)->GetTracks()) {
auto otio_track = new opentimelineio::v1_0::Track();
otio_track->set_kind("Video");
@@ -105,7 +104,9 @@ bool ProjectSaveAsOTIOTask::Run()
}
}
return true;
otio_timeline->to_json_file(filename_.toStdString(), &es);
return (es == opentimelineio::v1_0::ErrorStatus::OK);
}
OLIVE_NAMESPACE_EXIT
@@ -26,17 +26,19 @@
OLIVE_NAMESPACE_ENTER
class ProjectSaveAsOTIOTask : public Task
class ExportOTIOTask : public Task
{
Q_OBJECT
public:
ProjectSaveAsOTIOTask(Sequence* sequence);
ExportOTIOTask(ViewerOutput* sequence, const QString& filename);
protected:
virtual bool Run() override;
private:
Sequence* sequence_;
ViewerOutput* sequence_;
QString filename_;
};