コード例 #1
0
ファイル: c.scope_tilde.cpp プロジェクト: EQ4/CreamLibrary
extern "C" void setup_c0x2escope_tilde(void)
{
    t_eclass *c;

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

    eclass_guiinit(c, 0);
    eclass_dspinit(c);
    eclass_addmethod(c, (method) scope_dsp,             "dsp",              A_NULL, 0);
    eclass_addmethod(c, (method) scope_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) scope_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) scope_oksize,          "oksize",           A_NULL, 0);

    CLASS_ATTR_INVISIBLE            (c, "send", 1);
    CLASS_ATTR_DEFAULT              (c, "size", 0, "125 100");

    CLASS_ATTR_LONG                 (c, "bufdis", 0, t_scope, f_display_size);
    CLASS_ATTR_ORDER                (c, "bufdis", 0, "1");
    CLASS_ATTR_LABEL                (c, "bufdis", 0, "Display Buffer Size");
    CLASS_ATTR_FILTER_CLIP          (c, "bufdis", 2, 8092);
    CLASS_ATTR_DEFAULT              (c, "bufdis", 0, "256");
    CLASS_ATTR_SAVE                 (c, "bufdis", 1);
    CLASS_ATTR_STYLE                (c, "bufdis", 0, "number");

    CLASS_ATTR_LONG                 (c, "bufsig", 0, t_scope, f_signal_size);
    CLASS_ATTR_ORDER                (c, "bufsig", 0, "2");
    CLASS_ATTR_LABEL                (c, "bufsig", 0, "Signal Buffer Size");
    CLASS_ATTR_FILTER_CLIP          (c, "bufsig", 2, 8092);
    CLASS_ATTR_DEFAULT              (c, "bufsig", 0, "256");
    CLASS_ATTR_SAVE                 (c, "bufsig", 1);
    CLASS_ATTR_STYLE                (c, "bufsig", 0, "number");

    CLASS_ATTR_FLOAT_ARRAY          (c, "range", 0, t_scope, f_range, 2);
    CLASS_ATTR_ORDER                (c, "range", 0, "2");
    CLASS_ATTR_LABEL                (c, "range", 0, "Range");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "range", 0, "-1 1");

    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_scope, 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_scope, 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, "sicolor", 0, t_scope, f_color_signal);
    CLASS_ATTR_LABEL                (c, "sicolor", 0, "Signal Color");
    CLASS_ATTR_ORDER                (c, "sicolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "sicolor", 0, "0. 0.6 0. 0.8");
    CLASS_ATTR_STYLE                (c, "sicolor", 0, "color");

    eclass_register(CLASS_BOX, c);
    cscope_class = c;
}
コード例 #2
0
ファイル: sc.gendy1~.cpp プロジェクト: alfonso73/sc-max
int main(void){	
	t_class *c;
        
	c = class_new("sc.gendy1~", (method)gendy_new, (method)gendy_free, (long)sizeof(t_gendy), 0L, A_GIMME, 0);
    
	class_addmethod(c, (method)gendy_dsp,		"dsp",		A_CANT, 0);
	class_addmethod(c, (method)gendy_assist,    "assist",	A_CANT, 0);
    
    // the gendy parameters are set via attributes
    
    CLASS_ATTR_LONG         (c, "ampdist",  ATTR_FLAGS_NONE, t_gendy, g_ampdist);
    CLASS_ATTR_FILTER_CLIP  (c, "ampdist",  0, 6);
    CLASS_ATTR_ORDER        (c, "ampdist",	ATTR_FLAGS_NONE, "1");
    
    CLASS_ATTR_LONG         (c, "durdist",  ATTR_FLAGS_NONE, t_gendy, g_durdist);
    CLASS_ATTR_FILTER_CLIP  (c, "durdist",  0, 6);
    CLASS_ATTR_ORDER        (c, "durdist",	ATTR_FLAGS_NONE, "2");
    
    CLASS_ATTR_FLOAT        (c, "adparam",  ATTR_FLAGS_NONE, t_gendy, g_adparam);
    CLASS_ATTR_ORDER        (c, "adparam",	ATTR_FLAGS_NONE, "3");
    
    CLASS_ATTR_FLOAT        (c, "ddparam",  ATTR_FLAGS_NONE, t_gendy, g_ddparam);
    CLASS_ATTR_ORDER        (c, "ddparam",	ATTR_FLAGS_NONE, "4");
    
    CLASS_ATTR_FLOAT        (c, "minfreq",  ATTR_FLAGS_NONE, t_gendy, g_minfreq);
    CLASS_ATTR_FILTER_MIN   (c, "minfreq",  1.f);
    CLASS_ATTR_ORDER        (c, "minfreq",	ATTR_FLAGS_NONE, "5");
    
    CLASS_ATTR_FLOAT        (c, "maxfreq",  ATTR_FLAGS_NONE, t_gendy, g_maxfreq);
    CLASS_ATTR_FILTER_MIN   (c, "maxfreq",  1.f);
    CLASS_ATTR_ORDER        (c, "maxfreq",	ATTR_FLAGS_NONE, "6");
    
    CLASS_ATTR_FLOAT        (c, "ampscale", ATTR_FLAGS_NONE, t_gendy, g_ampscale);
    CLASS_ATTR_FILTER_CLIP  (c, "ampscale", 0.f, 1.f);
    CLASS_ATTR_ORDER        (c, "ampscale",	ATTR_FLAGS_NONE, "7");
    
    CLASS_ATTR_FLOAT        (c, "durscale", ATTR_FLAGS_NONE, t_gendy, g_durscale);
    CLASS_ATTR_FILTER_CLIP  (c, "durscale", 0.f, 1.f);
    CLASS_ATTR_ORDER        (c, "durscale",	ATTR_FLAGS_NONE, "8");
    
    CLASS_ATTR_LONG         (c, "knum",     ATTR_FLAGS_NONE, t_gendy, g_knum);
    CLASS_ATTR_ORDER        (c, "knum",     ATTR_FLAGS_NONE, "9");
    
	class_dspinit(c);				
	class_register(CLASS_BOX, c);
	gendy_class = c;
	
	return EXIT_SUCCESS;
}
コード例 #3
0
ファイル: huygens~.c プロジェクト: CICM/PotPourri
int main(void)
{	
	t_class *c;
	
	c = class_new("huygens~", (method)Huygens_new, (method)Huygens_free, (long)sizeof(t_Huygens), 0L, A_GIMME, 0);
	
	class_addmethod(c, (method)Huygens_dsp,			"dsp",			A_CANT, 0);
	class_addmethod(c, (method)Huygens_dsp64,		"dsp64",		A_CANT, 0);
	class_addmethod(c, (method)Huygens_assist,		"assist",		A_CANT, 0);
	class_addmethod(c, (method)Huygens_float,		"float",		A_FLOAT, 0);
	class_addmethod(c, (method)Huygens_float,		"int",			A_LONG, 0);
	
	CLASS_ATTR_LONG				(c, "shape", 0, t_Huygens, f_mode);
	CLASS_ATTR_LABEL			(c, "shape", 0, "Shape of the loudspeakers array");
	CLASS_ATTR_ENUMINDEX		(c, "shape", 0, "Linear \" \"Circular");
	CLASS_ATTR_SAVE				(c, "shape", 1);
	CLASS_ATTR_FILTER_CLIP		(c, "shape", 0, 1);
	CLASS_ATTR_ORDER			(c, "shape", 0, "0");
	
	CLASS_ATTR_FLOAT			(c, "distance", 0, t_Huygens, f_speakersDistance);
	CLASS_ATTR_LABEL			(c, "distance", 0, "Distance between speakers array and listener");
	//CLASS_ATTR_ACCESSORS		(c, "distance", NULL, distance_set);
	CLASS_ATTR_SAVE				(c, "distance", 1);
	CLASS_ATTR_FILTER_MIN		(c, "distance", 0.);
	CLASS_ATTR_ORDER			(c, "distance", 0, "1");
	
	CLASS_ATTR_FLOAT			(c, "delta", 0, t_Huygens, f_speakersDelta);
	CLASS_ATTR_LABEL			(c, "delta", 0, "Distance between speakers");
	//CLASS_ATTR_ACCESSORS		(c, "delta", NULL, delta_set);
	CLASS_ATTR_SAVE				(c, "delta", 1);
	CLASS_ATTR_FILTER_MIN		(c, "delta", 0.);
	CLASS_ATTR_ORDER			(c, "delta", 0, "2");
	
	CLASS_ATTR_LONG				(c, "interpolation", 0, t_Huygens, f_interpolation);
	CLASS_ATTR_LABEL			(c, "interpolation", 0, "Delay interpolation");
	CLASS_ATTR_ENUMINDEX		(c, "interpolation", 0, "Linear \" \"Quadratic \" \"Lagrange");
	CLASS_ATTR_SAVE				(c, "interpolation", 1);
	CLASS_ATTR_FILTER_CLIP		(c, "interpolation", 0, 2);
	CLASS_ATTR_ORDER			(c, "interpolation", 0, "3");
	
	class_dspinit(c);				
	class_register(CLASS_BOX, c);	
	Huygens_class = c;
	
	post("huygens~ by Julien Colafrancesco & Pierre Guillot");
	post("Copyright (C) 2012, CICM / Universite Paris 8");
	
	return 0;
}
コード例 #4
0
ファイル: smoov.c プロジェクト: alessandrostone/max-objects
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;
}
コード例 #5
0
void C74_EXPORT ext_main(void *r)
{
	t_class *c;
	c = class_new("3Dpoltocar", (method)dpoltocar_new,0L, (short)sizeof(t_dpoltocar), 0L, A_DEFLONG, A_DEFLONG, 0);
    class_addmethod(c, (method)dpoltocar_assist	,	"assist",	A_CANT,	0L);
    class_addmethod(c, (method)dpoltocar_bang,		"bang",				0L);
    class_addmethod(c, (method)dpoltocar_list,		"list",		A_GIMME,0L);
//    class_addmethod(c, (method)dpoltocar_mode,		"mode",		A_LONG, 0L);
//    class_addmethod(c, (method)inspector_open,		"info",		A_CANT,	0L);
	
	
//	CLASS_STICKY_ATTR(c,                                "category",	0L, "3Dcartopol");
	
	CLASS_ATTR_LONG(c,                                  "mode",		0L, t_dpoltocar, d_mode);
	CLASS_ATTR_LABEL(c,                                 "mode",		0L, "angle mode");
	CLASS_ATTR_STYLE(c,                                 "mode",		0L, "enum");
	CLASS_ATTR_ENUMINDEX(c,                             "mode",		0L, "\"radians\" \"degrees\"");
	CLASS_ATTR_SAVE(c,                                  "mode",		0L );
	CLASS_ATTR_FILTER_CLIP(c,                           "mode",		0, 1);
	CLASS_ATTR_ORDER(c,                                 "mode",		0L, "0");
	
	my_pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068;
	half_pi = my_pi / 2.0;
	divide_pi = my_pi / 180.0;
	two_pi = 2.0 * my_pi;
	divide_two_pi = 1.0 / two_pi;
	class_register(CLASS_BOX, c);
	dpoltocar_class = c;
	post("·    3Dpoltocar    ·    jasch    ·    "__DATE__"    ·    © all rights reserved",0);
	return;
}
コード例 #6
0
ファイル: c.blackboard.cpp プロジェクト: CICM/CreamLibrary
extern "C" void setup_c0x2eblackboard(void)
{
    t_eclass *c;
    
    c = eclass_new("c.blackboard", (method)blackboard_new, (method)blackboard_free, (short)sizeof(t_blackboard), 0L, A_GIMME, 0);
    eclass_guiinit(c, 0);

    
    eclass_addmethod(c, (method) blackboard_paint,           "paint",            A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_notify,          "notify",           A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_getdrawparams,   "getdrawparams",    A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_oksize,          "oksize",           A_NULL, 0);
    
    eclass_addmethod(c, (method) blackboard_width,           "width",            A_FLOAT,0);
    eclass_addmethod(c, (method) blackboard_color,           "color",            A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_fill,            "fill",             A_FLOAT,0);
    
    eclass_addmethod(c, (method) blackboard_line,            "line",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_path,            "path",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_rect,            "rect",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_oval,            "oval",             A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_arc,             "arc",              A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_image,           "image",            A_GIMME,0);
    eclass_addmethod(c, (method) blackboard_text,            "text",             A_GIMME,0);
    
    eclass_addmethod(c, (method) blackboard_clear,           "clear",            A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_reset,           "reset",            A_NULL, 0);
    
    eclass_addmethod(c, (method) blackboard_mousemove,       "mousemove",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mousedrag,       "mousedrag",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mousedown,       "mousedown",        A_NULL, 0);
    eclass_addmethod(c, (method) blackboard_mouseup,         "mouseup",          A_NULL, 0);
    
    CLASS_ATTR_DEFAULT              (c, "size", 0, "200 200");
    CLASS_ATTR_INVISIBLE            (c, "send", 1);
    
    CLASS_ATTR_LONG                 (c, "chalkmode", 0, t_blackboard, f_pen_mode);
    CLASS_ATTR_LABEL                (c, "chalkmode", 0, "Chalk Mode");
    CLASS_ATTR_FILTER_CLIP          (c, "chalkmode", 0, 1);
    CLASS_ATTR_ORDER                (c, "chalkmode", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "chalkmode", 0, "1");
    CLASS_ATTR_SAVE                 (c, "chalkmode", 0);
    CLASS_ATTR_STYLE                (c, "chalkmode", 0, "onoff");
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_blackboard, 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_blackboard, 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");
    
    eclass_register(CLASS_BOX, c);
    blackboard_class = c;
}
コード例 #7
0
ファイル: strstr.c プロジェクト: ycandau/str_objects
/****************************************************************
*  Initialization
*/
void ext_main(void *r)
{
  t_class *c;

  c = class_new("strstr",
    (method)strstr_new,
    (method)strstr_free,
    (long)sizeof(t_strstr),
    (method)NULL,
    A_GIMME, 0);

  class_addmethod(c, (method)strstr_assist,   "assist",    A_CANT,  0);
  class_addmethod(c, (method)strstr_bang,     "bang",               0);
  class_addmethod(c, (method)strstr_int,      "int",       A_LONG,  0);
  class_addmethod(c, (method)strstr_float,    "float",     A_FLOAT, 0);
  class_addmethod(c, (method)strstr_list,     "list",      A_GIMME, 0);
  class_addmethod(c, (method)strstr_anything, "anything",  A_GIMME, 0);
  class_addmethod(c, (method)strstr_set,      "set",       A_GIMME, 0);
  class_addmethod(c, (method)strstr_post,     "post",               0);
  class_addmethod(c, (method)stdinletinfo,    "inletinfo", A_CANT,  0);

  CLASS_ATTR_LONG(c, "mode", 0, t_strstr, mode);
  CLASS_ATTR_ORDER(c, "mode", 0, "1");            // order
  CLASS_ATTR_LABEL(c, "mode", 0, "mode");         // label
  CLASS_ATTR_FILTER_CLIP(c, "mode", 0, 1);        // min-max filter
  CLASS_ATTR_SAVE(c, "mode", 0);                  // save with patcher
  CLASS_ATTR_SELFSAVE(c, "mode", 0);              // display as saved
  CLASS_ATTR_ACCESSORS(c, "mode", NULL, str_mode_set);

  CLASS_ATTR_LONG(c, "fprecision", 0, t_strstr, fprecision);
  CLASS_ATTR_ORDER(c, "fprecision", 0, "2");
  CLASS_ATTR_LABEL(c, "fprecision", 0, "float precision");
  CLASS_ATTR_FILTER_CLIP(c, "fprecision", 0, 10);
  CLASS_ATTR_SAVE(c, "fprecision", 0);
  CLASS_ATTR_SELFSAVE(c, "fprecision", 0);
  CLASS_ATTR_ACCESSORS(c, "fprecision", NULL, str_fprecision_set);

  class_register(CLASS_BOX, c);
  strstr_class = c;
}
コード例 #8
0
ファイル: c.tab.cpp プロジェクト: EQ4/CreamLibrary
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;

    }
}
コード例 #9
0
ファイル: c.gain~.cpp プロジェクト: rvega/CicmWrapper
extern "C"  void setup_c0x2egain_tilde(void)
{
	t_eclass *c;
    
	c = eclass_new("c.gain~", (method)gain_new, (method)gain_free, (short)sizeof(t_gain), 0L, A_GIMME, 0);
    
    eclass_dspinit(c);
	eclass_init(c, 0);
	
    eclass_addmethod(c, (method) gain_dsp,             "dsp",              A_CANT, 0);
	eclass_addmethod(c, (method) gain_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) gain_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) gain_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) gain_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) gain_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) gain_set,             "set",              A_FLOAT,0);
    eclass_addmethod(c, (method) gain_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) gain_linear,          "linear",           A_FLOAT,0);
    eclass_addmethod(c, (method) gain_bang,            "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) gain_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) gain_mousedrag,       "mousedrag",        A_CANT, 0);
    eclass_addmethod(c, (method) gain_dblclick,        "dblclick",         A_CANT, 0);
    eclass_addmethod(c, (method) gain_preset,          "preset",           A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "20. 160.");
    
    CLASS_ATTR_LONG                 (c, "mode", 0, t_gain, f_mode);
	CLASS_ATTR_LABEL                (c, "mode", 0, "Relative Mode");
	CLASS_ATTR_ORDER                (c, "mode", 0, "1");
    CLASS_ATTR_FILTER_CLIP          (c, "mode", 0, 1);
    CLASS_ATTR_DEFAULT              (c, "mode", 0, "0");
    CLASS_ATTR_SAVE                 (c, "mode", 1);
    CLASS_ATTR_STYLE                (c, "mode", 0, "onoff");
    
    CLASS_ATTR_FLOAT                (c, "ramp", 0, t_gain, f_ramp);
	CLASS_ATTR_LABEL                (c, "ramp", 0, "Ramp Time (ms)");
    CLASS_ATTR_ACCESSORS			(c, "ramp", NULL, gain_ramp_set);
	CLASS_ATTR_ORDER                (c, "ramp", 0, "1");
    CLASS_ATTR_FILTER_MIN           (c, "ramp", 0);
    CLASS_ATTR_DEFAULT              (c, "ramp", 0, "20");
    CLASS_ATTR_SAVE                 (c, "ramp", 1);
    CLASS_ATTR_STYLE                (c, "ramp", 0, "number");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_gain, 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_gain, 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, "kncolor", 0, t_gain, f_color_knob);
	CLASS_ATTR_LABEL                (c, "kncolor", 0, "Knob Color");
	CLASS_ATTR_ORDER                (c, "kncolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "kncolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "kncolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    cicm_post();
	gain_class = c;
}
コード例 #10
0
ファイル: c.knob.cpp プロジェクト: rvega/CicmWrapper
extern "C" void setup_c0x2eknob(void)
{
	t_eclass *c;
    
	c = eclass_new("c.knob", (method)knob_new, (method)knob_free, (short)sizeof(t_knob), 0L, A_GIMME, 0);
    
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) knob_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) knob_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) knob_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) knob_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) knob_oksize,          "oksize",           A_CANT, 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_CANT, 0);
    eclass_addmethod(c, (method) knob_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) knob_mousedrag,       "mousedrag",        A_CANT, 0);
    eclass_addmethod(c, (method) knob_preset,          "preset",           A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "50. 50.");
    
    CLASS_ATTR_LONG                 (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_SAVE_PAINT   (c, "endless", 0, "0");
    CLASS_ATTR_STYLE                (c, "endless", 0, "onoff");
    
    CLASS_ATTR_LONG                 (c, "mode", 0, t_knob, f_mode);
	CLASS_ATTR_LABEL                (c, "mode", 0, "Circular Mode");
	CLASS_ATTR_ORDER                (c, "mode", 0, "1");
    CLASS_ATTR_FILTER_CLIP          (c, "mode", 0, 1);
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "mode", 0, "0");
    CLASS_ATTR_STYLE                (c, "mode", 0, "onoff");
    
    CLASS_ATTR_FLOAT                (c, "min", 0, t_knob, f_min);
	CLASS_ATTR_LABEL                (c, "min", 0, "Minimum Value");
	CLASS_ATTR_ORDER                (c, "min", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "min", 0, "0.");
    CLASS_ATTR_SAVE                 (c, "min", 1);
    CLASS_ATTR_STYLE                (c, "min", 0, "number");
    
    CLASS_ATTR_FLOAT                (c, "max", 0, t_knob, f_max);
	CLASS_ATTR_LABEL                (c, "max", 0, "Maximum Value");
	CLASS_ATTR_ORDER                (c, "max", 0, "1");
    CLASS_ATTR_DEFAULT              (c, "max", 0, "1.");
    CLASS_ATTR_SAVE                 (c, "max", 1);
    CLASS_ATTR_STYLE                (c, "max", 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);
    cicm_post();
	knob_class = c;
}
コード例 #11
0
ファイル: c.plane.cpp プロジェクト: EQ4/CreamLibrary
extern "C" void setup_c0x2eplane(void)
{
    t_eclass *c = eclass_new("c.plane", (method)plane_new, (method)ebox_free, (short)sizeof(t_plane), CLASS_NOINLET, A_GIMME, 0);
    
    if(c)
    {
        eclass_guiinit(c, 0);
        
        eclass_addmethod(c, (method) plane_paint,           "paint",            A_NULL, 0);
        eclass_addmethod(c, (method) plane_notify,          "notify",           A_NULL, 0);
        eclass_addmethod(c, (method) plane_getdrawparams,   "getdrawparams",    A_NULL, 0);
        eclass_addmethod(c, (method) plane_oksize,          "oksize",           A_NULL, 0);
        
        eclass_addmethod(c, (method) plane_bang,            "bang",             A_FLOAT,0);
        eclass_addmethod(c, (method) plane_float,           "float",            A_FLOAT,0);
        eclass_addmethod(c, (method) plane_set,             "set",              A_GIMME,0);
        eclass_addmethod(c, (method) plane_list,            "list",             A_GIMME,0);
        eclass_addmethod(c, (method) plane_output,          "bang",             A_NULL, 0);
        
        eclass_addmethod(c, (method) plane_mousedown,       "mousedown",        A_NULL, 0);
        eclass_addmethod(c, (method) plane_mousedrag,       "mousedrag",        A_NULL, 0);
        eclass_addmethod(c, (method) plane_mouseup,         "mouseup",          A_NULL, 0);
        
        CLASS_ATTR_DEFAULT              (c, "size", 0, "120 120");
        
        CLASS_ATTR_FLOAT_ARRAY          (c, "bounds", 0, t_plane, f_dummy, 4);
        CLASS_ATTR_LABEL                (c, "bounds", 0, "Boundaries");
        CLASS_ATTR_ACCESSORS			(c, "bounds", plane_bounds_get, plane_bounds_set);
        CLASS_ATTR_ORDER                (c, "bounds", 0, "2");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bounds", 0, "-1. -1. 1. 1.");
        
        CLASS_ATTR_FLOAT                (c, "ptsize", 0, t_plane, f_size);
        CLASS_ATTR_LABEL                (c, "ptsize", 0, "Point size");
        CLASS_ATTR_ORDER                (c, "ptsize", 0, "3");
        CLASS_ATTR_FILTER_CLIP          (c, "ptsize", 1., 50.f);
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ptsize", 0, "5");
        CLASS_ATTR_STYLE                (c, "ptsize", 0, "number");
        CLASS_ATTR_STEP                 (c, "ptsize", 0.5);
        
        CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_plane, 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_plane, 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, "ptcolor", 0, t_plane, f_color_point);
        CLASS_ATTR_LABEL                (c, "ptcolor", 0, "Point Color");
        CLASS_ATTR_ORDER                (c, "ptcolor", 0, "3");
        CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ptcolor", 0, "0.5 0.5 0.5 1.");
        CLASS_ATTR_STYLE                (c, "ptcolor", 0, "color");
        
        eclass_register(CLASS_BOX, c);
        plane_class = c;
    }
}
コード例 #12
0
void ext_main(void *r)
#endif
{
    t_class *c;
    
    c = class_new("hoa.2d.meter~", (method)meter_new, (method)meter_free, (short)sizeof(t_meter), 0L, A_GIMME, 0);
    class_setname((char *)"hoa.2d.meter~", (char *)"hoa.2d.meter~");
    
    c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
    class_dspinitjbox(c);
    jbox_initclass(c, JBOX_COLOR);
    
    hoa_initclass(c, (method)hoa_getinfos);
    
    // @method signal @digest Array of signals to visualize.
    // @description Array of signals to visualize.
    // @marg 0 @name channel-signal @optional 0 @type signal
    class_addmethod(c, (method) meter_dsp64,		 "dsp64",		  A_CANT, 0);
    class_addmethod(c, (method) meter_assist,		 "assist",		  A_CANT, 0);
    class_addmethod(c, (method) meter_paint,		 "paint",		  A_CANT, 0);
    class_addmethod(c, (method) meter_notify,        "notify",		  A_CANT, 0);
    
    CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 150 150");
    CLASS_ATTR_INVISIBLE            (c, "color", 0);
    
    /* APPEARANCE */
    CLASS_STICKY_CATEGORY           (c, 0, "Appearance");
    CLASS_ATTR_LONG                 (c, "ledsbg", 0, t_meter, f_drawledsbg);
    CLASS_ATTR_ORDER                (c, "ledsbg", 0, "1");
    CLASS_ATTR_STYLE_LABEL          (c, "ledsbg", 0, "onoff", "Draw Leds Background");
    CLASS_ATTR_DEFAULT              (c, "ledsbg", 0, "1");
    CLASS_ATTR_SAVE                 (c, "ledsbg", 1);
    // @description Draw leds background ?
    
    CLASS_ATTR_LONG                 (c, "vectors", 0, t_meter, f_drawvector);
    CLASS_ATTR_ORDER                (c, "vectors", 0, "2");
    CLASS_ATTR_LABEL                (c, "vectors", 0, "Draw Vectors");
    CLASS_ATTR_ENUMINDEX4           (c, "vectors", 0, "none", "energy", "velocity", "both")
    CLASS_ATTR_DEFAULT              (c, "vectors", 0, "1");
    CLASS_ATTR_SAVE                 (c, "vectors", 1);
    // @description The vector(s) to draw.
    
    CLASS_ATTR_LONG                 (c, "mborder", 0, t_meter, f_drawmborder);
    CLASS_ATTR_ORDER                (c, "mborder", 0, "3");
    CLASS_ATTR_LABEL                (c, "mborder", 0, "Draw Meter Borders");
    CLASS_ATTR_ENUMINDEX4           (c, "mborder", 0, "none", "Circles", "Axes", "both")
    CLASS_ATTR_DEFAULT              (c, "mborder", 0, "3");
    CLASS_ATTR_SAVE                 (c, "mborder", 1);
    // @description The meter border(s) to draw.
    
    CLASS_ATTR_DOUBLE               (c, "metersize", 0, t_meter, f_metersize);
    CLASS_ATTR_ORDER                (c, "metersize", 0, "4");
    CLASS_ATTR_LABEL                (c, "metersize", 0, "Meter Circle Size");
    CLASS_ATTR_FILTER_CLIP          (c, "metersize", 0., 1);
    CLASS_ATTR_DEFAULT              (c, "metersize", 0, "0.8");
    CLASS_ATTR_SAVE                 (c, "metersize", 1);
    // @description The size of the inner circle of the <o>hoa.2d.meter~</o>.
    
    CLASS_ATTR_LONG                 (c, "orientation", 0, t_meter, f_direction);
    CLASS_ATTR_LABEL                (c, "orientation", 0, "Meter Fill Orientation");
    CLASS_ATTR_ORDER                (c, "orientation", 0, "5");
    CLASS_ATTR_ENUMINDEX            (c, "orientation", 0, "inside outside");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "orientation", 0, "0");
    // @description The filling orientation of the peak level indicators <o>hoa.2d.meter~</o>.
    
    CLASS_STICKY_CATEGORY_CLEAR (c);
    
    CLASS_STICKY_CATEGORY           (c, 0, "Behavior");
    CLASS_ATTR_LONG                 (c, "channels", 0 , t_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "channels", channels_get, channels_set);
    CLASS_ATTR_ORDER                (c, "channels", 0, "1");
    CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
    CLASS_ATTR_SAVE                 (c, "channels", 1);
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    // @description The number of displayed channel and peak level indicators.
    
    CLASS_ATTR_DOUBLE_VARSIZE       (c, "angles", ATTR_SET_DEFER_LOW, t_meter, f_attrs, f_attrs, MAX_UI_CHANNELS);
    CLASS_ATTR_ACCESSORS            (c, "angles", angles_get, angles_set);
    CLASS_ATTR_ORDER                (c, "angles", 0, "2");
    CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Channels");
    CLASS_ATTR_SAVE                 (c, "angles", 1);
    // @description The angles of the displayed channels and peak level indicators. Values are in degrees, wrapped between 0. and 360., so you can also set the angles with negative values.
    
    CLASS_ATTR_DOUBLE               (c, "offset", 0, t_meter, f_attrs);
    CLASS_ATTR_ACCESSORS            (c, "offset", offset_get, offset_set);
    CLASS_ATTR_ORDER                (c, "offset", 0, "3");
    CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
    CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
    CLASS_ATTR_SAVE                 (c, "offset", 1);
    // @description Display offset of channels and peak level indicators. the value is in degree, clipped between -180. and 180.
    
    CLASS_ATTR_LONG                 (c, "rotation", 0, t_meter, f_rotation);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
    CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
    CLASS_ATTR_ENUMINDEX            (c, "rotation", 0, "clockwise anti-clockwise");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation",0, "1");
    // @description The rotation can either be <b>clockwise</b> or <b>anti-clockwise</b>
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_meter, f_interval);
    CLASS_ATTR_ORDER                (c, "interval", 0, "5");
    CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
    CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
    CLASS_ATTR_DEFAULT              (c, "interval", 0, "50");
    CLASS_ATTR_SAVE                 (c, "interval", 1);
    // @description The refresh interval time in milliseconds.
    
    CLASS_STICKY_CATEGORY_CLEAR     (c);
    
    CLASS_ATTR_LONG                 (c, "dbperled", 0, t_meter, f_dbperled);
    CLASS_ATTR_CATEGORY             (c, "dbperled", 0, "Value");
    CLASS_ATTR_ORDER                (c, "dbperled", 0, "4");
    CLASS_ATTR_LABEL                (c, "dbperled", 0, "DeciBels per Led");
    CLASS_ATTR_FILTER_CLIP          (c, "dbperled", 1, 12);
    CLASS_ATTR_DEFAULT              (c, "dbperled", 0, "3");
    CLASS_ATTR_SAVE                 (c, "dbperled", 1);
    // @description Sets the amount of signal level in deciBels represented by each LED. By default each LED represents a 3dB change in volume from its neighboring LEDs.
    
    CLASS_ATTR_LONG                 (c, "nhotleds", 0, t_meter, f_nhotleds);
    CLASS_ATTR_CATEGORY             (c, "nhotleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "nhotleds", 0, "5");
    CLASS_ATTR_LABEL                (c, "nhotleds", 0, "Number of Hot Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "nhotleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "nhotleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "nhotleds", 1);
    // @description Sets the total number "hot" warning LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>hotcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "ntepidleds", 0, t_meter, f_ntepidleds);
    CLASS_ATTR_CATEGORY             (c, "ntepidleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "ntepidleds", 0, "6");
    CLASS_ATTR_LABEL                (c, "ntepidleds", 0, "Number of Tepid Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "ntepidleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "ntepidleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "ntepidleds", 1);
    // @description Sets the total number "tepid" mid-range LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>tepidcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "nwarmleds", 0, t_meter, f_nwarmleds);
    CLASS_ATTR_CATEGORY             (c, "nwarmleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "nwarmleds", 0, "7");
    CLASS_ATTR_LABEL                (c, "nwarmleds", 0, "Number of Warm Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "nwarmleds", 0, 20);
    CLASS_ATTR_DEFAULT              (c, "nwarmleds", 0, "3");
    CLASS_ATTR_SAVE                 (c, "nwarmleds", 1);
    // @description Sets the total number "warm" lower-mid-range LEDs displayed on the <o>hoa.2d.meter~</o> object (corresponding to the color set by the <b>warmcolor</b> message).
    
    CLASS_ATTR_LONG                 (c, "numleds", 0, t_meter, f_numleds);
    CLASS_ATTR_CATEGORY             (c, "numleds", 0, "Value");
    CLASS_ATTR_ORDER                (c, "numleds", 0, "8");
    CLASS_ATTR_LABEL                (c, "numleds", 0, "Total Number of Leds");
    CLASS_ATTR_FILTER_CLIP          (c, "numleds", 10, 20);
    CLASS_ATTR_DEFAULT              (c, "numleds", 0, "12");
    CLASS_ATTR_SAVE                 (c, "numleds", 1);
    // @description The word numleds, followed by a number between 10 and 20, sets the total number of LEDs displayed on the <o>hoa.2d.meter~</o> object. The range is 10-20 LEDs.
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_meter, f_color_bg);
    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.");
    // @description Sets the RGBA values for the background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "mbgcolor", 0, t_meter, f_color_mbg);
    CLASS_ATTR_LABEL                (c, "mbgcolor", 0, "Meter Background Color");
    CLASS_ATTR_CATEGORY             (c, "mbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "mbgcolor", 0, "rgba");
    CLASS_ATTR_ORDER                (c, "mbgcolor", 0, "2");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "mbgcolor", 0, "0.61 0.61 0.61 1.");
    // @description Sets the RGBA values for the filled circle background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "ledbgcolor", 0, t_meter, f_color_ledbg);
    CLASS_ATTR_LABEL                (c, "ledbgcolor", 0, "Leds Background Color");
    CLASS_ATTR_CATEGORY             (c, "ledbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "ledbgcolor", 0, "rgba");
    CLASS_ATTR_ORDER                (c, "ledbgcolor", 0, "3");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ledbgcolor", 0, "0. 0. 0. 0.05");
    // @description Sets the RGBA values for leds background color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_meter, f_color_cold);
    CLASS_ATTR_CATEGORY             (c, "coldcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "coldcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
    CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
    // @description Sets the RGBA values for the cold signal color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_meter, f_color_tepid);
    CLASS_ATTR_CATEGORY             (c, "tepidcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "tepidcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
    CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the lower-middle "tepid" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_meter, f_color_warm);
    CLASS_ATTR_CATEGORY             (c, "warmcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "warmcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
    CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for upper-middle "warm" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_meter, f_color_hot);
    CLASS_ATTR_CATEGORY             (c, "hotcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "hotcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
    CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the upper "hot" range of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "overloadcolor", 0, t_meter, f_color_over);
    CLASS_ATTR_CATEGORY             (c, "overloadcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "overloadcolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "overloadcolor", 0, "Overload Signal Color");
    CLASS_ATTR_ORDER                (c, "overloadcolor", 0, "8");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overloadcolor", 0, "1. 0. 0. 0.8");
    // @description Sets the RGBA values for the LEDs color for the "over" indicator of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_meter, f_color_energy);
    CLASS_ATTR_CATEGORY             (c, "energycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "energycolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "energycolor", 0, "Energy Vector Color");
    CLASS_ATTR_ORDER                (c, "energycolor", 0, "9");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "energycolor", 0, "0. 0. 1. 0.8");
    // @description Sets the RGBA values for the energy vector color of the <o>hoa.2d.meter~</o> object
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_meter, f_color_velocity);
    CLASS_ATTR_CATEGORY             (c, "velocitycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "velocitycolor", 0, "rgba");
    CLASS_ATTR_LABEL                (c, "velocitycolor", 0, "Velocity Vector Color");
    CLASS_ATTR_ORDER                (c, "velocitycolor", 0, "9");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "velocitycolor", 0, "1. 0. 0. 0.8");
    // @description Sets the RGBA values for the velocity vector color of the <o>hoa.2d.meter~</o> object
    
    class_register(CLASS_BOX, c);
    class_alias(c, gensym("hoa.meter~"));
    meter_class = c;
}
コード例 #13
0
ファイル: c.textfield.c プロジェクト: rvega/CicmWrapper
void setup_c0x2efilterview(void)
{
	t_eclass *c;
    
	c = eclass_new("c.filterview", (method)filterview_new, (method)filterview_free, (short)sizeof(t_filterview), 0L, A_GIMME, 0);
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) filterview_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) filterview_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) filterview_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) filterview_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) filterview_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) filterview_set,             "set",              A_GIMME,0);
    eclass_addmethod(c, (method) filterview_list,            "list",            A_GIMME,0);
    eclass_addmethod(c, (method) filterview_output,          "bang",             A_CANT, 0);
    
    eclass_addmethod(c, (method) filterview_mousedrag,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) filterview_mousedrag,       "mousedrag",        A_CANT, 0);
    
    eclass_addmethod(c, (method) filterview_preset,          "preset",           A_CANT, 0);
    
	CLASS_ATTR_DEFAULT              (c, "size", 0, "200 120");
    
    CLASS_ATTR_LONG                 (c, "type", 0, t_filterview, f_type);
	CLASS_ATTR_LABEL                (c, "type", 0, "Filter Type");
    CLASS_ATTR_ACCESSORS			(c, "type", NULL, filterview_type_set);
	CLASS_ATTR_ORDER                (c, "type", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "type", 0, "0.");
    
    CLASS_ATTR_FLOAT                (c, "frequency", 0, t_filterview, f_frequency);
	CLASS_ATTR_LABEL                (c, "frequency", 0, "Boundaries");
	CLASS_ATTR_ORDER                (c, "frequency", 0, "1");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "frequency", 0, "40.");
    
    CLASS_ATTR_FLOAT                (c, "gain", 0, t_filterview, f_gain_factor);
	CLASS_ATTR_LABEL                (c, "gain", 0, "Point size");
	CLASS_ATTR_ORDER                (c, "gain", 0, "3");
    CLASS_ATTR_FILTER_CLIP          (c, "gain", 5., 50.f);
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "gain", 0, "5");
    
    CLASS_ATTR_FLOAT                (c, "factor", 0, t_filterview, f_q_factor);
	CLASS_ATTR_LABEL                (c, "factor", 0, "Point size");
	CLASS_ATTR_ORDER                (c, "factor", 0, "3");
    CLASS_ATTR_FILTER_CLIP          (c, "factor", 5., 50.f);
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "factor", 0, "5");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_filterview, 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_RGBA                 (c, "bdcolor", 0, t_filterview, f_color_border);
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Box 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_RGBA                 (c, "ptcolor", 0, t_filterview, f_color_point);
	CLASS_ATTR_LABEL                (c, "ptcolor", 0, "Point Color");
	CLASS_ATTR_ORDER                (c, "ptcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ptcolor", 0, "0. 0. 0. 1");
	
	
    eclass_register(CLASS_NOBOX, c);
	filterview_class = c;
}
コード例 #14
0
int C74_EXPORT main()
{
	t_class *c;
    
	c = class_new("hoa.2d.meter~", (method)meter_new, (method)meter_free, (short)sizeof(t_meter), 0L, A_GIMME, 0);
    class_alias(c, gensym("hoa.meter~"));
    
	c->c_flags |= CLASS_FLAG_NEWDICTIONARY;
	class_dspinitjbox(c);
	jbox_initclass(c, JBOX_COLOR | JBOX_FIXWIDTH);
	
    hoa_initclass(c, (method)hoa_getinfos);
	class_addmethod(c, (method) meter_dsp64,		 "dsp64",		  A_CANT, 0);
	class_addmethod(c, (method) meter_assist,		 "assist",		  A_CANT, 0);
	class_addmethod(c, (method) meter_paint,		 "paint",		  A_CANT, 0);
	class_addmethod(c, (method) meter_notify,        "notify",		  A_CANT, 0);
    class_addmethod(c, (method) meter_getdrawparams, "getdrawparams", A_CANT, 0);
    
	CLASS_ATTR_DEFAULT              (c, "patching_rect", 0, "0 0 225 225");
	CLASS_ATTR_INVISIBLE            (c, "color", 0);
	
	/* APPEARANCE */
    CLASS_STICKY_CATEGORY           (c, 0, "Appearance");
	CLASS_ATTR_LONG                 (c, "drawledsbg", 0, t_meter, f_drawledsbg);
	CLASS_ATTR_ORDER                (c, "drawledsbg", 0, "1");
	CLASS_ATTR_STYLE_LABEL          (c, "drawledsbg", 0, "onoff", "Draw Leds Background");
	CLASS_ATTR_DEFAULT              (c, "drawledsbg", 0, "1");
	CLASS_ATTR_SAVE                 (c, "drawledsbg", 1);
	
	CLASS_ATTR_LONG                 (c, "drawvector", 0, t_meter, f_drawvector);
	CLASS_ATTR_ORDER                (c, "drawvector", 0, "2");
    CLASS_ATTR_LABEL                (c, "drawvector", 0, "Draw Vectors");
    CLASS_ATTR_ENUMINDEX4           (c, "drawvector", 0, "none", "energy", "velocity", "both")
	CLASS_ATTR_DEFAULT              (c, "drawvector", 0, "1");
	CLASS_ATTR_SAVE                 (c, "drawvector", 1);
    
    CLASS_ATTR_LONG                 (c, "drawmborder", 0, t_meter, f_drawmborder);
	CLASS_ATTR_ORDER                (c, "drawmborder", 0, "3");
    CLASS_ATTR_LABEL                (c, "drawmborder", 0, "Draw Meter Borders");
    CLASS_ATTR_ENUMINDEX4           (c, "drawmborder", 0, "none", "Circles", "Axes", "both")
	CLASS_ATTR_DEFAULT              (c, "drawmborder", 0, "3");
	CLASS_ATTR_SAVE                 (c, "drawmborder", 1);
	
	CLASS_ATTR_DOUBLE               (c, "metersize", 0, t_meter, f_metersize);
	CLASS_ATTR_ORDER                (c, "metersize", 0, "4");
	CLASS_ATTR_LABEL                (c, "metersize", 0, "Meter Circle Size");
	CLASS_ATTR_FILTER_CLIP          (c, "metersize", 0., 1);
	CLASS_ATTR_DEFAULT              (c, "metersize", 0, "0.8");
	CLASS_ATTR_SAVE                 (c, "metersize", 1);
    
    CLASS_ATTR_LONG                 (c, "orientation", 0, t_meter, f_direction);
	CLASS_ATTR_LABEL                (c, "orientation", 0, "Meter Fill Orientation");
    CLASS_ATTR_ORDER                (c, "orientation", 0, "5");
	CLASS_ATTR_ENUMINDEX            (c, "orientation", 0, "inside outside");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c,"orientation",0, "0");
    CLASS_STICKY_CATEGORY_CLEAR (c);
	
    CLASS_STICKY_CATEGORY           (c, 0, "Behavior");
	CLASS_ATTR_LONG                 (c, "channels", 0 , t_meter, f_number_of_channels);
    CLASS_ATTR_ACCESSORS            (c, "channels", NULL, number_of_channels_set);
	CLASS_ATTR_ORDER                (c, "channels", 0, "1");
	CLASS_ATTR_LABEL                (c, "channels", 0, "Number of Channels");
	CLASS_ATTR_SAVE                 (c, "channels", 1);
    CLASS_ATTR_DEFAULT              (c, "channels", 0, "4");
    
	CLASS_ATTR_DOUBLE_VARSIZE       (c, "angles", 0, t_meter,f_angles_of_channels, f_number_of_channels, MAX_SPEAKER);
	CLASS_ATTR_ACCESSORS            (c, "angles", NULL, angles_of_channels_set);
	CLASS_ATTR_ORDER                (c, "angles", 0, "2");
	CLASS_ATTR_LABEL                (c, "angles", 0, "Angles of Loudspeakers");
    CLASS_ATTR_SAVE                 (c, "angles", 1);
    
	CLASS_ATTR_DOUBLE               (c, "offset", 0, t_meter, f_offset_of_channels);
	CLASS_ATTR_ORDER                (c, "offset", 0, "3");
	CLASS_ATTR_LABEL                (c, "offset", 0, "Offset of Channels");
	CLASS_ATTR_DEFAULT              (c, "offset", 0, "0");
	CLASS_ATTR_SAVE                 (c, "offset", 1);
    
    CLASS_ATTR_LONG                 (c, "rotation", 0, t_meter, f_rotation);
    CLASS_ATTR_ORDER                (c, "rotation", 0, "4");
	CLASS_ATTR_LABEL                (c, "rotation", 0, "Rotation of Channels");
	CLASS_ATTR_ENUMINDEX            (c, "rotation", 0, "clockwise anti-clockwise");
    CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "rotation",0, "1");
    
    CLASS_ATTR_LONG                 (c, "interval", 0, t_meter, f_interval);
	CLASS_ATTR_ORDER                (c, "interval", 0, "5");
	CLASS_ATTR_LABEL                (c, "interval", 0, "Refresh Interval in Milliseconds");
	CLASS_ATTR_FILTER_MIN           (c, "interval", 20);
	CLASS_ATTR_DEFAULT              (c, "interval", 0, "50");
	CLASS_ATTR_SAVE                 (c, "interval", 1);
    CLASS_STICKY_CATEGORY_CLEAR     (c);
	
	CLASS_ATTR_LONG                 (c, "dbperled", 0, t_meter, f_dbperled);
    CLASS_ATTR_CATEGORY             (c, "dbperled", 0, "Value");
	CLASS_ATTR_ORDER                (c, "dbperled", 0, "4");
	CLASS_ATTR_LABEL                (c, "dbperled", 0, "DeciBels per Led");
	CLASS_ATTR_FILTER_CLIP          (c, "dbperled", 1, 12);
	CLASS_ATTR_DEFAULT              (c, "dbperled", 0, "3");
	CLASS_ATTR_SAVE                 (c, "dbperled", 1);
	
	CLASS_ATTR_LONG                 (c, "nhotleds", 0, t_meter, f_nhotleds);
    CLASS_ATTR_CATEGORY             (c, "nhotleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "nhotleds", 0, "5");
	CLASS_ATTR_LABEL                (c, "nhotleds", 0, "Number of Hot Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "nhotleds", 0, 20);
	CLASS_ATTR_DEFAULT              (c, "nhotleds", 0, "3");
	CLASS_ATTR_SAVE                 (c, "nhotleds", 1);
	
	CLASS_ATTR_LONG                 (c, "ntepidleds", 0, t_meter, f_ntepidleds);
    CLASS_ATTR_CATEGORY             (c, "ntepidleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "ntepidleds", 0, "6");
	CLASS_ATTR_LABEL                (c, "ntepidleds", 0, "Number of Tepid Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "ntepidleds", 0, 20);
	CLASS_ATTR_DEFAULT              (c, "ntepidleds", 0, "3");
	CLASS_ATTR_SAVE                 (c, "ntepidleds", 1);
	
	CLASS_ATTR_LONG                 (c, "nwarmleds", 0, t_meter, f_nwarmleds);
    CLASS_ATTR_CATEGORY             (c, "nwarmleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "nwarmleds", 0, "7");
	CLASS_ATTR_LABEL                (c, "nwarmleds", 0, "Number of Warm Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "nwarmleds", 0, 20);
	CLASS_ATTR_DEFAULT              (c, "nwarmleds", 0, "3");
	CLASS_ATTR_SAVE                 (c, "nwarmleds", 1);
	
	CLASS_ATTR_LONG                 (c, "numleds", 0, t_meter, f_numleds);
    CLASS_ATTR_CATEGORY             (c, "numleds", 0, "Value");
	CLASS_ATTR_ORDER                (c, "numleds", 0, "8");
	CLASS_ATTR_LABEL                (c, "numleds", 0, "Total Number of Leds");
	CLASS_ATTR_FILTER_CLIP          (c, "numleds", 10, 20);
	CLASS_ATTR_DEFAULT              (c, "numleds", 0, "12");
	CLASS_ATTR_SAVE                 (c, "numleds", 1);
    
    
    CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_meter, f_color_bg);
	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, "bdcolor", 0, t_meter, f_color_bd);
	CLASS_ATTR_CATEGORY             (c, "bdcolor", 0, "Color");
	CLASS_ATTR_STYLE                (c, "bdcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "bdcolor", 0, "Border Color");
	CLASS_ATTR_ORDER                (c, "bdcolor", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bdcolor", 0, "0.7 0.7 0.7 1.");
    
	CLASS_ATTR_RGBA                 (c, "mbgcolor", 0, t_meter, f_color_mbg);
	CLASS_ATTR_LABEL                (c, "mbgcolor", 0, "Meter Background Color");
    CLASS_ATTR_CATEGORY             (c, "mbgcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "mbgcolor", 0, "rgba");
	CLASS_ATTR_ORDER                (c, "mbgcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "mbgcolor", 0, "0.61 0.61 0.61 1.");
	
	CLASS_ATTR_RGBA                 (c, "coldcolor", 0, t_meter, f_color_cold);
    CLASS_ATTR_CATEGORY             (c, "coldcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "coldcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "coldcolor", 0, "Cold Signal Color");
	CLASS_ATTR_ORDER                (c, "coldcolor", 0, "4");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "coldcolor", 0, "0. 0.6 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "tepidcolor", 0, t_meter, f_color_tepid);
    CLASS_ATTR_CATEGORY             (c, "tepidcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "tepidcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "tepidcolor", 0, "Tepid Signal Color");
	CLASS_ATTR_ORDER                (c, "tepidcolor", 0, "5");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "tepidcolor", 0, "0.6 0.73 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "warmcolor", 0, t_meter, f_color_warm);
    CLASS_ATTR_CATEGORY             (c, "warmcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "warmcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "warmcolor", 0, "Warm Signal Color");
	CLASS_ATTR_ORDER                (c, "warmcolor", 0, "6");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "warmcolor", 0, ".85 .85 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "hotcolor", 0, t_meter, f_color_hot);
    CLASS_ATTR_CATEGORY             (c, "hotcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "hotcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "hotcolor", 0, "Hot Signal Color");
	CLASS_ATTR_ORDER                (c, "hotcolor", 0, "7");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "hotcolor", 0, "1. 0.6 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "overcolor", 0, t_meter, f_color_over);
    CLASS_ATTR_CATEGORY             (c, "overcolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "overcolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "overcolor", 0, "Overload Signal Color");
	CLASS_ATTR_ORDER                (c, "overcolor", 0, "8");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "overcolor", 0, "1. 0. 0. 0.8");
	
	CLASS_ATTR_RGBA                 (c, "energycolor", 0, t_meter, f_color_energy);
    CLASS_ATTR_CATEGORY             (c, "energycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "energycolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "energycolor", 0, "Energy Vector Color");
	CLASS_ATTR_ORDER                (c, "energycolor", 0, "9");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "energycolor", 0, "0. 0. 1. 0.8");
    
    CLASS_ATTR_RGBA                 (c, "velocitycolor", 0, t_meter, f_color_velocity);
    CLASS_ATTR_CATEGORY             (c, "velocitycolor", 0, "Color");
    CLASS_ATTR_STYLE                (c, "velocitycolor", 0, "rgba");
	CLASS_ATTR_LABEL                (c, "velocitycolor", 0, "Velocity Vector Color");
	CLASS_ATTR_ORDER                (c, "velocitycolor", 0, "9");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "velocitycolor", 0, "1. 0. 0. 0.8");
	
	class_register(CLASS_BOX, c);
	meter_class = c;
    
    s_velocity_layer    = gensym("velocity_layer");
	s_energy_layer		= gensym("energy_layer");
    s_leds_layer        = gensym("leds_layer");
    s_separator_layer   = gensym("separator_layer");
    s_skeleton_layer    = gensym("skeleton_layer");
	return 0;
}
コード例 #15
0
ファイル: c.plane.cpp プロジェクト: rvega/CicmWrapper
extern "C" void setup_c0x2eplane(void)
{
	t_eclass *c;
    
	c = eclass_new("c.plane", (method)plane_new, (method)plane_free, (short)sizeof(t_plane), 0L, A_GIMME, 0);
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) plane_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) plane_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) plane_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) plane_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) plane_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) plane_set,             "set",              A_GIMME,0);
    eclass_addmethod(c, (method) plane_list,            "list",            A_GIMME,0);
    eclass_addmethod(c, (method) plane_output,          "bang",             A_CANT, 0);
    
    eclass_addmethod(c, (method) plane_mousedrag,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) plane_mousedrag,       "mousedrag",        A_CANT, 0);
    
    eclass_addmethod(c, (method) plane_preset,          "preset",           A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "120 120");
    
    CLASS_ATTR_FLOAT_ARRAY          (c, "bound", 0, t_plane, f_boundaries, 4);
	CLASS_ATTR_LABEL                (c, "bound", 0, "Boundaries");
    CLASS_ATTR_ACCESSORS			(c, "bound", NULL, plane_bound_set);
	CLASS_ATTR_ORDER                (c, "bound", 0, "2");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "bound", 0, "-1. -1. 1. 1.");
    
    CLASS_ATTR_FLOAT                (c, "ptsize", 0, t_plane, f_size);
	CLASS_ATTR_LABEL                (c, "ptsize", 0, "Point size");
	CLASS_ATTR_ORDER                (c, "ptsize", 0, "3");
    CLASS_ATTR_FILTER_CLIP          (c, "ptsize", 5., 50.f);
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ptsize", 0, "5");
    CLASS_ATTR_STYLE                (c, "ptsize", 0, "number");
    CLASS_ATTR_STEP                 (c, "ptsize", 0.5);
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_plane, 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_plane, 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, "ptcolor", 0, t_plane, f_color_point);
	CLASS_ATTR_LABEL                (c, "ptcolor", 0, "Point Color");
	CLASS_ATTR_ORDER                (c, "ptcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "ptcolor", 0, "0. 0. 0. 1");
	CLASS_ATTR_STYLE                (c, "ptcolor", 0, "color");
	
    eclass_register(CLASS_BOX, c);
    cicm_post();
	plane_class = c;
}
コード例 #16
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;    
}
コード例 #17
0
ファイル: c.knob.cpp プロジェクト: EQ4/CreamLibrary
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;
    }
}
コード例 #18
0
ファイル: c.radio.cpp プロジェクト: rvega/CicmWrapper
extern "C" void setup_c0x2eradio(void)
{
	t_eclass *c;
    
	c = eclass_new("c.radio", (method)radio_new, (method)radio_free, (short)sizeof(t_radio), 0L, A_GIMME, 0);
    
	eclass_init(c, 0);
	
	eclass_addmethod(c, (method) radio_assist,          "assist",           A_CANT, 0);
	eclass_addmethod(c, (method) radio_paint,           "paint",            A_CANT, 0);
	eclass_addmethod(c, (method) radio_notify,          "notify",           A_CANT, 0);
    eclass_addmethod(c, (method) radio_getdrawparams,   "getdrawparams",    A_CANT, 0);
    eclass_addmethod(c, (method) radio_oksize,          "oksize",           A_CANT, 0);
    eclass_addmethod(c, (method) radio_set,             "set",              A_GIMME,0);
    eclass_addmethod(c, (method) radio_list,            "list",             A_GIMME,0);
    eclass_addmethod(c, (method) radio_float,           "float",            A_FLOAT,0);
    eclass_addmethod(c, (method) radio_bang,            "bang",             A_CANT, 0);
    eclass_addmethod(c, (method) radio_mousedown,       "mousedown",        A_CANT, 0);
    eclass_addmethod(c, (method) radio_preset,          "preset",           A_CANT, 0);
    
    CLASS_ATTR_INVISIBLE            (c, "fontname", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontweight", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontslant", 1);
    CLASS_ATTR_INVISIBLE            (c, "fontsize", 1);
	CLASS_ATTR_DEFAULT              (c, "size", 0, "15. 120.");
    
    CLASS_ATTR_LONG                 (c, "nitems", 0, t_radio, f_nitems);
	CLASS_ATTR_LABEL                (c, "nitems", 0, "Number of Items");
    CLASS_ATTR_ACCESSORS			(c, "nitems", NULL, radio_nitems_set);
	CLASS_ATTR_ORDER                (c, "nitems", 0, "1");
    CLASS_ATTR_FILTER_CLIP          (c, "nitems", 1, 256);
    CLASS_ATTR_DEFAULT              (c, "nitems", 0, "8");
    CLASS_ATTR_SAVE                 (c, "nitems", 1);
    CLASS_ATTR_STYLE                (c, "nitems", 0, "number");
    
    CLASS_ATTR_LONG                 (c, "mode", 0, t_radio, f_mode);
	CLASS_ATTR_LABEL                (c, "mode", 0, "Check List Mode");
    CLASS_ATTR_ACCESSORS			(c, "mode", NULL, radio_mode_set);
	CLASS_ATTR_ORDER                (c, "mode", 0, "1");
    CLASS_ATTR_FILTER_CLIP          (c, "mode", 0, 1);
    CLASS_ATTR_DEFAULT              (c, "mode", 0, "0");
    CLASS_ATTR_SAVE                 (c, "mode", 1);
    CLASS_ATTR_STYLE                (c, "mode", 0, "onoff");
    
	CLASS_ATTR_RGBA                 (c, "bgcolor", 0, t_radio, 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_radio, 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, "itcolor", 0, t_radio, f_color_item);
	CLASS_ATTR_LABEL                (c, "itcolor", 0, "Item Color");
	CLASS_ATTR_ORDER                (c, "itcolor", 0, "3");
	CLASS_ATTR_DEFAULT_SAVE_PAINT   (c, "itcolor", 0, "0.5 0.5 0.5 1.");
	CLASS_ATTR_STYLE                (c, "itcolor", 0, "color");
    
    eclass_register(CLASS_BOX, c);
    cicm_post();
	radio_class = c;
}