]> git.vomp.tv Git - vompclient.git/blob - video.cc
HDTV for Windows
[vompclient.git] / video.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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20 //portions from vdr by Klaus Schmiding HSMF code
21
22 #include "video.h"
23
24 Video* Video::instance = NULL;
25
26 Video::Video()
27 {
28   if (instance) return;
29   instance = this;
30   initted = 0;
31
32   fdVideo = 0;
33
34   format = 0;
35   connection = 0;
36   aspectRatio = 0;
37   mode = 0;
38   tvsize = 0;
39
40   screenWidth = 0;
41   screenHeight = 0;
42 }
43
44 Video::~Video()
45 {
46   instance = NULL;
47 }
48
49 Video* Video::getInstance()
50 {
51   return instance;
52 }
53
54 /*
55 hmsf Video::framesToHMSF(ULONG frames, double fps)
56 {
57   hmsf ret;
58   / * from vdr *
59   double Seconds;
60   ret.frames= int(modf((frames + 0.5) / fps, &Seconds) * fps + 1);
61   int s = int(Seconds);
62   ret.seconds=s;
63   ret.minutes = s / 60 % 60;
64   ret.hours = s / 3600;
65
66 / *  if (format == NTSC)
67   {
68     ret.hours = frames / 108000;
69     frames %= 108000;
70     ret.minutes = frames / 1800;
71     frames %= 1800;
72     ret.seconds = frames / 30;
73     ret.frames = frames % 30;
74   }
75   else
76   {
77     ret.hours = frames / 90000;
78     frames %= 90000;
79     ret.minutes = frames / 1500;
80     frames %= 1500;
81     ret.seconds = frames / 25;
82     ret.frames = frames % 25;
83   }* /
84   return ret;
85 }*/
86
87 /*
88 UINT Video::getFPS()
89 {
90   if (format == NTSC) return 30;
91   else return 25;
92 }
93 */