Commit b9f44072 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

set source gain through the new function TDREND_SRC_SPATIAL_SetGain

parent 5e5d772a
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ static void TDREND_SRC_SPATIAL_SetDirAtten( TDREND_SRC_SPATIAL_t *SrcSpatial_p,

static void TDREND_SRC_SPATIAL_SetDistAtten( TDREND_SRC_SPATIAL_t *SrcSpatial_p, const TDREND_DistAtten_t *DistAtten_p );

#ifdef OBJ_EDITING_INTERFACE
static void TDREND_SRC_SPATIAL_SetGain(const TDREND_DirAtten_t *DirAtten_p, const float Gain);
#endif

static float TDREND_SRC_SPATIAL_GetDirGain( const TDREND_DirAtten_t *DirAtten_p, const float *Front_p, const float *RelPos_p );

static float TDREND_SRC_SPATIAL_GetDistGain( const TDREND_DistAtten_t *DistAtten_p, const float Dist );
@@ -150,7 +154,7 @@ ivas_error TDREND_MIX_SRC_SetGain(
    }
    else
    {
        hBinRendererTd->Sources[SrcInd]->SrcRend_p->SrcGain_p[0] = Gain;
		TDREND_SRC_SPATIAL_SetGain(hBinRendererTd->Sources[SrcInd], Gain );
    }

    return IVAS_ERR_OK;
@@ -561,6 +565,24 @@ static void TDREND_SRC_SPATIAL_SetDistAtten(

    return;
}


#ifdef OBJ_EDITING_INTERFACE
/*-------------------------------------------------------------------*
 * TDREND_SRC_SPATIAL_SetGain()
 *
 * Set the object gain
 --------------------------------------------------------------------*/

static void TDREND_SRC_SPATIAL_SetGain(
	const TDREND_SRC_t *Src_p,       /* i  : Directional attenuation specification */
	const float Gain                     /* i  : Front-pointing vector                 */
)
{
	Src_p->SrcRend_p->SrcGain_p[0] = Gain;
}
#endif

/*-------------------------------------------------------------------*
 * TDREND_SRC_SPATIAL_GetDirGain()
 *
@@ -612,7 +634,6 @@ static float TDREND_SRC_SPATIAL_GetDirGain(
    return DirGain;
}


/*-------------------------------------------------------------------*
 * TDREND_SRC_SPATIAL_GetDistGain()
 *