add something which doesn't work
[enigma2.git] / lib / driver / avswitch.cpp
index 80c7755bef966862fb159e168cc4eb1ec53617a3..09b1ec33fe2aad5a253966f2a7e06c889ec40fac 100644 (file)
@@ -26,6 +26,45 @@ 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);
+       
+       if (val == 1)
+               setFastBlank(2);
+}
+
+void eAVSwitch::setFastBlank(int val)
+{
+       int fd;
+       char *fb[] = {"low", "high", "vcr"};
+
+       
+       if((fd = open("/proc/stb/avs/0/fb", O_WRONLY)) < 0) {
+               printf("cannot open /proc/stb/avs/0/fb\n");
+               return;
+       }
+
+       write(fd, fb[val], strlen(fb[0]));
+       close(fd);
+}
+
 void eAVSwitch::setColorFormat(int format)
 {
        /*
@@ -36,6 +75,7 @@ void eAVSwitch::setColorFormat(int format)
        char *cvbs="cvbs";
        char *rgb="rgb";
        char *svideo="svideo";
+       char *yuv="yuv";
        int fd;
        
        if((fd = open("/proc/stb/avs/0/colorformat", O_WRONLY)) < 0) {
@@ -52,6 +92,9 @@ void eAVSwitch::setColorFormat(int format)
                case 2:
                        write(fd, svideo, strlen(svideo));
                        break;
+               case 3:
+                       write(fd, yuv, strlen(yuv));
+                       break;
        }       
        close(fd);
 }