diff options
author | jstebbins <[email protected]> | 2010-05-29 22:16:48 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-05-29 22:16:48 +0000 |
commit | 56186b06ee94845ac6a99fa35f62c4d8ad737c97 (patch) | |
tree | 8cb46c02e537c445fa2ce533c7d6cc26ca01c841 /gtk/src/hb-backend.c | |
parent | aab17eff3801f30a08516943f6ef41b60e305264 (diff) |
LinGui: tweak the ui to accommodate universal subtitle input
don't show burned or forced fields for non-vobsubs
show subtitle type in the subtitle track combo box
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3332 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r-- | gtk/src/hb-backend.c | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index e7265ef87..6f6cf0ce2 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1149,6 +1149,30 @@ ghb_subtitle_track_source(signal_user_data_t *ud, gint track) } const char* +ghb_subtitle_source_name(gint source) +{ + const gchar * name = "Unknown"; + switch (source) + { + case VOBSUB: + name = "Bitmap"; + break; + case TX3GSUB: + case UTF8SUB: + case CC708SUB: + case CC608SUB: + name = "Text"; + break; + case SRTSUB: + name = "SRT"; + break; + default: + break; + } + return name; +} + +const char* ghb_subtitle_track_source_name(signal_user_data_t *ud, gint track) { gint titleindex; @@ -1186,21 +1210,7 @@ ghb_subtitle_track_source_name(signal_user_data_t *ud, gint track) sub = hb_list_item( title->list_subtitle, track); if (sub != NULL) { - switch (sub->source) - { - case VOBSUB: - name = "Bitmap"; - break; - case CC708SUB: - case CC608SUB: - name = "Text"; - break; - case SRTSUB: - name = "SRT"; - break; - default: - break; - } + name = ghb_subtitle_source_name(sub->source); } done: @@ -1966,7 +1976,16 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) subtitle = (hb_subtitle_t *)hb_list_item(title->list_subtitle, ii); // Skip subtitles that must be burned if there is already // a burned subtitle in the list - options[ii] = g_strdup_printf("%d - %s", ii+1, subtitle->lang); + if (subtitle->source == VOBSUB) + { + options[ii] = g_strdup_printf("%d - %s", ii+1, subtitle->lang); + } + else + { + options[ii] = g_strdup_printf("%d - %s (%s)", ii+1, + subtitle->lang, + ghb_subtitle_source_name(subtitle->source)); + } subtitle_opts.map[ii+1].option = options[ii]; subtitle_opts.map[ii+1].shortOpt = index_str[ii]; subtitle_opts.map[ii+1].ivalue = ii; @@ -2382,7 +2401,7 @@ ghb_find_subtitle_track( continue; subtitle = (hb_subtitle_t*)hb_list_item( title->list_subtitle, ii ); - if (((burn || force) && (subtitle->source == VOBSUB)) && + if ((!(burn || force) || (subtitle->source == VOBSUB)) && ((strcmp(lang, subtitle->iso639_2) == 0) || (strcmp(lang, "und") == 0))) { @@ -3860,7 +3879,6 @@ ghb_validate_subtitles(signal_user_data_t *ud) titleindex = ghb_settings_combo_int(ud->settings, "title"); title = hb_list_item( list, titleindex ); if (title == NULL) return FALSE; - gint mux = ghb_settings_combo_int(ud->settings, "FileFormat"); const GValue *slist, *settings; gint count, ii, source; |