Esempio n. 1
0
void PlaylistModel::open(const QString &file,
                         bool refresh,
                         const File::Type &type,
                         const CSVInfo &info)
{
    if (!refresh)
        clear();

    _fileName = file;

    QList<Channel *> channels;
    switch (type)
    {
    case File::CSV:
        _open->openCSVFile(file, info);
        break;
    case File::GoTV:
        _open->openGoTVFile(file);
        break;
    case File::JS:
        _open->openJsFile(file);
        break;
    case File::M3U:
        _open->openM3UFile(file);
        break;
    default:
        break;
    }

    channels = _open->list();
    _name = _open->name();

    foreach (Channel *channel, channels) {
        processChannel(channel);
    }
Esempio n. 2
0
Profile *Profiles::processProfile(Profile *parent, pugi::xml_node config)
{
	std::string name = config.attribute("name").value();

	if (name.empty()) {
		throw std::runtime_error("Missing profile name");
	}
	
	/* Create new profile */
	Profile *profile = new Profile(name);
	profile->setParent(parent);
	profile->setNode(config);

	pugi::xpath_node_set profiles = config.select_nodes("profile");
	pugi::xpath_node_set channels = config.select_nodes("channel");

	for (auto& node: channels) {
		Channel *channel = processChannel(profile, node.node());
		profile->addChannel(channel, true);
	}

	for (auto& node: profiles) {
		Profile *child = processProfile(profile, node.node());
		profile->addProfile(child, true);
	}

	return profile;
}
Esempio n. 3
0
void CSVHandler::processList()
{
    foreach (const QString &line, _csvLineList) {
        if (!(_header && (line == _csvLineList.first())))
            processChannel(line.split(_separator));
    }
}
Esempio n. 4
0
void TextRemover::process(A4MemoryBank* src)
{
	processChannel(src->redChannelResized, src->redChannelResized->widthStep);
	processChannel(src->greenChannelResized, src->greenChannelResized->widthStep);
	processChannel(src->blueChannelResized, src->blueChannelResized->widthStep);
}