1
0

manager.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "../Agave/DecodeFile/ifc_audiostream.h"
  3. #include "../Agave/DecodeFile/api_decodefile.h"
  4. enum
  5. {
  6. BURN_OK = 0, // OK to burn
  7. BURN_GENERAL_FAILURE = 1, // can't burn, not 100% sure why
  8. BURN_FILE_NOT_FOUND = 2, // file doesn't exist
  9. BURN_DRM_NO_LICENSE = 3, // user doesn't have a license to open this DRM protected track
  10. BURN_DRM_NOT_ALLOWED = 4, // DRM license disallows burning
  11. BURN_DRM_BURN_COUNT_EXCEEDED= 5, // user has done too many burns already
  12. BURN_NO_DECODER=6, // no decoder was found to decompress this file
  13. };
  14. typedef unsigned __int32 WRESULT;
  15. class BurnManagerCallback
  16. {
  17. public:
  18. virtual void OnLicenseCallback(size_t numFiles, WRESULT *results) = 0;
  19. };
  20. class BurnManager
  21. {
  22. public:
  23. BurnManager();
  24. ~BurnManager();
  25. public:
  26. void SetDecodeAPI(api_decodefile *decoderAPI);
  27. api_decodefile *GetDecodeAPI(void);
  28. void SetFiles(size_t numFiles, const wchar_t **filenames, BurnManagerCallback *callback);
  29. ifc_audiostream *CreateDecoder(const wchar_t *filename);
  30. void CloseDecoder(ifc_audiostream *decoder);
  31. void CancelBurn();
  32. void BurnFinished();
  33. private:
  34. api_decodefile *decodeFile;
  35. void *context; // pImpl (pointer to implementation)
  36. };