当前位置: 首页>>代码示例>>C++>>正文


C++ outlet_int函数代码示例

本文整理汇总了C++中outlet_int函数的典型用法代码示例。如果您正苦于以下问题:C++ outlet_int函数的具体用法?C++ outlet_int怎么用?C++ outlet_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了outlet_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: minimum_bang

void minimum_bang(t_minimum *x)
{
	long i;
	t_big_atom themin;
	long minIndex;
	long res;
	double fres;

	minIndex = 0;
	themin.a_type = A_NOTHING;

	systhread_mutex_lock(x->m_mutex);
	for (i=0; i < x->m_count; i++)
		minimum_compare(&themin,x->m_args+i, &i, &minIndex);
	systhread_mutex_unlock(x->m_mutex);

	outlet_int(x->m_out2, minIndex);
	if (x->m_outtype==A_LONG) {
		if (themin.a_type == A_LONG)
			res = themin.w_long;
		else
			res = (long)themin.w_float;
		outlet_int(x->m_out,res);
	} else {
		if (themin.a_type == A_FLOAT)
			fres = themin.w_float;
		else
			fres = (float)themin.w_long;
		outlet_float(x->m_out,fres);
	}
}
开发者ID:AlvaroBuitrago,项目名称:max-test,代码行数:31,代码来源:minimum.c

示例2: senseXDoMessage

/*------------------------------------ senseXDoMessage ---*/
void
senseXDoMessage(SenseXData * xx)
{
    if (! xx->fStopping)
    {
        short prevLock;

        switch (xx->fState)
        {
            case kAwaitingFirstMessage:
                prevLock = lockout_set(1);
                if (0 > xx->fOnDelay)
                {
                    clock_delay(xx->fPollClock, xx->fOnDelay);
                    xx->fState = kBetweenMessages;
                }
                else
                {
                    outlet_int(xx->fResultOut, 1);
                    if (0 > xx->fOffDelay)
                    {
                        clock_delay(xx->fPollClock, xx->fOffDelay);
                        xx->fState = kAfterSecondMessage;
                    }
                    else
                    {
                        outlet_int(xx->fResultOut, 0);
                        xx->fState = kAwaitingFirstMessage;
                    }
                }
                lockout_set(prevLock);
                break;

            case kBetweenMessages:
                prevLock = lockout_set(1);
                outlet_int(xx->fResultOut, 1);
                clock_unset(xx->fPollClock);
                if (0 < xx->fOffDelay)
                {
                    clock_delay(xx->fPollClock, xx->fOffDelay);
                    xx->fState = kAfterSecondMessage;
                }
                else
                {
                    outlet_int(xx->fResultOut, 0);
                    xx->fState = kAwaitingFirstMessage;
                }
                lockout_set(prevLock);
                break;

            default:
                break;
                
        }
    }
} // senseXDoMessage
开发者ID:opendragon,项目名称:Max_Objects,代码行数:57,代码来源:senseX.cpp

示例3: slice_output

void slice_output(t_slice *x)
{
	t_atom *at;	
	
	if (x->s_len > x->s_split) {
		at = x->s_at + x->s_split;

		if (at->a_type != A_SYM) {
			if (x->s_len - x->s_split == 1) {
				if (at->a_type == A_LONG) {
					outlet_int(x->s_out2, at->a_w.w_long);
				} else if (at->a_type == A_FLOAT) {
					outlet_float(x->s_out2, at->a_w.w_float);
				}
			} else {
				outlet_list(x->s_out2,ps_list,x->s_len - x->s_split,at);
			}
		} else {
			outlet_anything(x->s_out2,at->a_w.w_sym,x->s_len - x->s_split - 1,at+1);
		}
	}
	if (x->s_len >= x->s_split) {	
		at = x->s_at;
		if (x->s_split == 1) {
			if (at->a_type == A_LONG) {
				outlet_int(x->s_out1, at->a_w.w_long);
			} else if (at->a_type == A_FLOAT) {
				outlet_float(x->s_out1, at->a_w.w_float);
			} else {
				outlet_anything(x->s_out1, at->a_w.w_sym, 0, (t_atom *)NIL);
			}
		} else if (at->a_type != A_SYM) {
			outlet_list(x->s_out1,ps_list,x->s_split,at);
		} else {
			outlet_anything(x->s_out1, at->a_w.w_sym, x->s_split-1, at+1);
		}
	} else {
		at = x->s_at;
		if (x->s_split == 1) {
			if (at->a_type == A_LONG) {
				outlet_int(x->s_out1, at->a_w.w_long);
			} else if (at->a_type == A_FLOAT) {
				outlet_float(x->s_out1, at->a_w.w_float);
			} else {
				outlet_anything(x->s_out1, at->a_w.w_sym, 0, (t_atom *)NIL);
			}
		} else if (at->a_type != A_SYM) {
			outlet_list(x->s_out1,ps_list,x->s_len,at);
		} else {
			outlet_anything(x->s_out1,at->a_w.w_sym,x->s_len-1,at+1);
		}
	}
}
开发者ID:imclab,项目名称:TapTools,代码行数:53,代码来源:tap.list.slice.cpp

