| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 bool OscillatorHandler::propagatesSilence() const | 326 bool OscillatorHandler::propagatesSilence() const |
| 327 { | 327 { |
| 328 return !isPlayingOrScheduled() || hasFinished() || !m_periodicWave.get(); | 328 return !isPlayingOrScheduled() || hasFinished() || !m_periodicWave.get(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 // ---------------------------------------------------------------- | 331 // ---------------------------------------------------------------- |
| 332 | 332 |
| 333 OscillatorNode::OscillatorNode(AbstractAudioContext& context) | 333 OscillatorNode::OscillatorNode(AbstractAudioContext& context) |
| 334 : AudioScheduledSourceNode(context) | 334 : AudioScheduledSourceNode(context) |
| 335 // Use musical pitch standard A440 as a default. | 335 // Use musical pitch standard A440 as a default. |
| 336 , m_frequency(AudioParam::create(context, ParamTypeOscillatorFrequency, 440,
0, context.sampleRate() / 2)) | 336 , m_frequency(AudioParam::create(context, ParamTypeOscillatorFrequency, 440, |
| 337 - context.sampleRate() / 2, |
| 338 context.sampleRate() / 2)) |
| 337 // Default to no detuning. | 339 // Default to no detuning. |
| 338 , m_detune(AudioParam::create(context, ParamTypeOscillatorDetune, 0)) | 340 , m_detune(AudioParam::create(context, ParamTypeOscillatorDetune, 0)) |
| 339 { | 341 { |
| 340 setHandler(OscillatorHandler::create(*this, context.sampleRate(), m_frequenc
y->handler(), m_detune->handler())); | 342 setHandler(OscillatorHandler::create(*this, context.sampleRate(), m_frequenc
y->handler(), m_detune->handler())); |
| 341 } | 343 } |
| 342 | 344 |
| 343 OscillatorNode* OscillatorNode::create(AbstractAudioContext& context, ExceptionS
tate& exceptionState) | 345 OscillatorNode* OscillatorNode::create(AbstractAudioContext& context, ExceptionS
tate& exceptionState) |
| 344 { | 346 { |
| 345 DCHECK(isMainThread()); | 347 DCHECK(isMainThread()); |
| 346 | 348 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 return m_detune; | 386 return m_detune; |
| 385 } | 387 } |
| 386 | 388 |
| 387 void OscillatorNode::setPeriodicWave(PeriodicWave* wave) | 389 void OscillatorNode::setPeriodicWave(PeriodicWave* wave) |
| 388 { | 390 { |
| 389 oscillatorHandler().setPeriodicWave(wave); | 391 oscillatorHandler().setPeriodicWave(wave); |
| 390 } | 392 } |
| 391 | 393 |
| 392 } // namespace blink | 394 } // namespace blink |
| 393 | 395 |
| OLD | NEW |