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 "vvideorec.h"
23 VVideoRec::VVideoRec(Recording* rec)
25 player = new PlayerVideo(Command::getInstance(), 1, 0); // say 0 for radio because buffering will work anyway
27 vdr = VDR::getInstance();
31 Video* video = Video::getInstance();
32 create(video->getScreenWidth(), video->getScreenHeight());
33 Colour transparent(0, 0, 0, 0);
34 setBackgroundColour(transparent);
37 VVideoRec::~VVideoRec()
39 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Pre delete player");
41 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Post delete player");
42 Video::getInstance()->setDefaultAspect();
45 void VVideoRec::draw()
50 void VVideoRec::go(ULLONG startPosition)
52 ULLONG recLength = vdr->streamRecording(myRec);
54 player->setLength(recLength);
55 player->setPosition(startPosition);
59 int VVideoRec::handleCommand(int command)
65 player->play(); // do resync
73 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Pre player stop");
76 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Post player stop");
81 player->togglePause();
84 case Remote::SKIPFORWARD:
86 player->skipForward(60);
89 case Remote::SKIPBACK:
91 player->skipBackward(60);
96 player->toggleFastForward();
101 player->skipBackward(10);
106 player->skipForward(10);
110 // case Remote::REVERSE:
112 // player->toggleFastBackward();
129 case Remote::ZERO: player->jumpToPercent(0); return 2;
130 case Remote::ONE: player->jumpToPercent(10); return 2;
131 case Remote::TWO: player->jumpToPercent(20); return 2;
132 case Remote::THREE: player->jumpToPercent(30); return 2;
133 case Remote::FOUR: player->jumpToPercent(40); return 2;
134 case Remote::FIVE: player->jumpToPercent(50); return 2;
135 case Remote::SIX: player->jumpToPercent(60); return 2;
136 case Remote::SEVEN: player->jumpToPercent(70); return 2;
137 case Remote::EIGHT: player->jumpToPercent(80); return 2;
138 case Remote::NINE: player->jumpToPercent(90); return 2;