Skip to content

Commit 4b49b99

Browse files
committed
Add missing audioInfo() to Adapter classes
1 parent 2053bd6 commit 4b49b99

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/AudioTools/CoreAudio/AudioIO.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ class AdapterAudioStreamToAudioOutput : public AudioOutputAdapter {
254254

255255
void setAudioInfo(AudioInfo info) override { p_stream->setAudioInfo(info); }
256256

257+
AudioInfo audioInfo() override { return p_stream->audioInfo(); }
258+
257259
size_t write(const uint8_t *data, size_t len) override {
258260
return p_stream->write(data, len);
259261
}
@@ -267,6 +269,8 @@ class AdapterAudioStreamToAudioOutput : public AudioOutputAdapter {
267269
/// If true we need to release the related memory in the destructor
268270
virtual bool isDeletable() { return true; }
269271

272+
operator bool() { return *p_stream; }
273+
270274
protected:
271275
AudioStream *p_stream = nullptr;
272276
};
@@ -284,13 +288,22 @@ class AdapterAudioOutputToAudioStream : public AudioStream {
284288
void setOutput(AudioOutput &stream) { p_stream = &stream; }
285289

286290
void setAudioInfo(AudioInfo info) { p_stream->setAudioInfo(info); }
291+
292+
AudioInfo audioInfo() override { return p_stream->audioInfo(); }
293+
287294
size_t write(const uint8_t *data, size_t len) {
288295
return p_stream->write(data, len);
289296
}
290297

298+
bool begin() override { return p_stream->begin(); }
299+
300+
void end() override { p_stream->end(); }
301+
291302
/// If true we need to release the related memory in the destructor
292303
virtual bool isDeletable() { return true; }
293304

305+
operator bool() override { return *p_stream; }
306+
294307
protected:
295308
AudioOutput *p_stream = nullptr;
296309
};

src/AudioTools/CoreAudio/AudioOutput.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class AudioOutput : public Print,
7777
return true;
7878
}
7979
virtual void end() { is_active = false; }
80+
8081
operator bool() { return is_active; }
8182

8283
protected:

0 commit comments

Comments
 (0)