Ticket #731: unified-multiple-proginfoosd.diff

File unified-multiple-proginfoosd.diff, 7.7 KB (added by bmayland@…, 21 years ago)

Patch agains svn r8080

  • themes/defaultosd/osd.xml

     
    7070       <area>538,274,60,27</area>
    7171       <font>infofont</font>
    7272    </textarea>
     73    <textarea name="channum" align="right">
     74      <area>440,30,160,90</area>
     75      <font>channelfont</font>
     76    </textarea>
    7377 <!-- just some examples.  The textarea is displaying a static message.
    7478      Possible values for align are 'right' and 'center'.  Leaving align
    7579      off entirely will just left justify things.
  • themes/blueosd/osd.xml

     
    8484        <area>365,25,240,90</area>
    8585        <font>timefont</font>
    8686     </textarea>
     87    <textarea name="channum">
     88      <area>90,20,160,90</area>
     89      <font>channelfont</font>
     90    </textarea>
    8791  </container>
    8892
    8993  <container name="browse_info">
  • libs/libmythtv/osd.h

     
    123123                                  OSDGenericTree *treeToShow);
    124124
    125125    void DisableFade(void);
     126    bool IsSetDisplaying(const QString &name);
     127    bool HasSet(const QString &name);
    126128
    127129 private:
    128130    void SetDefaults();
  • libs/libmythtv/tv_play.cpp

     
    22402240                if (HasQueuedInput())
    22412241                    DoArbSeek(ARBSEEK_SET);
    22422242                else
    2243                     ToggleOSD();
     2243                    ToggleOSD(false);
    22442244            }
    22452245            else if (action == "CHANNELUP")
    22462246            {
     
    23032303                if (HasQueuedInput())
    23042304                    DoArbSeek(ARBSEEK_SET);
    23052305                else
    2306                     DoInfo();
     2306                    ToggleOSD(true);
    23072307            }
    23082308            else if (action == "SELECT")
    23092309            {
     
    25602560    }
    25612561}
    25622562
    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     else
    2584     {
    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 
    25942563bool TV::DoNVPSeek(float time)
    25952564{
    25962565    if (time > -0.001f && time < +0.001f)
     
    33203289    return res;
    33213290}
    33223291
    3323 void TV::ToggleOSD(void)
     3292/** \fn TV::ToggleOSD(bool includeStatus)
     3293 *  \brief Cycle through the available Info OSDs.
     3294 */
     3295void TV::ToggleOSD(bool includeStatusOSD)
    33243296{
    3325     if (!GetOSD())
     3297    OSD *osd = GetOSD();
     3298    bool showStatus = false;
     3299    if (paused || !osd)
    33263300        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    }
    33273343
    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;
    33333360}
    33343361
    3335 void TV::UpdateOSD(void)
     3362/** \fn TV::UpdateOSDProgInfo(const char *whichInfo)
     3363 *  \brief Update and display the passed OSD set with programinfo
     3364 */
     3365void TV::UpdateOSDProgInfo(const char *whichInfo)
    33363366{
    33373367    InfoMap infoMap;
     3368    OSD *osd = GetOSD();
     3369    if (!osd)
     3370        return;
    33383371
    33393372    pbinfoLock.lock();
    33403373    if (playbackinfo)
    33413374        playbackinfo->ToMap(infoMap);
    33423375    pbinfoLock.unlock();
    33433376
    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);
    33523381}
    33533382
    33543383void TV::UpdateOSDSeekMessage(const QString &mesg, int disptime)
     
    52855314
    52865315    if (!nvp || (nvp && activenvp == nvp))
    52875316    {
    5288         UpdateOSD();
     5317        UpdateOSDProgInfo("program_info");
    52895318        UpdateLCD();
    52905319        AddPreviousChannel();
    52915320    }
  • libs/libmythtv/tv_play.h

     
    210210    void ToggleSleepTimer(void);
    211211    void ToggleSleepTimer(const QString);
    212212
    213     void DoInfo(void);
    214213    void DoPlay(void);
    215214    void DoPause(void);
    216215    void DoSeek(float time, const QString &mesg);
     
    239238    void SetManualZoom(bool zoomON = false);
    240239 
    241240    bool ClearOSD(void);
    242     void ToggleOSD(void);
    243     void UpdateOSD(void);
     241    void ToggleOSD(bool includeStatusOSD);
     242    void UpdateOSDProgInfo(const char *whichInfo);
    244243    void UpdateOSDSeekMessage(const QString &mesg, int disptime);
    245244    void UpdateOSDInput(void);
    246245    void UpdateOSDTextEntry(const QString &message);
  • libs/libmythtv/osd.cpp

     
    23042304    return ret;
    23052305}
    23062306
     2307bool OSD::IsSetDisplaying(const QString &name)
     2308{
     2309    OSDSet *oset = GetSet(name);
     2310    return Visible() && (oset != NULL) && oset->Displaying();
     2311}
     2312
     2313bool OSD::HasSet(const QString &name)
     2314{
     2315    return setMap.contains(name);
     2316}
     2317