]> git.vomp.tv Git - vompclient.git/blob - video.cc
2c8bb562326bd4e404c3e984891b6dfbb54ff712
[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   parx=1;
40   pary=1;
41
42   screenWidth = 0;
43   screenHeight = 0;
44 }
45
46 Video::~Video()
47 {
48   instance = NULL;
49 }
50
51 Video* Video::getInstance()
52 {
53   return instance;
54 }
55 /*
56 void Video::setInstance(Video* inst)
57 {
58   instance=inst;
59 }*/
60
61 /*
62 hmsf Video::framesToHMSF(ULONG frames, double fps)
63 {
64   hmsf ret;
65   / * from vdr *
66   double Seconds;
67   ret.frames= int(modf((frames + 0.5) / fps, &Seconds) * fps + 1);
68   int s = int(Seconds);
69   ret.seconds=s;
70   ret.minutes = s / 60 % 60;
71   ret.hours = s / 3600;
72
73 / *  if (format == NTSC)
74   {
75     ret.hours = frames / 108000;
76     frames %= 108000;
77     ret.minutes = frames / 1800;
78     frames %= 1800;
79     ret.seconds = frames / 30;
80     ret.frames = frames % 30;
81   }
82   else
83   {
84     ret.hours = frames / 90000;
85     frames %= 90000;
86     ret.minutes = frames / 1500;
87     frames %= 1500;
88     ret.seconds = frames / 25;
89     ret.frames = frames % 25;
90   }* /
91   return ret;
92 }*/
93
94 /*
95 UINT Video::getFPS()
96 {
97   if (format == NTSC) return 30;
98   else return 25;
99 }
100 */