[simple-scan] Support non-standard Epson ADF scanner options



commit b230d9e0a13663aa7f16f325faed3228eb8ae258
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Jan 28 11:08:15 2019 +1300

    Support non-standard Epson ADF scanner options
    
    Fixes #80

 src/scanner.vala | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
---
diff --git a/src/scanner.vala b/src/scanner.vala
index d0e02f6..d69fc62 100644
--- a/src/scanner.vala
+++ b/src/scanner.vala
@@ -1039,6 +1039,30 @@ public class Scanner
                     set_bool_option (handle, option, index, job.type == ScanType.ADF_BOTH, null);
             }
 
+            /* Non-standard Epson GT-S50 ADF options */
+            option = get_option_by_name (handle, "adf-mode", out index);
+            if (option != null)
+            {
+                string[] adf_simplex_modes =
+                {
+                    "Simplex"
+                };
+                string[] adf_duplex_modes =
+                {
+                    "Duplex"
+                };
+                if (job.type == ScanType.ADF_BOTH)
+                    set_constrained_string_option (handle, option, index, adf_duplex_modes, null);
+                else
+                    set_constrained_string_option (handle, option, index, adf_simplex_modes, null);
+            }
+            option = get_option_by_name (handle, "adf-auto-scan", out index);
+            if (option != null)
+            {
+                if (option.type == Sane.ValueType.BOOL)
+                    set_bool_option (handle, option, index, true, null);
+            }
+
             /* Multi-page options */
             option = get_option_by_name (handle, "batch-scan", out index);
             if (option != null)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]