Merge lp:~oberling/mixxx/feature_first-beat-in-bar into lp:~mixxxdevelopers/mixxx/trunk

Proposed by Stephan Bergemann
Status: Needs review
Proposed branch: lp:~oberling/mixxx/feature_first-beat-in-bar
Merge into: lp:~mixxxdevelopers/mixxx/trunk
Diff against target: 660 lines (+97/-12)
29 files modified
mixxx/res/skins/Deere1280x1024-SXGA/skin.xml (+2/-0)
mixxx/res/skins/Deere1280x800-WXGA/skin.xml (+2/-0)
mixxx/res/skins/Deere1366x768-WXGA/skin.xml (+2/-0)
mixxx/res/skins/Deere1440x900-WXGA+/skin.xml (+2/-0)
mixxx/res/skins/Deere1920x1080-FullHD/skin.xml (+2/-0)
mixxx/res/skins/Deere1920x1200-WUXGA/skin.xml (+2/-0)
mixxx/res/skins/DeereSamplegrid1280x800-WXGA/skin.xml (+2/-0)
mixxx/res/skins/LateNight1280x1024-SXGA/skin.xml (+2/-0)
mixxx/res/skins/LateNight1280x800-WXGA/skin.xml (+2/-0)
mixxx/res/skins/LateNight1366x768-WXGA/skin.xml (+2/-0)
mixxx/res/skins/LateNightBlues1280x1024-SXGA/skin.xml (+2/-0)
mixxx/res/skins/LateNightBlues1280x800-WXGA/skin.xml (+2/-0)
mixxx/res/skins/LateNightBlues1366x768-WXGA/skin.xml (+2/-0)
mixxx/res/skins/Outline1024x600-Netbook/skin.xml (+2/-0)
mixxx/res/skins/Outline1024x768-XGA/skin.xml (+2/-0)
mixxx/res/skins/Outline800x480-WVGA/skin.xml (+2/-0)
mixxx/res/skins/Phoney1600x1200-UXGA/skin.xml (+2/-0)
mixxx/res/skins/Phoney1680x1050-WSXGA/skin.xml (+2/-0)
mixxx/res/skins/PhoneyDark1600x1200-UXGA/skin.xml (+2/-0)
mixxx/res/skins/PhoneyDark1680x1050-WSXGA/skin.xml (+2/-0)
mixxx/res/skins/Shade1024x600-Netbook/skin.xml (+2/-0)
mixxx/res/skins/Shade1024x768-XGA/skin.xml (+2/-0)
mixxx/res/skins/ShadeDark1024x600-Netbook/skin.xml (+2/-0)
mixxx/res/skins/ShadeDark1024x768-XGA/skin.xml (+2/-0)
mixxx/src/track/beatgrid.cpp (+17/-5)
mixxx/src/track/beatmap.cpp (+11/-3)
mixxx/src/track/beats.h (+1/-0)
mixxx/src/waveform/renderers/waveformrenderbeat.cpp (+19/-4)
mixxx/src/waveform/renderers/waveformrenderbeat.h (+1/-0)
To merge this branch: bzr merge lp:~oberling/mixxx/feature_first-beat-in-bar
Reviewer Review Type Date Requested Status
Daniel Schürmann Abstain
Review via email: mp+155096@code.launchpad.net

Commit message

Added a highlight on every first beat in a bar.

Description of the change

Added a highlight on every first beat in a bar.
This fixes one part of bug #753301 as it gives a usefull visual indicator for mixing tracks.
I also added a color for this highlighted beat to each existing theme.

To post a comment you must log in.
3337. By Stephan Bergemann <email address hidden>

fixed firstBeatInBar-Calculation in BeatMap

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi Stephan,

Thank you very much for your branch.
From the coding side it looks good.
Except expression in mixxx/src/waveform/renderers/waveformrenderbeat.cpp line 110 should be combined with the expressions above.

Form the visual point of view IMHO the first beat bar is too highlighted (too red and bold). I would prefer an additional icon on the normal bars. I hope Jus, our design maintainer can also help out here.

While this is a good step to the final goal, I would not merge this branch yet because of the missing detection support.

Kind regards,
Daniel

review: Needs Fixing
3338. By Stephan Bergemann <email address hidden>

made first beat bar less bold; added a little efficiency;

Revision history for this message
Stephan Bergemann (oberling) wrote :

Hi Daniel,

thanks a lot for the review and kind advices.

I made the first beat bar a little less thick and integrated my if-clause with the existing ones. As i'm no designer i just chose the colors that fitted the most for me - may Jus feel free to change them all :-) .

I just don't get what you mean by "missing detection support". The missing phase-sync from the cited bug report was already implemented before my branch. At least one can click on sync and when not in vinyl control mode it should sync the bpm as well as the phase to the nearest detected beat. However it does not sync to the first beat of a bar - that's right. Was that what you meant?

Kind regards,
Stephan

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi Stephan,

thank you again. IMHO it looks fine now.

Please don’t kill me if the following paragraphs are totally rubbish :-) ...

I am not an expert in music theory but for a lot of my tracks it feels to me that the new downbeat makers are simply placed at the wrong position.

I have just read:
http://en.wikipedia.org/wiki/Beat_%28music%29
http://en.wikipedia.org/wiki/Bar_%28music%29

As far as I understand (please correct me) a downbeat marker should be placed at least at theme changes or when a chorus starts. Maybe there is an unwritten law that the first beat in a track is always a downbeat like assumed in your patch, but for some of the tracks in my collection this is true but not for the rest.

I cannot evaluate how useful you patch is in the current state. Is the four beat assumption true in general? Do we need a facility to correct the first beat in a bar and the number of beats per bar?

I hope we can answer these questions soon.

Kind regards,

Daniel

review: Abstain
Revision history for this message
Stephan Bergemann (oberling) wrote :

Hi Daniel,

