summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-03-01 10:14:00 +0000
committerjstebbins <[email protected]>2013-03-01 10:14:00 +0000
commit6039fc23819d1e9e8b5b7440ce6a156a6c46094d (patch)
tree1d6e2d36af8b8229f98bef66006186ecf58ce100 /gtk
parenta1a0e0e715d31badf58e3a43c02906b994587c90 (diff)
Improve scan progress granularity
We were only updating progress after completely processing each title. Now progress is updated as we generate previews as well. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5276 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c12
-rw-r--r--gtk/src/hb-backend.c9
-rw-r--r--gtk/src/hb-backend.h2
-rw-r--r--gtk/src/main.c2
4 files changed, 21 insertions, 4 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index eb98553e3..6e494f26e 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -2826,15 +2826,21 @@ ghb_backend_events(signal_user_data_t *ud)
}
else
{
- status_str = g_strdup_printf ("Scanning title %d of %d...",
+ if (status.scan.preview_cur == 0)
+ status_str = g_strdup_printf("Scanning title %d of %d...",
status.scan.title_cur, status.scan.title_count );
+ else
+ status_str = g_strdup_printf(
+ "Scanning title %d of %d preview %d...",
+ status.scan.title_cur, status.scan.title_count,
+ status.scan.preview_cur);
+
}
gtk_label_set_text (label, status_str);
g_free(status_str);
if (status.scan.title_count > 0)
{
- gtk_progress_bar_set_fraction (scan_prog,
- (gdouble)status.scan.title_cur / status.scan.title_count);
+ gtk_progress_bar_set_fraction (scan_prog, status.scan.progress);
}
}
else if (status.scan.state & GHB_STATE_SCANDONE)
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index bdd53c959..689c3b7e0 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -3495,6 +3495,9 @@ ghb_backend_scan(const gchar *path, gint titleindex, gint preview_count, uint64_
// when computing progress
hb_status.scan.title_count = 1;
hb_status.scan.title_cur = 0;
+ hb_status.scan.preview_count = 1;
+ hb_status.scan.preview_cur = 0;
+ hb_status.scan.progress = 0;
}
void
@@ -3563,6 +3566,9 @@ ghb_track_status()
hb_status.scan.state |= GHB_STATE_SCANNING;
hb_status.scan.title_count = p.title_count;
hb_status.scan.title_cur = p.title_cur;
+ hb_status.scan.preview_count = p.preview_count;
+ hb_status.scan.preview_cur = p.preview_cur;
+ hb_status.scan.progress = p.progress;
} break;
#undef p
@@ -3637,6 +3643,9 @@ ghb_track_status()
hb_status.queue.state |= GHB_STATE_SCANNING;
hb_status.queue.title_count = p.title_count;
hb_status.queue.title_cur = p.title_cur;
+ hb_status.queue.preview_count = p.preview_count;
+ hb_status.queue.preview_cur = p.preview_cur;
+ hb_status.queue.progress = p.progress;
} break;
#undef p
diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h
index e07bcb4cc..242a3e3b7 100644
--- a/gtk/src/hb-backend.h
+++ b/gtk/src/hb-backend.h
@@ -34,6 +34,8 @@ typedef struct
// SCANNING
gint title_count;
gint title_cur;
+ gint preview_count;
+ gint preview_cur;
// WORKING
gint unique_id;
diff --git a/gtk/src/main.c b/gtk/src/main.c
index 9f3dc8b24..b990ec0c4 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -1082,7 +1082,7 @@ main(int argc, char *argv[])
g_idle_add((GSourceFunc)ghb_reload_queue, ud);
// Start timer for monitoring libhb status, 500ms
- g_timeout_add(500, ghb_timer_cb, (gpointer)ud);
+ g_timeout_add(200, ghb_timer_cb, (gpointer)ud);
// Add dvd devices to File menu
ghb_volname_cache_init();