コード例 #1
0
        static AudioService()
        {
            var alarmPath        = P42.Utils.EmbeddedResourceCache.LocalStorageFullPathForEmbeddedResource("Forms9Patch.Resources.Sounds.alarm.mp3", typeof(Forms9Patch.Feedback).Assembly);
            var alertPath        = P42.Utils.EmbeddedResourceCache.LocalStorageFullPathForEmbeddedResource("Forms9Patch.Resources.Sounds.alert.mp3", typeof(Forms9Patch.Feedback).Assembly);
            var errorPath        = P42.Utils.EmbeddedResourceCache.LocalStorageFullPathForEmbeddedResource("Forms9Patch.Resources.Sounds.error.mp3", typeof(Forms9Patch.Feedback).Assembly);
            var messagePath      = P42.Utils.EmbeddedResourceCache.LocalStorageFullPathForEmbeddedResource("Forms9Patch.Resources.Sounds.message.mp3", typeof(Forms9Patch.Feedback).Assembly);
            var notificationPath = P42.Utils.EmbeddedResourceCache.LocalStorageFullPathForEmbeddedResource("Forms9Patch.Resources.Sounds.notification.mp3", typeof(Forms9Patch.Feedback).Assembly);

            alarmPlayer        = new AVFoundation.AVAudioPlayer(NSUrl.FromFilename(alarmPath), "mp3", out NSError nSError0);
            alertPlayer        = new AVFoundation.AVAudioPlayer(NSUrl.FromFilename(alertPath), "mp3", out NSError nSError1);
            errorPlayer        = new AVFoundation.AVAudioPlayer(NSUrl.FromFilename(errorPath), "mp3", out NSError nSError2);
            messagePlayer      = new AVFoundation.AVAudioPlayer(NSUrl.FromFilename(messagePath), "mp3", out NSError nSError3);
            notificationPlayer = new AVFoundation.AVAudioPlayer(NSUrl.FromFilename(notificationPath), "mp3", out NSError nSError4);
        }
コード例 #2
0
            public Camera() : base()
            {
                AVFoundation.AVCaptureVideoPreviewLayer captureVideoPreviewLayer = new AVFoundation.AVCaptureVideoPreviewLayer(session)
                {
                    Frame = Bounds
                };
                Layer.AddSublayer(captureVideoPreviewLayer);


                AVFoundation.AVCaptureDeviceInput input = new AVFoundation.AVCaptureDeviceInput(device, out Foundation.NSError error);
                if (input == null)
                {
                    // Handle the error appropriately.
                    Log(new Foundation.NSErrorException(error));//@"ERROR: trying to open camera: %@",
                }
                session.AddInput(input);

                session.StartRunning();
            }