Mercurial > hg > dmlib
annotate edtimeline.h @ 410:e4b2f689aff6
Stdint -> SDL types conversion.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 03 Nov 2012 02:41:15 +0200 |
parents | d34922e6a244 |
children | a4666c9e1336 |
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> |
397 | 6 #include <QVBoxLayout> |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
7 #include <QLabel> |
398 | 8 #include <QLineEdit> |
397 | 9 #include "edtlobj.h" |
369 | 10 #include "dmengine.h" |
357 | 11 |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
12 |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
13 class QEDTimelineTrackDisplay : public QWidget |
357 | 14 { |
15 Q_OBJECT | |
16 | |
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 |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
20 QEDTimelineTrackDisplay(QWidget *parent = 0); |
357 | 21 void setTrack(DMTimelineTrack *mtrack); |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
22 |
402
0f290af63fc1
Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents:
398
diff
changeset
|
23 float getTimeScale(float value); |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
24 float getTimeFromCoord(float value); |
357 | 25 |
26 void setTime(const int mtime); | |
27 void setOffset(const int moffs); | |
28 void setScale(const float mscale); | |
29 | |
386 | 30 QSize minimumSizeHint() const; |
31 QSize sizeHint() const; | |
32 | |
357 | 33 protected: |
34 void mousePressEvent(QMouseEvent *event); | |
35 void mouseMoveEvent(QMouseEvent *event); | |
36 void mouseReleaseEvent(QMouseEvent *event); | |
37 | |
38 void paintEvent(QPaintEvent *event); | |
39 | |
40 private: | |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
41 bool dragging; |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
42 QPoint dragPoint; |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
43 int dragOffs; // milliseconds |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
44 |
357 | 45 float scale; |
46 int time, offs; | |
393
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 |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
50 class QEDTimelineTrackView : public QWidget |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
51 { |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
52 Q_OBJECT |
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 private: |
398 | 55 QLineEdit *infoName; |
56 QLabel *infoData; | |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
57 QCheckBox *enabledCheck; |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
58 |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
59 public: |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
60 QEDTimelineTrackDisplay *track; |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
61 |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
62 QEDTimelineTrackView(QWidget *parent = 0); |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
63 void setTrack(DMTimelineTrack *mtrack); |
398 | 64 void update(); |
393
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 private slots: |
398 | 67 void slotTrackEnabledChanged(bool); |
68 void slotTrackNameChanged(const QString & text); | |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
69 |
397 | 70 signals: |
398 | 71 void trackChanged(); |
393
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 |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
75 class QEDTimelineView : public QWidget |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
76 { |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
77 Q_OBJECT |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
78 |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
79 private: |
397 | 80 QVBoxLayout *layout; |
398 | 81 |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
82 EDTimelineObject *tl; |
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
83 QList<QEDTimelineTrackView *> tracks; |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
84 |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
85 public: |
403
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
86 QEDTimelineView(QWidget *parent = 0); |
d34922e6a244
Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
402
diff
changeset
|
87 void setTimeline(EDTimelineObject *mtl); |
393
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
88 |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
89 void setTime(const int mtime); |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
90 void setOffset(const int moffs); |
5137db55f00b
More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
91 void setScale(const float mscale); |
397 | 92 |
93 private slots: | |
94 void slotTimelineChanged(); | |
95 | |
96 signals: | |
97 void timelineChanged(); | |
357 | 98 }; |
99 | |
100 #endif |