From d024e58390c5900d7badefa298f803cade8f356c Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Tue, 12 Sep 2017 12:43:11 -0700 Subject: LinGui: Reorgainize Summary pane Synching up with https://github.com/HandBrake/HandBrake/issues/833 --- gtk/src/audiohandler.c | 97 ++--- gtk/src/callbacks.c | 483 ++++++++++++++++++----- gtk/src/callbacks.h | 1 + gtk/src/ghb.m4 | 977 ++++++++++++++++------------------------------ gtk/src/hb-backend.c | 21 +- gtk/src/hb-backend.h | 1 + gtk/src/makedeps.py | 2 - gtk/src/preview.c | 19 +- gtk/src/queuehandler.c | 47 ++- gtk/src/subtitlehandler.c | 16 +- gtk/src/subtitlehandler.h | 2 + gtk/src/videohandler.c | 33 ++ libhb/avfilter.c | 6 +- libhb/hb_dict.c | 2 +- 14 files changed, 882 insertions(+), 825 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) diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 89aa9740c..649e7d227 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1239,15 +1239,33 @@ ghb_load_post_settings(signal_user_data_t * ud) static void show_scan_progress(signal_user_data_t *ud) { - GtkProgressBar *progress; - GtkLabel *label; + GtkWidget * source_info; + GtkProgressBar * progress; + GtkLabel * label; progress = GTK_PROGRESS_BAR(GHB_WIDGET(ud->builder, "scan_prog")); - gtk_progress_bar_set_fraction (progress, 0); + gtk_progress_bar_set_fraction(progress, 0); gtk_widget_show(GTK_WIDGET(progress)); label = GTK_LABEL(GHB_WIDGET(ud->builder, "volume_label")); gtk_label_set_text( label, _("Scanning ...") ); + + source_info = GHB_WIDGET(ud->builder, "SourceInfoBox"); + gtk_widget_hide(source_info); +} + +static void +hide_scan_progress(signal_user_data_t *ud) +{ + GtkWidget * source_info; + GtkProgressBar * progress; + + progress = GTK_PROGRESS_BAR(GHB_WIDGET(ud->builder, "scan_prog")); + gtk_progress_bar_set_fraction(progress, 1.0); + gtk_widget_hide(GTK_WIDGET(progress)); + + source_info = GHB_WIDGET(ud->builder, "SourceInfoBox"); + gtk_widget_show(source_info); } static void @@ -1707,38 +1725,6 @@ get_rate_string(gint rate_num, gint rate_den) static void update_aspect_info(signal_user_data_t *ud) { - GtkWidget *widget; - gchar *text; - - text = ghb_dict_get_bool(ud->settings, "PictureAutoCrop") ? _("On") : _("Off"); - widget = GHB_WIDGET(ud->builder, "crop_auto"); - gtk_label_set_text(GTK_LABEL(widget), text); - text = ghb_dict_get_bool(ud->settings, "autoscale") ? _("On") : _("Off"); - widget = GHB_WIDGET(ud->builder, "scale_auto"); - gtk_label_set_text(GTK_LABEL(widget), text); - switch (ghb_settings_combo_int(ud->settings, "PicturePAR")) - { - case HB_ANAMORPHIC_NONE: - text = _("Off"); - break; - case HB_ANAMORPHIC_STRICT: - text = _("Strict"); - break; - case HB_ANAMORPHIC_LOOSE: - text = _("Loose"); - break; - case HB_ANAMORPHIC_CUSTOM: - text = _("Custom"); - break; - case HB_ANAMORPHIC_AUTO: - text = _("Automatic"); - break; - default: - text = _("Unknown"); - break; - } - widget = GHB_WIDGET(ud->builder, "scale_anamorphic"); - gtk_label_set_text(GTK_LABEL(widget), text); } static void @@ -1760,41 +1746,30 @@ update_crop_info(signal_user_data_t *ud) crop[3] = ghb_dict_get_int(ud->settings, "PictureRightCrop"); width = title->geometry.width - crop[2] - crop[3]; height = title->geometry.height - crop[0] - crop[1]; - widget = GHB_WIDGET(ud->builder, "crop_dimensions"); text = g_strdup_printf ("%d x %d", width, height); - gtk_label_set_text(GTK_LABEL(widget), text); widget = GHB_WIDGET(ud->builder, "crop_dimensions2"); gtk_label_set_text(GTK_LABEL(widget), text); g_free(text); } - widget = GHB_WIDGET (ud->builder, "crop_values"); - text = g_strdup_printf ("%d:%d:%d:%d", crop[0], crop[1], crop[2], crop[3]); - gtk_label_set_text (GTK_LABEL(widget), text); - g_free(text); } static void update_scale_info(signal_user_data_t *ud) { - GtkWidget *widget; - gchar *text; - - gint width = ghb_dict_get_int(ud->settings, "scale_width"); - gint height = ghb_dict_get_int(ud->settings, "scale_height"); - widget = GHB_WIDGET(ud->builder, "scale_dimensions"); - text = g_strdup_printf("%d x %d", width, height); - gtk_label_set_text(GTK_LABEL(widget), text); - g_free(text); } void ghb_update_title_info(signal_user_data_t *ud) { - GtkWidget *widget; - gchar *text; - - int title_id, titleindex; - const hb_title_t * title; + GtkWidget * widget; + gchar * text; + gchar * aspect; + gchar * rate; + int title_id, titleindex; + int audio_count, subtitle_count; + const hb_title_t * title; + const hb_geometry_t * geo; + gint aspect_n, aspect_d; title_id = ghb_dict_get_int(ud->settings, "title"); title = ghb_lookup_title(title_id, &titleindex); @@ -1803,33 +1778,27 @@ ghb_update_title_info(signal_user_data_t *ud) update_title_duration(ud); - widget = GHB_WIDGET (ud->builder, "source_video_codec"); - if ( title->video_codec_name ) - gtk_label_set_text (GTK_LABEL(widget), title->video_codec_name); - else - gtk_label_set_text (GTK_LABEL(widget), _("Unknown")); - - widget = GHB_WIDGET (ud->builder, "source_dimensions"); - text = g_strdup_printf ("%d x %d", title->geometry.width, title->geometry.height); - gtk_label_set_text (GTK_LABEL(widget), text); - g_free(text); - - widget = GHB_WIDGET (ud->builder, "source_aspect"); - gint aspect_n, aspect_d; - hb_reduce(&aspect_n, &aspect_d, - title->geometry.width * title->geometry.par.num, - title->geometry.height * title->geometry.par.den); - text = get_aspect_string(aspect_n, aspect_d); - gtk_label_set_text (GTK_LABEL(widget), text); - g_free(text); - - widget = GHB_WIDGET (ud->builder, "source_frame_rate"); - text = (gchar*)get_rate_string(title->vrate.num, title->vrate.den); - gtk_label_set_text (GTK_LABEL(widget), text); - g_free(text); - - //widget = GHB_WIDGET (ud->builder, "source_interlaced"); - //gtk_label_set_text (GTK_LABEL(widget), title->interlaced ? "Yes" : "No"); + geo = &title->geometry; + hb_reduce(&aspect_n, &aspect_d, geo->width * geo->par.num, + geo->height * geo->par.den); + aspect = get_aspect_string(aspect_n, aspect_d); + rate = get_rate_string(title->vrate.num, title->vrate.den); + audio_count = hb_list_count(title->list_audio); + subtitle_count = hb_list_count(title->list_subtitle); + + text = g_strdup_printf( + "%dx%d (%dx%d), %s, %s FPS, %d Audio Track%s, %d Subtitle Track%s", + geo->width, geo->height, + geo->width * geo->par.num / geo->par.den, geo->height, + aspect, rate, + audio_count, audio_count == 1 ? "" : "s", + subtitle_count, subtitle_count == 1 ? "" : "s"); + + widget = GHB_WIDGET(ud->builder, "source_info_label"); + gtk_label_set_text(GTK_LABEL(widget), text); + free(text); + free(aspect); + free(rate); ghb_update_display_aspect_label(ud); @@ -1848,6 +1817,320 @@ static void update_meta(GhbValue *settings, const char *name, const char *val) ghb_dict_set_string(metadata, name, val); } +void +ghb_update_summary_info(signal_user_data_t *ud) +{ + GString * str; + char * text; + int title_id; + GtkWidget * widget; + GhbValue * titleDict; + + title_id = ghb_dict_get_int(ud->settings, "title"); + titleDict = ghb_get_title_dict(title_id); + if (titleDict == NULL) + { + // No title, clear summary + widget = GHB_WIDGET(ud->builder, "tracks_summary"); + gtk_label_set_text(GTK_LABEL(widget), ""); + widget = GHB_WIDGET(ud->builder, "filters_summary"); + gtk_label_set_text(GTK_LABEL(widget), ""); + widget = GHB_WIDGET(ud->builder, "dimensions_summary"); + gtk_label_set_text(GTK_LABEL(widget), "--"); + widget = GHB_WIDGET(ud->builder, "aspect_summary"); + gtk_label_set_text(GTK_LABEL(widget), "--"); + widget = GHB_WIDGET(ud->builder, "preview_button_image"); + gtk_image_set_from_icon_name(GTK_IMAGE(widget), "hb-icon", 128); + return; + } + + // Video Track + const hb_encoder_t * video_encoder; + const hb_rate_t * fps; + hb_rational_t vrate; + char * rate_str; + + str = g_string_new(""); + video_encoder = ghb_settings_video_encoder(ud->settings, "VideoEncoder"); + fps = ghb_settings_video_framerate(ud->settings, "VideoFramerate"); + if (fps->rate == 0) + { + hb_dict_extract_rational(&vrate, titleDict, "FrameRate"); + } + else + { + vrate.num = 27000000; + vrate.den = fps->rate; + } + rate_str = get_rate_string(vrate.num, vrate.den); + g_string_append_printf(str, "%s, %s FPS", video_encoder->name, rate_str); + if (ghb_dict_get_bool(ud->settings, "VideoFramerateCFR")) + { + g_string_append_printf(str, " CFR"); + } + else if (ghb_dict_get_bool(ud->settings, "VideoFrameratePFR")) + { + g_string_append_printf(str, " PFR"); + } + else if (ghb_dict_get_bool(ud->settings, "VideoFramerateVFR")) + { + g_string_append_printf(str, " VFR"); + } + + // Audio Tracks (show at most 3 tracks) + GhbValue * audioList; + GhbValue * sourceAudioList; + int ii, count, show; + + sourceAudioList = ghb_dict_get(titleDict, "AudioList"); + audioList = ghb_get_job_audio_list(ud->settings); + show = count = ghb_array_len(audioList); + if (count > 3) + { + show = 2; + } + for (ii = 0; ii < show; ii++) + { + GhbValue * asettings, * asource; + const hb_mixdown_t * audio_mix; + const hb_encoder_t * audio_encoder; + const char * lang; + int track; + + asettings = ghb_array_get(audioList, ii); + track = ghb_dict_get_int(asettings, "Track"); + asource = ghb_array_get(sourceAudioList, track); + lang = ghb_dict_get_string(asource, "Language"); + audio_encoder = ghb_settings_audio_encoder(asettings, "Encoder"); + if (audio_encoder->codec & HB_ACODEC_PASS_FLAG) + { + g_string_append_printf(str, "\n%s, %s", lang, audio_encoder->name); + } + else + { + audio_mix = ghb_settings_mixdown(asettings, "Mixdown"); + g_string_append_printf(str, "\n%s, %s, %s", lang, + audio_encoder->name, audio_mix->name); + } + } + if (show < count) + { + g_string_append_printf(str, "\n+ %d more audio track%s", count - show, + count - show > 1 ? "s" : ""); + } + + // Subtitle Tracks (show at most 3 tracks) + GhbValue * subtitleDict; + GhbValue * searchDict; + GhbValue * subtitleList; + GhbValue * sourceSubtitleList; + gboolean search; + + sourceSubtitleList = ghb_dict_get(titleDict, "SubtitleList"); + subtitleDict = ghb_get_job_subtitle_settings(ud->settings); + subtitleList = ghb_dict_get(subtitleDict, "SubtitleList"); + searchDict = ghb_dict_get(subtitleDict, "Search"); + search = ghb_dict_get_bool(searchDict, "Enable"); + show = count = ghb_array_len(subtitleList) + search; + if (count > 3) + { + show = 2; + } + if (search) + { + gboolean force, burn, def; + + force = ghb_dict_get_bool(searchDict, "Forced"); + burn = ghb_dict_get_bool(searchDict, "Burn"); + def = ghb_dict_get_bool(searchDict, "Default"); + + g_string_append_printf(str, "\nForeign Audio Scan"); + if (force) + { + g_string_append_printf(str, ", Forced Only"); + } + if (burn) + { + g_string_append_printf(str, ", Burned"); + } + else if (def) + { + g_string_append_printf(str, ", Default"); + } + show--; + count--; + } + for (ii = 0; ii < show; ii++) + { + GhbValue * subsettings, * subsource; + int track; + char * desc; + gboolean force, burn, def; + + subsettings = ghb_array_get(subtitleList, ii); + track = ghb_dict_get_int(subsettings, "Track"); + subsource = ghb_array_get(sourceSubtitleList, track); + desc = ghb_subtitle_short_description(subsource, subsettings); + force = ghb_dict_get_bool(subsettings, "Forced"); + burn = ghb_dict_get_bool(subsettings, "Burn"); + def = ghb_dict_get_bool(subsettings, "Default"); + + g_string_append_printf(str, "\n%s", desc); + if (force) + { + g_string_append_printf(str, ", Forced Only"); + } + if (burn) + { + g_string_append_printf(str, ", Burned"); + } + else if (def) + { + g_string_append_printf(str, ", Default"); + } + } + if (show < count) + { + g_string_append_printf(str, "\n+ %d more subtitle track%s", + count - show, + count - show > 1 ? "s" : ""); + } + + if (ghb_dict_get_bool(ud->settings, "ChapterMarkers")) + { + g_string_append_printf(str, "\nChapter Markers"); + } + + text = g_string_free(str, FALSE); + widget = GHB_WIDGET(ud->builder, "tracks_summary"); + gtk_label_set_text(GTK_LABEL(widget), text); + g_free(text); + + // Filters + gboolean detel, comb_detect, deint, decomb, deblock, nlmeans, denoise; + gboolean unsharp, lapsharp, rot, gray; + const char * sval; + int ival; + + sval = ghb_dict_get_string(ud->settings, "PictureDetelecine"); + detel = sval != NULL && !!strcasecmp(sval, "off"); + sval = ghb_dict_get_string(ud->settings, "PictureCombDetectPreset"); + comb_detect = sval != NULL && !!strcasecmp(sval, "off"); + sval = ghb_dict_get_string(ud->settings, "PictureDeinterlaceFilter"); + deint = sval != NULL && !strcasecmp(sval, "deinterlace"); + decomb = sval != NULL && !strcasecmp(sval, "decomb"); + ival = ghb_dict_get_int(ud->settings, "PictureDeblock"); + deblock = ival >= 5; + sval = ghb_dict_get_string(ud->settings, "PictureDenoiseFilter"); + nlmeans = sval != NULL && !strcasecmp(sval, "nlmeans"); + denoise = sval != NULL && !strcasecmp(sval, "hqdn3d"); + sval = ghb_dict_get_string(ud->settings, "PictureSharpenFilter"); + unsharp = sval != NULL && !strcasecmp(sval, "unsharp"); + lapsharp = sval != NULL && !strcasecmp(sval, "lapsharp"); + sval = ghb_dict_get_string(ud->settings, "PictureRotate"); + rot = sval != NULL && !!strcasecmp(sval, "disable=1"); + gray = ghb_dict_get_bool(ud->settings, "VideoGrayScale"); + + str = g_string_new(""); + sval = ""; + if (detel) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_DETELECINE); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (comb_detect) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_COMB_DETECT); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (deint) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_DEINTERLACE); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (decomb) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_DECOMB); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (deblock) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_DEBLOCK); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (nlmeans) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_NLMEANS); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (denoise) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_DENOISE); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (unsharp) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_UNSHARP); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (lapsharp) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_LAPSHARP); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (rot) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_ROTATE); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + if (gray) + { + hb_filter_object_t * filter = hb_filter_get(HB_FILTER_GRAYSCALE); + g_string_append_printf(str, "%s%s", sval, filter->name); + sval = ", "; + } + + text = g_string_free(str, FALSE); + widget = GHB_WIDGET(ud->builder, "filters_summary"); + gtk_label_set_text(GTK_LABEL(widget), text); + g_free(text); + + int width, height, display_width, display_height, par_width, par_height; + char * display_aspect; + + width = ghb_dict_get_int(ud->settings, "scale_width"); + height = ghb_dict_get_int(ud->settings, "scale_height"); + display_width = ghb_dict_get_int(ud->settings, "PictureDisplayWidth"); + display_height = ghb_dict_get_int(ud->settings, "PictureDisplayHeight"); + par_width = ghb_dict_get_int(ud->settings, "PicturePARWidth"); + par_height = ghb_dict_get_int(ud->settings, "PicturePARHeight"); + + text = g_strdup_printf("%dx%d storage, %dx%d display", + width, height, display_width, display_height); + widget = GHB_WIDGET(ud->builder, "dimensions_summary"); + gtk_label_set_text(GTK_LABEL(widget), text); + g_free(text); + + display_aspect = ghb_get_display_aspect_string(display_width, + display_height); + text = g_strdup_printf("%d:%d PAR, %s DAR", + par_width, par_height, display_aspect); + widget = GHB_WIDGET(ud->builder, "aspect_summary"); + gtk_label_set_text(GTK_LABEL(widget), text); + g_free(text); + g_free(display_aspect); +} + void set_title_settings(signal_user_data_t *ud, GhbValue *settings) { @@ -1977,12 +2260,14 @@ set_title_settings(signal_user_data_t *ud, GhbValue *settings) g_free(dest); ghb_dict_set_int(settings, "preview_frame", 2); + ghb_update_summary_info(ud); } void ghb_set_current_title_settings(signal_user_data_t *ud) { set_title_settings(ud, ud->settings); + ghb_update_summary_info(ud); } static void @@ -2023,6 +2308,7 @@ load_all_titles(signal_user_data_t *ud, int titleindex) ghb_value_free(&ud->settings_array); ud->settings_array = settings_array; ud->settings = ghb_array_get(ud->settings_array, titleindex); + ghb_update_summary_info(ud); } static gboolean update_preview = FALSE; @@ -2127,33 +2413,12 @@ ptop_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } } -G_MODULE_EXPORT void -framerate_changed_cb(GtkWidget *widget, signal_user_data_t *ud) -{ - ghb_widget_to_setting(ud->settings, widget); - - if (ghb_settings_video_framerate_rate(ud->settings, "VideoFramerate") != 0) - { - if (!ghb_dict_get_bool(ud->settings, "VideoFrameratePFR")) - { - ghb_ui_update(ud, "VideoFramerateCFR", ghb_boolean_value(TRUE)); - } - } - if (ghb_settings_video_framerate_rate(ud->settings, "VideoFramerate") == 0 && - ghb_dict_get_bool(ud->settings, "VideoFrameratePFR")) - { - ghb_ui_update(ud, "VideoFramerateVFR", ghb_boolean_value(TRUE)); - } - ghb_check_dependency(ud, widget, NULL); - ghb_clear_presets_selection(ud); - ghb_live_reset(ud); -} - G_MODULE_EXPORT void setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { ghb_widget_to_setting(ud->settings, widget); ghb_check_dependency(ud, widget, NULL); + ghb_update_summary_info(ud); ghb_clear_presets_selection(ud); ghb_live_reset(ud); } @@ -2178,6 +2443,7 @@ comb_detect_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_string_value("decomb")); } } + ghb_update_summary_info(ud); } G_MODULE_EXPORT void @@ -2198,6 +2464,7 @@ deint_filter_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_ui_update(ud, "PictureCombDetectPreset", ghb_string_value("off")); } + ghb_update_summary_info(ud); } G_MODULE_EXPORT void @@ -2210,6 +2477,7 @@ denoise_filter_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_update_ui_combo_box(ud, "PictureDenoisePreset", NULL, FALSE); ghb_ui_update(ud, "PictureDenoisePreset", ghb_dict_get(ud->settings, "PictureDenoisePreset")); + ghb_update_summary_info(ud); } G_MODULE_EXPORT void @@ -2224,6 +2492,7 @@ sharpen_filter_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_ui_update(ud, "PictureSharpenPreset", ghb_dict_get(ud->settings, "PictureSharpenPreset")); ghb_ui_update(ud, "PictureSharpenTune", ghb_string_value("none")); + ghb_update_summary_info(ud); } G_MODULE_EXPORT void @@ -2345,6 +2614,7 @@ chapter_markers_changed_cb(GtkWidget *widget, signal_user_data_t *ud) end = ghb_dict_get_int(ud->settings, "end_point"); markers &= (end > start); ghb_dict_set_bool(dest, "ChapterMarkers", markers); + ghb_update_summary_info(ud); } G_MODULE_EXPORT void @@ -3365,7 +3635,6 @@ ghb_backend_events(signal_user_data_t *ud) else if (status.scan.state & GHB_STATE_SCANDONE) { const gchar *source; - GtkProgressBar *scan_prog; GtkLabel *label; GtkWidget *widget; @@ -3383,9 +3652,7 @@ ghb_backend_events(signal_user_data_t *ud) source = ghb_dict_get_string(ud->globals, "scan_source"); update_source_label(ud, source); - scan_prog = GTK_PROGRESS_BAR(GHB_WIDGET (ud->builder, "scan_prog")); - gtk_progress_bar_set_fraction (scan_prog, 1.0); - gtk_widget_hide(GTK_WIDGET(scan_prog)); + hide_scan_progress(ud); int title_id, titleindex; const hb_title_t *title; diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h index 729f89974..7e0b1b886 100644 --- a/gtk/src/callbacks.h +++ b/gtk/src/callbacks.h @@ -89,6 +89,7 @@ void ghb_show_container_options(signal_user_data_t *ud); void ghb_scale_configure(signal_user_data_t *ud, char *name, double val, double min, double max, double step, double page, int digits, gboolean inverted); +void ghb_update_summary_info(signal_user_data_t *ud); #endif // _CALLBACKS_H_ diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4 index 75ca74e44..adf68c136 100644 --- a/gtk/src/ghb.m4 +++ b/gtk/src/ghb.m4 @@ -79,7 +79,7 @@ You can choose any of the subtitles recognized in your source file. In addition, there is a special track option -"Foreign Audio Search". This option will add +"Foreign Audio Scan". This option will add an extra pass to the encode that searches for subtitles that may correspond to a foreign language scene. This option is best used in @@ -1077,47 +1077,75 @@ Activity True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 6 - - True - False - <b>Source:</b> - True - - - False - True - 0 - - - - + + horizontal True False + 6 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - None + + + True + False + <b>Source:</b> + True + + + False + True + 0 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + middle + 12 + None + + + False + True + 1 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + end + + + + True + True + 2 + + True True - 1 + 0 - 400 10 False center GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False + True True - 2 + 1 @@ -1368,214 +1396,6 @@ This is often the feature title of a DVD. 1 - - - True - False - <b>Destination</b> - GTK_ALIGN_START - True - 6 - - - False - False - 2 - - - - - horizontal - True - False - 6 - 6 - - - 2 - True - False - 6 - - - True - False - end - File: - - - 0 - 0 - 1 - 1 - - - - - - - - True - True - Destination filename for your encode. - 40 - False - False - - - - - - 0 - 1 - 1 - 1 - - - - - True - False - Destination directory for your encode. - select-folder - False - Destination Directory - - - - 1 - 1 - 1 - 1 - - - - - False - True - 0 - - - - - True - False - 4 - 2 - - - horizontal - True - False - 4 - - - True - False - Format: - - - False - False - 0 - - - - - True - GTK_ALIGN_CENTER - False - Format to mux encoded tracks to. - - - - False - True - 1 - - - - - 0 - 0 - 1 - 1 - - - - - Web Optimized - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Optimize the layout of the MP4 file for progressive download. -This allows a player to initiate playback before downloading the entire file. - start - True - - - - 0 - 1 - 1 - 1 - - - - - Align A/V Start - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Aligns the initial timestamps of all audio and video streams by -inserting blank frames or dropping frames. May improve audio/video -sync for broken players that do not honor MP4 edit lists. - start - True - - - - 1 - 0 - 1 - 1 - - - - - iPod 5G Support - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Add iPod Atom needed by some older iPods. - start - True - - - - 1 - 1 - 1 - 1 - - - - - False - True - 1 - - - - - False - True - 3 - - False @@ -1649,6 +1469,7 @@ sync for broken players that do not honor MP4 edit lists. 400 True False + 12 vertical @@ -1685,412 +1506,199 @@ sync for broken players that do not honor MP4 edit lists. horizontal True + True + 12 False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 3 - - vertical + True + True + False False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - 10 - 0 + 32 + 2 + 6 - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - none - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - 6 - 2 - 12 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - Source Codec: - - - 0 - 0 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - -- - - - 0 - 1 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - Dimensions: - - - 1 - 0 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - -- - - - 1 - 1 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - Aspect: - - - 2 - 0 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - -- - - - 2 - 1 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - Frame Rate: - - - 3 - 0 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - -- - - - 3 - 1 - 1 - 1 - - - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Source Picture Parameters</b> - True - - + <b>Format:</b> + 0 + False + True - False - True - 2 - 0 + 0 + 0 + 1 + 1 - + True + False + start False + Format to mux encoded tracks to. + + + + 0 + 1 + 1 + 1 + + + + + Web Optimized + True + True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - none - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - 6 - 2 - 12 - 2 - - - True - False - start - Autocrop: - - - 0 - 0 - 1 - 1 - - - - - True - False - On - - - 0 - 1 - 1 - 1 - - - - - True - False - start - Crop: - - - 1 - 0 - 1 - 1 - - - - - True - False - -- - - - 1 - 1 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - Crop Dimensions: - - - 2 - 0 - 1 - 1 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - -- - - - 2 - 1 - 1 - 1 - - - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Cropping</b> - True - - + Optimize the layout of the MP4 file for progressive download. +This allows a player to initiate playback before downloading the entire file. + start + False + True + + + + 1 + 1 + 1 + 1 + + + + + Align A/V Start + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Aligns the initial timestamps of all audio and video streams by +inserting blank frames or dropping frames. May improve audio/video +sync for broken players that do not honor MP4 edit lists. + start + False + True + - False - True - 2 - 1 + 2 + 1 + 1 + 1 - + + iPod 5G Support True - False + True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - none - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - 6 - 2 - 12 - 2 - - - True - False - start - Scale Dimensions: - - - 0 - 0 - 1 - 1 - - - - - True - False - -- - - - 0 - 1 - 1 - 1 - - - - - True - False - start - Optimal for Source: - - - 1 - 0 - 1 - 1 - - - - - True - False - On - - - 1 - 1 - 1 - 1 - - - - - True - False - start - Anamorphic: - - - 2 - 0 - 1 - 1 - - - - - True - False - On - - - 2 - 1 - 1 - 1 - - - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - <b>Scaling</b> - True - - + Add iPod Atom needed by some older iPods. + start + False + True + - False - True - 2 - 2 + 3 + 1 + 1 + 1 + + + + + True + False + <b>Tracks:</b> + 0 + 0 + False + 12 + True + + + 4 + 0 + 1 + 1 + + + + + True + False + 30 + 50 + start + 0 + 0 + False + True + 12 + + True + + + 4 + 1 + 1 + 8 + + + + + True + False + <b>Filters:</b> + True + 0 + 0 + False + 12 + + + 12 + 0 + 1 + 1 + + + + + True + False + 30 + 50 + start + 0 + 0 + False + True + 12 + + True + + + 12 + 1 + 1 + 4 - True - True + False + False 0 @@ -2099,53 +1707,52 @@ sync for broken players that do not honor MP4 edit lists. vertical True False - center + True 12 0 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 448 - 200 True False - end 4 4 4 + True 128 hb-icon - False - False - 1 + True + True + 0 - - horizontal + True False - 4 center start + 6 - + True False - Presentation Dimensions: - right + Dimensions: + start + 0 - False - True - 0 + 0 + 0 + 1 + 1 - + 85 True False @@ -2154,16 +1761,48 @@ sync for broken players that do not honor MP4 edit lists. -- - False - True - 1 + 0 + 1 + 1 + 1 + + + + + True + False + Aspect Ratio: + start + 0 + + + 1 + 0 + 1 + 1 + + + + + 85 + True + False + start + start + -- + + + 1 + 1 + 1 + 1 False False - 2 + 1 @@ -3647,7 +3286,7 @@ a variable framerate, 'Same as source' will preserve it. Enables constant framerate output. start True - + 2 @@ -3670,7 +3309,7 @@ VFR is not compatible with some players. start True VideoFramerateCFR - + 3 @@ -3692,7 +3331,7 @@ VFR is not compatible with some players. start True VideoFramerateCFR - + 3 @@ -5180,7 +4819,7 @@ filter_output([ True True True - Foreign Audio Search + Foreign Audio Scan list-add Add an extra pass to the encode which searches for subtitle candidates that provide subtitles for @@ -5465,12 +5104,12 @@ filter_output([ - Add Foreign Audio Search Pass + Add Foreign Audio Scan Pass True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Add "Foreign Audio Search" when the default audio track is your preferred language. + Add "Foreign Audio Scan" when the default audio track is your preferred language. This search pass finds short sequences of foreign audio and provides subtitles for them. This option requires a language to be set in the Selected Languages list. @@ -7187,6 +6826,74 @@ This file may be reloaded at a later time to edit your jobs and re-encode.2 + + + 2 + 2 + True + False + 12 + 6 + 6 + + + True + False + end + 6 + True + <b>Destination:</b> + + + 0 + 0 + 1 + 1 + + + + + True + True + True + Destination filename for your encode. + False + False + + + + + + 0 + 1 + 1 + 1 + + + + + True + False + Destination directory for your encode. + select-folder + False + Destination Directory + + + + 0 + 2 + 1 + 1 + + + + + False + True + 3 + + horizontal @@ -7230,7 +6937,7 @@ This file may be reloaded at a later time to edit your jobs and re-encode. False True - 3 + 4 @@ -7245,7 +6952,7 @@ This file may be reloaded at a later time to edit your jobs and re-encode. False True - 4 + 5 diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 7332f9770..fb8f03205 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3688,14 +3688,12 @@ ghb_set_scale_settings(GhbValue *settings, gint mode) ghb_dict_set_int(par, "Den", resultGeo.par.den); } -void -ghb_update_display_aspect_label(signal_user_data_t *ud) +char * +ghb_get_display_aspect_string(int disp_width, int disp_height) { - gint disp_width, disp_height, dar_width, dar_height; + gint dar_width, dar_height; gchar *str; - disp_width = ghb_dict_get_int(ud->settings, "PictureDisplayWidth"); - disp_height = ghb_dict_get_int(ud->settings, "PictureDisplayHeight"); hb_reduce(&dar_width, &dar_height, disp_width, disp_height); gint iaspect = dar_width * 9 / dar_height; if (dar_width > 2 * dar_height) @@ -3714,6 +3712,18 @@ ghb_update_display_aspect_label(signal_user_data_t *ud) { str = g_strdup_printf("%d : %d", dar_width, dar_height); } + return str; +} + +void +ghb_update_display_aspect_label(signal_user_data_t *ud) +{ + gint disp_width, disp_height; + gchar *str; + + disp_width = ghb_dict_get_int(ud->settings, "PictureDisplayWidth"); + disp_height = ghb_dict_get_int(ud->settings, "PictureDisplayHeight"); + str = ghb_get_display_aspect_string(disp_width, disp_height); ghb_ui_update(ud, "display_aspect", ghb_string_value(str)); g_free(str); } @@ -3725,6 +3735,7 @@ ghb_set_scale(signal_user_data_t *ud, gint mode) ud->scale_busy = TRUE; ghb_set_scale_settings(ud->settings, mode); + ghb_update_summary_info(ud); ghb_picture_settings_deps(ud); // Step needs to be at least 2 because odd widths cause scaler crash diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 450989a06..d3c1410b5 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -225,6 +225,7 @@ const hb_rate_t* ghb_settings_audio_bitrate( const char* ghb_audio_bitrate_get_short_name(int rate); hb_audio_config_t* ghb_get_audio_info(const hb_title_t *title, gint track); hb_subtitle_t* ghb_get_subtitle_info(const hb_title_t *title, gint track); +char * ghb_get_display_aspect_string(int disp_width, int disp_height); hb_handle_t* ghb_scan_handle(void); hb_handle_t* ghb_queue_handle(void); diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py index 5ff09304e..e2ed0c226 100644 --- a/gtk/src/makedeps.py +++ b/gtk/src/makedeps.py @@ -10,8 +10,6 @@ dep_map = ( DepEntry("title", "queue_add_menu", "none", True, False), DepEntry("title", "queue_add_multiple_menu", "none", True, False), DepEntry("title", "preview_frame", "none", True, False), - DepEntry("title", "picture_summary", "none", True, False), - DepEntry("title", "picture_summary2", "none", True, False), DepEntry("title", "chapters_tab", "none", True, False), DepEntry("title", "start_point", "none", True, False), DepEntry("title", "end_point", "none", True, False), diff --git a/gtk/src/preview.c b/gtk/src/preview.c index 81f278e9b..9dcf81c4f 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -841,11 +841,11 @@ static void set_mini_preview_image(signal_user_data_t *ud, GdkPixbuf * pix) preview_height = gdk_pixbuf_get_height(pix); // Scale and display the mini-preview - height = MIN(ud->preview->button_height, 200); + height = MIN(ud->preview->button_height - 32, preview_height); width = preview_width * height / preview_height; - if (width > 400) + if (width > ud->preview->button_width - 32) { - width = 400; + width = MIN(ud->preview->button_width - 32, preview_width); height = preview_height * width / preview_width; } if ((height >= 16) && (width >= 16)) @@ -876,7 +876,7 @@ GdkPixbuf * do_preview_scaling(signal_user_data_t *ud, GdkPixbuf *pix) preview_width = gdk_pixbuf_get_width(pix); preview_height = gdk_pixbuf_get_height(pix); - if (ud->preview->render_width < 0 || ud->preview->render_height < 0) + if (ud->preview->render_width <= 0 || ud->preview->render_height <= 0) { // resize preview window to fit preview preview_set_render_size(ud, preview_width, preview_height); @@ -936,7 +936,11 @@ init_preview_image(signal_user_data_t *ud) title_id = ghb_dict_get_int(ud->settings, "title"); title = ghb_lookup_title(title_id, &titleindex); - if (title == NULL) return; + if (title == NULL) + { + g_object_unref(ud->preview->pix); + ud->preview->pix = NULL; + } widget = GHB_WIDGET (ud->builder, "preview_frame"); ud->preview->frame = ghb_widget_int(widget) - 1; if (ud->preview->encoded[ud->preview->frame]) @@ -970,11 +974,6 @@ init_preview_image(signal_user_data_t *ud) pix_width = gdk_pixbuf_get_width(ud->preview->pix); pix_height = gdk_pixbuf_get_height(ud->preview->pix); preview_set_size(ud, pix_width, pix_height); - - gchar *text = g_strdup_printf("%d x %d", width, height); - widget = GHB_WIDGET(ud->builder, "preview_dims"); - gtk_label_set_text(GTK_LABEL(widget), text); - g_free(text); } void diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index a708598fa..c8fdd00fc 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -78,6 +78,47 @@ queue_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t } } +char * +ghb_subtitle_short_description(const GhbValue *subsource, + const GhbValue *subsettings) +{ + GhbValue *srt; + char *desc = NULL; + + srt = ghb_dict_get(subsettings, "SRT"); + if (srt != NULL) + { + const gchar *code; + const gchar *lang; + const iso639_lang_t *iso; + + lang = ghb_dict_get_string(srt, "Language"); + code = ghb_dict_get_string(srt, "Codeset"); + + iso = lang_lookup(lang); + if (iso != NULL) + { + if (iso->native_name != NULL) + lang = iso->native_name; + else + lang = iso->eng_name; + } + + desc = g_strdup_printf("%s (%s)(SRT)", lang, code); + } + else if (subsource == NULL) + { + desc = g_strdup(_("Foreign Audio Scan")); + } + else + { + const char * lang = ghb_dict_get_string(subsource, "Language"); + desc = g_strdup_printf("%s", lang); + } + + return desc; +} + static char * subtitle_get_track_description(const GhbValue *subsource, const GhbValue *subsettings) @@ -120,15 +161,13 @@ subtitle_get_track_description(const GhbValue *subsource, } else if (subsource == NULL) { - desc = g_strdup(_("Foreign Audio Search")); + desc = g_strdup(_("Foreign Audio Scan")); } else { int track = ghb_dict_get_int(subsettings, "Track"); - int source = ghb_dict_get_int(subsource, "Source"); const char * lang = ghb_dict_get_string(subsource, "Language"); - desc = g_strdup_printf("%d - %s (%s)", track + 1, - lang, hb_subsource_name(source)); + desc = g_strdup_printf("%d - %s", track + 1, lang); } return desc; diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c index 580562fce..66ca478c1 100644 --- a/gtk/src/subtitlehandler.c +++ b/gtk/src/subtitlehandler.c @@ -379,7 +379,7 @@ subtitle_get_track_description(GhbValue *settings, GhbValue *subsettings) track = ghb_dict_get_int(subsettings, "Track"); if (val == NULL || track < 0) { - desc = g_strdup(_("Foreign Audio Search")); + desc = g_strdup(_("Foreign Audio Scan")); } else { @@ -717,8 +717,13 @@ subtitle_update_setting(GhbValue *val, const char *name, signal_user_data_t *ud) { ghb_dict_set(subsettings, name, val); subtitle_list_refresh_selected(ud, subsettings); + ghb_update_summary_info(ud); ghb_live_reset(ud); } + else + { + ghb_value_free(&val); + } return subsettings; } @@ -818,6 +823,7 @@ subtitle_srt_radio_toggled_cb(GtkWidget *widget, signal_user_data_t *ud) } subtitle_update_dialog_widgets(ud, subsettings); subtitle_list_refresh_selected(ud, subsettings); + ghb_update_summary_info(ud); ghb_live_reset(ud); } } @@ -857,6 +863,7 @@ srt_setting_update(GhbValue *val, const char *name, signal_user_data_t *ud) { ghb_dict_set(srt, name, val); subtitle_list_refresh_selected(ud, subsettings); + ghb_update_summary_info(ud); ghb_live_reset(ud); } else @@ -1094,6 +1101,7 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { ghb_value_free(&backup); } + ghb_update_summary_info(ud); } } @@ -1150,6 +1158,7 @@ subtitle_add_fas_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) ghb_value_free(&backup); } + ghb_update_summary_info(ud); } G_MODULE_EXPORT void @@ -1184,6 +1193,7 @@ subtitle_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) FALSE, FALSE, FALSE, &one_burned); } subtitle_refresh_list_ui(ud); + ghb_update_summary_info(ud); ghb_live_reset(ud); } @@ -1191,6 +1201,7 @@ G_MODULE_EXPORT void subtitle_reset_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { ghb_set_pref_subtitle(ud); + ghb_update_summary_info(ud); } // When the container changes, it may be necessary to burn additional @@ -1533,6 +1544,7 @@ subtitle_edit_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud) { ghb_value_free(&backup); } + ghb_update_summary_info(ud); } } @@ -1585,6 +1597,7 @@ subtitle_remove_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *u // Enable FAS button GtkWidget *w = GHB_WIDGET(ud->builder, "subtitle_add_fas"); gtk_widget_set_sensitive(w, 1); + ghb_update_summary_info(ud); return; } row--; @@ -1604,6 +1617,7 @@ subtitle_remove_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *u // Remove the selected item gtk_tree_store_remove(GTK_TREE_STORE(tm), &ti); + ghb_update_summary_info(ud); ghb_live_reset(ud); } gtk_tree_path_free(tp); diff --git a/gtk/src/subtitlehandler.h b/gtk/src/subtitlehandler.h index 9ce7e9baf..d29d781e9 100644 --- a/gtk/src/subtitlehandler.h +++ b/gtk/src/subtitlehandler.h @@ -38,5 +38,7 @@ void ghb_subtitle_set_pref_lang(GhbValue *settings); void ghb_clear_subtitle_selection(GtkBuilder *builder); GhbValue *ghb_get_subtitle_list(GhbValue *settings); GhbValue *ghb_get_subtitle_settings(GhbValue *settings); +char * ghb_subtitle_short_description(const GhbValue *subsource, + const GhbValue *subsettings); #endif // _SUBTITLEHANDLER_H_ diff --git a/gtk/src/videohandler.c b/gtk/src/videohandler.c index 7e23f120b..0219e22cf 100644 --- a/gtk/src/videohandler.c +++ b/gtk/src/videohandler.c @@ -71,6 +71,7 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) ghb_widget_to_setting(ud->settings, widget); ghb_check_dependency(ud, widget, NULL); ghb_show_container_options(ud); + ghb_update_summary_info(ud); ghb_clear_presets_selection(ud); ghb_live_reset(ud); @@ -330,3 +331,35 @@ format_video_preset_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) return g_strdup_printf(" %-12s", "ERROR"); } +G_MODULE_EXPORT void +framerate_changed_cb(GtkWidget *widget, signal_user_data_t *ud) +{ + ghb_widget_to_setting(ud->settings, widget); + ghb_update_summary_info(ud); + + if (ghb_settings_video_framerate_rate(ud->settings, "VideoFramerate") != 0) + { + if (!ghb_dict_get_bool(ud->settings, "VideoFrameratePFR")) + { + ghb_ui_update(ud, "VideoFramerateCFR", ghb_boolean_value(TRUE)); + } + } + if (ghb_settings_video_framerate_rate(ud->settings, "VideoFramerate") == 0 && + ghb_dict_get_bool(ud->settings, "VideoFrameratePFR")) + { + ghb_ui_update(ud, "VideoFramerateVFR", ghb_boolean_value(TRUE)); + } + ghb_check_dependency(ud, widget, NULL); + ghb_clear_presets_selection(ud); + ghb_live_reset(ud); +} + +G_MODULE_EXPORT void +framerate_mode_changed_cb(GtkWidget *widget, signal_user_data_t *ud) +{ + ghb_widget_to_setting(ud->settings, widget); + ghb_update_summary_info(ud); + ghb_check_dependency(ud, widget, NULL); + ghb_clear_presets_selection(ud); + ghb_live_reset(ud); +} diff --git a/libhb/avfilter.c b/libhb/avfilter.c index cc39a1a15..c37950815 100644 --- a/libhb/avfilter.c +++ b/libhb/avfilter.c @@ -66,7 +66,7 @@ hb_filter_object_t hb_filter_pad = { .id = HB_FILTER_PAD, .enforce_order = 1, - .name = "pad", + .name = "Pad", .settings = NULL, .init = null_init, .work = null_work, @@ -82,7 +82,7 @@ hb_filter_object_t hb_filter_rotate = { .id = HB_FILTER_ROTATE, .enforce_order = 1, - .name = "rotate", + .name = "Rotate", .settings = NULL, .init = null_init, .work = null_work, @@ -98,7 +98,7 @@ hb_filter_object_t hb_filter_deinterlace = { .id = HB_FILTER_DEINTERLACE, .enforce_order = 1, - .name = "deinterlace", + .name = "Deinterlace", .settings = NULL, .init = null_init, .work = null_work, diff --git a/libhb/hb_dict.c b/libhb/hb_dict.c index 22c88f2a9..09b3855a8 100644 --- a/libhb/hb_dict.c +++ b/libhb/hb_dict.c @@ -606,7 +606,7 @@ int hb_dict_extract_rational(hb_rational_t *dst, const hb_dict_t * dict, { return 0; } - hb_value_t * den_val = hb_dict_get(val, "Num"); + hb_value_t * den_val = hb_dict_get(val, "Den"); if (den_val == NULL) { return 0; -- cgit v1.2.3