本文整理汇总了C++中outlet_symbol函数的典型用法代码示例。如果您正苦于以下问题:C++ outlet_symbol函数的具体用法?C++ outlet_symbol怎么用?C++ outlet_symbol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outlet_symbol函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: split_path_symbol
void split_path_symbol(t_split_path *x, t_symbol *s)
{
int length = strlen(s->s_name);
char path_buffer[MAXPATHLEN] = "";
while (length--)
if (*(s->s_name + length) == '/')
break;
if (length < MAXPATHLEN)
outlet_symbol(x->x_filename_outlet,gensym(s->s_name + length + 1));
else
error("[split_path] filename name too long. The limit is %d characters",MAXPATHLEN);
while (length > 0)
{
length--;
if(*(s->s_name + length) != '/') break;
}
if (length < MAXPATHLEN)
{
strncpy(path_buffer, s->s_name, length + 1);
outlet_symbol(x->x_path_outlet,gensym(path_buffer));
}
else
{
error("[split_path] path name too long. The limit is %d characters",MAXPATHLEN);
}
}
示例2: ossmixer_get_source
static void ossmixer_get_source(t_ossmixer *x)
{
int fd = -1;
int channel = -1;
fd = open(x->device->s_name, O_WRONLY);
if (fd > 0){
if ( ioctl(fd, SOUND_MIXER_READ_RECSRC, &channel) ){
post ("ossmixer: could not get recording source");
}else{
t_symbol* s_ch = gensym("no_source_found");
if (channel & SOUND_MASK_VOLUME) s_ch = gensym("main");
if (channel & SOUND_MASK_PCM) s_ch = gensym("pcm");
if (channel & SOUND_MASK_MIC) s_ch = gensym("mic");
if (channel & SOUND_MASK_CD) s_ch = gensym("cd");
if (channel & SOUND_MASK_SYNTH) s_ch = gensym("synth");
if (channel & SOUND_MASK_LINE) s_ch = gensym("line");
if (channel & SOUND_MASK_LINE1) s_ch = gensym("line1");
if (channel & SOUND_MASK_LINE2) s_ch = gensym("line2");
if (channel & SOUND_MASK_LINE3) s_ch = gensym("line3");
if (channel & SOUND_MASK_ALTPCM) s_ch = gensym("altpcm");
outlet_symbol (x->x_out1,s_ch);
outlet_symbol (x->x_obj.ob_outlet,gensym("source"));
}
close (fd);
}else{
post ("ossmixer: could not open mixer device");
}
}
示例3: stripfilename_symbol
static void stripfilename_symbol(t_stripfilename *x, t_symbol *s)
{
if(x->x_nr_char < 0)/* cuts the string from the back */
{
int len = strlen(s->s_name);
int i=len + x->x_nr_char;
if(len > (MAXPDSTRING - 2))
strncpy(x->x_mem, s->s_name, MAXPDSTRING - 2 - len);
else
strcpy(x->x_mem, s->s_name);
if(i < 0)
i = 0;
x->x_mem[i] = 0;
outlet_symbol(x->x_obj.ob_outlet, gensym(x->x_mem));
}
else if(x->x_nr_char > 0)/* starts the string at this new offset */
{
int len = strlen(s->s_name);
int i=x->x_nr_char;
if(len > (MAXPDSTRING - 2))
strncpy(x->x_mem, s->s_name, MAXPDSTRING - 2 - len);
else
strcpy(x->x_mem, s->s_name);
if(i > len)
i = len;
outlet_symbol(x->x_obj.ob_outlet, gensym(x->x_mem+i));
}
else
outlet_symbol(x->x_obj.ob_outlet, s);
}
示例4: trigger2_list
static void trigger2_list(t_trigger2 *x, t_symbol *s, int argc, t_atom *argv){
t_trigger2out *u;
int i;
for(i = x->x_n, u = x->x_vec + i; u--, i--;){
if (u->u_type == TR_FLOAT)
outlet_float(u->u_outlet, (argc ? atom_getfloat(argv) : 0));
else if (u->u_type == TR_BANG)
outlet_bang(u->u_outlet);
else if (u->u_type == TR_SYMBOL)
outlet_symbol(u->u_outlet,
(argc ? atom_getsymbol(argv) : (s != NULL ? s : &s_symbol)));
else if (u->u_type == TR_ANYTHING)
outlet_anything(u->u_outlet, s, argc, argv);
else if (u->u_type == TR_POINTER){
if (!argc || argv->a_type != TR_POINTER)
pd_error(x, "unpack: bad pointer");
else outlet_pointer(u->u_outlet, argv->a_w.w_gpointer);
}
else if (u->u_type == TR_STATIC_FLOAT)
outlet_float(u->u_outlet, u->u_float);
else if (u->u_type == TR_STATIC_SYMBOL)
outlet_symbol(u->u_outlet, u->u_sym);
else outlet_list(u->u_outlet, &s_list, argc, argv);
}
}
示例5: listUnfold_anything
void listUnfold_anything(t_listUnfold *x, t_symbol* s, int ac, t_atom* av)
{
if ( x->mode == 0) {
// Output all
int i =0;
int offset =0;
x->iterating = 1;
if ( s != &s_list && s != &s_float && s != &s_symbol ) {
outlet_float(x->outlet2,0);
outlet_symbol(x->outlet1,s);
offset=1;
}
for ( ; i < ac && x->iterating; i++ ) {
outlet_float(x->outlet2,i+offset);
if ( IS_A_FLOAT(av,0) ) {
outlet_float(x->outlet1,atom_getfloat(av));
} else {
outlet_symbol(x->outlet1,atom_getsymbol(av));
}
av++;
}
} else {
x->iterating = 0;
// Copy and wait for bangs to output
int do_selector = ( s != &s_list && s != &s_float && s != &s_symbol );
x->ac = ac + do_selector; //One more for the selector
// Resize memory if required and add 3 atoms just in case
if(x->ac > x->memSize) {
x->av = resizebytes(x->av, x->memSize * sizeof(*(x->av)),
(3 + x->ac) * sizeof(*(x->av)));
x->memSize = 3 + x->ac;
}
t_atom* dst = x->av;
// Copy selector
if ( do_selector ) {
SETSYMBOL(dst, s);
dst++;
}
// Copy atoms
while(ac--) *dst++ = *av++;
}
}
示例6: iem_append_kernel_out
static void iem_append_kernel_out(t_iem_append_kernel *x)
{
int off=0;
if(x->x_type1 == A_GIMME)
{
if(x->x_type2 == A_COMMA)
off = 1;
else
off = 0;
iem_append_kernel_merge(x, off);
outlet_list(x->x_obj.ob_outlet, &s_list, x->x_ac1+x->x_ac2+off, x->x_at12);
}
else if(x->x_type1 == A_COMMA)
{
if(x->x_type2 == A_COMMA)
off = 1;
else
off = 0;
iem_append_kernel_merge(x, off);
outlet_anything(x->x_obj.ob_outlet, x->x_sym1, x->x_ac1+x->x_ac2+off, x->x_at12);
}
else if(x->x_type1 == A_NULL)/*depends on 2.part*/
{
iem_append_kernel_merge(x, 0);
if(x->x_type2 == A_GIMME)
outlet_list(x->x_obj.ob_outlet, &s_list, x->x_ac2, x->x_at12);
else if(x->x_type2 == A_COMMA)
outlet_anything(x->x_obj.ob_outlet, x->x_sym2, x->x_ac2, x->x_at12);
else if(x->x_type2 == A_FLOAT)
outlet_float(x->x_obj.ob_outlet, atom_getfloat(x->x_at12));
else if(x->x_type2 == A_SYMBOL)
outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(x->x_at12));
else if(x->x_type2 == A_NULL)
outlet_bang(x->x_obj.ob_outlet);
else if(x->x_type2 == A_POINTER)
outlet_pointer(x->x_obj.ob_outlet, (t_gpointer *)x->x_at12->a_w.w_gpointer);
}
else
{
if(x->x_type2 == A_COMMA)
off = 1;
else
off = 0;
iem_append_kernel_merge(x, off);
if(x->x_type2 == A_NULL)
{
if(x->x_type1 == A_FLOAT)
outlet_float(x->x_obj.ob_outlet, atom_getfloat(x->x_at12));
else if(x->x_type1 == A_SYMBOL)
outlet_symbol(x->x_obj.ob_outlet, atom_getsymbol(x->x_at12));
else if(x->x_type1 == A_POINTER)
outlet_pointer(x->x_obj.ob_outlet, (t_gpointer *)x->x_at12->a_w.w_gpointer);
}
else
outlet_list(x->x_obj.ob_outlet, &s_list, x->x_ac1+x->x_ac2+off, x->x_at12);
}
}
示例7: iter_dobang
/* CHECKED: both floats and symbols */
static void iter_dobang(t_iter *x, t_symbol *s, int ac, t_atom *av)
{
if (s && s != &s_)
outlet_symbol(((t_object *)x)->ob_outlet, s);
while (ac--)
{
if (av->a_type == A_FLOAT)
outlet_float(((t_object *)x)->ob_outlet, av->a_w.w_float);
else if (av->a_type == A_SYMBOL)
outlet_symbol(((t_object *)x)->ob_outlet, av->a_w.w_symbol);
av++;
}
}
示例8: multipouet_bang
/*
* Q.3 - Comportement en cas de message bang
*/
void multipouet_bang(t_multipouet *x){
x->i_count = x->i_count + x->step;
char pouet[1024];
strcpy(pouet,"");
int i;
for(i=0 ; i<x->i_count ; i++){
strcat(pouet, "pouet ");
}
outlet_symbol(x->p_out, gensym(pouet));
if(x->i_count >= x->i_max){
outlet_symbol(x->b_out, gensym("bang"));
x->i_count=x->i_min;
}
}
示例9: trigger2_anything
static void trigger2_anything(t_trigger2 *x, t_symbol *s, int argc, t_atom *argv){
t_atom *av2 = NULL;
t_trigger2out *u;
int i, j = 0;
for (i = x->x_n, u = x->x_vec + i; u--, i--;){
if (u->u_type == TR_BANG)
outlet_bang(u->u_outlet);
else if (u->u_type == TR_ANYTHING)
outlet_anything(u->u_outlet, s, argc, argv);
else if (u->u_type == TR_STATIC_FLOAT)
outlet_float(u->u_outlet, u->u_float);
else if (u->u_type == TR_STATIC_SYMBOL)
outlet_symbol(u->u_outlet, u->u_sym);
else{
// copying trigger2_list behavior except that here we keep
// the outlet number and therefore avoid redundant printouts
if (u->u_type == TR_FLOAT)
outlet_float(u->u_outlet, (argc ? atom_getfloat(argv) : 0));
else if (u->u_type == TR_BANG)
outlet_bang(u->u_outlet);
else if (u->u_type == TR_SYMBOL)
outlet_symbol(u->u_outlet,
(s != NULL ? s : (argc ? atom_getsymbol(argv) : &s_symbol)));
else if (u->u_type == TR_ANYTHING)
outlet_anything(u->u_outlet, s, argc, argv);
else if (u->u_type == TR_POINTER)
if (!argc || argv->a_type != TR_POINTER)
pd_error(x, "unpack: bad pointer");
else outlet_pointer(u->u_outlet, argv->a_w.w_gpointer);
else if (u->u_type == TR_STATIC_FLOAT)
outlet_float(u->u_outlet, u->u_float);
else if (u->u_type == TR_STATIC_SYMBOL)
outlet_symbol(u->u_outlet, u->u_sym);
else{ // Ico: don't have to worry about zero element case (AFAICT)
av2 = (t_atom *)getbytes((argc + 1) * sizeof(t_atom));
SETSYMBOL(av2, s);
if (argc == 0)
outlet_list(u->u_outlet, &s_symbol, argc+1, av2);
else{
for (j = 0; j < argc; j++)
av2[j + 1] = argv[j];
SETSYMBOL(av2, s);
outlet_list(u->u_outlet, &s_list, argc+1, av2);
}
freebytes(av2, (argc + 1) * sizeof(t_atom));
}
}
}
}
示例10: mergefilename_anything
static void mergefilename_anything(t_mergefilename *x, t_symbol *s, int ac, t_atom *av)
{
char flt_buf[30];
t_int i, length, accu_size=0;
x->x_mem[0] = 0;
length = strlen(s->s_name);
if(length > (MAXPDSTRING - 2))
{
strncat(x->x_mem, s->s_name, MAXPDSTRING - 2);
accu_size = MAXPDSTRING - 2;
i = ac + 1;
}
else
{
strcat(x->x_mem, s->s_name);
accu_size = length;
}
if(ac > 0)
{
for(i=0; i<ac; i++)
{
strcat(x->x_mem, x->x_sep);
if(IS_A_SYMBOL(av, 0))
{
length = strlen(av->a_w.w_symbol->s_name);
if((accu_size + length) > (MAXPDSTRING - 2))
{
strncat(x->x_mem, av->a_w.w_symbol->s_name, MAXPDSTRING - 2 - accu_size);
accu_size = MAXPDSTRING - 2;
i = ac + 1;
}
else
{
strcat(x->x_mem, av->a_w.w_symbol->s_name);
accu_size += length;
}
}
else if(IS_A_FLOAT(av, 0))
{
sprintf(flt_buf, "%g", av->a_w.w_float);
length = strlen(flt_buf);
if((accu_size + length) > (MAXPDSTRING - 2))
{
strncat(x->x_mem, flt_buf, MAXPDSTRING - 2 - accu_size);
accu_size = MAXPDSTRING - 2;
i = ac + 1;
}
else
{
strcat(x->x_mem, flt_buf);
accu_size += length;
}
}
av++;
}
}
outlet_symbol(x->x_obj.ob_outlet, gensym(x->x_mem));
}
示例11: sarray_get
static void sarray_get(t_sarray *x,t_float i)
{
t_symbol *s=scommon_get(x->x_c,i);
if(s==&s_) outlet_bang(x->x_obj.ob_outlet);
else outlet_symbol(x->x_obj.ob_outlet,scommon_get(x->x_c,i));
}
示例12: canvas_name_bang
static void canvas_name_bang(t_canvas_name *x)
{
/* actually get the canvas name each time to make sure we get
* accurate info in case of changes. If we cache the result, a
* canvas could have been deleted or renamed. */
outlet_symbol(x->x_obj.ob_outlet, get_canvas_name(x));
}
示例13: h_deque_front
static void h_deque_front(t_h_deque *x)
{
if(x->hdeque->getSize() == 0)
{
post("h_deque, front: size is 0 !");
return;
}
Element output = x->hdeque->front();
if(output.getLength() == 1) // symbol or float
{
if (output.getAtom()[0].a_type == A_FLOAT)
outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
if (output.getAtom()[0].a_type == A_SYMBOL)
outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
if (output.getAtom()[0].a_type == A_POINTER)
outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
return;
}
if(output.getLength() > 1) // list
{
outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
return;
}
// if there was no Element found, put out a bang at the right outlet
outlet_bang(x->out2);
}
示例14: routeOSC_symbol
static void routeOSC_symbol(t_routeOSC *x, t_symbol *s)
{
/* output non-OSC data on rightmost outlet */
if (x->x_verbosity) post("routeOSC_symbol (%p) %s", x, s->s_name);
outlet_symbol(x->x_outlets[x->x_num], s);
}
示例15: iter_symbol
/* CHECKME */
static void iter_symbol(t_iter *x, t_symbol *s)
{
outlet_symbol(((t_object *)x)->ob_outlet, s);
x->x_selector = 0;
x->x_natoms = 1;
SETSYMBOL(x->x_message, s);
}