Loading services/audiopolicy/common/managerdefinitions/src/VolumeCurve.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,13 @@ float VolumeCurve::volIndexToDb(int indexInUi, int volIndexMin, int volIndexMax) size_t nbCurvePoints = mCurvePoints.size(); // the volume index in the UI is relative to the min and max volume indices for this stream int nbSteps = 1 + mCurvePoints[nbCurvePoints - 1].mIndex - mCurvePoints[0].mIndex; if (indexInUi < volIndexMin) { ALOGV("VOLUME remapping index from %d to min index %d", indexInUi, volIndexMin); indexInUi = volIndexMin; } else if (indexInUi > volIndexMax) { ALOGV("VOLUME remapping index from %d to max index %d", indexInUi, volIndexMax); indexInUi = volIndexMax; } int volIdx = (nbSteps * (indexInUi - volIndexMin)) / (volIndexMax - volIndexMin); // Where would this volume index been inserted in the curve point Loading Loading
services/audiopolicy/common/managerdefinitions/src/VolumeCurve.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,13 @@ float VolumeCurve::volIndexToDb(int indexInUi, int volIndexMin, int volIndexMax) size_t nbCurvePoints = mCurvePoints.size(); // the volume index in the UI is relative to the min and max volume indices for this stream int nbSteps = 1 + mCurvePoints[nbCurvePoints - 1].mIndex - mCurvePoints[0].mIndex; if (indexInUi < volIndexMin) { ALOGV("VOLUME remapping index from %d to min index %d", indexInUi, volIndexMin); indexInUi = volIndexMin; } else if (indexInUi > volIndexMax) { ALOGV("VOLUME remapping index from %d to max index %d", indexInUi, volIndexMax); indexInUi = volIndexMax; } int volIdx = (nbSteps * (indexInUi - volIndexMin)) / (volIndexMax - volIndexMin); // Where would this volume index been inserted in the curve point Loading