Ejemplo n.º 1
0
void MainSynthWindow::populate (void)
{
    /* populate notebook */
    gthPatchManager *patchMgr = gthPatchManager::instance();
    int numPatches = patchMgr->numPatches();

    for (int i = 0; i < numPatches; i++)
    {
        gthPatchManager::PatchFile *patch = patchMgr->getPatch(i);
        std::ostringstream chanStr;
        string tabName;
        
        chanStr << i + 1 << ": ";
        
        if (patch == NULL)
        {
            tabName = chanStr.str() + "(Untitled)";
            append_tab (tabName, i, false);
            continue;
        }

        if (patch->filename.length() > 0)
        {
            /* display channel # */
            tabName = chanStr.str() + patch->filename;
        }
        else
        {
            tabName = chanStr.str() + "(Untitled)";
        }

        append_tab (tabName, i, true);
    }

}
Ejemplo n.º 2
0
static char	*get_word_and_append_tab(char **tab, char *buf, char c)
{
	size_t	len;
	size_t	i;
	char	*word;

	len = 0;
	i = 0;
	while (buf[len] && buf[len] != c)
		len++;
	word = ft_strnew(len);
	if (word)
	{
		while (i < len)
		{
			word[i] = buf[i];
			i++;
		}
		word[i] = '\0';
		append_tab(tab, word);
	}
	return (NULL);
}