Skip to content

Commit d6f0b81

Browse files
committed
Code Cleanup: add missing override
1 parent 3988aac commit d6f0b81

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

src/AudioCodecs/AudioEncoded.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class EncodedAudioPrint : public AudioStreamX {
286286
}
287287

288288
/// Starts the processing - sets the status to active
289-
bool begin() {
289+
bool begin() override {
290290
TRACED();
291291
const CodecNOP *nop = CodecNOP::instance();
292292
if (decoder_ptr != nop || encoder_ptr != nop) {
@@ -317,7 +317,7 @@ class EncodedAudioPrint : public AudioStreamX {
317317
}
318318

319319
/// Ends the processing
320-
void end() {
320+
void end() override {
321321
TRACEI();
322322
decoder_ptr->end();
323323
encoder_ptr->end();

src/AudioCodecs/CodecCopy.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#pragma once
22

33
#include "AudioCodecs/AudioEncoded.h"
4-
#include "Stream.h"
5-
4+
#ifdef ARDUINO
5+
#include "Print.h"
6+
#endif
67
/**
78
* @defgroup codec-copy Copy
89
* @ingroup codecs

src/AudioTools/AudioPrint.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
namespace audio_tools {
1212

13+
#ifndef ARDUINO
14+
# define FLUSH_OVERRIDE override
15+
#else
16+
# define FLUSH_OVERRIDE
17+
#endif
1318

1419
/**
1520
* @brief Abstract Audio Ouptut class
@@ -34,7 +39,7 @@ class AudioPrint : public Print, public AudioBaseInfoDependent, public AudioBase
3439
}
3540

3641
// removed override because some old implementation did not define this method as virtual
37-
virtual void flush() {
42+
virtual void flush() FLUSH_OVERRIDE {
3843
write((const uint8_t*)tmp, tmpPos-1);
3944
tmpPos=0;
4045
}

src/AudioTools/AudioStreams.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,23 +826,23 @@ class QueueStream : public AudioStreamX {
826826
virtual ~QueueStream() { delete callback_buffer_ptr; }
827827

828828
/// Activates the output
829-
virtual bool begin() {
829+
virtual bool begin() override {
830830
TRACEI();
831831
active = true;
832832
return true;
833833
}
834834

835835
/// stops the processing
836-
virtual void end() {
836+
virtual void end() override {
837837
TRACEI();
838838
active = false;
839839
};
840840

841-
int available() {
841+
int available() override {
842842
return callback_buffer_ptr->available()*sizeof(T);
843843
}
844844

845-
int availableForWrite() {
845+
int availableForWrite() override {
846846
return callback_buffer_ptr->availableForWrite()*sizeof(T);
847847
}
848848

0 commit comments

Comments
 (0)