uiBurnPlaylist.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #pragma once
  2. #include "./main.h"
  3. #include <commctrl.h>
  4. #include "./playlist.h"
  5. #define WM_BURNER ((WM_USER) + 0x400)
  6. #define WM_BURNGETSTATUS ((WM_BURNER) + 0x001)
  7. #define WM_BURNGETITEMSTATUS ((WM_BURNER) + 0x002)
  8. #define WM_BURNUPDATEOWNER ((WM_BURNER) + 0x003) // wParam = 0; lParam = ownerWnd
  9. #define WM_BURNCONFIGCHANGED ((WM_BURNER) + 0x004) // wParam = changed item; lParam = new value
  10. #define WM_BURNNOTIFY ((WM_BURNER) + 0x100) // wParam = Notify code, lParam notify data
  11. // Notification types
  12. #define BURN_READY 0xFFF // lParam = hwnd
  13. #define BURN_DESTROYED 0x001
  14. #define BURN_WORKING 0x002
  15. #define BURN_FINISHED 0x003
  16. #define BURN_STATECHANGED 0x004
  17. #define BURN_CONFIGCHANGED 0x005
  18. #define BURN_ITEMSTATECHANGED 0x010
  19. #define BURN_ITEMDECODEPROGRESS 0x011
  20. #define BURN_ITEMBURNPROGRESS 0x012
  21. // status types
  22. #define BURNSTATUS_DRIVE 0x0000
  23. #define BURNSTATUS_ELAPSED 0x0001
  24. #define BURNSTATUS_ESTIMATED 0x0002
  25. #define BURNSTATUS_PROGRESS 0x0003
  26. #define BURNSTATUS_STATE 0x0004
  27. #define BURNSTATUS_ERROR 0x0005
  28. #define BURNPLAYLISTUI_SUCCESS 0x0000
  29. #define BURNPLAYLISTUI_PRIMOSDKNOTSET 0x0105
  30. //stages
  31. #define PLSTAGE_READY 0x00
  32. #define PLSTAGE_LICENSED 0x01
  33. #define PLSTAGE_DECODED 0x02
  34. #define PLSTAGE_BURNED 0x03
  35. // config items
  36. #define BURNCFG_AUTOCLOSE 0x01
  37. #define BURNCFG_AUTOEJECT 0x02
  38. #define BURNCFG_ADDTODB 0x03
  39. #define BURNCFG_HIDEVIEW 0x04
  40. class BurnPlaylistUI
  41. {
  42. public:
  43. BURNLIB_API BurnPlaylistUI(void);
  44. BURNLIB_API ~BurnPlaylistUI(void);
  45. public:
  46. BURNLIB_API DWORD Burn(obj_primo *primoSDK, DWORD drive, DWORD maxspeed, DWORD burnFlags,
  47. BurnerPlaylist *playlist, const wchar_t* tempPath, HWND ownerWnd);
  48. protected:
  49. static DWORD CALLBACK OnLicensingPlaylist(void *sender, void *userparam, DWORD notifyCode, DWORD errorCode, ULONG_PTR param);
  50. static DWORD CALLBACK OnDecodePlaylist(void *sender, void *userparam, DWORD notifyCode, DWORD errorCode, ULONG_PTR param);
  51. static DWORD CALLBACK OnBurnPlaylist(void *sender, void *userparam, DWORD notifyCode, DWORD errorCode, ULONG_PTR param);
  52. static LRESULT CALLBACK WndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  53. void OnLicense(void);
  54. void OnDecode(void);
  55. void OnBurn(void);
  56. void OnInitDialog(HWND hwndDlg);
  57. void OnCancel(void);
  58. void OnDestroy(void);
  59. void SetExtendedView(BOOL extView);
  60. void SetColumns(void);
  61. void FillList(void);
  62. void SetProgress(int position);
  63. void UpdateTime(BOOL recalcEstimates);
  64. void ReportError(unsigned int stringCode, BOOL allowContinue);
  65. void ReportError(const wchar_t *errorString, BOOL allowContinue);
  66. DWORD DrawList(NMLVCUSTOMDRAW* cd);
  67. HBITMAP CreateStripBmp(HDC compDC);
  68. void SetReadyClose(BOOL ready);
  69. void UpdateItemStatus(int index);
  70. void SetItemStatusText(int index, unsigned int stringCode, BOOL redraw);
  71. void SetCurrentOperation(unsigned int stringCode);
  72. int MessageBox(unsigned int messageCode, unsigned int captionCode, unsigned int uType);
  73. protected:
  74. struct aproxtime
  75. {
  76. DWORD license;
  77. DWORD convert;
  78. DWORD transition;
  79. DWORD chkdisc;
  80. DWORD init;
  81. DWORD leadin;
  82. DWORD burn;
  83. DWORD leadout;
  84. DWORD finish;
  85. };
  86. protected:
  87. HWND hwnd;
  88. HWND ownerWnd;
  89. DWORD drive;
  90. DWORD maxspeed;
  91. DWORD burnFlags;
  92. BOOL extendedView;
  93. DWORD errCode;
  94. obj_primo *primoSDK;
  95. BurnerPlaylist *playlist;
  96. unsigned int startedTime;
  97. unsigned int estimatedTime;
  98. wchar_t *tmpfilename;
  99. HANDLE hTmpFile;
  100. int currentPercent;
  101. DWORD prevRefresh;
  102. HBITMAP stripBmp;
  103. BOOL cancelOp;
  104. HANDLE workDone;
  105. aproxtime estimated;
  106. BOOL readyClose;
  107. DWORD controlTime;
  108. DWORD realSpeed;
  109. DWORD stage;
  110. DWORD count; // count of items to process (actual)
  111. DWORD processed; // count of actually processed items
  112. };