public List <InputBindState> GenerateBindStateList()
        {
            var bindStates = new List <InputBindState>();

            //REMEMBER TO UPDATE THIS WHEN NEW BINDINGS ARE ADDED
            //MIN + MAX bind numbers
            for (int i = (int)InputBinding.Intercom; i <= (int)InputBinding.RadioChannelDown; i++)
            {
                if (_settings.InputDevices.ContainsKey((InputBinding)i))
                {
                    var input = _settings.InputDevices[(InputBinding)i];
                    //construct InputBindState

                    var bindState = new InputBindState()
                    {
                        IsActive        = false,
                        MainDevice      = input,
                        MainDeviceState = false,
                        ModifierDevice  = null,
                        ModifierState   = false
                    };

                    if (_settings.InputDevices.ContainsKey((InputBinding)i + 100))
                    {
                        bindState.ModifierDevice = _settings.InputDevices[(InputBinding)i + 100];
                    }

                    bindStates.Add(bindState);
                }
            }

            return(bindStates);
        }
Example #2
0
        public List <InputBindState> GenerateBindStateList()
        {
            var bindStates = new List <InputBindState>();

            //REMEMBER TO UPDATE THIS WHEN NEW BINDINGS ARE ADDED
            //MIN + MAX bind numbers
            for (int i = (int)InputBinding.Intercom; i <= (int)InputBinding.RadioChannelDown; i++)
            {
                var mainInputBind = InputConfig.InputDevices[(InputBinding)i];

                if (mainInputBind != null)
                {
                    //construct InputBindState

                    var bindState = new InputBindState()
                    {
                        IsActive        = false,
                        MainDevice      = mainInputBind,
                        MainDeviceState = false,
                        ModifierDevice  = InputConfig.InputDevices[(InputBinding)i + 100], // can be null but OK
                        ModifierState   = false
                    };

                    bindStates.Add(bindState);
                }
            }

            return(bindStates);
        }