remotecontrol: formatting code using astyle; some manual code nicenings

Origin commit data
------------------
Branch: ni/coolstream
Commit: b397b7c95f
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-01-25 (Tue, 25 Jan 2022)

Origin message was:
------------------
- remotecontrol: formatting code using astyle; some manual code nicenings

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2022-01-25 22:47:51 +01:00
parent 68ccbc7cb3
commit 30fc602567
2 changed files with 290 additions and 273 deletions

View File

@@ -69,7 +69,7 @@ CSubService::CSubService(const t_original_network_id anoriginal_network_id, cons
dauer = 0; dauer = 0;
subservice_name = asubservice_name; subservice_name = asubservice_name;
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); CZapitChannel *channel = CZapit::getInstance()->GetCurrentChannel();
satellitePosition = channel ? channel->getSatellitePosition() : 0; satellitePosition = channel ? channel->getSatellitePosition() : 0;
} }
@@ -82,17 +82,16 @@ CSubService::CSubService(const t_original_network_id anoriginal_network_id, cons
dauer = adauer; dauer = adauer;
subservice_name = ""; subservice_name = "";
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); CZapitChannel *channel = CZapit::getInstance()->GetCurrentChannel();
satellitePosition = channel ? channel->getSatellitePosition() : 0; satellitePosition = channel ? channel->getSatellitePosition() : 0;
} }
t_channel_id CSubService::getChannelID(void) const t_channel_id CSubService::getChannelID(void) const
{ {
return ((uint64_t) ( satellitePosition >= 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) | return ((uint64_t)(satellitePosition >= 0 ? satellitePosition : (uint64_t)(0xF000 + abs(satellitePosition))) << 48) |
(uint64_t) CREATE_CHANNEL_ID(service.service_id, service.original_network_id, service.transport_stream_id); (uint64_t) CREATE_CHANNEL_ID(service.service_id, service.original_network_id, service.transport_stream_id);
} }
CRemoteControl::CRemoteControl() CRemoteControl::CRemoteControl()
{ {
current_channel_id = CZapit::getInstance()->GetCurrentChannelID();; current_channel_id = CZapit::getInstance()->GetCurrentChannelID();;
@@ -103,68 +102,73 @@ CRemoteControl::CRemoteControl()
zap_completion_timeout = 0; zap_completion_timeout = 0;
current_EPGid = 0; current_EPGid = 0;
memset(&current_PIDs.PIDs, 0, sizeof(current_PIDs.PIDs) ); memset(&current_PIDs.PIDs, 0, sizeof(current_PIDs.PIDs));
has_ac3 = false; has_ac3 = false;
selected_subchannel = -1; selected_subchannel = -1;
needs_nvods = false; needs_nvods = false;
director_mode = 0; director_mode = 0;
// current_programm_timer = 0; //current_programm_timer = 0;
is_video_started = true; is_video_started = true;
//next_EPGid = 0; //next_EPGid = 0;
are_subchannels = false; are_subchannels = false;
has_unresolved_ctags = false; has_unresolved_ctags = false;
} }
int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
{ {
//printf("[neutrino] MSG %x\n", msg); //printf("[neutrino] MSG %x\n", msg);
if ( zap_completion_timeout != 0 ) { if (zap_completion_timeout != 0)
if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_FAILED ) || {
(msg == NeutrinoMessages::EVT_ZAP_ISNVOD )) { if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_FAILED) || (msg == NeutrinoMessages::EVT_ZAP_ISNVOD))
//printf("[neutrino] timeout EVT_ZAP current %llx data %llx\n", current_channel_id, *(t_channel_id *)data); {
if ((*(t_channel_id *)data) != current_channel_id) { //printf("[neutrino] timeout EVT_ZAP current %llx data %llx\n", current_channel_id, *(t_channel_id *)data);
if ((*(t_channel_id *)data) != current_channel_id)
{
g_InfoViewer->chanready = 0; g_InfoViewer->chanready = 0;
if (!IS_WEBCHAN(current_channel_id)) if (!IS_WEBCHAN(current_channel_id))
g_Sectionsd->setServiceStopped(); g_Sectionsd->setServiceStopped();
CMoviePlayerGui::getInstance().stopPlayBack(); CMoviePlayerGui::getInstance().stopPlayBack();
g_Zapit->zapTo_serviceID_NOWAIT(current_channel_id ); g_Zapit->zapTo_serviceID_NOWAIT(current_channel_id);
zap_completion_timeout = time_monotonic_ms() + ZAP_GUARD_TIME; zap_completion_timeout = time_monotonic_ms() + ZAP_GUARD_TIME;
return messages_return::handled; return messages_return::handled;
} }
else { else
{
zap_completion_timeout = 0; zap_completion_timeout = 0;
g_InfoViewer->chanready = 1; g_InfoViewer->chanready = 1;
} }
/* for CHANGETOLOCKED, we don't need to wait for EPG to arrive... */ // for CHANGETOLOCKED, we don't need to wait for EPG to arrive...
if ((!is_video_started) && if ((!is_video_started) && (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED))
(g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED))
g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false);
//check epg fsk in onsignal mode // check epg fsk in onsignal mode
if ((!is_video_started) && if ((!is_video_started) && (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL))
(g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL)){ {
CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo;
CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo); CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo);
if(currentNextInfo.current_fsk && currentNextInfo.current_fsk >= g_settings.parentallock_lockage){ if (currentNextInfo.current_fsk && currentNextInfo.current_fsk >= g_settings.parentallock_lockage)
{
g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false);
} }
} }
} }
} else { }
if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_FAILED ) || else
(msg == NeutrinoMessages::EVT_ZAP_ISNVOD ))
{ {
//printf("[neutrino] EVT_ZAP current %llx data %llx\n", current_channel_id, *(t_channel_id *)data); if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_FAILED) || (msg == NeutrinoMessages::EVT_ZAP_ISNVOD))
{
//printf("[neutrino] EVT_ZAP current %llx data %llx\n", current_channel_id, *(t_channel_id *)data);
g_InfoViewer->chanready = 1; g_InfoViewer->chanready = 1;
// wait for no message from ZAPIT -> someone else has triggered zapping // wait for no message from ZAPIT -> someone else has triggered zapping
if ((*(t_channel_id *)data) != current_channel_id) { if ((*(t_channel_id *)data) != current_channel_id)
{
t_channel_id new_id = *(t_channel_id *)data; t_channel_id new_id = *(t_channel_id *)data;
CZapitChannel* channel = CServiceManager::getInstance()->FindChannel(new_id); CZapitChannel *channel = CServiceManager::getInstance()->FindChannel(new_id);
is_video_started = true; is_video_started = true;
if (channel) { if (channel)
{
current_channel_name = channel->getName(); current_channel_name = channel->getName();
current_channel_num = channel->number; current_channel_num = channel->number;
if (channel->Locked() != g_settings.parentallock_defaultlocked) if (channel->Locked() != g_settings.parentallock_defaultlocked)
@@ -176,7 +180,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
current_EPGid = 0; current_EPGid = 0;
//next_EPGid = 0; //next_EPGid = 0;
memset(&current_PIDs.PIDs, 0, sizeof(current_PIDs.PIDs) ); memset(&current_PIDs.PIDs, 0, sizeof(current_PIDs.PIDs));
current_PIDs.APIDs.clear(); current_PIDs.APIDs.clear();
has_ac3 = false; has_ac3 = false;
@@ -187,21 +191,21 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
needs_nvods = (msg == NeutrinoMessages:: EVT_ZAP_ISNVOD); needs_nvods = (msg == NeutrinoMessages:: EVT_ZAP_ISNVOD);
CNeutrinoApp::getInstance()->adjustToChannelID(current_channel_id); CNeutrinoApp::getInstance()->adjustToChannelID(current_channel_id);
if ( g_InfoViewer->is_visible ) if (g_InfoViewer->is_visible)
g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR , 0 ); g_RCInput->postMsg(NeutrinoMessages::SHOW_INFOBAR, 0);
} }
if ((!is_video_started) && if ((!is_video_started) && (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED))
(g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED))
g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false);
} }
else else if ((msg == NeutrinoMessages::EVT_ZAP_SUB_COMPLETE) || (msg == NeutrinoMessages:: EVT_ZAP_SUB_FAILED))
if ((msg == NeutrinoMessages::EVT_ZAP_SUB_COMPLETE) || (msg == NeutrinoMessages:: EVT_ZAP_SUB_FAILED )) { {
//printf("[neutrino] EVT_ZAP_SUB current %llx data %llx\n", current_sub_channel_id, *(t_channel_id *)data); //printf("[neutrino] EVT_ZAP_SUB current %llx data %llx\n", current_sub_channel_id, *(t_channel_id *)data);
if ((*(t_channel_id *)data) != current_sub_channel_id) if ((*(t_channel_id *)data) != current_sub_channel_id)
{ {
current_sub_channel_id = *(t_channel_id *)data; current_sub_channel_id = *(t_channel_id *)data;
for(unsigned int i = 0; i < subChannels.size(); i++) for (unsigned int i = 0; i < subChannels.size(); i++)
{
if (subChannels[i].getChannelID() == (*(t_channel_id *)data)) if (subChannels[i].getChannelID() == (*(t_channel_id *)data))
{ {
selected_subchannel = i; selected_subchannel = i;
@@ -210,25 +214,25 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
} }
} }
} }
}
if ( msg == NeutrinoMessages::EVT_CURRENTEPG ) if (msg == NeutrinoMessages::EVT_CURRENTEPG)
{ {
if ((*(t_channel_id *)data) != (current_channel_id & 0xFFFFFFFFFFFFULL) && if ((*(t_channel_id *)data) != (current_channel_id & 0xFFFFFFFFFFFFULL) && (*(t_channel_id *)data) != (current_sub_channel_id & 0xFFFFFFFFFFFFULL))
(*(t_channel_id *)data) != (current_sub_channel_id & 0xFFFFFFFFFFFFULL))
return messages_return::handled; return messages_return::handled;
const CSectionsdClient::CurrentNextInfo info_CN = g_InfoViewer->getCurrentNextInfo(); const CSectionsdClient::CurrentNextInfo info_CN = g_InfoViewer->getCurrentNextInfo();
if ((info_CN.current_uniqueKey >> 16) == (current_channel_id & 0xFFFFFFFFFFFFULL) || (info_CN.current_uniqueKey >> 16) == (current_sub_channel_id & 0xFFFFFFFFFFFFULL)) if ((info_CN.current_uniqueKey >> 16) == (current_channel_id & 0xFFFFFFFFFFFFULL) || (info_CN.current_uniqueKey >> 16) == (current_sub_channel_id & 0xFFFFFFFFFFFFULL))
{ {
//CURRENT-EPG for current channel arrived!; // CURRENT-EPG for current channel arrived!;
CVFD::getInstance()->setEPGTitle(info_CN.current_name); CVFD::getInstance()->setEPGTitle(info_CN.current_name);
if (info_CN.current_uniqueKey != current_EPGid) if (info_CN.current_uniqueKey != current_EPGid)
{ {
if ( current_EPGid != 0 ) if (current_EPGid != 0)
{ {
// ist nur ein neues Programm, kein neuer Kanal // ist nur ein neues Programm, kein neuer Kanal
// PIDs neu holen // PIDs neu holen
g_Zapit->getPIDS( current_PIDs ); g_Zapit->getPIDS(current_PIDs);
// APID Bearbeitung neu anstossen // APID Bearbeitung neu anstossen
has_unresolved_ctags = true; has_unresolved_ctags = true;
// infobar indicate on epg change // infobar indicate on epg change
@@ -237,7 +241,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
current_EPGid = info_CN.current_uniqueKey; current_EPGid = info_CN.current_uniqueKey;
if ( has_unresolved_ctags ) if (has_unresolved_ctags)
processAPIDnames(); processAPIDnames();
if (selected_subchannel <= 0 && info_CN.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors) if (selected_subchannel <= 0 && info_CN.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors)
@@ -246,7 +250,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
getSubChannels(); getSubChannels();
} }
if ( needs_nvods ) if (needs_nvods)
getNVODs(); getNVODs();
} }
@@ -259,45 +263,46 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
} }
return messages_return::handled; return messages_return::handled;
} }
else if ( msg == NeutrinoMessages::EVT_NEXTEPG ) else if (msg == NeutrinoMessages::EVT_NEXTEPG)
{ {
if ((*(t_channel_id *)data) != current_channel_id) if ((*(t_channel_id *)data) != current_channel_id)
return messages_return::handled; return messages_return::handled;
#if 0 #if 0
const CSectionsdClient::CurrentNextInfo info_CN = g_InfoViewer->getCurrentNextInfo(); const CSectionsdClient::CurrentNextInfo info_CN = g_InfoViewer->getCurrentNextInfo();
if ((info_CN.next_uniqueKey >> 16) == (current_channel_id&0xFFFFFFFFFFFFULL) ) if ((info_CN.next_uniqueKey >> 16) == (current_channel_id & 0xFFFFFFFFFFFFULL))
{ {
// next-EPG for current channel arrived. no current-EPG?! // next-EPG for current channel arrived. no current-EPG?!
if (info_CN.next_uniqueKey != next_EPGid) if (info_CN.next_uniqueKey != next_EPGid)
next_EPGid = info_CN.next_uniqueKey; next_EPGid = info_CN.next_uniqueKey;
} }
#endif #endif
if ( !is_video_started ) if (!is_video_started)
g_RCInput->postMsg( NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false ); g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false);
return messages_return::handled; return messages_return::handled;
} }
else if (msg == NeutrinoMessages::EVT_NOEPG_YET) else if (msg == NeutrinoMessages::EVT_NOEPG_YET)
{ {
if ((*(t_channel_id *)data) == (current_channel_id&0xFFFFFFFFFFFFULL)) if ((*(t_channel_id *)data) == (current_channel_id & 0xFFFFFFFFFFFFULL))
{ {
if ( !is_video_started ) if (!is_video_started)
g_RCInput->postMsg( NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false ); g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false);
} }
return messages_return::handled; return messages_return::handled;
} }
else if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE)|| else if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_SUB_COMPLETE))
(msg == NeutrinoMessages::EVT_ZAP_SUB_COMPLETE)) { {
if ((*(t_channel_id *)data) == ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) ? current_channel_id : current_sub_channel_id)) if ((*(t_channel_id *)data) == ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) ? current_channel_id : current_sub_channel_id))
{ {
CVFD::getInstance()->showServicename(current_channel_name, current_channel_num); // UTF-8 CVFD::getInstance()->showServicename(current_channel_name, current_channel_num);
g_Zapit->getPIDS( current_PIDs ); g_Zapit->getPIDS(current_PIDs);
//tuxtxt
#if 1 #if 1
//tuxtxt
tuxtxt_stop(); tuxtxt_stop();
if(g_settings.cacheTXT) { if (g_settings.cacheTXT)
{
printf("TuxTXT pid: %X\n", current_PIDs.PIDs.vtxtpid); printf("TuxTXT pid: %X\n", current_PIDs.PIDs.vtxtpid);
if(current_PIDs.PIDs.vtxtpid != 0) if (current_PIDs.PIDs.vtxtpid != 0)
tuxtxt_start(current_PIDs.PIDs.vtxtpid); tuxtxt_start(current_PIDs.PIDs.vtxtpid);
} }
#endif #endif
@@ -309,7 +314,8 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
} }
return messages_return::handled; return messages_return::handled;
} }
else if (msg == NeutrinoMessages::EVT_PMT_CHANGED) { else if (msg == NeutrinoMessages::EVT_PMT_CHANGED)
{
g_Zapit->getPIDS(current_PIDs); g_Zapit->getPIDS(current_PIDs);
processAPIDnames(); processAPIDnames();
return messages_return::unhandled; return messages_return::unhandled;
@@ -320,65 +326,66 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
{ {
needs_nvods = true; needs_nvods = true;
CVFD::getInstance()->showServicename(std::string("[") + current_channel_name + ']', current_channel_num); // UTF-8 CVFD::getInstance()->showServicename(std::string("[") + current_channel_name + ']', current_channel_num); // UTF-8
if ( current_EPGid != 0) if (current_EPGid != 0)
{ {
getNVODs(); getNVODs();
if (subChannels.empty()) if (subChannels.empty())
g_Sectionsd->setServiceChanged( current_channel_id, false); g_Sectionsd->setServiceChanged(current_channel_id, false);
} }
else else
// EVENT anfordern! // EVENT anfordern!
g_Sectionsd->setServiceChanged( current_channel_id, false); g_Sectionsd->setServiceChanged(current_channel_id, false);
} }
return messages_return::handled; return messages_return::handled;
} }
#if 0 #if 0
else if ( ( msg == NeutrinoMessages::EVT_TIMER ) && ( data == current_programm_timer ) ) else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == current_programm_timer))
{ {
//printf("new program !\n"); //printf("new program !\n");
t_channel_id * p = new t_channel_id; t_channel_id *p = new t_channel_id;
*p = current_channel_id; *p = current_channel_id;
g_RCInput->postMsg(NeutrinoMessages::EVT_NEXTPROGRAM, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory g_RCInput->postMsg(NeutrinoMessages::EVT_NEXTPROGRAM, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory
return messages_return::handled; return messages_return::handled;
} }
#endif #endif
else if (msg == NeutrinoMessages::EVT_TUNE_COMPLETE) { else if (msg == NeutrinoMessages::EVT_TUNE_COMPLETE)
{
t_channel_id chid = *(t_channel_id *)data; t_channel_id chid = *(t_channel_id *)data;
printf("CRemoteControl::handleMsg: EVT_TUNE_COMPLETE (%016" PRIx64 ")\n", chid); printf("CRemoteControl::handleMsg: EVT_TUNE_COMPLETE (%016" PRIx64 ")\n", chid);
if(chid && !IS_WEBCHAN(chid)) if (chid && !IS_WEBCHAN(chid))
g_Sectionsd->setServiceChanged(chid, false); g_Sectionsd->setServiceChanged(chid, false);
return messages_return::handled; return messages_return::handled;
} }
//else if (msg == NeutrinoMessages::EVT_ZAP_FAILED || msg == NeutrinoMessages::EVT_ZAP_SUB_FAILED) //else if (msg == NeutrinoMessages::EVT_ZAP_FAILED || msg == NeutrinoMessages::EVT_ZAP_SUB_FAILED)
//return messages_return::handled; // return messages_return::handled;
else else
return messages_return::unhandled; return messages_return::unhandled;
} }
void CRemoteControl::getSubChannels() void CRemoteControl::getSubChannels()
{ {
//printf("[neutrino] getSubChannels, current_EPGid %llx\n", current_EPGid); //printf("[neutrino] getSubChannels, current_EPGid %llx\n", current_EPGid);
if ( subChannels.empty() ) if (subChannels.empty())
{ {
CSectionsdClient::LinkageDescriptorList linkedServices; CSectionsdClient::LinkageDescriptorList linkedServices;
if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices)) if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(current_EPGid, linkedServices))
{ {
if ( linkedServices.size()> 1 ) if (linkedServices.size() > 1)
{ {
are_subchannels = true; are_subchannels = true;
//printf("CRemoteControl::getSubChannels linkedServices.size %d\n", linkedServices.size()); //printf("CRemoteControl::getSubChannels linkedServices.size %d\n", linkedServices.size());
for (unsigned int i=0; i< linkedServices.size(); i++) for (unsigned int i = 0; i < linkedServices.size(); i++)
{ {
subChannels.push_back(CSubService( subChannels.push_back(CSubService(
linkedServices[i].originalNetworkId, linkedServices[i].originalNetworkId,
linkedServices[i].serviceId, linkedServices[i].serviceId,
linkedServices[i].transportStreamId, linkedServices[i].transportStreamId,
linkedServices[i].name)); linkedServices[i].name));
//printf("CRemoteControl::getSubChannels %s: %016llx\n", linkedServices[i].name.c_str(), subChannels[i].getChannelID()); //printf("CRemoteControl::getSubChannels %s: %016llx\n", linkedServices[i].name.c_str(), subChannels[i].getChannelID());
if ((subChannels[i].getChannelID()&0xFFFFFFFFFFFFULL) == (current_channel_id&0xFFFFFFFFFFFFULL)) if ((subChannels[i].getChannelID() & 0xFFFFFFFFFFFFULL) == (current_channel_id & 0xFFFFFFFFFFFFULL))
selected_subchannel = i; selected_subchannel = i;
} }
copySubChannelsToZapit(); copySubChannelsToZapit();
@@ -393,17 +400,17 @@ void CRemoteControl::getSubChannels()
void CRemoteControl::getNVODs() void CRemoteControl::getNVODs()
{ {
//printf("[neutrino] getNVODs, current_EPGid %llx\n", current_EPGid); //printf("[neutrino] getNVODs, current_EPGid %llx\n", current_EPGid);
if ( subChannels.empty() ) if (subChannels.empty())
{ {
CSectionsdClient::NVODTimesList NVODs; CSectionsdClient::NVODTimesList NVODs;
if (CEitManager::getInstance()->getNVODTimesServiceKey( current_channel_id, NVODs)) if (CEitManager::getInstance()->getNVODTimesServiceKey(current_channel_id, NVODs))
{ {
are_subchannels = false; are_subchannels = false;
//printf("CRemoteControl::getNVODs NVODs.size %d\n", NVODs.size()); //printf("CRemoteControl::getNVODs NVODs.size %d\n", NVODs.size());
for (unsigned int i=0; i< NVODs.size(); i++) for (unsigned int i = 0; i < NVODs.size(); i++)
{ {
if ( NVODs[i].zeit.dauer> 0 ) if (NVODs[i].zeit.dauer > 0)
{ {
CSubService newService( CSubService newService(
NVODs[i].original_network_id, NVODs[i].original_network_id,
@@ -412,13 +419,13 @@ void CRemoteControl::getNVODs()
NVODs[i].zeit.startzeit, NVODs[i].zeit.startzeit,
NVODs[i].zeit.dauer); NVODs[i].zeit.dauer);
CSubServiceListSorted::iterator e= subChannels.begin(); CSubServiceListSorted::iterator e = subChannels.begin();
for(; e!=subChannels.end(); ++e) for (; e != subChannels.end(); ++e)
{ {
if ( e->startzeit > newService.startzeit ) if (e->startzeit > newService.startzeit)
break; break;
} }
subChannels.insert( e, newService ); subChannels.insert(e, newService);
} }
} }
@@ -429,10 +436,10 @@ void CRemoteControl::getNVODs()
memcpy(p, &current_channel_id, sizeof(t_channel_id)); memcpy(p, &current_channel_id, sizeof(t_channel_id));
g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES, (neutrino_msg_data_t)p, false); // data is pointer to allocated memory g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES, (neutrino_msg_data_t)p, false); // data is pointer to allocated memory
if ( selected_subchannel == -1 ) if (selected_subchannel == -1)
{ {
// beim ersten Holen letzten NVOD-Kanal setzen! // beim ersten Holen letzten NVOD-Kanal setzen!
setSubChannel( subChannels.size()- 1 ); setSubChannel(subChannels.size() - 1);
} }
else else
{ {
@@ -445,7 +452,7 @@ void CRemoteControl::getNVODs()
void CRemoteControl::processAPIDnames() void CRemoteControl::processAPIDnames()
{ {
has_unresolved_ctags= false; has_unresolved_ctags = false;
has_ac3 = false; //use in infoviewer has_ac3 = false; //use in infoviewer
int pref_found = -1; int pref_found = -1;
int pref_ac3_found = -1; int pref_ac3_found = -1;
@@ -455,83 +462,91 @@ void CRemoteControl::processAPIDnames()
const char *desc; const char *desc;
char lang[4]; char lang[4];
if(g_settings.auto_lang && (current_PIDs.APIDs.size() > 1)) { if (g_settings.auto_lang && (current_PIDs.APIDs.size() > 1))
/* first we check prefs to find pid according to pref index */ {
for(int i = 0; i < 3; i++) { // first we check prefs to find pid according to pref index
for(int j = 0; j < (int) current_PIDs.APIDs.size(); j++) { for (int i = 0; i < 3; i++)
{
for (int j = 0; j < (int) current_PIDs.APIDs.size(); j++)
{
desc = current_PIDs.APIDs[j].desc; desc = current_PIDs.APIDs[j].desc;
// In some cases AAC is the only audio system used // In some cases AAC is the only audio system used
// so accept it here as a 'normal' sound track // so accept it here as a 'normal' sound track
if(strstr(desc, "(AAC)")) { if (strstr(desc, "(AAC)"))
{
strncpy(lang, desc, 3); strncpy(lang, desc, 3);
lang[3] = 0; lang[3] = 0;
desc = lang; desc = lang;
} }
/* processAPIDnames called 2 times, TODO find better way to detect second call */ // processAPIDnames called 2 times, TODO find better way to detect second call
if(strlen( desc ) != 3) if (strlen(desc) != 3)
continue; continue;
if(g_settings.pref_lang[i].empty()) if (g_settings.pref_lang[i].empty())
continue; continue;
std::string temp(g_settings.pref_lang[i]); std::string temp(g_settings.pref_lang[i]);
std::map<std::string, std::string>::const_iterator it; std::map<std::string, std::string>::const_iterator it;
for(it = iso639.begin(); it != iso639.end(); ++it) { for (it = iso639.begin(); it != iso639.end(); ++it)
if(temp == it->second && strcasecmp(desc, it->first.c_str()) == 0) { {
/* remember first pref found index and pid*/ if (temp == it->second && strcasecmp(desc, it->first.c_str()) == 0)
if(pref_found < 0) { {
// remember first pref found index and pid
if (pref_found < 0)
{
pref_found = j; pref_found = j;
pref_idx = i; pref_idx = i;
} }
if((current_PIDs.APIDs[j].is_ac3 || current_PIDs.APIDs[j].is_eac3) if ((current_PIDs.APIDs[j].is_ac3 || current_PIDs.APIDs[j].is_eac3)
&& g_settings.audio_DolbyDigital && (pref_ac3_found < 0)) { && g_settings.audio_DolbyDigital && (pref_ac3_found < 0))
{
pref_ac3_found = j; pref_ac3_found = j;
pref_ac3_idx = i; pref_ac3_idx = i;
} }
break; break;
} }
} }
} /* for all pids */ } // for all pids
} /*for all prefs*/ } // for all prefs
/* reset pref ac3, if it have lower priority */ // reset pref ac3, if it have lower priority
if((pref_idx >= 0) && (pref_idx < pref_ac3_idx)) if ((pref_idx >= 0) && (pref_idx < pref_ac3_idx))
pref_ac3_found = -1; pref_ac3_found = -1;
} }
#ifdef APID_DEBUG #ifdef APID_DEBUG
if (! current_PIDs.APIDs.empty()) if (! current_PIDs.APIDs.empty())
printf("Neutrino: "); printf("Neutrino: ");
#endif #endif
for(unsigned int count=0; count< current_PIDs.APIDs.size(); count++) for (unsigned int count = 0; count < current_PIDs.APIDs.size(); count++)
{ {
const char *iso = getISO639Description(current_PIDs.APIDs[count].desc); const char *iso = getISO639Description(current_PIDs.APIDs[count].desc);
#ifdef APID_DEBUG #ifdef APID_DEBUG
printf("apid=%04x/%s/%s ", current_PIDs.APIDs[count].pid, current_PIDs.APIDs[count].desc, iso); printf("apid=%04x/%s/%s ", current_PIDs.APIDs[count].pid, current_PIDs.APIDs[count].desc, iso);
#endif #endif
if ( current_PIDs.APIDs[count].component_tag != 0xFF ) if (current_PIDs.APIDs[count].component_tag != 0xFF)
{ {
has_unresolved_ctags= true; has_unresolved_ctags = true;
} }
std::string tmp_desc = current_PIDs.APIDs[count].desc; std::string tmp_desc = current_PIDs.APIDs[count].desc;
if ( tmp_desc.size() == 3 ) if (tmp_desc.size() == 3)
{ {
// unresolved language // unresolved language
tmp_desc = iso; tmp_desc = iso;
} }
if ( current_PIDs.APIDs[count].is_ac3 ) if (current_PIDs.APIDs[count].is_ac3)
{ {
if(!strstr(current_PIDs.APIDs[count].desc, " (AC3)")) if (!strstr(current_PIDs.APIDs[count].desc, " (AC3)"))
tmp_desc += " (AC3)"; tmp_desc += " (AC3)";
has_ac3 = true; has_ac3 = true;
if(g_settings.audio_DolbyDigital && (ac3_found < 0)) if (g_settings.audio_DolbyDigital && (ac3_found < 0))
ac3_found = count; ac3_found = count;
} }
else if ( current_PIDs.APIDs[count].is_eac3 ) else if (current_PIDs.APIDs[count].is_eac3)
{ {
if(!strstr(current_PIDs.APIDs[count].desc, " (EAC3)")) if (!strstr(current_PIDs.APIDs[count].desc, " (EAC3)"))
tmp_desc += " (EAC3)"; tmp_desc += " (EAC3)";
has_ac3 = true; has_ac3 = true;
if(g_settings.audio_DolbyDigital && (ac3_found < 0)) if (g_settings.audio_DolbyDigital && (ac3_found < 0))
ac3_found = count; ac3_found = count;
} }
else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)")) else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)"))
@@ -545,8 +560,9 @@ void CRemoteControl::processAPIDnames()
else if (current_PIDs.APIDs[count].is_lpcm && !strstr(current_PIDs.APIDs[count].desc, " (LPCM)")) else if (current_PIDs.APIDs[count].is_lpcm && !strstr(current_PIDs.APIDs[count].desc, " (LPCM)"))
tmp_desc += " (LPCM)"; tmp_desc += " (LPCM)";
if(!tmp_desc.empty()){ if (!tmp_desc.empty())
strncpy(current_PIDs.APIDs[count].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); {
strncpy(current_PIDs.APIDs[count].desc, tmp_desc.c_str(), DESC_MAX_LEN - 1);
} }
} }
@@ -554,29 +570,31 @@ void CRemoteControl::processAPIDnames()
if (! current_PIDs.APIDs.empty()) if (! current_PIDs.APIDs.empty())
printf("\n"); printf("\n");
#endif #endif
if ( has_unresolved_ctags ) if (has_unresolved_ctags)
{
if (current_EPGid == 0)
{ {
if ( current_EPGid == 0 ){
const CSectionsdClient::CurrentNextInfo info_CN = g_InfoViewer->getCurrentNextInfo(); const CSectionsdClient::CurrentNextInfo info_CN = g_InfoViewer->getCurrentNextInfo();
if ((info_CN.current_uniqueKey >> 16) == (current_channel_id & 0xFFFFFFFFFFFFULL)){ if ((info_CN.current_uniqueKey >> 16) == (current_channel_id & 0xFFFFFFFFFFFFULL))
{
current_EPGid = info_CN.current_uniqueKey; current_EPGid = info_CN.current_uniqueKey;
} }
} }
if ( current_EPGid != 0 ) if (current_EPGid != 0)
{ {
CSectionsdClient::ComponentTagList tags; CSectionsdClient::ComponentTagList tags;
if (CEitManager::getInstance()->getComponentTagsUniqueKey(current_EPGid, tags)) if (CEitManager::getInstance()->getComponentTagsUniqueKey(current_EPGid, tags))
{ {
has_unresolved_ctags = false; has_unresolved_ctags = false;
for (unsigned int i=0; i< tags.size(); i++) for (unsigned int i = 0; i < tags.size(); i++)
{ {
for (unsigned int j=0; j< current_PIDs.APIDs.size(); j++) for (unsigned int j = 0; j < current_PIDs.APIDs.size(); j++)
{ {
if ( current_PIDs.APIDs[j].component_tag == tags[i].componentTag ) if (current_PIDs.APIDs[j].component_tag == tags[i].componentTag)
{ {
// workaround for buggy ZDF ctags / or buggy sectionsd/drivers , who knows... // workaround for buggy ZDF ctags / or buggy sectionsd/drivers , who knows...
if(!tags[i].component.empty()) if (!tags[i].component.empty())
{ {
std::string tmp_desc2 = tags[i].component.c_str(); std::string tmp_desc2 = tags[i].component.c_str();
if (current_PIDs.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)")) if (current_PIDs.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)"))
@@ -586,8 +604,9 @@ void CRemoteControl::processAPIDnames()
else if (current_PIDs.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)")) else if (current_PIDs.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)"))
tmp_desc2 += " (EAC3)"; tmp_desc2 += " (EAC3)";
if(!tmp_desc2.empty()){ if (!tmp_desc2.empty())
strncpy(current_PIDs.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN -1); {
strncpy(current_PIDs.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN - 1);
} }
} }
current_PIDs.APIDs[j].component_tag = -1; current_PIDs.APIDs[j].component_tag = -1;
@@ -601,26 +620,30 @@ void CRemoteControl::processAPIDnames()
#ifdef APID_DEBUG #ifdef APID_DEBUG
printf("Neutrino: pref_found %d pref_ac3_found %d ac3_found %d\n", pref_found, pref_ac3_found, ac3_found); printf("Neutrino: pref_found %d pref_ac3_found %d ac3_found %d\n", pref_found, pref_ac3_found, ac3_found);
#endif #endif
if(pref_ac3_found >= 0) { if (pref_ac3_found >= 0)
{
#ifdef APID_DEBUG #ifdef APID_DEBUG
printf("Neutrino: set apid name= %s pid= %X\n", current_PIDs.APIDs[pref_ac3_found].desc, current_PIDs.APIDs[pref_ac3_found].pid); printf("Neutrino: set apid name= %s pid= %X\n", current_PIDs.APIDs[pref_ac3_found].desc, current_PIDs.APIDs[pref_ac3_found].pid);
#endif #endif
setAPID(pref_ac3_found); setAPID(pref_ac3_found);
} else if(pref_found >= 0) { }
else if (pref_found >= 0)
{
#ifdef APID_DEBUG #ifdef APID_DEBUG
printf("Neutrino: set apid name= %s pid= %X\n", current_PIDs.APIDs[pref_found].desc, current_PIDs.APIDs[pref_found].pid); printf("Neutrino: set apid name= %s pid= %X\n", current_PIDs.APIDs[pref_found].desc, current_PIDs.APIDs[pref_found].pid);
#endif #endif
setAPID(pref_found); setAPID(pref_found);
} }
else if(ac3_found >= 0) { else if (ac3_found >= 0)
{
#ifdef APID_DEBUG #ifdef APID_DEBUG
printf("Neutrino: set apid name= %s pid= %X\n", current_PIDs.APIDs[ac3_found].desc, current_PIDs.APIDs[ac3_found].pid); printf("Neutrino: set apid name= %s pid= %X\n", current_PIDs.APIDs[ac3_found].desc, current_PIDs.APIDs[ac3_found].pid);
#endif #endif
setAPID(ac3_found); setAPID(ac3_found);
} }
else if ( current_PIDs.PIDs.selected_apid >= current_PIDs.APIDs.size() ) else if (current_PIDs.PIDs.selected_apid >= current_PIDs.APIDs.size())
{ {
setAPID( 0 ); setAPID(0);
} }
char *p = new char[sizeof(t_channel_id)]; char *p = new char[sizeof(t_channel_id)];
@@ -628,7 +651,6 @@ void CRemoteControl::processAPIDnames()
g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOTAPIDS, (neutrino_msg_data_t)p, false); // data is pointer to allocated memory g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_GOTAPIDS, (neutrino_msg_data_t)p, false); // data is pointer to allocated memory
} }
void CRemoteControl::copySubChannelsToZapit(void) void CRemoteControl::copySubChannelsToZapit(void)
{ {
CZapitClient::subServiceList zapitList; CZapitClient::subServiceList zapitList;
@@ -639,25 +661,24 @@ void CRemoteControl::copySubChannelsToZapit(void)
g_Zapit->setSubServices(zapitList); g_Zapit->setSubServices(zapitList);
} }
void CRemoteControl::setAPID(uint32_t APID)
void CRemoteControl::setAPID( uint32_t APID )
{ {
if ((current_PIDs.PIDs.selected_apid == APID ) || if ((current_PIDs.PIDs.selected_apid == APID) ||
(APID >= current_PIDs.APIDs.size())) (APID >= current_PIDs.APIDs.size()))
return; return;
current_PIDs.PIDs.selected_apid = APID; current_PIDs.PIDs.selected_apid = APID;
g_Zapit->setAudioChannel( APID ); g_Zapit->setAudioChannel(APID);
} }
static const std::string empty_string; static const std::string empty_string;
const std::string & CRemoteControl::setSubChannel(const int numSub, const bool force_zap) const std::string &CRemoteControl::setSubChannel(const int numSub, const bool force_zap)
{ {
if ((numSub < 0) || (numSub >= (int)subChannels.size())) if ((numSub < 0) || (numSub >= (int)subChannels.size()))
return empty_string; return empty_string;
if ((selected_subchannel == numSub ) && (!force_zap)) if ((selected_subchannel == numSub) && (!force_zap))
return empty_string; return empty_string;
selected_subchannel = numSub; selected_subchannel = numSub;
@@ -666,22 +687,21 @@ const std::string & CRemoteControl::setSubChannel(const int numSub, const bool f
g_RCInput->killTimer(scrambled_timer); g_RCInput->killTimer(scrambled_timer);
CMoviePlayerGui::getInstance().stopPlayBack(); CMoviePlayerGui::getInstance().stopPlayBack();
g_Zapit->zapTo_subServiceID_NOWAIT( current_sub_channel_id ); g_Zapit->zapTo_subServiceID_NOWAIT(current_sub_channel_id);
return subChannels[numSub].subservice_name; return subChannels[numSub].subservice_name;
} }
const std::string & CRemoteControl::subChannelUp(void) const std::string &CRemoteControl::subChannelUp(void)
{ {
//return setSubChannel((subChannels.empty()) ? -1 : (int)((selected_subchannel + 1) % subChannels.size()));
// if there are any NVOD/subchannels switch these else switch audio channel (if any) // if there are any NVOD/subchannels switch these else switch audio channel (if any)
if ( !subChannels.empty() || !g_settings.audiochannel_up_down_enable) if (!subChannels.empty() || !g_settings.audiochannel_up_down_enable)
{ {
return setSubChannel( subChannels.empty() ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); return setSubChannel(subChannels.empty() ? -1 : (int)((selected_subchannel + 1) % subChannels.size()));
} }
else else
{ {
if ( !current_PIDs.APIDs.empty() ) if (!current_PIDs.APIDs.empty())
{ {
setAPID((current_PIDs.PIDs.selected_apid + 1) % current_PIDs.APIDs.size()); setAPID((current_PIDs.PIDs.selected_apid + 1) % current_PIDs.APIDs.size());
} }
@@ -689,17 +709,16 @@ const std::string & CRemoteControl::subChannelUp(void)
} }
} }
const std::string & CRemoteControl::subChannelDown(void) const std::string &CRemoteControl::subChannelDown(void)
{ {
//return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1));
// if there are any NVOD/subchannels switch these else switch audio channel (if any) // if there are any NVOD/subchannels switch these else switch audio channel (if any)
if ( !subChannels.empty() || !g_settings.audiochannel_up_down_enable) if (!subChannels.empty() || !g_settings.audiochannel_up_down_enable)
{ {
return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1)); return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1));
} }
else else
{ {
if ( !current_PIDs.APIDs.empty() ) if (!current_PIDs.APIDs.empty())
{ {
if (current_PIDs.PIDs.selected_apid <= 0) if (current_PIDs.PIDs.selected_apid <= 0)
setAPID(current_PIDs.APIDs.size() - 1); setAPID(current_PIDs.APIDs.size() - 1);
@@ -710,9 +729,9 @@ const std::string & CRemoteControl::subChannelDown(void)
} }
} }
void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::string & channame, int channum, const bool start_video) // UTF-8 void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::string &channame, int channum, const bool start_video)
{ {
//printf("zapTo_ChannelID: start_video: %d\n", start_video); //printf("zapTo_ChannelID: start_video: %d\n", start_video);
if (start_video) if (start_video)
startvideo(); startvideo();
else else
@@ -722,7 +741,7 @@ void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::s
current_EPGid = 0; current_EPGid = 0;
//next_EPGid = 0; //next_EPGid = 0;
memset(&current_PIDs.PIDs, 0, sizeof(current_PIDs.PIDs) ); memset(&current_PIDs.PIDs, 0, sizeof(current_PIDs.PIDs));
current_PIDs.APIDs.clear(); current_PIDs.APIDs.clear();
has_ac3 = false; has_ac3 = false;
@@ -733,7 +752,7 @@ void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::s
director_mode = 0; director_mode = 0;
uint64_t now = time_monotonic_ms(); uint64_t now = time_monotonic_ms();
if ( zap_completion_timeout < now ) if (zap_completion_timeout < now)
{ {
g_InfoViewer->chanready = 0; g_InfoViewer->chanready = 0;
@@ -750,7 +769,7 @@ void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::s
g_Zapit->zapTo_serviceID_NOWAIT(channel_id); g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
zap_completion_timeout = now + ZAP_GUARD_TIME; zap_completion_timeout = now + ZAP_GUARD_TIME;
// g_RCInput->killTimer( current_programm_timer ); //g_RCInput->killTimer( current_programm_timer );
} }
current_channel_id = channel_id; current_channel_id = channel_id;
current_channel_name = channame; current_channel_name = channame;
@@ -759,34 +778,34 @@ void CRemoteControl::zapTo_ChannelID(const t_channel_id channel_id, const std::s
void CRemoteControl::startvideo() void CRemoteControl::startvideo()
{ {
if ( !is_video_started ) if (!is_video_started)
{ {
is_video_started= true; is_video_started = true;
//g_Zapit->startPlayBack(); //g_Zapit->startPlayBack();
g_Zapit->unlockPlayBack(true); /* TODO: check if sendpmt=false is correct in stopvideo() */ g_Zapit->unlockPlayBack(true); // TODO: check if sendpmt=false is correct in stopvideo()
} }
} }
void CRemoteControl::stopvideo() void CRemoteControl::stopvideo()
{ {
if ( is_video_started ) if (is_video_started)
{ {
is_video_started= false; is_video_started = false;
/* we need stopPlayback to blank video, // we need stopPlayback to blank video,
lockPlayback prevents it from being inadvertently starting */
g_Zapit->stopPlayBack(false); g_Zapit->stopPlayBack(false);
// lockPlayback prevents it from being inadvertently starting
g_Zapit->lockPlayBack(false); g_Zapit->lockPlayBack(false);
} }
} }
void CRemoteControl::radioMode() void CRemoteControl::radioMode()
{ {
printf("CRemoteControl::radioMode\n"); printf("CRemoteControl::radioMode\n");
g_Zapit->setMode( CZapitClient::MODE_RADIO ); g_Zapit->setMode(CZapitClient::MODE_RADIO);
} }
void CRemoteControl::tvMode() void CRemoteControl::tvMode()
{ {
printf("CRemoteControl::tvMode\n"); printf("CRemoteControl::tvMode\n");
g_Zapit->setMode( CZapitClient::MODE_TV ); g_Zapit->setMode(CZapitClient::MODE_TV);
} }

View File

@@ -29,7 +29,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#ifndef __remotecontrol__ #ifndef __remotecontrol__
#define __remotecontrol__ #define __remotecontrol__
@@ -63,7 +62,7 @@ class CSubService
CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const std::string &asubservice_name); CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const std::string &asubservice_name);
CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const time_t astartzeit, const unsigned adauer); CSubService(const t_original_network_id, const t_service_id, const t_transport_stream_id, const time_t astartzeit, const unsigned adauer);
t_channel_id getChannelID (void) const; t_channel_id getChannelID(void) const;
inline const struct CZapitClient::commandAddSubServices getAsZapitSubService(void) const { return service; } inline const struct CZapitClient::commandAddSubServices getAsZapitSubService(void) const { return service; }
}; };
@@ -71,7 +70,7 @@ typedef std::vector<CSubService> CSubServiceListSorted;
class CRemoteControl class CRemoteControl
{ {
// unsigned int current_programm_timer; //unsigned int current_programm_timer;
uint64_t zap_completion_timeout; uint64_t zap_completion_timeout;
std::string current_channel_name; std::string current_channel_name;
int current_channel_num; int current_channel_num;
@@ -81,7 +80,7 @@ class CRemoteControl
void getSubChannels(); void getSubChannels();
void copySubChannelsToZapit(void); void copySubChannelsToZapit(void);
public: public:
t_channel_id current_channel_id; t_channel_id current_channel_id;
uint64_t current_EPGid; uint64_t current_EPGid;
//uint64_t next_EPGid; //uint64_t next_EPGid;
@@ -102,23 +101,22 @@ public:
bool is_video_started; bool is_video_started;
CRemoteControl(); CRemoteControl();
void zapTo_ChannelID(const t_channel_id channel_id, const std::string & channame, int channum, const bool start_video = true); // UTF-8 void zapTo_ChannelID(const t_channel_id channel_id, const std::string &channame, int channum, const bool start_video = true);
void startvideo(); void startvideo();
void stopvideo(); void stopvideo();
void queryAPIDs(); void queryAPIDs();
void setAPID(uint32_t APID); void setAPID(uint32_t APID);
void processAPIDnames(); void processAPIDnames();
const std::string & setSubChannel(const int numSub, const bool force_zap = false); const std::string &setSubChannel(const int numSub, const bool force_zap = false);
const std::string & subChannelUp(void); const std::string &subChannelUp(void);
const std::string & subChannelDown(void); const std::string &subChannelDown(void);
void radioMode(); void radioMode();
void tvMode(); void tvMode();
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
inline const std::string & getCurrentChannelName(void) const { return current_channel_name; } inline const std::string &getCurrentChannelName(void) const { return current_channel_name; }
inline const int & getCurrentChannelNumber(void) const { return current_channel_num; } inline const int &getCurrentChannelNumber(void) const { return current_channel_num; }
}; };
#endif #endif