Ticket #3952: linkage_frontend.diff

File linkage_frontend.diff, 2.6 KB (added by Wolfgang <mythtv@…>, 5 years ago)

frontend patch for linkage support

  • libs/libmythtv/tv_play.cpp

     
    66286628         else if (RunPlaybackBoxPtr) 
    66296629            EditSchedule(kPlaybackBox); 
    66306630    } 
     6631    else if (action.left(8) == "JUMPLINK") 
     6632    { 
     6633        ChangeChannel(action.section(" ",1,1).toInt(),""); 
     6634    } 
    66316635    else if (StateIsLiveTV(GetState())) 
    66326636    { 
    66336637        if (action == "TOGGLEPIPMODE") 
     
    67336737        if (!freeRecorders) 
    67346738            freeRecorders = RemoteGetFreeRecorderCount(); 
    67356739 
     6740        FillMenuSubchannels(treeMenu); 
     6741 
    67366742        item = new OSDGenericTree(treeMenu, tr("Program Guide"), "GUIDE"); 
    67376743        if (!gContext->GetNumSetting("JumpToProgramOSD", 1)) 
    67386744        { 
     
    78407846    }   
    78417847} 
    78427848 
     7849bool TV::FillMenuSubchannels(OSDGenericTree *treeMenu) 
     7850{ 
     7851    uint chanid = 0; 
     7852    QString selStr = "JUMPLINK_"; 
     7853 
     7854    chanid = playbackinfo->chanid.toUInt(); 
     7855    MSqlQuery query(MSqlQuery::InitCon()); 
     7856    query.prepare("SELECT linkage2.chanid,linkage2.subevent,program.title " 
     7857                      "FROM linkage AS linkage1,linkage AS linkage2,program " 
     7858                      "WHERE linkage1.chanid=:CHANID " 
     7859                      "AND   linkage1.portal_chanid=linkage2.portal_chanid " 
     7860                      "AND   linkage2.chanid = program.chanid " 
     7861                      "AND   program.starttime<now() " 
     7862                      "AND   program.endtime>now() " 
     7863                      "ORDER BY program.starttime,linkage2.serviceid"); 
     7864 
     7865    query.bindValue(":CHANID", chanid); 
     7866 
     7867    if (!query.exec() || !query.isActive()) 
     7868    { 
     7869        MythContext::DBError("GetLinkage", query); 
     7870        return false; 
     7871    } 
     7872 
     7873    if (query.size() == 0) 
     7874        return false; 
     7875 
     7876    OSDGenericTree *item = new OSDGenericTree(treeMenu, tr("Subchannels")); 
     7877 
     7878    while (query.next()) { 
     7879        new OSDGenericTree( 
     7880            item, QString::fromUtf8(query.value(1).toString()+":"+query.value(2).toString()), QString("JUMPLINK %1").arg(query.value(0).toString())); 
     7881    } 
     7882 
     7883    return true; 
     7884} 
     7885 
    78437886/* vim: set expandtab tabstop=4 shiftwidth=4: */ 
  • libs/libmythtv/tv_play.h

     
    389389    static TVState RemovePlaying(TVState state); 
    390390    static TVState RemoveRecording(TVState state); 
    391391 
     392    bool FillMenuSubchannels(OSDGenericTree *treeMenu); 
     393 
    392394  private: 
    393395    // Configuration variables from database 
    394396    QString baseFilters;