summaryrefslogtreecommitdiff
path: root/mymenu.h
blob: c7e60d7386feea1f6139085c9883b3ffca150d26 (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
/*
 * 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;
      bool isPluginReplay;
      void SetHelpKeys(void);
      void Set(bool Refresh = false);
      cString DirectoryName(void);
      bool Open(bool OpenSubMenus = false);
      bool Prepare(cMyMenuRecordingItem *Ri);
      eOSState Play(void);
      eOSState Rewind(void);
      eOSState Archive(void);
      eOSState Info(void);
      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 wothout being displayed
      virtual ~cMyMenuRecordings();
      virtual void SetCurrent(cOsdItem *Item, bool IsPluginReplay = true);
      virtual eOSState ProcessKey(eKeys Key);
};

class cMyMenuRecordingItem : public cOsdItem {
   private:
      cRecording *recording;
      int level;
      char *name;
      int totalEntries;
      int newEntries;
      bool isArchive = false;
      bool isMounted = false;
      bool isLinked = false;
      char *archiveId;
      char *uniqueFolder;
   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; }
      cRecording *Recording(void) { return recording; }
      bool IsDirectory(void) { return name != NULL; }
      bool IsArchive(void) { return isArchive; }
      bool IsMounted(void) { return isMounted; }
      bool IsLinked(void) { return isLinked; }
      const char *ArchiveId(void) { return archiveId; }
      const char *UniqueFolder(void) { return uniqueFolder; }
};

class cMenuRecording : public cOsdMenu {
   private:
      const cRecording *recording;
      bool withButtons;
   public:
      cMenuRecording(const cRecording *Recording, bool WithButtons = false);
      virtual void Display(void);
      virtual eOSState ProcessKey(eKeys Key);
};

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

#endif // __MYMENU_H