]> git.vomp.tv Git - vompclient.git/blob - video.cc
Preparations for dynamic mode switching
[vompclient.git] / video.cc
1 /*\r
2     Copyright 2004-2005 Chris Tallon\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
19 */\r
20 //portions from vdr by Klaus Schmiding HSMF code\r
21 \r
22 #include "video.h"\r
23 \r
24 Video* Video::instance = NULL;\r
25 \r
26 Video::Video()\r
27 {\r
28   if (instance) return;\r
29   instance = this;\r
30   initted = 0;\r
31 \r
32   fdVideo = 0;\r
33 \r
34   format = 0;\r
35   connection = 0;\r
36   aspectRatio = 0;\r
37   mode = 0;\r
38   tvsize = 0;\r
39 \r
40   screenWidth = 0;\r
41   screenHeight = 0;\r
42 }\r
43 \r
44 Video::~Video()\r
45 {\r
46   instance = NULL;\r
47 }\r
48 \r
49 Video* Video::getInstance()\r
50 {\r
51   return instance;\r
52 }\r
53 /*\r
54 void Video::setInstance(Video* inst)\r
55 {\r
56   instance=inst;\r
57 }*/\r
58 \r
59 /*\r
60 hmsf Video::framesToHMSF(ULONG frames, double fps)\r
61 {\r
62   hmsf ret;\r
63   / * from vdr *\r
64   double Seconds;\r
65   ret.frames= int(modf((frames + 0.5) / fps, &Seconds) * fps + 1);\r
66   int s = int(Seconds);\r
67   ret.seconds=s;\r
68   ret.minutes = s / 60 % 60;\r
69   ret.hours = s / 3600;\r
70 \r
71 / *  if (format == NTSC)\r
72   {\r
73     ret.hours = frames / 108000;\r
74     frames %= 108000;\r
75     ret.minutes = frames / 1800;\r
76     frames %= 1800;\r
77     ret.seconds = frames / 30;\r
78     ret.frames = frames % 30;\r
79   }\r
80   else\r
81   {\r
82     ret.hours = frames / 90000;\r
83     frames %= 90000;\r
84     ret.minutes = frames / 1500;\r
85     frames %= 1500;\r
86     ret.seconds = frames / 25;\r
87     ret.frames = frames % 25;\r
88   }* /\r
89   return ret;\r
90 }*/\r
91 \r
92 /*\r
93 UINT Video::getFPS()\r
94 {\r
95   if (format == NTSC) return 30;\r
96   else return 25;\r
97 }\r
98 */\r