]> git.vomp.tv Git - vompclient.git/blob - wtvmedia.cc
Fix text corruption in channel number display on live tv
[vompclient.git] / wtvmedia.cc
1 /*
2     Copyright 2004-2005 Chris Tallon, 2014 Marten Richter
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 #include "boxx.h"
21 #include "wtvmedia.h"
22
23
24
25
26  WTVMedia::WTVMedia()
27  {
28          media = false;
29          scale=NoZoom;
30  }
31
32  WTVMedia::~WTVMedia()
33  {
34
35  }
36
37
38
39  void WTVMedia::setTVMedia(TVMediaInfo & ninfo, Scaling nscale)
40  {
41          info = ninfo;
42          scale = nscale;
43          media =true;
44  }
45
46  void  WTVMedia::draw()
47  {
48          //Boxx::draw();
49          if (!media) return;
50          float w=0;
51          float h=0;
52          switch (scale)
53          {
54          case ZoomHorizontal:
55                  w = area.w; break;
56          case ZoomVertical:
57                  h = area.h; break;
58          case ZoomBoth:
59                  w = area.w;
60                  h = area.h; break;
61
62          case NoZoom:
63            ; // ?
64          }
65          drawTVMedia(info,0.f,0.f,w,h,TopLeft);
66
67  }