From b9f6daad538306bb81809748f47eca1de5a7f3a1 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 14 Jun 2008 14:41:44 +0000 Subject: [PATCH] Fix old remote osd in live tv --- vvideolivetv.cc | 56 +++++++++++++++++++++++++++++++------------------ vvideolivetv.h | 2 ++ 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/vvideolivetv.cc b/vvideolivetv.cc index f61b551..9f67cb4 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -113,6 +113,10 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V wssRegion.h = 2; } + // This variable is set to true if the user pressed OK to bring the OSD on screen + // This is only used on old remotes to stop up/down buttons being used for osd-epg scrolling + okTriggeredOSD = false; + Colour osdBack = Colour(0, 0, 0, 128); osd.setBackgroundColour(osdBack); @@ -282,58 +286,66 @@ int VVideoLiveTV::handleCommand(int command) vchannelList->highlightChannel((*chanList)[currentChannelIndex]); return 4; } + + // NEW REMOTE ONLY - navigate EPG, bring it onscreen if it's not there case Remote::UP: { - // New remote only - // epg data up doUpDown(false); return 2; } case Remote::DOWN: { - // New remote only - // epg data down doUpDown(true); return 2; } case Remote::LEFT: { - // New remote only - // epg data ch down doLeftRight(false); return 2; } case Remote::RIGHT: { - // New remote only - // epg data ch up doLeftRight(true); return 2; } - case Remote::DF_UP: + // Continue new remote only... + case Remote::CHANNELUP: { - // Old remote, decide what to do based on whether the osd is showing - if (osd.getVisible()) doUpDown(false); - else doChanUpDown(UP); + doChanUpDown(UP); return 2; } - case Remote::DF_DOWN: + case Remote::CHANNELDOWN: { - // Old remote, decide what to do based on whether the osd is showing - if (osd.getVisible()) doUpDown(true); - else doChanUpDown(DOWN); + doChanUpDown(DOWN); return 2; } - case Remote::CHANNELUP: + + // END NEW REMOTE ONLY, START OLD REMOTE ONLY + + // DF_LEFT and DF_RIGHT never get here because they are stolen + // by command as vol- and vol+ + + // Old remote. Decide what to do based on whether + // OK was pressed - osd shown manually, use up/down for epg nav + // UP/DOWN was pressed to change channel, osd was shown auto, use up/down for ch+/ch- + + case Remote::DF_UP: { - doChanUpDown(UP); + // Old remote, decide what to do based on okTriggeredOSD + if (okTriggeredOSD) doUpDown(false); + else doChanUpDown(UP); return 2; } - case Remote::CHANNELDOWN: + case Remote::DF_DOWN: { - doChanUpDown(DOWN); + // Old remote, decide what to do based on okTriggeredOSD + if (okTriggeredOSD) doUpDown(true); + else doChanUpDown(DOWN); return 2; } + + // END NEW/OLD REMOTE STUFF + case Remote::PREVCHANNEL: { channelChange(PREVIOUS, 0); @@ -479,6 +491,7 @@ void VVideoLiveTV::doOK() { osdChannelIndex = currentChannelIndex; displayOSD(true); + okTriggeredOSD = true; } } @@ -701,6 +714,8 @@ void VVideoLiveTV::clearScreen() osd.setVisible(false); summary.setVisible(false); + okTriggeredOSD = false; + draw(); boxstack->update(this); } @@ -760,6 +775,7 @@ void VVideoLiveTV::timercall(int ref) } osd.setVisible(false); + okTriggeredOSD = false; draw(); boxstack->update(this, osd.getRegion()); } diff --git a/vvideolivetv.h b/vvideolivetv.h index d261d98..78b7339 100644 --- a/vvideolivetv.h +++ b/vvideolivetv.h @@ -139,6 +139,8 @@ class VVideoLiveTV : public Boxx, public TimerReceiver Boxx summaryBlackLine; Region osdSummaryRegion; + + bool okTriggeredOSD; }; -- 2.39.5