export: made progress on headless export

Still incomplete and unusable, but less so than before.
This commit is contained in:
itsmattkc
2020-06-17 18:06:50 +10:00
parent c3c26a8e24
commit a818e17c55
14 changed files with 337 additions and 88 deletions
+30
View File
@@ -0,0 +1,30 @@
/***
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 "cliexportmanager.h"
OLIVE_NAMESPACE_ENTER
CLIExportManager::CLIExportManager()
{
}
OLIVE_NAMESPACE_EXIT
+36
View File
@@ -0,0 +1,36 @@
/***
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 CLIEXPORTMANAGER_H
#define CLIEXPORTMANAGER_H
#include "task/export/export.h"
OLIVE_NAMESPACE_ENTER
class CLIExportManager : public QObject
{
public:
CLIExportManager();
};
OLIVE_NAMESPACE_EXIT
#endif // CLIEXPORTMANAGER_H
+5 -4
View File
@@ -27,9 +27,10 @@ OLIVE_NAMESPACE_ENTER
CLIProgressDialog::CLIProgressDialog(const QString& title, QObject *parent) :
QObject(parent),
title_(title),
progress_(0),
progress_(-1),
drawn_(false)
{
SetProgress(0);
}
void CLIProgressDialog::Update()
@@ -68,7 +69,7 @@ void CLIProgressDialog::Update()
std::cout << "[";
// Get UI bar progress
int bar_prog = qRound(progress_ * 0.01 * progress_bar_columns);
int bar_prog = qRound(progress_ * progress_bar_columns);
// Draw filled in bar
for (int i=0;i<bar_prog;i++) {
@@ -90,10 +91,10 @@ void CLIProgressDialog::Update()
std::cout << " ";
}
std::cout << progress_ << "% " << std::flush;
std::cout << qRound(progress_ * 100.0) << "% " << std::endl << std::flush;
}
void CLIProgressDialog::SetProgress(int p)
void CLIProgressDialog::SetProgress(double p)
{
if (progress_ != p) {
progress_ = p;
+2 -2
View File
@@ -34,14 +34,14 @@ public:
CLIProgressDialog(const QString &title, QObject* parent = nullptr);
public slots:
void SetProgress(int p);
void SetProgress(double p);
private:
void Update();
QString title_;
int progress_;
double progress_;
bool drawn_;
+8 -2
View File
@@ -23,9 +23,15 @@
OLIVE_NAMESPACE_ENTER
CLITaskDialog::CLITaskDialog(Task *task, QObject* parent) :
CLIProgressDialog(task->GetTitle(), parent)
CLIProgressDialog(task->GetTitle(), parent),
task_(task)
{
// FIXME: Still developing this, don't try to use
connect(task_, &Task::ProgressChanged, this, &CLITaskDialog::SetProgress);
}
bool CLITaskDialog::Run()
{
return task_->Start();
}
OLIVE_NAMESPACE_EXIT
+6
View File
@@ -28,9 +28,15 @@ OLIVE_NAMESPACE_ENTER
class CLITaskDialog : public CLIProgressDialog
{
Q_OBJECT
public:
CLITaskDialog(Task *task, QObject* parent = nullptr);
bool Run();
private:
Task* task_;
};
OLIVE_NAMESPACE_EXIT