summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-12-14 21:25:34 +0100
committerGravatar waker <wakeroid@gmail.com>2010-12-14 21:25:34 +0100
commitf3c8e6b96c752dcb921dba1f5ea847da97684a30 (patch)
tree6106c265c90ffa9736cedae58b70eb4f1b434a81
parent0ebb646e4d32137759edbc13e6eb278529c2310d (diff)
renamed DB_dsp_instance_t to ddb_dsp_context_t
-rw-r--r--deadbeef.h32
-rw-r--r--plugins/converter/converter.c40
-rw-r--r--plugins/converter/converter.h2
-rw-r--r--plugins/dsp_libsrc/src.c30
-rw-r--r--plugins/ffmpeg/ffmpeg.c2
-rw-r--r--plugins/gtkui/eq.c24
-rw-r--r--plugins/gtkui/eq.h2
-rw-r--r--plugins/supereq/supereq.c70
-rw-r--r--streamer.c12
-rw-r--r--streamer.h2
10 files changed, 108 insertions, 108 deletions
diff --git a/deadbeef.h b/deadbeef.h
index 02401f5e..06f009b1 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -329,7 +329,7 @@ typedef struct {
int (*streamer_get_apx_bitrate) (void);
struct DB_fileinfo_s *(*streamer_get_current_fileinfo) (void);
int (*streamer_get_current_playlist) (void);
- struct DB_dsp_instance_s * (*streamer_get_dsp_chain) (void);
+ struct ddb_dsp_context_s * (*streamer_get_dsp_chain) (void);
// system folders
// normally functions will return standard folders derived from --prefix
// portable version will return pathes specified in comments below
@@ -755,38 +755,38 @@ typedef struct DB_output_s {
} DB_output_t;
// dsp plugin
-#define DDB_INIT_DSP_INSTANCE(var,type,plug) {\
+#define DDB_INIT_DSP_CONTEXT(var,type,plug) {\
memset(var,0,sizeof(type));\
- var->inst.plugin=plug;\
- var->inst.enabled=1;\
+ var->ctx.plugin=plug;\
+ var->ctx.enabled=1;\
}
-typedef struct DB_dsp_instance_s {
- // pointer to DSP plugin which created this instance
+typedef struct ddb_dsp_context_s {
+ // pointer to DSP plugin which created this context
struct DB_dsp_s *plugin;
- // pointer to the next DSP plugin instance in the chain
- struct DB_dsp_instance_s *next;
+ // pointer to the next DSP plugin context in the chain
+ struct ddb_dsp_context_s *next;
// read only flag; set by DB_dsp_t::enable
unsigned enabled : 1;
-} DB_dsp_instance_t;
+} ddb_dsp_context_t;
typedef struct DB_dsp_s {
DB_plugin_t plugin;
- DB_dsp_instance_t* (*open) (void);
+ ddb_dsp_context_t* (*open) (void);
- void (*close) (DB_dsp_instance_t *inst);
+ void (*close) (ddb_dsp_context_t *ctx);
// samples are interleaved
// returned value is number of output frames
// can change samplerate and number of channels
- int (*process) (DB_dsp_instance_t *inst, float *samples, int frames, int *samplerate, int *channels);
+ int (*process) (ddb_dsp_context_t *ctx, float *samples, int frames, int *samplerate, int *channels);
- void (*reset) (DB_dsp_instance_t *inst);
+ void (*reset) (ddb_dsp_context_t *ctx);
- void (*enable) (DB_dsp_instance_t *inst, int e);
+ void (*enable) (ddb_dsp_context_t *ctx, int e);
// num_params can be NULL, to indicate that plugin doesn't expose any params
//
@@ -796,8 +796,8 @@ typedef struct DB_dsp_s {
// param names are for display-only, and are allowed to contain spaces
int (*num_params) (void);
const char *(*get_param_name) (int p);
- void (*set_param) (DB_dsp_instance_t *inst, int p, float val);
- float (*get_param) (DB_dsp_instance_t *inst, int p);
+ void (*set_param) (ddb_dsp_context_t *ctx, int p, float val);
+ float (*get_param) (ddb_dsp_context_t *ctx, int p);
} DB_dsp_t;
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index 54d21245..b11a48d2 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -231,7 +231,7 @@ dsp_preset_free (ddb_dsp_preset_t *p) {
free (p->title);
}
while (p->chain) {
- DB_dsp_instance_t *next = p->chain->next;
+ ddb_dsp_context_t *next = p->chain->next;
p->chain->plugin->close (p->chain);
p->chain = next;
}
@@ -242,10 +242,10 @@ dsp_preset_free (ddb_dsp_preset_t *p) {
void
dsp_preset_copy (ddb_dsp_preset_t *to, ddb_dsp_preset_t *from) {
to->title = strdup (from->title);
- DB_dsp_instance_t *tail = NULL;
- DB_dsp_instance_t *dsp = from->chain;
+ ddb_dsp_context_t *tail = NULL;
+ ddb_dsp_context_t *dsp = from->chain;
while (dsp) {
- DB_dsp_instance_t *i = dsp->plugin->open ();
+ ddb_dsp_context_t *i = dsp->plugin->open ();
if (dsp->plugin->num_params) {
int n = dsp->plugin->num_params ();
for (int j = 0; j < n; j++) {
@@ -286,7 +286,7 @@ dsp_preset_load (const char *fname) {
goto error;
}
p->title = strdup (temp);
- DB_dsp_instance_t *tail = NULL;
+ ddb_dsp_context_t *tail = NULL;
for (;;) {
// plugin {
@@ -304,18 +304,18 @@ dsp_preset_load (const char *fname) {
fprintf (stderr, "ddb_dsp_preset_load: plugin %s not found. preset will not be loaded\n", temp);
goto error;
}
- DB_dsp_instance_t *inst = plug->open ();
- if (!inst) {
- fprintf (stderr, "ddb_dsp_preset_load: failed to open instance of plugin %s\n", temp);
+ ddb_dsp_context_t *ctx = plug->open ();
+ if (!ctx) {
+ fprintf (stderr, "ddb_dsp_preset_load: failed to open ctxance of plugin %s\n", temp);
goto error;
}
if (tail) {
- tail->next = inst;
- tail = inst;
+ tail->next = ctx;
+ tail = ctx;
}
else {
- tail = p->chain = inst;
+ tail = p->chain = ctx;
}
int n = 0;
@@ -333,7 +333,7 @@ dsp_preset_load (const char *fname) {
goto error;
}
if (plug->num_params) {
- plug->set_param (inst, n, value);
+ plug->set_param (ctx, n, value);
}
n++;
}
@@ -385,19 +385,19 @@ dsp_preset_save (ddb_dsp_preset_t *p, int overwrite) {
fprintf (fp, "title %s\n", p->title);
- DB_dsp_instance_t *inst = p->chain;
- while (inst) {
- fprintf (fp, "%s {\n", inst->plugin->plugin.id);
- if (inst->plugin->num_params) {
- int n = inst->plugin->num_params ();
+ ddb_dsp_context_t *ctx = p->chain;
+ while (ctx) {
+ fprintf (fp, "%s {\n", ctx->plugin->plugin.id);
+ if (ctx->plugin->num_params) {
+ int n = ctx->plugin->num_params ();
int i;
for (i = 0; i < n; i++) {
- float v = inst->plugin->get_param (inst, i);
+ float v = ctx->plugin->get_param (ctx, i);
fprintf (fp, "\t%f\n", v);
}
}
fprintf (fp, "}\n");
- inst = inst->next;
+ ctx = ctx->next;
}
fclose (fp);
@@ -636,7 +636,7 @@ convert (DB_playItem_t *it, const char *outfolder, int selected_format, ddb_enco
fmt.is_float = 1;
deadbeef->pcm_convert (&fileinfo->fmt, buffer, &fmt, dspbuffer, sz);
- DB_dsp_instance_t *dsp = dsp_preset->chain;
+ ddb_dsp_context_t *dsp = dsp_preset->chain;
int frames = sz / samplesize;
while (dsp) {
frames = dsp->plugin->process (dsp, (float *)dspbuffer, frames, &fmt.samplerate, &fmt.channels);
diff --git a/plugins/converter/converter.h b/plugins/converter/converter.h
index 6b90857b..ca9a83e6 100644
--- a/plugins/converter/converter.h
+++ b/plugins/converter/converter.h
@@ -52,7 +52,7 @@ typedef struct ddb_encoder_preset_s {
typedef struct ddb_dsp_preset_s {
char *title;
struct ddb_dsp_preset_s *next;
- DB_dsp_instance_t *chain;
+ ddb_dsp_context_t *chain;
} ddb_dsp_preset_t;
typedef struct {
diff --git a/plugins/dsp_libsrc/src.c b/plugins/dsp_libsrc/src.c
index b0bf7de7..3f972d64 100644
--- a/plugins/dsp_libsrc/src.c
+++ b/plugins/dsp_libsrc/src.c
@@ -36,7 +36,7 @@ static DB_functions_t *deadbeef;
static DB_dsp_t plugin;
typedef struct {
- DB_dsp_instance_t inst;
+ ddb_dsp_context_t ctx;
int channels;
int quality;
@@ -49,19 +49,19 @@ typedef struct {
unsigned need_reset : 1;
} ddb_src_libsamplerate_t;
-DB_dsp_instance_t*
+ddb_dsp_context_t*
ddb_src_open (void) {
ddb_src_libsamplerate_t *src = malloc (sizeof (ddb_src_libsamplerate_t));
- DDB_INIT_DSP_INSTANCE (src,ddb_src_libsamplerate_t,&plugin);
+ DDB_INIT_DSP_CONTEXT (src,ddb_src_libsamplerate_t,&plugin);
src->samplerate = 44100;
src->quality = 2;
src->channels = -1;
- return (DB_dsp_instance_t *)src;
+ return (ddb_dsp_context_t *)src;
}
void
-ddb_src_close (DB_dsp_instance_t *_src) {
+ddb_src_close (ddb_dsp_context_t *_src) {
ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src;
if (src->src) {
src_delete (src->src);
@@ -71,14 +71,14 @@ ddb_src_close (DB_dsp_instance_t *_src) {
}
void
-ddb_src_reset (DB_dsp_instance_t *_src) {
+ddb_src_reset (ddb_dsp_context_t *_src) {
ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src;
src->need_reset = 1;
}
void
-ddb_src_set_ratio (DB_dsp_instance_t *_src, float ratio) {
+ddb_src_set_ratio (ddb_dsp_context_t *_src, float ratio) {
ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src;
if (src->srcdata.src_ratio != ratio) {
src->srcdata.src_ratio = ratio;
@@ -87,7 +87,7 @@ ddb_src_set_ratio (DB_dsp_instance_t *_src, float ratio) {
}
int
-ddb_src_process (DB_dsp_instance_t *_src, float *samples, int nframes, int *samplerate, int *nchannels) {
+ddb_src_process (ddb_dsp_context_t *_src, float *samples, int nframes, int *samplerate, int *nchannels) {
ddb_src_libsamplerate_t *src = (ddb_src_libsamplerate_t*)_src;
if (*samplerate == src->samplerate) {
@@ -197,14 +197,14 @@ ddb_src_get_param_name (int p) {
}
}
void
-ddb_src_set_param (DB_dsp_instance_t *inst, int p, float val) {
+ddb_src_set_param (ddb_dsp_context_t *ctx, int p, float val) {
switch (p) {
case SRC_PARAM_SAMPLERATE:
- ((ddb_src_libsamplerate_t*)inst)->samplerate = val;
+ ((ddb_src_libsamplerate_t*)ctx)->samplerate = val;
break;
case SRC_PARAM_QUALITY:
- ((ddb_src_libsamplerate_t*)inst)->quality = val;
- ((ddb_src_libsamplerate_t*)inst)->quality_changed = 1;
+ ((ddb_src_libsamplerate_t*)ctx)->quality = val;
+ ((ddb_src_libsamplerate_t*)ctx)->quality_changed = 1;
break;
default:
fprintf (stderr, "ddb_src_set_param: invalid param index (%d)\n", p);
@@ -212,12 +212,12 @@ ddb_src_set_param (DB_dsp_instance_t *inst, int p, float val) {
}
float
-ddb_src_get_param (DB_dsp_instance_t *inst, int p) {
+ddb_src_get_param (ddb_dsp_context_t *ctx, int p) {
switch (p) {
case SRC_PARAM_SAMPLERATE:
- return ((ddb_src_libsamplerate_t*)inst)->samplerate;
+ return ((ddb_src_libsamplerate_t*)ctx)->samplerate;
case SRC_PARAM_QUALITY:
- return ((ddb_src_libsamplerate_t*)inst)->quality;
+ return ((ddb_src_libsamplerate_t*)ctx)->quality;
default:
fprintf (stderr, "ddb_src_get_param: invalid param index (%d)\n", p);
}
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index f56c8fd2..f8c80f72 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -94,7 +94,7 @@ static DB_playItem_t *current_track;
static DB_fileinfo_t *current_info;
static DB_fileinfo_t *
-ffmpeg_open (void) {
+ffmpeg_open (uint32_t hints) {
DB_fileinfo_t *_info = malloc (sizeof (ffmpeg_info_t));
memset (_info, 0, sizeof (ffmpeg_info_t));
return _info;
diff --git a/plugins/gtkui/eq.c b/plugins/gtkui/eq.c
index a27f15db..e137511e 100644
--- a/plugins/gtkui/eq.c
+++ b/plugins/gtkui/eq.c
@@ -39,9 +39,9 @@ amp_to_db (float amp) {
return 20*log10 (amp);
}
-DB_dsp_instance_t *
+ddb_dsp_context_t *
get_supereq (void) {
- DB_dsp_instance_t *dsp = deadbeef->streamer_get_dsp_chain ();
+ ddb_dsp_context_t *dsp = deadbeef->streamer_get_dsp_chain ();
while (dsp) {
if (!strcmp (dsp->plugin->plugin.id, "supereq")) {
return dsp;
@@ -53,7 +53,7 @@ get_supereq (void) {
}
static void
-set_param (DB_dsp_instance_t *eq, int i, float v) {
+set_param (ddb_dsp_context_t *eq, int i, float v) {
eq->plugin->set_param (eq, i, v);
if (i == 0) {
deadbeef->conf_set_float ("eq.preamp", v);
@@ -68,7 +68,7 @@ set_param (DB_dsp_instance_t *eq, int i, float v) {
void
eq_value_changed (DdbEqualizer *widget)
{
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
for (int i = 0; i < 18; i++) {
set_param (eq, i+1, db_to_amp (ddb_equalizer_get_band (widget, i)));
@@ -80,7 +80,7 @@ eq_value_changed (DdbEqualizer *widget)
void
on_enable_toggled (GtkToggleButton *togglebutton,
gpointer user_data) {
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
int enabled = gtk_toggle_button_get_active (togglebutton) ? 1 : 0;
eq->plugin->enable (eq, enabled);
@@ -92,7 +92,7 @@ void
on_zero_all_clicked (GtkButton *button,
gpointer user_data) {
if (eqwin) {
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
ddb_equalizer_set_preamp (DDB_EQUALIZER (eqwin), 0);
set_param (eq, 0, 1);
@@ -112,7 +112,7 @@ void
on_zero_preamp_clicked (GtkButton *button,
gpointer user_data) {
if (eqwin) {
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
set_param (eq, 0, 1);
ddb_equalizer_set_preamp (DDB_EQUALIZER (eqwin), 0);
@@ -125,7 +125,7 @@ void
on_zero_bands_clicked (GtkButton *button,
gpointer user_data) {
if (eqwin) {
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
for (int i = 0; i < 18; i++) {
ddb_equalizer_set_band (DDB_EQUALIZER (eqwin), i, 0);
@@ -159,7 +159,7 @@ on_save_preset_clicked (GtkButton *button,
if (fname) {
FILE *fp = fopen (fname, "w+b");
if (fp) {
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
for (int i = 0; i < 18; i++) {
fprintf (fp, "%f\n", amp_to_db (eq->plugin->get_param (eq, i+1)));
@@ -217,7 +217,7 @@ on_load_preset_clicked (GtkButton *button,
fclose (fp);
if (i == 19) {
// apply and save config
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
set_param (eq, 0, db_to_amp (vals[18]));
ddb_equalizer_set_preamp (DDB_EQUALIZER (eqwin), vals[18]);
@@ -280,7 +280,7 @@ on_import_fb2k_preset_clicked (GtkButton *button,
fclose (fp);
if (i == 18) {
// apply and save config
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
if (eq) {
set_param (eq, 0, 1);
ddb_equalizer_set_preamp (DDB_EQUALIZER (eqwin), 0);
@@ -319,7 +319,7 @@ eq_window_show (void) {
eqenablebtn = button = gtk_check_button_new_with_label (_("Enable"));
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (buttons), button, FALSE, FALSE, 0);
- DB_dsp_instance_t *eq = get_supereq ();
+ ddb_dsp_context_t *eq = get_supereq ();
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eqenablebtn), eq ? eq->enabled : 0);
g_signal_connect ((gpointer) button, "toggled",
G_CALLBACK (on_enable_toggled),
diff --git a/plugins/gtkui/eq.h b/plugins/gtkui/eq.h
index 6169123a..3dd99787 100644
--- a/plugins/gtkui/eq.h
+++ b/plugins/gtkui/eq.h
@@ -29,7 +29,7 @@ eq_window_hide (void);
void
eq_window_destroy (void);
-DB_dsp_instance_t *
+ddb_dsp_context_t *
get_supereq (void);
void
diff --git a/plugins/supereq/supereq.c b/plugins/supereq/supereq.c
index 52be2d44..d3d83389 100644
--- a/plugins/supereq/supereq.c
+++ b/plugins/supereq/supereq.c
@@ -26,7 +26,7 @@ static DB_functions_t *deadbeef;
static DB_dsp_t plugin;
typedef struct {
- DB_dsp_instance_t inst;
+ ddb_dsp_context_t ctx;
float last_srate;
int last_nch;
float lbands[18];
@@ -36,12 +36,12 @@ typedef struct {
int params_changed;
uintptr_t mutex;
SuperEqState state;
-} ddb_supereq_instance_t;
+} ddb_supereq_ctx_t;
-void supereq_reset (DB_dsp_instance_t *inst);
+void supereq_reset (ddb_dsp_context_t *ctx);
void
-recalc_table (ddb_supereq_instance_t *eq) {
+recalc_table (ddb_supereq_ctx_t *eq) {
void *params = paramlist_alloc ();
deadbeef->mutex_lock (eq->mutex);
@@ -75,8 +75,8 @@ supereq_plugin_stop (void) {
}
int
-supereq_process (DB_dsp_instance_t *inst, float *samples, int frames, int *samplerate, int *channels) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_process (ddb_dsp_context_t *ctx, float *samples, int frames, int *samplerate, int *channels) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
if (supereq->params_changed) {
recalc_table (supereq);
supereq->params_changed = 0;
@@ -100,14 +100,14 @@ supereq_process (DB_dsp_instance_t *inst, float *samples, int frames, int *sampl
}
float
-supereq_get_band (DB_dsp_instance_t *inst, int band) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_get_band (ddb_dsp_context_t *ctx, int band) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
return supereq->lbands[band];
}
void
-supereq_set_band (DB_dsp_instance_t *inst, int band, float value) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_set_band (ddb_dsp_context_t *ctx, int band, float value) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
deadbeef->mutex_lock (supereq->mutex);
supereq->lbands[band] = supereq->rbands[band] = value;
deadbeef->mutex_unlock (supereq->mutex);
@@ -115,14 +115,14 @@ supereq_set_band (DB_dsp_instance_t *inst, int band, float value) {
}
float
-supereq_get_preamp (DB_dsp_instance_t *inst) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_get_preamp (ddb_dsp_context_t *ctx) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
return supereq->preamp;
}
void
-supereq_set_preamp (DB_dsp_instance_t *inst, float value) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_set_preamp (ddb_dsp_context_t *ctx, float value) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
deadbeef->mutex_lock (supereq->mutex);
supereq->preamp = value;
deadbeef->mutex_unlock (supereq->mutex);
@@ -130,21 +130,21 @@ supereq_set_preamp (DB_dsp_instance_t *inst, float value) {
}
void
-supereq_reset (DB_dsp_instance_t *inst) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_reset (ddb_dsp_context_t *ctx) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
deadbeef->mutex_lock (supereq->mutex);
equ_clearbuf(&supereq->state);
deadbeef->mutex_unlock (supereq->mutex);
}
void
-supereq_enable (DB_dsp_instance_t *inst, int e) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
- if (e != supereq->inst.enabled) {
- if (e && !supereq->inst.enabled) {
- supereq_reset (inst);
+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->inst.enabled = e;
+ supereq->ctx.enabled = e;
}
}
@@ -180,13 +180,13 @@ supereq_get_param_name (int p) {
return bandnames[p];
}
void
-supereq_set_param (DB_dsp_instance_t *inst, int p, float val) {
+supereq_set_param (ddb_dsp_context_t *ctx, int p, float val) {
switch (p) {
case 0:
- supereq_set_preamp (inst, val);
+ supereq_set_preamp (ctx, val);
break;
case 1 ... 18:
- supereq_set_band (inst, p, val);
+ supereq_set_band (ctx, p, val);
break;
default:
fprintf (stderr, "supereq_set_param: invalid param index (%d)\n", p);
@@ -194,13 +194,13 @@ supereq_set_param (DB_dsp_instance_t *inst, int p, float val) {
}
float
-supereq_get_param (DB_dsp_instance_t *inst, int p) {
+supereq_get_param (ddb_dsp_context_t *ctx, int p) {
switch (p) {
case 0:
- return supereq_get_preamp (inst);
+ return supereq_get_preamp (ctx);
break;
case 1 ... 18:
- return supereq_get_band (inst, p);
+ return supereq_get_band (ctx, p);
break;
default:
fprintf (stderr, "supereq_get_param: invalid param index (%d)\n", p);
@@ -208,10 +208,10 @@ supereq_get_param (DB_dsp_instance_t *inst, int p) {
}
-DB_dsp_instance_t*
+ddb_dsp_context_t*
supereq_open (void) {
- ddb_supereq_instance_t *supereq = malloc (sizeof (ddb_supereq_instance_t));
- DDB_INIT_DSP_INSTANCE (supereq,ddb_supereq_instance_t,&plugin);
+ ddb_supereq_ctx_t *supereq = malloc (sizeof (ddb_supereq_ctx_t));
+ DDB_INIT_DSP_CONTEXT (supereq,ddb_supereq_ctx_t,&plugin);
equ_init (&supereq->state, 14);
supereq->paramsroot = paramlist_alloc ();
@@ -223,19 +223,19 @@ supereq_open (void) {
// deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (supereq_on_configchanged), 0);
- return (DB_dsp_instance_t*)supereq;
+ return (ddb_dsp_context_t*)supereq;
}
void
-supereq_close (DB_dsp_instance_t *inst) {
- ddb_supereq_instance_t *supereq = (ddb_supereq_instance_t *)inst;
+supereq_close (ddb_dsp_context_t *ctx) {
+ ddb_supereq_ctx_t *supereq = (ddb_supereq_ctx_t *)ctx;
if (supereq->mutex) {
deadbeef->mutex_free (supereq->mutex);
supereq->mutex = 0;
}
equ_quit (&supereq->state);
paramlist_free (supereq->paramsroot);
- free (inst);
+ free (ctx);
}
static DB_dsp_t plugin = {
diff --git a/streamer.c b/streamer.c
index 5ea397a1..4f8b2ebc 100644
--- a/streamer.c
+++ b/streamer.c
@@ -50,9 +50,9 @@ FILE *out;
static intptr_t streamer_tid;
static DB_dsp_t *srcplug;
static DB_dsp_t *eqplug;
-static DB_dsp_instance_t *dsp_chain;
-static DB_dsp_instance_t *src;
-static DB_dsp_instance_t *eq;
+static ddb_dsp_context_t *dsp_chain;
+static ddb_dsp_context_t *src;
+static ddb_dsp_context_t *eq;
static int conf_replaygain_mode = 0;
static int conf_replaygain_scale = 1;
@@ -1226,7 +1226,7 @@ streamer_reset (int full) { // must be called when current song changes by exter
}
// reset dsp
- DB_dsp_instance_t *dsp = dsp_chain;
+ ddb_dsp_context_t *dsp = dsp_chain;
while (dsp) {
if (dsp->plugin->reset) {
dsp->plugin->reset (dsp);
@@ -1383,7 +1383,7 @@ streamer_read_async (char *bytes, int size) {
}
int nframes = inputsize / inputsamplesize;
- DB_dsp_instance_t *dsp = dsp_chain;
+ ddb_dsp_context_t *dsp = dsp_chain;
int samplerate = fileinfo->fmt.samplerate;
int channels = dspfmt.channels;
while (dsp) {
@@ -1652,7 +1652,7 @@ streamer_notify_playlist_deleted (playlist_t *plt) {
}
}
-DB_dsp_instance_t *
+ddb_dsp_context_t *
streamer_get_dsp_chain (void) {
return dsp_chain;
}
diff --git a/streamer.h b/streamer.h
index 9eb08946..7a65c95c 100644
--- a/streamer.h
+++ b/streamer.h
@@ -108,7 +108,7 @@ str_get_idx_of (playItem_t *it);
void
streamer_notify_playlist_deleted (playlist_t *plt);
-struct DB_dsp_instance_s *
+struct ddb_dsp_context_s *
streamer_get_dsp_chain (void);
#endif // __STREAMER_H