From fe9f9eb13f933e207c3e90ecb909b5305259cdcd Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 20 Dec 2005 16:19:03 +0000 Subject: [PATCH] Last channel highlighted in channel list view --- vchannellist.cc | 10 +++++++++- vchannellist.h | 1 + vvideolive.cc | 6 +++++- vvideolive.h | 5 +++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/vchannellist.cc b/vchannellist.cc index e4f8d8d..554cf72 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -88,6 +88,14 @@ void VChannelList::setList(ChannelList* tlist) } } +void VChannelList::highlightChannel(Channel* chan) +{ + sl.hintSetCurrent(chan->index); + sl.draw(); + doShowingBar(); + ViewMan::getInstance()->updateView(this); +} + void VChannelList::draw() { View::draw(); @@ -200,7 +208,7 @@ int VChannelList::handleCommand(int command) // if (chan->type == VDR::RADIO) return 2; - VVideoLive* v = new VVideoLive(chanList, chan->type); + VVideoLive* v = new VVideoLive(chanList, chan->type, this); v->draw(); ViewMan::getInstance()->add(v); diff --git a/vchannellist.h b/vchannellist.h index 6f737aa..4feeb11 100644 --- a/vchannellist.h +++ b/vchannellist.h @@ -45,6 +45,7 @@ class VChannelList : public View ~VChannelList(); void setList(ChannelList* chanList); + void highlightChannel(Channel* channel); int handleCommand(int command); void draw(); diff --git a/vvideolive.cc b/vvideolive.cc index e7dabd6..7fb9685 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -22,7 +22,7 @@ VVideoLive* VVideoLive::instance = NULL; -VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType) +VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType, VChannelList* tvchannelList) { instance = this; vdr = VDR::getInstance(); @@ -30,6 +30,8 @@ VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType) video = Video::getInstance(); chanList = tchanList; + vchannelList = tvchannelList; + currentChannel = 0; previousChannel = 0; unavailable = 0; @@ -83,6 +85,8 @@ int VVideoLive::handleCommand(int command) { if (unavailable) showUnavailable(0); else stop(); + + vchannelList->highlightChannel((*chanList)[currentChannel]); return 4; } // Take up and down from new remote and do live banner diff --git a/vvideolive.h b/vvideolive.h index 3757324..8d2d1c5 100644 --- a/vvideolive.h +++ b/vvideolive.h @@ -41,13 +41,13 @@ #include "wtextbox.h" class VEpg; - +class VChannelList; class VLiveBanner; class VVideoLive : public View { public: - VVideoLive(ChannelList* chanList, ULONG streamType); + VVideoLive(ChannelList* chanList, ULONG streamType, VChannelList* vchannelList); ~VVideoLive(); static VVideoLive* getInstance(); void draw(); @@ -77,6 +77,7 @@ class VVideoLive : public View Video* video; Player* player; ChannelList* chanList; + VChannelList* vchannelList; UINT currentChannel; // index in list UINT previousChannel; // index in list int unavailable; -- 2.39.2