diff options
-rw-r--r-- | plugins/gtkui/eq.c | 7 | ||||
-rw-r--r-- | plugins/gtkui/eq.h | 3 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 13 |
3 files changed, 17 insertions, 6 deletions
diff --git a/plugins/gtkui/eq.c b/plugins/gtkui/eq.c index f558d8c7..494333e0 100644 --- a/plugins/gtkui/eq.c +++ b/plugins/gtkui/eq.c @@ -40,7 +40,7 @@ amp_to_db (float amp) { return 20*log10 (amp); } -static DB_supereq_dsp_t * +DB_supereq_dsp_t * get_supereq_plugin (void) { DB_dsp_t **plugs = deadbeef->plug_get_dsp_list (); for (int i = 0; plugs[i]; i++) { @@ -273,6 +273,10 @@ on_import_fb2k_preset_clicked (GtkButton *button, void eq_window_show (void) { + DB_supereq_dsp_t *eq = get_supereq_plugin (); + if (!eq) { + return; + } if (!eqcont) { eqcont = gtk_vbox_new (FALSE, 8); GtkWidget *parent= lookup_widget (mainwin, "plugins_bottom_vbox"); @@ -338,7 +342,6 @@ eq_window_show (void) { g_signal_connect (eqwin, "on_changed", G_CALLBACK (eq_value_changed), 0); gtk_widget_set_size_request (eqwin, -1, 200); - DB_supereq_dsp_t *eq = get_supereq_plugin (); ddb_equalizer_set_preamp (DDB_EQUALIZER (eqwin), amp_to_db (eq->get_preamp ())); for (int i = 0; i < 18; i++) { diff --git a/plugins/gtkui/eq.h b/plugins/gtkui/eq.h index 6f063cb3..efd4ac69 100644 --- a/plugins/gtkui/eq.h +++ b/plugins/gtkui/eq.h @@ -29,4 +29,7 @@ eq_window_hide (void); void eq_window_destroy (void); +struct DB_supereq_dsp_s * +get_supereq_plugin (void); + #endif diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 008f8679..30305548 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -786,12 +786,17 @@ gtkui_thread (void *ctx) { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (ts_mi), FALSE); gtk_widget_hide (ts); } - if (deadbeef->conf_get_int ("gtkui.eq.visible", 0)) { - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), TRUE); - eq_window_show (); + if (!get_supereq_plugin ()) { + gtk_widget_hide (GTK_WIDGET (eq_mi)); } else { - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), FALSE); + if (deadbeef->conf_get_int ("gtkui.eq.visible", 0)) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), TRUE); + eq_window_show (); + } + else { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), FALSE); + } } searchwin = create_searchwin (); |