| 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "platform/Histogram.h" | 33 #include "platform/Histogram.h" |
| 34 #include "platform/audio/AudioUtilities.h" | 34 #include "platform/audio/AudioUtilities.h" |
| 35 #include "platform/v8_inspector/public/ConsoleTypes.h" | 35 #include "platform/v8_inspector/public/ConsoleTypes.h" |
| 36 #include "wtf/MathExtras.h" | 36 #include "wtf/MathExtras.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 const double AudioParamHandler::DefaultSmoothingConstant = 0.05; | 40 const double AudioParamHandler::DefaultSmoothingConstant = 0.05; |
| 41 const double AudioParamHandler::SnapThreshold = 0.001; | 41 const double AudioParamHandler::SnapThreshold = 0.001; |
| 42 | 42 |
| 43 AudioParamHandler::AudioParamHandler(AbstractAudioContext& context, AudioParamTy
pe paramType, double defaultValue, float minValue, float maxValue) | 43 AudioParamHandler::AudioParamHandler(BaseAudioContext& context, AudioParamType p
aramType, double defaultValue, float minValue, float maxValue) |
| 44 : AudioSummingJunction(context.deferredTaskHandler()) | 44 : AudioSummingJunction(context.deferredTaskHandler()) |
| 45 , m_paramType(paramType) | 45 , m_paramType(paramType) |
| 46 , m_intrinsicValue(defaultValue) | 46 , m_intrinsicValue(defaultValue) |
| 47 , m_defaultValue(defaultValue) | 47 , m_defaultValue(defaultValue) |
| 48 , m_minValue(minValue) | 48 , m_minValue(minValue) |
| 49 , m_maxValue(maxValue) | 49 , m_maxValue(maxValue) |
| 50 { | 50 { |
| 51 // The destination MUST exist because we need the destination handler for th
e AudioParam. | 51 // The destination MUST exist because we need the destination handler for th
e AudioParam. |
| 52 RELEASE_ASSERT(context.destination()); | 52 RELEASE_ASSERT(context.destination()); |
| 53 | 53 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 } | 332 } |
| 333 break; | 333 break; |
| 334 default: | 334 default: |
| 335 // Nothing to do for all other types. | 335 // Nothing to do for all other types. |
| 336 break; | 336 break; |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 | 339 |
| 340 // ---------------------------------------------------------------- | 340 // ---------------------------------------------------------------- |
| 341 | 341 |
| 342 AudioParam::AudioParam(AbstractAudioContext& context, AudioParamType paramType,
double defaultValue, float minValue, float maxValue) | 342 AudioParam::AudioParam(BaseAudioContext& context, AudioParamType paramType, doub
le defaultValue, float minValue, float maxValue) |
| 343 : m_handler(AudioParamHandler::create(context, paramType, defaultValue, minV
alue, maxValue)) | 343 : m_handler(AudioParamHandler::create(context, paramType, defaultValue, minV
alue, maxValue)) |
| 344 , m_context(context) | 344 , m_context(context) |
| 345 { | 345 { |
| 346 } | 346 } |
| 347 | 347 |
| 348 AudioParam* AudioParam::create(AbstractAudioContext& context, AudioParamType par
amType, double defaultValue) | 348 AudioParam* AudioParam::create(BaseAudioContext& context, AudioParamType paramTy
pe, double defaultValue) |
| 349 { | 349 { |
| 350 // Default nominal range is most negative float to most positive. This basi
cally means any | 350 // Default nominal range is most negative float to most positive. This basi
cally means any |
| 351 // value is valid, except that floating-point infinities are excluded. | 351 // value is valid, except that floating-point infinities are excluded. |
| 352 float limit = std::numeric_limits<float>::max(); | 352 float limit = std::numeric_limits<float>::max(); |
| 353 return new AudioParam(context, paramType, defaultValue, -limit, limit); | 353 return new AudioParam(context, paramType, defaultValue, -limit, limit); |
| 354 } | 354 } |
| 355 | 355 |
| 356 AudioParam* AudioParam::create(AbstractAudioContext& context, AudioParamType par
amType, double defaultValue, float minValue, float maxValue) | 356 AudioParam* AudioParam::create(BaseAudioContext& context, AudioParamType paramTy
pe, double defaultValue, float minValue, float maxValue) |
| 357 { | 357 { |
| 358 DCHECK_LE(minValue, maxValue); | 358 DCHECK_LE(minValue, maxValue); |
| 359 return new AudioParam(context, paramType, defaultValue, minValue, maxValue); | 359 return new AudioParam(context, paramType, defaultValue, minValue, maxValue); |
| 360 } | 360 } |
| 361 | 361 |
| 362 DEFINE_TRACE(AudioParam) | 362 DEFINE_TRACE(AudioParam) |
| 363 { | 363 { |
| 364 visitor->trace(m_context); | 364 visitor->trace(m_context); |
| 365 } | 365 } |
| 366 | 366 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 } | 499 } |
| 500 | 500 |
| 501 AudioParam* AudioParam::cancelScheduledValues(double startTime, ExceptionState&
exceptionState) | 501 AudioParam* AudioParam::cancelScheduledValues(double startTime, ExceptionState&
exceptionState) |
| 502 { | 502 { |
| 503 handler().timeline().cancelScheduledValues(startTime, exceptionState); | 503 handler().timeline().cancelScheduledValues(startTime, exceptionState); |
| 504 return this; | 504 return this; |
| 505 } | 505 } |
| 506 | 506 |
| 507 } // namespace blink | 507 } // namespace blink |
| 508 | 508 |
| OLD | NEW |