mirror of https://github.com/AxioDL/amuse.git
Avoid narrowing conversion for panning
This commit is contained in:
parent
1312a5fa86
commit
8fee7a282b
|
@ -56,8 +56,8 @@ class Voice : public Entity
|
||||||
|
|
||||||
struct Panning
|
struct Panning
|
||||||
{
|
{
|
||||||
float m_time; /**< time of PANNING command */
|
double m_time; /**< time of PANNING command */
|
||||||
float m_dur; /**< requested duration of PANNING command */
|
double m_dur; /**< requested duration of PANNING command */
|
||||||
uint8_t m_pos; /**< initial pan value of PANNING command */
|
uint8_t m_pos; /**< initial pan value of PANNING command */
|
||||||
int8_t m_width; /**< delta pan value to target of PANNING command */
|
int8_t m_width; /**< delta pan value to target of PANNING command */
|
||||||
};
|
};
|
||||||
|
|
|
@ -435,10 +435,10 @@ void Voice::preSupplyAudio(double dt)
|
||||||
{
|
{
|
||||||
Panning& p = m_panningQueue.front();
|
Panning& p = m_panningQueue.front();
|
||||||
p.m_time += dt;
|
p.m_time += dt;
|
||||||
float start = (p.m_pos - 64) / 64.f;
|
double start = (p.m_pos - 64) / 64.0;
|
||||||
float end = (p.m_pos + p.m_width - 64) / 64.f;
|
double end = (p.m_pos + p.m_width - 64) / 64.0;
|
||||||
float t = clamp(0.f, p.m_time / p.m_dur, 1.f);
|
double t = clamp(0.0, p.m_time / p.m_dur, 1.0);
|
||||||
_setPan((start * (1.0f - t)) + (end * t));
|
_setPan(float((start * (1.0 - t)) + (end * t)));
|
||||||
refresh = true;
|
refresh = true;
|
||||||
|
|
||||||
/* Done with panning */
|
/* Done with panning */
|
||||||
|
@ -451,10 +451,10 @@ void Voice::preSupplyAudio(double dt)
|
||||||
{
|
{
|
||||||
Panning& s = m_spanningQueue.front();
|
Panning& s = m_spanningQueue.front();
|
||||||
s.m_time += dt;
|
s.m_time += dt;
|
||||||
float start = (s.m_pos - 64) / 64.f;
|
double start = (s.m_pos - 64) / 64.0;
|
||||||
float end = (s.m_pos + s.m_width - 64) / 64.f;
|
double end = (s.m_pos + s.m_width - 64) / 64.0;
|
||||||
float t = clamp(0.f, s.m_time / s.m_dur, 1.f);
|
double t = clamp(0.0, s.m_time / s.m_dur, 1.0);
|
||||||
_setSurroundPan((start * (1.0f - t)) + (end * t));
|
_setSurroundPan(float((start * (1.0 - t)) + (end * t)));
|
||||||
refresh = true;
|
refresh = true;
|
||||||
|
|
||||||
/* Done with spanning */
|
/* Done with spanning */
|
||||||
|
|
Loading…
Reference in New Issue