diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Input/in_flac/RawReader.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Plugins/Input/in_flac/RawReader.h')
-rw-r--r-- | Src/Plugins/Input/in_flac/RawReader.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Src/Plugins/Input/in_flac/RawReader.h b/Src/Plugins/Input/in_flac/RawReader.h new file mode 100644 index 00000000..68348e38 --- /dev/null +++ b/Src/Plugins/Input/in_flac/RawReader.h @@ -0,0 +1,36 @@ +#pragma once +#include "../Agave/DecodeFile/svc_raw_media_reader.h" +#include "../Agave/DecodeFile/ifc_raw_media_reader.h" +#include "FLACFileCallbacks.h" +#include <FLAC/all.h> + +// {E906F4DC-3080-4B9B-951F-85950193ACBF} +static const GUID flac_raw_reader_guid = +{ 0xe906f4dc, 0x3080, 0x4b9b, { 0x95, 0x1f, 0x85, 0x95, 0x1, 0x93, 0xac, 0xbf } }; + + +class RawMediaReaderService : public svc_raw_media_reader +{ +public: + static const char *getServiceName() { return "FLAC Raw Reader"; } + static GUID getServiceGuid() { return flac_raw_reader_guid; } + int CreateRawMediaReader(const wchar_t *filename, ifc_raw_media_reader **reader); +protected: + RECVS_DISPATCH; +}; + +class RawMediaReader : public ifc_raw_media_reader +{ +public: + RawMediaReader(); + ~RawMediaReader(); + int Initialize(nx_file_t ); + int Read(void *buffer, size_t buffer_size, size_t *bytes_read); + size_t Release(); +protected: + RECVS_DISPATCH; +private: + FLAC__StreamDecoder *decoder; + FLACClientData state; + nx_file_t file; +};
\ No newline at end of file |