]> git.vomp.tv Git - vompclient-marten.git/commitdiff
DEV var in Makefile
authorChris Tallon <chris@vomp.tv>
Tue, 6 Sep 2005 20:42:14 +0000 (20:42 +0000)
committerChris Tallon <chris@vomp.tv>
Tue, 6 Sep 2005 20:42:14 +0000 (20:42 +0000)
Widescreen ability
FTA channels only patch from davep

14 files changed:
Makefile
audio.cc
audio.h
command.cc
player.h
playerradio.cc
playervideo.cc
playervideo.h
vconnect.cc
video.cc
video.h
voptions.cc
voptions.h
vvideorec.cc

index 7751a5824e140f66e01e02de5c38984716f4f95b..49e0e22bc1528cca503775f77d7e43eb27540af4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,8 @@ STRIP = /opt/crosstool/powerpc-405-linux-gnu/gcc-2.95.3-glibc-2.2.5/bin/powerpc-
 
 CXX = $(CC)
 INCLUDES = -I../jpeg-6b
-CXXFLAGS = -g -O0 -Wall -Woverloaded-virtual -Werror -D_GNU_SOURCE $(INCLUDES)
+CXXFLAGS_DEV = -g -O0 -Wall -Woverloaded-virtual -Werror -DDEV -D_GNU_SOURCE $(INCLUDES)
+CXXFLAGS_REL = -O3 -Wall -Woverloaded-virtual -Werror -D_GNU_SOURCE $(INCLUDES)
 LDFLAGS = -Wall -static
 
 LIBPATHS =
@@ -21,15 +22,11 @@ OBJECTS = main.o command.o log.o remote.o led.o mtd.o video.o audio.o tcp.o dire
 
 .PHONY: clean fresh all install strip
 
-default: vompclient
-fresh:   clean all
-all:     vompclient
-
-clean:
-       rm -f *.o deps vompclient *~ fonts/*.o fonts/*~
+default: dev
+fresh:   clean default
 
 vompclient: $(OBJECTS)
-       $(CC) $(LDFLAGS) $(LIBPATHS) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
+       $(CC) $(LDFLAGS) $(LIBPATHS) $(RELEASE) -o vompclient $(OBJECTS) $(CROSSLIBS) $(LIBS)
 
 strip:
        $(STRIP) vompclient
@@ -38,10 +35,16 @@ install:
        rm -f /diskless/nfs/mvp/vompclient
        cp vompclient /diskless/nfs/mvp
 
-release: CXXFLAGS := -O3 $(CXXFLAGS)
+dev: CXXFLAGS := $(CXXFLAGS_DEV)
+dev: vompclient
+
+release: CXXFLAGS := $(CXXFLAGS_REL)
 release: clean vompclient strip
 
 deps: Makefile
        $(CC) -MM $(INCLUDES) $(OBJECTS:%.o=%.cc) > deps
 
 -include deps
+
+clean:
+       rm -f *.o deps vompclient *~ fonts/*.o fonts/*~
index 174c5779829f7da3772eadc082fd0bd1a6974ef5..25a270fbf8e458f3978f5468c144acacc0450faf 100644 (file)
--- a/audio.cc
+++ b/audio.cc
@@ -209,6 +209,7 @@ int Audio::setVolume(int volume)
   return 1;
 }
 
+#ifdef DEV
 int Audio::test()
 {
 //  ULLONG stc = 0;
@@ -227,6 +228,7 @@ int Audio::test()
 
 
 }
+#endif
 
 int Audio::volumeUp()
 {
diff --git a/audio.h b/audio.h
index 190513e229bea7c369d2d067d2a580f98e44096e..5b2877b4510a2c6fd24ed5093391e52b4be214ef 100644 (file)
--- a/audio.h
+++ b/audio.h
@@ -62,7 +62,9 @@ class Audio
     int toggleUserMute();
     int systemMuteOn();
     int systemMuteOff();
+#ifdef DEV
     int test();
+#endif
 
     int write(char *buf, int len);
 
index 136b04fc2747ec7398535e849591a6412758a24e..4a6a6fb4ba77d97437d0468263e5a1d3ac4ffe41 100644 (file)
@@ -195,11 +195,13 @@ void Command::handleCommand(int button)
       doStandby();
       return;
     }
+#ifdef DEV
     case Remote::RECORD:
     {
       Osd::getInstance()->screenShot("/out.jpg");
       return;
     }
+#endif
   }
 }
 
@@ -241,10 +243,25 @@ void Command::doReboot()
 
 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)
   {
@@ -310,12 +327,12 @@ void Command::doJustConnected(VConnect* vconnect)
     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
@@ -350,8 +367,35 @@ void Command::doJustConnected(VConnect* vconnect)
 
   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();
index 87711ce28036ad2dd64708b89b1899d4ec174e24..2a8ac2de4ddd4db44f679e4ecee2016d126ff7f2 100644 (file)
--- a/player.h
+++ b/player.h
@@ -42,10 +42,12 @@ class Player : public Thread, public Callback
     virtual void jumpToPercent(int percent)=0;
     virtual void skipForward(int seconds)=0;
     virtual void skipBackward(int seconds)=0;
-    virtual void test()=0;
-    virtual void test2()=0;
     virtual void setPosition(ULLONG position)=0;
     virtual void setLength(ULLONG length)=0;
+#ifdef DEV
+    virtual void test()=0;
+    virtual void test2()=0;
+#endif
 
     virtual void call()=0; // for callback interface
     virtual void threadMethod()=0; // for thread interface
index 666872a04e51a61c93d617720647c1e3fde8cfbf..db0918ed097c10f3d844374ccc2a0afdd7f620c6 100644 (file)
@@ -130,7 +130,7 @@ int PlayerRadio::play()
 // ------------------------ This one doesn't work, but it should, and would allow for prebuffering.
 */
 
