[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

crogers at google.com crogers at google.com
Wed Dec 22 12:59:28 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c8b139c1e4d52ae12c24e4b142315054ef391a78
Author: crogers at google.com <crogers at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 3 19:04:49 2010 +0000

    2010-09-03  Chris Rogers  <crogers at google.com>
    
            Reviewed by Kenneth Russell.
    
            Add Panner files
            https://bugs.webkit.org/show_bug.cgi?id=45076
    
            No new tests since audio API is not yet implemented.
    
            * platform/audio/Panner.cpp: Added.
            (WebCore::Panner::create):
            * platform/audio/Panner.h: Added.
            (WebCore::Panner::~Panner):
            (WebCore::Panner::panningModel):
            (WebCore::Panner::Panner):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 152e644..24a19d0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,22 @@
 
         Reviewed by Kenneth Russell.
 
+        Add Panner files
+        https://bugs.webkit.org/show_bug.cgi?id=45076
+
+        No new tests since audio API is not yet implemented.
+
+        * platform/audio/Panner.cpp: Added.
+        (WebCore::Panner::create):
+        * platform/audio/Panner.h: Added.
+        (WebCore::Panner::~Panner):
+        (WebCore::Panner::panningModel):
+        (WebCore::Panner::Panner):
+
+2010-09-03  Chris Rogers  <crogers at google.com>
+
+        Reviewed by Kenneth Russell.
+
         Add AudioListener files
         https://bugs.webkit.org/show_bug.cgi?id=45006
 
diff --git a/WebCore/platform/audio/Panner.cpp b/WebCore/platform/audio/Panner.cpp
new file mode 100644
index 0000000..29a1fbe
--- /dev/null
+++ b/WebCore/platform/audio/Panner.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "Panner.h"
+
+#include "EqualPowerPanner.h"
+#include "HRTFPanner.h"
+#include "PassThroughPanner.h"
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+
+PassOwnPtr<Panner> Panner::create(PanningModel model, double sampleRate)
+{
+    OwnPtr<Panner> panner;
+
+    switch (model) {
+    case PanningModelEqualPower:
+        panner = adoptPtr(new EqualPowerPanner());
+        break;
+
+    case PanningModelHRTF:
+        panner = adoptPtr(new HRTFPanner(sampleRate));
+        break;
+
+    case PanningModelPassthrough:
+        panner = adoptPtr(new PassThroughPanner());
+        break;
+
+    // FIXME: sound field panning is not yet implemented...
+    case PanningModelSoundField:
+    default:
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+
+    return panner.release();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/Panner.h b/WebCore/platform/audio/Panner.h
new file mode 100644
index 0000000..c8e219b
--- /dev/null
+++ b/WebCore/platform/audio/Panner.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Panner_h
+#define Panner_h
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class AudioBus;
+
+// Abstract base class for panning a mono or stereo source.
+
+class Panner {
+public:
+    enum {
+        PanningModelPassthrough = 0,
+        PanningModelEqualPower = 1,
+        PanningModelHRTF = 2,
+        PanningModelSoundField = 3
+    };
+    
+    typedef unsigned PanningModel;
+
+    static PassOwnPtr<Panner> create(PanningModel model, double sampleRate);
+
+    virtual ~Panner() { };
+
+    PanningModel panningModel() const { return m_panningModel; }
+
+    virtual void pan(double azimuth, double elevation, AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess) = 0;
+
+    virtual void reset() = 0;
+
+protected:
+    Panner(PanningModel model) : m_panningModel(model) { }
+
+    PanningModel m_panningModel;
+};
+
+} // namespace WebCore
+
+#endif // Panner_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list