| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void OscillatorNode::setType(const String& type) | 100 void OscillatorNode::setType(const String& type) |
| 101 { | 101 { |
| 102 if (type == "sine") | 102 if (type == "sine") |
| 103 setType(SINE); | 103 setType(SINE); |
| 104 else if (type == "square") | 104 else if (type == "square") |
| 105 setType(SQUARE); | 105 setType(SQUARE); |
| 106 else if (type == "sawtooth") | 106 else if (type == "sawtooth") |
| 107 setType(SAWTOOTH); | 107 setType(SAWTOOTH); |
| 108 else if (type == "triangle") | 108 else if (type == "triangle") |
| 109 setType(TRIANGLE); | 109 setType(TRIANGLE); |
| 110 else | |
| 111 ASSERT_NOT_REACHED(); | |
| 112 } | 110 } |
| 113 | 111 |
| 114 bool OscillatorNode::setType(unsigned type) | 112 bool OscillatorNode::setType(unsigned type) |
| 115 { | 113 { |
| 116 PeriodicWave* periodicWave = 0; | 114 PeriodicWave* periodicWave = 0; |
| 117 float sampleRate = this->sampleRate(); | 115 float sampleRate = this->sampleRate(); |
| 118 | 116 |
| 119 switch (type) { | 117 switch (type) { |
| 120 case SINE: { | 118 case SINE: { |
| 121 DEFINE_STATIC_REF(PeriodicWave, periodicWaveSine, (PeriodicWave::createS
ine(sampleRate))); | 119 DEFINE_STATIC_REF(PeriodicWave, periodicWaveSine, (PeriodicWave::createS
ine(sampleRate))); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 337 } |
| 340 | 338 |
| 341 bool OscillatorNode::propagatesSilence() const | 339 bool OscillatorNode::propagatesSilence() const |
| 342 { | 340 { |
| 343 return !isPlayingOrScheduled() || hasFinished() || !m_periodicWave.get(); | 341 return !isPlayingOrScheduled() || hasFinished() || !m_periodicWave.get(); |
| 344 } | 342 } |
| 345 | 343 |
| 346 } // namespace WebCore | 344 } // namespace WebCore |
| 347 | 345 |
| 348 #endif // ENABLE(WEB_AUDIO) | 346 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |