Ticket #3769: guide.diff
File guide.diff, 8.3 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/tv_play.h
427 427 bool exitPlayer; 428 428 bool paused; 429 429 bool errored; 430 bool switchToLive; 430 431 bool stretchAdjustment; ///< True if time stretch is turned on 431 432 bool audiosyncAdjustment; ///< True if audiosync is turned on 432 433 long long audiosyncBaseline; -
libs/libmythtv/guidegrid.cpp
61 61 else 62 62 gg->exec(); 63 63 64 if (chanid != gg->GetChanID()) 64 uint newchan = gg->GetChanID(); 65 if (chanid != newchan && newchan != 0) 65 66 { 66 67 chanid = gg->GetChanID(); 67 68 channum = gg->GetChanNum(); 68 channel_changed = true;69 //channel_changed = true; 69 70 } 71 channel_changed = newchan != 0; 70 72 71 73 if (thread) 72 74 qApp->lock(); -
libs/libmythtv/tv_play.cpp
10 10 #include <qtimer.h> 11 11 #include <qdir.h> 12 12 13 #include "cardutil.h" 13 14 #include "mythdbcon.h" 14 15 #include "tv_play.h" 15 16 #include "tv_rec.h" … … 109 110 { 110 111 if (!tv->Playback(curProgram)) 111 112 quitAll = true; 113 delete curProgram; 114 curProgram = NULL; 112 115 } 113 116 else if (!freeRecorders) 114 117 { … … 479 482 // State variables 480 483 internalState(kState_None), 481 484 menurunning(false), runMainLoop(false), wantsToQuit(true), 482 exitPlayer(false), paused(false), errored(false), 485 exitPlayer(false), paused(false), errored(false), switchToLive(false), 483 486 stretchAdjustment(false), 484 487 audiosyncAdjustment(false), audiosyncBaseline(LONG_LONG_MIN), 485 488 editmode(false), zoomMode(false), … … 1120 1123 lockTimerOn = false; 1121 1124 1122 1125 SET_NEXT(); 1123 recorder->SpawnLiveTV(tvchain->GetID(), false, ""); 1126 if (switchToLive) { 1127 switchToLive = false; 1128 recorder->SpawnLiveTV(tvchain->GetID(), false, playbackinfo->chanstr); 1129 } 1130 else 1131 recorder->SpawnLiveTV(tvchain->GetID(), false, ""); 1124 1132 1125 1133 tvchain->ReloadAll(); 1126 1134 … … 1633 1641 sleep_index = 0; 1634 1642 normal_speed = 1.0f; 1635 1643 1636 pbinfoLock.lock(); 1637 if (playbackinfo) 1638 delete playbackinfo; 1639 playbackinfo = NULL; 1640 pbinfoLock.unlock(); 1644 if (!switchToLive) 1645 { 1646 pbinfoLock.lock(); 1647 if (playbackinfo) 1648 delete playbackinfo; 1649 playbackinfo = NULL; 1650 pbinfoLock.unlock(); 1651 } 1641 1652 1642 1653 DeleteRecorder(); 1643 1654 … … 2815 2826 else if (action == "JUMPREC") 2816 2827 { 2817 2828 if (gContext->GetNumSetting("JumpToProgramOSD", 1) 2818 && StateIsPlaying(internalState))2829 && (StateIsPlaying(internalState) || StateIsLiveTV(internalState)) ) 2819 2830 { 2820 2831 DisplayJumpMenuSoon(); 2821 2832 } … … 5102 5113 pbinfoLock.unlock(); 5103 5114 5104 5115 bool changeChannel = false; 5116 bool allowsecondary = true; 5105 5117 ProgramInfo *nextProgram = NULL; 5106 5118 5107 5119 if (StateIsLiveTV(GetState())) … … 5112 5124 case kScheduleProgramGuide: 5113 5125 { 5114 5126 // See if we can provide a channel preview in EPG 5115 bool allowsecondary = true;5116 5127 if (nvp && nvp->getVideoOutput()) 5117 5128 allowsecondary = nvp->getVideoOutput()->AllowPreviewEPG(); 5118 5129 … … 5152 5163 else 5153 5164 { 5154 5165 bool stayPaused = paused; 5155 if (!paused )5166 if (!paused && editType != kScheduleProgramGuide) 5156 5167 DoPause(false); 5157 5168 5158 5169 switch (editType) 5159 5170 { 5160 5171 default: 5161 5172 case kScheduleProgramGuide: 5162 RunProgramGuide(chanid, channum, true); 5173 // See if we can provide a channel preview in EPG 5174 if (nvp && nvp->getVideoOutput()) 5175 allowsecondary = nvp->getVideoOutput()->AllowPreviewEPG(); 5176 5177 // Start up EPG 5178 changeChannel = RunProgramGuide(chanid, channum, true, this, allowsecondary); 5163 5179 break; 5164 5180 case kScheduleProgramFinder: 5165 5181 RunProgramFind(true, false); … … 5192 5208 if (theme) 5193 5209 delete theme; 5194 5210 nextProgram = RunPlaybackBoxPtr((void *)this); 5195 if (IsEmbedding())5196 StopEmbeddingOutput();5197 5211 if (nextProgram) 5198 5212 { 5199 5213 setLastProgram(nextProgram); … … 5204 5218 break; 5205 5219 } 5206 5220 } 5221 if (IsEmbedding()) 5222 StopEmbeddingOutput(); 5207 5223 5208 if (!stayPaused )5224 if (!stayPaused && editType != kScheduleProgramGuide) 5209 5225 DoPause(false); 5210 5226 } 5211 5227 … … 5218 5234 } 5219 5235 5220 5236 // If user selected a new channel in the EPG, change to that channel 5221 if (changeChannel) 5237 if (changeChannel) { 5238 if (StateIsPlaying(GetState())) { 5239 switchToLive = true; 5240 ChangeState(kState_None); 5241 ProgramInfo *pginfo = ProgramInfo::GetProgramAtDateTime(QString::number(chanid), QDateTime::currentDateTime()); 5242 SetCurrentlyPlaying(pginfo); 5243 delete pginfo; 5244 } 5222 5245 EPGChannelUpdate(chanid, channum); 5246 } 5223 5247 5224 5248 if (nvp && jumpToProgram) 5225 5249 nvp->DiscardVideoFrames(true); … … 6593 6617 else if (action == "JUMPREC") 6594 6618 { 6595 6619 if (gContext->GetNumSetting("JumpToProgramOSD", 1) 6596 && StateIsPlaying(internalState))6620 && (StateIsPlaying(internalState) || StateIsLiveTV(internalState)) ) 6597 6621 { 6598 6622 DisplayJumpMenuSoon(); 6599 6623 } … … 6612 6636 BrowseStart(); 6613 6637 else if (action == "PREVCHAN") 6614 6638 PreviousChannel(); 6639 else if (action.left(8) == "JUMPPROG") 6640 { 6641 SetJumpToProgram(action.section(" ",1,-2), 6642 action.section(" ",-1,-1).toInt()); 6643 nvp->SetBookmark(); 6644 exitPlayer = true; 6645 jumpToProgram = true; 6646 } 6615 6647 else 6616 6648 { 6617 6649 VERBOSE(VB_IMPORTANT, LOC_ERR + … … 6706 6738 freeRecorders = RemoteGetFreeRecorderCount(); 6707 6739 6708 6740 item = new OSDGenericTree(treeMenu, tr("Program Guide"), "GUIDE"); 6709 if (!gContext->GetNumSetting("JumpToProgramOSD", 1)) 6710 { 6711 item = new OSDGenericTree(treeMenu, tr("Jump to Program")); 6712 subitem = new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC"); 6713 if (lastProgram != NULL) 6741 item = new OSDGenericTree(treeMenu, tr("Jump to Program")); 6742 subitem = new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC"); 6743 if (lastProgram != NULL) 6714 6744 subitem = new OSDGenericTree(item, lastProgram->title, "JUMPPREV"); 6715 }6716 6745 if (freeRecorders) 6717 6746 { 6718 6747 item = new OSDGenericTree(treeMenu, tr("Picture-in-Picture")); … … 6741 6770 { 6742 6771 item = new OSDGenericTree(treeMenu, tr("Edit Recording"), "TOGGLEEDIT"); 6743 6772 6773 item = new OSDGenericTree(treeMenu, tr("Program Guide"), "GUIDE"); 6744 6774 item = new OSDGenericTree(treeMenu, tr("Jump to Program")); 6745 6775 6746 6776 subitem = new OSDGenericTree(item, tr("Recorded Program"), "JUMPREC"); … … 7754 7784 //bool LiveTVInAllPrograms = gContext->GetNumSetting("LiveTVInAllPrograms",0); 7755 7785 if (infoList) 7756 7786 { 7787 QString recGroup; 7788 if (StateIsLiveTV(GetState())) 7789 recGroup = gContext->GetSetting("DisplayRecGroup","All Programs"); 7790 else 7791 recGroup = playbackinfo->recgroup; 7757 7792 pbinfoLock.lock(); 7758 7793 vector<ProgramInfo *>::iterator i = infoList->begin(); 7759 7794 for ( ; i != infoList->end(); i++) 7760 7795 { 7761 7796 p = *i; 7762 7797 //if (p->recgroup != "LiveTV" || LiveTVInAllPrograms) 7763 if (p->recgroup == playbackinfo->recgroup) 7798 if (p->recgroup == recGroup) 7799 7764 7800 progLists[p->title].prepend(p); 7765 7801 } 7766 7802 pbinfoLock.unlock();