Ticket #2518: nvp.time.diff
File nvp.time.diff, 2.4 KB (added by , 17 years ago) |
---|
-
mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
5372 5372 void NuppelVideoPlayer::calcSliderPos(struct StatusPosInfo &posInfo, 5373 5373 bool paddedFields) 5374 5374 { 5375 bool islive = false; 5375 5376 posInfo.desc = ""; 5376 5377 posInfo.position = 0; 5377 5378 posInfo.progBefore = false; … … 5397 5398 posInfo.progBefore = livetvchain->HasPrev(); 5398 5399 posInfo.progAfter = livetvchain->HasNext(); 5399 5400 playbackLen = livetvchain->GetLengthAtCurPos(); 5401 islive = true; 5400 5402 } 5401 5403 else if (watchingrecording && nvr_enc && nvr_enc->IsValidRecorder()) 5404 { 5402 5405 playbackLen = 5403 5406 (int)(((float)nvr_enc->GetFramesWritten() / video_frame_rate)); 5407 islive = true; 5408 } 5404 5409 5405 5410 float secsplayed; 5406 5411 if (ringBuffer->isDVD()) … … 5424 5429 int smins = (playbackLen - shours * 3600) / 60; 5425 5430 int ssecs = (playbackLen - shours * 3600 - smins * 60); 5426 5431 5427 QString text1, text2; 5432 int secsbehind = max((playbackLen - (int) secsplayed), 0); 5433 5434 int sbhours = secsbehind / 3600; 5435 int sbmins = (secsbehind - sbhours * 3600) / 60; 5436 int sbsecs = (secsbehind - sbhours * 3600 - sbmins * 60); 5437 5438 QString text1, text2, text3; 5428 5439 if (paddedFields) 5429 5440 { 5430 5441 text1.sprintf("%02d:%02d:%02d", phours, pmins, psecs); 5431 5442 text2.sprintf("%02d:%02d:%02d", shours, smins, ssecs); 5443 text3.sprintf("%02d:%02d:%02d", sbhours, sbmins, sbsecs); 5432 5444 } 5433 5445 else 5434 5446 { … … 5442 5454 text1.sprintf("%d:%02d", pmins, psecs); 5443 5455 text2.sprintf("%d:%02d", smins, ssecs); 5444 5456 } 5457 if (sbhours > 0) 5458 { 5459 text3.sprintf("%d:%02d:%02d", sbhours, sbmins, sbsecs); 5460 } 5461 else if (sbmins > 0) 5462 { 5463 text3.sprintf("%d:%02d", sbmins, sbsecs); 5464 } 5465 else 5466 { 5467 text3.sprintf("%d seconds", sbsecs); 5468 } 5445 5469 } 5446 5470 5447 posInfo.desc = QObject::tr("%1 of %2").arg(text1).arg(text2); 5471 if (islive) 5472 { 5473 posInfo.desc = QObject::tr("%1 of %2 (%3 behind)").arg(text1).arg(text2).arg(text3); 5474 } 5475 else 5476 { 5477 posInfo.desc = QObject::tr("%1 of %2 (%3 remaining)").arg(text1).arg(text2).arg(text3); 5478 } 5448 5479 } 5449 5480 5450 5481 void NuppelVideoPlayer::AutoCommercialSkip(void)