| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // If we get close enough then snap to actual value. | 89 // If we get close enough then snap to actual value. |
| 90 if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the thres
hold needs to be adjustable depending on range - but this is OK general purpose
value. | 90 if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the thres
hold needs to be adjustable depending on range - but this is OK general purpose
value. |
| 91 m_smoothedValue = m_value; | 91 m_smoothedValue = m_value; |
| 92 } | 92 } |
| 93 | 93 |
| 94 return false; | 94 return false; |
| 95 } | 95 } |
| 96 | 96 |
| 97 float AudioParam::finalValue() | 97 float AudioParam::finalValue() |
| 98 { | 98 { |
| 99 float value; | 99 float value = m_value; |
| 100 calculateFinalValues(&value, 1, false); | 100 calculateFinalValues(&value, 1, false); |
| 101 return value; | 101 return value; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void AudioParam::calculateSampleAccurateValues(float* values, unsigned numberOfV
alues) | 104 void AudioParam::calculateSampleAccurateValues(float* values, unsigned numberOfV
alues) |
| 105 { | 105 { |
| 106 bool isSafe = context() && context()->isAudioThread() && values && numberOfV
alues; | 106 bool isSafe = context() && context()->isAudioThread() && values && numberOfV
alues; |
| 107 ASSERT(isSafe); | 107 ASSERT(isSafe); |
| 108 if (!isSafe) | 108 if (!isSafe) |
| 109 return; | 109 return; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (m_outputs.contains(output)) { | 191 if (m_outputs.contains(output)) { |
| 192 m_outputs.remove(output); | 192 m_outputs.remove(output); |
| 193 changedOutputs(); | 193 changedOutputs(); |
| 194 output->removeParam(this); | 194 output->removeParam(this); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace WebCore | 198 } // namespace WebCore |
| 199 | 199 |
| 200 #endif // ENABLE(WEB_AUDIO) | 200 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |