summaryrefslogtreecommitdiff
path: root/mymenu.h
blob: 6b921683e52ed30548b8045d428ff6875e01a5ed (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
/*
 * mymenu.h: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#ifndef __MYMENU_H
#define __MYMENU_H

#include <vdr/cutter.h>
#include <vdr/interface.h>
#include <vdr/menu.h>
#include <vdr/osdbase.h>
#include <vdr/recording.h>
#include <vdr/tools.h>
#include <vdr/videodir.h>
#include "archive.h"
#include "setup.h"

class cMyMenuRecordingItem;

class cMyMenuRecordings : public cOsdMenu {
   private:
      char *base;
      int level;
      bool show;
      int recordingsState;
      int helpKeys;
      void SetHelpKeys(void);
      void Set(bool Refresh = false);
      cString DirectoryName(void);
      bool Open(bool OpenSubMenus = false);
      bool Prepare(const cRecording *Recording);
      eOSState Play(void);
      eOSState Archive(void);
      eOSState Delete(void);
      eOSState Info(void);
      eOSState Commands(eKeys Key = kNone);
      eOSState Sort(void);
   public:
      cMyMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false, bool Show = true);
      // when Show = false, the menu works in background without being displayed
      virtual ~cMyMenuRecordings();
      virtual eOSState ProcessKey(eKeys Key);
      eOSState Play(const cRecording *Recording, bool IsPluginReplay = true);
};

class cMyMenuRecordingItem : public cOsdItem {
   private:
      cRecording *recording;
      int level;
      char *name;
      int totalEntries;
      int newEntries;
   public:
      cMyMenuRecordingItem(cRecording *Recording, int Level);
      virtual ~cMyMenuRecordingItem();
      void IncrementCounter(bool New);
      virtual void SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable);
      const char *Name(void) { return name; }
      int Level(void) { return level; }
      cRecording *Recording(void) { return recording; }
      bool IsDirectory(void) { return name != NULL; }
};

class cMenuRecording : public cOsdMenu {
   private:
#if APIVERSNUM > 20101
      cRecording *recording;
      cString originalFileName;
      int recordingsState;
      bool RefreshRecording(void);
#else
      cRecording *recording;
#endif
      bool withButtons;
   public:
#if APIVERSNUM > 20101
      cMenuRecording(cRecording *Recording, bool WithButtons = false);
#else
      cMenuRecording(const cRecording *Recording, bool WithButtons = false);
#endif
      virtual void Display(void);
      virtual eOSState ProcessKey(eKeys Key);
};

class cMyReplayControl : public cReplayControl {
   private:
      bool isPluginReplay;
   public:
      cMyReplayControl(bool IsPluginReplay = true);
      virtual ~cMyReplayControl();
};

class cMenuPathEdit : public cOsdMenu {
   private:
      cString path;
      char folder[PATH_MAX];
      char name[NAME_MAX];
      cMenuEditStrItem *folderItem;
      int pathIsInUse;
      eOSState SetFolder(void);
      eOSState Folder(void);
      eOSState ApplyChanges(void);
   public:
      cMenuPathEdit(const char *Path);
      virtual eOSState ProcessKey(eKeys Key);
};

#endif // __MYMENU_H