Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
49
Src/Plugins/Input/in_wmvdrm/WaitLayer.cpp
Normal file
49
Src/Plugins/Input/in_wmvdrm/WaitLayer.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
#include "main.h"
|
||||
#include "WaitLayer.h"
|
||||
#include "util.h"
|
||||
|
||||
WaitLayer::WaitLayer(IWMReader *_reader)
|
||||
: reader(_reader), stopEvent(0)
|
||||
{
|
||||
reader->AddRef();
|
||||
openEvent = CreateEvent(0, TRUE, FALSE, 0);
|
||||
}
|
||||
|
||||
WaitLayer::~WaitLayer()
|
||||
{
|
||||
reader->Release();
|
||||
reader=0;
|
||||
}
|
||||
|
||||
void WaitLayer::Opened()
|
||||
{
|
||||
SetEvent(openEvent);
|
||||
WMHandler::Opened();
|
||||
}
|
||||
|
||||
bool WaitLayer::IsOpen()
|
||||
{
|
||||
return WaitForSingleObject(openEvent, 0) == WAIT_OBJECT_0;
|
||||
}
|
||||
|
||||
void WaitLayer::OpenCalled()
|
||||
{
|
||||
SetEvent(openEvent);
|
||||
WMHandler::OpenCalled();
|
||||
}
|
||||
|
||||
void WaitLayer::OpenFailed()
|
||||
{
|
||||
SetEvent(openEvent);
|
||||
WMHandler::OpenFailed();
|
||||
}
|
||||
|
||||
bool WaitLayer::WaitForOpen(int time_ms)
|
||||
{
|
||||
return WaitForSingleObject(openEvent, time_ms) == WAIT_OBJECT_0;
|
||||
}
|
||||
|
||||
void WaitLayer::ResetForOpen()
|
||||
{
|
||||
ResetEvent(openEvent);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue