summaryrefslogtreecommitdiff
path: root/graphtftng.h
blob: 828ad57c773369c7657d940fddb72562534be2a0 (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
/*
 *  GraphTFT plugin for the Video Disk Recorder 
 *
 * graphtftng.h
 *
 * (c) 2006-2016 Jörg Wendel
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 */

#ifndef __GTFT__H__
#define __GTFT__H__

//***************************************************************************
// Includes
//***************************************************************************

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

#include "common.h"
#include "setup.h"
#include "display.h"
#include "HISTORY.h"

//***************************************************************************
// General
//***************************************************************************

static const char* DESCRIPTION    = trNOOP("VDR OSD on TFT");
static const char* MAINMENUENTRY  = trNOOP("Graph-TFTng");

class cPluginGraphTFT;

//***************************************************************************
// Class GraphTFTMenuItem
//***************************************************************************

class cGraphTFTMenuItem : public cOsdItem
{
   public:
   
      cGraphTFTMenuItem(const char* aTitle)
         : cOsdItem(aTitle) {}
};

//***************************************************************************
// Class GraphTFTMenu
//***************************************************************************

class cGraphTFTMenu : public cMenuSetupPage
{
   public:

      enum Size
      {
         sizeVarMax = 100
      };

      cGraphTFTMenu(const char* title, cPluginGraphTFT* aPlugin);
      virtual ~cGraphTFTMenu();
      
      virtual eOSState ProcessKey(eKeys key);

      const char* MenuKind() { return "MenuSetupPage"; }

   protected:

      void Store();

      cPluginGraphTFT* plugin;
      int defMode;
      int originalDefMode;
      int dspActive;
      char variableValues[50][sizeVarMax+TB];
};

//***************************************************************************
// Class cPluginGraphTFT
//***************************************************************************

class cPluginGraphTFT : public cPlugin, cThemeService
{
   public:

      cPluginGraphTFT();
      ~cPluginGraphTFT();

      const char* Version()          { return VERSION; }
      const char* Description()      { return tr(DESCRIPTION); }
      const char* CommandLineHelp();

      bool ProcessArgs(int argc, char* argv[]);
      bool Initialize();
      bool Start();
      void Store();
      void Housekeeping() {}

      const char* MainMenuEntry()    
      { return GraphTFTSetup.HideMainMenu ? 0 : tr(MAINMENUENTRY); }

      cOsdObject* MainMenuAction();

      cMenuSetupPage* SetupMenu();
      bool SetupParse(const char* Name, const char* Value);
      cGraphTFTDisplay* getDisplay() { return display; }

      bool Service(const char* Id, void* Data);
      const char** SVDRPHelpPages();
      cString SVDRPCommand(const char* Command, const char* Option, int& ReplyCode);

      int loadThemes();

   private:

      cGraphTFTDisplay* display;
      char* device;
      int startDetached;
      int port;
};

//***************************************************************************
#endif  // __GTFT__H__