1
0

SongDownloader.h 699 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include "../Components/wac_downloadManager/DownloadCallbackT.h"
  3. class SongDownloader : public DownloadCallbackT<SongDownloader>
  4. {
  5. public:
  6. SongDownloader(const wchar_t *filename, HANDLE done_event, void (*callback)(void *callbackContext, wchar_t *status), void *context);
  7. ~SongDownloader();
  8. void OnInit(DownloadToken token);
  9. void OnData(DownloadToken token, void *data, size_t datalen);
  10. void OnCancel(DownloadToken token);
  11. void OnError(DownloadToken token, int error);
  12. void OnFinish(DownloadToken token);
  13. private:
  14. void (*callback)(void *callbackContext, wchar_t *status);
  15. void *context;
  16. HANDLE hFile, done_event;
  17. uint64_t content_length;
  18. uint64_t bytes_downloaded;
  19. };