summaryrefslogtreecommitdiff
path: root/playlist.h
blob: 08090ef9b91b3c17789082a3eee8e4fa90779ed1 (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
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
164
165
166
167
/*
 * playlist: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: playlist.h 0.2 2004/10/08 02:34:00 hflor Exp $
 */

#ifndef __PLAYLIST_H
#define __PLAYLIST_H

#include <vdr/config.h>
#include <vdr/recording.h>
#include <vdr/plugin.h>

#define FREENULL(T) { if (T) { free(T); T = NULL; } }
#if VDRVERSNUM >= 10307
#define MAXOSDTEXTWIDTH 45
#define AKTOSDTEXTWIDTH 45
#define ERROR(E)  Skins.Message(mtError, E)
#define INFO(I)   Skins.Message(mtInfo, I)
#define STATUS(S) Skins.Message(mtStatus, S)
#else
#define MAXOSDTEXTWIDTH MAXOSDWIDTH
#define AKTOSDTEXTWIDTH Setup.OSDwidth
#define ERROR(E)  Interface->Error(E)
#define INFO(I)   Interface->Info(I)
#endif

// Global variables that control the overall behaviour:

enum eStartOption {
  Start_DisplayPL = 0,
  Start_DisplayLast,
  Start_PlayLast,
  Start_NewEmpty,
  Start_max };

enum eNoYesDefault {
  NoYesDefault_no = 0,
  NoYesDefault_yes,
  NoYesDefault_defaultPlugin,
  NoYesDefault_defaultPlaylist,
  NoYesDefault_defaultRecordDir,
  NoYesDefault_max };

enum ePlayOptions {
  PlayOptions_firstpos = 0,
  PlayOptions_firstnew,
  PlayOptions_lastplay,
  PlayOptions_selectpos,
  PlayOptions_question,
  PlayOptions_defaultPlugin,
  PlayOptions_max };

enum eOptions {
  Option_confirmdeleterecord = 0,
  Option_confirmstartnewrecord,
  Option_deletefromlist,
  Option_deleterecord,
  Option_jumpmark,
  Option_playoption1,
  Option_playoption2,
  Option_playonlynew,
  Option_searchnewrecord,
  Option_searchrecordsub,
  Option_max };

#define MAXOptionLines 20

struct tParamInt {
  bool c;               // read command line
  bool r;               // read config file
  bool h;               // hide in setup menu
  int d;                // default
  int u;                // used
  int s;                // config file
  int o;                // old value for setup menu
  };

struct tParamChar {
  bool c;               // read command line
  bool r;               // read config file
  bool h;               // hide in setup menu
  char d;               // default
  char u;               // used
  char s;               // config file
  char o;               // old value for setup menu
  };

struct tParamFile {
  bool c;               // read command line
  bool r;               // read config file
  bool h;               // hide in setup menu
  char d[MaxFileName];  // default
  char u[MaxFileName];  // used
  char s[MaxFileName];  // config file
  char o[MaxFileName];  // old value for setup menu
  char e[MaxFileName];  // expanded name (environment)
  };

// var pos1

extern tParamChar  charentry;
extern tParamChar  charfolder;
extern tParamChar  charrecord;
extern tParamInt   commandline_preference;
extern tParamFile  lastplaylist;
extern tParamFile  mainmenu_name;
extern tParamInt   mainmenu_visible;
extern tParamInt   confirmdelplentry;
extern tParamInt   okstartplay;
extern tParamInt   deleterecords;
extern tParamFile  pathplaylists;
extern tParamInt   startoption;
extern tParamInt   storeplaylist;
extern tParamInt   timeoutreadrecords;
extern tParamInt   verbose;
extern tParamInt   PL_options[];

extern char        plugin_name[];
extern char        DisplayStatus[];
extern const char  *NoYesDefault[];
extern const char  *StartOptions[];
extern const char  *PlayOptions[];
extern char        *FileNameCharsAllowed;
extern char        *AllCharsAllowed;
extern char        *LastSelectedRecord;
extern bool        ControlMenuIsOpen;
#if VDRVERSNUM < 10311
extern cRecordings Recordings;
extern time_t      LoadTime_Recordings;
#endif

void ExpandEnvironment(tParamFile *FileStruc);

// --- cPluginPlaylist ----------------------------------------------------------

class cPluginPlaylist : public cPlugin {
private:
  // Add any member variables or functions you may need here.
#if VDRVERSNUM >= 10507
  const char *OSDLanguage;
#else
  int OSDLanguage;
#endif
  void TestAndSetOSDLanguage(void);
  bool ProcessArg(int argc, char *argv[]);

public:
  cPluginPlaylist(void);
  virtual ~cPluginPlaylist();
  virtual const char *Version(void);
  virtual const char *Description(void);
  virtual const char *CommandLineHelp(void);
  virtual bool ProcessArgs(int argc, char *argv[]);
  virtual bool Start(void);
  virtual const char *MainMenuEntry(void);
  virtual cOsdObject *MainMenuAction(void);
  virtual cMenuSetupPage *SetupMenu(void);
  virtual bool SetupParse(const char *Name, const char *Value);
  const char *ExpandPath(const char *Filename, bool CreateDir = true);
  };

extern cPluginPlaylist *PluginPlaylist;

#endif //__PLAYLIST_H