diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 08968fddd..fc902669d 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -163,6 +163,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"epg", &CControlAPI::EpgCGI, ""}, {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, + {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system {"standby", &CControlAPI::StandbyCGI, "text/plain"}, {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, @@ -531,6 +532,12 @@ void CControlAPI::GetChannel_IDCGI(CyhookHandler *hh) hh->printf("%x%04x%04x\n",current_pids.tsid, current_pids.onid, current_pids.sid); } +// get actual channel_id +void CControlAPI::GetTPChannel_IDCGI(CyhookHandler *hh) +{ + SendChannelList(hh, true); +} + //----------------------------------------------------------------------------- void CControlAPI::MessageCGI(CyhookHandler *hh) { @@ -1597,17 +1604,22 @@ void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) } //----------------------------------------------------------------------------- -void CControlAPI::SendChannelList(CyhookHandler *hh) +void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP) { + t_channel_id current_channel = 0; + if(currentTP){ + current_channel = CZapit::getInstance()->GetCurrentChannelID(); + current_channel=(current_channel>>16); + } + int mode = NeutrinoAPI->Zapit->getMode(); hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %s\n", - channel->channel_id, - channel->getName().c_str()); + if(!currentTP || (channel->channel_id >>16) == current_channel){ + hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->channel_id, channel->getName().c_str()); + } } } diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index db8670cd3..151dbf160 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -36,7 +36,7 @@ private: void SendStreamInfo(CyhookHandler *hh); void SendBouquets(CyhookHandler *hh); void SendBouquet(CyhookHandler *hh,int BouquetNr); - void SendChannelList(CyhookHandler *hh); + void SendChannelList(CyhookHandler *hh, bool currentTP = false); void SendTimers(CyhookHandler *hh); void SendTimersXML(CyhookHandler *hh); void epgDetailList(CyhookHandler *hh); @@ -70,6 +70,7 @@ private: void GetServicesxmlCGI(CyhookHandler *hh); void GetBouquetsxmlCGI(CyhookHandler *hh); void GetChannel_IDCGI(CyhookHandler *hh); + void GetTPChannel_IDCGI(CyhookHandler *hh); void MessageCGI(CyhookHandler *hh); void InfoCGI(CyhookHandler *hh); void HWInfoCGI(CyhookHandler *hh);