Beispiel #1
0
 internal void PrepareMapping()
 {
     InputCache = new List <long>();
     DeviceBindings.ForEach(_ => InputCache.Add(0L));
     Multiplexer = new List <CallbackMultiplexer>();
     for (var i = 0; i < DeviceBindings.Count; i++)
     {
         var cm = new CallbackMultiplexer(InputCache, i, Update);
         Multiplexer.Add(cm);
         DeviceBindings[i].Callback = cm.Update;
     }
 }
Beispiel #2
0
        public bool AddPlugin(Plugin plugin)
        {
            if (Plugins.Count == 0)
            {
                foreach (var _ in plugin.InputCategories)
                {
                    DeviceBindings.Add(new DeviceBinding(Update, Profile, DeviceIoType.Input));
                }
            }

            plugin.SetProfile(Profile);
            Plugins.Add(plugin);

            Profile.Context.ContextChanged();
            return(true);
        }
Beispiel #3
0
        internal void PrepareMapping(FilterState filterState)
        {
            InputCache = new List <short>();
            DeviceBindings.ForEach(_ => InputCache.Add(0));
            Multiplexer = new List <CallbackMultiplexer>();
            for (var i = 0; i < DeviceBindings.Count; i++)
            {
                var cm = new CallbackMultiplexer(InputCache, i, Update);
                Multiplexer.Add(cm);
                DeviceBindings[i].Callback     = cm.Update;
                DeviceBindings[i].CurrentValue = 0;
            }

            FilterState = filterState;
            Plugins.ForEach(p => p.RuntimeMapping = this);
        }