]> git.vomp.tv Git - vompclient.git/blob - vvideolivetv.h
Vogel Media Player 2008-11-28
[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 stop();
106     UINT upChannel(UINT index);
107     UINT downChannel(UINT index);
108     void toggleChopSides();
109
110     void displayOSD(bool newNowNextData);
111     void clearScreen();
112     void setClock();
113     void delData();
114     void setNowNextData();
115     void setSummaryData();
116     void doAudioChannelSymbol();
117     void showUnavailable();
118     
119     VAudioSelector* vas;
120     
121     Wwss wss;
122     Region wssRegion;
123     bool dowss;
124     
125     Boxx osd;
126     WTextbox clock;
127     WTextbox osdChanNum;
128     WTextbox osdChanName;
129     WSelectList sl;
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     WSymbol sAspectRatio;
139     WProgressBar bufferBar;
140     WSymbol sAudioChannels;
141     WTextbox textUnavailable;
142     
143     Boxx summary;
144     WTextbox textSummary;
145     Boxx summaryBlackLine;
146     
147     Region osdSummaryRegion;
148     
149     bool okTriggeredOSD;
150
151 };
152
153 #endif