CuteLogger
Fast and simple logging solution for Qt based applications
avformatproducerwidget.h
1 /*
2  * Copyright (c) 2012-2023 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 AVFORMATPRODUCERWIDGET_H
19 #define AVFORMATPRODUCERWIDGET_H
20 
21 #include "abstractproducerwidget.h"
22 
23 #include "dialogs/transcodedialog.h"
24 
25 #include <QRunnable>
26 #include <QWidget>
27 
28 namespace Ui {
29 class AvformatProducerWidget;
30 }
31 
32 class AvformatProducerWidget : public QWidget, public AbstractProducerWidget
33 {
34  Q_OBJECT
35 
36 public:
37  explicit AvformatProducerWidget(QWidget *parent = 0);
38  ~AvformatProducerWidget();
39 
40  // AbstractProducerWidget overrides
41  Mlt::Producer *newProducer(Mlt::Profile &);
42  void setProducer(Mlt::Producer *);
43 
44 public slots:
45  void updateDuration();
46  void rename();
47  void offerConvert(QString message, bool set709Convert = false, bool setSubClip = false);
48 
49 signals:
50  void producerChanged(Mlt::Producer *);
51  void producerReopened(bool play);
52  void modified();
53  void showInFiles(QString);
54 
55 protected:
56  void keyPressEvent(QKeyEvent *event);
57 
58 private slots:
59 
60  void onProducerChanged(Mlt::Producer *);
61 
62  void on_videoTrackComboBox_activated(int index);
63 
64  void on_audioTrackComboBox_activated(int index);
65 
66  void on_scanComboBox_activated(int index);
67 
68  void on_fieldOrderComboBox_activated(int index);
69 
70  void on_aspectNumSpinBox_valueChanged(int);
71 
72  void on_aspectDenSpinBox_valueChanged(int);
73 
74  void on_durationSpinBox_editingFinished();
75 
76  void on_speedSpinBox_editingFinished();
77 
78  void on_pitchCheckBox_stateChanged(int state);
79 
80  void on_syncSlider_valueChanged(int value);
81 
82  void on_actionOpenFolder_triggered();
83 
84  void on_menuButton_clicked();
85 
86  void on_actionCopyFullFilePath_triggered();
87 
88  void on_notesTextEdit_textChanged();
89 
90  void on_actionFFmpegInfo_triggered();
91 
92  void on_actionFFmpegIntegrityCheck_triggered();
93 
94  void on_actionFFmpegConvert_triggered();
95 
96  void on_reverseButton_clicked();
97 
98  void on_actionExtractSubclip_triggered();
99 
100  void on_actionExtractSubtitles_triggered();
101 
102  void on_actionSetFileDate_triggered();
103 
104  void on_rangeComboBox_activated(int index);
105 
106  void on_filenameLabel_editingFinished();
107 
108  void on_convertButton_clicked();
109 
110  void on_actionDisableProxy_triggered(bool checked);
111 
112  void on_actionMakeProxy_triggered();
113 
114  void on_actionDeleteProxy_triggered();
115 
116  void on_actionCopyHashCode_triggered();
117 
118  void on_proxyButton_clicked();
119 
120  void on_actionReset_triggered();
121 
122  void on_actionSetEquirectangular_triggered();
123 
124  void on_actionFFmpegVideoQuality_triggered();
125 
126  void on_rotationComboBox_activated(int index);
127 
128  void on_actionExportGPX_triggered();
129 
130  void on_speedComboBox_textActivated(const QString &arg1);
131 
132 private:
133  Ui::AvformatProducerWidget *ui;
134  int m_defaultDuration;
135  bool m_recalcDuration;
136  bool m_askToConvert;
137 
138  void reopen(Mlt::Producer *p);
139  void recreateProducer(bool getFrame = false);
140  bool revertToOriginalResource();
141  void setSyncVisibility();
142  double fps();
143 
144 private slots:
145  void reloadProducerValues();
146  void on_actionBitrateViewer_triggered();
147  void on_actionShowInFiles_triggered();
148 };
149 
150 class ProbeTask : public QObject, public QRunnable
151 {
152  Q_OBJECT
153 
154 public:
155  explicit ProbeTask(Mlt::Producer *producer);
156  void run();
157 
158 signals:
159  void probeFinished();
160 
161 private:
162  Mlt::Producer m_producer;
163 };
164 
165 #endif // AVFORMATPRODUCERWIDGET_H