summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-06-10 16:26:45 +0000
committerjstebbins <[email protected]>2009-06-10 16:26:45 +0000
commite00722e17ef990e44ce497b0407cdef81abe1b4c (patch)
treed0f6b0437f77fa97ffbba69015a4ce7a5ec46350 /gtk
parent71bc820e642a7afaf80046e0288220cbbfec23e8 (diff)
LinGui: remove the big jump in the drc slider when going from 1.0->Off
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2510 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/audiohandler.c44
-rw-r--r--gtk/src/ghb.ui6
-rw-r--r--gtk/src/hb-backend.c3
-rw-r--r--gtk/src/presets.c33
-rw-r--r--gtk/src/queuehandler.c2
5 files changed, 59 insertions, 29 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 0e15b1962..176f7d9cf 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -231,8 +231,8 @@ audio_list_refresh_selected(signal_user_data_t *ud)
if (gtk_tree_selection_get_selected(selection, &store, &iter))
{
const gchar *track, *codec, *br, *sr, *mix;
- gchar *drc, *s_track, *s_codec, *s_br, *s_sr, *s_mix;
- gdouble s_drc;
+ gchar *s_drc, *s_track, *s_codec, *s_br, *s_sr, *s_mix;
+ gdouble drc;
// Get the row number
treepath = gtk_tree_model_get_path (store, &iter);
indices = gtk_tree_path_get_indices (treepath);
@@ -256,11 +256,11 @@ audio_list_refresh_selected(signal_user_data_t *ud)
s_br = ghb_settings_get_string(asettings, "AudioBitrate");
s_sr = ghb_settings_get_string(asettings, "AudioSamplerate");
s_mix = ghb_settings_get_string(asettings, "AudioMixdown");
- s_drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider");
- if (s_drc < 0.1)
- drc = g_strdup("Off");
+ drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider");
+ if (drc < 1.0)
+ s_drc = g_strdup("Off");
else
- drc = g_strdup_printf("%.1f", s_drc);
+ s_drc = g_strdup_printf("%.1f", drc);
gtk_list_store_set(GTK_LIST_STORE(store), &iter,
// These are displayed in list
@@ -269,16 +269,16 @@ audio_list_refresh_selected(signal_user_data_t *ud)
2, br,
3, sr,
4, mix,
- 5, drc,
+ 5, s_drc,
// These are used to set combo values when a list item is selected
6, s_track,
7, s_codec,
8, s_br,
9, s_sr,
10, s_mix,
- 11, s_drc,
+ 11, drc,
-1);
- g_free(drc);
+ g_free(s_drc);
g_free(s_track);
g_free(s_codec);
g_free(s_br);
@@ -314,7 +314,6 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
mix_code = ghb_lookup_combo_int("AudioMixdown", ghb_string_value("dpl2"));
mix_code = ghb_get_best_mix( titleindex, track, acodec_code, mix_code);
ghb_ui_update(ud, "AudioMixdown", ghb_int64_value(mix_code));
- ghb_ui_update(ud, "AudioTrackDRCSlider", ghb_double_value(1.0));
}
ghb_adjust_audio_rate_combos(ud);
ghb_grey_combo_options (ud->builder);
@@ -406,12 +405,6 @@ drc_widget_changed_cb(GtkWidget *widget, gdouble val, signal_user_data_t *ud)
gchar *drc;
g_debug("drc_widget_changed_cb ()");
- if (val > 0.8 && val < 1.0)
- gtk_scale_button_set_value(GTK_SCALE_BUTTON(widget), 1.0);
- if (val <= 0.8 && val > 0.5)
- gtk_scale_button_set_value(GTK_SCALE_BUTTON(widget), 0.0);
- else if (val > 0.0 && val <= 0.5)
- gtk_scale_button_set_value(GTK_SCALE_BUTTON(widget), 1.0);
label = GTK_LABEL(GHB_WIDGET(ud->builder, "drc_label"));
if (val < 1.0)
@@ -473,8 +466,8 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings)
GtkListStore *store;
GtkTreeSelection *selection;
const gchar *track, *codec, *br, *sr, *mix;
- gchar *drc, *s_track, *s_codec, *s_br, *s_sr, *s_mix;
- gdouble s_drc;
+ gchar *s_drc, *s_track, *s_codec, *s_br, *s_sr, *s_mix;
+ gdouble drc;
g_debug("add_to_audio_list ()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "audio_list"));
@@ -492,11 +485,12 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings)
s_br = ghb_settings_get_string(settings, "AudioBitrate");
s_sr = ghb_settings_get_string(settings, "AudioSamplerate");
s_mix = ghb_settings_get_string(settings, "AudioMixdown");
- s_drc = ghb_settings_get_double(settings, "AudioTrackDRCSlider");
- if (s_drc < 0.1)
- drc = g_strdup("Off");
+ drc = ghb_settings_get_double(settings, "AudioTrackDRCSlider");
+ if (drc < 1.0)
+ s_drc = g_strdup("Off");
else
- drc = g_strdup_printf("%.1f", s_drc);
+ s_drc = g_strdup_printf("%.1f", drc);
+
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@@ -506,17 +500,17 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings)
2, br,
3, sr,
4, mix,
- 5, drc,
+ 5, s_drc,
// These are used to set combo box values when a list item is selected
6, s_track,
7, s_codec,
8, s_br,
9, s_sr,
10, s_mix,
- 11, s_drc,
+ 11, drc,
-1);
gtk_tree_selection_select_iter(selection, &iter);
- g_free(drc);
+ g_free(s_drc);
g_free(s_track);
g_free(s_codec);
g_free(s_br);
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index c8d32afe6..b29717ef1 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -219,11 +219,11 @@
</object>
<object class="GtkAdjustment" id="adjustment28">
<property name="upper">4</property>
- <property name="lower">0</property>
+ <property name="lower">0.9</property>
<property name="page_increment">1</property>
- <property name="step_increment">0.2</property>
+ <property name="step_increment">0.1</property>
<property name="page_size">0</property>
- <property name="value">2.6</property>
+ <property name="value">0.0</property>
</object>
<object class="GtkAdjustment" id="preview_progress_adj">
<property name="upper">100</property>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 9540d4afb..f3168c1bd 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -3923,6 +3923,9 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
}
audio.out.dynamic_range_compression =
ghb_settings_get_double(asettings, "AudioTrackDRCSlider");
+ if (audio.out.dynamic_range_compression < 1.0)
+ audio.out.dynamic_range_compression = 0.0;
+
// It would be better if this were done in libhb for us, but its not yet.
if (audio.out.codec == HB_ACODEC_AC3 || audio.out.codec == HB_ACODEC_DCA)
{
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index ad2af5c67..6c490de0a 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -2219,6 +2219,7 @@ import_value_xlat(GValue *dict)
if (gval)
ghb_dict_insert(dict, g_strdup(key), gval);
+
GValue *sdeflist;
GValue *sdefaults;
GValue *slist;
@@ -2324,6 +2325,18 @@ import_value_xlat(GValue *dict)
gval = import_value_xlat2(adefaults, mix_xlat, key, mac_val);
if (gval)
ghb_dict_insert(adict, g_strdup(key), gval);
+
+ mac_val = ghb_dict_lookup(adict, "AudioTrackDRCSlider");
+ if (mac_val != NULL)
+ {
+ gdouble drc;
+ drc = ghb_value_double(mac_val);
+ if (drc < 1.0 && drc > 0.0)
+ {
+ ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"),
+ ghb_double_value_new(0.0));
+ }
+ }
}
}
}
@@ -2530,6 +2543,26 @@ export_xlat_preset(GValue *dict)
ghb_dict_insert(dict, g_strdup("VideoQualityType"),
ghb_int_value_new(2));
}
+
+ GValue *alist, *adict;
+ gint count, ii;
+
+ alist = ghb_dict_lookup(dict, "AudioList");
+ count = ghb_array_len(alist);
+ for (ii = 0; ii < count; ii++)
+ {
+ gdouble drc;
+
+ adict = ghb_array_get_nth(alist, ii);
+ drc = ghb_value_double(
+ preset_dict_get_value(adict, "AudioTrackDRCSlider"));
+ if (drc < 1.0 && drc > 0.0)
+ {
+ ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"),
+ ghb_double_value_new(0.0));
+ }
+ }
+
ghb_dict_insert(dict, g_strdup("PicturePARWidth"),
ghb_int_value_new(par_width));
ghb_dict_insert(dict, g_strdup("PicturePARHeight"),
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 41a207f12..d4bb5cece 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -465,7 +465,7 @@ audio_list_refresh(signal_user_data_t *ud)
s_sr = ghb_settings_get_string(asettings, "AudioSamplerate");
s_mix = ghb_settings_get_string(asettings, "AudioMixdown");
s_drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider");
- if (s_drc < 0.1)
+ if (s_drc < 1.0)
drc = g_strdup("Off");
else
drc = g_strdup_printf("%.1f", s_drc);