api4 : use zapit.conf writeChannelsNames [0..3] to decide writing DVB-names in bouquets

Origin commit data
------------------
Branch: ni/coolstream
Commit: e01f57395b
Author: Janus <janus@debian>
Date: 2014-10-25 (Sat, 25 Oct 2014)


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

------------------
This commit was generated by Migit
This commit is contained in:
Janus
2014-10-25 08:46:32 -04:00
committed by [CST] Focus
parent 6c55ddfbe8
commit fe2c7e7375
2 changed files with 12 additions and 5 deletions

View File

@@ -21,8 +21,12 @@
*/
#include <cstdio>
#include <zapit/zapit.h>
#include <zapit/channel.h>
extern Zapit_config zapitCfg;
CZapitChannel::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 p_freq)
{
name = p_name;
@@ -347,6 +351,10 @@ void CZapitChannel::dumpServiceXml(FILE * fd, const char * action)
void CZapitChannel::dumpBouquetXml(FILE * fd, bool bUser)
{
// TODO : gui->manage configuration: write names (if nessessary or wanted)
// menu > installation > Servicesscan > under 'Bouquet' => "Write DVB-names in bouquets:" f.e. =>0=never 1=ubouquets 2=bouquets 3=both
int write_names = zapitCfg.writeChannelsNames;
fprintf(fd, "\t\t<S");
// references
@@ -356,15 +364,13 @@ void CZapitChannel::dumpBouquetXml(FILE * fd, bool bUser)
fprintf(fd, " u=\"%s\"",convert_UTF8_To_UTF8_XML(url.c_str()).c_str());
// service descriptors
// TODO : manage configuration: write names (if nessessary or wanted) f.e. =>0=never 1=ubouquets 2=bouquets 3=both
bool write_names = false; //config.getBool("writeChannelsNames", true);
if (bUser || !url.empty()) {
if (write_names)
if ((write_names==0x01) || (write_names==0x03))
fprintf(fd, " n=\"%s\"", convert_UTF8_To_UTF8_XML(name.c_str()).c_str());
//fprintf(fd, " n=\"%s\"", convert_UTF8_To_UTF8_XML(name.c_str()).c_str());
}
else {
if (write_names)
if ((write_names==0x02) || (write_names==0x03))
fprintf(fd, " n=\"%s\"", convert_UTF8_To_UTF8_XML(name.c_str()).c_str());
}

View File

@@ -172,7 +172,7 @@ void CZapit::SaveSettings(bool write)
configfile.setInt64("lastOTAChannel", last_channel_id);
}
configfile.setBool("writeChannelsNames", config.writeChannelsNames);
configfile.setInt32("writeChannelsNames", config.writeChannelsNames);
configfile.setBool("makeRemainingChannelsBouquet", config.makeRemainingChannelsBouquet);
configfile.setInt32("feTimeout", config.feTimeout);
@@ -299,6 +299,7 @@ void CZapit::LoadSettings()
voltageOff = configfile.getBool("voltageOff", 0);
#endif
config.saveLastChannel = configfile.getBool("saveLastChannel", true);
config.writeChannelsNames = configfile.getInt32("writeChannelsNames", 1);
/* FIXME Channels renum should be done for all channels atm. TODO*/
//config.makeRemainingChannelsBouquet = configfile.getBool("makeRemainingChannelsBouquet", 1);
config.makeRemainingChannelsBouquet = 1;