1 /*---------------------------------------------------------------------------- 2 * 3 * File: 4 * eas_pan.h 5 * 6 * Contents and purpose: 7 * Calculates left and right gain multipliers based on a pan value from -63 to +63 8 * 9 * NOTES: 10 * The _CMX_PARSER and _MFI_PARSER preprocessor symbols determine 11 * whether the parser works for those particular file formats. 12 * 13 * Copyright Sonic Network Inc. 2005 14 15 * Licensed under the Apache License, Version 2.0 (the "License"); 16 * you may not use this file except in compliance with the License. 17 * You may obtain a copy of the License at 18 * 19 * http://www.apache.org/licenses/LICENSE-2.0 20 * 21 * Unless required by applicable law or agreed to in writing, software 22 * distributed under the License is distributed on an "AS IS" BASIS, 23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 * See the License for the specific language governing permissions and 25 * limitations under the License. 26 * 27 *---------------------------------------------------------------------------- 28 * Revision Control: 29 * $Revision: 82 $ 30 * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 31 *---------------------------------------------------------------------------- 32 */ 33 34 #ifndef _EAS_PAN_H 35 #define _EAS_PAN_H 36 37 #include "eas_types.h" 38 39 /*---------------------------------------------------------------------------- 40 * EAS_CalcPanControl() 41 *---------------------------------------------------------------------------- 42 * Purpose: 43 * Assign the left and right gain values corresponding to the given pan value. 44 * 45 * This routine uses sin/cos approximations for an equal power curve: 46 * 47 * sin(x) = (2-4*c)*x^2 + c + x 48 * cos(x) = (2-4*c)*x^2 + c - x 49 * 50 * where c = 1/sqrt(2) 51 * using the a0 + x*(a1 + x*a2) approach 52 * 53 * Inputs: 54 * pan - pan value (-63 to + 63) 55 * 56 * Outputs: 57 * pGainLeft linear gain multiplier for left channel (15-bit fraction) 58 * pGainRight linear gain multiplier for left channel (15-bit fraction) 59 * 60 * Side Effects: 61 *---------------------------------------------------------------------------- 62 */ 63 void EAS_CalcPanControl (EAS_INT pan, EAS_I16 *pGainLeft, EAS_I16 *pGainRight); 64 65 #endif /* #ifndef _EAS_PAN_H */ 66 67