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 <QQuickView>
27#include <QQuickWidget>
28
29class QmlFilter;
30class QmlMetadata;
31class MetadataModel;
32class AttachedFiltersModel;
33class MotionTrackerModel;
34class SubtitlesModel;
35
36class FiltersDock : public QDockWidget
37{
38 Q_OBJECT
39
40public:
41 explicit FiltersDock(MetadataModel *metadataModel,
42 AttachedFiltersModel *attachedModel,
43 MotionTrackerModel *motionTrackerModel,
44 SubtitlesModel *subtitlesModel,
45 QWidget *parent = 0);
46
47 QmlProducer *qmlProducer() { return &m_producer; }
48
49signals:
50 void currentFilterRequested(int attachedIndex);
51 void changed();
52 void seeked(int);
53 void producerInChanged(int delta);
54 void producerOutChanged(int delta);
55
56public slots:
57 void setCurrentFilter(QmlFilter *filter, QmlMetadata *meta, int index);
58 void onSeeked(int position);
59 void onShowFrame(const SharedFrame &frame);
60 void openFilterMenu() const;
61 void showCopyFilterMenu();
62 void onServiceInChanged(int delta, Mlt::Service *service);
63 void load();
64
65protected:
66 bool event(QEvent *event);
67 void keyPressEvent(QKeyEvent *event);
68
69private:
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:50