annotate edtimeline.h @ 398:8660c6005032

More work.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Oct 2012 09:46:05 +0300
parents 9993873ff655
children 0f290af63fc1
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>
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
6 #include <QVBoxLayout>
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
7 #include <QLabel>
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
8 #include <QLineEdit>
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
9 #include "edtlobj.h"
369
e1c984404b6b Re-entrancy.
Matti Hamalainen <ccr@tnsp.org>
parents: 357
diff changeset
10 #include "dmengine.h"
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
12
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
13 class QTimelineTrackDisplay : public QWidget
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 Q_OBJECT
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 public:
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
18 DMTimelineTrack *track;
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 QTimelineTrackDisplay(QWidget *parent = 0);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 void setTrack(DMTimelineTrack *mtrack);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
22
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
23 float getTimeFromCoord(float value);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 void setTime(const int mtime);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 void setOffset(const int moffs);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 void setScale(const float mscale);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28
386
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
29 QSize minimumSizeHint() const;
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
30 QSize sizeHint() const;
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 369
diff changeset
31
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 protected:
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 void mousePressEvent(QMouseEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 void mouseMoveEvent(QMouseEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 void mouseReleaseEvent(QMouseEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 void paintEvent(QPaintEvent *event);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 private:
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
40 bool dragging;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
41 QPoint dragPoint;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
42 int dragOffs; // milliseconds
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
43
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 float scale;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 int time, offs;
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
46 };
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
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
49 class QTimelineTrackView : public QWidget
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
50 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
51 Q_OBJECT
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
52
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
53 private:
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
54 QLineEdit *infoName;
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
55 QLabel *infoData;
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
56 QCheckBox *enabledCheck;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
57
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
58 public:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
59 QTimelineTrackDisplay *track;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
60
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
61 QTimelineTrackView(QWidget *parent = 0);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
62 void setTrack(DMTimelineTrack *mtrack);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
63 void update();
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
64
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
65 private slots:
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
66 void slotTrackEnabledChanged(bool);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
67 void slotTrackNameChanged(const QString & text);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
68
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
69 signals:
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
70 void trackChanged();
393
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
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
73
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
74 class QTimelineView : public QWidget
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 Q_OBJECT
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
77
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
78 private:
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
79 QVBoxLayout *layout;
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
80
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
81 TimelineObject *tl;
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
82 QList<QTimelineTrackView *> tracks;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
83
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
84 public:
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
85 QTimelineView(QWidget *parent = 0);
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
86 void setTimeline(TimelineObject *mtl);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
87
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
88 void setTime(const int mtime);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
89 void setOffset(const int moffs);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
90 void setScale(const float mscale);
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
91
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
92 private slots:
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
93 void slotTimelineChanged();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
94
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
95 signals:
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
96 void timelineChanged();
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 };
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 #endif