diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-07-16 10:20:58 +0200 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-07-16 10:20:58 +0200 | 
| commit | 0d9b56ff5bbc3b263bb24d60a5d53e09e2785532 (patch) | |
| tree | be9cd87ce9f41713ed2710b9b424861155a43f33 /src/scanner.vala | |
| parent | 6c629d45711b613257d30e8d5a1527003d9c3f1f (diff) | |
| parent | 657d8b8812f16b2c377e5b77ff2ffcc4046a7dce (diff) | |
Updated version 3.25.1 from 'upstream/3.25.1'
with Debian dir 8914d0848d9107f42ab3763c541ef1480cee0f27
Diffstat (limited to 'src/scanner.vala')
| -rw-r--r-- | src/scanner.vala | 18 | 
1 files changed, 14 insertions, 4 deletions
| diff --git a/src/scanner.vala b/src/scanner.vala index 16f33cf..f98b4b6 100644 --- a/src/scanner.vala +++ b/src/scanner.vala @@ -69,7 +69,8 @@ public enum ScanType      SINGLE,      ADF_FRONT,      ADF_BACK, -    ADF_BOTH +    ADF_BOTH, +    BATCH  }  public class ScanOptions @@ -82,6 +83,7 @@ public class ScanOptions      public int paper_height;      public int brightness;      public int contrast; +    public int page_delay;  }  private class ScanJob @@ -96,6 +98,7 @@ private class ScanJob      public int page_height;      public int brightness;      public int contrast; +    public int page_delay;  }  private class Request {} @@ -945,6 +948,7 @@ public class Scanner                  switch (job.type)                  {                  case ScanType.SINGLE: +                case ScanType.BATCH:                      if (!set_default_option (handle, option, index))                          if (!set_constrained_string_option (handle, option, index, flatbed_sources, null))                              warning ("Unable to set single page source, please file a bug"); @@ -1040,7 +1044,7 @@ public class Scanner              if (option != null)              {                  if (option.type == Sane.ValueType.BOOL) -                    set_bool_option (handle, option, index, job.type != ScanType.SINGLE, null); +                    set_bool_option (handle, option, index, (job.type != ScanType.SINGLE) && (job.type != ScanType.BATCH), null);              }              /* Disable compression, we will compress after scanning */ @@ -1291,6 +1295,9 @@ public class Scanner          /* Go back for another page */          if (job.type != ScanType.SINGLE)          { +            if (job.type == ScanType.BATCH) +                Thread.usleep (job.page_delay * 1000); +              page_number++;              pass_number = 0;              notify (new NotifyPageDone (job.id)); @@ -1550,6 +1557,8 @@ public class Scanner              return "ScanType.ADF_BACK";          case ScanType.ADF_BOTH:              return "ScanType.ADF_BOTH"; +        case ScanType.BATCH: +            return "ScanType.BATCH";          default:              return "%d".printf (type);          } @@ -1557,10 +1566,10 @@ public class Scanner      public void scan (string? device, ScanOptions options)      { -        debug ("Scanner.scan (\"%s\", dpi=%d, scan_mode=%s, depth=%d, type=%s, paper_width=%d, paper_height=%d, brightness=%d, contrast=%d)", +        debug ("Scanner.scan (\"%s\", dpi=%d, scan_mode=%s, depth=%d, type=%s, paper_width=%d, paper_height=%d, brightness=%d, contrast=%d, delay=%dms)",                 device != null ? device : "(null)", options.dpi, get_scan_mode_string (options.scan_mode), options.depth,                 get_scan_type_string (options.type), options.paper_width, options.paper_height, -               options.brightness, options.contrast); +               options.brightness, options.contrast, options.page_delay);          var request = new RequestStartScan ();          request.job = new ScanJob ();          request.job.id = job_id++; @@ -1573,6 +1582,7 @@ public class Scanner          request.job.page_height = options.paper_height;          request.job.brightness = options.brightness;          request.job.contrast = options.contrast; +        request.job.page_delay = options.page_delay;          request_queue.push (request);      } | 
