Ticket #320: fix320-v1.patch
File fix320-v1.patch, 7.3 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/tv_play.cpp
199 199 // Channel changing state variables 200 200 channelqueued(false), channelKeys(""), lookForChannel(false), 201 201 lastCC(""), lastCCDir(0), muteTimer(new QTimer(this)), 202 lockTimerOn(false), lockTimeout(3000), 202 203 // previous channel functionality state variables 203 204 prevChanKeyCnt(0), prevChanTimer(new QTimer(this)), 204 205 // channel browsing state variables … … 712 713 } 713 714 else 714 715 { 716 lockTimerOn = false; 715 717 prbuffer = new RingBuffer(name, filesize, smudge, recorder); 716 718 717 719 SET_NEXT(); … … 736 738 737 739 SET_LAST(); 738 740 } 741 else 742 { 743 MSqlQuery query(MSqlQuery::InitCon()); 744 query.prepare("SELECT channel_timeout " 745 "FROM capturecard " 746 "WHERE cardid = :CARDID"); 747 query.bindValue(":CARDID", recorder->GetRecorderNumber()); 748 if (!query.exec() || !query.isActive() || !query.next()) 749 MythContext::DBError("Getting timeout", query); 750 751 lockTimeout = query.value(0).toInt(); 752 cerr<<"set lockTimeout to: "<<lockTimeout<<endl; 753 lockTimer.start(); 754 lockTimerOn = true; 755 } 739 756 } 740 757 } 741 758 else if (TRANSITION(kState_WatchingLiveTV, kState_None)) … … 1269 1286 lastSignalMsg.clear(); 1270 1287 } 1271 1288 1289 UpdateOSDTimeoutMessage(); 1290 1272 1291 if (IsErrored()) 1273 1292 { 1274 1293 VERBOSE(VB_IMPORTANT, "TVPlay: RunTV encountered " … … 1699 1718 else if (result == 3) 1700 1719 recorder->CancelNextRecording(); 1701 1720 } 1721 else if (dialogname == "channel_timed_out") 1722 { 1723 lockTimerOn = false; 1724 } 1702 1725 1703 1726 while (GetOSD()->DialogShowing(dialogname)) 1704 1727 { … … 3240 3263 GetOSD()->ClearAllText("program_info"); 3241 3264 GetOSD()->SetText("program_info", infoMap, osd_display_time); 3242 3265 lastSignalMsgTime.start(); 3266 3267 // Turn of lock timer since we have a signal lock now... 3268 if (allGood) 3269 lockTimerOn = false; 3243 3270 } 3244 3271 3272 void TV::UpdateOSDTimeoutMessage(void) 3273 { 3274 QString dlg_name("channel_timed_out"); 3275 bool timed_out = lockTimerOn && (lockTimer.elapsed() > (int)lockTimeout); 3276 OSD *osd = GetOSD(); 3277 3278 if (!osd) 3279 { 3280 if (timed_out) 3281 VERBOSE(VB_IMPORTANT, "Error: You have no OSD, " 3282 "but tuning has already taken too long."); 3283 return; 3284 } 3285 3286 if (!timed_out) 3287 { 3288 if (osd->DialogShowing(dlg_name)) 3289 osd->TurnDialogOff(dlg_name); 3290 return; 3291 } 3292 3293 if (osd->DialogShowing(dlg_name)) 3294 return; 3295 3296 // create dialog... 3297 static QString chan_up = GET_KEY("TV Playback", "CHANNELUP"); 3298 static QString chan_down = GET_KEY("TV Playback", "CHANNELDOWN"); 3299 static QString tog_in = GET_KEY("TV Playback", "TOGGLEINPUTS"); 3300 static QString tog_cards = GET_KEY("TV Playback", "SWITCHCARDS"); 3301 3302 QString message = tr( 3303 "You should have gotten a channel lock by now. " 3304 "You can continue to wait for a signal, or you " 3305 "can change the channels with %1 or %2, change " 3306 "input's (%3), capture cards (%4), etc.") 3307 .arg(chan_up).arg(chan_down).arg(tog_in).arg(tog_cards); 3308 3309 QStringList options; 3310 options += tr("OK"); 3311 3312 dialogname = dlg_name; 3313 osd->NewDialogBox(dialogname, message, options, 0); 3314 } 3315 3245 3316 void TV::UpdateLCD(void) 3246 3317 { 3247 3318 // Make sure the LCD information gets updated shortly … … 4917 4988 void TV::PauseLiveTV(void) 4918 4989 { 4919 4990 VERBOSE(VB_PLAYBACK, "PauseLiveTV()"); 4991 lockTimerOn = false; 4920 4992 4921 4993 if (activenvp) 4922 4994 activenvp->Pause(false); … … 4958 5030 UpdateLCD(); 4959 5031 AddPreviousChannel(); 4960 5032 } 5033 5034 lockTimer.start(); 5035 lockTimerOn = true; 4961 5036 } -
libs/libmythtv/tv_play.h
210 210 void UpdateOSD(void); 211 211 void UpdateOSDInput(void); 212 212 void UpdateOSDSignal(const QStringList& strlist); 213 void UpdateOSDTimeoutMessage(void); 213 214 214 215 void LoadMenu(void); 215 216 … … 327 328 * or decreased to speedup or slowdown playback. 328 329 * Ignored when doing Fast Forward or Rewind. 329 330 */ 330 float normal_speed; 331 float normal_speed; 331 332 332 333 float frameRate; ///< Estimated framerate from recorder 333 334 … … 340 341 int lastCCDir; ///< Last channel changing direction 341 342 QTimer *muteTimer; ///< For temp. audio muting during channel changes 342 343 344 // Channel changing timeout notification variables 345 QTime lockTimer; 346 bool lockTimerOn; 347 uint lockTimeout; 348 349 343 350 // Previous channel functionality state variables 344 351 str_vec_t prevChan; ///< Previous channels 345 352 uint prevChanKeyCnt; ///< Number of repeated channel button presses -
libs/libmyth/mythdialogs.cpp
538 538 BindKey(context, action, keybind); 539 539 } 540 540 541 QString MythMainWindow::GetKey(const QString &context, 542 const QString &action) const 543 { 544 MSqlQuery query(MSqlQuery::InitCon()); 545 if (!query.isConnected()) 546 return "?"; 547 548 query.prepare("SELECT keylist FROM keybindings WHERE " 549 "context = :CONTEXT AND action = :ACTION AND " 550 "hostname = :HOSTNAME ;"); 551 query.bindValue(":CONTEXT", context); 552 query.bindValue(":ACTION", action); 553 query.bindValue(":HOSTNAME", gContext->GetHostName()); 554 555 if (!query.exec() || !query.isActive() || !query.next()) 556 return "?"; 557 558 return query.value(0).toString(); 559 } 560 541 561 void MythMainWindow::ClearJump(const QString &destination) 542 562 { 543 563 /* make sure that the jump point exists (using [] would add it)*/ -
libs/libmyth/mythdialogs.h
59 59 }; 60 60 61 61 #define REG_KEY(a, b, c, d) gContext->GetMainWindow()->RegisterKey(a, b, c, d) 62 #define GET_KEY(a, b) gContext->GetMainWindow()->GetKey(a, b) 62 63 #define REG_JUMP(a, b, c, d) gContext->GetMainWindow()->RegisterJump(a, b, c, d) 63 64 #define REG_MEDIA_HANDLER(a, b, c, d, e) gContext->GetMainWindow()->RegisterMediaHandler(a, b, c, d, e) 64 65 #define REG_MEDIAPLAYER(a,b,c) gContext->GetMainWindow()->RegisterMediaPlugin(a, b, c) … … 90 91 const QString &key); 91 92 void RegisterKey(const QString &context, const QString &action, 92 93 const QString &description, const QString &key); 94 QString GetKey(const QString &context, const QString &action) const; 93 95 94 96 void ClearJump(const QString &destination); 95 97 void BindJump(const QString &destination, const QString &key);