CuteLogger
Fast and simple logging solution for Qt based applications
avformatproducerwidget.h
1/*
2 * Copyright (c) 2012-2021 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 "sharedframe.h"
25#include "dialogs/transcodedialog.h"
26
27namespace Ui {
28class AvformatProducerWidget;
29}
30
31class AvformatProducerWidget : public QWidget, public AbstractProducerWidget
32{
33 Q_OBJECT
34
35public:
36 explicit AvformatProducerWidget(QWidget *parent = 0);
37 ~AvformatProducerWidget();
38
39 // AbstractProducerWidget overrides
40 Mlt::Producer *newProducer(Mlt::Profile &);
41 void setProducer(Mlt::Producer *);
42
43public slots:
44 void updateDuration();
45 void rename();
46 void offerConvert(QString message, bool set709Convert = false, bool setSubClip = false);
47
48signals:
49 void producerChanged(Mlt::Producer *);
50 void producerReopened(bool play);
51 void modified();
52
53protected:
54 void keyPressEvent(QKeyEvent *event);
55
56private slots:
57 void onFrameDisplayed(const SharedFrame &);
58
59 void onProducerChanged(Mlt::Producer *);
60
61 void onFrameDecoded();
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_pitchCheckBox_stateChanged(int state);
80
81 void on_syncSlider_valueChanged(int value);
82
83 void on_actionOpenFolder_triggered();
84
85 void on_menuButton_clicked();
86
87 void on_actionCopyFullFilePath_triggered();
88
89 void on_notesTextEdit_textChanged();
90
91 void on_actionFFmpegInfo_triggered();
92
93 void on_actionFFmpegIntegrityCheck_triggered();
94
95 void on_actionFFmpegConvert_triggered();
96
97 void on_reverseButton_clicked();
98
99 void on_actionExtractSubclip_triggered();
100
101 void on_actionSetFileDate_triggered();
102
103 void on_rangeComboBox_activated(int index);
104
105 void on_filenameLabel_editingFinished();
106
107 void on_convertButton_clicked();
108
109 void on_actionDisableProxy_triggered(bool checked);
110
111 void on_actionMakeProxy_triggered();
112
113 void on_actionDeleteProxy_triggered();
114
115 void on_actionCopyHashCode_triggered();
116
117 void on_proxyButton_clicked();
118
119 void on_actionReset_triggered();
120
121 void on_actionSetEquirectangular_triggered();
122
123 void on_actionFFmpegVideoQuality_triggered();
124
125 void on_rotationComboBox_activated(int index);
126
127 void on_actionExportGPX_triggered();
128
129private:
130 Ui::AvformatProducerWidget *ui;
131 int m_defaultDuration;
132 bool m_recalcDuration;
133 bool m_askToConvert;
134
135 void reopen(Mlt::Producer *p);
136 void recreateProducer();
137 void convert(TranscodeDialog &dialog);
138 bool revertToOriginalResource();
139 void setSyncVisibility();
140};
141
142
143class DecodeTask : public QObject, public QRunnable
144{
145 Q_OBJECT
146
147public:
148 explicit DecodeTask(AvformatProducerWidget *widget);
149 void run();
150
151signals:
152 void frameDecoded();
153
154private:
155 QScopedPointer<Mlt::Frame> m_frame;
156};
157
158#endif // AVFORMATPRODUCERWIDGET_H
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:49