@@ -96,7 +96,17 @@ bool AudioControlWM8731::volumeInteger(unsigned int n) | |||
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; | |||
} | |||
/******************************************************************/ | |||
@@ -35,7 +35,7 @@ public: | |||
bool enable(void); | |||
bool disable(void) { return false; } | |||
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; } | |||
protected: | |||
bool write(unsigned int reg, unsigned int val); |