logger->log("Player", Log::DEBUG, "Player has received length frames of %lu", lengthFrames);
}
-/*
-ULLONG Player::getEndTS() // FIXME delme - used only by bar clocks until current frame code is done
-{
- long long rendTS = endTS - startTS;
- if (rendTS < 0) rendTS += 8589934592ULL;
- return (ULLONG)rendTS;
-}
-*/
-
-/*
-hmsf Player::getEndHMSF()
-{
- return video->framesToHMSF(lengthFrames);
-}
-*/
-
ULONG Player::getLengthFrames()
{
return lengthFrames;
#endif
}
-/*
-void Player::restartAt(ULLONG timecode)
-{
- if (paused) togglePauseInt();
- if (ffwd) toggleFastForwardInt();
-
- ULONG wantedFrameNumber = video->timecodeToFrameNumber(timecode);
- ULLONG newPosition = VDR::getInstance()->positionFromFrameNumber(wantedFrameNumber);
- if (!VDR::getInstance()->isConnected()) { doConnectionLost(); return; }
- logger->log("Player", Log::DEBUG, "wantedframe %i feedpos %llu goto %llu", wantedFrameNumber, feedPosition, newPosition);
-
- vfeed.stop();
- afeed.stop();
- threadStop();
- video->stop();
- video->reset();
- audio->reset();
- demuxer->flush();
- if (!isRadio) demuxer->seek();
- feedPosition = newPosition;
- demuxer->setFrameNum(wantedFrameNumber);
- videoStartup = true;
- afeed.start();
- vfeed.start();
- threadStart();
- audio->play();
- video->sync();
- audio->sync();
- audio->systemMuteOff();
- audio->doMuting();
- fbwd = false;
-}
-*/
-
void Player::restartAtFrame(ULONG newFrame)
{
if (paused) togglePauseInt();
fbwd = false;
}
-/*
-void Player::setStartTS(UINT dataInBuffer)
-{
-#ifndef NEW_DEMUXER
- if (isRecording && feedPosition) // (feedPosition != 0)
- {
- // FIXME find out how much data need to get to find a TS
- // Need to get the actual start of the recording
-
- UINT thisRead;
- UCHAR* tempBuffer = VDR::getInstance()->getBlock(0, 100000, &thisRead);
- if (!tempBuffer && !VDR::getInstance()->isConnected()) { doConnectionLost(); return; }
- if (!tempBuffer) return;
- if (thisRead) demuxer->findVideoPTS(tempBuffer, thisRead, &startTS);
- free(tempBuffer);
- }
- else
- {
- demuxer->findVideoPTS(threadBuffer, dataInBuffer, &startTS);
- }
-#else
- startTS=0;
-#endif
-}
-*/
-
-/*
-void Player::setEndTS()
-{
- logger->log("Player", Log::DEBUG, "Setting end TS");
-#ifndef NEW_DEMUXER
- UINT thisRead;
- UCHAR* tempBuffer = VDR::getInstance()->getBlock((lengthBytes - 100000), 100000, &thisRead);
- if (!tempBuffer && !VDR::getInstance()->isConnected()) { doConnectionLost(); return; }
- if (!tempBuffer) return;
- if (thisRead) demuxer->findVideoPTS(tempBuffer, thisRead, &endTS);
- free(tempBuffer);
- #else //The replacement code relias completely on VDRs timecode and not the pts
- endTS=video->frameNumberToTimecode(
- VDR::getInstance()->frameNumberFromPosition((lengthBytes - 100000)));
- #endif
- logger->log("Player", Log::DEBUG, "Set end TS");
-}
-*/
-
void Player::doConnectionLost()
{
Message* m = new Message();
barRegion.w = video->getScreenWidth();
barRegion.h = 66;
- clocksRegion.x = barRegion.x + 160;
+ clocksRegion.x = barRegion.x + 140;
clocksRegion.y = barRegion.y + 12;
clocksRegion.w = 170;
clocksRegion.h = surface->getFontHeight();
drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT);
- // Draw progress bar
- rectangle(barRegion.x + 350, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT);
- rectangle(barRegion.x + 352, barRegion.y + 14, 306, 20, barBlue);
+ // Draw clock
+ // Blank the area first
+ rectangle(barRegion.x + 624, barRegion.y + 12, 60, 30, barBlue);
+ char timeString[20];
+ time_t t;
+ time(&t);
+ struct tm* tms = localtime(&t);
+ strftime(timeString, 19, "%H:%M", tms);
+ drawText(timeString, barRegion.x + 624, barRegion.y + 12, Colour::LIGHTTEXT);
+
+
+
+
+
+
+ // Draw progress bar
+ int progBarXbase = barRegion.x + 300;
-// if ((currentTS > 95441) || (!endTS)) return; // No values yet
+ rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT);
+ rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 14, 306, 20, barBlue);
double progress01 = (double)currentFrameNum / (double)lengthFrames;
// total width of bar = 302
int progressWidth = (int)(302 * progress01);
- rectangle(barRegion.x + 354, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT);
+ rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT);
// Now calc position for start margin blips
double pos01;
pos01 = (startMargin * video->getFPS()) / (double)lengthFrames;
posPix = (int)(302 * pos01);
- rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
- rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
+ rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
+ rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
pos01 = (lengthFrames - (endMargin * video->getFPS())) / (double)lengthFrames;
posPix = (int)(302 * pos01);
- rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
- rectangle(barRegion.x + 352 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
+ rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT);
+ rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT);
}
void VVideoRec::removeBar()