obj_databurner.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef NULLSOFT_BURNER_OBJ_DATABURNER_H
  2. #define NULLSOFT_BURNER_OBJ_DATABURNER_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/platform/types.h>
  5. class ifc_burner_writecallback;
  6. class obj_databurner : public Dispatchable
  7. {
  8. protected:
  9. obj_databurner() {}
  10. ~obj_databurner() {}
  11. public:
  12. int Open(const wchar_t *volumeName, wchar_t driveLetter, int format);
  13. int AddFile(const wchar_t *source, const wchar_t *destination);
  14. int AddFolder(const wchar_t *folder);
  15. int Write(int flags, unsigned int speed, ifc_burner_writecallback *callback);
  16. void ForceCallback(); // call this (from another thread) to force the Write() function to call your callback ASAP
  17. DISPATCH_CODES
  18. {
  19. DATABURNER_OPEN = 0,
  20. DATABURNER_ADDFILE = 1,
  21. DATABURNER_ADDFOLDER = 2,
  22. DATABURNER_WRITE = 3,
  23. DATABURNER_FORCECALLBACK = 4,
  24. };
  25. };
  26. inline int obj_databurner::Open(const wchar_t *volumeName, wchar_t driveLetter, int format)
  27. {
  28. return _call(DATABURNER_OPEN, (int)1, volumeName, driveLetter, format);
  29. }
  30. inline int obj_databurner::AddFile(const wchar_t *source, const wchar_t *destination)
  31. {
  32. return _call(DATABURNER_ADDFILE, (int)1, source, destination);
  33. }
  34. inline int obj_databurner::AddFolder(const wchar_t *folder)
  35. {
  36. return _call(DATABURNER_ADDFOLDER, (int)1, folder);
  37. }
  38. inline int obj_databurner::Write(int flags, unsigned int speed, ifc_burner_writecallback *callback)
  39. {
  40. return _call(DATABURNER_WRITE, (int)1, flags, speed, callback);
  41. }
  42. inline void obj_databurner::ForceCallback()
  43. {
  44. _voidcall(DATABURNER_FORCECALLBACK);
  45. }
  46. // {0AF177FF-EC9E-4004-8886-B092879895BC}
  47. static const GUID obj_databurnerGUID =
  48. { 0xaf177ff, 0xec9e, 0x4004, { 0x88, 0x86, 0xb0, 0x92, 0x87, 0x98, 0x95, 0xbc } };
  49. #endif