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
23#include <MltProfile.h>
24#include <QTemporaryFile>
25
26class MeltJob : public AbstractJob
27{
28 Q_OBJECT
29public:
30 MeltJob(const QString &name,
31 const QString &xml,
32 int frameRateNum,
33 int frameRateDen,
34 QThread::Priority priority = Settings.jobPriority());
35 MeltJob(const QString &name, const QStringList &args, int frameRateNum, int frameRateDen);
36 MeltJob(const QString &name,
37 const QString &xml,
38 const QStringList &args,
39 int frameRateNum,
40 int frameRateDen);
41 virtual ~MeltJob();
42 QString xml();
43 QString xmlPath() const { return m_xml->fileName(); }
44 void setIsStreaming(bool streaming);
45 void setUseMultiConsumer(bool multi = true);
46 void setInAndOut(int in, int out);
47
48public slots:
49 void start();
50 void onViewXmlTriggered();
51
52protected slots:
53 virtual void onOpenTiggered();
54 virtual void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
55 void onShowFolderTriggered();
56 void onShowInFilesTriggered();
57 void onReadyRead();
58
59protected:
60 QScopedPointer<QTemporaryFile> m_xml;
61
62private:
63 bool m_isStreaming;
64 int m_previousPercent;
65 QStringList m_args;
66 int m_currentFrame;
67 Mlt::Profile m_profile;
68 bool m_useMultiConsumer;
69 int m_in{-1};
70 int m_out{-1};
71};
72
73#endif // MELTJOB_H