Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/ConstantSourceNode.h

Issue 2134813002: Implement ConstantSourceNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ConstantSourceNode_h
6 #define ConstantSourceNode_h
7
8 #include "modules/webaudio/AudioParam.h"
9 #include "modules/webaudio/AudioScheduledSourceNode.h"
10 #include "platform/audio/AudioBus.h"
11 #include "wtf/PassRefPtr.h"
12 #include "wtf/RefPtr.h"
13 #include "wtf/Threading.h"
14
15 namespace blink {
16
17 class BaseAudioContext;
18 class ConstantSourceOptions;
19 class ExceptionState;
20
21 // ConstantSourceNode is an audio generator for a constant source
22
23 class ConstantSourceHandler final : public AudioScheduledSourceHandler {
24 public:
25 static PassRefPtr<ConstantSourceHandler> create(AudioNode&,
26 float sampleRate,
27 AudioParamHandler& offset);
28 ~ConstantSourceHandler() override;
29
30 // AudioHandler
31 void process(size_t framesToProcess) override;
32
33 private:
34 ConstantSourceHandler(AudioNode&,
35 float sampleRate,
36 AudioParamHandler& offset);
37
38 // If we are no longer playing, propogate silence ahead to downstream nodes.
39 bool propagatesSilence() const override;
40
41 RefPtr<AudioParamHandler> m_offset;
42 AudioFloatArray m_sampleAccurateValues;
43 };
44
45 class ConstantSourceNode final : public AudioScheduledSourceNode {
46 DEFINE_WRAPPERTYPEINFO();
47
48 public:
49 static ConstantSourceNode* create(BaseAudioContext&, ExceptionState&);
50 static ConstantSourceNode* create(BaseAudioContext*,
51 const ConstantSourceOptions&,
52 ExceptionState&);
53 DECLARE_VIRTUAL_TRACE();
54
55 AudioParam* offset();
56
57 private:
58 ConstantSourceNode(BaseAudioContext&);
59 ConstantSourceHandler& constantSourceHandler() const;
60
61 Member<AudioParam> m_offset;
62 };
63
64 } // namespace blink
65
66 #endif // ConstantSourceNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698