From d7ad9c9682d83dc8f59bd6ff86d3ec422c1f6adb Mon Sep 17 00:00:00 2001 From: Rodeo Date: Sat, 25 Jan 2014 23:24:48 +0000 Subject: decavcodec: DRC support. Adds DRC support for E-AC-3 audio (as well as any future libavcodec decoders with DRC support). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5995 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/audiohandler.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gtk/src/audiohandler.c') diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index cdf1d16e3..67e979d14 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -29,6 +29,35 @@ static void ghb_clear_audio_list_ui(GtkBuilder *builder); static gboolean block_updates = FALSE; +static void audio_deps(signal_user_data_t *ud) +{ + gint track = -1, encoder = 0; + hb_audio_config_t *aconfig = NULL; + gint titleindex = ghb_settings_combo_int(ud->settings, "title"); + GValue *asettings = get_selected_asettings(ud); + + if (asettings != NULL) + { + track = ghb_settings_combo_int(asettings, "AudioTrack"); + encoder = ghb_settings_combo_int(asettings, "AudioEncoderActual"); + aconfig = ghb_get_scan_audio_info(titleindex, track); + } + + gboolean enable_drc = TRUE; + if (aconfig != NULL) + { + enable_drc = hb_audio_can_apply_drc(aconfig->in.codec, + aconfig->in.codec_param, encoder); + } + + GtkWidget * widget = GHB_WIDGET(ud->builder, "AudioTrackDRCSlider"); + gtk_widget_set_sensitive(widget, enable_drc); + widget = GHB_WIDGET(ud->builder, "AudioTrackDRCSliderLabel"); + gtk_widget_set_sensitive(widget, enable_drc); + widget = GHB_WIDGET(ud->builder, "AudioTrackDRCValue"); + gtk_widget_set_sensitive(widget, enable_drc); +} + void ghb_show_hide_advanced_audio( signal_user_data_t *ud ) { @@ -731,6 +760,7 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_adjust_audio_rate_combos(ud); ghb_grey_combo_options (ud); ghb_check_dependency(ud, widget, NULL); + audio_deps(ud); prev_acodec = acodec_code; if (asettings != NULL) { @@ -771,6 +801,7 @@ audio_track_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_adjust_audio_rate_combos(ud); ghb_check_dependency(ud, widget, NULL); + audio_deps(ud); ghb_grey_combo_options(ud); asettings = get_selected_asettings(ud); if (asettings != NULL) @@ -1117,6 +1148,7 @@ audio_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t widget = GHB_WIDGET (ud->builder, "audio_remove"); gtk_widget_set_sensitive(widget, FALSE); } + audio_deps(ud); } static gboolean -- cgit v1.2.3