add possibilty to hide menu entries when needed hardware is not available
[enigma2.git] / lib / driver / avswitch.cpp
index d582db81ae3ca90bf33b25158e2e75f616b4af60..a936aa543dd6cb8678b59e19a310b8d893e5a159 100644 (file)
@@ -1,6 +1,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <string.h>
 
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
@@ -81,6 +82,19 @@ eAVSwitch *eAVSwitch::getInstance()
        return instance;
 }
 
+bool eAVSwitch::haveScartSwitch()
+{
+       char tmp[255];
+       int fd = open("/proc/stb/avs/0/input_choices", O_RDONLY);
+       if(fd < 0) {
+               eDebug("cannot open /proc/stb/avs/0/input_choices");
+               return false;
+       }
+       read(fd, tmp, 255);
+       close(fd);
+       return !!strstr(tmp, "scart");
+}
+
 void eAVSwitch::setInput(int val)
 {
        /*