Skip to content

Commit ae2516f

Browse files
committed
ICYStreamBuffered: change from using to class
1 parent 88a360e commit ae2516f

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#pragma once
2-
#include "AudioTools/Communication/HTTP/URLStream.h"
32
#include "AudioTools/Communication/HTTP/ICYStreamT.h"
3+
#include "AudioTools/Communication/HTTP/URLStream.h"
44

55
namespace audio_tools {
66

7-
87
/**
98
* @brief Type alias for ICYStreamT<URLStream>.
109
* @ingroup http
@@ -13,11 +12,21 @@ using ICYStream = ICYStreamT<URLStream>;
1312

1413
#if defined(USE_CONCURRENCY)
1514
/**
16-
* @brief Type alias for URLStreamBufferedT<ICYStream> (buffered ICYStream).
15+
* @brief Buffered ICYStream with metadata callback support.
1716
* @ingroup http
1817
*/
19-
using ICYStreamBuffered = URLStreamBufferedT<ICYStream>;
18+
class ICYStreamBuffered : public URLStreamBufferedT<ICYStream> {
19+
public:
20+
using URLStreamBufferedT<ICYStream>::URLStreamBufferedT;
2021

22+
/// Defines the metadata callback function
23+
virtual bool setMetadataCallback(void (*fn)(MetaDataType info,
24+
const char* str,
25+
int len)) override {
26+
this->urlStream.setMetadataCallback(fn);
27+
return true;
28+
}
29+
};
2130
#endif
2231

23-
}
32+
} // namespace audio_tools

0 commit comments

Comments
 (0)