annotate edtimeline.cpp @ 409:b529b7e8ff83

Various improvements and cruft cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 03 Nov 2012 02:40:07 +0200
parents d34922e6a244
children a4666c9e1336
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 void QEDTimelineTrackDisplay::setTime(const int mtime)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 time = mtime;
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
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
39 void QEDTimelineTrackDisplay::setOffset(const int moffs)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 offs = moffs;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
45 void QEDTimelineTrackDisplay::setScale(const float mscale)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 if (mscale > 0.05)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 scale = mscale;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
52 float QEDTimelineTrackDisplay::getTimeScale(float value)
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
53 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
54 return value * scale;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
55 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
56
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
57
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
58 float QEDTimelineTrackDisplay::getTimeFromCoord(float value)
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
59 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
60 return value * scale * 1000.0f;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
61 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
62
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
63
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
64 void QEDTimelineTrackDisplay::paintEvent(QPaintEvent *)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 {
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
66 if (track == NULL)
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
67 return;
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
68
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 QColor eventColor(150, 150, 150);
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
70 QColor invalidEventColor(250, 150, 150);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
71 QColor eventBorder(200, 250, 200);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
72 QColor eventParam(200, 150, 100);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
73 QColor eventText(255, 255, 255);
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 QColor markerColor(255,255,255);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
76 QFont fantti;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
77 fantti.setFamily("Arial");
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
78 fantti.setPointSizeF(8.0f);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
79 fantti.setStyleHint(QFont::SansSerif);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
80
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 QPainter painter(this);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 painter.setRenderHint(QPainter::Antialiasing);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
84
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 painter.save();
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 painter.scale(scale, 1);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
88 float wd = getTimeScale(width());
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 for (int event = 0; event < track->nevents; event++)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 DMTimelineEvent *ev = track->events[event];
402
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
92
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
93 float x0 = getTimeScale(ev->start - offs),
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
94 x1 = getTimeScale(ev->start + ev->duration - offs);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
95
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
96 if ((x0 >= 0 && x0 < wd) || (x0 < 0 && x1 >= 0))
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
97 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
98 painter.setFont(fantti);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
99 painter.setBrush(ev->effect != NULL ? eventColor : invalidEventColor);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
100 painter.setPen(eventBorder);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
101 x0 = ev->start - offs;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
102 x1 = ev->duration;
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
103 painter.fillRect(x0, 0, x1, height(), eventColor);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
104
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
105 painter.setBrush(eventText);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
106 if (ev->effect != NULL)
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
107 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
108 QString name(ev->effect->name);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
109 painter.drawText(QPointF(x0 + 2, 10), name);
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
110 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
111 else
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
112 {
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
113 painter.drawText(QPointF(x0 + 2, 10), "INVALID");
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
114 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
115 }
0f290af63fc1 Timeline event drawing prototype works.
Matti Hamalainen <ccr@tnsp.org>
parents: 401
diff changeset
116
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
119 painter.restore();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
120
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 if (time >= offs * scale && time - offs <= width() * scale)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 int xc = time - offs;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
124 painter.save();
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 painter.scale(scale, 1);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 painter.setPen(markerColor);
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 painter.drawLine(xc, 0, xc, height());
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
128 painter.restore();
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
133 void QEDTimelineTrackDisplay::mousePressEvent(QMouseEvent *ev)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 /*
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 if (ev->button() == Qt::LeftButton)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 lastPoint = ev->pos();
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 scribbling = true;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 */
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
145 void QEDTimelineTrackDisplay::mouseMoveEvent(QMouseEvent *ev)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 /*
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 if ((ev->buttons() & Qt::LeftButton) && scribbling)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 drawLineTo(ev->pos());
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 */
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
154 void QEDTimelineTrackDisplay::mouseReleaseEvent(QMouseEvent *ev)
357
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 /*
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 if (ev->button() == Qt::LeftButton && scribbling)
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 {
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 drawLineTo(ev->pos());
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 scribbling = false;
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 }
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 */
1b8362a26692 Work towards Qt based editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
164
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
165
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
166 QEDTimelineTrackView::QEDTimelineTrackView(QWidget *parent) : QWidget(parent)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
167 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
168 QHBoxLayout *mainLayout = new QHBoxLayout(this);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
169 mainLayout->setMargin(0);
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
170 track = new QEDTimelineTrackDisplay(this);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
171
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
172 QFrame *infoLayoutContainer = new QFrame(this);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
173 infoLayoutContainer->setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
174 infoLayoutContainer->setLineWidth(2);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
175 infoLayoutContainer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
176 infoLayoutContainer->setFixedWidth(200);
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
177
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
178 QVBoxLayout *infoLayout = new QVBoxLayout(infoLayoutContainer);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
179 infoLayout->setMargin(0);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
180 // QVBoxLayout *infoLayout = new QVBoxLayout();
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
181 infoName = new QLineEdit();
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
182 infoName->setFrame(false);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
183 infoName->setMaxLength(DT_MAX_NAME_LENGTH);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
184 infoName->setStyleSheet("QLineEdit { background-color: black; color: white; padding: 2px; }");
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
185 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
186 infoLayout->addWidget(infoName);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
187
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
188
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
189 enabledCheck = new QCheckBox("Enabled");
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
190 infoLayout->addWidget(enabledCheck);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
191 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
192
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
193 infoData = new QLabel();
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
194 infoData->setStyleSheet("QLabel { padding: 2px; }");
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
195 infoLayout->addWidget(infoData);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
196
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
197 mainLayout->addWidget(infoLayoutContainer);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
198 // mainLayout->addLayout(infoLayout);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
199 mainLayout->addWidget(track);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
200 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
201
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
202
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
203 void QEDTimelineTrackView::update()
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
204 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
205 if (track != NULL && track->track)
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
206 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
207 infoName->setText(QString(track->track->name));
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
208 enabledCheck->setChecked(track->track->enabled);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
209 infoData->setText(QString("<b>%1</b> events").arg(track->track->nevents));
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
210 }
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
211 else
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
212 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
213 infoName->setText("");
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
214 infoData->setText("-");
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
215 enabledCheck->setChecked(false);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
216 }
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
217
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
218 QWidget::update();
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
219 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
220
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
221
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
222 void QEDTimelineTrackView::setTrack(DMTimelineTrack *mtrack)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
223 {
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
224 track->setTrack(mtrack);
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
225 update();
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
226 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
227
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
228
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
229 void QEDTimelineTrackView::slotTrackEnabledChanged(bool value)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
230 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
231 track->track->enabled = value;
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
232 emit trackChanged();
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
233 }
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
234
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
235
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
236 void QEDTimelineTrackView::slotTrackNameChanged(const QString & text)
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
237 {
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
238 QByteArray ba = text.toUtf8();
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
239 track->track->name = dm_strdup(ba.constData());
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
240 emit trackChanged();
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
241 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
242
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
243
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
244
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
245 QEDTimelineView::QEDTimelineView(QWidget *parent) : QWidget(parent)
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
246 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
247 layout = new QVBoxLayout(this);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
248 tl = NULL;
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
249 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
250
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
251
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
252 void QEDTimelineView::setTimeline(EDTimelineObject *mtl)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
253 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
254 tl = mtl;
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
255
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
256 delete layout;
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
257 layout = new QVBoxLayout(this);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
258 layout->setMargin(0);
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
259
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
260 tracks.clear();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
261
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
262 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
263 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
264 for (int track = 0; track < tl->tl->ntracks; track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
265 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
266 QEDTimelineTrackView *vtr = new QEDTimelineTrackView(this);
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
267 vtr->setTrack(tl->tl->tracks[track]);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
268 tracks.append(vtr);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
269 layout->addWidget(vtr);
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
270 connect(vtr, SIGNAL(trackChanged()), this, SLOT(slotTimelineChanged()));
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
271 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
272 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
273 update();
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
274 }
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
275
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
276
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
277 void QEDTimelineView::slotTimelineChanged()
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
278 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
279 if (tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
280 {
401
2fdf440ea66a Fix some segfaults, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 398
diff changeset
281 tl->touch();
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
282 emit timelineChanged();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
283 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
284 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
285
398
8660c6005032 More work.
Matti Hamalainen <ccr@tnsp.org>
parents: 397
diff changeset
286
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
287 void QEDTimelineView::setTime(const int mtime)
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
288 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
289 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
290 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
291 QList<QEDTimelineTrackView *>::iterator track;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
292 for (track = tracks.begin(); track != tracks.end(); track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
293 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
294 (*track)->track->setTime(mtime);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
295 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
296 update();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
297 }
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
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
300
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
301 void QEDTimelineView::setOffset(const int moffs)
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
302 {
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
303 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
304 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
305 QList<QEDTimelineTrackView *>::iterator track;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
306 for (track = tracks.begin(); track != tracks.end(); track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
307 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
308 (*track)->track->setOffset(moffs);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
309 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
310 update();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
311 }
393
5137db55f00b More work towards the editor ..
Matti Hamalainen <ccr@tnsp.org>
parents: 386
diff changeset
312 }
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
313
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
314
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
315 void QEDTimelineView::setScale(const float mscale)
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
316 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
317 if (tl != NULL && tl->tl != NULL)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
318 {
403
d34922e6a244 Even more work towards the editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
319 QList<QEDTimelineTrackView *>::iterator track;
397
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
320 for (track = tracks.begin(); track != tracks.end(); track++)
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
321 {
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
322 (*track)->track->setScale(mscale);
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
323 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
324 update();
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
325 }
9993873ff655 More work towards editor.
Matti Hamalainen <ccr@tnsp.org>
parents: 393
diff changeset
326 }