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