CrossThreadProgress.h 767 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // CrossThreadProgress.h
  2. #ifndef __CROSSTHREADPROGRESS_H
  3. #define __CROSSTHREADPROGRESS_H
  4. #include "../../ICoder.h"
  5. #include "../../../Windows/Synchronization.h"
  6. #include "../../../Common/MyCom.h"
  7. class CCrossThreadProgress:
  8. public ICompressProgressInfo,
  9. public CMyUnknownImp
  10. {
  11. public:
  12. const UInt64 *InSize;
  13. const UInt64 *OutSize;
  14. HRESULT Result;
  15. NWindows::NSynchronization::CAutoResetEvent ProgressEvent;
  16. NWindows::NSynchronization::CAutoResetEvent WaitEvent;
  17. HRes Create()
  18. {
  19. RINOK(ProgressEvent.CreateIfNotCreated());
  20. return WaitEvent.CreateIfNotCreated();
  21. }
  22. void Init()
  23. {
  24. ProgressEvent.Reset();
  25. WaitEvent.Reset();
  26. }
  27. MY_UNKNOWN_IMP
  28. STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
  29. };
  30. #endif