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