OLD | NEW |
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // sourceL -> destL and "equal-power pan" sourceR as in mono case | 94 // sourceL -> destL and "equal-power pan" sourceR as in mono case |
95 // by transforming the "azimuth" value from -90 -> 0 degrees into th
e range -90 -> +90. | 95 // by transforming the "azimuth" value from -90 -> 0 degrees into th
e range -90 -> +90. |
96 desiredPanPosition = (azimuth + 90) / 90; | 96 desiredPanPosition = (azimuth + 90) / 90; |
97 } else { // from 0 -> +90 | 97 } else { // from 0 -> +90 |
98 // sourceR -> destR and "equal-power pan" sourceL as in mono case | 98 // sourceR -> destR and "equal-power pan" sourceL as in mono case |
99 // by transforming the "azimuth" value from 0 -> +90 degrees into th
e range -90 -> +90. | 99 // by transforming the "azimuth" value from 0 -> +90 degrees into th
e range -90 -> +90. |
100 desiredPanPosition = azimuth / 90; | 100 desiredPanPosition = azimuth / 90; |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 desiredGainL = cos(0.5 * piDouble * desiredPanPosition); | 104 desiredGainL = cos(piOverTwoDouble * desiredPanPosition); |
105 desiredGainR = sin(0.5 * piDouble * desiredPanPosition); | 105 desiredGainR = sin(piOverTwoDouble * desiredPanPosition); |
106 | 106 |
107 // Don't de-zipper on first render call. | 107 // Don't de-zipper on first render call. |
108 if (m_isFirstRender) { | 108 if (m_isFirstRender) { |
109 m_isFirstRender = false; | 109 m_isFirstRender = false; |
110 m_gainL = desiredGainL; | 110 m_gainL = desiredGainL; |
111 m_gainR = desiredGainR; | 111 m_gainR = desiredGainR; |
112 } | 112 } |
113 | 113 |
114 // Cache in local variables. | 114 // Cache in local variables. |
115 double gainL = m_gainL; | 115 double gainL = m_gainL; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 m_gainL = gainL; | 153 m_gainL = gainL; |
154 m_gainR = gainR; | 154 m_gainR = gainR; |
155 } | 155 } |
156 | 156 |
157 } // namespace WebCore | 157 } // namespace WebCore |
158 | 158 |
159 #endif // ENABLE(WEB_AUDIO) | 159 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |