Ticket #475: channelchange.diff

File channelchange.diff, 5.4 KB (added by tahoward@…, 19 years ago)
  • libs/libmythtv/tv_play.cpp

     
    915915
    916916    QString filters = "";
    917917   
    918    
     918    channeltuned = false;
     919
    919920    nvp = new NuppelVideoPlayer(playbackinfo);
    920921    nvp->SetParentWidget(myWindow);
    921922    nvp->SetRingBuffer(prbuffer);
     
    24462447
    24472448void TV::ToggleInputs(void)
    24482449{
    2449     if (activenvp == nvp)
     2450    if (paused)
    24502451    {
    2451         if (paused)
    2452         {
    2453             osd->EndPause();
    2454             gContext->DisableScreensaver();
    2455             paused = false;
    2456         }
     2452        osd->EndPause();
     2453        gContext->DisableScreensaver();
     2454        paused = false;
    24572455    }
    24582456
    24592457    activenvp->Pause(false);
     
    24682466    activenvp->ResetPlaying();
    24692467    activenvp->Play(normal_speed, true, false);
    24702468
    2471     if (activenvp == nvp)
    2472     {
    2473         UpdateOSDInput();
    2474         UpdateLCD();
    2475     }
     2469    UpdateOSDInput();
     2470    UpdateLCD();
    24762471}
    24772472
    24782473void TV::ToggleChannelFavorite(void)
     
    24842479{
    24852480    bool muted = false;
    24862481
    2487     if (!force && (activenvp == nvp) && showBufferedWarnings)
     2482    if (!force && showBufferedWarnings)
    24882483    {
    24892484        int behind = activenvp->GetSecondsBehind();
    24902485        if (behind > bufferedChannelThreshold)
     
    25182513        muted = true;
    25192514    }
    25202515
    2521     if (activenvp == nvp)
     2516    if (paused)
    25222517    {
    2523         if (paused)
    2524         {
    2525             osd->EndPause();
    2526             gContext->DisableScreensaver();
    2527             paused = false;
    2528         }
     2518        osd->EndPause();
     2519        gContext->DisableScreensaver();
     2520        paused = false;
    25292521    }
    25302522
    25312523    activenvp->Pause(false);
     
    25472539   
    25482540    activenvp->Play(normal_speed, true, false);
    25492541
     2542    UpdateOSD();
     2543    UpdateLCD();
     2544
    25502545    if (activenvp == nvp)
    25512546    {
    2552         UpdateOSD();
    2553         UpdateLCD();
    25542547        AddPreviousChannel();
    25552548    }
    25562549
     
    26402633        }
    26412634    }
    26422635
    2643     if (activenvp == nvp && osd)
     2636    if (osd)
    26442637    {
    26452638        QMap<QString, QString> infoMap;
    26462639
     
    26642657    if (browsemode)
    26652658    {
    26662659        BrowseChannel(chan);
    2667         if (activenvp == nvp && osd)
     2660        if (osd)
    26682661            osd->HideSet("channel_number");
    26692662    }
    26702663    else
     
    26772670{
    26782671    bool muted = false;
    26792672
    2680     if (!channame_vector.empty() && channame_vector.back() == name)
     2673    if (!channame_vector.empty() && channame_vector.back() == name && channeltuned)
    26812674        return;
    26822675
    26832676    if (!activerecorder->CheckChannel(name))
    26842677        return;
    26852678
    2686     if (!force && (activenvp == nvp) && showBufferedWarnings)
     2679    if (!force && showBufferedWarnings)
    26872680    {
    26882681        int behind = activenvp->GetSecondsBehind();
    26892682        if (behind > bufferedChannelThreshold)
     
    27172710        muted = true;
    27182711    }
    27192712
    2720     if (activenvp == nvp)
    2721     {
    27222713        if (paused)
    27232714        {
    27242715            osd->EndPause();
    27252716            gContext->DisableScreensaver();
    27262717            paused = false;
    27272718        }
    2728     }
    27292719
    27302720    activenvp->Pause(false);
    27312721    // all we care about is the ringbuffer being paused, here..
     
    27462736   
    27472737    activenvp->Play(normal_speed, true, false);
    27482738
     2739    UpdateOSD();
     2740    UpdateLCD();
     2741
    27492742    if (activenvp == nvp)
    27502743    {
    2751         UpdateOSD();
    2752         UpdateLCD();
    27532744        AddPreviousChannel();
    27542745    }
    27552746
    27562747    if (muted)
    27572748        muteTimer->start(kMuteTimeout * 2, true);
     2749    channeltuned = true;
    27582750}
    27592751
    27602752void TV::AddPreviousChannel(void)
     
    27882780                 channame_vector.size();
    27892781
    27902782    // Display channel name in the OSD for up to 1 second.
    2791     if (activenvp == nvp && osd)
    2792     {
    2793         osd->HideSet("program_info");
     2783    osd->HideSet("program_info");
    27942784
    2795         QMap<QString, QString> infoMap;
     2785    QMap<QString, QString> infoMap;
    27962786
    2797         infoMap["channum"] = channame_vector[vector];
    2798         infoMap["callsign"] = "";
    2799         osd->ClearAllText("channel_number");
    2800         osd->SetText("channel_number", infoMap, 1);
    2801     }
     2787    infoMap["channum"] = channame_vector[vector];
     2788    infoMap["callsign"] = "";
     2789    osd->ClearAllText("channel_number");
     2790    osd->SetText("channel_number", infoMap, 1);
    28022791
    28032792    // Reset the timer
    28042793    prevChannelTimer->stop();
     
    28322821    }
    28332822
    28342823    //Turn off the OSD Channel Num so the channel changes right away
    2835     if (activenvp == nvp && osd)
    2836         osd->HideSet("channel_number");
     2824    osd->HideSet("channel_number");
    28372825}
    28382826
    28392827bool TV::ClearOSD(void)
     
    35233511
    35243512void TV::BrowseStart(void)
    35253513{
    3526     if (activenvp != nvp)
    3527         return;
    3528 
    35293514    if (paused)
    35303515        return;
    35313516
     
    36463631
    36473632            QString msg = QString("%1 \"%2\"").arg(tr("Record")).arg(title);
    36483633
    3649             if (activenvp == nvp)
    3650                 osd->SetSettingsText(msg, 3);
     3634            osd->SetSettingsText(msg, 3);
    36513635
    36523636            delete program_info;
    36533637        }
     
    36673651    osd->ClearAllText("browse_info");
    36683652    osd->SetText("browse_info", infoMap, -1);
    36693653
    3670     if (activenvp == nvp)
    3671         osd->SetSettingsText(tr("Record"), 3);
     3654    osd->SetSettingsText(tr("Record"), 3);
    36723655
    36733656    delete program_info;
    36743657}
  • libs/libmythtv/tv_play.h

     
    271271
    272272    // Channel changing state variables
    273273    bool channelqueued;
     274    bool channeltuned;
    274275    char channelKeys[5];
    275276    int channelkeysstored;
    276277    QString lastCC;      // last channel