Mercurial > audlegacy
diff src/audacious/ui_preferences.c @ 2538:719e0898ff3c trunk
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
similar to what foobar2000 can do. Patch by Teru KAMOGASHIRA.
author | nenolod |
---|---|
date | Sat, 17 Feb 2007 02:19:35 -0800 |
parents | 5206f4ef02f7 |
children | 0ad10a95ed10 |
line wrap: on
line diff
--- a/src/audacious/ui_preferences.c Sat Feb 17 01:54:30 2007 -0800 +++ b/src/audacious/ui_preferences.c Sat Feb 17 02:19:35 2007 -0800 @@ -1510,6 +1510,102 @@ } static void +on_enable_src_realize(GtkToggleButton * button, + gpointer data) +{ +#ifdef USE_SRC + ConfigDb *db; + gboolean ret; + + db = bmp_cfg_db_open(); + + if (bmp_cfg_db_get_bool(db, NULL, "enable_src", &ret) != FALSE) + gtk_toggle_button_set_active(button, ret); + + bmp_cfg_db_close(db); +#else + gtk_toggle_button_set_active(button, FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); +#endif +} + +static void +on_enable_src_toggled(GtkToggleButton * button, + gpointer data) +{ + ConfigDb *db; + gboolean ret = gtk_toggle_button_get_active(button); + + db = bmp_cfg_db_open(); + bmp_cfg_db_set_bool(db, NULL, "enable_src", ret); + bmp_cfg_db_close(db); +} + +static void +on_src_rate_realize(GtkSpinButton * button, + gpointer data) +{ +#ifdef USE_SRC + ConfigDb *db; + gint value; + + db = bmp_cfg_db_open(); + + if (bmp_cfg_db_get_int(db, NULL, "src_rate", &value) != FALSE) + gtk_spin_button_set_value(button, (gdouble)value); + + bmp_cfg_db_close(db); +#else + gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); +#endif +} + +static void +on_src_rate_value_changed(GtkSpinButton * button, + gpointer data) +{ + ConfigDb *db; + gint value = gtk_spin_button_get_value_as_int(button); + + db = bmp_cfg_db_open(); + bmp_cfg_db_set_int(db, NULL, "src_rate", value); + bmp_cfg_db_close(db); +} + +static void +on_src_converter_type_realize(GtkComboBox * box, + gpointer data) +{ +#ifdef USE_SRC + ConfigDb *db; + gint value; + + db = bmp_cfg_db_open(); + + if (bmp_cfg_db_get_int(db, NULL, "src_type", &value) != FALSE) + gtk_combo_box_set_active(box, value); + else + gtk_combo_box_set_active(box, 0); + + bmp_cfg_db_close(db); +#else + gtk_widget_set_sensitive(GTK_WIDGET(box), FALSE); +#endif +} + +static void +on_src_converter_type_changed(GtkComboBox * box, + gpointer data) +{ + ConfigDb *db; + gint value = gtk_combo_box_get_active(box); + + db = bmp_cfg_db_open(); + bmp_cfg_db_set_int(db, NULL, "src_type", value); + bmp_cfg_db_close(db); +} + +static void on_mouse_wheel_scroll_pl_realize(GtkSpinButton * button, gpointer data) { @@ -2253,6 +2349,12 @@ FUNC_MAP_ENTRY(on_mouse_wheel_scroll_pl_changed) FUNC_MAP_ENTRY(on_pause_between_songs_time_realize) FUNC_MAP_ENTRY(on_pause_between_songs_time_changed) + FUNC_MAP_ENTRY(on_enable_src_realize) + FUNC_MAP_ENTRY(on_enable_src_toggled) + FUNC_MAP_ENTRY(on_src_rate_realize) + FUNC_MAP_ENTRY(on_src_rate_value_changed) + FUNC_MAP_ENTRY(on_src_converter_type_realize) + FUNC_MAP_ENTRY(on_src_converter_type_changed) FUNC_MAP_ENTRY(on_pl_metadata_on_load_realize) FUNC_MAP_ENTRY(on_pl_metadata_on_load_toggled) FUNC_MAP_ENTRY(on_pl_metadata_on_display_realize)