Ticket #3632: tv_type.diff

File tv_type.diff, 5.2 KB (added by skamithi, 13 years ago)
  • libs/libmythtv/tv.h

     
    3434     *         watching a pre-existing recording.
    3535     */
    3636    kState_WatchingPreRecorded,
     37    /** \brief Watching Video is the state when a video, but not a dvd,
     38     * is playing
     39     */
     40    kState_WatchingVideo,
     41    /** \brief Watching DVD is the state when a dvd is playing.
     42     */
     43    kState_WatchingDVD,
    3744    /** \brief Watching Recording is the state for when we are watching
    3845     *         an in progress recording, but the user does not have control
    3946     *         over the channel and recorder to use.
     
    5259
    5360const int kLiveTVAutoExpire = 10000;
    5461
    55 QString StateToString(TVState state);
     62QString StateToString(TVState state, bool brief = false);
    5663
    5764typedef enum PictureAdjustType
    5865{
  • libs/libmythtv/tv.cpp

     
    88/** \fn StateToString(TVState state)
    99 *  \brief Returns a human readable QString representing a TVState.
    1010 *  \param state State to print.
     11 *  \param brief print brief string format
    1112 */
    12 QString StateToString(TVState state)
     13QString StateToString(TVState state, bool brief)
    1314{
     15    bool appendWatching = false;
    1416    QString statestr = QString("Unknown(%1)").arg((int)state);
    1517    switch (state) {
    1618        case kState_Error: statestr = "Error"; break;
    1719        case kState_None: statestr = "None"; break;
    18         case kState_WatchingLiveTV: statestr = "WatchingLiveTV"; break;
     20        case kState_WatchingLiveTV:
     21            statestr = "LiveTV";
     22            appendWatching = true;
     23            break;
    1924        case kState_WatchingPreRecorded:
    20             statestr = "WatchingPreRecorded"; break;
    21         case kState_WatchingRecording: statestr = "WatchingRecording"; break;
     25            statestr = "PreRecorded";
     26            appendWatching = true;
     27            break;
     28        case kState_WatchingVideo:
     29            statestr = "Video"; break;
     30            appendWatching = true;
     31        case kState_WatchingDVD:
     32            statestr = "DVD"; break;
     33            appendWatching = true;
     34        case kState_WatchingRecording:
     35            statestr = "Recording";
     36            appendWatching = true;
     37            break;
    2238        case kState_RecordingOnly: statestr = "RecordingOnly"; break;
    2339        case kState_ChangingState: statestr = "ChangingState"; break;
    2440    }
     41    if (!brief && appendWatching)
     42        statestr.prepend("Watching");
    2543    return statestr;
    2644}
    2745
  • libs/libmythtv/tv_play.cpp

     
    947978
    948979    if (curtime < recendts && !rcinfo->isVideo)
    949980        ChangeState(kState_WatchingRecording);
     981    else if (rcinfo->isVideo)
     982    {
     983        if (rcinfo->pathname.left(4) == "dvd:")
     984            ChangeState(kState_WatchingDVD);
     985        else
     986            ChangeState(kState_WatchingVideo);
     987    }
    950988    else
    951989        ChangeState(kState_WatchingPreRecorded);
    952990
     
    10201058bool TV::StateIsPlaying(TVState state)
    10211059{
    10221060    return (state == kState_WatchingPreRecorded ||
    1023             state == kState_WatchingRecording);
     1061            state == kState_WatchingRecording   ||
     1062            state == kState_WatchingVideo       ||
     1063            state == kState_WatchingDVD);
    10241064}
    10251065
    10261066bool TV::StateIsLiveTV(TVState state)
     
    11741214        SET_NEXT();
    11751215    }
    11761216    else if (TRANSITION(kState_None, kState_WatchingPreRecorded) ||
    1177              TRANSITION(kState_None, kState_WatchingRecording))
     1217             TRANSITION(kState_None, kState_WatchingRecording)   ||
     1218             TRANSITION(kState_None, kState_WatchingVideo)       ||
     1219             TRANSITION(kState_None, kState_WatchingDVD))
    11781220    {
    11791221        QString playbackURL;
    11801222        if ((playbackinfo->pathname.left(4) == "dvd:") ||
     
    12241266        }
    12251267    }
    12261268    else if (TRANSITION(kState_WatchingPreRecorded, kState_None) ||
    1227              TRANSITION(kState_WatchingRecording, kState_None))
     1269             TRANSITION(kState_WatchingRecording, kState_None)   ||
     1270             TRANSITION(kState_WatchingVideo, kState_None)       ||
     1271             TRANSITION(kState_WatchingDVD, kState_None))
    12281272    {
    12291273        SET_NEXT();
    12301274
     
    46184679        playbackinfo->ToMap(infoMap);
    46194680    pbinfoLock.unlock();
    46204681
     4682    infoMap["tvstate"] = QString("(%1)")
     4683            .arg(StateToString(internalState, true));
    46214684    // Clear previous osd and add new info
    46224685    osd->ClearAllText(whichInfo);
    46234686    osd->HideAll();
     
    46974760            playbackinfo->ToMap(lastSignalUIInfo);
    46984761        pbinfoLock.unlock();
    46994762        infoMap = lastSignalUIInfo;
     4763        infoMap["tvstate"] = QString("(%1)")
     4764                .arg(StateToString(internalState, true));
    47004765        lastSignalUIInfoTime.start();
    47014766    }
    47024767
     
    47944859    else if (!msg.isEmpty())
    47954860        sigDesc = msg;
    47964861
     4862    infoMap["tvstate"] = QString("(%1)")
     4863        .arg(StateToString(internalState, true));
     4864
    47974865    //GetOSD()->ClearAllText("signal_info");
    47984866    //GetOSD()->SetText("signal_info", infoMap, -1);
    47994867