/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* callbacks.c
- * Copyright (C) John Stebbins 2008 <stebbins@stebbins>
+ * Copyright (C) John Stebbins 2008-2011 <stebbins@stebbins>
*
* callbacks.c is free software.
*
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;
+ gchar *escape, *escape2;
g_debug("update_queue_list ()");
if (settings == NULL) return;
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);
+ escape2 = g_markup_escape_text(vol_name, -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,
+ escape2, title, points, start_point, end_point,
pass2 ? 2:1, pass2 ? "Passes":"Pass", escape
);
g_free(basename);
g_free(escape);
+ g_free(escape2);
if (piter)
iter = *piter;
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)
gchar *bitrate, *samplerate, *track;
const gchar *acodec, *mix;
GValue *asettings;
+ gdouble sr;
asettings = ghb_array_get_nth(audio_list, ii);
- acodec = ghb_settings_combo_option(asettings, "AudioEncoder");
+ acodec = ghb_settings_combo_option(asettings, "AudioEncoderActual");
bitrate = ghb_settings_get_string(asettings, "AudioBitrate");
+ sr = ghb_settings_get_double(asettings, "AudioSamplerate");
samplerate = ghb_settings_get_string(asettings, "AudioSamplerate");
- if (strcmp("source", samplerate) == 0)
+ if ((int)sr == 0)
{
- g_free(samplerate);
samplerate = g_strdup("Same As Source");
}
+ else
+ {
+ samplerate = g_strdup_printf("%.4g", sr);
+ }
track = ghb_settings_get_string(asettings, "AudioTrackDescription");
mix = ghb_settings_combo_option(asettings, "AudioMixdown");
if (count == 1)
do
{
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;
+ gchar *s_drc;
+ gint itrack;
+ gdouble drc;
GValue *asettings;
audio_list = ghb_settings_get_value(ud->settings, "audio_list");
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");
+ codec = ghb_settings_combo_option(asettings, "AudioEncoderActual");
br = ghb_settings_combo_option(asettings, "AudioBitrate");
sr = ghb_settings_combo_option(asettings, "AudioSamplerate");
mix = ghb_settings_combo_option(asettings, "AudioMixdown");
- s_track = ghb_settings_get_string(asettings, "AudioTrack");
- s_codec = ghb_settings_get_string(asettings, "AudioEncoder");
- s_br = ghb_settings_get_string(asettings, "AudioBitrate");
- 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 < 1.0)
- drc = g_strdup("Off");
+ drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider");
+ if (drc < 1.0)
+ s_drc = g_strdup("Off");
else
- drc = g_strdup_printf("%.1f", s_drc);
-
- if (icodec == HB_ACODEC_MASK)
- codec = ghb_select_audio_codec_str(ud, itrack);
+ s_drc = g_strdup_printf("%.1f", drc);
gtk_list_store_set(GTK_LIST_STORE(store), &iter,
// These are displayed in list
2, br,
3, sr,
4, mix,
- 5, drc,
- // These are used to set combo values when an item is selected
- 6, s_track,
- 7, s_codec,
- 8, s_br,
- 9, s_sr,
- 10, s_mix,
- 11, s_drc,
+ 5, s_drc,
-1);
- g_free(drc);
- g_free(s_track);
- g_free(s_codec);
- g_free(s_br);
- g_free(s_sr);
- g_free(s_mix);
+ g_free(s_drc);
done = !gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
row++;
} while (!done);
scan_state = ghb_get_scan_state();
show_stop = queue_state &
- (GHB_STATE_WORKING | GHB_STATE_SCANNING | GHB_STATE_MUXING);
+ (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_add");
+ gtk_widget_set_sensitive(widget, show_start);
+ action = GHB_ACTION(ud->builder, "queue_add_menu");
+ gtk_action_set_sensitive(action, show_start);
+
widget = GHB_WIDGET (ud->builder, "queue_start1");
if (show_stop)
{
gint state;
state = ghb_get_queue_state();
- if (state & (GHB_STATE_WORKING | GHB_STATE_SCANNING | GHB_STATE_MUXING))
+ 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?");
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(
add_to_queue_list(ud, settings, NULL);
}
ghb_queue_buttons_grey(ud);
+ ghb_save_queue(ud->queue);
}
else
{
ghb_value_free(queue);
- ghb_remove_queue_file();
}
g_free(message);
}