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

Unified Diff: third_party/WebKit/Source/platform/audio/StereoPanner.cpp

Issue 2272683003: Remove redundant definition of Spatializer abstract class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Detach StereoPanner from Panner base class (plus rebasing) Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/audio/StereoPanner.cpp
diff --git a/third_party/WebKit/Source/platform/audio/StereoPanner.cpp b/third_party/WebKit/Source/platform/audio/StereoPanner.cpp
index bc636e286b0b1da790ddbd706a9991c04a829a3e..9e9708d70fe3f66ab2e3236a1108340098300d99 100644
--- a/third_party/WebKit/Source/platform/audio/StereoPanner.cpp
+++ b/third_party/WebKit/Source/platform/audio/StereoPanner.cpp
@@ -13,15 +13,16 @@ const float SmoothingTimeConstant = 0.050f;
namespace blink {
-// Implement equal-power panning algorithm for mono or stereo input.
-// See: http://webaudio.github.io/web-audio-api/#panning-algorithm
+std::unique_ptr<StereoPanner> StereoPanner::create(float sampleRate)
+{
+ return wrapUnique(new StereoPanner(sampleRate));
+}
-StereoPanner::StereoPanner(float sampleRate) : Spatializer(PanningModelEqualPower)
- , m_isFirstRender(true)
+StereoPanner::StereoPanner(float sampleRate)
+ : m_isFirstRender(true)
+ , m_smoothingConstant(AudioUtilities::discreteTimeConstantForSampleRate(SmoothingTimeConstant, sampleRate))
, m_pan(0.0)
{
- // Convert smoothing time (50ms) to a per-sample time value.
- m_smoothingConstant = AudioUtilities::discreteTimeConstantForSampleRate(SmoothingTimeConstant, sampleRate);
Raymond Toy 2016/08/24 18:30:29 I'd prefer not changing these lines.
hongchan 2016/08/24 21:52:33 Done.
}
void StereoPanner::panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBus, const float* panValues, size_t framesToProcess)
@@ -168,4 +169,3 @@ void StereoPanner::panToTargetValue(const AudioBus* inputBus, AudioBus* outputBu
}
} // namespace blink
-

Powered by Google App Engine
This is Rietveld 408576698