diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/decode/api_decode.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/replicant/decode/api_decode.h')
-rw-r--r-- | Src/replicant/decode/api_decode.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Src/replicant/decode/api_decode.h b/Src/replicant/decode/api_decode.h new file mode 100644 index 00000000..3b5433c7 --- /dev/null +++ b/Src/replicant/decode/api_decode.h @@ -0,0 +1,35 @@ +#pragma once +#include "foundation/dispatch.h" +#include "audio/ifc_audio_decoder_callback.h" +#include "audio/parameters.h" +#include "service/types.h" +#include "nx/nxuri.h" + +// {AA4404BC-69E7-4898-9296-420F774C3331} +static const GUID decode_api_service_guid = +{ 0xaa4404bc, 0x69e7, 0x4898, { 0x92, 0x96, 0x42, 0xf, 0x77, 0x4c, 0x33, 0x31 } }; + +/* benski> some of this is TODO as of 25-Jan-2012 +We want to have several ways to create a decoder +1) Simple method. Create a decoder of the desired style (callback, pull, packet). api_decode will convert between styles if necessary +2) Constraint method: Non-zero values for nsaudio::Parameters members are treated as requirements and api_decode will convert. Flags might indicate that sample rate or channels is a "maximum" rather than a strict requirement +3) Multiple nsaudio::Parameters values. Used if you are a little more flexible in the data format, e.g. if you can handle 16bit audio or floating point +*/ +class api_decode : public Wasabi2::Dispatchable +{ +protected: + api_decode() : Wasabi2::Dispatchable(DISPATCHABLE_VERSION) {} + ~api_decode() {} +public: + static GUID GetServiceType() { return SVC_TYPE_UNIQUE; } + static GUID GetServiceGUID() { return decode_api_service_guid; } + + int CreateAudioDecoder_Callback(ifc_audio_decoder_callback **decoder, nx_uri_t filename, nsaudio::Parameters *parameters, int flags) { return DecodeAPI_CreateAudioDecoder_Callback(decoder, filename, parameters, flags); } + + enum + { + DISPATCHABLE_VERSION=0, + }; +private: + virtual int WASABICALL DecodeAPI_CreateAudioDecoder_Callback(ifc_audio_decoder_callback **decoder, nx_uri_t filename, nsaudio::Parameters *parameters, int flags)=0; +}; |