Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert end of track #3867

Merged
merged 3 commits into from
May 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,12 @@ void EngineBuffer::updateIndicators(double speed, int iBufferSize) {
speed = 0;
}

// Report fractional playpos to SyncControl.
// TODO(rryan) It's kind of hacky that this is in updateIndicators but it
// prevents us from computing fFractionalPlaypos multiple times per
// EngineBuffer::process().
m_pSyncControl->reportTrackPosition(fFractionalPlaypos);

// Update indicators that are only updated after every
// sampleRate/kiUpdateRate samples processed. (e.g. playposSlider)
if (m_iSamplesSinceLastIndicatorUpdate >
Expand Down
8 changes: 8 additions & 0 deletions src/engine/sync/synccontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ void SyncControl::setInstantaneousBpm(double bpm) {
m_pBpmControl->setInstantaneousBpm(bpm * m_masterBpmAdjustFactor);
}

void SyncControl::reportTrackPosition(double fractionalPlaypos) {
// If we're close to the end, and master, disable master so we don't stop
// the party.
if (isMaster(getSyncMode()) && fractionalPlaypos >= 1.0) {
m_pChannel->getEngineBuffer()->requestSyncMode(SYNC_FOLLOWER);
}
}

// called from an engine worker thread
void SyncControl::trackLoaded(TrackPointer pNewTrack) {
mixxx::BeatsPointer pBeats;
Expand Down
1 change: 1 addition & 0 deletions src/engine/sync/synccontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class SyncControl : public EngineControl, public Syncable {

void setEngineControls(RateControl* pRateControl, BpmControl* pBpmControl);

void reportTrackPosition(double fractionalPlaypos);
void reportPlayerSpeed(double speed, bool scratching);
void notifySeek(double dNewPlaypos) override;
void trackLoaded(TrackPointer pNewTrack) override;
Expand Down