Ticket #4376: tv_play.patch
File tv_play.patch, 5.7 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
4078 4078 res = activenvp->Rewind(-time); 4079 4079 4080 4080 if (muted) 4081 muteTimer->start(kMuteTimeout, true);4081 SetMuteTimer(kMuteTimeout); 4082 4082 4083 4083 return res; 4084 4084 } … … 4332 4332 activenvp->SkipCommercials(direction); 4333 4333 4334 4334 if (muted) 4335 muteTimer->start(kMuteTimeout, true);4335 SetMuteTimer(kMuteTimeout); 4336 4336 } 4337 4337 4338 4338 void TV::SwitchSource(uint source_direction) … … 4640 4640 ClearInputQueues(false); 4641 4641 4642 4642 if (muted) 4643 muteTimer->start(kMuteTimeout * 2, true);4643 SetMuteTimer(kMuteTimeout * 2); 4644 4644 4645 4645 UnpauseLiveTV(); 4646 4646 } … … 4972 4972 activerecorder->SetChannel(channum); 4973 4973 4974 4974 if (muted) 4975 muteTimer->start(kMuteTimeout * 2, true);4975 SetMuteTimer(kMuteTimeout * 2); 4976 4976 4977 4977 UnpauseLiveTV(); 4978 4978 } … … 5685 5685 5686 5686 // Start up EPG 5687 5687 changeChannel = GuideGrid::Run( 5688 chanid, channum, true, this, allowsecondary);5688 chanid, channum, false, this, allowsecondary); 5689 5689 5690 5690 break; 5691 5691 } … … 5728 5728 { 5729 5729 default: 5730 5730 case kScheduleProgramGuide: 5731 GuideGrid::Run(chanid, channum, true);5731 GuideGrid::Run(chanid, channum, false); 5732 5732 break; 5733 5733 case kScheduleProgramFinder: 5734 5734 RunProgramFind(true, false); … … 5796 5796 menurunning = false; 5797 5797 } 5798 5798 5799 void *TV::EPGMenuHandler(void *param)5800 {5801 TV *obj = (TV *)param;5802 obj->doEditSchedule(kScheduleProgramGuide);5803 5804 return NULL;5805 }5806 5807 void *TV::FinderMenuHandler(void *param)5808 {5809 TV *obj = (TV *)param;5810 obj->doEditSchedule(kScheduleProgramFinder);5811 5812 return NULL;5813 }5814 5815 void *TV::ScheduleMenuHandler(void *param)5816 {5817 TV *obj = (TV *)param;5818 obj->doEditSchedule(kScheduledRecording);5819 5820 return NULL;5821 }5822 5823 void *TV::RecordedShowMenuHandler(void *param)5824 {5825 TV *obj = (TV *)param;5826 obj->doEditSchedule(kPlaybackBox);5827 5828 return NULL;5829 }5830 5831 5799 void TV::EditSchedule(int editType) 5832 5800 { 5833 if (menurunning == true) 5834 return; 5835 menurunning = true; 5836 pthread_t tid; 5837 pthread_attr_t attr; 5838 pthread_attr_init(&attr); 5839 pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); 5840 5841 switch (editType) 5842 { 5843 default: 5844 case kScheduleProgramGuide: 5845 pthread_create(&tid, &attr, TV::EPGMenuHandler, this); 5846 break; 5847 case kScheduleProgramFinder: 5848 pthread_create(&tid, &attr, TV::FinderMenuHandler, this); 5849 break; 5850 case kScheduledRecording: 5851 pthread_create(&tid, &attr, TV::ScheduleMenuHandler, this); 5852 break; 5853 case kPlaybackBox: 5854 pthread_create(&tid, &attr, TV::RecordedShowMenuHandler, this); 5855 break; 5856 } 5857 5858 pthread_attr_destroy(&attr); 5801 // post the request to the main UI thread 5802 // it will be caught in eventFilter and processed as CustomEvent 5803 // this will create the program guide window (widget) 5804 // on the main thread and avoid a deadlock on Win32 5805 QString message = QString("START_EPG %1").arg(editType); 5806 MythEvent* me = new MythEvent(message); 5807 qApp->postEvent(myWindow, me); 5859 5808 } 5860 5809 5861 5810 void TV::ChangeVolume(bool up) … … 6133 6082 keyRepeat = true; 6134 6083 } 6135 6084 6085 void TV::SetMuteTimer(int timeout) 6086 { 6087 // message to set the timer will be posted to the main UI thread 6088 // where it will be caught in eventFilter and processed as CustomEvent 6089 // this will properly set the mute timer 6090 // otherwise it never fires on Win32 6091 QString message = QString("UNMUTE %1").arg(timeout); 6092 MythEvent* me = new MythEvent(message); 6093 qApp->postEvent(myWindow, me); 6094 } 6095 6136 6096 /** \fn TV::UnMute(void) 6137 6097 * \brief If the player exists and sound is muted, this unmutes the sound. 6138 6098 */ … … 6305 6265 ncLock.unlock(); 6306 6266 } 6307 6267 } 6268 else if (message.left(7) == "UNMUTE ") 6269 { 6270 message = message.simplifyWhiteSpace(); 6271 QStringList tokens = QStringList::split(" ", message); 6272 int timeout = tokens[1].toInt(); 6273 muteTimer->start(timeout, true); 6274 } 6275 else if (message.left(10) == "START_EPG ") 6276 { 6277 message = message.simplifyWhiteSpace(); 6278 QStringList tokens = QStringList::split(" ", message); 6279 int editType = tokens[1].toInt(); 6280 doEditSchedule(editType); 6281 } 6308 6282 6309 6283 pbinfoLock.lock(); 6310 6284 if (playbackinfo && message.left(14) == "COMMFLAG_START") … … 7560 7534 { 7561 7535 OSDGenericTree *item, *subitem; 7562 7536 7563 if (activerbuffer ->isDVD())7537 if (activerbuffer && activerbuffer->isDVD()) 7564 7538 { 7565 7539 item = new OSDGenericTree( 7566 7540 treeMenu, tr("DVD Root Menu"), "JUMPTODVDROOTMENU"); -
libs/libmythtv/tv_play.h
236 236 237 237 protected: 238 238 void doEditSchedule(int editType = kScheduleProgramGuide); 239 static void *EPGMenuHandler(void *param);240 static void *FinderMenuHandler(void *param);241 static void *ScheduleMenuHandler(void *param);242 static void *RecordedShowMenuHandler(void *param);243 244 239 void RunTV(void); 245 240 static void *EventThread(void *param); 241 void SetMuteTimer(int timeout); 246 242 247 243 bool eventFilter(QObject *o, QEvent *e); 248 244 static QStringList lastProgramStringList;