public EventClock(Kontrol2OBS parent, int tickRate) { this.obsVolume = new ConcurrentDictionary <string, double>(); Thread t = new Thread(() => { while (!stop) { if (this.obsBuffer.Count > 0) { this.obsBuffer.Dequeue().Invoke(); } foreach (SpecialSourceObject specialSource in parent.specialSources.Values) { if (specialSource.windowsDevice != null) { specialSource.windowsDevice.UpdateStatus(); } } foreach (KeyValuePair <string, double> volumePair in this.obsVolume) { this.AddOBSEvent(() => { parent.obsSocket.SetVolume(volumePair.Key, volumePair.Value); }); } this.obsVolume.Clear(); Thread.Sleep(1000 / tickRate); } }); t.Start(); }
public Config(Kontrol2OBS parent, string path) { this.parent = parent; this.inputbindings = new Dictionary <int, Action>(); this.outputbindings = new List <Reaction>(); XmlDocument config = this.LoadAndValidateConfig(path); this.ImportConfig(config); }