本文整理汇总了C++中ebox_redraw函数的典型用法代码示例。如果您正苦于以下问题:C++ ebox_redraw函数的具体用法?C++ ebox_redraw怎么用?C++ ebox_redraw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ebox_redraw函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: tab_set
static void tab_set(t_tab *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
t_symbol* item;
if(argc && argv && atom_gettype(argv) == A_FLOAT)
{
ebox_parameter_setvalue((t_ebox *)x, 1, atom_getfloat(argv), 0);
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
ebox_redraw((t_ebox *)x);
}
else if(argc && argv && atom_gettype(argv) == A_SYMBOL)
{
item = tab_gensym(NULL, argc, argv);
if(item)
{
for(i = 0; i < x->f_nitems; i++)
{
if(x->f_items[i] == item)
{
ebox_parameter_setvalue((t_ebox *)x, 1, (float)i, 0);
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
ebox_redraw((t_ebox *)x);
return;
}
}
}
}
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:28,代码来源:c.tab.cpp
示例2: knob_mousedrag
static void knob_mousedrag(t_knob *x, t_object *patcherview, t_pt pt, long modifiers)
{
t_rect rect;
ebox_get_rect_for_view((t_ebox *)x, &rect);
if(x->f_circular)
{
const float size = rect.width * 0.5f;
const float angle = pd_angle(pt.x - size, -(size - pt.y));
if(x->f_endless)
{
const float value = pd_wrap((angle - EPD_PI2) / EPD_2PI, 0.f, 1.f);
if(ebox_parameter_isinverted((t_ebox *)x, 1))
{
ebox_parameter_setvalue_normalized((t_ebox *)x, 1, 1.f - value, 1);
}
else
{
ebox_parameter_setvalue_normalized((t_ebox *)x, 1, value, 1);
}
}
else
{
const float value = (pd_clip(pd_wrap((angle - EPD_PI2) / EPD_2PI, 0.f, 1.f), 0.125f, 0.875f) - 0.125f) / 0.75f;
if(ebox_parameter_isinverted((t_ebox *)x, 1))
{
ebox_parameter_setvalue_normalized((t_ebox *)x, 1, 1.f - value, 1);
}
else
{
ebox_parameter_setvalue_normalized((t_ebox *)x, 1, value, 1);
}
}
knob_output(x);
ebox_invalidate_layer((t_ebox *)x, cream_sym_needle_layer);
ebox_redraw((t_ebox *)x);
}
else
{
const float current = ebox_parameter_getvalue_normalized((t_ebox *)x, 1);
const float diff = (x->f_reference - pt.y) / (rect.width) * (ebox_parameter_isinverted((t_ebox *)x, 1) ? -1.f : 1.f);
if(x->f_endless)
{
ebox_parameter_setvalue_normalized((t_ebox *)x, 1, pd_wrap(current + diff, 0.f, 1.f), 1);
}
else
{
ebox_parameter_setvalue_normalized((t_ebox *)x, 1, pd_clip(current + diff, 0.f, 1.f), 1);
}
x->f_reference = pt.y;
}
knob_output(x);
ebox_invalidate_layer((t_ebox *)x, cream_sym_needle_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:55,代码来源:c.knob.cpp
示例3: blackboard_image
static void blackboard_image(t_blackboard *x, t_symbol *s, int argc, t_atom *argv)
{
int fd;
char path[MAXPDSTRING];
char name[MAXPDSTRING];
char *nameptr;
if(x->f_ninstructions >= _blackboard::maxcmd)
{
pd_error(x, "%s too many drawing commands.", eobj_getclassname(x)->s_name);
return;
}
if(argc > 2 && argv)
{
if(atom_gettype(argv) == A_FLOAT && atom_gettype(argv+1) == A_FLOAT && atom_gettype(argv+2) == A_SYMBOL)
{
sprintf(path, "%s",atom_getsymbol(argv+2)->s_name);
if(access(path, O_RDONLY) != -1)
{
sprintf(x->f_instructions[x->f_ninstructions], "create image %d %d -anchor nw -image [image create photo -file %s]", (int)atom_getfloat(argv), (int)atom_getfloat(argv+1), path);
x->f_ninstructions++;
ebox_redraw((t_ebox *)x);
return;
}
sprintf(path, "%s/%s", canvas_getdir(x->j_box.b_obj.o_canvas)->s_name, atom_getsymbol(argv+2)->s_name);
if(access(path, O_RDONLY) != -1)
{
sprintf(x->f_instructions[x->f_ninstructions], "create image %d %d -anchor nw -image [image create photo -file %s]", (int)atom_getfloat(argv), (int)atom_getfloat(argv+1), path);
x->f_ninstructions++;
ebox_redraw((t_ebox *)x);
return;
}
sprintf(name, "%s", atom_getsymbol(argv+2)->s_name);
if(!strncmp(name+strlen(name)-4, ".gif", 4))
{
strncpy(name+strlen(name)-4, "\0", 4);
}
fd = open_via_path(canvas_getdir(x->j_box.b_obj.o_canvas)->s_name, name, ".gif", path, &nameptr, MAXPDSTRING, 0);
if(fd >= 0)
{
sprintf(x->f_instructions[x->f_ninstructions], "create image %d %d -anchor nw -image [image create photo -file %s/%s.gif]", (int)atom_getfloat(argv), (int)atom_getfloat(argv+1), path, name);
x->f_ninstructions++;
ebox_redraw((t_ebox *)x);
return;
}
}
}
}
开发者ID:CICM,项目名称:CreamLibrary,代码行数:54,代码来源:c.blackboard.cpp
示例4: plane_float
static void plane_float(t_plane *x, float f)
{
ebox_parameter_setvalue((t_ebox *)x, 1, f, eobj_getproxy(x) + 1);
plane_output(x);
ebox_invalidate_layer((t_ebox *)x, cream_sym_points_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:7,代码来源:c.plane.cpp
示例5: blackboard_text
static void blackboard_text(t_blackboard *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
char buffer[MAXPDSTRING];
size_t length;
if(x->f_ninstructions >= _blackboard::maxcmd)
{
pd_error(x, "%s too many drawing commands.", eobj_getclassname(x)->s_name);
return;
}
if(argc > 2 && argv)
{
if (atom_gettype(argv) == A_FLOAT && atom_gettype(argv+1) == A_FLOAT)
{
sprintf(x->f_instructions[x->f_ninstructions], "create text %d %d -anchor nw -text {", (int)atom_getfloat(argv), (int)atom_getfloat(argv+1));
for(i = 2; i < argc; i++)
{
atom_string(argv+i, buffer, MAXPDSTRING);
length = strlen(buffer);
strncat(x->f_instructions[x->f_ninstructions], " ", 1);
strncat(x->f_instructions[x->f_ninstructions], buffer, length);
}
sprintf(buffer, "} -font {%s %d %s} -fill %s", x->j_box.b_font.c_family->s_name, (int)x->j_box.b_font.c_size, x->j_box.b_font.c_weight->s_name, x->f_color->s_name);
length = strlen(buffer);
strncat(x->f_instructions[x->f_ninstructions], buffer, length);
x->f_ninstructions++;
ebox_redraw((t_ebox *)x);
}
}
}
开发者ID:CICM,项目名称:CreamLibrary,代码行数:35,代码来源:c.blackboard.cpp
示例6: hoa_meter_tick
void hoa_meter_tick(t_hoa_meter *x)
{
if(x->f_vector_type == hoa_sym_both)
x->f_vector->process(x->f_signals, x->f_vector_coords);
else if(x->f_vector_type == hoa_sym_velocity)
x->f_vector->processVelocity(x->f_signals, x->f_vector_coords);
else if(x->f_vector_type == hoa_sym_energy)
x->f_vector->processEnergy(x->f_signals, x->f_vector_coords + 2);
double peak;
for (int i = 0; i < x->f_meter->getNumberOfChannels(); i++)
{
peak = x->f_meter->getChannelEnergy(i);
if(peak >= 0.)
x->f_over_leds[i] = 1000;
else
x->f_over_leds[i] -= x->f_interval;
if(x->f_over_leds[i] < 0)
x->f_over_leds[i] = 0;
}
ebox_invalidate_layer((t_ebox *)x, hoa_sym_leds_layer);
ebox_invalidate_layer((t_ebox *)x, hoa_sym_vector_layer);
ebox_redraw((t_ebox *)x);
if (sys_getdspstate())
clock_delay(x->f_clock, x->f_interval);
}
开发者ID:sfm1234,项目名称:HoaLibrary,代码行数:29,代码来源:hoa.2d.meter_gui_tilde.cpp
示例7: carray_output
void carray_output(t_carray *x, t_symbol* s, long argc, t_atom* argv)
{
post("Array : %s, Size : %i", x->f_name->s_name, x->f_buffer_size);
ebox_invalidate_layer((t_ebox*)x, gensym("buffer_layer"));
ebox_invalidate_layer((t_ebox *)x, gensym("background_layer"));
ebox_redraw((t_ebox *)x);
}
开发者ID:rvega,项目名称:CicmWrapper,代码行数:7,代码来源:c.array.cpp
示例8: breakpoints_mousemove
void breakpoints_mousemove(t_breakpoints *x, t_object *patcherview, t_pt pt, long modifiers)
{
int i;
float abs, ord;
float height = sys_fontheight(ebox_getfontsize((t_ebox *)x)) + 2;
float distx = (3. / (x->f_size.x - 4.)) * (x->f_range_abscissa[1] - x->f_range_abscissa[0]);
float disty = (3. / (x->f_size.y - 4. - height)) * (x->f_range_ordinate[1] - x->f_range_ordinate[0]);
abs = ((pt.x - 3.) / (x->f_size.x - 4.)) * (x->f_range_abscissa[1] - x->f_range_abscissa[0]) + x->f_range_abscissa[0];
ord = ((x->f_size.y - (pt.y - 4.) - 4.) / (x->f_size.y - 4. - height)) * (x->f_range_ordinate[1] - x->f_range_ordinate[0]) + x->f_range_ordinate[0];
x->f_point_hover = -1;
x->f_mouse.x = abs;
x->f_mouse.y = ord;
for(i = 0; i < x->f_number_of_points; i++)
{
if(abs > x->f_point_abscissa[i] - distx && abs < x->f_point_abscissa[i] + distx && ord > x->f_point_ordinate[i] - disty && ord < x->f_point_ordinate[i] + disty)
{
x->f_point_hover = i;
}
}
ebox_invalidate_layer((t_ebox *)x, gensym("points_layer"));
ebox_invalidate_layer((t_ebox *)x, cream_sym_text_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:avilleret,项目名称:CreamLibrary,代码行数:25,代码来源:c.breakpoints.cpp
示例9: tab_float
static void tab_float(t_tab *x, t_floatarg f)
{
ebox_parameter_setvalue((t_ebox *)x, 1, f, 1);
tab_output(x);
ebox_invalidate_layer((t_ebox *)x, cream_sym_selection_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:7,代码来源:c.tab.cpp
示例10: radio_set
void radio_set(t_radio *x, t_symbol* s, long argc, t_atom* argv)
{
int i;
if(argc && argv)
{
if(x->f_mode)
{
for(i = 0; i < argc && i < x->f_nitems; i++)
{
if(atom_gettype(argv+i) == A_FLOAT && atom_getfloat(argv+i) == 0)
x->f_items[i] = 0;
else
x->f_items[i] = 1;
}
}
else if(atom_gettype(argv) == A_FLOAT && atom_getfloat(argv) >= 0 && atom_getfloat(argv) < x->f_nitems)
{
for(i = 0; i < x->f_nitems; i++)
x->f_items[(i)] = 0;
x->f_items[(int)atom_getfloat(argv)] = 1;
}
ebox_invalidate_layer((t_ebox *)x, gensym("items_layer"));
ebox_redraw((t_ebox *)x);
}
}
开发者ID:rvega,项目名称:CicmWrapper,代码行数:26,代码来源:c.radio.cpp
示例11: carray_buffer_set
t_pd_err carray_buffer_set(t_carray *x, t_eattr *attr, long argc, t_atom* argv)
{
int i;
x->f_array = NULL;
if(argc && argv && atom_gettype(argv) == A_SYM)
{
x->f_name = atom_getsym(argv);
if(!(x->f_array = (t_garray *)pd_findbyclass(x->f_name, garray_class)))
{
x->f_array = NULL;
x->f_name = gensym("(null)");
x->f_buffer_size = 0;
x->f_buffer = NULL;
}
else if(!garray_getfloatarray(x->f_array, &x->f_buffer_size, &x->f_buffer))
{
x->f_array = NULL;
x->f_name = gensym("(null)");
x->f_buffer_size = 0;
x->f_buffer = NULL;
}
else
{
for(i = 0; i < x->f_buffer_size; i++)
post("%f", x->f_buffer[i]);
ebox_invalidate_layer((t_ebox*)x, gensym("buffer_layer"));
ebox_redraw((t_ebox*)x);
}
}
return 0;
}
开发者ID:rvega,项目名称:CicmWrapper,代码行数:32,代码来源:c.array.cpp
示例12: breakpoints_remove
void breakpoints_remove(t_breakpoints *x, t_symbol* s, int argc, t_atom* argv)
{
int index, i;
if(x->f_number_of_points == MAXPOINTS)
return;
if(argc && argv)
{
if(argc == 1 && atom_gettype(argv) == A_FLOAT)
{
index = atom_getfloat(argv);
if(index >= x->f_number_of_points || index < 0)
return;
for(i = index; i < x->f_number_of_points; i++)
{
x->f_point_abscissa[i] = x->f_point_abscissa[i+1];
x->f_point_ordinate[i] = x->f_point_ordinate[i+1];
}
x->f_number_of_points--;
ebox_invalidate_layer((t_ebox *)x, gensym("points_layer"));
ebox_redraw((t_ebox *)x);
}
}
}
开发者ID:avilleret,项目名称:CreamLibrary,代码行数:25,代码来源:c.breakpoints.cpp
示例13: angles_set
t_pd_err angles_set(t_hoa_meter *x, void *attr, long argc, t_atom *argv)
{
double angles[MAX_SPEAKER];
if(argc > MAX_SPEAKER)
argc = MAX_SPEAKER;
if(argc && argv)
{
for(int i = 0; i < argc; i++)
{
if(atom_gettype(argv+i) == A_FLOAT)
{
angles[i] = atom_getfloat(argv+i) / 360. * HOA_2PI;
}
}
x->f_meter->setChannelsAzimuth(angles);
x->f_vector->setChannelsAzimuth(angles);
}
ebox_invalidate_layer((t_ebox *)x, hoa_sym_background_layer);
ebox_invalidate_layer((t_ebox *)x, hoa_sym_leds_layer);
ebox_invalidate_layer((t_ebox *)x, hoa_sym_vector_layer);
ebox_redraw((t_ebox *)x);
return 0;
}
开发者ID:sfm1234,项目名称:HoaLibrary,代码行数:25,代码来源:hoa.2d.meter_gui_tilde.cpp
示例14: dsp_tilde_stop
static void dsp_tilde_stop(t_dsp_tilde *x)
{
canvas_suspend_dsp();
x->f_state = 0;
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:avilleret,项目名称:CreamLibrary,代码行数:7,代码来源:c.dsp_tilde.cpp
示例15: dsp_tilde_start
static void dsp_tilde_start(t_dsp_tilde *x)
{
canvas_resume_dsp(1);
x->f_state = 1;
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:avilleret,项目名称:CreamLibrary,代码行数:7,代码来源:c.dsp_tilde.cpp
示例16: radio_mousedown
void radio_mousedown(t_radio *x, t_object *patcherview, t_pt pt, long modifiers)
{
int i, index;
if(x->f_direction)
{
index = (pt.x - 2) / x->j_box.b_rect.width * x->f_nitems;
}
else
{
index = (pt.y - 2) / x->j_box.b_rect.height * x->f_nitems;
}
if(index >= 0 && index < x->f_nitems)
{
if(x->f_mode)
{
if(x->f_items[index] == 0)
x->f_items[index] = 1;
else
x->f_items[index] = 0;
}
else
{
for(i = 0; i < x->f_nitems; i++)
x->f_items[i] = 0;
x->f_items[index] = 1;
}
}
ebox_invalidate_layer((t_ebox *)x, gensym("items_layer"));
ebox_redraw((t_ebox *)x);
radio_output(x);
}
开发者ID:rvega,项目名称:CicmWrapper,代码行数:33,代码来源:c.radio.cpp
示例17: tab_notify
static t_pd_err tab_notify(t_tab *x, t_symbol *s, t_symbol *msg, void *sender, void *data)
{
if (msg == cream_sym_attr_modified)
{
if(s == cream_sym_bgcolor ||
s == cream_sym_bdcolor ||
s == cream_sym_textcolor ||
s == cream_sym_hocolor ||
s == cream_sym_secolor ||
s == cream_sym_orientation ||
s == cream_sym_font)
{
ebox_invalidate_layer((t_ebox *)x, cream_sym_selection_layer);
ebox_invalidate_layer((t_ebox *)x, cream_sym_text_layer);
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
}
else if(s == cream_sym_orientation ||
s == cream_sym_items)
{
ebox_notify((t_ebox *)x, s_cream_size, cream_sym_attr_modified, NULL, NULL);
}
}
else if(msg == cream_sym_value_changed)
{
tab_output(x);
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
ebox_redraw((t_ebox *)x);
}
return 0;
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:30,代码来源:c.tab.cpp
示例18: incdec_mouseup
static void incdec_mouseup(t_incdec *x, t_object *patcherview, t_pt pt, long modifiers)
{
x->f_mouse_down = 0;
clock_unset(x->f_clock);
ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:7,代码来源:c.incdec.cpp
示例19: filterview_set
void filterview_set(t_filterview *x, t_symbol *s, long ac, t_atom *av)
{
if(ac && av)
{
ebox_invalidate_layer((t_ebox *)x, gensym("point_layer"));
ebox_redraw((t_ebox *)x);
}
}
开发者ID:rvega,项目名称:CicmWrapper,代码行数:8,代码来源:c.textfield.c
示例20: tab_prev
static void tab_prev(t_tab *x)
{
const float index = ebox_parameter_getvalue((t_ebox *)x, 1);
ebox_parameter_setvalue((t_ebox *)x, 1, index-1, 1);
tab_output(x);
ebox_invalidate_layer((t_ebox *)x, cream_sym_selection_layer);
ebox_redraw((t_ebox *)x);
}
开发者ID:EQ4,项目名称:CreamLibrary,代码行数:8,代码来源:c.tab.cpp
注:本文中的ebox_redraw函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论