[DEV] remove etk_min and etk_max
This commit is contained in:
parent
9569402ace
commit
730685f470
@ -54,8 +54,8 @@ class RequestPlay {
|
|||||||
m_freeSlot = true;
|
m_freeSlot = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int32_t processTimeMax = etk_min(_nbSample, m_effect->m_nbSamples - m_playTime);
|
int32_t processTimeMax = std::min(_nbSample, m_effect->m_nbSamples - m_playTime);
|
||||||
processTimeMax = etk_max(0, processTimeMax);
|
processTimeMax = std::max(0, processTimeMax);
|
||||||
int16_t * pointer = _bufferInterlace;
|
int16_t * pointer = _bufferInterlace;
|
||||||
int16_t * newData = &m_effect->m_data[m_playTime];
|
int16_t * newData = &m_effect->m_data[m_playTime];
|
||||||
//EWOLSA_DEBUG("AUDIO : Play slot... nb sample : " << processTimeMax << " playTime=" <<m_playTime << " nbCannels=" << nbChannels);
|
//EWOLSA_DEBUG("AUDIO : Play slot... nb sample : " << processTimeMax << " playTime=" <<m_playTime << " nbCannels=" << nbChannels);
|
||||||
@ -63,7 +63,7 @@ class RequestPlay {
|
|||||||
// TODO : set volume and spacialisation ...
|
// TODO : set volume and spacialisation ...
|
||||||
for (int32_t jjj=0; jjj<_nbChannels; jjj++) {
|
for (int32_t jjj=0; jjj<_nbChannels; jjj++) {
|
||||||
int32_t tmppp = *pointer + ((((int32_t)*newData)*effectsVolumeApply)>>16);
|
int32_t tmppp = *pointer + ((((int32_t)*newData)*effectsVolumeApply)>>16);
|
||||||
*pointer = etk_avg(-32767, tmppp, 32766);
|
*pointer = std::avg(-32767, tmppp, 32766);
|
||||||
//EWOLSA_DEBUG("AUDIO : element : " << *pointer);
|
//EWOLSA_DEBUG("AUDIO : element : " << *pointer);
|
||||||
pointer++;
|
pointer++;
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ static void uptateEffectVolume() {
|
|||||||
|
|
||||||
void ewolsa::effects::volumeSet(float _newVolume) {
|
void ewolsa::effects::volumeSet(float _newVolume) {
|
||||||
effectsVolume = _newVolume;
|
effectsVolume = _newVolume;
|
||||||
effectsVolume = etk_avg(-100, effectsVolume, 20);
|
effectsVolume = std::avg(-100, effectsVolume, 20);
|
||||||
EWOLSA_INFO("Set music Volume at " << _newVolume << "dB == > " << effectsVolume << "dB");
|
EWOLSA_INFO("Set music Volume at " << _newVolume << "dB == > " << effectsVolume << "dB");
|
||||||
uptateEffectVolume();
|
uptateEffectVolume();
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ void ewolsa::music::unInit() {
|
|||||||
|
|
||||||
void ewolsa::music::fading(int32_t _timeMs) {
|
void ewolsa::music::fading(int32_t _timeMs) {
|
||||||
musicFadingTime = _timeMs;
|
musicFadingTime = _timeMs;
|
||||||
musicFadingTime = etk_avg(-100, musicFadingTime, 20);
|
musicFadingTime = std::avg(-100, musicFadingTime, 20);
|
||||||
EWOLSA_INFO("Set music fading time at " << _timeMs << "ms == > " << musicFadingTime << "ms");
|
EWOLSA_INFO("Set music fading time at " << _timeMs << "ms == > " << musicFadingTime << "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ static void uptateMusicVolume() {
|
|||||||
|
|
||||||
void ewolsa::music::volumeSet(float _newVolume) {
|
void ewolsa::music::volumeSet(float _newVolume) {
|
||||||
musicVolume = _newVolume;
|
musicVolume = _newVolume;
|
||||||
musicVolume = etk_avg(-1000, musicVolume, 40);
|
musicVolume = std::avg(-1000, musicVolume, 40);
|
||||||
EWOLSA_INFO("Set music Volume at " << _newVolume << "dB == > " << musicVolume << "dB");
|
EWOLSA_INFO("Set music Volume at " << _newVolume << "dB == > " << musicVolume << "dB");
|
||||||
uptateMusicVolume();
|
uptateMusicVolume();
|
||||||
}
|
}
|
||||||
@ -191,14 +191,14 @@ void ewolsa::music::getData(int16_t * _bufferInterlace, int32_t _nbSample, int32
|
|||||||
if (musicListRead[musicCurrentRead]->m_data == NULL) {
|
if (musicListRead[musicCurrentRead]->m_data == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int32_t processTimeMax = etk_min(_nbSample*_nbChannels, musicListRead[musicCurrentRead]->m_nbSamples - musicPositionReading);
|
int32_t processTimeMax = std::min(_nbSample*_nbChannels, musicListRead[musicCurrentRead]->m_nbSamples - musicPositionReading);
|
||||||
processTimeMax = etk_max(0, processTimeMax);
|
processTimeMax = std::max(0, processTimeMax);
|
||||||
int16_t * pointer = _bufferInterlace;
|
int16_t * pointer = _bufferInterlace;
|
||||||
int16_t * newData = &musicListRead[musicCurrentRead]->m_data[musicPositionReading];
|
int16_t * newData = &musicListRead[musicCurrentRead]->m_data[musicPositionReading];
|
||||||
//EWOLSA_DEBUG("AUDIO : Play slot... nb sample : " << processTimeMax << " playTime=" <<m_playTime << " nbCannels=" << nbChannels);
|
//EWOLSA_DEBUG("AUDIO : Play slot... nb sample : " << processTimeMax << " playTime=" <<m_playTime << " nbCannels=" << nbChannels);
|
||||||
for (int32_t iii=0; iii<processTimeMax; iii++) {
|
for (int32_t iii=0; iii<processTimeMax; iii++) {
|
||||||
int32_t tmppp = *pointer + ((((int32_t)*newData)*musicVolumeApply)>>16);
|
int32_t tmppp = *pointer + ((((int32_t)*newData)*musicVolumeApply)>>16);
|
||||||
*pointer = etk_avg(-32767, tmppp, 32766);
|
*pointer = std::avg(-32767, tmppp, 32766);
|
||||||
//EWOLSA_DEBUG("AUDIO : element : " << *pointer);
|
//EWOLSA_DEBUG("AUDIO : element : " << *pointer);
|
||||||
pointer++;
|
pointer++;
|
||||||
newData++;
|
newData++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user