1
0

BurnManager.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /** (c) Nullsoft, Inc. C O N F I D E N T I A L
  2. ** Filename:
  3. ** Project:
  4. ** Description:
  5. ** Author:
  6. ** Created:
  7. **/
  8. #include "../Agave/DecodeFile/ifc_audiostream.h"
  9. #include "../Agave/DecodeFile/api_decodefile.h"
  10. #include "./BurnManager.h"
  11. BurnManager::BurnManager(void) : decodeFile(NULL), context(NULL)
  12. {
  13. }
  14. BurnManager::~BurnManager()
  15. {
  16. }
  17. void BurnManager::SetDecodeAPI(api_decodefile *decoderAPI)
  18. {
  19. decodeFile = decoderAPI;
  20. }
  21. api_decodefile *BurnManager::GetDecodeAPI(void)
  22. {
  23. return decodeFile;
  24. }
  25. void BurnManager::SetFiles(size_t numFiles, const wchar_t **filenames, BurnManagerCallback *callback)
  26. {
  27. WRESULT *results = new WRESULT[numFiles];
  28. memset(results, 0, numFiles * sizeof(WRESULT));
  29. callback->OnLicenseCallback(numFiles, results);
  30. delete [] results;
  31. }
  32. ifc_audiostream* BurnManager::CreateDecoder(const wchar_t *filename)
  33. {
  34. AudioParameters parameters;
  35. parameters.bitsPerSample = 16;
  36. parameters.channels = 2;
  37. parameters.sampleRate = 44100;
  38. ifc_audiostream *decoder = decodeFile->OpenAudio(filename, &parameters);
  39. if (decoder && (parameters.bitsPerSample != 16 || parameters.channels != 2 || parameters.sampleRate != 44100))
  40. {
  41. parameters.errorCode = API_DECODEFILE_BAD_RESAMPLE;
  42. decodeFile->CloseAudio(decoder);
  43. decoder=0;
  44. }
  45. return decoder;
  46. }
  47. void BurnManager::CloseDecoder(ifc_audiostream *decoder)
  48. {
  49. decodeFile->CloseAudio(decoder);
  50. }
  51. void BurnManager::CancelBurn()
  52. {
  53. }
  54. void BurnManager::BurnFinished()
  55. {
  56. }