aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/ultravox/ifc_ultravox_reader.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/ultravox/ifc_ultravox_reader.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/ultravox/ifc_ultravox_reader.h')
-rw-r--r--Src/replicant/ultravox/ifc_ultravox_reader.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Src/replicant/ultravox/ifc_ultravox_reader.h b/Src/replicant/ultravox/ifc_ultravox_reader.h
new file mode 100644
index 00000000..745eb145
--- /dev/null
+++ b/Src/replicant/ultravox/ifc_ultravox_reader.h
@@ -0,0 +1,28 @@
+#pragma once
+#include "foundation/dispatch.h"
+
+class ifc_ultravox_reader : public Wasabi2::Dispatchable
+{
+protected:
+ ifc_ultravox_reader() : Dispatchable(DISPATCHABLE_VERSION) {}
+ ~ifc_ultravox_reader() {}
+public:
+ enum
+ {
+ DISPATCHABLE_VERSION=0,
+ };
+
+ size_t BytesBuffered() { return UltravoxReader_BytesBuffered(); }
+ int Read(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_Read(buffer, buffer_length, bytes_read); }
+ int Peek(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_Peek(buffer, buffer_length, bytes_read); }
+ int IsClosed() { return UltravoxReader_IsClosed(); }
+ /* gives you back the contents of exactly one packet. used when Ultravox is provided codec framing */
+ int ReadPacket(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_ReadPacket(buffer, buffer_length, bytes_read); }
+private:
+ virtual int WASABICALL UltravoxReader_Read(void *buffer, size_t buffer_length, size_t *bytes_read)=0;
+ virtual int WASABICALL UltravoxReader_Peek(void *buffer, size_t buffer_length, size_t *bytes_read)=0;
+ virtual size_t WASABICALL UltravoxReader_BytesBuffered()=0;
+ virtual int WASABICALL UltravoxReader_IsClosed()=0;
+ virtual int WASABICALL UltravoxReader_ReadPacket(void *buffer, size_t buffer_length, size_t *bytes_read)=0;
+
+};