Beispiel #1
0
void CBouquetManager::renumServices()
{
	if(remainChannels)
		deleteBouquet(remainChannels);
	remainChannels = NULL;
	
	makeRemainingChannelsBouquet();
}
void CBouquetManager::renumServices()
{
#if 0
	if(remainChannels)
		deleteBouquet(remainChannels);

	remainChannels = NULL;
#endif
	if(remainChannels) {
		remainChannels->tvChannels.clear();
		remainChannels->radioChannels.clear();
	}

	makeRemainingChannelsBouquet();
}
Beispiel #3
0
void CBouquetManager::saveBouquets(bool includeBouquetOthers)
{
	FILE *       bouq_fd;
	bool         write_names           = config.getBool("writeChannelsNames", true);
	unsigned int string_number         = (strcmp(getFrontendName(), "sat") == 0) ? 1 : 0;
	const char * channel_printf_string = write_names ? printf_string_with_names[string_number] : printf_string_without_names[string_number];
	
	if (includeBouquetOthers) makeRemainingChannelsBouquet();
	bouq_fd = fopen(BOUQUETS_XML, "w");
		
	fprintf(bouq_fd, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zapit>\n");

	for (BouquetList::const_iterator it = Bouquets.begin(); it != Bouquets.end(); ++it)
	{
		// TODO: use locales
		if (includeBouquetOthers || (((*it) != remainChannels) && (strncmp((*it)->Name.c_str(),"Neue Sender",11) != 0)))
		{
			//fprintf(bouq_fd, "\t<Bouquet name=\"%s\" hidden=\"%d\" locked=\"%d\">\n",
			fprintf(bouq_fd, "\t<Bouquet type=\"%01x\" bouquet_id=\"%04x\" name=\"%s\" hidden=\"%01x\" locked=\"%01x\">\n",
				(*it)->type,
				(*it)->bouquet_id,
				convert_UTF8_To_UTF8_XML((*it)->Name.c_str()).c_str(),
				(*it)->bHidden ? 1 : 0,
				(*it)->bLocked ? 1 : 0);

			writeChannelList(bouq_fd, (*it)->tvChannels   , write_names, channel_printf_string);
			writeChannelList(bouq_fd, (*it)->radioChannels, write_names, channel_printf_string);

			fprintf(bouq_fd, "\t</Bouquet>\n");
		}
	}
	
	fprintf(bouq_fd, "</zapit>\n");
	fclose(bouq_fd);

	chmod(BOUQUETS_XML, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
}