doStandby();
return;
}
+#ifdef DEV
case Remote::RECORD:
{
Osd::getInstance()->screenShot("/out.jpg");
return;
}
+#endif
}
}
void Command::doJustConnected(VConnect* vconnect)
{
- VDR* vdr = VDR::getInstance();
+ Video* video = Video::getInstance();
ViewMan* viewman = ViewMan::getInstance();
viewman->removeView(vconnect, 0, 1);
+ VInfo* vi = new VInfo();
+ vi->setDimensions(400, 200);
+ if (video->getFormat() == Video::PAL)
+ vi->setScreenPos(170, 200);
+ else
+ vi->setScreenPos(160, 150);
+
+ vi->setMainText("\n Connected, loading config");
+ vi->draw();
+ vi->show();
+ viewman->add(vi);
+
+
+ VDR* vdr = VDR::getInstance();
+
// Power off if first boot and config says so
if (firstBoot)
{
if (!strcasecmp(svideo, "Yes"))
{
logger->log("Command", Log::INFO, "Switching to S-Video as S-Video=%s", svideo);
- Video::getInstance()->setConnection(Video::SVIDEO);
+ video->setConnection(Video::SVIDEO);
}
else
{
logger->log("Command", Log::INFO, "Leaving video output as S-Video=%s", svideo);
- Video::getInstance()->setConnection(Video::COMPOSITERGB);
+ video->setConnection(Video::COMPOSITERGB);
}
}
else
vdr->configSave("General", "Last Power State", "On");
+ // Get TV aspect ratio
+
+ char* aspect = vdr->configLoad("TV", "Aspect");
+
+ if (aspect)
+ {
+ if (!strcasecmp(aspect, "16:9"))
+ {
+ logger->log("Command", Log::INFO, "Switching to TV aspect 16:9");
+ video->setAspectRatio(Video::ASPECT16X9);
+ }
+ else
+ {
+ logger->log("Command", Log::INFO, "Switching to TV aspect 4:3");
+ video->setAspectRatio(Video::ASPECT4X3);
+ }
+ }
+ else
+ {
+ logger->log("Command", Log::INFO, "Config TV/Aspect type not found, going 4:3");
+ video->setAspectRatio(Video::ASPECT4X3);
+ }
+
+ video->reinit();
+
// config done
+ viewman->removeView(vi);
+
VWelcome* vw = new VWelcome();
viewman->add(vw);
viewman->redrawAll();
VOptions::VOptions()
{
- setDimensions(460, 190);
+ setDimensions(500, 250);
if (Video::getInstance()->getFormat() == Video::PAL)
{
- setScreenPos(140, 170);
+ setScreenPos(120, 140);
}
else
{
- setScreenPos(130, 140);
+ setScreenPos(110, 110);
}
setBackgroundColour(Colour::VIEWBACKGROUND);
int fontHeight = surface->getFontHeight();
- optionBox[0].setScreenPos(screenX + 290, screenY + 45);
+ optionBox[0].setScreenPos(screenX + 330, screenY + 45);
optionBox[0].setDimensions(150, fontHeight);
optionBox[0].addOption("Old");
optionBox[0].addOption("New");
- optionBox[1].setScreenPos(screenX + 290, screenY + 75);
+ optionBox[1].setScreenPos(screenX + 330, screenY + 75);
optionBox[1].setDimensions(150, fontHeight);
optionBox[1].addOption("RGB+composite");
optionBox[1].addOption("S-Video");
- optionBox[2].setScreenPos(screenX + 290, screenY + 105);
+ optionBox[2].setScreenPos(screenX + 330, screenY + 105);
optionBox[2].setDimensions(150, fontHeight);
- optionBox[2].addOption("On");
- optionBox[2].addOption("Off");
- optionBox[2].addOption("Last state");
+ optionBox[2].addOption("4:3");
+ optionBox[2].addOption("16:9");
+ optionBox[3].setScreenPos(screenX + 330, screenY + 135);
+ optionBox[3].setDimensions(150, fontHeight);
+ optionBox[3].addOption("On");
+ optionBox[3].addOption("Off");
+ optionBox[3].addOption("Last state");
+
+ optionBox[4].setScreenPos(screenX + 330, screenY + 165);
+ optionBox[4].setDimensions(150, fontHeight);
+ optionBox[4].addOption("All");
+ optionBox[4].addOption("FTA only");
char* config;
vdr = VDR::getInstance();
optionBox[1].setSelected("RGB+composite");
}
+ config = vdr->configLoad("TV", "Aspect");
+ if (!config)
+ {
+ optionBox[2].setSelected("4:3");
+ }
+ else if (!strcasecmp(config, "16:9"))
+ {
+ optionBox[2].setSelected("16:9");
+ }
+ else
+ {
+ optionBox[2].setSelected("4:3");
+ }
config = vdr->configLoad("General", "Power After Boot");
if (!config)
{
- optionBox[2].setSelected("On");
+ optionBox[3].setSelected("On");
}
else if (!strcasecmp(config, "On")) // just for completeness
{
- optionBox[2].setSelected("On");
+ optionBox[3].setSelected("On");
}
else if (!strcasecmp(config, "Off"))
{
- optionBox[2].setSelected("Off");
+ optionBox[3].setSelected("Off");
}
else if (!strcasecmp(config, "Last state"))
{
- optionBox[2].setSelected("Last state");
+ optionBox[3].setSelected("Last state");
}
else
{
- optionBox[2].setSelected("On");
+ optionBox[3].setSelected("On");
}
+ config = vdr->configLoad("General", "Channels");
+ if (!config)
+ {
+ optionBox[4].setSelected("All");
+ }
+ else if (!strcasecmp(config, "FTA only"))
+ {
+ optionBox[4].setSelected("FTA only");
+ }
+ else
+ {
+ optionBox[4].setSelected("All");
+ }
selectedOption = 0;
optionBox[0].setActive(1);
drawText("Remote control type", 10, 45, Colour::LIGHTTEXT);
drawText("TV connection type", 10, 75, Colour::LIGHTTEXT);
- drawText("Power state after bootup", 10, 105, Colour::LIGHTTEXT);
+ drawText("TV aspect ratio", 10, 105, Colour::LIGHTTEXT);
+ drawText("Power state after bootup", 10, 135, Colour::LIGHTTEXT);
+ drawText("Display channels", 10, 165, Colour::LIGHTTEXT);
- drawText("Press back to exit, <, > or [ok] to change", 10, 160, Colour::LIGHTTEXT);
+ drawText("Press back to exit, <, > or [ok] to change", 10, 220, Colour::LIGHTTEXT);
for (UINT i = 0; i < numOptions; i++)
{
ws.nextSymbol = WSymbol::LEFTARROW;
ws.nextColour = cl;
- ws.setScreenPos(screenX + 272, screenY + 47 + (i * 30));
+ ws.setScreenPos(screenX + 312, screenY + 47 + (i * 30));
ws.draw();
ws.nextSymbol = WSymbol::RIGHTARROW;
- ws.setScreenPos(screenX + 442, screenY + 47 + (i * 30));
+ ws.setScreenPos(screenX + 482, screenY + 47 + (i * 30));
ws.draw();
optionBox[i].draw();
optionBox[i].show();
{
char* remoteType = optionBox[0].getSelected();
vdr->configSave("General", "Remote type", remoteType);
+
+ char* tvconnection = optionBox[1].getSelected();
+ if (!strcmp(tvconnection, "S-Video"))
+ vdr->configSave("TV", "S-Video", "Yes");
+ else
+ vdr->configSave("TV", "S-Video", "No");
+
+ char* aspect = optionBox[2].getSelected();
+ vdr->configSave("TV", "Aspect", aspect);
+
+ char* powerState = optionBox[3].getSelected();
+ vdr->configSave("General", "Power After Boot", powerState);
+
+ char* channels = optionBox[4].getSelected();
+ vdr->configSave("General", "Channels", channels);
+
+ // Apply changes
+
if (!strcmp(remoteType, "New"))
- {
Remote::getInstance()->setRemoteType(Remote::NEWREMOTE);
- }
else
- {
Remote::getInstance()->setRemoteType(Remote::OLDREMOTE);
- }
- char* tvconnection = optionBox[1].getSelected();
+
if (!strcmp(tvconnection, "S-Video"))
- {
- vdr->configSave("TV", "S-Video", "Yes");
Video::getInstance()->setConnection(Video::SVIDEO);
- }
else
- {
- vdr->configSave("TV", "S-Video", "No");
Video::getInstance()->setConnection(Video::COMPOSITERGB);
- }
- char* powerState = optionBox[2].getSelected();
- vdr->configSave("General", "Power After Boot", powerState);
+ printf("here\n");
+
+ if (!strcmp(aspect, "16:9"))
+ Video::getInstance()->setAspectRatio(Video::ASPECT16X9);
+ else
+ Video::getInstance()->setAspectRatio(Video::ASPECT4X3);
+
+ Video::getInstance()->reinit();
}