Skip to content

Commit

Permalink
engine/controls: Remove superfluous notifySeek implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Aug 19, 2020
1 parent a90062c commit 7d462c4
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 57 deletions.
5 changes: 0 additions & 5 deletions src/engine/controls/bpmcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,11 +927,6 @@ void BpmControl::slotUpdateRateSlider(double value) {
m_pRateRatio->set(dRateRatio);
}

void BpmControl::notifySeek(double dNewPlaypos) {
EngineControl::notifySeek(dNewPlaypos);
updateBeatDistance();
}

// called from an engine worker thread
void BpmControl::trackLoaded(TrackPointer pNewTrack) {
mixxx::BeatsPointer pBeats;
Expand Down
1 change: 0 additions & 1 deletion src/engine/controls/bpmcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class BpmControl : public EngineControl {
static double shortestPercentageChange(const double& current_percentage,
const double& target_percentage);
double getRateRatio() const;
void notifySeek(double dNewPlaypos) override;
void trackLoaded(TrackPointer pNewTrack) override;
void trackBeatsUpdated(mixxx::BeatsPointer pBeats) override;

Expand Down
6 changes: 0 additions & 6 deletions src/engine/controls/enginecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ void EngineControl::seek(double sample) {
}
}

void EngineControl::notifySeek(double dNewPlaypos) {
SampleOfTrack sot = m_sampleOfTrack.getValue();
sot.current = dNewPlaypos;
m_sampleOfTrack.setValue(sot);
}

EngineBuffer* EngineControl::pickSyncTarget() {
EngineMaster* pMaster = getEngineMaster();
if (!pMaster) {
Expand Down
7 changes: 5 additions & 2 deletions src/engine/controls/enginecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ class EngineControl : public QObject {
Q_UNUSED(pGroupFeatures);
}

// Called whenever a seek occurs to allow the EngineControl to respond.
virtual void notifySeek(double dNewPlaypos);
/// Called whenever a seek occurs to allow the EngineControl to respond.
virtual void notifySeek(double dNewPlaypos) {
Q_UNUSED(dNewPlaypos);
};

virtual void trackLoaded(TrackPointer pNewTrack);
virtual void trackBeatsUpdated(mixxx::BeatsPointer pBeats);

Expand Down
1 change: 0 additions & 1 deletion src/engine/controls/loopingcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,6 @@ void LoopingControl::notifySeek(double dNewPlaypos) {
setLoopingEnabled(false);
}
}
EngineControl::notifySeek(dNewPlaypos);
}

void LoopingControl::setLoopingEnabled(bool enabled) {
Expand Down
5 changes: 0 additions & 5 deletions src/engine/controls/quantizecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ void QuantizeControl::setCurrentSample(const double dCurrentSample,
playPosChanged(dCurrentSample);
}

void QuantizeControl::notifySeek(double dNewPlaypos) {
EngineControl::notifySeek(dNewPlaypos);
playPosChanged(dNewPlaypos);
}

void QuantizeControl::playPosChanged(double dNewPlaypos) {
// We only need to update the prev or next if the current sample is
// out of range of the existing beat positions or if we've been forced to
Expand Down
7 changes: 4 additions & 3 deletions src/engine/controls/quantizecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ class QuantizeControl : public EngineControl {
QuantizeControl(QString group, UserSettingsPointer pConfig);
~QuantizeControl() override;

void setCurrentSample(const double dCurrentSample,
const double dTotalSamples, const double dTrackSampleRate) override;
void notifySeek(double dNewPlaypos) override;
void setCurrentSample(
const double dCurrentSample,
const double dTotalSamples,
const double dTrackSampleRate) override;
void trackLoaded(TrackPointer pNewTrack) override;
void trackBeatsUpdated(mixxx::BeatsPointer pBeats) override;

Expand Down
5 changes: 0 additions & 5 deletions src/engine/controls/ratecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,6 @@ void RateControl::resetRateTemp(void)
setRateTemp(0.0);
}

void RateControl::notifySeek(double playPos) {
m_pScratchController->notifySeek(playPos);
EngineControl::notifySeek(playPos);
}

bool RateControl::isReverseButtonPressed() {
if (m_pReverseButton) {
return m_pReverseButton->toBool();
Expand Down
1 change: 0 additions & 1 deletion src/engine/controls/ratecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class RateControl : public EngineControl {
// Set Rate Ramp Sensitivity
static void setRateRampSensitivity(int);
static int getRateRampSensitivity();
void notifySeek(double dNewPlaypos) override;
bool isReverseButtonPressed();

public slots:
Expand Down
6 changes: 0 additions & 6 deletions src/engine/positionscratchcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,3 @@ bool PositionScratchController::isEnabled() {
double PositionScratchController::getRate() {
return m_dRate;
}

void PositionScratchController::notifySeek(double currentSample) {
// scratching continues after seek due to calculating the relative distance traveled
// in m_dPositionDeltaSum
m_dLastPlaypos = currentSample;
}
1 change: 0 additions & 1 deletion src/engine/positionscratchcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class PositionScratchController : public QObject {
int iBufferSize, double baserate);
bool isEnabled();
double getRate();
void notifySeek(double currentSample);

private:
const QString m_group;
Expand Down
7 changes: 0 additions & 7 deletions src/engine/sync/synccontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,6 @@ void SyncControl::reportPlayerSpeed(double speed, bool scratching) {
m_pEngineSync->notifyInstantaneousBpmChanged(this, instantaneous_bpm);
}

void SyncControl::notifySeek(double dNewPlaypos) {
// qDebug() << "SyncControl::notifySeek" << dNewPlaypos;
EngineControl::notifySeek(dNewPlaypos);
m_pBpmControl->notifySeek(dNewPlaypos);
updateTargetBeatDistance();
}

double SyncControl::fileBpm() const {
mixxx::BeatsPointer pBeats = m_pBeats;
if (pBeats) {
Expand Down
1 change: 0 additions & 1 deletion src/engine/sync/synccontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class SyncControl : public EngineControl, public Syncable {

void reportTrackPosition(double fractionalPlaypos);
void reportPlayerSpeed(double speed, bool scratching);
void notifySeek(double dNewPlaypos) override;
void trackLoaded(TrackPointer pNewTrack) override;
void trackBeatsUpdated(mixxx::BeatsPointer pBeats) override;

Expand Down
13 changes: 0 additions & 13 deletions src/test/readaheadmanager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ class StubLoopControl : public LoopingControl {
return m_triggerReturnValues.takeFirst();
}

// hintReader has no effect in this stubbed class
void hintReader(HintVector* pHintList) override {
Q_UNUSED(pHintList);
}

void notifySeek(double dNewPlaypos) override {
Q_UNUSED(dNewPlaypos);
}

void trackLoaded(TrackPointer pTrack) override {
Q_UNUSED(pTrack);
}

protected:
QList<double> m_triggerReturnValues;
QList<double> m_targetReturnValues;
Expand Down

0 comments on commit 7d462c4

Please sign in to comment.