CuteLogger
Fast and simple logging solution for Qt based applications
filtersdock.h
1 /*
2  * Copyright (c) 2013-2024 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 FILTERSDOCK_H
19 #define FILTERSDOCK_H
20 
21 #include "qmltypes/qmlproducer.h"
22 #include "sharedframe.h"
23 
24 #include <QDockWidget>
25 #include <QObject>
26 #include <QQuickWidget>
27 
28 class QmlFilter;
29 class QmlMetadata;
30 class MetadataModel;
31 class AttachedFiltersModel;
32 class MotionTrackerModel;
33 class SubtitlesModel;
34 
35 class FiltersDock : public QDockWidget
36 {
37  Q_OBJECT
38 
39 public:
40  explicit FiltersDock(MetadataModel *metadataModel,
41  AttachedFiltersModel *attachedModel,
42  MotionTrackerModel *motionTrackerModel,
43  SubtitlesModel *subtitlesModel,
44  QWidget *parent = 0);
45 
46  QmlProducer *qmlProducer() { return &m_producer; }
47 
48 signals:
49  void currentFilterRequested(int attachedIndex);
50  void changed();
51  void seeked(int);
52  void producerInChanged(int delta);
53  void producerOutChanged(int delta);
54 
55 public slots:
56  void setCurrentFilter(QmlFilter *filter, QmlMetadata *meta, int index);
57  void onSeeked(int position);
58  void onShowFrame(const SharedFrame &frame);
59  void openFilterMenu() const;
60  void showCopyFilterMenu();
61  void onServiceInChanged(int delta, Mlt::Service *service);
62  void load();
63 
64 protected:
65  bool event(QEvent *event);
66  void keyPressEvent(QKeyEvent *event);
67 
68 private:
69  void setupActions();
70  QQuickWidget m_qview;
71  QmlProducer m_producer;
72  unsigned loadTries{0};
73 };
74 
75 #endif // FILTERSDOCK_H
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:50