public override void ViewDidLoad () { base.ViewDidLoad (); sessionManager = new SessionManager (); sessionManager.StartRunning (); previewLayer = new AVCaptureVideoPreviewLayer (sessionManager.CaptureSession) { Frame = previewView.Bounds, VideoGravity = AVLayerVideoGravity.ResizeAspectFill }; if (previewLayer.Connection != null && previewLayer.Connection.SupportsVideoOrientation) previewLayer.Connection.VideoOrientation = AVCaptureVideoOrientation.LandscapeLeft; previewView.Layer.AddSublayer (previewLayer); previewView.Layer.MasksToBounds = true; barcodeTargetLayer = new CALayer () { Frame = View.Layer.Bounds }; View.Layer.AddSublayer (barcodeTargetLayer); synth = new Synth (); synth.LoadPreset (this); // the loop that continuously looks for barcodes to detect stepTimer = NSTimer.CreateScheduledTimer (0.15, this, new Selector ("step:"), null, true); }
public override void ViewDidLoad () { base.ViewDidLoad (); sessionManager = new SessionManager (); sessionManager.StartRunning (); previewLayer = new AVCaptureVideoPreviewLayer (sessionManager.CaptureSession) { Frame = previewView.Bounds, VideoGravity = AVLayerVideoGravity.ResizeAspectFill }; if (previewLayer.Connection != null && previewLayer.Connection.SupportsVideoOrientation) previewLayer.Connection.VideoOrientation = AVCaptureVideoOrientation.LandscapeLeft; previewView.Layer.AddSublayer (previewLayer); previewView.Layer.MasksToBounds = true; barcodeTargetLayer = new CALayer () { Frame = View.Layer.Bounds }; View.Layer.AddSublayer (barcodeTargetLayer); synth = new Synth (); synth.LoadPreset (this); }