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