summaryrefslogtreecommitdiff
path: root/setup.h
blob: 7b82a6acfbbdbff2ea4327f1f4e8e5ae15a2db46 (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
/*
 * targavfd plugin for VDR (C++)
 *
 * (C) 2010-2013 Andreas Brachold <vdr07 AT deltab de>
 *
 * This targavfd plugin is free software: you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation, version 3 of the License.
 *
 * See the files README and COPYING for details.
 *
 */

#ifndef __VFD_SETUP_H___
#define __VFD_SETUP_H___

#include <vdr/menuitems.h>
#define memberof(x) (sizeof(x)/sizeof(*x))

enum eOnExitMode {
   eOnExitMode_SHOWMSG     /**< Do nothing - just leave the "last" message there */
  ,eOnExitMode_SHOWCLOCK   /**< Show the big clock */
  ,eOnExitMode_BLANKSCREEN /**< Blank the device completely */
  ,eOnExitMode_NEXTTIMER   /**< Show next active timer */
  ,eOnExitMode_NEXTTIMER_BLANKSCR   /**< Show next active timer, or blank if none timer defined */
  ,eOnExitMode_LASTITEM
};

enum eVolumeMode {
   eVolumeMode_ShowNever   /**< Show the volume bar never */
  ,eVolumeMode_ShowTimed   /**< Show the volume bar short time */
  ,eVolumeMode_ShowEver    /**< Show the volume bar ever */
  ,eVolumeMode_Progress    /**< Show the volume bar as time progress */
  ,eVolumeMode_LASTITEM
};

enum eRenderMode {
   eRenderMode_SingleLine   /**< Render screen at single line */
  ,eRenderMode_DualLine     /**< Render screen at dual line */
  ,eRenderMode_SingleTopic  /**< Render screen at single line, only names */
  ,eRenderMode_MultiPage    /**< Render screen at multiple pages */
  ,eRenderMode_LASTITEM
};

enum eSuspendMode {
   eSuspendMode_Never   /**< Suspend display never */
  ,eSuspendMode_Timed   /**< Suspend display, resume short time */
  ,eSuspendMode_Ever    /**< Suspend display ever */
  ,eSuspendMode_LASTITEM
};

struct cVFDSetup 
{
  int          m_nOnExit;
  int          m_nBrightness;

  const int    m_cWidth;
  const int    m_cHeight;

  int          m_nBigFontHeight;
  int          m_nSmallFontHeight;

  char         m_szFont[256];

  int          m_nRenderMode; /** enable two line mode */

  int          m_nVolumeMode;

  int          m_nSuspendMode;
  int          m_nSuspendTimeOn;
  int          m_nSuspendTimeOff;

  cVFDSetup(void);
  cVFDSetup(const cVFDSetup& x);
  cVFDSetup& operator = (const cVFDSetup& x);
  
  /// Parse our own setup parameters and store their values.
  bool SetupParse(const char *szName, const char *szValue);
  
};

class cVFDWatch;
class cVFDMenuSetup
	:public cMenuSetupPage 
{
  cVFDSetup  m_tmpSetup;
  cVFDWatch* m_pDev;
  cStringList fontNames;
  int         fontIndex;
protected:
  virtual void Store(void);
  virtual eOSState ProcessKey(eKeys nKey);
public:
  cVFDMenuSetup(cVFDWatch*    pDev);
};


/// The exported one and only Stored setup data
extern cVFDSetup theSetup;

#endif  //__VFD_SETUP_H___