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

Side by Side Diff: Source/core/platform/audio/Panner.h

Issue 14636011: Support multiple HRTFDatabases for different sample-rates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add ASSERT(isMainThread()) Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/platform/audio/HRTFPanner.cpp ('k') | Source/core/platform/audio/Panner.cpp » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 16 matching lines...) Expand all
27 */ 27 */
28 28
29 #ifndef Panner_h 29 #ifndef Panner_h
30 #define Panner_h 30 #define Panner_h
31 31
32 #include <wtf/PassOwnPtr.h> 32 #include <wtf/PassOwnPtr.h>
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 class AudioBus; 36 class AudioBus;
37 class HRTFDatabaseLoader;
37 38
38 // Abstract base class for panning a mono or stereo source. 39 // Abstract base class for panning a mono or stereo source.
39 40
40 class Panner { 41 class Panner {
41 public: 42 public:
42 enum { 43 enum {
43 PanningModelEqualPower = 0, 44 PanningModelEqualPower = 0,
44 PanningModelHRTF = 1, 45 PanningModelHRTF = 1,
45 PanningModelSoundField = 2 46 PanningModelSoundField = 2
46 }; 47 };
47 48
48 typedef unsigned PanningModel; 49 typedef unsigned PanningModel;
49 50
50 static PassOwnPtr<Panner> create(PanningModel, float sampleRate); 51 static PassOwnPtr<Panner> create(PanningModel, float sampleRate, HRTFDatabas eLoader*);
51 52
52 virtual ~Panner() { }; 53 virtual ~Panner() { };
53 54
54 PanningModel panningModel() const { return m_panningModel; } 55 PanningModel panningModel() const { return m_panningModel; }
55 56
56 virtual void pan(double azimuth, double elevation, const AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess) = 0; 57 virtual void pan(double azimuth, double elevation, const AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess) = 0;
57 58
58 virtual void reset() = 0; 59 virtual void reset() = 0;
59 60
60 virtual double tailTime() const = 0; 61 virtual double tailTime() const = 0;
61 virtual double latencyTime() const = 0; 62 virtual double latencyTime() const = 0;
62 63
63 protected: 64 protected:
64 Panner(PanningModel model) : m_panningModel(model) { } 65 Panner(PanningModel model) : m_panningModel(model) { }
65 66
66 PanningModel m_panningModel; 67 PanningModel m_panningModel;
67 }; 68 };
68 69
69 } // namespace WebCore 70 } // namespace WebCore
70 71
71 #endif // Panner_h 72 #endif // Panner_h
OLDNEW
« no previous file with comments | « Source/core/platform/audio/HRTFPanner.cpp ('k') | Source/core/platform/audio/Panner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698