| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2004-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * Except as expressly set forth in the Authorized License, |
|---|
| 15 | * |
|---|
| 16 | * 1. This program, including its structure, sequence and organization, constitutes the valuable trade |
|---|
| 17 | * secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof, |
|---|
| 18 | * and to use this information only in connection with your use of Broadcom integrated circuit products. |
|---|
| 19 | * |
|---|
| 20 | * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" |
|---|
| 21 | * AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR |
|---|
| 22 | * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO |
|---|
| 23 | * THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES |
|---|
| 24 | * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, |
|---|
| 25 | * LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION |
|---|
| 26 | * OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF |
|---|
| 27 | * USE OR PERFORMANCE OF THE SOFTWARE. |
|---|
| 28 | * |
|---|
| 29 | * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS |
|---|
| 30 | * LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR |
|---|
| 31 | * EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR |
|---|
| 32 | * USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF |
|---|
| 33 | * THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT |
|---|
| 34 | * ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE |
|---|
| 35 | * LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF |
|---|
| 36 | * ANY LIMITED REMEDY. |
|---|
| 37 | * |
|---|
| 38 | * $brcm_Workfile: bape_studio_sound.c $ |
|---|
| 39 | * $brcm_Revision: Hydra_Software_Devel/3 $ |
|---|
| 40 | * $brcm_Date: 8/9/11 10:00a $ |
|---|
| 41 | * |
|---|
| 42 | * API Description: |
|---|
| 43 | * API name: StudioSound |
|---|
| 44 | * Specific APIs related to SRS StudioSound Audio Processing |
|---|
| 45 | * |
|---|
| 46 | * Revision History: |
|---|
| 47 | * |
|---|
| 48 | * $brcm_Log: /magnum/portinginterface/ape/7422/bape_studio_sound.c $ |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/3 8/9/11 10:00a jgarrett |
|---|
| 51 | * SWDTV-6761: Coverity CID 587,588 |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/2 8/8/11 5:38p jgarrett |
|---|
| 54 | * SWDTV-6761: Adding StudioSound |
|---|
| 55 | * |
|---|
| 56 | ***************************************************************************/ |
|---|
| 57 | |
|---|
| 58 | #include "bape.h" |
|---|
| 59 | #include "bape_priv.h" |
|---|
| 60 | #include "bdsp_raaga.h" |
|---|
| 61 | |
|---|
| 62 | BDBG_MODULE(bape_studio_sound); |
|---|
| 63 | |
|---|
| 64 | BDBG_OBJECT_ID(BAPE_StudioSound); |
|---|
| 65 | |
|---|
| 66 | typedef struct BAPE_StudioSound |
|---|
| 67 | { |
|---|
| 68 | BDBG_OBJECT(BAPE_StudioSound) |
|---|
| 69 | BAPE_PathNode node; |
|---|
| 70 | BAPE_StudioSoundSettings settings; |
|---|
| 71 | BAPE_Connector input; |
|---|
| 72 | unsigned branchId; |
|---|
| 73 | struct |
|---|
| 74 | { |
|---|
| 75 | unsigned tvol; /* TruVolume Stage */ |
|---|
| 76 | unsigned cstd; /* CircleSurround/TruDialog Stage */ |
|---|
| 77 | unsigned tshd; /* TruSurroundHd Stage */ |
|---|
| 78 | unsigned eqhl; /* Equalizer/Hard Limiter Stage */ |
|---|
| 79 | } stageId; |
|---|
| 80 | } BAPE_StudioSound; |
|---|
| 81 | |
|---|
| 82 | static BERR_Code BAPE_StudioSound_P_ConnectorSupported(struct BAPE_PathNode *pNode, BAPE_PathConnector *pConnector); |
|---|
| 83 | static BERR_Code BAPE_StudioSound_P_AllocatePathFromInput(struct BAPE_PathNode *pNode, struct BAPE_PathConnection *pConnection); |
|---|
| 84 | static BERR_Code BAPE_StudioSound_P_ConfigPathFromInput(struct BAPE_PathNode *pNode, struct BAPE_PathConnection *pConnection); |
|---|
| 85 | static BERR_Code BAPE_StudioSound_P_ApplyDspSettings(BAPE_StudioSoundHandle handle, BDSP_TaskHandle task); |
|---|
| 86 | static void BAPE_StudioSound_P_StopPathFromInput(struct BAPE_PathNode *pNode, struct BAPE_PathConnection *pConnection); |
|---|
| 87 | static void BAPE_StudioSound_P_RemoveInputCallback(struct BAPE_PathNode *pNode, BAPE_PathConnector *pConnector); |
|---|
| 88 | |
|---|
| 89 | static void BAPE_StudioSound_P_GetDefaultTopLevelSettings( |
|---|
| 90 | BAPE_StudioSoundSettings *pSettings |
|---|
| 91 | ) |
|---|
| 92 | { |
|---|
| 93 | BDSP_Raaga_SrsTruVolumeSettings userConfig; |
|---|
| 94 | |
|---|
| 95 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 96 | |
|---|
| 97 | (void)BDSP_Raaga_GetDefaultAudioProcessingSettings(BDSP_AudioProcessing_eSrsTruVolume, &userConfig, sizeof(userConfig)); |
|---|
| 98 | pSettings->enabled = userConfig.sTopLevelConfig.i32mEnable?true:false; |
|---|
| 99 | pSettings->mode = userConfig.sTopLevelConfig.i32StudioSoundMode == 2?BAPE_StudioSoundMode_eMode2:BAPE_StudioSoundMode_eMode1; |
|---|
| 100 | pSettings->inputGain = 100; |
|---|
| 101 | /*BDBG_ASSERT(userConfig.sTopLevelConfig.i32mInputGain == 0x7fffffff);*/ /* Default is incorrect */ |
|---|
| 102 | pSettings->outputGain = 100; |
|---|
| 103 | /*BDBG_ASSERT(userConfig.sTopLevelConfig.i32mOutputGain == 0x7fffffff);*/ |
|---|
| 104 | pSettings->bypassGain = 100; |
|---|
| 105 | /*BDBG_ASSERT(userConfig.sTopLevelConfig.i32mBypassGain == 0x7fffffff);*/ |
|---|
| 106 | pSettings->headroomGain = 100; |
|---|
| 107 | /*BDBG_ASSERT(userConfig.sTopLevelConfig.i32mHeadroomGain == 0x7fffffff);*/ |
|---|
| 108 | switch ( userConfig.sTopLevelConfig.i32mInputMode ) |
|---|
| 109 | { |
|---|
| 110 | case 0: |
|---|
| 111 | pSettings->inputMode = BAPE_StudioSoundInputMode_eMono; |
|---|
| 112 | break; |
|---|
| 113 | case 1: |
|---|
| 114 | pSettings->inputMode = BAPE_StudioSoundInputMode_eStereo; |
|---|
| 115 | break; |
|---|
| 116 | case 2: |
|---|
| 117 | pSettings->inputMode = BAPE_StudioSoundInputMode_eMultichannel; |
|---|
| 118 | break; |
|---|
| 119 | default: |
|---|
| 120 | case 3: |
|---|
| 121 | pSettings->inputMode = BAPE_StudioSoundInputMode_eLtRt; |
|---|
| 122 | break; |
|---|
| 123 | } |
|---|
| 124 | } |
|---|
| 125 | |
|---|
| 126 | static void BAPE_StudioSound_P_GetDefaultCsTdSettings( |
|---|
| 127 | BAPE_StudioSoundSettings *pSettings |
|---|
| 128 | ) |
|---|
| 129 | { |
|---|
| 130 | BDSP_Raaga_SrsCsdTdSettings userConfig; |
|---|
| 131 | |
|---|
| 132 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 133 | |
|---|
| 134 | (void)BDSP_Raaga_GetDefaultAudioProcessingSettings(BDSP_AudioProcessing_eSrsCsdTd, &userConfig, sizeof(userConfig)); |
|---|
| 135 | pSettings->circleSurround.enabled = userConfig.sCSDecoderConfig.i32mEnable?true:false; |
|---|
| 136 | pSettings->circleSurround.inputGain = 1000; |
|---|
| 137 | BDBG_ASSERT(userConfig.sCSDecoderConfig.i32mInputGain == 0x7fffffff); |
|---|
| 138 | pSettings->circleSurround.mode = (userConfig.sCSDecoderConfig.i32mMode == 1)?BAPE_CircleSurroundMode_eCinema:BAPE_CircleSurroundMode_eMusic; |
|---|
| 139 | pSettings->circleSurround.outputMode = userConfig.sCSDecoderConfig.i32mOutputMode; |
|---|
| 140 | pSettings->circleSurround.outputGainFront = 1000; |
|---|
| 141 | BDBG_ASSERT(userConfig.sCSDecoderConfig.i32mCSDecOutputGainLR == 0x10000000); |
|---|
| 142 | pSettings->circleSurround.outputGainRear = 1000; |
|---|
| 143 | BDBG_ASSERT(userConfig.sCSDecoderConfig.i32mCSDecOutputGainLsRs == 0x10000000); |
|---|
| 144 | pSettings->circleSurround.outputGainCenter = 1000; |
|---|
| 145 | BDBG_ASSERT(userConfig.sCSDecoderConfig.i32mCSDecOutputGainC == 0x10000000); |
|---|
| 146 | pSettings->circleSurround.outputGainSubwoofer = 1000; |
|---|
| 147 | BDBG_ASSERT(userConfig.sCSDecoderConfig.i32mCSDecOutputGainSub == 0x10000000); |
|---|
| 148 | |
|---|
| 149 | pSettings->truDialog.enabled = userConfig.sTruDialogConfig.i32mEnable?true:false; |
|---|
| 150 | pSettings->truDialog.inputGain = 100; |
|---|
| 151 | BDBG_ASSERT(userConfig.sTruDialogConfig.i32mTruDialogInputGain == 0x7fffffff); |
|---|
| 152 | pSettings->truDialog.outputGain = 100; |
|---|
| 153 | BDBG_ASSERT(userConfig.sTruDialogConfig.i32mTruDialogOutputGain == 0x7fffffff); |
|---|
| 154 | pSettings->truDialog.processGain = 150; |
|---|
| 155 | BDBG_ASSERT(userConfig.sTruDialogConfig.i32mTruDialogProcessGain == 0x0c000000); |
|---|
| 156 | pSettings->truDialog.bypassGain = 100; |
|---|
| 157 | BDBG_ASSERT(userConfig.sTruDialogConfig.i32mTruDialogBypassGain == 0x7fffffff); |
|---|
| 158 | pSettings->truDialog.enhancementGain = 100; |
|---|
| 159 | BDBG_ASSERT(userConfig.sTruDialogConfig.i32mTruDialogDialogClarityGain == 0x7fffffff); |
|---|
| 160 | } |
|---|
| 161 | |
|---|
| 162 | static void BAPE_StudioSound_P_GetDefaultEqHlSettings( |
|---|
| 163 | BAPE_StudioSoundSettings *pSettings |
|---|
| 164 | ) |
|---|
| 165 | { |
|---|
| 166 | unsigned i, j; |
|---|
| 167 | static BDSP_Raaga_SrsEqHlSettings userConfig; /* This structure is > 1k. Magnum is not thread safe so this is acceptable */ |
|---|
| 168 | |
|---|
| 169 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 170 | |
|---|
| 171 | (void)BDSP_Raaga_GetDefaultAudioProcessingSettings(BDSP_AudioProcessing_eSrsEqHl, &userConfig, sizeof(userConfig)); |
|---|
| 172 | |
|---|
| 173 | /* GEQ */ |
|---|
| 174 | pSettings->graphicEq.leftEnabled = userConfig.sGraphicEqConfig.i32mEnable[0]?true:false; |
|---|
| 175 | pSettings->graphicEq.rightEnabled = userConfig.sGraphicEqConfig.i32mEnable[1]?true:false; |
|---|
| 176 | switch ( userConfig.sGraphicEqConfig.i32mFilterMode ) |
|---|
| 177 | { |
|---|
| 178 | default: |
|---|
| 179 | case 0: |
|---|
| 180 | pSettings->graphicEq.bandMode = BAPE_SrsGraphicEqBandMode_eFiveBand; |
|---|
| 181 | break; |
|---|
| 182 | case 1: |
|---|
| 183 | pSettings->graphicEq.bandMode = BAPE_SrsGraphicEqBandMode_eTenBand; |
|---|
| 184 | break; |
|---|
| 185 | case 2: |
|---|
| 186 | pSettings->graphicEq.bandMode = BAPE_SrsGraphicEqBandMode_eSpeakerCompensation; |
|---|
| 187 | break; |
|---|
| 188 | } |
|---|
| 189 | BDBG_CASSERT((sizeof(userConfig.sGraphicEqConfig.i32mBandGain)/(2*sizeof(int32_t))) == BAPE_STUDIO_SOUND_MAX_GEQ_BANDS); |
|---|
| 190 | for ( i = 0; i < BAPE_STUDIO_SOUND_MAX_GEQ_BANDS; i++ ) |
|---|
| 191 | { |
|---|
| 192 | pSettings->graphicEq.leftBandGain[i] = 1000; |
|---|
| 193 | BDBG_ASSERT(userConfig.sGraphicEqConfig.i32mBandGain[0][i] == 0x20000000); |
|---|
| 194 | pSettings->graphicEq.rightBandGain[i] = 1000; |
|---|
| 195 | BDBG_ASSERT(userConfig.sGraphicEqConfig.i32mBandGain[1][i] == 0x20000000); |
|---|
| 196 | } |
|---|
| 197 | pSettings->graphicEq.inputGain = 316; |
|---|
| 198 | /*BDBG_ASSERT(userConfig.sGraphicEqConfig.i32mInputGain == 0x2872b021); This does not appear to be correct in the comments vs. structure init */ |
|---|
| 199 | pSettings->graphicEq.outputGain = 100; |
|---|
| 200 | BDBG_ASSERT(userConfig.sGraphicEqConfig.i32mOutputGain == 0x7fffffff); |
|---|
| 201 | pSettings->graphicEq.bypassGain = 100; |
|---|
| 202 | BDBG_ASSERT(userConfig.sGraphicEqConfig.i32mBypassGain == 0x7fffffff); |
|---|
| 203 | |
|---|
| 204 | /* TruEq */ |
|---|
| 205 | pSettings->truEq.leftEnabled = userConfig.sParametricEqConfig.i32mEnable[0]; |
|---|
| 206 | pSettings->truEq.rightEnabled = userConfig.sParametricEqConfig.i32mEnable[1]; |
|---|
| 207 | BDBG_CASSERT((sizeof(userConfig.sParametricEqConfig.i32mBandEnable)/(2*sizeof(int32_t))) == BAPE_STUDIO_SOUND_MAX_PEQ_BANDS); |
|---|
| 208 | for ( i = 0; i < BAPE_STUDIO_SOUND_MAX_PEQ_BANDS; i++ ) |
|---|
| 209 | { |
|---|
| 210 | pSettings->truEq.leftBandEnabled[i] = userConfig.sParametricEqConfig.i32mBandEnable[0][i]?true:false; |
|---|
| 211 | pSettings->truEq.rightBandEnabled[i] = userConfig.sParametricEqConfig.i32mBandEnable[1][i]?true:false; |
|---|
| 212 | } |
|---|
| 213 | pSettings->truEq.inputGain = 100; |
|---|
| 214 | BDBG_ASSERT(userConfig.sParametricEqConfig.i32mInputGain == 0x08000000); |
|---|
| 215 | pSettings->truEq.outputGain = 100; |
|---|
| 216 | BDBG_ASSERT(userConfig.sParametricEqConfig.i32mOutputGain == 0x08000000); |
|---|
| 217 | pSettings->truEq.bypassGain = 100; |
|---|
| 218 | BDBG_ASSERT(userConfig.sParametricEqConfig.i32mBypassGain == 0x08000000); |
|---|
| 219 | pSettings->truEq.coefficientMode = userConfig.sParametricEqConfig.i32CoefGenMode == 1 ? BAPE_SrsFilterCoefficientMode_eSpecification : BAPE_SrsFilterCoefficientMode_eUser; |
|---|
| 220 | for ( i = 0; i < 3; i++ ) |
|---|
| 221 | { |
|---|
| 222 | for ( j = 0; j < BAPE_STUDIO_SOUND_MAX_PEQ_BANDS; j++ ) |
|---|
| 223 | { |
|---|
| 224 | pSettings->truEq.coefficientSettings.user[i][j].filterOrder = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32Order; |
|---|
| 225 | pSettings->truEq.coefficientSettings.user[i][j].scale = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32Scale; |
|---|
| 226 | pSettings->truEq.coefficientSettings.user[i][j].coefficientB0 = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientB0; |
|---|
| 227 | pSettings->truEq.coefficientSettings.user[i][j].coefficientA1 = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientA1; |
|---|
| 228 | pSettings->truEq.coefficientSettings.user[i][j].coefficientB1 = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientB1; |
|---|
| 229 | pSettings->truEq.coefficientSettings.user[i][j].coefficientA2 = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientA2; |
|---|
| 230 | pSettings->truEq.coefficientSettings.user[i][j].coefficientB2 = userConfig.sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientB2; |
|---|
| 231 | } |
|---|
| 232 | } |
|---|
| 233 | for ( i = 0; i < BAPE_STUDIO_SOUND_MAX_PEQ_BANDS; i++ ) |
|---|
| 234 | { |
|---|
| 235 | pSettings->truEq.coefficientSettings.specification[i].bandGain = userConfig.sParametricEqConfig.sFilterSpecPeq[i].i32BandGain; |
|---|
| 236 | pSettings->truEq.coefficientSettings.specification[i].bandFrequency = userConfig.sParametricEqConfig.sFilterSpecPeq[i].ui32BandFrequency; |
|---|
| 237 | pSettings->truEq.coefficientSettings.specification[i].qFactor = userConfig.sParametricEqConfig.sFilterSpecPeq[i].i32QFactor; |
|---|
| 238 | } |
|---|
| 239 | |
|---|
| 240 | /* HPF */ |
|---|
| 241 | pSettings->highPassFilter.enabled = userConfig.sHighPassFilterConfig.ui32mEnable?true:false; |
|---|
| 242 | pSettings->highPassFilter.coefficientMode = userConfig.sHighPassFilterConfig.ui32CoefGenMode == 1 ? BAPE_SrsFilterCoefficientMode_eSpecification : BAPE_SrsFilterCoefficientMode_eUser; |
|---|
| 243 | for ( i = 0; i < 3; i++ ) |
|---|
| 244 | { |
|---|
| 245 | pSettings->highPassFilter.coefficientSettings.user[i].filterOrder = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].ui32Order; |
|---|
| 246 | for ( j = 0; j < 3; j++ ) |
|---|
| 247 | { |
|---|
| 248 | pSettings->highPassFilter.coefficientSettings.user[i].coefficients[j].scale = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32Scale; |
|---|
| 249 | pSettings->highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientB0 = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientB0; |
|---|
| 250 | pSettings->highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientB1 = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientB1; |
|---|
| 251 | pSettings->highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientB2 = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientB2; |
|---|
| 252 | pSettings->highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientA1 = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientA1; |
|---|
| 253 | pSettings->highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientA2 = userConfig.sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientA2; |
|---|
| 254 | } |
|---|
| 255 | } |
|---|
| 256 | pSettings->highPassFilter.coefficientSettings.specification.cutoffFrequency = userConfig.sHighPassFilterConfig.sFilterSpecHpf.ui32CutoffFrequency; |
|---|
| 257 | pSettings->highPassFilter.coefficientSettings.specification.filterOrder = userConfig.sHighPassFilterConfig.sFilterSpecHpf.ui32Order; |
|---|
| 258 | |
|---|
| 259 | /* Hard Limiter */ |
|---|
| 260 | pSettings->hardLimiter.enabled = userConfig.sHardLimiterConfig.i32LimiterEnable?true:false; |
|---|
| 261 | switch ( userConfig.sHardLimiterConfig.i32blockSize ) |
|---|
| 262 | { |
|---|
| 263 | default: |
|---|
| 264 | case 256: |
|---|
| 265 | pSettings->hardLimiter.blockSize = BAPE_SrsHardLimiterBlockSize_e256; |
|---|
| 266 | break; |
|---|
| 267 | case 512: |
|---|
| 268 | pSettings->hardLimiter.blockSize = BAPE_SrsHardLimiterBlockSize_e512; |
|---|
| 269 | break; |
|---|
| 270 | case 768: |
|---|
| 271 | pSettings->hardLimiter.blockSize = BAPE_SrsHardLimiterBlockSize_e768; |
|---|
| 272 | break; |
|---|
| 273 | case 1024: |
|---|
| 274 | pSettings->hardLimiter.blockSize = BAPE_SrsHardLimiterBlockSize_e1024; |
|---|
| 275 | break; |
|---|
| 276 | } |
|---|
| 277 | pSettings->hardLimiter.inputGain = 100; |
|---|
| 278 | /*BDBG_ASSERT(userConfig.sHardLimiterConfig.i32InputGain == 0x20000000);*/ |
|---|
| 279 | pSettings->hardLimiter.outputGain = 100; |
|---|
| 280 | /*BDBG_ASSERT(userConfig.sHardLimiterConfig.i32OutputGain == 0x20000000);*/ |
|---|
| 281 | pSettings->hardLimiter.bypassGain = 100; |
|---|
| 282 | BDBG_ASSERT(userConfig.sHardLimiterConfig.i32BypassGain == 0x7fffffff); |
|---|
| 283 | pSettings->hardLimiter.boost = 2820; |
|---|
| 284 | BDBG_ASSERT(userConfig.sHardLimiterConfig.i32LimiterBoost == 0x0168f5c3); |
|---|
| 285 | pSettings->hardLimiter.level = 100000; |
|---|
| 286 | BDBG_ASSERT(userConfig.sHardLimiterConfig.i32HardLimit == 0x7fffffff); |
|---|
| 287 | pSettings->hardLimiter.delay = userConfig.sHardLimiterConfig.i32DelayLength; |
|---|
| 288 | } |
|---|
| 289 | |
|---|
| 290 | void BAPE_StudioSound_GetDefaultSettings( |
|---|
| 291 | BAPE_StudioSoundSettings *pSettings /* [out] default settings */ |
|---|
| 292 | ) |
|---|
| 293 | { |
|---|
| 294 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 295 | BKNI_Memset(pSettings, 0, sizeof(BAPE_StudioSoundSettings)); |
|---|
| 296 | |
|---|
| 297 | BAPE_StudioSound_P_GetDefaultTopLevelSettings(pSettings); |
|---|
| 298 | BAPE_TruVolume_GetDefaultSettings(&pSettings->truVolume); |
|---|
| 299 | BAPE_TruSurroundHd_GetDefaultSettings(&pSettings->truSurroundHd); |
|---|
| 300 | BAPE_StudioSound_P_GetDefaultCsTdSettings(pSettings); |
|---|
| 301 | BAPE_StudioSound_P_GetDefaultEqHlSettings(pSettings); |
|---|
| 302 | } |
|---|
| 303 | |
|---|
| 304 | BERR_Code BAPE_StudioSound_Create( |
|---|
| 305 | BAPE_Handle deviceHandle, |
|---|
| 306 | const BAPE_StudioSoundSettings *pSettings, |
|---|
| 307 | BAPE_StudioSoundHandle *pHandle |
|---|
| 308 | ) |
|---|
| 309 | { |
|---|
| 310 | BAPE_StudioSoundHandle handle; |
|---|
| 311 | |
|---|
| 312 | BDBG_OBJECT_ASSERT(deviceHandle, BAPE_Device); |
|---|
| 313 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 314 | BDBG_ASSERT(NULL != pHandle); |
|---|
| 315 | |
|---|
| 316 | |
|---|
| 317 | handle = BKNI_Malloc(sizeof(BAPE_StudioSound)); |
|---|
| 318 | if ( NULL == handle ) |
|---|
| 319 | { |
|---|
| 320 | return BERR_TRACE(BERR_OUT_OF_SYSTEM_MEMORY); |
|---|
| 321 | } |
|---|
| 322 | BKNI_Memset(handle, 0, sizeof(BAPE_StudioSound)); |
|---|
| 323 | BDBG_OBJECT_SET(handle, BAPE_StudioSound); |
|---|
| 324 | handle->settings = *pSettings; |
|---|
| 325 | BAPE_P_InitPathNode(&handle->node, BAPE_PathNodeType_ePostProcessor, BAPE_PostProcessorType_eStudioSound, 1, deviceHandle, handle); |
|---|
| 326 | handle->node.pName = "StudioSound"; |
|---|
| 327 | handle->node.paths[0].connector.numChannelPairs = 1; /* Only output stereo */ |
|---|
| 328 | handle->node.paths[0].connector.useBufferPool = true; |
|---|
| 329 | handle->node.paths[0].connector.dataSource = BAPE_DataSource_eDspBuffer; |
|---|
| 330 | |
|---|
| 331 | /* Generic Routines */ |
|---|
| 332 | handle->node.allocatePathToOutput = BAPE_DSP_P_AllocatePathToOutput; |
|---|
| 333 | handle->node.configPathToOutput = BAPE_DSP_P_ConfigPathToOutput; |
|---|
| 334 | handle->node.stopPathToOutput = BAPE_DSP_P_StopPathToOutput; |
|---|
| 335 | handle->node.startPathToOutput = BAPE_DSP_P_StartPathToOutput; |
|---|
| 336 | handle->node.stopPathToOutput = BAPE_DSP_P_StopPathToOutput; |
|---|
| 337 | |
|---|
| 338 | /* StudioSound Specifics */ |
|---|
| 339 | handle->node.connectorSupported = BAPE_StudioSound_P_ConnectorSupported; |
|---|
| 340 | handle->node.allocatePathFromInput = BAPE_StudioSound_P_AllocatePathFromInput; |
|---|
| 341 | handle->node.configPathFromInput = BAPE_StudioSound_P_ConfigPathFromInput; |
|---|
| 342 | handle->node.stopPathFromInput = BAPE_StudioSound_P_StopPathFromInput; |
|---|
| 343 | handle->node.removeInput = BAPE_StudioSound_P_RemoveInputCallback; |
|---|
| 344 | |
|---|
| 345 | *pHandle = handle; |
|---|
| 346 | return BERR_SUCCESS; |
|---|
| 347 | } |
|---|
| 348 | |
|---|
| 349 | void BAPE_StudioSound_Destroy( |
|---|
| 350 | BAPE_StudioSoundHandle handle |
|---|
| 351 | ) |
|---|
| 352 | { |
|---|
| 353 | bool running; |
|---|
| 354 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 355 | running = (handle->node.paths[0].connector.task != NULL)?true:false; |
|---|
| 356 | BDBG_ASSERT(false == running); |
|---|
| 357 | BDBG_ASSERT(NULL == handle->input); |
|---|
| 358 | BDBG_OBJECT_DESTROY(handle, BAPE_StudioSound); |
|---|
| 359 | BKNI_Free(handle); |
|---|
| 360 | } |
|---|
| 361 | |
|---|
| 362 | void BAPE_StudioSound_GetSettings( |
|---|
| 363 | BAPE_StudioSoundHandle handle, |
|---|
| 364 | BAPE_StudioSoundSettings *pSettings /* [out] Settings */ |
|---|
| 365 | ) |
|---|
| 366 | { |
|---|
| 367 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 368 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 369 | *pSettings = handle->settings; |
|---|
| 370 | } |
|---|
| 371 | |
|---|
| 372 | BERR_Code BAPE_StudioSound_SetSettings( |
|---|
| 373 | BAPE_StudioSoundHandle handle, |
|---|
| 374 | const BAPE_StudioSoundSettings *pSettings |
|---|
| 375 | ) |
|---|
| 376 | { |
|---|
| 377 | BERR_Code errCode; |
|---|
| 378 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 379 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 380 | |
|---|
| 381 | if ( pSettings != &handle->settings ) |
|---|
| 382 | { |
|---|
| 383 | handle->settings = *pSettings; |
|---|
| 384 | } |
|---|
| 385 | |
|---|
| 386 | if ( handle->node.paths[0].connector.task != NULL ) |
|---|
| 387 | { |
|---|
| 388 | errCode = BAPE_StudioSound_P_ApplyDspSettings(handle, handle->node.paths[0].connector.task); |
|---|
| 389 | if ( errCode ) |
|---|
| 390 | { |
|---|
| 391 | return BERR_TRACE(errCode); |
|---|
| 392 | } |
|---|
| 393 | } |
|---|
| 394 | |
|---|
| 395 | return BERR_SUCCESS; |
|---|
| 396 | } |
|---|
| 397 | |
|---|
| 398 | |
|---|
| 399 | void BAPE_StudioSound_GetConnector( |
|---|
| 400 | BAPE_StudioSoundHandle handle, |
|---|
| 401 | BAPE_Connector *pConnector |
|---|
| 402 | ) |
|---|
| 403 | { |
|---|
| 404 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 405 | BDBG_ASSERT(NULL != pConnector); |
|---|
| 406 | *pConnector = &handle->node.paths[0].connector; |
|---|
| 407 | } |
|---|
| 408 | |
|---|
| 409 | |
|---|
| 410 | BERR_Code BAPE_StudioSound_AddInput( |
|---|
| 411 | BAPE_StudioSoundHandle handle, |
|---|
| 412 | BAPE_Connector input |
|---|
| 413 | ) |
|---|
| 414 | { |
|---|
| 415 | BERR_Code errCode; |
|---|
| 416 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 417 | BDBG_OBJECT_ASSERT(input, BAPE_PathConnector); |
|---|
| 418 | if ( NULL != handle->input ) |
|---|
| 419 | { |
|---|
| 420 | BDBG_ERR(("Can not have more than one input")); |
|---|
| 421 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 422 | } |
|---|
| 423 | errCode = BAPE_PathNode_P_AddInput(&handle->node, input); |
|---|
| 424 | if ( errCode ) |
|---|
| 425 | { |
|---|
| 426 | return BERR_TRACE(errCode); |
|---|
| 427 | } |
|---|
| 428 | handle->input = input; |
|---|
| 429 | return BERR_SUCCESS; |
|---|
| 430 | } |
|---|
| 431 | |
|---|
| 432 | |
|---|
| 433 | BERR_Code BAPE_StudioSound_RemoveInput( |
|---|
| 434 | BAPE_StudioSoundHandle handle, |
|---|
| 435 | BAPE_Connector input |
|---|
| 436 | ) |
|---|
| 437 | { |
|---|
| 438 | BERR_Code errCode; |
|---|
| 439 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 440 | BDBG_OBJECT_ASSERT(input, BAPE_PathConnector); |
|---|
| 441 | if ( input != handle->input ) |
|---|
| 442 | { |
|---|
| 443 | BDBG_ERR(("Input %s %s (%#x) is not connected", input->pParent->pName, input->pName, input)); |
|---|
| 444 | return BERR_TRACE(BERR_INVALID_PARAMETER); |
|---|
| 445 | } |
|---|
| 446 | errCode = BAPE_PathNode_P_RemoveInput(&handle->node, input); |
|---|
| 447 | if ( errCode ) |
|---|
| 448 | { |
|---|
| 449 | return BERR_TRACE(errCode); |
|---|
| 450 | } |
|---|
| 451 | handle->input = NULL; |
|---|
| 452 | return BERR_SUCCESS; |
|---|
| 453 | } |
|---|
| 454 | |
|---|
| 455 | BERR_Code BAPE_StudioSound_RemoveAllInputs( |
|---|
| 456 | BAPE_StudioSoundHandle handle |
|---|
| 457 | ) |
|---|
| 458 | { |
|---|
| 459 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 460 | if ( handle->input ) |
|---|
| 461 | { |
|---|
| 462 | return BAPE_StudioSound_RemoveInput(handle, handle->input); |
|---|
| 463 | } |
|---|
| 464 | return BERR_SUCCESS; |
|---|
| 465 | } |
|---|
| 466 | |
|---|
| 467 | static BERR_Code BAPE_StudioSound_P_ConnectorSupported(struct BAPE_PathNode *pNode, BAPE_PathConnector *pConnector) |
|---|
| 468 | { |
|---|
| 469 | BDBG_OBJECT_ASSERT(pNode, BAPE_PathNode); |
|---|
| 470 | BDBG_OBJECT_ASSERT(pConnector, BAPE_PathConnector); |
|---|
| 471 | if ( pConnector->dataSource == BAPE_DataSource_eDspBuffer && |
|---|
| 472 | pConnector->numChannelPairs == 1 && |
|---|
| 473 | !pConnector->compressed ) |
|---|
| 474 | { |
|---|
| 475 | return BERR_SUCCESS; |
|---|
| 476 | } |
|---|
| 477 | else |
|---|
| 478 | { |
|---|
| 479 | BDBG_ERR(("Only stereo DSP input is supported")); |
|---|
| 480 | return BERR_TRACE(BERR_INVALID_PARAMETER); |
|---|
| 481 | } |
|---|
| 482 | } |
|---|
| 483 | |
|---|
| 484 | static BERR_Code BAPE_StudioSound_P_AllocatePathFromInput(struct BAPE_PathNode *pNode, struct BAPE_PathConnection *pConnection) |
|---|
| 485 | { |
|---|
| 486 | BERR_Code errCode; |
|---|
| 487 | BAPE_StudioSoundHandle handle; |
|---|
| 488 | unsigned branchId; |
|---|
| 489 | BDBG_OBJECT_ASSERT(pNode, BAPE_PathNode); |
|---|
| 490 | BDBG_OBJECT_ASSERT(pConnection, BAPE_PathConnection); |
|---|
| 491 | BDBG_ASSERT(NULL != pConnection->pSource->pTaskCreateSettings); |
|---|
| 492 | handle = pNode->pHandle; |
|---|
| 493 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 494 | /* Add stages to CIT and propagate task settings */ |
|---|
| 495 | errCode = BAPE_DSP_P_AddProcessingStage(pConnection->pSource->pTaskCreateSettings, pConnection->pSource->branchId, pConnection->pSource->stageId, |
|---|
| 496 | BAPE_DSP_P_GetDataTypeFromConnector(handle->input), |
|---|
| 497 | BDSP_AudioProcessing_eSrsTruVolume, |
|---|
| 498 | false, |
|---|
| 499 | &branchId, &handle->stageId.tvol); |
|---|
| 500 | if ( errCode ) |
|---|
| 501 | { |
|---|
| 502 | return BERR_TRACE(errCode); |
|---|
| 503 | } |
|---|
| 504 | handle->branchId = branchId; |
|---|
| 505 | |
|---|
| 506 | errCode = BAPE_DSP_P_AddProcessingStage(pConnection->pSource->pTaskCreateSettings, handle->branchId, handle->stageId.tvol, |
|---|
| 507 | BAPE_DSP_P_GetDataTypeFromConnector(handle->input), |
|---|
| 508 | BDSP_AudioProcessing_eSrsCsdTd, |
|---|
| 509 | false, |
|---|
| 510 | &branchId, &handle->stageId.cstd); |
|---|
| 511 | if ( errCode ) |
|---|
| 512 | { |
|---|
| 513 | return BERR_TRACE(errCode); |
|---|
| 514 | } |
|---|
| 515 | if ( branchId != handle->branchId ) |
|---|
| 516 | { |
|---|
| 517 | BDBG_ERR(("Unable to add StudioSound to the current processing branch.")); |
|---|
| 518 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 519 | } |
|---|
| 520 | |
|---|
| 521 | errCode = BAPE_DSP_P_AddProcessingStage(pConnection->pSource->pTaskCreateSettings, handle->branchId, handle->stageId.cstd, |
|---|
| 522 | BAPE_DSP_P_GetDataTypeFromConnector(handle->input), |
|---|
| 523 | BDSP_AudioProcessing_eSrsHd, |
|---|
| 524 | false, |
|---|
| 525 | &branchId, &handle->stageId.tshd); |
|---|
| 526 | if ( errCode ) |
|---|
| 527 | { |
|---|
| 528 | return BERR_TRACE(errCode); |
|---|
| 529 | } |
|---|
| 530 | if ( branchId != handle->branchId ) |
|---|
| 531 | { |
|---|
| 532 | BDBG_ERR(("Unable to add StudioSound to the current processing branch.")); |
|---|
| 533 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 534 | } |
|---|
| 535 | |
|---|
| 536 | errCode = BAPE_DSP_P_AddProcessingStage(pConnection->pSource->pTaskCreateSettings, handle->branchId, handle->stageId.tshd, |
|---|
| 537 | BAPE_DSP_P_GetDataTypeFromConnector(handle->input), |
|---|
| 538 | BDSP_AudioProcessing_eSrsEqHl, |
|---|
| 539 | false, |
|---|
| 540 | &branchId, &handle->stageId.eqhl); |
|---|
| 541 | if ( errCode ) |
|---|
| 542 | { |
|---|
| 543 | return BERR_TRACE(errCode); |
|---|
| 544 | } |
|---|
| 545 | if ( branchId != handle->branchId ) |
|---|
| 546 | { |
|---|
| 547 | BDBG_ERR(("Unable to add StudioSound to the current processing branch.")); |
|---|
| 548 | return BERR_TRACE(BERR_NOT_SUPPORTED); |
|---|
| 549 | } |
|---|
| 550 | |
|---|
| 551 | pNode->paths[0].connector.branchId = branchId; |
|---|
| 552 | pNode->paths[0].connector.stageId = handle->stageId.eqhl; |
|---|
| 553 | pNode->paths[0].connector.pTaskCreateSettings = pConnection->pSource->pTaskCreateSettings; |
|---|
| 554 | return BERR_SUCCESS; |
|---|
| 555 | } |
|---|
| 556 | |
|---|
| 557 | static BERR_Code BAPE_StudioSound_P_ConfigPathFromInput(struct BAPE_PathNode *pNode, struct BAPE_PathConnection *pConnection) |
|---|
| 558 | { |
|---|
| 559 | BERR_Code errCode; |
|---|
| 560 | BAPE_StudioSoundHandle handle; |
|---|
| 561 | BDBG_OBJECT_ASSERT(pNode, BAPE_PathNode); |
|---|
| 562 | BDBG_OBJECT_ASSERT(pConnection, BAPE_PathConnection); |
|---|
| 563 | BDBG_ASSERT(NULL != pConnection->pSource->task); |
|---|
| 564 | |
|---|
| 565 | handle = pNode->pHandle; |
|---|
| 566 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 567 | pNode->paths[0].connector.task = pConnection->pSource->task; |
|---|
| 568 | errCode = BAPE_StudioSound_P_ApplyDspSettings(handle, handle->node.paths[0].connector.task); |
|---|
| 569 | if ( errCode ) |
|---|
| 570 | { |
|---|
| 571 | return BERR_TRACE(errCode); |
|---|
| 572 | } |
|---|
| 573 | |
|---|
| 574 | return BERR_SUCCESS; |
|---|
| 575 | } |
|---|
| 576 | |
|---|
| 577 | static BERR_Code BAPE_StudioSound_P_ConvertTopLevelSettings(const BAPE_StudioSoundSettings *pSettings, BDSP_Raaga_Audio_StudioSoundTopLevelUserConfig *pUserConfig) |
|---|
| 578 | { |
|---|
| 579 | BDBG_ASSERT(NULL != pSettings); |
|---|
| 580 | BDBG_ASSERT(NULL != pUserConfig); |
|---|
| 581 | |
|---|
| 582 | pUserConfig->i32IsStudioSound = true; |
|---|
| 583 | BDBG_MSG(("Top Level: i32IsStudioSound = true")); |
|---|
| 584 | pUserConfig->i32StudioSoundMode = (pSettings->mode == BAPE_StudioSoundMode_eMode2) ? 2 : 1; |
|---|
| 585 | BDBG_MSG(("Top Level: i32StudioSoundMode = %u", pUserConfig->i32StudioSoundMode)); |
|---|
| 586 | pUserConfig->i32mEnable = pSettings->enabled ? 1 : 0; |
|---|
| 587 | BDBG_MSG(("Top Level: i32mEnable = %u", pUserConfig->i32mEnable)); |
|---|
| 588 | pUserConfig->i32mInputGain = BAPE_P_FloatToQ131(pSettings->inputGain, 100); |
|---|
| 589 | BDBG_MSG(("Top Level: i32mInputGain = %#x", pUserConfig->i32mInputGain)); |
|---|
| 590 | pUserConfig->i32mHeadroomGain = BAPE_P_FloatToQ131(pSettings->headroomGain, 100); |
|---|
| 591 | BDBG_MSG(("Top Level: i32mHeadroomGain = %#x", pUserConfig->i32mHeadroomGain)); |
|---|
| 592 | switch ( pSettings->inputMode ) |
|---|
| 593 | { |
|---|
| 594 | case BAPE_StudioSoundInputMode_eMono: |
|---|
| 595 | pUserConfig->i32mInputMode = 0; |
|---|
| 596 | break; |
|---|
| 597 | case BAPE_StudioSoundInputMode_eStereo: |
|---|
| 598 | pUserConfig->i32mInputMode = 1; |
|---|
| 599 | break; |
|---|
| 600 | case BAPE_StudioSoundInputMode_eMultichannel: |
|---|
| 601 | pUserConfig->i32mInputMode = 2; |
|---|
| 602 | break; |
|---|
| 603 | default: |
|---|
| 604 | case BAPE_StudioSoundInputMode_eLtRt: |
|---|
| 605 | pUserConfig->i32mInputMode = 3; |
|---|
| 606 | break; |
|---|
| 607 | } |
|---|
| 608 | BDBG_MSG(("Top Level: i32mInputMode = %u", pUserConfig->i32mInputMode)); |
|---|
| 609 | pUserConfig->i32mOutputGain = BAPE_P_FloatToQ131(pSettings->outputGain, 100); |
|---|
| 610 | BDBG_MSG(("Top Level: i32mOutputGain = %#x", pUserConfig->i32mOutputGain)); |
|---|
| 611 | pUserConfig->i32mBypassGain = BAPE_P_FloatToQ131(pSettings->bypassGain, 100); |
|---|
| 612 | BDBG_MSG(("Top Level: i32mBypassGain = %#x", pUserConfig->i32mBypassGain)); |
|---|
| 613 | |
|---|
| 614 | return BERR_SUCCESS; |
|---|
| 615 | } |
|---|
| 616 | |
|---|
| 617 | static BERR_Code BDSP_StudioSound_P_ApplyCsTdSettings( |
|---|
| 618 | BAPE_StudioSoundHandle handle, |
|---|
| 619 | BDSP_TaskHandle task, |
|---|
| 620 | const BDSP_Raaga_Audio_StudioSoundTopLevelUserConfig *pTopLevelConfig |
|---|
| 621 | ) |
|---|
| 622 | { |
|---|
| 623 | BERR_Code errCode; |
|---|
| 624 | BDSP_Raaga_SrsCsdTdSettings userConfig; |
|---|
| 625 | |
|---|
| 626 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 627 | BDBG_ASSERT(NULL != task); |
|---|
| 628 | BDBG_ASSERT(NULL != pTopLevelConfig); |
|---|
| 629 | |
|---|
| 630 | errCode = BDSP_Task_GetStageSettings(task, handle->branchId, handle->stageId.cstd, &userConfig, sizeof(userConfig)); |
|---|
| 631 | if ( errCode ) |
|---|
| 632 | { |
|---|
| 633 | return BERR_TRACE(errCode); |
|---|
| 634 | } |
|---|
| 635 | |
|---|
| 636 | BKNI_Memcpy(&userConfig.sTopLevelConfig, pTopLevelConfig, sizeof(*pTopLevelConfig)); |
|---|
| 637 | |
|---|
| 638 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mEnable, handle->settings.circleSurround.enabled ? 1 : 0); |
|---|
| 639 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mInputGain, BAPE_P_FloatToQ131(handle->settings.circleSurround.inputGain, 1000)); |
|---|
| 640 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mMode, (handle->settings.circleSurround.mode == BAPE_CircleSurroundMode_eCinema) ? 1 : 0); |
|---|
| 641 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mCSDecOutputGainLR, BAPE_P_FloatToQ428(handle->settings.circleSurround.outputGainFront, 1000)); |
|---|
| 642 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mCSDecOutputGainLsRs, BAPE_P_FloatToQ428(handle->settings.circleSurround.outputGainRear, 1000)); |
|---|
| 643 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mCSDecOutputGainC, BAPE_P_FloatToQ428(handle->settings.circleSurround.outputGainCenter, 1000)); |
|---|
| 644 | BAPE_DSP_P_SET_VARIABLE(userConfig.sCSDecoderConfig, i32mCSDecOutputGainSub, BAPE_P_FloatToQ428(handle->settings.circleSurround.outputGainSubwoofer, 1000)); |
|---|
| 645 | |
|---|
| 646 | BAPE_DSP_P_SET_VARIABLE(userConfig.sTruDialogConfig, i32mEnable, handle->settings.truDialog.enabled ? 1 : 0); |
|---|
| 647 | BAPE_DSP_P_SET_VARIABLE(userConfig.sTruDialogConfig, i32mTruDialogInputGain, BAPE_P_FloatToQ131(handle->settings.truDialog.inputGain, 100)); |
|---|
| 648 | BAPE_DSP_P_SET_VARIABLE(userConfig.sTruDialogConfig, i32mTruDialogOutputGain, BAPE_P_FloatToQ131(handle->settings.truDialog.outputGain, 100)); |
|---|
| 649 | BAPE_DSP_P_SET_VARIABLE(userConfig.sTruDialogConfig, i32mTruDialogProcessGain, BAPE_P_FloatToQ527(handle->settings.truDialog.processGain, 300)); |
|---|
| 650 | BAPE_DSP_P_SET_VARIABLE(userConfig.sTruDialogConfig, i32mTruDialogBypassGain, BAPE_P_FloatToQ131(handle->settings.truDialog.bypassGain, 100)); |
|---|
| 651 | BAPE_DSP_P_SET_VARIABLE(userConfig.sTruDialogConfig, i32mTruDialogDialogClarityGain, BAPE_P_FloatToQ131(handle->settings.truDialog.enhancementGain, 100)); |
|---|
| 652 | |
|---|
| 653 | errCode = BDSP_Task_SetStageSettings(task, handle->branchId, handle->stageId.cstd, &userConfig, sizeof(userConfig)); |
|---|
| 654 | if ( errCode ) |
|---|
| 655 | { |
|---|
| 656 | return BERR_TRACE(errCode); |
|---|
| 657 | } |
|---|
| 658 | |
|---|
| 659 | return BERR_SUCCESS; |
|---|
| 660 | } |
|---|
| 661 | |
|---|
| 662 | static BERR_Code BDSP_StudioSound_P_ApplyTruSurroundSettings( |
|---|
| 663 | BAPE_StudioSoundHandle handle, |
|---|
| 664 | BDSP_TaskHandle task, |
|---|
| 665 | const BDSP_Raaga_Audio_StudioSoundTopLevelUserConfig *pTopLevelConfig |
|---|
| 666 | ) |
|---|
| 667 | { |
|---|
| 668 | BERR_Code errCode; |
|---|
| 669 | BDSP_Raaga_SrsHdSettings userConfig; |
|---|
| 670 | |
|---|
| 671 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 672 | BDBG_ASSERT(NULL != task); |
|---|
| 673 | BDBG_ASSERT(NULL != pTopLevelConfig); |
|---|
| 674 | |
|---|
| 675 | errCode = BDSP_Task_GetStageSettings(task, handle->branchId, handle->stageId.tshd, &userConfig, sizeof(userConfig)); |
|---|
| 676 | if ( errCode ) |
|---|
| 677 | { |
|---|
| 678 | return BERR_TRACE(errCode); |
|---|
| 679 | } |
|---|
| 680 | |
|---|
| 681 | BKNI_Memcpy(&userConfig.sTopLevelConfig, pTopLevelConfig, sizeof(*pTopLevelConfig)); |
|---|
| 682 | BAPE_TruSurroundHd_P_ConvertSettingsToDsp(&handle->settings.truSurroundHd, 1, &userConfig); |
|---|
| 683 | |
|---|
| 684 | errCode = BDSP_Task_SetStageSettings(task, handle->branchId, handle->stageId.tshd, &userConfig, sizeof(userConfig)); |
|---|
| 685 | if ( errCode ) |
|---|
| 686 | { |
|---|
| 687 | return BERR_TRACE(errCode); |
|---|
| 688 | } |
|---|
| 689 | |
|---|
| 690 | return BERR_SUCCESS; |
|---|
| 691 | } |
|---|
| 692 | |
|---|
| 693 | static BERR_Code BDSP_StudioSound_P_ApplyEqHlSettings( |
|---|
| 694 | BAPE_StudioSoundHandle handle, |
|---|
| 695 | BDSP_TaskHandle task, |
|---|
| 696 | const BDSP_Raaga_Audio_StudioSoundTopLevelUserConfig *pTopLevelConfig |
|---|
| 697 | ) |
|---|
| 698 | { |
|---|
| 699 | BERR_Code errCode; |
|---|
| 700 | static BDSP_Raaga_SrsEqHlSettings userConfig; /* This structure is > 1k. Magnum is not thread safe so this is acceptable */ |
|---|
| 701 | unsigned i, j; |
|---|
| 702 | |
|---|
| 703 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 704 | BDBG_ASSERT(NULL != task); |
|---|
| 705 | BDBG_ASSERT(NULL != pTopLevelConfig); |
|---|
| 706 | |
|---|
| 707 | errCode = BDSP_Task_GetStageSettings(task, handle->branchId, handle->stageId.eqhl, &userConfig, sizeof(userConfig)); |
|---|
| 708 | if ( errCode ) |
|---|
| 709 | { |
|---|
| 710 | return BERR_TRACE(errCode); |
|---|
| 711 | } |
|---|
| 712 | |
|---|
| 713 | BKNI_Memcpy(&userConfig.sTopLevelConfig, pTopLevelConfig, sizeof(*pTopLevelConfig)); |
|---|
| 714 | |
|---|
| 715 | /* GEQ */ |
|---|
| 716 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mEnable[0], handle->settings.graphicEq.leftEnabled ? 1 : 0); |
|---|
| 717 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mEnable[1], handle->settings.graphicEq.rightEnabled ? 1 : 0); |
|---|
| 718 | switch ( handle->settings.graphicEq.bandMode ) |
|---|
| 719 | { |
|---|
| 720 | default: |
|---|
| 721 | case BAPE_SrsGraphicEqBandMode_eFiveBand: |
|---|
| 722 | i = 0; |
|---|
| 723 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mInputGain, BAPE_P_FloatToQ131(handle->settings.graphicEq.inputGain, 4000)); |
|---|
| 724 | break; |
|---|
| 725 | case BAPE_SrsGraphicEqBandMode_eTenBand: |
|---|
| 726 | i = 1; |
|---|
| 727 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mInputGain, BAPE_P_FloatToQ131(handle->settings.graphicEq.inputGain, 1000)); |
|---|
| 728 | break; |
|---|
| 729 | case BAPE_SrsGraphicEqBandMode_eSpeakerCompensation: |
|---|
| 730 | i = 2; |
|---|
| 731 | /* TODO: Input Gain Units? */ |
|---|
| 732 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mInputGain, BAPE_P_FloatToQ131(handle->settings.graphicEq.inputGain, 4000)); |
|---|
| 733 | break; |
|---|
| 734 | } |
|---|
| 735 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mFilterMode, i); |
|---|
| 736 | for ( i = 0; i < BAPE_STUDIO_SOUND_MAX_GEQ_BANDS; i++ ) |
|---|
| 737 | { |
|---|
| 738 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mBandGain[0][i], BAPE_P_FloatToQ329(handle->settings.graphicEq.leftBandGain[i], 1000)); |
|---|
| 739 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mBandGain[1][i], BAPE_P_FloatToQ329(handle->settings.graphicEq.rightBandGain[i], 1000)); |
|---|
| 740 | } |
|---|
| 741 | |
|---|
| 742 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mOutputGain, BAPE_P_FloatToQ131(handle->settings.graphicEq.outputGain, 100)); |
|---|
| 743 | BAPE_DSP_P_SET_VARIABLE(userConfig.sGraphicEqConfig, i32mBypassGain, BAPE_P_FloatToQ131(handle->settings.graphicEq.bypassGain, 100)); |
|---|
| 744 | |
|---|
| 745 | /* TruEq */ |
|---|
| 746 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mEnable[0], handle->settings.truEq.leftEnabled ? 1 : 0); |
|---|
| 747 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mEnable[1], handle->settings.truEq.rightEnabled ? 1 : 0); |
|---|
| 748 | |
|---|
| 749 | for ( i = 0; i < BAPE_STUDIO_SOUND_MAX_PEQ_BANDS; i++ ) |
|---|
| 750 | { |
|---|
| 751 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mBandEnable[0][i], handle->settings.truEq.leftBandEnabled[i] ? 1 : 0); |
|---|
| 752 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mBandEnable[1][i], handle->settings.truEq.rightBandEnabled[i] ? 1 : 0); |
|---|
| 753 | } |
|---|
| 754 | |
|---|
| 755 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mInputGain, BAPE_P_FloatToQ527(handle->settings.truEq.inputGain, 100)); |
|---|
| 756 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mOutputGain, BAPE_P_FloatToQ527(handle->settings.truEq.outputGain, 100)); |
|---|
| 757 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32mBypassGain, BAPE_P_FloatToQ527(handle->settings.truEq.bypassGain, 100)); |
|---|
| 758 | |
|---|
| 759 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.i32CoefGenMode, (handle->settings.truEq.coefficientMode == BAPE_SrsFilterCoefficientMode_eSpecification) ? 1 : 0); |
|---|
| 760 | |
|---|
| 761 | for ( i = 0; i < 3; i++ ) |
|---|
| 762 | { |
|---|
| 763 | for ( j = 0; j < BAPE_STUDIO_SOUND_MAX_PEQ_BANDS; j++ ) |
|---|
| 764 | { |
|---|
| 765 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32Order, handle->settings.truEq.coefficientSettings.user[i][j].filterOrder); |
|---|
| 766 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32Scale, handle->settings.truEq.coefficientSettings.user[i][j].scale); |
|---|
| 767 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientB0, handle->settings.truEq.coefficientSettings.user[i][j].coefficientB0); |
|---|
| 768 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientA1, handle->settings.truEq.coefficientSettings.user[i][j].coefficientA1); |
|---|
| 769 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientB1, handle->settings.truEq.coefficientSettings.user[i][j].coefficientB1); |
|---|
| 770 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientA2, handle->settings.truEq.coefficientSettings.user[i][j].coefficientA2); |
|---|
| 771 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterCoefPeq[i][j].i32FilterCoefficientB2, handle->settings.truEq.coefficientSettings.user[i][j].coefficientB2); |
|---|
| 772 | } |
|---|
| 773 | } |
|---|
| 774 | for ( i = 0; i < BAPE_STUDIO_SOUND_MAX_PEQ_BANDS; i++ ) |
|---|
| 775 | { |
|---|
| 776 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterSpecPeq[i].i32BandGain, handle->settings.truEq.coefficientSettings.specification[i].bandGain); |
|---|
| 777 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterSpecPeq[i].ui32BandFrequency, handle->settings.truEq.coefficientSettings.specification[i].bandFrequency); |
|---|
| 778 | BAPE_DSP_P_SET_VARIABLE(userConfig, sParametricEqConfig.sFilterSpecPeq[i].i32QFactor, handle->settings.truEq.coefficientSettings.specification[i].qFactor); |
|---|
| 779 | } |
|---|
| 780 | |
|---|
| 781 | /* HPF */ |
|---|
| 782 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.ui32mEnable, handle->settings.highPassFilter.enabled?1:0); |
|---|
| 783 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.ui32CoefGenMode, handle->settings.highPassFilter.coefficientMode == BAPE_SrsFilterCoefficientMode_eSpecification?1:0); |
|---|
| 784 | for ( i = 0; i < 3; i++ ) |
|---|
| 785 | { |
|---|
| 786 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].ui32Order, handle->settings.highPassFilter.coefficientSettings.user[i].filterOrder); |
|---|
| 787 | for ( j = 0; j < 3; j++ ) |
|---|
| 788 | { |
|---|
| 789 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32Scale, handle->settings.highPassFilter.coefficientSettings.user[i].coefficients[j].scale); |
|---|
| 790 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientB0, handle->settings.highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientB0); |
|---|
| 791 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientA1, handle->settings.highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientA1); |
|---|
| 792 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientB1, handle->settings.highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientB1); |
|---|
| 793 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientA2, handle->settings.highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientA2); |
|---|
| 794 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterCoefHpf[i].sFilterCoefHpfTdf2[j].i32FilterCoefficientB2, handle->settings.highPassFilter.coefficientSettings.user[i].coefficients[j].coefficientB2); |
|---|
| 795 | } |
|---|
| 796 | } |
|---|
| 797 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterSpecHpf.ui32CutoffFrequency, handle->settings.highPassFilter.coefficientSettings.specification.cutoffFrequency); |
|---|
| 798 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHighPassFilterConfig.sFilterSpecHpf.ui32Order, handle->settings.highPassFilter.coefficientSettings.specification.filterOrder); |
|---|
| 799 | |
|---|
| 800 | /* Hard Limiter */ |
|---|
| 801 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32LimiterEnable, handle->settings.hardLimiter.enabled?1:0); |
|---|
| 802 | switch ( handle->settings.hardLimiter.blockSize ) |
|---|
| 803 | { |
|---|
| 804 | default: |
|---|
| 805 | case BAPE_SrsHardLimiterBlockSize_e256: i = 256; break; |
|---|
| 806 | case BAPE_SrsHardLimiterBlockSize_e512: i = 512; break; |
|---|
| 807 | case BAPE_SrsHardLimiterBlockSize_e768: i = 768; break; |
|---|
| 808 | case BAPE_SrsHardLimiterBlockSize_e1024: i = 1024; break; |
|---|
| 809 | } |
|---|
| 810 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32blockSize, i); |
|---|
| 811 | |
|---|
| 812 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32InputGain, BAPE_P_FloatToQ131(handle->settings.hardLimiter.inputGain, 400)); |
|---|
| 813 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32OutputGain, BAPE_P_FloatToQ131(handle->settings.hardLimiter.outputGain, 400)); |
|---|
| 814 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32BypassGain, BAPE_P_FloatToQ131(handle->settings.hardLimiter.bypassGain, 100)); |
|---|
| 815 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32LimiterBoost, BAPE_P_FloatToQ131(handle->settings.hardLimiter.boost, 256000)); |
|---|
| 816 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32HardLimit, BAPE_P_FloatToQ131(handle->settings.hardLimiter.level, 100000)); |
|---|
| 817 | |
|---|
| 818 | BAPE_DSP_P_SET_VARIABLE(userConfig, sHardLimiterConfig.i32DelayLength, handle->settings.hardLimiter.delay); |
|---|
| 819 | |
|---|
| 820 | errCode = BDSP_Task_SetStageSettings(task, handle->branchId, handle->stageId.eqhl, &userConfig, sizeof(userConfig)); |
|---|
| 821 | if ( errCode ) |
|---|
| 822 | { |
|---|
| 823 | return BERR_TRACE(errCode); |
|---|
| 824 | } |
|---|
| 825 | |
|---|
| 826 | return BERR_SUCCESS; |
|---|
| 827 | } |
|---|
| 828 | |
|---|
| 829 | static BERR_Code BAPE_StudioSound_P_ApplyDspSettings(BAPE_StudioSoundHandle handle, BDSP_TaskHandle task) |
|---|
| 830 | { |
|---|
| 831 | BERR_Code errCode; |
|---|
| 832 | BDSP_Raaga_Audio_TruVolumeUserConfig truVolumeConfig; |
|---|
| 833 | |
|---|
| 834 | BDBG_OBJECT_ASSERT(handle, BAPE_StudioSound); |
|---|
| 835 | BDBG_ASSERT(NULL != task); |
|---|
| 836 | |
|---|
| 837 | errCode = BDSP_Task_GetStageSettings(task, handle->branchId, handle->stageId.tvol, &truVolumeConfig, sizeof(truVolumeConfig)); |
|---|
| 838 | if ( errCode ) |
|---|
| 839 | { |
|---|
| 840 | return BERR_TRACE(errCode); |
|---|
| 841 | } |
|---|
| 842 | |
|---|
| 843 | errCode = BAPE_StudioSound_P_ConvertTopLevelSettings(&handle->settings, &truVolumeConfig.sTopLevelConfig); |
|---|
| 844 | if ( errCode ) |
|---|
| 845 | { |
|---|
| 846 | return BERR_TRACE(errCode); |
|---|
| 847 | } |
|---|
| 848 | errCode = BAPE_TruVolume_P_ConvertSettingsToDsp(&handle->settings.truVolume, &truVolumeConfig); |
|---|
| 849 | if ( errCode ) |
|---|
| 850 | { |
|---|
| 851 | return BERR_TRACE(errCode); |
|---|
| 852 | } |
|---|
| 853 | errCode = BDSP_Task_SetStageSettings(task, handle->branchId, handle->stageId.tvol, &truVolumeConfig, sizeof(truVolumeConfig)); |
|---|
| 854 | if ( errCode ) |
|---|
| 855 | { |
|---|
| 856 | return BERR_TRACE(errCode); |
|---|
| 857 | } |
|---|
| 858 | |
|---|
| 859 | errCode = BDSP_StudioSound_P_ApplyCsTdSettings(handle, task, &truVolumeConfig.sTopLevelConfig); |
|---|
| 860 | if ( errCode ) |
|---|
| 861 | { |
|---|
| 862 | return BERR_TRACE(errCode); |
|---|
| 863 | } |
|---|
| 864 | |
|---|
| 865 | errCode = BDSP_StudioSound_P_ApplyTruSurroundSettings(handle, task, &truVolumeConfig.sTopLevelConfig); |
|---|
| 866 | if ( errCode ) |
|---|
| 867 | { |
|---|
| 868 | return BERR_TRACE(errCode); |
|---|
| 869 | } |
|---|
| 870 | |
|---|
| 871 | errCode = BDSP_StudioSound_P_ApplyEqHlSettings(handle, task, &truVolumeConfig.sTopLevelConfig); |
|---|
| 872 | if ( errCode ) |
|---|
| 873 | { |
|---|
| 874 | return BERR_TRACE(errCode); |
|---|
| 875 | } |
|---|
| 876 | |
|---|
| 877 | return BERR_SUCCESS; |
|---|
| 878 | } |
|---|
| 879 | |
|---|
| 880 | static void BAPE_StudioSound_P_StopPathFromInput(struct BAPE_PathNode *pNode, struct BAPE_PathConnection *pConnection) |
|---|
| 881 | { |
|---|
| 882 | /* Invalidate task handle */ |
|---|
| 883 | BDBG_OBJECT_ASSERT(pNode, BAPE_PathNode); |
|---|
| 884 | BSTD_UNUSED(pConnection); |
|---|
| 885 | pNode->paths[0].connector.task = NULL; |
|---|
| 886 | } |
|---|
| 887 | |
|---|
| 888 | static void BAPE_StudioSound_P_RemoveInputCallback(struct BAPE_PathNode *pNode, BAPE_PathConnector *pConnector) |
|---|
| 889 | { |
|---|
| 890 | (void)BAPE_StudioSound_RemoveInput(pNode->pHandle, pConnector); |
|---|
| 891 | } |
|---|