From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/burnlib/manager.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Src/burnlib/manager.h (limited to 'Src/burnlib/manager.h') diff --git a/Src/burnlib/manager.h b/Src/burnlib/manager.h new file mode 100644 index 00000000..743f0ec9 --- /dev/null +++ b/Src/burnlib/manager.h @@ -0,0 +1,42 @@ +#pragma once + +#include "../Agave/DecodeFile/ifc_audiostream.h" +#include "../Agave/DecodeFile/api_decodefile.h" + +enum +{ + BURN_OK = 0, // OK to burn + BURN_GENERAL_FAILURE = 1, // can't burn, not 100% sure why + BURN_FILE_NOT_FOUND = 2, // file doesn't exist + BURN_DRM_NO_LICENSE = 3, // user doesn't have a license to open this DRM protected track + BURN_DRM_NOT_ALLOWED = 4, // DRM license disallows burning + BURN_DRM_BURN_COUNT_EXCEEDED= 5, // user has done too many burns already + BURN_NO_DECODER=6, // no decoder was found to decompress this file +}; +typedef unsigned __int32 WRESULT; + +class BurnManagerCallback +{ +public: + virtual void OnLicenseCallback(size_t numFiles, WRESULT *results) = 0; +}; + +class BurnManager +{ +public: + BurnManager(); + ~BurnManager(); + +public: + void SetDecodeAPI(api_decodefile *decoderAPI); + api_decodefile *GetDecodeAPI(void); + void SetFiles(size_t numFiles, const wchar_t **filenames, BurnManagerCallback *callback); + ifc_audiostream *CreateDecoder(const wchar_t *filename); + void CloseDecoder(ifc_audiostream *decoder); + void CancelBurn(); + void BurnFinished(); + +private: + api_decodefile *decodeFile; + void *context; // pImpl (pointer to implementation) +}; \ No newline at end of file -- cgit