本文整理汇总了C++中outlet_symbol函数的典型用法代码示例。如果您正苦于以下问题:C++ outlet_symbol函数的具体用法?C++ outlet_symbol怎么用?C++ outlet_symbol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outlet_symbol函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:Angeldude,项目名称:pd,代码行数:27,代码来源:split_path.c
示例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");
}
}
开发者ID:Angeldude,项目名称:pd,代码行数:30,代码来源:ossmixer.c
示例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);
}
开发者ID:Angeldude,项目名称:pd,代码行数:32,代码来源:stripfilename.c
示例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);
}
}
开发者ID:porres,项目名称:Porres-ELS,代码行数:25,代码来源:trigger2.c
示例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++;
}
}
开发者ID:Angeldude,项目名称:pd,代码行数:58,代码来源:listUnfold.c
示例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);
}
}
开发者ID:MagdaHertzberg,项目名称:Pure-Data,代码行数:58,代码来源:iem_append_kernel.c
示例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++;
}
}
开发者ID:Git689,项目名称:libpd-cyclone-ios,代码行数:14,代码来源:iter.c
示例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;
}
}
开发者ID:davidsan,项目名称:pd-ppc,代码行数:17,代码来源:multipouet.c
示例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));
}
}
}
}
开发者ID:porres,项目名称:Porres-ELS,代码行数:49,代码来源:trigger2.c
示例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));
}
开发者ID:MagdaHertzberg,项目名称:Pure-Data,代码行数:60,代码来源:mergefilename.c
示例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));
}
开发者ID:Angeldude,项目名称:pd,代码行数:7,代码来源:sarray.c
示例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));
}
开发者ID:Angeldude,项目名称:pd,代码行数:7,代码来源:canvas_name.c
示例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);
}
开发者ID:Angeldude,项目名称:pd,代码行数:29,代码来源:h_deque.cpp
示例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);
}
开发者ID:nebogeo,项目名称:sonic-kayaks-puredata,代码行数:7,代码来源:routeOSC.c
示例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);
}
开发者ID:Git689,项目名称:libpd-cyclone-ios,代码行数:8,代码来源:iter.c
示例16: ctw_output
static void ctw_output(struct _ctw *common, struct _memory_struct *out_memory, FILE *fp) {
CURLMsg *msg;
int msgs_left;
while ((msg = curl_multi_info_read(common->multi_handle, &msgs_left))) {
if (msg->msg == CURLMSG_DONE) {
long http_status;
/* output status */
curl_easy_getinfo(common->easy_handle, CURLINFO_RESPONSE_CODE, &http_status);
if (http_status >= 200 && http_status < 300) {
if (msg->data.result == CURLE_OK) {
if (fp == NULL) {
outlet_symbol(common->x_ob.ob_outlet, gensym((*out_memory).memory));
}
/* Free memory */
string_free((*out_memory).memory, &(*out_memory).size);
outlet_bang(common->status_out);
} else {
ctw_output_curl_error(common, msg);
}
} else {
if (msg->data.result == CURLE_OK){
t_atom http_status_data;
SETFLOAT(&http_status_data, (float)http_status);
pd_error(common, "HTTP error while performing request: %li", http_status);
outlet_float(common->status_out, atom_getfloat(&http_status_data));
} else {
ctw_output_curl_error(common, msg);
}
}
curl_easy_cleanup(common->easy_handle);
curl_multi_cleanup(common->multi_handle);
}
}
}
开发者ID:quahada,项目名称:PuRestJson,代码行数:35,代码来源:ctw.c
示例17: h_list_front
static void h_list_front(t_h_list *x)
{
if(x->hlist->getSize() == 0)
{
outlet_bang(x->out3);
return;
}
Element output = x->hlist->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;
}
outlet_bang(x->out3);
}
开发者ID:Angeldude,项目名称:pd,代码行数:28,代码来源:h_list.cpp
示例18: hang_tick
static void hang_tick(t_hang *h)
{
t_pipe *x = h->h_owner;
t_hang *h2, *h3;
t_pipeout *p;
int i;
union word *w;
if (x->x_hang == h) x->x_hang = h->h_next;
else for (h2 = x->x_hang; (h3 = h2->h_next); h2 = h3)
{
if (h3 == h)
{
h2->h_next = h3->h_next;
break;
}
}
for (i = x->x_n, p = x->x_vec + (x->x_n - 1), w = h->h_vec + (x->x_n - 1);
i--; p--, w--)
{
switch (p->p_atom.a_type)
{
case A_FLOAT: outlet_float(p->p_outlet, w->w_float); break;
case A_SYMBOL: outlet_symbol(p->p_outlet, w->w_symbol); break;
case A_POINTER:
if (gpointer_check(w->w_gpointer, 1))
outlet_pointer(p->p_outlet, w->w_gpointer);
else pd_error(x, "pipe: stale pointer");
break;
default: break;
}
}
hang_free(h);
}
开发者ID:porres,项目名称:pure-data,代码行数:33,代码来源:x_time.c
示例19: pd_deque_outlet_cur
/*--------------------------------------------------------------------
* outlet_cur
* + outlets current element to outlet-1, if non-NULL
* + otherwise, bangs to outlet-2
*/
static void pd_deque_outlet_cur(t_pd_deque *x)
{
if (x->x_cur) {
--x->x_size;
if (x->x_cur->argc == 1) {
switch (x->x_cur->argv->a_type) {
case A_FLOAT:
outlet_float(x->elt_out, x->x_cur->argv->a_w.w_float);
return;
case A_SYMBOL:
outlet_symbol(x->elt_out, x->x_cur->argv->a_w.w_symbol);
return;
case A_POINTER:
outlet_pointer(x->elt_out, x->x_cur->argv->a_w.w_gpointer);
return;
default:
error("Error: deque: unrecognized atom type '%d' defaults to 'bang'.",
x->x_cur->argv->a_type);
outlet_bang(x->elt_out);
}
} else {
outlet_anything(x->elt_out,
atom_getsymbol(x->x_cur->argv),
x->x_cur->argc-1,
x->x_cur->argv+1
);
}
} else {
outlet_bang(x->eoq_out);
}
}
开发者ID:Angeldude,项目名称:pd,代码行数:36,代码来源:deque.c
示例20: buddy_check
static void buddy_check(t_buddy *x)
{
t_buddy_proxy **p = (t_buddy_proxy **)x->x_proxies;
int i = x->x_nslots;
while (i--)
if (!(*p++)->p_selector)
return;
p = (t_buddy_proxy **)x->x_proxies;
i = x->x_nslots;
while (i--)
{
t_symbol *s = p[i]->p_selector;
if (s == &s_bang)
outlet_bang(x->x_outs[i]);
else if (s == &s_float)
outlet_float(x->x_outs[i], p[i]->p_float);
else if (s == &s_symbol && p[i]->p_symbol)
outlet_symbol(x->x_outs[i], p[i]->p_symbol);
else if (s == &s_pointer)
{
/* LATER */
}
else if (s == &s_list)
outlet_list(x->x_outs[i], s, p[i]->p_natoms, p[i]->p_message);
else if (s)
outlet_anything(x->x_outs[i], s, p[i]->p_natoms, p[i]->p_message);
}
buddy_clear(x);
}
开发者ID:EQ4,项目名称:Pd-for-LibPd,代码行数:29,代码来源:buddy.c
注:本文中的outlet_symbol函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论