| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return listener_; | 282 return listener_; |
| 283 } | 283 } |
| 284 | 284 |
| 285 String PannerHandler::PanningModel() const { | 285 String PannerHandler::PanningModel() const { |
| 286 switch (panning_model_) { | 286 switch (panning_model_) { |
| 287 case Panner::kPanningModelEqualPower: | 287 case Panner::kPanningModelEqualPower: |
| 288 return "equalpower"; | 288 return "equalpower"; |
| 289 case Panner::kPanningModelHRTF: | 289 case Panner::kPanningModelHRTF: |
| 290 return "HRTF"; | 290 return "HRTF"; |
| 291 default: | 291 default: |
| 292 ASSERT_NOT_REACHED(); | 292 NOTREACHED(); |
| 293 return "equalpower"; | 293 return "equalpower"; |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 void PannerHandler::SetPanningModel(const String& model) { | 297 void PannerHandler::SetPanningModel(const String& model) { |
| 298 // WebIDL should guarantee that we are never called with an invalid string | 298 // WebIDL should guarantee that we are never called with an invalid string |
| 299 // for the model. | 299 // for the model. |
| 300 if (model == "equalpower") | 300 if (model == "equalpower") |
| 301 SetPanningModel(Panner::kPanningModelEqualPower); | 301 SetPanningModel(Panner::kPanningModelEqualPower); |
| 302 else if (model == "HRTF") | 302 else if (model == "HRTF") |
| (...skipping 28 matching lines...) Expand all Loading... |
| 331 | 331 |
| 332 String PannerHandler::DistanceModel() const { | 332 String PannerHandler::DistanceModel() const { |
| 333 switch (const_cast<PannerHandler*>(this)->distance_effect_.Model()) { | 333 switch (const_cast<PannerHandler*>(this)->distance_effect_.Model()) { |
| 334 case DistanceEffect::kModelLinear: | 334 case DistanceEffect::kModelLinear: |
| 335 return "linear"; | 335 return "linear"; |
| 336 case DistanceEffect::kModelInverse: | 336 case DistanceEffect::kModelInverse: |
| 337 return "inverse"; | 337 return "inverse"; |
| 338 case DistanceEffect::kModelExponential: | 338 case DistanceEffect::kModelExponential: |
| 339 return "exponential"; | 339 return "exponential"; |
| 340 default: | 340 default: |
| 341 ASSERT_NOT_REACHED(); | 341 NOTREACHED(); |
| 342 return "inverse"; | 342 return "inverse"; |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 void PannerHandler::SetDistanceModel(const String& model) { | 346 void PannerHandler::SetDistanceModel(const String& model) { |
| 347 if (model == "linear") | 347 if (model == "linear") |
| 348 SetDistanceModel(DistanceEffect::kModelLinear); | 348 SetDistanceModel(DistanceEffect::kModelLinear); |
| 349 else if (model == "inverse") | 349 else if (model == "inverse") |
| 350 SetDistanceModel(DistanceEffect::kModelInverse); | 350 SetDistanceModel(DistanceEffect::kModelInverse); |
| 351 else if (model == "exponential") | 351 else if (model == "exponential") |
| 352 SetDistanceModel(DistanceEffect::kModelExponential); | 352 SetDistanceModel(DistanceEffect::kModelExponential); |
| 353 } | 353 } |
| 354 | 354 |
| 355 bool PannerHandler::SetDistanceModel(unsigned model) { | 355 bool PannerHandler::SetDistanceModel(unsigned model) { |
| 356 switch (model) { | 356 switch (model) { |
| 357 case DistanceEffect::kModelLinear: | 357 case DistanceEffect::kModelLinear: |
| 358 case DistanceEffect::kModelInverse: | 358 case DistanceEffect::kModelInverse: |
| 359 case DistanceEffect::kModelExponential: | 359 case DistanceEffect::kModelExponential: |
| 360 if (model != distance_model_) { | 360 if (model != distance_model_) { |
| 361 // This synchronizes with process(). | 361 // This synchronizes with process(). |
| 362 MutexLocker process_locker(process_lock_); | 362 MutexLocker process_locker(process_lock_); |
| 363 distance_effect_.SetModel( | 363 distance_effect_.SetModel( |
| 364 static_cast<DistanceEffect::ModelType>(model)); | 364 static_cast<DistanceEffect::ModelType>(model)); |
| 365 distance_model_ = model; | 365 distance_model_ = model; |
| 366 } | 366 } |
| 367 break; | 367 break; |
| 368 default: | 368 default: |
| 369 ASSERT_NOT_REACHED(); | 369 NOTREACHED(); |
| 370 return false; | 370 return false; |
| 371 } | 371 } |
| 372 | 372 |
| 373 return true; | 373 return true; |
| 374 } | 374 } |
| 375 | 375 |
| 376 void PannerHandler::SetRefDistance(double distance) { | 376 void PannerHandler::SetRefDistance(double distance) { |
| 377 if (RefDistance() == distance) | 377 if (RefDistance() == distance) |
| 378 return; | 378 return; |
| 379 | 379 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 visitor->Trace(position_z_); | 812 visitor->Trace(position_z_); |
| 813 | 813 |
| 814 visitor->Trace(orientation_x_); | 814 visitor->Trace(orientation_x_); |
| 815 visitor->Trace(orientation_y_); | 815 visitor->Trace(orientation_y_); |
| 816 visitor->Trace(orientation_z_); | 816 visitor->Trace(orientation_z_); |
| 817 | 817 |
| 818 AudioNode::Trace(visitor); | 818 AudioNode::Trace(visitor); |
| 819 } | 819 } |
| 820 | 820 |
| 821 } // namespace blink | 821 } // namespace blink |
| OLD | NEW |