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 
25 class MeltJob : public AbstractJob
26 {
27  Q_OBJECT
28 public:
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 
44 public slots:
45  void start();
46  void onViewXmlTriggered();
47 
48 protected slots:
49  virtual void onOpenTiggered();
50  virtual void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
51  void onShowFolderTriggered();
52  void onShowInFilesTriggered();
53  void onReadyRead();
54 
55 protected:
56  QScopedPointer<QTemporaryFile> m_xml;
57 
58 private:
59 
60  bool m_isStreaming;
61  int m_previousPercent;
62  QStringList m_args;
63  int m_currentFrame;
64  Mlt::Profile m_profile;
65  bool m_useMultiConsumer;
66  int m_in {-1};
67  int m_out {-1};
68 };
69 
70 #endif // MELTJOB_H