Mercurial > hg > dmlib
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 |
rev | line source |
---|---|
357 | 1 #ifndef EDTIMELINE_H |
2 #define EDTIMELINE_H | |
3 | |
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 | 7 #include "dmengine.h" |
357 | 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 | 11 { |
12 Q_OBJECT | |
13 | |
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 | 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 | 21 |
22 void setTime(const int mtime); | |
23 void setOffset(const int moffs); | |
24 void setScale(const float mscale); | |
25 | |
386 | 26 QSize minimumSizeHint() const; |
27 QSize sizeHint() const; | |
28 | |
357 | 29 protected: |
30 void mousePressEvent(QMouseEvent *event); | |
31 void mouseMoveEvent(QMouseEvent *event); | |
32 void mouseReleaseEvent(QMouseEvent *event); | |
33 | |
34 void paintEvent(QPaintEvent *event); | |
35 | |
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 | 41 float scale; |
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 | 83 }; |
84 | |
85 #endif |