X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=gtk%2Fsrc%2Fqueuehandler.c;h=d47a2aa66b64240d656ed50d234a01d8847eb4de;hb=722be02e829ad969250d1604e57ec8b9846dc060;hp=d928ed7c719107d9d8e5ec5bd9916eda77a3c65f;hpb=4a8e68f3c579df8a2dbb25739f8da08bf847a360;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index d928ed7c..d47a2aa6 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -23,7 +23,7 @@ #include "presets.h" #include "ghb-dvd.h" -void +G_MODULE_EXPORT void queue_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t *ud) { GtkTreeModel *store; @@ -72,7 +72,8 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) gchar *fps, *vcodec_abbr; gint title, start_chapter, end_chapter, width, height; gint source_width, source_height; - gboolean pass2, anamorphic, round_dim, keep_aspect, vqtype, turbo; + gboolean pass2, keep_aspect, vqtype, turbo; + gint pic_par; gboolean tweaks; gchar *escape; @@ -186,23 +187,13 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) width = ghb_settings_get_int(settings, "scale_width"); height = ghb_settings_get_int(settings, "scale_height"); - anamorphic = ghb_settings_get_boolean(settings, "anamorphic"); - round_dim = ghb_settings_get_boolean(settings, "ModDimensions"); + pic_par = ghb_settings_combo_int(settings, "PicturePAR"); keep_aspect = ghb_settings_get_boolean(settings, "PictureKeepRatio"); gchar *aspect_desc; - if (anamorphic) + switch (pic_par) { - if (round_dim) - { - aspect_desc = "(Anamorphic)"; - } - else - { - aspect_desc = "(Strict Anamorphic)"; - } - } - else + case 0: { if (keep_aspect) { @@ -212,6 +203,27 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) { aspect_desc = "(Aspect Lost)"; } + } break; + + case 1: + { + aspect_desc = "(Strict Anamorphic)"; + } break; + + case 2: + { + aspect_desc = "(Loose Anamorphic)"; + } break; + + case 3: + { + aspect_desc = "(Custom Anamorphic)"; + } break; + + default: + { + aspect_desc = "(Unknown)"; + } break; } vqtype = ghb_settings_get_boolean(settings, "vquality_type_constant"); @@ -243,16 +255,8 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) // Constant quality vqvalue = ghb_settings_get_double(settings, "VideoQualitySlider"); vq_desc = "Constant Quality:"; - if (ghb_settings_get_boolean(settings, "directqp")) - { - vqstr = g_strdup_printf("%d", (gint)vqvalue); - vq_units = "(crf)"; - } - else - { - vqstr = g_strdup_printf("%.1f", 100*vqvalue); - vq_units = "%"; - } + vqstr = g_strdup_printf("%d", (gint)vqvalue); + vq_units = "(crf)"; } fps = ghb_settings_get_string(settings, "VideoFramerate"); if (strcmp("source", fps) == 0) @@ -278,19 +282,34 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) "Picture: Source: %d x %d, Output %d x %d %s\n", source_width, source_height, width, height, aspect_desc); - gboolean decomb; + gint decomb, detel; gboolean filters = FALSE; decomb = ghb_settings_combo_int(settings, "PictureDecomb"); g_string_append_printf(str, "Filters:"); - if (ghb_settings_combo_int(settings, "PictureDetelecine")) + detel = ghb_settings_combo_int(settings, "PictureDetelecine"); + if (detel) { g_string_append_printf(str, " - Detelecine"); + if (detel == 1) + { + gchar *cust; + cust = ghb_settings_get_string(settings, "PictureDetelecineCustom"); + g_string_append_printf(str, ": %s", cust); + g_free(cust); + } filters = TRUE; } if (decomb) { g_string_append_printf(str, " - Decomb"); + if (decomb == 1) + { + gchar *cust; + cust = ghb_settings_get_string(settings, "PictureDecombCustom"); + g_string_append_printf(str, ": %s", cust); + g_free(cust); + } filters = TRUE; } else @@ -298,18 +317,38 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace"); if (deint) { - const gchar *opt = ghb_settings_combo_option(settings, + if (deint == 1) + { + gchar *cust = ghb_settings_get_string(settings, + "PictureDeinterlaceCustom"); + g_string_append_printf(str, " - Deinterlace: %s", cust); + g_free(cust); + } + else + { + const gchar *opt = ghb_settings_combo_option(settings, "PictureDeinterlace"); - g_string_append_printf(str, " - Deinterlace: %s", opt); + g_string_append_printf(str, " - Deinterlace: %s", opt); + } filters = TRUE; } } gint denoise = ghb_settings_combo_int(settings, "PictureDenoise"); if (denoise) { - const gchar *opt = ghb_settings_combo_option(settings, + if (denoise == 1) + { + gchar *cust = ghb_settings_get_string(settings, + "PictureDenoiseCustom"); + g_string_append_printf(str, " - Denoise: %s", cust); + g_free(cust); + } + else + { + const gchar *opt = ghb_settings_combo_option(settings, "PictureDenoise"); - g_string_append_printf(str, " - Denoise: %s", opt); + g_string_append_printf(str, " - Denoise: %s", opt); + } filters = TRUE; } gint deblock = ghb_settings_get_int(settings, "PictureDeblock"); @@ -367,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, "Audio:"); + else if (ii == 0) + g_string_append_printf(str, "Audio:\n"); + if (count != 1) + g_string_append_printf(str, "\t"); + g_string_append_printf(str, - "Audio: %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s", + " %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s\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, "Subtitle:"); + else if (ii == 0) + g_string_append_printf(str, "Subtitles:\n"); + if (count != 1) + g_string_append_printf(str, "\t"); + + if (source != SRTSUB) + { + g_string_append_printf(str, + " %s%s%s%s", + 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); @@ -426,7 +511,7 @@ audio_list_refresh(signal_user_data_t *ud) s_sr = ghb_settings_get_string(asettings, "AudioSamplerate"); s_mix = ghb_settings_get_string(asettings, "AudioMixdown"); s_drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider"); - if (s_drc < 0.1) + if (s_drc < 1.0) drc = g_strdup("Off"); else drc = g_strdup_printf("%.1f", s_drc); @@ -511,6 +596,8 @@ validate_settings(signal_user_data_t *ud) g_free(destdir); return FALSE; } +#if !defined(_WIN32) + // This doesn't work properly on windows if (g_access(destdir, R_OK|W_OK) != 0) { message = g_strdup_printf( @@ -523,6 +610,7 @@ validate_settings(signal_user_data_t *ud) g_free(destdir); return FALSE; } +#endif GFile *gfile; GFileInfo *info; guint64 size; @@ -563,7 +651,7 @@ validate_settings(signal_user_data_t *ud) { message = g_strdup_printf( "Destination: %s\n\n" - "File already exhists.\n" + "File already exists.\n" "Do you want to overwrite?", dest); if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, "Cancel", "Overwrite")) @@ -586,6 +674,11 @@ validate_settings(signal_user_data_t *ud) { return FALSE; } + // Validate audio settings + if (!ghb_validate_subtitles(ud)) + { + return FALSE; + } // Validate video settings if (!ghb_validate_video(ud)) { @@ -613,6 +706,7 @@ queue_add(signal_user_data_t *ud) { return FALSE; } + if (ud->queue == NULL) ud->queue = ghb_array_value_new(32); // Make a copy of current settings to be used for the new job @@ -629,14 +723,14 @@ queue_add(signal_user_data_t *ud) return TRUE; } -void +G_MODULE_EXPORT void queue_add_clicked_cb(GtkWidget *widget, signal_user_data_t *ud) { g_debug("queue_add_clicked_cb ()"); queue_add(ud); } -void +G_MODULE_EXPORT void queue_remove_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud) { GtkTreeView *treeview; @@ -716,7 +810,7 @@ find_last_finished(GValue *queue) // handler from expanding rows if you hover over them while // dragging. // Also controls where valid drop locations are -gboolean +G_MODULE_EXPORT gboolean queue_drag_motion_cb( GtkTreeView *tv, GdkDragContext *ctx, @@ -733,6 +827,11 @@ queue_drag_motion_cb( GtkTreeView *srctv; GtkTreeModel *model; GtkTreeSelection *select; + GtkWidget *widget; + + widget = gtk_drag_get_source_widget(ctx); + if (widget == NULL || widget != GTK_WIDGET(tv)) + return TRUE; // This bit checks to see if the source is allowed to be // moved. Only pending and canceled items may be moved. @@ -794,7 +893,7 @@ queue_drag_motion_cb( return TRUE; } -void +G_MODULE_EXPORT void queue_drag_cb( GtkTreeView *dstwidget, GdkDragContext *dc, @@ -928,7 +1027,7 @@ ghb_queue_buttons_grey(signal_user_data_t *ud, gboolean working) gtk_action_set_sensitive (action, working); } -void +G_MODULE_EXPORT void queue_list_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, GtkCellRenderer *cell) { GtkTreeViewColumn *column; @@ -943,7 +1042,7 @@ queue_list_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, GtkCel g_object_set(cell, "wrap-width", width-70, NULL); } -void +G_MODULE_EXPORT void queue_start_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { GValue *js; @@ -979,14 +1078,14 @@ queue_start_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) } } -void +G_MODULE_EXPORT void queue_stop_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { ud->cancel_encode = TRUE; ghb_cancel_encode(NULL); } -void +G_MODULE_EXPORT void queue_pause_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { ghb_pause_queue(); @@ -1004,13 +1103,6 @@ ghb_reload_queue(signal_user_data_t *ud) g_debug("ghb_reload_queue"); - // I really shouldn't have to do this, but at startup the - // initial window size is larger than it should be. This - // make it adjust to the proper size. - GtkWindow *hb_window; - hb_window = GTK_WINDOW(GHB_WIDGET (ud->builder, "hb_window")); - gtk_window_resize(hb_window, 16, 16); - queue = ghb_load_queue(); // Look for unfinished entries count = ghb_array_len(queue); @@ -1069,7 +1161,7 @@ ghb_reload_queue(signal_user_data_t *ud) return FALSE; } -gboolean +G_MODULE_EXPORT gboolean queue_key_press_cb( GtkWidget *widget, GdkEventKey *event, @@ -1132,7 +1224,7 @@ queue_key_press_cb( GValue *ghb_queue_edit_settings = NULL; -void +G_MODULE_EXPORT void queue_edit_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { GtkTreeView *treeview; @@ -1173,7 +1265,7 @@ queue_edit_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) } gchar *source; source = ghb_settings_get_string(ghb_queue_edit_settings, "source"); - ghb_do_scan(ud, source, FALSE); + ghb_do_scan(ud, source, 0, FALSE); g_free(source); } }