From a0ece0735315851b99963c492dce1ea70d03fb7b Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Wed, 14 Dec 2005 17:37:08 +0000 Subject: [PATCH] Message tweaks --- language-data.h | 12 ++++++++++++ message.h | 1 + vchannellist.cc | 3 ++- vepg.cc | 15 ++++++++++++--- viewman.cc | 2 +- vvideolive.cc | 35 +++++++++++++---------------------- vvideolive.h | 2 +- 7 files changed, 42 insertions(+), 28 deletions(-) diff --git a/language-data.h b/language-data.h index bdbb189..7c21df0 100644 --- a/language-data.h +++ b/language-data.h @@ -476,6 +476,12 @@ const I18n::tI18nPhrase I18n::Phrases[] = "EPG", "57", }, + { "OK", + "OK", + "OK", + "OK", + "57.5", + }, { "Page up", "Seite hoch", "", @@ -500,6 +506,12 @@ const I18n::tI18nPhrase I18n::Phrases[] = "+24 óra", "61", }, + { "Go: Preview", + "", + "", + "", + "61.5", + }, { "Guide / Back: Close", "EPG / Zurück: Schließen", "", diff --git a/message.h b/message.h index 4caf10d..7c0f478 100644 --- a/message.h +++ b/message.h @@ -57,6 +57,7 @@ class Message const static ULONG REDRAW_LANG = 18; const static ULONG TIMER = 19; const static ULONG EPG = 20; + const static ULONG EPG_CLOSE = 21; }; #endif diff --git a/vchannellist.cc b/vchannellist.cc index 3648561..e4f8d8d 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -201,12 +201,13 @@ int VChannelList::handleCommand(int command) // if (chan->type == VDR::RADIO) return 2; VVideoLive* v = new VVideoLive(chanList, chan->type); - v->channelChange(VVideoLive::NUMBER, chan->number); v->draw(); ViewMan::getInstance()->add(v); ViewMan::getInstance()->updateView(v); + v->channelChange(VVideoLive::NUMBER, chan->number); + return 2; } case Remote::BACK: diff --git a/vepg.cc b/vepg.cc index 50c9d47..4b65cb1 100644 --- a/vepg.cc +++ b/vepg.cc @@ -54,7 +54,7 @@ VEpg::VEpg(VVideoLive* v, UINT currentChannel) xpos = 60; ypos = 16; summaryLines = 8; - summaryLowerPadding = 12; + summaryLowerPadding = 16; chanNameYpos = 244; gridRows = 7; } @@ -341,7 +341,7 @@ int VEpg::handleCommand(int command) } case Remote::RECORD: { - //TODO + //TODO FIXME return 2; } case Remote::PLAY: @@ -362,7 +362,14 @@ int VEpg::handleCommand(int command) case Remote::GUIDE: { // return to normal TV mode - if (videoLive) videoLive->resetPictureSize(); // ptr check done in case being tested from videorec + if (videoLive) // ptr check done in case being tested from videorec + { + Message* m = new Message(); + m->from = this; + m->to = videoLive; + m->message = Message::EPG_CLOSE; + ViewMan::getInstance()->postMessage(m); + } return 4; } case Remote::CHANNELUP: @@ -557,6 +564,8 @@ void VEpg::setCurrentChannel(char* chname) void VEpg::paintCell(Event* event, int yOffset, Colour bg, Colour fg) { int w, x, y, h; + w = x = 0; // keep compiler happy + y =yOffset; h = Surface::getFontHeight(); // TODO if want border around text, need to increae this and wselectlist line height UINT end = event->time + event->duration; // programme end time diff --git a/viewman.cc b/viewman.cc index f818058..0ddc920 100644 --- a/viewman.cc +++ b/viewman.cc @@ -430,7 +430,7 @@ void ViewMan::processMessage(Message* m) removeView((View*)m->from); break; } - case Message::ADD_VIEW: + case Message::ADD_VIEW: // currently not used by anything but it might come in useful again { View* toAdd = (View*)m->parameter; add(toAdd); diff --git a/vvideolive.cc b/vvideolive.cc index 5321c51..1c10622 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -231,6 +231,11 @@ void VVideoLive::processMessage(Message* m) Log::getInstance()->log("VVideoLive", Log::DEBUG, "EPG requested from live banner"); showEPG(); } + else if (m->message == Message::EPG_CLOSE) + { + Video::getInstance()->setMode(videoMode); + if (saveUnavailable) showUnavailable(1); + } } void VVideoLive::doBanner(bool bannerTakesCommands) @@ -241,13 +246,9 @@ void VVideoLive::doBanner(bool bannerTakesCommands) VLiveBanner* vlb = new VLiveBanner(this, (*chanList)[currentChannel], bannerTakesCommands); - Message* m = new Message(); - m->from = this; - m->to = viewman; - m->message = Message::ADD_VIEW; - m->parameter = (ULONG)vlb; - - viewman->postMessage(m); + vlb->draw(); + viewman->add(vlb); + viewman->updateView(vlb); } void VVideoLive::doNoSuchChannel() @@ -277,14 +278,9 @@ void VVideoLive::showUnavailable(int active) unavailableView->setTitleText((*chanList)[currentChannel]->name); unavailableView->setOneLiner(tr("Channel unavailable")); unavailableView->setDropThrough(); - - Message* m = new Message(); - m->from = this; - m->to = viewman; - m->message = Message::ADD_VIEW; - m->parameter = (ULONG)unavailableView; - - viewman->postMessage(m); + unavailableView->draw(); + viewman->add(unavailableView); + viewman->updateView(unavailableView); } else { @@ -302,8 +298,8 @@ void VVideoLive::play(int noShowVLB) if (!available) { - showUnavailable(1); if (!noShowVLB) doBanner(false); + showUnavailable(1); } else { @@ -341,6 +337,7 @@ UINT VVideoLive::downChannel() void VVideoLive::showEPG() { + saveUnavailable = unavailable; if (unavailable) showUnavailable(0); if (VEpg::getInstance()) return; // already showing! @@ -354,9 +351,3 @@ void VVideoLive::showEPG() viewman->add(vepg); viewman->updateView(vepg); } - -void VVideoLive::resetPictureSize() -{ - // called by VEpg when it closes - Video::getInstance()->setMode(videoMode); -} diff --git a/vvideolive.h b/vvideolive.h index 2f1e722..75cf275 100644 --- a/vvideolive.h +++ b/vvideolive.h @@ -61,7 +61,6 @@ class VVideoLive : public View void play(int noShowVLB = 0); void stop(int noRemoveVLB = 0); - void resetPictureSize(); const static UCHAR INDEX = 1; const static UCHAR NUMBER = 2; @@ -90,6 +89,7 @@ class VVideoLive : public View void showEPG(); void doNoSuchChannel(); int videoMode; + int saveUnavailable; }; #endif -- 2.39.2