]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Clean up of all video init system, NTSC/PAL, screen size functions.
authorChris Tallon <chris@vomp.tv>
Sat, 23 Jul 2005 22:34:24 +0000 (22:34 +0000)
committerChris Tallon <chris@vomp.tv>
Sat, 23 Jul 2005 22:34:24 +0000 (22:34 +0000)
Support for S-Video

29 files changed:
command.cc
main.cc
mtd.cc
mtd.h
osd.cc
osd.h
player.cc
vchannellist.cc
vchannellist.h
video.cc
video.h
vlivebanner.cc
vlivebanner.h
vmute.cc
vmute.h
vrecordinglist.cc
vrecordinglist.h
vrecordingmenu.cc
vrecordingmenu.h
vserverselect.cc
vserverselect.h
vvideolive.cc
vvideorec.cc
vvolume.cc
vvolume.h
vwallpaper.cc
vwallpaper.h
vwelcome.cc
vwelcome.h

index 7c4285ddfb13ac880263211126871ba9055d2dec..125f82bfc49014f7e320e364cc2f90575667f95c 100644 (file)
@@ -78,17 +78,19 @@ void Command::run()
 
   mainPid = getpid();
 
-  UCHAR screenSize = Osd::getInstance()->getScreenSize();
+  Video* video = Video::getInstance();
+
+  UCHAR screenSize = video->getFormat();
 
   // moved from startup because surface delete doesn't work
 
   // just in case
-  Video::getInstance()->signalOn();
+  video->signalOn();
   Led::getInstance()->on();
 
   // Blue background
   View* v = new View();
-  v->setDimensions(Osd::getInstance()->getScreenHeight(), Osd::getInstance()->getScreenWidth());
+  v->setDimensions(video->getScreenHeight(), video->getScreenWidth());
   v->setBackgroundColour(Colour::VIDEOBLUE);
   v->draw();
   v->show();
@@ -97,14 +99,14 @@ void Command::run()
 
   // Wallpaper
   VWallpaper* w = new VWallpaper();
-  if (screenSize == Osd::PAL)
+  if (screenSize == Video::PAL)
   {
-    Log::getInstance()->log("Command", Log::DEBUG, "PAL wallpaper selected");
+    logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
     w->init("/wallpaperPAL.jpg");
   }
   else
   {
-    Log::getInstance()->log("Command", Log::DEBUG, "NTSC wallpaper selected");
+    logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
     w->init("/wallpaperNTSC.jpg");
   }
   w->draw();
