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