annotate editor/edtimeline.cpp @ 2294:7f6ba3b32f54

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 03 Jul 2019 10:28:43 +0300
parents b4992d9f72fe
children
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 #include <QtGui>
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 #include "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
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
5 QEDTimelineTrackDisplay::QEDTimelineTrackDisplay(QWidget *parent) : QWidget(parent)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 track = NULL;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 time = offs = 0;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 scale = 1.0f;
386
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
10
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
11 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
12 }
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
13
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
14
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
15 QSize QEDTimelineTrackDisplay::minimumSizeHint() const
386
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
16 {
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
17 return QSize(100, 60);
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
18 }
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
19
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
20
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
21 QSize QEDTimelineTrackDisplay::sizeHint() const
386
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
22 {
69ca8a83c25a Add size hints.
Matti Hamalainen <ccr@tnsp.org>
parents: 376
diff changeset
23 return QSize(600, 60);
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
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
27 void QEDTimelineTrackDisplay::setTrack(DMTimelineTrack *mtrack)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 track = mtrack;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
33 float QEDTimelineTrackDisplay::getTimeScale(float value)
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
34 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
35 return value * scale;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
36 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
37
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
38
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
39 float QEDTimelineTrackDisplay::getTimeFromCoord(float value)
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
40 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
41 return value * scale * 1000.0f;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
42 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
43
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
44
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
45 void QEDTimelineTrackDisplay::setTime(const float mtime)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
46 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
47 if (time != mtime && mtime >= 0)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
48 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
49 time = mtime;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
50 emit timeChanged(time);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
51 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
52 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
53
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
54
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
55 void QEDTimelineTrackDisplay::setOffset(const float moffs)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
56 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
57 if (offs != moffs && moffs >= 0)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
58 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
59 offs = moffs;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
60 emit offsetChanged(offs);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
61 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
62 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
63
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
64
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
65 void QEDTimelineTrackDisplay::setScale(const float mscale)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
66 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
67 if (mscale > 0.05)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
68 scale = mscale;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
69 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
70
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
71
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
72 void QEDTimelineTrackDisplay::setSelection(const float mstart, const float mend)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
73 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
74 if (mstart >= 0 && mend >= 0 && fabs(mend - mstart) > 0)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
75 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
76 selectionValid = true;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
77 if (mend > mstart)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
78 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
79 selectionStart = mstart;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
80 selectionDuration = mend - mstart + 1;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
81 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
82 else
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
83 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
84 selectionStart = mend;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
85 selectionDuration = mstart - mend + 1;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
86 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
87 emit selectionChanged(selectionStart, selectionDuration);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
88 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
89 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
90
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
91
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
92 void QEDTimelineTrackDisplay::clearSelection()
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
93 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
94 selectionValid = false;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
95 selectionStart = 0;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
96 selectionDuration = 0;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
97 emit selectionChanged(selectionStart, selectionDuration);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
98 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
99
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
100
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
101 bool QEDTimelineTrackDisplay::getSelection(float *mstart, float *mduration)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
102 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
103 if (selectionValid)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
104 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
105 *mstart = selectionStart;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
106 *mduration = selectionDuration;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
107 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
108 return selectionValid;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
109 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
110
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
111
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
112 QList<DMTimelineEvent *> QEDTimelineTrackDisplay::getEventsAt(const int time)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
113 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
114 QList<DMTimelineEvent *> list;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
115
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
116 for (int event = 0; event < track->nevents; event++)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
117 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
118 DMTimelineEvent *ev = track->events[event];
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
119 if (time >= ev->start && time <= ev->start + ev->duration)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
120 list.append(ev);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
121 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
122
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
123 return list;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
124 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
125
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
126
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
127
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
128 QList<DMTimelineEvent *> QEDTimelineTrackDisplay::getEventsForRange(const int start, const int duration)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
129 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
130 QList<DMTimelineEvent *> list;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
131
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
132 for (int event = 0; event < track->nevents; event++)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
133 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
134 DMTimelineEvent *ev = track->events[event];
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
135 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
136
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
137 return list;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
138 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
139
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
140
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
141 void QEDTimelineTrackDisplay::paintEvent(QPaintEvent *)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 {
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
143 if (track == NULL)
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
144 return;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
145
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
146 QColor eventColor(150, 150, 150, 128);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
147 QColor invalidEventColor(250, 150, 150, 128);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
148 QColor eventBorder(200, 250, 200, 200);
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
149 QColor eventParam(200, 150, 100);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
150 QColor eventText(255, 255, 255);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 QColor markerColor(255,255,255);
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
152 QColor selectionColor(0,255,0, 150);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
153 QColor selectionEnd(0,255,0, 200);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
155 QFont fantti;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
156 fantti.setFamily("Arial");
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
157 fantti.setPointSizeF(8.0f);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
158 fantti.setStyleHint(QFont::SansSerif);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
159
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 QPainter painter(this);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 painter.setRenderHint(QPainter::Antialiasing);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
163
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 painter.save();
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 painter.scale(scale, 1);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
167 float wd = getTimeScale(width());
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 for (int event = 0; event < track->nevents; event++)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 DMTimelineEvent *ev = track->events[event];
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
171
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
172 float x0 = getTimeScale(ev->start - offs),
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
173 x1 = getTimeScale(ev->start + ev->duration - offs);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
174
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
175 if ((x0 >= 0 && x0 < wd) || (x0 < 0 && x1 >= 0))
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
176 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
177 painter.setFont(fantti);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
178 painter.setBrush(ev->effect != NULL ? eventColor : invalidEventColor);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
179 painter.setPen(eventBorder);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
180 x0 = ev->start - offs;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
181 x1 = ev->duration;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
182 painter.fillRect(x0, 0, x1, height(), eventColor);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
183
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
184 QPainterPath path;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
185 path.addText(QPointF(x0 + 2, 10), fantti, ev->effect != NULL ? QString(ev->effect->name) : "INVALID");
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
186
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
187 painter.save();
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
188 painter.translate(1,1);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
189 painter.setPen(Qt::black);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
190 painter.setBrush(Qt::black);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
191 painter.drawPath(path);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
192 painter.restore();
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
193
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
194 painter.setPen(eventText);
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
195 painter.setBrush(eventText);
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
196 painter.drawPath(path);
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
197 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
198
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
201 painter.restore();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
202
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
203 if (selectionValid)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
204 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
205 float x0 = getTimeScale(selectionStart - offs),
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
206 x1 = getTimeScale(selectionStart + selectionDuration - offs);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
207
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
208 if ((x0 >= 0 && x0 < wd) || (x0 < 0 && x1 >= 0))
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
209 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
210 painter.setBrush(selectionColor);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
211 painter.setPen(selectionEnd);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
212 x0 = selectionStart - offs;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
213 x1 = selectionDuration;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
214 painter.fillRect(x0, 0, x1, height(), eventColor);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
215
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
216 painter.drawLine(x0, 0, x0, height());
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
217 painter.drawLine(x1, 0, x1, height());
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
218 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
219 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
220
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
221
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 if (time >= offs * scale && time - offs <= width() * scale)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 int xc = time - offs;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
225 painter.save();
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226 painter.scale(scale, 1);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 painter.setPen(markerColor);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228 painter.drawLine(xc, 0, xc, height());
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
229 painter.restore();
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
234 void QEDTimelineTrackDisplay::mousePressEvent(QMouseEvent *ev)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235 {
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
236 switch (ev->button())
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237 {
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
238 case Qt::LeftButton:
1738
b4992d9f72fe Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 651
diff changeset
239 if (parent.getActiveTrack() != this)
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
240 emit trackActivated(this);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
241
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
242 selectionPoint = ev->pos();
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
243 selectionOffs = offs / scale;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
244 selecting = false;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
245 break;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
246
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
247 case Qt::RightButton:
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
248 dragPoint = ev->pos();
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
249 dragOffs = offs / scale;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
250 dragging = false;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
251 break;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
252
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
253 default:
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
254 break;
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
259 void QEDTimelineTrackDisplay::mouseMoveEvent(QMouseEvent *ev)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
260 {
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
261 if ((ev->buttons() & Qt::LeftButton) && ev->pos().x() != selectionPoint.x())
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
262 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
263 selecting = true;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
264 setSelection(selectionOffs, offs + (ev->pos().x() - selectionPoint.x()) / scale);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
265 }
1738
b4992d9f72fe Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 651
diff changeset
266
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
267 if ((ev->buttons() & Qt::RightButton) && ev->pos().x() != dragPoint.x())
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
268 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
269 dragging = true;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
270 setOffset(dragOffs - (ev->pos().x() - dragPoint.x()) / scale);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
271 }
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
272 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
274
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
275 void QEDTimelineTrackDisplay::mouseReleaseEvent(QMouseEvent *ev)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
276 {
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
277 if (ev->button() == Qt::LeftButton)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
278 {
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
279 if (selecting)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
280 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
281 selecting = false;
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
282 setSelection(selectionOffs + (ev->pos().x() - selectionPoint.x()) / scale);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
283 }
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
284 }
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
285 else
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
286 if (ev->button() == Qt::RightButton && !dragging)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
287 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
288 setTime(offs + getTimeFromCoord(ev->pos().x()));
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
289 }
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
290 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
291
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
292
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
293 QEDTimelineTrackView::QEDTimelineTrackView(QWidget *parent) : QWidget(parent)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
294 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
295 QHBoxLayout *mainLayout = new QHBoxLayout(this);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
296 mainLayout->setMargin(0);
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
297 track = new QEDTimelineTrackDisplay(this);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
298
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
299 QFrame *infoLayoutContainer = new QFrame(this);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
300 infoLayoutContainer->setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
301 infoLayoutContainer->setLineWidth(2);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
302 infoLayoutContainer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
303 infoLayoutContainer->setFixedWidth(200);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
304
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
305 QVBoxLayout *infoLayout = new QVBoxLayout(infoLayoutContainer);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
306 infoLayout->setMargin(0);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
307 infoName = new QLineEdit();
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
308 infoName->setFrame(false);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
309 infoName->setMaxLength(DT_MAX_NAME_LENGTH);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
310 infoName->setStyleSheet("QLineEdit { background-color: black; color: white; padding: 2px; }");
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
311 connect(infoName, SIGNAL(textEdited(const QString&)), this, SLOT(slotTrackNameChanged(const QString&)));
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
312 infoLayout->addWidget(infoName);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
313
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
314
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
315 enabledCheck = new QCheckBox("Enabled");
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
316 infoLayout->addWidget(enabledCheck);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
317 connect(enabledCheck, SIGNAL(toggled(bool)), this, SLOT(slotTrackEnabledChanged(bool)));
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
318
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
319 infoData = new QLabel();
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
320 infoData->setStyleSheet("QLabel { padding: 2px; }");
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
321 infoLayout->addWidget(infoData);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
322
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
323 mainLayout->addWidget(infoLayoutContainer);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
324 mainLayout->addWidget(track);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
325 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
326
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
327
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
328 void QEDTimelineTrackView::update()
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
329 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
330 if (track != NULL && track->track)
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
331 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
332 infoName->setText(QString(track->track->name));
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
333 enabledCheck->setChecked(track->track->enabled);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
334 infoData->setText(QString("<b>%1</b> events").arg(track->track->nevents));
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
335 }
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
336 else
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
337 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
338 infoName->setText("");
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
339 infoData->setText("-");
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
340 enabledCheck->setChecked(false);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
341 }
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
342
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
343 QWidget::update();
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
344 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
345
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
346
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
347 void QEDTimelineTrackView::setTrack(DMTimelineTrack *mtrack)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
348 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
349 track->setTrack(mtrack);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
350 update();
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
351 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
352
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
353
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
354 void QEDTimelineTrackView::slotTrackEnabledChanged(bool value)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
355 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
356 track->track->enabled = value;
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
357 emit trackChanged();
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
358 }
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
359
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
360
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
361 void QEDTimelineTrackView::slotTrackNameChanged(const QString & text)
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
362 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
363 QByteArray ba = text.toUtf8();
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
364 track->track->name = dm_strdup(ba.constData());
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
365 emit trackChanged();
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
366 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
367
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
368
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
369
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
370 QEDTimelineView::QEDTimelineView(QWidget *parent) : QWidget(parent)
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
371 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
372 layout = new QVBoxLayout(this);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
373 tl = NULL;
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
374 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
375
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
376
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
377 void QEDTimelineView::setTimeline(EDTimelineObject *mtl)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
378 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
379 tl = mtl;
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
380
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
381 delete layout;
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
382 layout = new QVBoxLayout(this);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
383 layout->setMargin(0);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
384
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
385 tracks.clear();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
386
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
387 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
388 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
389 for (int track = 0; track < tl->tl->ntracks; track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
390 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
391 QEDTimelineTrackView *vtr = new QEDTimelineTrackView(this);
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
392 vtr->setTrack(tl->tl->tracks[track]);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
393 tracks.append(vtr);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
394 layout->addWidget(vtr);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
395 connect(vtr, SIGNAL(trackChanged()), this, SLOT(slotTimelineChanged()));
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
396 connect(vtr, SIGNAL(timeChanged(float)), this, SLOT(slotTimeChanged(float)));
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
397 connect(vtr, SIGNAL(offsetChanged(float)), this, SLOT(slotOffsetChanged(float)));
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
398 connect(vtr, SIGNAL(selectionChanged(float,float)), this, SLOT(slotSelectionChanged(float,float)));
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
399 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
400 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
401 update();
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
402 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
403
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
404
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
405 void QEDTimelineView::slotTimelineChanged()
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
406 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
407 if (tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
408 {
401
2fdf440ea66a Fix some segfaults, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
409 tl->touch();
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
410 emit timelineChanged();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
411 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
412 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
413
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
414
1738
b4992d9f72fe Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 651
diff changeset
415 void QEDTimelineView::setTime(const float mtime)
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
416 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
417 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
418 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
419 QList<QEDTimelineTrackView *>::iterator track;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
420 for (track = tracks.begin(); track != tracks.end(); track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
421 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
422 (*track)->track->setTime(mtime);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
423 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
424 update();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
425 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
426 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
427
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
428
1738
b4992d9f72fe Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 651
diff changeset
429 void QEDTimelineView::setOffset(const float moffs)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
430 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
431 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
432 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
433 QList<QEDTimelineTrackView *>::iterator track;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
434 for (track = tracks.begin(); track != tracks.end(); track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
435 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
436 (*track)->track->setOffset(moffs);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
437 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
438 update();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
439 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
440 }
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
441
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
442
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
443 void QEDTimelineView::setScale(const float mscale)
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
444 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
445 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
446 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
447 QList<QEDTimelineTrackView *>::iterator track;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
448 for (track = tracks.begin(); track != tracks.end(); track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
449 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
450 (*track)->track->setScale(mscale);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
451 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
452 update();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
453 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
454 }
565
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
455
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
456
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
457 QList<DMTimelineEvent *> QEDTimelineView::getEventsAt(const int time)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
458 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
459 if (tl != NULL && tl->tl != NULL &&
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
460 activeTrack >= 0 && activeTrack < tl->tl->ntracks)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
461 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
462 return tracks[activeTrack]->tl->getEventsAt(time);
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
463 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
464 else
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
465 return QList<DMTimelineEvent *>();
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
466 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
467
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
468
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
469 QList<DMTimelineEvent *> QEDTimelineView::getEventsForRange(const int start, const int duration)
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
470 {
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
471 }
a4666c9e1336 Moar work on the editor (broken).
Matti Hamalainen <ccr@tnsp.org>
parents: 403
diff changeset
472