summaryrefslogtreecommitdiff
path: root/plexSdOsd.cpp
blob: 0379dd71b41eedfc92fb0f9ca6b4ae79b3c3e1cb (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
#include "plexSdOsd.h"
#include "viewGridNavigator.h"
#include "pictureCache.h"
#include <vdr/thread.h>

cMutex cPlexSdOsd::RedrawMutex;

cPlexSdOsd::cPlexSdOsd()
{
}

void cPlexSdOsd::Show(void)
{
	bool skinDesignerAvailable = InitSkindesignerInterface("plex");
	if (!skinDesignerAvailable) {
		return;
	}

	m_pRootView = GetOsdView(eViews::viRootView);
	if (!m_pRootView) {
		esyslog("[plex]: used skindesigner skin does not support plex");
		return;
	}
	
	m_pBrowserGrid = std::shared_ptr<cBrowserGrid>(new cBrowserGrid(m_pRootView));
	m_pBrowserGrid->SwitchGrid(ePlexMenuTab::pmtOnDeck);
	Flush();
}

void cPlexSdOsd::Flush()
{
	m_pBrowserGrid->DrawGrid();
	m_pBrowserGrid->Flush();
}

eOSState cPlexSdOsd::ProcessKey(eKeys Key)
{
	eOSState state = eOSState::osContinue;
	switch (Key & ~k_Repeat) {
	case kUp:
		m_pBrowserGrid->NavigateUp();
		Flush();
		break;
	case kDown:
		m_pBrowserGrid->NavigateDown();
		Flush();
		break;
	case kLeft:
		m_pBrowserGrid->NavigateLeft();
		Flush();
		break;
	case kRight:
		m_pBrowserGrid->NavigateRight();
		Flush();
		break;
	case kOk:
		// Play movie or change dir
		state = m_pBrowserGrid->NavigateSelect();
		Flush();
		break;
	case kBack:
		//state =
		m_pBrowserGrid->NavigateBack();
		Flush();
		break;
	case kRed:
		// Prev Tab
		//SwitchGrid(m_pViewHeader->NextTab());
		Flush();
		break;
	case kGreen:
		// Next Tab
		//SwitchGrid(m_pViewHeader->PrevTab());
		Flush();
		break;
	default:
		break;
	}
	return state;
}