blob: 298a943010ffa7111022cc28e3ec1628ed9533d4 (
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
|
#include "myreplaycontrol.h"
myMenuRecordingInfo::myMenuRecordingInfo(const cRecording *Recording,bool WithButtons):cOsdMenu(tr("Recording info"))
{
recording=Recording;
withButtons=WithButtons;
if(withButtons)
SetHelp(tr("Button$Play"),tr("Button$Rewind"));
}
void myMenuRecordingInfo::Display(void)
{
cOsdMenu::Display();
DisplayMenu()->SetRecording(recording);
cStatus::MsgOsdTextItem(recording->Info()->Description());
}
eOSState myMenuRecordingInfo::Play()
{
if(recording)
{
myReplayControl::SetRecording(recording->FileName(),recording->Title());
cControl::Shutdown(); // stop running playbacks
cControl::Launch(new myReplayControl); // start playback
return osEnd; // close plugin
}
return osContinue;
}
eOSState myMenuRecordingInfo::Rewind()
{
if(recording)
{
cDevice::PrimaryDevice()->StopReplay();
cResumeFile ResumeFile(recording->FileName());
ResumeFile.Delete();
return Play();
}
return osContinue;
}
eOSState myMenuRecordingInfo::ProcessKey(eKeys Key)
{
switch (Key)
{
case kUp|k_Repeat:
case kUp:
case kDown|k_Repeat:
case kDown:
case kLeft|k_Repeat:
case kLeft:
case kRight|k_Repeat:
case kRight: DisplayMenu()->Scroll(NORMALKEY(Key)==kUp||NORMALKEY(Key)==kLeft,NORMALKEY(Key)==kLeft||NORMALKEY(Key)==kRight);
cStatus::MsgOsdTextItem(NULL,NORMALKEY(Key)==kUp);
return osContinue;
default: break;
}
eOSState state=cOsdMenu::ProcessKey(Key);
if(state==osUnknown)
{
switch (Key)
{
case kRed: return Play();
case kGreen: return Rewind();
case kOk: return osBack;
default: break;
}
}
return state;
}
|