]> git.vomp.tv Git - vompclient.git/commitdiff
Message tweaks r0-0-17
authorChris Tallon <chris@vomp.tv>
Wed, 14 Dec 2005 17:37:08 +0000 (17:37 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 14 Dec 2005 17:37:08 +0000 (17:37 +0000)
language-data.h
message.h
vchannellist.cc
vepg.cc
viewman.cc
vvideolive.cc
vvideolive.h

index bdbb189ba998e3d4083c08dcdb0ccd1e88d1d399..7c21df04738bcd5af9eff476373f1ab5b45444e6 100644 (file)
@@ -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",
     "",
index 4caf10d31eb141bbc97a099503d36b3774fb5a4f..7c0f478a7ddc32e3a8b07a4bf3988c23a8cb40fe 100644 (file)
--- 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
index 364856140b988bca237150f6f3202c43636b5b26..e4f8d8d3462e9a8b314352d31ed1dafbc7b5548a 100644 (file)
@@ -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 50c9d479fe96de3e2ee678bec21c2c996eeda383..4b65cb11b593bab637ed7892bfb260b74d5f9b9e 100644 (file)
--- 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)
     }\r
     case Remote::RECORD:\r
     {\r
-      //TODO\r
+      //TODO FIXME\r
       return 2;\r
     }\r
     case Remote::PLAY:\r
@@ -362,7 +362,14 @@ int VEpg::handleCommand(int command)
     case Remote::GUIDE:\r
     {\r
       // return to normal TV mode\r
-      if (videoLive) videoLive->resetPictureSize(); // ptr check done in case being tested from videorec\r
+      if (videoLive) // ptr check done in case being tested from videorec\r
+      {\r
+        Message* m = new Message();
+        m->from = this;
+        m->to = videoLive;
+        m->message = Message::EPG_CLOSE;
+        ViewMan::getInstance()->postMessage(m);
+      }
       return 4;\r
     }\r
     case Remote::CHANNELUP:\r
@@ -557,6 +564,8 @@ void VEpg::setCurrentChannel(char* chname)
 void VEpg::paintCell(Event* event, int yOffset, Colour bg, Colour fg)\r
 {\r
   int w, x, y, h;\r
+  w = x = 0; // keep compiler happy
+
   y =yOffset;\r
   h = Surface::getFontHeight(); // TODO if want border around text, need to increae this and wselectlist line height\r
   UINT end = event->time + event->duration; // programme end time\r
index f8180589e4d0df1bb6d7e843bfcf40123995a5e6..0ddc9201c2d08e17e283121c2a8ce0ff8089d96e 100644 (file)
@@ -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);
index 5321c51a5bf2af8fb0fe5a757b3bfed9bd3b2d46..1c10622c74e7db3672f5e8d1ed6e1031f45864f2 100644 (file)
@@ -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);
-}
index 2f1e72282b4c0c5dd9fd4bb55606c69a23670e61..75cf2751f7f3d00d2c3824b1dfb39f78c10e548c 100644 (file)
@@ -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