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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #include "vvideorec.h"
24 #include "vteletextview.h"
34 #include "recording.h"
35 #include "vaudioselector.h"
46 VVideoRec::VVideoRec(Recording* rec, bool ish264)
48 boxstack = BoxStack::getInstance();
49 vdr = VDR::getInstance();
50 video = Video::getInstance();
51 timers = Timers::getInstance();
55 videoMode = video->getMode();
58 video->seth264mode(ish264);
60 player = new Player(Command::getInstance(), this, this);
61 player->init(myRec->IsPesRecording,myRec->recInfo->fps);
67 char* cstartMargin = vdr->configLoad("Timers", "Start margin");
68 char* cendMargin = vdr->configLoad("Timers", "End margin");
71 startMargin = 300; // 5 mins default
75 startMargin = atoi(cstartMargin) * 60;
76 delete[] cstartMargin;
81 endMargin = 300; // 5 mins default
85 endMargin = atoi(cendMargin) * 60;
89 Log::getInstance()->log("VVideoRec", Log::DEBUG, "SM: %u EM: %u", startMargin, endMargin);
91 setSize(video->getScreenWidth(), video->getScreenHeight());
93 transparent.set(0, 0, 0, 0);
94 setBackgroundColour(transparent);
97 barRegion.y = video->getScreenHeight() - 58; // FIXME, need to be - 1? and below?
98 barRegion.w = video->getScreenWidth();
101 clocksRegion.x = barRegion.x + 140;
102 clocksRegion.y = barRegion.y + 12;
103 clocksRegion.w = 170;
104 clocksRegion.h = surface->getFontHeight();
105 // barBlue.set(0, 0, 150, 150);
106 barBlue.set(0, 0, 0, 128);
114 char* optionWSS = vdr->configLoad("General", "WSS");
117 if (strstr(optionWSS, "Yes")) dowss = true;
120 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Do WSS: %u", dowss);
124 wss.setFormat(video->getFormat());
130 wssRegion.w = video->getScreenWidth();
135 void VVideoRec::preDelete()
137 timers->cancelTimer(this, 1);
138 timers->cancelTimer(this, 2);
142 boxstack->remove(vas);
146 if (vsummary) delete vsummary;
148 if (playing) stopPlay();
151 VVideoRec::~VVideoRec()
153 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Entering vvideorec destructor");
155 video->setDefaultAspect();
157 // kill recInfo in case resumePoint has changed (likely)
158 myRec->dropRecInfo();
159 // FIXME - do this properly - save the resume point back to the server manually and update
160 // rec->recInfo->resumePoint - this will fix the ~10s offset problem as well
163 void VVideoRec::go(bool resume)
167 startFrameNum = myRec->recInfo->resumePoint;
171 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Starting stream: %s at frame: %lu", myRec->getFileName(), startFrameNum);
172 ULONG lengthFrames = 0;
174 ULLONG lengthBytes = vdr->streamRecording(myRec->getFileName(), &lengthFrames, &isPesRecording);
175 myRec->IsPesRecording = isPesRecording;
178 player->setLengthBytes(lengthBytes);
179 player->setLengthFrames(lengthFrames);
180 player->setStartFrame(startFrameNum);
187 stopPlay(); // clean up
189 if (!vdr->isConnected())
191 Command::getInstance()->connectionLost();
195 Message* m = new Message();
196 m->message = Message::CLOSE_ME;
199 Command::getInstance()->postMessageNoLock(m);
201 VInfo* vi = new VInfo();
202 vi->setSize(400, 150);
204 if (video->getFormat() == Video::PAL)
205 vi->setPosition(170, 200);
207 vi->setPosition(160, 150);
210 vi->setTitleBarOn(0);
211 vi->setOneLiner(tr("Error playing recording"));
215 m->message = Message::ADD_VIEW;
217 m->parameter = (ULONG)vi;
218 Command::getInstance()->postMessageNoLock(m);
222 int VVideoRec::handleCommand(int command)
244 if (playing) stopPlay();
254 case Remote::SKIPFORWARD:
257 player->skipForward(60);
260 case Remote::SKIPBACK:
263 player->skipBackward(60);
266 case Remote::FORWARD:
268 player->fastForward();
272 case Remote::REVERSE:
274 player->fastBackward();
280 if (vsummary) removeSummary();
291 if (myRec->hasMarks())
293 // skip to previous mark
294 Log* logger = Log::getInstance();
295 int currentFrame = (player->getCurrentFrameNum()); // get current Frame
296 currentFrame -= 5. * myRec->recInfo->fps; // subtrack 5 seconds, else you cannot skip more than once back ..
298 int prevMark = myRec->getPrevMark(currentFrame); // find previous Frame
301 logger->log("VVideoRec", Log::NOTICE, "jump back from pos %i to mark at %i",currentFrame,prevMark);
302 player->jumpToMark(prevMark);
309 player->skipBackward(10);
315 if (myRec->hasMarks())
318 Log* logger = Log::getInstance();
319 int currentFrame = (player->getCurrentFrameNum());
321 int nextMark = myRec->getNextMark(currentFrame);
325 logger->log("VVideoRec", Log::NOTICE, "jump forward from pos %i to mark at %i",currentFrame,nextMark);
326 player->jumpToMark(nextMark);
333 player->skipForward(10);
340 player->skipBackward(10);
346 player->skipForward(10);
364 if (barShowing) removeBar();
369 case Remote::ZERO: player->jumpToPercent(0); doBar(0); return 2;
370 case Remote::ONE: player->jumpToPercent(10); doBar(0); return 2;
371 case Remote::TWO: player->jumpToPercent(20); doBar(0); return 2;
372 case Remote::THREE: player->jumpToPercent(30); doBar(0); return 2;
373 case Remote::FOUR: player->jumpToPercent(40); doBar(0); return 2;
374 case Remote::FIVE: player->jumpToPercent(50); doBar(0); return 2;
375 case Remote::SIX: player->jumpToPercent(60); doBar(0); return 2;
376 case Remote::SEVEN: player->jumpToPercent(70); doBar(0); return 2;
377 case Remote::EIGHT: player->jumpToPercent(80); doBar(0); return 2;
378 case Remote::NINE: player->jumpToPercent(90); doBar(0); return 2;
380 case Remote::RECORD: player->toggleSubtitles(); return 2;
384 //Don't use RED for anything. It will eventually be recording summary
390 // for testing EPG in NTSC with a NTSC test video
391 Video::getInstance()->setMode(Video::QUARTER);
392 Video::getInstance()->setPosition(170, 5);
393 VEpg* vepg = new VEpg(NULL, 0);
395 BoxStack::getInstance()->add(vepg);
396 BoxStack::getInstance()->update(vepg);
409 void VVideoRec::doTeletext()
416 VTeletextView *vtxv=player->getTeletextDecoder()->getTeletxtView();
418 vtxv= new VTeletextView((player)->getTeletextDecoder(),this);
419 (player)->getTeletextDecoder()->registerTeletextView(vtxv);
422 vtxv->setSubtitleMode(true);
427 BoxStack::getInstance()->add(vtxv);
429 BoxStack::getInstance()->update(this);
430 BoxStack::getInstance()->update(vtxv);
433 void VVideoRec::processMessage(Message* m)
435 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Message received");
437 if (m->message == Message::MOUSE_LBDOWN)
439 UINT x = (m->parameter>>16) - getScreenX();
440 UINT y = (m->parameter&0xFFFF) - getScreenY();
444 BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
446 else if (barRegion.x<=x && barRegion.y<=y && (barRegion.x+barRegion.w)>=x && (barRegion.y+barRegion.h)>=y)
448 int progBarXbase = barRegion.x + 300;
449 if (myRec->hasMarks())
451 MarkList* markList = myRec->getMarkList();
452 MarkList::iterator i;
453 Mark* loopMark = NULL;
456 if (myRec->recInfo->timerEnd > time(NULL))
459 // Work out an approximate length in frames (good to 1s...)
460 lengthFrames = (ULONG)((double)(myRec->recInfo->timerEnd - myRec->recInfo->timerStart) * myRec->recInfo->fps);
464 lengthFrames = player->getLengthFrames();
466 for(i = markList->begin(); i != markList->end(); i++)
471 posPix = 302 * loopMark->pos / lengthFrames;
472 rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, Colour::DANGER);
473 if (x>=barRegion.x + progBarXbase + 2 + posPix
474 && x<=barRegion.x + progBarXbase + 2 + posPix+3
475 && y>=barRegion.y + 12 - 2
476 && y<=barRegion.y + 12 - 2+28)
478 player->jumpToMark(loopMark->pos);
486 if (x>=barRegion.x + progBarXbase + 24
487 && x<=barRegion.x + progBarXbase + 4 + 302
488 && y>=barRegion.y + 12 - 2
489 && y<=barRegion.y + 12 - 2+28)
491 int cx=x-(barRegion.x + progBarXbase + 4);
492 double percent=((double)cx)/302.*100.;
493 player->jumpToPercent(percent);
496 // int progressWidth = 302 * currentFrameNum / lengthFrames;
497 // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT);
502 BoxStack::getInstance()->handleCommand(Remote::OK); //simulate rok press
505 else if (m->from == player)
507 if (m->message != Message::PLAYER_EVENT) return;
510 case Player::CONNECTION_LOST: // connection lost detected
512 // I can't handle this, send it to command
513 Message* m2 = new Message();
514 m2->to = Command::getInstance();
515 m2->message = Message::CONNECTION_LOST;
516 Command::getInstance()->postMessageNoLock(m2);
519 case Player::STOP_PLAYBACK:
521 // FIXME Obselete ish - improve this
522 Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
523 m2->to = Command::getInstance();
524 m2->message = Message::STOP_PLAYBACK;
525 Command::getInstance()->postMessageNoLock(m2);
528 case Player::ASPECT43:
532 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 43");
535 boxstack->update(this, &wssRegion);
539 case Player::ASPECT169:
543 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received do WSS 169");
546 boxstack->update(this, &wssRegion);
552 else if (m->message == Message::AUDIO_CHANGE_CHANNEL)
554 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change audio channel to %i", m->parameter);
555 player->setAudioChannel(m->parameter&0xFFFF,(m->parameter&0xFF0000)>> 16 );
557 else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
559 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Received change subtitle channel to %i", m->parameter);
560 int type=((m->parameter & 0xFF0000)>>16);
562 case 0x10: { //dvbsubtitle
563 player->setSubtitleChannel((m->parameter & 0xFFFF));
564 player->turnSubtitlesOn(true);
565 VTeletextView *vtxt=((Player*)player)->getTeletextDecoder()->getTeletxtView();
566 if (vtxt && vtxt->isInSubtitleMode()) {
567 BoxStack::getInstance()->remove(vtxt);
570 case 0xFF: { //nosubtitles
572 player->turnSubtitlesOn(false);
573 VTeletextView *vtxt=((Player*)player)->getTeletextDecoder()->getTeletxtView();
574 if (vtxt && vtxt->isInSubtitleMode()) {
575 BoxStack::getInstance()->remove(vtxt);
579 case 0x11: { //videotext
580 player->turnSubtitlesOn(false);
582 ((Player*)player)->getTeletextDecoder()->setPage((m->parameter & 0xFFFF));
586 BoxStack::getInstance()->update(vas);
588 BoxStack::getInstance()->update(this);
592 else if (m->message == Message::CHILD_CLOSE)
598 if (!barGenHold && !barScanHold && !barVasHold) removeBar();
603 void VVideoRec::stopPlay()
605 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Pre stopPlay");
608 Log::getInstance()->log("VVideoRec", Log::DEBUG, "1");
610 Log::getInstance()->log("VVideoRec", Log::DEBUG, "2");
611 vdr->stopStreaming();
612 Log::getInstance()->log("VVideoRec", Log::DEBUG, "3");
617 if (!vdr->isConnected()) { Command::getInstance()->connectionLost(); return; }
618 Log::getInstance()->log("VVideoRec", Log::DEBUG, "Post stopPlay");
621 void VVideoRec::toggleChopSides()
623 if (video->getTVsize() == Video::ASPECT16X9) return; // Means nothing for 16:9 TVs
625 if (videoMode == Video::NORMAL)
627 videoMode = Video::LETTERBOX;
628 video->setMode(Video::LETTERBOX);
632 videoMode = Video::NORMAL;
633 video->setMode(Video::NORMAL);
637 void VVideoRec::doAudioSelector()
639 int subtitleChannel=player->getCurrentSubtitleChannel();
640 int subtitleType=0x10;
641 if (!(player)->isSubtitlesOn()) {
642 if ((player)->getTeletextDecoder()->getTeletxtView() &&
643 (player)->getTeletextDecoder()->getTeletxtView()->isInSubtitleMode()
645 subtitleChannel=(player)->getTeletextDecoder()->getPage();
649 subtitleType=0xFF; //turnedOff
653 if (player->isPesRecording()) {
654 bool* availableMpegAudioChannels = player->getDemuxerMpegAudioChannels();
655 bool* availableAc3AudioChannels = NULL;
656 bool* availableSubtitleChannels = player->getDemuxerSubtitleChannels();
657 int *availableTTxtpages = player->getTeletxtSubtitlePages();
658 int currentAudioChannel = player->getCurrentAudioChannel();
659 if (Audio::getInstance()->supportsAc3())
661 availableAc3AudioChannels = player->getDemuxerAc3AudioChannels();
664 vas = new VAudioSelector(this, availableMpegAudioChannels, availableAc3AudioChannels, currentAudioChannel,availableSubtitleChannels, availableTTxtpages,
665 subtitleChannel, subtitleType, myRec->recInfo);
668 Channel temp_channel=player->getDemuxerChannel();
669 RecInfo *cur_info= myRec->recInfo;
670 unsigned char numchan_recinfo = cur_info->numComponents;
671 unsigned char numchan_subtitles_siz = temp_channel.numSPids;
672 ULONG mp_audcounter = 0;
673 ULONG ac3_counter = 0;
674 int dvb_subcounter = 1;
680 for (i = 0; i < numchan_recinfo; i++)
683 type = cur_info->types[i];
684 lang = cur_info->languages[i];
685 description = cur_info->descriptions[i];
688 if (cur_info->streams[i] == 2) {
691 case 1: //mpaudio mono
692 case 3: //mpaudio stereo
693 if (mp_audcounter < temp_channel.numAPids) ac = &temp_channel.apids[mp_audcounter];
698 if (ac3_counter < temp_channel.numDPids) ac = &temp_channel.dpids[ac3_counter];
702 } else if (cur_info->streams[i] == 3){
703 if (dvb_subcounter < numchan_subtitles_siz) ac = &temp_channel.spids[dvb_subcounter];
704 } else continue; //neither audio nor subtitle
707 if (description && (strlen(description) > 0))
709 ac->name = new char[strlen(description) + 1];
710 strcpy(ac->name, description);
712 } else if (lang && strlen(lang) > 0)
714 ac->name = new char[strlen(lang) + 1];
715 strcpy(ac->name, lang);
720 for (i=0;i<temp_channel.numAPids;i++) {
721 apid *ac=&temp_channel.apids[i];
722 if (ac->name==NULL) {
723 ac->name = new char[strlen(tr("unknown")) + 1];
724 strcpy(ac->name, tr("unknown"));
727 for (i=0;i<temp_channel.numDPids;i++) {
728 apid *ac=&temp_channel.dpids[i];
729 if (ac->name==NULL) {
730 ac->name = new char[strlen(tr("unknown")) + 1];
731 strcpy(ac->name, tr("unknown"));
734 for (i=0;i<temp_channel.numSPids;i++) {
735 apid *ac=&temp_channel.spids[i];
736 if (ac->name==NULL) {
737 ac->name = new char[strlen(tr("unknown")) + 1];
738 strcpy(ac->name, tr("unknown"));
742 vas = new VAudioSelector(this,&temp_channel , (player)->getCurrentAudioChannel(),
743 subtitleType,subtitleChannel,player->getTeletxtSubtitlePages());
744 for (i=0;i<temp_channel.numAPids;i++) {
745 apid *ac=&temp_channel.apids[i];
749 for (i=0;i<temp_channel.numDPids;i++) {
750 apid *ac=&temp_channel.dpids[i];
754 for (i=0;i<temp_channel.numSPids;i++) {
755 apid *ac=&temp_channel.spids[i];
762 vas->setBackgroundColour(barBlue);
763 vas->setPosition(0, barRegion.y - 120);
772 boxstack->update(vas);
775 void VVideoRec::doBar(int action)
779 rectangle(barRegion, barBlue);
781 /* Work out what to display - choices:
788 Specials, informed by parameter
800 w.setPosition(barRegion.x + 66, barRegion.y + 16);
802 UCHAR playerState = 0;
806 if (action == 1) w.nextSymbol = WSymbol::SKIPFORWARD;
807 else if (action == 2) w.nextSymbol = WSymbol::SKIPBACK;
808 else if (action == 3) w.nextSymbol = WSymbol::SKIPFORWARD2;
809 else if (action == 4) w.nextSymbol = WSymbol::SKIPBACK2;
813 playerState = player->getState();
814 if (playerState == Player::S_PAUSE_P) w.nextSymbol = WSymbol::PAUSE;
815 else if (playerState == Player::S_PAUSE_I) w.nextSymbol = WSymbol::PAUSE;
816 else if (playerState == Player::S_FFWD) w.nextSymbol = WSymbol::FFWD;
817 else if (playerState == Player::S_FBWD) w.nextSymbol = WSymbol::FBWD;
818 else w.nextSymbol = WSymbol::PLAY;
823 if ((playerState == Player::S_FFWD) || (playerState == Player::S_FBWD))
825 // draw blips to show how fast the scan is
826 UCHAR scanrate = player->getIScanRate();
830 SNPRINTF(text, 5, "%ux", scanrate);
831 drawText(text, barRegion.x + 102, barRegion.y + 12, Colour::LIGHTTEXT);
837 boxstack->update(this, &barRegion);
839 timers->cancelTimer(this, 1);
842 if ((playerState == Player::S_FFWD) || (playerState == Player::S_FBWD)) barScanHold = true;
843 else barScanHold = false;
845 if (!barGenHold && !barScanHold && !barVasHold) timers->setTimerD(this, 1, 4);
847 timers->setTimerD(this, 2, 0, 200000000);
850 void VVideoRec::timercall(int clientReference)
852 switch(clientReference)
863 if (!barShowing) break;
865 boxstack->update(this, &barRegion);
867 timers->setTimerD(this, 2, 0, 200000000);
873 hmsf VVideoRec::framesToHMSF(ULONG frames)
878 double fps=myRec->recInfo->fps;
879 ret.frames= int(modf((frames + 0.5) / fps, &Seconds) * fps + 1);
880 int s = int(Seconds);
882 ret.minutes = s / 60 % 60;
883 ret.hours = s / 3600;
889 void VVideoRec::drawBarClocks()
893 UCHAR playerState = player->getState();
894 // sticky bar is set if we are in ffwd/fbwd mode
895 // if player has gone to S_PLAY then kill stickyBar, and run doBar(0) which
896 // will repaint all the bar (it will call this function again, but
897 // this section won't run because stickyBarF will then == false)
899 if ((playerState != Player::S_FFWD) && (playerState != Player::S_FBWD))
903 return; // doBar will call this function and do the rest
907 Log* logger = Log::getInstance();
908 logger->log("VVideoRec", Log::DEBUG, "Draw bar clocks");
911 // Blank the area first
912 rectangle(barRegion.x + 624, barRegion.y + 12, 60, 30, barBlue);
916 struct tm* tms = localtime(&t);
917 strftime(timeString, 19, "%H:%M", tms);
918 drawText(timeString, barRegion.x + 624, barRegion.y + 12, Colour::LIGHTTEXT);
922 rectangle(clocksRegion, barBlue);
924 ULONG currentFrameNum = player->getCurrentFrameNum();
926 if (myRec->recInfo->timerEnd > time(NULL))
929 // Work out an approximate length in frames (good to 1s...)
930 lengthFrames =(ULONG) ((double)(myRec->recInfo->timerEnd - myRec->recInfo->timerStart) * myRec->recInfo->fps);
934 lengthFrames = player->getLengthFrames();
937 hmsf currentFrameHMSF = framesToHMSF(currentFrameNum);
938 hmsf lengthHMSF = framesToHMSF(lengthFrames);
941 if (currentFrameNum >= lengthFrames)
943 strcpy(buffer, "-:--:-- / -:--:--");
947 SNPRINTF(buffer, 99, "%01i:%02i:%02i / %01i:%02i:%02i", currentFrameHMSF.hours, currentFrameHMSF.minutes, currentFrameHMSF.seconds, lengthHMSF.hours, lengthHMSF.minutes, lengthHMSF.seconds);
948 logger->log("VVideoRec", Log::DEBUG, buffer);
951 drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT);
960 int progBarXbase = barRegion.x + 300;
962 rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT);
963 rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 14, 306, 20, barBlue);
965 if (currentFrameNum > lengthFrames) return;
966 if (lengthFrames == 0) return;
968 // Draw yellow portion
969 int progressWidth = 302 * currentFrameNum / lengthFrames;
970 rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT);
972 if (myRec->recInfo->timerEnd > time(NULL)) // if chasing
974 int nrWidth = (int)(302 * ((double)(lengthFrames - player->getLengthFrames()) / lengthFrames));
976 Log::getInstance()->log("GVASDF", Log::DEBUG, "Length Frames: %lu", lengthFrames);
977 Log::getInstance()->log("GVASDF", Log::DEBUG, "Player lf: %lu", player->getLengthFrames());
978 Log::getInstance()->log("GVASDF", Log::DEBUG, "NR WDITH: %i", nrWidth);
979 rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, Colour::RED);
983 // Now calc position for blips
985 if (myRec->hasMarks())
987 // Draw blips where there are cut marks
988 MarkList* markList = myRec->getMarkList();
989 MarkList::iterator i;
990 Mark* loopMark = NULL;
992 for(i = markList->begin(); i != markList->end(); i++)
997 logger->log("VVideoRec", Log::DEBUG, "Drawing mark at frame %i", loopMark->pos);
998 posPix = 302 * loopMark->pos / lengthFrames;
999 rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, Colour::DANGER);
1005 // Draw blips where start and end margins probably are
1007 posPix =(int) (302. * myRec->recInfo->fps * ((double)startMargin) /((double) lengthFrames));
1009 rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
1010 rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
1012 posPix = (int)(302. * ((double)lengthFrames - ((double)endMargin) * myRec->recInfo->fps) / ((double)lengthFrames));
1014 rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
1015 rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
1019 void VVideoRec::removeBar()
1021 if (!barShowing) return;
1022 timers->cancelTimer(this, 2);
1025 barScanHold = false;
1027 rectangle(barRegion, transparent);
1028 boxstack->update(this, &barRegion);
1031 void VVideoRec::doSummary()
1033 vsummary = new VInfo();
1034 vsummary->setTitleText(myRec->getProgName());
1035 vsummary->setBorderOn(1);
1036 vsummary->setExitable();
1037 if (myRec->recInfo->summary) vsummary->setMainText(myRec->recInfo->summary);
1038 else vsummary->setMainText(tr("Summary unavailable"));
1039 if (Video::getInstance()->getFormat() == Video::PAL)
1041 vsummary->setPosition(120, 130);
1045 vsummary->setPosition(110, 90);
1047 vsummary->setSize(510, 270);
1051 BoxStack::getInstance()->update(this);
1054 void VVideoRec::removeSummary()
1062 BoxStack::getInstance()->update(this);
1066 void VVideoRec::drawOSDBitmap(UINT posX, UINT posY, const Bitmap& bm)
1068 drawBitmap(posX, posY, bm);
1070 r.x = posX; r.y = posY; r.w = bm.getWidth(); r.h = bm.getHeight();
1071 boxstack->update(this, &r);
1074 void VVideoRec::clearOSD()
1076 rectangle(area, transparent);
1077 boxstack->update(this, &area);
1080 void VVideoRec::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height)
1083 r.x = posX; r.y = posY; r.w = width; r.h = height;
1084 rectangle(r, transparent);
1085 boxstack->update(this, &r);