From cf430d87586ec1974db4b9d4e791ad7bf213aa75 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Fri, 21 Sep 2012 21:02:38 +0200 Subject: [PATCH] Bugfix interface and changes for remotes with not much buttons --- remote.h | 2 ++ remotelinux.h | 2 ++ vvideolivetv.cc | 14 ++++++++++++-- woptionbox.h | 2 +- wprogressbar.h | 2 +- wselectlist.h | 2 +- wtextbox.h | 2 +- 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/remote.h b/remote.h index e693b78..2a4da44 100644 --- a/remote.h +++ b/remote.h @@ -54,6 +54,8 @@ class Remote: public AbstractOption virtual UCHAR getButtonPress(int how)=0; virtual void clearBuffer()=0; + virtual bool mayHaveFewButtons() {return false;}; + virtual void InitHWCListwithDefaults(); virtual char* HCWDesc(ULLONG hcw); const char *CommandDesc(UCHAR number); diff --git a/remotelinux.h b/remotelinux.h index 9492951..78790bf 100644 --- a/remotelinux.h +++ b/remotelinux.h @@ -52,6 +52,8 @@ class RemoteLinux : public Remote const char*HardcodedTranslateStr(UCHAR command); char* HCWDesc(ULLONG hcw); + bool mayHaveFewButtons() {return true;}; + int initCec(); void deinitCec(); diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 6e0771a..4256004 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -295,12 +295,22 @@ int VVideoLiveTV::handleCommand(int command) // NEW REMOTE ONLY - navigate EPG, bring it onscreen if it's not there case Remote::UP: { - doUpDown(false); + if (Remote::getInstance()->mayHaveFewButtons()) { + if (okTriggeredOSD) doUpDown(false); + else doChanUpDown(UP); + } else { + doUpDown(false); + } return 2; } case Remote::DOWN: { - doUpDown(true); + if (Remote::getInstance()->mayHaveFewButtons()) { + if (okTriggeredOSD) doUpDown(true); + else doChanUpDown(DOWN); + } else { + doUpDown(true); + } return 2; } case Remote::LEFT: diff --git a/woptionbox.h b/woptionbox.h index b6effd5..ae6b770 100644 --- a/woptionbox.h +++ b/woptionbox.h @@ -32,7 +32,7 @@ class WOptionBox : public Boxx { public: WOptionBox(); - ~WOptionBox(); + virtual ~WOptionBox(); // Int mode stuff void setIntMode(int start, int numOptions); diff --git a/wprogressbar.h b/wprogressbar.h index 7db78e2..d7addc4 100644 --- a/wprogressbar.h +++ b/wprogressbar.h @@ -36,7 +36,7 @@ class WProgressBar : public Boxx { public: WProgressBar(); - ~WProgressBar(); + virtual ~WProgressBar(); void setPercent(UINT percent); void draw(); diff --git a/wselectlist.h b/wselectlist.h index 9d5a62b..72b53e0 100644 --- a/wselectlist.h +++ b/wselectlist.h @@ -84,7 +84,7 @@ class WSelectList : public Boxx bool showseloption, darkseloption; UINT gap; - DrawStyle &backgroundColour; + DrawStyle backgroundColour; }; #endif diff --git a/wtextbox.h b/wtextbox.h index 3bab197..cc80935 100644 --- a/wtextbox.h +++ b/wtextbox.h @@ -43,7 +43,7 @@ class WTextbox : public Boxx private: char* text; - DrawStyle& foreColour; + DrawStyle foreColour; int textX; int textY; bool paraMode; -- 2.39.5