From patchwork Thu Mar 1 14:27:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 144030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D50071007D2 for ; Fri, 2 Mar 2012 01:30:07 +1100 (EST) Received: from localhost ([::1]:42747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S371B-0001l4-Ds for incoming@patchwork.ozlabs.org; Thu, 01 Mar 2012 09:30:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S370N-0008Cj-2n for qemu-devel@nongnu.org; Thu, 01 Mar 2012 09:29:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S36zr-0005od-OB for qemu-devel@nongnu.org; Thu, 01 Mar 2012 09:29:14 -0500 Received: from mail-ey0-f173.google.com ([209.85.215.173]:55379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S36zr-0005nd-Ey for qemu-devel@nongnu.org; Thu, 01 Mar 2012 09:28:43 -0500 Received: by eaan13 with SMTP id n13so263499eaa.4 for ; Thu, 01 Mar 2012 06:28:41 -0800 (PST) Received-SPF: pass (google.com: domain of marcandre.lureau@gmail.com designates 10.14.131.12 as permitted sender) client-ip=10.14.131.12; Authentication-Results: mr.google.com; spf=pass (google.com: domain of marcandre.lureau@gmail.com designates 10.14.131.12 as permitted sender) smtp.mail=marcandre.lureau@gmail.com; dkim=pass header.i=marcandre.lureau@gmail.com Received: from mr.google.com ([10.14.131.12]) by 10.14.131.12 with SMTP id l12mr1187498eei.103.1330612121395 (num_hops = 1); Thu, 01 Mar 2012 06:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=BE3ZPTWkWXaaRGMspL0bSCMysZFX8wZL+mKjKErJ2eo=; b=mP4pXzqHAdybZf6ENgymRpNKQ3xTlcpmb70r0OdWzrML5PXbJyFZMXI6L6d1925l/o aFdzcyoE3sVS/1+4UGRmOpXn2h0GeGxov+q9ioVyF9aSVb4RY0jbwfpnDZfRYJIpn/Fj G6YbYH/8xRz4H8s3TKYSeAwGDGzIKLUjuIImA= Received: by 10.14.131.12 with SMTP id l12mr884843eei.103.1330612121324; Thu, 01 Mar 2012 06:28:41 -0800 (PST) Received: from localhost (84.216.13.109.rev.sfr.net. [109.13.216.84]) by mx.google.com with ESMTPS id w60sm7880825eeb.4.2012.03.01.06.28.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 06:28:39 -0800 (PST) From: "=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=" To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2012 15:27:57 +0100 Message-Id: <1330612087-1882-2-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1330612087-1882-1-git-send-email-marcandre.lureau@redhat.com> References: <1330612087-1882-1-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1316621468-32171-1-git-send-email-marcandre.lureau@redhat.com> References: <1316621468-32171-1-git-send-email-marcandre.lureau@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.173 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com Subject: [Qemu-devel] [PATCH 01/11] audio: add VOICE_VOLUME ctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org --- audio/audio.c | 12 ++++++++++++ audio/audio_int.h | 1 + 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index 398763f..d76c342 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -2053,17 +2053,29 @@ 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) { + HWVoiceOut *hw = sw->hw; + sw->vol.mute = mute; sw->vol.l = nominal_volume.l * lvol / 255; sw->vol.r = nominal_volume.r * rvol / 255; + + if (hw->pcm_ops->ctl_out) { + hw->pcm_ops->ctl_out (hw, VOICE_VOLUME, sw); + } } } void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol) { if (sw) { + HWVoiceIn *hw = sw->hw; + sw->vol.mute = mute; sw->vol.l = nominal_volume.l * lvol / 255; sw->vol.r = nominal_volume.r * rvol / 255; + + if (hw->pcm_ops->ctl_in) { + hw->pcm_ops->ctl_in (hw, VOICE_VOLUME, sw); + } } } diff --git a/audio/audio_int.h b/audio/audio_int.h index 2003f8b..117f95e 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -231,6 +231,7 @@ void audio_run (const char *msg); #define VOICE_ENABLE 1 #define VOICE_DISABLE 2 +#define VOICE_VOLUME 3 static inline int audio_ring_dist (int dst, int src, int len) {