{
// Add settings to the queue
GValue *settings;
+ gint titleindex;
+ gint titlenum;
g_debug("queue_add ()");
if (!validate_settings(ud))
settings = ghb_value_dup(ud->settings);
ghb_settings_set_int(settings, "job_status", GHB_QUEUE_PENDING);
ghb_settings_set_int(settings, "job_unique_id", 0);
+ titleindex = ghb_settings_get_int(settings, "title");
+ titlenum = ghb_get_title_number(titleindex);
+ ghb_settings_set_int(settings, "titlenum", titlenum);
ghb_array_append(ud->queue, settings);
add_to_queue_list(ud, settings);
ghb_save_queue(ud->queue);
queue_scan(GValue *js)
{
gchar *path;
- gint titleindex;
+ gint titlenum;
path = ghb_settings_get_string( js, "source");
- titleindex = ghb_settings_get_int(js, "title");
- ghb_backend_queue_scan(path, titleindex+1);
+ titlenum = ghb_settings_get_int(js, "titlenum");
+ ghb_backend_queue_scan(path, titlenum);
g_free(path);
}
del_tree(dir, !partial);
}
+gint
+ghb_get_title_number(gint titleindex)
+{
+ hb_list_t * list;
+ hb_title_t * title;
+ hb_audio_config_t *audio = NULL;
+
+ if (h_scan == NULL) return 1;
+ list = hb_get_titles( h_scan );
+ if( !hb_list_count( list ) )
+ {
+ /* No valid title, stop right there */
+ return NULL;
+ }
+ title = hb_list_item( list, titleindex );
+ if (title == NULL) return 1; // Bad titleindex
+ return title->index;
+}
+
static hb_audio_config_t*
get_hb_audio(gint titleindex, gint track)
{
}
void
-ghb_backend_queue_scan(const gchar *path, gint titleindex)
+ghb_backend_queue_scan(const gchar *path, gint titlenum)
{
g_debug("ghb_backend_queue_scan()");
- hb_scan( h_queue, path, titleindex );
+ hb_scan( h_queue, path, titlenum );
hb_status.queue_state |= GHB_STATE_SCANNING;
}
gint titleindex, gint index, GValue *settings, gboolean borders);
gint ghb_calculate_target_bitrate(GValue *settings, gint titleindex);
gchar* ghb_dvd_volname(const gchar *device);
+gint ghb_get_title_number(gint titleindex);
gint ghb_guess_bitrate(GValue *settings);
gboolean ghb_validate_container(signal_user_data_t *ud);