Browse Source

Fixed gain calculator problem

Bit of a fight with the github client, heaps of distraction and no time
delayed me getting back to this. Sorry.
dds
robsoles 10 years ago
parent
commit
54aaa02150
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      control_sgtl5000.cpp

+ 2
- 3
control_sgtl5000.cpp View File

surroundSoundEnable(1); surroundSoundEnable(1);
} }



unsigned char AudioControlSGTL5000::calcVol(float n, unsigned char range) unsigned char AudioControlSGTL5000::calcVol(float n, unsigned char range)
{ {
// n=(n*(((float)range)/100))+0.499; // n=(n*(((float)range)/100))+0.499;
n=(n*((float)range))+0.499;
n=(n*(float)range)+0.499;
if ((unsigned char)n>range) n=range; if ((unsigned char)n>range) n=range;
return (unsigned char)n; return (unsigned char)n;
} }
// DAP_AUDIO_EQ_BASS_BAND0 & DAP_AUDIO_EQ_BAND1 & DAP_AUDIO_EQ_BAND2 etc etc // DAP_AUDIO_EQ_BASS_BAND0 & DAP_AUDIO_EQ_BAND1 & DAP_AUDIO_EQ_BAND2 etc etc
unsigned short AudioControlSGTL5000::dap_audio_eq_band(uint8_t bandNum, float n) // by signed percentage -100/+100; dap_audio_eq(3); unsigned short AudioControlSGTL5000::dap_audio_eq_band(uint8_t bandNum, float n) // by signed percentage -100/+100; dap_audio_eq(3);
{ {
n=((n/1)*48)+0.499;
n=(n*48)+0.499;
if(n<-47) n=-47; if(n<-47) n=-47;
if(n>48) n=48; if(n>48) n=48;
n+=47; n+=47;

Loading…
Cancel
Save