public static bool Init() { if (_Webcam != null) { return(false); } switch (CConfig.Config.Video.WebcamLib) { case EWebcamLib.AForgeNet: _Webcam = new CAForgeNet(); break; default: _Webcam = new CAForgeNet(); break; } if (!_Webcam.Init()) { return(false); } _Webcam.Select(CConfig.Config.Video.WebcamConfig.HasValue ? CConfig.Config.Video.WebcamConfig.Value : new SWebcamConfig()); CConfig.Config.Video.WebcamConfig = _Webcam.GetConfig(); CConfig.SaveConfig(); return(true); }
public static void Close() { if (_Webcam == null) { return; } _Webcam.Close(); _Webcam = null; }
public Scanner(ScannerSettings settings, IParser parser, IWebcam webcam) { Status = ScannerStatus.Initialize; // Default Properties Settings = (settings == null) ? new ScannerSettings() : settings; Parser = (parser == null) ? new ZXingParser(Settings) : parser; Camera = (webcam == null) ? new UnityWebcam(Settings) : webcam; // Check Device Authorization if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) { throw new Exception("This Webcam Library can't work without the webcam authorization"); } }
public Scanner(IParser parser = null, IWebcam webcam = null) { // Check Device Authorization if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) { throw new Exception("This Webcam Library can't work without the webcam authorization"); } Status = ScannerStatus.Initialize; Parser = (parser == null) ? new ZXingParser() : parser; Camera = (webcam == null) ? new UnityWebcam() : webcam; #if UNITY_WEBGL useBackgroundThread = false; #endif }
public WebCamActor(ActorElement ae) { IPAddress ip = IPAddress.Parse(ae.Ip); var type = Type.GetType(ae.WebCamModel); if (type == null) { throw new ApplicationException("The webcam model " + ae.WebCamModel + " cannot be found in the list of available supported web cams. Please review the config file."); } _physicalWebcam = (IWebcam)Activator.CreateInstance(type, ae.WebCamUsername, ae.WebCamPassword, ip, Int32.Parse(ae.WebCamPort)); _pushBullet = new Pushbullet(ae.PushbulletKey, ae.PushbulletDeviceToSendMessagesTo); Become(Disalarmed); }
public static void Init() { switch (CConfig.WebcamLib) { case EWebcamLib.AForgeNet: _Webcam = new CAForgeNet(); break; default: _Webcam = new CAForgeNet(); break; } _Webcam.Init(); _Webcam.Select(CConfig.WebcamConfig); CConfig.WebcamConfig = _Webcam.GetConfig(); CConfig.SaveConfig(); }
public static void Init() { switch (CConfig.WebcamLib) { case EWebcamLib.AForgeNet: _Webcam = new CAForgeNet(); break; default: _Webcam = new CAForgeNet(); break; } _Webcam.Init(); _Webcam.Select(CConfig.WebcamConfig); CConfig.WebcamConfig = _Webcam.GetConfig(); CConfig.SaveConfig(); }
public Scanner(IParser parser, IWebcam webcam) : this(null, parser, webcam) { }
public InitiateBarcodeScanner(IBarcodeParser parser, IWebcam webcam) : this(null, parser, webcam) { }