public void InitializeStep() { _allPhotons.Clear(); if (_photons.Count > 0) { _allPhotons.AddRange(_photons); } if (_bigPhotons.Count > 0) { foreach (BigPhoton p in _bigPhotons) { _allPhotons.AddRange(p.Attribute.GetPhotonsAtLevel(p.Level)); } } upFader = new Fader(_parentEffect.ToString() + _stepID.ToString(), _allPhotons, _lowLevel, _highLevel, (100.0 / Controller.Rate) * _upFadeTime); downFader = new Fader(_parentEffect.ToString() + _stepID.ToString(), _allPhotons, _highLevel, _lowLevel, (100.0 / Controller.Rate) * _downFadeTime); }
private void colorRotationHelper(object parameter) { double fadeTime = (double)parameter; bool firstTime = true; while (true) { for (int i = 0; i < colors.Count; i++) { List<Photon> prev; if (i == 0) prev = colors[colors.Count - 1]; else prev = colors[i - 1]; Fader colorFader = new Fader(Name + "colorRotation", colors[i], 0, 255, fadeTime); colorRotationFaders.Add(colorFader); lock (c_lock) { colorFader.Run(new FaderDoneCallback(DoneFading)); Monitor.Wait(c_lock); } if (firstTime) { firstTime = false; continue; } Fader prevFader = new Fader(Name + "colorRotation", prev, 255, 0, fadeTime); colorRotationFaders.Add(prevFader); lock (c_lock) { prevFader.Run(new FaderDoneCallback(DoneFading)); Monitor.Wait(c_lock); } } } }