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

Unified Diff: Source/platform/audio/Spatializer.h

Issue 691143007: Implement StereoPannerNode for robust stereo panning (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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: Source/platform/audio/Spatializer.h
diff --git a/Source/platform/audio/Spatializer.h b/Source/platform/audio/Spatializer.h
new file mode 100644
index 0000000000000000000000000000000000000000..63c5ded4d26aee1412967b9c081f6dc75b91c10d
--- /dev/null
+++ b/Source/platform/audio/Spatializer.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef Spatializer_h
+#define Spatializer_h
+
+#include "platform/PlatformExport.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class AudioBus;
+
+// Abstract base class for spatializing a mono or stereo source.
+class PLATFORM_EXPORT Spatializer : public GarbageCollectedFinalized<Spatializer> {
haraken 2014/11/13 02:08:27 I guess "Finalized" is not needed.
hongchan 2014/11/13 18:38:20 Done.
+public:
+ enum {
+ PanningModelEqualPower = 0
+ };
+
+ typedef unsigned PanningModel;
+
+ static Spatializer* create(PanningModel, float sampleRate);
+
+ virtual ~Spatializer() { };
haraken 2014/11/13 02:08:27 You can remove this destructor.
hongchan 2014/11/13 18:38:20 Done.
+
+ // Handle sample-accurate panning by AudioParam automation.
+ virtual void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBuf, const float* panValues, size_t framesToProcess) = 0;
+
+ // Handle de-zippered panning to a target value.
+ virtual void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float panValue, size_t framesToProcess) = 0;
+
+ virtual void reset() = 0;
+ virtual double tailTime() const = 0;
+ virtual double latencyTime() const = 0;
+
+ virtual void trace(Visitor*) { }
+
+protected:
+ Spatializer(PanningModel model) { }
haraken 2014/11/13 02:08:27 Add explicit.
hongchan 2014/11/13 18:38:20 Done.
+};
+
+} // namespace blink
+
+#endif // Spatializer_h

Powered by Google App Engine
This is Rietveld 408576698