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