]> git.vomp.tv Git - vompclient.git/commitdiff
Clock on recplayer bar. code deletions from player
authorChris Tallon <chris@vomp.tv>
Wed, 14 Jun 2006 23:17:29 +0000 (23:17 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 14 Jun 2006 23:17:29 +0000 (23:17 +0000)
player.cc
player.h
vvideorec.cc

index ad515497a3df366c3f4999cf3f3f6276d50ca3f8..c68eca1a0db89b5d206b6791390675f55d96cd8e 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -154,22 +154,6 @@ void Player::setLengthFrames(ULONG length)
   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;
@@ -494,40 +478,6 @@ void Player::unLock()
 #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();
@@ -559,51 +509,6 @@ void Player::restartAtFrame(ULONG newFrame)
   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();
index 92d3efaf5679317ca43ee9146684744c6bd51ebe..59826bb468742def16a08de15639598209aad96e 100644 (file)
--- a/player.h
+++ b/player.h
@@ -66,8 +66,6 @@ class Player : public Thread_TYPE, public Callback
     bool isFbwd() { return fbwd; }
     ULONG getCurrentFrameNum();
     ULONG getLengthFrames();
-//    ULLONG getEndTS();
-//    hmsf getEndHMSF();
 
     void call(void*); // for callback interface
 
@@ -92,7 +90,6 @@ class Player : public Thread_TYPE, public Callback
 
     void setEndTS();
     void doConnectionLost();
-//    void restartAt(ULLONG timeCode);
     void restartAtFrame(ULONG newFrame);
 
     MessageQueue* commandMessageQueue;
index 55cca718a533f92442c18d74d95ec32a4561fff5..6dd80cdce7d69238be40c5736aa9380bb4ac0521 100644 (file)
@@ -69,7 +69,7 @@ VVideoRec::VVideoRec(Recording* rec)
   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();
@@ -395,18 +395,33 @@ void VVideoRec::drawBarClocks()
 
   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;
@@ -415,14 +430,14 @@ void VVideoRec::drawBarClocks()
   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()