]> git.vomp.tv Git - vompclient.git/blob - vepg.h
Fix for possible crash when removing bar
[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, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef VEPG_H
22 #define VEPG_H
23 #define WINDOW_WIDTH (150)
24 #define MINUTE_SCALE (3)
25 #include <stdio.h>
26 #include <string.h>
27
28 #include "view.h"
29 #include "remote.h"
30 #include "wselectlist.h"
31 #include "viewman.h"
32 #include "vdr.h"
33 #include "vchannellist.h"
34 #include "command.h"
35 #include "message.h"
36 #include "colour.h"
37 #include "video.h"
38 #include "wtextbox.h"
39 #include "event.h"
40 #include "message.h"
41 #include "vvideolive.h"
42 #include "vepgsettimer.h"
43 #include "timers.h"
44
45 class VVideoLive;
46
47 class VEpg : public View, public TimerReceiver
48 {
49   public:
50     VEpg(VVideoLive* v, UINT currentChannel, ULONG streamType);
51     ~VEpg();
52     static VEpg* getInstance();
53
54     int handleCommand(int command); // deal with commands (from remote control)
55     void draw(); // draw epg view
56     void setCurrentChannel(char* chname);
57     void processMessage(Message* m);
58     void timercall(int clientReference);
59
60   private:
61     static VEpg* instance;
62
63     void setInfo(Event* event); // display details of selected programme
64     void drawgrid(); // redraws grid and select programme
65     void drawData();
66
67     WSelectList chanListbox; // listbox to display available channels
68     WTextbox progTitle; // area to display time and title of selected programme
69     WTextbox progInfo; // area to display details of selected programme
70     EventList* eventList; // list of events (programmes) for a channel
71     Event thisEvent; // the selected event
72     time_t selTime; // current selection time
73     UINT e; // temp used to point to an event
74     ChannelList* chanList; // list of available channels
75     tm* epgtime; // selected time within epg
76     tm* Ltime; // time of LHS of epg view
77     time_t ltime; // time of LHS of epg view
78     time_t lastEnd; // end time of last painted cell - used to look for gaps in epg
79     WTextbox chanName;
80     EventList* eventLista[7];
81     int listTop;
82     int listWindowSize;
83     void updateChanList();
84     void updateEventList();
85     void paintCell(Event* event, int yOffset, Colour bg, Colour fg);
86     time_t prevHour(time_t* t);
87     VVideoLive* videoLive;
88     ViewMan* viewman;
89     UINT gridRows;
90 };
91
92 #endif