Skip to content

Commit

Permalink
Use override keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Mar 30, 2022
1 parent c4b081a commit 7f0ba01
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 31 deletions.
18 changes: 10 additions & 8 deletions src/engine/channels/engineaux.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,33 @@ class EngineAux : public EngineChannel, public AudioDestination {
Q_OBJECT
public:
EngineAux(const ChannelHandleAndGroup& handleGroup, EffectsManager* pEffectsManager);
virtual ~EngineAux();
~EngineAux() override;

ActiveState updateActiveState() override;

/// Called by EngineMaster whenever is requesting a new buffer of audio.
virtual void process(CSAMPLE* pOutput, const int iBufferSize);
virtual void collectFeatures(GroupFeatureState* pGroupFeatures) const;
virtual void postProcess(const int iBufferSize) { Q_UNUSED(iBufferSize) }
void process(CSAMPLE* pOutput, const int iBufferSize) override;
void collectFeatures(GroupFeatureState* pGroupFeatures) const override;
void postProcess(const int iBufferSize) override {
Q_UNUSED(iBufferSize)
}

/// This is called by SoundManager whenever there are new samples from the
/// configured input to be processed. This is run in the callback thread of
/// the soundcard this AudioDestination was registered for! Beware, in the
/// case of multiple soundcards, this method is not re-entrant but it may be
/// concurrent with EngineMaster processing.
virtual void receiveBuffer(const AudioInput& input,
void receiveBuffer(const AudioInput& input,
const CSAMPLE* pBuffer,
unsigned int nFrames);
unsigned int nFrames) override;

/// Called by SoundManager whenever the aux input is connected to a
/// soundcard input.
virtual void onInputConfigured(const AudioInput& input);
void onInputConfigured(const AudioInput& input) override;

/// Called by SoundManager whenever the aux input is disconnected from
/// a soundcard input.
virtual void onInputUnconfigured(const AudioInput& input);
void onInputUnconfigured(const AudioInput& input) override;

private:
QScopedPointer<ControlObject> m_pInputConfigured;
Expand Down
5 changes: 2 additions & 3 deletions src/engine/channels/enginechannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class EngineChannel : public EngineObject {
EffectsManager* pEffectsManager,
bool isTalkoverChannel,
bool isPrimaryDeck);
virtual ~EngineChannel();
~EngineChannel() override;

virtual ChannelOrientation getOrientation() const;

Expand Down Expand Up @@ -67,12 +67,11 @@ class EngineChannel : public EngineObject {
}

virtual void process(CSAMPLE* pOut, const int iBufferSize) = 0;
virtual void collectFeatures(GroupFeatureState* pGroupFeatures) const = 0;
virtual void postProcess(const int iBuffersize) = 0;

// TODO(XXX) This hack needs to be removed.
virtual EngineBuffer* getEngineBuffer() {
return NULL;
return nullptr;
}

protected:
Expand Down
18 changes: 9 additions & 9 deletions src/engine/channels/enginedeck.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class EngineDeck : public EngineChannel, public AudioDestination {
EffectsManager* pEffectsManager,
EngineChannel::ChannelOrientation defaultOrientation,
bool primaryDeck);
virtual ~EngineDeck();
~EngineDeck() override;

virtual void process(CSAMPLE* pOutput, const int iBufferSize);
virtual void collectFeatures(GroupFeatureState* pGroupFeatures) const;
virtual void postProcess(const int iBufferSize);
void process(CSAMPLE* pOutput, const int iBufferSize) override;
void collectFeatures(GroupFeatureState* pGroupFeatures) const override;
void postProcess(const int iBufferSize) override;

// TODO(XXX) This hack needs to be removed.
virtual EngineBuffer* getEngineBuffer();
EngineBuffer* getEngineBuffer() override;

EngineChannel::ActiveState updateActiveState() override;

Expand All @@ -45,17 +45,17 @@ class EngineDeck : public EngineChannel, public AudioDestination {
// the soundcard this AudioDestination was registered for! Beware, in the
// case of multiple soundcards, this method is not re-entrant but it may be
// concurrent with EngineMaster processing.
virtual void receiveBuffer(const AudioInput& input,
void receiveBuffer(const AudioInput& input,
const CSAMPLE* pBuffer,
unsigned int nFrames);
unsigned int nFrames) override;

// Called by SoundManager whenever the passthrough input is connected to a
// soundcard input.
virtual void onInputConfigured(const AudioInput& input);
void onInputConfigured(const AudioInput& input) override;

// Called by SoundManager whenever the passthrough input is disconnected
// from a soundcard input.
virtual void onInputUnconfigured(const AudioInput& input);
void onInputUnconfigured(const AudioInput& input) override;

// Return whether or not passthrough is active
bool isPassthroughActive() const;
Expand Down
18 changes: 10 additions & 8 deletions src/engine/channels/enginemicrophone.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,33 @@ class EngineMicrophone : public EngineChannel, public AudioDestination {
public:
EngineMicrophone(const ChannelHandleAndGroup& handleGroup,
EffectsManager* pEffectsManager);
virtual ~EngineMicrophone();
~EngineMicrophone() override;

ActiveState updateActiveState();

// Called by EngineMaster whenever is requesting a new buffer of audio.
virtual void process(CSAMPLE* pOutput, const int iBufferSize);
virtual void collectFeatures(GroupFeatureState* pGroupFeatures) const;
virtual void postProcess(const int iBufferSize) { Q_UNUSED(iBufferSize) }
void process(CSAMPLE* pOutput, const int iBufferSize) override;
void collectFeatures(GroupFeatureState* pGroupFeatures) const override;
void postProcess(const int iBufferSize) override {
Q_UNUSED(iBufferSize)
}

// This is called by SoundManager whenever there are new samples from the
// configured input to be processed. This is run in the callback thread of
// the soundcard this AudioDestination was registered for! Beware, in the
// case of multiple soundcards, this method is not re-entrant but it may be
// concurrent with EngineMaster processing.
virtual void receiveBuffer(const AudioInput& input,
void receiveBuffer(const AudioInput& input,
const CSAMPLE* pBuffer,
unsigned int iNumSamples);
unsigned int iNumSamples) override;

// Called by SoundManager whenever the microphone input is connected to a
// soundcard input.
virtual void onInputConfigured(const AudioInput& input);
void onInputConfigured(const AudioInput& input) override;

// Called by SoundManager whenever the microphone input is disconnected from
// a soundcard input.
virtual void onInputUnconfigured(const AudioInput& input);
void onInputUnconfigured(const AudioInput& input) override;

bool isSolo();
double getSoloDamping();
Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class EngineBuffer : public EngineObject {

double getRateRatio() const;

void collectFeatures(GroupFeatureState* pGroupFeatures) const;
void collectFeatures(GroupFeatureState* pGroupFeatures) const override;

// For dependency injection of scalers.
void setScalerForTest(
Expand Down
4 changes: 2 additions & 2 deletions src/engine/engineobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class EngineObject : public QObject {
Q_OBJECT
public:
EngineObject();
virtual ~EngineObject();
~EngineObject() override;
virtual void process(CSAMPLE* pInOut,
const int iBufferSize) = 0;

Expand All @@ -24,7 +24,7 @@ class EngineObjectConstIn : public QObject {
Q_OBJECT
public:
EngineObjectConstIn();
virtual ~EngineObjectConstIn();
~EngineObjectConstIn() override;

virtual void process(const CSAMPLE* pIn, CSAMPLE* pOut,
const int iBufferSize) = 0;
Expand Down

0 comments on commit 7f0ba01

Please sign in to comment.