summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-05-29 22:16:48 +0000
committerjstebbins <[email protected]>2010-05-29 22:16:48 +0000
commit56186b06ee94845ac6a99fa35f62c4d8ad737c97 (patch)
tree8cb46c02e537c445fa2ce533c7d6cc26ca01c841
parentaab17eff3801f30a08516943f6ef41b60e305264 (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
-rw-r--r--gtk/src/hb-backend.c54
-rw-r--r--gtk/src/hb-backend.h1
-rw-r--r--gtk/src/subtitlehandler.c15
3 files changed, 50 insertions, 20 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;
diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h
index 1ccb53eac..975616967 100644
--- a/gtk/src/hb-backend.h
+++ b/gtk/src/hb-backend.h
@@ -165,6 +165,7 @@ gchar* ghb_dvd_volname(const gchar *device);
gint ghb_get_title_number(gint titleindex);
gint ghb_subtitle_track_source(signal_user_data_t *ud, gint track);
const char* ghb_subtitle_track_source_name(signal_user_data_t *ud, gint track);
+const char* ghb_subtitle_source_name(gint source);
gchar* ghb_subtitle_track_lang(signal_user_data_t *ud, gint track);
gboolean ghb_validate_vquality(GValue *settings);
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index 1c5b42cd1..44f06a094 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -678,6 +678,7 @@ subtitle_list_refresh_selected(signal_user_data_t *ud)
gint row;
GValue *settings = NULL;
const GValue *subtitle_list;
+ gboolean allow_burn_force = FALSE;
g_debug("subtitle_list_refresh_selected ()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "subtitle_list"));
@@ -752,6 +753,10 @@ subtitle_list_refresh_selected(signal_user_data_t *ud)
burned = ghb_settings_get_boolean(settings, "SubtitleBurned");
}
+ if (i_source == VOBSUB)
+ allow_burn_force = TRUE;
+
+
gtk_list_store_set(GTK_LIST_STORE(store), &iter,
// These are displayed in list
0, track,
@@ -763,6 +768,8 @@ subtitle_list_refresh_selected(signal_user_data_t *ud)
// These are used to set combo box values when a list item is selected
6, s_track,
7, i_source,
+ 8, allow_burn_force,
+ 9, allow_burn_force,
-1);
g_free(track);
g_free(source);
@@ -909,6 +916,7 @@ add_to_subtitle_list(
gboolean forced, burned, def;
gchar *s_track;
gint i_source;
+ gboolean allow_burn_force = FALSE;
g_debug("add_to_subtitle_list ()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "subtitle_list"));
@@ -924,6 +932,9 @@ add_to_subtitle_list(
i_source = ghb_settings_get_int(settings, "SubtitleSource");
source = subtitle_source_name(i_source);
+ if (i_source == VOBSUB)
+ allow_burn_force = TRUE;
+
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
// These are displayed in list
@@ -935,8 +946,8 @@ add_to_subtitle_list(
// These are used to set combo box values when a list item is selected
6, s_track,
7, i_source,
- 8, TRUE,
- 9, TRUE,
+ 8, allow_burn_force,
+ 9, allow_burn_force,
10, FALSE,
-1);
gtk_tree_selection_select_iter(selection, &iter);