mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
Remove global allchans, use CServiceManager and CZapit.
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1650 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -44,12 +44,10 @@
|
|||||||
#include <gui/widget/buttons.h>
|
#include <gui/widget/buttons.h>
|
||||||
|
|
||||||
#include <zapit/client/zapitclient.h>
|
#include <zapit/client/zapitclient.h>
|
||||||
#include <zapit/channel.h>
|
#include <zapit/zapit.h>
|
||||||
#include <zapit/bouquets.h>
|
#include <zapit/getservices.h>
|
||||||
|
|
||||||
extern tallchans allchans;
|
|
||||||
extern CBouquetManager *g_bouquetManager;
|
extern CBouquetManager *g_bouquetManager;
|
||||||
void addChannelToBouquet(const unsigned int bouquet, const t_channel_id channel_id);
|
|
||||||
|
|
||||||
CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsigned int Bouquet, CZapitClient::channelsMode Mode)
|
CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsigned int Bouquet, CZapitClient::channelsMode Mode)
|
||||||
:CListBox(Caption.c_str())
|
:CListBox(Caption.c_str())
|
||||||
@@ -141,7 +139,7 @@ void CBEChannelSelectWidget::onOkKeyPressed()
|
|||||||
if (isChannelInBouquet(selected))
|
if (isChannelInBouquet(selected))
|
||||||
g_bouquetManager->Bouquets[bouquet]->removeService(Channels[selected]->channel_id);
|
g_bouquetManager->Bouquets[bouquet]->removeService(Channels[selected]->channel_id);
|
||||||
else
|
else
|
||||||
addChannelToBouquet( bouquet, Channels[selected]->channel_id);
|
CZapit::getInstance()->addChannelToBouquet( bouquet, Channels[selected]->channel_id);
|
||||||
|
|
||||||
bouquetChannels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels);
|
bouquetChannels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels);
|
||||||
|
|
||||||
@@ -165,13 +163,9 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action
|
|||||||
|
|
||||||
Channels.clear();
|
Channels.clear();
|
||||||
if (mode == CZapitClient::MODE_RADIO) {
|
if (mode == CZapitClient::MODE_RADIO) {
|
||||||
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++)
|
CServiceManager::getInstance()->GetAllRadioChannels(Channels);
|
||||||
if (it->second.getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE)
|
|
||||||
Channels.push_back(&(it->second));
|
|
||||||
} else {
|
} else {
|
||||||
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++)
|
CServiceManager::getInstance()->GetAllTvChannels(Channels);
|
||||||
if (it->second.getServiceType() == ST_DIGITAL_TELEVISION_SERVICE)
|
|
||||||
Channels.push_back(&(it->second));
|
|
||||||
}
|
}
|
||||||
sort(Channels.begin(), Channels.end(), CmpChannelByChName());
|
sort(Channels.begin(), Channels.end(), CmpChannelByChName());
|
||||||
|
|
||||||
|
@@ -61,7 +61,8 @@
|
|||||||
#include <daemonc/remotecontrol.h>
|
#include <daemonc/remotecontrol.h>
|
||||||
#include <zapit/client/zapittools.h>
|
#include <zapit/client/zapittools.h>
|
||||||
#include <gui/pictureviewer.h>
|
#include <gui/pictureviewer.h>
|
||||||
#include <zapit/bouquets.h>
|
|
||||||
|
#include <zapit/zapit.h>
|
||||||
#include <zapit/satconfig.h>
|
#include <zapit/satconfig.h>
|
||||||
#include <zapit/getservices.h>
|
#include <zapit/getservices.h>
|
||||||
#include <zapit/frontend_c.h>
|
#include <zapit/frontend_c.h>
|
||||||
@@ -78,7 +79,6 @@ extern CBouquetList * RADIObouquetList;
|
|||||||
extern CBouquetList * RADIOsatList;
|
extern CBouquetList * RADIOsatList;
|
||||||
extern CBouquetList * RADIOfavList;
|
extern CBouquetList * RADIOfavList;
|
||||||
extern CBouquetList * RADIOallList;
|
extern CBouquetList * RADIOallList;
|
||||||
extern tallchans allchans;
|
|
||||||
|
|
||||||
|
|
||||||
//extern t_channel_id rec_channel_id;
|
//extern t_channel_id rec_channel_id;
|
||||||
@@ -88,7 +88,6 @@ extern int g_channel_list_changed;
|
|||||||
extern CBouquetManager *g_bouquetManager;
|
extern CBouquetManager *g_bouquetManager;
|
||||||
void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode, t_channel_id *chidlist, int clen);
|
void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode, t_channel_id *chidlist, int clen);
|
||||||
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
|
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
|
||||||
void addChannelToBouquet(const unsigned int bouquet, const t_channel_id channel_id);
|
|
||||||
void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
|
void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
|
||||||
|
|
||||||
extern int old_b_id;
|
extern int old_b_id;
|
||||||
@@ -125,8 +124,8 @@ void CChannelList::ClearList(void)
|
|||||||
|
|
||||||
void CChannelList::setSize(int newsize)
|
void CChannelList::setSize(int newsize)
|
||||||
{
|
{
|
||||||
chanlist.reserve(newsize);
|
//chanlist.reserve(newsize);
|
||||||
//chanlist.resize(newsize);
|
chanlist.resize(newsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::SetChannelList(ZapitChannelList* channels)
|
void CChannelList::SetChannelList(ZapitChannelList* channels)
|
||||||
@@ -391,7 +390,7 @@ int CChannelList::doChannelMenu(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(new_bouquet_id, channel_id)) {
|
if(!g_bouquetManager->existsChannelInBouquet(new_bouquet_id, channel_id)) {
|
||||||
addChannelToBouquet(new_bouquet_id, channel_id);
|
CZapit::getInstance()->addChannelToBouquet(new_bouquet_id, channel_id);
|
||||||
}
|
}
|
||||||
if(g_bouquetManager->existsChannelInBouquet(old_bouquet_id, channel_id)) {
|
if(g_bouquetManager->existsChannelInBouquet(old_bouquet_id, channel_id)) {
|
||||||
g_bouquetManager->Bouquets[old_bouquet_id]->removeService(channel_id);
|
g_bouquetManager->Bouquets[old_bouquet_id]->removeService(channel_id);
|
||||||
@@ -415,7 +414,7 @@ int CChannelList::doChannelMenu(void)
|
|||||||
if (bouquet_id == -1)
|
if (bouquet_id == -1)
|
||||||
return 0;
|
return 0;
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
||||||
addChannelToBouquet(bouquet_id, channel_id);
|
CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -426,7 +425,7 @@ int CChannelList::doChannelMenu(void)
|
|||||||
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
bouquet_id = g_bouquetManager->existsUBouquet(g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME), true);
|
||||||
}
|
}
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
||||||
addChannelToBouquet(bouquet_id, channel_id);
|
CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1157,22 +1156,21 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */)
|
|||||||
/* to replace zapTo_ChannelID and zapTo from "whole" list ? */
|
/* to replace zapTo_ChannelID and zapTo from "whole" list ? */
|
||||||
void CChannelList::NewZap(t_channel_id channel_id)
|
void CChannelList::NewZap(t_channel_id channel_id)
|
||||||
{
|
{
|
||||||
tallchans_iterator it = allchans.find(channel_id);
|
CZapitChannel * chan = CServiceManager::getInstance()->FindChannel(channel_id);
|
||||||
|
|
||||||
if(it == allchans.end())
|
if(chan == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CZapitChannel* chan = &it->second;
|
|
||||||
printf("**************************** CChannelList::NewZap me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, chan->name.c_str(), chan->channel_id);
|
printf("**************************** CChannelList::NewZap me %p %s tuned %d new %s -> %llx\n", this, name.c_str(), tuned, chan->name.c_str(), chan->channel_id);
|
||||||
|
|
||||||
if(selected_chid != chan->channel_id) {
|
if(selected_chid != chan->getChannelID()) {
|
||||||
selected_chid = chan->channel_id;
|
selected_chid = chan->getChannelID();
|
||||||
g_RemoteControl->zapTo_ChannelID(chan->channel_id, chan->name, !chan->bAlwaysLocked);
|
g_RemoteControl->zapTo_ChannelID(chan->getChannelID(), chan->name, !chan->bAlwaysLocked);
|
||||||
/* remove recordModeActive from infobar */
|
/* remove recordModeActive from infobar */
|
||||||
if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) {
|
if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) {
|
||||||
g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0);
|
g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0);
|
||||||
}
|
}
|
||||||
CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id);
|
CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->getChannelID());
|
||||||
g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 );
|
g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,13 +40,13 @@
|
|||||||
#include <gui/widget/stringinput.h>
|
#include <gui/widget/stringinput.h>
|
||||||
|
|
||||||
#include <zapit/client/zapitclient.h>
|
#include <zapit/client/zapitclient.h>
|
||||||
|
#include <zapit/zapit.h>
|
||||||
|
|
||||||
|
|
||||||
#include <gui/bouquetlist.h>
|
#include <gui/bouquetlist.h>
|
||||||
|
|
||||||
extern CBouquetList * bouquetList; /* neutrino.cpp */
|
extern CBouquetList * bouquetList; /* neutrino.cpp */
|
||||||
extern t_channel_id live_channel_id;
|
extern t_channel_id live_channel_id;
|
||||||
void addChannelToBouquet(const unsigned int bouquet, const t_channel_id channel_id);
|
|
||||||
extern CBouquetManager *g_bouquetManager;
|
extern CBouquetManager *g_bouquetManager;
|
||||||
//
|
//
|
||||||
// -- Add current channel to Favorites-Bouquet
|
// -- Add current channel to Favorites-Bouquet
|
||||||
@@ -92,7 +92,7 @@ int CFavorites::addChannelToFavorites(bool show_list)
|
|||||||
channel_id = live_channel_id;
|
channel_id = live_channel_id;
|
||||||
|
|
||||||
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
|
||||||
addChannelToBouquet(bouquet_id, channel_id);
|
CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id);
|
||||||
status |= 2;
|
status |= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user