@@ -172,7 +174,7 @@ void Command::run()
 
       if (state == 3)
       {
-        Log::getInstance()->log("Command", Log::DEBUG, "Server selected: %i", selectServer);
+        logger->log("Command", Log::DEBUG, "Server selected: %i", selectServer);
 
         int success = connectToServer(selectServer);
         clearServerIPs();
@@ -184,6 +186,49 @@ void Command::run()
           vw->show();
           viewman->add(vw);
           state = 4;
+
+          // test area for just after connect
+          char* svideo = VDR::getInstance()->configLoad("TV", "S-Video");
+
+          if (svideo)
+          {
+            if (!strcasecmp(svideo, "Yes"))
+            {
+              logger->log("Command", Log::INFO, "Switching to S-Video as S-Video=%s", svideo);
+              video->setConnection(Video::SVIDEO);
+            }
+            else
+            {
+              logger->log("Command", Log::INFO, "Leaving video output as S-Video=%s", svideo);
+            }
+          }
+          else
+          {
+            logger->log("Command", Log::INFO, "Config TV/S-Video not found");
+          }
+
+/*
+
+          if ((isWidescreen != NULL) && (!strcmp(isWidescreen, "Yes")))
+          {
+            logger->log("Command", Log::DEBUG, "Setting 16x9");
+
+            int a = video->setAspectRatio(Video::ASPECT16X9);
+            printf("success = %i\n", a);
+            video->reset();
+          }
+          else
+          {
+            //temp
+            logger->log("Command", Log::DEBUG, "Setting 4x3");
+            int a = video->setAspectRatio(Video::ASPECT4X3);
+            printf("success = %i\n", a);
+            video->reset();
+          }
+*/
+
+          // end of test area
+
         }
         else
         {
@@ -215,7 +260,7 @@ void Command::postMessage(Message* m)
 
 void Command::processMessage(Message* m)
 {
-  Log::getInstance()->log("Command", Log::DEBUG, "processing message %i", m->message);
+  logger->log("Command", Log::DEBUG, "processing message %i", m->message);
 
   switch(m->message)
   {
@@ -287,7 +332,7 @@ void Command::broadcastForServers()
 {
   VInfo* viewWait = new VInfo();
   viewWait->setDimensions(200, 400);
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     viewWait->setScreenPos(170, 200);
   }
@@ -319,7 +364,7 @@ int Command::connectToServer(int vectorIndex)
 
   VInfo* viewWait = new VInfo();
   viewWait->setDimensions(200, 400);
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     viewWait->setScreenPos(170, 200);
   }
@@ -336,7 +381,7 @@ int Command::connectToServer(int vectorIndex)
 
   if (success)
   {
-    Log::getInstance()->log("Command", Log::DEBUG, "Connected ok, doing login");
+    logger->log("Command", Log::DEBUG, "Connected ok, doing login");
     success = vdr->doLogin();
 
     if (success)
diff --git a/main.cc b/main.cc
index 4bd36b692bfcb104211b657e3f52ef7748d8fdda..7f130bf844f43afbbcf792c232607224ec9c3de7 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -57,9 +57,6 @@ VDR* vdr;
 Video* video;
 Audio* audio;
 
-int SCREENWIDTH = 0;
-int SCREENHEIGHT = 0;
-
 int main(int argc, char** argv)
 {
   if ((argc > 1) && (!strcmp(argv[1], "-d"))) debugEnabled = 1;
@@ -174,102 +171,63 @@ int main(int argc, char** argv)
     shutdown(1);
   }
 
-  // Need to init SCREENWIDTH, SCREENHEIGHT and ready the pal/ntsc connection stuff immediately
-  UCHAR videoFormat = 0;
-  UCHAR videoConnection = 0;
+  UCHAR videoFormat = (UCHAR)mtd->getPALorNTSC();
+  if      (videoFormat == Video::PAL)  logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576");
+  else if (videoFormat == Video::NTSC) logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480");
+  else                                 logger->log("Core", Log::INFO, "No help from MTD. Assuming NTSC 720x480");
 
-  short mtdVideoMode = mtd->getVideoMode();
-  if (mtdVideoMode == 0)
-  {
-    SCREENWIDTH = 720;
-    SCREENHEIGHT = 480;
-    videoFormat = Video::NTSC;
-    videoConnection = Video::COMPOSITE;
-    logger->log("Core", Log::INFO, "Read from MTD: NTSC 720x480 composite");
-  }
-  else if (mtdVideoMode == 1)
-  {
-    SCREENWIDTH = 720;
-    SCREENHEIGHT = 576;
-    videoFormat = Video::PAL;
-    videoConnection = Video::SCART;
-    logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576 RGB");
-  }
-  else if (mtdVideoMode == 2)
-  {
-    SCREENWIDTH = 720;
-    SCREENHEIGHT = 576;
-    videoFormat = Video::PAL;
-    videoConnection = Video::COMPOSITE;
-    logger->log("Core", Log::INFO, "Read from MTD: PAL 720x576 composite");
-  }
-  else
-  {
-    // ?
-
-    SCREENWIDTH = 720;
-    SCREENHEIGHT = 480;
-    videoFormat = Video::NTSC;
-    videoConnection = Video::COMPOSITE;
-    logger->log("Core", Log::INFO, "MTD gave us no help. Guessing NTSC.");
-  }
-
-  // temp hack - simulate ntsc on pal
-//  SCREENHEIGHT = 480;
-//  videoFormat = Video::NTSC;
-
-  success = osd->init("/dev/stbgfx", SCREENHEIGHT, SCREENWIDTH, videoFormat, 1);
+  success = video->init(videoFormat);
   if (success)
   {
-    logger->log("Core", Log::INFO, "OSD module initialised");
+    logger->log("Core", Log::INFO, "Video module initialised");
   }
   else
   {
-    logger->log("Core", Log::EMERG, "OSD module failed to initialise");
+    logger->log("Core", Log::EMERG, "Video module failed to initialise");
     shutdown(1);
   }
 
-  success = vdr->init(3024);
+  success = osd->init("/dev/stbgfx", 1);
   if (success)
   {
-    logger->log("Core", Log::INFO, "VDR module initialised");
+    logger->log("Core", Log::INFO, "OSD module initialised");
   }
   else
   {
-    logger->log("Core", Log::EMERG, "VDR module failed to initialise");
+    logger->log("Core", Log::EMERG, "OSD module failed to initialise");
     shutdown(1);
   }
 
-  success = video->init(videoFormat, videoConnection, Video::ASPECT4X3, Video::NORMAL);
+  success = audio->init(Audio::MPEG2_PES);
   if (success)
   {
-    logger->log("Core", Log::INFO, "Video module initialised");
+    logger->log("Core", Log::INFO, "Audio module initialised");
   }
   else
   {
-    logger->log("Core", Log::EMERG, "Video module failed to initialise");
+    logger->log("Core", Log::EMERG, "Audio module failed to initialise");
     shutdown(1);
   }
 
-  success = audio->init(Audio::MPEG2_PES);
+  success = viewman->init();
   if (success)
   {
-    logger->log("Core", Log::INFO, "Audio module initialised");
+    logger->log("Core", Log::INFO, "ViewMan module initialised");
   }
   else
   {
-    logger->log("Core", Log::EMERG, "Audio module failed to initialise");
+    logger->log("Core", Log::EMERG, "ViewMan module failed to initialise");
     shutdown(1);
   }
 
-  success = viewman->init();
+  success = vdr->init(3024);
   if (success)
   {
-    logger->log("Core", Log::INFO, "ViewMan module initialised");
+    logger->log("Core", Log::INFO, "VDR module initialised");
   }
   else
   {
-    logger->log("Core", Log::EMERG, "ViewMan module failed to initialise");
+    logger->log("Core", Log::EMERG, "VDR module failed to initialise");
     shutdown(1);
   }
 
@@ -310,6 +268,13 @@ void shutdown(int code)
     logger->log("Core", Log::NOTICE, "Command module shut down");
   }
 
+  if (vdr)
+  {
+    vdr->shutdown();
+    delete vdr;
+    logger->log("Core", Log::NOTICE, "VDR module shut down");
+  }
+
   if (viewman)
   {
     viewman->shutdown();
@@ -317,6 +282,13 @@ void shutdown(int code)
     logger->log("Core", Log::NOTICE, "ViewMan module shut down");
   }
 
+  if (osd)
+  {
+    osd->shutdown();
+    delete osd;
+    logger->log("Core", Log::NOTICE, "OSD module shut down");
+  }
+
   if (audio)
   {
     audio->shutdown();
@@ -331,20 +303,6 @@ void shutdown(int code)
     logger->log("Core", Log::NOTICE, "Video module shut down");
   }
 
-  if (vdr)
-  {
-    vdr->shutdown();
-    delete vdr;
-    logger->log("Core", Log::NOTICE, "VDR module shut down");
-  }
-
-  if (osd)
-  {
-    osd->shutdown();
-    delete osd;
-    logger->log("Core", Log::NOTICE, "OSD module shut down");
-  }
-
   if (mtd)
   {
     mtd->shutdown();
diff --git a/mtd.cc b/mtd.cc
index f5d900ce319e26d5b439521b4b68307cfd1019ba..100097e0e8787407a1f0b4e3ec87e25e956df22c 100644 (file)
--- a/mtd.cc
+++ b/mtd.cc
@@ -72,7 +72,7 @@ int Mtd::shutdown()
   return 1;
 }
 
-short Mtd::getVideoMode()
+short Mtd::getPALorNTSC()
 {
   return data[2119];
 }
@@ -116,7 +116,7 @@ void Mtd::logit()
 {
   Log* logger = Log::getInstance();
 
-  logger->log("MTD", Log::DEBUG, "Mode: %i", getVideoMode());
+  logger->log("MTD", Log::DEBUG, "Mode: %i", getPALorNTSC());
   logger->log("MTD", Log::DEBUG, "Aspect: %i", getAspect());
   logger->log("MTD", Log::DEBUG, "Flicker: %i", getFlicker());
   logger->log("MTD", Log::DEBUG, "Bootlogo output: %i", getBootLogoOutput());
diff --git a/mtd.h b/mtd.h
index 0e3f7de857eee7df0cb96364812b81e6cc98f775..aca0b9f05ba181cb1c2093d2a41c01f15c0d9fe4 100644 (file)
--- a/mtd.h
+++ b/mtd.h
@@ -55,7 +55,7 @@ class Mtd
     int init(char* device);
     int shutdown();
 
-    short getVideoMode();
+    short getPALorNTSC();
     short getAspect();
     short getFlicker();
     short getBootLogoOutput();
diff --git a/osd.cc b/osd.cc
index 5040dbfd4f9e4c0a6674f6a2d8e4e21119701ae9..9b7814c97b01711fee6498eab395bc15e5e0d1e4 100644 (file)
--- a/osd.cc
+++ b/osd.cc
@@ -50,22 +50,7 @@ int Osd::getFD()
   return fdOsd;
 }
 
-int Osd::getScreenHeight()
-{
-  return height;
-}
-
-int Osd::getScreenWidth()
-{
-  return width;
-}
-
-int Osd::getScreenSize()
-{
-  return screenSize;
-}
-
-int Osd::init(char* device, int height, int width, UCHAR tscreenSize, int doubleBuffering)
+int Osd::init(char* device, int doubleBuffering)
 {
   if (initted) return 0;
 
@@ -78,20 +63,18 @@ int Osd::init(char* device, int height, int width, UCHAR tscreenSize, int double
 
   initted = 1; // must set this here or create surface won't work
 
-  this->height = height;
-  this->width = width;
-  screenSize = tscreenSize;
-
   Surface::initConversionTables();
 
+  Video* video = Video::getInstance();
+
   screen = new Surface(fdOsd, Surface::SCREEN);
-  screen->create(height, width);
+  screen->create(video->getScreenHeight(), video->getScreenWidth());
   screen->display();
 
   if (doubleBuffering)
   {
     buffer = new Surface(fdOsd, Surface::BUFFER);
-    buffer->create(height, width);
+    buffer->create(video->getScreenHeight(), video->getScreenWidth());
   }
   else
   {
diff --git a/osd.h b/osd.h
index 04cc8a0c90f3e1085a68d7c5b180094c93be20e2..db773337186dd37078a382c7308fe443c52598d5 100644 (file)
--- a/osd.h
+++ b/osd.h
@@ -28,6 +28,7 @@
 #include "defines.h"
 #include "log.h"
 #include "surface.h"
+#include "video.h"
 
 class Osd
 {
@@ -36,20 +37,13 @@ class Osd
     ~Osd();
     static Osd* getInstance();
 
-    int init(char* device, int height, int width, UCHAR tscreenSize, int doubleBuffering);
+    int init(char* device, int doubleBuffering);
     int shutdown();
 
     int getFD();
-    int getScreenHeight();
-    int getScreenWidth();
-    int getScreenSize();
 
     void screenShot(char* fileName);
 
-    // Video formats - AV_SET_VID_DISP_FMT  // here, video, everywhere!
-    const static UCHAR NTSC = 0;
-    const static UCHAR PAL = 1;
-
   private:
     static Osd* instance;
     int initted;
@@ -58,8 +52,6 @@ class Osd
     Surface* buffer;
 
     int fdOsd;
-    int width;
-    int height;
     UCHAR screenSize;
 };
 
index e7d7d04de9847a1417daee705ae4210e433630f6..4cbef18a9219b0ffef2061b1b3394e1876e91af8 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -254,16 +254,20 @@ void Player::test()
 {
   Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST");
 
-//  video->test();
+/*
 
-//  static int flipflop = 0;
+//  video->test();
 
-//  if (flipflop) video->setAspectRatio(Video::ASPECT16X9);
-//  else video->setAspectRatio(Video::ASPECT4X3);
+  static int flipflop = 0;
 
-//  flipflop = !flipflop;
+  int a;
+  if (flipflop) a = video->setAspectRatio(Video::ASPECT16X9);
+  else a = video->setAspectRatio(Video::ASPECT4X3);
 
+  flipflop = !flipflop;
 
+  printf("A = %i\n", a);
+*/
 }
 
 void Player::test2()
index 3550e14a6741a5da4de14fc18698db5dda9b1db3..17a98d2290651b996614935ec1661e43e9b73f42 100644 (file)
@@ -22,7 +22,7 @@
 
 VChannelList::VChannelList(ULONG type)
 {
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(80, 70);
   }
index c7b197372c659a101d88e65dee19670ddefba817..69fd479111983a1eee9676ae518817d02cc978e9 100644 (file)
@@ -35,6 +35,7 @@
 #include "vvideolive.h"
 #include "vradiolive.h"
 #include "colour.h"
+#include "video.h"
 
 class VChannelList : public View
 {
index 53907ad93357269007986c5f22f03f30a399e575..1a8ee98cd88fbecffc0700125bde700bf670d1ae 100644 (file)
--- a/video.cc
+++ b/video.cc
@@ -34,6 +34,9 @@ Video::Video()
   connection = 0;
   aspectRatio = 0;
   mode = 0;
+
+  screenWidth = 0;
+  screenHeight = 0;
 }
 
 Video::~Video()
@@ -46,37 +49,25 @@ Video* Video::getInstance()
   return instance;
 }
 
-int Video::init(UCHAR format, UCHAR connection, UCHAR aspectRatio, UCHAR mode)
+int Video::init(UCHAR tformat)
 {
   if (initted) return 0;
   initted = 1;
 
-//  if ((fdVideo = open("/dev/vdec_dev", O_RDWR | O_NONBLOCK)) < 0) return 0;
   if ((fdVideo = open("/dev/vdec_dev", O_WRONLY)) < 0) return 0;
 
-  this->format = format;
-  this->connection = connection;
-  this->aspectRatio = aspectRatio;
-  this->mode = mode;
-
-  if (!initAllParams())
-  {
-    shutdown();
-    return 0;
-  }
+  if (!setFormat(tformat))           { shutdown(); return 0; }
+  if (!setConnection(COMPOSITERGB))  { shutdown(); return 0; }
+  if (!setAspectRatio(ASPECT4X3))    { shutdown(); return 0; }
+  if (!setMode(NORMAL))              { shutdown(); return 0; }
+  if (!setSource())                  { shutdown(); return 0; }
+  if (!attachFrameBuffer())          { shutdown(); return 0; }
 
-  attachFrameBuffer();
   stop();
 
   return 1;
 }
 
-int Video::initAllParams()
-{
-  return (setFormat(format) && setConnection(connection) &&
-          setAspectRatio(aspectRatio) && setMode(mode) && setSource());
-}
-
 int Video::shutdown()
 {
   if (!initted) return 0;
@@ -90,47 +81,75 @@ int Video::write(char *buf, int len)
   return 1;//write(fdVideo, buf, len);
 }
 
-int Video::setFormat(UCHAR format)
+int Video::checkSCART()
+{
+  // Returns 3 for SCART Composite out
+  // Returns 3 for SCART S-Video out
+  // Returns 2 for SCART RGB out
+  // Returns 3 for SCART not plugged in
+
+  // So, as you can have RGB and composite out simultaneously,
+  // and it can't detect S-Video, what is the point of this?
+
+  int scart;
+  if (ioctl(fdVideo, AV_CHK_SCART, &scart) != 0) return -10;
+
+  return scart;
+}
+
+int Video::setFormat(UCHAR tformat)
 {
   if (!initted) return 0;
-  if ((format != PAL) && (format != NTSC)) return 0;
+  if ((tformat != PAL) && (tformat != NTSC)) return 0;
+  format = tformat;
 
   if (ioctl(fdVideo, AV_SET_VID_DISP_FMT, format) != 0) return 0;
-  this->format = format;
+
+  if (format == NTSC)
+  {
+    screenWidth = 720;
+    screenHeight = 480;
+  }
+  if (format == PAL)
+  {
+    screenWidth = 720;
+    screenHeight = 576;
+  }
+
   return 1;
 }
 
-int Video::setConnection(UCHAR connection)
+int Video::setConnection(UCHAR tconnection)
 {
   if (!initted) return 0;
-  if ((connection != SCART) && (connection != COMPOSITE) && (connection != SVIDEO)) return 0;
+  if ((tconnection != COMPOSITERGB) && (tconnection != SVIDEO)) return 0;
+  connection = tconnection;
 
   if (ioctl(fdVideo, AV_SET_VID_OUTPUT, connection) != 0) return 0;
-  this->connection = connection;
   return 1;
 }
 
-int Video::setAspectRatio(UCHAR aspectRatio)
+int Video::setAspectRatio(UCHAR taspectRatio)
 {
   if (!initted) return 0;
-  if ((aspectRatio != ASPECT4X3) && (aspectRatio != ASPECT16X9)) return 0;
+  if ((taspectRatio != ASPECT4X3) && (taspectRatio != ASPECT16X9)) return 0;
+  aspectRatio = taspectRatio;
 
   if (ioctl(fdVideo, AV_SET_VID_RATIO, aspectRatio) != 0) return 0;
-  this->aspectRatio = aspectRatio;
   return 1;
 }
 
-int Video::setMode(UCHAR mode)
+int Video::setMode(UCHAR tmode)
 {
   if (!initted) return 0;
 
-  if ((mode != NORMAL) && (mode != LETTERBOX) && (mode != UNKNOWN2) && (mode != QUARTER) && (mode != EIGHTH)
-      && (mode != ZOOM) && (mode != UNKNOWN6)) return 0;
+  if ((tmode != NORMAL) && (tmode != LETTERBOX) && (tmode != UNKNOWN2) && (tmode != QUARTER) && (tmode != EIGHTH)
+      && (tmode != ZOOM) && (tmode != UNKNOWN6)) return 0;
+  mode = tmode;
 
 //  mode = LETTERBOX;
 
   if (ioctl(fdVideo, AV_SET_VID_MODE, mode) != 0) return 0;
-  this->mode = mode;
   return 1;
 }
 
@@ -302,3 +321,18 @@ int Video::getFD()
 
   return fdVideo;
 }
+
+UCHAR Video::getFormat()
+{
+  return format;
+}
+
+UINT Video::getScreenWidth()
+{
+  return screenWidth;
+}
+
+UINT Video::getScreenHeight()
+{
+  return screenHeight;
+}
diff --git a/video.h b/video.h
index ba6ff779b7770c8d809cdb274bbb64c6f7efef54..6bd9dd26261bb4c564a769898aba95f2351159a6 100644 (file)
--- a/video.h
+++ b/video.h
@@ -41,7 +41,7 @@ class Video
     ~Video();
     static Video* getInstance();
 
-    int init(UCHAR format, UCHAR connection, UCHAR aspectRatio, UCHAR mode);
+    int init(UCHAR format);
     int shutdown();
 
     // Video formats - AV_SET_VID_DISP_FMT
@@ -49,8 +49,7 @@ class Video
     const static UCHAR PAL = 1;
 
     // Video connections - AV_SET_VID_OUTPUT
-    const static UCHAR SCART = 0;
-    const static UCHAR COMPOSITE = 1;
+    const static UCHAR COMPOSITERGB = 1;
     const static UCHAR SVIDEO = 2;
 
     // Video aspect ratios - AV_SET_VID_RATIO
@@ -93,19 +92,25 @@ class Video
     int write(char *buf, int len);
 
     int getFD();
+    UCHAR getFormat();
+    UINT getScreenWidth();
+    UINT getScreenHeight();
 
   private:
+    int checkSCART();
+
     static Video* instance;
     int initted;
 
-    int initAllParams();
-
     int fdVideo;
 
     UCHAR format;
     UCHAR connection;
     UCHAR aspectRatio;
     UCHAR mode;
+
+    UINT screenWidth;
+    UINT screenHeight;
 };
 
 #endif
index b50ca9089b267183623c140435937fb46ec740b7..278e8ef0d5dcc6ccc233519df29ef18d362d7eb5 100644 (file)
@@ -22,7 +22,7 @@
 
 VLiveBanner::VLiveBanner()
 {
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(130, 370);
   }
index 90555895d2d9bbe99e732f20d04836f46dabfc56..8e5bd8003215c2a091f0295280495b55dafbb45d 100644 (file)
@@ -29,7 +29,7 @@
 #include "vdr.h"
 #include "wselectlist.h"
 #include "colour.h"
-#include "osd.h"
+#include "video.h"
 
 class VLiveBanner : public View
 {
index 4233a9eb967758756726411d3c16430c924ecc79..b4df9994a41ae5475e727dedf5b5359b9b368064 100644 (file)
--- a/vmute.cc
+++ b/vmute.cc
@@ -24,7 +24,7 @@ VMute::VMute()
 {
   isMuted = Audio::getInstance()->toggleUserMute();
 
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(600, 500);
   }
diff --git a/vmute.h b/vmute.h
index c89d324d390de2c79e4904cf1c37c2284cc32605..fb393b467da726ed5f3fa43d1a36f0158fc040ff 100644 (file)
--- a/vmute.h
+++ b/vmute.h
@@ -28,7 +28,7 @@
 #include "audio.h"
 #include "wsymbol.h"
 #include "colour.h"
-#include "osd.h"
+#include "video.h"
 
 class VMute : public View
 {
index 6eb572d5dc0b3d6f2fa42a31cd6cea50cd2f2605..59a9135126ca52a259c3540cabf7cb8638985493 100644 (file)
@@ -22,7 +22,7 @@
 
 VRecordingList::VRecordingList()
 {
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(80, 70);
   }
index 2044f400a777dcab6b5f4b3ff1d69572e29aa0ca..c13468bc32f2fe00ad04e519f48104ab72f1ac28 100644 (file)
@@ -36,6 +36,7 @@
 #include "vdr.h"
 #include "vvideorec.h"
 #include "colour.h"
+#include "video.h"
 
 class VRecordingList : public View
 {
index 63c402e296e9e4aaa474a24cb36ee7f16c70ae53..5212c2b7013dbc8fc256b54ddee30be5192b8785 100644 (file)
@@ -24,7 +24,7 @@ VRecordingMenu::VRecordingMenu()
 {
   rec = NULL;
 
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(260, 190);
   }
@@ -117,7 +117,7 @@ int VRecordingMenu::handleCommand(int command)
       vi->setExitable();
       if (summary) vi->setMainText(summary);
       else vi->setMainText("Summary unavailable");
-      if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+      if (Video::getInstance()->getFormat() == Video::PAL)
       {
         vi->setScreenPos(120, 130);
       }
@@ -146,7 +146,7 @@ int VRecordingMenu::handleCommand(int command)
       v->setTitleText("Delete recording");
       v->setMainText("Are you sure you want to delete this recording?");
       v->setDefault(VQuestion::NO);
-      if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+      if (Video::getInstance()->getFormat() == Video::PAL)
       {
         v->setScreenPos(230, 160);
       }
index 816b1da8af45eaf228becd44b42aca822c0db81d..e589f5ff8a92ad2b377f7857318e70b11e942314 100644 (file)
@@ -34,7 +34,7 @@
 #include "vinfo.h"
 #include "vdr.h"
 #include "colour.h"
-#include "osd.h"
+#include "video.h"
 
 class VRecordingList;
 
index ddc140a5b08ac70a36423d7fc52dfbb7d45dd9f9..3d6ee3e7519efce7b2d3027f2f608ddd79ee2c01 100644 (file)
@@ -28,7 +28,7 @@ VServerSelect::VServerSelect(std::vector<char*>* serverIPs, int* tselectServer)
   // anyway, now it doesn't use a object wide reference.
   selectServer = tselectServer;
 
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(220, 200);
   }
index 423b3bbf69697655a63ae77b9396e851fdf43d1c..81ec5977753aa8c26d12bcf99727f188342f26b0 100644 (file)
@@ -30,7 +30,7 @@
 #include "remote.h"
 #include "wselectlist.h"
 #include "colour.h"
-#include "osd.h"
+#include "video.h"
 
 class VServerSelect : public View
 {
index 431c48dcc39124f1b3e39a46b9a0067bd24aed55..d09bbbad50b68b4961fbacb319d575816c3836d4 100644 (file)
@@ -28,7 +28,8 @@ VVideoLive::VVideoLive(List* tchanList)
   chanList = tchanList;
   currentChannel = 0;
 
-  setDimensions(Osd::getInstance()->getScreenHeight(), Osd::getInstance()->getScreenWidth());
+  Video* video = Video::getInstance();
+  setDimensions(video->getScreenHeight(), video->getScreenWidth());
   Colour transparent(0, 0, 0, 0);
   setBackgroundColour(transparent);
 }
index 70707e9379d02fc4ac829d9fba61e552351bf32e..9ac408916af3e31f453a085ace4c1152f9ef7e7f 100644 (file)
@@ -28,7 +28,8 @@ VVideoRec::VVideoRec(Recording* rec)
 
   myRec = rec;
 
-  setDimensions(Osd::getInstance()->getScreenHeight(), Osd::getInstance()->getScreenWidth());
+  Video* video = Video::getInstance();
+  setDimensions(video->getScreenHeight(), video->getScreenWidth());
   Colour transparent(0, 0, 0, 0);
   setBackgroundColour(transparent);
 }
@@ -106,6 +107,12 @@ int VVideoRec::handleCommand(int command)
 //      return 2;
 //    }
 
+    case Remote::RED:
+    {
+      player->test();
+      return 2;
+    }
+
     case Remote::ZERO: player->jumpToPercent(0); return 2;
     case Remote::ONE: player->jumpToPercent(10); return 2;
     case Remote::TWO: player->jumpToPercent(20); return 2;
index 6408dc57081e5ad0575621e0ccc556e71512326a..441a7ef014d95b39e604bcc28381b0724bed209b 100644 (file)
@@ -24,7 +24,7 @@ VVolume::VVolume()
 {
   displayVolume = Audio::getInstance()->getVolume();
 
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(100, 499);
   }
index 380dca4ea1ec235a09bc77558add3b089e423f29..893b0d0050285752474a5e11f241cd2274524820 100644 (file)
--- a/vvolume.h
+++ b/vvolume.h
@@ -28,7 +28,7 @@
 #include "audio.h"
 #include "wsymbol.h"
 #include "colour.h"
-#include "osd.h"
+#include "video.h"
 
 class VVolume : public View
 {
index 6b149f397b3ce2efe24ba0b4a29bfc3e2d2f8937..101bc153845981d48d0383d030a5c0855d5d4db0 100644 (file)
@@ -34,12 +34,12 @@ void VWallpaper::init(char* name)
 {
   jpeg.init(name);
 
-  Osd* o = Osd::getInstance();
-  setDimensions(o->getScreenHeight(), o->getScreenWidth());
+  Video* video = Video::getInstance();
+  setDimensions(video->getScreenHeight(), video->getScreenWidth());
 
   // Now override the surface pointer found in Box to a seperate wallpaper surface
   // but only for the wjpeg, not for this object
-  wallpaperSurface = new Surface(o->getFD(), 0);
+  wallpaperSurface = new Surface(Osd::getInstance()->getFD(), 0);
   wallpaperSurface->create(height, width);
 
   jpeg.overrideSurface(wallpaperSurface);
index 0154ff3b18f2a570aa5203bc3d1f514a0c63a8cf..721c73a9f53769fceefc1ee21ed5c95ccb754b4d 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "osd.h"
 #include "surface.h"
+#include "video.h"
 
 class VWallpaper : public View
 {
index 1cd1031914748aadbdb6a6ed59809ed5c132e41a..d17e07048e7f959e01660e293c084aeaac8b2da3 100644 (file)
@@ -24,7 +24,7 @@ VWelcome::VWelcome()
 {
   setDimensions(190, 460);
 
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     setScreenPos(140, 170);
   }
@@ -193,7 +193,7 @@ void VWelcome::doRecordingsList()
 
   VInfo* viewWait = new VInfo();
   viewWait->setDimensions(190, 460);
-  if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+  if (Video::getInstance()->getFormat() == Video::PAL)
   {
     viewWait->setScreenPos(140, 170);
   }
index 417a16969a5caed1a353f15ef115c516247baec3..a5c3b584ff98aaf3236e780d0668677948694887 100644 (file)
@@ -36,7 +36,7 @@
 #include "command.h"
 #include "message.h"
 #include "colour.h"
-#include "osd.h"
+#include "video.h"
 
 class VWelcome : public View
 {