aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Input/in_wmvdrm/WMDRMModule.h
blob: 528129305aee58a6588de2c33a36028509aabeb0 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef NULLSOFT_WMDRMMODULEH
#define NULLSOFT_WMDRMMODULEH

#include "Remaining.h"
#include <wmsdk.h>
// layers
#include "AudioLayer.h"
#include "VideoLayer.h"
#include "ClockLayer.h"
#include "WaitLayer.h"
#include "BufferLayer.h"
#include "SeekLayer.h"
#include "GainLayer.h"

#include "WMHandler.h"
#include "WMCallback.h"
#include "WMInformation.h"

class WMDRM : public WMHandler
{
public:
	WMDRM();
	~WMDRM();
	void Config(HWND hwndParent);
	void Init();
	void Quit();
	void GetFileInfo(const wchar_t *file, wchar_t *title, int *length_in_ms);
	int InfoBox(const wchar_t *file, HWND hwndParent);
	int IsOurFile(const wchar_t *fn);
	int Play(const wchar_t *fn);
	void Pause();
	void UnPause();
	int IsPaused();
	void Stop();
	int GetLength();
	int GetOutputTime();
	void SetOutputTime(int time_in_ms);
	void SetVolume(int volume);
	void SetPan(int pan);
	int GetVolume() { return volume; }
	int GetPan() { return pan; }
	void EQSet(int on, char data[10], int preamp);
	void BuildBuffers();
	void OutputAudioSamples(void *data,  long samples, DWORD&);
	void OutputAudioSamples(void *data,  long samples);
	void QuantizedViz(void *data,  long sizeBytes, DWORD);
	long GetPosition();
	void EndOfFile();
	bool OpenVideo(int fourcc, int width, int height, bool flipped);
	void ReOpen();
	void NewSourceFlags();
//	const char *GetFile() { return fn.c_str();}
	bool playing;
	int startAtMilliseconds;
	void InitWM();
protected:
	//WMHandler
	void AudioDataReceived(void *_data, unsigned long sizeBytes, DWORD timestamp);
	void Opened();
	void NewMetadata();
	void Closed();
	void Started();
	void Error();
	void OpenFailed();
	void Stopped();
	void Kill();

	BufferLayer *buffer;
	ClockLayer *clock;
#ifndef NO_DRM
	DRMLayer *drm;
#endif
	AudioLayer *audio;
	VideoLayer *video;
	WaitLayer *wait;
	SeekLayer *seek;
	GainLayer *gain;
	WMCallback callback;
	IWMReader *reader;
	IWMReaderAdvanced *reader1;
	IWMReaderAdvanced2 *reader2;
	IWMReaderNetworkConfig *network;
	WMInformation *info;
	Remaining remaining;
	unsigned char *dspBuffer, *vizBuffer;
	int volume, pan;
	bool flushed, paused;

	HANDLE killswitch;

	bool opened;
	bool drmProtected;
	void Connecting();
	void Locating();
	void AssignOutput();	
	void AccessDenied();

	
};
#endif