CuteLogger
Fast and simple logging solution for Qt based applications
meltjob.h
1/*
2 * Copyright (c) 2012-2024 Meltytech, LLC
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef MELTJOB_H
19#define MELTJOB_H
20
21#include "abstractjob.h"
22#include <QTemporaryFile>
23#include <MltProfile.h>
24
25class MeltJob : public AbstractJob
26{
27 Q_OBJECT
28public:
29 MeltJob(const QString &name, const QString &xml, int frameRateNum, int frameRateDen,
30 QThread::Priority priority = Settings.jobPriority());
31 MeltJob(const QString &name, const QStringList &args, int frameRateNum, int frameRateDen);
32 MeltJob(const QString &name, const QString &xml, const QStringList &args, int frameRateNum,
33 int frameRateDen);
34 virtual ~MeltJob();
35 QString xml();
36 QString xmlPath() const
37 {
38 return m_xml->fileName();
39 }
40 void setIsStreaming(bool streaming);
41 void setUseMultiConsumer(bool multi = true);
42 void setInAndOut(int in, int out);
43
44public slots:
45 void start();
46 void onViewXmlTriggered();
47
48protected slots:
49 virtual void onOpenTiggered();
50 virtual void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
51 void onShowFolderTriggered();
52 void onReadyRead();
53
54protected:
55 QScopedPointer<QTemporaryFile> m_xml;
56
57private:
58
59 bool m_isStreaming;
60 int m_previousPercent;
61 QStringList m_args;
62 int m_currentFrame;
63 Mlt::Profile m_profile;
64 bool m_useMultiConsumer;
65 int m_in {-1};
66 int m_out {-1};
67};
68
69#endif // MELTJOB_H