本文整理汇总了C++中outlet_anything函数的典型用法代码示例。如果您正苦于以下问题:C++ outlet_anything函数的具体用法?C++ outlet_anything怎么用?C++ outlet_anything使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outlet_anything函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: inquisitor_get
void inquisitor_get(t_inquisitor *x, t_symbol *name)
{
if(!x->subject){
t_object* b = jpatcher_get_firstobject(x->patcher);
while(b){
if(x->name == jbox_get_varname(b)){
x->subject = jbox_get_object(b);
break;
}
b = jbox_get_nextobject(b);
}
}
if(x->subject && !NOGOOD(x->subject)){
t_atom* av = NULL;
long ac = 0;
t_max_err err;
err = object_attr_getvalueof(x->subject, name, &ac, &av);
if(!err && ac && av){
for(long i=0; i<ac; i++){
if(atom_gettype(av+i) != A_LONG && atom_gettype(av+i) != A_FLOAT && atom_gettype(av+i) != A_SYM){
object_error((t_object*)x, "The type of data returned for this attribute value is not usable by tap.inquisitor: %s", name->s_name);
err = MAX_ERR_GENERIC;
break;
}
}
if(!err)
outlet_anything(x->outlet, name, ac, av);
}
else{
object_error((t_object*)x, "problem getting attribute value for %s", name->s_name);
}
if(ac && av)
sysmem_freeptr(av);
}
}
开发者ID:imclab,项目名称:TapTools,代码行数:39,代码来源:tap.inquisitor.cpp
示例2: mtx_divelement_float
static void mtx_divelement_float(t_mtx_binmtx *x, t_float f)
{
t_matrix *m=&x->m, *m2=&x->m2;
t_atom *ap, *ap2=m2->atombuffer+2;
int row2, col2, n;
if (!m2->atombuffer){ pd_error(x, "right-hand matrix missing"); return; }
row2=atom_getfloat(m2->atombuffer);
col2=atom_getfloat(m2->atombuffer+1);
adjustsize(m, row2, col2);
ap=m->atombuffer+2;
n=row2*col2;
while(n--){
SETFLOAT(ap, f/atom_getfloat(ap2++));
ap++;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), m->row*m->col+2, m->atombuffer);
}
开发者ID:Angeldude,项目名称:pd,代码行数:22,代码来源:mtx_mul.c
示例3: mtx_divscalar_matrix
static void mtx_divscalar_matrix(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv)
{
int n=argc-2;
t_atom *m;
t_float factor = 1.0/x->f;
int row=atom_getfloat(argv++);
int col=atom_getfloat(argv++);
if (argc<2){
pd_error(x, "crippled matrix");
return;
}
adjustsize(&x->m, row, col);
m = x->m.atombuffer+2;
while(n--){
m->a_type = A_FLOAT;
(m++)->a_w.w_float = atom_getfloat(argv++)*factor;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
}
开发者ID:Angeldude,项目名称:pd,代码行数:22,代码来源:mtx_mul.c
示例4: mg_read
static void *twiliomax_mongoose_callback(enum mg_event event,
struct mg_connection *conn) {
t_twiliomax *x = (t_twiliomax*)mg_get_user_data(conn);
if (event == MG_NEW_REQUEST) {
char post_data[1024],
sms_from[sizeof(post_data)],
sms_body[sizeof(post_data)];
int post_data_len;
// Read POST data
post_data_len = mg_read(conn, post_data, sizeof(post_data));
mg_get_var(post_data, post_data_len, "From", sms_from, sizeof(sms_from));
mg_get_var(post_data, post_data_len, "Body", sms_body, sizeof(sms_body));
if (strlen(sms_body) > 0 && strlen(sms_from) > 0) {
t_atom sms_atoms[2];
atom_setsym(&sms_atoms[0], gensym(sms_from));
atom_setsym(&sms_atoms[1], gensym(sms_body));
outlet_anything(x->m_outlet1, gensym("sms"), 2, sms_atoms);
}
mg_printf(conn,
"HTTP/1.0 200 OK\r\n"
"Content-Type: application/xml\r\n\r\n"
"%s",
twilio_response);
return "";
} else {
return NULL;
}
}
开发者ID:bengl3rt,项目名称:twiliomax,代码行数:38,代码来源:twilio.c
示例5: holmes_mask_anything
/*-------------------------------------------------------------
* anything() : match element-names only
*/
static void holmes_mask_anything(t_holmes_mask *x, t_symbol *sel, int argc, t_atom *argv)
{
int i;
alhash_entry_t *he;
t_outlet *heout;
t_symbol *es = sel;
for (i = -1; i < argc; i++) {
//-- element, lookup
if (i >= 0) es = atom_getsymbolarg(i, argc, argv);
he = alhash_lookup_extended(symbol_to_holmes_eid, es);
if (he) {
if (x->x_mask & Elements[(unsigned int)(he->val)].feat) heout = x->x_goodout;
else heout = x->x_badout;
}
else {
heout = x->x_badout;
error("holmes_mask: unknown holmes element '%s'", es->s_name);
}
outlet_anything(heout, es, 0, NULL);
}
}
开发者ID:megrimm,项目名称:pd-chips,代码行数:26,代码来源:holmes-mask.c
示例6: SendDataToOutlet
// Should think about generalizing and moving this to MaxUtils...
static inline void SendDataToOutlet(void* iJitOb, Symbol* iAttr, void* iOutlet)
{
long atomCount = 0;
Atom* outAtoms = NIL;
jit_object_method(iJitOb, iAttr, &atomCount, &outAtoms);
// This method attempts to memory for outAtoms
// Don't forget to call jit_freebytes() when done
if (atomCount > 0 && outAtoms != NIL) {
if (atomCount > 1)
outlet_anything(iOutlet, _jit_sym_list, atomCount, outAtoms);
else switch (outAtoms[0].a_type) {
case A_LONG: outlet_int(iOutlet, outAtoms[0].a_w.w_long); break;
case A_FLOAT: outlet_float(iOutlet, outAtoms[0].a_w.w_float); break;
default: break;
}
jit_freebytes(outAtoms, sizeof(t_atom) * atomCount);
}
}
开发者ID:pcastine-lp,项目名称:LitterPower,代码行数:24,代码来源:lbj.penize.c
示例7: mtx_rmstodb_matrix
static void mtx_rmstodb_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv)
{
int row=atom_getfloat(argv++);
int col=atom_getfloat(argv++);
t_atom *m;
int n = argc-2;
if (argc<2){ post("mtx_rmstodb: crippled matrix"); return; }
if ((col<1)||(row<1)) { post("mtx_rmstodb: invalid dimensions"); return; }
if (col*row>argc-2){ post("sparse matrix not yet supported : use \"mtx_check\""); return; }
adjustsize(&x->m, row, col);
m = x->m.atombuffer+2;
while(n--){
t_float f=atom_getfloat(argv++);
t_float v=(f<0)?0.:(100+20./LOGTEN * log(f));
SETFLOAT(m, (v<0)?0:v);
m++;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
}
开发者ID:Angeldude,项目名称:pd,代码行数:23,代码来源:mtx_rmstodb.c
示例8: twiliomax_sendsms
void twiliomax_sendsms(t_twiliomax *x, t_symbol *s, long argc, t_atom *argv) {
if (argc != 2) {
object_error((t_object *)x, "sendsms: Exactly two arguments required");
return;
}
if (argv[0].a_type != A_SYM || argv[1].a_type != A_SYM) {
object_error((t_object *)x, "sendsms: Invalid arg type. Exactly two string arguments required");
return;
}
char *destination_number = atom_getsym(&argv[0])->s_name;
char *message = atom_getsym(&argv[1])->s_name;
if (send_outgoing_sms(x->twilio_account_sid, x->curl, x->twilio_phone_number, destination_number, message) < 0) {
object_error((t_object *)x, "Unable to communicate with Twilio to send outgoing SMS");
return;
}
outlet_anything(x->m_outlet1, gensym("sent"), 1, &argv[0]);
}
开发者ID:bengl3rt,项目名称:twiliomax,代码行数:23,代码来源:twilio.c
示例9: udpreceive_optionI
static void udpreceive_optionI(t_udpreceive*x, t_symbol*s, int argc, t_atom*argv) {
int*reuse=NULL;
if(gensym("reuseport")==s)reuse=&x->x_reuseport;
if(gensym("reuseaddr")==s)reuse=&x->x_reuseaddr;
if(!reuse) {
pd_error(x, "[%s]: unknown option '%s'", objName, s->s_name);
return;
}
if(argc) {
if(1==argc && A_FLOAT == argv->a_type) {
*reuse=atom_getint(argv);
return;
} else {
pd_error(x, "[%s] usage: %s [<val>]", objName, s->s_name);
return;
}
} else {
t_atom ap[1];
SETFLOAT(ap, *reuse);
outlet_anything(x->x_statout, s, 1, ap);
}
}
开发者ID:cjfitz,项目名称:pd-iemnet,代码行数:23,代码来源:udpreceive.c
示例10: omax_FullPacket
void omax_FullPacket(t_object *ob, long len, long ptr)
{
t_symbol *classname = object_classname(ob);
if(!classname){
// if we can't get our classname, there's no way we can match anything
return;
}
char buf[len];
sprintf(buf, "/%s", classname->s_name);
t_context c;
c.ob = ob;
c.classname = classname;
c.osc_classname = gensym(buf);
memset(buf, '\0', len);
c.buf = buf;
osc_bundle_s_setBundleID(buf);
c.bufpos = OSC_HEADER_SIZE;
c.should_output_state = 0;
t_osc_err e = osc_bundle_s_getMessagesWithCallback(len, (char *)ptr, omax_FullPacketCallback, (void *)(&c));
if(e){
object_error(ob, "%s (%d)", osc_error_string(e), e);
return;
}
if(c.bufpos > OSC_HEADER_SIZE){
void *cout = omax_object_getContinuationOutlet(ob);
if(cout){
t_atom out[2];
atom_setlong(out, c.bufpos);
atom_setlong(out + 1, (long)(c.buf));
outlet_anything(cout, gensym("FullPacket"), 2, out);
}
}
if(c.should_output_state > 0){
omax_outputState(ob);
}
}
开发者ID:CNMAT,项目名称:libomax,代码行数:37,代码来源:omax_class.c
示例11: netreceive_doit
static void netreceive_doit(void *z, t_binbuf *b)
{
#ifndef ROCKBOX
t_atom messbuf[1024];
#endif
t_netreceive *x = (t_netreceive *)z;
int msg, natom = binbuf_getnatom(b);
t_atom *at = binbuf_getvec(b);
for (msg = 0; msg < natom;)
{
int emsg;
for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA
&& at[emsg].a_type != A_SEMI; emsg++)
;
if (emsg > msg)
{
int i;
for (i = msg; i < emsg; i++)
if (at[i].a_type == A_DOLLAR || at[i].a_type == A_DOLLSYM)
{
pd_error(x, "netreceive: got dollar sign in message");
goto nodice;
}
if (at[msg].a_type == A_FLOAT)
{
if (emsg > msg + 1)
outlet_list(x->x_msgout, 0, emsg-msg, at + msg);
else outlet_float(x->x_msgout, at[msg].a_w.w_float);
}
else if (at[msg].a_type == A_SYMBOL)
outlet_anything(x->x_msgout, at[msg].a_w.w_symbol,
emsg-msg-1, at + msg + 1);
}
nodice:
msg = emsg + 1;
}
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:37,代码来源:x_net.c
示例12: trigger_anything
static void trigger_anything(t_trigger *x, t_symbol *s, int argc, t_atom *argv)
{
//fprintf(stderr,"trigger_anything %s\n", s->s_name);
t_triggerout *u;
int i;
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) {
//fprintf(stderr,"TR_ANYTHING\n");
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 trigger_symbol(x, s);
}
}
开发者ID:flummingbird,项目名称:pd,代码行数:24,代码来源:x_connective.c
示例13: max_jit_gl_spout_receiver_draw
void max_jit_gl_spout_receiver_draw(t_max_jit_gl_spout_receiver *x, t_symbol *s, long argc, t_atom *argv)
{
UNREFERENCED_PARAMETER(s);
UNREFERENCED_PARAMETER(argc);
UNREFERENCED_PARAMETER(argv);
t_atom a;
// get the jitter object
t_jit_object *jitob = (t_jit_object*)max_jit_obex_jitob_get(x);
// Call the jitter object's draw method (from Syphon code)
// LJ - This causes an error with corrupted texture received in draw
// but does not affect the output. Seem to be not needed - needs tracing
// t_symbol *attr = gensym("draw");
// jit_object_method(jitob, attr, s, argc, argv);
// query the texture name and send out the texture output
jit_atom_setsym(&a, jit_attr_getsym(jitob, ps_out_name));
outlet_anything(x->texout, ps_out_texture, 1, &a);
}
开发者ID:leadedge,项目名称:Spout2,代码行数:24,代码来源:max.jit.gl.spoutreceiver.c
示例14: depack_do_args
void depack_do_args(t_depack *x, short argc, t_atom *argv, long offset)
{
long i;
long num_outlets = x->num_outlets;
void **outlet_array = x->outlet_array;
if (argc > num_outlets - offset) argc = num_outlets - offset;
for (i = argc - 1; i >= 0; i--)
{
switch (atom_gettype(argv + i))
{
case A_SYM:
outlet_anything(outlet_array[i + offset], atom_getsym(argv + i), 0, 0);
break;
case A_FLOAT:
outlet_float(outlet_array[i + offset], atom_getfloat(argv + i));
break;
case A_LONG:
outlet_int(outlet_array[i + offset], atom_getlong(argv + i));
break;
}
}
}
开发者ID:AlexHarker,项目名称:AHarker_Externals,代码行数:24,代码来源:depack.cpp
示例15: strtok_anything
void strtok_anything(t_strtok *x, t_symbol *s, long argc, t_atom *argv)
{
char *ptr;
char local[4096];
long status = 0;
short i, j;
t_atom result[256];
t_atom head;
i = 0;
strcpy(local, s->s_name);
ptr = strtok(local,x->s_tempstring);
while (ptr != NULL){
result[i].a_type = A_SYMBOL;
result[i].a_w.w_symbol = gensym(ptr);
ptr = strtok (NULL, x->s_tempstring);
i++;
}
j = i;
head.a_w.w_symbol = result[0].a_w.w_symbol;
for(j=0;j<i;j++) result[j] = result[j+1];
outlet_anything(x->s_outlet,head.a_w.w_symbol,i-1,result);
return;
}
开发者ID:Angeldude,项目名称:pd,代码行数:24,代码来源:strtok.c
示例16: wiimote_cwiid_balance_output
static void wiimote_cwiid_balance_output(t_wiimote *x, t_symbol*s, uint16_t value, uint16_t calibration[3])
{
/*
1700 appears to be the step the calibrations are against.
17kg per sensor is 68kg, 1/2 of the advertised Japanese weight limit.
*/
#define WIIMOTE_BALANCE_CALWEIGHT 1700.f
t_atom ap[2];
t_float weight=0;
t_float falue=value;
if(calibration) {
if(value<calibration[1]) {
weight = WIIMOTE_BALANCE_CALWEIGHT * (falue - calibration[0]) / (calibration[1]-calibration[0]);
} else {
weight = WIIMOTE_BALANCE_CALWEIGHT * (1 + (falue - calibration[1]) / (calibration[2]-calibration[1]));
}
} else {
weight=falue;
}
SETSYMBOL(ap+0, s);
SETFLOAT (ap+1, weight);
outlet_anything(x->outlet_data, gensym("balance"), 2, ap);
}
开发者ID:Angeldude,项目名称:pd,代码行数:24,代码来源:wiimote.c
示例17: append_bangout
static void append_bangout(t_outlet *outp, int ac, t_atom *av)
{
if (ac)
{
if (av->a_type == A_SYMBOL)
outlet_anything(outp, av->a_w.w_symbol, ac-1, av+1);
else if (av->a_type == A_POINTER)
{
if (ac == 1)
outlet_pointer(outp, av->a_w.w_gpointer);
else
outlet_list(outp, &s_list, ac, av);
}
else if (av->a_type == A_FLOAT)
{
if (ac == 1)
outlet_float(outp, av->a_w.w_float);
else
outlet_list(outp, &s_list, ac, av);
}
else loudbug_bug("append_bangout");
}
else outlet_bang(outp);
}
开发者ID:amurtet,项目名称:pd-cyclone,代码行数:24,代码来源:Append.c
示例18: testmess_heapmess
static void testmess_heapmess(t_testmess *x, t_symbol *s, int ac, t_atom *av)
{
int ntotal = x->x_natoms + ac;
t_atom *buf = getbytes(ntotal * sizeof(*buf));
if (buf)
{
if (x->x_appendmode)
{
if (ac)
memcpy(buf, av, ac * sizeof(*buf));
if (x->x_natoms)
memcpy(buf + ac, x->x_message, x->x_natoms * sizeof(*buf));
}
else
{
if (x->x_natoms)
memcpy(buf, x->x_message, x->x_natoms * sizeof(*buf));
if (ac)
memcpy(buf + x->x_natoms, av, ac * sizeof(*buf));
}
outlet_anything(((t_object *)x)->ob_outlet, s, ntotal, buf);
freebytes(buf, ntotal * sizeof(*buf));
}
}
开发者ID:EQ4,项目名称:Pd-for-LibPd,代码行数:24,代码来源:testmess.c
示例19: show
static void show(latoomutalpha_struct *latoomutalpha) {
make_results(latoomutalpha);
outlet_anything(latoomutalpha -> search_outlet, gensym("show"), M_search_count, latoomutalpha -> search_out);
}
开发者ID:kmatheussen,项目名称:libpd,代码行数:4,代码来源:latoomutalpha.c
示例20: receive_anything
static void receive_anything(t_receive *x, t_symbol *s, int argc, t_atom *argv)
{
outlet_anything(x->x_obj.ob_outlet, s, argc, argv);
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:4,代码来源:x_connective.c
注:本文中的outlet_anything函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论