summaryrefslogtreecommitdiff
path: root/hlsPlayerControl.cpp
blob: 97be2d752abcbe203118152fe907637488911b98 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "hlsPlayerControl.h"

cHlsPlayerControl::cHlsPlayerControl(cHlsPlayer* Player, std::string title) :cControl(Player)
{
	player = Player;
	m_title = title;
}

cHlsPlayerControl::~cHlsPlayerControl()
{
}

cString cHlsPlayerControl::GetHeader(void)
{
	return m_title.c_str();
}

void cHlsPlayerControl::Hide(void)
{
}

void cHlsPlayerControl::Show(void)
{
}

eOSState cHlsPlayerControl::ProcessKey(eKeys Key)
{
	if (!Active())
		return osEnd;
	if (Key == kPlayPause) {
		bool Play, Forward;
		int Speed;
		GetReplayMode(Play, Forward, Speed);
		if (Speed >= 0)
			Key = Play ? kPlay : kPause;
		else
			Key = Play ? kPause : kPlay;
	}
	switch (int(Key)) {
		// Positioning:
	case kPlay:
	case kUp:
		Play();
		break;
	case kPause:
	case kDown:
		Pause();
		break;
	case kFastRew|k_Release:
	case kLeft|k_Release:
		//if (Setup.MultiSpeedMode) break;
	case kFastRew:
	case kLeft:
		//Backward();
		break;
	case kFastFwd|k_Release:
	case kRight|k_Release:
		//if (Setup.MultiSpeedMode) break;
	case kFastFwd:
	case kRight:
		//Forward();
		break;
	case kRed:
		//TimeSearch();
		break;
	case kGreen|k_Repeat:
	case kGreen:
		//SkipSeconds(-60);
		break;
	case kYellow|k_Repeat:
	case kYellow:
		//SkipSeconds( 60);
		break;
	case kStop:
	case kBlue:
		Hide();
		Stop();
		return osEnd;
	}
	return osContinue;
}

bool cHlsPlayerControl::Active(void)
{
	return player && player->Active();
}

void cHlsPlayerControl::Pause(void)
{
	if(player)
		player->Pause();
}

void cHlsPlayerControl::Play(void)
{
	if(player)
		player->Play();
}

void cHlsPlayerControl::Stop(void)
{
	if(player)
		player->Stop();
}