diff options
author | jstebbins <[email protected]> | 2009-06-04 21:14:41 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-04 21:14:41 +0000 |
commit | 65cb895b41176c6c06558a5fd52a6f2657c65ad2 (patch) | |
tree | 249a1902ccb0741bcb4a3dc903fd3af4d97ab104 /gtk/src/hb-backend.c | |
parent | f1a347e745c0570ffaaac9bd270f4d8578d3d1b3 (diff) |
LinGui: make "Foreign Audio Search" a separate widget instead of adding it
like a to the subtitle track list as if it were a regular subtitle track.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2485 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r-- | gtk/src/hb-backend.c | 83 |
1 files changed, 34 insertions, 49 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 4b2e607c2..22ea2efbc 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1707,26 +1707,14 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) if (subtitle_opts.map) g_free(subtitle_opts.map); if (count > 0) { - subtitle_opts.count = count+1; - subtitle_opts.map = g_malloc((count+1)*sizeof(options_map_t)); + subtitle_opts.count = count; + subtitle_opts.map = g_malloc((count)*sizeof(options_map_t)); } else { - subtitle_opts.count = LANG_TABLE_SIZE+1; - subtitle_opts.map = g_malloc((LANG_TABLE_SIZE+1)*sizeof(options_map_t)); + subtitle_opts.count = LANG_TABLE_SIZE; + subtitle_opts.map = g_malloc((LANG_TABLE_SIZE)*sizeof(options_map_t)); } - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - 0, "Foreign Audio Search", - 1, TRUE, - 2, "-1", - 3, -1.0, - 4, "auto", - -1); - subtitle_opts.map[0].option = "Foreign Audio Search"; - subtitle_opts.map[0].shortOpt = "-1"; - subtitle_opts.map[0].ivalue = -1; - subtitle_opts.map[0].svalue = "auto"; if (count > 0) { if (options != NULL) @@ -1739,10 +1727,10 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) // 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); - subtitle_opts.map[ii+1].option = options[ii]; - subtitle_opts.map[ii+1].shortOpt = index_str[ii]; - subtitle_opts.map[ii+1].ivalue = ii; - subtitle_opts.map[ii+1].svalue = subtitle->iso639_2; + subtitle_opts.map[ii].option = options[ii]; + subtitle_opts.map[ii].shortOpt = index_str[ii]; + subtitle_opts.map[ii].ivalue = ii; + subtitle_opts.map[ii].svalue = subtitle->iso639_2; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, options[ii], @@ -1759,10 +1747,10 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) index_str_init(LANG_TABLE_SIZE-1); for (ii = 0; ii < LANG_TABLE_SIZE; ii++) { - subtitle_opts.map[ii+1].option = ghb_language_table[ii].eng_name; - subtitle_opts.map[ii+1].shortOpt = index_str[ii]; - subtitle_opts.map[ii+1].ivalue = ii; - subtitle_opts.map[ii+1].svalue = ghb_language_table[ii].iso639_2; + subtitle_opts.map[ii].option = ghb_language_table[ii].eng_name; + subtitle_opts.map[ii].shortOpt = index_str[ii]; + subtitle_opts.map[ii].ivalue = ii; + subtitle_opts.map[ii].svalue = ghb_language_table[ii].iso639_2; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, ghb_language_table[ii].eng_name, @@ -3976,47 +3964,44 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) const GValue *subtitle_list; gint subtitle; + gboolean force, burned, def, one_burned = FALSE; job->select_subtitle = NULL; - subtitle_list = ghb_settings_get_value(js, "subtitle_list"); - count = ghb_array_len(subtitle_list); - for (ii = 0; ii < count; ii++) + if (ghb_settings_get_boolean(js, "SubtitleForeignSearch")) { - GValue *ssettings; - gboolean force, burned, def, one_burned = FALSE; - - ssettings = ghb_array_get_nth(subtitle_list, ii); + force = ghb_settings_get_boolean(js, "SubtitleForeignForced"); + burned = ghb_settings_get_boolean(js, "SubtitleForeignBurned"); + def = ghb_settings_get_boolean(js, "SubtitleForeignDefaultTrack"); - subtitle = ghb_settings_get_int(ssettings, "SubtitleTrack"); - force = ghb_settings_get_boolean(ssettings, "SubtitleForced"); - burned = ghb_settings_get_boolean(ssettings, "SubtitleBurned"); - def = ghb_settings_get_boolean(ssettings, "SubtitleDefaultTrack"); - - if (subtitle == -1) + if (burned || job->mux != HB_MUX_MP4) { if (!burned && job->mux == HB_MUX_MKV) { job->select_subtitle_config.dest = PASSTHRUSUB; } - else if (!burned && job->mux == HB_MUX_MP4) - { - // Skip any non-burned vobsubs when output is mp4 - continue; - } - else - { - // Only allow one subtitle to be burned into the video - if (one_burned) - continue; + if (burned) one_burned = TRUE; - } job->select_subtitle_config.force = force; job->select_subtitle_config.default_track = def; job->indepth_scan = 1; job->select_subtitle = malloc(sizeof(hb_subtitle_t*)); *job->select_subtitle = NULL; } - else if (subtitle >= 0) + } + subtitle_list = ghb_settings_get_value(js, "subtitle_list"); + count = ghb_array_len(subtitle_list); + for (ii = 0; ii < count; ii++) + { + GValue *ssettings; + + ssettings = ghb_array_get_nth(subtitle_list, ii); + + subtitle = ghb_settings_get_int(ssettings, "SubtitleTrack"); + force = ghb_settings_get_boolean(ssettings, "SubtitleForced"); + burned = ghb_settings_get_boolean(ssettings, "SubtitleBurned"); + def = ghb_settings_get_boolean(ssettings, "SubtitleDefaultTrack"); + + if (subtitle >= 0) { hb_subtitle_t * subt; hb_subtitle_config_t sub_config; |