| 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 17 matching lines...) Expand all Loading... |
| 28 #include "modules/webaudio/AudioParam.h" | 28 #include "modules/webaudio/AudioParam.h" |
| 29 #include "modules/webaudio/AudioScheduledSourceNode.h" | 29 #include "modules/webaudio/AudioScheduledSourceNode.h" |
| 30 #include "platform/audio/AudioBus.h" | 30 #include "platform/audio/AudioBus.h" |
| 31 #include "wtf/OwnPtr.h" | 31 #include "wtf/OwnPtr.h" |
| 32 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 33 #include "wtf/RefPtr.h" | 33 #include "wtf/RefPtr.h" |
| 34 #include "wtf/Threading.h" | 34 #include "wtf/Threading.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class AbstractAudioContext; | 38 class BaseAudioContext; |
| 39 class ExceptionState; | 39 class ExceptionState; |
| 40 class PeriodicWave; | 40 class PeriodicWave; |
| 41 | 41 |
| 42 // OscillatorNode is an audio generator of periodic waveforms. | 42 // OscillatorNode is an audio generator of periodic waveforms. |
| 43 | 43 |
| 44 class OscillatorHandler final : public AudioScheduledSourceHandler { | 44 class OscillatorHandler final : public AudioScheduledSourceHandler { |
| 45 public: | 45 public: |
| 46 // The waveform type. | 46 // The waveform type. |
| 47 // These must be defined as in the .idl file. | 47 // These must be defined as in the .idl file. |
| 48 enum { | 48 enum { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 AudioFloatArray m_detuneValues; | 93 AudioFloatArray m_detuneValues; |
| 94 | 94 |
| 95 // This Persistent doesn't make a reference cycle including the owner | 95 // This Persistent doesn't make a reference cycle including the owner |
| 96 // OscillatorNode. | 96 // OscillatorNode. |
| 97 Persistent<PeriodicWave> m_periodicWave; | 97 Persistent<PeriodicWave> m_periodicWave; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 class OscillatorNode final : public AudioScheduledSourceNode { | 100 class OscillatorNode final : public AudioScheduledSourceNode { |
| 101 DEFINE_WRAPPERTYPEINFO(); | 101 DEFINE_WRAPPERTYPEINFO(); |
| 102 public: | 102 public: |
| 103 static OscillatorNode* create(AbstractAudioContext&, float sampleRate); | 103 static OscillatorNode* create(BaseAudioContext&, float sampleRate); |
| 104 DECLARE_VIRTUAL_TRACE(); | 104 DECLARE_VIRTUAL_TRACE(); |
| 105 | 105 |
| 106 String type() const; | 106 String type() const; |
| 107 void setType(const String&, ExceptionState&); | 107 void setType(const String&, ExceptionState&); |
| 108 AudioParam* frequency(); | 108 AudioParam* frequency(); |
| 109 AudioParam* detune(); | 109 AudioParam* detune(); |
| 110 void setPeriodicWave(PeriodicWave*); | 110 void setPeriodicWave(PeriodicWave*); |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 OscillatorNode(AbstractAudioContext&, float sampleRate); | 113 OscillatorNode(BaseAudioContext&, float sampleRate); |
| 114 OscillatorHandler& oscillatorHandler() const; | 114 OscillatorHandler& oscillatorHandler() const; |
| 115 | 115 |
| 116 Member<AudioParam> m_frequency; | 116 Member<AudioParam> m_frequency; |
| 117 Member<AudioParam> m_detune; | 117 Member<AudioParam> m_detune; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| 121 | 121 |
| 122 #endif // OscillatorNode_h | 122 #endif // OscillatorNode_h |
| OLD | NEW |