]> git.vomp.tv Git - vompclient.git/blob - vvideolivetv.h
Rewritten vomp discovery protocol
[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 "wwss.h"
31 #include "vdr.h"
32 #include "wtextbox.h"
33 #include "wselectlist.h"
34 #include "timerreceiver.h"
35 #include "wsymbol.h"
36 #include "wprogressbar.h"
37 #include "osdreceiver.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     ~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&);
74     void clearOSD();
75     void clearOSDArea(UINT posX, UINT posY, UINT width, UINT height);
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 displayOSD(bool newNowNextData);
112     void clearScreen();
113     void setClock();
114     void delData();
115     void setNowNextData();
116     void setSummaryData();
117     void doAudioChannelSymbol();
118     void showUnavailable();
119     
120     VAudioSelector* vas;
121     
122     Wwss wss;
123     Region wssRegion;
124     bool dowss;
125     
126     Boxx osd;
127     WTextbox clock;
128     WTextbox osdChanNum;
129     WTextbox osdChanName;
130     WSelectList sl;
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     WSymbol sAspectRatio;
140     WProgressBar bufferBar;
141     WSymbol sAudioChannels;
142     WTextbox textUnavailable;
143     
144     Boxx summary;
145     WTextbox textSummary;
146     Boxx summaryBlackLine;
147     
148     Region osdSummaryRegion;
149     
150     bool okTriggeredOSD;
151
152 };
153
154 #endif