Browse Source

AudioControlWM8731::inputLevel(float n)

dds
mxmxmx 9 years ago
parent
commit
d15c3642c6
2 changed files with 11 additions and 1 deletions
  1. +10
    -0
      control_wm8731.cpp
  2. +1
    -1
      control_wm8731.h

+ 10
- 0
control_wm8731.cpp View File

return true; return true;
} }


bool AudioControlWM8731::inputLevel(float n)
{
// range is 0x00 (min) - 0x1F (max)

int _level = int(n * 31.f);


_level = _level > 0x1F ? 0x1F : _level;
write(WM8731_REG_LLINEIN, _level);
write(WM8731_REG_RLINEIN, _level);
return true;
}


/******************************************************************/ /******************************************************************/



+ 1
- 1
control_wm8731.h View File

bool enable(void); bool enable(void);
bool disable(void) { return false; } bool disable(void) { return false; }
bool volume(float n) { return volumeInteger(n * 80.0 + 47.499); } bool volume(float n) { return volumeInteger(n * 80.0 + 47.499); }
bool inputLevel(float n) { return false; }
bool inputLevel(float n); // range: 0.0f to 1.0f
bool inputSelect(int n) { return false; } bool inputSelect(int n) { return false; }
protected: protected:
bool write(unsigned int reg, unsigned int val); bool write(unsigned int reg, unsigned int val);

Loading…
Cancel
Save