CuteLogger
Fast and simple logging solution for Qt based applications
avformatproducerwidget.h
1 /*
2  * Copyright (c) 2012-2020 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 
27 namespace Ui {
28  class AvformatProducerWidget;
29 }
30 
31 class AvformatProducerWidget : public QWidget, public AbstractProducerWidget
32 {
33  Q_OBJECT
34 
35 public:
36  explicit AvformatProducerWidget(QWidget *parent = 0);
37  ~AvformatProducerWidget();
38 
39  // AbstractProducerWidget overrides
40  Mlt::Producer* newProducer(Mlt::Profile&);
41  void setProducer(Mlt::Producer*);
42 
43 public slots:
44  void updateDuration();
45 
46 signals:
47  void producerChanged(Mlt::Producer*);
48  void producerReopened();
49  void modified();
50 
51 protected:
52  void keyPressEvent(QKeyEvent *event);
53 
54 private slots:
55  void onFrameDisplayed(const SharedFrame&);
56 
57  void onProducerChanged();
58 
59  void onFrameDecoded();
60 
61  void on_resetButton_clicked();
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 private:
110  Ui::AvformatProducerWidget *ui;
111  int m_defaultDuration;
112  bool m_recalcDuration;
113  bool m_askToConvert;
114  bool m_userDefinedCaption;
115 
116  void reopen(Mlt::Producer* p);
117  void recreateProducer();
118  void convert(TranscodeDialog& dialog);
119 };
120 
121 
122 class DecodeTask : public QObject, public QRunnable
123 {
124  Q_OBJECT
125 
126 public:
127  explicit DecodeTask(AvformatProducerWidget* widget);
128  void run();
129 
130 signals:
131  void frameDecoded();
132 
133 private:
134  QScopedPointer<Mlt::Frame> m_frame;
135 };
136 
137 #endif // AVFORMATPRODUCERWIDGET_H
SharedFrame
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:48