| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return; | 46 return; |
| 47 } | 47 } |
| 48 | 48 |
| 49 if (value->IsString()) { | 49 if (value->IsString()) { |
| 50 String model = toWebCoreString(value); | 50 String model = toWebCoreString(value); |
| 51 if (model == "equalpower" || model == "HRTF" || model == "soundfield") { | 51 if (model == "equalpower" || model == "HRTF" || model == "soundfield") { |
| 52 imp->setPanningModel(model); | 52 imp->setPanningModel(model); |
| 53 return; | 53 return; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 throwTypeError("Illegal panningModel", info.GetIsolate()); | 57 throwTypeError("Illegal panningModel", info.GetIsolate()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void V8PannerNode::distanceModelAttrSetterCustom(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 60 void V8PannerNode::distanceModelAttrSetterCustom(v8::Local<v8::String> name, v8:
:Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
| 61 { | 61 { |
| 62 PannerNode* imp = V8PannerNode::toNative(info.Holder()); | 62 PannerNode* imp = V8PannerNode::toNative(info.Holder()); |
| 63 | 63 |
| 64 if (value->IsNumber()) { | 64 if (value->IsNumber()) { |
| 65 bool ok = false; | 65 bool ok = false; |
| 66 uint32_t model = toUInt32(value, ok); | 66 uint32_t model = toUInt32(value, ok); |
| 67 ASSERT(ok); | 67 ASSERT(ok); |
| 68 if (!imp->setDistanceModel(model)) | 68 if (!imp->setDistanceModel(model)) |
| 69 throwTypeError("Illegal distanceModel", info.GetIsolate()); | 69 throwTypeError("Illegal distanceModel", info.GetIsolate()); |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (value->IsString()) { | 73 if (value->IsString()) { |
| 74 String model = toWebCoreString(value); | 74 String model = toWebCoreString(value); |
| 75 if (model == "linear" || model == "inverse" || model == "exponential") { | 75 if (model == "linear" || model == "inverse" || model == "exponential") { |
| 76 imp->setDistanceModel(model); | 76 imp->setDistanceModel(model); |
| 77 return; | 77 return; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 throwTypeError("Illegal distanceModel", info.GetIsolate()); | 81 throwTypeError("Illegal distanceModel", info.GetIsolate()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace WebCore | 84 } // namespace WebCore |
| 85 | 85 |
| 86 #endif // ENABLE(WEB_AUDIO) | 86 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |