new flag to mark channel added to some bouquet

* new helpers to dump service description to services or bouquets xml files.



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


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

Origin message was:
------------------
* new flag to mark channel added to some bouquet
* new helpers to dump service description to services or bouquets xml files.



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


------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2011-09-01 12:06:08 +00:00
parent e203c16748
commit 3fc2d5eaaf
2 changed files with 60 additions and 15 deletions

View File

@@ -27,7 +27,7 @@
#include <string>
#include <inttypes.h>
#include <cstdlib>
#include <xmltree/xmlinterface.h>
#include <sectionsdclient/sectionsdclient.h>
/* zapit */
@@ -117,6 +117,7 @@ class CZapitChannel
/* pids of this channel */
std::vector <CZapitAbsSub* > channelSubs;
std::vector <CZapitAudioChannel *> audioChannels;
unsigned short pcrPid;
unsigned short pmtPid;
unsigned short teletextPid;
@@ -125,7 +126,7 @@ class CZapitChannel
unsigned short privatePid;
/* set true when pids are set up */
bool pidsFlag;
bool pidsFlag;
/* last selected audio channel */
unsigned char currentAudioChannel;
@@ -149,21 +150,23 @@ class CZapitChannel
int pmtLen;
/* from neutrino CChannel class */
uint64_t last_unlocked_EPGid;
time_t last_unlocked_time;
uint64_t last_unlocked_EPGid;
time_t last_unlocked_time;
std::string ttx_language_code;
std::string ttx_language_code;
friend class CChannelList;
public:
bool bAlwaysLocked;
bool bAlwaysLocked;
int number;
CChannelEvent currentEvent,nextEvent;
int type;
int number;
CChannelEvent currentEvent,nextEvent;
int type;
t_channel_id channel_id;
unsigned char scrambled;
char * pname;
unsigned char scrambled;
char * pname;
bool has_bouquet;
/* constructor, desctructor */
CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t freq);
@@ -226,6 +229,9 @@ class CZapitChannel
CZapitAbsSub* getChannelSub(int index = -1);
int getChannelSubIndex(void);
void setChannelSub(int subIdx);
void dumpServiceXml(FILE * fd, const char * action = NULL);
void dumpBouquetXml(FILE * fd);
};
#endif /* __zapit_channel_h__ */

View File

@@ -45,6 +45,7 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_t
ttx_language_code = "";
last_unlocked_EPGid = 0;
last_unlocked_time = 0;
has_bouquet = false;
//printf("NEW CHANNEL %s %x\n", name.c_str(), (int) this);
}
@@ -196,8 +197,6 @@ printf("[subtitle] TTXSub: PID=0x%04x, lang=%3.3s, page=%1X%02X\n", pid, langCod
tmpSub->teletext_magazine_number=mag_nr;
tmpSub->teletext_page_number=page_number;
tmpSub->hearingImpaired=impaired;
//setPidsUpdated();
}
void CZapitChannel::addDVBSubtitle(const unsigned int pid, const std::string langCode, const unsigned char subtitling_type, const unsigned short composition_page_id, const unsigned short ancillary_page_id)
@@ -236,8 +235,6 @@ printf("[subtitles] DVBSub: PID=0x%04x, lang=%3.3s, cpageid=%04x, apageid=%04x\n
tmpSub->subtitling_type=subtitling_type;
tmpSub->composition_page_id=composition_page_id;
tmpSub->ancillary_page_id=ancillary_page_id;
//setPidsUpdated();
}
CZapitAbsSub* CZapitChannel::getChannelSub(int index)
@@ -280,3 +277,45 @@ void CZapitChannel::setRawPmt(unsigned char * pmt, int len)
rawPmt = pmt;
pmtLen = len;
}
void CZapitChannel::dumpServiceXml(FILE * fd, const char * action)
{
if(action) {
fprintf(fd, "\t\t\t<S action=\"%s\" i=\"%04x\" n=\"%s\" t=\"%x\" s=\"%d\"/>\n", action,
getServiceId(), convert_UTF8_To_UTF8_XML(getName().c_str()).c_str(),
getServiceType(), scrambled);
} else if(getPidsFlag()) {
fprintf(fd, "\t\t\t<S i=\"%04x\" n=\"%s\" v=\"%x\" a=\"%x\" p=\"%x\" pmt=\"%x\" tx=\"%x\" t=\"%x\" vt=\"%d\" s=\"%d\"/>\n",
getServiceId(), convert_UTF8_To_UTF8_XML(getName().c_str()).c_str(),
getVideoPid(), getPreAudioPid(),
getPcrPid(), getPmtPid(), getTeletextPid(),
getServiceType(true), type, scrambled);
} else {
fprintf(fd, "\t\t\t<S i=\"%04x\" n=\"%s\" t=\"%x\" s=\"%d\"/>\n",
getServiceId(), convert_UTF8_To_UTF8_XML(getName().c_str()).c_str(),
getServiceType(true), scrambled);
}
}
void CZapitChannel::dumpBouquetXml(FILE * fd)
{
//bool write_names = bUser ? true : config.getBool("writeChannelsNames", true);
bool write_names = 1;
if(write_names) {
fprintf(fd, "\t\t<S i=\"%x\" n=\"%s\" t=\"%x\" on=\"%x\" s=\"%hd\" frq=\"%hd\"/>\n",
getServiceId(), convert_UTF8_To_UTF8_XML(getName().c_str()).c_str(),
getTransportStreamId(),
getOriginalNetworkId(),
getSatellitePosition(),
getFreqId());
} else {
fprintf(fd, "\t\t<S i=\"%x\" t=\"%x\" on=\"%x\" s=\"%hd\" frq=\"%hd\"/>\n",
getServiceId(),
getTransportStreamId(),
getOriginalNetworkId(),
getSatellitePosition(),
getFreqId());
}
}