]> git.vomp.tv Git - vompclient.git/blob - vvideolivetv.h
Fix text corruption in channel number display on live tv
[vompclient.git] / vvideolivetv.h
1 /*
2     Copyright 2007 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
21 #ifndef VVIDEOLIVETV_H
22 #define VVIDEOLIVETV_H
23
24 #include <stdio.h>
25 #include <vector>
26 #include <math.h>
27
28 #include "boxx.h"
29 #include "region.h"
30 #include "vdr.h"
31 #include "wtextbox.h"
32 #include "wselectlist.h"
33 #include "timerreceiver.h"
34 #include "wsymbol.h"
35 #include "wprogressbar.h"
36 #include "osdreceiver.h"
37 #include "wtvmedia.h"
38
39 #ifdef PAL_WSS
40 #include "wwss.h"
41 #endif
42
43 class VChannelList;
44 class Video;
45 class VChannelList;
46 class BoxStack;
47 class WTextbox;
48 class PlayerLive;
49 class VAudioSelector;
50 class Bitmap;
51
52 class VVideoLiveTV : public Boxx, public TimerReceiver, public OSDReceiver
53 {
54   public:
55     VVideoLiveTV(ChannelList* chanList, ULONG initialChannelNumber, VChannelList* vchannelList);
56     virtual ~VVideoLiveTV();
57     void preDelete();
58     int handleCommand(int command);
59     void processMessage(Message* m);
60
61     void go();
62
63     bool channelChange(UCHAR changeType, UINT newData);
64     // changeType = INDEX = (newData is a channel index in the list)
65     //            = NUMBER = (newData is a real channel number)
66     //            = OFFSET = (newData is UP or DOWN)
67
68     const static UCHAR INDEX = 1;
69     const static UCHAR NUMBER = 2;
70     const static UCHAR OFFSET = 3;
71     const static UCHAR PREVIOUS = 4;
72     const static UCHAR UP = 1;
73     const static UCHAR DOWN = 2;
74
75     void timercall(int ref);
76
77     void drawOSDBitmap(UINT posX, UINT posY, const Bitmap&, const DisplayRegion& region);
78     void clearOSD();
79     void clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, const DisplayRegion& region);
80
81   private:
82     BoxStack* boxstack;
83     VDR* vdr;
84     Video* video;
85     PlayerLive* player;
86     bool playing;
87     ChannelList* chanList;
88     VChannelList* vchannelList;
89     EventList* eventList;
90     int numberWidth;
91     int videoMode;
92     ULONG streamType;
93     ULONG preBuffering;
94
95     UINT currentChannelIndex;
96     UINT previousChannelIndex;
97     UINT osdChannelIndex;
98     int keying;
99     int keyingInput[10];
100
101     void doOK();
102     void doLeftRight(bool right);
103     void doUpDown(bool down);
104     void doChanUpDown(int which); // UP or DOWN
105     void doKey(int command);
106     void doEPG();
107     void doSummary();
108     void doAudioSelector();
109     void doTeletext(bool subtitle=false);
110     void stop();
111     UINT upChannel(UINT index);
112     UINT downChannel(UINT index);
113     void toggleChopSides();
114
115     void updatePosterBanner();
116
117     void displayOSD(bool newNowNextData);
118     void clearScreen();
119     void setClock();
120     void delData();
121     void setNowNextData();
122     void setSummaryData();
123     void doAudioChannelSymbol();
124     void showUnavailable();
125     
126     VAudioSelector* vas;
127 #ifdef PAL_WSS
128     Wwss wss;
129     Region wssRegion;
130     bool dowss;
131 #endif
132     
133     Boxx osd;
134     WTextbox clock;
135     WTextbox osdChanNum;
136     WTextbox osdChanName;
137     WTextbox sl;
138
139     Boxx boxRed;
140     Boxx boxGreen;
141     Boxx boxYellow;
142     Boxx boxBlue;
143     WTextbox textRed;
144     WTextbox textGreen;
145     WTextbox textYellow;
146     WTextbox textBlue;
147     WProgressBar bufferBar;
148     WSymbol sAspectRatio;
149     WSymbol sAudioChannels;
150
151
152     WTextbox textUnavailable;
153     WTVMedia osdposterbanner;
154     WTVMedia radioChannelLogo;
155     WTVMedia osdChannelLogo;
156     
157     WTVMedia txtlogo;
158     WTVMedia dolbylogo;
159     WTVMedia reslogo;
160
161     
162
163     
164     bool okTriggeredOSD;
165
166 };
167
168 #endif