示例4: perform

	// default signal processing method is called 'perform'
	void perform(double **ins, long numins, double **outs, long numouts, long sampleframes) {
		// 
		char *this_chordname;
		std::vector<double> chroma;
		chroma.resize(12);
		double rms, rms_tot;
		int q;
		rms = 0;
		rms_tot = 0;
		for (long channel = 0; channel < numouts; channel++) {
			double * in = ins[channel];
			double * out = outs[channel];
			for (long i=0; i < sampleframes; i++) {
				out[i] = in[i];
				// we only want to process on channel 0
				if (channel == 0) {
					if (currentsamples < frameSize - 1) {
						frame[currentsamples] = in[i];
						currentsamples++;
					}
					else {
						currentsamples = 0;
						for (q = 0; q < frameSize; q++) {
							rms_tot += pow(frame[q],2);
						}
						rms = rms_tot / frameSize;
						if (rms > rms_cutoff){
							c.processAudioFrame(frame);
							outlet_int(m_outlets[3], 1);
						}
						else {
							outlet_int(m_outlets[3], 0);
						}
						if (c.isReady()) {
							std::vector<double> chroma = c.getChromagram();
							chordspotter.detectChord(chroma);
							currentchord = 10000 * chordspotter.rootNote + chordspotter.chord_num;
							chord_name = chordspotter.chord_name;
							const char *this_chordname = chord_name.c_str();
							if (currentchord != lastchord) {
								outlet_anything(m_outlets[0], gensym(this_chordname), 0, NULL);
								outlet_int(m_outlets[1], currentchord);
								midilist(chordspotter.rootNote, chordspotter.chord_num);
							}
							lastchord = currentchord;
						}
					}
				}

			}
		}
	}
开发者ID:scblakely,项目名称:chordid,代码行数:53,代码来源:chordid~.cpp

示例5: fftinfo_dsp

void fftinfo_dsp(t_fftinfo *x, t_signal **sp, short *count)
{
	if (x->x_pfft) {
		outlet_int(x->x_out[3], (x->x_fullspect = (x->x_pfft->x_fullspect)?1:0));
		outlet_int(x->x_out[2], (x->x_ffthop = x->x_pfft->x_ffthop));
		outlet_int(x->x_out[1], (x->x_n = sp[0]->s_n));
		outlet_int(x->x_out[0], (x->x_fftsize = x->x_pfft->x_fftsize));
	}
	else if (fftinfo_warning) {
		object_warn((t_object *)x, "fftinfo~ only functions inside a pfft~",0);
		fftinfo_warning = 0;
	}
}
开发者ID:Cycling74,项目名称:max5-sdk,代码行数:13,代码来源:fftinfo~.c

示例6: fftinfo_bang

void fftinfo_bang(t_fftinfo *x)
{
	if (x->x_pfft) {
		// just output current values
		outlet_int(x->x_out[3], x->x_fullspect); // fullspect flag
		outlet_int(x->x_out[2], x->x_ffthop);
		outlet_int(x->x_out[1], x->x_n);
		outlet_int(x->x_out[0], x->x_fftsize);
	}
	else if (fftinfo_warning) {
		object_warn((t_object *)x, "fftinfo~ only functions inside a pfft~",0);
		fftinfo_warning = 0;
	}
}
开发者ID:Cycling74,项目名称:max5-sdk,代码行数:14,代码来源:fftinfo~.c

示例7: bits_list

