Remove global allchans, use CServiceManager.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1649 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 28382c9aa5
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2011-09-01 (Thu, 01 Sep 2011)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2011-09-01 12:24:18 +00:00
parent 23ab6fd53d
commit 1e0b87cbe3
7 changed files with 52 additions and 84 deletions

View File

@@ -49,7 +49,6 @@ void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventL
void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors);
bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags);
extern tallchans allchans;
extern CBouquetManager *g_bouquetManager;
extern t_channel_id live_channel_id;
#define EVENTDEV "/dev/input/input0"

View File

@@ -37,8 +37,8 @@
#include <zapit/client/zapitclient.h>
#include <zapit/channel.h>
#include <zapit/bouquets.h>
#include <zapit/getservices.h>
extern tallchans allchans;
extern CBouquetManager *g_bouquetManager;
extern CFrontend * frontend;
extern cVideo * videoDecoder;
@@ -205,17 +205,12 @@ t_channel_id CNeutrinoAPI::ChannelNameToChannelId(std::string search_channel_nam
//int mode = Zapit->getMode();
t_channel_id channel_id = (t_channel_id)-1;
CStringArray channel_names = ySplitStringVector(search_channel_name, ",");
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++) {
std::string channel_name = it->second.getName();
for(unsigned int j=0;j<channel_names.size();j++)
{
if(channel_names[j].length() == channel_name.length() &&
equal(channel_names[j].begin(), channel_names[j].end(),
channel_name.begin(), nocase_compare)) //case insensitive compare
{
channel_id = it->second.channel_id;
break;
}
for(unsigned int j=0;j<channel_names.size();j++) {
CZapitChannel * channel = CServiceManager::getInstance()->FindChannelByName(channel_names[j]);
if(channel) {
channel_id = channel->getChannelID();
break;
}
}
return channel_id;
@@ -281,11 +276,7 @@ bool CNeutrinoAPI::GetChannelEvents(void)
std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id)
{
tallchans_iterator it = allchans.find(channel_id);
if (it != allchans.end())
return it->second.getName();
else
return "";
return CServiceManager::getInstance()->GetServiceName(channel_id);
}
//-------------------------------------------------------------------------

View File

@@ -28,10 +28,10 @@
#include <zapit/channel.h>
#include <zapit/bouquets.h>
#include <zapit/getservices.h>
#include <cs_api.h>
#include <system/configure_network.h>
extern tallchans allchans;
extern CBouquetManager *g_bouquetManager;
extern t_channel_id live_channel_id;
@@ -1065,15 +1065,11 @@ std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std
}
ZapitChannelList Channels;
Channels.clear();
if (mode == CZapitClient::MODE_RADIO) {
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++)
if (it->second.getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE)
Channels.push_back(&(it->second));
} else {
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++)
if (it->second.getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE)
Channels.push_back(&(it->second));
}
if (mode == CZapitClient::MODE_RADIO)
CServiceManager::getInstance()->GetAllRadioChannels(Channels);
else
CServiceManager::getInstance()->GetAllTvChannels(Channels);
sort(Channels.begin(), Channels.end(), CmpChannelByChName());
for (int i = 0; i < (int) Channels.size(); i++) {