-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbewegung_mainmenu.c
77 lines (68 loc) · 1.64 KB
/
bewegung_mainmenu.c
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
#include <vdr/plugin.h>
#include <wiimote.h>
#include <wiimote_api.h>
#include "bewegung_mainmenu.h"
#include "bewegung_reader.h"
cBewegungMainmenu::cBewegungMainmenu(void)
{
osd = NULL;
x = (OSDMAXX2-OSDMAXX1)/2;
y = (OSDMAXY2-OSDMAXY1)/2;
color = clrRed;
}
cBewegungMainmenu::~cBewegungMainmenu()
{
delete osd;
}
void cBewegungMainmenu::Show(void)
{
osd = cOsdProvider::NewOsd(OSDMAXX1, OSDMAXY1);
if (osd) {
tArea Area = { OSDMAXX1, OSDMAXY1, OSDMAXX2, OSDMAXY2, 4 };
osd->SetAreas(&Area, 1);
osd->DrawRectangle(OSDMAXX1, OSDMAXY1, OSDMAXX2, OSDMAXY2, clrGray50);
osd->DrawRectangle(OSDMAXX1, OSDMAXY1, OSDMAXX2, OSDMAXY2, clrBlue);
osd->Flush();
/*
cWiiReaderThread *thread = cWiiReaderThread::getInstance();
#ifdef _ENABLE_FORCE
fprintf(stderr, "FORCE x=%.3f y=%.3f z=%.3f (sum=%.3f)\n",
wiimote.force.x,
wiimote.force.y,
wiimote.force.z,
sqrt(wiimote.force.x*wiimote.force.x+wiimote.force.y*wiimote.force.y+wiimote.force.z*wiimote.force.z));
#endif
thread->Connect();
*/
// cWiiReaderThread::Init();
}
}
eOSState cBewegungMainmenu::ProcessKey(eKeys Key)
{
eOSState state = cOsdObject::ProcessKey(Key);
color = clrWhite;
if (state == osUnknown) {
switch (Key & ~k_Repeat) {
case kOk:
return osEnd;
case kRed:
color=clrRed;
break;
case kGreen:
color=clrGreen;
break;
case kBlue:
color=clrBlue;
break;
case kYellow:
color=clrYellow;
break;
default:
return state;
}
osd->DrawRectangle(x, y, x + 3, y + 3, color);
osd->Flush();
state = osContinue;
}
return state;
}