]> git.vomp.tv Git - vompclient.git/blob - vepg.h
Fix black background for 16:9 live TV on 4:3 screen
[vompclient.git] / vepg.h
1 /*
2     Copyright 2005 Brian Walton
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, see <https://www.gnu.org/licenses/>.
18 */
19
20 #ifndef VEPG_H
21 #define VEPG_H
22
23 #include <vector>
24
25 #include "boxx.h"
26 #include "defines.h"
27 #include "timers.h"
28 #include "wtextbox.h"
29 #include "vdr.h"
30 #include "wselectlist.h"
31 #include "event.h"
32
33 class Message;
34 class VVideoLive;
35 class BoxStack;
36
37 //#define WINDOW_WIDTH (150)
38 #define MINUTE_SCALE (3)
39
40 class VVideoLive;
41
42 class VEpg : public Boxx, public TimerReceiver
43 {
44   public:
45     VEpg(void* parent, UINT currentChannel, ChannelList* tchanList);
46     ~VEpg();
47     static VEpg* getInstance();
48
49     void preDelete();
50     int handleCommand(int command); // deal with commands (from remote control)
51     void draw(); // draw epg view
52     void processMessage(Message* m);
53     void timercall(int clientReference);
54
55   private:
56     static VEpg* instance;
57
58     void setInfo(Event* event); // display details of selected programme
59     void drawgrid(); // redraws grid and select programme
60     void drawData();
61     void setCurrentChannel();
62
63     WSelectList chanListbox; // listbox to display available channels
64     WTextbox progTitle; // area to display time and title of selected programme
65     WTextbox progInfo; // area to display details of selected programme
66     EventList* eventList; // list of events (programmes) for a channel
67     Event thisEvent; // the selected event
68     time_t selTime; // current selection time
69     UINT e; // temp used to point to an event
70     ChannelList* chanList; // list of available channels
71     tm* epgtime; // selected time within epg
72     tm* Ltime; // time of LHS of epg view
73     time_t ltime; // time of LHS of epg view
74     time_t lastEnd; // end time of last painted cell - used to look for gaps in epg
75     WTextbox chanName;
76     std::vector<EventList*> eventLista;
77     int listTop;
78     int listWindowSize;
79     void updateChanList();
80     void updateEventList();
81     void paintCell(Event* event, int yOffset, const DrawStyle& bg, const DrawStyle& fg);
82     time_t prevHour(time_t* t);
83     void* parent;
84     BoxStack* boxstack;
85     UINT gridRows;
86     UINT currentChannelIndex;
87     UINT window_width;
88     UINT window_x;
89 };
90
91 #endif