annotate edtimeline.h @ 393:5137db55f00b

More work towards the editor ..
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Oct 2012 05:50:11 +0300
parents 69ca8a83c25a
children 9993873ff655
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #ifndef EDTIMELINE_H
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 #define EDTIMELINE_H
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #include <QWidget>
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
5 #include <QCheckBox>
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
6 #include <QLabel>
369
e1c984404b6b Re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents: 357
diff changeset
7 #include "dmengine.h"
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
9
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
10 class QTimelineTrackDisplay : public QWidget
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 Q_OBJECT
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 public:
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
15 DMTimelineTrack *track;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
16
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
17 QTimelineTrackDisplay(QWidget *parent = 0);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 void setTrack(DMTimelineTrack *mtrack);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
19
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
20 float getTimeFromCoord(float value);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 void setTime(const int mtime);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 void setOffset(const int moffs);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 void setScale(const float mscale);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
386
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
26 QSize minimumSizeHint() const;
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
27 QSize sizeHint() const;
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
28
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 protected:
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 void mousePressEvent(QMouseEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 void mouseMoveEvent(QMouseEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 void mouseReleaseEvent(QMouseEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 void paintEvent(QPaintEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 private:
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
37 bool dragging;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
38 QPoint dragPoint;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
39 int dragOffs; // milliseconds
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
40
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 float scale;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 int time, offs;
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
43 };
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
44
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
45
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
46 class QTimelineTrackView : public QWidget
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
47 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
48 Q_OBJECT
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
49
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
50 private:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
51 QLabel *infoName, *infoData;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
52 QCheckBox *enabledCheck;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
53
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
54 public:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
55 QTimelineTrackDisplay *track;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
56
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
57 QTimelineTrackView(QWidget *parent = 0);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
58 void setTrack(DMTimelineTrack *mtrack);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
59
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
60 private slots:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
61 void slotEnabledChanged(bool);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
62
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
63 //signals:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
64 // void enabledChanged(bool);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
65 };
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
66
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
67
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
68 class QTimelineView : public QWidget
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
69 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
70 Q_OBJECT
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
71
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
72 private:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
73 DMTimeline *tl;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
74 QList<QTimelineTrackView *> tracks;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
75
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
76 public:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
77 QTimelineView(QWidget *parent = 0);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
78 void setTimeline(DMTimeline *mtl);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
79
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
80 void setTime(const int mtime);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
81 void setOffset(const int moffs);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
82 void setScale(const float mscale);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 };
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 #endif