int main (void)
{
    this_class = class_new("ircropfade~",
                           (method) ircropfade_new,
                           (method)ircropfade_free,
                           sizeof(t_ircropfade),
                           0L,
                           0);

    class_addmethod(this_class, (method)ircropfade_process, "process", A_GIMME, 0L);

    class_addmethod(this_class, (method)ircropfade_assist, "assist", A_CANT, 0L);

    CLASS_STICKY_ATTR(this_class, "category", 0L, "Buffer");

    CLASS_ATTR_ATOM_LONG(this_class, "writechan", 0L, t_ircropfade, write_chan);
    CLASS_ATTR_FILTER_MIN(this_class, "writechan", 1);
    CLASS_ATTR_LABEL(this_class,"writechan", 0L, "Buffer Write Channel");

    CLASS_ATTR_ATOM_LONG(this_class, "resize", 0L, t_ircropfade, resize);
    CLASS_ATTR_STYLE_LABEL(this_class,"resize", 0L, "onoff","Buffer Resize");

    CLASS_ATTR_ATOM_LONG(this_class, "readchan", 0, t_ircropfade, read_chan);
    CLASS_ATTR_FILTER_MIN(this_class, "readchan", 1);
    CLASS_ATTR_LABEL(this_class,"readchan", 0, "Buffer Read Channel");

    CLASS_STICKY_ATTR_CLEAR(this_class, "category");

    class_register(CLASS_BOX, this_class);

    buffer_access_init();

    return 0;
}
Esempio n. 2
0
void ext_main(void *r) {
	// Initialize the class - first argument: VERY important to match the name of the object in the procect settings!!!
	cmbuffercloud_class = class_new("cm.buffercloud~", (method)cmbuffercloud_new, (method)cmbuffercloud_free, sizeof(t_cmbuffercloud), 0, A_GIMME, 0);
	
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_dsp64, 		"dsp64", 	A_CANT, 0);  // Bind the 64 bit dsp method
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_assist, 		"assist", 	A_CANT, 0); // Bind the assist message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_float, 		"float", 	A_FLOAT, 0); // Bind the float message (allowing float input)
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_dblclick, 	"dblclick",	A_CANT, 0); // Bind the double click message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_notify, 		"notify", 	A_CANT, 0); // Bind the notify message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_set, 		"set", 		A_GIMME, 0); // Bind the set message for user buffer set
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_limit, 		"limit", 	A_GIMME, 0); // Bind the limit message
	class_addmethod(cmbuffercloud_class, (method)cmbuffercloud_bang,		"bang",		0);
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "stereo", 0, t_cmbuffercloud, attr_stereo);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "stereo", (method)NULL, (method)cmbuffercloud_stereo_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "stereo", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "stereo", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "stereo", 0, "onoff", "Multichannel playback");
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "w_interp", 0, t_cmbuffercloud, attr_winterp);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "w_interp", (method)NULL, (method)cmbuffercloud_winterp_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "w_interp", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "w_interp", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "w_interp", 0, "onoff", "Window interpolation on/off");
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "s_interp", 0, t_cmbuffercloud, attr_sinterp);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "s_interp", (method)NULL, (method)cmbuffercloud_sinterp_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "s_interp", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "s_interp", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "s_interp", 0, "onoff", "Sample interpolation on/off");
	
	CLASS_ATTR_ATOM_LONG(cmbuffercloud_class, "zero", 0, t_cmbuffercloud, attr_zero);
	CLASS_ATTR_ACCESSORS(cmbuffercloud_class, "zero", (method)NULL, (method)cmbuffercloud_zero_set);
	CLASS_ATTR_BASIC(cmbuffercloud_class, "zero", 0);
	CLASS_ATTR_SAVE(cmbuffercloud_class, "zero", 0);
	CLASS_ATTR_STYLE_LABEL(cmbuffercloud_class, "zero", 0, "onoff", "Zero crossing trigger mode on/off");
	
	CLASS_ATTR_ORDER(cmbuffercloud_class, "stereo", 0, "1");
	CLASS_ATTR_ORDER(cmbuffercloud_class, "w_interp", 0, "2");
	CLASS_ATTR_ORDER(cmbuffercloud_class, "s_interp", 0, "3");
	CLASS_ATTR_ORDER(cmbuffercloud_class, "zero", 0, "4");
	
	class_dspinit(cmbuffercloud_class); // Add standard Max/MSP methods to your class
	class_register(CLASS_BOX, cmbuffercloud_class); // Register the class with Max
	ps_buffer_modified = gensym("buffer_modified"); // assign the buffer modified message to the static pointer created above
	ps_stereo = gensym("stereo");
}
Esempio n. 3
0
int C74_EXPORT main()
{
	t_class *c;

	c = class_new("hoa.scope~", (method)scope_new, (method)scope_free, (short)sizeof(t_scope), 0L, A_GIMME, 0);

	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	class_dspinitjbox(c);
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);

	class_addmethod(c, (method)scope_dsp,			"dsp",			A_CANT, 0);
	class_addmethod(c, (method)scope_dsp64,			"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)scope_assist,		"assist",		A_CANT,	0);
	class_addmethod(c, (method)scope_paint,			"paint",		A_CANT,	0);
	class_addmethod(c, (method)scope_notify,		"notify",		A_CANT, 0);
	class_addmethod(c, (method)scope_getdrawparams, "getdrawparams", A_CANT, 0);
	class_addmethod(c, (method)scope_oksize,		"oksize",		A_CANT, 0);

	CLASS_ATTR_DEFAULT			(c, "patching_rect", 0, "0 0 225 225");

    CLASS_ATTR_LONG             (c, "order", 0, t_scope, f_order);
    CLASS_ATTR_ACCESSORS        (c, "order", (method)NULL,(method)scope_setattr_order);
	CLASS_ATTR_CATEGORY			(c, "order", 0, "Value");
	CLASS_ATTR_ORDER			(c, "order", 0, "1");
	CLASS_ATTR_LABEL			(c, "order", 0, "Ambisonic Order");
	CLASS_ATTR_FILTER_MIN		(c, "order", 1);
	CLASS_ATTR_DEFAULT			(c, "order", 0, "3");
	CLASS_ATTR_SAVE				(c, "order", 1);
	
    CLASS_ATTR_LONG             (c, "mode", 0, t_scope, f_process_mode);
	CLASS_ATTR_CATEGORY			(c, "mode", 0, "Value");
    CLASS_ATTR_ENUMINDEX2       (c, "mode", 0, "Peak", "Average");
	CLASS_ATTR_ORDER			(c, "mode", 0, "2");
	CLASS_ATTR_LABEL			(c, "mode", 0, "Process Mode");
	CLASS_ATTR_DEFAULT			(c, "mode", 0, "0");
	CLASS_ATTR_SAVE				(c, "mode", 1);
    
    CLASS_ATTR_LONG             (c, "bufsize", 0, t_scope, f_bufsize);
	CLASS_ATTR_CATEGORY			(c, "bufsize", 0, "Value");
	CLASS_ATTR_ORDER			(c, "bufsize", 0, "3");
    CLASS_ATTR_FILTER_MIN		(c, "bufsize", 1);
	CLASS_ATTR_LABEL			(c, "bufsize", 0, "Buffer Size (in samps)");
	CLASS_ATTR_DEFAULT			(c, "bufsize", 0, "128");
	CLASS_ATTR_SAVE				(c, "bufsize", 1);
    
	CLASS_ATTR_LONG             (c, "interval", 0, t_scope, f_interval);
	CLASS_ATTR_CATEGORY			(c, "interval", 0, "Value");
	CLASS_ATTR_ORDER			(c, "interval", 0, "4");
	CLASS_ATTR_LABEL			(c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN		(c, "interval", 20);
	CLASS_ATTR_DEFAULT			(c, "interval", 0, "100");
	CLASS_ATTR_SAVE				(c, "interval", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawcircle", 0, t_scope, f_drawCircle);
	CLASS_ATTR_CATEGORY			(c, "drawcircle", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcircle", 0, "1");
	CLASS_ATTR_STYLE_LABEL		(c, "drawcircle", 0, "onoff", "Draw Circle");
	CLASS_ATTR_DEFAULT			(c, "drawcircle", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcircle", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawangles", 0, t_scope, f_drawAngles);
	CLASS_ATTR_CATEGORY			(c, "drawangles", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawangles", 0, "2");
	CLASS_ATTR_STYLE_LABEL		(c, "drawangles", 0, "onoff", "Draw Angles");
	CLASS_ATTR_DEFAULT			(c, "drawangles", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawangles", 1);
    
    CLASS_ATTR_ATOM_LONG		(c, "drawcontrib", 0, t_scope, f_drawContributions);
	CLASS_ATTR_CATEGORY			(c, "drawcontrib", 0, "Appearance");
	CLASS_ATTR_ORDER			(c, "drawcontrib", 0, "3");
	CLASS_ATTR_STYLE_LABEL		(c, "drawcontrib", 0, "onoff", "Draw Contributions");
	CLASS_ATTR_DEFAULT			(c, "drawcontrib", 0, "1");
	CLASS_ATTR_SAVE				(c, "drawcontrib", 1);
	
	CLASS_ATTR_INVISIBLE		(c, "color", 0);
	CLASS_ATTR_INVISIBLE		(c, "textcolor", 0);
	
	CLASS_ATTR_RGBA				(c, "bgcolor", 0, t_scope, f_colorBackground);
	CLASS_ATTR_CATEGORY			(c, "bgcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bgcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bgcolor", 0, "Background Color");
	CLASS_ATTR_ORDER			(c, "bgcolor", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bgcolor", 0, "0.76 0.76 0.76 1.");
    
    CLASS_ATTR_RGBA				(c, "bordercolor", 0, t_scope, f_bordercolor);
	CLASS_ATTR_CATEGORY			(c, "bordercolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "bordercolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "bordercolor", 0, "Border Color");
	CLASS_ATTR_ORDER			(c, "bordercolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "bordercolor", 0, "0.7 0.7 0.7 1.");
	
	CLASS_ATTR_RGBA				(c, "txcolor", 0, t_scope, f_colorText);
	CLASS_ATTR_CATEGORY			(c, "txcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "txcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "txcolor", 0, "Text Color");
	CLASS_ATTR_ORDER			(c, "txcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "txcolor", 0, "0. 0. 0. 7.");
	
	CLASS_ATTR_RGBA				(c, "phcolor", 0, t_scope, f_colorPositif);
	CLASS_ATTR_CATEGORY			(c, "phcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "phcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "phcolor", 0, "Positifs Harmonics");
	CLASS_ATTR_ORDER			(c, "phcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "phcolor", 0, "1. 0. 0. 1.");
	
	CLASS_ATTR_RGBA				(c, "nhcolor", 0, t_scope, f_colorNegatif);
	CLASS_ATTR_CATEGORY			(c, "nhcolor", 0, "Color");
	CLASS_ATTR_STYLE			(c, "nhcolor", 0, "rgba");
	CLASS_ATTR_LABEL			(c, "nhcolor", 0, "Negatifs Harmonics");
	CLASS_ATTR_ORDER			(c, "nhcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "nhcolor", 0, "0. 0. 1. 1.");
	
	class_register(CLASS_BOX, c);
	scope_class = c;
	
	class_findbyname(CLASS_NOBOX, gensym("hoa.encoder~"));
	return 0;
}