diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index b94a5b1c6..67fab006c 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -27,7 +27,7 @@ #include #include #include - +#include #include /* zapit */ @@ -117,6 +117,7 @@ class CZapitChannel /* pids of this channel */ std::vector channelSubs; std::vector 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__ */ diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp index 035f315d7..db27236ba 100644 --- a/src/zapit/src/channel.cpp +++ b/src/zapit/src/channel.cpp @@ -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\n", action, + getServiceId(), convert_UTF8_To_UTF8_XML(getName().c_str()).c_str(), + getServiceType(), scrambled); + + } else if(getPidsFlag()) { + fprintf(fd, "\t\t\t\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\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\n", + getServiceId(), convert_UTF8_To_UTF8_XML(getName().c_str()).c_str(), + getTransportStreamId(), + getOriginalNetworkId(), + getSatellitePosition(), + getFreqId()); + } else { + fprintf(fd, "\t\t\n", + getServiceId(), + getTransportStreamId(), + getOriginalNetworkId(), + getSatellitePosition(), + getFreqId()); + } +}