mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
api4 : use zapit.conf writeChannelsNames [0..3] to decide writing DVB-names in bouquets
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user