]> git.vomp.tv Git - vompclient.git/blob - vlivebanner.cc
Another stab at radio support, fix for chasing playback
[vompclient.git] / vlivebanner.cc
1 /*
2     Copyright 2004-2005 Chris Tallon
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 #include "vlivebanner.h"
22
23 VLiveBanner::VLiveBanner(Channel* channel)
24 {
25   currentChannel = channel;
26
27   if (Video::getInstance()->getFormat() == Video::PAL)
28   {
29     setScreenPos(130, 370);
30   }
31   else
32   {
33     setScreenPos(120, 320);
34   }
35
36   setDimensions(120, 500);
37
38   setBackgroundColour(Colour::VIEWBACKGROUND);
39   setTitleBarOn(1);
40   setTitleText(currentChannel->name);
41   setTitleBarColour(Colour::TITLEBARBACKGROUND);
42
43   sl.setScreenPos(screenX, screenY + 30);
44   sl.setDimensions(height - 60, width);
45 }
46
47 VLiveBanner::~VLiveBanner()
48 {
49 }
50
51 void VLiveBanner::draw()
52 {
53 //int success = VDR::getInstance()->getChannelSchedule(1);
54 int success = 0;
55
56   if (!success)
57   {
58     sl.addOption("No channel data available", 1);
59   }
60   else
61   {
62     sl.addOption("This Programme", 1);
63     sl.addOption("The Next Programme", 0);
64     sl.addOption("The Programme after that", 0);
65   }
66
67   View::draw();
68   sl.draw();
69   rectangle(0, height - 30, width, 30, titleBarColour);
70 }
71
72 int VLiveBanner::handleCommand(int command)
73 {
74   switch (command)
75   {
76     case Remote::OK:
77     case Remote::BACK:
78     {
79       return 4;
80     }
81     case Remote::DF_UP:
82     case Remote::UP:
83     {
84       sl.up();
85       sl.draw();
86
87       show();
88       return 2;
89     }
90     case Remote::DF_DOWN:
91     case Remote::DOWN:
92     {
93       sl.down();
94       sl.draw();
95
96       show();
97       return 2;
98     }
99   }
100
101   return 1;
102 }