示例#1
0
static void funbuff_dowrite(t_funbuff *x, t_symbol *fn)
{
    t_binbuf *bb = binbuf_new();
    char buf[MAXPDSTRING];
    t_hammernode *np;
    binbuf_addv(bb, "s", atom_getsymbol(binbuf_getvec(x->x_ob.te_binbuf)));
    for (np = x->x_tree.t_first; np; np = np->n_next)
        binbuf_addv(bb, "if", np->n_key, HAMMERNODE_GETFLOAT(np));
    canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING);
    binbuf_write(bb, buf, "", 0);
    binbuf_free(bb);
}
static void qlist_write(t_qlist *x, t_symbol *filename, t_symbol *format)
{
    int cr = 0;
    char buf[MAXPDSTRING];
    canvas_makefilename(x->x_canvas, filename->s_name,
        buf, MAXPDSTRING);
    if (!strcmp(format->s_name, "cr"))
        cr = 1;
    else if (*format->s_name)
        pd_error(x, "qlist_read: unknown flag: %s", format->s_name);
    if (binbuf_write(x->x_binbuf, buf, "", cr))
            pd_error(x, "%s: write failed", filename->s_name);
}
示例#3
0
static void autoabstraction_createpatch(t_canvas*canvas, char*classname) {
  if(!s_state) {
    /* autoabstraction turned off... */
    return;
  }
  if(s_bb) {
    char name[MAXPDSTRING];
    snprintf(name, MAXPDSTRING, "%s.pd", classname);

    binbuf_write(s_bb, name, "", 0);
  } else {
    verbose(1, "[autoabstraction]: no template");
  }
}
示例#4
0
void breakpoints_write(t_breakpoints *x, t_symbol *s, int argc, t_atom *argv)
{
    t_binbuf *d = binbuf_new();
    if(d && argv && argc && atom_gettype(argv) == A_SYM)
    {
        breakpoints_save(x, d);
        if(binbuf_write(d, atom_getsym(argv)->s_name, "", 0))
        {
            object_error(x, "breakpoints : %s write failed", atom_getsym(argv)->s_name);
        }
    }
    if(d)
        binbuf_free(d);

}
示例#5
0
文件: xeq.c 项目: pure-data/xeq
static void xeq_write(t_xeq *x, t_symbol *filename,
		      t_symbol *format, t_symbol *tts)
{
    int cr = 0;
    char buf[MAXPDSTRING];
    if (!strcmp(format->s_name, "cr"))
    	cr = 1;
    else if (!strcmp(format->s_name, "mf"))
    {
	xeq_mfwrite(x, filename, tts);
	return;
    }
    else if (*format->s_name)
    	error("xeq_read: unknown flag: %s", format->s_name);
    canvas_makefilename(x->x_canvas, filename->s_name,
    	buf, MAXPDSTRING);
    if (binbuf_write(x->x_binbuf, buf, "", cr))
	error("%s: write failed", filename->s_name);
}
示例#6
0
static void preset_write(t_presetobj *x, t_symbol *s, int argc, t_atom *argv)
{
    t_binbuf *d = binbuf_new();
    if(d && argv && argc && atom_gettype(argv) == A_SYMBOL)
    {
        preset_save(x, d);
        if(binbuf_write(d, atom_getsymbol(argv)->s_name, (char *)"", 0))
        {
            pd_error(x, "preset : %s write failed", atom_getsymbol(argv)->s_name);
        }
        else
        {
            post("preset : write %s.", atom_getsymbol(argv)->s_name);
        }
    }
    if(d)
    {
        binbuf_free(d);
    }
}