Ticket #8153: external_subtitle_menu_v2.patch

File external_subtitle_menu_v2.patch, 4.0 KB (added by Jim Stichnoth <stichnot@…>, 14 years ago)
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    8989#define LOC_WARN QString("NVP(%1), Warning: ").arg(dbg_ident(this),0,36)
    9090#define LOC_ERR  QString("NVP(%1), Error: ").arg(dbg_ident(this),0,36)
    9191
    92 uint track_type_to_display_mode[kTrackTypeCount+2] =
     92uint track_type_to_display_mode[kTrackTypeCount+3] =
    9393{
    9494    kDisplayNone,
    9595    kDisplayAVSubtitle,
     
    9898    kDisplayTeletextCaptions,
    9999    kDisplayNone,
    100100    kDisplayNUVTeletextCaptions,
     101    kDisplayTextSubtitle,
    101102};
    102103
    103104NuppelVideoPlayer::NuppelVideoPlayer(bool muted)
     
    19281929
    19291930    // figure out which text type to enable..
    19301931    bool captions_found = true;
    1931     if (decoder->GetTrackCount(kTrackTypeSubtitle))
     1932    if (textSubtitles.GetSubtitleCount() > 0)
     1933        EnableCaptions(kDisplayTextSubtitle, osd_msg);
     1934    else if (decoder->GetTrackCount(kTrackTypeSubtitle))
    19321935        EnableCaptions(kDisplayAVSubtitle, osd_msg);
    1933     else if (textSubtitles.GetSubtitleCount() > 0)
    1934         EnableCaptions(kDisplayTextSubtitle, osd_msg);
    19351936    else if (db_prefer708 && decoder->GetTrackCount(kTrackTypeCC708))
    19361937        EnableCaptions(kDisplayCC708, osd_msg);
    19371938    else if (decoder->GetTrackCount(kTrackTypeTeletextCaptions))
     
    67546755    if (kTrackTypeSubtitle == type)
    67556756    {
    67566757        DisableCaptions(textDisplayMode, false);
    6757         EnableCaptions(kDisplayAVSubtitle);
     6758        EnableCaptions(GetTextSubtitlesCount() > 0 ?
     6759                       kDisplayTextSubtitle : kDisplayAVSubtitle);
    67586760    }
    67596761    else if (kTrackTypeCC708 == type)
    67606762    {
     
    68986900
    68996901int NuppelVideoPlayer::ChangeTrack(uint type, int dir)
    69006902{
     6903    if (type == kTrackTypeSubtitle && GetTextSubtitlesCount() > 0)
     6904        return SetTrack(type, 0);
    69016905    QMutexLocker locker(&decoder_change_lock);
    69026906
    69036907    if (GetDecoder())
  • libs/libmythtv/NuppelVideoPlayer.h

     
    418418    bool PosMapFromEnc(unsigned long long          start,
    419419                       QMap<long long, long long> &posMap);
    420420
     421    uint GetTextSubtitlesCount(void) const
     422    {
     423        return textSubtitles.GetSubtitleCount();
     424    }
     425
    421426  protected:
    422427    void DisplayPauseFrame(void);
    423428    void DisplayNormalFrame(void);
  • libs/libmythtv/tv_play.cpp

     
    34703470    else if (action.left(6) == "TOGGLE")
    34713471    {
    34723472        int type = to_track_type(action.mid(6));
     3473        if (type == kTrackTypeSubtitle &&
     3474            ctx->nvp->GetTextSubtitlesCount() > 0)
     3475            type = kTrackTypeTextSubtitle;
    34733476        if (type == kTrackTypeTeletextMenu)
    34743477        {
    34753478            handled = true;
     
    1081110814        typeStr = "SUBTITLE";
    1081210815        selStr  = "SELECTSUBTITLE_";
    1081310816        grpStr  = "SUBTITLEGROUP";
    10814         sel     = capmode & kDisplayAVSubtitle;
     10817        sel     = capmode & (kDisplayAVSubtitle | kDisplayTextSubtitle);
    1081510818    }
    1081610819    else if (kTrackTypeCC608 == type)
    1081710820    {
     
    1085410857    }
    1085510858    ctx->UnlockDeleteNVP(__FILE__, __LINE__);
    1085610859
    10857     if (tracks.empty())
     10860    if (tracks.empty() &&
     10861        !(type == kTrackTypeSubtitle && ctx->nvp->GetTextSubtitlesCount() > 0))
    1085810862        return false;
    1085910863
    1086010864    if ((kTrackTypeAudio == type) && tracks.size() <= 1)
     
    1087310877            (sel && (i == curtrack)) ? 1 : 0, NULL, grpStr);
    1087410878    }
    1087510879
     10880    if (type == kTrackTypeSubtitle && ctx->nvp->GetTextSubtitlesCount() > 0)
     10881    {
     10882        new OSDGenericTree(
     10883            tm_item, QObject::tr("Text Subtitles"), selStr + QString::number(1),
     10884            sel ? 1 : 0, NULL, grpStr);
     10885    }
     10886
    1087610887    return true;
    1087710888}
    1087810889