sorry for that taking so long - lots of other stuff to do first.
I thought for some time about your suggestions:
I totally agree with you, that it would be nice to have the "first beat in a bar" adjustable. At the moment it's just the first ever stroke in the grid corresponding to the audio file (which doesn't have to be the first beat of the track - however it (at least for my tracks) is in 90% ;-) ).
The first beat in a bar in my understanding (and if i understood correctly also in your understanding) describes the downbeat (thats also the definition of Downbeat in the wikipedia article "Beat_(music)").

There are a few steps i could try to implement from that point:
* add a "first_downbeat" to the stored track informations
* store the first beat really on a beat (and not the first ever grid-element in the audio file) - that would be quiet hard to distinguish i guess (silent intros and stuff)
* bloat the beat detection to be really highly sophisticated and also detect bars, intros outtros, repeated parts and stuff - that would involve detecting where bars start and end and also a the writing of a PhD thesis :-D

All those changes would however that would (as far as i see) result in the need of a recreateion of the database and i don't know if that would raise my chances of getting this branch merged ;-) .
That's the main reason why i didn't do it that way in the first place.

As of the four beat assumption: this is adjustable but defaults to 4 (see the Constructors of the BeatGridIterator and BeatMapIterator) in the current state of development to give an idea.
When extending this idea we would have to think about storing this information as well in the Trackinformation.
And... in general (although i can not remember having seen that in other DJ Software) all the beat detection is voulnerable to time changes.

Kind regards,
Stephan

> Hi Stephan,
>
> thank you again. IMHO it looks fine now.
>
> Please don’t kill me if the following paragraphs are totally rubbish :-) ...
>
> I am not an expert in music theory but for a lot of my tracks it feels to me
> that the new downbeat makers are simply placed at the wrong position.
>
> I have just read:
> http://en.wikipedia.org/wiki/Beat_%28music%29
> http://en.wikipedia.org/wiki/Bar_%28music%29
>
> As far as I understand (please correct me) a downbeat marker should be placed
> at least at theme changes or when a chorus starts. Maybe there is an unwritten
> law that the first beat in a track is always a downbeat like assumed in your
> patch, but for some of the tracks in my collection this is true but not for
> the rest.
>
> I cannot evaluate how useful you patch is in the current state. Is the four
> beat assumption true in general? Do we need a facility to correct the first
> beat in a bar and the number of beats per bar?
>
> I hope we can answer these questions soon.
>
> Kind regards,
>
> Daniel

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi Stephan,

first of all: I am sure your branch will get merged.

I personaly not like informaton that "might" be right. So the bars schould not be displayed by default if they are not valid. But you might introduce a waveform preference to enable them.

An other option is to introduce a new Cue point type "first bar". The database schma already supports different cue point types. lp:~smstewart91/mixxx/advanced_autodj makes use of it. I think it is common for many DJs to place the normal cue point at this place so you might deal with it.
We could probably adjust it by rightclick to the "Adjust Beatgrid" button.

The third option is to activate the bar detection which already lives in the mixxx source. mixxx/vamp-plugins/plugins/BarBeatTrack.cpp I dont know the current state but maybe Vittorio or RJ might help here.

Kind regards

Daniel

Unmerged revisions

3338. By Stephan Bergemann <email address hidden>

made first beat bar less bold; added a little efficiency;

3337. By Stephan Bergemann <email address hidden>

fixed firstBeatInBar-Calculation in BeatMap

3336. By Stephan Bergemann <email address hidden>

added new colour to every theme

3335. By Stephan Bergemann <email address hidden>

