Ejemplo n.º 1
0
        protected override void PopulateOptions()
        {
            var auto = new ArrayParameterOption <uint?>(null, "Auto");

            Options.Add(auto);
            SelectedOption = auto;

            CameraCapturePropertyRange range = PhotoCaptureDevice.GetSupportedPropertyRange(Device.SensorLocation,
                                                                                            ParameterId);
            object currentValue = Device.GetProperty(ParameterId);

            uint[] standardValues = { 100, 200, 400, 800, 1600, 3200 };

            var min = (uint)range.Min;
            var max = (uint)range.Max;

            foreach (uint isoValue in standardValues)
            {
                if (isoValue >= min && isoValue <= max)
                {
                    string name   = string.Format("ISO {0}", isoValue);
                    var    option = new ArrayParameterOption <uint?>(isoValue, name);
                    Options.Add(option);

                    if (isoValue.Equals(currentValue))
                    {
                        SelectedOption = option;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected override void PopulateOptions()
        {
            var auto = new ArrayParameterOption <uint?>(null, "Auto");

            Options.Add(auto);

            CameraCapturePropertyRange times = PhotoCaptureDevice.GetSupportedPropertyRange(Device.SensorLocation,
                                                                                            KnownCameraPhotoProperties
                                                                                            .ExposureTime);
            var currentValue = (uint?)Device.GetProperty(ParameterId);

            uint[] standardValues = { 2000, 1000, 500, 250, 125, 60, 30, 15, 8, 4, 2, 1 };
            var    min            = (uint)times.Min;
            var    max            = (uint)times.Max;

            foreach (uint timeValue in standardValues)
            {
                uint microSeconds = 1000000 / timeValue;

                if (microSeconds >= min && microSeconds <= max)
                {
                    string name   = string.Format("1 / {0} s", timeValue);
                    var    option = new ArrayParameterOption <uint?>(microSeconds, name);
                    Options.Add(option);

                    if (currentValue == microSeconds)
                    {
                        SelectedOption = option;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected override async void SetOption(ArrayParameterOption <Size> option)
        {
            if (IsModifiable)
            {
                IsModifiable = false;

                await Device.SetCaptureResolutionAsync(option.Value);

                IsModifiable = true;
            }
        }
Ejemplo n.º 4
0
        protected override void PopulateOptions()
        {
            IReadOnlyList <object> supportedValues = PhotoCaptureDevice.GetSupportedPropertyValues(
                Device.SensorLocation, ParameterId);
            object currentValue = Device.GetProperty(ParameterId);

            foreach (dynamic mode in supportedValues)
            {
                var csm    = (CameraSceneMode)mode;
                var option = new ArrayParameterOption <CameraSceneMode>(csm, Enum.GetName(typeof(CameraSceneMode), mode));
                Options.Add(option);

                if (mode.Equals(currentValue))
                {
                    SelectedOption = option;
                }
            }
        }
Ejemplo n.º 5
0
        protected override void PopulateOptions()
        {
            IReadOnlyList <Size> cameraResolutions =
                PhotoCaptureDevice.GetAvailableCaptureResolutions(Device.SensorLocation);
            Size currentResolution = Device.CaptureResolution;

            foreach (Size resolution in cameraResolutions)
            {
                string optionName = string.Format("{0}x{1}", resolution.Width, resolution.Height);
                var    option     = new ArrayParameterOption <Size>(resolution, optionName);

                Options.Add(option);

                if (resolution == currentResolution)
                {
                    SelectedOption = option;
                }
            }
        }
Ejemplo n.º 6
0
        public override sealed void ReadCurrent()
        {
            _refreshing = true;
            Options.Clear();
            _selectedOption = null;

            try
            {
                PopulateOptions();
                IsSupported = Options.Count > 0;
            }
            catch (Exception)
            {
                IsSupported = false;
                Debug.WriteLine("Einstellung {0} konnte nicht abgerufen werden.", Name);
            }

            IsModifiable = IsSupported && Options.Count > 1;

            _refreshing = false;
        }
Ejemplo n.º 7
0
 protected override void SetOption(ArrayParameterOption <uint?> option)
 {
     Device.SetProperty(ParameterId, option.Value);
 }
Ejemplo n.º 8
0
 /// <summary>
 ///     Setzt den angegebenen Optionswert für diesen Kameraparameter.
 /// </summary>
 /// <param name="option"></param>
 protected abstract void SetOption(ArrayParameterOption <T> option);
Ejemplo n.º 9
0
 protected override void SetOption(ArrayParameterOption <CameraSceneMode> option)
 {
     Device.SetProperty(ParameterId, option.Value);
 }