diff options
author | jstebbins <[email protected]> | 2010-06-01 20:21:49 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-06-01 20:21:49 +0000 |
commit | 9728615d2d5871efb7c37cdedb9175fa1b7844d6 (patch) | |
tree | 166ddd10201b26e90e3d810562408b7983e38985 /gtk | |
parent | f22a86152809db1e5a44b0a24b4c865c8f9f997d (diff) |
Add SSA subtitle support
Thanks to davidfster
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3342 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/hb-backend.c | 13 | ||||
-rw-r--r-- | gtk/src/main.c | 21 | ||||
-rw-r--r-- | gtk/src/subtitlehandler.c | 65 |
3 files changed, 38 insertions, 61 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 6f6cf0ce2..5f28ffea2 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1155,17 +1155,24 @@ ghb_subtitle_source_name(gint source) switch (source) { case VOBSUB: - name = "Bitmap"; + name = "VOBSUB"; break; case TX3GSUB: + name = "TX3G"; + break; case UTF8SUB: + name = "UTF8"; + break; case CC708SUB: case CC608SUB: - name = "Text"; + name = "CC"; break; case SRTSUB: name = "SRT"; break; + case SSASUB: + name = "SSA"; + break; default: break; } @@ -1976,11 +1983,13 @@ 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 +#if 0 if (subtitle->source == VOBSUB) { options[ii] = g_strdup_printf("%d - %s", ii+1, subtitle->lang); } else +#endif { options[ii] = g_strdup_printf("%d - %s (%s)", ii+1, subtitle->lang, diff --git a/gtk/src/main.c b/gtk/src/main.c index 6d0d81441..e043623e0 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -406,10 +406,10 @@ bind_subtitle_tree_model (signal_user_data_t *ud) // values that I need // Track, force, burn, default, type, srt offset, track short, source // force visible, burn visible, offset visible - treestore = gtk_list_store_new(11, + treestore = gtk_list_store_new(10, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, - G_TYPE_BOOLEAN, G_TYPE_STRING, + G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, @@ -420,19 +420,19 @@ bind_subtitle_tree_model (signal_user_data_t *ud) column = gtk_tree_view_column_new_with_attributes( _("Track"), cell, "text", 0, NULL); gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column)); - gtk_tree_view_column_set_min_width (column, 190); - gtk_tree_view_column_set_max_width (column, 190); + gtk_tree_view_column_set_min_width (column, 350); + gtk_tree_view_column_set_max_width (column, 350); cell = gtk_cell_renderer_toggle_new(); column = gtk_tree_view_column_new_with_attributes( - _("Forced Only"), cell, "active", 1, "visible", 8, NULL); + _("Forced Only"), cell, "active", 1, "visible", 7, NULL); gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column)); g_signal_connect(cell, "toggled", subtitle_forced_toggled_cb, ud); cell = gtk_cell_renderer_toggle_new(); gtk_cell_renderer_toggle_set_radio(GTK_CELL_RENDERER_TOGGLE(cell), TRUE); column = gtk_tree_view_column_new_with_attributes( - _("Burned In"), cell, "active", 2, "visible", 9, NULL); + _("Burned In"), cell, "active", 2, "visible", 8, NULL); gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column)); g_signal_connect(cell, "toggled", subtitle_burned_toggled_cb, ud); @@ -445,14 +445,7 @@ bind_subtitle_tree_model (signal_user_data_t *ud) cell = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes( - _("Type"), cell, "text", 4, NULL); - gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column)); - gtk_tree_view_column_set_min_width (column, 190); - gtk_tree_view_column_set_max_width (column, 190); - - cell = gtk_cell_renderer_text_new(); - column = gtk_tree_view_column_new_with_attributes( - _("Srt Offset"), cell, "text", 5, "visible", 10, NULL); + _("Srt Offset"), cell, "text", 4, "visible", 9, NULL); gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column)); diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c index 44f06a094..fddb6a9fd 100644 --- a/gtk/src/subtitlehandler.c +++ b/gtk/src/subtitlehandler.c @@ -642,30 +642,6 @@ subtitle_default_toggled_cb( ghb_live_reset(ud); } -static const char* -subtitle_source_name(gint source) -{ - const gchar * name; - - switch (source) - { - case VOBSUB: - name = "Bitmap"; - break; - case CC708SUB: - case CC608SUB: - name = "Text"; - break; - case SRTSUB: - name = "SRT"; - break; - default: - name = "Unknown"; - break; - } - return name; -} - static void subtitle_list_refresh_selected(signal_user_data_t *ud) { @@ -721,8 +697,6 @@ subtitle_list_refresh_selected(signal_user_data_t *ud) lang = ghb_settings_combo_option(settings, "SrtLanguage"); code = ghb_settings_get_string(settings, "SrtCodeset"); - track = g_strdup_printf("%s (%s)", lang, code); - g_free(code); s_track = ghb_settings_get_string(settings, "SrtFile"); if (g_file_test(s_track, G_FILE_TEST_IS_REGULAR)) @@ -730,13 +704,16 @@ subtitle_list_refresh_selected(signal_user_data_t *ud) gchar *basename; basename = g_path_get_basename(s_track); + track = g_strdup_printf("%s (%s)(SRT)(%s)", lang, code, basename); source = g_strdup_printf("SRT (%s)", basename); g_free(basename); } else { + track = g_strdup_printf("%s (%s)(SRT)", lang, code); source = g_strdup_printf("SRT (none)"); } + g_free(code); offset = ghb_settings_get_int(settings, "SrtOffset"); forced = FALSE; @@ -746,7 +723,7 @@ subtitle_list_refresh_selected(signal_user_data_t *ud) { track = g_strdup( ghb_settings_combo_option(settings, "SubtitleTrack")); - source = g_strdup(subtitle_source_name(i_source)); + source = g_strdup(ghb_subtitle_source_name(i_source)); s_track = ghb_settings_get_string(settings, "SubtitleTrack"); forced = ghb_settings_get_boolean(settings, "SubtitleForced"); @@ -763,13 +740,12 @@ subtitle_list_refresh_selected(signal_user_data_t *ud) 1, forced, 2, burned, 3, def, - 4, source, - 5, offset, + 4, offset, // These are used to set combo box values when a list item is selected - 6, s_track, - 7, i_source, + 5, s_track, + 6, i_source, + 7, allow_burn_force, 8, allow_burn_force, - 9, allow_burn_force, -1); g_free(track); g_free(source); @@ -930,7 +906,7 @@ add_to_subtitle_list( s_track = ghb_settings_get_string(settings, "SubtitleTrack"); i_source = ghb_settings_get_int(settings, "SubtitleSource"); - source = subtitle_source_name(i_source); + source = ghb_subtitle_source_name(i_source); if (i_source == VOBSUB) allow_burn_force = TRUE; @@ -942,13 +918,12 @@ add_to_subtitle_list( 1, forced, 2, burned, 3, def, - 4, source, // These are used to set combo box values when a list item is selected - 6, s_track, - 7, i_source, + 5, s_track, + 6, i_source, + 7, allow_burn_force, 8, allow_burn_force, - 9, allow_burn_force, - 10, FALSE, + 9, FALSE, -1); gtk_tree_selection_select_iter(selection, &iter); g_free(s_track); @@ -975,7 +950,6 @@ add_to_srt_list( lang = ghb_settings_combo_option(settings, "SrtLanguage"); code = ghb_settings_get_string(settings, "SrtCodeset"); - track = g_strdup_printf("%s (%s)", lang, code); forced = FALSE; burned = FALSE; def = ghb_settings_get_boolean(settings, "SubtitleDefaultTrack"); @@ -986,11 +960,13 @@ add_to_srt_list( gchar *basename; basename = g_path_get_basename(filename); + track = g_strdup_printf("%s (%s)(SRT)(%s)", lang, code, basename); source = g_strdup_printf("SRT (%s)", basename); g_free(basename); } else { + track = g_strdup_printf("%s (%s)(SRT)", lang, code); source = g_strdup_printf("SRT (none)"); } i_source = SRTSUB; @@ -1003,14 +979,13 @@ add_to_srt_list( 1, forced, 2, burned, 3, def, - 4, source, - 5, offset, + 4, offset, // These are used to set combo box values when a list item is selected - 6, filename, - 7, i_source, + 5, filename, + 6, i_source, + 7, FALSE, 8, FALSE, - 9, FALSE, - 10, TRUE, + 9, TRUE, -1); gtk_tree_selection_select_iter(selection, &iter); g_free(code); |