summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-11-21 19:49:34 +0100
committerGravatar waker <wakeroid@gmail.com>2010-11-21 19:49:45 +0100
commita540df0dcbd66f9e178603db1081cef64d1f7db1 (patch)
treeb35a8572bf53d9011f970c6c8ef96f3c20406856
parent05a3f0a6fc4c3ca2776d55e36b38c8c07e0d3184 (diff)
changed DSP plugin API
-rw-r--r--deadbeef.h15
-rw-r--r--plugins/gtkui/eq.c10
-rw-r--r--streamer.c2
3 files changed, 22 insertions, 5 deletions
diff --git a/deadbeef.h b/deadbeef.h
index 4296a7e7..ce77478c 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -740,15 +740,22 @@ typedef struct DB_output_s {
} DB_output_t;
// dsp plugin
+
+typedef struct DB_dsp_instance_s {
+ struct DB_dsp_instance_s *next;
+ unsigned enabled : 1;
+} DB_dsp_instance_t;
+
typedef struct DB_dsp_s {
DB_plugin_t plugin;
+
+ DB_dsp_instance_t (*open) (void);
+ void (*close) (DB_dsp_instance_t *inst);
+
// process gets called before SRC
// stereo samples are stored in interleaved format
// stereo sample is counted as 1 sample
- int (*process) (char * restrict samples, ddb_waveformat_t * restrict fmt);
- void (*reset) (void);
- void (*enable) (int e);
- int (*enabled) (void);
+ int (*process) (DB_dsp_instance_t *inst, float *samples, int frames, int channels);
} DB_dsp_t;
// misc plugin
diff --git a/plugins/gtkui/eq.c b/plugins/gtkui/eq.c
index 93f92af5..a40e1900 100644
--- a/plugins/gtkui/eq.c
+++ b/plugins/gtkui/eq.c
@@ -64,13 +64,16 @@ eq_value_changed (DdbEqualizer *widget)
void
on_enable_toggled (GtkToggleButton *togglebutton,
gpointer user_data) {
+#if 0 // !!!! FIXME !!!!
DB_supereq_dsp_t *eq = get_supereq_plugin ();
- eq->dsp.enable (gtk_toggle_button_get_active (togglebutton));
+ eq->dsp.enabled = gtk_toggle_button_get_active (togglebutton) ? 1 : 0;
+#endif
}
void
on_zero_all_clicked (GtkButton *button,
gpointer user_data) {
+#if 0 // !!!! FIXME !!!!
if (eqwin) {
DB_supereq_dsp_t *eq = get_supereq_plugin ();
eq->set_preamp (1);
@@ -81,22 +84,26 @@ on_zero_all_clicked (GtkButton *button,
}
gdk_window_invalidate_rect (eqwin->window, NULL, FALSE);
}
+#endif
}
void
on_zero_preamp_clicked (GtkButton *button,
gpointer user_data) {
+#if 0 // !!!! FIXME !!!!
if (eqwin) {
DB_supereq_dsp_t *eq = get_supereq_plugin ();
eq->set_preamp (1);
ddb_equalizer_set_preamp (DDB_EQUALIZER (eqwin), 0);
gdk_window_invalidate_rect (eqwin->window, NULL, FALSE);
}
+#endif
}
void
on_zero_bands_clicked (GtkButton *button,
gpointer user_data) {
+#if 0 // !!!! FIXME !!!!
if (eqwin) {
DB_supereq_dsp_t *eq = get_supereq_plugin ();
for (int i = 0; i < 18; i++) {
@@ -105,6 +112,7 @@ on_zero_bands_clicked (GtkButton *button,
}
gdk_window_invalidate_rect (eqwin->window, NULL, FALSE);
}
+#endif
}
void
diff --git a/streamer.c b/streamer.c
index 9bf0e0ea..d19cbe74 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1187,6 +1187,7 @@ streamer_reset (int full) { // must be called when current song changes by exter
streamer_unlock ();
}
ddb_src_reset (src, 1);
+#if 0 // !!!! FIXME !!!!
// reset dsp
DB_dsp_t **dsp = deadbeef->plug_get_dsp_list ();
//int srate = output->fmt.samplerate;
@@ -1195,6 +1196,7 @@ streamer_reset (int full) { // must be called when current song changes by exter
dsp[i]->reset ();
}
}
+#endif
ddb_src_unlock (src);
}