本文整理汇总了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();
}
示例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());
}
示例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;
}
示例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();
}
示例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());
}
示例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());
}