]> git.vomp.tv Git - vompclient.git/blob - videowin.cc
Windows port
[vompclient.git] / videowin.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 "videowin.h"
22
23 VideoWin::VideoWin()
24 {
25   if (instance) return;
26 }
27
28 VideoWin::~VideoWin()
29 {
30   instance = NULL;
31 }
32
33 int VideoWin::init(UCHAR tformat)
34 {
35   if (initted) return 0;
36   initted = 1;
37   return 1;
38 }
39
40 int VideoWin::setTVsize(UCHAR ttvsize)
41 {
42   return 1;
43 }
44
45 int VideoWin::setDefaultAspect()
46 {
47   return setAspectRatio(tvsize);
48 }
49
50 int VideoWin::shutdown()
51 {
52   if (!initted) return 0;
53   initted = 0;
54   return 1;
55 }
56
57 int VideoWin::setFormat(UCHAR tformat)
58 {
59   if (!initted) return 0;
60   if ((tformat != PAL) && (tformat != NTSC)) return 0;
61   format = tformat;
62
63   return 1;
64 }
65
66 int VideoWin::setConnection(UCHAR tconnection)
67 {
68   if (!initted) return 0;
69   if ((tconnection != COMPOSITERGB) && (tconnection != SVIDEO)) return 0;
70   connection = tconnection;
71
72   return 1;
73 }
74
75 int VideoWin::setAspectRatio(UCHAR taspectRatio)
76 {
77   if (!initted) return 0;
78   if ((taspectRatio != ASPECT4X3) && (taspectRatio != ASPECT16X9)) return 0;
79   aspectRatio = taspectRatio;
80
81   return 1;
82 }
83
84 int VideoWin::setMode(UCHAR tmode)
85 {
86   if (!initted) return 0;
87
88   if ((tmode == LETTERBOX) && (tvsize == ASPECT16X9)) return 0; // invalid mode
89
90   if ((tmode != NORMAL) && (tmode != LETTERBOX) && (tmode != UNKNOWN2) && (tmode != QUARTER) && (tmode != EIGHTH)
91       && (tmode != ZOOM) && (tmode != UNKNOWN6)) return 0;
92   mode = tmode;
93
94   return 1;
95 }
96
97 int VideoWin::signalOff()
98 {
99   return 1;
100 }
101
102 int VideoWin::signalOn()
103 {
104   return 1;
105 }
106
107 int VideoWin::setSource()
108 {
109   if (!initted) return 0;
110
111   return 1;
112 }
113
114 int VideoWin::setPosition(int x, int y)
115 {
116   if (!initted) return 0;
117
118   return 1;
119 }
120
121 int VideoWin::sync()
122 {
123   if (!initted) return 0;
124
125   return 1;
126 }
127
128 int VideoWin::play()
129 {
130   if (!initted) return 0;
131
132   return 1;
133 }
134
135 int VideoWin::stop()
136 {
137   if (!initted) return 0;
138
139   return 1;
140 }
141
142 int VideoWin::reset()
143 {
144   if (!initted) return 0;
145
146   return 1;
147 }
148
149 int VideoWin::pause()
150 {
151   if (!initted) return 0;
152
153   return 1;
154 }
155
156 int VideoWin::unPause() // FIXME get rid - same as play!!
157 {
158   if (!initted) return 0;
159   return 1;
160 }
161
162 int VideoWin::fastForward()
163 {
164   if (!initted) return 0;
165   return 1;
166 }
167
168 int VideoWin::unFastForward()
169 {
170   if (!initted) return 0;
171   return 1;
172 }
173
174 int VideoWin::attachFrameBuffer()
175 {
176   if (!initted) return 0;
177   return 1;
178 }
179
180 int VideoWin::blank(void)
181 {
182   return 1;
183 }
184
185 int VideoWin::getFD()
186 {
187   if (!initted) return 0;
188
189   return fdVideo;
190 }
191
192 ULLONG VideoWin::getCurrentTimestamp()
193 {
194   return 0;
195 }
196
197 ULONG VideoWin::timecodeToFrameNumber(ULLONG timecode)
198 {
199   if (format == PAL) return (ULONG)(((double)timecode / (double)90000) * (double)25);
200   else               return (ULONG)(((double)timecode / (double)90000) * (double)30);
201 }
202
203 #ifdef DEV
204 int VideoWin::test()
205 {
206   return 0;
207 }
208
209 int VideoWin::test2()
210 {
211   return 0;
212 }
213 #endif