diff options
author | jstebbins <[email protected]> | 2009-06-23 20:00:55 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-23 20:00:55 +0000 |
commit | 255282062759e163c37e829e423f74e3e92293b8 (patch) | |
tree | 785537a7217e18cc5a751ca69497c33178246187 | |
parent | 75545419c8d15ac244cfde51c96228870794e588 (diff) |
LinGui: add subtitle list to queue display
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2605 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/callbacks.c | 2 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 1 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 52 | ||||
-rw-r--r-- | gtk/src/subtitlehandler.c | 60 |
4 files changed, 86 insertions, 29 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 0267d2ef8..bf44181e6 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2976,7 +2976,7 @@ ghb_file_menu_add_dvd(signal_user_data_t *ud) static GtkActionGroup *agroup = NULL; static gint merge_id; - g_debug("ghb_file_menu_add_dvd()\n"); + g_debug("ghb_file_menu_add_dvd()"); link = drives = dvd_device_list(); if (drives != NULL) { diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 1627fb3fa..9bc771a78 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -5756,6 +5756,7 @@ libmpeg2 authors: Brion Vibber Martin Vogt Fredrik Vraalsen + libogg authors: Christopher Montgomery diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 4dc683df3..22b2c25e4 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -406,15 +406,61 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) } track = ghb_settings_get_string(asettings, "AudioTrackDescription"); mix = ghb_settings_combo_option(asettings, "AudioMixdown"); + if (count == 1) + g_string_append_printf(str, "<b>Audio:</b>"); + else if (ii == 0) + g_string_append_printf(str, "<b>Audio:</b>\n"); + if (count != 1) + g_string_append_printf(str, "\t"); + g_string_append_printf(str, - "<b>Audio:</b><small> %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s</small>", + "<small> %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s</small>\n", track, acodec, mix, samplerate, bitrate); - if (ii < count-1) - g_string_append_printf(str, "\n"); g_free(track); g_free(bitrate); g_free(samplerate); } + + // Add the audios + const GValue *sub_list; + + sub_list = ghb_settings_get_value(settings, "subtitle_list"); + count = ghb_array_len(sub_list); + for (ii = 0; ii < count; ii++) + { + GValue *settings; + gchar *track; + gboolean force, burn, def; + gint source; + + settings = ghb_array_get_nth(sub_list, ii); + track = ghb_settings_get_string(settings, "SubtitleTrackDescription"); + source = ghb_settings_get_int(settings, "SubtitleSource"); + force = ghb_settings_get_boolean(settings, "SubtitleForced"); + burn = ghb_settings_get_boolean(settings, "SubtitleBurned"); + def = ghb_settings_get_boolean(settings, "SubtitleDefaultTrack"); + if (count == 1) + g_string_append_printf(str, "<b>Subtitle:</b>"); + else if (ii == 0) + g_string_append_printf(str, "<b>Subtitles:</b>\n"); + if (count != 1) + g_string_append_printf(str, "\t"); + + if (source != SRTSUB) + { + g_string_append_printf(str, + "<small> %s%s%s%s</small>", + track, + force ? " (Force)":"", + burn ? " (Burn)":"", + def ? " (Default)":"" + ); + } + if (ii < count-1) + g_string_append_printf(str, "\n"); + g_free(track); + } + info = g_string_free(str, FALSE); gtk_tree_store_append(store, &citer, &iter); gtk_tree_store_set(store, &citer, 1, info, -1); diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c index fd7c52c6b..31fa40605 100644 --- a/gtk/src/subtitlehandler.c +++ b/gtk/src/subtitlehandler.c @@ -129,10 +129,20 @@ ghb_add_subtitle(signal_user_data_t *ud, GValue *settings) GValue *subtitle_list; gint count; gboolean burned; + const gchar *track; + gint tt, source; g_debug("ghb_add_subtitle ()"); - // Only allow up to 8 subtitle entries + // Add the long track description so the queue can access it + // when a different title is selected. + track = ghb_settings_combo_option(settings, "SubtitleTrack"); + ghb_settings_set_string(settings, "SubtitleTrackDescription", track); + + tt = ghb_settings_get_int(settings, "SubtitleTrack"); + source = ghb_subtitle_track_source(ud, tt); + ghb_settings_set_int(settings, "SubtitleSource", source); + subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list"); if (subtitle_list == NULL) { @@ -140,12 +150,27 @@ ghb_add_subtitle(signal_user_data_t *ud, GValue *settings) ghb_settings_set_value(ud->settings, "subtitle_list", subtitle_list); } count = ghb_array_len(subtitle_list); + + // Don't allow more than 99 + // This is a had limit imposed by libhb/sync.c:GetFifoForId() + if (count >= 99) + { + ghb_value_free(settings); + return; + } + ghb_array_append(subtitle_list, settings); add_to_subtitle_list(ud, settings); burned = ghb_settings_get_boolean(settings, "SubtitleBurned"); if (burned) ghb_subtitle_exclusive_burn(ud, count); + if (count == 98) + { + GtkWidget *widget; + widget = GHB_WIDGET (ud->builder, "subtitle_add"); + gtk_widget_set_sensitive(widget, FALSE); + } } static void @@ -584,8 +609,16 @@ subtitle_track_changed_cb(GtkWidget *widget, signal_user_data_t *ud) settings = ghb_selected_subtitle_settings(ud); if (settings != NULL) { + const gchar *track; + gint tt, source; + ghb_widget_to_setting(settings, widget); subtitle_list_refresh_selected(ud); + track = ghb_settings_combo_option(settings, "SubtitleTrack"); + ghb_settings_set_string(settings, "SubtitleTrackDescription", track); + tt = ghb_settings_get_int(settings, "SubtitleTrack"); + source = ghb_subtitle_track_source(ud, tt); + ghb_settings_set_int(settings, "SubtitleSource", source); } ghb_live_reset(ud); } @@ -679,26 +712,12 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { // Add the current subtitle settings to the list. GValue *settings; - gint count; - GValue *subtitle_list; gboolean burned = FALSE; gint track; g_debug("subtitle_add_clicked_cb ()"); - subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list"); - if (subtitle_list == NULL) - { - subtitle_list = ghb_array_value_new(8); - ghb_settings_set_value(ud->settings, "subtitle_list", subtitle_list); - } - count = ghb_array_len(subtitle_list); - // Don't allow more than 99 - // This is a had limit imposed by libhb/sync.c:GetFifoForId() - if (count >= 99) - return; track = ghb_settings_get_int(ud->settings, "SubtitleTrack"); - if (mustBurn(ud, track)) { burned = TRUE; @@ -712,16 +731,7 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) ghb_settings_take_value(settings, "SubtitleDefaultTrack", ghb_boolean_value_new(FALSE)); - ghb_array_append(subtitle_list, settings); - add_to_subtitle_list(ud, settings); - if (burned) - ghb_subtitle_exclusive_burn(ud, count); - if (count == 98) - { - GtkWidget *widget; - widget = GHB_WIDGET (ud->builder, "subtitle_add"); - gtk_widget_set_sensitive(widget, FALSE); - } + ghb_add_subtitle(ud, settings); } G_MODULE_EXPORT void |