Ticket #8631: seek_honors_cutlist_v2.patch
File seek_honors_cutlist_v2.patch, 22.3 KB (added by , 13 years ago) |
---|
-
libs/libmythtv/deletemap.h
45 45 bool IsTemporaryMark(uint64_t frame); 46 46 bool HasTemporaryMark(void); 47 47 uint64_t GetLastFrame(uint64_t total); 48 uint64_t TranslatePositionAbsToRel(uint64_t absPosition) { 49 return TranslatePositionAbsToRel(m_deleteMap, absPosition); 50 } 51 uint64_t TranslatePositionRelToAbs(uint64_t relPosition) { 52 return TranslatePositionRelToAbs(m_deleteMap, relPosition); 53 } 54 static uint64_t TranslatePositionAbsToRel(const frm_dir_map_t &deleteMap, 55 uint64_t absPosition); 56 static uint64_t TranslatePositionRelToAbs(const frm_dir_map_t &deleteMap, 57 uint64_t relPosition); 48 58 49 59 void TrackerReset(uint64_t frame, uint64_t total); 50 60 bool TrackerWantsToJump(uint64_t frame, uint64_t total, uint64_t &to); -
libs/libmythtv/tv_play.h
419 419 420 420 bool SeekHandleAction(PlayerContext *actx, const QStringList &actions, 421 421 const bool isDVD); 422 void DoSeek(PlayerContext*, float time, const QString &mesg); 422 void DoSeek(PlayerContext*, float time, const QString &mesg, 423 bool timeIsOffset, bool honorCutlist=true); 423 424 bool DoPlayerSeek(PlayerContext*, float time); 424 425 enum ArbSeekWhence { 425 426 ARBSEEK_SET = 0, … … 427 428 ARBSEEK_FORWARD, 428 429 ARBSEEK_END 429 430 }; 430 void DoArbSeek(PlayerContext*, ArbSeekWhence whence );431 void DoArbSeek(PlayerContext*, ArbSeekWhence whence, bool honorCutlist=true); 431 432 void NormalSpeed(PlayerContext*); 432 433 void ChangeSpeed(PlayerContext*, int direction); 433 434 void ToggleTimeStretch(PlayerContext*); -
libs/libmythtv/mythplayer.h
232 232 virtual long long CalcMaxFFTime(long long ff, bool setjump = true) const; 233 233 long long CalcRWTime(long long rw) const; 234 234 virtual void calcSliderPos(osdInfo &info, bool paddedFields = false); 235 uint64_t TranslatePositionAbsToRel(uint64_t absPosition) { 236 return deleteMap.TranslatePositionAbsToRel(absPosition); 237 } 238 uint64_t TranslatePositionRelToAbs(uint64_t relPosition) { 239 return deleteMap.TranslatePositionRelToAbs(relPosition); 240 } 235 241 236 242 /// Non-const gets 237 243 OSD *GetOSD(void) { return osd; } … … 497 503 void JumpToProgram(void); 498 504 499 505 void calcSliderPosPriv(osdInfo &info, bool paddedFields, 500 int playbackLen, float secsplayed, bool islive); 506 int playbackLen, float secsplayed, bool islive, 507 bool isRaw); 501 508 502 509 protected: 503 510 DecoderBase *decoder; -
libs/libmythtv/mythdvdplayer.cpp
338 338 // DVD playing non-functional under windows for now 339 339 secsplayed = 0.0f; 340 340 #endif 341 calcSliderPosPriv(info, paddedFields, playbackLen, secsplayed, islive); 341 calcSliderPosPriv(info, paddedFields, playbackLen, secsplayed, islive, false); 342 calcSliderPosPriv(info, paddedFields, playbackLen, secsplayed, islive, true); 342 343 } 343 344 344 345 void MythDVDPlayer::SeekForScreenGrab(uint64_t &number, uint64_t frameNum, -
libs/libmythtv/tv_play.cpp
548 548 "Pause"), "P"); 549 549 REG_KEY("TV Playback", "SEEKFFWD", QT_TRANSLATE_NOOP("MythControls", 550 550 "Fast Forward"), "Right"); 551 REG_KEY("TV Playback", "SEEKFFWDNOCUTLIST", QT_TRANSLATE_NOOP("MythControls", 552 "Fast Forward ignoring cutlist"), ""); 551 553 REG_KEY("TV Playback", "SEEKRWND", QT_TRANSLATE_NOOP("MythControls", 552 554 "Rewind"), "Left"); 555 REG_KEY("TV Playback", "SEEKRWNDNOCUTLIST", QT_TRANSLATE_NOOP("MythControls", 556 "Rewind ignoring cutlist"), ""); 553 557 REG_KEY("TV Playback", "ARBSEEK", QT_TRANSLATE_NOOP("MythControls", 554 558 "Arbitrary Seek"), "*"); 559 REG_KEY("TV Playback", "ARBSEEKNOCUTLIST", QT_TRANSLATE_NOOP("MythControls", 560 "Arbitrary Seek ignoring cutlist"), ""); 555 561 REG_KEY("TV Playback", "CHANNELUP", QT_TRANSLATE_NOOP("MythControls", 556 562 "Channel up"), "Up"); 557 563 REG_KEY("TV Playback", "CHANNELDOWN", QT_TRANSLATE_NOOP("MythControls", … … 562 568 "Switch to the previous channel"), "H"); 563 569 REG_KEY("TV Playback", "JUMPFFWD", QT_TRANSLATE_NOOP("MythControls", 564 570 "Jump ahead"), "PgDown"); 571 REG_KEY("TV Playback", "JUMPFFWDNOCUTLIST", QT_TRANSLATE_NOOP("MythControls", 572 "Jump ahead ignoring cutlist"), ""); 565 573 REG_KEY("TV Playback", "JUMPRWND", QT_TRANSLATE_NOOP("MythControls", 566 574 "Jump back"), "PgUp"); 575 REG_KEY("TV Playback", "JUMPRWNDNOCUTLIST", QT_TRANSLATE_NOOP("MythControls", 576 "Jump back ignoring cutlist"), ""); 577 REG_KEY("TV Playback", "INFONOCUTLIST", QT_TRANSLATE_NOOP("MythControls", 578 "Info ignoring cutlist"), ""); 567 579 REG_KEY("TV Playback", "JUMPBKMRK", QT_TRANSLATE_NOOP("MythControls", 568 580 "Jump to bookmark"), "K"); 569 581 REG_KEY("TV Playback", "FFWDSTICKY", QT_TRANSLATE_NOOP("MythControls", … … 3986 3998 ctx->buffer->DVD()->MoveButtonDown(); 3987 3999 } 3988 4000 else if (has_action("LEFT", actions) || 3989 has_action("SEEKRWND", actions)) 4001 has_action("SEEKRWND", actions) || 4002 has_action("SEEKRWNDNOCUTLIST", actions)) 3990 4003 { 3991 4004 ctx->buffer->DVD()->MoveButtonLeft(); 3992 4005 } 3993 4006 else if (has_action("RIGHT", actions) || 3994 has_action("SEEKFFWD", actions)) 4007 has_action("SEEKFFWD", actions) || 4008 has_action("SEEKFFWDNOCUTLIST", actions)) 3995 4009 { 3996 4010 ctx->buffer->DVD()->MoveButtonRight(); 3997 4011 } … … 4092 4106 } 4093 4107 } 4094 4108 } 4095 else if (has_action("JUMPRWND", actions)) 4109 else if (has_action("JUMPRWND", actions) || 4110 has_action("JUMPRWNDNOCUTLIST", actions)) 4096 4111 { 4097 4112 if (isDVD) 4098 4113 DVDJumpBack(ctx); 4099 4114 else if (GetNumChapters(ctx) > 0) 4100 4115 DoJumpChapter(ctx, -1); 4101 4116 else 4102 DoSeek(ctx, -ctx->jumptime * 60, tr("Jump Back")); 4117 DoSeek(ctx, -ctx->jumptime * 60, tr("Jump Back"), 4118 true, has_action("JUMPRWND", actions)); 4103 4119 } 4104 else if (has_action("JUMPFFWD", actions)) 4120 else if (has_action("JUMPFFWD", actions) || 4121 has_action("JUMPFFWDNOCUTLIST", actions)) 4105 4122 { 4106 4123 if (isDVD) 4107 4124 DVDJumpForward(ctx); 4108 4125 else if (GetNumChapters(ctx) > 0) 4109 4126 DoJumpChapter(ctx, 9999); 4110 4127 else 4111 DoSeek(ctx, ctx->jumptime * 60, tr("Jump Ahead")); 4128 DoSeek(ctx, ctx->jumptime * 60, tr("Jump Ahead"), 4129 true, has_action("JUMPFFWD", actions)); 4112 4130 } 4113 4131 else if (has_action("JUMPBKMRK", actions)) 4114 4132 { 4115 4133 ctx->LockDeletePlayer(__FILE__, __LINE__); 4116 long long bookmark = ctx->player->GetBookmark(); 4117 long long curloc = ctx->player->GetFramesPlayed(); 4134 uint64_t bookmark = ctx->player->GetBookmark(); 4118 4135 float mult = 1.0f; 4119 4136 if (ctx->last_framerate) 4120 4137 mult = 1.0f / ctx->last_framerate; 4121 long long seekloc = (long long) ((bookmark - curloc) * mult);4138 float seekloc = ctx->player->TranslatePositionAbsToRel(bookmark) * mult; 4122 4139 ctx->UnlockDeletePlayer(__FILE__, __LINE__); 4123 4140 4124 4141 if (bookmark > ctx->last_framerate) 4125 4142 { 4126 DoSeek(ctx, seekloc, tr("Jump to Bookmark") );4143 DoSeek(ctx, seekloc, tr("Jump to Bookmark"), false); 4127 4144 } 4128 4145 } 4129 4146 else if (has_action("JUMPSTART",actions)) 4130 4147 { 4131 long long seekloc = +1; 4132 ctx->LockDeletePlayer(__FILE__, __LINE__); 4133 if (ctx->player && ctx->last_framerate >= 0.0001f) 4134 { 4135 seekloc = (int64_t) (-1.0 * ctx->player->GetFramesPlayed() / 4136 ctx->last_framerate); 4137 } 4138 ctx->UnlockDeletePlayer(__FILE__, __LINE__); 4139 4140 if (seekloc <= 0) 4141 DoSeek(ctx, seekloc, tr("Jump to Beginning")); 4148 DoSeek(ctx, 0, tr("Jump to Beginning"), false); 4142 4149 } 4143 4150 else if (has_action("CLEAROSD", actions)) 4144 4151 { … … 4285 4292 ChangeTimeStretch(ctx, -1); 4286 4293 else if (has_action("MENU", actions)) 4287 4294 ShowOSDMenu(ctx); 4288 else if (has_action("INFO", actions) )4295 else if (has_action("INFO", actions) || has_action("INFONOCUTLIST", actions)) 4289 4296 { 4290 4297 if (HasQueuedInput()) 4291 4298 { 4292 DoArbSeek(ctx, ARBSEEK_SET );4299 DoArbSeek(ctx, ARBSEEK_SET, !has_action("INFONOCUTLIST", actions)); 4293 4300 } 4294 4301 else 4295 4302 ToggleOSD(ctx, true); … … 4486 4493 else if (GetNumChapters(ctx) > 0) 4487 4494 DoJumpChapter(ctx, -1); 4488 4495 else 4489 DoSeek(ctx, -ctx->jumptime * 60, tr("Jump Back") );4496 DoSeek(ctx, -ctx->jumptime * 60, tr("Jump Back"), true); 4490 4497 } 4491 4498 else if (has_action("CHANNELDOWN", actions)) 4492 4499 { … … 4502 4509 else if (GetNumChapters(ctx) > 0) 4503 4510 DoJumpChapter(ctx, 9999); 4504 4511 else 4505 DoSeek(ctx, ctx->jumptime * 60, tr("Jump Ahead") );4512 DoSeek(ctx, ctx->jumptime * 60, tr("Jump Ahead"), true); 4506 4513 } 4507 4514 else if (has_action("DELETE", actions) && !islivetv) 4508 4515 { … … 4727 4734 ctx->UnlockDeletePlayer(__FILE__, __LINE__); 4728 4735 4729 4736 if (tokens[2] == "BEGINNING") 4730 DoSeek(ctx, -fplay, tr("Jump to Beginning")); 4731 else if (tokens[2] == "FORWARD") 4732 DoSeek(ctx, ctx->fftime, tr("Skip Ahead")); 4733 else if (tokens[2] == "BACKWARD") 4734 DoSeek(ctx, -ctx->rewtime, tr("Skip Back")); 4735 else if ((tokens[2] == "POSITION") && (tokens.size() == 4) && 4737 DoSeek(ctx, 0, tr("Jump to Beginning"), false); 4738 else if (tokens[2] == "FORWARD" || tokens[2] == "FORWARDNOCUTLIST") 4739 DoSeek(ctx, ctx->fftime, tr("Skip Ahead"), true, tokens[2] == "FORWARD"); 4740 else if (tokens[2] == "BACKWARD" || tokens[2] == "BACKWARDNOCUTLIST") 4741 DoSeek(ctx, -ctx->rewtime, tr("Skip Back"), true, tokens[2] == "BACKWARD"); 4742 else if ((tokens[2] == "POSITION" || 4743 tokens[2] == "POSITIONNOCUTLIST") && 4744 (tokens.size() == 4) && 4736 4745 (tokens[3].contains(QRegExp("^\\d+$"))) && 4737 4746 ctx->last_framerate) 4738 4747 { 4739 4748 long long rel_frame = tokens[3].toInt(); 4740 rel_frame -= (long long) (fplay * (1.0 / ctx->last_framerate)),4741 DoSeek(ctx, rel_frame, tr("Jump To"));4749 DoSeek(ctx, rel_frame / ctx->last_framerate, tr("Jump To"), 4750 false, tokens[2] == "POSITION"); 4742 4751 } 4743 4752 } 4744 4753 else if (tokens.size() >= 3 && tokens[1] == "VOLUME") … … 5778 5787 const bool isDVD) 5779 5788 { 5780 5789 const int kRewind = 4, kForward = 8, kSticky = 16, kSlippery = 32, 5781 kRelative = 64, kAbsolute = 128, kWhenceMask = 3; 5790 kRelative = 64, kAbsolute = 128, kIgnoreCutlist = 256, 5791 kWhenceMask = 3; 5782 5792 int flags = 0; 5783 5793 if (has_action("SEEKFFWD", actions)) 5784 5794 flags = ARBSEEK_FORWARD | kForward | kSlippery | kRelative; 5795 else if (has_action("SEEKFFWDNOCUTLIST", actions)) 5796 flags = ARBSEEK_FORWARD | kForward | kSlippery | kRelative | kIgnoreCutlist; 5785 5797 else if (has_action("FFWDSTICKY", actions)) 5786 5798 flags = ARBSEEK_END | kForward | kSticky | kAbsolute; 5787 5799 else if (has_action("RIGHT", actions)) 5788 5800 flags = ARBSEEK_FORWARD | kForward | kSticky | kRelative; 5789 5801 else if (has_action("SEEKRWND", actions)) 5790 5802 flags = ARBSEEK_REWIND | kRewind | kSlippery | kRelative; 5803 else if (has_action("SEEKRWNDNOCUTLIST", actions)) 5804 flags = ARBSEEK_REWIND | kRewind | kSlippery | kRelative | kIgnoreCutlist; 5791 5805 else if (has_action("RWNDSTICKY", actions)) 5792 5806 flags = ARBSEEK_SET | kRewind | kSticky | kAbsolute; 5793 5807 else if (has_action("LEFT", actions)) … … 5798 5812 int direction = (flags & kRewind) ? -1 : 1; 5799 5813 if (HasQueuedInput()) 5800 5814 { 5801 DoArbSeek(actx, static_cast<ArbSeekWhence>(flags & kWhenceMask)); 5815 DoArbSeek(actx, static_cast<ArbSeekWhence>(flags & kWhenceMask), 5816 !(flags & kIgnoreCutlist)); 5802 5817 } 5803 5818 else if (actx->paused) 5804 5819 { … … 5808 5823 direction * (1.001 / actx->last_framerate); 5809 5824 QString message = (flags & kRewind) ? QString(tr("Rewind")) : 5810 5825 QString(tr("Forward")); 5811 DoSeek(actx, time, message );5826 DoSeek(actx, time, message, true, !(flags & kIgnoreCutlist)); 5812 5827 } 5813 5828 } 5814 5829 else if (flags & kSticky) … … 5819 5834 { 5820 5835 if (smartForward) 5821 5836 doSmartForward = true; 5822 DoSeek(actx, -actx->rewtime, tr("Skip Back")); 5837 DoSeek(actx, -actx->rewtime, tr("Skip Back"), 5838 true, !(flags & kIgnoreCutlist)); 5823 5839 } 5824 5840 else 5825 5841 { 5826 5842 if (smartForward & doSmartForward) 5827 DoSeek(actx, actx->rewtime, tr("Skip Ahead")); 5843 DoSeek(actx, actx->rewtime, tr("Skip Ahead"), 5844 true, !(flags & kIgnoreCutlist)); 5828 5845 else 5829 DoSeek(actx, actx->fftime, tr("Skip Ahead")); 5846 DoSeek(actx, actx->fftime, tr("Skip Ahead"), 5847 true, !(flags & kIgnoreCutlist)); 5830 5848 } 5831 5849 return true; 5832 5850 } 5833 5851 5834 void TV::DoSeek(PlayerContext *ctx, float time, const QString &mesg) 5852 void TV::DoSeek(PlayerContext *ctx, float time, const QString &mesg, 5853 bool timeIsOffset, bool honorCutlist) 5835 5854 { 5836 5855 bool limitkeys = false; 5837 5856 … … 5845 5864 keyRepeatTimer.start(); 5846 5865 NormalSpeed(ctx); 5847 5866 time += StopFFRew(ctx); 5867 float framerate = ctx->last_framerate; 5868 uint64_t currentFrameAbs = ctx->player->GetFramesPlayed(); 5869 uint64_t currentFrameRel = honorCutlist ? 5870 ctx->player->TranslatePositionAbsToRel(currentFrameAbs) : 5871 currentFrameAbs; 5872 int64_t desiredFrameRel = (timeIsOffset ? currentFrameRel : 0) + 5873 time * framerate + 0.5; 5874 if (desiredFrameRel < 0) 5875 desiredFrameRel = 0; 5876 uint64_t desiredFrameAbs = honorCutlist ? 5877 ctx->player->TranslatePositionRelToAbs(desiredFrameRel) : 5878 desiredFrameRel; 5879 time = ((int64_t)desiredFrameAbs - (int64_t)currentFrameAbs) / framerate; 5848 5880 DoPlayerSeek(ctx, time); 5849 5881 UpdateOSDSeekMessage(ctx, mesg, kOSDTimeout_Med); 5850 5882 } 5851 5883 } 5852 5884 5853 void TV::DoArbSeek(PlayerContext *ctx, ArbSeekWhence whence )5885 void TV::DoArbSeek(PlayerContext *ctx, ArbSeekWhence whence, bool honorCutlist) 5854 5886 { 5855 5887 bool ok = false; 5856 5888 int seek = GetQueuedInputAsInt(&ok); … … 5861 5893 float time = ((seek / 100) * 3600) + ((seek % 100) * 60); 5862 5894 5863 5895 if (whence == ARBSEEK_FORWARD) 5864 DoSeek(ctx, time, tr("Jump Ahead") );5896 DoSeek(ctx, time, tr("Jump Ahead"), true, honorCutlist); 5865 5897 else if (whence == ARBSEEK_REWIND) 5866 DoSeek(ctx, -time, tr("Jump Back") );5898 DoSeek(ctx, -time, tr("Jump Back"), true, honorCutlist); 5867 5899 else 5868 5900 { 5869 5901 ctx->LockDeletePlayer(__FILE__, __LINE__); … … 5875 5907 if (whence == ARBSEEK_END) 5876 5908 time = (ctx->player->CalcMaxFFTime(LONG_MAX, false) / 5877 5909 ctx->last_framerate) - time; 5878 else5879 time = time - (ctx->player->GetFramesPlayed() - 1) /5880 ctx->last_framerate;5881 5910 ctx->UnlockDeletePlayer(__FILE__, __LINE__); 5882 DoSeek(ctx, time, tr("Jump To") );5911 DoSeek(ctx, time, tr("Jump To"), (whence != ARBSEEK_SET), honorCutlist); 5883 5912 } 5884 5913 } 5885 5914 … … 6815 6844 { 6816 6845 commited = true; 6817 6846 if (HasQueuedInput()) 6847 // XXX Should the cutlist be honored? 6818 6848 DoArbSeek(ctx, ARBSEEK_FORWARD); 6819 6849 } 6820 6850 else if (StateIsLiveTV(GetState(ctx))) … … 11406 11436 uint chapterLength = ctx->buffer->DVD()->GetChapterLength(); 11407 11437 if ((titleLength == chapterLength) && chapterLength > 300) 11408 11438 { 11409 DoSeek(ctx, -ctx->jumptime * 60, tr("Jump Back") );11439 DoSeek(ctx, -ctx->jumptime * 60, tr("Jump Back"), true); 11410 11440 } 11411 11441 else 11412 11442 { … … 11451 11481 (currentTime < (chapterLength - (ctx->jumptime * 60))) && 11452 11482 chapterLength > 300) 11453 11483 { 11454 DoSeek(ctx, ctx->jumptime * 60, tr("Jump Ahead") );11484 DoSeek(ctx, ctx->jumptime * 60, tr("Jump Ahead"), true); 11455 11485 } 11456 11486 else 11457 11487 { -
libs/libmythtv/deletemap.cpp
695 695 result = it.key(); 696 696 return result; 697 697 } 698 699 uint64_t DeleteMap::TranslatePositionAbsToRel(const frm_dir_map_t &deleteMap, 700 uint64_t absPosition) 701 { 702 uint64_t subtraction = 0; 703 uint64_t startOfCutRegion = 0; 704 frm_dir_map_t::const_iterator i; 705 bool withinCut = false; 706 bool first = true; 707 for (i = deleteMap.constBegin(); 708 i != deleteMap.constEnd() && i.key() <= absPosition; 709 i++) 710 { 711 if (first) 712 withinCut = (i.value() == MARK_CUT_END); 713 first = false; 714 if (i.value() == MARK_CUT_START && !withinCut) 715 { 716 withinCut = true; 717 startOfCutRegion = i.key(); 718 } 719 else if (i.value() == MARK_CUT_END && withinCut) 720 { 721 withinCut = false; 722 subtraction += (i.key() - startOfCutRegion); 723 } 724 } 725 if (withinCut) 726 subtraction += (absPosition - startOfCutRegion); 727 return absPosition - subtraction; 728 } 729 730 uint64_t DeleteMap::TranslatePositionRelToAbs(const frm_dir_map_t &deleteMap, 731 uint64_t relPosition) 732 { 733 uint64_t addition = 0; 734 uint64_t startOfCutRegion = 0; 735 frm_dir_map_t::const_iterator i; 736 bool withinCut = false; 737 bool first = true; 738 for (i = deleteMap.constBegin(); i != deleteMap.constEnd(); i++) 739 { 740 if (first) 741 withinCut = (i.value() == MARK_CUT_END); 742 first = false; 743 if (i.value() == MARK_CUT_START && !withinCut) 744 { 745 withinCut = true; 746 startOfCutRegion = i.key(); 747 if (relPosition + addition <= startOfCutRegion) 748 break; 749 } 750 else if (i.value() == MARK_CUT_END && withinCut) 751 { 752 withinCut = false; 753 addition += (i.key() - startOfCutRegion); 754 } 755 } 756 return relPosition + addition; 757 } -
libs/libmythtv/mythplayer.cpp
4142 4142 info.values.insert("progbefore", 0); 4143 4143 info.values.insert("progafter", 0); 4144 4144 4145 int playbackLen = totalLength; 4145 int rawPlaybackLen = totalLength; 4146 int playbackLen = deleteMap.TranslatePositionAbsToRel(totalLength * video_frame_rate) / video_frame_rate; 4146 4147 4147 4148 if (livetv && player_ctx->tvchain) 4148 4149 { … … 4160 4161 islive = true; 4161 4162 } 4162 4163 4163 float secsplayed = ((float)framesPlayed / video_frame_rate); 4164 calcSliderPosPriv(info, paddedFields, playbackLen, secsplayed, islive); 4164 float secsplayed = ((float)deleteMap.TranslatePositionAbsToRel(framesPlayed) / video_frame_rate); 4165 calcSliderPosPriv(info, paddedFields, playbackLen, secsplayed, islive, false); 4166 float rawSecsplayed = ((float)framesPlayed / video_frame_rate); 4167 calcSliderPosPriv(info, paddedFields, rawPlaybackLen, rawSecsplayed, islive, true); 4165 4168 } 4166 4169 4167 4170 void MythPlayer::calcSliderPosPriv(osdInfo &info, bool paddedFields, 4168 4171 int playbackLen, float secsplayed, 4169 bool islive )4172 bool islive, bool isRaw) 4170 4173 { 4174 QString rawPrefix = isRaw ? "raw" : ""; 4171 4175 playbackLen = max(playbackLen, 1); 4172 4176 secsplayed = min((float)playbackLen, max(secsplayed, 0.0f)); 4173 4177 4174 info.values["position"] = (int)(1000.0f * (secsplayed / (float)playbackLen)); 4178 info.values[rawPrefix + "position"] = 4179 (int)(1000.0f * (secsplayed / (float)playbackLen)); 4175 4180 4176 4181 int phours = (int)secsplayed / 3600; 4177 4182 int pmins = ((int)secsplayed - phours * 3600) / 60; … … 4220 4225 } 4221 4226 } 4222 4227 4223 info.text[ "description"] = QObject::tr("%1 of %2").arg(text1).arg(text2);4224 info.text[ "playedtime"] = text1;4225 info.text[ "totaltime"] = text2;4226 info.text[ "remainingtime"] = islive ? QString() : text3;4227 info.text[ "behindtime"] = islive ? text3 : QString();4228 info.text[rawPrefix + "description"] = QObject::tr("%1 of %2").arg(text1).arg(text2); 4229 info.text[rawPrefix + "playedtime"] = text1; 4230 info.text[rawPrefix + "totaltime"] = text2; 4231 info.text[rawPrefix + "remainingtime"] = islive ? QString() : text3; 4232 info.text[rawPrefix + "behindtime"] = islive ? text3 : QString(); 4228 4233 } 4229 4234 4230 4235 int MythPlayer::GetNumChapters() -
libs/libmythtv/osd.cpp
313 313 found = true; 314 314 } 315 315 } 316 if (map.contains("rawposition")) 317 { 318 MythUIProgressBar *bar = dynamic_cast<MythUIProgressBar *> (win->GetChild("rawposition")); 319 if (bar) 320 { 321 bar->SetVisible(true); 322 bar->SetStart(0); 323 bar->SetTotal(1000); 324 bar->SetUsed(map.value("rawposition")); 325 found = true; 326 } 327 } 316 328 317 329 if (found) 318 330 SetExpiry(window, timeout);