summaryrefslogtreecommitdiff
path: root/status.h
blob: a39d680b54b06517dd61b29c76e1274ce0f3d4a5 (plain)
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
/*
 * $Id: status.h,v 1.7 2005/06/03 08:53:13 lordjaxom Exp $
 */
 
#ifndef VDR_TEXT2SKIN_STATUS_H
#define VDR_TEXT2SKIN_STATUS_H

#include <algorithm>
#include <vector>
#include "common.h"
#include <vdr/status.h>


class cText2SkinRender;

class cText2SkinStatus: public cStatus {
public:
	enum eReplayMode {
		replayNone,
		replayNormal,
		replayMP3,
		replayMPlayer,
		replayDVD,
		replayVCD,
		replayImage,

#define __REPLAY_COUNT__ (cText2SkinStatus::replayImage+1)
	};

	typedef std::string tRecordingInfo;
	typedef std::vector<tRecordingInfo> tRecordings;

	struct tEvent
	{
		std::string    title;
		bool           isRecording;
		std::string    channelName;
		int            channelNumber;
		time_t         startTime;
		time_t         stopTime;
		int            priority;
		
		bool tEvent::operator< (const tEvent &b) const
		{
			int r = startTime - b.startTime;
			r = r == 0 ? b.priority - priority : r;
			return r > 0 ? true : false;
		};
	};
	
	typedef std::vector<tEvent> tEvents;
	
private:
	void UpdateEvents(void);
	
	cText2SkinRender *mRender;
	eReplayMode       mReplayMode;
	bool              mReplayIsLoop;
	bool              mReplayIsShuffle;
	tRecordings       mRecordings;
	tEvents           mEvents;
	const cRecording *mReplay;
	cMutex            mRecordingsLock;
	uint              mCurrentRecording;
	uint              mNextRecording;
	int               mLastLanguage;
	bool              mTimerConflict;

protected:
	virtual void Replaying(const cControl *Control, const char *Name);
	virtual void Recording(const cDevice *Device, const char *Name);
	virtual void OsdClear(void);
	virtual void OsdCurrentItem(const char *Text);

public:
	cText2SkinStatus(void);

	void SetLanguage(int Language) { mLastLanguage = Language; }
	void SetRender(cText2SkinRender *Render);

	cxType GetTokenData(const txToken &Token);

	eReplayMode ReplayMode(void) const { return mReplayMode; }
};

extern cText2SkinStatus Text2SkinStatus;

#endif // VDR_TEXT2SKIN_STATUS_H