コード例 #1
0
ファイル: capture.c プロジェクト: ma4u/pd-macambira
void capture_setup(void)
{
    capture_class = class_new(gensym("capture"),
                              (t_newmethod)capture_new,
                              (t_method)capture_free,
                              sizeof(t_capture), 0, A_DEFFLOAT, A_DEFSYM, 0);
    class_addfloat(capture_class, capture_float);
    class_addlist(capture_class, capture_list);
    class_addmethod(capture_class, (t_method)capture_clear,
                    gensym("clear"), 0);
    class_addmethod(capture_class, (t_method)capture_count,
                    gensym("count"), 0);
    class_addmethod(capture_class, (t_method)capture_dump,
                    gensym("dump"), 0);
    class_addmethod(capture_class, (t_method)capture_write,
                    gensym("write"), A_DEFSYM, 0);
    class_addmethod(capture_class, (t_method)capture_open,
                    gensym("open"), 0);
    class_addmethod(capture_class, (t_method)capture_wclose,
                    gensym("wclose"), 0);
    class_addmethod(capture_class, (t_method)capture_click,
                    gensym("click"),
                    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
    hammerfile_setup(capture_class, 0);
}
コード例 #2
0
ファイル: prob.c プロジェクト: psoamusic/PourOver
void prob_setup(void)
{
    prob_class = class_new(gensym("prob"),
			   (t_newmethod)prob_new,
			   (t_method)prob_free,
			   sizeof(t_prob), 0, 0);
    class_addbang(prob_class, prob_bang);
    class_addfloat(prob_class, prob_float);
    class_addlist(prob_class, prob_list);
    class_addmethod(prob_class, (t_method)prob_embed,
		    gensym("embed"), A_FLOAT, 0);
    class_addmethod(prob_class, (t_method)prob_reset,
		    gensym("reset"), A_FLOAT, 0);
    class_addmethod(prob_class, (t_method)prob_clear,
		    gensym("clear"), 0);
    class_addmethod(prob_class, (t_method)prob_dump,
		    gensym("dump"), 0);
    /* CHECKED: doesn't understand "seed" */
    class_addmethod(prob_class, (t_method)prob__silent,
		    gensym("_silent"), 0);
    class_addmethod(prob_class, (t_method)prob_click,
		    gensym("click"),
		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
    hammerfile_setup(prob_class, 1);
    fitter_setup(prob_class, 0);
}
コード例 #3
0
ファイル: funbuff.c プロジェクト: ma4u/pd-macambira
void funbuff_setup(void)
{
    funbuff_class = class_new(gensym("funbuff"),
                              (t_newmethod)funbuff_new,
                              (t_method)funbuff_free,
                              sizeof(t_funbuff), 0, A_DEFSYM, 0);
    class_addbang(funbuff_class, funbuff_bang);
    class_addfloat(funbuff_class, funbuff_float);
    class_addmethod(funbuff_class, (t_method)funbuff_ft1,
                    gensym("ft1"), A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_clear,
                    gensym("clear"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_goto,
                    gensym("goto"), A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_min,
                    gensym("min"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_max,
                    gensym("max"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_next,
                    gensym("next"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_embed,
                    gensym("embed"), A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_read,
                    gensym("read"), A_DEFSYM, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_write,
                    gensym("write"), A_DEFSYM, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_set,
                    gensym("set"), A_GIMME, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_delete,
                    gensym("delete"), A_GIMME, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_find,
                    gensym("find"), A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_dump,
                    gensym("dump"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_interp,
                    gensym("interp"), A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_interptab,
                    gensym("interptab"), A_FLOAT, A_SYMBOL, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_reduce,
                    gensym("reduce"), A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_select,
                    gensym("select"), A_FLOAT, A_FLOAT, 0);
    class_addmethod(funbuff_class, (t_method)funbuff_cut,
                    gensym("cut"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_copy,
                    gensym("copy"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_paste,
                    gensym("paste"), 0);
    class_addmethod(funbuff_class, (t_method)funbuff_undo,
                    gensym("undo"), 0);
#ifdef HAMMERTREE_DEBUG
    class_addmethod(funbuff_class, (t_method)funbuff_debug,
                    gensym("debug"), A_DEFFLOAT, 0);
#endif
    hammerfile_setup(funbuff_class, 1);
}
コード例 #4
0
void plustot_env_setup(void)
{
    plustot_env_class = class_new(gensym("+env"), 0,
				  (t_method)plustot_env_free,
				  sizeof(t_plustot_env), 0, 0);
    plusclass_inherit(plustot_env_class, gensym("+env"));
    class_addbang(plustot_env_class, plustot_env_bang);
    class_addmethod(plustot_env_class, (t_method)plustot_env_source,
		    gensym("source"), A_DEFSYM, 0);
    hammerfile_setup(plustot_env_class, 0);
}
コード例 #5
0
ファイル: capture.c プロジェクト: EQ4/PdPulpito
void capture_tilde_setup(void)
{
    capture_class = class_new(gensym("capture~"),
			      (t_newmethod)capture_new,
			      (t_method)capture_free,
			      sizeof(t_capture), 0, A_GIMME, 0);
    sic_setup(capture_class, capture_dsp, SIC_FLOATTOSIGNAL);
    class_addmethod(capture_class, (t_method)capture_clear,
		    gensym("clear"), 0);
    class_addmethod(capture_class, (t_method)capture_write,
		    gensym("write"), A_DEFSYM, 0);
    class_addmethod(capture_class, (t_method)capture_open,
		    gensym("open"), 0);
    class_addmethod(capture_class, (t_method)capture_wclose,
		    gensym("wclose"), 0);
    class_addmethod(capture_class, (t_method)capture_click,
		    gensym("click"),
		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
    hammerfile_setup(capture_class, 0);
}
コード例 #6
0
ファイル: hammer.c プロジェクト: psoamusic/PourOver
void hammer_setup(void)
{
    if (canvas_getcurrent())
    {
	/* Loading the library by object creation is banned, because of a danger
	   of having some of the classes already loaded. LATER rethink. */
	loud_error(0, "apparently an attempt to create a 'hammer' object");
	loud_errand(0, "without having hammer library preloaded");
	return;
    }
    if (zgetfn(&pd_objectmaker, gensym("hammer")))
    {
	loud_error(0, "hammer is already loaded");
	return;
    }
    if (!zgetfn(&pd_objectmaker, gensym("cyclone")))
	post("this is hammer %s, %s %s build",
	     CYCLONE_VERSION, loud_ordinal(CYCLONE_BUILD), CYCLONE_RELEASE);
    hammer_class = class_new(gensym("hammer"),
			     (t_newmethod)hammer_new,
			     (t_method)hammer_free,
			     sizeof(t_hammer), 0, 0);
    class_addbang(hammer_class, hammer_bang);
    class_addmethod(hammer_class, (t_method)hammer_cd,
		    gensym("cd"), A_DEFSYM, 0);
    class_addmethod(hammer_class, (t_method)hammer_pwd,
		    gensym("pwd"), A_SYMBOL, 0);
    class_addmethod(hammer_class, (t_method)hammer_import,
		    gensym("import"), A_DEFSYM, 0);
    class_addmethod(hammer_class, (t_method)hammer_click,
		    gensym("click"),
		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
    hammerfile_setup(hammer_class, 0);
    hammer_firstndx = fragile_class_count();
    allhammers_setup();
    hammer_lastndx = fragile_class_count() - 1;
}
コード例 #7
0
ファイル: mtr.c プロジェクト: EQ4/PdPulpito
void mtr_setup(void)
{
    mtrack_class = class_new(gensym("_mtrack"), 0, 0,
			     sizeof(t_mtrack), CLASS_PD | CLASS_NOINLET, 0);
    class_addfloat(mtrack_class, mtrack_float);
    class_addsymbol(mtrack_class, mtrack_symbol);
    class_addlist(mtrack_class, mtrack_list);
    class_addmethod(mtrack_class, (t_method)mtrack_record,
		    gensym("record"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_play,
		    gensym("play"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_stop,
		    gensym("stop"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_next,
		    gensym("next"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_rewind,
		    gensym("rewind"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_mute,
		    gensym("mute"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_unmute,
		    gensym("unmute"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_clear,
		    gensym("clear"), 0);
    class_addmethod(mtrack_class, (t_method)mtrack_delay,
		    gensym("delay"), A_FLOAT, 0);
    class_addmethod(mtrack_class, (t_method)mtrack_first,
		    gensym("first"), A_FLOAT, 0);
    class_addmethod(mtrack_class, (t_method)mtrack_read,
		    gensym("read"), A_DEFSYM, 0);
    class_addmethod(mtrack_class, (t_method)mtrack_write,
		    gensym("write"), A_DEFSYM, 0);
    class_addmethod(mtrack_class, (t_method)mtrack_tempo,
		    gensym("tempo"), A_FLOAT, 0);

    mtr_class = class_new(gensym("mtr"),
			  (t_newmethod)mtr_new,
			  (t_method)mtr_free,
			  sizeof(t_mtr), 0,
			  A_DEFFLOAT, 0);
    class_addmethod(mtr_class, (t_method)mtr_record,
		    gensym("record"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_play,
		    gensym("play"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_stop,
		    gensym("stop"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_next,
		    gensym("next"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_rewind,
		    gensym("rewind"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_mute,
		    gensym("mute"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_unmute,
		    gensym("unmute"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_clear,
		    gensym("clear"), A_GIMME, 0);
    class_addmethod(mtr_class, (t_method)mtr_delay,
		    gensym("delay"), A_FLOAT, 0);
    class_addmethod(mtr_class, (t_method)mtr_first,
		    gensym("first"), A_FLOAT, 0);
    class_addmethod(mtr_class, (t_method)mtr_read,
		    gensym("read"), A_DEFSYM, 0);
    class_addmethod(mtr_class, (t_method)mtr_write,
		    gensym("write"), A_DEFSYM, 0);
    class_addmethod(mtr_class, (t_method)mtr_tempo,
		    gensym("tempo"), A_FLOAT, 0);
#ifdef MTR_DEBUG
    class_addmethod(mtr_class, (t_method)mtr_debug,
		    gensym("debug"), 0);
#endif
    hammerfile_setup(mtr_class, 0);
    fitter_setup(mtr_class, 0);
}
コード例 #8
0
ファイル: maxmode.c プロジェクト: Git689/libpd-cyclone-ios
void maxmode_setup(void)
{
    int dresult = LOADER_OK;
    if (zgetfn(&pd_objectmaker, gensym("maxmode")))
    {
	loud_error(0, "maxmode is already loaded");
	return;
    }
    maxmode_class = class_new(gensym("maxmode"),
			      (t_newmethod)maxmode_new,
			      (t_method)maxmode_free,
			      sizeof(t_maxmode), 0, A_GIMME, 0);
    class_addbang(maxmode_class, maxmode_bang);
    class_addmethod(maxmode_class, (t_method)maxmode_set,
		    gensym("set"), A_DEFSYM, 0);
    class_addmethod(maxmode_class, (t_method)maxmode_get,
		    gensym("get"), 0);
    class_addmethod(maxmode_class, (t_method)maxmode_cd,
		    gensym("cd"), A_DEFSYM, 0);
    class_addmethod(maxmode_class, (t_method)maxmode_pwd,
		    gensym("pwd"), A_SYMBOL, 0);
    class_addmethod(maxmode_class, (t_method)maxmode_import,
		    gensym("import"), A_DEFSYM, 0);
    class_addmethod(maxmode_class, (t_method)maxmode_click,
		    gensym("click"),
		    A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
    hammerfile_setup(maxmode_class, 0);

    if (canvas_getcurrent())
    {
	fitter_setup(0, 0);
	if (!zgetfn(&pd_objectmaker, gensym("cyclone")))
	    /* cycloneless maxmode -- banner is posted by the oldest
	       maxmode object with no creation arguments */
	    maxmode_withbanner = 1;
    }
    else
    {
	fittermax_set();
	if (zgetfn(&pd_objectmaker, gensym("cyclone")))
	    loud_warning(0, "maxmode", "cyclone is already loaded");
	else
	{
	    if (unstable_load_lib("", "cyclone") == LOADER_NOFILE)
		loud_error(0, "cyclone library is missing");
	    else if (!zgetfn(&pd_objectmaker, gensym("cyclone")))
		loud_error(0, "miXed/Pd version mismatch");
	}
    }
    maxmode_dummiesndx = fragile_class_count();
    if (zgetfn(&pd_objectmaker, gensym("dummies")))
	loud_warning(0, "maxmode", "dummies are already loaded");
    else
	dresult = unstable_load_lib("", "dummies");
    maxmode_lastndx = fragile_class_count() - 1;
    if (dresult == LOADER_NOFILE)
	loud_warning(0, "maxmode", "dummies not found");
    else
    {
	t_symbol *s = gensym("_cc.dummies");
	if (s->s_thing && !s->s_next
	    && !strcmp(class_getname(*s->s_thing), "_cc.dummies"))
	    maxmode_dproxy = s->s_thing;
	else
	    loudbug_bug("maxmode_setup");  /* FIXME */
    }
}