70cbf0fbb3f698c9ec60a21b4b97eca7d7e85a0b
[vuplus_xbmc] / xbmc / utils / LCD.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2012 Team XBMC
5  *      http://www.xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "threads/Thread.h"
24 #include "utils/XBMCTinyXML.h"
25 #include "guilib/GUILabelControl.h"  // for CInfoPortion
26
27 class TiXmlNode;
28
29 #define MAX_ROWS 20
30
31 class ILCD : public CThread
32 {
33 private:
34   enum DISABLE_ON_PLAY { DISABLE_ON_PLAY_NONE = 0, DISABLE_ON_PLAY_VIDEO = 1, DISABLE_ON_PLAY_MUSIC = 2 };
35
36 public:
37   enum LCD_MODE {
38                         LCD_MODE_GENERAL = 0,
39                         LCD_MODE_MUSIC,
40                         LCD_MODE_VIDEO,
41                         LCD_MODE_NAVIGATION,
42                         LCD_MODE_SCREENSAVER,
43                         LCD_MODE_XBE_LAUNCH,
44                         LCD_MODE_PVRTV,
45                         LCD_MODE_PVRRADIO,
46                         LCD_MODE_MAX
47                 };
48   enum CUSTOM_CHARSET {
49                         CUSTOM_CHARSET_DEFAULT = 0,
50                         CUSTOM_CHARSET_SMALLCHAR,
51                         CUSTOM_CHARSET_MEDIUMCHAR,
52                         CUSTOM_CHARSET_BIGCHAR,
53                         CUSTOM_CHARSET_MAX
54                 };
55   virtual void Initialize();
56   virtual bool IsConnected();
57   virtual void Stop() = 0;
58   virtual void Suspend() = 0;
59   virtual void Resume() = 0;
60   virtual void SetBackLight(int iLight) = 0;
61   virtual void SetContrast(int iContrast) = 0;
62   virtual int  GetColumns() = 0;
63   virtual int  GetRows() = 0;
64   virtual void SetLine(int iLine, const CStdString& strLine) = 0;
65   virtual void DisableOnPlayback(bool playingVideo, bool playingMusic);
66   CStdString GetProgressBar(double tCurrent, double tTotal);
67   void SetCharset( UINT nCharset );
68   CStdString GetBigDigit( UINT _nCharset, int _nDigit, UINT _nLine, UINT _nMinSize, UINT _nMaxSize, bool _bSpacePadding );
69   void LoadSkin(const CStdString &xmlFile);
70   void Reset();
71   void Render(LCD_MODE mode);
72  ILCD() : CThread("ILCD"),
73           m_disableOnPlay(DISABLE_ON_PLAY_NONE), 
74           m_eCurrentCharset(CUSTOM_CHARSET_DEFAULT) {}
75 protected:
76   virtual void Process() = 0;
77   void StringToLCDCharSet(CStdString& strText);
78   unsigned char GetLCDCharsetCharacter( UINT _nCharacter, int _nCharset=-1);
79   void LoadMode(TiXmlNode *node, LCD_MODE mode);
80
81 private:
82   int m_disableOnPlay;
83
84   std::vector<CGUIInfoLabel> m_lcdMode[LCD_MODE_MAX];
85   UINT m_eCurrentCharset;
86 };
87 extern ILCD* g_lcd;