gchar *dest, *preset, *vol_name, *basename;
const gchar *vcodec, *container;
gchar *fps, *vcodec_abbr;
- gint title, start_chapter, end_chapter, width, height;
+ gint title, start_point, end_point, width, height;
gint source_width, source_height;
- gboolean pass2, keep_aspect, vqtype, turbo;
+ gboolean pass2 = FALSE, keep_aspect, vqtype, turbo;
gint pic_par;
gboolean tweaks;
gchar *escape;
tweaks = ghb_settings_get_boolean(settings, "allow_tweaks");
title = ghb_settings_get_int(settings, "titlenum");
- start_chapter = ghb_settings_get_int(settings, "start_chapter");
- end_chapter = ghb_settings_get_int(settings, "end_chapter");
- pass2 = ghb_settings_get_boolean(settings, "VideoTwoPass");
+ start_point = ghb_settings_get_int(settings, "start_point");
+ end_point = ghb_settings_get_int(settings, "end_point");
vol_name = ghb_settings_get_string(settings, "volume_label");
dest = ghb_settings_get_string(settings, "destination");
basename = g_path_get_basename(dest);
escape = g_markup_escape_text(basename, -1);
+
+ vqtype = ghb_settings_get_boolean(settings, "vquality_type_constant");
+ if (!vqtype)
+ pass2 = ghb_settings_get_boolean(settings, "VideoTwoPass");
+ const gchar *points = "Chapters";
+ if (ghb_settings_combo_int(settings, "PtoPType") == 0)
+ points = "Chapters";
+ else if (ghb_settings_combo_int(settings, "PtoPType") == 1)
+ points = "Seconds";
+ else if (ghb_settings_combo_int(settings, "PtoPType") == 2)
+ points = "Frames";
info = g_strdup_printf
(
"<big><b>%s</b></big> "
- "<small>(Title %d, Chapters %d through %d, %d Video %s)"
+ "<small>(Title %d, %s %d through %d, %d Video %s)"
" --> %s</small>",
- vol_name, title, start_chapter, end_chapter,
+ vol_name, title, points, start_point, end_point,
pass2 ? 2:1, pass2 ? "Passes":"Pass", escape
);
g_free(basename);
vqvalue = ghb_settings_get_double(settings, "VideoQualitySlider");
vq_desc = "Constant Quality:";
vqstr = g_strdup_printf("%d", (gint)vqvalue);
- vq_units = "(crf)";
+ vq_units = "(RF)";
}
fps = ghb_settings_get_string(settings, "VideoFramerate");
if (strcmp("source", fps) == 0)
source_width, source_height, width, height, aspect_desc);
gint decomb, detel;
+ gboolean decomb_deint;
gboolean filters = FALSE;
+ decomb_deint = ghb_settings_get_boolean(settings, "PictureDecombDeinterlace");
decomb = ghb_settings_combo_int(settings, "PictureDecomb");
g_string_append_printf(str, "<b>Filters:</b><small>");
detel = ghb_settings_combo_int(settings, "PictureDetelecine");
}
filters = TRUE;
}
- if (decomb)
+ if (decomb_deint && decomb)
{
g_string_append_printf(str, " - Decomb");
if (decomb == 1)
}
filters = TRUE;
}
- else
+ else if (!decomb_deint)
{
gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace");
if (deint)
{
const gchar *track, *codec, *br, *sr, *mix;
gchar *drc, *s_track, *s_codec, *s_br, *s_sr, *s_mix;
+ gint itrack, icodec;
gdouble s_drc;
GValue *asettings;
asettings = ghb_array_get_nth(audio_list, row);
track = ghb_settings_combo_option(asettings, "AudioTrack");
+ itrack = ghb_settings_combo_int(asettings, "AudioTrack");
codec = ghb_settings_combo_option(asettings, "AudioEncoder");
+ icodec = ghb_settings_combo_int(asettings, "AudioEncoder");
br = ghb_settings_combo_option(asettings, "AudioBitrate");
sr = ghb_settings_combo_option(asettings, "AudioSamplerate");
mix = ghb_settings_combo_option(asettings, "AudioMixdown");
else
drc = g_strdup_printf("%.1f", s_drc);
+ if (icodec == HB_ACODEC_MASK)
+ codec = ghb_select_audio_codec_str(ud, itrack);
+
gtk_list_store_set(GTK_LIST_STORE(store), &iter,
// These are displayed in list
0, track,
ghb_array_append(ud->queue, settings);
add_to_queue_list(ud, settings, NULL);
ghb_save_queue(ud->queue);
+ ghb_update_pending(ud);
return TRUE;
}
if (status == GHB_QUEUE_RUNNING)
{
// Ask if wants to stop encode.
- if (!ghb_cancel_encode(NULL))
+ if (!ghb_cancel_encode2(ud, NULL))
{
return;
}
{
gtk_tree_path_free (treepath);
}
+ ghb_update_pending(ud);
}
static gint
}
void
-ghb_queue_buttons_grey(signal_user_data_t *ud, gboolean working)
+ghb_queue_buttons_grey(signal_user_data_t *ud)
{
GtkWidget *widget;
GtkAction *action;
gint queue_count;
gint titleindex;
- gboolean title_ok;
+ gint queue_state, scan_state;
+ gboolean show_start, show_stop, paused;
queue_count = ghb_array_len(ud->queue);
titleindex = ghb_settings_combo_int(ud->settings, "title");
- title_ok = (titleindex >= 0);
+
+ queue_state = ghb_get_queue_state();
+ scan_state = ghb_get_scan_state();
+
+ show_stop = queue_state &
+ (GHB_STATE_WORKING | GHB_STATE_SEARCHING |
+ GHB_STATE_SCANNING | GHB_STATE_MUXING);
+ show_start = !(scan_state & GHB_STATE_SCANNING) &&
+ (titleindex >= 0 || queue_count > 0);
+
+
+ paused = queue_state & GHB_STATE_PAUSED;
widget = GHB_WIDGET (ud->builder, "queue_start1");
- gtk_widget_set_sensitive (widget, !working && (title_ok || queue_count));
+ if (show_stop)
+ {
+ gtk_widget_set_sensitive (widget, TRUE);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-stop");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Stop");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Stop Encoding");
+ }
+ else
+ {
+ gtk_widget_set_sensitive (widget, show_start);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-play");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Start");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Start Encoding");
+ }
widget = GHB_WIDGET (ud->builder, "queue_start2");
- gtk_widget_set_sensitive (widget, !working && (title_ok || queue_count));
- action = GHB_ACTION (ud->builder, "queue_start_menu");
- gtk_action_set_sensitive (action, !working && (title_ok || queue_count));
+ if (show_stop)
+ {
+ gtk_widget_set_sensitive (widget, TRUE);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-stop");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Stop");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Stop Encoding");
+ }
+ else
+ {
+ gtk_widget_set_sensitive (widget, show_start);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-play");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Start");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Start Encoding");
+ }
widget = GHB_WIDGET (ud->builder, "queue_pause1");
- gtk_widget_set_sensitive (widget, working);
+ if (paused)
+ {
+ gtk_widget_set_sensitive (widget, show_stop);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-play");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Resume");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Resume Encoding");
+ }
+ else
+ {
+ gtk_widget_set_sensitive (widget, show_stop);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-pause");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Pause");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Pause Encoding");
+ }
widget = GHB_WIDGET (ud->builder, "queue_pause2");
- gtk_widget_set_sensitive (widget, working);
+ if (paused)
+ {
+ gtk_widget_set_sensitive (widget, show_stop);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-play");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Resume");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Resume Encoding");
+ }
+ else
+ {
+ gtk_widget_set_sensitive (widget, show_stop);
+ gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(widget), "hb-pause");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(widget), "Pause");
+ gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(widget), "Pause Encoding");
+ }
+
+ action = GHB_ACTION (ud->builder, "queue_start_menu");
+ if (show_stop)
+ {
+ gtk_action_set_sensitive (action, TRUE);
+#if GTK_CHECK_VERSION(2, 16, 0)
+ gtk_action_set_icon_name(action, "hb-stop");
+ gtk_action_set_label(action, "S_top Queue");
+ gtk_action_set_tooltip(action, "Stop Encoding");
+#else
+ g_object_set_property(G_OBJECT(action), "icon-name",
+ ghb_string_value("hb-stop"));
+ g_object_set_property(G_OBJECT(action), "label",
+ ghb_string_value("S_top Queue"));
+ g_object_set_property(G_OBJECT(action), "tooltip",
+ ghb_string_value("Stop Encoding"));
+#endif
+ }
+ else
+ {
+ gtk_action_set_sensitive (action, show_start);
+#if GTK_CHECK_VERSION(2, 16, 0)
+ gtk_action_set_icon_name(action, "hb-play");
+ gtk_action_set_label(action, "_Start Queue");
+ gtk_action_set_tooltip(action, "Start Encoding");
+#else
+ g_object_set_property(G_OBJECT(action), "icon-name",
+ ghb_string_value("hb-play"));
+ g_object_set_property(G_OBJECT(action), "label",
+ ghb_string_value("_Start Queue"));
+ g_object_set_property(G_OBJECT(action), "tooltip",
+ ghb_string_value("Start Encoding"));
+#endif
+ }
action = GHB_ACTION (ud->builder, "queue_pause_menu");
- gtk_action_set_sensitive (action, working);
- widget = GHB_WIDGET (ud->builder, "queue_stop");
- gtk_widget_set_sensitive (widget, working);
- action = GHB_ACTION (ud->builder, "queue_stop_menu");
- gtk_action_set_sensitive (action, working);
+ if (paused)
+ {
+ gtk_action_set_sensitive (action, show_start);
+#if GTK_CHECK_VERSION(2, 16, 0)
+ gtk_action_set_icon_name(action, "hb-play");
+ gtk_action_set_label(action, "_Resume Queue");
+ gtk_action_set_tooltip(action, "Resume Encoding");
+#else
+ g_object_set_property(G_OBJECT(action), "icon-name",
+ ghb_string_value("hb-play"));
+ g_object_set_property(G_OBJECT(action), "label",
+ ghb_string_value("_Resume Queue"));
+ g_object_set_property(G_OBJECT(action), "tooltip",
+ ghb_string_value("Resume Encoding"));
+#endif
+ }
+ else
+ {
+ gtk_action_set_sensitive (action, show_stop);
+#if GTK_CHECK_VERSION(2, 16, 0)
+ gtk_action_set_icon_name(action, "hb-pause");
+ gtk_action_set_label(action, "_Pause Queue");
+ gtk_action_set_tooltip(action, "Pause Encoding");
+#else
+ g_object_set_property(G_OBJECT(action), "icon-name",
+ ghb_string_value("hb-pause"));
+ g_object_set_property(G_OBJECT(action), "label",
+ ghb_string_value("_Pause Queue"));
+ g_object_set_property(G_OBJECT(action), "tooltip",
+ ghb_string_value("Pause Encoding"));
+#endif
+ }
}
G_MODULE_EXPORT void
gint status;
gint state;
+ state = ghb_get_queue_state();
+ if (state & (GHB_STATE_WORKING | GHB_STATE_SEARCHING |
+ GHB_STATE_SCANNING | GHB_STATE_MUXING))
+ {
+ ghb_cancel_encode(ud, "You are currently encoding. "
+ "What would you like to do?");
+ return;
+ }
+
count = ghb_array_len(ud->queue);
for (ii = 0; ii < count; ii++)
{
if (!queue_add(ud))
return;
}
- state = ghb_get_queue_state();
if (state == GHB_STATE_IDLE)
{
// Add the first pending queue item and start
}
G_MODULE_EXPORT void
-queue_stop_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
-{
- ud->cancel_encode = TRUE;
- ghb_cancel_encode(NULL);
-}
-
-G_MODULE_EXPORT void
queue_pause_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
ghb_pause_queue();
GValue *queue;
gint unfinished = 0;
gint count, ii;
+ gint pid;
gint status;
GValue *settings;
gchar *message;
g_debug("ghb_reload_queue");
- queue = ghb_load_queue();
+find_pid:
+ pid = ghb_find_pid_file();
+ if (pid < 0)
+ return FALSE;
+
+ queue = ghb_load_old_queue(pid);
+ ghb_remove_old_queue_file(pid);
// Look for unfinished entries
count = ghb_array_len(queue);
for (ii = 0; ii < count; ii++)
unfinished++;
}
}
+ if (!unfinished)
+ goto find_pid;
+
if (unfinished)
{
message = g_strdup_printf(
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "queue_window");
gtk_widget_show (widget);
+ widget = GHB_WIDGET (ud->builder, "show_queue");
+ gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), TRUE);
ud->queue = queue;
// First get rid of any old items we don't want
ghb_settings_set_int(settings, "job_status", GHB_QUEUE_PENDING);
add_to_queue_list(ud, settings, NULL);
}
- ghb_queue_buttons_grey(ud, FALSE);
+ ghb_queue_buttons_grey(ud);
+ ghb_save_queue(ud->queue);
}
else
{
ghb_value_free(queue);
- ghb_remove_queue_file();
}
g_free(message);
}
if (status == GHB_QUEUE_RUNNING)
{
// Ask if wants to stop encode.
- if (!ghb_cancel_encode(NULL))
+ if (!ghb_cancel_encode2(ud, NULL))
{
return TRUE;
}
// Remove the corresponding item from the queue list
ghb_array_remove(ud->queue, row);
}
+ else
+ {
+ ghb_queue_edit_settings = ghb_value_dup(ghb_queue_edit_settings);
+ }
gchar *source;
source = ghb_settings_get_string(ghb_queue_edit_settings, "source");
ghb_do_scan(ud, source, 0, FALSE);