コード例 #1
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);
                }
            }
        }
    }