-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
engine/controls: Remove superfluous notifySeek implementations
- Loading branch information
Showing
14 changed files
with
55 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
// enginecontrol.h | ||
// Created 7/5/2009 by RJ Ryan ([email protected]) | ||
|
||
#ifndef ENGINECONTROL_H | ||
#define ENGINECONTROL_H | ||
#pragma once | ||
|
||
#include <gtest/gtest_prod.h> | ||
|
||
|
@@ -21,54 +17,62 @@ class EngineBuffer; | |
|
||
const int kNoTrigger = -1; | ||
|
||
/** | ||
* EngineControl is an abstract base class for objects which implement | ||
* functionality pertaining to EngineBuffer. An EngineControl is meant to be a | ||
* succinct implementation of a given EngineBuffer feature. Previously, | ||
* EngineBuffer was an example of feature creep -- this is the result. | ||
* | ||
* When writing an EngineControl class, the following two properties hold: | ||
* | ||
* EngineControl::process will only be called during an EngineBuffer::process | ||
* callback from the sound engine. This implies that any ControlObject accesses | ||
* made in either of these methods are mutually exclusive, since one is | ||
* exclusively in the call graph of the other. | ||
*/ | ||
/// EngineControl is an abstract base class for objects which implement | ||
/// functionality pertaining to EngineBuffer. An EngineControl is meant to be a | ||
/// succinct implementation of a given EngineBuffer feature. | ||
class EngineControl : public QObject { | ||
Q_OBJECT | ||
public: | ||
EngineControl(QString group, | ||
UserSettingsPointer pConfig); | ||
~EngineControl() override; | ||
|
||
// Called by EngineBuffer::process every latency period. See the above | ||
// comments for information about guarantees that hold during this call. An | ||
// EngineControl can perform any upkeep operations that are necessary during | ||
// this call. | ||
virtual void process(const double dRate, | ||
const double dCurrentSample, | ||
const int iBufferSize); | ||
|
||
// hintReader allows the EngineControl to provide hints to the reader to | ||
// indicate that the given portion of a song is a potential imminent seek | ||
// target. | ||
virtual void hintReader(HintVector* pHintList); | ||
EngineControl(QString group, UserSettingsPointer pConfig); | ||
QString getGroup() const; | ||
|
||
virtual void setEngineMaster(EngineMaster* pEngineMaster); | ||
void setEngineBuffer(EngineBuffer* pEngineBuffer); | ||
virtual void setCurrentSample(const double dCurrentSample, | ||
const double dTotalSamples, const double dTrackSampleRate); | ||
QString getGroup() const; | ||
|
||
// Called to collect player features for effects processing. | ||
virtual void setCurrentSample( | ||
const double dCurrentSample, | ||
const double dTotalSamples, | ||
const double dTrackSampleRate); | ||
|
||
/// Called whenever a seek occurs to allow the EngineControl to respond. | ||
virtual void notifySeek(double dNewPlaypos) { | ||
Q_UNUSED(dNewPlaypos); | ||
}; | ||
|
||
/// Called by EngineBuffer::process every latency period. An EngineControl | ||
/// can perform any necessary upkeep operations during this call. | ||
/// | ||
/// EngineControl::process will only be called during an | ||
/// EngineBuffer::process callback from the sound engine. This implies that | ||
/// any ControlObject accesses made in either of these methods are mutually | ||
/// exclusive, since one is exclusively in the call graph of the other. | ||
virtual void process( | ||
const double dRate, | ||
const double dCurrentSample, | ||
const int iBufferSize) { | ||
Q_UNUSED(dRate); | ||
Q_UNUSED(dCurrentSample); | ||
Q_UNUSED(iBufferSize); | ||
}; | ||
|
||
/// Called to collect player features for effects processing | ||
virtual void collectFeatureState(GroupFeatureState* pGroupFeatures) const { | ||
Q_UNUSED(pGroupFeatures); | ||
} | ||
|
||
// Called whenever a seek occurs to allow the EngineControl to respond. | ||
virtual void notifySeek(double dNewPlaypos); | ||
virtual void trackLoaded(TrackPointer pNewTrack); | ||
virtual void trackBeatsUpdated(mixxx::BeatsPointer pBeats); | ||
virtual void trackLoaded(TrackPointer pNewTrack) { | ||
Q_UNUSED(pNewTrack); | ||
} | ||
virtual void trackBeatsUpdated(mixxx::BeatsPointer pBeats) { | ||
Q_UNUSED(pBeats); | ||
} | ||
|
||
/// hintReader allows the EngineControl to provide hints to the reader to | ||
/// indicate that the given portion of a song is a potential imminent seek | ||
/// target. | ||
virtual void hintReader(HintVector* pHintList) { | ||
Q_UNUSED(pHintList); | ||
}; | ||
|
||
protected: | ||
struct SampleOfTrack { | ||
|
@@ -82,9 +86,9 @@ class EngineControl : public QObject { | |
} | ||
void seek(double fractionalPosition); | ||
void seekAbs(double sample); | ||
// Seek to an exact sample and don't allow quantizing adjustment. | ||
/// Seek to an exact sample and don't allow quantizing adjustment. | ||
void seekExact(double sample); | ||
// Returns an EngineBuffer to target for syncing. Returns nullptr if none found | ||
/// Returns an EngineBuffer to target for syncing. Returns nullptr if none found | ||
EngineBuffer* pickSyncTarget(); | ||
|
||
UserSettingsPointer getConfig(); | ||
|
@@ -108,5 +112,3 @@ class EngineControl : public QObject { | |
FRIEND_TEST(LoopingControlTest, LoopResizeSeek); | ||
FRIEND_TEST(LoopingControlTest, Beatjump_JumpsByBeats); | ||
}; | ||
|
||
#endif /* ENGINECONTROL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters