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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp

Issue 1865583002: Implement BaseAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 m_analyser.setSmoothingTimeConstant(k); 106 m_analyser.setSmoothingTimeConstant(k);
107 } else { 107 } else {
108 exceptionState.throwDOMException( 108 exceptionState.throwDOMException(
109 IndexSizeError, 109 IndexSizeError,
110 ExceptionMessages::indexOutsideRange("smoothing value", k, 0.0, Exce ptionMessages::InclusiveBound, 1.0, ExceptionMessages::InclusiveBound)); 110 ExceptionMessages::indexOutsideRange("smoothing value", k, 0.0, Exce ptionMessages::InclusiveBound, 1.0, ExceptionMessages::InclusiveBound));
111 } 111 }
112 } 112 }
113 113
114 // ---------------------------------------------------------------- 114 // ----------------------------------------------------------------
115 115
116 AnalyserNode::AnalyserNode(AbstractAudioContext& context, float sampleRate) 116 AnalyserNode::AnalyserNode(BaseAudioContext& context, float sampleRate)
117 : AudioBasicInspectorNode(context) 117 : AudioBasicInspectorNode(context)
118 { 118 {
119 setHandler(AnalyserHandler::create(*this, sampleRate)); 119 setHandler(AnalyserHandler::create(*this, sampleRate));
120 } 120 }
121 121
122 AnalyserNode* AnalyserNode::create(AbstractAudioContext& context, float sampleRa te) 122 AnalyserNode* AnalyserNode::create(BaseAudioContext& context, float sampleRate)
123 { 123 {
124 return new AnalyserNode(context, sampleRate); 124 return new AnalyserNode(context, sampleRate);
125 } 125 }
126 126
127 AnalyserHandler& AnalyserNode::analyserHandler() const 127 AnalyserHandler& AnalyserNode::analyserHandler() const
128 { 128 {
129 return static_cast<AnalyserHandler&>(handler()); 129 return static_cast<AnalyserHandler&>(handler());
130 } 130 }
131 131
132 unsigned AnalyserNode::fftSize() const 132 unsigned AnalyserNode::fftSize() const
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 analyserHandler().getFloatTimeDomainData(array); 189 analyserHandler().getFloatTimeDomainData(array);
190 } 190 }
191 191
192 void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array) 192 void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array)
193 { 193 {
194 analyserHandler().getByteTimeDomainData(array); 194 analyserHandler().getByteTimeDomainData(array);
195 } 195 }
196 196
197 } // namespace blink 197 } // namespace blink
198 198
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698