Exemplo n.º 1
0
 /// <summary>
 /// Constructor - Creates a new ExtensionManager
 /// </summary>
 /// <param name="path"></param>
 /// <param name="settings"></param>
 public ExtensionManager() {
     deviceCount = 0;
     Lib = new ExtensionLibrary();
     Lib.Update();
     PresetBuilder = new Management.PresetBuilder(Lib);
     Instances = new Dictionary<int, ExtensionInstance>();
     CaptureInstance = null;
 }
Exemplo n.º 2
0
        public void AddScreenProcessorsFromInstance(ExtensionInstance InstanceToMerge)
        {
            bool restart = false;
            if(running) {
                restart = true;
                Stop();
            }

            Extensions.ActiveProcessors.AddRange(InstanceToMerge.Extensions.ActiveProcessors);

            if(restart) {
                Start();
            }
        }
Exemplo n.º 3
0
        public void Start(int id) {
            if(id == -1) {
                for(var i = 0; i < Instances.Count; i += 1) {
                    Start(i);
                }
                return;
            }

            Guid grabber = Instances[id].GetGrabber();
            if(!grabber.Equals(Guid.Empty)) {
                if(CaptureInstance == null) {
                    CaptureInstance = Instances[id];
                    CaptureInstance.Start();
                } else {
                    CaptureInstance.AddScreenProcessorsFromInstance(Instances[id]);
                }
            } else {
                Instances[id].Start();
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Create an ExtensionInstance for the specified id and mode
 /// </summary>
 /// <param name="id"></param>
 /// <param name="preset"></param>
 /// <returns></returns>
 public ExtensionInstance CreateInstance(int id, MODE preset) {
     ActiveExtensions actives;
     switch(preset) {
         case MODE.HSV:
             actives = PresetBuilder.GetHSVFadePreset();
             break;
         case MODE.SIN:
             actives = PresetBuilder.GetSinFadePreset();
             break;
         case MODE.NEON:
             actives = PresetBuilder.GetNeonFadePreset();
             break;
         case MODE.MIRROR://Both use same extensions, just different settings
         case MODE.SMOOTH:
             actives = PresetBuilder.GetMirrorPreset();
             break;
         case MODE.AUGMENT:
             actives = PresetBuilder.GetAugmentMirrorPreset();
             break;
         case MODE.GAME:
             actives = PresetBuilder.GetGameMirrorPreset();
             break;
         case MODE.EMPTY:
         default:
             actives = new ActiveExtensions();
             break;
     }
     ExtensionInstance instance = new ExtensionInstance(id, actives);
     instance.AttachObserver((AntumbraColorObserver)this);
     return instance;
 }