diff options
author | waker <wakeroid@gmail.com> | 2010-12-30 20:23:23 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-12-30 20:23:23 +0100 |
commit | 2d0b6eda861e5bfcdce1ca43afb013d15b9d73b5 (patch) | |
tree | 18467f2ae9871dd0677ac0b3de9760a12abac317 /plugins/supereq | |
parent | 44a0f104bdf326e87ae5d3d36234b19c2d81f8d8 (diff) |
streamer dsp chain WIP
Diffstat (limited to 'plugins/supereq')
-rw-r--r-- | plugins/supereq/supereq.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/plugins/supereq/supereq.c b/plugins/supereq/supereq.c index 9e957116..79a0bd5d 100644 --- a/plugins/supereq/supereq.c +++ b/plugins/supereq/supereq.c @@ -37,6 +37,7 @@ typedef struct { int params_changed; uintptr_t mutex; SuperEqState state; + int enabled; } ddb_supereq_ctx_t; void supereq_reset (ddb_dsp_context_t *ctx); @@ -78,6 +79,19 @@ supereq_plugin_stop (void) { int supereq_process (ddb_dsp_context_t *ctx, float *samples, int frames, ddb_waveformat_t *fmt) { ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx; + if (supereq->enabled != ctx->enabled) { + if (ctx->enabled && !supereq->enabled) { + supereq_reset (ctx); + } + supereq->enabled = ctx->enabled; + + DB_playItem_t *it = deadbeef->streamer_get_playing_track (); + if (it) { + float playpos = deadbeef->streamer_get_playpos (); + deadbeef->streamer_seek (playpos); + deadbeef->pl_item_unref (it); + } + } if (supereq->params_changed) { recalc_table (supereq); supereq->params_changed = 0; @@ -138,24 +152,6 @@ supereq_reset (ddb_dsp_context_t *ctx) { deadbeef->mutex_unlock (supereq->mutex); } -void -supereq_enable (ddb_dsp_context_t *ctx, int e) { - ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx; - if (e != supereq->ctx.enabled) { - if (e && !supereq->ctx.enabled) { - supereq_reset (ctx); - } - supereq->ctx.enabled = e; - } - - DB_playItem_t *it = deadbeef->streamer_get_playing_track (); - if (it) { - float playpos = deadbeef->streamer_get_playpos (); - deadbeef->streamer_seek (playpos); - deadbeef->pl_item_unref (it); - } -} - int supereq_num_params (void) { return 19; @@ -303,7 +299,6 @@ static DB_dsp_t plugin = { .close = supereq_close, .process = supereq_process, .reset = supereq_reset, - .enable = supereq_enable, .num_params = supereq_num_params, .get_param_name = supereq_get_param_name, .set_param = supereq_set_param, |