Ticket #731: unified-multiple-proginfoosd.diff
File unified-multiple-proginfoosd.diff, 7.7 KB (added by , 18 years ago) |
---|
-
themes/defaultosd/osd.xml
70 70 <area>538,274,60,27</area> 71 71 <font>infofont</font> 72 72 </textarea> 73 <textarea name="channum" align="right"> 74 <area>440,30,160,90</area> 75 <font>channelfont</font> 76 </textarea> 73 77 <!-- just some examples. The textarea is displaying a static message. 74 78 Possible values for align are 'right' and 'center'. Leaving align 75 79 off entirely will just left justify things. -
themes/blueosd/osd.xml
84 84 <area>365,25,240,90</area> 85 85 <font>timefont</font> 86 86 </textarea> 87 <textarea name="channum"> 88 <area>90,20,160,90</area> 89 <font>channelfont</font> 90 </textarea> 87 91 </container> 88 92 89 93 <container name="browse_info"> -
libs/libmythtv/osd.h
123 123 OSDGenericTree *treeToShow); 124 124 125 125 void DisableFade(void); 126 bool IsSetDisplaying(const QString &name); 127 bool HasSet(const QString &name); 126 128 127 129 private: 128 130 void SetDefaults(); -
libs/libmythtv/tv_play.cpp
2240 2240 if (HasQueuedInput()) 2241 2241 DoArbSeek(ARBSEEK_SET); 2242 2242 else 2243 ToggleOSD( );2243 ToggleOSD(false); 2244 2244 } 2245 2245 else if (action == "CHANNELUP") 2246 2246 { … … 2303 2303 if (HasQueuedInput()) 2304 2304 DoArbSeek(ARBSEEK_SET); 2305 2305 else 2306 DoInfo();2306 ToggleOSD(true); 2307 2307 } 2308 2308 else if (action == "SELECT") 2309 2309 { … … 2560 2560 } 2561 2561 } 2562 2562 2563 void TV::DoInfo(void)2564 {2565 QString title, subtitle, description, category, starttime, endtime;2566 QString callsign, iconpath;2567 OSDSet *oset;2568 2569 if (paused || !GetOSD())2570 return;2571 2572 oset = GetOSD()->GetSet("status");2573 if ((oset) && (oset->Displaying()) && !prbuffer->isDVD())2574 {2575 InfoMap infoMap;2576 pbinfoLock.lock();2577 playbackinfo->ToMap(infoMap);2578 pbinfoLock.unlock();2579 GetOSD()->HideSet("status");2580 GetOSD()->ClearAllText("program_info");2581 GetOSD()->SetText("program_info", infoMap, osd_prog_info_timeout);2582 }2583 else2584 {2585 QString desc = "";2586 int pos = nvp->calcSliderPos(desc);2587 GetOSD()->HideSet("program_info");2588 GetOSD()->StartPause(pos, false, tr("Position"), desc,2589 osd_prog_info_timeout);2590 update_osd_pos = true;2591 }2592 }2593 2594 2563 bool TV::DoNVPSeek(float time) 2595 2564 { 2596 2565 if (time > -0.001f && time < +0.001f) … … 3320 3289 return res; 3321 3290 } 3322 3291 3323 void TV::ToggleOSD(void) 3292 /** \fn TV::ToggleOSD(bool includeStatus) 3293 * \brief Cycle through the available Info OSDs. 3294 */ 3295 void TV::ToggleOSD(bool includeStatusOSD) 3324 3296 { 3325 if (!GetOSD()) 3297 OSD *osd = GetOSD(); 3298 bool showStatus = false; 3299 if (paused || !osd) 3326 3300 return; 3301 3302 // DVD toggles between status and nothing 3303 if (prbuffer->isDVD()) 3304 { 3305 if (osd->IsSetDisplaying("status")) 3306 osd->HideAll(); 3307 else 3308 showStatus = true; 3309 } 3310 else if (osd->IsSetDisplaying("status")) 3311 { 3312 if (osd->HasSet("program_info_small")) 3313 UpdateOSDProgInfo("program_info_small"); 3314 else 3315 UpdateOSDProgInfo("program_info"); 3316 } 3317 // If small is displaying, show long if we have it, else hide info 3318 else if (osd->IsSetDisplaying("program_info_small")) 3319 { 3320 if (osd->HasSet("program_info")) 3321 UpdateOSDProgInfo("program_info"); 3322 else 3323 osd->HideAll(); 3324 } 3325 // If long is displaying, hide info 3326 else if (osd->IsSetDisplaying("program_info")) 3327 { 3328 osd->HideAll(); 3329 } 3330 // If no program_info displaying, show status if we want it 3331 else if (includeStatusOSD) 3332 { 3333 showStatus = true; 3334 } 3335 // No status desired? Nothing is up, Display small if we have, else display long 3336 else 3337 { 3338 if (osd->HasSet("program_info_small")) 3339 UpdateOSDProgInfo("program_info_small"); 3340 else 3341 UpdateOSDProgInfo("program_info"); 3342 } 3327 3343 3328 OSDSet *oset = GetOSD()->GetSet("program_info"); 3329 if ((oset) && (oset->Displaying() || prbuffer->isDVD())) 3330 GetOSD()->HideAll(); 3331 else if (!prbuffer->isDVD()) 3332 UpdateOSD(); 3344 if (showStatus) 3345 { 3346 osd->HideAll(); 3347 if (nvp) 3348 { 3349 QString desc = ""; 3350 int pos = nvp->calcSliderPos(desc); 3351 osd->StartPause(pos, false, tr("Position"), desc, 3352 osd_prog_info_timeout); 3353 update_osd_pos = true; 3354 } 3355 else 3356 update_osd_pos = false; 3357 } 3358 else 3359 update_osd_pos = false; 3333 3360 } 3334 3361 3335 void TV::UpdateOSD(void) 3362 /** \fn TV::UpdateOSDProgInfo(const char *whichInfo) 3363 * \brief Update and display the passed OSD set with programinfo 3364 */ 3365 void TV::UpdateOSDProgInfo(const char *whichInfo) 3336 3366 { 3337 3367 InfoMap infoMap; 3368 OSD *osd = GetOSD(); 3369 if (!osd) 3370 return; 3338 3371 3339 3372 pbinfoLock.lock(); 3340 3373 if (playbackinfo) 3341 3374 playbackinfo->ToMap(infoMap); 3342 3375 pbinfoLock.unlock(); 3343 3376 3344 if (GetOSD()) 3345 { 3346 // Clear previous osd and add new info 3347 GetOSD()->ClearAllText("program_info"); 3348 GetOSD()->SetText("program_info", infoMap, osd_prog_info_timeout); 3349 GetOSD()->ClearAllText("channel_number"); 3350 GetOSD()->SetText("channel_number", infoMap, osd_prog_info_timeout); 3351 } 3377 // Clear previous osd and add new info 3378 osd->ClearAllText(whichInfo); 3379 osd->HideAll(); 3380 osd->SetText(whichInfo, infoMap, osd_prog_info_timeout); 3352 3381 } 3353 3382 3354 3383 void TV::UpdateOSDSeekMessage(const QString &mesg, int disptime) … … 5285 5314 5286 5315 if (!nvp || (nvp && activenvp == nvp)) 5287 5316 { 5288 UpdateOSD ();5317 UpdateOSDProgInfo("program_info"); 5289 5318 UpdateLCD(); 5290 5319 AddPreviousChannel(); 5291 5320 } -
libs/libmythtv/tv_play.h
210 210 void ToggleSleepTimer(void); 211 211 void ToggleSleepTimer(const QString); 212 212 213 void DoInfo(void);214 213 void DoPlay(void); 215 214 void DoPause(void); 216 215 void DoSeek(float time, const QString &mesg); … … 239 238 void SetManualZoom(bool zoomON = false); 240 239 241 240 bool ClearOSD(void); 242 void ToggleOSD( void);243 void UpdateOSD (void);241 void ToggleOSD(bool includeStatusOSD); 242 void UpdateOSDProgInfo(const char *whichInfo); 244 243 void UpdateOSDSeekMessage(const QString &mesg, int disptime); 245 244 void UpdateOSDInput(void); 246 245 void UpdateOSDTextEntry(const QString &message); -
libs/libmythtv/osd.cpp
2304 2304 return ret; 2305 2305 } 2306 2306 2307 bool OSD::IsSetDisplaying(const QString &name) 2308 { 2309 OSDSet *oset = GetSet(name); 2310 return Visible() && (oset != NULL) && oset->Displaying(); 2311 } 2312 2313 bool OSD::HasSet(const QString &name) 2314 { 2315 return setMap.contains(name); 2316 } 2317