-    audio->test();
+//    audio->test();
   threadStart();
     sleep(6);
 
index 78620aed4fb7e295a30fa2668335071c42f8ddd6..49a8276a3bf37156252d4b6adcd84c3873b3d1d8 100644 (file)
@@ -251,6 +251,7 @@ void PlayerVideo::togglePause()
   }
 }
 
+#ifdef DEV
 void PlayerVideo::test()
 {
   Log::getInstance()->log("Player", Log::DEBUG, "PLAYER TEST");
@@ -279,6 +280,7 @@ void PlayerVideo::test2()
 
 //  video->test2();
 }
+#endif
 
 void PlayerVideo::setPosition(ULLONG position)
 {
index 96ad61c06b6a6abbe9b64685c9b833620abb80e1..4b777e166d00c29253fa78a67f0cb1f0a678125e 100644 (file)
@@ -53,11 +53,13 @@ class PlayerVideo : public Player
     void jumpToPercent(int percent);
     void skipForward(int seconds);
     void skipBackward(int seconds);
-    void test();
-    void test2();
     void call(); // for callback interface
     void setPosition(ULLONG position);
     void setLength(ULLONG length);
+#ifdef DEV
+    void test();
+    void test2();
+#endif
 
     void threadMethod();
     void threadPostStopCleanup();
index e8eaeff61ae4b0246e31cba4c6c630e9a6e35adb..75a52927d2938b9b6f66397f771ccc8042920bea 100644 (file)
@@ -115,9 +115,9 @@ void VConnect::threadMethod()
 
       if (success)
       {
-        setMainText("\n                            Connected");
+    //    setMainText("\n                            Connected");
         ts.tv_sec = 0;
-        ts.tv_nsec = 500000000;
+        ts.tv_nsec = 000000000;
       }
       else
       {
index bd31e90fa3af1f7e98b4622540b2e4e88829bb48..576c554d1bed76786f296786dcfc8b46d963df41 100644 (file)
--- a/video.cc
+++ b/video.cc
@@ -162,6 +162,7 @@ int Video::setMode(UCHAR tmode)
   return 1;
 }
 
+#ifdef DEV
 int Video::test()
 {
   return 0;
@@ -178,8 +179,7 @@ int Video::test2()
 {
   return 0;
 }
-
-
+#endif
 
 int Video::signalOff()
 {
diff --git a/video.h b/video.h
index f5d822b144b699ea9dd95d88c89321359da4adcf..29aa1a1d038839aaf88f90b35681bf3df2b664ff 100644 (file)
--- a/video.h
+++ b/video.h
@@ -81,8 +81,6 @@ class Video
     int setConnection(UCHAR connection);
     int setAspectRatio(UCHAR aspectRatio);
     int setMode(UCHAR mode);
-    int test();
-    int test2();
     int setSource();
     int setPosition(int x, int y);
     int sync();
@@ -97,6 +95,11 @@ class Video
     int signalOn();
     int signalOff();
 
+#ifdef DEV
+    int test();
+    int test2();
+#endif
+
     int attachFrameBuffer(); // What does this do?
 
     int getFD();
index 78520c45add00b3e3b32ce81daa6b4293ecd38fe..c7a6bb3b88ebf10c621539d6595d508d7bbf79f3 100644 (file)
 
 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);
@@ -40,22 +40,31 @@ VOptions::VOptions()
 
   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();
@@ -90,29 +99,55 @@ VOptions::VOptions()
     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);
@@ -131,9 +166,11 @@ void VOptions::draw()
 
   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++)
   {
@@ -143,10 +180,10 @@ void VOptions::draw()
     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();
@@ -220,27 +257,41 @@ void VOptions::doSave()
 {
   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();
 }
index 2ae5c1fff6fce72661b383cb240d6582320aa9e4..b0d8a348a018e193a49ea2c0c8306d45d537f2ca 100644 (file)
@@ -42,7 +42,7 @@ class VOptions : public View
   private:
     void doSave();
 
-    const static UINT numOptions = 3;
+    const static UINT numOptions = 5;
     UINT selectedOption;
     WOptionBox optionBox[numOptions];
     VDR* vdr;
index 2d3d3f41168f81b577329a6e95a1f0e4ecf0a9a9..cdc757767d264e074766d7b55d758c0ff4ce068c 100644 (file)
@@ -107,6 +107,7 @@ int VVideoRec::handleCommand(int command)
 //      return 2;
 //    }
 
+#ifdef DEV
     case Remote::RED:
     {
       player->test();
@@ -117,6 +118,7 @@ int VVideoRec::handleCommand(int command)
       player->test2();
       return 2;
     }
+#endif
 
     case Remote::ZERO: player->jumpToPercent(0); return 2;
     case Remote::ONE: player->jumpToPercent(10); return 2;