-
Notifications
You must be signed in to change notification settings - Fork 6
/
mediaplayer.h
116 lines (108 loc) · 3.08 KB
/
mediaplayer.h
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
106
107
108
109
110
111
112
113
114
115
116
///
/// @file mediaplayer.cpp @brief A software HD device plugin for VDR.
///
/// Copyright (c) 2020 by zille. All Rights Reserved.
///
/// Contributor(s):
///
/// License: AGPLv3
///
/// This program is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
/// published by the Free Software Foundation, either version 3 of the
/// License.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Affero General Public License for more details.
///
/// $Id$
//////////////////////////////////////////////////////////////////////////////
struct PLEntry {
string Path;
string File;
string Folder;
string SubFolder;
struct PLEntry *NextEntry;
};
//////////////////////////////////////////////////////////////////////////////
// cPlayer
//////////////////////////////////////////////////////////////////////////////
/**
** player for mediaplayer mode.
*/
class cSoftHdPlayer : public cPlayer, cThread
{
private:
void Player(const char *);
void ReadPL(const char *);
char *Source;
int Entries;
protected:
virtual void Activate(bool On);
virtual void Action(void);
public:
cSoftHdPlayer(const char *);
virtual ~ cSoftHdPlayer();
struct PLEntry *FirstEntry;
struct PLEntry *CurrentEntry;
void SetEntry(int);
const char * GetTitle(void);
int Jump;
int Pause;
int StopPlay;
int Random;
int NoModify;
int CurrentTime;
int Duration;
};
//////////////////////////////////////////////////////////////////////////////
// cControl
//////////////////////////////////////////////////////////////////////////////
/**
** control class for mediaplayer mode.
*/
class cSoftHdControl : public cControl
{
private:
void ShowProgress();
static cSoftHdControl *pControl;
static cSoftHdPlayer *pPlayer;
cSkinDisplayReplay *pOsd;
public:
cSoftHdControl(const char *); ///< control constructor
virtual ~cSoftHdControl(); ///< control destructor
virtual void Hide(void); ///< hide control
virtual cOsdObject *GetInfo(void) { return NULL; }
virtual eOSState ProcessKey(eKeys); ///< process input events
static cSoftHdControl *Control() { return pControl; }
static cSoftHdPlayer *Player() { return pPlayer; }
int Close;
};
//////////////////////////////////////////////////////////////////////////////
// cOsdMenu
//////////////////////////////////////////////////////////////////////////////
/**
** Soft device plugin menu class.
*/
class cSoftHdMenu : public cOsdMenu
{
private:
void MainMenu(void); ///< create plugin main menu
void SelectPL(void);
void FindFile(string, FILE *);
void MakePlayList(const char *, const char *);
int TestMedia(const char *);
void PlayMedia(const char *);
string Path;
string LastItem;
string Playlist;
public:
cSoftHdMenu(const char *, int = 0, int = 0, int = 0, int = 0, int = 0);
virtual ~ cSoftHdMenu();
void PlayListMenu(void);
virtual eOSState ProcessKey(eKeys);
static cSoftHdMenu *pSoftHdMenu;
static cSoftHdMenu *Menu() { return pSoftHdMenu; }
};