Skip to content

Commit 5f94d32

Browse files
committed
Documentation cleanup
1 parent 76d7ab2 commit 5f94d32

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

src/AudioTools/AudioCopy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class StreamCopyT {
148148
int result = 0;
149149
if (from!=nullptr) {
150150
if (availableCallback!=nullptr){
151-
result = availableCallback(from->toStreamPointer());
151+
result = availableCallback((Stream*)from);
152152
} else {
153153
result = from->available();
154154
}

src/AudioTools/AudioStreams.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class AudioStream : public Stream, public AudioBaseInfoDependent, public AudioBa
3838
AudioStream(AudioStream const&) = delete;
3939
AudioStream& operator=(AudioStream const&) = delete;
4040

41-
4241
virtual bool begin(){return true;}
4342
virtual void end(){}
4443

@@ -56,14 +55,6 @@ class AudioStream : public Stream, public AudioBaseInfoDependent, public AudioBa
5655
p_notify = &bi;
5756
}
5857

59-
#ifndef DOXYGEN
60-
61-
virtual size_t readBytes(char *buffer, size_t length) {
62-
return readBytes((uint8_t *)buffer, length);
63-
}
64-
65-
#endif
66-
6758
virtual size_t readBytes(uint8_t *buffer, size_t length) STREAM_WRITE_OVERRIDE = 0;
6859

6960
virtual size_t write(const uint8_t *buffer, size_t size) override = 0;
@@ -79,11 +70,7 @@ class AudioStream : public Stream, public AudioBaseInfoDependent, public AudioBa
7970

8071
virtual void flush() override {}
8172

82-
virtual Stream* toStreamPointer() {
83-
return this;
84-
}
85-
86-
/// Writes n 0 values (= silence)
73+
/// Writes len bytes of silence (=0).
8774
/// @param len
8875
virtual void writeSilence(size_t len){
8976
int16_t zero = 0;
@@ -92,6 +79,17 @@ class AudioStream : public Stream, public AudioBaseInfoDependent, public AudioBa
9279
}
9380
}
9481

82+
// Methods which should be suppressed in the documentation
83+
#ifndef DOXYGEN
84+
85+
virtual size_t readBytes(char *buffer, size_t length) {
86+
return readBytes((uint8_t *)buffer, length);
87+
}
88+
89+
virtual size_t write(uint8_t) { return not_supported(0);};
90+
91+
#endif
92+
9593
protected:
9694
AudioBaseInfoDependent *p_notify=nullptr;
9795
AudioBaseInfo info;
@@ -115,12 +113,13 @@ class AudioStreamX : public AudioStream {
115113
AudioStreamX& operator=(AudioStreamX const&) = delete;
116114

117115
virtual size_t readBytes(uint8_t *buffer, size_t length) override { return not_supported(0); }
118-
#ifndef DOXYGEN
116+
119117
virtual size_t write(const uint8_t *buffer, size_t size) override{ return not_supported(0); }
120-
#endif
118+
121119
virtual int available() override { return not_supported(0); };
122120

123121
virtual int read() override { return not_supported(-1); }
122+
124123
virtual int peek() override { return not_supported(-1); }
125124
};
126125

0 commit comments

Comments
 (0)