Ticket #5910: 5910_PrepareToExitPlayer.diff
File 5910_PrepareToExitPlayer.diff, 7.7 KB (added by , 15 years ago) |
---|
-
mythtv/libs/libmythtv/tv_play.cpp
void TV::HandleOSDAskAllowResponse(PlayerContext *ctx, int dialog_result) 1479 1479 break; 1480 1480 case 2: 1481 1481 // return to main menu 1482 PrepareToExitPlayer(ctx, __LINE__); 1482 1483 SetExitPlayer(true, true); 1483 1484 break; 1484 1485 case 3: … … void TV::HandleOSDAskAllowResponse(PlayerContext *ctx, int dialog_result) 1496 1497 default: 1497 1498 case 1: 1498 1499 // return to main menu 1500 PrepareToExitPlayer(ctx, __LINE__); 1499 1501 SetExitPlayer(true, true); 1500 1502 break; 1501 1503 case 2: … … void TV::SetErrored(PlayerContext *ctx) 2893 2895 errorRecoveryTimerId = StartTimer(1, __LINE__); 2894 2896 } 2895 2897 2898 void TV::PrepareToExitPlayer(PlayerContext *ctx, int line, bool bookmark) const 2899 { 2900 bool bookmark_it = bookmark && IsBookmarkAllowed(ctx); 2901 ctx->LockDeleteNVP(__FILE__, line); 2902 if (ctx->nvp) 2903 { 2904 if (bookmark_it) 2905 ctx->nvp->SetBookmark(); 2906 if (db_auto_set_watched) 2907 ctx->nvp->SetWatched(); 2908 } 2909 ctx->UnlockDeleteNVP(__FILE__, line); 2910 } 2911 2896 2912 void TV::SetExitPlayer(bool set_it, bool wants_to) const 2897 2913 { 2898 2914 QMutexLocker locker(&timerIdLock); … … void TV::HandleEndOfPlaybackTimerEvent(void) 2954 2970 if (mctx == ctx) 2955 2971 { 2956 2972 endOfRecording = true; 2957 mctx->LockDeleteNVP(__FILE__, __LINE__); 2958 if (db_auto_set_watched && mctx->nvp) 2959 mctx->nvp->SetWatched(); 2960 mctx->UnlockDeleteNVP(__FILE__, __LINE__); 2973 PrepareToExitPlayer(mctx, __LINE__, false); 2961 2974 SetExitPlayer(true, true); 2962 2975 } 2963 2976 } … … void TV::HandleVideoExitDialogTimerEvent(void) 3051 3064 ReturnOSDLock(mctx, osd); 3052 3065 DoTogglePause(mctx, true); 3053 3066 ClearOSD(mctx); 3067 PrepareToExitPlayer(mctx, __LINE__); 3054 3068 ReturnPlayerLock(mctx); 3055 3069 3056 3070 requestDelete = false; … … bool TV::OSDDialogHandleAction(PlayerContext *actx, const QStringList &actions) 3667 3681 else if (has_action("ESCAPE", actions) && isnearend) 3668 3682 { 3669 3683 requestDelete = false; 3684 PrepareToExitPlayer(actx, __LINE__, false); 3670 3685 SetExitPlayer(true, true); 3671 3686 } 3672 3687 else if (has_action("SELECT", actions) || … … bool TV::OSDDialogHandleAction(PlayerContext *actx, const QStringList &actions) 3731 3746 DoTogglePause(actx, true); 3732 3747 break; 3733 3748 case 1: 3734 actx->LockDeleteNVP(__FILE__, __LINE__); 3735 if (actx->nvp) 3736 actx->nvp->SetBookmark(); 3737 actx->UnlockDeleteNVP(__FILE__, __LINE__); 3749 PrepareToExitPlayer(actx, __LINE__); 3738 3750 SetExitPlayer(true, true); 3739 3751 break; 3740 3752 case 3: … … bool TV::OSDDialogHandleAction(PlayerContext *actx, const QStringList &actions) 3743 3755 actx, tr("Delete this recording?")); 3744 3756 return handled; 3745 3757 default: 3758 PrepareToExitPlayer(actx, __LINE__, false); 3746 3759 SetExitPlayer(true, true); 3747 3760 break; 3748 3761 } … … bool TV::OSDDialogHandleAction(PlayerContext *actx, const QStringList &actions) 3761 3774 SetExitPlayer(true, true); 3762 3775 break; 3763 3776 case 3: 3777 PrepareToExitPlayer(actx, __LINE__); 3764 3778 SetExitPlayer(true, true); 3765 3779 break; 3766 3780 default: 3767 3781 if (isnearend) 3782 { 3783 PrepareToExitPlayer(actx, __LINE__, false); 3768 3784 SetExitPlayer(true, true); 3785 } 3769 3786 else 3770 3787 DoTogglePause(actx, true); 3771 3788 break; … … bool TV::ActiveHandleAction(PlayerContext *ctx, 4187 4204 } 4188 4205 else if (has_action("EXITSHOWNOPROMPTS", actions)) 4189 4206 { 4190 ctx->LockDeleteNVP(__FILE__, __LINE__);4191 if (ctx->nvp)4192 ctx->nvp->SetBookmark();4193 ctx->UnlockDeleteNVP(__FILE__, __LINE__);4194 4207 requestDelete = false; 4208 PrepareToExitPlayer(ctx, __LINE__); 4195 4209 SetExitPlayer(true, true); 4196 4210 } 4197 4211 else if (has_action("ESCAPE", actions)) … … bool TV::ActiveHandleAction(PlayerContext *ctx, 4239 4253 PromptStopWatchingRecording(ctx); 4240 4254 return handled; 4241 4255 } 4242 else if (ctx->HasNVP() && 4243 (db_playback_exit_prompt == 2)) 4244 { 4245 ctx->LockDeleteNVP(__FILE__, __LINE__); 4246 if (ctx->nvp) 4247 ctx->nvp->SetBookmark(); 4248 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 4249 } 4250 if (ctx->HasNVP() && db_auto_set_watched) 4251 { 4252 ctx->LockDeleteNVP(__FILE__, __LINE__); 4253 if (ctx->nvp) 4254 ctx->nvp->SetWatched(); 4255 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 4256 } 4256 PrepareToExitPlayer(ctx, __LINE__, db_playback_exit_prompt == 2); 4257 4257 requestDelete = false; 4258 4258 do_exit = true; 4259 4259 } … … void TV::customEvent(QEvent *e) 8605 8605 for (uint i = 0; mctx && (i < player.size()); i++) 8606 8606 { 8607 8607 PlayerContext *ctx = GetPlayer(mctx, i); 8608 ctx->LockDeleteNVP(__FILE__, __LINE__); 8609 if (ctx->nvp) 8610 { 8611 if (db_playback_exit_prompt == 1 || 8612 db_playback_exit_prompt == 2) 8613 { 8614 ctx->nvp->SetBookmark(); 8615 } 8616 if (db_auto_set_watched) 8617 ctx->nvp->SetWatched(); 8618 } 8619 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 8608 PrepareToExitPlayer(ctx, __LINE__, db_playback_exit_prompt == 1 || 8609 db_playback_exit_prompt == 2); 8620 8610 } 8621 8611 8622 8612 SetExitPlayer(true, true); … … bool TV::HandleJumpToProgramAction( 10729 10719 { 10730 10720 if (mctx == ctx) 10731 10721 { 10732 ctx->LockDeleteNVP(__FILE__, __LINE__); 10733 ctx->nvp->SetBookmark(); 10734 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 10722 PrepareToExitPlayer(ctx, __LINE__); 10735 10723 jumpToProgram = true; 10736 10724 SetExitPlayer(true, true); 10737 10725 } … … bool TV::HandleJumpToProgramAction( 10792 10780 .arg(p->title).arg(p->subtitle)); 10793 10781 10794 10782 SetLastProgram(p); 10795 ctx->LockDeleteNVP(__FILE__, __LINE__); 10796 ctx->nvp->SetBookmark(); 10797 ctx->UnlockDeleteNVP(__FILE__, __LINE__); 10783 PrepareToExitPlayer(ctx, __LINE__); 10798 10784 jumpToProgram = true; 10799 10785 SetExitPlayer(true, true); 10800 10786 } -
mythtv/libs/libmythtv/tv_play.h
class MPUBLIC TV : public QThread 338 338 void ForceNextStateNone(PlayerContext*); 339 339 void ScheduleStateChange(PlayerContext*); 340 340 void SetErrored(PlayerContext*); 341 void PrepareToExitPlayer(PlayerContext*, int line, 342 bool bookmark = true) const; 341 343 void SetExitPlayer(bool set_it, bool wants_to) const; 342 344 void SetUpdateOSDPosition(bool set_it); 343 345