本文整理汇总了C++中outlet_bang函数的典型用法代码示例。如果您正苦于以下问题:C++ outlet_bang函数的具体用法?C++ outlet_bang怎么用?C++ outlet_bang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outlet_bang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lifop_bang
static void lifop_bang(t_lifop *x)
{
t_lifop_prioritylist*plifo=0;
t_lifop_list*lifo=0;
t_atom*argv=0;
int argc=0;
if(!(plifo=getLifo(x->lifo_list))){
outlet_bang(x->x_infout);
return;
}
if(!(lifo=plifo->lifo_start)){
outlet_bang(x->x_infout);
return;
}
x->counter--;
plifo->lifo_start=lifo->next;
/* get the list from the entry */
argc=lifo->argc;
argv=lifo->argv;
lifo->argc=0;
lifo->argv=0;
lifo->next=0;
/* destroy the lifo-entry (important for recursion! */
freebytes(lifo, sizeof(t_lifop_list));
/* output the list */
outlet_list(x->x_out, &s_list, argc, argv);
/* free the list */
freebytes(argv, argc*sizeof(t_atom));
}
示例2: oggread_decode_input
static int oggread_decode_input(t_oggread *x)
{
long ret; /* bytes per channel returned by decoder */
int i;
float **pcm;
x->x_vi = ov_info(&x->x_ov, x->x_current_section);
while(!x->x_eos)
{
ret = ov_read_float(&x->x_ov, &pcm, READ, &x->x_current_section);
if (ret == 0)
{
/* EOF */
x->x_eos = 1;
x->x_stream = 0;
clock_unset(x->x_clock);
// post("oggread~: end of file detected, stopping");
outlet_bang(x->x_out_end);
}
else if (ret < 0)
{
/* error in the stream. Not a problem, just reporting it in
case we (the app) cares. In this case, we don't. */
}
else
{
/* we don't bother dealing with sample rate changes, etc, but
you'll have to */
long j;
for(j = 0; j < ret; j++)
{
for(i = 0; i < x->x_vi->channels; i++)
{
x->x_outbuffer[x->x_outwriteposition] = pcm[i][j];
x->x_outwriteposition = (x->x_outwriteposition + 1)%x->x_outbuffersize;
}
}
x->x_outunread += (t_int)ret * x->x_vi->channels;
}
break;
}
x->x_decoded = (t_int)ret * x->x_vi->channels; /* num. of samples we got from decoder */
x->x_position = (t_float)ov_time_tell(&x->x_ov);
/* exit decoding 'loop' here, we'll get called again by perform() */
return 1;
}
示例3: x10ProcessQueue
/*------------------------------------ x10ProcessQueue ---*/
static void
x10ProcessQueue(X10ControlData * xx)
{
if (xx && (! xx->fStopping))
{
short prevLock = lockout_set(1);
outlet_bang(xx->fPollerOut);
clock_delay(xx->fPollClock, xx->fPollRate);
lockout_set(prevLock);
#if USE_EVNUM
evnum_incr();
#endif /* USE_EVNUM */
}
} // x10ProcessQueue
示例4: postrender
/////////////////////////////////////////////////////////
// postrender
//
/////////////////////////////////////////////////////////
void pix_filmOS :: postrender(GemState *state)
{
if(state) {
// state->image=m_oldImage;
state->set(GemState::_PIX, m_oldImage);
}
m_pixBlock.newimage = 0;
if (m_numFrames>0 && m_reqFrame>m_numFrames){
m_reqFrame = m_numFrames;
outlet_bang(m_outEnd);
}
m_newFilm = 0;
m_pixBlock.newfilm = m_newFilm;
}
示例5: fvec_set_sample
static t_int *aubioquiet_tilde_perform(t_int *w)
{
t_aubioquiet_tilde *x = (t_aubioquiet_tilde *)(w[1]);
t_sample *in = (t_sample *)(w[2]);
int n = (int)(w[3]);
int j;
for (j=0;j<n;j++) {
/* write input to datanew */
fvec_set_sample(x->vec, in[j], x->pos);
/*time for fft*/
if (x->pos == x->hopsize-1) {
/* block loop */
if (aubio_silence_detection(x->vec, x->silence)==1) {
if (x->wassilence==1) {
x->issilence = 1;
} else {
x->issilence = 2;
outlet_bang(x->quietbang);
}
x->wassilence=1;
} else {
if (x->wassilence<=0) {
x->issilence = 0;
} else {
x->issilence = -1;
outlet_bang(x->noisybang);
}
x->wassilence=0;
}
/* end of block loop */
x->pos = -1; /* so it will be zero next j loop */
}
x->pos++;
}
return (w+4);
}
示例6: counter_bang
//the method when a bang is received
void counter_bang(t_extCounter* x)
{
t_float f=x->i_count;
t_int step = x->step;
x->i_count+=step;
if (x->i_down-x->i_up)
{
if ((step>0) && (x->i_count > x->i_up))
{
x->i_count = x->i_down;
// so if we're reseting output a bang on the second outlet
outlet_bang(x->b_out);
}
else if (x->i_count < x->i_down)
{
x->i_count = x->i_up;
// so if we're reseting output a bang on the second outlet
outlet_bang(x->b_out);
}
}
outlet_float(x->f_out, f);
post("extCounter banging");
}
示例7: sel2_symbol
static void sel2_symbol(t_sel2 *x, t_symbol *s)
{
t_selectelement *e;
int nelement;
if (x->x_type == A_SYMBOL)
{
for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++)
if (e->e_w.w_symbol == s)
{
outlet_bang(e->e_outlet);
return;
}
}
outlet_symbol(x->x_rejectout, s);
}
示例8: spline_make_endpoints
void Catmullrom3D::spline_exec(t_spline *x)
{
long i;
double inc;
t_point delta;
spline_make_endpoints(x); // prep for hermite etc: calculate helper points
spline_stepthrough(x);
x->b_result[0].a_w.w_float = x->b_control[x->b_size - 1].x; // output the last point
x->b_result[1].a_w.w_float = x->b_control[x->b_size - 1].y;
x->b_result[2].a_w.w_float = x->b_control[x->b_size - 1].z;
outlet_list(x->b_outlet1, 0L, x->b_dim, x->b_result);
outlet_bang(x->b_outlet2);
}
示例9: sel2_float
static void sel2_float(t_sel2 *x, t_float f)
{
t_selectelement *e;
int nelement;
if (x->x_type == A_FLOAT)
{
for (nelement = x->x_nelement, e = x->x_vec; nelement--; e++)
if (e->e_w.w_float == f)
{
outlet_bang(e->e_outlet);
return;
}
}
outlet_float(x->x_rejectout, f);
}
示例10: holmes_bang
/*--------------------------------------------------------------------
* bang : output the next klatt frame as a list
*/
void holmes_bang(t_holmes *x) {
// -- get the next frame
holmes_compute_next_frame(&(x->hg),&(x->hs));
if (dsqueue_empty(x->hs.eltq)) {
// -- report end-of-queue
outlet_bang(x->eoq_out);
}
// -- reset end-of-utterance flag
x->hs.flags &= ~(HOLMES_FLAG_EOU|HOLMES_FLAG_EOW);
// -- finally, output the klatt frame
klatt_frame_to_alist((long *)&(x->hs.pars), x->aframe);
outlet_list(x->kfr_out, &s_list, NPAR, x->aframe);
}
示例11: while
/* this is the actual performance routine which acts on the samples.
It's called with a single pointer "w" which is our location in the
DSP call list. We return a new "w" which will point to the next item
after us. Meanwhile, w[0] is just a pointer to dsp-perform itself
(no use to us), w[1] and w[2] are the input and output vector locations,
and w[3] is the number of points to calculate. */
static t_int *fileosc_perform(t_int *w)
{
t_float *in = (t_float *)(w[1]);
t_float *out = (t_float *)(w[2]);
int n = (int)(w[3]);
t_fileosc *x = (t_fileosc *)(w[4]);
double y,ind;
int z,v;
if (x->stat)
{
while (n--)
{
/* trata o inicio de eventos */
if (x->n==0)
{
/* testa se acabou arquivo */
z=fscanf(x->arq,"%lf",&y);
x->freq=y;
if (feof(x->arq))
{
x->stat=0;
x->n = 0;
post("...acabou o arquivo!");
outlet_bang(x->bangoutlet);
return (w+5);
}
z=fscanf(x->arq,"%d",&v);
x->dur=v;
post("novo evento: frequencia=%lf, duracao=%d",x->freq,x->dur);
x->delta = x->freq*x->S/sys_getsr();
}
/* Aqui esta' sendo feita a leitura truncada da tabela */
ind = x->ind+x->n*x->delta;
*out = x->SENO[(int)(ind-((int)ind/x->S)*x->S)];
x->n++;
if (x->n==x->dur)
{
x->n=0;
x->ind = x->ind+x->n*x->delta;
}
*out++;
}
}
return (w+5);
}
示例12: spaceballProcessQueue
/*------------------------------------ spaceballProcessQueue ---*/
static void
spaceballProcessQueue(SpaceballData * xx)
{
if (xx && (! xx->fStopping))
{
short prevLock = lockout_set(1);
if (! xx->fReset)
{
static unsigned char resetString[] = "@RESET\015\015";
if (! xx->fDelayCounter)
{
spaceballPerformWriteCommand(xx, sizeof(resetString) - 1, resetString);
++xx->fDelayCounter;
}
else if (xx->fDelayCounter++ >= xx->fResetDuration)
{
xx->fReset = true;
xx->fDelayCounter = 0;
}
}
else if (! xx->fInited)
{
static unsigned char initString[] =
"CB\015NT\015FR?\[email protected]@r\015MSSV\015Z\015BcCcCc\015";
if (! xx->fDelayCounter)
{
spaceballPerformWriteCommand(xx, sizeof(initString) - 1, initString);
spaceballZeroValues(xx);
++xx->fDelayCounter;
}
else if (xx->fDelayCounter++ >= xx->fInitDuration)
{
xx->fInited = true;
xx->fDelayCounter = 0;
}
}
outlet_bang(xx->fSampleBangOut);
clock_delay(xx->fPollClock, xx->fPollRate);
lockout_set(prevLock);
#if USE_EVNUM
evnum_incr();
#endif /* USE_EVNUM */
}
} // spaceballProcessQueue
示例13: cmd_Anything
/*------------------------------------ cmd_Anything ---*/
Pvoid
cmd_Anything(RcxControlPtr xx,
PSymbol message,
short argc,
PAtom argv)
{
EnterCallback();
LOG_ERROR_2(OUTPUT_PREFIX "Unknown message '%s' seen", message->s_name)
outlet_bang(xx->fErrorBangOut);
for (short ii = 0; ii < argc; ++ii)
{
switch (argv[ii].a_type)
{
case A_LONG:
LOG_POST_3(" argument %hd is a long (%ld)", ii, argv[ii].a_w.w_long)
break;
case A_SYM:
LOG_POST_3(" argument %hd is a symbol (%s)", ii, argv[ii].a_w.w_sym->s_name)
break;
case A_FLOAT:
LOG_POST_3(" argument %hd is a float (%g)", ii, double(argv[ii].a_w.w_float))
break;
case A_SEMI:
LOG_POST_2(" argument %hd is a semicolon", ii)
break;
case A_COMMA:
LOG_POST_2(" argument %hd is a comma", ii)
break;
case A_DOLLAR:
LOG_POST_2(" argument %hd is a dollar sign", ii)
break;
default:
LOG_POST_3(" argument %hd is an unknown type (%hd)", ii, argv[ii].a_type)
break;
}
}
ExitMaxMessageHandler()
} /* cmd_Anything */
示例14: rawin_close
static void rawin_close(t_rawin *x)
{
if (!x->x_active) return;
/* stop thread: set giveup + wait */
x->x_giveup = 1;
if (x->x_mode) pthread_join(x->x_thread, NULL);
x->x_active = 0;
/* close pipe */
close(x->x_pipefd);
/* notify */
outlet_bang(x->x_sync_outlet);
pdp_post("pdp_rawin: connection to %s closed", x->x_pipe->s_name);
}
示例15: past_int
void past_int(t_past *x, long n)
{
t_atom a;
atom_setlong(&a, n);
if (x->p_size==1) {
if (past_compare(x,&a,0) > 0) {
if (!x->p_set) {
x->p_set = 1;
outlet_bang(x->p_out);
}
} else {
x->p_set = 0;
}
} else {
if (past_compare(x,&a,0) < 0)
x->p_set = 0;
}
}