added red highlight for first beat of each bar

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mixxx/res/skins/Deere1280x1024-SXGA/skin.xml'
2--- mixxx/res/skins/Deere1280x1024-SXGA/skin.xml 2013-02-16 15:03:32 +0000
3+++ mixxx/res/skins/Deere1280x1024-SXGA/skin.xml 2013-03-24 00:04:23 +0000
4@@ -3958,6 +3958,7 @@
5 <SignalLowColor></SignalLowColor>
6 <SignalColor>#0099FF</SignalColor>
7 <BeatColor>#ffffff</BeatColor>
8+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
9 <BeatHighlightColor></BeatHighlightColor>
10 <PlayPosColor>#00FF00</PlayPosColor>
11 <EndOfTrackColor>#EA0000</EndOfTrackColor>
12@@ -5057,6 +5058,7 @@
13 <SignalLowColor></SignalLowColor>
14 <SignalColor>#E17800</SignalColor>
15 <BeatColor>#ffffff</BeatColor>
16+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
17 <BeatHighlightColor></BeatHighlightColor>
18 <PlayPosColor>#00FF00</PlayPosColor>
19 <EndOfTrackColor>#EA0000</EndOfTrackColor>
20
21=== modified file 'mixxx/res/skins/Deere1280x800-WXGA/skin.xml'
22--- mixxx/res/skins/Deere1280x800-WXGA/skin.xml 2013-02-16 15:03:32 +0000
23+++ mixxx/res/skins/Deere1280x800-WXGA/skin.xml 2013-03-24 00:04:23 +0000
24@@ -3958,6 +3958,7 @@
25 <SignalLowColor></SignalLowColor>
26 <SignalColor>#0099FF</SignalColor>
27 <BeatColor>#ffffff</BeatColor>
28+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
29 <BeatHighlightColor></BeatHighlightColor>
30 <PlayPosColor>#00FF00</PlayPosColor>
31 <EndOfTrackColor>#EA0000</EndOfTrackColor>
32@@ -5057,6 +5058,7 @@
33 <SignalLowColor></SignalLowColor>
34 <SignalColor>#E17800</SignalColor>
35 <BeatColor>#ffffff</BeatColor>
36+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
37 <BeatHighlightColor></BeatHighlightColor>
38 <PlayPosColor>#00FF00</PlayPosColor>
39 <EndOfTrackColor>#EA0000</EndOfTrackColor>
40
41=== modified file 'mixxx/res/skins/Deere1366x768-WXGA/skin.xml'
42--- mixxx/res/skins/Deere1366x768-WXGA/skin.xml 2013-02-16 15:03:32 +0000
43+++ mixxx/res/skins/Deere1366x768-WXGA/skin.xml 2013-03-24 00:04:23 +0000
44@@ -3958,6 +3958,7 @@
45 <SignalLowColor></SignalLowColor>
46 <SignalColor>#0099FF</SignalColor>
47 <BeatColor>#ffffff</BeatColor>
48+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
49 <BeatHighlightColor></BeatHighlightColor>
50 <PlayPosColor>#00FF00</PlayPosColor>
51 <EndOfTrackColor>#EA0000</EndOfTrackColor>
52@@ -5057,6 +5058,7 @@
53 <SignalLowColor></SignalLowColor>
54 <SignalColor>#E17800</SignalColor>
55 <BeatColor>#ffffff</BeatColor>
56+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
57 <BeatHighlightColor></BeatHighlightColor>
58 <PlayPosColor>#00FF00</PlayPosColor>
59 <EndOfTrackColor>#EA0000</EndOfTrackColor>
60
61=== modified file 'mixxx/res/skins/Deere1440x900-WXGA+/skin.xml'
62--- mixxx/res/skins/Deere1440x900-WXGA+/skin.xml 2013-02-16 15:03:32 +0000
63+++ mixxx/res/skins/Deere1440x900-WXGA+/skin.xml 2013-03-24 00:04:23 +0000
64@@ -3958,6 +3958,7 @@
65 <SignalLowColor></SignalLowColor>
66 <SignalColor>#0099FF</SignalColor>
67 <BeatColor>#ffffff</BeatColor>
68+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
69 <BeatHighlightColor></BeatHighlightColor>
70 <PlayPosColor>#00FF00</PlayPosColor>
71 <EndOfTrackColor>#EA0000</EndOfTrackColor>
72@@ -5057,6 +5058,7 @@
73 <SignalLowColor></SignalLowColor>
74 <SignalColor>#E17800</SignalColor>
75 <BeatColor>#ffffff</BeatColor>
76+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
77 <BeatHighlightColor></BeatHighlightColor>
78 <PlayPosColor>#00FF00</PlayPosColor>
79 <EndOfTrackColor>#EA0000</EndOfTrackColor>
80
81=== modified file 'mixxx/res/skins/Deere1920x1080-FullHD/skin.xml'
82--- mixxx/res/skins/Deere1920x1080-FullHD/skin.xml 2013-02-16 15:03:32 +0000
83+++ mixxx/res/skins/Deere1920x1080-FullHD/skin.xml 2013-03-24 00:04:23 +0000
84@@ -4986,6 +4986,7 @@
85 <SignalLowColor></SignalLowColor>
86 <SignalColor>#0099FF</SignalColor>
87 <BeatColor>#ffffff</BeatColor>
88+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
89 <BeatHighlightColor></BeatHighlightColor>
90 <PlayPosColor>#00FF00</PlayPosColor>
91 <EndOfTrackColor>#EA0000</EndOfTrackColor>
92@@ -6085,6 +6086,7 @@
93 <SignalLowColor></SignalLowColor>
94 <SignalColor>#E17800</SignalColor>
95 <BeatColor>#ffffff</BeatColor>
96+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
97 <BeatHighlightColor></BeatHighlightColor>
98 <PlayPosColor>#00FF00</PlayPosColor>
99 <EndOfTrackColor>#EA0000</EndOfTrackColor>
100
101=== modified file 'mixxx/res/skins/Deere1920x1200-WUXGA/skin.xml'
102--- mixxx/res/skins/Deere1920x1200-WUXGA/skin.xml 2013-02-16 15:03:32 +0000
103+++ mixxx/res/skins/Deere1920x1200-WUXGA/skin.xml 2013-03-24 00:04:23 +0000
104@@ -4986,6 +4986,7 @@
105 <SignalLowColor></SignalLowColor>
106 <SignalColor>#0099FF</SignalColor>
107 <BeatColor>#ffffff</BeatColor>
108+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
109 <BeatHighlightColor></BeatHighlightColor>
110 <PlayPosColor>#00FF00</PlayPosColor>
111 <EndOfTrackColor>#EA0000</EndOfTrackColor>
112@@ -6085,6 +6086,7 @@
113 <SignalLowColor></SignalLowColor>
114 <SignalColor>#E17800</SignalColor>
115 <BeatColor>#ffffff</BeatColor>
116+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
117 <BeatHighlightColor></BeatHighlightColor>
118 <PlayPosColor>#00FF00</PlayPosColor>
119 <EndOfTrackColor>#EA0000</EndOfTrackColor>
120
121=== modified file 'mixxx/res/skins/DeereSamplegrid1280x800-WXGA/skin.xml'
122--- mixxx/res/skins/DeereSamplegrid1280x800-WXGA/skin.xml 2013-02-16 15:03:32 +0000
123+++ mixxx/res/skins/DeereSamplegrid1280x800-WXGA/skin.xml 2013-03-24 00:04:23 +0000
124@@ -5622,6 +5622,7 @@
125 <SignalLowColor></SignalLowColor>
126 <SignalColor>#0099FF</SignalColor>
127 <BeatColor>#ffffff</BeatColor>
128+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
129 <BeatHighlightColor></BeatHighlightColor>
130 <MarkerColor>#00FF00</MarkerColor>
131 <PlayPosColor>#00FF00</PlayPosColor>
132@@ -6723,6 +6724,7 @@
133 <SignalLowColor></SignalLowColor>
134 <SignalColor>#E17800</SignalColor>
135 <BeatColor>#ffffff</BeatColor>
136+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
137 <BeatHighlightColor></BeatHighlightColor>
138 <MarkerColor>#00FF00</MarkerColor>
139 <PlayPosColor>#00FF00</PlayPosColor>
140
141=== modified file 'mixxx/res/skins/LateNight1280x1024-SXGA/skin.xml'
142--- mixxx/res/skins/LateNight1280x1024-SXGA/skin.xml 2013-02-16 15:03:32 +0000
143+++ mixxx/res/skins/LateNight1280x1024-SXGA/skin.xml 2013-03-24 00:04:23 +0000
144@@ -2817,6 +2817,7 @@
145 <BgPixmap>style/style_bg_waveform1.png</BgPixmap>
146 <SignalColor>#0099FF</SignalColor>
147 <BeatColor>#ffffff</BeatColor>
148+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
149 <BeatHighlightColor></BeatHighlightColor>
150 <PlayPosColor>#00FF00</PlayPosColor>
151 <EndOfTrackColor>#EA0000</EndOfTrackColor>
152@@ -2871,6 +2872,7 @@
153 <BgPixmap>style/style_bg_waveform2.png</BgPixmap>
154 <SignalColor>#E17800</SignalColor>
155 <BeatColor>#ffffff</BeatColor>
156+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
157 <BeatHighlightColor></BeatHighlightColor>
158 <PlayPosColor>#00FF00</PlayPosColor>
159 <EndOfTrackColor>#EA0000</EndOfTrackColor>
160
161=== modified file 'mixxx/res/skins/LateNight1280x800-WXGA/skin.xml'
162--- mixxx/res/skins/LateNight1280x800-WXGA/skin.xml 2013-02-16 15:03:32 +0000
163+++ mixxx/res/skins/LateNight1280x800-WXGA/skin.xml 2013-03-24 00:04:23 +0000
164@@ -2817,6 +2817,7 @@
165 <BgPixmap>style/style_bg_waveform1.png</BgPixmap>
166 <SignalColor>#0099FF</SignalColor>
167 <BeatColor>#ffffff</BeatColor>
168+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
169 <BeatHighlightColor></BeatHighlightColor>
170 <PlayPosColor>#00FF00</PlayPosColor>
171 <EndOfTrackColor>#EA0000</EndOfTrackColor>
172@@ -2871,6 +2872,7 @@
173 <BgPixmap>style/style_bg_waveform2.png</BgPixmap>
174 <SignalColor>#E17800</SignalColor>
175 <BeatColor>#ffffff</BeatColor>
176+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
177 <BeatHighlightColor></BeatHighlightColor>
178 <PlayPosColor>#00FF00</PlayPosColor>
179 <EndOfTrackColor>#EA0000</EndOfTrackColor>
180
181=== modified file 'mixxx/res/skins/LateNight1366x768-WXGA/skin.xml'
182--- mixxx/res/skins/LateNight1366x768-WXGA/skin.xml 2013-02-16 15:03:32 +0000
183+++ mixxx/res/skins/LateNight1366x768-WXGA/skin.xml 2013-03-24 00:04:23 +0000
184@@ -2817,6 +2817,7 @@
185 <BgPixmap>style/style_bg_waveform1.png</BgPixmap>
186 <SignalColor>#0099FF</SignalColor>
187 <BeatColor>#ffffff</BeatColor>
188+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
189 <BeatHighlightColor></BeatHighlightColor>
190 <PlayPosColor>#00FF00</PlayPosColor>
191 <EndOfTrackColor>#EA0000</EndOfTrackColor>
192@@ -2871,6 +2872,7 @@
193 <BgPixmap>style/style_bg_waveform2.png</BgPixmap>
194 <SignalColor>#E17800</SignalColor>
195 <BeatColor>#ffffff</BeatColor>
196+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
197 <BeatHighlightColor></BeatHighlightColor>
198 <PlayPosColor>#00FF00</PlayPosColor>
199 <EndOfTrackColor>#EA0000</EndOfTrackColor>
200
201=== modified file 'mixxx/res/skins/LateNightBlues1280x1024-SXGA/skin.xml'
202--- mixxx/res/skins/LateNightBlues1280x1024-SXGA/skin.xml 2013-02-16 15:03:32 +0000
203+++ mixxx/res/skins/LateNightBlues1280x1024-SXGA/skin.xml 2013-03-24 00:04:23 +0000
204@@ -2817,6 +2817,7 @@
205 <BgPixmap>style/style_bg_waveform1.png</BgPixmap>
206 <SignalColor>#FBC400</SignalColor>
207 <BeatColor>#ffffff</BeatColor>
208+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
209 <BeatHighlightColor></BeatHighlightColor>
210 <PlayPosColor>#00FF00</PlayPosColor>
211 <EndOfTrackColor>#EA0000</EndOfTrackColor>
212@@ -2871,6 +2872,7 @@
213 <BgPixmap>style/style_bg_waveform2.png</BgPixmap>
214 <SignalColor>#FB9A00</SignalColor>
215 <BeatColor>#ffffff</BeatColor>
216+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
217 <BeatHighlightColor></BeatHighlightColor>
218 <PlayPosColor>#00FF00</PlayPosColor>
219 <EndOfTrackColor>#EA0000</EndOfTrackColor>
220
221=== modified file 'mixxx/res/skins/LateNightBlues1280x800-WXGA/skin.xml'
222--- mixxx/res/skins/LateNightBlues1280x800-WXGA/skin.xml 2013-02-16 15:03:32 +0000
223+++ mixxx/res/skins/LateNightBlues1280x800-WXGA/skin.xml 2013-03-24 00:04:23 +0000
224@@ -2817,6 +2817,7 @@
225 <BgPixmap>style/style_bg_waveform1.png</BgPixmap>
226 <SignalColor>#FBC400</SignalColor>
227 <BeatColor>#ffffff</BeatColor>
228+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
229 <BeatHighlightColor></BeatHighlightColor>
230 <PlayPosColor>#00FF00</PlayPosColor>
231 <EndOfTrackColor>#EA0000</EndOfTrackColor>
232@@ -2871,6 +2872,7 @@
233 <BgPixmap>style/style_bg_waveform2.png</BgPixmap>
234 <SignalColor>#FB9A00</SignalColor>
235 <BeatColor>#ffffff</BeatColor>
236+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
237 <BeatHighlightColor></BeatHighlightColor>
238 <PlayPosColor>#00FF00</PlayPosColor>
239 <EndOfTrackColor>#EA0000</EndOfTrackColor>
240
241=== modified file 'mixxx/res/skins/LateNightBlues1366x768-WXGA/skin.xml'
242--- mixxx/res/skins/LateNightBlues1366x768-WXGA/skin.xml 2013-02-16 15:03:32 +0000
243+++ mixxx/res/skins/LateNightBlues1366x768-WXGA/skin.xml 2013-03-24 00:04:23 +0000
244@@ -2817,6 +2817,7 @@
245 <BgPixmap>style/style_bg_waveform1.png</BgPixmap>
246 <SignalColor>#FBC400</SignalColor>
247 <BeatColor>#ffffff</BeatColor>
248+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
249 <BeatHighlightColor></BeatHighlightColor>
250 <PlayPosColor>#00FF00</PlayPosColor>
251 <EndOfTrackColor>#EA0000</EndOfTrackColor>
252@@ -2871,6 +2872,7 @@
253 <BgPixmap>style/style_bg_waveform2.png</BgPixmap>
254 <SignalColor>#FB9A00</SignalColor>
255 <BeatColor>#ffffff</BeatColor>
256+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
257 <BeatHighlightColor></BeatHighlightColor>
258 <PlayPosColor>#00FF00</PlayPosColor>
259 <EndOfTrackColor>#EA0000</EndOfTrackColor>
260
261=== modified file 'mixxx/res/skins/Outline1024x600-Netbook/skin.xml'
262--- mixxx/res/skins/Outline1024x600-Netbook/skin.xml 2013-02-01 17:26:08 +0000
263+++ mixxx/res/skins/Outline1024x600-Netbook/skin.xml 2013-03-24 00:04:23 +0000
264@@ -616,6 +616,7 @@
265 <SignalLowColor>#FF0035</SignalLowColor>
266 <SignalColor>#19ABFB</SignalColor>
267 <BeatColor>#191919</BeatColor>
268+ <FirstBeatInBarColor>#000000</FirstBeatInBarColor>
269 <BeatHighlightColor></BeatHighlightColor>
270 <PlayPosColor>#00FF00</PlayPosColor>
271 <Align></Align>
272@@ -674,6 +675,7 @@
273 <SignalLowColor>#FF0035</SignalLowColor>
274 <SignalColor>#FF0000</SignalColor>
275 <BeatColor>#191919</BeatColor>
276+ <FirstBeatInBarColor>#000000</FirstBeatInBarColor>
277 <BeatHighlightColor></BeatHighlightColor>
278 <PlayPosColor>#00FF00</PlayPosColor>
279 <Align></Align>
280
281=== modified file 'mixxx/res/skins/Outline1024x768-XGA/skin.xml'
282--- mixxx/res/skins/Outline1024x768-XGA/skin.xml 2013-02-01 17:26:08 +0000
283+++ mixxx/res/skins/Outline1024x768-XGA/skin.xml 2013-03-24 00:04:23 +0000
284@@ -616,6 +616,7 @@
285 <SignalLowColor>#FF0035</SignalLowColor>
286 <SignalColor>#19ABFB</SignalColor>
287 <BeatColor>#191919</BeatColor>
288+ <FirstBeatInBarColor>#000000</FirstBeatInBarColor>
289 <BeatHighlightColor></BeatHighlightColor>
290 <PlayPosColor>#00FF00</PlayPosColor>
291 <Align></Align>
292@@ -674,6 +675,7 @@
293 <SignalLowColor>#FF0035</SignalLowColor>
294 <SignalColor>#FF0000</SignalColor>
295 <BeatColor>#191919</BeatColor>
296+ <FirstBeatInBarColor>#000000</FirstBeatInBarColor>
297 <BeatHighlightColor></BeatHighlightColor>
298 <PlayPosColor>#00FF00</PlayPosColor>
299 <Align></Align>
300
301=== modified file 'mixxx/res/skins/Outline800x480-WVGA/skin.xml'
302--- mixxx/res/skins/Outline800x480-WVGA/skin.xml 2013-02-01 17:26:52 +0000
303+++ mixxx/res/skins/Outline800x480-WVGA/skin.xml 2013-03-24 00:04:23 +0000
304@@ -616,6 +616,7 @@
305 <SignalLowColor>#FF0035</SignalLowColor>
306 <SignalColor>#19ABFB</SignalColor>
307 <BeatColor>#191919</BeatColor>
308+ <FirstBeatInBarColor>#000000</FirstBeatInBarColor>
309 <BeatHighlightColor></BeatHighlightColor>
310 <PlayPosColor>#00FF00</PlayPosColor>
311 <Align></Align>
312@@ -674,6 +675,7 @@
313 <SignalLowColor>#FF0035</SignalLowColor>
314 <SignalColor>#FF0000</SignalColor>
315 <BeatColor>#191919</BeatColor>
316+ <FirstBeatInBarColor>#000000</FirstBeatInBarColor>
317 <BeatHighlightColor></BeatHighlightColor>
318 <PlayPosColor>#00FF00</PlayPosColor>
319 <Align></Align>
320
321=== modified file 'mixxx/res/skins/Phoney1600x1200-UXGA/skin.xml'
322--- mixxx/res/skins/Phoney1600x1200-UXGA/skin.xml 2013-01-31 19:48:57 +0000
323+++ mixxx/res/skins/Phoney1600x1200-UXGA/skin.xml 2013-03-24 00:04:23 +0000
324@@ -210,6 +210,7 @@
325 <SignalLowColor></SignalLowColor>
326 <SignalColor>#0080FF</SignalColor>
327 <BeatColor>#454C53</BeatColor>
328+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
329 <BeatHighlightColor></BeatHighlightColor>
330 <PlayPosColor>#FD0564</PlayPosColor>
331 <EndOfTrackColor>#EA0000</EndOfTrackColor>
332@@ -267,6 +268,7 @@
333 <SignalLowColor></SignalLowColor>
334 <SignalColor>#E17000</SignalColor>
335 <BeatColor>#454C53</BeatColor>
336+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
337 <BeatHighlightColor></BeatHighlightColor>
338 <PlayPosColor>#FD0564</PlayPosColor>
339 <EndOfTrackColor>#EA0000</EndOfTrackColor>
340
341=== modified file 'mixxx/res/skins/Phoney1680x1050-WSXGA/skin.xml'
342--- mixxx/res/skins/Phoney1680x1050-WSXGA/skin.xml 2013-01-31 19:48:57 +0000
343+++ mixxx/res/skins/Phoney1680x1050-WSXGA/skin.xml 2013-03-24 00:04:23 +0000
344@@ -210,6 +210,7 @@
345 <SignalLowColor></SignalLowColor>
346 <SignalColor>#0080FF</SignalColor>
347 <BeatColor>#454C53</BeatColor>
348+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
349 <BeatHighlightColor></BeatHighlightColor>
350 <PlayPosColor>#FD0564</PlayPosColor>
351 <EndOfTrackColor>#EA0000</EndOfTrackColor>
352@@ -267,6 +268,7 @@
353 <SignalLowColor></SignalLowColor>
354 <SignalColor>#E17000</SignalColor>
355 <BeatColor>#454C53</BeatColor>
356+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
357 <BeatHighlightColor></BeatHighlightColor>
358 <PlayPosColor>#FD0564</PlayPosColor>
359 <EndOfTrackColor>#EA0000</EndOfTrackColor>
360
361=== modified file 'mixxx/res/skins/PhoneyDark1600x1200-UXGA/skin.xml'
362--- mixxx/res/skins/PhoneyDark1600x1200-UXGA/skin.xml 2013-01-31 19:48:57 +0000
363+++ mixxx/res/skins/PhoneyDark1600x1200-UXGA/skin.xml 2013-03-24 00:04:23 +0000
364@@ -209,6 +209,7 @@
365 <SignalLowColor></SignalLowColor>
366 <SignalColor>#0099FF</SignalColor>
367 <BeatColor>#CCCCCC</BeatColor>
368+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
369 <BeatHighlightColor></BeatHighlightColor>
370 <PlayPosColor>#00FF00</PlayPosColor>
371 <EndOfTrackColor>#EA0000</EndOfTrackColor>
372@@ -266,6 +267,7 @@
373 <SignalLowColor></SignalLowColor>
374 <SignalColor>#CC6600</SignalColor>
375 <BeatColor>#CCCCCC</BeatColor>
376+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
377 <BeatHighlightColor></BeatHighlightColor>
378 <PlayPosColor>#00FF00</PlayPosColor>
379 <EndOfTrackColor>#EA0000</EndOfTrackColor>
380
381=== modified file 'mixxx/res/skins/PhoneyDark1680x1050-WSXGA/skin.xml'
382--- mixxx/res/skins/PhoneyDark1680x1050-WSXGA/skin.xml 2013-01-31 19:48:57 +0000
383+++ mixxx/res/skins/PhoneyDark1680x1050-WSXGA/skin.xml 2013-03-24 00:04:23 +0000
384@@ -209,6 +209,7 @@
385 <SignalLowColor></SignalLowColor>
386 <SignalColor>#0099FF</SignalColor>
387 <BeatColor>#CCCCCC</BeatColor>
388+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
389 <BeatHighlightColor></BeatHighlightColor>
390 <PlayPosColor>#00FF00</PlayPosColor>
391 <EndOfTrackColor>#EA0000</EndOfTrackColor>
392@@ -266,6 +267,7 @@
393 <SignalLowColor></SignalLowColor>
394 <SignalColor>#CC6600</SignalColor>
395 <BeatColor>#CCCCCC</BeatColor>
396+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
397 <BeatHighlightColor></BeatHighlightColor>
398 <PlayPosColor>#00FF00</PlayPosColor>
399 <EndOfTrackColor>#EA0000</EndOfTrackColor>
400
401=== modified file 'mixxx/res/skins/Shade1024x600-Netbook/skin.xml'
402--- mixxx/res/skins/Shade1024x600-Netbook/skin.xml 2013-03-15 14:15:30 +0000
403+++ mixxx/res/skins/Shade1024x600-Netbook/skin.xml 2013-03-24 00:04:23 +0000
404@@ -3386,6 +3386,7 @@
405 <SignalLowColor></SignalLowColor>
406 <SignalColor>#191F24</SignalColor>
407 <BeatColor>#FFFFFF</BeatColor>
408+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
409 <BeatHighlightColor></BeatHighlightColor>
410 <PlayPosColor>#00FF00</PlayPosColor>
411 <EndOfTrackColor>#EA0000</EndOfTrackColor>
412@@ -4730,6 +4731,7 @@
413 <SignalLowColor></SignalLowColor>
414 <SignalColor>#191F24</SignalColor>
415 <BeatColor>#FFFFFF</BeatColor>
416+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
417 <BeatHighlightColor></BeatHighlightColor>
418 <PlayPosColor>#00FF00</PlayPosColor>
419 <EndOfTrackColor>#EA0000</EndOfTrackColor>
420
421=== modified file 'mixxx/res/skins/Shade1024x768-XGA/skin.xml'
422--- mixxx/res/skins/Shade1024x768-XGA/skin.xml 2013-03-15 14:15:30 +0000
423+++ mixxx/res/skins/Shade1024x768-XGA/skin.xml 2013-03-24 00:04:23 +0000
424@@ -3386,6 +3386,7 @@
425 <SignalLowColor></SignalLowColor>
426 <SignalColor>#191F24</SignalColor>
427 <BeatColor>#FFFFFF</BeatColor>
428+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
429 <BeatHighlightColor></BeatHighlightColor>
430 <PlayPosColor>#00FF00</PlayPosColor>
431 <EndOfTrackColor>#EA0000</EndOfTrackColor>
432@@ -4730,6 +4731,7 @@
433 <SignalLowColor></SignalLowColor>
434 <SignalColor>#191F24</SignalColor>
435 <BeatColor>#FFFFFF</BeatColor>
436+ <FirstBeatInBarColor>#bc0a0a</FirstBeatInBarColor>
437 <BeatHighlightColor></BeatHighlightColor>
438 <PlayPosColor>#00FF00</PlayPosColor>
439 <EndOfTrackColor>#EA0000</EndOfTrackColor>
440
441=== modified file 'mixxx/res/skins/ShadeDark1024x600-Netbook/skin.xml'
442--- mixxx/res/skins/ShadeDark1024x600-Netbook/skin.xml 2013-03-15 14:15:30 +0000
443+++ mixxx/res/skins/ShadeDark1024x600-Netbook/skin.xml 2013-03-24 00:04:23 +0000
444@@ -3386,6 +3386,7 @@
445 <SignalLowColor>#FF0035</SignalLowColor>
446 <SignalColor>#FF8000</SignalColor>
447 <BeatColor>#E4E4E4</BeatColor>
448+ <FirstBeatInBarColor>#fefefe</FirstBeatInBarColor>
449 <BeatHighlightColor></BeatHighlightColor>
450 <PlayPosColor>#00FF00</PlayPosColor>
451 <EndOfTrackColor>#EA0000</EndOfTrackColor>
452@@ -4730,6 +4731,7 @@
453 <SignalLowColor>#FF0035</SignalLowColor>
454 <SignalColor>#FF8000</SignalColor>
455 <BeatColor>#E4E4E4</BeatColor>
456+ <FirstBeatInBarColor>#fefefe</FirstBeatInBarColor>
457 <BeatHighlightColor></BeatHighlightColor>
458 <PlayPosColor>#00FF00</PlayPosColor>
459 <EndOfTrackColor>#EA0000</EndOfTrackColor>
460
461=== modified file 'mixxx/res/skins/ShadeDark1024x768-XGA/skin.xml'
462--- mixxx/res/skins/ShadeDark1024x768-XGA/skin.xml 2013-03-15 14:15:30 +0000
463+++ mixxx/res/skins/ShadeDark1024x768-XGA/skin.xml 2013-03-24 00:04:23 +0000
464@@ -3386,6 +3386,7 @@
465 <SignalLowColor>#FF0035</SignalLowColor>
466 <SignalColor>#FF8000</SignalColor>
467 <BeatColor>#E4E4E4</BeatColor>
468+ <FirstBeatInBarColor>#fefefe</FirstBeatInBarColor>
469 <BeatHighlightColor></BeatHighlightColor>
470 <PlayPosColor>#00FF00</PlayPosColor>
471 <EndOfTrackColor>#EA0000</EndOfTrackColor>
472@@ -4730,6 +4731,7 @@
473 <SignalLowColor>#FF0035</SignalLowColor>
474 <SignalColor>#FF8000</SignalColor>
475 <BeatColor>#E4E4E4</BeatColor>
476+ <FirstBeatInBarColor>#fefefe</FirstBeatInBarColor>
477 <BeatHighlightColor></BeatHighlightColor>
478 <PlayPosColor>#00FF00</PlayPosColor>
479 <EndOfTrackColor>#EA0000</EndOfTrackColor>
480
481=== modified file 'mixxx/src/track/beatgrid.cpp'
482--- mixxx/src/track/beatgrid.cpp 2012-11-20 00:40:18 +0000
483+++ mixxx/src/track/beatgrid.cpp 2013-03-24 00:04:23 +0000
484@@ -7,16 +7,19 @@
485 static const int kFrameSize = 2;
486
487 struct BeatGridData {
488- double bpm;
489- double firstBeat;
490+ double bpm;
491+ double firstBeat;
492+ int beatsPerBar;
493 };
494
495 class BeatGridIterator : public BeatIterator {
496 public:
497- BeatGridIterator(double dBeatLength, double dFirstBeat, double dEndSample)
498+ BeatGridIterator(double dBeatLength, double dFirstBeat, double dEndSample, double dGlobalFirstBeat, int dBeatsPerBar = 4)
499 : m_dBeatLength(dBeatLength),
500 m_dCurrentSample(dFirstBeat),
501- m_dEndSample(dEndSample) {
502+ m_dEndSample(dEndSample),
503+ m_dFirstBeat(dGlobalFirstBeat),
504+ m_dBeatsPerBar(dBeatsPerBar) {
505 }
506
507 virtual bool hasNext() const {
508@@ -29,10 +32,18 @@
509 return beat;
510 }
511
512+ virtual bool isFirstInBar() const {
513+ if(m_dCurrentSample >= m_dFirstBeat)
514+ return (((int)(((m_dCurrentSample - m_dFirstBeat) / m_dBeatLength)+.5)-1) % m_dBeatsPerBar) == 0;
515+ return false;
516+ }
517+
518 private:
519 double m_dBeatLength;
520 double m_dCurrentSample;
521 double m_dEndSample;
522+ double m_dFirstBeat;
523+ int m_dBeatsPerBar;
524 };
525
526 BeatGrid::BeatGrid(TrackInfoObject* pTrack, const QByteArray* pByteArray)
527@@ -188,7 +199,8 @@
528 if (curBeat == -1.0) {
529 return NULL;
530 }
531- return new BeatGridIterator(m_dBeatLength, curBeat, stopSample);
532+ double firstBeat = findNextBeat(0);
533+ return new BeatGridIterator(m_dBeatLength, curBeat, stopSample, firstBeat);
534 }
535
536 bool BeatGrid::hasBeatInRange(double startSample, double stopSample) const {
537
538=== modified file 'mixxx/src/track/beatmap.cpp'
539--- mixxx/src/track/beatmap.cpp 2012-05-07 05:30:14 +0000
540+++ mixxx/src/track/beatmap.cpp 2013-03-24 00:04:23 +0000
541@@ -29,9 +29,11 @@
542
543 class BeatMapIterator : public BeatIterator {
544 public:
545- BeatMapIterator(BeatList::const_iterator start, BeatList::const_iterator end)
546+ BeatMapIterator(BeatList::const_iterator start, BeatList::const_iterator end, BeatList::const_iterator first, int beatsPerBar = 4)
547 : m_currentBeat(start),
548- m_endBeat(end) {
549+ m_endBeat(end),
550+ m_firstBeat(first),
551+ m_beatsPerBar(beatsPerBar) {
552 // Advance to the first enabled beat.
553 while (m_currentBeat != m_endBeat && !m_currentBeat->enabled()) {
554 m_currentBeat++;
555@@ -51,9 +53,15 @@
556 return beat;
557 }
558
559+ virtual bool isFirstInBar() const {
560+ return (m_currentBeat - m_firstBeat) % m_beatsPerBar == 0;
561+ }
562+
563 private:
564 BeatList::const_iterator m_currentBeat;
565 BeatList::const_iterator m_endBeat;
566+ BeatList::const_iterator m_firstBeat;;
567+ int m_beatsPerBar;
568 };
569
570 BeatMap::BeatMap(TrackPointer pTrack, const QByteArray* pByteArray)
571@@ -248,7 +256,7 @@
572 if (curBeat >= lastBeat) {
573 return NULL;
574 }
575- return new BeatMapIterator(curBeat, lastBeat);
576+ return new BeatMapIterator(curBeat, lastBeat, m_beats.begin());
577 }
578
579 bool BeatMap::hasBeatInRange(double startSample, double stopSample) const {
580
581=== modified file 'mixxx/src/track/beats.h'
582--- mixxx/src/track/beats.h 2013-01-19 12:15:22 +0000
583+++ mixxx/src/track/beats.h 2013-03-24 00:04:23 +0000
584@@ -14,6 +14,7 @@
585 virtual ~BeatIterator() {}
586 virtual bool hasNext() const = 0;
587 virtual double next() = 0;
588+ virtual bool isFirstInBar() const = 0;
589 };
590
591 // Beats is a pure abstract base class for BPM and beat management classes. It
592
593=== modified file 'mixxx/src/waveform/renderers/waveformrenderbeat.cpp'
594--- mixxx/src/waveform/renderers/waveformrenderbeat.cpp 2012-12-10 02:44:06 +0000
595+++ mixxx/src/waveform/renderers/waveformrenderbeat.cpp 2013-03-24 00:04:23 +0000
596@@ -39,6 +39,14 @@
597 }
598 m_highBeatColor = WSkinColor::getCorrectColor(m_highBeatColor);
599
600+ m_firstBeatInBarColor = Qt::red;
601+ QString firstInBar = WWidget::selectNodeQString(node, "FirstBeatInBarColor");
602+ if (firstInBar != "") {
603+ m_firstBeatInBarColor.setNamedColor(firstInBar);
604+ }
605+ m_firstBeatInBarColor = WSkinColor::getCorrectColor(m_firstBeatInBarColor);
606+
607+
608 if (m_beatColor.alphaF() > 0.99)
609 m_beatColor.setAlphaF(0.8);
610
611@@ -55,6 +63,7 @@
612 BeatsPointer trackBeats = trackInfo->getBeats();
613 if (!trackBeats)
614 return;
615+ double firstBeatOfTrack = trackBeats->findNextBeat(0);
616
617 const int trackSamples = m_waveformRenderer->getTrackSamples();
618 if (trackSamples <= 0) {
619@@ -83,19 +92,25 @@
620 beatPen.setWidth(1.5);
621 QPen highBeatPen(m_highBeatColor);
622 highBeatPen.setWidth(1.5);
623+ QPen firstBeatInBarPen(m_firstBeatInBarColor);
624+ firstBeatInBarPen.setWidth(2.5);
625
626 while (it->hasNext()) {
627 int beatPosition = it->next();
628 m_waveformRenderer->regulateVisualSample(beatPosition);
629 double xBeatPoint = m_waveformRenderer->transformSampleIndexInRendererWorld(beatPosition);
630
631+ if (it->isFirstInBar()) {
632+ painter->setPen(firstBeatInBarPen);
633+ }
634 //NOTE: (vRince) RJ should we keep this ?
635- if (m_beatActive && m_beatActive->get() > 0.0 &&
636- abs(xBeatPoint - m_waveformRenderer->getWidth()/2) < 20)
637+ else if (m_beatActive && m_beatActive->get() > 0.0 &&
638+ abs(xBeatPoint - m_waveformRenderer->getWidth()/2) < 20) {
639 painter->setPen(highBeatPen);
640- else
641+ } else {
642 painter->setPen(beatPen);
643-
644+ }
645+
646 painter->drawLine(QPointF(xBeatPoint, 0.f),
647 QPointF(xBeatPoint,
648 (float)m_waveformRenderer->getHeight()));
649
650=== modified file 'mixxx/src/waveform/renderers/waveformrenderbeat.h'
651--- mixxx/src/waveform/renderers/waveformrenderbeat.h 2012-09-19 21:04:53 +0000
652+++ mixxx/src/waveform/renderers/waveformrenderbeat.h 2013-03-24 00:04:23 +0000
653@@ -20,6 +20,7 @@
654 private:
655 QColor m_beatColor;
656 QColor m_highBeatColor;
657+ QColor m_firstBeatInBarColor;
658 ControlObjectThreadMain* m_beatActive;
659
660 DISALLOW_COPY_AND_ASSIGN(WaveformRenderBeat);