Add metadta callback for Icy streams

Allow a UI to get a notification when a StreamTitle or other metadata
comes into the stream. Callback function would normally just update a
flag and let the next global event loop handle updating the display.
This commit is contained in:
Earle F. Philhower, III committed 2017-12-04 12:45:16 -08:00
1 parent 8c6bb549f1
commit 3226d6ec0a
4 files changed
+95 -22

No files matched your search

+4 -8
View File
@@ -34,19 +34,15 @@ class AudioFileSourceICYStream : public AudioFileSourceHTTPStream
virtual ~AudioFileSourceICYStream() override;
virtual bool open(const char *url) override;
// virtual uint32_t read(void *data, uint32_t len) override;
// virtual uint32_t readNonBlock(void *data, uint32_t len) override;
// virtual bool seek(int32_t pos, int dir) override;
// virtual bool close() override;
// virtual bool isOpen() override;
// virtual uint32_t getSize() override;
// virtual uint32_t getPos() override;
// bool SetReconnect(bool val) { reconnect = val; return true; }
typedef void (*callbackFn)(const char *type, const char *value);
void setCallback(callbackFn f) { cb = f; }
private:
virtual uint32_t readInternal(void *data, uint32_t len, bool nonBlock) override;
int icyMetaInt;
int icyByteCount;
callbackFn cb;
};