]> git.vomp.tv Git - vompclient.git/blob - mtdmvp.cc
Update for windows
[vompclient.git] / mtdmvp.cc
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #include "mtdmvp.h"
22
23 MtdMVP::MtdMVP()
24 {
25   if (instance) return;
26   initted = 0;
27 }
28
29 MtdMVP::~MtdMVP()
30 {
31 }
32
33 int MtdMVP::init(char* device)
34 {
35   if (initted) return 0;
36   initted = 1;
37
38   int fd;
39
40   if ((fd = open(device, O_RDONLY)) < 0)
41   {
42     initted = 0;
43     return 0;
44   }
45
46   if (read(fd, data, 8192) < 8192)
47   {
48     initted = 0;
49     return 0;
50   }
51
52   close(fd);
53
54   //logit();
55
56   return 1;
57 }
58
59 int MtdMVP::shutdown()
60 {
61   if (!initted) return 0;
62   initted = 0;
63   return 1;
64 }
65
66 short MtdMVP::getPALorNTSC()
67 {
68   return data[2119];
69 }
70
71 /*
72 short MtdMVP::getAspect()
73 {
74   return data[2125];
75 }
76
77 short MtdMVP::getFlicker()
78 {
79   return data[2124];
80 }
81
82 short MtdMVP::getBootLogoOutput()
83 {
84   return data[2116];
85 }
86
87 short MtdMVP::getBootLogoDisplayVideoLeft()
88 {
89   return data[2120];
90 }
91
92 short MtdMVP::getBootLogoDisplayVideoUpper()
93 {
94   return data[2121];
95 }
96
97 short MtdMVP::getBootLogoDisplayVideoWidth()
98 {
99   return data[2122];
100 }
101
102 short MtdMVP::getBootLogoDisplayVideoHeight()
103 {
104   return data[2123];
105 }
106
107 void MtdMVP::logit()
108 {
109   Log* logger = Log::getInstance();
110
111   logger->log("MTD", Log::DEBUG, "Mode: %i", getPALorNTSC());
112   logger->log("MTD", Log::DEBUG, "Aspect: %i", getAspect());
113   logger->log("MTD", Log::DEBUG, "Flicker: %i", getFlicker());
114   logger->log("MTD", Log::DEBUG, "Bootlogo output: %i", getBootLogoOutput());
115   logger->log("MTD", Log::DEBUG, "Bootlogo display video left: %i", getBootLogoDisplayVideoLeft());
116   logger->log("MTD", Log::DEBUG, "Bootlogo display video upper: %i", getBootLogoDisplayVideoUpper());
117   logger->log("MTD", Log::DEBUG, "Bootlogo display video width: %i", getBootLogoDisplayVideoWidth());
118   logger->log("MTD", Log::DEBUG, "Bootlogo display video height: %i", getBootLogoDisplayVideoHeight());
119 }
120 */