int gfxengine_t::open(int objects, int extraflags) { xflags = extraflags; if(is_open) return show(); log_printf(DLOG, "Opening engine...\n"); csengine = cs_engine_create(_width, _height, objects); if(!csengine) { log_printf(ELOG, "Failed to set up control system engine!\n"); return -1; } csengine->on_frame = on_frame; cs_engine_set_wrap(csengine, wx, wy); gfx = s_new_container(GFX_BANKS); if(!gfx) { log_printf(ELOG, "Failed to set up graphics container!\n"); cs_engine_delete(csengine); return -2; } reset_filters(); is_open = 1; return show(); }
void rg_analysis_reset (RgAnalysisCtx * ctx) { g_return_if_fail (ctx != NULL); reset_filters (ctx); accumulator_clear (&ctx->track); accumulator_clear (&ctx->album); }
static int ki_get_redirects_all(sip_msg_t* msg) { int n; msg_tracer(msg, 0); /* get the contacts */ n = get_redirect(msg, 0, 0, NULL, bflags); reset_filters(); /* reset the tracer */ msg_tracer(msg, 1); return n; }
static int ki_get_redirects(sip_msg_t* msg, int max_c, int max_b) { int n; msg_tracer(msg, 0); /* get the contacts */ n = get_redirect(msg, max_c, max_b, NULL, bflags); reset_filters(); /* reset the tracer */ msg_tracer(msg, 1); return n; }
static int w_get_redirect(struct sip_msg* msg, int *max_t, int *max_b) { int n; msg_tracer( msg, 0); /* get the contacts */ n = get_redirect(msg , max_t ? *max_t : 0, max_b ? *max_b : 0); reset_filters(); /* reset the tracer */ msg_tracer( msg, 1); return n; }
gboolean rg_analysis_set_sample_rate (RgAnalysisCtx * ctx, gint sample_rate) { g_return_val_if_fail (ctx != NULL, FALSE); if (ctx->sample_rate == sample_rate) return TRUE; switch (sample_rate) { case 48000: ctx->sample_rate_index = 0; break; case 44100: ctx->sample_rate_index = 1; break; case 32000: ctx->sample_rate_index = 2; break; case 24000: ctx->sample_rate_index = 3; break; case 22050: ctx->sample_rate_index = 4; break; case 16000: ctx->sample_rate_index = 5; break; case 12000: ctx->sample_rate_index = 6; break; case 11025: ctx->sample_rate_index = 7; break; case 8000: ctx->sample_rate_index = 8; break; default: return FALSE; } ctx->sample_rate = sample_rate; /* The + 999 has the effect of ceil()ing: */ ctx->window_n_samples = (guint) ((sample_rate * RMS_WINDOW_MSECS + 999) / 1000); reset_filters (ctx); reset_silence_detection (ctx); return TRUE; }
static int w_get_redirect2(struct sip_msg* msg, char *max_c, char *reason) { int n; unsigned short max; msg_tracer( msg, 0); /* get the contacts */ max = (unsigned short)(long)max_c; n = get_redirect(msg , (max>>8)&0xff, max&0xff, (struct acc_param*)reason); reset_filters(); /* reset the tracer */ msg_tracer( msg, 1); return n; }
gboolean rg_analysis_track_result (RgAnalysisCtx * ctx, gdouble * gain, gdouble * peak) { gboolean result; g_return_val_if_fail (ctx != NULL, FALSE); accumulator_add (&ctx->album, &ctx->track); result = accumulator_result (&ctx->track, gain, peak); accumulator_clear (&ctx->track); reset_filters (ctx); return result; }
static inline void msg_tracer(struct sip_msg* msg, int reset) { static unsigned int id = 0; static unsigned int set = 0; if (reset) { set = 0; } else { if (set) { if (id!=msg->id) { LM_WARN("filters set but not used -> reseting to default\n"); reset_filters(); id = msg->id; } } else { id = msg->id; set = 1; } } }
static inline void msg_tracer(struct sip_msg* msg, int reset) { static int id = 0; static int set = 0; if (reset) { set = 0; } else { if (set) { if (id!=msg->id) { LOG(L_WARN,"WARNING:uac_redirect:msg_tracer: filters set " "but not used -> reseting to default\n"); reset_filters(); id = msg->id; } } else { id = msg->id; set = 1; } } }
static int ki_get_redirects_acc(sip_msg_t* msg, int max_c, int max_b, str *reason) { int n; acc_param_t accp; if(reason && reason->len>0) { memset(&accp, 0, sizeof(acc_param_t)); accp.reason.s = reason->s; accp.reason.len = reason->len; } msg_tracer(msg, 0); /* get the contacts */ n = get_redirect(msg, max_c, max_b, (reason && reason->len>0)?&accp:NULL, bflags); reset_filters(); /* reset the tracer */ msg_tracer(msg, 1); return n; }
void init_filters(void) { memset( rd_filters , 0, NR_FILTER_TYPES*MAX_FILTERS*sizeof(regex_t*)); reset_filters(); }
static void perform_shut_down( void ) { reset_motors( ); reset_filters( ); reset_controllers( ); }