blob: 376f8578aef9aafd01054b9254ab9473543de763 (
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
105
|
#include "plexSdOsd.h"
#include "viewGridNavigator.h"
#include "pictureCache.h"
#include <vdr/thread.h>
cMutex cPlexSdOsd::RedrawMutex;
cPlexSdOsd::cPlexSdOsd()
{
}
cPlexSdOsd::~cPlexSdOsd()
{
cPictureCache::GetInstance().RemoveAll();
}
bool cPlexSdOsd::SdSupport()
{
bool skinDesignerAvailable = InitSkindesignerInterface("plex");
if (skinDesignerAvailable) {
cOsdView *rootView = GetOsdView(eViews::viRootView);
if (!rootView) {
esyslog("[plex]: used skindesigner skin does not support plex");
return false;
}
}
return skinDesignerAvailable;
}
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));
Flush();
}
void cPlexSdOsd::Flush()
{
m_pBrowserGrid->DrawGrid();
m_pBrowserGrid->Flush();
}
eOSState cPlexSdOsd::ProcessKey(eKeys Key)
{
eOSState state = eOSState::osContinue;
plexclient::Video* vid = dynamic_cast<plexclient::Video*>(m_pBrowserGrid->SelectedObject());
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:
if(vid) {
if(vid->m_iViewCount > 0) vid->SetUnwatched();
else vid->SetWatched();
vid->UpdateFromServer();
Flush();
}
break;
case kGreen:
m_pBrowserGrid->PrevTab();
Flush();
break;
case kYellow:
m_pBrowserGrid->NextTab();
Flush();
break;
default:
break;
}
return state;
}
|