diff options
author | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-05-04 10:21:03 +0000 |
---|---|---|
committer | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-05-04 10:21:03 +0000 |
commit | 683efdcbdb83a45f8a6ff52831855d06a56df469 (patch) | |
tree | db679ff9bdbe522dcaadb40d04e5f98a05bcdf06 /audio/audio.c | |
parent | 3945462805beb52cdc3e42eff948afbe2e7c4683 (diff) |
First cut at WM8750 volume control (Jan Kiszka).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4321 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'audio/audio.c')
-rw-r--r-- | audio/audio.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/audio/audio.c b/audio/audio.c index 9e7fe80443..c178584ca0 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -117,8 +117,8 @@ volume_t nominal_volume = { 1.0, 1.0 #else - UINT_MAX, - UINT_MAX + 1ULL << 32, + 1ULL << 32 #endif }; @@ -1955,3 +1955,21 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque) } } } + +void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t rvol) +{ + if (sw) { + sw->vol.mute = mute; + sw->vol.l = nominal_volume.l * lvol / 255; + sw->vol.r = nominal_volume.r * rvol / 255; + } +} + +void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol) +{ + if (sw) { + sw->vol.mute = mute; + sw->vol.l = nominal_volume.l * lvol / 255; + sw->vol.r = nominal_volume.r * rvol / 255; + } +} |