当前位置: 首页>>代码示例>>C++>>正文


C++ PannerNode类代码示例

本文整理汇总了C++中PannerNode的典型用法代码示例。如果您正苦于以下问题:C++ PannerNode类的具体用法?C++ PannerNode怎么用?C++ PannerNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PannerNode类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: exceptionState

void V8PannerNode::distanceModelAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
    ExceptionState exceptionState(ExceptionState::SetterContext, "distanceModel", "PannerNode", info.Holder(), info.GetIsolate());
    PannerNode* impl = V8PannerNode::toNative(info.Holder());

    if (value->IsNumber()) {
        uint32_t model = toUInt32(value, exceptionState);
        if (exceptionState.throwIfNeeded())
            return;
        if (!impl->setDistanceModel(model)) {
            exceptionState.throwTypeError("Illegal distanceModel");
            exceptionState.throwIfNeeded();
        }
        return;
    }

    if (value->IsString()) {
        String model = toCoreString(value.As<v8::String>());
        if (model == "linear" || model == "inverse" || model == "exponential") {
            impl->setDistanceModel(model);
            return;
        }
    }

    exceptionState.throwTypeError("Illegal distanceModel");
    exceptionState.throwIfNeeded();
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:27,代码来源:V8PannerNodeCustom.cpp

示例2: ENABLE

void V8PannerNode::distanceModelAttrSetterCustom(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    PannerNode* imp = V8PannerNode::toNative(info.Holder());

#if ENABLE(LEGACY_WEB_AUDIO)    
    if (value->IsNumber()) {
        bool ok = false;
        uint32_t model = toUInt32(value, ok);
        ASSERT(ok);
        if (!imp->setDistanceModel(model))
            throwError(v8TypeError, "Illegal distanceModel", info.GetIsolate());
        return;
    }
#endif

    if (value->IsString()) {
        String model = toWebCoreString(value);
        if (model == "linear" || model == "inverse" || model == "exponential") {
            imp->setDistanceModel(model);
            return;
        }
    }
    
    throwError(v8TypeError, "Illegal distanceModel", info.GetIsolate());
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:25,代码来源:V8PannerNodeCustom.cpp

示例3: rolloffFactorAttrSetter

static void rolloffFactorAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    PannerNode* imp = V8PannerNode::toNative(info.Holder());
    float v = static_cast<float>(value->NumberValue());
    imp->setRolloffFactor(v);
    return;
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:7,代码来源:V8PannerNode.cpp

示例4: setVelocityCallback

static v8::Handle<v8::Value> setVelocityCallback(const v8::Arguments& args)
{
    if (args.Length() < 3)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    PannerNode* imp = V8PannerNode::toNative(args.Holder());
    V8TRYCATCH(float, x, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->NumberValue()));
    V8TRYCATCH(float, z, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 2, DefaultIsUndefined)->NumberValue()));
    imp->setVelocity(x, y, z);
    return v8Undefined();
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:11,代码来源:V8PannerNode.cpp

示例5: coneInnerAngleAttrGetter

static v8::Handle<v8::Value> coneInnerAngleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    PannerNode* imp = V8PannerNode::toNative(info.Holder());
    return v8::Number::New(imp->coneInnerAngle());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:5,代码来源:V8PannerNode.cpp

示例6: distanceModelAttrGetter

static v8::Handle<v8::Value> distanceModelAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    PannerNode* imp = V8PannerNode::toNative(info.Holder());
    return v8String(imp->distanceModel(), info.GetIsolate());
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:5,代码来源:V8PannerNode.cpp


注:本文中的PannerNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。