diff --git a/NTwain/Data/TwainValues.cs b/NTwain/Data/TwainValues.cs index 6fa7c37..11d599d 100644 --- a/NTwain/Data/TwainValues.cs +++ b/NTwain/Data/TwainValues.cs @@ -2056,7 +2056,20 @@ namespace NTwain.Data Constrainable = 0x40, GetHelp = 0x100, GetLabel = 0x200, - GetLabelEnum = 0x400 + GetLabelEnum = 0x400, + + /// + /// Cap applies to entire session/machine. + /// + Machine = 0x1000, + /// + /// Cap applies to bitonal cameras. + /// + Bitonal = 0x2000, + /// + /// Cap applies to color cameras. + /// + Color = 0x4000 } /// diff --git a/NTwain/TwainSource.cs b/NTwain/TwainSource.cs index 54114a3..6501c21 100644 --- a/NTwain/TwainSource.cs +++ b/NTwain/TwainSource.cs @@ -15,7 +15,7 @@ namespace NTwain /// /// Represents a TWAIN data source. /// - public partial class TwainSource : INotifyPropertyChanged + public partial class TwainSource { ITwainSessionInternal _session; @@ -257,5 +257,46 @@ namespace NTwain } #endregion + + #region cameras + + /// + /// Gets the cameras supported by the source. + /// + /// + public IList GetCameras() + { + TWFileSystem fs = new TWFileSystem(); + List cams = new List(); + var rc = DGControl.FileSystem.GetFirstFile(fs); + while (rc == ReturnCode.Success) + { + switch (fs.FileType) + { + case FileType.Camera: + case FileType.CameraBottom: + case FileType.CameraTop: + case FileType.CameraPreview: + cams.Add(fs.OutputName); + break; + } + rc = DGControl.FileSystem.GetNextFile(fs); + } + return cams; + } + + /// + /// Sets the target camera for cap negotiation that can be set per camera. + /// + /// + /// + public ReturnCode SetCamera(string cameraName) + { + TWFileSystem fs = new TWFileSystem(); + fs.InputName = cameraName; + return DGControl.FileSystem.ChangeDirectory(fs); + } + + #endregion } }