AVSValue ExpDoublePlus::Evaluate(IScriptEnvironment* env) { AVSValue x = a->Evaluate(env); AVSValue y = b->Evaluate(env); if (x.IsClip() && y.IsClip()) return new_Splice(x.AsClip(), y.AsClip(), true, env); // AlignedSplice else { env->ThrowError("Evaluate: operands of `++' must be clips"); return 0; } }
static AVSValue __cdecl Create(AVSValue args, void* user_data, IScriptEnvironment* env) { const int mode = int(user_data); const bool fAudio = (mode == MODE_WAV) || args[1].AsBool(true); const char* pixel_type = (mode != MODE_WAV) ? args[2].AsString("") : ""; const char* fourCC = (mode != MODE_WAV) ? args[3].AsString("") : ""; PClip result = new AVISource(args[0][0].AsString(), fAudio, pixel_type, fourCC, mode, env); for (int i=1; i<args[0].ArraySize(); ++i) result = new_Splice(result, new AVISource(args[0][i].AsString(), fAudio, pixel_type, fourCC, mode, env), false, env); return AlignPlanar::Create(result); }
AVSValue ExpPlus::Evaluate(IScriptEnvironment* env) { AVSValue x = a->Evaluate(env); AVSValue y = b->Evaluate(env); if (x.IsClip() && y.IsClip()) return new_Splice(x.AsClip(), y.AsClip(), false, env); // UnalignedSplice else if (x.IsInt() && y.IsInt()) return x.AsInt() + y.AsInt(); else if (x.IsFloat() && y.IsFloat()) return x.AsFloat() + y.AsFloat(); else if (x.IsString() && y.IsString()) return env->Sprintf("%s%s", x.AsString(), y.AsString()); else { env->ThrowError("Evaluate: operands of `+' must both be numbers, strings, or clips"); return 0; } }