add setInput()
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 14 Nov 2005 02:50:47 +0000 (02:50 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 14 Nov 2005 02:50:47 +0000 (02:50 +0000)
lib/driver/avswitch.cpp
lib/driver/avswitch.h

index 80c7755bef966862fb159e168cc4eb1ec53617a3..5038ee5384ca8a932a45f269b2d2b7fd57b0c90d 100644 (file)
@@ -26,6 +26,27 @@ eAVSwitch *eAVSwitch::getInstance()
        return instance;
 }
 
+void eAVSwitch::setInput(int val)
+{
+       /*
+       0-encoder
+       1-scart
+       2-aux
+       */
+
+       char *input[] = {"encoder", "scart", "aux"};
+
+       int fd;
+       
+       if((fd = open("/proc/stb/avs/0/input", O_WRONLY)) < 0) {
+               printf("cannot open /proc/stb/avs/0/input\n");
+               return;
+       }
+
+       write(fd, input[val], strlen(input[val]));
+       close(fd);
+}
+
 void eAVSwitch::setColorFormat(int format)
 {
        /*
index 157948826fe5d4af8c24a9ac78e5a3c8b3657d38..ec7d5c136a0ea3ac3e394faefe9f18e219a951f3 100644 (file)
@@ -15,6 +15,8 @@ public:
        void setColorFormat(int format);
        void setAspectRatio(int ratio);
        void setVideomode(int mode);
+       void setInput(int val);
+
 };
 
 #endif