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 "vtimeredit.h"
23 VTimerEdit::VTimerEdit(RecTimer* trt)
28 if (Video::getInstance()->getFormat() == Video::PAL)
38 setBackgroundColour(Colour::VIEWBACKGROUND);
40 setTitleText(tr("Edit Timer"));
41 setTitleBarColour(Colour::TITLEBARBACKGROUND);
50 drawText("Active", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
51 drawText("Channel", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
52 drawText("Name", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
53 drawText("Directory", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
54 ypos += surface->getFontHeight();
55 drawText("Start", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
56 drawText("Stop", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
57 drawText("Priority", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
58 drawText("Lifetime", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
59 ypos += surface->getFontHeight();
60 drawText("Current", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
61 drawText("Recording", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
62 drawText("Summary", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
72 if (recTimer->active) strcpy(buffer, "Yes");
73 else strcpy(buffer, "No");
74 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
77 snprintf(buffer, 999, "%lu", recTimer->channelNumber);
78 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
81 snprintf(buffer, 999, "%s", recTimer->getName());
82 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
85 if (recTimer->getDirectory()) snprintf(buffer, 999, "%s", recTimer->getDirectory());
86 else strcpy(buffer, "");
87 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
88 ypos += surface->getFontHeight();
91 tms = localtime((time_t*)&recTimer->startTime);
92 strftime(buffer, 999, "%d/%m %H:%M", tms);
93 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
96 tms = localtime((time_t*)&recTimer->stopTime);
97 strftime(buffer, 999, "%d/%m %H:%M", tms);
98 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
101 snprintf(buffer, 999, "%lu", recTimer->priority);
102 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
105 snprintf(buffer, 999, "%lu", recTimer->lifeTime);
106 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
107 ypos += surface->getFontHeight();
110 if (recTimer->pending) strcpy(buffer, "Yes");
111 else strcpy(buffer, "No");
112 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
115 if (recTimer->recording) strcpy(buffer, "Yes");
116 else strcpy(buffer, "No");
117 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
120 strcpy(buffer, "View summary");
121 drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight();
126 VTimerEdit::~VTimerEdit()
130 int VTimerEdit::handleCommand(int command)
138 ViewMan::getInstance()->updateView(this);
141 case Remote::DF_DOWN:
145 ViewMan::getInstance()->updateView(this);
158 // stop command getting to any more views