summaryrefslogtreecommitdiff
path: root/display.h
diff options
context:
space:
mode:
Diffstat (limited to 'display.h')
-rw-r--r--display.h200
1 files changed, 57 insertions, 143 deletions
diff --git a/display.h b/display.h
index ac8cc81..2bb971a 100644
--- a/display.h
+++ b/display.h
@@ -7,68 +7,45 @@
* to the COPYING file distributed with this package.
*
* (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online.de>
- * (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net>
*/
-#ifndef GRAPHLCD_DISPLAY_H
-#define GRAPHLCD_DISPLAY_H
+#ifndef _GRAPHLCD_DISPLAY_H_
+#define _GRAPHLCD_DISPLAY_H_
#include <stdint.h>
#include <string>
#include <vector>
+#include <map>
#include <glcdgraphics/bitmap.h>
-#include <glcdgraphics/font.h>
+#include <glcddrivers/driver.h>
+#include <glcdskin/skin.h>
#include "global.h"
-#include "layout.h"
-#include "logolist.h"
#include "setup.h"
#include "state.h"
-#include "widgets.h"
+#include "skinconfig.h"
-#include <vdr/thread.h>
-#include <vdr/player.h>
-
-#define SPAN_CLIENT_CHECK_ID "Span-ClientCheck-v1.0"
-#define SPAN_GET_BAR_HEIGHTS_ID "Span-GetBarHeights-v1.0"
+#include "service.h"
-#define LCDMAXCARDS 4
-static const int kMaxTabCount = 10;
+#include <vdr/thread.h>
-struct Span_Client_Check_1_0 {
- bool *isActive;
- bool *isRunning;
-};
-struct Span_GetBarHeights_v1_0 {
- unsigned int bands; // number of bands to compute
- unsigned int *barHeights; // the heights of the bars of the
- // two channels combined
- unsigned int *barHeightsLeftChannel; // the heights of the bars of the
- // left channel
- unsigned int *barHeightsRightChannel; // the heights of the bars of the
- // right channel
- unsigned int *volumeLeftChannel; // the volume of the left channels
- unsigned int *volumeRightChannel; // the volume of the right channels
- unsigned int *volumeBothChannels; // the combined volume of the two
- // channels
- const char *name; // name of the plugin that wants to
- // get the data (must be unique for
- // each client!)
- unsigned int falloff; // bar falloff value
- unsigned int *barPeaksBothChannels; // bar peaks of the two channels
- // combined
- unsigned int *barPeaksLeftChannel; // bar peaks of the left channel
- unsigned int *barPeaksRightChannel; // bar peaks of the right channel
+enum eThreadState
+{
+ StateNormal,
+ StateReplay,
+ StateMenu
};
-enum ThreadState
+// state of current display mode (interesting for displays w/ touchpads)
+enum eDisplayMode
{
- Normal,
- Replay,
- Menu
+ DisplayModeNormal,
+ DisplayModeInteractive
};
// Display update Thread
@@ -78,121 +55,58 @@ public:
cGraphLCDDisplay(void);
~cGraphLCDDisplay(void);
- int Init(GLCD::cDriver * Lcd, const char * CfgDir);
- void Tick(void);
-
- void SetChannel(int ChannelNumber);
- void SetClear();
- void SetOsdTitle();
- void SetOsdItem(const char * Text);
- void SetOsdCurrentItem();
- void Recording(const cDevice * Device , const char * Name);
- void Replaying(bool starting, eReplayMode replayMode);
- //void SetStatusMessage(const char * Msg);
- void SetOsdTextItem(const char * Text, bool Scroll);
- //void SetColorButtons(const char * Red, const char * Green, const char * Yellow, const char * Blue);
- void SetVolume(int Volume, bool Absolute);
-
+ bool Initialise(GLCD::cDriver * Lcd, const std::string & CfgPath, const std::string & SkinsPath, const std::string & SkinName);
+ void Tick();
void Update();
void Clear();
+ void Replaying(bool Starting);
+ void SetMenuClear();
+ void SetMenuTitle();
+ void SetMenuCurrent();
+ const GLCD::cBitmap * GetScreen() const { return mScreen; }
+
+ void ForceUpdateBrightness();
+
+ const cGraphLCDService * GetServiceObject() const { return mService; }
+ GLCD::cDriver * GetDriver() const { return mLcd; }
+ GLCD::cSkin * GetSkin() const { return mSkin; }
+
+ const eDisplayMode GetDisplayMode() const { return mDisplayMode; }
protected:
virtual void Action();
private:
- bool update;
- bool active;
GLCD::cDriver * mLcd;
+ GLCD::cBitmap * mScreen;
+ GLCD::cSkin * mSkin;
+ cGraphLCDSkinConfig * mSkinConfig;
- cFontList fontList;
- GLCD::cBitmap * bitmap;
- const GLCD::cFont * largeFont;
- const GLCD::cFont * normalFont;
- const GLCD::cFont * smallFont;
- const GLCD::cFont * symbols;
- std::string cfgDir;
- std::string fontDir;
- std::string logoDir;
-
- ThreadState State;
- ThreadState LastState;
-
- cMutex mutex;
- cGraphLCDState * GraphLCDState;
-
- int menuTop;
- int menuCount;
- int tabCount;
- int tab[kMaxTabCount];
- int tabMax[kMaxTabCount];
-
- std::vector <std::string> textItemLines;
- int textItemTop;
- int textItemVisibleLines;
-
- bool showVolume;
-
- time_t CurrTime;
- time_t LastTime;
- time_t LastTimeCheckSym;
- time_t LastTimeModSym;
- cTimeMs LastTimeSA; //span
- struct timeval CurrTimeval;
- struct timeval UpdateAt;
-
- std::vector<cScroller> scroller;
-
- cGraphLCDLogoList * logoList;
- cGraphLCDLogo * logo;
-
- char szETSymbols[32];
-
-#ifdef USE_WAREAGLEICON
- bool bIsUTF8;
- char * textWithIcons;
- const char * ConvertWarEagleIconsUtf8(const char *s);
-#endif
+ bool mUpdate;
+ uint64_t mUpdateAt;
+ uint64_t mLastTimeMs;
- void DisplayChannel();
- void DisplayTime();
- void DisplayLogo();
- void DisplaySymbols();
- void DisplayProgramme();
- void DisplayReplay(tReplayState & replay);
- void DisplayMenu();
- void DisplayMessage();
- void DisplayTextItem();
- void DisplayColorButtons();
- void DisplayVolume();
- void DisplaySA(); //span
-
- void UpdateIn(long usec);
- bool CheckAndUpdateSymbols();
-
-#if VDRVERSNUM >= 10701
- /** Check if replay index bigger as one hour */
- bool IndexIsGreaterAsOneHour(int Index, double framesPerSecond) const;
- /** Translate replay index to string with minute and second MM:SS */
- const char *IndexToMS(int Index, double framesPerSecond) const;
-#else
- bool IndexIsGreaterAsOneHour(int Index) const;
- const char *IndexToMS(int Index) const;
-#endif
- /** Compare Scroller with new Textbuffer*/
- bool IsScrollerTextChanged(const std::vector<cScroller> & scroller, const std::vector <std::string> & lines) const;
- /** Returns true if Logo loaded and active*/
- bool IsLogoActive() const;
- /** Returns true if Symbols loaded and active*/
- bool IsSymbolsActive() const;
-
- /** Set Brightness depends user activity */
+ eThreadState mState;
+ eThreadState mLastState;
+
+ cMutex mMutex;
+ cGraphLCDState * mGraphLCDState;
+
+ bool mShowVolume;
+ bool mShowAudio;
+
+ void UpdateIn(uint64_t msec);
+
+ /* set brightness depending on user activity */
void SetBrightness();
uint64_t LastTimeBrightness;
int nCurrentBrightness;
bool bBrightnessActive;
-
- cCharSetConv *conv;
- const char * Convert(const char *s);
+ /* external services */
+ cGraphLCDService * mService;
+ /* display mode (normal or interactive) */
+ eDisplayMode mDisplayMode;
+ uint64_t LastTimeDisplayMode;
};
#endif