enable color on thedoc's box (depends as usual on mac)
[vuplus_dvbapp] / lib / driver / avswitch.cpp
1 #include <lib/driver/avswitch.h>
2
3 #include <unistd.h>
4 #include <fcntl.h>
5 #include <sys/ioctl.h>
6
7 #include <lib/base/init.h>
8 #include <lib/base/init_num.h>
9 #include <lib/base/econfig.h>
10 #include <lib/base/eerror.h>
11
12 eAVSwitch *eAVSwitch::instance = 0;
13
14 eAVSwitch::eAVSwitch()
15 {
16         ASSERT(!instance);
17         instance = this;
18         
19         avsfd = open("/dev/dbox/avs0", O_RDWR);
20         
21         //enable colors on thedoc's tv 
22         ioctl(avsfd, 0x1000 | 35, 2);
23         ioctl(avsfd, 0x1000 | 9, 1);
24 }
25
26 eAVSwitch::~eAVSwitch()
27 {
28         if(avsfd > 0)
29                 close(avsfd);
30 }
31
32 eAVSwitch *eAVSwitch::getInstance()
33 {
34         return instance;
35 }
36
37 void eAVSwitch::setColorFormat(int format)
38 {
39         printf("eAVSwitch::setColorFormat(%d)\n",format);
40         /*there are no ioctl for controling this in avs - scart api needed 
41                 no, not the gillem one */
42 }
43
44 //FIXME: correct "run/startlevel"
45 eAutoInitP0<eAVSwitch> init_avswitch(eAutoInitNumbers::rc, "AVSwitch Driver");