From: Ronny Strutz Date: Mon, 14 Nov 2005 02:50:47 +0000 (+0000) Subject: add setInput() X-Git-Tag: 2.6.0~5241 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/e41cbd8e4f84ce4ef23095e7eaba9c885922ba92?hp=e80b07ffc45ad5b4c5f89715eff2190a1b9da7a8 add setInput() --- diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp index 80c7755b..5038ee53 100644 --- a/lib/driver/avswitch.cpp +++ b/lib/driver/avswitch.cpp @@ -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) { /* diff --git a/lib/driver/avswitch.h b/lib/driver/avswitch.h index 15794882..ec7d5c13 100644 --- a/lib/driver/avswitch.h +++ b/lib/driver/avswitch.h @@ -15,6 +15,8 @@ public: void setColorFormat(int format); void setAspectRatio(int ratio); void setVideomode(int mode); + void setInput(int val); + }; #endif