From d89be097be4a9ac52166c5f47cc189c5522d3441 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Fri, 1 Feb 2008 23:15:24 +0000 Subject: add possibilty to hide menu entries when needed hardware is not available --- lib/driver/avswitch.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/driver/avswitch.cpp') diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp index d582db81..a936aa54 100644 --- a/lib/driver/avswitch.cpp +++ b/lib/driver/avswitch.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -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) { /* -- cgit v1.2.3