CuteLogger
Fast and simple logging solution for Qt based applications
avformatproducerwidget.h
1 /*
2  * Copyright (c) 2012-2018 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 signals:
44  void producerChanged(Mlt::Producer*);
45  void producerReopened();
46  void modified();
47 
48 protected:
49  void keyPressEvent(QKeyEvent *event);
50 
51 private slots:
52  void onFrameDisplayed(const SharedFrame&);
53 
54  void onProducerChanged();
55 
56  void onFrameDecoded();
57 
58  void on_resetButton_clicked();
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_syncSlider_valueChanged(int value);
77 
78  void on_actionOpenFolder_triggered();
79 
80  void on_menuButton_clicked();
81 
82  void on_actionCopyFullFilePath_triggered();
83 
84  void on_notesTextEdit_textChanged();
85 
86  void on_actionFFmpegInfo_triggered();
87 
88  void on_actionFFmpegIntegrityCheck_triggered();
89 
90  void on_actionFFmpegConvert_triggered();
91 
92  void on_reverseButton_clicked();
93 
94  void on_actionExtractSubclip_triggered();
95 
96  void on_actionSetFileDate_triggered();
97 
98  void on_rangeComboBox_activated(int index);
99 
100 private:
101  Ui::AvformatProducerWidget *ui;
102  int m_defaultDuration;
103  bool m_recalcDuration;
104  bool m_askToConvert;
105 
106  void reopen(Mlt::Producer* p);
107  void recreateProducer();
108  void convert(TranscodeDialog& dialog);
109 };
110 
111 
112 class DecodeTask : public QObject, public QRunnable
113 {
114  Q_OBJECT
115 
116 public:
117  explicit DecodeTask(AvformatProducerWidget* widget);
118  void run();
119 
120 signals:
121  void frameDecoded();
122 
123 private:
124  QScopedPointer<Mlt::Frame> m_frame;
125 };
126 
127 #endif // AVFORMATPRODUCERWIDGET_H
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:48