CuteLogger
Fast and simple logging solution for Qt based applications
keyframesdock.h
1/*
2 * Copyright (c) 2016-2022 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 KEYFRAMESDOCK_H
19#define KEYFRAMESDOCK_H
20
21#include "qmltypes/qmlfilter.h"
22#include "models/metadatamodel.h"
23#include "sharedframe.h"
24#include "models/keyframesmodel.h"
25
26#include <QDockWidget>
27#include <QQuickWidget>
28#include <QScopedPointer>
29
30class QmlFilter;
31class QmlMetadata;
32class MetadataModel;
33class AttachedFiltersModel;
34class QmlProducer;
35class QMenu;
36
37class KeyframesDock : public QDockWidget
38{
39 Q_OBJECT
40
41public:
42 explicit KeyframesDock(QmlProducer *qmlProducer, QWidget *parent = 0);
43
44 KeyframesModel &model()
45 {
46 return m_model;
47 }
48 Q_INVOKABLE int seekPrevious();
49 Q_INVOKABLE int seekNext();
50 int currentParameter() const;
51
52signals:
53 void changed();
54 void setZoom(double value);
55 void zoomIn();
56 void zoomOut();
57 void zoomToFit();
58 void resetZoom();
59 void seekPreviousSimple();
60 void seekNextSimple();
61 void newFilter(); // Notifies when the filter itself has been changed
62 void timeScaleChanged();
63 void dockClicked();
64
65public slots:
66 void setCurrentFilter(QmlFilter *filter, QmlMetadata *meta);
67 void load(bool force = false);
68 void onProducerModified();
69
70protected:
71 bool event(QEvent *event);
72 void keyPressEvent(QKeyEvent *event);
73 void keyReleaseEvent(QKeyEvent *event);
74
75private slots:
76 void onDockRightClicked();
77 void onKeyframeRightClicked();
78 void onClipRightClicked();
79
80private:
81 void setupActions();
82 QQuickWidget m_qview;
83 KeyframesModel m_model;
84 QmlMetadata *m_metadata;
85 QmlFilter *m_filter;
86 QmlProducer *m_qmlProducer;
87 QMenu *m_mainMenu;
88 QMenu *m_keyMenu;
89 QMenu *m_clipMenu;
90};
91
92#endif // KEYFRAMESDOCK_H