]> git.vomp.tv Git - vompclient.git/blob - vepg.h
Connection failure detection
[vompclient.git] / vepg.h
1 /*\r
2     Copyright 2005 Brian Walton\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 */\r
20 \r
21 #ifndef VEPG_H\r
22 #define VEPG_H\r
23 #define WINDOW_WIDTH (150)\r
24 #define MINUTE_SCALE (3)\r
25 #include <stdio.h>\r
26 #include <string.h>\r
27 \r
28 #include "view.h"\r
29 #include "remote.h"\r
30 #include "wselectlist.h"\r
31 #include "viewman.h"\r
32 #include "vdr.h"\r
33 #include "vchannellist.h"\r
34 #include "command.h"\r
35 #include "message.h"\r
36 #include "colour.h"\r
37 #include "video.h"\r
38 #include "wtextbox.h"\r
39 #include "event.h"\r
40 #include "message.h"\r
41 #include "vvideolive.h"\r
42 #include "vepgsettimer.h"\r
43 \r
44 class VVideoLive;\r
45 \r
46 class VEpg : public View\r
47 {\r
48   public:\r
49     VEpg(VVideoLive* v, UINT currentChannel = 0);\r
50     ~VEpg();\r
51     static VEpg* getInstance();\r
52 \r
53     int handleCommand(int command); // deal with commands (from remote control)\r
54     void draw(); // draw epg view\r
55     void setCurrentChannel(char* chname);\r
56 \r
57   private:\r
58     static VEpg* instance;\r
59 \r
60     void setInfo(Event* event); // display details of selected programme\r
61     void drawgrid(); // redraws grid and select programme\r
62     void drawData();\r
63 \r
64     WSelectList chanListbox; // listbox to display available channels\r
65     WTextbox progTitle; // area to display time and title of selected programme\r
66     WTextbox progInfo; // area to display details of selected programme\r
67     EventList* eventList; // list of events (programmes) for a channel\r
68     Event thisEvent; // the selected event\r
69     time_t selTime; // current selection time\r
70     UINT e; // temp used to point to an event\r
71     ChannelList* chanList; // list of available channels\r
72     tm* epgtime; // selected time within epg\r
73     tm* Ltime; // time of LHS of epg view\r
74     time_t ltime; // time of LHS of epg view\r
75     time_t lastEnd; // end time of last painted cell - used to look for gaps in epg\r
76     WTextbox chanName;\r
77     EventList* eventLista[7];\r
78     int listTop;\r
79     int listWindowSize;\r
80     void updateChanList();\r
81     void updateEventList();\r
82     void paintCell(Event* event, int yOffset, Colour bg, Colour fg);\r
83     time_t prevHour(time_t* t);\r
84     VVideoLive* videoLive;\r
85     ViewMan* viewman;\r
86     UINT gridRows;\r
87 };\r
88 \r
89 #endif\r