]> git.vomp.tv Git - vompclient.git/blob - video.cc
End of line normalization
[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 void Video::setInstance(Video* inst)
55 {
56   instance=inst;
57 }*/
58
59 /*
60 hmsf Video::framesToHMSF(ULONG frames, double fps)
61 {
62   hmsf ret;
63   / * from vdr *
64   double Seconds;
65   ret.frames= int(modf((frames + 0.5) / fps, &Seconds) * fps + 1);
66   int s = int(Seconds);
67   ret.seconds=s;
68   ret.minutes = s / 60 % 60;
69   ret.hours = s / 3600;
70
71 / *  if (format == NTSC)
72   {
73     ret.hours = frames / 108000;
74     frames %= 108000;
75     ret.minutes = frames / 1800;
76     frames %= 1800;
77     ret.seconds = frames / 30;
78     ret.frames = frames % 30;
79   }
80   else
81   {
82     ret.hours = frames / 90000;
83     frames %= 90000;
84     ret.minutes = frames / 1500;
85     frames %= 1500;
86     ret.seconds = frames / 25;
87     ret.frames = frames % 25;
88   }* /
89   return ret;
90 }*/
91
92 /*
93 UINT Video::getFPS()
94 {
95   if (format == NTSC) return 30;
96   else return 25;
97 }
98 */