-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.h
163 lines (140 loc) · 3.22 KB
/
commands.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#ifndef __COMMANDS_DVDSWITCH_H
#define __COMMANDS_DVDSWITCH_H
#include <vdr/plugin.h>
#include "imagelist.h"
#include "menu.h"
#include "setup.h"
#include <stdlib.h>
enum eCMDs
{
cmdNone,
cmdDirManage,
cmdDVDopen,
cmdDVDclose,
cmdImgPlay,
cmdImgRename,
cmdImgMove,
cmdImgDelete,
cmdImgBurn,
cmdImgRead,
cmdCommands
};
enum eCMDState
{
csNone,
csDirNew,
csDirEdit,
csDirMove,
csDirDel
};
class cCMD
{
public:
static eOSState Play(const cMainMenuItem *item = NULL);
static eOSState Eject(bool close = false);
};
class cCMDMenu : public cOsdMenu
{
private:
const cMainMenuItem *iItem;
cMainMenu *OsdObject;
cImageList &ImageList;
public:
cCMDMenu(cImageList &ImageList, const cMainMenuItem *item, cMainMenu *osdobject);
virtual eOSState ProcessKey(eKeys Key);
};
class cCMDDir : public cOsdMenu, private cDirHandlingOpt
{
private:
eCMDState State;
char Dir[MaxFileName];
cMainMenu *OsdObject;
bool Select;
char *LastDir;
cImageList &ImageList;
void Build(const char *dir = NULL);
void SetDir(const char *value = NULL)
{
if(value)
strn0cpy(Dir, value, MaxFileName);
else
strcpy(Dir, "\0");
}
eOSState New(void);
eOSState New(eKeys Key);
eOSState Edit(cMainMenuItem *mItem);
eOSState Edit(eKeys Key);
public:
cCMDDir(cImageList &ImageList, cMainMenu *osdobject = NULL, bool select = false, char *lastdir = NULL);
virtual eOSState ProcessKey(eKeys Key);
void SetHelp(void);
};
class cCMDMove : public cOsdMenu, private cDirHandlingOpt
{
private:
char *File;
cMainMenu *OsdObject;
bool Dir;
bool Direct;
cImageList &ImageList;
void Build(const char *dir = NULL);
public:
cCMDMove(cImageList &ImageList, const char *file, cMainMenu *osdobject, bool dir = true, bool direct = false);
~cCMDMove(void) { free(File); }
virtual eOSState ProcessKey(eKeys Key);
void SetHelp(void);
};
class cCMDImage
{
private:
char *File;
cMainMenu *OsdObject;
public:
char NewFile[MaxFileName];
int tmpHideTypeCol;
//int tmpHideImgSize
cCMDImage(cMainMenu *osdobject = NULL);
~cCMDImage(void);
char* Rename(const char *file = NULL);
eOSState Delete(const char *file = NULL);
eOSState Burn(const char *file);
};
class cCMDImageRead : public cOsdMenu
{
private:
char File[MaxFileName];
char Dir[MaxFileName];
char ImgTypeTxt[MaxFileName];
int ImgType;
cImageList &ImageList;
const char ** m_szItemTypes;
public:
cCMDImageRead(cImageList &ImageList);
~cCMDImageRead(void);
void SetHelp(void);
virtual eOSState ProcessKey(eKeys Key);
};
class cCMDImageReadThread : public cThread
{
private:
char *File;
char *Dir;
eFileInfo FileType;
protected:
virtual void Action(void);
public:
cCMDImageReadThread(char *file, char *dir, int imgtype, cImageList &ImageList);
virtual ~cCMDImageReadThread(void);
};
class cCMDImageBurnThread : public cThread
{
private:
char *File;
eFileInfo FileType;
protected:
virtual void Action(void);
public:
cCMDImageBurnThread(const char *file, eFileInfo type);
virtual ~cCMDImageBurnThread(void);
};
#endif // __COMMANDS_DVDSWITCH_H