From d37832cefd3802e4da0262d4672e3492ab3e703c Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 23 Jul 2005 22:34:24 +0000 Subject: [PATCH] Clean up of all video init system, NTSC/PAL, screen size functions. Support for S-Video --- command.cc | 67 +++++++++++++++++++++++----- main.cc | 108 ++++++++++++++-------------------------------- mtd.cc | 4 +- mtd.h | 2 +- osd.cc | 27 +++--------- osd.h | 12 +----- player.cc | 14 +++--- vchannellist.cc | 2 +- vchannellist.h | 1 + video.cc | 98 +++++++++++++++++++++++++++-------------- video.h | 15 ++++--- vlivebanner.cc | 2 +- vlivebanner.h | 2 +- vmute.cc | 2 +- vmute.h | 2 +- vrecordinglist.cc | 2 +- vrecordinglist.h | 1 + vrecordingmenu.cc | 6 +-- vrecordingmenu.h | 2 +- vserverselect.cc | 2 +- vserverselect.h | 2 +- vvideolive.cc | 3 +- vvideorec.cc | 9 +++- vvolume.cc | 2 +- vvolume.h | 2 +- vwallpaper.cc | 6 +-- vwallpaper.h | 1 + vwelcome.cc | 4 +- vwelcome.h | 2 +- 29 files changed, 217 insertions(+), 185 deletions(-) diff --git a/command.cc b/command.cc index 7c4285d..125f82b 100644 --- a/command.cc +++ b/command.cc @@ -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 4bd36b6..7f130bf 100644 --- 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 f5d900c..100097e 100644 --- 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 0e3f7de..aca0b9f 100644 --- 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 5040dbf..9b7814c 100644 --- 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 04cc8a0..db77333 100644 --- 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; }; diff --git a/player.cc b/player.cc index e7d7d04..4cbef18 100644 --- 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() diff --git a/vchannellist.cc b/vchannellist.cc index 3550e14..17a98d2 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -22,7 +22,7 @@ VChannelList::VChannelList(ULONG type) { - if (Osd::getInstance()->getScreenSize() == Osd::PAL) + if (Video::getInstance()->getFormat() == Video::PAL) { setScreenPos(80, 70); } diff --git a/vchannellist.h b/vchannellist.h index c7b1973..69fd479 100644 --- a/vchannellist.h +++ b/vchannellist.h @@ -35,6 +35,7 @@ #include "vvideolive.h" #include "vradiolive.h" #include "colour.h" +#include "video.h" class VChannelList : public View { diff --git a/video.cc b/video.cc index 53907ad..1a8ee98 100644 --- 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 ba6ff77..6bd9dd2 100644 --- 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 diff --git a/vlivebanner.cc b/vlivebanner.cc index b50ca90..278e8ef 100644 --- a/vlivebanner.cc +++ b/vlivebanner.cc @@ -22,7 +22,7 @@ VLiveBanner::VLiveBanner() { - if (Osd::getInstance()->getScreenSize() == Osd::PAL) + if (Video::getInstance()->getFormat() == Video::PAL) { setScreenPos(130, 370); } diff --git a/vlivebanner.h b/vlivebanner.h index 9055589..8e5bd80 100644 --- a/vlivebanner.h +++ b/vlivebanner.h @@ -29,7 +29,7 @@ #include "vdr.h" #include "wselectlist.h" #include "colour.h" -#include "osd.h" +#include "video.h" class VLiveBanner : public View { diff --git a/vmute.cc b/vmute.cc index 4233a9e..b4df999 100644 --- 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 c89d324..fb393b4 100644 --- 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 { diff --git a/vrecordinglist.cc b/vrecordinglist.cc index 6eb572d..59a9135 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -22,7 +22,7 @@ VRecordingList::VRecordingList() { - if (Osd::getInstance()->getScreenSize() == Osd::PAL) + if (Video::getInstance()->getFormat() == Video::PAL) { setScreenPos(80, 70); } diff --git a/vrecordinglist.h b/vrecordinglist.h index 2044f40..c13468b 100644 --- a/vrecordinglist.h +++ b/vrecordinglist.h @@ -36,6 +36,7 @@ #include "vdr.h" #include "vvideorec.h" #include "colour.h" +#include "video.h" class VRecordingList : public View { diff --git a/vrecordingmenu.cc b/vrecordingmenu.cc index 63c402e..5212c2b 100644 --- a/vrecordingmenu.cc +++ b/vrecordingmenu.cc @@ -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); } diff --git a/vrecordingmenu.h b/vrecordingmenu.h index 816b1da..e589f5f 100644 --- a/vrecordingmenu.h +++ b/vrecordingmenu.h @@ -34,7 +34,7 @@ #include "vinfo.h" #include "vdr.h" #include "colour.h" -#include "osd.h" +#include "video.h" class VRecordingList; diff --git a/vserverselect.cc b/vserverselect.cc index ddc140a..3d6ee3e 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -28,7 +28,7 @@ VServerSelect::VServerSelect(std::vector* 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); } diff --git a/vserverselect.h b/vserverselect.h index 423b3bb..81ec597 100644 --- a/vserverselect.h +++ b/vserverselect.h @@ -30,7 +30,7 @@ #include "remote.h" #include "wselectlist.h" #include "colour.h" -#include "osd.h" +#include "video.h" class VServerSelect : public View { diff --git a/vvideolive.cc b/vvideolive.cc index 431c48d..d09bbba 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -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); } diff --git a/vvideorec.cc b/vvideorec.cc index 70707e9..9ac4089 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -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; diff --git a/vvolume.cc b/vvolume.cc index 6408dc5..441a7ef 100644 --- a/vvolume.cc +++ b/vvolume.cc @@ -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); } diff --git a/vvolume.h b/vvolume.h index 380dca4..893b0d0 100644 --- 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 { diff --git a/vwallpaper.cc b/vwallpaper.cc index 6b149f3..101bc15 100644 --- a/vwallpaper.cc +++ b/vwallpaper.cc @@ -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); diff --git a/vwallpaper.h b/vwallpaper.h index 0154ff3..721c73a 100644 --- a/vwallpaper.h +++ b/vwallpaper.h @@ -29,6 +29,7 @@ #include "osd.h" #include "surface.h" +#include "video.h" class VWallpaper : public View { diff --git a/vwelcome.cc b/vwelcome.cc index 1cd1031..d17e070 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -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); } diff --git a/vwelcome.h b/vwelcome.h index 417a169..a5c3b58 100644 --- a/vwelcome.h +++ b/vwelcome.h @@ -36,7 +36,7 @@ #include "command.h" #include "message.h" #include "colour.h" -#include "osd.h" +#include "video.h" class VWelcome : public View { -- 2.39.5