aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/decode/api_decode.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/decode/api_decode.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/decode/api_decode.h')
-rw-r--r--Src/replicant/decode/api_decode.h35
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;
+};