public Evaluator GetEvaluator(Dictionary<Expression, Evaluator> Cache, int BufferSize, int Resolution) { Evaluator eval; if (Cache.TryGetValue(this, out eval)) { // Make sure the cached version is buffered, so its results can be reused. if (!(eval is ConstantEvaluator) && !(eval is IdentityEvaluator)) { BufferedEvaluator beval = eval.GetBuffered(BufferSize); if (eval != beval) { eval = beval; Cache[this] = beval; } } } else { eval = this.CreateEvaluator(Cache, BufferSize, Resolution); Cache[this] = eval; } return eval; }
public EvaluatorStream(int BufferSize, Expression Expression, SoundOptions Options, bool Exporting) : this(BufferSize, Expression.GetEvaluator(new Dictionary<Expression,Evaluator>(), BufferSize, Options.Resolution), Options, Exporting) { }