void rg_analysis_reset (RgAnalysisCtx * ctx) { g_return_if_fail (ctx != NULL); reset_filters (ctx); accumulator_clear (&ctx->track); accumulator_clear (&ctx->album); }
gboolean rg_analysis_album_result (RgAnalysisCtx * ctx, gdouble * gain, gdouble * peak) { gboolean result; g_return_val_if_fail (ctx != NULL, FALSE); result = accumulator_result (&ctx->album, gain, peak); accumulator_clear (&ctx->album); return result; }
RgAnalysisCtx * rg_analysis_new (void) { RgAnalysisCtx *ctx; ctx = g_new (RgAnalysisCtx, 1); ctx->inpre_l = ctx->inprebuf_l + MAX_ORDER; ctx->step_l = ctx->stepbuf_l + MAX_ORDER; ctx->out_l = ctx->outbuf_l + MAX_ORDER; ctx->inpre_r = ctx->inprebuf_r + MAX_ORDER; ctx->step_r = ctx->stepbuf_r + MAX_ORDER; ctx->out_r = ctx->outbuf_r + MAX_ORDER; ctx->sample_rate = 0; accumulator_clear (&ctx->track); accumulator_clear (&ctx->album); return ctx; }
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; }
void rg_analysis_reset_album (RgAnalysisCtx * ctx) { accumulator_clear (&ctx->album); }