public Effects(TimeSpan nowtime, TimeSpan end, EffectsNames name) { effectName = name; startTime = nowtime; endTime = end; keypoints = new List <KeyPoint>(); }
public Effects(TimeSpan nowtime, EffectsNames name, double dur = defaultDuration) { effectName = name; startTime = nowtime; endTime = startTime.Add(new TimeSpan(0, 0, 0, (int)dur)); keypoints = new List <KeyPoint>(); keypoints.Add(new KeyPoint(startTime, KeyPoint.defaultColor)); }
public EffectBounce(string[] strs, EffectsNames name) : base(LightBallHelper.getTimeSpanFromString(strs[2]), LightBallHelper.getTimeSpanFromString(strs[3]), name) { paraInit(); loadPara(strs, 7); this.Add(this.startTime, 0, 0, Color.FromArgb(LightBallHelper.getIntFromString(strs[4]), // R LightBallHelper.getIntFromString(strs[5]), // G LightBallHelper.getIntFromString(strs[6])), // B 0, 0); // Bright Tran }
public EffectBounce(TimeSpan start_time, EffectsNames name) : base(start_time, name) { paraInit(); }
public EffectMeteor(TimeSpan start_time, EffectsNames name) : base(start_time, name) { paraInit(); }
public static void RestoreHistory(string filename, out List <Effects> effects) { effects = new List <Effects>(); StreamReader sr = new StreamReader(filename); Effects now_eff = null; string line = ""; int cmd_id = -1; while ((line = sr.ReadLine()) != null) { string[] strs = line.Split(','); if (strs.Length <= 1) { continue; } int id; if (int.TryParse(strs[0], out id)) { if (id == 0) { globalStartingTime = LightBallHelper.getTimeSpanFromString(strs[1]); numOfBall = LightBallHelper.getIntFromString(strs[2]); } else if (cmd_id != id) { if (now_eff != null) { effects.Add(now_eff); } EffectsNames effect = (EffectsNames)Enum.Parse(typeof(EffectsNames), strs[1]); switch (effect) { case EffectsNames.EffectHSL: now_eff = new EffectHSL(strs); break; case EffectsNames.EffectColorTransition: now_eff = new EffectColorTransition(strs); break; case EffectsNames.EffectSparkAsync: now_eff = new EffectSparkAsync(strs); break; case EffectsNames.EffectSparkSync: now_eff = new EffectSparkSync(strs); break; case EffectsNames.EffectMeteorAsync: now_eff = new EffectMeteorAsync(strs); break; case EffectsNames.EffectMeteorSync: now_eff = new EffectMeteorSync(strs); break; case EffectsNames.EffectBounceAsync: now_eff = new EffectBounceAsync(strs); break; case EffectsNames.EffectBounceSync: now_eff = new EffectBounceSync(strs); break; default: break; } } else { now_eff.LoadKeypoints(strs); } cmd_id = id; } } sr.Close(); }