From 88d8dbedbab92ec5694f8f39da12e612dc72cb49 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 15 Jun 2006 01:28:00 +0000 Subject: info: display progress when adding async darcs-hash:20060615012854-4e3e3-746ce41e3529fa7177bbe9a516b24bb3b451c229.gz --- emms-info.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/emms-info.el b/emms-info.el index 03a3c81..7e0bfee 100644 --- a/emms-info.el +++ b/emms-info.el @@ -60,6 +60,13 @@ This requires `later-do', which should come with EMMS." :type 'boolean :group 'emms-info) +(defcustom emms-info-report-each-num-tracks 200 + "*Non-zero will report progress information every number of tracks. +The default is to display a message every 200 tracks. +This variable is only used when adding tracks asynchronously." + :type 'integer + :group 'emms-info) + (defcustom emms-info-functions nil "*Functions which add information to tracks. Each is called with a track as argument." @@ -96,9 +103,14 @@ Return t when the track got changed." (when emms-info-asynchronously (setq emms-info-asynchronous-tracks (1- emms-info-asynchronous-tracks)) - (when (zerop emms-info-asynchronous-tracks) - (message "EMMS: All track information loaded."))) - t)) + (if (zerop emms-info-asynchronous-tracks) + (message "EMMS: All track information loaded.") + (unless (zerop emms-info-report-each-num-tracks) + (if (zerop + (mod emms-info-asynchronous-tracks + emms-info-report-each-num-tracks)) + (message "EMMS: %d tracks to go.." + emms-info-asynchronous-tracks))))))) (defun emms-info-track-file-mtime (track) "Return the mtime of the file of TRACK, if any. -- cgit v1.2.3