summaryrefslogtreecommitdiffstats
path: root/gtk/src/audiohandler.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-09-12 12:43:11 -0700
committerJohn Stebbins <[email protected]>2017-11-06 08:19:49 -0800
commitd024e58390c5900d7badefa298f803cade8f356c (patch)
treed4984dc3e3d2769af4fb6c0204ff8e2a193be9c0 /gtk/src/audiohandler.c
parentb64e2ff7ad7aaa500f4927998f67c7c29070bd5a (diff)
LinGui: Reorgainize Summary pane
Synching up with https://github.com/HandBrake/HandBrake/issues/833
Diffstat (limited to 'gtk/src/audiohandler.c')
-rw-r--r--gtk/src/audiohandler.c97
1 files changed, 41 insertions, 56 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 0a3a01833..f6def5149 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -895,31 +895,58 @@ ghb_audio_list_refresh_all(signal_user_data_t *ud)
{
ghb_sanitize_audio_tracks(ud);
audio_refresh_list_ui(ud);
+ ghb_update_summary_info(ud);
}
-G_MODULE_EXPORT void
-audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+void
+audio_update_setting(
+ GhbValue *val,
+ const char *name,
+ signal_user_data_t *ud)
{
- static gint prev_acodec = 0;
- gint acodec;
GhbValue *asettings;
- ghb_widget_to_setting(ud->settings, widget);
+ if (block_updates)
+ {
+ ghb_value_free(&val);
+ return;
+ }
+
asettings = audio_get_selected_settings(ud, NULL);
- if (!block_updates && asettings != NULL)
+ if (asettings != NULL)
{
- ghb_dict_set(asettings, "Encoder", ghb_widget_value(widget));
- audio_deps(ud, asettings, widget);
+ if (val != NULL)
+ ghb_dict_set(asettings, name, val);
+ else
+ ghb_dict_remove(asettings, name);
+ audio_deps(ud, asettings, NULL);
+ ghb_update_summary_info(ud);
ghb_audio_list_refresh_selected(ud);
ghb_live_reset(ud);
}
+ else
+ {
+ ghb_value_free(&val);
+ }
+}
+
+G_MODULE_EXPORT void
+audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ static gint prev_acodec = 0;
+ gint acodec;
+
+ ghb_widget_to_setting(ud->settings, widget);
+ audio_update_setting(ghb_widget_value(widget), "Encoder", ud);
acodec = ghb_settings_audio_encoder_codec(ud->settings, "AudioEncoder");
float low, high, gran, defval;
int dir;
+ GhbValue *asettings;
hb_audio_quality_get_limits(acodec, &low, &high, &gran, &dir);
defval = hb_audio_quality_get_default(acodec);
+ asettings = audio_get_selected_settings(ud, NULL);
if (asettings != NULL && ghb_audio_quality_enabled(asettings))
{
gdouble quality = ghb_dict_get_double(asettings, "Quality");
@@ -1000,56 +1027,11 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
G_MODULE_EXPORT void
audio_track_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- GhbValue *asettings;
-
g_debug("audio_track_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- if (block_updates)
- {
- return;
- }
-
- asettings = audio_get_selected_settings(ud, NULL);
- if (asettings != NULL)
- {
- GhbValue *val = ghb_widget_value(widget);
- ghb_dict_set(asettings, "Track", ghb_value_xform(val, GHB_INT));
- ghb_value_free(&val);
- audio_deps(ud, asettings, widget);
- ghb_audio_list_refresh_selected(ud);
- ghb_live_reset(ud);
- }
-}
-
-void
-audio_update_setting(
- GhbValue *val,
- const char *name,
- signal_user_data_t *ud)
-{
- GhbValue *asettings;
-
- if (block_updates)
- {
- ghb_value_free(&val);
- return;
- }
-
- asettings = audio_get_selected_settings(ud, NULL);
- if (asettings != NULL)
- {
- if (val != NULL)
- ghb_dict_set(asettings, name, val);
- else
- ghb_dict_remove(asettings, name);
- audio_deps(ud, asettings, NULL);
- ghb_audio_list_refresh_selected(ud);
- ghb_live_reset(ud);
- }
- else
- {
- ghb_value_free(&val);
- }
+ GhbValue *val = ghb_widget_value(widget);
+ audio_update_setting(ghb_value_xform(val, GHB_INT), "Track", ud);
+ ghb_value_free(&val);
}
G_MODULE_EXPORT void
@@ -1399,6 +1381,7 @@ audio_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
audio_update_dialog_widgets(ud, asettings);
}
audio_refresh_list_ui(ud);
+ ghb_update_summary_info(ud);
}
else
{
@@ -1442,6 +1425,7 @@ audio_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
} while (asettings != NULL);
}
audio_refresh_list_ui(ud);
+ ghb_update_summary_info(ud);
}
G_MODULE_EXPORT void
@@ -1555,6 +1539,7 @@ audio_reset_clicked_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_sanitize_audio_tracks(ud);
audio_update_dialog_widgets(ud, audio_get_selected_settings(ud, NULL));
audio_refresh_list_ui(ud);
+ ghb_update_summary_info(ud);
}
static GtkWidget *find_widget_recurse(GtkWidget *widget, const gchar *name)