summaryrefslogtreecommitdiffstats
path: root/src/vinylcontrol/vinylcontrolxwax.cpp
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2014-12-29 09:04:23 +0100
committerDaniel Schürmann <daschuer@mixxx.org>2014-12-29 09:04:23 +0100
commit37b6280d72519b6d90f07660f7122ac67a502f49 (patch)
treed36e389aad277d82b977f2f24817154b320c1d87 /src/vinylcontrol/vinylcontrolxwax.cpp
parentfa4f26745dbf5b31e5b4129435926aadecf56692 (diff)
renamed m_pVCRate to controlScratch and make it a ControlObjectSlave
Diffstat (limited to 'src/vinylcontrol/vinylcontrolxwax.cpp')
-rw-r--r--src/vinylcontrol/vinylcontrolxwax.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vinylcontrol/vinylcontrolxwax.cpp b/src/vinylcontrol/vinylcontrolxwax.cpp
index 79bee58a3f..1cc13528d2 100644
--- a/src/vinylcontrol/vinylcontrolxwax.cpp
+++ b/src/vinylcontrol/vinylcontrolxwax.cpp
@@ -25,6 +25,7 @@
#include "vinylcontrol/vinylcontrolxwax.h"
#include "util/timer.h"
#include "controlobjectthread.h"
+#include "controlobjectslave.h"
#include "controlobject.h"
#include "sampleutil.h"
#include "util/math.h"
@@ -173,7 +174,7 @@ VinylControlXwax::~VinylControlXwax() {
// VinylControlProcessor so we are probably leaking the LUTs.
s_bLUTInitialized = false;
- controlScratch->slotSet(0.0);
+ m_pVCRate->set(0.0);
}
//static
@@ -390,7 +391,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
m_bTrackSelectMode = true;
togglePlayButton(false);
resetSteadyPitch(0.0, 0.0);
- controlScratch->slotSet(0.0);
+ m_pVCRate->set(0.0);
}
doTrackSelection(true, dVinylPitch, m_iPosition);
}
@@ -436,7 +437,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
double newScratch = reportedPlayButton ? rateDir->get() *
(rateSlider->get() * rateRange->get()) + 1.0 : 0.0;
- controlScratch->slotSet(newScratch);
+ m_pVCRate->set(newScratch);
//is there any reason we'd need to do anything else?
return;
@@ -505,7 +506,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
//end of track, force stop
togglePlayButton(false);
resetSteadyPitch(0.0, 0.0);
- controlScratch->slotSet(0.0);
+ m_pVCRate->set(0.0);
m_iPitchRingPos = 0;
m_iPitchRingFilled = 0;
return;
@@ -532,7 +533,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
//end of track, force stop
togglePlayButton(false);
resetSteadyPitch(0.0, 0.0);
- controlScratch->slotSet(0.0);
+ m_pVCRate->set(0.0);
m_iPitchRingPos = 0;
m_iPitchRingFilled = 0;
return;
@@ -582,7 +583,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
averagePitch = dVinylPitch;
}
- controlScratch->slotSet(averagePitch + dDriftControl);
+ m_pVCRate->set(averagePitch + dDriftControl);
if (m_iPosition != -1 && reportedPlayButton && uiUpdateTime(filePosition)) {
double true_pitch = averagePitch + dDriftControl;
double pitch_difference = true_pitch - m_dDisplayPitch;
@@ -630,7 +631,7 @@ void VinylControlXwax::analyzeSamples(CSAMPLE* pSamples, size_t nFrames) {
//We are not playing any more
togglePlayButton(false);
resetSteadyPitch(0.0, 0.0);
- controlScratch->slotSet(0.0);
+ m_pVCRate->set(0.0);
//resetSteadyPitch(dVinylPitch, filePosition);
// Notify the UI that the timecode quality is garbage/missing.
m_fTimecodeQuality = 0.0f;
@@ -656,9 +657,9 @@ void VinylControlXwax::enableConstantMode() {
m_iVCMode = MIXXX_VCMODE_CONSTANT;
mode->slotSet((double)m_iVCMode);
togglePlayButton(true);
- double rate = controlScratch->get();
+ double rate = m_pVCRate->get();
rateSlider->slotSet(rateDir->get() * (fabs(rate) - 1.0) / rateRange->get());
- controlScratch->slotSet(rate);
+ m_pVCRate->set(rate);
}
void VinylControlXwax::enableConstantMode(double rate) {
@@ -667,7 +668,7 @@ void VinylControlXwax::enableConstantMode(double rate) {
mode->slotSet((double)m_iVCMode);
togglePlayButton(true);
rateSlider->slotSet(rateDir->get() * (fabs(rate) - 1.0) / rateRange->get());
- controlScratch->slotSet(rate);
+ m_pVCRate->set(rate);
}
void VinylControlXwax::disableRecordEndMode() {
@@ -774,8 +775,8 @@ bool VinylControlXwax::checkEnabled(bool was, bool is) {
//the track will keep playing at the previous rate.
//This allows for single-deck control, dj handoffs, etc.
- togglePlayButton(playButton->get() || fabs(controlScratch->get()) > 0.05);
- controlScratch->slotSet(rateDir->get() * (rateSlider->get() * rateRange->get()) + 1.0);
+ togglePlayButton(playButton->get() || fabs(m_pVCRate->get()) > 0.05);
+ m_pVCRate->set(rateDir->get() * (rateSlider->get() * rateRange->get()) + 1.0);
resetSteadyPitch(0.0, 0.0);
m_bForceResync = true;
if (!was)