2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
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.
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.
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
21 #include "vtimerlist.h"
23 VTimerList::VTimerList(RecTimerList* trtl)
28 if (Video::getInstance()->getFormat() == Video::PAL)
38 setBackgroundColour(Colour::VIEWBACKGROUND);
40 setTitleText(tr("Timers"));
41 setTitleBarColour(Colour::TITLEBARBACKGROUND);
43 sl.setSurface(surface);
44 sl.setSurfaceOffset(10, 30 + 5);
45 sl.setDimensions(area.w - 20, area.h - 30 - 15 - 30);
50 VTimerList::~VTimerList()
54 for (UINT i = 0; i < recTimerList->size(); i++)
56 delete (*recTimerList)[i];
59 recTimerList->clear();
64 void VTimerList::drawData()
74 for (UINT i = 0; i < recTimerList->size(); i++)
76 recTimer = (*recTimerList)[i];
77 sprintf(str, "%u\t%s", i, recTimer->file);
78 recTimer->index = sl.addOption(str, first);
83 void VTimerList::draw()
88 // Put the status stuff at the bottom
91 w.setSurface(surface);
93 w.nextSymbol = WSymbol::UP;
94 w.setSurfaceOffset(20, 385);
97 w.nextSymbol = WSymbol::DOWN;
98 w.setSurfaceOffset(50, 385);
101 w.nextSymbol = WSymbol::SKIPBACK;
102 w.setSurfaceOffset(85, 385);
105 w.nextSymbol = WSymbol::SKIPFORWARD;
106 w.setSurfaceOffset(115, 385);
109 // w.nextSymbol = WSymbol::PLAY;
110 // w.setSurfaceOffset(150, 385);
116 void VTimerList::doShowingBar()
118 int topOption = sl.getTopOption() + 1;
119 if (sl.getNumOptions() == 0) topOption = 0;
122 sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
124 rectangle(220, 385, 220+160, 385+25, Colour::VIEWBACKGROUND);
125 drawText(showing, 220, 385, Colour::LIGHTTEXT);
128 int VTimerList::handleCommand(int command)
139 ViewMan::getInstance()->updateView(this);
142 case Remote::DF_DOWN:
149 ViewMan::getInstance()->updateView(this);
152 case Remote::SKIPBACK:
158 ViewMan::getInstance()->updateView(this);
161 case Remote::SKIPFORWARD:
167 ViewMan::getInstance()->updateView(this);
172 RecTimer* recTimer = NULL;
175 int currentOption = sl.getCurrentOption();
177 for (UINT i = 0; i < recTimerList->size(); i++)
179 recTimer = (*recTimerList)[i];
180 if (currentOption == recTimer->index) break;
184 if (recTimer == NULL) return 2;
186 // recTimer is the one you want FIXME
195 // stop command getting to any more views