Exemplo n.º 1
0
void C74_EXPORT ext_main(void *r)
{
  t_class *c;
  
  c = class_new("y.filesys", (method)filesys_new, (method)filesys_free, 
        (long)sizeof(t_filesys), (method)NULL, A_GIMME, 0);
  
  class_addmethod(c, (method)filesys_assist, "assist", A_CANT, 0);  

  class_addmethod(c, (method)filesys_cd, "cd", A_SYM, 0);
  class_addmethod(c, (method)filesys_getdir, "getdir", 0);
  class_addmethod(c, (method)filesys_postdir, "postdir", 0);

  class_addmethod(c, (method)filesys_rename, "rename", A_GIMME, 0);
  class_addmethod(c, (method)filesys_rename, "ren", A_GIMME, 0);
  class_addmethod(c, (method)filesys_rename, "mv", A_GIMME, 0);
  class_addmethod(c, (method)filesys_delete, "delete", A_GIMME, 0);
  class_addmethod(c, (method)filesys_delete, "del", A_GIMME, 0);
  class_addmethod(c, (method)filesys_delete, "rm", A_GIMME, 0);

  class_addmethod(c, (method)filesys_anything, "anything", A_GIMME, 0);

  CLASS_ATTR_CHAR(c, "verbose", 0, t_filesys, a_verbose);
	CLASS_ATTR_STYLE_LABEL(c, "verbose", 0, "onoff", "Verbose");
  CLASS_ATTR_SAVE(c, "verbose", 0);
  CLASS_ATTR_ORDER(c, "verbose", 0, "1");

  CLASS_ATTR_CHAR(c, "err_report", 0, t_filesys, a_error_report);
	CLASS_ATTR_STYLE_LABEL(c, "err_report", 0, "onoff", "Error reporting");
  CLASS_ATTR_SAVE(c, "err_report", 0);
  CLASS_ATTR_ORDER(c, "err_report", 0, "2");

  class_register(CLASS_BOX, c);
  filesys_class = c;
}
Exemplo n.º 2
0
void ext_main(void *r)
{
	t_class *c;

	c = class_new("smoov", (method)smoov_new, (method)smoov_free, sizeof(t_smoov), 0L, A_GIMME, 0); // class_new() loads our external's class into Max's memory so it can be used in a patch

	class_addmethod(c, (method)smoov_bang,		"bang",		0);                 // the method it uses when it gets a bang in the left inlet
    class_addmethod(c, (method)smoov_set,		"set",		A_GIMME,    0);     // the method to set and int or a float in the left inlet       (inlet 0)
	class_addmethod(c, (method)smoov_int,		"int",		A_LONG,     0);     // the method for an int in the left inlet                      (inlet 0)
    class_addmethod(c, (method)smoov_list,		"list",		A_GIMME,     0);    // the method for a list in the left inlet                      (inlet 0)
    class_addmethod(c, (method)smoov_float,		"float",	A_FLOAT,    0);     // the method for a float in the left inlet                     (inlet 0)
	class_addmethod(c, (method)smoov_assist,	"assist",	A_CANT,     0);     // (optional) assistance method needs to be declared like this

    CLASS_ATTR_CHAR(c, "active", 0, t_smoov, s_active);
    CLASS_ATTR_ORDER(c, "active", 0, "1");
    CLASS_ATTR_STYLE_LABEL(c, "active", 0, "onoff", "Toggle smoothing");

    CLASS_ATTR_DOUBLE(c, "smooth", 0, t_smoov, s_smooth);
    CLASS_ATTR_LABEL(c, "smooth", 0, "Smoothing value");
    CLASS_ATTR_ORDER(c, "smooth", 0, "2");
    CLASS_ATTR_FILTER_CLIP(c, "smooth", 0., 1.);
    
    CLASS_ATTR_CHAR(c, "force_output", 0, t_smoov, s_force_output);
    CLASS_ATTR_ORDER(c, "force_output", 0, "3");
    CLASS_ATTR_ENUMINDEX3(c, "force_output",0,"as input","int output","float output");
    CLASS_ATTR_LABEL(c, "force_output", 0, "Fore output style");
    
	class_register(CLASS_BOX, c);
	smoov_class = c;
}
Exemplo n.º 3
0
int TTCLASSWRAPPERMAX_EXPORT main(void)
{
	t_class *c;
	
	TTDSPInit();
	common_symbols_init();

	c = class_new("jcom.gain~", (method)gain_new, (method)gain_free, sizeof(t_gain), (method)0L, A_GIMME, 0);

	// Make methods accessible for our class: 
	class_addmethod(c, (method)gain_dsp, 				"dsp", A_CANT, 0L);
	class_addmethod(c, (method)gain_dsp64,				"dsp64", A_CANT, 0);
    class_addmethod(c, (method)object_obex_dumpout, 	"dumpout", A_CANT,0);
    class_addmethod(c, (method)gain_assist, 			"assist", A_CANT, 0L);

	CLASS_ATTR_CHAR(c,		"bypass",	0,		t_gain,	attrBypass);
	CLASS_ATTR_ACCESSORS(c,	"bypass",	NULL,	attr_set_bypass);
	
	CLASS_ATTR_FLOAT(c,		"mix",		0,		t_gain,	attrBypass);
	CLASS_ATTR_ACCESSORS(c,	"mix",		NULL,	attr_set_mix);
	
	CLASS_ATTR_FLOAT(c,		"gain",		0,		t_gain,	attrBypass);
	CLASS_ATTR_ACCESSORS(c,	"gain",		NULL,	attr_set_gain);
		
	// Setup our class to work with MSP
	class_dspinit(c);

	// Finalize our class
	class_register(CLASS_BOX, c);
	s_gain_class = c;
	return 0;
}
Exemplo n.º 4
0
void C74_EXPORT ext_main(void *r)
{
  t_class *c;
  
  c = class_new("dict.recurse", (method)dict_recurse_new, (method)dict_recurse_free, 
      (long)sizeof(t_dict_recurse), (method)NULL, A_GIMME, 0);
  
  // Methods
  class_addmethod(c, (method)dict_recurse_assist, "assist", A_CANT, 0);  

  class_addmethod(c, (method)dict_recurse_all, "all", A_SYM, 0);
  class_addmethod(c, (method)dict_recurse_find, "find", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_replace, "replace", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_append, "append", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_delete, "delete", A_GIMME, 0);

  class_addmethod(c, (method)dict_recurse_bang, "bang", 0);
  class_addmethod(c, (method)dict_recurse_set, "set", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_get, "get", A_GIMME, 0);
  class_addmethod(c, (method)dict_recurse_anything, "anything", A_GIMME, 0);  

  class_addmethod(c, (method)dict_re_compile, "compile", A_GIMME, 0);
  class_addmethod(c, (method)dict_re_simulate, "simulate", A_GIMME, 0);
  class_addmethod(c, (method)dict_re_states, "states", 0);

  // Attributes
  CLASS_ATTR_CHAR(c, "verbose", 0, t_dict_recurse, a_verbose);
  CLASS_ATTR_STYLE(c, "verbose", 0, "onoff");
  CLASS_ATTR_SAVE(c, "verbose", 0);

  class_register(CLASS_BOX, c);
  dict_recurse_class = c;
}
Exemplo n.º 5
0
int C74_EXPORT main(void)
{	
	t_class *c;
		
	c = class_new("uisimp", (method)uisimp_new, (method)uisimp_free, sizeof(t_uisimp), 0L, A_GIMME, 0);

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

	class_addmethod(c, (method)uisimp_paint,		"paint",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mousedown,	"mousedown",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mousedrag,	"mousedrag",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mouseup,		"mouseup",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mouseenter,	"mouseenter",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mouseleave,	"mouseleave",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_mousemove,	"mousemove",	A_CANT, 0);
	class_addmethod(c, (method)uisimp_assist,		"assist",	A_CANT, 0);  
	
	// messages for state setting / retrieval
	
	class_addmethod(c, (method)uisimp_int,			"int",	A_LONG, 0);
	class_addmethod(c, (method)uisimp_bang,			"bang", 0);
	
	// attributes
	
	CLASS_ATTR_CHAR(c, "trackmouse", 0, t_uisimp, u_trackmouse);
	CLASS_ATTR_STYLE_LABEL(c, "trackmouse", 0, "onoff", "Track Mouse");
	CLASS_ATTR_SAVE(c, "trackmouse", 0);
	CLASS_ATTR_CATEGORY(c, "trackmouse", 0, "Behavior");
	
	CLASS_STICKY_ATTR(c, "category", 0, "Color");
	CLASS_ATTR_RGBA(c, "bgcolor", 0, t_uisimp, u_background); 
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "bgcolor", 0, "1. 1. 1. 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"bgcolor",0,"rgba","Background Color");
	
	CLASS_ATTR_RGBA(c, "bordercolor", 0, t_uisimp, u_outline); 
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "bordercolor", 0, "0.5 0.5 0.5 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"bordercolor",0,"rgba","Border Color");
	
	CLASS_ATTR_RGBA(c, "hilitecolor", 0, t_uisimp, u_hilite); 
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "hilitecolor", 0, "0.5 0.5 0.5 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"hilitecolor",0,"rgba","Hilite Color");

    // color uses the color declared in t_jbox.b_color
	CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c, "color", 0, "0. 0. 0. 1."); 
	CLASS_ATTR_STYLE_LABEL(c,"color",0,"rgba","Check Color");
	
	CLASS_STICKY_ATTR_CLEAR(c, "category");
	
	
	CLASS_ATTR_DEFAULT(c,"patching_rect",0, "0. 0. 20. 20.");
	
	class_register(CLASS_BOX, c);
	s_uisimp_class = c;

	return 0;
}
Exemplo n.º 6
0
int JAMOMA_EXPORT_MAXOBJ main(void)
{
	t_class 	*c;
	t_object 	*attr = NULL;
	long		numDataspaces = 0;
	SymbolPtr*	dataspaceNames = NULL;
	char		dataspaces[2048];
	short		i;

	jamoma_init();
	common_symbols_init();
	
	jamoma_getDataspaceList(&numDataspaces, &dataspaceNames);
	dataspaces[0] = 0;
	for (i=0; i<numDataspaces; i++)
	{
		strcat(dataspaces, dataspaceNames[i]->s_name);
		strcat(dataspaces, " ");
	}

	// Define our class
	c = class_new("jcom.return",(method)return_new, (method)return_free, sizeof(t_return), (method)0L, A_GIMME, 0);
	
	// Make methods accessible for our class:
	class_addmethod(c, (method)return_bang,					"bang",			A_CANT, 0L);
	class_addmethod(c, (method)return_int,					"int",			A_DEFLONG,	0L);
	class_addmethod(c, (method)return_float,				"float",		A_DEFFLOAT,	0L);
 	class_addmethod(c, (method)return_list,					"list",			A_GIMME, 0L);
 	class_addmethod(c, (method)return_symbol,				"anything",		A_GIMME, 0L);
	class_addmethod(c, (method)return_dump,					"dump",			0L);
	class_addmethod(c, (method)return_updatename,			"update_name",	A_CANT, 0L);
	class_addmethod(c, (method)return_assist,				"assist",		A_CANT, 0L); 

	jcom_core_subscriber_classinit_extended(c, attr);
	
	// ATTRIBUTE: type - options are generic, integer, decimal, string, boolean
	jamoma_class_attr_new(c, "type", _sym_symbol, (method)return_attr_settype, (method)return_attr_gettype);
	
	// ATTRIBUTES: dataspace stuff
	
	CLASS_ATTR_SYM(c,						"dataspace",					0,	t_return, attrDataspace);
	CLASS_ATTR_LABEL(c,						"dataspace",					0,	"dataspace");
	CLASS_ATTR_ENUM(c,						"dataspace",					0, dataspaces);

	CLASS_ATTR_SYM(c,						"dataspace/unit/native",		0,	t_return, attrUnitNative);
	CLASS_ATTR_LABEL(c,						"dataspace/unit/native",		0,	"dataspace/unit/native");
		
	CLASS_ATTR_CHAR(c,						"enable",						0,	t_return,	attrEnable);
	CLASS_ATTR_STYLE(c,						"enable",						0,	"onoff");
	
	// Finalize our class
	class_register(CLASS_BOX, c);
	return_class = c;
	
	return 0;
}
Exemplo n.º 7
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("uisimp4", 
							(method)uisimp_new,
							(method)uisimp_free,
							sizeof(t_uisimp),
							(method)NULL,
							A_GIMME,
							0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);
	
	class_addmethod(c, (method) uisimp_paint, "paint", A_CANT, 0);
	class_addmethod(c, (method) uisimp_int, "int", A_LONG, 0);
	
	class_addmethod(c, (method) uisimp_mousedown, "mousedown", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mousedragdelta, "mousedragdelta", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mouseup, "mouseup", A_CANT, 0);

	class_addmethod(c, (method) uisimp_assist, "assist", A_CANT, 0);
	class_addmethod(c, (method) jbox_notify, "notify", A_CANT, 0);

	CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0 0 60 60");
	CLASS_ATTR_DEFAULT(c, "color", 0, "0.8 0.5 0.2 1");
	
	CLASS_ATTR_LONG(c,"inset",0, t_uisimp, j_inset);
	CLASS_ATTR_LABEL(c,"inset",0,"Filled Area Inset");
	CLASS_ATTR_CATEGORY(c,"inset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"inset",0,"3");
	
	CLASS_ATTR_CHAR(c,"reset",0, t_uisimp, j_reset);
	CLASS_ATTR_STYLE_LABEL(c,"reset",0,"onoff","Reset Counter on Click");
	CLASS_ATTR_CATEGORY(c,"reset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE(c,"reset",0,"1");
	
	CLASS_ATTR_LONG(c,"shape",0, t_uisimp, j_shape);
	CLASS_ATTR_LABEL(c,"shape", 0, "Fill Shape");
	CLASS_ATTR_CATEGORY(c,"shape",0,"Shape");
	CLASS_ATTR_ENUMINDEX(c,"shape", 0, "Square Circle Angle");
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"shape",0,"0");
	
	s_uisimp_class = c;
	class_register(CLASS_BOX, s_uisimp_class);
	return 0;
}
Exemplo n.º 8
0
int C74_EXPORT main(void)
{
	t_class *c;
	
	c = class_new("uisimp3", 
							(method)uisimp_new,
							(method)uisimp_free,
							sizeof(t_uisimp),
							(method)NULL,
							A_GIMME,
							0L);
	
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH | JBOX_FONTATTR);
	
	class_addmethod(c, (method) uisimp_paint, "paint", A_CANT, 0);
	class_addmethod(c, (method) uisimp_int, "int", A_LONG, 0);
	
	class_addmethod(c, (method) uisimp_mousedown, "mousedown", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mousedrag, "mousedrag", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mousewheel, "mousewheel", A_CANT, 0);
	class_addmethod(c, (method) uisimp_mouseup, "mouseup", A_CANT, 0);
	class_addmethod(c, (method) uisimp_getdrawparams, "getdrawparams", A_CANT, 0);

	class_addmethod(c, (method) uisimp_assist, "assist", A_CANT, 0);
	class_addmethod(c, (method) jbox_notify, "notify", A_CANT, 0);

	CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0 0 50 50");
	CLASS_ATTR_DEFAULT(c, "color", 0, "0.8 0.5 0.2 1");
	
	CLASS_ATTR_CHAR(c,"reset",0, t_uisimp, j_reset);
	CLASS_ATTR_STYLE_LABEL(c,"reset",0,"onoff","Reset Counter on Click");
	CLASS_ATTR_CATEGORY(c,"reset",0,"Tweaks");
	CLASS_ATTR_DEFAULT_SAVE(c,"reset",0,"1");
	
	s_uisimp_class = c;
	class_register(CLASS_BOX, s_uisimp_class);
	return 0;
}
Exemplo n.º 9
0
extern "C" void setup_c0x2eknob(void)
{
    t_eclass *c = eclass_new("c.knob", (method)knob_new, (method)ebox_free, (short)sizeof(t_knob), 0L, A_GIMME, 0);
    
    if(c)
    {
        eclass_guiinit(c, 0);
        
        eclass_addmethod(c, (method) knob_paint,            "paint",            A_NULL, 0);
        eclass_addmethod(c, (method) knob_notify,           "notify",           A_NULL, 0);
        eclass_addmethod(c, (method) knob_getdrawparams,    "getdrawparams",    A_NULL, 0);
        eclass_addmethod(c, (method) knob_oksize,           "oksize",           A_NULL, 0);
        eclass_addmethod(c, (method) knob_set,              "set",              A_FLOAT,0);
        eclass_addmethod(c, (method) knob_float,            "float",            A_FLOAT,0);
        eclass_addmethod(c, (method) knob_bang,             "bang",             A_NULL, 0);
        
        eclass_addmethod(c, (method) knob_mousedown,        "mousedown",        A_NULL, 0);
        eclass_addmethod(c, (method) knob_mousedrag,        "mousedrag",        A_NULL, 0);
        eclass_addmethod(c, (method) knob_mouseup,          "mouseup",          A_NULL, 0);
        
        CLASS_ATTR_DEFAULT              (c, "size", 0, "50. 50.");
        
        CLASS_ATTR_CHAR                 (c, "endless", 0, t_knob, f_endless);
        CLASS_ATTR_LABEL                (c, "endless", 0, "Endless Mode");
        CLASS_ATTR_ORDER                (c, "endless", 0, "1");
        CLASS_ATTR_FILTER_CLIP          (c, "endless", 0, 1);
        CLASS_ATTR_DEFAULT              (c, "endless", 0, "0");
        CLASS_ATTR_SAVE                 (c, "endless", 0);
        CLASS_ATTR_STYLE                (c, "endless", 0, "onoff");
        CLASS_ATTR_PAINT                (c, "endless", 0);
        
        CLASS_ATTR_FLOAT_ARRAY          (c, "minmax", 0, t_knob, f_dummy, 2);
        CLASS_ATTR_ORDER                (c, "minmax", 0, "3");
        CLASS_ATTR_LABEL                (c, "minmax", 0, "Min/Max Values");
        CLASS_ATTR_DEFAULT              (c, "minmax", 0, "0 1");
        CLASS_ATTR_ACCESSORS            (c, "minmax", knob_minmax_get, knob_minmax_set);
        CLASS_ATTR_SAVE                 (c, "minmax", 1);
        
        CLASS_ATTR_INT                  (c, "bdsize", 0, t_knob, f_bdsize);
        CLASS_ATTR_LABEL                (c, "bdsize", 0, "Border Size");
        CLASS_ATTR_ORDER                (c, "bdsize", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdsize", 0, "2");
        CLASS_ATTR_FILTER_CLIP          (c, "bdsize", 0, 4);
        CLASS_ATTR_STYLE                (c, "bdsize", 0, "number");
        
        CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_knob, f_color_background);
        CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
        CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
        CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");
        
        CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_knob, f_color_border);
        CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
        CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");
        
        CLASS_ATTR_RGBA                 (c, "necolor", 0, t_knob, f_color_needle);
        CLASS_ATTR_LABEL                (c, "necolor", 0, "Needle Color");
        CLASS_ATTR_ORDER                (c, "necolor", 0, "3");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "necolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "necolor", 0, "color");
        
        eclass_register(CLASS_BOX, c);
        knob_class = c;
    }
}
Exemplo n.º 10
0
int main(void){
#if defined(CC_MSP) && defined(CC_JBOX)
	t_class *c = class_new("cc_jbox~", (method)cc_new, (method)cc_free, sizeof(t_cc), 0L, A_GIMME, 0);
	class_dspinitjbox(c);
#elif defined(CC_MSP)
	t_class *c = class_new("cc~", (method)cc_new, (method)cc_free, sizeof(t_cc), 0L, A_GIMME, 0);
	class_dspinit(c);
#elif defined(CC_JBOX)
	t_class *c = class_new("cc_jbox", (method)cc_new, (method)cc_free, sizeof(t_cc), 0L, A_GIMME, 0);

#else
	t_class *c = class_new("cc", (method)cc_new, (method)cc_free, sizeof(t_cc), 0L, A_GIMME, 0);
#endif

#if defined(CC_JBOX)
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY; 
 	jbox_initclass(c, JBOX_FIXWIDTH | JBOX_COLOR | JBOX_FONTATTR);
	class_addmethod(c, (method)cc_paint, "paint", A_CANT, 0);
	class_addmethod(c, (method)cc_mousedown, "mousedown", A_CANT, 0);
	class_addmethod(c, (method)cc_mousedrag, "mousedrag", A_CANT, 0);
	class_addmethod(c, (method)cc_mouseup, "mouseup", A_CANT, 0);
	class_addmethod(c, (method)cc_mouseenter, "mouseenter", A_CANT, 0);
	class_addmethod(c, (method)cc_mouseleave, "mouseleave", A_CANT, 0);
	class_addmethod(c, (method)cc_mousemove, "mousemove", A_CANT, 0);
	class_addmethod(c, (method)cc_mousewheel, "mousewheel", A_CANT, 0);
#endif
#if defined(CC_MSP)
	class_addmethod(c, (method)cc_dsp, "dsp", A_CANT, 0);
#endif

	class_addmethod(c, (method)cc_bang, "bang", 0);
	class_addmethod(c, (method)cc_float, "float", A_FLOAT, 0);
	class_addmethod(c, (method)cc_int, "int", A_LONG, 0);
	class_addmethod(c, (method)cc_list, "list", A_GIMME, 0);
	class_addmethod(c, (method)cc_anything, "anything", A_GIMME, 0);
	class_addmethod(c, (method)cc_assist, "assist", A_CANT, 0);
	//class_addmethod(c, (method)cc_notify, "notify", A_CANT, 0);

	//for the text editor and code
	class_addmethod(c, (method)cc_edclose, "edclose", A_CANT, 0); 
	class_addmethod(c, (method)cc_edsave, "edsave", A_CANT, 0); 
#if !defined(CC_JBOX)
	class_addmethod(c, (method)cc_dblclick, "dblclick", A_CANT, 0);
#endif
	class_addmethod(c, (method)cc_okclose, "okclose", A_CANT, 0);  
	class_addmethod(c, (method)cc_compile, "compile", 0);
	class_addmethod(c, (method)cc_open_editor, "open_editor", 0);

	CLASS_ATTR_SYM(c, "maxsdk", 0, t_cc, path_to_maxsdk);
	CLASS_ATTR_ACCESSORS(c, "maxsdk", cc_maxsdk_get, cc_maxsdk_set);
	CLASS_ATTR_SAVE(c, "maxsdk", 0);

	CLASS_ATTR_LONG(c, "outlets", 0, t_cc, noutlets);
	CLASS_ATTR_SAVE(c, "outlets", 0);
	CLASS_ATTR_LONG(c, "inlets", 0, t_cc, ninlets);
	CLASS_ATTR_SAVE(c, "inlets", 0);
	CLASS_ATTR_LONG(c, "verbose", 0, t_cc, verbose);

	CLASS_ATTR_CHAR(c, "cfile", 0, t_cc, cfile_fullpath);
	CLASS_ATTR_ACCESSORS(c, "cfile", cc_cfile_get, cc_cfile_set);
	CLASS_ATTR_SAVE(c, "cfile", 0);

	CLASS_ATTR_CHAR(c, "build_path", 0, t_cc, build_path);
	CLASS_ATTR_ACCESSORS(c, "build_path", cc_build_path_get, cc_build_path_set);
	CLASS_ATTR_SAVE(c, "build_path", 0);

	CLASS_ATTR_CHAR(c, "load", 0, t_cc, dfile_fullpath);
	CLASS_ATTR_ACCESSORS(c, "load", cc_load_get, cc_load_set);
	CLASS_ATTR_SAVE(c, "load", 0);

#if defined(CC_MSP)
	CLASS_ATTR_LONG(c, "sigoutlets", 0, t_cc, nsigoutlets);
	CLASS_ATTR_SAVE(c, "sigoutlets", 0);
	CLASS_ATTR_LONG(c, "siginlets", 0, t_cc, nsiginlets);
	CLASS_ATTR_SAVE(c, "siginlets", 0);
#endif
#if defined(CC_JBOX)
	CLASS_ATTR_DEFAULT(c, "patching_rect", 0, "0. 0. 300. 100.");
#endif

	class_register(CLASS_BOX, c);
	cc_class = c;

	ps_cc_instance_count = gensym("cc_instance_count");
	ps_cc_instance_count->s_thing = 0;

	common_symbols_init();
	version(0);
    
	return 0;
}
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.gain~", (method)hoa_gain_new, (method)hoa_gain_free, sizeof(t_hoa_gain), (method)NULL, A_GIMME, 0L);
    class_setname((char *)"hoa.gain~", (char *)"hoa.gain~");
    
    c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
    class_dspinitjbox(c);
    jbox_initclass(c, JBOX_FIXWIDTH | JBOX_COLOR );
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    class_addmethod (c, (method) hoa_gain_assist,              "assist",               A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_paint,               "paint",                A_CANT, 0);
    
    // @method signal @digest The inputs signals to be scaled by the slider.
    // @description The inputs signals to be scaled by the slider.
    class_addmethod (c, (method) hoa_gain_dsp64,               "dsp64",                A_CANT, 0);
    
    // @method int @digest Set the value of the slider
    // @description The <m>int</m> method sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, and outputs the slider's value out the right outlet.
    // @marg 0 @name value @optional 0 @type int
    class_addmethod (c, (method) hoa_gain_int,                 "int",                  A_LONG, 0);
    
    // @method float @digest Set the value of the slider
    // @description The <m>float</m> method sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, and outputs the slider's value out the right outlet.
    // @marg 0 @name value @optional 0 @type int
    class_addmethod (c, (method) hoa_gain_float,               "float",                A_FLOAT, 0);
    
    // @method contextvalue @digest Set the value of the slider with DeciBels, Amplitude or MIDI value type.
    // @description Set the value of the slider with DeciBels, Amplitude or MIDI value type.
    // @marg 0 @name inputmode @optional 0 @type int @description 0 = DeciBels, 1 = 1mplitude, 2 = MIDI.
    // @marg 1 @name value @optional 0 @type float @description The slider value
    class_addmethod (c, (method) hoa_gain_contextValue,        "contextvalue", A_LONG, A_FLOAT, 0);
    
    // @method bang @digest Send current value out right outlet.
    // @description The <m>bang</m> message send current value out right outlet.
    class_addmethod (c, (method) hoa_gain_bang,                "bang",                         0);
    
    // @method set @digest Set the value of the slider without outputting slider value.
    // @description The word set, followed by a number, sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, but does not output the slider's value out the right outlet.
    // @marg 1 @name value @optional 0 @type float @description The slider value
    class_addmethod (c, (method) hoa_gain_set,                 "set",                  A_GIMME, 0);
    //class_addmethod (c, (method) hoa_gain_tometer,             "anything",             A_GIMME, 0);
    class_addmethod (c, (method) hoa_gain_anything,            "anything",             A_GIMME, 0);
    
    // @method (mouse) @digest click and drag to set the slider outlet.
    // @description Clicking and dragging with the mouse sets the value of the slider, ramps the output signal to the level corresponding to the new value over the specified ramp time, and outputs the slider’s value out the right outlet. double-click to set the slider value to <m>defvaldb</m>
    
    class_addmethod (c, (method) hoa_gain_mousedoubleclick,    "mousedoubleclick",     A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_mousedown,           "mousedown",            A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_mousedragdelta,      "mousedragdelta",       A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_mouseup,             "mouseup",              A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_getvalueof,          "getvalueof",           A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_setvalueof,          "setvalueof",           A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_preset,              "preset",                       0);
    class_addmethod (c, (method) hoa_gain_notify,              "notify",               A_CANT, 0);
    class_addmethod (c, (method) hoa_gain_oksize,              "oksize",               A_CANT, 0);
    
    CLASS_ATTR_DEFAULT(c,"patching_rect",0, "0. 0. 140. 22.");
    
    CLASS_STICKY_CATEGORY		(c,0,"Value");
    
    CLASS_ATTR_DOUBLE			(c, "interp", 0, t_hoa_gain, f_interp);
    CLASS_ATTR_ACCESSORS		(c, "interp",(method)NULL,(method)hoa_gain_setattr_interp);
    CLASS_ATTR_LABEL			(c, "interp", 0, "Ramp Time (ms)");
    CLASS_ATTR_FILTER_MIN		(c, "interp", 0);
    // @description Ramp time in milliseconds
    
    CLASS_ATTR_CHAR				(c,"relative", 0, t_hoa_gain, j_relative);
    CLASS_ATTR_LABEL			(c,"relative", 0, "Mousing Mode");
    CLASS_ATTR_ENUMINDEX2		(c, "relative", 0, "Absolute", "Relative");
    CLASS_ATTR_BASIC			(c, "relative", 0);
    // @description Mousing can either be <b>absolute</b> or <b>relative</b>
    
    CLASS_ATTR_CHAR				(c,"inputmode", 0, t_hoa_gain, f_inputMode);
    CLASS_ATTR_LABEL			(c,"inputmode", 0, "Input Mode");
    CLASS_ATTR_ENUMINDEX3		(c, "inputmode", 0, "DeciBels", "Amplitude", "Midi");
    // @description Input mode can either be in <b>DeciBels</b>, <b>Amplitude</b> or <b>Midi</b>
    
    CLASS_ATTR_DOUBLE			(c, "defvaldb", 0, t_hoa_gain, j_defaultValuedB);
    CLASS_ATTR_LABEL			(c, "defvaldb", 0, "Default Value (dB)");
    // @description Default value in <b>DeciBels</b>, <b>Amplitude</b> or <b>Midi</b>
    
    CLASS_STICKY_CATEGORY_CLEAR(c);
    
    CLASS_ATTR_CHAR				(c,"orientation",0,t_hoa_gain,j_orientation);
    CLASS_ATTR_LABEL			(c,"orientation",0,"Orientation");
    CLASS_ATTR_ENUMINDEX3		(c,"orientation", 0,"Automatic", "Horizontal", "Vertical");
    CLASS_ATTR_CATEGORY			(c, "orientation", 0, "Appearance");
    CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "orientation", 0, "0");
    // @description Orientation can either be in <b>Automatic</b>, <b>Horizontal</b> or <b>Vertical</b>
    
    CLASS_STICKY_CATEGORY(c, 0, "Color");
    
    CLASS_ATTR_INVISIBLE(c, "color", 0);
    // @exclude hoa.gain~
    
    CLASS_ATTR_RGBA_LEGACY		(c, "bgcolor", "brgb", 0, t_hoa_gain, j_brgba);
    CLASS_ATTR_ALIAS			(c,"bgcolor", "brgba");
    CLASS_ATTR_DEFAULTNAME_SAVE_PAINT(c,"bgcolor",0,"0.611765 0.611765 0.611765 1.");
    CLASS_ATTR_STYLE_LABEL		(c, "bgcolor", 0, "rgba", "Background Color");
    CLASS_ATTR_BASIC			(c, "bgcolor", 0);
    // @description Sets the RGBA values for the background color of the <o>hoa.gain~</o> object
    
    CLASS_ATTR_RGBA				(c, "knobcolor", 0, t_hoa_gain, j_knobcolor);
    CLASS_ATTR_STYLE_LABEL      (c, "knobcolor", 0, "rgba","Knob Color");
    CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "knobcolor", 0, "0.396078 0.396078 0.396078 1.");
    // @description Sets the RGBA values for the knob color of the <o>hoa.gain~</o> object
    
    CLASS_ATTR_RGBA				(c, "barcolor", 0, t_hoa_gain, j_barcolor);
    CLASS_ATTR_STYLE_LABEL      (c, "barcolor", 0, "rgba","Value Bar Color");
    CLASS_ATTR_DEFAULT_SAVE_PAINT(c, "barcolor", 0, "0.396078 0.396078 0.396078 0.6");
    // @description Sets the RGBA values for the value bar color of the <o>hoa.gain~</o> object
    
    CLASS_STICKY_CATEGORY_CLEAR(c);
    
    CLASS_ATTR_DEFAULT_SAVE		(c,"relative",0,"0");
    CLASS_ATTR_DEFAULT_SAVE		(c,"defvaldb",0,"0");
    CLASS_ATTR_DEFAULT_SAVE		(c,"inputmode",0,"0");
    CLASS_ATTR_DEFAULT_SAVE		(c,"interp",0,"20");
    CLASS_ATTR_LABEL			(c,"min", 0, "Output Minimum");
    CLASS_ATTR_LABEL			(c,"mult", 0, "Output Multiplier");
    CLASS_ATTR_STYLE_LABEL		(c,"floatoutput",0,"onoff","Float Output");
    
    CLASS_ATTR_ORDER			(c, "relative",		0, "2");
    CLASS_ATTR_ORDER			(c, "size",			0, "3");
    CLASS_ATTR_ORDER			(c, "min",			0, "4");
    CLASS_ATTR_ORDER			(c, "mult",			0, "5");
    
    CLASS_ATTR_CATEGORY			(c, "channels", 0, "Custom");
    CLASS_ATTR_LONG				(c, "channels", 0, t_hoa_gain, f_number_of_channels);
    CLASS_ATTR_ACCESSORS        (c, "channels", NULL, hoa_gain_setattr_channels);
    CLASS_ATTR_ORDER			(c, "channels", 0, "1");
    CLASS_ATTR_LABEL			(c, "channels", 0, "Number of Channels");
    CLASS_ATTR_FILTER_CLIP		(c, "channels", 1, MAX_IO);
    CLASS_ATTR_DEFAULT			(c, "channels", 0, "8");
    CLASS_ATTR_SAVE				(c, "channels", 1);
    
    CLASS_ATTR_CATEGORY			(c, "range", 0, "Value");
    CLASS_ATTR_DOUBLE_ARRAY     (c, "range", 0, t_hoa_gain, f_range, 2);
    CLASS_ATTR_ACCESSORS        (c, "range", NULL, hoa_gain_setattr_range);
    CLASS_ATTR_ORDER			(c, "range", 0, "2");
    CLASS_ATTR_LABEL			(c, "range", 0, "Range (dB)");
    CLASS_ATTR_DEFAULT			(c, "range", 0, "-70. 18.");
    CLASS_ATTR_SAVE             (c, "range", 1);
    
    class_register(CLASS_BOX, c);
    s_hoa_gain_class = c;    
}
Exemplo n.º 12
0
extern "C" void setup_c0x2etab(void)
{
    t_eclass *c = eclass_new("c.tab", (method)tab_new, (method)ebox_free, (short)sizeof(t_tab), 0L, A_GIMME, 0);

    if(c)
    {
        eclass_guiinit(c, 0);
        eclass_addmethod(c, (method) tab_paint,             "paint",            A_NULL, 0);
        eclass_addmethod(c, (method) tab_notify,            "notify",           A_NULL, 0);
        eclass_addmethod(c, (method) tab_getdrawparams,     "getdrawparams",    A_NULL, 0);
        eclass_addmethod(c, (method) tab_oksize,            "oksize",           A_NULL, 0);

        eclass_addmethod(c, (method) tab_append,            "append",           A_GIMME,0);
        eclass_addmethod(c, (method) tab_insert,            "insert",           A_GIMME,0);
        eclass_addmethod(c, (method) tab_setitem,           "setitem",          A_GIMME,0);
        eclass_addmethod(c, (method) tab_delete,            "delete",           A_FLOAT,0);
        eclass_addmethod(c, (method) tab_clear,             "clear",            A_NULL,0);

        eclass_addmethod(c, (method) tab_float,             "float",            A_FLOAT,0);
        eclass_addmethod(c, (method) tab_anything,          "anything",         A_GIMME,0);
        eclass_addmethod(c, (method) tab_set,               "set",              A_GIMME,0);
        eclass_addmethod(c, (method) tab_setsymbol,         "setsymbol",        A_GIMME,0);
        eclass_addmethod(c, (method) tab_bang,              "bang",             A_NULL, 0);
        eclass_addmethod(c, (method) tab_next,              "next",             A_NULL, 0);
        eclass_addmethod(c, (method) tab_prev,              "prev",             A_NULL, 0);

        eclass_addmethod(c, (method) tab_mousedown,         "mousedown",       A_NULL, 0);
        eclass_addmethod(c, (method) tab_mouseup,           "mouseup",         A_NULL, 0);
        eclass_addmethod(c, (method) tab_mousemove,         "mousemove",       A_NULL, 0);
        eclass_addmethod(c, (method) tab_mouseleave,        "mouseleave",      A_NULL, 0);

        CLASS_ATTR_DEFAULT              (c, "size", 0, "100 13");

        CLASS_ATTR_CHAR                 (c, "orientation", 0, t_tab, f_orientation);
        CLASS_ATTR_LABEL                (c, "orientation", 0, "Vertical Orientation");
        CLASS_ATTR_ORDER                (c, "orientation", 0, "1");
        CLASS_ATTR_FILTER_CLIP          (c, "orientation", 0, 1);
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "orientation", 0, "0");
        CLASS_ATTR_STYLE                (c, "orientation", 0, "onoff");

        CLASS_ATTR_CHAR                 (c, "toggle", 0, t_tab, f_toggle);
        CLASS_ATTR_LABEL                (c, "toggle", 0, "Toggle Mode");
        CLASS_ATTR_ORDER                (c, "toggle", 0, "1");
        CLASS_ATTR_FILTER_CLIP          (c, "toggle", 0, 1);
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "toggle", 0, "0");
        CLASS_ATTR_STYLE                (c, "toggle", 0, "onoff");

        CLASS_ATTR_SYMBOL_VARSIZE       (c, "items", 0, t_tab, f_items, f_nitems, CREAM_MAXITEMS);
        CLASS_ATTR_LABEL                (c, "items", 0, "Items");
        CLASS_ATTR_ORDER                (c, "items", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "items", 0, "");
        CLASS_ATTR_ACCESSORS            (c, "items", NULL, tab_items_set);

        CLASS_ATTR_FONT                 (c, "font", 0, t_tab, f_font);
        CLASS_ATTR_LABEL                (c, "font", 0, "Font");
        CLASS_ATTR_SAVE                 (c, "font", 0);
        CLASS_ATTR_PAINT                (c, "font", 0);

        CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_tab, f_color_background);
        CLASS_ATTR_LABEL                (c, "bgcolor", 0, "Background Color");
        CLASS_ATTR_ORDER                (c, "bgcolor", 0, "1");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bgcolor", 0, "0.75 0.75 0.75 1.");
        CLASS_ATTR_STYLE                (c, "bgcolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "bdcolor", 0, t_tab, f_color_border);
        CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
        CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "bdcolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "textcolor", 0, t_tab, f_color_text);
        CLASS_ATTR_LABEL                (c, "textcolor", 0, "Text Color");
        CLASS_ATTR_ORDER                (c, "textcolor", 0, "3");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "textcolor", 0, "0. 0. 0. 1.");
        CLASS_ATTR_STYLE                (c, "textcolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "hocolor", 0, t_tab, f_color_hover);
        CLASS_ATTR_LABEL                (c, "hocolor", 0, "Hover Color");
        CLASS_ATTR_ORDER                (c, "hocolor", 0, "4");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hocolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "hocolor", 0, "color");

        CLASS_ATTR_RGBA                 (c, "secolor", 0, t_tab, f_color_select);
        CLASS_ATTR_LABEL                (c, "secolor", 0, "Selection Color");
        CLASS_ATTR_ORDER                (c, "secolor", 0, "5");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "secolor", 0, "0.35 0.35 0.35 1.");
        CLASS_ATTR_STYLE                (c, "secolor", 0, "color");

        eclass_register(CLASS_BOX, c);
        tab_class = c;

    }
}