From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jrkh1-0005yG-S9 for qemu-devel@nongnu.org; Thu, 01 May 2008 22:08:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jrkh0-0005y4-AO for qemu-devel@nongnu.org; Thu, 01 May 2008 22:08:11 -0400 Received: from [199.232.76.173] (port=51344 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jrkh0-0005y1-6O for qemu-devel@nongnu.org; Thu, 01 May 2008 22:08:10 -0400 Received: from ug-out-1314.google.com ([66.249.92.175]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jrkgz-0006jq-SQ for qemu-devel@nongnu.org; Thu, 01 May 2008 22:08:10 -0400 Received: by ug-out-1314.google.com with SMTP id m2so1849249uge.4 for ; Thu, 01 May 2008 19:08:07 -0700 (PDT) Message-ID: Date: Fri, 2 May 2008 04:08:07 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <481462F8.3050806@web.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka , malc Cc: qemu-devel@nongnu.org I'd like to merge the following instead, I see no point in removing per voice volume control if we're still doing scaling in software. On top of that I would apply your wm8750 patch - I have it running now and volume setting in MusicPal UI works nicely. The user still needs to disable NOVOL if they really want volume control. diff --git a/audio/audio.c b/audio/audio.c index 9e7fe80..1231ec5 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -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; + } +} diff --git a/audio/audio.h b/audio/audio.h index ec9eee4..ae29b8a 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -124,6 +124,9 @@ int AUD_is_active_out (SWVoiceOut *sw); void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts); +void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t rvol); +void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol); + SWVoiceIn *AUD_open_in ( QEMUSoundCard *card, SWVoiceIn *sw, -- Please do not print this email unless absolutely necessary. Spread environmental awareness.