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