// Method for list input (converts a list of bits into a long)
void bits_list(t_bits *x, t_symbol *msg, short argc, t_atom *argv)
{
	int i, j;			// counters
	long val = 0;		// Our bit-constructed number
	long temp;
	Atom templist[3];	// used in matrixctrl mode
	
	if(x->mode==ps_bits2ints){						// *** BIT-LIST TO INTEGER(LIST) MODE ***
		for(i=(argc - 1); i>=0; i--){
			temp = argv[i].a_w.w_long;
			val |= temp<<(argc-(i+1));						// bit shift, then or it with the val
		}	
		outlet_int(x->my_outlet[0], val);					// spit it out
	}
	else if(x->mode==ps_matrixctrl2ints){			// *** MATRIX-CTRL TO INTEGER-LIST MODE ***
		object_post((t_object *)x, "tap.bits: This mode is not yet implemented");
	}
	else if(x->mode==ps_ints2matrixctrl){			// *** INTEGER-LIST TO MATRIX-CTRL MODE ***
		for(j=0; j<argc; j++){
			atom_setlong(templist+1, j);						// Store the row in the output list
			temp = argv[j].a_w.w_long;					// Get the value in the input list (for the moment we assume it is an int - should also handle floats)
			for(i=0; i < x->matrix_width; i++){
				atom_setlong(templist+0, i);						// Store the column in the output list
				atom_setlong(templist+2, 1 & temp);				// Store the switch value in the output list
				temp = temp>>1;								// Bit shift to the next one
				
				outlet_list(x->my_outlet[0], 0L, 3, templist);	// output the result	
			}
		}
	}
	else			// use the Jitter attribute dumpout outlet to report an error
开发者ID:imclab,项目名称:TapTools,代码行数:32,代码来源:tap.bits.cpp

示例8: output_msg

void output_msg(t_oscroute *x, char *msg, int outlet, long argc, t_atom *argv)
{
	t_symbol *output;
	if (msg == '\0') {
		
		if (argc == 0) {
			outlet_bang(x->outlets[outlet]);
		} else if (argc==1) {
		
			if (argv->a_type==A_LONG) 
				outlet_int(x->outlets[outlet],argv->a_w.w_long);				
			else if (argv->a_type==A_FLOAT) 
				outlet_float(x->outlets[outlet],argv->a_w.w_float);
			else if (argv->a_type==A_SYM) 
				outlet_anything(x->outlets[outlet],argv->a_w.w_sym,0,0);
				
		} else {
			if (argv->a_type==A_SYM) {
				output = argv->a_w.w_sym;
				argc--;
				argv++;
			} else {
				output = _sym_list;
			}
					
			outlet_anything(x->outlets[outlet], output, argc, argv);
		}				
	} else 
		outlet_anything(x->outlets[outlet], gensym(msg), argc, argv);
	
}
开发者ID:thorangutang,项目名称:JamomaMax,代码行数:31,代码来源:jcom.oscroute.cpp

示例9: akabookmotion_bang

void akabookmotion_bang(t_akabookmotion *x)
{
	int sms_x, sms_y, sms_z;
	int result;
	
	if (x->type != unknown)
	{
		result = read_sms_raw(x->type, &sms_x, &sms_y, &sms_z);
		if (result)
		{
			outlet_int(x->m_zout, sms_z);
			outlet_int(x->m_yout, sms_y);
			outlet_int(x->m_xout, sms_x);
		}
	}
}
开发者ID:Themitchell,项目名称:Max-Library,代码行数:16,代码来源:aka.bookmotion.c

示例10: return_int

// INT INPUT
void return_int(t_return *x, long value)
{
	if (!x->attrEnable)
		return;
	if (x->common.attr_repetitions == 0) {
		if (value == atom_getlong(&x->output[1]))
			return;
	}
	if (x->common.attr_clipmode != _sym_none) {
		if (x->common.attr_clipmode == jps_both)
			TTLimit<TTInt32>(value, x->common.attr_range[0], x->common.attr_range[1]);
		else if (x->common.attr_clipmode == jps_low)
			TTLimitMin<TTInt32>(value, x->common.attr_range[0]);
		else if (x->common.attr_clipmode == jps_high)
			TTLimitMax<TTInt32>(value, x->common.attr_range[1]);
		else if (x->common.attr_clipmode == jps_wrap)
			value = TTInfWrap<TTInt32>(value,x->common.attr_range[0], x->common.attr_range[1]);
		else if (x->common.attr_clipmode == jps_fold)
			value = TTFold<TTInt32>(value, x->common.attr_range[0], x->common.attr_range[1]);
	}
    
	atom_setlong(&x->output[1], value);
	x->output_len = 2;
	return_send_feedback(x);

	outlet_int(x->outlets[k_outlet_thru], value);
}
开发者ID:OlivierBaudry,项目名称:JamomaModular,代码行数:28,代码来源:jcom.return.cpp

示例11: stats_bang

// BANG input
void stats_bang(t_stats *x)
{
	double mean, standardDeviation;
   
/*	if (x->valueCount < 0)
		mean = 0;
	else 
		mean = x->sumOfValues / x->valueCount;
	if (x->valueCount > 1)
		standardDeviation = sqrt((x->sumOfSquaredValues - ((x->sumOfValues*x->sumOfValues) / x->valueCount)) / (x->valueCount - 1));
	else
		standardDeviation = 0;*/

/////small optimization by Nils Peters////

	if (x->valueCount >= 0)
		mean = x->sumOfValues / x->valueCount;  
	else
		mean = 0;
    if (x->valueCount > 1)
        standardDeviation = sqrt((x->sumOfSquaredValues - (x->sumOfValues*mean)) / (x->valueCount - 1));  /* i just simplified the equation by using the mean which was already calculated before*/
    else
        standardDeviation = 0;
///// end of small optimization by Nils Peters////  
	outlet_float(x->outlet5, standardDeviation);
	outlet_float(x->outlet4, mean);
	outlet_float(x->outlet3, x->max);
	outlet_float(x->outlet2, x->min);
	outlet_int(x->outlet, x->valueCount);
}
开发者ID:avilleret,项目名称:JamomaMax,代码行数:31,代码来源:j.stats.cpp

示例12: DiceyBang

static void
DiceyBang(
	objDicey* me)
	
	{
	long	c	= me->nDice,		// All of these are non-negative, but will not exceed
			f	= me->nFaces,		// kMaxLong, so don't need to declare unsigned.
			d;						// Initialize in if/else below
	
	
	if (f < 2) d = c;				// Shortcut for degenerate dice
	else {
		tTaus88DataPtr	tausData = me->tausData;
		double			ff		= f;				// Convert long to double now
		d = 0;
		while (c-- > 0) {
			// ULong2Unit_Zo returns value in range		[0.0 .. 1.0)
			// * ff				results in range			[0.0 .. ff)
			// + 1.0			results in range			[1.0 .. ff + 1.0)
			// Thus values are equally distributed over [1 .. 2), [2 .. 3), ..., [ff .. f+1)
			// After truncation to integer we have equiprobably distribution of 1, 2, .. f
			// QED
			d += ff * ULong2Unit_Zo(Taus88(tausData)) + 1.0;
			}
		}
	
	outlet_int(me->coreObject.o_outlet, d);
	
	}
开发者ID:pcastine-lp,项目名称:LitterPower,代码行数:29,代码来源:dicey.c

示例13: filein_access

void filein_access(t_filein *x, t_symbol *s, short ac, t_atom *av)
{
	OSErr err;
	Byte data[8];
	long count;
	unsigned long dummy;
	
	if (s==ps_int)
		count = 1;
	else if (s==ps_in1)
		count = 2;
	else
		count = 4;
	err = sysfile_setpos(x->f_fh,SYSFILE_FROMSTART,av->a_w.w_long);
	if (err)
		object_error((t_object *)x, "seek err %d",err);
	else {
		err = sysfile_read(x->f_fh,&count,data);
		if (err)
			object_error((t_object *)x, "read err %d",err);
		else {
			if (count==1)
				dummy = data[0];
			else
				sysmem_copyptr(data,&dummy,count);
			outlet_int(x->f_out,dummy);
		}
	}
}
开发者ID:pukulsesuatu,项目名称:max6-sdk,代码行数:29,代码来源:filein.c

示例14: iter_int

void iter_int(t_iter *x, long n)
{
	iter_resize(x,1);
	x->i_ac = 1;
	SETLONG(x->i_av,n);
	outlet_int(x->i_ob.o_outlet,n);
}
开发者ID:Alfpercar,项目名称:MaxMSPExternals,代码行数:7,代码来源:iter.c

示例15: _defer_delete

void _defer_delete(t_filesys *x, t_symbol *sym, long argc, t_atom *argv)
{
  TRACE("_defer_delete");

  char str_cur[MAX_PATH_CHARS];

  t_symbol *sym_cur = atom_getsym(argv);

  _filesys_get_path(x, sym_cur->s_name, str_cur);
  
  // Try deleting the file
  int err = 0;

#ifdef WIN_VERSION
  err = remove(str_cur);
#endif

#ifdef MAC_VERSION
  err = remove(str_cur);
#endif

  // In case of success
  if (!err) { if (x->a_verbose) { POST("Removing:  %s", sym_cur->s_name); } }

  // ... otherwise post an error message
  else {
    switch (errno) {
    case EACCES: MY_ERR("delete:  File is open or read-only:  \"%s\"",
      sym_cur->s_name); break;
    case ENOENT: MY_ERR("delete:  File not found:  \"%s\"", sym_cur->s_name); break;
    default: MY_ERR("delete:  Unknown error:  %i", errno); break; } }

  // Send a 0 or 1 message to indicate failure or success
  outlet_int(x->outl_return, err ? 0 : 1);
}
开发者ID:ycandau,项目名称:y.filesys,代码行数:35,代码来源:y_filesys.c


注:本文中的outlet_int函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。