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