您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ t_freebytes函数代码示例

51自学网 2021-06-03 08:39:14
  C++
这篇教程C++ t_freebytes函数代码示例写得很实用,希望能帮到您。

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

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

示例1: multigrain_dsp_free

void multigrain_dsp_free(t_multigrain *x){	dsp_free((t_pxobject *)x);	t_freebytes(x->grains, MAXGRAINS * sizeof(t_grain));	t_freebytes(x->pitchscale, MAXSCALE * sizeof(float));    t_freebytes(x->changroup, x->output_channels * sizeof(long));}
开发者ID:ericlyon,项目名称:LyonPotpourri3.0-MaxMSP,代码行数:7,


示例2: specBrightness_tilde_bang

static void specBrightness_tilde_bang(t_specBrightness_tilde *x){    int i, j, window, window_half, bang_sample, bin_boundary;    float dividend, divisor, brightness;    t_sample *signal_R, *signal_I;	double current_time;    window = x->window;    window_half = window*0.5;	// create local memory	signal_R = (t_sample *)getbytes(0);	signal_I = (t_sample *)getbytes(0);	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window*sizeof(t_sample));	signal_I = (t_sample *)t_resizebytes(signal_I, 0, window_half*sizeof(t_sample));	    bin_boundary = specBrightness_tilde_nearest_bin_index(x->freq_boundary, x->bin_freqs);  // hard-coded based on 1200, but can use nearest_bin_freq function later    	current_time = clock_gettimesince(x->last_dsp_time);	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round	if (bang_sample < 0)        bang_sample = 0;    else if ( bang_sample >= x->n )        bang_sample = x->n - 1;            	// construct analysis window using bang_sample as the end of the window	for(i=0, j=bang_sample; i<window; i++, j++)		signal_R[i] = x->signal_R[j];		specBrightness_tilde_hann(window, signal_R, x->hann);	mayer_realfft(window, signal_R);	specBrightness_tilde_realfft_unpack(window, window_half, signal_R, signal_I);	specBrightness_tilde_abs(window_half, signal_R, signal_I);	// 	if(x->normalize)// 		specBrightness_tilde_normal(window_half, signal_R);	dividend=0;	divisor=0;	brightness=0;		for(i=bin_boundary; i<window_half; i++)		dividend += signal_R[i];	for(i=0; i<window_half; i++)		divisor += signal_R[i];		if(divisor==0)		divisor=1;			brightness = dividend/divisor;			outlet_float(x->x_brightness, brightness);	// free local memory	t_freebytes(signal_R, window * sizeof(t_sample));	t_freebytes(signal_I, window_half * sizeof(t_sample));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:59,


示例3: getonset_free

void  getonset_free(t_getonset *x) {	if (x->Buf1) t_freebytes(x->Buf1, x->BufSize * sizeof(float));	if (x->Buf2) t_freebytes(x->Buf2, x->BufSize * sizeof(float));	if (x->BufFFT) t_freebytes(x->BufFFT, x->FFTSize * sizeof(float));	if (x->memFFT) t_freebytes(x->memFFT, CMAX * x->FFTSize * sizeof(float));	freeobject((t_object *)x->g_clock);	dsp_free((t_pxobject *)x);}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:8,


示例4: specCentroid_tilde_free

static void specCentroid_tilde_free(t_specCentroid_tilde *x){	// free the input buffer memory    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));	// free the hann window memory    t_freebytes(x->hann, x->window*sizeof(float));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:8,


示例5: pique_free

static void pique_free(t_pique *x){    int n = x->x_n;    t_freebytes(x->x_freq, n * sizeof(*x->x_freq));    t_freebytes(x->x_amp, n * sizeof(*x->x_amp));    t_freebytes(x->x_ampre, n * sizeof(*x->x_ampre));    t_freebytes(x->x_ampim, n * sizeof(*x->x_ampim));}
开发者ID:Gaz5700,项目名称:pd-double,代码行数:8,


示例6: oscil_dsp_free

void oscil_dsp_free(t_oscil *x){	t_freebytes(x->wavetable, x->table_length * sizeof(float));	t_freebytes(x->old_wavetable, x->table_length * sizeof(float));	t_freebytes(x->harmonic_weights, OSCIL_MAXIMUM_HARMONICS * sizeof(float));	t_freebytes(x->harmonic_phases, OSCIL_MAXIMUM_HARMONICS * sizeof(float));}
开发者ID:ericlyon,项目名称:lyonpotpourri3.0-64bit,代码行数:8,


示例7: resample_free

void resample_free(t_resample *x){  if (x->s_n) t_freebytes(x->s_vec, x->s_n*sizeof(*x->s_vec));  if (x->coefsize) t_freebytes(x->coeffs, x->coefsize*sizeof(*x->coeffs));  if (x->bufsize) t_freebytes(x->buffer, x->bufsize*sizeof(*x->buffer));  x->s_n = x->coefsize = x->bufsize = 0;  x->s_vec = x->coeffs = x->buffer  = 0;}
开发者ID:4nykey,项目名称:rockbox,代码行数:9,


示例8: centroid_free

void  centroid_free(t_centroid *x) {	if (x->Buf1) t_freebytes(x->Buf1, x->BufSize * sizeof(float));	if (x->Buf2) t_freebytes(x->Buf2, x->BufSize * sizeof(float));	if (x->BufFFT) t_freebytes(x->BufFFT, x->FFTSize * sizeof(float));	if (x->WindFFT) t_freebytes(x->WindFFT, x->FFTSize * sizeof(float));	if (x->memFFT) t_freebytes(x->memFFT, CMAX * x->FFTSize * sizeof(float));	freeobject((t_object *)x->c_clock);	dsp_free((t_pxobject *)x);}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:9,


示例9: specCentroid_tilde_bang

static void specCentroid_tilde_bang(t_specCentroid_tilde *x){    int i, j, window, window_half, bang_sample;    float dividend, divisor, centroid;    t_sample *signal_R, *signal_I;	double current_time;    window = x->window;    window_half = window*0.5;	// create local memory	signal_R = (t_sample *)getbytes(0);	signal_I = (t_sample *)getbytes(0);	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window*sizeof(t_sample));	signal_I = (t_sample *)t_resizebytes(signal_I, 0, window_half*sizeof(t_sample));    	current_time = clock_gettimesince(x->last_dsp_time);	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round	if (bang_sample < 0)        bang_sample = 0;    else if ( bang_sample >= x->n )        bang_sample = x->n - 1;            	// construct analysis window using bang_sample as the end of the window	for(i=0, j=bang_sample; i<window; i++, j++)		signal_R[i] = x->signal_R[j];		specCentroid_tilde_hann(window, signal_R, x->hann);	mayer_realfft(window, signal_R);	specCentroid_tilde_realfft_unpack(window, window_half, signal_R, signal_I);	specCentroid_tilde_abs(window_half, signal_R, signal_I);	// 	if(x->normalize)// 		specCentroid_tilde_normal(window_half, signal_R);	dividend=0;	divisor=0;	centroid=0;		for(i=0; i<window_half; i++)		dividend += signal_R[i]*(i*(x->sr/window));  // weight by bin freq	for(i=0; i<window_half; i++)		divisor += signal_R[i];			if(divisor==0) divisor = 1; // don't divide by zero		centroid = dividend/divisor;			outlet_float(x->x_centroid, centroid);	// free local memory	t_freebytes(signal_R, window * sizeof(t_sample));	t_freebytes(signal_I, window_half * sizeof(t_sample));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:56,


示例10: cepstrum_tilde_bang

static void cepstrum_tilde_bang(t_cepstrum_tilde *x){    int i, j, window, window_half, bang_sample;   	t_atom *listOut;    t_sample *signal_R, *signal_I;	double current_time;    window = x->window;    window_half = window*0.5;   	signal_R = (t_sample *)getbytes(0);	signal_I = (t_sample *)getbytes(0);	listOut = (t_atom *)getbytes(0);	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window*sizeof(t_sample));	signal_I = (t_sample *)t_resizebytes(signal_I, 0, window_half*sizeof(t_sample));	listOut = (t_atom *)t_resizebytes(listOut, 0, ((int)x->window*0.5)*sizeof(t_atom));		current_time = clock_gettimesince(x->last_dsp_time);	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round	if (bang_sample < 0)        bang_sample = 0;    else if ( bang_sample >= x->n )        bang_sample = x->n - 1;            	// construct analysis window using bang_sample as the end of the window	for(i=0, j=bang_sample; i<window; i++, j++)		signal_R[i] = x->signal_R[j];		cepstrum_tilde_hann(window, signal_R, x->hann);	mayer_realfft(window, signal_R);	cepstrum_tilde_realfft_unpack(window, window_half, signal_R, signal_I);	cepstrum_tilde_abs(window_half, signal_R, signal_I);		if(x->normalize)		cepstrum_tilde_normal(window_half, signal_R);		cepstrum_tilde_log(window_half, signal_R);	// fill out the negative frequencies	for(i=0; i<window_half; i++)		signal_I[i] = signal_R[i];//		signal_I[i] = 0.0; // or we could zero them out...			cepstrum_tilde_realifft(window, window_half, signal_R, signal_I);					for(i=0; i<window_half; i++)		SETFLOAT(listOut+i, signal_R[i]);	outlet_list(x->x_featureList, 0, window_half, listOut);	t_freebytes(signal_R, window * sizeof(t_sample));	t_freebytes(signal_I, window_half * sizeof(t_sample));	t_freebytes(listOut, window_half * sizeof(t_atom));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:56,


示例11: pitcher_free

void pitcher_free(t_pitcher *x) {		if (x->ringBufSize != 0) {		t_freebytes(x->inputRingBuf, (long) (x->ringBufSize * sizeof(float)));	}		if (x->ringBufSize != 0) {		t_freebytes(x->outputRingBuf, (long) (x->ringBufSize * sizeof(float)));	}		dsp_free(&(x->x_obj));}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:10,


示例12: namelist_free

void namelist_free(t_namelist *listwas){    t_namelist *nl, *nl2;    for (nl = listwas; nl; nl = nl2)    {        nl2 = nl->nl_next;        t_freebytes(nl->nl_string, strlen(nl->nl_string) + 1);        t_freebytes(nl, sizeof(*nl));    }}
开发者ID:rfabbri,项目名称:pd-extended-core,代码行数:10,


示例13: bfcc_tilde_free

static void bfcc_tilde_free(t_bfcc_tilde *x){	int i;		// free the input buffer memory    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));	// free the blackman window memory    t_freebytes(x->blackman, x->window*sizeof(float));	// free the cosine window memory    t_freebytes(x->cosine, x->window*sizeof(float));	// free the hamming window memory    t_freebytes(x->hamming, x->window*sizeof(float));	// free the hann window memory    t_freebytes(x->hann, x->window*sizeof(float));    	// free the bfcc memory    t_freebytes(x->bfcc, x->num_filters*sizeof(float));           // free the filterbank memory	for(i=0; i<x->num_filters; i++)		t_freebytes(x->x_filterbank[i].filter, x->x_filterbank_sizes[i]*sizeof(float));    	t_freebytes(x->x_filterbank, x->num_filters*sizeof(t_filter));	// free the indices memory    t_freebytes(x->x_indices, x->num_filters*sizeof(t_indices));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:31,


示例14: specBrightness_tilde_free

static void specBrightness_tilde_free(t_specBrightness_tilde *x){	// free the input buffer memory    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));	// free the hann window memory    t_freebytes(x->hann, x->window*sizeof(float));	// free the bin freq memory    t_freebytes(x->bin_freqs, x->window*sizeof(float));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:11,


示例15: magSpec_tilde_free

static void magSpec_tilde_free(t_magSpec_tilde *x){	// free the input buffer memory    t_freebytes(x->signal_R, (x->window+x->n)*sizeof(t_sample));	// free the window memory	t_freebytes(x->blackman, x->window*sizeof(t_float));	t_freebytes(x->cosine, x->window*sizeof(t_float));	t_freebytes(x->hamming, x->window*sizeof(t_float));	t_freebytes(x->hann, x->window*sizeof(t_float));}
开发者ID:avilleret,项目名称:timbreID,代码行数:11,


示例16: nearestPoint_free

static void nearestPoint_free(t_nearestPoint *x){	int i;			for(i=0; i<x->numPoints; i++)		t_freebytes(x->x_coordinates[i].coordinate, x->dimensions*sizeof(t_float));		t_freebytes(x->x_coordinates, x->numPoints*sizeof(t_coordinate));		t_freebytes(x->x_input, x->dimensions*sizeof(t_float));}
开发者ID:avilleret,项目名称:timbreID,代码行数:11,


示例17: udpsend_tilde_free

static void udpsend_tilde_free(t_udpsend_tilde* x){    udpsend_tilde_disconnect(x);    /* free the memory */    if (x->x_cbuf)t_freebytes(x->x_cbuf, x->x_cbufsize);    if (x->x_myvec)t_freebytes(x->x_myvec, sizeof(t_int) * (x->x_ninlets + 3));    clock_free(x->x_clock);    pthread_mutex_destroy(&x->x_mutex);}
开发者ID:Angeldude,项目名称:pd,代码行数:12,


示例18: fft_free

void fft_free(t_fft *x){	if (x->f_realin)		t_freebytes(x->f_realin,x->f_points * sizeof(float));	if (x->f_imagin)		t_freebytes(x->f_imagin,x->f_points * sizeof(float));	if (x->f_realout)		t_freebytes(x->f_realout,x->f_points * sizeof(float));	if (x->f_imagout)		t_freebytes(x->f_imagout,x->f_points * sizeof(float));	dsp_free((t_pxobject *)x);	if (fts_mode)		freeobject(x->f_clock);}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:14,


示例19: fft_free

void fft_free(t_fft *x){	if (x->x_realin)		t_freebytes(x->x_realin,x->x_fftsize * sizeof(float));	if (x->x_imagin)		t_freebytes(x->x_imagin,x->x_fftsize * sizeof(float));	if (x->x_realout)		t_freebytes(x->x_realout,x->x_fftsize * sizeof(float));	if (x->x_imagout)		t_freebytes(x->x_imagout,x->x_fftsize * sizeof(float));	if (x->x_window)		t_freebytes(x->x_window,x->x_fftsize * sizeof(float));	dsp_free((t_pxobject *)x);}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:15,


示例20: stft_free

void stft_free(t_stft *x){	if (x->x_in)		t_freebytes(x->x_in,x->x_fftsize * sizeof(float));	if (x->x_out)		t_freebytes(x->x_out,x->x_fftsize * sizeof(float));	if (x->x_window)		t_freebytes(x->x_window,x->x_fftsize * sizeof(float));		if (x->x_sdifbuf)		t_freebytes(x->x_sdifbuf,x->x_sdifbufsize * sizeof(t_complex));	//if (x->x_twiddle) 	//	t_freebytes(x->x_twiddle, CMAX * x->x_fftsize * sizeof(float));	dsp_free((t_pxobject *)x);}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:15,


示例21: zeroCrossing_tilde_bang

static void zeroCrossing_tilde_bang(t_zeroCrossing_tilde *x){    int i, j, window, bang_sample;    float crossings;    t_sample *signal_R;	double current_time;    window = x->window;	signal_R = (t_sample *)getbytes(0);	signal_R = (t_sample *)t_resizebytes(signal_R, 0, window * sizeof(t_sample));    	current_time = clock_gettimesince(x->last_dsp_time);	bang_sample = (int)(((current_time/1000.0)*x->sr)+0.5); // round	if (bang_sample < 0)        bang_sample = 0;    else if ( bang_sample >= x->n )        bang_sample = x->n - 1;            	// construct analysis window using bang_sample as the end of the window	for(i=0, j=bang_sample; i<window; i++, j++)		signal_R[i] = x->signal_R[j];		crossings=0;		crossings = zeroCrossing_tilde_zero_crossing_rate(window, signal_R);			outlet_float(x->x_crossings, crossings);	// free local memory    t_freebytes(signal_R, window*sizeof(t_sample));}
开发者ID:brunorohde,项目名称:SINCOPA,代码行数:34,


示例22: gstub_dis

static void gstub_dis(t_gstub *gs){    int refcount = --gs->gs_refcount;    if ((!refcount) && gs->gs_which == GP_NONE)        t_freebytes(gs, sizeof (*gs));    else if (refcount < 0) bug("gstub_dis");}
开发者ID:Yalexyo,项目名称:SoundMaster,代码行数:7,


示例23: pack_bang

static void pack_bang(t_pack *x){    int i, reentered = 0, size = x->x_n * sizeof (t_atom);    t_gpointer *gp;    t_atom *outvec;    for (i = x->x_nptr, gp = x->x_gpointer; i--; gp++)    	if (!gpointer_check(gp, 1))    {    	pd_error(x, "pack: stale pointer");    	return;    }    	/* reentrancy protection.  The first time through use the pre-allocated	x_outvec; if we're reentered we have to allocate new memory. */    if (!x->x_outvec)    {    	    /* LATER figure out how to deal with reentrancy and pointers... */    	if (x->x_nptr)	    post("pack_bang: warning: reentry with pointers unprotected");	outvec = t_getbytes(size);	reentered = 1;    }    else    {    	outvec = x->x_outvec;	x->x_outvec = 0;    }    memcpy(outvec, x->x_vec, size);    outlet_list(x->x_obj.ob_outlet, &s_list, x->x_n, outvec);    if (reentered)    	t_freebytes(outvec, size);    else x->x_outvec = outvec;}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:32,


示例24: vinlet_free

static void vinlet_free(t_vinlet *x){    canvas_rminlet(x->x_canvas, x->x_inlet);    if (x->x_buf)        t_freebytes(x->x_buf, x->x_bufsize * sizeof(*x->x_buf));    resample_free(&x->x_updown);}
开发者ID:Angeldude,项目名称:pure-data,代码行数:7,


示例25: conv_tilde_free

void conv_tilde_free(t_conv_tilde *x){	#ifdef THREADS		int rc = pthread_join(x->childthread, NULL);		if (rc != 0 )			post("conv~: pthread_join() error %d.", rc);	#endif	/* Free channel variable arrays. */	//free(x->parameters);	free(x->input_rw_ptr);	free(x->ir_end_ptr);	free(x->ir_frames);	free(x->frames_stored);	free(x->irlength);	free(x->ircount);	free(x->ircount_prev);	/* Free fft plans and associated arrays. */	conv_tilde_free_fft_plans(x);	/* free the dsp vector */	if (x->x_myvec)		t_freebytes(x->x_myvec, sizeof(t_int) * (x->all_channels + 3));}
开发者ID:joniemi,项目名称:dist-conv,代码行数:25,


示例26: vline_tilde_float

static void vline_tilde_float(t_vline *x, t_float f){    t_time timenow = clock_gettimesince(x->x_referencetime);    t_sample inlet1 = (x->x_inlet1 < 0 ? 0 : (t_sample)x->x_inlet1);    t_sample inlet2 = (t_sample) x->x_inlet2;    t_time starttime = timenow + inlet2;    t_vseg *s1, *s2, *deletefrom = 0,    	*snew = (t_vseg *)t_getbytes(sizeof(*snew));    if (PD_BADFLOAT(f))	f = 0;    	/* negative delay input means stop and jump immediately to new value */    if (inlet2 < 0)    {    	vline_tilde_stop(x);	x->x_value = ftofix(f);	return;    }    	/* check if we supplant the first item in the list.  We supplant	an item by having an earlier starttime, or an equal starttime unless	the equal one was instantaneous and the new one isn't (in which case	we'll do a jump-and-slide starting at that time.) */    if (!x->x_list || x->x_list->s_starttime > starttime ||    	(x->x_list->s_starttime == starttime &&	    (x->x_list->s_targettime > x->x_list->s_starttime || inlet1 <= 0)))    {    	deletefrom = x->x_list;	x->x_list = snew;    }    else    {    	for (s1 = x->x_list; (s2 = s1->s_next); s1 = s2)	{    	    if (s2->s_starttime > starttime ||    		(s2->s_starttime == starttime &&		    (s2->s_targettime > s2->s_starttime || inlet1 <= 0)))	    {    		deletefrom = s2;		s1->s_next = snew;		goto didit;	    }	}	s1->s_next = snew;	deletefrom = 0;    didit: ;    }    while (deletefrom)    {    	s1 = deletefrom->s_next;	t_freebytes(deletefrom, sizeof(*deletefrom));	deletefrom = s1;    }    snew->s_next = 0;    snew->s_target = f;    snew->s_starttime = starttime;    snew->s_targettime = starttime + inlet1;    x->x_inlet1 = x->x_inlet2 = 0;}
开发者ID:4nykey,项目名称:rockbox,代码行数:58,


示例27: vline_tilde_stop

static void vline_tilde_stop(t_vline *x){    t_vseg *s1, *s2;    for (s1 = x->x_list; s1; s1 = s2)    	s2 = s1->s_next, t_freebytes(s1, sizeof(*s1));    x->x_list = 0;    x->x_inc = 0;    x->x_inlet1 = x->x_inlet2 = 0;}
开发者ID:4nykey,项目名称:rockbox,代码行数:9,


示例28: freeverb_free

	// clean upstatic void freeverb_free(t_freeverb *x)    {	int i;#ifndef PD	dsp_free((t_pxobject *)x);		// Free the object#endif	// free memory used by delay lines	for(i = 0; i < numcombs; i++)	{		t_freebytes(x->x_bufcombL[i], x->x_combtuningL[i]*sizeof(t_float));		t_freebytes(x->x_bufcombR[i], x->x_combtuningR[i]*sizeof(t_float));	}	for(i = 0; i < numallpasses; i++)	{		t_freebytes(x->x_bufallpassL[i], x->x_allpasstuningL[i]*sizeof(t_float));		t_freebytes(x->x_bufallpassR[i], x->x_allpasstuningR[i]*sizeof(t_float));	}}
开发者ID:BirminghamConservatoire,项目名称:IntegraLive,代码行数:20,


示例29: netsend_send

static void netsend_send(t_netsend *x, t_symbol *s, int argc, t_atom *argv){#ifdef ROCKBOX    (void) x;    (void) s;    (void) argc;    (void) argv;#else /* ROCKBOX */    if (x->x_fd >= 0)    {	t_binbuf *b = binbuf_new();	char *buf, *bp;	int length, sent;	t_atom at;	binbuf_add(b, argc, argv);	SETSEMI(&at);	binbuf_add(b, 1, &at);	binbuf_gettext(b, &buf, &length);	for (bp = buf, sent = 0; sent < length;)	{	    static double lastwarntime;	    static double pleasewarn;	    double timebefore = sys_getrealtime();    	    int res = send(x->x_fd, buf, length-sent, 0);    	    double timeafter = sys_getrealtime();    	    int late = (timeafter - timebefore > 0.005);    	    if (late || pleasewarn)    	    {    	    	if (timeafter > lastwarntime + 2)    	    	{    	    	     post("netsend blocked %d msec",    	    	     	(int)(1000 * ((timeafter - timebefore) + pleasewarn)));    	    	     pleasewarn = 0;    	    	     lastwarntime = timeafter;    	    	}    	    	else if (late) pleasewarn += timeafter - timebefore;    	    }    	    if (res <= 0)    	    {    		sys_sockerror("netsend");    		netsend_disconnect(x);    		break;    	    }    	    else    	    {    		sent += res;    		bp += res;    	    }	}	t_freebytes(buf, length);	binbuf_free(b);    }    else error("netsend: not connected");#endif /* ROCKBOX */}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:55,


示例30: clock_gettimesince

static t_int *vline_tilde_perform(t_int *w){    t_vline *x = (t_vline *)(w[1]);    t_sample *out = (t_sample *)(w[2]);    int n = (int)(w[3]), i;    t_sample f = x->x_value;    t_sample inc = x->x_inc;    t_time msecpersamp = x->x_msecpersamp;#ifndef ROCKBOX    t_time samppermsec = x->x_samppermsec;#endif    t_time timenow = clock_gettimesince(x->x_referencetime) - n * msecpersamp;    t_vseg *s = x->x_list;    for (i = 0; i < n; i++)    {    	t_time timenext = timenow + msecpersamp;    checknext:	if (s)	{	    /* has starttime elapsed?  If so update value and increment */	    if (s->s_starttime < timenext)	    {		if (x->x_targettime <= timenext)		    f = x->x_target, inc = 0;	    	    /* if zero-length segment bash output value */	    	if (s->s_targettime <= s->s_starttime)		{		    f = s->s_target;		    inc = 0;		}		else		{		    t_time incpermsec = idiv((s->s_target - f),		    	(s->s_targettime - s->s_starttime));		    f = mult(f + incpermsec,(timenext - s->s_starttime));		    inc = mult(incpermsec,msecpersamp);		}    	    	x->x_inc = inc;		x->x_target = s->s_target;		x->x_targettime = s->s_targettime;		x->x_list = s->s_next;		t_freebytes(s, sizeof(*s));		s = x->x_list;		goto checknext;	    }	}	if (x->x_targettime <= timenext)	    f = x->x_target, inc = 0;	*out++ = f;	f = f + inc;	timenow = timenext;    }    x->x_value = f;    return (w+4);}
开发者ID:4nykey,项目名称:rockbox,代码行数:55,



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


C++ t_getbytes函数代码示例
C++ t_error函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。