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