|
|
|
|
|
|
|
|
void gain(unsigned int channel, float gain) { |
|
|
void gain(unsigned int channel, float gain) { |
|
|
if (channel >= 4) return; |
|
|
if (channel >= 4) return; |
|
|
if (gain > 32767.0f) gain = 32767.0f; |
|
|
if (gain > 32767.0f) gain = 32767.0f; |
|
|
else if (gain < 0.0f) gain = 0.0f; |
|
|
|
|
|
|
|
|
else if (gain < -32767.0f) gain = -32767.0f; |
|
|
multiplier[channel] = gain * 65536.0f; // TODO: proper roundoff? |
|
|
multiplier[channel] = gain * 65536.0f; // TODO: proper roundoff? |
|
|
} |
|
|
} |
|
|
private: |
|
|
private: |
|
|
|
|
|
|
|
|
void gain(unsigned int channel, float gain) { |
|
|
void gain(unsigned int channel, float gain) { |
|
|
if (channel >= 4) return; |
|
|
if (channel >= 4) return; |
|
|
if (gain > 127.0f) gain = 127.0f; |
|
|
if (gain > 127.0f) gain = 127.0f; |
|
|
else if (gain < 0.0f) gain = 0.0f; |
|
|
|
|
|
|
|
|
else if (gain < -127.0f) gain = -127.0f; |
|
|
multiplier[channel] = gain * 256.0f; // TODO: proper roundoff? |
|
|
multiplier[channel] = gain * 256.0f; // TODO: proper roundoff? |
|
|
} |
|
|
} |
|
|
private: |
|
|
private: |