CC = /opt/crosstool/powerpc-405-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin/powerpc-405-linux-gnu-g++
STRIP = /opt/crosstool/powerpc-405-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin/powerpc-405-linux-gnu-strip
+
CXX = $(CC)
INCLUDES = -I../jpeg-6b
CXXFLAGS = -Wall -Woverloaded-virtual -Werror $(INCLUDES)
mainPid = getpid();
+ UCHAR screenSize = Osd::getInstance()->getScreenSize();
+
// moved from startup because surface delete doesn't work
// just in case
// Blue background
View* v = new View();
- v->setDimensions(SCREENHEIGHT, SCREENWIDTH);
+ v->setDimensions(Osd::getInstance()->getScreenHeight(), Osd::getInstance()->getScreenWidth());
v->setBackgroundColour(Colour::VIDEOBLUE);
v->draw();
v->show();
// Wallpaper
VWallpaper* w = new VWallpaper();
- w->init("/wallpaper.jpg");
+ if (screenSize == Osd::PAL)
+ {
+ Log::getInstance()->log("Command", Log::DEBUG, "PAL wallpaper selected");
+ w->init("/wallpaperPAL.jpg");
+ }
+ else
+ {
+ Log::getInstance()->log("Command", Log::DEBUG, "NTSC wallpaper selected");
+ w->init("/wallpaperNTSC.jpg");
+ }
w->draw();
w->show();
viewman->add(w);
{
VInfo* viewWait = new VInfo();
viewWait->setDimensions(200, 400);
- viewWait->setScreenPos(170, 200);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ viewWait->setScreenPos(170, 200);
+ }
+ else
+ {
+ viewWait->setScreenPos(160, 150);
+ }
viewWait->setMainText("\n Locating server");
viewWait->draw();
viewWait->show();
VInfo* viewWait = new VInfo();
viewWait->setDimensions(200, 400);
- viewWait->setScreenPos(170, 200);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ viewWait->setScreenPos(170, 200);
+ }
+ else
+ {
+ viewWait->setScreenPos(160, 150);
+ }
viewWait->setMainText("\n Connecting to VDR");
viewWait->draw();
viewWait->show();
#include "vwelcome.h"
#include "vmute.h"
#include "colour.h"
+#include "osd.h"
class Command : public MessageQueue
{
//#define SCREENHEIGHT 576
//#define SCREENHEIGHT 480
-extern int SCREENWIDTH;
-extern int SCREENHEIGHT;
+//extern int SCREENWIDTH;
+//extern int SCREENHEIGHT;
ULLONG htonll(ULLONG a);
ULLONG ntohll(ULLONG a);
videoFormat = Video::NTSC;
videoConnection = Video::COMPOSITE;
logger->log("Core", Log::INFO, "MTD gave us no help. Guessing NTSC.");
-
}
- success = osd->init("/dev/stbgfx", SCREENHEIGHT, SCREENWIDTH, 1);
+ // temp hack - simulate ntsc on pal
+// SCREENHEIGHT = 480;
+// videoFormat = Video::NTSC;
+
+ success = osd->init("/dev/stbgfx", SCREENHEIGHT, SCREENWIDTH, videoFormat, 1);
if (success)
{
logger->log("Core", Log::INFO, "OSD module initialised");
return width;
}
-int Osd::init(char* device, int height, int width, int doubleBuffering)
+int Osd::getScreenSize()
+{
+ return screenSize;
+}
+
+int Osd::init(char* device, int height, int width, UCHAR tscreenSize, int doubleBuffering)
{
if (initted) return 0;
this->height = height;
this->width = width;
+ screenSize = tscreenSize;
Surface::initConversionTables();
~Osd();
static Osd* getInstance();
- int init(char* device, int height, int width, int doubleBuffering);
+ int init(char* device, int height, int width, UCHAR tscreenSize, 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;
int fdOsd;
int width;
int height;
-
+ UCHAR screenSize;
};
#endif
return connected;
}
-int TCP::sendPacket(void* buf, size_t count)
+int TCP::sendPacket(void* bufR, size_t count)
{
size_t bytes_sent = 0;
int this_write;
int temp_write;
+ unsigned char* buf = (unsigned char*)bufR;
+
while (bytes_sent < count)
{
do
return(this_write);
}
bytes_sent += this_write;
- (unsigned char*)buf += this_write;
+ buf += this_write;
}
return(count);
}
VChannelList::VChannelList(ULONG type)
{
- setScreenPos(80, 70);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(80, 70);
+ }
+ else
+ {
+ setScreenPos(70, 35);
+ }
+
setDimensions(420, 570);
setBackgroundColour(Colour::VIEWBACKGROUND);
VLiveBanner::VLiveBanner()
{
- setScreenPos(130, 370);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(130, 370);
+ }
+ else
+ {
+ setScreenPos(120, 320);
+ }
+
setDimensions(120, 500);
setBackgroundColour(Colour::VIEWBACKGROUND);
#include "vdr.h"
#include "wselectlist.h"
#include "colour.h"
+#include "osd.h"
class VLiveBanner : public View
{
{
isMuted = Audio::getInstance()->toggleUserMute();
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(600, 500);
+ }
+ else
+ {
+ setScreenPos(590, 400);
+ }
+
setDimensions(40, 40);
- setScreenPos(600, 500);
setBackgroundColour(Colour::VIEWBACKGROUND);
}
#include "audio.h"
#include "wsymbol.h"
#include "colour.h"
+#include "osd.h"
class VMute : public View
{
VRecordingList::VRecordingList()
{
- setScreenPos(80, 70);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(80, 70);
+ }
+ else
+ {
+ setScreenPos(70, 35);
+ }
+
setDimensions(420, 570);
setBackgroundColour(Colour::VIEWBACKGROUND);
{
rec = NULL;
- setScreenPos(260, 190);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(260, 190);
+ }
+ else
+ {
+ setScreenPos(250, 160);
+ }
+
setDimensions(140, 200);
setBackgroundColour(Colour::VIEWBACKGROUND);
vi->setExitable();
if (summary) vi->setMainText(summary);
else vi->setMainText("Summary unavailable");
- vi->setScreenPos(120, 130);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ vi->setScreenPos(120, 130);
+ }
+ else
+ {
+ vi->setScreenPos(110, 90);
+ }
vi->setDimensions(300, 490);
ViewMan::getInstance()->addNoLock(vi);
v->setTitleText("Delete recording");
v->setMainText("Are you sure you want to delete this recording?");
v->setDefault(VQuestion::NO);
- v->setScreenPos(230, 160);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ v->setScreenPos(230, 160);
+ }
+ else
+ {
+ v->setScreenPos(220, 140);
+ }
v->setDimensions(180, 260);
ViewMan::getInstance()->addNoLock(v);
#include "vinfo.h"
#include "vdr.h"
#include "colour.h"
+#include "osd.h"
class VRecordingList;
// anyway, now it doesn't use a object wide reference.
selectServer = tselectServer;
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(220, 200);
+ }
+ else
+ {
+ setScreenPos(210, 150);
+ }
setDimensions(200, 300);
- setScreenPos(220, 200);
setBackgroundColour(Colour::VIEWBACKGROUND);
setTitleBarOn(1);
setTitleBarColour(Colour::TITLEBARBACKGROUND);
#include "remote.h"
#include "wselectlist.h"
#include "colour.h"
+#include "osd.h"
class VServerSelect : public View
{
chanList = tchanList;
currentChannel = 0;
- setDimensions(SCREENHEIGHT, SCREENWIDTH);
+ setDimensions(Osd::getInstance()->getScreenHeight(), Osd::getInstance()->getScreenWidth());
Colour transparent(0, 0, 0, 0);
setBackgroundColour(transparent);
}
#include "viewman.h"
#include "vchannelselect.h"
#include "colour.h"
+#include "osd.h"
class VVideoLive : public View
{
myRec = rec;
- setDimensions(SCREENHEIGHT, SCREENWIDTH);
+ setDimensions(Osd::getInstance()->getScreenHeight(), Osd::getInstance()->getScreenWidth());
Colour transparent(0, 0, 0, 0);
setBackgroundColour(transparent);
}
#include "recording.h"
#include "command.h"
#include "colour.h"
+#include "osd.h"
class VVideoRec : public View
{
{
displayVolume = Audio::getInstance()->getVolume();
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(100, 499);
+ }
+ else
+ {
+ setScreenPos(90, 400);
+ }
+
setDimensions(31, 227);
- setScreenPos(100, 499);
setBackgroundColour(Colour::VIEWBACKGROUND);
}
WSymbol* w = new WSymbol;
w->nextSymbol = WSymbol::VOLUME2;
- w->setScreenPos(103, 509);
+ w->setScreenPos(screenX + 3, screenY + 10);
w->draw();
int i = 0;
for(; i < displayVolume; i++)
{
w->nextSymbol = WSymbol::VOLBAR;
- w->setScreenPos(140 + (i * 9), 502);
+ w->setScreenPos(screenX + 40 + (i * 9), screenY + 3);
w->draw();
}
for(; i < 20; i++)
{
w->nextSymbol = WSymbol::VOLDOT;
- w->setScreenPos(140 + (i * 9), 512);
+ w->setScreenPos(screenX + 40 + (i * 9), screenY + 13);
w->draw();
}
#include "audio.h"
#include "wsymbol.h"
#include "colour.h"
+#include "osd.h"
class VVolume : public View
{
VWelcome::VWelcome()
{
setDimensions(190, 460);
- setScreenPos(140, 170);
+
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ setScreenPos(140, 170);
+ }
+ else
+ {
+ setScreenPos(130, 140);
+ }
setBackgroundColour(Colour::VIEWBACKGROUND);
setTitleBarOn(1);
VInfo* viewWait = new VInfo();
viewWait->setDimensions(190, 460);
- viewWait->setScreenPos(140, 170);
+ if (Osd::getInstance()->getScreenSize() == Osd::PAL)
+ {
+ viewWait->setScreenPos(140, 170);
+ }
+ else
+ {
+ viewWait->setScreenPos(130, 140);
+ }
viewWait->setMainText("\n Downloading recordings list");
viewWait->draw();
viewWait->show();
#include "command.h"
#include "message.h"
#include "colour.h"
+#include "osd.h"
class VWelcome : public View
{