Merge lp:~ywwg/mixxx/features_xwax2 into lp:~mixxxdevelopers/mixxx/trunk
- features_xwax2
- Merge into trunk
Status: | Superseded | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~ywwg/mixxx/features_xwax2 | ||||||||||||||||||||
Merge into: | lp:~mixxxdevelopers/mixxx/trunk | ||||||||||||||||||||
Diff against target: |
1496 lines (+492/-161) (has conflicts) 28 files modified
mixxx/lib/xwax/timecoder.c (+1/-1) mixxx/lib/xwax/timecoder_win32.cpp (+1/-1) mixxx/src/dlgprefnovinyldlg.ui (+67/-0) mixxx/src/dlgprefvinyl.cpp (+3/-0) mixxx/src/dlgprefvinyldlg.ui (+7/-0) mixxx/src/engine/enginebuffer.cpp (+3/-0) mixxx/src/engine/enginebufferscalelinear.cpp (+0/-10) mixxx/src/engine/enginedeck.cpp (+1/-2) mixxx/src/engine/enginevinylsoundemu.cpp (+29/-25) mixxx/src/engine/enginevinylsoundemu.h (+1/-1) mixxx/src/engine/vinylcontrolcontrol.cpp (+6/-0) mixxx/src/engine/vinylcontrolcontrol.h (+2/-0) mixxx/src/mixxx.cpp (+9/-35) mixxx/src/skin/legacyskinparser.cpp (+4/-2) mixxx/src/skin/legacyskinparser.h (+3/-1) mixxx/src/skin/skinloader.cpp (+4/-2) mixxx/src/skin/skinloader.h (+2/-1) mixxx/src/soundmanager.cpp (+1/-0) mixxx/src/vinylcontrol/vinylcontrol.cpp (+15/-2) mixxx/src/vinylcontrol/vinylcontrol.h (+6/-1) mixxx/src/vinylcontrol/vinylcontrolmanager.cpp (+2/-6) mixxx/src/vinylcontrol/vinylcontrolsignalwidget.cpp (+1/-1) mixxx/src/vinylcontrol/vinylcontrolxwax.cpp (+103/-57) mixxx/src/vinylcontrol/vinylcontrolxwax.h (+1/-0) mixxx/src/waveform/waveformrenderer.cpp (+24/-1) mixxx/src/waveform/waveformrenderer.h (+2/-1) mixxx/src/widget/wspinny.cpp (+169/-10) mixxx/src/widget/wspinny.h (+25/-1) Text conflict in mixxx/src/dlgprefnovinyldlg.ui |
||||||||||||||||||||
To merge this branch: | bzr merge lp:~ywwg/mixxx/features_xwax2 | ||||||||||||||||||||
Related bugs: |
|
||||||||||||||||||||
Related blueprints: |
Vinyl Control Improvements
(Essential)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
RJ Skerry-Ryan | Pending | ||
Review via email: mp+69904@code.launchpad.net |
Commit message
Description of the change
I've continued working in features_xwax2 to make some fixes and updates to the vinyl control code. It would be nice if some of these fixes could go into trunk, other new features can probably wait if it breaks freeze too badly.
New Features:
* Show signal quality inside WSpinny
* More pleasant waveform stretching
Fixes:
* fix vinylsoundemu and take equivalent code out of EBSL
* when loading a track, update track duration with correct value
* keep vinyl control enabled when changing vinyl control preferences
* Absolute mode fixes (better for scratching)
William Good (bkgood) wrote : | # |
Owen Williams (ywwg) wrote : | # |
Right, 1.10. I've resubmitted the proposal with my intended target
RJ Skerry-Ryan (rryan) wrote : | # |
Have the two branches diverged yet? Anyway i'll take a look. thanks owen!
On Sun, Jul 31, 2011 at 8:15 AM, Owen Williams <email address hidden> wrote:
> Right, 1.10. I've resubmitted the proposal with my intended target
> --
> https:/
> You are requested to review the proposed merge of
> lp:~ywwg/mixxx/features_xwax2 into lp:mixxx.
>
- 2664. By Owen Williams
-
Merge from lp:mixxx
- 2665. By Owen Williams
-
Calculate fabs value once, not three times
- 2666. By Owen Williams
-
Replace explicit number with #defined value
- 2667. By Owen Williams
-
Optimizing vinyl sound emu:
* precompute random values for dithering
* don't repeatedly calculate absolute value - 2668. By Owen Williams
-
Also randomize position in noise buffer so right and left aren't aligned
- 2669. By Owen Williams
-
Always record pitch for steadypitch, not just when we have position
- 2670. By Owen Williams
-
Retweak pitch smoothing tweak. Make sure spurious values aren't in the ringbuffer
- 2671. By Owen Williams
-
Don't use static variables
- 2672. By Owen Williams
-
Merge from lp:mixxx
- 2673. By Owen Williams
-
include genre in search results
- 2674. By Owen Williams
-
merge from lp:mixxx
- 2675. By Owen Williams
-
Abstractify vinyl proxies more
- 2676. By Owen Williams
-
Don't change metadata-reported duration
- 2677. By Owen Williams
-
merge from lp:mixxx
- 2678. By Owen Williams
-
Merge with lp:mixxx
- 2679. By Owen Williams
-
merge from lp:mixxx
- 2680. By Owen Williams
-
merged into trunk
- 2681. By Owen Williams
-
merge from lp:mixxx
- 2682. By Owen Williams
-
If rate is exactly 1.0, don't scale audio at all
- 2683. By Owen Williams
-
Since my wave writer code is so useful, make it something I can #define to enable
- 2684. By Owen Williams
-
Create vinylcontrol_
scratching CO that is 1 when pitch is changing rapidly and 0 when not.
Use new vinylcontrol_scatching CO to trigger swap between keylock and linear scaling in engine. - 2685. By Owen Williams
-
Vinyl Control bugfixes:
* fix steady pitch detector to work in reverse and better detect loops
* try not to enter track selection mode when scratching - 2686. By Owen Williams
-
typo
Unmerged revisions
Preview Diff
1 | === modified file 'mixxx/lib/xwax/timecoder.c' | |||
2 | --- mixxx/lib/xwax/timecoder.c 2011-05-25 19:52:14 +0000 | |||
3 | +++ mixxx/lib/xwax/timecoder.c 2011-07-30 20:21:03 +0000 | |||
4 | @@ -519,7 +519,7 @@ | |||
5 | 519 | 519 | ||
6 | 520 | if (r >= 0) { | 520 | if (r >= 0) { |
7 | 521 | //normalize position to milliseconds, not timecode steps -- Owen | 521 | //normalize position to milliseconds, not timecode steps -- Owen |
9 | 522 | r = r * 1000 / (tc->def->resolution * tc->speed); | 522 | r = (float)r * (1000.0 / (tc->def->resolution * tc->speed)); |
10 | 523 | if (when) | 523 | if (when) |
11 | 524 | *when = tc->timecode_ticker * tc->dt; | 524 | *when = tc->timecode_ticker * tc->dt; |
12 | 525 | return r; | 525 | return r; |
13 | 526 | 526 | ||
14 | === modified file 'mixxx/lib/xwax/timecoder_win32.cpp' | |||
15 | --- mixxx/lib/xwax/timecoder_win32.cpp 2011-05-25 19:52:14 +0000 | |||
16 | +++ mixxx/lib/xwax/timecoder_win32.cpp 2011-07-30 20:21:03 +0000 | |||
17 | @@ -521,7 +521,7 @@ | |||
18 | 521 | 521 | ||
19 | 522 | if (r >= 0) { | 522 | if (r >= 0) { |
20 | 523 | //normalize position to milliseconds, not timecode steps -- Owen | 523 | //normalize position to milliseconds, not timecode steps -- Owen |
22 | 524 | r = r * 1000 / (tc->def->resolution * tc->speed); | 524 | r = (float)r * (1000.0 / (tc->def->resolution * tc->speed)); |
23 | 525 | if (when) | 525 | if (when) |
24 | 526 | *when = tc->timecode_ticker * tc->dt; | 526 | *when = tc->timecode_ticker * tc->dt; |
25 | 527 | return r; | 527 | return r; |
26 | 528 | 528 | ||
27 | === modified file 'mixxx/src/dlgprefnovinyldlg.ui' | |||
28 | --- mixxx/src/dlgprefnovinyldlg.ui 2011-05-26 10:22:03 +0000 | |||
29 | +++ mixxx/src/dlgprefnovinyldlg.ui 2011-07-30 20:21:03 +0000 | |||
30 | @@ -9,8 +9,13 @@ | |||
31 | 9 | <rect> | 9 | <rect> |
32 | 10 | <x>0</x> | 10 | <x>0</x> |
33 | 11 | <y>0</y> | 11 | <y>0</y> |
34 | 12 | <<<<<<< TREE | ||
35 | 12 | <width>461</width> | 13 | <width>461</width> |
36 | 13 | <height>527</height> | 14 | <height>527</height> |
37 | 15 | ======= | ||
38 | 16 | <width>504</width> | ||
39 | 17 | <height>501</height> | ||
40 | 18 | >>>>>>> MERGE-SOURCE | ||
41 | 14 | </rect> | 19 | </rect> |
42 | 15 | </property> | 20 | </property> |
43 | 16 | <property name="windowTitle"> | 21 | <property name="windowTitle"> |
44 | @@ -317,6 +322,13 @@ | |||
45 | 317 | </property> | 322 | </property> |
46 | 318 | </spacer> | 323 | </spacer> |
47 | 319 | </item> | 324 | </item> |
48 | 325 | <item row="3" column="0" colspan="3"> | ||
49 | 326 | <widget class="QCheckBox" name="SignalQualityEnable"> | ||
50 | 327 | <property name="text"> | ||
51 | 328 | <string>Show Signal Quality in Skin</string> | ||
52 | 329 | </property> | ||
53 | 330 | </widget> | ||
54 | 331 | </item> | ||
55 | 320 | </layout> | 332 | </layout> |
56 | 321 | </widget> | 333 | </widget> |
57 | 322 | </item> | 334 | </item> |
58 | @@ -406,9 +418,26 @@ | |||
59 | 406 | </property> | 418 | </property> |
60 | 407 | </spacer> | 419 | </spacer> |
61 | 408 | </item> | 420 | </item> |
62 | 421 | <item row="1" column="0"> | ||
63 | 422 | <widget class="QLabel" name="label"> | ||
64 | 423 | <property name="enabled"> | ||
65 | 424 | <bool>false</bool> | ||
66 | 425 | </property> | ||
67 | 426 | <property name="toolTip"> | ||
68 | 427 | <string>http://www.xwax.co.uk</string> | ||
69 | 428 | </property> | ||
70 | 429 | <property name="text"> | ||
71 | 430 | <string>Powered by xwax</string> | ||
72 | 431 | </property> | ||
73 | 432 | <property name="alignment"> | ||
74 | 433 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
75 | 434 | </property> | ||
76 | 435 | </widget> | ||
77 | 436 | </item> | ||
78 | 409 | </layout> | 437 | </layout> |
79 | 410 | </widget> | 438 | </widget> |
80 | 411 | </item> | 439 | </item> |
81 | 440 | <<<<<<< TREE | ||
82 | 412 | <item row="6" column="0" colspan="2"> | 441 | <item row="6" column="0" colspan="2"> |
83 | 413 | <widget class="QLabel" name="label_3"> | 442 | <widget class="QLabel" name="label_3"> |
84 | 414 | <property name="text"> | 443 | <property name="text"> |
85 | @@ -458,6 +487,9 @@ | |||
86 | 458 | </widget> | 487 | </widget> |
87 | 459 | </item> | 488 | </item> |
88 | 460 | <item row="6" column="2" rowspan="2"> | 489 | <item row="6" column="2" rowspan="2"> |
89 | 490 | ======= | ||
90 | 491 | <item row="6" column="2"> | ||
91 | 492 | >>>>>>> MERGE-SOURCE | ||
92 | 461 | <spacer name="verticalSpacer"> | 493 | <spacer name="verticalSpacer"> |
93 | 462 | <property name="orientation"> | 494 | <property name="orientation"> |
94 | 463 | <enum>Qt::Vertical</enum> | 495 | <enum>Qt::Vertical</enum> |
95 | @@ -470,6 +502,41 @@ | |||
96 | 470 | </property> | 502 | </property> |
97 | 471 | </spacer> | 503 | </spacer> |
98 | 472 | </item> | 504 | </item> |
99 | 505 | <<<<<<< TREE | ||
100 | 506 | ======= | ||
101 | 507 | <item row="5" column="2"> | ||
102 | 508 | <widget class="QPushButton" name="applyButton"> | ||
103 | 509 | <property name="enabled"> | ||
104 | 510 | <bool>false</bool> | ||
105 | 511 | </property> | ||
106 | 512 | <property name="sizePolicy"> | ||
107 | 513 | <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> | ||
108 | 514 | <horstretch>0</horstretch> | ||
109 | 515 | <verstretch>0</verstretch> | ||
110 | 516 | </sizepolicy> | ||
111 | 517 | </property> | ||
112 | 518 | <property name="sizeHint" stdset="0"> | ||
113 | 519 | <size> | ||
114 | 520 | <width>85</width> | ||
115 | 521 | <height>27</height> | ||
116 | 522 | </size> | ||
117 | 523 | </property> | ||
118 | 524 | <property name="text"> | ||
119 | 525 | <string>Apply</string> | ||
120 | 526 | </property> | ||
121 | 527 | </widget> | ||
122 | 528 | </item> | ||
123 | 529 | <item row="5" column="0" colspan="2"> | ||
124 | 530 | <widget class="QLabel" name="label_3"> | ||
125 | 531 | <property name="text"> | ||
126 | 532 | <string><b>This version of Mixxx does not support vinyl control.</b> <br> Please visit <a href="http://mixxx.org">Mixxx.org</a> for more information.</string> | ||
127 | 533 | </property> | ||
128 | 534 | <property name="wordWrap"> | ||
129 | 535 | <bool>true</bool> | ||
130 | 536 | </property> | ||
131 | 537 | </widget> | ||
132 | 538 | </item> | ||
133 | 539 | >>>>>>> MERGE-SOURCE | ||
134 | 473 | </layout> | 540 | </layout> |
135 | 474 | </widget> | 541 | </widget> |
136 | 475 | <layoutdefault spacing="6" margin="11"/> | 542 | <layoutdefault spacing="6" margin="11"/> |
137 | 476 | 543 | ||
138 | === modified file 'mixxx/src/dlgprefvinyl.cpp' | |||
139 | --- mixxx/src/dlgprefvinyl.cpp 2011-05-11 04:38:17 +0000 | |||
140 | +++ mixxx/src/dlgprefvinyl.cpp 2011-07-30 20:21:03 +0000 | |||
141 | @@ -137,6 +137,8 @@ | |||
142 | 137 | 137 | ||
143 | 138 | // Honour the Needle Skip Prevention setting. | 138 | // Honour the Needle Skip Prevention setting. |
144 | 139 | NeedleSkipEnable->setChecked( (bool)config->getValueString( ConfigKey("[VinylControl]", "needle_skip_prevention") ).toInt() ); | 139 | NeedleSkipEnable->setChecked( (bool)config->getValueString( ConfigKey("[VinylControl]", "needle_skip_prevention") ).toInt() ); |
145 | 140 | |||
146 | 141 | SignalQualityEnable->setChecked((bool)config->getValueString(ConfigKey("[VinylControl]", "show_signal_quality") ).toInt() ); | ||
147 | 140 | 142 | ||
148 | 141 | //set vinyl control gain | 143 | //set vinyl control gain |
149 | 142 | VinylGain->setValue( config->getValueString(ConfigKey("[VinylControl]","gain")).toInt()); | 144 | VinylGain->setValue( config->getValueString(ConfigKey("[VinylControl]","gain")).toInt()); |
150 | @@ -182,6 +184,7 @@ | |||
151 | 182 | m_COMode.slotSet(iMode); | 184 | m_COMode.slotSet(iMode); |
152 | 183 | config->set(ConfigKey("[VinylControl]","mode"), ConfigValue(iMode)); | 185 | config->set(ConfigKey("[VinylControl]","mode"), ConfigValue(iMode)); |
153 | 184 | config->set(ConfigKey("[VinylControl]","needle_skip_prevention" ), ConfigValue( (int)(NeedleSkipEnable->isChecked( )) ) ); | 186 | config->set(ConfigKey("[VinylControl]","needle_skip_prevention" ), ConfigValue( (int)(NeedleSkipEnable->isChecked( )) ) ); |
154 | 187 | config->set(ConfigKey("[VinylControl]","show_signal_quality" ), ConfigValue( (int)(SignalQualityEnable->isChecked( )) ) ); | ||
155 | 185 | 188 | ||
156 | 186 | m_pVCManager->reloadConfig(); | 189 | m_pVCManager->reloadConfig(); |
157 | 187 | slotUpdate(); | 190 | slotUpdate(); |
158 | 188 | 191 | ||
159 | === modified file 'mixxx/src/dlgprefvinyldlg.ui' | |||
160 | --- mixxx/src/dlgprefvinyldlg.ui 2011-05-26 10:22:03 +0000 | |||
161 | +++ mixxx/src/dlgprefvinyldlg.ui 2011-07-30 20:21:03 +0000 | |||
162 | @@ -308,6 +308,13 @@ | |||
163 | 308 | </property> | 308 | </property> |
164 | 309 | </spacer> | 309 | </spacer> |
165 | 310 | </item> | 310 | </item> |
166 | 311 | <item row="3" column="0" colspan="3"> | ||
167 | 312 | <widget class="QCheckBox" name="SignalQualityEnable"> | ||
168 | 313 | <property name="text"> | ||
169 | 314 | <string>Show Signal Quality in Skin</string> | ||
170 | 315 | </property> | ||
171 | 316 | </widget> | ||
172 | 317 | </item> | ||
173 | 311 | </layout> | 318 | </layout> |
174 | 312 | </widget> | 319 | </widget> |
175 | 313 | </item> | 320 | </item> |
176 | 314 | 321 | ||
177 | === modified file 'mixxx/src/engine/enginebuffer.cpp' | |||
178 | --- mixxx/src/engine/enginebuffer.cpp 2011-05-01 19:10:21 +0000 | |||
179 | +++ mixxx/src/engine/enginebuffer.cpp 2011-07-30 20:21:03 +0000 | |||
180 | @@ -336,6 +336,9 @@ | |||
181 | 336 | m_pTrackSampleRate->set(iTrackSampleRate); | 336 | m_pTrackSampleRate->set(iTrackSampleRate); |
182 | 337 | slotControlSeek(0.); | 337 | slotControlSeek(0.); |
183 | 338 | 338 | ||
184 | 339 | //fix the duration | ||
185 | 340 | pTrack->setDuration(iTrackNumSamples / (2 * iTrackSampleRate)); | ||
186 | 341 | |||
187 | 339 | 342 | ||
188 | 340 | // Let the engine know that a track is loaded now. | 343 | // Let the engine know that a track is loaded now. |
189 | 341 | m_pTrackEndCOT->slotSet(0.0f); //XXX: Not sure if to use the COT or CO here | 344 | m_pTrackEndCOT->slotSet(0.0f); //XXX: Not sure if to use the COT or CO here |
190 | 342 | 345 | ||
191 | === modified file 'mixxx/src/engine/enginebufferscalelinear.cpp' | |||
192 | --- mixxx/src/engine/enginebufferscalelinear.cpp 2011-04-16 20:51:48 +0000 | |||
193 | +++ mixxx/src/engine/enginebufferscalelinear.cpp 2011-07-30 20:21:03 +0000 | |||
194 | @@ -326,16 +326,6 @@ | |||
195 | 326 | //at extremely low speeds, dampen the gain to hide pops and clicks | 326 | //at extremely low speeds, dampen the gain to hide pops and clicks |
196 | 327 | //this does cause odd-looking linear waveforms that go to zero and back | 327 | //this does cause odd-looking linear waveforms that go to zero and back |
197 | 328 | 328 | ||
198 | 329 | //although enginevinylsoundemu does this, it works much better here | ||
199 | 330 | //because the gain ramps as the rate does | ||
200 | 331 | if (fabs(rate_add) < 0.5) { | ||
201 | 332 | float dither = (float)(rand() % 32768) / 32768 - 0.5; // dither | ||
202 | 333 | //float dither = 0; | ||
203 | 334 | float gainfrac = fabs(rate_add) / 0.5; | ||
204 | 335 | buf[i] = gainfrac * (float)buf[i] + dither; | ||
205 | 336 | buf[i+1] = gainfrac * (float)buf[i+1] + dither; | ||
206 | 337 | } | ||
207 | 338 | |||
208 | 339 | /*writer << QString("%1,%2,%3,%4\n").arg(buffer_count) | 329 | /*writer << QString("%1,%2,%3,%4\n").arg(buffer_count) |
209 | 340 | .arg(buffer[i]) | 330 | .arg(buffer[i]) |
210 | 341 | .arg(prev_sample[0]) | 331 | .arg(prev_sample[0]) |
211 | 342 | 332 | ||
212 | === modified file 'mixxx/src/engine/enginedeck.cpp' | |||
213 | --- mixxx/src/engine/enginedeck.cpp 2011-04-15 22:19:45 +0000 | |||
214 | +++ mixxx/src/engine/enginedeck.cpp 2011-07-30 20:21:03 +0000 | |||
215 | @@ -54,8 +54,7 @@ | |||
216 | 54 | // Process the raw audio | 54 | // Process the raw audio |
217 | 55 | m_pBuffer->process(0, pOut, iBufferSize); | 55 | m_pBuffer->process(0, pOut, iBufferSize); |
218 | 56 | // Emulate vinyl sounds | 56 | // Emulate vinyl sounds |
221 | 57 | // This causes popping, disable -Owen | 57 | m_pVinylSoundEmu->process(pOut, pOut, iBufferSize); |
220 | 58 | //m_pVinylSoundEmu->process(pOut, pOut, iBufferSize); | ||
222 | 59 | // Apply pregain | 58 | // Apply pregain |
223 | 60 | m_pPregain->process(pOut, pOut, iBufferSize); | 59 | m_pPregain->process(pOut, pOut, iBufferSize); |
224 | 61 | // Filter the channel with EQs | 60 | // Filter the channel with EQs |
225 | 62 | 61 | ||
226 | === modified file 'mixxx/src/engine/enginevinylsoundemu.cpp' | |||
227 | --- mixxx/src/engine/enginevinylsoundemu.cpp 2010-09-17 04:15:33 +0000 | |||
228 | +++ mixxx/src/engine/enginevinylsoundemu.cpp 2011-07-30 20:21:03 +0000 | |||
229 | @@ -23,7 +23,7 @@ | |||
230 | 23 | 23 | ||
231 | 24 | /** This class emulates the response of a vinyl record's audio to changes | 24 | /** This class emulates the response of a vinyl record's audio to changes |
232 | 25 | * in speed. In practice, it quiets the audio during very slow playback. | 25 | * in speed. In practice, it quiets the audio during very slow playback. |
234 | 26 | * This also helps mask the aliasing due to interpolation that occurs at | 26 | * Dithering also helps mask the aliasing due to interpolation that occurs at |
235 | 27 | * these slow speeds. | 27 | * these slow speeds. |
236 | 28 | */ | 28 | */ |
237 | 29 | 29 | ||
238 | @@ -31,7 +31,7 @@ | |||
239 | 31 | { | 31 | { |
240 | 32 | m_pConfig = pConfig; | 32 | m_pConfig = pConfig; |
241 | 33 | m_pRateEngine = ControlObject::getControl(ConfigKey(group, "rateEngine")); | 33 | m_pRateEngine = ControlObject::getControl(ConfigKey(group, "rateEngine")); |
243 | 34 | m_fAbsSpeed = 0.0f; | 34 | m_fSpeed = m_fOldSpeed = 0.0f; |
244 | 35 | m_fGainFactor = 1.0f; | 35 | m_fGainFactor = 1.0f; |
245 | 36 | } | 36 | } |
246 | 37 | 37 | ||
247 | @@ -43,30 +43,34 @@ | |||
248 | 43 | void EngineVinylSoundEmu::process(const CSAMPLE * pIn, const CSAMPLE * pOut, const int iBufferSize) | 43 | void EngineVinylSoundEmu::process(const CSAMPLE * pIn, const CSAMPLE * pOut, const int iBufferSize) |
249 | 44 | { | 44 | { |
250 | 45 | CSAMPLE * pOutput = (CSAMPLE *)pOut; | 45 | CSAMPLE * pOutput = (CSAMPLE *)pOut; |
253 | 46 | m_fAbsSpeed = fabs((float)m_pRateEngine->get()); | 46 | m_fSpeed = (float)m_pRateEngine->get(); |
254 | 47 | //qDebug() << m_pRateEngine->get(); | 47 | float rateFrac = 2 * (m_fSpeed - m_fOldSpeed) / (float)iBufferSize; |
255 | 48 | float curRate = m_fOldSpeed; | ||
256 | 48 | 49 | ||
257 | 49 | const float thresholdSpeed = 0.070f; //Scale volume if playback speed is below 7%. | 50 | const float thresholdSpeed = 0.070f; //Scale volume if playback speed is below 7%. |
279 | 50 | if (m_fAbsSpeed < thresholdSpeed && m_fAbsSpeed > 0.0f) //Change the volume based on the playback speed. | 51 | const float ditherSpeed = 0.85f; //Dither if playback speed is below 85%. |
280 | 51 | { | 52 | |
281 | 52 | //The numbers in this formula are important: | 53 | //iterate over old rate to new rate to prevent audible pops |
282 | 53 | // - The "1 + ..." makes the minimum value of the parameter of log10 | 54 | for (int i=0; i<iBufferSize; i+=2) |
283 | 54 | // be 1, which makes the gain 0. | 55 | { |
284 | 55 | // - The "* 9" makes the maximum value of the log10 become 10 (9 + 1 = 10) | 56 | float dither = 0; |
285 | 56 | // which gives a gain of 1 | 57 | if (fabs(curRate) < ditherSpeed) { |
286 | 57 | //m_fGainFactor = log10(1 + m_fAbsSpeed/0.50f * 9); | 58 | dither = (float)(rand() % 32768) / 32768 - 0.5; |
287 | 58 | m_fGainFactor = m_fAbsSpeed/thresholdSpeed; | 59 | } |
288 | 59 | //qDebug() << m_fGainFactor << m_fAbsSpeed; | 60 | |
289 | 60 | } | 61 | if (fabs(curRate) < thresholdSpeed) { |
290 | 61 | else if (m_fAbsSpeed == 0.0f) | 62 | float gainfrac = fabs(curRate) / thresholdSpeed; |
291 | 62 | m_fGainFactor = 0.0f; //Log blows up at 0 :) | 63 | pOutput[i] = gainfrac * (float)pIn[i] + dither; |
292 | 63 | else | 64 | pOutput[i+1] = gainfrac * (float)pIn[i+1] + dither; |
293 | 64 | { | 65 | } |
294 | 65 | m_fGainFactor = 1.0f; | 66 | else |
295 | 66 | } | 67 | { |
296 | 67 | 68 | pOutput[i] = pIn[i] + dither; | |
297 | 68 | // Apply whatever gain we calculated. SampleUtil takes care of aliased | 69 | pOutput[i+1] = pIn[i+1] + dither; |
298 | 69 | // buffers and gains of 1 or 0. | 70 | } |
299 | 70 | SampleUtil::copyWithGain(pOutput, pIn, m_fGainFactor, iBufferSize); | 71 | |
300 | 72 | curRate += rateFrac; | ||
301 | 73 | } | ||
302 | 74 | m_fOldSpeed = m_fSpeed; | ||
303 | 71 | } | 75 | } |
304 | 72 | 76 | ||
305 | 73 | 77 | ||
306 | === modified file 'mixxx/src/engine/enginevinylsoundemu.h' | |||
307 | --- mixxx/src/engine/enginevinylsoundemu.h 2009-01-24 04:39:32 +0000 | |||
308 | +++ mixxx/src/engine/enginevinylsoundemu.h 2011-07-30 20:21:03 +0000 | |||
309 | @@ -28,7 +28,7 @@ | |||
310 | 28 | private: | 28 | private: |
311 | 29 | ConfigObject<ConfigValue> *m_pConfig; | 29 | ConfigObject<ConfigValue> *m_pConfig; |
312 | 30 | ControlObject *m_pRateEngine; | 30 | ControlObject *m_pRateEngine; |
314 | 31 | float m_fAbsSpeed; | 31 | float m_fSpeed, m_fOldSpeed; |
315 | 32 | float m_fGainFactor; | 32 | float m_fGainFactor; |
316 | 33 | }; | 33 | }; |
317 | 34 | 34 | ||
318 | 35 | 35 | ||
319 | === modified file 'mixxx/src/engine/vinylcontrolcontrol.cpp' | |||
320 | --- mixxx/src/engine/vinylcontrolcontrol.cpp 2011-05-11 04:38:17 +0000 | |||
321 | +++ mixxx/src/engine/vinylcontrolcontrol.cpp 2011-07-30 20:21:03 +0000 | |||
322 | @@ -27,12 +27,18 @@ | |||
323 | 27 | m_pControlVinylEnabled = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_enabled")); | 27 | m_pControlVinylEnabled = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_enabled")); |
324 | 28 | m_pControlVinylEnabled->set(0); | 28 | m_pControlVinylEnabled->set(0); |
325 | 29 | m_pControlVinylEnabled->setToggleButton(true); | 29 | m_pControlVinylEnabled->setToggleButton(true); |
326 | 30 | m_pControlVinylWantEnabled = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_wantenabled")); | ||
327 | 31 | m_pControlVinylWantEnabled->set(0); | ||
328 | 32 | m_pControlVinylWantEnabled->setToggleButton(true); | ||
329 | 30 | m_pControlVinylMode = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_mode")); | 33 | m_pControlVinylMode = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_mode")); |
330 | 31 | m_pControlVinylMode->setStates(3); | 34 | m_pControlVinylMode->setStates(3); |
331 | 32 | m_pControlVinylMode->setToggleButton(true); | 35 | m_pControlVinylMode->setToggleButton(true); |
332 | 33 | m_pControlVinylCueing = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_cueing")); | 36 | m_pControlVinylCueing = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_cueing")); |
333 | 34 | m_pControlVinylCueing->setStates(3); | 37 | m_pControlVinylCueing->setStates(3); |
334 | 35 | m_pControlVinylCueing->setToggleButton(true); | 38 | m_pControlVinylCueing->setToggleButton(true); |
335 | 39 | m_pControlVinylSignalEnabled = new ControlPushButton(ConfigKey(pGroup, "vinylcontrol_signal_enabled")); | ||
336 | 40 | m_pControlVinylSignalEnabled->set(1); | ||
337 | 41 | m_pControlVinylSignalEnabled->setToggleButton(true); | ||
338 | 36 | } | 42 | } |
339 | 37 | 43 | ||
340 | 38 | VinylControlControl::~VinylControlControl() { | 44 | VinylControlControl::~VinylControlControl() { |
341 | 39 | 45 | ||
342 | === modified file 'mixxx/src/engine/vinylcontrolcontrol.h' | |||
343 | --- mixxx/src/engine/vinylcontrolcontrol.h 2011-05-11 04:38:17 +0000 | |||
344 | +++ mixxx/src/engine/vinylcontrolcontrol.h 2011-07-30 20:21:03 +0000 | |||
345 | @@ -25,7 +25,9 @@ | |||
346 | 25 | ControlObject* m_pControlVinylStatus; | 25 | ControlObject* m_pControlVinylStatus; |
347 | 26 | ControlPushButton* m_pControlVinylMode; | 26 | ControlPushButton* m_pControlVinylMode; |
348 | 27 | ControlPushButton* m_pControlVinylEnabled; | 27 | ControlPushButton* m_pControlVinylEnabled; |
349 | 28 | ControlPushButton* m_pControlVinylWantEnabled; | ||
350 | 28 | ControlPushButton* m_pControlVinylCueing; | 29 | ControlPushButton* m_pControlVinylCueing; |
351 | 30 | ControlPushButton* m_pControlVinylSignalEnabled; | ||
352 | 29 | TrackPointer m_pCurrentTrack; | 31 | TrackPointer m_pCurrentTrack; |
353 | 30 | }; | 32 | }; |
354 | 31 | 33 | ||
355 | 32 | 34 | ||
356 | === modified file 'mixxx/src/mixxx.cpp' | |||
357 | --- mixxx/src/mixxx.cpp 2011-05-06 09:45:12 +0000 | |||
358 | +++ mixxx/src/mixxx.cpp 2011-07-30 20:21:03 +0000 | |||
359 | @@ -481,7 +481,8 @@ | |||
360 | 481 | if (!(m_pWidgetParent = m_pSkinLoader->loadDefaultSkin(m_pView, | 481 | if (!(m_pWidgetParent = m_pSkinLoader->loadDefaultSkin(m_pView, |
361 | 482 | m_pKeyboard, | 482 | m_pKeyboard, |
362 | 483 | m_pPlayerManager, | 483 | m_pPlayerManager, |
364 | 484 | m_pLibrary))) { | 484 | m_pLibrary, |
365 | 485 | m_pVCManager))) { | ||
366 | 485 | qDebug() << "Could not load default skin."; | 486 | qDebug() << "Could not load default skin."; |
367 | 486 | } | 487 | } |
368 | 487 | 488 | ||
369 | @@ -875,9 +876,6 @@ | |||
370 | 875 | // Either check or uncheck the vinyl control menu item depending on what | 876 | // Either check or uncheck the vinyl control menu item depending on what |
371 | 876 | // it was saved as. | 877 | // it was saved as. |
372 | 877 | m_pOptionsVinylControl->setCheckable(true); | 878 | m_pOptionsVinylControl->setCheckable(true); |
373 | 878 | //make sure control is off on startup (this is redundant to vinylcontrolmanager.cpp) | ||
374 | 879 | m_pConfig->set( | ||
375 | 880 | ConfigKey("[VinylControl]", "enabled_ch1"), false); | ||
376 | 881 | m_pOptionsVinylControl->setChecked(false); | 879 | m_pOptionsVinylControl->setChecked(false); |
377 | 882 | m_pOptionsVinylControl->setStatusTip(tr("Activate Vinyl Control")); | 880 | m_pOptionsVinylControl->setStatusTip(tr("Activate Vinyl Control")); |
378 | 883 | m_pOptionsVinylControl->setWhatsThis( | 881 | m_pOptionsVinylControl->setWhatsThis( |
379 | @@ -891,8 +889,6 @@ | |||
380 | 891 | SLOT(slotControlVinylControl(double))); | 889 | SLOT(slotControlVinylControl(double))); |
381 | 892 | 890 | ||
382 | 893 | m_pOptionsVinylControl2->setCheckable(true); | 891 | m_pOptionsVinylControl2->setCheckable(true); |
383 | 894 | m_pConfig->set( | ||
384 | 895 | ConfigKey("[VinylControl]", "enabled_ch2"), false); | ||
385 | 896 | m_pOptionsVinylControl2->setChecked(false); | 892 | m_pOptionsVinylControl2->setChecked(false); |
386 | 897 | m_pOptionsVinylControl2->setStatusTip(tr("Activate Vinyl Control")); | 893 | m_pOptionsVinylControl2->setStatusTip(tr("Activate Vinyl Control")); |
387 | 898 | m_pOptionsVinylControl2->setWhatsThis( | 894 | m_pOptionsVinylControl2->setWhatsThis( |
388 | @@ -1162,15 +1158,9 @@ | |||
389 | 1162 | { | 1158 | { |
390 | 1163 | #ifdef __VINYLCONTROL__ | 1159 | #ifdef __VINYLCONTROL__ |
391 | 1164 | if (m_pVCManager->vinylInputEnabled(1)) { | 1160 | if (m_pVCManager->vinylInputEnabled(1)) { |
392 | 1165 | m_pConfig->set( | ||
393 | 1166 | ConfigKey("[VinylControl]", "enabled_ch1"), ConfigValue((int)toggle)); | ||
394 | 1167 | m_pOptionsVinylControl->setChecked((bool)toggle); | 1161 | m_pOptionsVinylControl->setChecked((bool)toggle); |
395 | 1168 | if (toggle) { | ||
396 | 1169 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_status"))->set(VINYL_STATUS_OK); | ||
397 | 1170 | } else { | ||
398 | 1171 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_status"))->set(VINYL_STATUS_DISABLED); | ||
399 | 1172 | } | ||
400 | 1173 | } else { | 1162 | } else { |
401 | 1163 | m_pOptionsVinylControl->setChecked(false); | ||
402 | 1174 | if (toggle) { | 1164 | if (toggle) { |
403 | 1175 | QMessageBox::warning(this, tr("Mixxx"), | 1165 | QMessageBox::warning(this, tr("Mixxx"), |
404 | 1176 | tr("No input device(s) select.\nPlease select your soundcard(s) " | 1166 | tr("No input device(s) select.\nPlease select your soundcard(s) " |
405 | @@ -1179,8 +1169,6 @@ | |||
406 | 1179 | QMessageBox::Ok); | 1169 | QMessageBox::Ok); |
407 | 1180 | m_pPrefDlg->show(); | 1170 | m_pPrefDlg->show(); |
408 | 1181 | m_pPrefDlg->showSoundHardwarePage(); | 1171 | m_pPrefDlg->showSoundHardwarePage(); |
409 | 1182 | m_pOptionsVinylControl->setChecked(false); | ||
410 | 1183 | m_pConfig->set(ConfigKey("[VinylControl]","enabled_ch1"), ConfigValue(0)); | ||
411 | 1184 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_status"))->set(VINYL_STATUS_DISABLED); | 1172 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_status"))->set(VINYL_STATUS_DISABLED); |
412 | 1185 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_enabled"))->set(0); | 1173 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_enabled"))->set(0); |
413 | 1186 | } | 1174 | } |
414 | @@ -1191,27 +1179,17 @@ | |||
415 | 1191 | void MixxxApp::slotCheckboxVinylControl(bool toggle) | 1179 | void MixxxApp::slotCheckboxVinylControl(bool toggle) |
416 | 1192 | { | 1180 | { |
417 | 1193 | #ifdef __VINYLCONTROL__ | 1181 | #ifdef __VINYLCONTROL__ |
422 | 1194 | bool current = (bool)m_pConfig->getValueString(ConfigKey("[VinylControl]","enabled_ch1")).toInt(); | 1182 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_enabled"))->set((double)toggle); |
419 | 1195 | if (current != toggle) { | ||
420 | 1196 | ControlObject::getControl(ConfigKey("[Channel1]", "vinylcontrol_enabled"))->set((double)toggle); | ||
421 | 1197 | } | ||
423 | 1198 | #endif | 1183 | #endif |
424 | 1199 | } | 1184 | } |
425 | 1200 | 1185 | ||
426 | 1201 | void MixxxApp::slotControlVinylControl2(double toggle) | 1186 | void MixxxApp::slotControlVinylControl2(double toggle) |
427 | 1202 | { | 1187 | { |
428 | 1203 | #ifdef __VINYLCONTROL__ | 1188 | #ifdef __VINYLCONTROL__ |
429 | 1204 | //we just need at least 1 input (deck 1) because of single deck mode | ||
430 | 1205 | if (m_pVCManager->vinylInputEnabled(2)) { | 1189 | if (m_pVCManager->vinylInputEnabled(2)) { |
439 | 1206 | m_pConfig->set( | 1190 | m_pOptionsVinylControl2->setChecked((bool)toggle); |
432 | 1207 | ConfigKey("[VinylControl]", "enabled_ch2"), ConfigValue((int)toggle)); | ||
433 | 1208 | m_pOptionsVinylControl2->setChecked((bool)toggle); | ||
434 | 1209 | if (toggle) { | ||
435 | 1210 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_status"))->set(VINYL_STATUS_OK); | ||
436 | 1211 | } else { | ||
437 | 1212 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_status"))->set(VINYL_STATUS_DISABLED); | ||
438 | 1213 | } | ||
440 | 1214 | } else { | 1191 | } else { |
441 | 1192 | m_pOptionsVinylControl2->setChecked(false); | ||
442 | 1215 | if (toggle) { | 1193 | if (toggle) { |
443 | 1216 | QMessageBox::warning(this, tr("Mixxx"), | 1194 | QMessageBox::warning(this, tr("Mixxx"), |
444 | 1217 | tr("No input device(s) select.\nPlease select your soundcard(s) " | 1195 | tr("No input device(s) select.\nPlease select your soundcard(s) " |
445 | @@ -1220,8 +1198,6 @@ | |||
446 | 1220 | QMessageBox::Ok); | 1198 | QMessageBox::Ok); |
447 | 1221 | m_pPrefDlg->show(); | 1199 | m_pPrefDlg->show(); |
448 | 1222 | m_pPrefDlg->showSoundHardwarePage(); | 1200 | m_pPrefDlg->showSoundHardwarePage(); |
449 | 1223 | m_pOptionsVinylControl2->setChecked(false); | ||
450 | 1224 | m_pConfig->set(ConfigKey("[VinylControl]","enabled_ch2"), ConfigValue(0)); | ||
451 | 1225 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_status"))->set(VINYL_STATUS_DISABLED); | 1201 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_status"))->set(VINYL_STATUS_DISABLED); |
452 | 1226 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_enabled"))->set(0); | 1202 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_enabled"))->set(0); |
453 | 1227 | } | 1203 | } |
454 | @@ -1232,10 +1208,7 @@ | |||
455 | 1232 | void MixxxApp::slotCheckboxVinylControl2(bool toggle) | 1208 | void MixxxApp::slotCheckboxVinylControl2(bool toggle) |
456 | 1233 | { | 1209 | { |
457 | 1234 | #ifdef __VINYLCONTROL__ | 1210 | #ifdef __VINYLCONTROL__ |
462 | 1235 | bool current = (bool)m_pConfig->getValueString(ConfigKey("[VinylControl]","enabled_ch2")).toInt(); | 1211 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_enabled"))->set((double)toggle); |
459 | 1236 | if (current != toggle) { | ||
460 | 1237 | ControlObject::getControl(ConfigKey("[Channel2]", "vinylcontrol_enabled"))->set((double)toggle); | ||
461 | 1238 | } | ||
463 | 1239 | #endif | 1212 | #endif |
464 | 1240 | } | 1213 | } |
465 | 1241 | 1214 | ||
466 | @@ -1428,7 +1401,8 @@ | |||
467 | 1428 | if (!(m_pWidgetParent = m_pSkinLoader->loadDefaultSkin(m_pView, | 1401 | if (!(m_pWidgetParent = m_pSkinLoader->loadDefaultSkin(m_pView, |
468 | 1429 | m_pKeyboard, | 1402 | m_pKeyboard, |
469 | 1430 | m_pPlayerManager, | 1403 | m_pPlayerManager, |
471 | 1431 | m_pLibrary))) { | 1404 | m_pLibrary, |
472 | 1405 | m_pVCManager))) { | ||
473 | 1432 | qDebug() << "Could not reload the skin."; | 1406 | qDebug() << "Could not reload the skin."; |
474 | 1433 | } | 1407 | } |
475 | 1434 | 1408 | ||
476 | 1435 | 1409 | ||
477 | === modified file 'mixxx/src/skin/legacyskinparser.cpp' | |||
478 | --- mixxx/src/skin/legacyskinparser.cpp 2011-05-05 21:29:33 +0000 | |||
479 | +++ mixxx/src/skin/legacyskinparser.cpp 2011-07-30 20:21:03 +0000 | |||
480 | @@ -58,11 +58,13 @@ | |||
481 | 58 | LegacySkinParser::LegacySkinParser(ConfigObject<ConfigValue>* pConfig, | 58 | LegacySkinParser::LegacySkinParser(ConfigObject<ConfigValue>* pConfig, |
482 | 59 | MixxxKeyboard* pKeyboard, | 59 | MixxxKeyboard* pKeyboard, |
483 | 60 | PlayerManager* pPlayerManager, | 60 | PlayerManager* pPlayerManager, |
485 | 61 | Library* pLibrary) | 61 | Library* pLibrary, |
486 | 62 | VinylControlManager* pVCMan) | ||
487 | 62 | : m_pConfig(pConfig), | 63 | : m_pConfig(pConfig), |
488 | 63 | m_pKeyboard(pKeyboard), | 64 | m_pKeyboard(pKeyboard), |
489 | 64 | m_pPlayerManager(pPlayerManager), | 65 | m_pPlayerManager(pPlayerManager), |
490 | 65 | m_pLibrary(pLibrary), | 66 | m_pLibrary(pLibrary), |
491 | 67 | m_pVCManager(pVCMan), | ||
492 | 66 | m_pParent(NULL) { | 68 | m_pParent(NULL) { |
493 | 67 | 69 | ||
494 | 68 | } | 70 | } |
495 | @@ -611,7 +613,7 @@ | |||
496 | 611 | QWidget* LegacySkinParser::parseSpinny(QDomElement node) { | 613 | QWidget* LegacySkinParser::parseSpinny(QDomElement node) { |
497 | 612 | QString channelStr = lookupNodeGroup(node); | 614 | QString channelStr = lookupNodeGroup(node); |
498 | 613 | const char* pSafeChannelStr = safeChannelString(channelStr); | 615 | const char* pSafeChannelStr = safeChannelString(channelStr); |
500 | 614 | WSpinny* p = new WSpinny(m_pParent); | 616 | WSpinny* p = new WSpinny(m_pParent, m_pVCManager); |
501 | 615 | setupWidget(node, p); | 617 | setupWidget(node, p); |
502 | 616 | 618 | ||
503 | 617 | connect(p, SIGNAL(trackDropped(QString, QString)), | 619 | connect(p, SIGNAL(trackDropped(QString, QString)), |
504 | 618 | 620 | ||
505 | === modified file 'mixxx/src/skin/legacyskinparser.h' | |||
506 | --- mixxx/src/skin/legacyskinparser.h 2011-04-29 03:18:02 +0000 | |||
507 | +++ mixxx/src/skin/legacyskinparser.h 2011-07-30 20:21:03 +0000 | |||
508 | @@ -9,6 +9,7 @@ | |||
509 | 9 | 9 | ||
510 | 10 | #include "configobject.h" | 10 | #include "configobject.h" |
511 | 11 | #include "skin/skinparser.h" | 11 | #include "skin/skinparser.h" |
512 | 12 | #include "vinylcontrol/vinylcontrolmanager.h" | ||
513 | 12 | 13 | ||
514 | 13 | class Library; | 14 | class Library; |
515 | 14 | class MixxxKeyboard; | 15 | class MixxxKeyboard; |
516 | @@ -20,7 +21,7 @@ | |||
517 | 20 | public: | 21 | public: |
518 | 21 | LegacySkinParser(ConfigObject<ConfigValue>* pConfig, | 22 | LegacySkinParser(ConfigObject<ConfigValue>* pConfig, |
519 | 22 | MixxxKeyboard* pKeyboard, PlayerManager* pPlayerManager, | 23 | MixxxKeyboard* pKeyboard, PlayerManager* pPlayerManager, |
521 | 23 | Library* pLibrary); | 24 | Library* pLibrary, VinylControlManager* pVCMan); |
522 | 24 | virtual ~LegacySkinParser(); | 25 | virtual ~LegacySkinParser(); |
523 | 25 | 26 | ||
524 | 26 | virtual bool canParse(QString skinPath); | 27 | virtual bool canParse(QString skinPath); |
525 | @@ -73,6 +74,7 @@ | |||
526 | 73 | MixxxKeyboard* m_pKeyboard; | 74 | MixxxKeyboard* m_pKeyboard; |
527 | 74 | PlayerManager* m_pPlayerManager; | 75 | PlayerManager* m_pPlayerManager; |
528 | 75 | Library* m_pLibrary; | 76 | Library* m_pLibrary; |
529 | 77 | VinylControlManager* m_pVCManager; | ||
530 | 76 | QWidget *m_pParent; | 78 | QWidget *m_pParent; |
531 | 77 | static QList<const char*> s_channelStrs; | 79 | static QList<const char*> s_channelStrs; |
532 | 78 | static QMutex s_safeStringMutex; | 80 | static QMutex s_safeStringMutex; |
533 | 79 | 81 | ||
534 | === modified file 'mixxx/src/skin/skinloader.cpp' | |||
535 | --- mixxx/src/skin/skinloader.cpp 2011-01-07 22:31:50 +0000 | |||
536 | +++ mixxx/src/skin/skinloader.cpp 2011-07-30 20:21:03 +0000 | |||
537 | @@ -5,6 +5,7 @@ | |||
538 | 5 | #include <QDir> | 5 | #include <QDir> |
539 | 6 | #include <QtDebug> | 6 | #include <QtDebug> |
540 | 7 | 7 | ||
541 | 8 | #include "vinylcontrol/vinylcontrolmanager.h" | ||
542 | 8 | #include "skin/skinloader.h" | 9 | #include "skin/skinloader.h" |
543 | 9 | #include "skin/legacyskinparser.h" | 10 | #include "skin/legacyskinparser.h" |
544 | 10 | 11 | ||
545 | @@ -52,10 +53,11 @@ | |||
546 | 52 | QWidget* SkinLoader::loadDefaultSkin(QWidget* pParent, | 53 | QWidget* SkinLoader::loadDefaultSkin(QWidget* pParent, |
547 | 53 | MixxxKeyboard* pKeyboard, | 54 | MixxxKeyboard* pKeyboard, |
548 | 54 | PlayerManager* pPlayerManager, | 55 | PlayerManager* pPlayerManager, |
550 | 55 | Library* pLibrary) { | 56 | Library* pLibrary, |
551 | 57 | VinylControlManager* pVCMan) { | ||
552 | 56 | QString skinPath = getConfiguredSkinPath(); | 58 | QString skinPath = getConfiguredSkinPath(); |
553 | 57 | 59 | ||
555 | 58 | LegacySkinParser legacy(m_pConfig, pKeyboard, pPlayerManager, pLibrary); | 60 | LegacySkinParser legacy(m_pConfig, pKeyboard, pPlayerManager, pLibrary, pVCMan); |
556 | 59 | qDebug() << "Legacy can parse:" << legacy.canParse(skinPath); | 61 | qDebug() << "Legacy can parse:" << legacy.canParse(skinPath); |
557 | 60 | return legacy.parseSkin(skinPath, pParent); | 62 | return legacy.parseSkin(skinPath, pParent); |
558 | 61 | } | 63 | } |
559 | 62 | 64 | ||
560 | === modified file 'mixxx/src/skin/skinloader.h' | |||
561 | --- mixxx/src/skin/skinloader.h 2011-01-06 19:05:52 +0000 | |||
562 | +++ mixxx/src/skin/skinloader.h 2011-07-30 20:21:03 +0000 | |||
563 | @@ -17,7 +17,8 @@ | |||
564 | 17 | QWidget* loadDefaultSkin(QWidget* pParent, | 17 | QWidget* loadDefaultSkin(QWidget* pParent, |
565 | 18 | MixxxKeyboard* pKeyboard, | 18 | MixxxKeyboard* pKeyboard, |
566 | 19 | PlayerManager* pPlayerManager, | 19 | PlayerManager* pPlayerManager, |
568 | 20 | Library* pLibrary); | 20 | Library* pLibrary, |
569 | 21 | VinylControlManager* pVCMan); | ||
570 | 21 | 22 | ||
571 | 22 | QString getConfiguredSkinPath(); | 23 | QString getConfiguredSkinPath(); |
572 | 23 | 24 | ||
573 | 24 | 25 | ||
574 | === modified file 'mixxx/src/soundmanager.cpp' | |||
575 | --- mixxx/src/soundmanager.cpp 2011-07-19 18:12:33 +0000 | |||
576 | +++ mixxx/src/soundmanager.cpp 2011-07-30 20:21:03 +0000 | |||
577 | @@ -26,6 +26,7 @@ | |||
578 | 26 | #include "sounddevice.h" | 26 | #include "sounddevice.h" |
579 | 27 | #include "sounddeviceportaudio.h" | 27 | #include "sounddeviceportaudio.h" |
580 | 28 | #include "engine/enginemaster.h" | 28 | #include "engine/enginemaster.h" |
581 | 29 | #include "engine/enginebuffer.h" | ||
582 | 29 | #include "controlobjectthreadmain.h" | 30 | #include "controlobjectthreadmain.h" |
583 | 30 | #include "soundmanagerutil.h" | 31 | #include "soundmanagerutil.h" |
584 | 31 | #include "controlobject.h" | 32 | #include "controlobject.h" |
585 | 32 | 33 | ||
586 | === modified file 'mixxx/src/vinylcontrol/vinylcontrol.cpp' | |||
587 | --- mixxx/src/vinylcontrol/vinylcontrol.cpp 2011-04-29 16:57:44 +0000 | |||
588 | +++ mixxx/src/vinylcontrol/vinylcontrol.cpp 2011-07-30 20:21:03 +0000 | |||
589 | @@ -11,6 +11,8 @@ | |||
590 | 11 | 11 | ||
591 | 12 | // Get Control objects | 12 | // Get Control objects |
592 | 13 | playPos = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "playposition"))); //Range: -.14 to 1.14 | 13 | playPos = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "playposition"))); //Range: -.14 to 1.14 |
593 | 14 | trackSamples = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "track_samples"))); | ||
594 | 15 | trackSampleRate = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "track_samplerate"))); | ||
595 | 14 | vinylSeek = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_seek"))); | 16 | vinylSeek = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_seek"))); |
596 | 15 | controlScratch = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "scratch2"))); | 17 | controlScratch = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "scratch2"))); |
597 | 16 | rateSlider = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "rate"))); //Range -1.0 to 1.0 | 18 | rateSlider = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "rate"))); //Range -1.0 to 1.0 |
598 | @@ -19,11 +21,13 @@ | |||
599 | 19 | duration = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "duration"))); | 21 | duration = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "duration"))); |
600 | 20 | mode = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_mode"))); | 22 | mode = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_mode"))); |
601 | 21 | enabled = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_enabled"))); | 23 | enabled = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_enabled"))); |
602 | 24 | wantenabled = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_wantenabled"))); | ||
603 | 22 | cueing = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_cueing"))); | 25 | cueing = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_cueing"))); |
604 | 23 | rateRange = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "rateRange"))); | 26 | rateRange = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "rateRange"))); |
605 | 24 | vinylStatus = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_status"))); | 27 | vinylStatus = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_status"))); |
606 | 25 | rateDir = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "rate_dir"))); | 28 | rateDir = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "rate_dir"))); |
607 | 26 | loopEnabled = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "loop_enabled"))); | 29 | loopEnabled = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "loop_enabled"))); |
608 | 30 | signalenabled = new ControlObjectThread(ControlObject::getControl(ConfigKey(group, "vinylcontrol_signal_enabled"))); | ||
609 | 27 | 31 | ||
610 | 28 | dVinylPitch = 0.0f; | 32 | dVinylPitch = 0.0f; |
611 | 29 | dVinylPosition = 0.0f; | 33 | dVinylPosition = 0.0f; |
612 | @@ -47,8 +51,8 @@ | |||
613 | 47 | //Vinyl control mode | 51 | //Vinyl control mode |
614 | 48 | iVCMode = m_pConfig->getValueString(ConfigKey("[VinylControl]","mode")).toInt(); | 52 | iVCMode = m_pConfig->getValueString(ConfigKey("[VinylControl]","mode")).toInt(); |
615 | 49 | 53 | ||
618 | 50 | //Enabled or not | 54 | //Enabled or not -- load from saved value in case vinyl control is restarting |
619 | 51 | bIsEnabled = m_pConfig->getValueString(ConfigKey(group,"vinylcontrol_enabled")).toInt(); | 55 | bIsEnabled = wantenabled->get(); |
620 | 52 | 56 | ||
621 | 53 | //Gain | 57 | //Gain |
622 | 54 | ControlObject::getControl(ConfigKey("[VinylControl]", "gain"))->set( | 58 | ControlObject::getControl(ConfigKey("[VinylControl]", "gain"))->set( |
623 | @@ -59,7 +63,9 @@ | |||
624 | 59 | { | 63 | { |
625 | 60 | bIsEnabled = enable; | 64 | bIsEnabled = enable; |
626 | 61 | if (m_pConfig) | 65 | if (m_pConfig) |
627 | 66 | { | ||
628 | 62 | m_pConfig->set(ConfigKey(m_group,"vinylcontrol_enabled"), ConfigValue((int)enable)); | 67 | m_pConfig->set(ConfigKey(m_group,"vinylcontrol_enabled"), ConfigValue((int)enable)); |
629 | 68 | } | ||
630 | 63 | 69 | ||
631 | 64 | enabled->slotSet(enable); | 70 | enabled->slotSet(enable); |
632 | 65 | 71 | ||
633 | @@ -71,8 +77,15 @@ | |||
634 | 71 | 77 | ||
635 | 72 | VinylControl::~VinylControl() | 78 | VinylControl::~VinylControl() |
636 | 73 | { | 79 | { |
637 | 80 | bool wasEnabled = bIsEnabled; | ||
638 | 74 | enabled->slotSet(false); | 81 | enabled->slotSet(false); |
639 | 75 | vinylStatus->slotSet(VINYL_STATUS_DISABLED); | 82 | vinylStatus->slotSet(VINYL_STATUS_DISABLED); |
640 | 83 | if (wasEnabled) | ||
641 | 84 | { | ||
642 | 85 | //if vinyl control is just restarting, indicate that it should | ||
643 | 86 | //be enabled | ||
644 | 87 | wantenabled->slotSet(true); | ||
645 | 88 | } | ||
646 | 76 | } | 89 | } |
647 | 77 | 90 | ||
648 | 78 | float VinylControl::getSpeed() | 91 | float VinylControl::getSpeed() |
649 | 79 | 92 | ||
650 | === modified file 'mixxx/src/vinylcontrol/vinylcontrol.h' | |||
651 | --- mixxx/src/vinylcontrol/vinylcontrol.h 2011-05-11 04:38:17 +0000 | |||
652 | +++ mixxx/src/vinylcontrol/vinylcontrol.h 2011-07-30 20:21:03 +0000 | |||
653 | @@ -35,7 +35,7 @@ | |||
654 | 35 | 35 | ||
655 | 36 | #define MIXXX_VC_DEFAULT_LEADINTIME 0 | 36 | #define MIXXX_VC_DEFAULT_LEADINTIME 0 |
656 | 37 | 37 | ||
658 | 38 | #define MIXXX_VINYL_SCOPE_SIZE 128 | 38 | #define MIXXX_VINYL_SCOPE_SIZE 100 |
659 | 39 | 39 | ||
660 | 40 | //TODO: Make this an EngineObject instead one day? (need to route all the input audio through the engine that way too...) | 40 | //TODO: Make this an EngineObject instead one day? (need to route all the input audio through the engine that way too...) |
661 | 41 | 41 | ||
662 | @@ -62,6 +62,8 @@ | |||
663 | 62 | QString m_group; | 62 | QString m_group; |
664 | 63 | ControlObjectThread *playButton; //The ControlObject used to start/stop playback of the song. | 63 | ControlObjectThread *playButton; //The ControlObject used to start/stop playback of the song. |
665 | 64 | ControlObjectThread *playPos; //The ControlObject used to read the playback position in the song. | 64 | ControlObjectThread *playPos; //The ControlObject used to read the playback position in the song. |
666 | 65 | ControlObjectThread *trackSamples; | ||
667 | 66 | ControlObjectThread *trackSampleRate; | ||
668 | 65 | ControlObjectThread *vinylSeek; //The ControlObject used to change the playback position in the song. | 67 | ControlObjectThread *vinylSeek; //The ControlObject used to change the playback position in the song. |
669 | 66 | ControlObjectThread *controlScratch; //The ControlObject used to seek when the record is spinning fast. | 68 | ControlObjectThread *controlScratch; //The ControlObject used to seek when the record is spinning fast. |
670 | 67 | ControlObjectThread *rateSlider; //The ControlObject used to change the speed/pitch of the song. | 69 | ControlObjectThread *rateSlider; //The ControlObject used to change the speed/pitch of the song. |
671 | @@ -69,11 +71,13 @@ | |||
672 | 69 | ControlObjectThread *duration; //The ControlObject used to get the duration of the current song. | 71 | ControlObjectThread *duration; //The ControlObject used to get the duration of the current song. |
673 | 70 | ControlObjectThread *mode; //The ControlObject used to get the vinyl control mode (absolute/relative/scratch) | 72 | ControlObjectThread *mode; //The ControlObject used to get the vinyl control mode (absolute/relative/scratch) |
674 | 71 | ControlObjectThread *enabled; //The ControlObject used to get if the vinyl control is enabled or disabled. | 73 | ControlObjectThread *enabled; //The ControlObject used to get if the vinyl control is enabled or disabled. |
675 | 74 | ControlObjectThread *wantenabled; //The ControlObject used to get if the vinyl control should try to enable itself | ||
676 | 72 | ControlObjectThread *cueing; //Should cueing mode be active? | 75 | ControlObjectThread *cueing; //Should cueing mode be active? |
677 | 73 | ControlObjectThread *rateRange; //The ControlObject used to the get the pitch range from the prefs. | 76 | ControlObjectThread *rateRange; //The ControlObject used to the get the pitch range from the prefs. |
678 | 74 | ControlObjectThread *vinylStatus; | 77 | ControlObjectThread *vinylStatus; |
679 | 75 | ControlObjectThread *rateDir; //direction of rate | 78 | ControlObjectThread *rateDir; //direction of rate |
680 | 76 | ControlObjectThread *loopEnabled; //looping enabled? | 79 | ControlObjectThread *loopEnabled; //looping enabled? |
681 | 80 | ControlObjectThread *signalenabled; //show the signal in the skin? | ||
682 | 77 | //ControlObject *vinylStatus; //Status of vinyl control | 81 | //ControlObject *vinylStatus; //Status of vinyl control |
683 | 78 | 82 | ||
684 | 79 | int iLeadInTime; //The lead-in time... | 83 | int iLeadInTime; //The lead-in time... |
685 | @@ -86,6 +90,7 @@ | |||
686 | 86 | float fRateRange; //The pitch range setting from Mixxx's preferences | 90 | float fRateRange; //The pitch range setting from Mixxx's preferences |
687 | 87 | float m_fTimecodeQuality; //Used as a measure of the quality of the timecode signal. | 91 | float m_fTimecodeQuality; //Used as a measure of the quality of the timecode signal. |
688 | 88 | 92 | ||
689 | 93 | float fTrackDuration; | ||
690 | 89 | unsigned long iSampleRate; | 94 | unsigned long iSampleRate; |
691 | 90 | bool bIsEnabled; | 95 | bool bIsEnabled; |
692 | 91 | int iRIAACorrection; | 96 | int iRIAACorrection; |
693 | 92 | 97 | ||
694 | === modified file 'mixxx/src/vinylcontrol/vinylcontrolmanager.cpp' | |||
695 | --- mixxx/src/vinylcontrol/vinylcontrolmanager.cpp 2011-07-19 20:54:56 +0000 | |||
696 | +++ mixxx/src/vinylcontrol/vinylcontrolmanager.cpp 2011-07-30 20:21:03 +0000 | |||
697 | @@ -26,11 +26,9 @@ | |||
698 | 26 | { | 26 | { |
699 | 27 | // load a bunch of stuff | 27 | // load a bunch of stuff |
700 | 28 | ControlObject::getControl(ConfigKey("[Channel1]","vinylcontrol_enabled")) | 28 | ControlObject::getControl(ConfigKey("[Channel1]","vinylcontrol_enabled")) |
703 | 29 | ->queueFromThread(m_pConfig->getValueString( | 29 | ->queueFromThread(0); |
702 | 30 | ConfigKey("[VinylControl]","enabled_ch1")).toDouble()); | ||
704 | 31 | ControlObject::getControl(ConfigKey("[Channel2]","vinylcontrol_enabled")) | 30 | ControlObject::getControl(ConfigKey("[Channel2]","vinylcontrol_enabled")) |
707 | 32 | ->queueFromThread(m_pConfig->getValueString( | 31 | ->queueFromThread(0); |
706 | 33 | ConfigKey("[VinylControl]","enabled_ch2")).toDouble()); | ||
708 | 34 | ControlObject::getControl(ConfigKey("[Channel1]","vinylcontrol_mode")) | 32 | ControlObject::getControl(ConfigKey("[Channel1]","vinylcontrol_mode")) |
709 | 35 | ->queueFromThread(m_pConfig->getValueString( | 33 | ->queueFromThread(m_pConfig->getValueString( |
710 | 36 | ConfigKey("[VinylControl]","mode")).toDouble()); | 34 | ConfigKey("[VinylControl]","mode")).toDouble()); |
711 | @@ -62,8 +60,6 @@ | |||
712 | 62 | 60 | ||
713 | 63 | // save a bunch of stuff to config | 61 | // save a bunch of stuff to config |
714 | 64 | // turn off vinyl control so it won't be enabled on load (this is redundant to mixxx.cpp) | 62 | // turn off vinyl control so it won't be enabled on load (this is redundant to mixxx.cpp) |
715 | 65 | m_pConfig->set(ConfigKey("[VinylControl]","enabled_ch1"), false); | ||
716 | 66 | m_pConfig->set(ConfigKey("[VinylControl]","enabled_ch2"), false); | ||
717 | 67 | m_pConfig->set(ConfigKey("[Channel 1]","vinylcontrol_enabled"), false); | 63 | m_pConfig->set(ConfigKey("[Channel 1]","vinylcontrol_enabled"), false); |
718 | 68 | m_pConfig->set(ConfigKey("[Channel 2]","vinylcontrol_enabled"), false); | 64 | m_pConfig->set(ConfigKey("[Channel 2]","vinylcontrol_enabled"), false); |
719 | 69 | m_pConfig->set(ConfigKey("[VinylControl]","mode"), | 65 | m_pConfig->set(ConfigKey("[VinylControl]","mode"), |
720 | 70 | 66 | ||
721 | === modified file 'mixxx/src/vinylcontrol/vinylcontrolsignalwidget.cpp' | |||
722 | --- mixxx/src/vinylcontrol/vinylcontrolsignalwidget.cpp 2011-04-17 04:16:00 +0000 | |||
723 | +++ mixxx/src/vinylcontrol/vinylcontrolsignalwidget.cpp 2011-07-30 20:21:03 +0000 | |||
724 | @@ -31,7 +31,7 @@ | |||
725 | 31 | : QWidget(), | 31 | : QWidget(), |
726 | 32 | m_iTimerId(0), | 32 | m_iTimerId(0), |
727 | 33 | m_pVinylControl(NULL), | 33 | m_pVinylControl(NULL), |
729 | 34 | m_iSize(128), | 34 | m_iSize(100), |
730 | 35 | m_qImage(), | 35 | m_qImage(), |
731 | 36 | m_bVinylActive(FALSE) { | 36 | m_bVinylActive(FALSE) { |
732 | 37 | } | 37 | } |
733 | 38 | 38 | ||
734 | === modified file 'mixxx/src/vinylcontrol/vinylcontrolxwax.cpp' | |||
735 | --- mixxx/src/vinylcontrol/vinylcontrolxwax.cpp 2011-05-21 01:07:25 +0000 | |||
736 | +++ mixxx/src/vinylcontrol/vinylcontrolxwax.cpp 2011-07-30 20:21:03 +0000 | |||
737 | @@ -47,6 +47,7 @@ | |||
738 | 47 | iOldMode = MIXXX_VCMODE_ABSOLUTE; | 47 | iOldMode = MIXXX_VCMODE_ABSOLUTE; |
739 | 48 | dUiUpdateTime = -1.0f; | 48 | dUiUpdateTime = -1.0f; |
740 | 49 | m_bNeedleSkipPrevention = (bool)(m_pConfig->getValueString( ConfigKey( "[VinylControl]", "needle_skip_prevention" ) ).toInt()); | 49 | m_bNeedleSkipPrevention = (bool)(m_pConfig->getValueString( ConfigKey( "[VinylControl]", "needle_skip_prevention" ) ).toInt()); |
741 | 50 | signalenabled->slotSet(m_pConfig->getValueString( ConfigKey( "[VinylControl]", "show_signal_quality" ) ).toInt()); | ||
742 | 50 | 51 | ||
743 | 51 | dLastTrackSelectPos = 0.0; | 52 | dLastTrackSelectPos = 0.0; |
744 | 52 | dCurTrackSelectPos = 0.0; | 53 | dCurTrackSelectPos = 0.0; |
745 | @@ -97,6 +98,7 @@ | |||
746 | 97 | //Note that timecoder_init will not double-malloc the LUTs, and after this we are guaranteed | 98 | //Note that timecoder_init will not double-malloc the LUTs, and after this we are guaranteed |
747 | 98 | //that the LUT has been generated unless we ran out of memory. | 99 | //that the LUT has been generated unless we ran out of memory. |
748 | 99 | m_bLUTInitialized = true; | 100 | m_bLUTInitialized = true; |
749 | 101 | m_uiSafeZone = timecoder_get_safe(&timecoder); | ||
750 | 100 | //} | 102 | //} |
751 | 101 | s_xwaxLUTMutex.unlock(); | 103 | s_xwaxLUTMutex.unlock(); |
752 | 102 | 104 | ||
753 | @@ -177,6 +179,7 @@ | |||
754 | 177 | double dPitchRing[RING_SIZE]; | 179 | double dPitchRing[RING_SIZE]; |
755 | 178 | int ringPos = 0; | 180 | int ringPos = 0; |
756 | 179 | int ringFilled = 0; | 181 | int ringFilled = 0; |
757 | 182 | double cur_duration = -1.0f; | ||
758 | 180 | double old_duration = -1.0f; | 183 | double old_duration = -1.0f; |
759 | 181 | int reportedMode = 0; | 184 | int reportedMode = 0; |
760 | 182 | bool reportedPlayButton = 0; | 185 | bool reportedPlayButton = 0; |
761 | @@ -225,36 +228,62 @@ | |||
762 | 225 | //if no track loaded, let track selection work but that's it | 228 | //if no track loaded, let track selection work but that's it |
763 | 226 | if (duration == NULL) | 229 | if (duration == NULL) |
764 | 227 | { | 230 | { |
767 | 228 | bTrackSelectMode = true; | 231 | //until I can figure out how to detect "track 2" on serato CD, |
768 | 229 | doTrackSelection(false, dVinylPitch, iPosition); | 232 | //don't try track selection |
769 | 233 | if (!m_bCDControl) | ||
770 | 234 | { | ||
771 | 235 | bTrackSelectMode = true; | ||
772 | 236 | doTrackSelection(false, dVinylPitch, iPosition); | ||
773 | 237 | } | ||
774 | 230 | continue; | 238 | continue; |
775 | 231 | } | 239 | } |
776 | 232 | //qDebug() << m_group << id << iPosition << dVinylPitch; | 240 | //qDebug() << m_group << id << iPosition << dVinylPitch; |
777 | 233 | 241 | ||
779 | 234 | double cur_duration = duration->get(); | 242 | cur_duration = duration->get(); |
780 | 243 | |||
781 | 244 | |||
782 | 245 | //Has a new track been loaded? | ||
783 | 235 | //FIXME? we should really sync on all track changes | 246 | //FIXME? we should really sync on all track changes |
784 | 236 | if (cur_duration != old_duration) | 247 | if (cur_duration != old_duration) |
785 | 237 | { | 248 | { |
786 | 238 | bForceResync=true; | 249 | bForceResync=true; |
787 | 239 | bTrackSelectMode = false; //just in case | 250 | bTrackSelectMode = false; //just in case |
788 | 240 | old_duration = cur_duration; | 251 | old_duration = cur_duration; |
789 | 252 | //duration from the control object is an integer. We need | ||
790 | 253 | //more precision: | ||
791 | 254 | fTrackDuration = trackSamples->get() / 2 / trackSampleRate->get(); | ||
792 | 255 | |||
793 | 256 | //we were at record end, so turn it off and restore mode | ||
794 | 257 | if(atRecordEnd) | ||
795 | 258 | { | ||
796 | 259 | disableRecordEndMode(); | ||
797 | 260 | if (iOldMode == MIXXX_VCMODE_CONSTANT) | ||
798 | 261 | iVCMode = MIXXX_VCMODE_RELATIVE; | ||
799 | 262 | else | ||
800 | 263 | iVCMode = iOldMode; | ||
801 | 264 | } | ||
802 | 241 | } | 265 | } |
803 | 242 | 266 | ||
807 | 243 | dVinylPosition = iPosition; | 267 | //make sure dVinylPosition only has good values |
808 | 244 | dVinylPosition = dVinylPosition / 1000.0f; | 268 | if (iPosition != -1) |
809 | 245 | dVinylPosition -= iLeadInTime; | 269 | { |
810 | 270 | dVinylPosition = iPosition; | ||
811 | 271 | dVinylPosition = dVinylPosition / 1000.0f; | ||
812 | 272 | dVinylPosition -= iLeadInTime; | ||
813 | 273 | } | ||
814 | 274 | |||
815 | 275 | |||
816 | 246 | 276 | ||
817 | 247 | //Initialize drift control to zero in case we don't get any position data to calculate it with. | 277 | //Initialize drift control to zero in case we don't get any position data to calculate it with. |
818 | 248 | dDriftControl = 0.0f; | 278 | dDriftControl = 0.0f; |
819 | 249 | 279 | ||
821 | 250 | filePosition = playPos->get() * cur_duration; //Get the playback position in the file in seconds. | 280 | filePosition = playPos->get() * fTrackDuration; //Get the playback position in the file in seconds. |
822 | 251 | 281 | ||
823 | 252 | reportedMode = mode->get(); | 282 | reportedMode = mode->get(); |
824 | 253 | reportedPlayButton = playButton->get(); | 283 | reportedPlayButton = playButton->get(); |
825 | 254 | 284 | ||
826 | 255 | if (iVCMode != reportedMode) | 285 | if (iVCMode != reportedMode) |
827 | 256 | { | 286 | { |
828 | 257 | //qDebug() << "cur mode" << iVCMode << "new mode" << reportedMode; | ||
829 | 258 | //if we are playing, don't allow change | 287 | //if we are playing, don't allow change |
830 | 259 | //to absolute mode (would cause sudden track skip) | 288 | //to absolute mode (would cause sudden track skip) |
831 | 260 | if (reportedPlayButton && reportedMode == MIXXX_VCMODE_ABSOLUTE) | 289 | if (reportedPlayButton && reportedMode == MIXXX_VCMODE_ABSOLUTE) |
832 | @@ -282,7 +311,6 @@ | |||
833 | 282 | iVCMode = MIXXX_VCMODE_RELATIVE; | 311 | iVCMode = MIXXX_VCMODE_RELATIVE; |
834 | 283 | mode->slotSet((double)iVCMode); | 312 | mode->slotSet((double)iVCMode); |
835 | 284 | } | 313 | } |
836 | 285 | |||
837 | 286 | //are we newly playing near the end of the record? (in absolute mode, this happens | 314 | //are we newly playing near the end of the record? (in absolute mode, this happens |
838 | 287 | //when the filepos is past safe (more accurate), | 315 | //when the filepos is past safe (more accurate), |
839 | 288 | //but it can also happen in relative mode if the vinylpos is nearing the end | 316 | //but it can also happen in relative mode if the vinylpos is nearing the end |
840 | @@ -292,13 +320,13 @@ | |||
841 | 292 | { | 320 | { |
842 | 293 | if (iVCMode == MIXXX_VCMODE_ABSOLUTE) | 321 | if (iVCMode == MIXXX_VCMODE_ABSOLUTE) |
843 | 294 | { | 322 | { |
845 | 295 | if ((filePosition + iLeadInTime) * 1000.0f > timecoder_get_safe(&timecoder) && | 323 | if ((filePosition + iLeadInTime) * 1000.0f > m_uiSafeZone && |
846 | 296 | !bForceResync) //corner case: we are waiting for resync so don't enable just yet | 324 | !bForceResync) //corner case: we are waiting for resync so don't enable just yet |
847 | 297 | enableRecordEndMode(); | 325 | enableRecordEndMode(); |
848 | 298 | } | 326 | } |
849 | 299 | else if (iVCMode == MIXXX_VCMODE_RELATIVE || iVCMode == MIXXX_VCMODE_CONSTANT) | 327 | else if (iVCMode == MIXXX_VCMODE_RELATIVE || iVCMode == MIXXX_VCMODE_CONSTANT) |
850 | 300 | { | 328 | { |
852 | 301 | if (iPosition != -1 && iPosition > timecoder_get_safe(&timecoder)) | 329 | if (iPosition != -1 && iPosition > m_uiSafeZone) |
853 | 302 | enableRecordEndMode(); | 330 | enableRecordEndMode(); |
854 | 303 | } | 331 | } |
855 | 304 | } | 332 | } |
856 | @@ -307,25 +335,20 @@ | |||
857 | 307 | { | 335 | { |
858 | 308 | //if atRecordEnd was true, maybe it no longer applies: | 336 | //if atRecordEnd was true, maybe it no longer applies: |
859 | 309 | 337 | ||
867 | 310 | if ((iVCMode == MIXXX_VCMODE_ABSOLUTE && | 338 | if (!reportedPlayButton) |
861 | 311 | (filePosition + iLeadInTime) * 1000.0f <= timecoder_get_safe(&timecoder))) | ||
862 | 312 | { | ||
863 | 313 | //if we are in absolute mode and the file position is in a safe zone now | ||
864 | 314 | disableRecordEndMode(); | ||
865 | 315 | } | ||
866 | 316 | else if (!reportedPlayButton) | ||
868 | 317 | { | 339 | { |
869 | 318 | //if we turned off play button, also disable | 340 | //if we turned off play button, also disable |
870 | 319 | disableRecordEndMode(); | 341 | disableRecordEndMode(); |
871 | 320 | } | 342 | } |
873 | 321 | else if (iPosition != -1) | 343 | else if (iPosition != -1 && |
874 | 344 | iPosition <= m_uiSafeZone && | ||
875 | 345 | dVinylPosition > 0 && | ||
876 | 346 | checkSteadyPitch(dVinylPitch, filePosition) > 0.5) | ||
877 | 347 | |||
878 | 322 | { | 348 | { |
885 | 323 | //if relative mode, and vinylpos is safe | 349 | //if good position, and safe, and not in leadin, and steady, |
886 | 324 | if (iVCMode == MIXXX_VCMODE_RELATIVE && | 350 | //disable |
887 | 325 | iPosition <= timecoder_get_safe(&timecoder)) | 351 | disableRecordEndMode(); |
882 | 326 | { | ||
883 | 327 | disableRecordEndMode(); | ||
884 | 328 | } | ||
888 | 329 | } | 352 | } |
889 | 330 | 353 | ||
890 | 331 | if (atRecordEnd) | 354 | if (atRecordEnd) |
891 | @@ -345,17 +368,22 @@ | |||
892 | 345 | 368 | ||
893 | 346 | if (!atRecordEnd) | 369 | if (!atRecordEnd) |
894 | 347 | { | 370 | { |
896 | 348 | if (iPosition != -1 && iPosition > timecoder_get_safe(&timecoder)) | 371 | if (iPosition != -1 && iPosition > m_uiSafeZone) |
897 | 349 | { | 372 | { |
899 | 350 | if (!bTrackSelectMode) | 373 | //until I can figure out how to detect "track 2" on serato CD, |
900 | 374 | //don't try track selection | ||
901 | 375 | if (!m_bCDControl) | ||
902 | 351 | { | 376 | { |
908 | 352 | qDebug() << "position greater than safe, select mode" << iPosition << timecoder_get_safe(&timecoder); | 377 | if (!bTrackSelectMode) |
909 | 353 | bTrackSelectMode = true; | 378 | { |
910 | 354 | togglePlayButton(FALSE); | 379 | qDebug() << "position greater than safe, select mode" << iPosition << m_uiSafeZone; |
911 | 355 | resetSteadyPitch(0.0f, 0.0f); | 380 | bTrackSelectMode = true; |
912 | 356 | controlScratch->slotSet(0.0f); | 381 | togglePlayButton(FALSE); |
913 | 382 | resetSteadyPitch(0.0f, 0.0f); | ||
914 | 383 | controlScratch->slotSet(0.0f); | ||
915 | 384 | } | ||
916 | 385 | doTrackSelection(true, dVinylPitch, iPosition); | ||
917 | 357 | } | 386 | } |
918 | 358 | doTrackSelection(true, dVinylPitch, iPosition); | ||
919 | 359 | 387 | ||
920 | 360 | //hm I wonder if track will keep playing while this happens? | 388 | //hm I wonder if track will keep playing while this happens? |
921 | 361 | //not sure what we want to do here... probably enforce | 389 | //not sure what we want to do here... probably enforce |
922 | @@ -432,8 +460,9 @@ | |||
923 | 432 | 460 | ||
924 | 433 | //save the absolute amount of drift for when we need to estimate vinyl position | 461 | //save the absolute amount of drift for when we need to estimate vinyl position |
925 | 434 | dDriftAmt = dVinylPosition - filePosition; | 462 | dDriftAmt = dVinylPosition - filePosition; |
926 | 463 | |||
927 | 464 | //qDebug() << "drift" << dDriftAmt; | ||
928 | 435 | 465 | ||
929 | 436 | //qDebug() << "vinyl" << dVinylPosition << "file" << filePosition; | ||
930 | 437 | if (bForceResync) | 466 | if (bForceResync) |
931 | 438 | { | 467 | { |
932 | 439 | //if forceresync was set but we're no longer absolute, | 468 | //if forceresync was set but we're no longer absolute, |
933 | @@ -504,12 +533,14 @@ | |||
934 | 504 | 533 | ||
935 | 505 | //Calculate how much the vinyl's position has drifted from it's timecode and compensate for it. | 534 | //Calculate how much the vinyl's position has drifted from it's timecode and compensate for it. |
936 | 506 | //(This is caused by the manufacturing process of the vinyl.) | 535 | //(This is caused by the manufacturing process of the vinyl.) |
938 | 507 | dDriftControl = ((filePosition - dVinylPosition) / dVinylPosition) / 100 * 4.0f; | 536 | if (fabs(dDriftAmt) > 0.1 && fabs(dDriftAmt) < 5.0) { |
939 | 537 | dDriftControl = dDriftAmt; | ||
940 | 538 | } else { | ||
941 | 539 | dDriftControl = 0.0; | ||
942 | 540 | } | ||
943 | 508 | 541 | ||
944 | 509 | //if we hit the end of the ring, loop around | 542 | //if we hit the end of the ring, loop around |
948 | 510 | ringPos++; | 543 | ringPos = (ringPos + 1) % RING_SIZE; |
946 | 511 | if(ringPos >= RING_SIZE) | ||
947 | 512 | ringPos = 0; | ||
949 | 513 | dOldPos = dVinylPosition; | 544 | dOldPos = dVinylPosition; |
950 | 514 | } | 545 | } |
951 | 515 | else | 546 | else |
952 | @@ -528,6 +559,14 @@ | |||
953 | 528 | ringFilled = 0; | 559 | ringFilled = 0; |
954 | 529 | continue; | 560 | continue; |
955 | 530 | } | 561 | } |
956 | 562 | |||
957 | 563 | if (iVCMode == MIXXX_VCMODE_ABSOLUTE && | ||
958 | 564 | fabs(dVinylPitch) < 0.05 && | ||
959 | 565 | fabs(dDriftAmt) >= 0.3f) | ||
960 | 566 | { | ||
961 | 567 | qDebug() << "slow, out of sync, syncing position"; | ||
962 | 568 | syncPosition(); | ||
963 | 569 | } | ||
964 | 531 | 570 | ||
965 | 532 | dOldPos = filePosition + dDriftAmt; | 571 | dOldPos = filePosition + dDriftAmt; |
966 | 533 | 572 | ||
967 | @@ -556,13 +595,12 @@ | |||
968 | 556 | else | 595 | else |
969 | 557 | averagePitch = dVinylPitch; | 596 | averagePitch = dVinylPitch; |
970 | 558 | 597 | ||
971 | 559 | |||
972 | 560 | if (iVCMode == MIXXX_VCMODE_ABSOLUTE) | 598 | if (iVCMode == MIXXX_VCMODE_ABSOLUTE) |
973 | 561 | { | 599 | { |
975 | 562 | controlScratch->slotSet(averagePitch + dDriftControl); | 600 | controlScratch->slotSet(dVinylPitch + dDriftControl); |
976 | 563 | if (iPosition != -1 && reportedPlayButton && uiUpdateTime(filePosition)) | 601 | if (iPosition != -1 && reportedPlayButton && uiUpdateTime(filePosition)) |
977 | 564 | { | 602 | { |
979 | 565 | rateSlider->slotSet(rateDir->get() * (fabs(averagePitch + dDriftControl) - 1.0f) / fRateRange); | 603 | rateSlider->slotSet(rateDir->get() * (fabs(dVinylPitch + dDriftControl) - 1.0f) / fRateRange); |
980 | 566 | dUiUpdateTime = filePosition; | 604 | dUiUpdateTime = filePosition; |
981 | 567 | } | 605 | } |
982 | 568 | } | 606 | } |
983 | @@ -587,14 +625,21 @@ | |||
984 | 587 | //let the track play a wee bit more before deciding we've stopped | 625 | //let the track play a wee bit more before deciding we've stopped |
985 | 588 | 626 | ||
986 | 589 | rateSlider->slotSet(0.0f); | 627 | rateSlider->slotSet(0.0f); |
987 | 628 | |||
988 | 629 | if (iVCMode == MIXXX_VCMODE_ABSOLUTE && | ||
989 | 630 | fabs(dVinylPosition - filePosition) >= 0.1f) | ||
990 | 631 | { | ||
991 | 632 | qDebug() << "stopped, out of sync, syncing position"; | ||
992 | 633 | syncPosition(); | ||
993 | 634 | } | ||
994 | 590 | 635 | ||
995 | 591 | if(fabs(filePosition - dOldFilePos) >= 0.1 || | 636 | if(fabs(filePosition - dOldFilePos) >= 0.1 || |
996 | 592 | !m_bNeedleSkipPrevention || | 637 | !m_bNeedleSkipPrevention || |
997 | 593 | filePosition == dOldFilePos) | 638 | filePosition == dOldFilePos) |
998 | 594 | { | 639 | { |
999 | 595 | //We are not playing any more | 640 | //We are not playing any more |
1002 | 596 | togglePlayButton(FALSE); | 641 | togglePlayButton(FALSE); |
1003 | 597 | resetSteadyPitch(0.0f, 0.0f); | 642 | resetSteadyPitch(0.0f, 0.0f); |
1004 | 598 | controlScratch->slotSet(0.0f); | 643 | controlScratch->slotSet(0.0f); |
1005 | 599 | //resetSteadyPitch(dVinylPitch, filePosition); | 644 | //resetSteadyPitch(dVinylPitch, filePosition); |
1006 | 600 | //Notify the UI that the timecode quality is garbage/missing. | 645 | //Notify the UI that the timecode quality is garbage/missing. |
1007 | @@ -643,15 +688,8 @@ | |||
1008 | 643 | { | 688 | { |
1009 | 644 | vinylStatus->slotSet(VINYL_STATUS_OK); | 689 | vinylStatus->slotSet(VINYL_STATUS_OK); |
1010 | 645 | atRecordEnd = false; | 690 | atRecordEnd = false; |
1020 | 646 | //don't start a new track with constant mode | 691 | iVCMode = MIXXX_VCMODE_RELATIVE; |
1021 | 647 | if (iVCMode == MIXXX_VCMODE_CONSTANT) | 692 | mode->slotSet((double)iVCMode); |
1013 | 648 | { | ||
1014 | 649 | if (iOldMode == MIXXX_VCMODE_CONSTANT) | ||
1015 | 650 | iVCMode = MIXXX_VCMODE_RELATIVE; | ||
1016 | 651 | else | ||
1017 | 652 | iVCMode = iOldMode; | ||
1018 | 653 | mode->slotSet((double)iVCMode); | ||
1019 | 654 | } | ||
1022 | 655 | } | 693 | } |
1023 | 656 | 694 | ||
1024 | 657 | void VinylControlXwax::togglePlayButton(bool on) | 695 | void VinylControlXwax::togglePlayButton(bool on) |
1025 | @@ -769,11 +807,19 @@ | |||
1026 | 769 | void VinylControlXwax::syncPosition() | 807 | void VinylControlXwax::syncPosition() |
1027 | 770 | { | 808 | { |
1028 | 771 | //qDebug() << "sync position" << dVinylPosition / duration->get(); | 809 | //qDebug() << "sync position" << dVinylPosition / duration->get(); |
1030 | 772 | vinylSeek->slotSet(dVinylPosition / duration->get()); //VinylPos in seconds / total length of song | 810 | vinylSeek->slotSet(dVinylPosition / fTrackDuration); //VinylPos in seconds / total length of song |
1031 | 773 | } | 811 | } |
1032 | 774 | 812 | ||
1033 | 775 | bool VinylControlXwax::checkEnabled(bool was, bool is) | 813 | bool VinylControlXwax::checkEnabled(bool was, bool is) |
1034 | 776 | { | 814 | { |
1035 | 815 | // if we're not enabled, but the last object was, try turning ourselves on | ||
1036 | 816 | // XXX: is this just a race that's working right now? | ||
1037 | 817 | if (!is and wantenabled->get()) | ||
1038 | 818 | { | ||
1039 | 819 | enabled->slotSet(true); | ||
1040 | 820 | wantenabled->slotSet(false); //don't try to do this over and over | ||
1041 | 821 | return true; //optimism! | ||
1042 | 822 | } | ||
1043 | 777 | if (was != is) | 823 | if (was != is) |
1044 | 778 | { | 824 | { |
1045 | 779 | //we reset the scratch value, but we don't reset the rate slider. | 825 | //we reset the scratch value, but we don't reset the rate slider. |
1046 | @@ -824,7 +870,9 @@ | |||
1047 | 824 | { | 870 | { |
1048 | 825 | bQualityRing[iQualPos] = quality_sample; | 871 | bQualityRing[iQualPos] = quality_sample; |
1049 | 826 | if(iQualFilled < QUALITY_RING_SIZE) | 872 | if(iQualFilled < QUALITY_RING_SIZE) |
1051 | 827 | iQualFilled++; | 873 | { |
1052 | 874 | iQualFilled++; | ||
1053 | 875 | } | ||
1054 | 828 | 876 | ||
1055 | 829 | int quality = 0; | 877 | int quality = 0; |
1056 | 830 | for (int i=0; i<iQualFilled; i++) | 878 | for (int i=0; i<iQualFilled; i++) |
1057 | @@ -836,9 +884,7 @@ | |||
1058 | 836 | //qDebug() << "quality" << m_fTimecodeQuality; | 884 | //qDebug() << "quality" << m_fTimecodeQuality; |
1059 | 837 | m_fTimecodeQuality = (float)quality / (float)iQualFilled; | 885 | m_fTimecodeQuality = (float)quality / (float)iQualFilled; |
1060 | 838 | 886 | ||
1064 | 839 | iQualPos++; | 887 | iQualPos = (iQualPos + 1) % QUALITY_RING_SIZE; |
1062 | 840 | if(iQualPos >= QUALITY_RING_SIZE) | ||
1063 | 841 | iQualPos = 0; | ||
1065 | 842 | } | 888 | } |
1066 | 843 | 889 | ||
1067 | 844 | float VinylControlXwax::getAngle() | 890 | float VinylControlXwax::getAngle() |
1068 | 845 | 891 | ||
1069 | === modified file 'mixxx/src/vinylcontrol/vinylcontrolxwax.h' | |||
1070 | --- mixxx/src/vinylcontrol/vinylcontrolxwax.h 2011-04-17 04:16:00 +0000 | |||
1071 | +++ mixxx/src/vinylcontrol/vinylcontrolxwax.h 2011-07-30 20:21:03 +0000 | |||
1072 | @@ -48,6 +48,7 @@ | |||
1073 | 48 | void establishQuality(bool quality_sample); | 48 | void establishQuality(bool quality_sample); |
1074 | 49 | 49 | ||
1075 | 50 | double dFileLength; // The length (in samples) of the current song. | 50 | double dFileLength; // The length (in samples) of the current song. |
1076 | 51 | unsigned int m_uiSafeZone; // Cache the position of the end of record | ||
1077 | 51 | 52 | ||
1078 | 52 | double dOldPos; // The position read last time it was polled. | 53 | double dOldPos; // The position read last time it was polled. |
1079 | 53 | double dOldPitch; | 54 | double dOldPitch; |
1080 | 54 | 55 | ||
1081 | === modified file 'mixxx/src/waveform/waveformrenderer.cpp' | |||
1082 | --- mixxx/src/waveform/waveformrenderer.cpp 2011-04-06 21:20:35 +0000 | |||
1083 | +++ mixxx/src/waveform/waveformrenderer.cpp 2011-07-30 20:21:03 +0000 | |||
1084 | @@ -26,6 +26,8 @@ | |||
1085 | 26 | #define DEFAULT_SUBPIXELS_PER_PIXEL 4 | 26 | #define DEFAULT_SUBPIXELS_PER_PIXEL 4 |
1086 | 27 | #define DEFAULT_PIXELS_PER_SECOND 100 | 27 | #define DEFAULT_PIXELS_PER_SECOND 100 |
1087 | 28 | 28 | ||
1088 | 29 | #define RATE_INCREMENT 0.015 | ||
1089 | 30 | |||
1090 | 29 | void WaveformRenderer::run() { | 31 | void WaveformRenderer::run() { |
1091 | 30 | double msecs_old = 0, msecs_elapsed = 0; | 32 | double msecs_old = 0, msecs_elapsed = 0; |
1092 | 31 | 33 | ||
1093 | @@ -61,6 +63,7 @@ | |||
1094 | 61 | m_dRate(0), | 63 | m_dRate(0), |
1095 | 62 | m_dRateRange(0), | 64 | m_dRateRange(0), |
1096 | 63 | m_dRateDir(0), | 65 | m_dRateDir(0), |
1097 | 66 | m_iRateAdjusting(0), | ||
1098 | 64 | m_iDupes(0), | 67 | m_iDupes(0), |
1099 | 65 | m_dPlayPosAdjust(0), | 68 | m_dPlayPosAdjust(0), |
1100 | 66 | m_iLatency(0), | 69 | m_iLatency(0), |
1101 | @@ -190,7 +193,7 @@ | |||
1102 | 190 | } | 193 | } |
1103 | 191 | 194 | ||
1104 | 192 | void WaveformRenderer::slotUpdateRate(double v) { | 195 | void WaveformRenderer::slotUpdateRate(double v) { |
1106 | 193 | m_dRate = v; | 196 | m_dTargetRate = v; |
1107 | 194 | } | 197 | } |
1108 | 195 | 198 | ||
1109 | 196 | void WaveformRenderer::slotUpdateRateRange(double v) { | 199 | void WaveformRenderer::slotUpdateRateRange(double v) { |
1110 | @@ -501,6 +504,26 @@ | |||
1111 | 501 | 504 | ||
1112 | 502 | //qDebug() << m_dPlayPosAdjust; | 505 | //qDebug() << m_dPlayPosAdjust; |
1113 | 503 | 506 | ||
1114 | 507 | // Gradually stretch the waveform | ||
1115 | 508 | if (fabs(m_dTargetRate - m_dRate) > RATE_INCREMENT) | ||
1116 | 509 | { | ||
1117 | 510 | if ((m_dTargetRate - m_dRate) > 0) | ||
1118 | 511 | { | ||
1119 | 512 | m_iRateAdjusting = m_iRateAdjusting > 0 ? m_iRateAdjusting + 1 : 1; | ||
1120 | 513 | m_dRate = math_min(m_dTargetRate, m_dRate + RATE_INCREMENT * pow(m_iRateAdjusting, 2) / 80); | ||
1121 | 514 | } | ||
1122 | 515 | else | ||
1123 | 516 | { | ||
1124 | 517 | m_iRateAdjusting = m_iRateAdjusting < 0 ? m_iRateAdjusting - 1 : -1; | ||
1125 | 518 | m_dRate = math_max(m_dTargetRate, m_dRate - RATE_INCREMENT * pow(m_iRateAdjusting, 2) / 80); | ||
1126 | 519 | } | ||
1127 | 520 | } | ||
1128 | 521 | else | ||
1129 | 522 | { | ||
1130 | 523 | m_iRateAdjusting = 0; | ||
1131 | 524 | m_dRate = m_dTargetRate; | ||
1132 | 525 | } | ||
1133 | 526 | |||
1134 | 504 | // Limit our rate adjustment to < 99%, "Bad Things" might happen otherwise. | 527 | // Limit our rate adjustment to < 99%, "Bad Things" might happen otherwise. |
1135 | 505 | double rateAdjust = m_dRateDir * math_min(0.99, m_dRate * m_dRateRange); | 528 | double rateAdjust = m_dRateDir * math_min(0.99, m_dRate * m_dRateRange); |
1136 | 506 | 529 | ||
1137 | 507 | 530 | ||
1138 | === modified file 'mixxx/src/waveform/waveformrenderer.h' | |||
1139 | --- mixxx/src/waveform/waveformrenderer.h 2011-03-08 22:17:41 +0000 | |||
1140 | +++ mixxx/src/waveform/waveformrenderer.h 2011-07-30 20:21:03 +0000 | |||
1141 | @@ -61,7 +61,8 @@ | |||
1142 | 61 | 61 | ||
1143 | 62 | int m_iPlayPosTime, m_iPlayPosTimeOld; | 62 | int m_iPlayPosTime, m_iPlayPosTimeOld; |
1144 | 63 | QTime m_playPosTime, m_playPosTimeOld; | 63 | QTime m_playPosTime, m_playPosTimeOld; |
1146 | 64 | double m_dPlayPos, m_dPlayPosOld, m_dRate, m_dRateRange, m_dRateDir; | 64 | double m_dPlayPos, m_dPlayPosOld, m_dTargetRate, m_dRate, m_dRateRange, m_dRateDir; |
1147 | 65 | int m_iRateAdjusting; | ||
1148 | 65 | int m_iDupes; | 66 | int m_iDupes; |
1149 | 66 | double m_dPlayPosAdjust; | 67 | double m_dPlayPosAdjust; |
1150 | 67 | int m_iLatency; | 68 | int m_iLatency; |
1151 | 68 | 69 | ||
1152 | === modified file 'mixxx/src/widget/wspinny.cpp' | |||
1153 | --- mixxx/src/widget/wspinny.cpp 2011-05-12 14:46:18 +0000 | |||
1154 | +++ mixxx/src/widget/wspinny.cpp 2011-07-30 20:21:03 +0000 | |||
1155 | @@ -6,7 +6,7 @@ | |||
1156 | 6 | #include "sharedglcontext.h" | 6 | #include "sharedglcontext.h" |
1157 | 7 | #include "wspinny.h" | 7 | #include "wspinny.h" |
1158 | 8 | 8 | ||
1160 | 9 | WSpinny::WSpinny(QWidget* parent) : QGLWidget(SharedGLContext::getContext(), parent), | 9 | WSpinny::WSpinny(QWidget* parent, VinylControlManager* pVCMan) : QGLWidget(SharedGLContext::getContext(), parent), |
1161 | 10 | m_pBG(NULL), | 10 | m_pBG(NULL), |
1162 | 11 | m_pFG(NULL), | 11 | m_pFG(NULL), |
1163 | 12 | m_pGhost(NULL), | 12 | m_pGhost(NULL), |
1164 | @@ -20,6 +20,12 @@ | |||
1165 | 20 | m_pScratchToggle(NULL), | 20 | m_pScratchToggle(NULL), |
1166 | 21 | m_pScratchPos(NULL), | 21 | m_pScratchPos(NULL), |
1167 | 22 | m_pVinylControlSpeedType(NULL), | 22 | m_pVinylControlSpeedType(NULL), |
1168 | 23 | m_pVinylControlEnabled(NULL), | ||
1169 | 24 | m_bVinylActive(false), | ||
1170 | 25 | m_bSignalActive(true), | ||
1171 | 26 | m_iSize(0), | ||
1172 | 27 | m_iTimerId(0), | ||
1173 | 28 | m_iSignalUpdateTick(0), | ||
1174 | 23 | m_fAngle(0.0f), | 29 | m_fAngle(0.0f), |
1175 | 24 | m_fGhostAngle(0.0f), | 30 | m_fGhostAngle(0.0f), |
1176 | 25 | m_dPausedPosition(0.0f), | 31 | m_dPausedPosition(0.0f), |
1177 | @@ -29,6 +35,10 @@ | |||
1178 | 29 | m_iFullRotations(0), | 35 | m_iFullRotations(0), |
1179 | 30 | m_dPrevTheta(0.) | 36 | m_dPrevTheta(0.) |
1180 | 31 | { | 37 | { |
1181 | 38 | #ifdef __VINYLCONTROL__ | ||
1182 | 39 | m_pVCManager = pVCMan; | ||
1183 | 40 | m_pVinylControl = NULL; | ||
1184 | 41 | #endif | ||
1185 | 32 | //Drag and drop | 42 | //Drag and drop |
1186 | 33 | setAcceptDrops(true); | 43 | setAcceptDrops(true); |
1187 | 34 | } | 44 | } |
1188 | @@ -69,6 +79,13 @@ | |||
1189 | 69 | if (m_pBG && !m_pBG->isNull()) { | 79 | if (m_pBG && !m_pBG->isNull()) { |
1190 | 70 | setFixedSize(m_pBG->size()); | 80 | setFixedSize(m_pBG->size()); |
1191 | 71 | } | 81 | } |
1192 | 82 | |||
1193 | 83 | #ifdef __VINYLCONTROL__ | ||
1194 | 84 | m_iSize = MIXXX_VINYL_SCOPE_SIZE; | ||
1195 | 85 | m_qImage = QImage(m_iSize, m_iSize, QImage::Format_ARGB32); | ||
1196 | 86 | //fill with transparent black | ||
1197 | 87 | m_qImage.fill(qRgba(0,0,0,0)); | ||
1198 | 88 | #endif | ||
1199 | 72 | 89 | ||
1200 | 73 | m_pPlay = new ControlObjectThreadMain(ControlObject::getControl( | 90 | m_pPlay = new ControlObjectThreadMain(ControlObject::getControl( |
1201 | 74 | ConfigKey(group, "play"))); | 91 | ConfigKey(group, "play"))); |
1202 | @@ -92,6 +109,15 @@ | |||
1203 | 92 | ConfigKey(group, "scratch_position_enable"))); | 109 | ConfigKey(group, "scratch_position_enable"))); |
1204 | 93 | m_pScratchPos = new ControlObjectThreadMain(ControlObject::getControl( | 110 | m_pScratchPos = new ControlObjectThreadMain(ControlObject::getControl( |
1205 | 94 | ConfigKey(group, "scratch_position"))); | 111 | ConfigKey(group, "scratch_position"))); |
1206 | 112 | |||
1207 | 113 | Q_ASSERT(m_pPlayPos); | ||
1208 | 114 | Q_ASSERT(m_pDuration); | ||
1209 | 115 | |||
1210 | 116 | //Repaint when visual_playposition changes. | ||
1211 | 117 | connect(m_pVisualPlayPos, SIGNAL(valueChanged(double)), | ||
1212 | 118 | this, SLOT(updateAngle(double))); | ||
1213 | 119 | |||
1214 | 120 | #ifdef __VINYLCONTROL__ | ||
1215 | 95 | m_pVinylControlSpeedType = new ControlObjectThreadMain(ControlObject::getControl( | 121 | m_pVinylControlSpeedType = new ControlObjectThreadMain(ControlObject::getControl( |
1216 | 96 | ConfigKey(group, "vinylcontrol_speed_type"))); | 122 | ConfigKey(group, "vinylcontrol_speed_type"))); |
1217 | 97 | if (m_pVinylControlSpeedType) | 123 | if (m_pVinylControlSpeedType) |
1218 | @@ -99,17 +125,26 @@ | |||
1219 | 99 | //Initialize the rotational speed. | 125 | //Initialize the rotational speed. |
1220 | 100 | this->updateVinylControlSpeed(m_pVinylControlSpeedType->get()); | 126 | this->updateVinylControlSpeed(m_pVinylControlSpeedType->get()); |
1221 | 101 | } | 127 | } |
1228 | 102 | Q_ASSERT(m_pPlayPos); | 128 | m_pVinylControlEnabled = new ControlObjectThreadMain(ControlObject::getControl( |
1229 | 103 | Q_ASSERT(m_pDuration); | 129 | ConfigKey(group, "vinylcontrol_enabled"))); |
1230 | 104 | 130 | m_pSignalEnabled = new ControlObjectThreadMain(ControlObject::getControl( | |
1231 | 105 | //Repaint when visual_playposition changes. | 131 | ConfigKey(group, "vinylcontrol_signal_enabled"))); |
1232 | 106 | connect(m_pVisualPlayPos, SIGNAL(valueChanged(double)), | 132 | m_pRate = new ControlObjectThreadMain(ControlObject::getControl( |
1233 | 107 | this, SLOT(updateAngle(double))); | 133 | ConfigKey(group, "rate"))); |
1234 | 108 | 134 | ||
1235 | 109 | //Match the vinyl control's set RPM so that the spinny widget rotates at the same | 135 | //Match the vinyl control's set RPM so that the spinny widget rotates at the same |
1236 | 110 | //speed as your physical decks, if you're using vinyl control. | 136 | //speed as your physical decks, if you're using vinyl control. |
1237 | 111 | connect(m_pVinylControlSpeedType, SIGNAL(valueChanged(double)), | 137 | connect(m_pVinylControlSpeedType, SIGNAL(valueChanged(double)), |
1238 | 112 | this, SLOT(updateVinylControlSpeed(double))); | 138 | this, SLOT(updateVinylControlSpeed(double))); |
1239 | 139 | |||
1240 | 140 | //Make sure vinyl control proxies are up to date | ||
1241 | 141 | connect(m_pVinylControlEnabled, SIGNAL(valueChanged(double)), | ||
1242 | 142 | this, SLOT(updateVinylControlEnabled(double))); | ||
1243 | 143 | |||
1244 | 144 | //Check the rate to see if we are stopped | ||
1245 | 145 | connect(m_pRate, SIGNAL(valueChanged(double)), | ||
1246 | 146 | this, SLOT(updateRate(double))); | ||
1247 | 147 | #endif | ||
1248 | 113 | } | 148 | } |
1249 | 114 | 149 | ||
1250 | 115 | void WSpinny::paintEvent(QPaintEvent *e) | 150 | void WSpinny::paintEvent(QPaintEvent *e) |
1251 | @@ -121,6 +156,49 @@ | |||
1252 | 121 | if (m_pBG) { | 156 | if (m_pBG) { |
1253 | 122 | p.drawPixmap(0, 0, *m_pBG); | 157 | p.drawPixmap(0, 0, *m_pBG); |
1254 | 123 | } | 158 | } |
1255 | 159 | |||
1256 | 160 | #ifdef __VINYLCONTROL__ | ||
1257 | 161 | // Overlay the signal quality drawing if vinyl is active | ||
1258 | 162 | if (m_bVinylActive && m_bSignalActive) | ||
1259 | 163 | { | ||
1260 | 164 | //reduce cpu load by only updating every 3 times | ||
1261 | 165 | m_iSignalUpdateTick = (m_iSignalUpdateTick + 1) % 3; | ||
1262 | 166 | if (m_iSignalUpdateTick == 0) | ||
1263 | 167 | { | ||
1264 | 168 | unsigned char * buf = m_pVinylControl->getScopeBytemap(); | ||
1265 | 169 | int r,g,b; | ||
1266 | 170 | QColor qual_color = QColor(); | ||
1267 | 171 | float signalQuality = m_pVinylControl->getTimecodeQuality(); | ||
1268 | 172 | |||
1269 | 173 | //color is related to signal quality | ||
1270 | 174 | //hsv: s=1, v=1 | ||
1271 | 175 | //h is the only variable. | ||
1272 | 176 | //h=0 is red, h=120 is green | ||
1273 | 177 | qual_color.setHsv((int)(120.0 * signalQuality), 255, 255); | ||
1274 | 178 | qual_color.getRgb(&r, &g, &b); | ||
1275 | 179 | |||
1276 | 180 | if (buf) { | ||
1277 | 181 | for (int y=0; y<m_iSize; y++) { | ||
1278 | 182 | QRgb *line = (QRgb *)m_qImage.scanLine(y); | ||
1279 | 183 | for(int x=0; x<m_iSize; x++) { | ||
1280 | 184 | //use xwax's bitmap to set alpha data only | ||
1281 | 185 | //adjust alpha by 3/4 so it's not quite so distracting | ||
1282 | 186 | //setpixel is slow, use scanlines instead | ||
1283 | 187 | //m_qImage.setPixel(x, y, qRgba(r,g,b,(int)buf[x+m_iSize*y] * .75)); | ||
1284 | 188 | *line = qRgba(r,g,b,(int)(buf[x+m_iSize*y] * .75)); | ||
1285 | 189 | line++; | ||
1286 | 190 | } | ||
1287 | 191 | } | ||
1288 | 192 | p.drawImage(this->rect(), m_qImage); | ||
1289 | 193 | } | ||
1290 | 194 | } | ||
1291 | 195 | else | ||
1292 | 196 | { | ||
1293 | 197 | //draw the last good image | ||
1294 | 198 | p.drawImage(this->rect(), m_qImage); | ||
1295 | 199 | } | ||
1296 | 200 | } | ||
1297 | 201 | #endif | ||
1298 | 124 | 202 | ||
1299 | 125 | //To rotate the foreground pixmap around the center of the image, | 203 | //To rotate the foreground pixmap around the center of the image, |
1300 | 126 | //we use the classic trick of translating the coordinate system such that | 204 | //we use the classic trick of translating the coordinate system such that |
1301 | @@ -147,7 +225,7 @@ | |||
1302 | 147 | //Rotate back to the playback position (not the ghost positon), | 225 | //Rotate back to the playback position (not the ghost positon), |
1303 | 148 | //and draw the beat marks from there. | 226 | //and draw the beat marks from there. |
1304 | 149 | p.restore(); | 227 | p.restore(); |
1306 | 150 | 228 | ||
1307 | 151 | /* | 229 | /* |
1308 | 152 | //Draw a line where the next 4 beats are | 230 | //Draw a line where the next 4 beats are |
1309 | 153 | double bpm = m_pBPM->get(); | 231 | double bpm = m_pBPM->get(); |
1310 | @@ -247,6 +325,29 @@ | |||
1311 | 247 | void WSpinny::updateAngle(double playpos) | 325 | void WSpinny::updateAngle(double playpos) |
1312 | 248 | { | 326 | { |
1313 | 249 | m_fAngle = calculateAngle(playpos); | 327 | m_fAngle = calculateAngle(playpos); |
1314 | 328 | |||
1315 | 329 | // if we had the timer going, kill it | ||
1316 | 330 | if (m_iTimerId != 0) { | ||
1317 | 331 | killTimer(m_iTimerId); | ||
1318 | 332 | m_iTimerId = 0; | ||
1319 | 333 | } | ||
1320 | 334 | update(); | ||
1321 | 335 | } | ||
1322 | 336 | |||
1323 | 337 | void WSpinny::updateRate(double rate) | ||
1324 | 338 | { | ||
1325 | 339 | //if rate is zero, updateAngle won't get called, | ||
1326 | 340 | if (rate == 0.0 && m_bVinylActive) | ||
1327 | 341 | { | ||
1328 | 342 | if (m_iTimerId == 0) | ||
1329 | 343 | { | ||
1330 | 344 | m_iTimerId = startTimer(10); | ||
1331 | 345 | } | ||
1332 | 346 | } | ||
1333 | 347 | } | ||
1334 | 348 | |||
1335 | 349 | void WSpinny::timerEvent(QTimerEvent *event) | ||
1336 | 350 | { | ||
1337 | 250 | update(); | 351 | update(); |
1338 | 251 | } | 352 | } |
1339 | 252 | 353 | ||
1340 | @@ -266,6 +367,60 @@ | |||
1341 | 266 | m_dRotationsPerSecond = rpm/60.; | 367 | m_dRotationsPerSecond = rpm/60.; |
1342 | 267 | } | 368 | } |
1343 | 268 | 369 | ||
1344 | 370 | void WSpinny::updateVinylControlEnabled(double enabled) | ||
1345 | 371 | { | ||
1346 | 372 | #ifdef __VINYLCONTROL__ | ||
1347 | 373 | if (enabled) | ||
1348 | 374 | { | ||
1349 | 375 | if (m_pVinylControl == NULL) | ||
1350 | 376 | { | ||
1351 | 377 | QList<VinylControlProxy*> VCProxiesList = m_pVCManager->vinylControlProxies(); | ||
1352 | 378 | if (m_group == "[Channel1]") | ||
1353 | 379 | { | ||
1354 | 380 | m_pVinylControl = VCProxiesList.value(0); | ||
1355 | 381 | } | ||
1356 | 382 | else if (m_group == "[Channel2]") | ||
1357 | 383 | { | ||
1358 | 384 | m_pVinylControl = VCProxiesList.value(1); | ||
1359 | 385 | } | ||
1360 | 386 | |||
1361 | 387 | if (m_pVinylControl != NULL) | ||
1362 | 388 | { | ||
1363 | 389 | m_bVinylActive = true; | ||
1364 | 390 | m_bSignalActive = m_pSignalEnabled->get(); | ||
1365 | 391 | connect(m_pVinylControl, SIGNAL(destroyed()), | ||
1366 | 392 | this, SLOT(invalidateVinylControl())); | ||
1367 | 393 | } | ||
1368 | 394 | } | ||
1369 | 395 | else | ||
1370 | 396 | { | ||
1371 | 397 | m_bVinylActive = true; | ||
1372 | 398 | } | ||
1373 | 399 | } | ||
1374 | 400 | else | ||
1375 | 401 | { | ||
1376 | 402 | m_bVinylActive = false; | ||
1377 | 403 | //don't need the timer anymore | ||
1378 | 404 | if (m_iTimerId != 0) | ||
1379 | 405 | { | ||
1380 | 406 | killTimer(m_iTimerId); | ||
1381 | 407 | } | ||
1382 | 408 | // draw once more to erase signal | ||
1383 | 409 | update(); | ||
1384 | 410 | } | ||
1385 | 411 | #endif | ||
1386 | 412 | } | ||
1387 | 413 | |||
1388 | 414 | void WSpinny::invalidateVinylControl() | ||
1389 | 415 | { | ||
1390 | 416 | #ifdef __VINYLCONTROL__ | ||
1391 | 417 | m_bVinylActive = false; | ||
1392 | 418 | m_pVinylControl = NULL; | ||
1393 | 419 | update(); | ||
1394 | 420 | #endif | ||
1395 | 421 | } | ||
1396 | 422 | |||
1397 | 423 | |||
1398 | 269 | void WSpinny::mouseMoveEvent(QMouseEvent * e) | 424 | void WSpinny::mouseMoveEvent(QMouseEvent * e) |
1399 | 270 | { | 425 | { |
1400 | 271 | int y = e->y(); | 426 | int y = e->y(); |
1401 | @@ -301,7 +456,7 @@ | |||
1402 | 301 | //qDebug() << "c t:" << theta << "pt:" << m_dPrevTheta << | 456 | //qDebug() << "c t:" << theta << "pt:" << m_dPrevTheta << |
1403 | 302 | // "icr" << m_iFullRotations; | 457 | // "icr" << m_iFullRotations; |
1404 | 303 | 458 | ||
1406 | 304 | if (e->buttons() & Qt::LeftButton) | 459 | if (e->buttons() & Qt::LeftButton && !m_bVinylActive) |
1407 | 305 | { | 460 | { |
1408 | 306 | //Convert deltaTheta into a percentage of song length. | 461 | //Convert deltaTheta into a percentage of song length. |
1409 | 307 | double absPos = calculatePositionFromAngle(theta); | 462 | double absPos = calculatePositionFromAngle(theta); |
1410 | @@ -325,6 +480,10 @@ | |||
1411 | 325 | 480 | ||
1412 | 326 | m_iStartMouseX = x; | 481 | m_iStartMouseX = x; |
1413 | 327 | m_iStartMouseY = y; | 482 | m_iStartMouseY = y; |
1414 | 483 | |||
1415 | 484 | //don't do anything if vinyl control is active | ||
1416 | 485 | if (m_bVinylActive) | ||
1417 | 486 | return; | ||
1418 | 328 | 487 | ||
1419 | 329 | if (e->button() == Qt::LeftButton) | 488 | if (e->button() == Qt::LeftButton) |
1420 | 330 | { | 489 | { |
1421 | @@ -394,7 +553,7 @@ | |||
1422 | 394 | Q_UNUSED(e); //ditch unused param warning | 553 | Q_UNUSED(e); //ditch unused param warning |
1423 | 395 | 554 | ||
1424 | 396 | /* | 555 | /* |
1426 | 397 | double wheelDirection = ((QWheelEvent *)e)->delta() / 120.; | 556 | double wheelDirection = ((QWheelEvent *)e)->delta() / 120.; |
1427 | 398 | double newValue = getValue() + (wheelDirection); | 557 | double newValue = getValue() + (wheelDirection); |
1428 | 399 | this->updateValue(newValue); | 558 | this->updateValue(newValue); |
1429 | 400 | 559 | ||
1430 | 401 | 560 | ||
1431 | === modified file 'mixxx/src/widget/wspinny.h' | |||
1432 | --- mixxx/src/widget/wspinny.h 2011-05-11 04:38:17 +0000 | |||
1433 | +++ mixxx/src/widget/wspinny.h 2011-07-30 20:21:03 +0000 | |||
1434 | @@ -4,6 +4,11 @@ | |||
1435 | 4 | 4 | ||
1436 | 5 | #include <QGLWidget> | 5 | #include <QGLWidget> |
1437 | 6 | #include "wwidget.h" | 6 | #include "wwidget.h" |
1438 | 7 | #include "vinylcontrol/vinylcontrolmanager.h" | ||
1439 | 8 | #ifdef __VINYLCONTROL__ | ||
1440 | 9 | #include "vinylcontrol/vinylcontrolproxy.h" | ||
1441 | 10 | #include "vinylcontrol/vinylcontrol.h" | ||
1442 | 11 | #endif | ||
1443 | 7 | 12 | ||
1444 | 8 | class ControlObjectThreadMain; | 13 | class ControlObjectThreadMain; |
1445 | 9 | 14 | ||
1446 | @@ -11,15 +16,18 @@ | |||
1447 | 11 | { | 16 | { |
1448 | 12 | Q_OBJECT | 17 | Q_OBJECT |
1449 | 13 | public: | 18 | public: |
1451 | 14 | WSpinny(QWidget* parent); | 19 | WSpinny(QWidget* parent, VinylControlManager* pVCMan); |
1452 | 15 | ~WSpinny(); | 20 | ~WSpinny(); |
1453 | 16 | void setup(QDomNode node, QString group); | 21 | void setup(QDomNode node, QString group); |
1454 | 17 | void dragEnterEvent(QDragEnterEvent *event); | 22 | void dragEnterEvent(QDragEnterEvent *event); |
1455 | 18 | void dropEvent(QDropEvent *event); | 23 | void dropEvent(QDropEvent *event); |
1456 | 19 | public slots: | 24 | public slots: |
1457 | 20 | void updateAngle(double); | 25 | void updateAngle(double); |
1458 | 26 | void updateRate(double); | ||
1459 | 21 | void updateAngleForGhost(); | 27 | void updateAngleForGhost(); |
1460 | 22 | void updateVinylControlSpeed(double rpm); | 28 | void updateVinylControlSpeed(double rpm); |
1461 | 29 | void updateVinylControlEnabled(double enabled); | ||
1462 | 30 | void invalidateVinylControl(); | ||
1463 | 23 | signals: | 31 | signals: |
1464 | 24 | void trackDropped(QString filename, QString group); | 32 | void trackDropped(QString filename, QString group); |
1465 | 25 | protected: | 33 | protected: |
1466 | @@ -29,6 +37,7 @@ | |||
1467 | 29 | void mousePressEvent(QMouseEvent * e); | 37 | void mousePressEvent(QMouseEvent * e); |
1468 | 30 | void mouseReleaseEvent(QMouseEvent * e); | 38 | void mouseReleaseEvent(QMouseEvent * e); |
1469 | 31 | void wheelEvent(QWheelEvent *e); | 39 | void wheelEvent(QWheelEvent *e); |
1470 | 40 | void timerEvent(QTimerEvent* event); | ||
1471 | 32 | 41 | ||
1472 | 33 | double calculateAngle(double playpos); | 42 | double calculateAngle(double playpos); |
1473 | 34 | int calculateFullRotations(double playpos); | 43 | int calculateFullRotations(double playpos); |
1474 | @@ -47,7 +56,22 @@ | |||
1475 | 47 | ControlObjectThreadMain* m_pScratch; | 56 | ControlObjectThreadMain* m_pScratch; |
1476 | 48 | ControlObjectThreadMain* m_pScratchToggle; | 57 | ControlObjectThreadMain* m_pScratchToggle; |
1477 | 49 | ControlObjectThreadMain* m_pScratchPos; | 58 | ControlObjectThreadMain* m_pScratchPos; |
1478 | 59 | ControlObjectThreadMain* m_pRate; | ||
1479 | 50 | ControlObjectThreadMain* m_pVinylControlSpeedType; | 60 | ControlObjectThreadMain* m_pVinylControlSpeedType; |
1480 | 61 | ControlObjectThreadMain* m_pVinylControlEnabled; | ||
1481 | 62 | ControlObjectThreadMain* m_pSignalEnabled; | ||
1482 | 63 | |||
1483 | 64 | #ifdef __VINYLCONTROL__ | ||
1484 | 65 | VinylControlManager* m_pVCManager; | ||
1485 | 66 | VinylControlProxy* m_pVinylControl; | ||
1486 | 67 | #endif | ||
1487 | 68 | bool m_bVinylActive; | ||
1488 | 69 | bool m_bSignalActive; | ||
1489 | 70 | QImage m_qImage; | ||
1490 | 71 | int m_iSize; | ||
1491 | 72 | int m_iTimerId; | ||
1492 | 73 | int m_iSignalUpdateTick; | ||
1493 | 74 | |||
1494 | 51 | QString m_group; | 75 | QString m_group; |
1495 | 52 | float m_fAngle; //Degrees | 76 | float m_fAngle; //Degrees |
1496 | 53 | float m_fGhostAngle; | 77 | float m_fGhostAngle; |
Changes in trunk won't go out until after 1.10, should this be retargeted at
LP:mixxx/1.10?
Bill
On Jul 30, 2011 3:21 PM, "Owen Williams" <email address hidden> wrote: /bugs.launchpad .net/mixxx/ +bug/528113 /bugs.launchpad .net/mixxx/ +bug/624925 /bugs.launchpad .net/mixxx/ +bug/624931 /bugs.launchpad .net/mixxx/ +bug/669289 /bugs.launchpad .net/mixxx/ +bug/672758 /code.launchpad .net/~ywwg/ mixxx/features_ xwax2/+ merge/69904 /code.launchpad .net/~ywwg/ mixxx/features_ xwax2/+ merge/69904 lib/xwax/ timecoder. c' xwax/timecoder. c 2011-05-25 19:52:14 +0000 xwax/timecoder. c 2011-07-30 20:21:03 +0000 >resolution * tc->speed); >resolution * lib/xwax/ timecoder_ win32.cpp' xwax/timecoder_ win32.cpp 2011-05-25 19:52:14 +0000 xwax/timecoder_ win32.cpp 2011-07-30 20:21:03 +0000 >resolution * tc->speed); >resolution * src/dlgprefnovi nyldlg. ui' dlgprefnovinyld lg.ui 2011-05-26 10:22:03 +0000 dlgprefnovinyld lg.ui 2011-07-30 20:21:03 +0000
>
> Owen Williams has proposed merging lp:~ywwg/mixxx/features_xwax2 into
lp:mixxx.
>
> Requested reviews:
> RJ Ryan (rryan)
> Related bugs:
> Bug #528113 in Mixxx: "Vinyl control signal quality doesn't refresh"
> https:/
> Bug #624925 in Mixxx: "Mixxx should switch to relative mode if looping is
enabled in absolute mode"
> https:/
> Bug #624931 in Mixxx: "Scale BPM display does not work for vinyl control
in Mixxx 1.8 and below"
> https:/
> Bug #669289 in Mixxx: "Enable needle cueing in relative mode"
> https:/
> Bug #672758 in Mixxx: "Support 45 rpm vinyl mode"
> https:/
>
> For more details, see:
> https:/
>
> I've continued working in features_xwax2 to make some fixes and updates to
the vinyl control code. It would be nice if some of these fixes could go
into trunk, other new features can probably wait if it breaks freeze too
badly.
>
> New Features:
> * Show signal quality inside WSpinny
> * More pleasant waveform stretching
>
> Fixes:
> * fix vinylsoundemu and take equivalent code out of EBSL
> * when loading a track, update track duration with correct value
> * keep vinyl control enabled when changing vinyl control preferences
> * Absolute mode fixes (better for scratching)
> --
> https:/
> Your team Mixxx Development Team is subscribed to branch lp:mixxx.
>
> === modified file 'mixxx/
> --- mixxx/lib/
> +++ mixxx/lib/
> @@ -519,7 +519,7 @@
>
> if (r >= 0) {
> //normalize position to milliseconds, not timecode steps --
Owen
> - r = r * 1000 / (tc->def-
> + r = (float)r * (1000.0 / (tc->def-
tc->speed));
> if (when)
> *when = tc->timecode_ticker * tc->dt;
> return r;
>
> === modified file 'mixxx/
> --- mixxx/lib/
> +++ mixxx/lib/
> @@ -521,7 +521,7 @@
>
> if (r >= 0) {
> //normalize position to milliseconds, not timecode steps --
Owen
> - r = r * 1000 / (tc->def-
> + r = (float)r * (1000.0 / (tc->def-
tc->speed));
> if (when)
> *when = tc->timecode_ticker * tc->dt;
> return r;
>
> === modified file 'mixxx/
> --- mixxx/src/
> +++ mixxx/src/
> @@ -9,8 +9,13 @@
> <rect>
> <x>0</x>
> <y>0</y>
> +<<<<<<< TREE
> <width>461</width>
> <height...