Merge lp:~mixxxdevelopers/mixxx/features_waveform into lp:~mixxxdevelopers/mixxx/features_sqlite
- features_waveform
- Merge into features_sqlite
Proposed by
RJ Skerry-Ryan
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~mixxxdevelopers/mixxx/features_waveform |
Merge into: | lp:~mixxxdevelopers/mixxx/features_sqlite |
Diff against target: |
2700 lines (+1330/-318) 30 files modified
mixxx/res/skins/Collusion (1280)/skin.xml (+34/-4) mixxx/res/skins/Collusion (1280-WS)/skin.xml (+34/-4) mixxx/res/skins/hercules/skin.xml (+34/-0) mixxx/res/skins/nCut/skin.xml (+34/-0) mixxx/res/skins/outline/skin.xml (+34/-4) mixxx/res/skins/outlineClose/skin.xml (+34/-4) mixxx/res/skins/outlineMini/skin.xml (+49/-20) mixxx/res/skins/outlineNetbook/skin.xml (+34/-4) mixxx/res/skins/outlineSmall/skin.xml (+35/-5) mixxx/res/skins/traditional/skin.xml (+34/-0) mixxx/src/SConscript (+2/-0) mixxx/src/cachingreader.cpp (+1/-0) mixxx/src/configobject.cpp (+10/-1) mixxx/src/configobject.h (+1/-1) mixxx/src/engine/loopingcontrol.cpp (+13/-2) mixxx/src/engine/loopingcontrol.h (+1/-0) mixxx/src/waveform/renderobject.cpp (+6/-7) mixxx/src/waveform/renderobject.h (+6/-5) mixxx/src/waveform/waveformrenderer.cpp (+103/-82) mixxx/src/waveform/waveformrenderer.h (+13/-10) mixxx/src/waveform/waveformrendermark.cpp (+224/-29) mixxx/src/waveform/waveformrendermark.h (+21/-6) mixxx/src/waveform/waveformrendermarkrange.cpp (+233/-0) mixxx/src/waveform/waveformrendermarkrange.h (+60/-0) mixxx/src/widget/wglwaveformviewer.cpp (+14/-48) mixxx/src/widget/wglwaveformviewer.h (+3/-7) mixxx/src/widget/woverview.cpp (+216/-55) mixxx/src/widget/woverview.h (+37/-8) mixxx/src/widget/wwaveformviewer.cpp (+8/-8) mixxx/src/widget/wwidget.cpp (+2/-4) |
To merge this branch: | bzr merge lp:~mixxxdevelopers/mixxx/features_waveform |
Related bugs: | |
Related blueprints: |
Tiling Waveform Renderer
(Low)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Santoni | Approve | ||
Review via email: mp+14973@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
RJ Skerry-Ryan (rryan) wrote : | # |
Revision history for this message
RJ Skerry-Ryan (rryan) wrote : | # |
For some reason launchpad is showing merge errors. The merge works perfectly when I do it by hand.
Revision history for this message
Albert Santoni (gamegod) wrote : | # |
Looks good, feel free to merge whenever you have a chance.
WaveformRenderer's getting pretty big though, eh?
Revision history for this message
Albert Santoni (gamegod) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'mixxx/res/skins/Collusion (1280)/skin.xml' |
2 | --- mixxx/res/skins/Collusion (1280)/skin.xml 2009-02-07 08:42:10 +0000 |
3 | +++ mixxx/res/skins/Collusion (1280)/skin.xml 2009-11-18 00:45:30 +0000 |
4 | @@ -1056,8 +1056,23 @@ |
5 | <SignalColor>#d1d1d1</SignalColor> |
6 | <BeatColor>#48839b</BeatColor> |
7 | <MarkerColor>#48839b</MarkerColor> |
8 | - <FisheyeColor>#222222</FisheyeColor> |
9 | - <Zoom>true</Zoom> |
10 | + <Mark> |
11 | + <Control>cue_point</Control> |
12 | + <Text>CUE</Text> |
13 | + </Mark> |
14 | + <MarkRange> |
15 | + <StartControl>loop_start_position</StartControl> |
16 | + <EndControl>loop_end_position</EndControl> |
17 | + <EnabledControl>loop_enabled</EnabledControl> |
18 | + </MarkRange> |
19 | + <Mark> |
20 | + <Control>loop_start_position</Control> |
21 | + <Text>IN</Text> |
22 | + </Mark> |
23 | + <Mark> |
24 | + <Control>loop_end_position</Control> |
25 | + <Text>OUT</Text> |
26 | + </Mark> |
27 | </Visual> |
28 | |
29 | <Visual> |
30 | @@ -1069,8 +1084,23 @@ |
31 | <SignalColor>#d1d1d1</SignalColor> |
32 | <BeatColor>#9b4848</BeatColor> |
33 | <MarkerColor>#9b4848</MarkerColor> |
34 | - <FisheyeColor>#222222</FisheyeColor> |
35 | - <Zoom>true</Zoom> |
36 | + <Mark> |
37 | + <Control>cue_point</Control> |
38 | + <Text>CUE</Text> |
39 | + </Mark> |
40 | + <MarkRange> |
41 | + <StartControl>loop_start_position</StartControl> |
42 | + <EndControl>loop_end_position</EndControl> |
43 | + <EnabledControl>loop_enabled</EnabledControl> |
44 | + </MarkRange> |
45 | + <Mark> |
46 | + <Control>loop_start_position</Control> |
47 | + <Text>IN</Text> |
48 | + </Mark> |
49 | + <Mark> |
50 | + <Control>loop_end_position</Control> |
51 | + <Text>OUT</Text> |
52 | + </Mark> |
53 | </Visual> |
54 | |
55 | <XSliderComposed> |
56 | |
57 | === modified file 'mixxx/res/skins/Collusion (1280-WS)/skin.xml' |
58 | --- mixxx/res/skins/Collusion (1280-WS)/skin.xml 2009-02-07 08:42:10 +0000 |
59 | +++ mixxx/res/skins/Collusion (1280-WS)/skin.xml 2009-11-18 00:45:30 +0000 |
60 | @@ -1056,8 +1056,23 @@ |
61 | <SignalColor>#d1d1d1</SignalColor> |
62 | <BeatColor>#48839b</BeatColor> |
63 | <MarkerColor>#48839b</MarkerColor> |
64 | - <FisheyeColor>#222222</FisheyeColor> |
65 | - <Zoom>true</Zoom> |
66 | + <Mark> |
67 | + <Control>cue_point</Control> |
68 | + <Text>CUE</Text> |
69 | + </Mark> |
70 | + <MarkRange> |
71 | + <StartControl>loop_start_position</StartControl> |
72 | + <EndControl>loop_end_position</EndControl> |
73 | + <EnabledControl>loop_enabled</EnabledControl> |
74 | + </MarkRange> |
75 | + <Mark> |
76 | + <Control>loop_start_position</Control> |
77 | + <Text>IN</Text> |
78 | + </Mark> |
79 | + <Mark> |
80 | + <Control>loop_end_position</Control> |
81 | + <Text>OUT</Text> |
82 | + </Mark> |
83 | </Visual> |
84 | |
85 | <Visual> |
86 | @@ -1069,8 +1084,23 @@ |
87 | <SignalColor>#d1d1d1</SignalColor> |
88 | <BeatColor>#9b4848</BeatColor> |
89 | <MarkerColor>#9b4848</MarkerColor> |
90 | - <FisheyeColor>#222222</FisheyeColor> |
91 | - <Zoom>true</Zoom> |
92 | + <Mark> |
93 | + <Control>cue_point</Control> |
94 | + <Text>CUE</Text> |
95 | + </Mark> |
96 | + <MarkRange> |
97 | + <StartControl>loop_start_position</StartControl> |
98 | + <EndControl>loop_end_position</EndControl> |
99 | + <EnabledControl>loop_enabled</EnabledControl> |
100 | + </MarkRange> |
101 | + <Mark> |
102 | + <Control>loop_start_position</Control> |
103 | + <Text>IN</Text> |
104 | + </Mark> |
105 | + <Mark> |
106 | + <Control>loop_end_position</Control> |
107 | + <Text>OUT</Text> |
108 | + </Mark> |
109 | </Visual> |
110 | |
111 | <XSliderComposed> |
112 | |
113 | === modified file 'mixxx/res/skins/hercules/skin.xml' |
114 | --- mixxx/res/skins/hercules/skin.xml 2009-02-07 08:42:10 +0000 |
115 | +++ mixxx/res/skins/hercules/skin.xml 2009-11-18 00:45:30 +0000 |
116 | @@ -199,6 +199,23 @@ |
117 | <MarkerColor>#0000ff</MarkerColor> |
118 | <FisheyeColor>#ffffff</FisheyeColor> |
119 | <Zoom>true</Zoom> |
120 | + <Mark> |
121 | + <Control>cue_point</Control> |
122 | + <Text>CUE</Text> |
123 | + </Mark> |
124 | + <MarkRange> |
125 | + <StartControl>loop_start_position</StartControl> |
126 | + <EndControl>loop_end_position</EndControl> |
127 | + <EnabledControl>loop_enabled</EnabledControl> |
128 | + </MarkRange> |
129 | + <Mark> |
130 | + <Control>loop_start_position</Control> |
131 | + <Text>IN</Text> |
132 | + </Mark> |
133 | + <Mark> |
134 | + <Control>loop_end_position</Control> |
135 | + <Text>OUT</Text> |
136 | + </Mark> |
137 | </Visual> |
138 | |
139 | <Visual> |
140 | @@ -214,6 +231,23 @@ |
141 | <MarkerColor>#ff0000</MarkerColor> |
142 | <FisheyeColor>#ffffff</FisheyeColor> |
143 | <Zoom>true</Zoom> |
144 | + <Mark> |
145 | + <Control>cue_point</Control> |
146 | + <Text>CUE</Text> |
147 | + </Mark> |
148 | + <MarkRange> |
149 | + <StartControl>loop_start_position</StartControl> |
150 | + <EndControl>loop_end_position</EndControl> |
151 | + <EnabledControl>loop_enabled</EnabledControl> |
152 | + </MarkRange> |
153 | + <Mark> |
154 | + <Control>loop_start_position</Control> |
155 | + <Text>IN</Text> |
156 | + </Mark> |
157 | + <Mark> |
158 | + <Control>loop_end_position</Control> |
159 | + <Text>OUT</Text> |
160 | + </Mark> |
161 | </Visual> |
162 | |
163 | <Text> |
164 | |
165 | === modified file 'mixxx/res/skins/nCut/skin.xml' |
166 | --- mixxx/res/skins/nCut/skin.xml 2009-02-07 08:42:10 +0000 |
167 | +++ mixxx/res/skins/nCut/skin.xml 2009-11-18 00:45:30 +0000 |
168 | @@ -1109,6 +1109,23 @@ |
169 | <MarkerColor>#ffffff</MarkerColor> |
170 | <CueColor>#ff0000</CueColor> |
171 | <FisheyeColor>#404040</FisheyeColor> |
172 | + <Mark> |
173 | + <Control>cue_point</Control> |
174 | + <Text>CUE</Text> |
175 | + </Mark> |
176 | + <MarkRange> |
177 | + <StartControl>loop_start_position</StartControl> |
178 | + <EndControl>loop_end_position</EndControl> |
179 | + <EnabledControl>loop_enabled</EnabledControl> |
180 | + </MarkRange> |
181 | + <Mark> |
182 | + <Control>loop_start_position</Control> |
183 | + <Text>IN</Text> |
184 | + </Mark> |
185 | + <Mark> |
186 | + <Control>loop_end_position</Control> |
187 | + <Text>OUT</Text> |
188 | + </Mark> |
189 | </Visual> |
190 | |
191 | <Visual> |
192 | @@ -1123,6 +1140,23 @@ |
193 | <MarkerColor>#ffffff</MarkerColor> |
194 | <CueColor>#ff0000</CueColor> |
195 | <FisheyeColor>#404040</FisheyeColor> |
196 | + <Mark> |
197 | + <Control>cue_point</Control> |
198 | + <Text>CUE</Text> |
199 | + </Mark> |
200 | + <MarkRange> |
201 | + <StartControl>loop_start_position</StartControl> |
202 | + <EndControl>loop_end_position</EndControl> |
203 | + <EnabledControl>loop_enabled</EnabledControl> |
204 | + </MarkRange> |
205 | + <Mark> |
206 | + <Control>loop_start_position</Control> |
207 | + <Text>IN</Text> |
208 | + </Mark> |
209 | + <Mark> |
210 | + <Control>loop_end_position</Control> |
211 | + <Text>OUT</Text> |
212 | + </Mark> |
213 | </Visual> |
214 | |
215 | <!-- |
216 | |
217 | === modified file 'mixxx/res/skins/outline/skin.xml' |
218 | --- mixxx/res/skins/outline/skin.xml 2009-10-10 02:25:55 +0000 |
219 | +++ mixxx/res/skins/outline/skin.xml 2009-11-18 00:45:30 +0000 |
220 | @@ -1129,8 +1129,23 @@ |
221 | <SignalColor>#00ff00</SignalColor><HfcColor>#FFC115</HfcColor> |
222 | <BeatColor>#0000f0</BeatColor> |
223 | <MarkerColor>#0000ff</MarkerColor> |
224 | - <FisheyeColor>#ffffff</FisheyeColor> |
225 | - <Zoom>true</Zoom> |
226 | + <Mark> |
227 | + <Control>cue_point</Control> |
228 | + <Text>CUE</Text> |
229 | + </Mark> |
230 | + <MarkRange> |
231 | + <StartControl>loop_start_position</StartControl> |
232 | + <EndControl>loop_end_position</EndControl> |
233 | + <EnabledControl>loop_enabled</EnabledControl> |
234 | + </MarkRange> |
235 | + <Mark> |
236 | + <Control>loop_start_position</Control> |
237 | + <Text>IN</Text> |
238 | + </Mark> |
239 | + <Mark> |
240 | + <Control>loop_end_position</Control> |
241 | + <Text>OUT</Text> |
242 | + </Mark> |
243 | </Visual> |
244 | |
245 | <Visual> |
246 | @@ -1142,8 +1157,23 @@ |
247 | <SignalColor>#00ff00</SignalColor><HfcColor>#FFC115</HfcColor> |
248 | <BeatColor>#f00000</BeatColor> |
249 | <MarkerColor>#ff0000</MarkerColor> |
250 | - <FisheyeColor>#ffffff</FisheyeColor> |
251 | - <Zoom>true</Zoom> |
252 | + <Mark> |
253 | + <Control>cue_point</Control> |
254 | + <Text>CUE</Text> |
255 | + </Mark> |
256 | + <MarkRange> |
257 | + <StartControl>loop_start_position</StartControl> |
258 | + <EndControl>loop_end_position</EndControl> |
259 | + <EnabledControl>loop_enabled</EnabledControl> |
260 | + </MarkRange> |
261 | + <Mark> |
262 | + <Control>loop_start_position</Control> |
263 | + <Text>IN</Text> |
264 | + </Mark> |
265 | + <Mark> |
266 | + <Control>loop_end_position</Control> |
267 | + <Text>OUT</Text> |
268 | + </Mark> |
269 | </Visual> |
270 | |
271 | <Text> |
272 | |
273 | === modified file 'mixxx/res/skins/outlineClose/skin.xml' |
274 | --- mixxx/res/skins/outlineClose/skin.xml 2009-03-17 13:49:05 +0000 |
275 | +++ mixxx/res/skins/outlineClose/skin.xml 2009-11-18 00:45:30 +0000 |
276 | @@ -808,8 +808,23 @@ |
277 | <SignalColor>#00ff00</SignalColor> |
278 | <BeatColor>#0000f0</BeatColor> |
279 | <MarkerColor>#0000ff</MarkerColor> |
280 | - <FisheyeColor>#ffffff</FisheyeColor> |
281 | - <Zoom>true</Zoom> |
282 | + <Mark> |
283 | + <Control>cue_point</Control> |
284 | + <Text>CUE</Text> |
285 | + </Mark> |
286 | + <MarkRange> |
287 | + <StartControl>loop_start_position</StartControl> |
288 | + <EndControl>loop_end_position</EndControl> |
289 | + <EnabledControl>loop_enabled</EnabledControl> |
290 | + </MarkRange> |
291 | + <Mark> |
292 | + <Control>loop_start_position</Control> |
293 | + <Text>IN</Text> |
294 | + </Mark> |
295 | + <Mark> |
296 | + <Control>loop_end_position</Control> |
297 | + <Text>OUT</Text> |
298 | + </Mark> |
299 | </Visual> |
300 | |
301 | <Visual> |
302 | @@ -821,8 +836,23 @@ |
303 | <SignalColor>#00ff00</SignalColor> |
304 | <BeatColor>#f00000</BeatColor> |
305 | <MarkerColor>#ff0000</MarkerColor> |
306 | - <FisheyeColor>#ffffff</FisheyeColor> |
307 | - <Zoom>true</Zoom> |
308 | + <Mark> |
309 | + <Control>cue_point</Control> |
310 | + <Text>CUE</Text> |
311 | + </Mark> |
312 | + <MarkRange> |
313 | + <StartControl>loop_start_position</StartControl> |
314 | + <EndControl>loop_end_position</EndControl> |
315 | + <EnabledControl>loop_enabled</EnabledControl> |
316 | + </MarkRange> |
317 | + <Mark> |
318 | + <Control>loop_start_position</Control> |
319 | + <Text>IN</Text> |
320 | + </Mark> |
321 | + <Mark> |
322 | + <Control>loop_end_position</Control> |
323 | + <Text>OUT</Text> |
324 | + </Mark> |
325 | </Visual> |
326 | |
327 | <Text> |
328 | |
329 | === modified file 'mixxx/res/skins/outlineMini/skin.xml' |
330 | --- mixxx/res/skins/outlineMini/skin.xml 2009-02-07 08:42:10 +0000 |
331 | +++ mixxx/res/skins/outlineMini/skin.xml 2009-11-18 00:45:30 +0000 |
332 | @@ -15,7 +15,7 @@ |
333 | <VFact>0.7</VFact> |
334 | <HFact>0.3</HFact> |
335 | </HSVTweak> |
336 | - |
337 | + |
338 | <HSVTweak> |
339 | <SMax>50</SMax> |
340 | <HFact>0</HFact> |
341 | @@ -23,7 +23,7 @@ |
342 | <SConst>120</SConst> |
343 | <VConst>-10</VConst> |
344 | </HSVTweak> |
345 | - |
346 | + |
347 | </Filters> |
348 | </Scheme> |
349 | <Scheme> |
350 | @@ -154,7 +154,7 @@ |
351 | </PushButton> |
352 | |
353 | <PushButton> |
354 | - <Tooltip>Change playback rate |
355 | + <Tooltip>Change playback rate |
356 | (left/right click: large/small effect)</Tooltip> |
357 | <NumberStates>1</NumberStates> |
358 | <State> |
359 | @@ -176,7 +176,7 @@ |
360 | </PushButton> |
361 | |
362 | <PushButton> |
363 | - <Tooltip>Change playback rate |
364 | + <Tooltip>Change playback rate |
365 | (left/right click: large/small effect)</Tooltip> |
366 | <NumberStates>1</NumberStates> |
367 | <State> |
368 | @@ -198,7 +198,7 @@ |
369 | </PushButton> |
370 | |
371 | <PushButton> |
372 | - <Tooltip>Change playback rate |
373 | + <Tooltip>Change playback rate |
374 | (left/right click: large/small effect)</Tooltip> |
375 | <NumberStates>1</NumberStates> |
376 | <State> |
377 | @@ -220,7 +220,7 @@ |
378 | </PushButton> |
379 | |
380 | <PushButton> |
381 | - <Tooltip>Temporary change playback rate |
382 | + <Tooltip>Temporary change playback rate |
383 | (left/right click: large/small effect)</Tooltip> |
384 | <NumberStates>1</NumberStates> |
385 | <State> |
386 | @@ -252,7 +252,7 @@ |
387 | </PushButton> |
388 | |
389 | <PushButton> |
390 | - <Tooltip>Temporary change playback rate |
391 | + <Tooltip>Temporary change playback rate |
392 | (left/right click: large/small effect)</Tooltip> |
393 | <NumberStates>1</NumberStates> |
394 | <State> |
395 | @@ -284,7 +284,7 @@ |
396 | </PushButton> |
397 | |
398 | <PushButton> |
399 | - <Tooltip>Temporary change playback rate |
400 | + <Tooltip>Temporary change playback rate |
401 | (left/right click: large/small effect)</Tooltip> |
402 | <NumberStates>1</NumberStates> |
403 | <State> |
404 | @@ -316,7 +316,7 @@ |
405 | </PushButton> |
406 | |
407 | <PushButton> |
408 | - <Tooltip>Temporary change playback rate |
409 | + <Tooltip>Temporary change playback rate |
410 | (left/right click: large/small effect)</Tooltip> |
411 | <NumberStates>1</NumberStates> |
412 | <State> |
413 | @@ -514,7 +514,7 @@ |
414 | |
415 | <PushButton> |
416 | <Tooltip>Go to and play (while playing), |
417 | -Set cue point (while stopped), |
418 | +Set cue point (while stopped), |
419 | Go to and stop (right-click)</Tooltip> |
420 | <NumberStates>1</NumberStates> |
421 | <State> |
422 | @@ -537,7 +537,7 @@ |
423 | |
424 | <PushButton> |
425 | <Tooltip>Go to and play (while playing), |
426 | -Set cue point (while stopped), |
427 | +Set cue point (while stopped), |
428 | Go to and stop (right-click)</Tooltip> |
429 | <NumberStates>1</NumberStates> |
430 | <State> |
431 | @@ -601,7 +601,7 @@ |
432 | </PushButton> |
433 | |
434 | <PushButton> |
435 | - <Tooltip>Left click: Fast forward, |
436 | + <Tooltip>Left click: Fast forward, |
437 | Right click: End of track</Tooltip> |
438 | <NumberStates>1</NumberStates> |
439 | <State> |
440 | @@ -628,7 +628,7 @@ |
441 | </PushButton> |
442 | |
443 | <PushButton> |
444 | - <Tooltip>Left click: Fast backward, |
445 | + <Tooltip>Left click: Fast backward, |
446 | Right click: Start of track</Tooltip> |
447 | <NumberStates>1</NumberStates> |
448 | <State> |
449 | @@ -655,7 +655,7 @@ |
450 | </PushButton> |
451 | |
452 | <PushButton> |
453 | - <Tooltip>Left click: Fast forward, |
454 | + <Tooltip>Left click: Fast forward, |
455 | Right click: End of track</Tooltip> |
456 | <NumberStates>1</NumberStates> |
457 | <State> |
458 | @@ -682,7 +682,7 @@ |
459 | </PushButton> |
460 | |
461 | <PushButton> |
462 | - <Tooltip>Left click: Fast backward, |
463 | + <Tooltip>Left click: Fast backward, |
464 | Right click: Start of track</Tooltip> |
465 | <NumberStates>1</NumberStates> |
466 | <State> |
467 | @@ -974,11 +974,25 @@ |
468 | <SignalColor>#00ff00</SignalColor> |
469 | <BeatColor>#0000f0</BeatColor> |
470 | <MarkerColor>#0000ff</MarkerColor> |
471 | - <FisheyeColor>#ffffff</FisheyeColor> |
472 | - <Zoom>true</Zoom> |
473 | + <Mark> |
474 | + <Control>cue_point</Control> |
475 | + <Text>CUE</Text> |
476 | + </Mark> |
477 | + <MarkRange> |
478 | + <StartControl>loop_start_position</StartControl> |
479 | + <EndControl>loop_end_position</EndControl> |
480 | + <EnabledControl>loop_enabled</EnabledControl> |
481 | + </MarkRange> |
482 | + <Mark> |
483 | + <Control>loop_start_position</Control> |
484 | + <Text>IN</Text> |
485 | + </Mark> |
486 | + <Mark> |
487 | + <Control>loop_end_position</Control> |
488 | + <Text>OUT</Text> |
489 | + </Mark> |
490 | </Visual> |
491 | |
492 | - |
493 | <Visual> |
494 | <Tooltip>Drag with mouse to control sound playback. Drop tracks from external file manager here</Tooltip> |
495 | <Channel>2</Channel> |
496 | @@ -988,8 +1002,23 @@ |
497 | <SignalColor>#00ff00</SignalColor> |
498 | <BeatColor>#f00000</BeatColor> |
499 | <MarkerColor>#ff0000</MarkerColor> |
500 | - <FisheyeColor>#ffffff</FisheyeColor> |
501 | - <Zoom>true</Zoom> |
502 | + <Mark> |
503 | + <Control>cue_point</Control> |
504 | + <Text>CUE</Text> |
505 | + </Mark> |
506 | + <MarkRange> |
507 | + <StartControl>loop_start_position</StartControl> |
508 | + <EndControl>loop_end_position</EndControl> |
509 | + <EnabledControl>loop_enabled</EnabledControl> |
510 | + </MarkRange> |
511 | + <Mark> |
512 | + <Control>loop_start_position</Control> |
513 | + <Text>IN</Text> |
514 | + </Mark> |
515 | + <Mark> |
516 | + <Control>loop_end_position</Control> |
517 | + <Text>OUT</Text> |
518 | + </Mark> |
519 | </Visual> |
520 | |
521 | <!-- Track title display --> |
522 | |
523 | === modified file 'mixxx/res/skins/outlineNetbook/skin.xml' |
524 | --- mixxx/res/skins/outlineNetbook/skin.xml 2009-10-03 09:01:50 +0000 |
525 | +++ mixxx/res/skins/outlineNetbook/skin.xml 2009-11-18 00:45:30 +0000 |
526 | @@ -1111,8 +1111,23 @@ |
527 | <SignalColor>#00ff00</SignalColor> |
528 | <BeatColor>#0000f0</BeatColor> |
529 | <MarkerColor>#0000ff</MarkerColor> |
530 | - <FisheyeColor>#ffffff</FisheyeColor> |
531 | - <Zoom>true</Zoom> |
532 | + <Mark> |
533 | + <Control>cue_point</Control> |
534 | + <Text>CUE</Text> |
535 | + </Mark> |
536 | + <MarkRange> |
537 | + <StartControl>loop_start_position</StartControl> |
538 | + <EndControl>loop_end_position</EndControl> |
539 | + <EnabledControl>loop_enabled</EnabledControl> |
540 | + </MarkRange> |
541 | + <Mark> |
542 | + <Control>loop_start_position</Control> |
543 | + <Text>IN</Text> |
544 | + </Mark> |
545 | + <Mark> |
546 | + <Control>loop_end_position</Control> |
547 | + <Text>OUT</Text> |
548 | + </Mark> |
549 | </Visual> |
550 | |
551 | <Visual> |
552 | @@ -1124,8 +1139,23 @@ |
553 | <SignalColor>#00ff00</SignalColor> |
554 | <BeatColor>#f00000</BeatColor> |
555 | <MarkerColor>#ff0000</MarkerColor> |
556 | - <FisheyeColor>#ffffff</FisheyeColor> |
557 | - <Zoom>true</Zoom> |
558 | + <Mark> |
559 | + <Control>cue_point</Control> |
560 | + <Text>CUE</Text> |
561 | + </Mark> |
562 | + <MarkRange> |
563 | + <StartControl>loop_start_position</StartControl> |
564 | + <EndControl>loop_end_position</EndControl> |
565 | + <EnabledControl>loop_enabled</EnabledControl> |
566 | + </MarkRange> |
567 | + <Mark> |
568 | + <Control>loop_start_position</Control> |
569 | + <Text>IN</Text> |
570 | + </Mark> |
571 | + <Mark> |
572 | + <Control>loop_end_position</Control> |
573 | + <Text>OUT</Text> |
574 | + </Mark> |
575 | </Visual> |
576 | |
577 | <Text> |
578 | |
579 | === modified file 'mixxx/res/skins/outlineSmall/skin.xml' |
580 | --- mixxx/res/skins/outlineSmall/skin.xml 2009-03-17 13:49:05 +0000 |
581 | +++ mixxx/res/skins/outlineSmall/skin.xml 2009-11-18 00:45:30 +0000 |
582 | @@ -17,7 +17,7 @@ |
583 | <Amount>-50</Amount> |
584 | </Add> |
585 | </Filters> |
586 | - </Scheme> |
587 | + </Scheme> |
588 | <Scheme> |
589 | <Name>5pm (Classic Mixxx)</Name> |
590 | <Filters> |
591 | @@ -983,8 +983,23 @@ |
592 | <SignalColor>#00ff00</SignalColor> |
593 | <BeatColor>#0000f0</BeatColor> |
594 | <MarkerColor>#0000ff</MarkerColor> |
595 | - <FisheyeColor>#ffffff</FisheyeColor> |
596 | - <Zoom>true</Zoom> |
597 | + <Mark> |
598 | + <Control>cue_point</Control> |
599 | + <Text>CUE</Text> |
600 | + </Mark> |
601 | + <MarkRange> |
602 | + <StartControl>loop_start_position</StartControl> |
603 | + <EndControl>loop_end_position</EndControl> |
604 | + <EnabledControl>loop_enabled</EnabledControl> |
605 | + </MarkRange> |
606 | + <Mark> |
607 | + <Control>loop_start_position</Control> |
608 | + <Text>IN</Text> |
609 | + </Mark> |
610 | + <Mark> |
611 | + <Control>loop_end_position</Control> |
612 | + <Text>OUT</Text> |
613 | + </Mark> |
614 | </Visual> |
615 | |
616 | <Visual> |
617 | @@ -996,8 +1011,23 @@ |
618 | <SignalColor>#00ff00</SignalColor> |
619 | <BeatColor>#f00000</BeatColor> |
620 | <MarkerColor>#ff0000</MarkerColor> |
621 | - <FisheyeColor>#ffffff</FisheyeColor> |
622 | - <Zoom>true</Zoom> |
623 | + <Mark> |
624 | + <Control>cue_point</Control> |
625 | + <Text>CUE</Text> |
626 | + </Mark> |
627 | + <MarkRange> |
628 | + <StartControl>loop_start_position</StartControl> |
629 | + <EndControl>loop_end_position</EndControl> |
630 | + <EnabledControl>loop_enabled</EnabledControl> |
631 | + </MarkRange> |
632 | + <Mark> |
633 | + <Control>loop_start_position</Control> |
634 | + <Text>IN</Text> |
635 | + </Mark> |
636 | + <Mark> |
637 | + <Control>loop_end_position</Control> |
638 | + <Text>OUT</Text> |
639 | + </Mark> |
640 | </Visual> |
641 | |
642 | <Text> |
643 | |
644 | === modified file 'mixxx/res/skins/traditional/skin.xml' |
645 | --- mixxx/res/skins/traditional/skin.xml 2009-02-07 08:42:10 +0000 |
646 | +++ mixxx/res/skins/traditional/skin.xml 2009-11-18 00:45:30 +0000 |
647 | @@ -630,6 +630,23 @@ |
648 | <BeatColor>#0000ff</BeatColor> |
649 | <MarkerColor>#ff0000</MarkerColor> |
650 | <FisheyeColor>#404040</FisheyeColor> |
651 | + <Mark> |
652 | + <Control>cue_point</Control> |
653 | + <Text>CUE</Text> |
654 | + </Mark> |
655 | + <MarkRange> |
656 | + <StartControl>loop_start_position</StartControl> |
657 | + <EndControl>loop_end_position</EndControl> |
658 | + <EnabledControl>loop_enabled</EnabledControl> |
659 | + </MarkRange> |
660 | + <Mark> |
661 | + <Control>loop_start_position</Control> |
662 | + <Text>IN</Text> |
663 | + </Mark> |
664 | + <Mark> |
665 | + <Control>loop_end_position</Control> |
666 | + <Text>OUT</Text> |
667 | + </Mark> |
668 | </Visual> |
669 | |
670 | <Visual> |
671 | @@ -641,6 +658,23 @@ |
672 | <BeatColor>#0000ff</BeatColor> |
673 | <MarkerColor>#ff0000</MarkerColor> |
674 | <FisheyeColor>#404040</FisheyeColor> |
675 | + <Mark> |
676 | + <Control>cue_point</Control> |
677 | + <Text>CUE</Text> |
678 | + </Mark> |
679 | + <MarkRange> |
680 | + <StartControl>loop_start_position</StartControl> |
681 | + <EndControl>loop_end_position</EndControl> |
682 | + <EnabledControl>loop_enabled</EnabledControl> |
683 | + </MarkRange> |
684 | + <Mark> |
685 | + <Control>loop_start_position</Control> |
686 | + <Text>IN</Text> |
687 | + </Mark> |
688 | + <Mark> |
689 | + <Control>loop_end_position</Control> |
690 | + <Text>OUT</Text> |
691 | + </Mark> |
692 | </Visual> |
693 | |
694 | <Text> |
695 | |
696 | === modified file 'mixxx/src/SConscript' |
697 | --- mixxx/src/SConscript 2009-11-18 00:14:40 +0000 |
698 | +++ mixxx/src/SConscript 2009-11-18 00:45:31 +0000 |
699 | @@ -434,11 +434,13 @@ |
700 | widget/wwaveformviewer.cpp |
701 | widget/wglwaveformviewer.cpp |
702 | waveformviewerfactory.cpp |
703 | + waveform/renderobject.cpp |
704 | waveform/waveformrenderer.cpp |
705 | waveform/waveformrenderbackground.cpp |
706 | waveform/waveformrendersignal.cpp |
707 | waveform/waveformrendersignalpixmap.cpp |
708 | waveform/waveformrendermark.cpp |
709 | + waveform/waveformrendermarkrange.cpp |
710 | waveform/waveformrenderbeat.cpp |
711 | |
712 | |
713 | |
714 | === modified file 'mixxx/src/cachingreader.cpp' |
715 | --- mixxx/src/cachingreader.cpp 2009-10-19 01:18:59 +0000 |
716 | +++ mixxx/src/cachingreader.cpp 2009-11-18 00:45:31 +0000 |
717 | @@ -299,6 +299,7 @@ |
718 | int CachingReader::read(int sample, int num_samples, CSAMPLE* buffer) { |
719 | // Check for bogus sample numbers |
720 | Q_ASSERT(sample >= 0); |
721 | + Q_ASSERT(sample % 2 == 0); |
722 | Q_ASSERT(num_samples >= 0); |
723 | |
724 | // If asked to read 0 samples, don't do anything. (this is a perfectly |
725 | |
726 | === modified file 'mixxx/src/configobject.cpp' |
727 | --- mixxx/src/configobject.cpp 2009-09-10 05:17:56 +0000 |
728 | +++ mixxx/src/configobject.cpp 2009-11-18 00:45:31 +0000 |
729 | @@ -46,6 +46,15 @@ |
730 | item = i; |
731 | } |
732 | |
733 | +// static |
734 | +ConfigKey ConfigKey::parseCommaSeparated(QString key) { |
735 | + ConfigKey configKey; |
736 | + int comma = key.indexOf(","); |
737 | + configKey.group = key.left(comma); |
738 | + configKey.item = key.mid(comma+1); |
739 | + return configKey; |
740 | +} |
741 | + |
742 | ConfigValue::ConfigValue() |
743 | { |
744 | } |
745 | @@ -325,7 +334,7 @@ |
746 | qConfigPath = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding()); |
747 | qConfigPath.append("/Contents/Resources/"); //XXX this should really use QDir, this entire function should |
748 | #endif |
749 | - } |
750 | + } |
751 | if (qConfigPath.length() == 0) qCritical() << "qConfigPath is empty, this can not be so -- did our developer forget to define one of __UNIX__, __WINDOWS__, __APPLE__??"; |
752 | // If the directory does not end with a "/", add one |
753 | if (!qConfigPath.endsWith("/")) |
754 | |
755 | === modified file 'mixxx/src/configobject.h' |
756 | --- mixxx/src/configobject.h 2009-04-11 20:16:51 +0000 |
757 | +++ mixxx/src/configobject.h 2009-11-18 00:45:31 +0000 |
758 | @@ -48,7 +48,7 @@ |
759 | public: |
760 | ConfigKey(); |
761 | ConfigKey(QString g, QString i); |
762 | - |
763 | + static ConfigKey parseCommaSeparated(QString key); |
764 | QString group, item; |
765 | }; |
766 | |
767 | |
768 | === modified file 'mixxx/src/engine/loopingcontrol.cpp' |
769 | --- mixxx/src/engine/loopingcontrol.cpp 2009-10-18 21:14:48 +0000 |
770 | +++ mixxx/src/engine/loopingcontrol.cpp 2009-11-18 00:45:31 +0000 |
771 | @@ -37,6 +37,10 @@ |
772 | this, SLOT(slotReloopExit(double))); |
773 | m_pReloopExitButton->set(0); |
774 | |
775 | + |
776 | + m_pCOLoopEnabled = new ControlObject(ConfigKey(_group, "loop_enabled")); |
777 | + m_pCOLoopEnabled->set(0.0f); |
778 | + |
779 | m_pCOLoopStartPosition = |
780 | new ControlObject(ConfigKey(_group, "loop_start_position")); |
781 | m_pCOLoopStartPosition->set(kNoTrigger); |
782 | @@ -156,8 +160,10 @@ |
783 | m_iLoopEndSample = m_iCurrentSample; |
784 | m_pCOLoopEndPosition->set(m_iLoopEndSample); |
785 | if (m_iLoopStartSample != -1 && |
786 | - m_iLoopEndSample != -1) |
787 | + m_iLoopEndSample != -1) { |
788 | m_bLoopingEnabled = true; |
789 | + m_pCOLoopEnabled->set(1.0f); |
790 | + } |
791 | //qDebug() << "set loop_out to " << m_iLoopStartSample; |
792 | } |
793 | } |
794 | @@ -167,11 +173,14 @@ |
795 | // If we're looping, stop looping |
796 | if (m_bLoopingEnabled) { |
797 | m_bLoopingEnabled = false; |
798 | + m_pCOLoopEnabled->set(0.0f); |
799 | //qDebug() << "reloop_exit looping off"; |
800 | } else { |
801 | // If we're not looping, jump to the loop-in point and start looping |
802 | - if (m_iLoopStartSample != -1 && m_iLoopEndSample != -1) |
803 | + if (m_iLoopStartSample != -1 && m_iLoopEndSample != -1) { |
804 | m_bLoopingEnabled = true; |
805 | + m_pCOLoopEnabled->set(1.0f); |
806 | + } |
807 | //qDebug() << "reloop_exit looping on"; |
808 | } |
809 | } |
810 | @@ -181,6 +190,7 @@ |
811 | int newpos = pos; |
812 | if (newpos == -1.0f) { |
813 | m_bLoopingEnabled = false; |
814 | + m_pCOLoopEnabled->set(0.0f); |
815 | } |
816 | if (newpos >= 0 && !even(newpos)) { |
817 | newpos--; |
818 | @@ -192,6 +202,7 @@ |
819 | int newpos = pos; |
820 | if (newpos == -1.0f) { |
821 | m_bLoopingEnabled = false; |
822 | + m_pCOLoopEnabled->set(0.0f); |
823 | } |
824 | if (newpos >= 0 && !even(newpos)) { |
825 | newpos--; |
826 | |
827 | === modified file 'mixxx/src/engine/loopingcontrol.h' |
828 | --- mixxx/src/engine/loopingcontrol.h 2009-10-18 21:14:48 +0000 |
829 | +++ mixxx/src/engine/loopingcontrol.h 2009-11-18 00:45:31 +0000 |
830 | @@ -55,6 +55,7 @@ |
831 | private: |
832 | ControlObject* m_pCOLoopStartPosition; |
833 | ControlObject* m_pCOLoopEndPosition; |
834 | + ControlObject* m_pCOLoopEnabled; |
835 | ControlPushButton* m_pLoopInButton; |
836 | ControlPushButton* m_pLoopOutButton; |
837 | ControlPushButton* m_pReloopExitButton; |
838 | |
839 | === modified file 'mixxx/src/waveform/renderobject.cpp' |
840 | --- mixxx/src/waveform/renderobject.cpp 2009-02-06 09:20:10 +0000 |
841 | +++ mixxx/src/waveform/renderobject.cpp 2009-11-18 00:45:31 +0000 |
842 | @@ -3,11 +3,10 @@ |
843 | |
844 | #include "renderobject.h" |
845 | |
846 | -void RenderObject::resize(int w, int h) { |
847 | -} |
848 | -void RenderObject::setup(QDomNode node) { |
849 | -} |
850 | -void RenderObject::draw(QPainter *pPainter, QPaintEvent *pEvent, QVector<float> *buffer, double playpos, double rateAdjust) { |
851 | -} |
852 | -void RenderObject::newTrack(TrackInfoObject *pTrack) { |
853 | +RenderObject::RenderObject() : QObject() { |
854 | + |
855 | +} |
856 | + |
857 | +RenderObject::~RenderObject() { |
858 | + |
859 | } |
860 | |
861 | === modified file 'mixxx/src/waveform/renderobject.h' |
862 | --- mixxx/src/waveform/renderobject.h 2009-02-06 09:20:10 +0000 |
863 | +++ mixxx/src/waveform/renderobject.h 2009-11-18 00:45:31 +0000 |
864 | @@ -12,15 +12,16 @@ |
865 | class TrackInfoObject; |
866 | |
867 | class RenderObject : public QObject { |
868 | - |
869 | + Q_OBJECT |
870 | public: |
871 | - RenderObject() {} |
872 | - ~RenderObject() {} |
873 | + explicit RenderObject(); |
874 | + virtual ~RenderObject(); |
875 | virtual void resize(int w, int h) = 0; |
876 | virtual void setup(QDomNode node) = 0; |
877 | - virtual void draw(QPainter *pPainter, QPaintEvent *pEvent, QVector<float> *buffer, double playpos, double rateAdjust) = 0; |
878 | + virtual void draw(QPainter *pPainter, QPaintEvent *pEvent, |
879 | + QVector<float> *buffer, double playpos, |
880 | + double rateAdjust) = 0; |
881 | virtual void newTrack(TrackInfoObject *pTrack) = 0; |
882 | - |
883 | }; |
884 | |
885 | #endif |
886 | |
887 | === modified file 'mixxx/src/waveform/waveformrenderer.cpp' |
888 | --- mixxx/src/waveform/waveformrenderer.cpp 2009-09-22 20:11:11 +0000 |
889 | +++ mixxx/src/waveform/waveformrenderer.cpp 2009-11-18 00:45:31 +0000 |
890 | @@ -7,6 +7,7 @@ |
891 | #include <QDebug> |
892 | #include <QDomNode> |
893 | #include <QImage> |
894 | +#include <QListIterator> |
895 | #include <QObject> |
896 | |
897 | #include <time.h> |
898 | @@ -16,6 +17,7 @@ |
899 | #include "waveformrenderbackground.h" |
900 | #include "waveformrenderbeat.h" |
901 | #include "waveformrendermark.h" |
902 | +#include "waveformrendermarkrange.h" |
903 | #include "waveformrendersignal.h" |
904 | #include "waveformrendersignalpixmap.h" |
905 | #include "trackinfoobject.h" |
906 | @@ -34,7 +36,7 @@ |
907 | double msecs_old = 0, msecs_elapsed = 0; |
908 | |
909 | while(!m_bQuit) { |
910 | - |
911 | + |
912 | if(m_iLatency != 0 && m_dPlayPos != -1 && m_dPlayPosOld != -1 && m_iNumSamples != 0) { |
913 | QTime now = QTime::currentTime(); |
914 | double msecs_elapsed = m_playPosTime.msecsTo(now); |
915 | @@ -42,67 +44,77 @@ |
916 | double adjust = (m_dPlayPos - m_dPlayPosOld) * math_min(1.0f, timeratio); |
917 | m_dPlayPosAdjust = adjust; |
918 | } |
919 | - |
920 | + |
921 | QThread::msleep(6); |
922 | } |
923 | - |
924 | + |
925 | } |
926 | |
927 | WaveformRenderer::WaveformRenderer(const char* group) : |
928 | QThread(), |
929 | + m_pGroup(group), |
930 | m_iWidth(0), |
931 | m_iHeight(0), |
932 | - m_iNumSamples(0), |
933 | bgColor(0,0,0), |
934 | signalColor(255,255,255), |
935 | colorMarker(255,255,255), |
936 | colorBeat(255,255,255), |
937 | colorCue(255,255,255), |
938 | + m_iNumSamples(0), |
939 | + m_iPlayPosTime(-1), |
940 | + m_iPlayPosTimeOld(-1), |
941 | + m_dPlayPos(0), |
942 | + m_dPlayPosOld(-1), |
943 | + m_dRate(0), |
944 | + m_dRateRange(0), |
945 | + m_dRateDir(0), |
946 | + m_iDupes(0), |
947 | + m_dPlayPosAdjust(0), |
948 | + m_iLatency(0), |
949 | + m_pSampleBuffer(NULL), |
950 | + m_pPixmap(NULL), |
951 | + m_pImage(), |
952 | m_iSubpixelsPerPixel(DEFAULT_SUBPIXELS_PER_PIXEL), |
953 | m_iPixelsPerSecond(DEFAULT_PIXELS_PER_SECOND), |
954 | - m_pImage(), |
955 | - m_dPlayPos(0), |
956 | - m_dPlayPosOld(-1), |
957 | - m_iPlayPosTime(-1), |
958 | - m_iPlayPosTimeOld(-1), |
959 | m_pTrack(NULL), |
960 | - m_pSampleBuffer(NULL), |
961 | - m_dPlayPosAdjust(0), |
962 | - m_iDupes(0), |
963 | m_bQuit(false) |
964 | { |
965 | - m_pPlayPos = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group,"visual_playposition"))); |
966 | + m_pPlayPos = new ControlObjectThreadMain( |
967 | + ControlObject::getControl(ConfigKey(group,"visual_playposition"))); |
968 | if(m_pPlayPos != NULL) |
969 | - connect(m_pPlayPos, SIGNAL(valueChanged(double)), this, SLOT(slotUpdatePlayPos(double))); |
970 | - |
971 | - |
972 | - m_pLatency = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey("[Master]","latency"))); |
973 | + connect(m_pPlayPos, SIGNAL(valueChanged(double)), |
974 | + this, SLOT(slotUpdatePlayPos(double))); |
975 | + |
976 | + |
977 | + m_pLatency = new ControlObjectThreadMain( |
978 | + ControlObject::getControl(ConfigKey("[Master]","latency"))); |
979 | if(m_pLatency != NULL) |
980 | - connect(m_pLatency, SIGNAL(valueChanged(double)), this, SLOT(slotUpdateLatency(double))); |
981 | - |
982 | + connect(m_pLatency, SIGNAL(valueChanged(double)), |
983 | + this, SLOT(slotUpdateLatency(double))); |
984 | + |
985 | m_pRenderBackground = new WaveformRenderBackground(group, this); |
986 | m_pRenderSignal = new WaveformRenderSignal(group, this); |
987 | m_pRenderSignalPixmap = new WaveformRenderSignalPixmap(group, this); |
988 | m_pRenderBeat = new WaveformRenderBeat(group, this); |
989 | - m_pRenderCue = new WaveformRenderMark(group, ConfigKey(group, "cue_point"), this); |
990 | - m_pRenderLoopStart = new WaveformRenderMark(group, ConfigKey(group, "loop_start_position"), this); |
991 | - m_pRenderLoopEnd = new WaveformRenderMark(group, ConfigKey(group, "loop_end_position"), this); |
992 | |
993 | m_pCOVisualResample = new ControlObject(ConfigKey(group, "VisualResample")); |
994 | |
995 | - m_pRate = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group, "rate"))); |
996 | + m_pRate = new ControlObjectThreadMain( |
997 | + ControlObject::getControl(ConfigKey(group, "rate"))); |
998 | if(m_pRate != NULL) { |
999 | connect(m_pRate, SIGNAL(valueChanged(double)), |
1000 | this, SLOT(slotUpdateRate(double))); |
1001 | } |
1002 | |
1003 | - m_pRateRange = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group, "rateRange"))); |
1004 | + m_pRateRange = new ControlObjectThreadMain( |
1005 | + ControlObject::getControl(ConfigKey(group, "rateRange"))); |
1006 | if(m_pRateRange != NULL) { |
1007 | connect(m_pRateRange, SIGNAL(valueChanged(double)), |
1008 | this, SLOT(slotUpdateRateRange(double))); |
1009 | } |
1010 | |
1011 | - m_pRateDir = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group, "rate_dir"))); |
1012 | + m_pRateDir = new ControlObjectThreadMain( |
1013 | + ControlObject::getControl(ConfigKey(group, "rate_dir"))); |
1014 | if (m_pRateDir) { |
1015 | connect(m_pRateDir, SIGNAL(valueChanged(double)), |
1016 | this, SLOT(slotUpdateRateDir(double))); |
1017 | @@ -117,7 +129,7 @@ |
1018 | // Wait for the thread to quit |
1019 | m_bQuit = true; |
1020 | QThread::wait(); |
1021 | - |
1022 | + |
1023 | if(m_pCOVisualResample) |
1024 | delete m_pCOVisualResample; |
1025 | m_pCOVisualResample = NULL; |
1026 | @@ -125,7 +137,7 @@ |
1027 | if(m_pRate) |
1028 | delete m_pRate; |
1029 | m_pRate = NULL; |
1030 | - |
1031 | + |
1032 | if(m_pRateRange) |
1033 | delete m_pRateRange; |
1034 | m_pRateRange = NULL; |
1035 | @@ -145,38 +157,24 @@ |
1036 | if(m_pRenderSignalPixmap) |
1037 | delete m_pRenderSignalPixmap; |
1038 | m_pRenderSignalPixmap = NULL; |
1039 | - |
1040 | + |
1041 | if(m_pRenderSignal) |
1042 | delete m_pRenderSignal; |
1043 | m_pRenderSignal = NULL; |
1044 | - |
1045 | + |
1046 | if(m_pRenderBeat) |
1047 | delete m_pRenderBeat; |
1048 | m_pRenderBeat = NULL; |
1049 | - |
1050 | - if(m_pRenderCue) |
1051 | - delete m_pRenderCue; |
1052 | - m_pRenderCue = NULL; |
1053 | - |
1054 | - if(m_pRenderLoopStart) |
1055 | - delete m_pRenderLoopStart; |
1056 | - m_pRenderLoopStart = NULL; |
1057 | - |
1058 | - if(m_pRenderLoopEnd) |
1059 | - delete m_pRenderLoopEnd; |
1060 | - m_pRenderLoopEnd = NULL; |
1061 | - |
1062 | } |
1063 | |
1064 | void WaveformRenderer::slotUpdatePlayPos(double v) { |
1065 | m_iPlayPosTimeOld = m_iPlayPosTime; |
1066 | m_playPosTimeOld = m_playPosTime; |
1067 | - m_dPlayPosOld = m_dPlayPos; |
1068 | + m_dPlayPosOld = m_dPlayPos; |
1069 | m_dPlayPos = v; |
1070 | m_iPlayPosTime = clock(); |
1071 | m_playPosTime = QTime::currentTime(); |
1072 | |
1073 | - |
1074 | m_iDupes = 0; |
1075 | m_dPlayPosAdjust = 0; |
1076 | } |
1077 | @@ -208,9 +206,12 @@ |
1078 | m_pRenderSignal->resize(w,h); |
1079 | m_pRenderSignalPixmap->resize(w,h); |
1080 | m_pRenderBeat->resize(w,h); |
1081 | - m_pRenderCue->resize(w,h); |
1082 | - m_pRenderLoopStart->resize(w,h); |
1083 | - m_pRenderLoopEnd->resize(w,h); |
1084 | + |
1085 | + QListIterator<RenderObject*> iter(m_renderObjects); |
1086 | + while (iter.hasNext()) { |
1087 | + RenderObject* ro = iter.next(); |
1088 | + ro->resize(w,h); |
1089 | + } |
1090 | } |
1091 | |
1092 | void WaveformRenderer::setupControlObjects() { |
1093 | @@ -222,7 +223,7 @@ |
1094 | // Let a sample be a sample in the original song. |
1095 | // Let a downsample be a sample in the downsampled buffer |
1096 | // Let a pixel be a pixel on the screen. |
1097 | - |
1098 | + |
1099 | // W samples -> X downsamples -> Y pixels |
1100 | |
1101 | // We start with the restriction that we desire 1 second of |
1102 | @@ -244,7 +245,7 @@ |
1103 | // We combine 1 and 2 into one constraint: |
1104 | |
1105 | // (f/z) = mn, or f = m * n * z |
1106 | - |
1107 | + |
1108 | // REQUIRE : M * N * Z = F |
1109 | // M : DOWNSAMPLES PER PIXEL |
1110 | // N : SAMPLES PER DOWNSAMPLE |
1111 | @@ -258,10 +259,10 @@ |
1112 | |
1113 | double m = m_iSubpixelsPerPixel; // M DOWNSAMPLES PER PIXEL |
1114 | double z = m_iPixelsPerSecond; // Z PIXELS REPRESENTS 1 SECOND OF DATA |
1115 | - |
1116 | + |
1117 | m_pCOVisualResample->set(m*z); |
1118 | |
1119 | - qDebug() << "WaveformRenderer::setupControlObjects - VisualResample: " << m*z; |
1120 | + //qDebug() << "WaveformRenderer::setupControlObjects - VisualResample: " << m*z; |
1121 | |
1122 | } |
1123 | |
1124 | @@ -270,13 +271,9 @@ |
1125 | bgColor.setNamedColor(WWidget::selectNodeQString(node, "BgColor")); |
1126 | bgColor = WSkinColor::getCorrectColor(bgColor); |
1127 | |
1128 | - qDebug() << "Got bgColor " << bgColor; |
1129 | - |
1130 | signalColor.setNamedColor(WWidget::selectNodeQString(node, "SignalColor")); |
1131 | signalColor = WSkinColor::getCorrectColor(signalColor); |
1132 | |
1133 | - qDebug() << "Got signalColor " << signalColor; |
1134 | - |
1135 | colorMarker.setNamedColor(WWidget::selectNodeQString(node, "MarkerColor")); |
1136 | colorMarker = WSkinColor::getCorrectColor(colorMarker); |
1137 | |
1138 | @@ -286,13 +283,33 @@ |
1139 | colorCue.setNamedColor(WWidget::selectNodeQString(node, "CueColor")); |
1140 | colorCue = WSkinColor::getCorrectColor(colorCue); |
1141 | |
1142 | + while (m_renderObjects.size() > 0) { |
1143 | + RenderObject* ro = m_renderObjects.takeFirst(); |
1144 | + delete ro; |
1145 | + } |
1146 | + |
1147 | + // Process any <Mark> nodes |
1148 | + QDomNode child = node.firstChild(); |
1149 | + while (!child.isNull()) { |
1150 | + RenderObject* pRenderObject = NULL; |
1151 | + if (child.nodeName() == "Mark") { |
1152 | + pRenderObject = new WaveformRenderMark(m_pGroup, this); |
1153 | + } else if(child.nodeName() == "MarkRange") { |
1154 | + pRenderObject = new WaveformRenderMarkRange(m_pGroup, this); |
1155 | + } |
1156 | + if (pRenderObject != NULL) { |
1157 | + if (m_pTrack != NULL) |
1158 | + pRenderObject->newTrack(m_pTrack); |
1159 | + pRenderObject->setup(child); |
1160 | + m_renderObjects.push_back(pRenderObject); |
1161 | + } |
1162 | + child = child.nextSibling(); |
1163 | + } |
1164 | + |
1165 | m_pRenderBackground->setup(node); |
1166 | m_pRenderSignal->setup(node); |
1167 | m_pRenderSignalPixmap->setup(node); |
1168 | m_pRenderBeat->setup(node); |
1169 | - m_pRenderCue->setup(node); |
1170 | - m_pRenderLoopStart->setup(node); |
1171 | - m_pRenderLoopEnd->setup(node); |
1172 | } |
1173 | |
1174 | |
1175 | @@ -305,7 +322,7 @@ |
1176 | int monoSamples = (m_iNumSamples >> 3); |
1177 | qDebug() << monoSamples << " samples for qimage"; |
1178 | QImage qi(monoSamples, m_iHeight, QImage::Format_RGB32); |
1179 | - |
1180 | + |
1181 | QPainter paint; |
1182 | paint.begin(&qi); |
1183 | |
1184 | @@ -319,7 +336,7 @@ |
1185 | //paint.drawLine(QLine(i,0,i,m_iHeight/2)); |
1186 | //paint.drawLine(QLine(i,0,i,m_iHeight/2)); |
1187 | //} |
1188 | - |
1189 | + |
1190 | for(int i=0;i<monoSamples;i++) { |
1191 | //SAMPLE sampl = (*m_pSampleBuffer)[i*2]; |
1192 | //SAMPLE sampr = (*m_pSampleBuffer)[i*2+1]; |
1193 | @@ -333,7 +350,7 @@ |
1194 | qi.save("/home/rryan/foo.bmp", "BMP", 100); |
1195 | m_pImage = qi; |
1196 | |
1197 | - |
1198 | + |
1199 | return; |
1200 | |
1201 | /* |
1202 | @@ -347,7 +364,7 @@ |
1203 | } else { |
1204 | qDebug() << " Build a pixmap " << pm->size(); |
1205 | } |
1206 | - |
1207 | + |
1208 | QPainter paint; |
1209 | paint.begin(pm); |
1210 | |
1211 | @@ -358,7 +375,7 @@ |
1212 | paint.translate(0,m_iHeight/2); |
1213 | paint.scale(1.0,-1.0); |
1214 | //paint.drawLine(QLine(0,0,resultSamples/2,0)); |
1215 | - |
1216 | + |
1217 | for(int i=0;i<m_iNumSamples/2;i++) { |
1218 | SAMPLE sampl = (*m_pSampleBuffer)[i*2]; |
1219 | SAMPLE sampr = (*m_pSampleBuffer)[i*2+1]; |
1220 | @@ -367,12 +384,12 @@ |
1221 | paint.drawLine(QLine(i,-sampr,i,sampl)); |
1222 | } |
1223 | paint.end(); |
1224 | - |
1225 | + |
1226 | */ |
1227 | } |
1228 | |
1229 | bool WaveformRenderer::fetchWaveformFromTrack() { |
1230 | - |
1231 | + |
1232 | if(!m_pTrack) |
1233 | return false; |
1234 | |
1235 | @@ -394,10 +411,10 @@ |
1236 | //return; |
1237 | if(m_pImage.isNull()) |
1238 | return; |
1239 | - |
1240 | + |
1241 | //double dCurPos = m_pPlayPos->get(); |
1242 | int iCurPos = (int)(m_dPlayPos*m_pImage.width()); |
1243 | - |
1244 | + |
1245 | int halfw = m_iWidth/2; |
1246 | int halfh = m_iHeight/2; |
1247 | |
1248 | @@ -440,14 +457,14 @@ |
1249 | if(m_iWidth == 0 || m_iHeight == 0) |
1250 | return; |
1251 | |
1252 | - |
1253 | + |
1254 | /* |
1255 | if(m_dPlayPos != -1 && m_dPlayPosOld != -1 && m_iNumSamples != 0) { |
1256 | static double elatency = ControlObject::getControl(ConfigKey("[Master]","latency"))->get(); |
1257 | double latency = elatency; |
1258 | latency *= 4; |
1259 | latency *= CLOCKS_PER_SEC / 1000.0; |
1260 | - |
1261 | + |
1262 | //int latency = m_iPlayPosTime - m_iPlayPosTimeOld; |
1263 | double timeelapsed = (clock() - m_iPlayPosTime); |
1264 | double timeratio = 0; |
1265 | @@ -458,7 +475,7 @@ |
1266 | |
1267 | double timerun = m_iPlayPosTime - m_iPlayPosTimeOld; |
1268 | |
1269 | - |
1270 | + |
1271 | playposadjust = ((m_dPlayPos*m_iNumSamples) - (m_dPlayPosOld*m_iNumSamples)) * timeelapsed; |
1272 | playposadjust /= (latency*m_iNumSamples); |
1273 | |
1274 | @@ -494,21 +511,23 @@ |
1275 | |
1276 | // Now scale so that positive-y points up. |
1277 | pPainter->scale(1.0,-1.0); |
1278 | - |
1279 | + |
1280 | // Draw the center horizontal line under the signal. |
1281 | pPainter->drawLine(QLine(0,0,m_iWidth,0)); |
1282 | |
1283 | m_pRenderSignal->draw(pPainter, pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1284 | - |
1285 | |
1286 | // Draw various markers. |
1287 | - m_pRenderBeat->draw(pPainter,pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1288 | - m_pRenderCue->draw(pPainter,pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1289 | - m_pRenderLoopStart->draw(pPainter, pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1290 | - m_pRenderLoopEnd->draw(pPainter, pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1291 | - |
1292 | + m_pRenderBeat->draw(pPainter, pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1293 | + |
1294 | + QListIterator<RenderObject*> iter(m_renderObjects); |
1295 | + while (iter.hasNext()) { |
1296 | + RenderObject* ro = iter.next(); |
1297 | + ro->draw(pPainter, pEvent, m_pSampleBuffer, playpos, rateAdjust); |
1298 | + } |
1299 | + |
1300 | pPainter->setPen(colorMarker); |
1301 | - |
1302 | + |
1303 | // Draw the center vertical line |
1304 | pPainter->drawLine(QLineF(m_iWidth/2.0,m_iHeight/2.0,m_iWidth/2.0,-m_iHeight/2.0)); |
1305 | |
1306 | @@ -526,9 +545,12 @@ |
1307 | m_pRenderSignal->newTrack(pTrack); |
1308 | m_pRenderSignalPixmap->newTrack(pTrack); |
1309 | m_pRenderBeat->newTrack(pTrack); |
1310 | - m_pRenderCue->newTrack(pTrack); |
1311 | - m_pRenderLoopStart->newTrack(pTrack); |
1312 | - m_pRenderLoopEnd->newTrack(pTrack); |
1313 | + |
1314 | + QListIterator<RenderObject*> iter(m_renderObjects); |
1315 | + while (iter.hasNext()) { |
1316 | + RenderObject* ro = iter.next(); |
1317 | + ro->newTrack(pTrack); |
1318 | + } |
1319 | } |
1320 | |
1321 | int WaveformRenderer::getPixelsPerSecond() { |
1322 | @@ -538,4 +560,3 @@ |
1323 | int WaveformRenderer::getSubpixelsPerPixel() { |
1324 | return m_iSubpixelsPerPixel; |
1325 | } |
1326 | - |
1327 | |
1328 | === modified file 'mixxx/src/waveform/waveformrenderer.h' |
1329 | --- mixxx/src/waveform/waveformrenderer.h 2009-09-22 20:11:11 +0000 |
1330 | +++ mixxx/src/waveform/waveformrenderer.h 2009-11-18 00:45:31 +0000 |
1331 | @@ -3,17 +3,20 @@ |
1332 | #define WAVEFORMRENDERER_H |
1333 | |
1334 | #include <QColor> |
1335 | +#include <QDomNode> |
1336 | +#include <QList> |
1337 | +#include <QMutex> |
1338 | #include <QPainter> |
1339 | #include <QPaintEvent> |
1340 | +#include <QThread> |
1341 | +#include <QTime> |
1342 | #include <QVector> |
1343 | -#include <QTime> |
1344 | -#include <QThread> |
1345 | |
1346 | #include "defs.h" |
1347 | |
1348 | class TrackInfoObject; |
1349 | class ControlObjectThreadMain; |
1350 | -class QDomNode; |
1351 | +class RenderObject; |
1352 | class WaveformRenderBackground; |
1353 | class WaveformRenderSignal; |
1354 | class WaveformRenderSignalPixmap; |
1355 | @@ -34,6 +37,7 @@ |
1356 | void precomputePixmap(); |
1357 | int getSubpixelsPerPixel(); |
1358 | int getPixelsPerSecond(); |
1359 | + |
1360 | public slots: |
1361 | void slotNewTrack(TrackInfoObject *pTrack); |
1362 | void slotUpdateLatency(double latency); |
1363 | @@ -41,13 +45,15 @@ |
1364 | void slotUpdateRate(double rate); |
1365 | void slotUpdateRateRange(double rate_range); |
1366 | void slotUpdateRateDir(double rate_dir); |
1367 | - |
1368 | + |
1369 | protected: |
1370 | void run(); |
1371 | |
1372 | private: |
1373 | void setupControlObjects(); |
1374 | bool fetchWaveformFromTrack(); |
1375 | + |
1376 | + const char* m_pGroup; |
1377 | int m_iWidth, m_iHeight; |
1378 | QColor bgColor, signalColor, colorMarker, colorBeat, colorCue; |
1379 | int m_iNumSamples; |
1380 | @@ -58,7 +64,6 @@ |
1381 | int m_iDupes; |
1382 | double m_dPlayPosAdjust; |
1383 | int m_iLatency; |
1384 | - |
1385 | |
1386 | QVector<float> *m_pSampleBuffer; |
1387 | QPixmap *m_pPixmap; |
1388 | @@ -69,23 +74,21 @@ |
1389 | ControlObjectThreadMain *m_pRate; |
1390 | ControlObjectThreadMain *m_pRateRange; |
1391 | ControlObjectThreadMain *m_pRateDir; |
1392 | - |
1393 | + |
1394 | ControlObject *m_pCOVisualResample; |
1395 | |
1396 | WaveformRenderBackground *m_pRenderBackground; |
1397 | WaveformRenderSignal *m_pRenderSignal; |
1398 | WaveformRenderSignalPixmap *m_pRenderSignalPixmap; |
1399 | WaveformRenderBeat *m_pRenderBeat; |
1400 | - WaveformRenderMark *m_pRenderCue; |
1401 | - WaveformRenderMark *m_pRenderLoopStart; |
1402 | - WaveformRenderMark *m_pRenderLoopEnd; |
1403 | + |
1404 | + QList<RenderObject*> m_renderObjects; |
1405 | |
1406 | const int m_iSubpixelsPerPixel; |
1407 | const int m_iPixelsPerSecond; |
1408 | TrackInfoObject *m_pTrack; |
1409 | |
1410 | bool m_bQuit; |
1411 | - |
1412 | }; |
1413 | |
1414 | #endif |
1415 | |
1416 | === modified file 'mixxx/src/waveform/waveformrendermark.cpp' |
1417 | --- mixxx/src/waveform/waveformrendermark.cpp 2009-02-06 09:29:07 +0000 |
1418 | +++ mixxx/src/waveform/waveformrendermark.cpp 2009-11-18 00:45:31 +0000 |
1419 | @@ -17,22 +17,25 @@ |
1420 | #include "widget/wwidget.h" |
1421 | #include "trackinfoobject.h" |
1422 | |
1423 | -WaveformRenderMark::WaveformRenderMark(const char *group, ConfigKey key, WaveformRenderer *parent) { |
1424 | - |
1425 | - m_pParent = parent; |
1426 | - m_key = key; |
1427 | - |
1428 | - m_iMarkPoint = -1; |
1429 | - m_iSampleRate = -1; |
1430 | - m_dSamplesPerDownsample = -1; |
1431 | - m_iNumSamples = 0; |
1432 | - |
1433 | - m_pMarkPoint = new ControlObjectThreadMain(ControlObject::getControl(key)); |
1434 | - connect(m_pMarkPoint, SIGNAL(valueChanged(double)), this, SLOT(slotUpdateMarkPoint(double))); |
1435 | - |
1436 | - m_pTrackSamples = new ControlObjectThreadMain(ControlObject::getControl(ConfigKey(group,"track_samples"))); |
1437 | +WaveformRenderMark::WaveformRenderMark(const char* pGroup, |
1438 | + WaveformRenderer *parent) |
1439 | + : m_pGroup(pGroup), |
1440 | + m_pParent(parent), |
1441 | + m_pMarkPoint(NULL), |
1442 | + m_pTrackSamples(NULL), |
1443 | + m_pTrack(NULL), |
1444 | + m_iMarkPoint(-1), |
1445 | + m_iWidth(0), |
1446 | + m_iHeight(0), |
1447 | + m_dSamplesPerDownsample(-1), |
1448 | + m_iNumSamples(0), |
1449 | + m_iSampleRate(-1) { |
1450 | + |
1451 | + m_pTrackSamples = new ControlObjectThreadMain( |
1452 | + ControlObject::getControl(ConfigKey(pGroup,"track_samples"))); |
1453 | slotUpdateTrackSamples(m_pTrackSamples->get()); |
1454 | - connect(m_pTrackSamples, SIGNAL(valueChanged(double)), this, SLOT(slotUpdateTrackSamples(double))); |
1455 | + connect(m_pTrackSamples, SIGNAL(valueChanged(double)), |
1456 | + this, SLOT(slotUpdateTrackSamples(double))); |
1457 | } |
1458 | |
1459 | void WaveformRenderMark::slotUpdateMarkPoint(double v) { |
1460 | @@ -69,45 +72,237 @@ |
1461 | |
1462 | m_dSamplesPerDownsample = n; |
1463 | |
1464 | + // TODO(rryan) This will possibly get us into trouble, because track samples |
1465 | + // might not be updated yet. |
1466 | + slotUpdateTrackSamples(m_pTrackSamples->get()); |
1467 | + if (m_pMarkPoint) |
1468 | + slotUpdateMarkPoint(m_pMarkPoint->get()); |
1469 | } |
1470 | |
1471 | void WaveformRenderMark::setup(QDomNode node) { |
1472 | - |
1473 | - markColor.setNamedColor(WWidget::selectNodeQString(node, "CueColor")); |
1474 | - markColor = WSkinColor::getCorrectColor(markColor); |
1475 | - |
1476 | + ConfigKey configKey; |
1477 | + configKey.group = m_pGroup; |
1478 | + configKey.item = WWidget::selectNodeQString(node, "Control"); |
1479 | + |
1480 | + if (m_pMarkPoint) { |
1481 | + // Disconnect the old control |
1482 | + disconnect(m_pMarkPoint, 0, this, 0); |
1483 | + delete m_pMarkPoint; |
1484 | + m_pMarkPoint = NULL; |
1485 | + } |
1486 | + |
1487 | + m_pMarkPoint = new ControlObjectThreadMain( |
1488 | + ControlObject::getControl(configKey)); |
1489 | + slotUpdateMarkPoint(m_pMarkPoint->get()); |
1490 | + connect(m_pMarkPoint, SIGNAL(valueChanged(double)), |
1491 | + this, SLOT(slotUpdateMarkPoint(double))); |
1492 | + |
1493 | + // Read the mark color, otherwise get MarkerColor of the Visual element |
1494 | + QString markColor = WWidget::selectNodeQString(node, "Color"); |
1495 | + if (markColor == "") { |
1496 | + // As a fallback, grab the mark color from the parent's MarkerColor |
1497 | + markColor = WWidget::selectNodeQString(node.parentNode(), "MarkerColor"); |
1498 | + qDebug() << "Didn't get mark Color, using parent's MarkerColor:" |
1499 | + << markColor; |
1500 | + m_markColor.setNamedColor(markColor); |
1501 | + // m_markColor = QColor(255 - m_markColor.red(), |
1502 | + // 255 - m_markColor.green(), |
1503 | + // 255 - m_markColor.blue()); |
1504 | + } else { |
1505 | + m_markColor.setNamedColor(markColor); |
1506 | + } |
1507 | + m_markColor = WSkinColor::getCorrectColor(m_markColor); |
1508 | + |
1509 | + // Read the text color, otherwise use the parent's BgColor. |
1510 | + QString textColor = WWidget::selectNodeQString(node, "TextColor"); |
1511 | + if (textColor == "") { |
1512 | + textColor = WWidget::selectNodeQString(node.parentNode(), "BgColor"); |
1513 | + qDebug() << "Didn't get mark TextColor, using parent's BgColor:" |
1514 | + << textColor; |
1515 | + m_textColor.setNamedColor(textColor); |
1516 | + // m_textColor = QColor(255 - m_textColor.red(), |
1517 | + // 255 - m_textColor.green(), |
1518 | + // 255 - m_textColor.blue()); |
1519 | + } else { |
1520 | + m_textColor.setNamedColor(textColor); |
1521 | + } |
1522 | + m_textColor = WSkinColor::getCorrectColor(m_textColor); |
1523 | + |
1524 | + QString markAlign = WWidget::selectNodeQString(node, "Align"); |
1525 | + if (markAlign.compare("center", Qt::CaseInsensitive) == 0) { |
1526 | + m_markAlign = WaveformRenderMark::CENTER; |
1527 | + } else if (markAlign.compare("bottom", Qt::CaseInsensitive) == 0) { |
1528 | + m_markAlign = WaveformRenderMark::BOTTOM; |
1529 | + } else { |
1530 | + // Default |
1531 | + m_markAlign = WaveformRenderMark::TOP; |
1532 | + } |
1533 | + |
1534 | + // Read the mark's text |
1535 | + m_markText = WWidget::selectNodeQString(node, "Text"); |
1536 | + m_markPixmapPath = WWidget::selectNodeQString(node,"Pixmap"); |
1537 | + |
1538 | + setupMarkPixmap(); |
1539 | } |
1540 | |
1541 | |
1542 | -void WaveformRenderMark::draw(QPainter *pPainter, QPaintEvent *event, QVector<float> *buffer, double dPlayPos, double rateAdjust) { |
1543 | - |
1544 | - if(m_iSampleRate == -1 || m_iSampleRate == 0 || m_iNumSamples == 0) |
1545 | +void WaveformRenderMark::draw(QPainter *pPainter, QPaintEvent *event, |
1546 | + QVector<float> *buffer, double dPlayPos, |
1547 | + double rateAdjust) { |
1548 | + if (m_iSampleRate == -1 || m_iSampleRate == 0 || m_iNumSamples == 0) |
1549 | return; |
1550 | |
1551 | // necessary? |
1552 | - if(buffer == NULL) |
1553 | + if (buffer == NULL) |
1554 | return; |
1555 | |
1556 | double subpixelsPerPixel = m_pParent->getSubpixelsPerPixel()*(1.0+rateAdjust); |
1557 | |
1558 | pPainter->save(); |
1559 | pPainter->scale(1.0/subpixelsPerPixel,1.0); |
1560 | - pPainter->setPen(markColor); |
1561 | - |
1562 | + QPen oldPen = pPainter->pen(); |
1563 | + QBrush oldBrush = pPainter->brush(); |
1564 | + |
1565 | double subpixelWidth = m_iWidth * subpixelsPerPixel; |
1566 | double subpixelHalfWidth = subpixelWidth / 2.0; |
1567 | double halfh = m_iHeight/2; |
1568 | - |
1569 | - if(m_iMarkPoint != -1) { |
1570 | + |
1571 | + if (m_iMarkPoint != -1) { |
1572 | double markPointMono = m_iMarkPoint >> 1; |
1573 | double curPos = dPlayPos * (m_iNumSamples/2); |
1574 | double i = (markPointMono - curPos)/m_dSamplesPerDownsample; |
1575 | - |
1576 | - if(abs(i) < subpixelHalfWidth) { |
1577 | + |
1578 | + if (abs(i) < subpixelHalfWidth) { |
1579 | double x = (i+subpixelHalfWidth); |
1580 | + QPen newPen = QPen(m_markColor); |
1581 | + newPen.setWidth(subpixelsPerPixel*2); |
1582 | + pPainter->setPen(newPen); |
1583 | pPainter->drawLine(QLineF(x, halfh, x, -halfh)); |
1584 | + |
1585 | + pPainter->setPen(m_markColor); |
1586 | + pPainter->setBrush(QBrush(m_markColor)); |
1587 | + QPolygonF topTriangle; |
1588 | + QPolygonF bottomTriangle; |
1589 | + double triWidth = subpixelsPerPixel * 8.0; |
1590 | + double triHeight = 10.0; |
1591 | + topTriangle << QPointF(x - 1 - triWidth/2.0f, halfh) |
1592 | + << QPointF(x + 1 + triWidth/2.0f, halfh) |
1593 | + << QPointF(x, halfh - triHeight); |
1594 | + bottomTriangle << QPointF(x - triWidth/2.0f, -halfh) |
1595 | + << QPointF(x + 1 + triWidth/2.0f, -halfh) |
1596 | + << QPointF(x, -halfh + triHeight); |
1597 | + pPainter->drawPolygon(topTriangle); |
1598 | + pPainter->drawPolygon(bottomTriangle); |
1599 | + |
1600 | + if (!m_markPixmap.isNull()) { |
1601 | + pPainter->scale(subpixelsPerPixel, -1.0); |
1602 | + x = x / subpixelsPerPixel; |
1603 | + int pw = m_markPixmap.width(); |
1604 | + int ph = m_markPixmap.height(); |
1605 | + |
1606 | + // Draw the pixmap in the right place |
1607 | + switch (m_markAlign) { |
1608 | + case WaveformRenderMark::BOTTOM: |
1609 | + // Bottom |
1610 | + pPainter->drawPixmap(x - pw/2.0, halfh - ph, m_markPixmap); |
1611 | + break; |
1612 | + case WaveformRenderMark::CENTER: |
1613 | + // Center |
1614 | + pPainter->drawPixmap(x - pw/2.0, 0 - ph/2.0, m_markPixmap); |
1615 | + break; |
1616 | + case WaveformRenderMark::TOP: |
1617 | + default: |
1618 | + // Top |
1619 | + pPainter->drawPixmap(x - pw/2.0, -halfh + 2.0, m_markPixmap); |
1620 | + break; |
1621 | + } |
1622 | + } |
1623 | } |
1624 | } |
1625 | |
1626 | + pPainter->setPen(oldPen); |
1627 | + pPainter->setBrush(oldBrush); |
1628 | pPainter->restore(); |
1629 | } |
1630 | + |
1631 | +void WaveformRenderMark::setupMarkPixmap() { |
1632 | + // Load the pixmap from file -- takes precedence over text. |
1633 | + if (m_markPixmapPath != "") { |
1634 | + // TODO(XXX) We could use WPixmapStore here, which would recolor the |
1635 | + // pixmap according to the theme. Then we would have to worry about |
1636 | + // deleting it -- for now we'll just load the pixmap directly. |
1637 | + m_markPixmap = QPixmap(WWidget::getPath(m_markPixmapPath)); |
1638 | + |
1639 | + // If loading the pixmap didn't fail, then we're done. Otherwise fall |
1640 | + // through and render a label. |
1641 | + if (!m_markPixmap.isNull()) { |
1642 | + return; |
1643 | + } |
1644 | + } |
1645 | + |
1646 | + // If no text is provided, leave m_markPixmap as a null pixmap |
1647 | + if (m_markText == "") { |
1648 | + return; |
1649 | + } |
1650 | + |
1651 | + //QFont font("Bitstream Vera Sans"); |
1652 | + //QFont font("Helvetica"); |
1653 | + QFont font; // Uses the application default |
1654 | + font.setPointSize(8); |
1655 | + //font.setWeight(QFont::Bold); |
1656 | + //font.setLetterSpacing(QFont::AbsoluteSpacing, -1); |
1657 | + |
1658 | + QFontMetrics metrics(font); |
1659 | + |
1660 | + // Add left and right margins of one characters worth (based on average |
1661 | + // pixels / character). |
1662 | + double wordWidth = metrics.boundingRect(m_markText).width(); |
1663 | + double wordHeight = metrics.height(); |
1664 | + |
1665 | + // A sensible margin for the horizontal is a quarter of the average |
1666 | + // character width. |
1667 | + //int marginX = wordWidth/m_markText.size()/4; |
1668 | + //int marginX = metrics.maxWidth() / 4; |
1669 | + double marginX = metrics.averageCharWidth() / 4.0; |
1670 | + |
1671 | + double marginY = 0; // .1 * wordHeight |
1672 | + |
1673 | + double markWidth = wordWidth + 2*marginX; |
1674 | + double markHeight = wordHeight + 2*marginY; |
1675 | + |
1676 | + QRectF internalRect(marginX, marginY, wordWidth-1, wordHeight-1); |
1677 | + QRectF externalRect(0, 0, markWidth-1, markHeight-1); |
1678 | + |
1679 | + m_markPixmap = QPixmap(markWidth, markHeight); |
1680 | + |
1681 | + // Fill with transparent pixels |
1682 | + m_markPixmap.fill(QColor(0,0,0,0)); |
1683 | + |
1684 | + QPainter painter(&m_markPixmap); |
1685 | + painter.setRenderHint(QPainter::TextAntialiasing); |
1686 | + //painter.setRenderHint(QPainter::Antialiasing); |
1687 | + painter.setRenderHint(QPainter::HighQualityAntialiasing); |
1688 | + painter.setBackgroundMode(Qt::TransparentMode); |
1689 | + painter.setFont(font); |
1690 | + QColor color = m_textColor; |
1691 | + color = QColor(0xff - color.red(), |
1692 | + 0xff - color.green(), |
1693 | + 0xff - color.blue(), |
1694 | + 128); |
1695 | + painter.setPen(color); |
1696 | + painter.setBrush(QBrush(color)); |
1697 | + |
1698 | + // Stuff to test that the rectangles are correct. |
1699 | + //painter.setBrush(QBrush()); |
1700 | + //painter.drawRect(externalRect); |
1701 | + //painter.drawRect(internalRect); |
1702 | + |
1703 | + //painter.setBrush(QBrush()); |
1704 | + //painter.drawRoundedRect(externalRect, 25, 60, Qt::RelativeSize); |
1705 | + painter.drawRoundedRect(externalRect, 2, 2); |
1706 | + |
1707 | + painter.setPen(m_textColor); |
1708 | + painter.drawText(internalRect, |
1709 | + Qt::AlignCenter, |
1710 | + m_markText); |
1711 | +} |
1712 | |
1713 | === modified file 'mixxx/src/waveform/waveformrendermark.h' |
1714 | --- mixxx/src/waveform/waveformrendermark.h 2009-02-06 09:20:10 +0000 |
1715 | +++ mixxx/src/waveform/waveformrendermark.h 2009-11-18 00:45:31 +0000 |
1716 | @@ -4,6 +4,7 @@ |
1717 | |
1718 | #include <QObject> |
1719 | #include <QColor> |
1720 | +#include <QPixmap> |
1721 | #include <QVector> |
1722 | |
1723 | class QDomNode; |
1724 | @@ -11,7 +12,7 @@ |
1725 | class QPaintEvent; |
1726 | |
1727 | #include "configobject.h" |
1728 | -#include "renderobject.h" |
1729 | +#include "waveform/renderobject.h" |
1730 | |
1731 | class ConfigKey; |
1732 | class ControlObjectThreadMain; |
1733 | @@ -21,16 +22,27 @@ |
1734 | class WaveformRenderMark : public RenderObject { |
1735 | Q_OBJECT |
1736 | public: |
1737 | - WaveformRenderMark(const char *group, ConfigKey key, WaveformRenderer *parent); |
1738 | + explicit WaveformRenderMark(const char* pGroup, |
1739 | + WaveformRenderer *parent); |
1740 | void resize(int w, int h); |
1741 | void setup(QDomNode node); |
1742 | - void draw(QPainter *pPainter, QPaintEvent *event, QVector<float> *buffer, double playPos, double rateAdjust); |
1743 | + void draw(QPainter *pPainter, QPaintEvent *event, |
1744 | + QVector<float> *buffer, double playPos, double rateAdjust); |
1745 | void newTrack(TrackInfoObject *pTrack); |
1746 | |
1747 | public slots: |
1748 | void slotUpdateMarkPoint(double mark); |
1749 | void slotUpdateTrackSamples(double samples); |
1750 | private: |
1751 | + void setupMarkPixmap(); |
1752 | + |
1753 | + enum MarkAlign { |
1754 | + TOP = 0, |
1755 | + BOTTOM, |
1756 | + CENTER |
1757 | + }; |
1758 | + |
1759 | + const char* m_pGroup; |
1760 | WaveformRenderer *m_pParent; |
1761 | ControlObjectThreadMain *m_pMarkPoint; |
1762 | ControlObjectThreadMain *m_pTrackSamples; |
1763 | @@ -38,11 +50,14 @@ |
1764 | |
1765 | int m_iMarkPoint; |
1766 | int m_iWidth, m_iHeight; |
1767 | - QColor markColor; |
1768 | + QColor m_markColor; |
1769 | + QColor m_textColor; |
1770 | + QString m_markText; |
1771 | + QString m_markPixmapPath; |
1772 | + MarkAlign m_markAlign; |
1773 | + QPixmap m_markPixmap; |
1774 | double m_dSamplesPerDownsample; |
1775 | |
1776 | - ConfigKey m_key; |
1777 | - |
1778 | int m_iNumSamples; |
1779 | int m_iSampleRate; |
1780 | }; |
1781 | |
1782 | === added file 'mixxx/src/waveform/waveformrendermarkrange.cpp' |
1783 | --- mixxx/src/waveform/waveformrendermarkrange.cpp 1970-01-01 00:00:00 +0000 |
1784 | +++ mixxx/src/waveform/waveformrendermarkrange.cpp 2009-11-18 00:45:31 +0000 |
1785 | @@ -0,0 +1,233 @@ |
1786 | +// waveformrendermarkrange.cpp |
1787 | +// Created 11/14/2009 by RJ Ryan (rryan@mit.edu) |
1788 | + |
1789 | +#include <QDebug> |
1790 | +#include <QColor> |
1791 | +#include <QDomNode> |
1792 | +#include <QPaintEvent> |
1793 | +#include <QPainter> |
1794 | +#include <QObject> |
1795 | +#include <QVector> |
1796 | + |
1797 | +#include "waveformrendermarkrange.h" |
1798 | + |
1799 | +#include "waveformrenderer.h" |
1800 | +#include "configobject.h" |
1801 | +#include "controlobjectthreadmain.h" |
1802 | +#include "controlobject.h" |
1803 | +#include "widget/wskincolor.h" |
1804 | +#include "widget/wwidget.h" |
1805 | +#include "trackinfoobject.h" |
1806 | + |
1807 | +WaveformRenderMarkRange::WaveformRenderMarkRange(const char* pGroup, |
1808 | + WaveformRenderer *parent) |
1809 | + : m_pGroup(pGroup), |
1810 | + m_pParent(parent), |
1811 | + m_pMarkStartPoint(NULL), |
1812 | + m_pMarkEndPoint(NULL), |
1813 | + m_pMarkEnabled(NULL), |
1814 | + m_pTrackSamples(NULL), |
1815 | + m_pTrack(NULL), |
1816 | + m_bMarkEnabled(true), |
1817 | + m_iMarkStartPoint(-1), |
1818 | + m_iMarkEndPoint(-1), |
1819 | + m_iWidth(0), |
1820 | + m_iHeight(0), |
1821 | + m_dSamplesPerDownsample(-1), |
1822 | + m_iNumSamples(0), |
1823 | + m_iSampleRate(-1) { |
1824 | + |
1825 | + m_pTrackSamples = new ControlObjectThreadMain( |
1826 | + ControlObject::getControl(ConfigKey(pGroup,"track_samples"))); |
1827 | + slotUpdateTrackSamples(m_pTrackSamples->get()); |
1828 | + connect(m_pTrackSamples, SIGNAL(valueChanged(double)), |
1829 | + this, SLOT(slotUpdateTrackSamples(double))); |
1830 | +} |
1831 | + |
1832 | +void WaveformRenderMarkRange::slotUpdateMarkStartPoint(double v) { |
1833 | + //qDebug() << "WaveformRenderMarkRange :: MarkStartPoint = " << v; |
1834 | + m_iMarkStartPoint = (int)v; |
1835 | +} |
1836 | + |
1837 | +void WaveformRenderMarkRange::slotUpdateMarkEndPoint(double v) { |
1838 | + //qDebug() << "WaveformRenderMarkRange :: MarkEndPoint = " << v; |
1839 | + m_iMarkEndPoint = (int)v; |
1840 | +} |
1841 | + |
1842 | +void WaveformRenderMarkRange::slotUpdateMarkEnabled(double v) { |
1843 | + //qDebug() << "WaveformRenderMarkRange :: MarkEnabled = " << v; |
1844 | + m_bMarkEnabled = !(v == 0.0f); |
1845 | +} |
1846 | + |
1847 | +void WaveformRenderMarkRange::slotUpdateTrackSamples(double samples) { |
1848 | + //qDebug() << "WaveformRenderMarkRange :: samples = " << int(samples); |
1849 | + m_iNumSamples = (int)samples; |
1850 | +} |
1851 | + |
1852 | +void WaveformRenderMarkRange::resize(int w, int h) { |
1853 | + m_iWidth = w; |
1854 | + m_iHeight = h; |
1855 | +} |
1856 | + |
1857 | +void WaveformRenderMarkRange::newTrack(TrackInfoObject* pTrack) { |
1858 | + m_pTrack = pTrack; |
1859 | + m_iMarkStartPoint = -1; |
1860 | + m_iMarkEndPoint = -1; |
1861 | + m_bMarkEnabled = true; |
1862 | + m_iNumSamples = 0; |
1863 | + |
1864 | + // calculate beat info for this track: |
1865 | + |
1866 | + int sampleRate = pTrack->getSampleRate(); |
1867 | + |
1868 | + // f = z * m * n |
1869 | + double m = m_pParent->getSubpixelsPerPixel(); |
1870 | + double f = sampleRate; |
1871 | + double z = m_pParent->getPixelsPerSecond(); |
1872 | + double n = f / (m*z); |
1873 | + |
1874 | + m_iSampleRate = sampleRate; |
1875 | + |
1876 | + m_dSamplesPerDownsample = n; |
1877 | + |
1878 | + // TODO(rryan) This will possibly get us into trouble, because track samples |
1879 | + // might not be updated yet. |
1880 | + slotUpdateTrackSamples(m_pTrackSamples->get()); |
1881 | + if (m_pMarkStartPoint) |
1882 | + slotUpdateMarkStartPoint(m_pMarkStartPoint->get()); |
1883 | + if (m_pMarkEndPoint) |
1884 | + slotUpdateMarkEndPoint(m_pMarkEndPoint->get()); |
1885 | +} |
1886 | + |
1887 | +void WaveformRenderMarkRange::setup(QDomNode node) { |
1888 | + |
1889 | + if (m_pMarkStartPoint) { |
1890 | + // Disconnect the old control |
1891 | + disconnect(m_pMarkStartPoint, 0, this, 0); |
1892 | + delete m_pMarkStartPoint; |
1893 | + m_pMarkStartPoint = NULL; |
1894 | + } |
1895 | + |
1896 | + if (m_pMarkEndPoint) { |
1897 | + // Disconnect the old control |
1898 | + disconnect(m_pMarkEndPoint, 0, this, 0); |
1899 | + delete m_pMarkEndPoint; |
1900 | + m_pMarkEndPoint = NULL; |
1901 | + } |
1902 | + |
1903 | + if (m_pMarkEnabled) { |
1904 | + // Disconnect the old control |
1905 | + disconnect(m_pMarkEnabled, 0, this, 0); |
1906 | + delete m_pMarkEnabled; |
1907 | + m_pMarkEnabled = NULL; |
1908 | + } |
1909 | + |
1910 | + ConfigKey configKey; |
1911 | + configKey.group = m_pGroup; |
1912 | + |
1913 | + configKey.item = WWidget::selectNodeQString(node, "StartControl"); |
1914 | + m_pMarkStartPoint = new ControlObjectThreadMain( |
1915 | + ControlObject::getControl(configKey)); |
1916 | + slotUpdateMarkStartPoint(m_pMarkStartPoint->get()); |
1917 | + connect(m_pMarkStartPoint, SIGNAL(valueChanged(double)), |
1918 | + this, SLOT(slotUpdateMarkStartPoint(double))); |
1919 | + |
1920 | + configKey.item = WWidget::selectNodeQString(node, "EndControl"); |
1921 | + m_pMarkEndPoint = new ControlObjectThreadMain( |
1922 | + ControlObject::getControl(configKey)); |
1923 | + slotUpdateMarkEndPoint(m_pMarkEndPoint->get()); |
1924 | + connect(m_pMarkEndPoint, SIGNAL(valueChanged(double)), |
1925 | + this, SLOT(slotUpdateMarkEndPoint(double))); |
1926 | + |
1927 | + // Leave m_pMarkEnabled NULL if it is not specified |
1928 | + if (!WWidget::selectNode(node, "EnabledControl").isNull()) { |
1929 | + configKey.item = WWidget::selectNodeQString(node, "EnabledControl"); |
1930 | + m_pMarkEnabled = new ControlObjectThreadMain( |
1931 | + ControlObject::getControl(configKey)); |
1932 | + slotUpdateMarkEnabled(m_pMarkEnabled->get()); |
1933 | + connect(m_pMarkEnabled, SIGNAL(valueChanged(double)), |
1934 | + this, SLOT(slotUpdateMarkEnabled(double))); |
1935 | + } |
1936 | + |
1937 | + // Read the mark color, otherwise get MarkerColor of the Visual element |
1938 | + QString markColor = WWidget::selectNodeQString(node, "Color"); |
1939 | + if (markColor == "") { |
1940 | + // As a fallback, grab the mark color from the parent's MarkerColor |
1941 | + markColor = WWidget::selectNodeQString(node.parentNode(), "MarkerColor"); |
1942 | + qDebug() << "Didn't get mark Color, using parent's MarkerColor:" |
1943 | + << markColor; |
1944 | + m_markColor.setNamedColor(markColor); |
1945 | + // m_markColor = QColor(255 - m_markColor.red(), |
1946 | + // 255 - m_markColor.green(), |
1947 | + // 255 - m_markColor.blue()); |
1948 | + } else { |
1949 | + m_markColor.setNamedColor(markColor); |
1950 | + } |
1951 | + m_markColor = WSkinColor::getCorrectColor(m_markColor); |
1952 | + |
1953 | + QString markDisabledColor = WWidget::selectNodeQString(node, "DisabledColor"); |
1954 | + if (markDisabledColor == "") { |
1955 | + // As a fallback, grab the mark color from the parent's MarkerColor |
1956 | + markDisabledColor = WWidget::selectNodeQString( |
1957 | + node.parentNode(), "SignalColor"); |
1958 | + qDebug() << "Didn't get mark Color, using parent's MarkerColor:" |
1959 | + << markDisabledColor; |
1960 | + m_markDisabledColor.setNamedColor(markDisabledColor); |
1961 | + // m_markDisabledColor = QColor(255 - m_markDisabledColor.red(), |
1962 | + // 255 - m_markDisabledColor.green(), |
1963 | + // 255 - m_markDisabledColor.blue()); |
1964 | + } else { |
1965 | + m_markDisabledColor.setNamedColor(markDisabledColor); |
1966 | + } |
1967 | + m_markDisabledColor = WSkinColor::getCorrectColor(m_markDisabledColor); |
1968 | +} |
1969 | + |
1970 | + |
1971 | +void WaveformRenderMarkRange::draw(QPainter *pPainter, QPaintEvent *event, |
1972 | + QVector<float> *buffer, double dPlayPos, |
1973 | + double rateAdjust) { |
1974 | + if (m_iSampleRate == -1 || m_iSampleRate == 0 || m_iNumSamples == 0) |
1975 | + return; |
1976 | + |
1977 | + // necessary? |
1978 | + if (buffer == NULL) |
1979 | + return; |
1980 | + |
1981 | + // The range is not active, do nothing. |
1982 | + if (m_iMarkStartPoint == -1 || m_iMarkEndPoint == -1) |
1983 | + return; |
1984 | + |
1985 | + double subpixelsPerPixel = m_pParent->getSubpixelsPerPixel()*(1.0+rateAdjust); |
1986 | + |
1987 | + pPainter->save(); |
1988 | + pPainter->scale(1.0/subpixelsPerPixel,1.0); |
1989 | + QPen oldPen = pPainter->pen(); |
1990 | + QBrush oldBrush = pPainter->brush(); |
1991 | + |
1992 | + double subpixelWidth = m_iWidth * subpixelsPerPixel; |
1993 | + double subpixelHalfWidth = subpixelWidth / 2.0; |
1994 | + double halfh = m_iHeight/2; |
1995 | + |
1996 | + double curPos = dPlayPos * (m_iNumSamples/2); |
1997 | + |
1998 | + double markStartPointMono = m_iMarkStartPoint >> 1; |
1999 | + double markEndPointMono = m_iMarkEndPoint >> 1; |
2000 | + |
2001 | + double iStart = (markStartPointMono - curPos)/m_dSamplesPerDownsample; |
2002 | + double xStart = iStart + subpixelHalfWidth; |
2003 | + double iEnd = (markEndPointMono - curPos)/m_dSamplesPerDownsample; |
2004 | + double xEnd = iEnd + subpixelHalfWidth; |
2005 | + |
2006 | + QRectF markRect(QPointF(xStart, halfh), QPointF(xEnd, -halfh)); |
2007 | + |
2008 | + QColor color = m_bMarkEnabled ? m_markColor : m_markDisabledColor; |
2009 | + color.setAlphaF(0.2); |
2010 | + QPen newPen(color); |
2011 | + pPainter->setPen(newPen); |
2012 | + pPainter->setBrush(QBrush(color)); |
2013 | + pPainter->drawRect(markRect); |
2014 | + |
2015 | + pPainter->setPen(oldPen); |
2016 | + pPainter->setBrush(oldBrush); |
2017 | + pPainter->restore(); |
2018 | +} |
2019 | |
2020 | === added file 'mixxx/src/waveform/waveformrendermarkrange.h' |
2021 | --- mixxx/src/waveform/waveformrendermarkrange.h 1970-01-01 00:00:00 +0000 |
2022 | +++ mixxx/src/waveform/waveformrendermarkrange.h 2009-11-18 00:45:31 +0000 |
2023 | @@ -0,0 +1,60 @@ |
2024 | +// waveformrendermarkrange.h |
2025 | +// Created 11/14/2009 by RJ Ryan (rryan@mit.edu) |
2026 | + |
2027 | +#ifndef WAVEFORMRENDERMARKRANGE_H |
2028 | +#define WAVEFORMRENDERMARKRANGE_H |
2029 | + |
2030 | +#include <QObject> |
2031 | +#include <QColor> |
2032 | +#include <QVector> |
2033 | + |
2034 | +class QDomNode; |
2035 | +class QPainter; |
2036 | +class QPaintEvent; |
2037 | + |
2038 | +#include "configobject.h" |
2039 | +#include "waveform/renderobject.h" |
2040 | + |
2041 | +class ConfigKey; |
2042 | +class ControlObjectThreadMain; |
2043 | +class WaveformRenderer; |
2044 | +class TrackInfoObject; |
2045 | + |
2046 | +class WaveformRenderMarkRange : public RenderObject { |
2047 | + Q_OBJECT |
2048 | +public: |
2049 | + explicit WaveformRenderMarkRange(const char* pGroup, |
2050 | + WaveformRenderer *parent); |
2051 | + void resize(int w, int h); |
2052 | + void setup(QDomNode node); |
2053 | + void draw(QPainter *pPainter, QPaintEvent *event, |
2054 | + QVector<float> *buffer, double playPos, double rateAdjust); |
2055 | + void newTrack(TrackInfoObject *pTrack); |
2056 | + |
2057 | +public slots: |
2058 | + void slotUpdateMarkStartPoint(double mark); |
2059 | + void slotUpdateMarkEndPoint(double mark); |
2060 | + void slotUpdateMarkEnabled(double mark); |
2061 | + void slotUpdateTrackSamples(double samples); |
2062 | +private: |
2063 | + const char* m_pGroup; |
2064 | + WaveformRenderer *m_pParent; |
2065 | + |
2066 | + ControlObjectThreadMain *m_pMarkStartPoint; |
2067 | + ControlObjectThreadMain *m_pMarkEndPoint; |
2068 | + ControlObjectThreadMain *m_pMarkEnabled; |
2069 | + ControlObjectThreadMain *m_pTrackSamples; |
2070 | + TrackInfoObject *m_pTrack; |
2071 | + |
2072 | + bool m_bMarkEnabled; |
2073 | + int m_iMarkStartPoint, m_iMarkEndPoint; |
2074 | + int m_iWidth, m_iHeight; |
2075 | + QColor m_markColor; |
2076 | + QColor m_markDisabledColor; |
2077 | + |
2078 | + double m_dSamplesPerDownsample; |
2079 | + int m_iNumSamples; |
2080 | + int m_iSampleRate; |
2081 | +}; |
2082 | + |
2083 | +#endif |
2084 | |
2085 | === modified file 'mixxx/src/widget/wglwaveformviewer.cpp' |
2086 | --- mixxx/src/widget/wglwaveformviewer.cpp 2009-07-12 08:02:43 +0000 |
2087 | +++ mixxx/src/widget/wglwaveformviewer.cpp 2009-11-18 00:45:31 +0000 |
2088 | @@ -18,9 +18,9 @@ |
2089 | |
2090 | m_pWaveformRenderer = pWaveformRenderer; |
2091 | Q_ASSERT(m_pWaveformRenderer); |
2092 | - |
2093 | + |
2094 | m_pGroup = group; |
2095 | - |
2096 | + |
2097 | setAcceptDrops(true); |
2098 | |
2099 | installEventFilter(this); |
2100 | @@ -30,7 +30,7 @@ |
2101 | int desired_fps = 40; |
2102 | int update_interval = 1000 / desired_fps; |
2103 | m_iTimerID = startTimer(update_interval); |
2104 | - |
2105 | + |
2106 | m_painting = false; |
2107 | } |
2108 | |
2109 | @@ -52,7 +52,7 @@ |
2110 | int sep = pos.indexOf(","); |
2111 | int x = pos.left(sep).toInt(); |
2112 | int y = pos.mid(sep+1).toInt(); |
2113 | - |
2114 | + |
2115 | move(x,y); |
2116 | |
2117 | // Acquire size |
2118 | @@ -63,18 +63,23 @@ |
2119 | |
2120 | setFixedSize(x,y); |
2121 | |
2122 | + m_pWaveformRenderer->setup(node); |
2123 | + |
2124 | m_pWaveformRenderer->resize(x,y); |
2125 | - |
2126 | - m_pWaveformRenderer->setup(node); |
2127 | } |
2128 | |
2129 | void WGLWaveformViewer::paintEvent(QPaintEvent *event) { |
2130 | QPainter painter; |
2131 | painter.begin(this); |
2132 | - |
2133 | + |
2134 | painter.setRenderHint(QPainter::Antialiasing); |
2135 | + //painter.setRenderHint(QPainter::TextAntialiasing); |
2136 | + |
2137 | + // HighQualityAntialiasing makes some CPUs go crazy |
2138 | + //painter.setRenderHint(QPainter::HighQualityAntialiasing); |
2139 | + |
2140 | m_pWaveformRenderer->draw(&painter, event); |
2141 | - |
2142 | + |
2143 | painter.end(); |
2144 | m_painting = false; |
2145 | // QPainter goes out of scope and is destructed |
2146 | @@ -84,7 +89,7 @@ |
2147 | //m_paintMutex.lock(); |
2148 | if(!m_painting) { |
2149 | m_painting = true; |
2150 | - |
2151 | + |
2152 | // The docs say update is better than repaint. |
2153 | update(); |
2154 | //updateGL(); |
2155 | @@ -92,45 +97,6 @@ |
2156 | //m_paintMutex.unlock(); |
2157 | } |
2158 | |
2159 | - |
2160 | -void WGLWaveformViewer::initializeGL() { |
2161 | - QGLWidget::initializeGL(); |
2162 | - //qDebug() << "QGL initializeGL"; |
2163 | - |
2164 | - /* |
2165 | - // setup backface culling so CCW polygons are facing out |
2166 | - glFrontFace(GL_CCW); |
2167 | - glEnable(GL_CULL_FACE); |
2168 | - glCullFace(GL_BACK); |
2169 | - |
2170 | - // enables zbuffer |
2171 | - glEnable(GL_DEPTH_TEST); |
2172 | - |
2173 | - // enable alpha blending |
2174 | - glEnable(GL_BLEND); |
2175 | - */ |
2176 | - |
2177 | - |
2178 | -} |
2179 | - |
2180 | -void WGLWaveformViewer::resizeGL(int w, int h) { |
2181 | - QGLWidget::resizeGL(w,h); |
2182 | - //qDebug() << "QGL resizeGL " << w << " : " << h; |
2183 | - |
2184 | - //m_pWaveformRenderer->resize(w,h); |
2185 | -} |
2186 | - |
2187 | -void WGLWaveformViewer::paintGL() { |
2188 | - QGLWidget::paintGL(); |
2189 | - |
2190 | - //qDebug() << "QGL paintGL"; |
2191 | - |
2192 | - //m_pWaveformRenderer->glDraw(); |
2193 | - //m_painting = false; |
2194 | -} |
2195 | - |
2196 | - |
2197 | - |
2198 | /** SLOTS **/ |
2199 | |
2200 | void WGLWaveformViewer::setValue(double) { |
2201 | |
2202 | === modified file 'mixxx/src/widget/wglwaveformviewer.h' |
2203 | --- mixxx/src/widget/wglwaveformviewer.h 2009-04-15 01:40:11 +0000 |
2204 | +++ mixxx/src/widget/wglwaveformviewer.h 2009-11-18 00:45:31 +0000 |
2205 | @@ -30,7 +30,7 @@ |
2206 | void dropEvent(QDropEvent *event); |
2207 | void setup(QDomNode node); |
2208 | bool eventFilter(QObject *o, QEvent *e); |
2209 | - |
2210 | + |
2211 | public slots: |
2212 | void setValue(double); |
2213 | signals: |
2214 | @@ -39,11 +39,7 @@ |
2215 | void trackDropped(QString filename); |
2216 | |
2217 | protected: |
2218 | - |
2219 | - void initializeGL(); |
2220 | - void resizeGL(int, int); |
2221 | - void paintGL(); |
2222 | - |
2223 | + |
2224 | void timerEvent(QTimerEvent *); |
2225 | void paintEvent(QPaintEvent* event); |
2226 | |
2227 | @@ -56,7 +52,7 @@ |
2228 | |
2229 | /** Waveform Renderer does all the work for us */ |
2230 | WaveformRenderer *m_pWaveformRenderer; |
2231 | - |
2232 | + |
2233 | bool m_painting; |
2234 | QMutex m_paintMutex; |
2235 | |
2236 | |
2237 | === modified file 'mixxx/src/widget/woverview.cpp' |
2238 | --- mixxx/src/widget/woverview.cpp 2009-11-11 02:10:46 +0000 |
2239 | +++ mixxx/src/widget/woverview.cpp 2009-11-18 00:45:31 +0000 |
2240 | @@ -9,20 +9,38 @@ |
2241 | // Copyright: See COPYING file that comes with this distribution |
2242 | // |
2243 | // |
2244 | +<<<<<<< TREE |
2245 | +======= |
2246 | + |
2247 | +#include <QBrush> |
2248 | +>>>>>>> MERGE-SOURCE |
2249 | #include <QtDebug> |
2250 | #include <Q3MemArray> |
2251 | #include <QMouseEvent> |
2252 | #include <Q3ValueList> |
2253 | #include <QPaintEvent> |
2254 | -#include <qpainter.h> |
2255 | -#include <QtDebug> |
2256 | -#include <qpixmap.h> |
2257 | -#include <qapplication.h> |
2258 | - |
2259 | -#include "controlobject.h" |
2260 | -#include "woverview.h" |
2261 | -#include "wskincolor.h" |
2262 | -#include "trackinfoobject.h" |
2263 | +<<<<<<< TREE |
2264 | +#include <qpainter.h> |
2265 | +#include <QtDebug> |
2266 | +#include <qpixmap.h> |
2267 | +#include <qapplication.h> |
2268 | + |
2269 | +#include "controlobject.h" |
2270 | +#include "woverview.h" |
2271 | +#include "wskincolor.h" |
2272 | +#include "trackinfoobject.h" |
2273 | +======= |
2274 | +#include <qpainter.h> |
2275 | +#include <QtDebug> |
2276 | +#include <qpixmap.h> |
2277 | +#include <qapplication.h> |
2278 | + |
2279 | +#include "controlobject.h" |
2280 | +#include "controlobjectthreadmain.h" |
2281 | +#include "woverview.h" |
2282 | +#include "wskincolor.h" |
2283 | +#include "trackinfoobject.h" |
2284 | +>>>>>>> MERGE-SOURCE |
2285 | #include "mathstuff.h" |
2286 | |
2287 | WOverview::WOverview(const char *pGroup, QWidget * parent) |
2288 | @@ -34,30 +52,80 @@ |
2289 | m_bDrag = false; |
2290 | m_pScreenBuffer = 0; |
2291 | |
2292 | - QString pattern = "hotcue_%1_position"; |
2293 | - |
2294 | - int i = 0; |
2295 | - ConfigKey hotcueKey; |
2296 | - hotcueKey.group = m_pGroup; |
2297 | - hotcueKey.item = pattern.arg(i); |
2298 | - ControlObject* pControl = ControlObject::getControl(hotcueKey); |
2299 | - |
2300 | - |
2301 | - qDebug() << "Connecting hotcue controls."; |
2302 | - while (pControl) { |
2303 | - m_hotcueControls.push_back(pControl); |
2304 | - m_hotcues.push_back(pControl->get()); |
2305 | - m_hotcueMap[pControl] = i; |
2306 | - |
2307 | - qDebug() << "Connecting hotcue" << hotcueKey.group << hotcueKey.item; |
2308 | - |
2309 | - connect(pControl, SIGNAL(valueChangedFromEngine(double)), |
2310 | - this, SLOT(cueChanged(double))); |
2311 | - |
2312 | - hotcueKey.item = pattern.arg(++i); |
2313 | - pControl = ControlObject::getControl(hotcueKey); |
2314 | - } |
2315 | - |
2316 | +<<<<<<< TREE |
2317 | + QString pattern = "hotcue_%1_position"; |
2318 | + |
2319 | + int i = 0; |
2320 | + ConfigKey hotcueKey; |
2321 | + hotcueKey.group = m_pGroup; |
2322 | + hotcueKey.item = pattern.arg(i); |
2323 | + ControlObject* pControl = ControlObject::getControl(hotcueKey); |
2324 | + |
2325 | + |
2326 | + qDebug() << "Connecting hotcue controls."; |
2327 | + while (pControl) { |
2328 | + m_hotcueControls.push_back(pControl); |
2329 | + m_hotcues.push_back(pControl->get()); |
2330 | + m_hotcueMap[pControl] = i; |
2331 | + |
2332 | + qDebug() << "Connecting hotcue" << hotcueKey.group << hotcueKey.item; |
2333 | + |
2334 | + connect(pControl, SIGNAL(valueChangedFromEngine(double)), |
2335 | + this, SLOT(cueChanged(double))); |
2336 | + |
2337 | + hotcueKey.item = pattern.arg(++i); |
2338 | + pControl = ControlObject::getControl(hotcueKey); |
2339 | + } |
2340 | + |
2341 | +======= |
2342 | + m_pLoopStart = ControlObject::getControl( |
2343 | + ConfigKey(m_pGroup, "loop_start_position")); |
2344 | + connect(m_pLoopStart, SIGNAL(valueChanged(double)), |
2345 | + this, SLOT(loopStartChanged(double))); |
2346 | + connect(m_pLoopStart, SIGNAL(valueChangedFromEngine(double)), |
2347 | + this, SLOT(loopStartChanged(double))); |
2348 | + loopStartChanged(m_pLoopStart->get()); |
2349 | + m_pLoopEnd = ControlObject::getControl( |
2350 | + ConfigKey(m_pGroup, "loop_end_position")); |
2351 | + connect(m_pLoopEnd, SIGNAL(valueChanged(double)), |
2352 | + this, SLOT(loopEndChanged(double))); |
2353 | + connect(m_pLoopEnd, SIGNAL(valueChangedFromEngine(double)), |
2354 | + this, SLOT(loopEndChanged(double))); |
2355 | + loopEndChanged(m_pLoopEnd->get()); |
2356 | + m_pLoopEnabled = ControlObject::getControl( |
2357 | + ConfigKey(m_pGroup, "loop_enabled")); |
2358 | + connect(m_pLoopEnabled, SIGNAL(valueChanged(double)), |
2359 | + this, SLOT(loopEnabledChanged(double))); |
2360 | + connect(m_pLoopEnabled, SIGNAL(valueChangedFromEngine(double)), |
2361 | + this, SLOT(loopEnabledChanged(double))); |
2362 | + loopEnabledChanged(m_pLoopEnabled->get()); |
2363 | + |
2364 | + QString pattern = "hotcue_%1_position"; |
2365 | + |
2366 | + int i = 0; |
2367 | + ConfigKey hotcueKey; |
2368 | + hotcueKey.group = m_pGroup; |
2369 | + hotcueKey.item = pattern.arg(i); |
2370 | + ControlObject* pControl = ControlObject::getControl(hotcueKey); |
2371 | + |
2372 | + qDebug() << "Connecting hotcue controls."; |
2373 | + while (pControl) { |
2374 | + m_hotcueControls.push_back(pControl); |
2375 | + m_hotcues.push_back(pControl->get()); |
2376 | + m_hotcueMap[pControl] = i; |
2377 | + |
2378 | + qDebug() << "Connecting hotcue" << hotcueKey.group << hotcueKey.item; |
2379 | + |
2380 | + connect(pControl, SIGNAL(valueChangedFromEngine(double)), |
2381 | + this, SLOT(cueChanged(double))); |
2382 | + connect(pControl, SIGNAL(valueChanged(double)), |
2383 | + this, SLOT(cueChanged(double))); |
2384 | + |
2385 | + hotcueKey.item = pattern.arg(++i); |
2386 | + pControl = ControlObject::getControl(hotcueKey); |
2387 | + } |
2388 | + |
2389 | +>>>>>>> MERGE-SOURCE |
2390 | waveformChanged = false; |
2391 | } |
2392 | |
2393 | @@ -137,28 +205,65 @@ |
2394 | |
2395 | void WOverview::slotLoadNewWaveform(TrackInfoObject* pTrack) |
2396 | { |
2397 | - //Update this widget with new waveform summary data from the new track. |
2398 | - setData(pTrack->getWaveSummary(), |
2399 | - pTrack->getDuration()*pTrack->getSampleRate()*pTrack->getChannels()); |
2400 | - update(); |
2401 | -} |
2402 | - |
2403 | -void WOverview::cueChanged(double v) { |
2404 | - qDebug() << "WOverview::cueChanged()"; |
2405 | - QObject* pSender = sender(); |
2406 | - if (!pSender) |
2407 | - return; |
2408 | - |
2409 | - if (!m_hotcueMap.contains(pSender)) |
2410 | - return; |
2411 | - |
2412 | - int hotcue = m_hotcueMap[pSender]; |
2413 | - m_hotcues[hotcue] = v; |
2414 | - qDebug() << "hotcue" << hotcue << "position" << v; |
2415 | - update(); |
2416 | -} |
2417 | - |
2418 | -void WOverview::setData(QByteArray* pWaveformSummary, long liSampleDuration) |
2419 | +<<<<<<< TREE |
2420 | + //Update this widget with new waveform summary data from the new track. |
2421 | + setData(pTrack->getWaveSummary(), |
2422 | + pTrack->getDuration()*pTrack->getSampleRate()*pTrack->getChannels()); |
2423 | + update(); |
2424 | +} |
2425 | + |
2426 | +void WOverview::cueChanged(double v) { |
2427 | + qDebug() << "WOverview::cueChanged()"; |
2428 | + QObject* pSender = sender(); |
2429 | + if (!pSender) |
2430 | + return; |
2431 | + |
2432 | + if (!m_hotcueMap.contains(pSender)) |
2433 | + return; |
2434 | + |
2435 | + int hotcue = m_hotcueMap[pSender]; |
2436 | + m_hotcues[hotcue] = v; |
2437 | + qDebug() << "hotcue" << hotcue << "position" << v; |
2438 | + update(); |
2439 | +} |
2440 | + |
2441 | +void WOverview::setData(QByteArray* pWaveformSummary, long liSampleDuration) |
2442 | +======= |
2443 | + //Update this widget with new waveform summary data from the new track. |
2444 | + setData(pTrack->getWaveSummary(), |
2445 | + pTrack->getDuration()*pTrack->getSampleRate()*pTrack->getChannels()); |
2446 | + update(); |
2447 | +} |
2448 | + |
2449 | +void WOverview::cueChanged(double v) { |
2450 | + qDebug() << "WOverview::cueChanged()"; |
2451 | + QObject* pSender = sender(); |
2452 | + if (!pSender) |
2453 | + return; |
2454 | + |
2455 | + if (!m_hotcueMap.contains(pSender)) |
2456 | + return; |
2457 | + |
2458 | + int hotcue = m_hotcueMap[pSender]; |
2459 | + m_hotcues[hotcue] = v; |
2460 | + qDebug() << "hotcue" << hotcue << "position" << v; |
2461 | + update(); |
2462 | +} |
2463 | + |
2464 | +void WOverview::loopStartChanged(double v) { |
2465 | + m_dLoopStart = v; |
2466 | +} |
2467 | + |
2468 | +void WOverview::loopEndChanged(double v) { |
2469 | + m_dLoopEnd = v; |
2470 | +} |
2471 | + |
2472 | +void WOverview::loopEnabledChanged(double v) { |
2473 | + m_bLoopEnabled = !(v == 0.0f); |
2474 | +} |
2475 | + |
2476 | +void WOverview::setData(QByteArray* pWaveformSummary, long liSampleDuration) |
2477 | +>>>>>>> MERGE-SOURCE |
2478 | { |
2479 | m_pWaveformSummary = pWaveformSummary; |
2480 | m_liSampleDuration = liSampleDuration; |
2481 | @@ -311,6 +416,7 @@ |
2482 | paint.drawLine(m_iPos+1, 0, m_iPos+1, height()); |
2483 | //paint.drawLine(m_iPos-1, 0, m_iPos-1, height()); |
2484 | |
2485 | +<<<<<<< TREE |
2486 | // Draw hotcues |
2487 | |
2488 | if (m_liSampleDuration > 0) { |
2489 | @@ -333,6 +439,61 @@ |
2490 | fPos+5, height()); |
2491 | |
2492 | paint.drawText(rect, Qt::AlignCenter, QString("%1").arg(i)); |
2493 | +======= |
2494 | + // Draw hotcues |
2495 | + |
2496 | + if (m_liSampleDuration > 0) { |
2497 | + float fPos; |
2498 | + |
2499 | + // Draw loop markers |
2500 | + QColor loopColor = m_qColorMarker; |
2501 | + if (!m_bLoopEnabled) { |
2502 | + loopColor = m_qColorSignal; |
2503 | + } |
2504 | + paint.setPen(loopColor); |
2505 | + if (m_dLoopStart != -1.0) { |
2506 | + fPos = m_dLoopStart * (width() - 2) / m_liSampleDuration; |
2507 | + paint.drawLine(fPos, 0, fPos, height()); |
2508 | + } |
2509 | + if (m_dLoopEnd != -1.0) { |
2510 | + fPos = m_dLoopEnd * (width() - 2) / m_liSampleDuration; |
2511 | + paint.drawLine(fPos, 0, fPos, height()); |
2512 | + } |
2513 | + |
2514 | + if (m_dLoopStart != -1.0 && m_dLoopEnd != -1.0) { |
2515 | + //loopColor.setAlphaF(0.5); |
2516 | + paint.setOpacity(0.5); |
2517 | + //paint.setPen(loopColor); |
2518 | + paint.setBrush(QBrush(loopColor)); |
2519 | + float sPos = m_dLoopStart * (width() - 2) / m_liSampleDuration; |
2520 | + float ePos = m_dLoopEnd * (width() - 2) / m_liSampleDuration; |
2521 | + QRectF rect(QPointF(sPos, 0), QPointF(ePos, height()-1)); |
2522 | + paint.drawRect(rect); |
2523 | + paint.setOpacity(1.0); |
2524 | + } |
2525 | + |
2526 | + QFont font; |
2527 | + font.setBold(false); |
2528 | + font.setPixelSize(height()); |
2529 | + paint.setPen(m_qColorMarker); |
2530 | + paint.setFont(font); |
2531 | + |
2532 | + for (int i = 0; i < m_hotcues.size(); ++i) { |
2533 | + int position = m_hotcues[i]; |
2534 | + if (position == -1) |
2535 | + continue; |
2536 | + fPos = float(position) * (width()-2) / m_liSampleDuration; |
2537 | + //qDebug() << "Drawing cue" << i << "at" << fPos; |
2538 | + // paint.drawLine(fPos, 0, |
2539 | + // fPos, height()); |
2540 | + // paint.drawLine(fPos+1, 0, |
2541 | + // fPos+1, height()); |
2542 | + int textWidth = 5; |
2543 | + QRectF rect(fPos-5, 0, |
2544 | + fPos+5, height()); |
2545 | + |
2546 | + paint.drawText(rect, Qt::AlignCenter, QString("%1").arg(i)); |
2547 | +>>>>>>> MERGE-SOURCE |
2548 | } |
2549 | } |
2550 | } |
2551 | |
2552 | === modified file 'mixxx/src/widget/woverview.h' |
2553 | --- mixxx/src/widget/woverview.h 2009-11-11 02:10:46 +0000 |
2554 | +++ mixxx/src/widget/woverview.h 2009-11-18 00:45:31 +0000 |
2555 | @@ -49,20 +49,49 @@ |
2556 | QColor getSignalColor(); |
2557 | public slots: |
2558 | void setValue(double); |
2559 | - void slotLoadNewWaveform(TrackInfoObject* pTrack); |
2560 | - private slots: |
2561 | - void cueChanged(double v); |
2562 | - private: |
2563 | +<<<<<<< TREE |
2564 | + void slotLoadNewWaveform(TrackInfoObject* pTrack); |
2565 | + private slots: |
2566 | + void cueChanged(double v); |
2567 | + private: |
2568 | +======= |
2569 | + void slotLoadNewWaveform(TrackInfoObject* pTrack); |
2570 | + private slots: |
2571 | + void cueChanged(double v); |
2572 | + void loopStartChanged(double v); |
2573 | + void loopEndChanged(double v); |
2574 | + void loopEnabledChanged(double v); |
2575 | + private: |
2576 | +>>>>>>> MERGE-SOURCE |
2577 | |
2578 | const char* m_pGroup; |
2579 | bool waveformChanged; |
2580 | |
2581 | - QList<ControlObject*> m_hotcueControls; |
2582 | - QMap<QObject*, int> m_hotcueMap; |
2583 | - QList<int> m_hotcues; |
2584 | - |
2585 | +<<<<<<< TREE |
2586 | + QList<ControlObject*> m_hotcueControls; |
2587 | + QMap<QObject*, int> m_hotcueMap; |
2588 | + QList<int> m_hotcues; |
2589 | + |
2590 | +======= |
2591 | + // Loop controls and values |
2592 | + ControlObject* m_pLoopStart; |
2593 | + ControlObject* m_pLoopEnd; |
2594 | + ControlObject* m_pLoopEnabled; |
2595 | + double m_dLoopStart, m_dLoopEnd; |
2596 | + bool m_bLoopEnabled; |
2597 | + |
2598 | + // Hotcue controls and values |
2599 | + QList<ControlObject*> m_hotcueControls; |
2600 | + QMap<QObject*, int> m_hotcueMap; |
2601 | + QList<int> m_hotcues; |
2602 | + |
2603 | +>>>>>>> MERGE-SOURCE |
2604 | /** Pointer to array containing waveform summary */ |
2605 | +<<<<<<< TREE |
2606 | QByteArray *m_pWaveformSummary; |
2607 | +======= |
2608 | + QByteArray* m_pWaveformSummary; |
2609 | +>>>>>>> MERGE-SOURCE |
2610 | /** Duration of current track in samples */ |
2611 | int m_liSampleDuration; |
2612 | /** True if slider is dragged. Only used when m_bEventWhileDrag is false */ |
2613 | |
2614 | === modified file 'mixxx/src/widget/wwaveformviewer.cpp' |
2615 | --- mixxx/src/widget/wwaveformviewer.cpp 2009-07-12 08:02:43 +0000 |
2616 | +++ mixxx/src/widget/wwaveformviewer.cpp 2009-11-18 00:45:31 +0000 |
2617 | @@ -21,7 +21,7 @@ |
2618 | Q_ASSERT(m_pWaveformRenderer); |
2619 | |
2620 | m_pGroup = group; |
2621 | - |
2622 | + |
2623 | setAcceptDrops(true); |
2624 | |
2625 | installEventFilter(this); |
2626 | @@ -31,7 +31,7 @@ |
2627 | int desired_fps = 1; |
2628 | int update_interval = 1000 / desired_fps; |
2629 | m_iTimerID = startTimer(update_interval); |
2630 | - |
2631 | + |
2632 | m_painting = false; |
2633 | } |
2634 | |
2635 | @@ -47,7 +47,7 @@ |
2636 | int sep = pos.indexOf(","); |
2637 | int x = pos.left(sep).toInt(); |
2638 | int y = pos.mid(sep+1).toInt(); |
2639 | - |
2640 | + |
2641 | move(x,y); |
2642 | |
2643 | // Acquire size |
2644 | @@ -58,19 +58,19 @@ |
2645 | |
2646 | setFixedSize(x,y); |
2647 | |
2648 | + m_pWaveformRenderer->setup(node); |
2649 | + |
2650 | m_pWaveformRenderer->resize(x,y); |
2651 | - |
2652 | - m_pWaveformRenderer->setup(node); |
2653 | } |
2654 | |
2655 | void WWaveformViewer::paintEvent(QPaintEvent *event) { |
2656 | QPainter painter; |
2657 | painter.begin(this); |
2658 | - |
2659 | + |
2660 | painter.setRenderHint(QPainter::Antialiasing); |
2661 | |
2662 | m_pWaveformRenderer->draw(&painter, event); |
2663 | - |
2664 | + |
2665 | painter.end(); |
2666 | m_painting = false; |
2667 | // QPainter goes out of scope and is destructed |
2668 | @@ -80,7 +80,7 @@ |
2669 | //m_paintMutex.lock(); |
2670 | if(!m_painting) { |
2671 | m_painting = true; |
2672 | - |
2673 | + |
2674 | // The docs say update is better than repaint. |
2675 | update(); |
2676 | } |
2677 | |
2678 | === modified file 'mixxx/src/widget/wwidget.cpp' |
2679 | --- mixxx/src/widget/wwidget.cpp 2009-03-05 17:52:08 +0000 |
2680 | +++ mixxx/src/widget/wwidget.cpp 2009-11-18 00:45:31 +0000 |
2681 | @@ -30,7 +30,7 @@ |
2682 | |
2683 | WWidget::WWidget(QWidget * parent, Qt::WFlags flags) : QWidget(parent, flags) |
2684 | { |
2685 | - |
2686 | + |
2687 | m_fValue = 0.; |
2688 | m_bOff = false; |
2689 | connect(this, SIGNAL(valueChangedLeftDown(double)), this, SLOT(slotReEmitValueDown(double))); |
2690 | @@ -83,9 +83,7 @@ |
2691 | // Get ConfigKey |
2692 | QString key = selectNodeQString(con, "ConfigKey"); |
2693 | |
2694 | - ConfigKey configKey; |
2695 | - configKey.group = key.left(key.indexOf(",")); |
2696 | - configKey.item = key.mid(key.indexOf(",")+1); |
2697 | + ConfigKey configKey = ConfigKey::parseCommaSeparated(key); |
2698 | |
2699 | // Check that the control exists |
2700 | ControlObject * control = ControlObject::getControl(configKey); |
The waveform changes are ready to go. This includes loop markers with range coloring and waveform overview showing of loops. Additionally, waveform markers are more flexible now -- you can put a text label on them or load a pixmap to show for them and control their colors. They can be added via skin.xml now too. I updated every skin to have a loop start and end marker, a loop range marker, and a cue point marker.