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