static v8::Handle<v8::Value> noteOffCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    AudioBufferSourceNode* imp = V8AudioBufferSourceNode::toNative(args.Holder());
    V8TRYCATCH(double, when, static_cast<double>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
    imp->noteOff(when);
    return v8Undefined();
}
Example #2
0
static v8::Handle<v8::Value> noteOffCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.AudioBufferSourceNode.noteOff");
    if (args.Length() < 1)
        return throwError("Not enough arguments", V8Proxy::TypeError);
    AudioBufferSourceNode* imp = V8AudioBufferSourceNode::toNative(args.Holder());
    EXCEPTION_BLOCK(float, when, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)->NumberValue()));
    imp->noteOff(when);
    return v8::Handle<v8::Value>();
}
EncodedJSValue JSC_HOST_CALL jsAudioBufferSourceNodePrototypeFunctionNoteOff(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSAudioBufferSourceNode::s_info))
        return throwVMTypeError(exec);
    JSAudioBufferSourceNode* castedThis = static_cast<JSAudioBufferSourceNode*>(asObject(thisValue));
    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSAudioBufferSourceNode::s_info);
    AudioBufferSourceNode* imp = static_cast<AudioBufferSourceNode*>(castedThis->impl());
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
    float when(exec->argument(0).toFloat(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->noteOff(when);
    return JSValue::encode(jsUndefined());
}