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

Side by Side Diff: Source/modules/webaudio/AudioBufferSourceNode.h

Issue 635233004: Replace FINAL and OVERRIDE with their C++11 counterparts in Source/modules (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/modules/webaudio/AudioBuffer.h ('k') | Source/modules/webaudio/AudioContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * 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 24 matching lines...) Expand all
35 #include "wtf/RefPtr.h" 35 #include "wtf/RefPtr.h"
36 #include "wtf/Threading.h" 36 #include "wtf/Threading.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class AudioContext; 40 class AudioContext;
41 41
42 // AudioBufferSourceNode is an AudioNode representing an audio source from an in -memory audio asset represented by an AudioBuffer. 42 // AudioBufferSourceNode is an AudioNode representing an audio source from an in -memory audio asset represented by an AudioBuffer.
43 // It generally will be used for short sounds which require a high degree of sch eduling flexibility (can playback in rhythmically perfect ways). 43 // It generally will be used for short sounds which require a high degree of sch eduling flexibility (can playback in rhythmically perfect ways).
44 44
45 class AudioBufferSourceNode FINAL : public AudioScheduledSourceNode { 45 class AudioBufferSourceNode final : public AudioScheduledSourceNode {
46 DEFINE_WRAPPERTYPEINFO(); 46 DEFINE_WRAPPERTYPEINFO();
47 public: 47 public:
48 static AudioBufferSourceNode* create(AudioContext*, float sampleRate); 48 static AudioBufferSourceNode* create(AudioContext*, float sampleRate);
49 49
50 virtual ~AudioBufferSourceNode(); 50 virtual ~AudioBufferSourceNode();
51 51
52 // AudioNode 52 // AudioNode
53 virtual void dispose() OVERRIDE; 53 virtual void dispose() override;
54 virtual void process(size_t framesToProcess) OVERRIDE; 54 virtual void process(size_t framesToProcess) override;
55 55
56 // setBuffer() is called on the main thread. This is the buffer we use for p layback. 56 // setBuffer() is called on the main thread. This is the buffer we use for p layback.
57 void setBuffer(AudioBuffer*, ExceptionState&); 57 void setBuffer(AudioBuffer*, ExceptionState&);
58 AudioBuffer* buffer() { return m_buffer.get(); } 58 AudioBuffer* buffer() { return m_buffer.get(); }
59 59
60 // numberOfChannels() returns the number of output channels. This value equ als the number of channels from the buffer. 60 // numberOfChannels() returns the number of output channels. This value equ als the number of channels from the buffer.
61 // If a new buffer is set with a different number of channels, then this val ue will dynamically change. 61 // If a new buffer is set with a different number of channels, then this val ue will dynamically change.
62 unsigned numberOfChannels(); 62 unsigned numberOfChannels();
63 63
64 // Play-state 64 // Play-state
(...skipping 14 matching lines...) Expand all
79 void setLoopStart(double loopStart) { m_loopStart = loopStart; } 79 void setLoopStart(double loopStart) { m_loopStart = loopStart; }
80 void setLoopEnd(double loopEnd) { m_loopEnd = loopEnd; } 80 void setLoopEnd(double loopEnd) { m_loopEnd = loopEnd; }
81 81
82 AudioParam* playbackRate() { return m_playbackRate.get(); } 82 AudioParam* playbackRate() { return m_playbackRate.get(); }
83 83
84 // If a panner node is set, then we can incorporate doppler shift into the p layback pitch rate. 84 // If a panner node is set, then we can incorporate doppler shift into the p layback pitch rate.
85 void setPannerNode(PannerNode*); 85 void setPannerNode(PannerNode*);
86 void clearPannerNode(); 86 void clearPannerNode();
87 87
88 // If we are no longer playing, propogate silence ahead to downstream nodes. 88 // If we are no longer playing, propogate silence ahead to downstream nodes.
89 virtual bool propagatesSilence() const OVERRIDE; 89 virtual bool propagatesSilence() const override;
90 90
91 // AudioScheduledSourceNode 91 // AudioScheduledSourceNode
92 virtual void finish() OVERRIDE; 92 virtual void finish() override;
93 93
94 virtual void trace(Visitor*) OVERRIDE; 94 virtual void trace(Visitor*) override;
95 95
96 private: 96 private:
97 AudioBufferSourceNode(AudioContext*, float sampleRate); 97 AudioBufferSourceNode(AudioContext*, float sampleRate);
98 98
99 // Returns true on success. 99 // Returns true on success.
100 bool renderFromBuffer(AudioBus*, unsigned destinationFrameOffset, size_t num berOfFrames); 100 bool renderFromBuffer(AudioBus*, unsigned destinationFrameOffset, size_t num berOfFrames);
101 101
102 // Render silence starting from "index" frame in AudioBus. 102 // Render silence starting from "index" frame in AudioBus.
103 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, si ze_t framesToProcess); 103 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, si ze_t framesToProcess);
104 104
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // AudioNode::breakConnection() when we remove an AudioNode from this. 142 // AudioNode::breakConnection() when we remove an AudioNode from this.
143 Member<PannerNode> m_pannerNode; 143 Member<PannerNode> m_pannerNode;
144 144
145 // This synchronizes process() with setBuffer() which can cause dynamic chan nel count changes. 145 // This synchronizes process() with setBuffer() which can cause dynamic chan nel count changes.
146 mutable Mutex m_processLock; 146 mutable Mutex m_processLock;
147 }; 147 };
148 148
149 } // namespace blink 149 } // namespace blink
150 150
151 #endif // AudioBufferSourceNode_h 151 #endif // AudioBufferSourceNode_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioBuffer.h ('k') | Source/modules/webaudio/AudioContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698