Пример #1
0
        public AVProLiveCameraSettingBase GetVideoSettingByType(SettingsEnum type)
        {
            AVProLiveCameraSettingBase result = null;

            if (!_settingsByType.TryGetValue((int)type, out result))
            {
                result = null;
            }
            return(result);
        }
Пример #2
0
        public AVProLiveCameraSettingBase GetVideoSettingByIndex(int index)
        {
            AVProLiveCameraSettingBase result = null;

            if (index >= 0 && index < _settings.Count)
            {
                result = _settings[index];
            }

            return(result);
        }
Пример #3
0
        private void EnumVideoSettings()
        {
            int numVideoSettings = AVProLiveCameraPlugin.GetNumDeviceVideoSettings(_deviceIndex);

            for (int i = 0; i < numVideoSettings; i++)
            {
                int    settingType;
                int    dataType;
                string name;
                bool   canAutomatic;
                if (AVProLiveCameraPlugin.GetDeviceVideoSettingInfo(_deviceIndex, i, out settingType, out dataType, out name, out canAutomatic))
                {
                    AVProLiveCameraSettingBase setting = null;

                    // Data type is boolean
                    if (dataType == 0)
                    {
                        bool defaultValue;
                        bool currentValue;
                        bool isAutomatic;
                        if (AVProLiveCameraPlugin.GetDeviceVideoSettingBoolean(_deviceIndex, i, out defaultValue, out currentValue, out isAutomatic))
                        {
                            setting = new AVProLiveCameraSettingBoolean(_deviceIndex, i, settingType, name, canAutomatic, isAutomatic, defaultValue, currentValue);
                        }
                    }
                    // Data type is float
                    else if (dataType == 1)
                    {
                        bool  isAutomatic;
                        float defaultValue;
                        float currentValue;
                        float minValue, maxValue;
                        if (AVProLiveCameraPlugin.GetDeviceVideoSettingFloat(_deviceIndex, i, out defaultValue, out currentValue, out minValue, out maxValue, out isAutomatic))
                        {
                            setting = new AVProLiveCameraSettingFloat(_deviceIndex, i, settingType, name, canAutomatic, isAutomatic, defaultValue, currentValue, minValue, maxValue);
                        }
                    }

                    if (setting != null)
                    {
                        _settings.Add(setting);
                        _settingsByType.Add(settingType, setting);
                    }
                }
            }
        }