aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Input/in_wmvdrm/ClockLayer.h
blob: 1fb8923054ccbf27a900ac213951808f122ae57f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef NULLSOFT_CLOCKLAYERH
#define NULLSOFT_CLOCKLAYERH

#include "WMHandler.h"
class ClockLayer : public WMHandler
{
public:
	ClockLayer(IWMReader *reader);

	void SetStartTimeMilliseconds(long time);
	QWORD GetStartTime();

	void GoRealTime();
	int GetOutputTime();
	void SetLastOutputTime(int _outputTime)
	{
		lastOutputTime = _outputTime;
	}
	void Clock();
private:
	// WMHandler
	void Opened();
	void Started();
	void TimeReached(QWORD &timeReached);
	void TimeToSync(QWORD timeStamp, __int64 &diff);
	void SampleReceived(QWORD &timeStamp, QWORD &duration, unsigned long &outputNum, unsigned long &flags, INSSBuffer *&sample);

	IWMReaderAdvanced *clock;
	
	QWORD startTime, clockTick, curTime;
	DWORD startTimeMilliseconds;
	bool realTime;
	int lastOutputTime;
};

#endif