From: "andrzej zaborowski" <balrogg@gmail.com>
To: Jan Kiszka <jan.kiszka@web.de>, malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume
Date: Fri, 2 May 2008 04:08:07 +0200 [thread overview]
Message-ID: <fb249edb0805011908m17957e1eh29933bc0bf08b7d0@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0804272230420.2648@linmac.oyster.ru>
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.
next prev parent reply other threads:[~2008-05-02 2:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-27 11:26 [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume Jan Kiszka
2008-04-27 18:35 ` malc
2008-05-02 2:08 ` andrzej zaborowski [this message]
2008-05-02 7:41 ` Jan Kiszka
2008-05-02 10:12 ` andrzej zaborowski
2008-05-02 10:55 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb249edb0805011908m17957e1eh29933bc0bf08b7d0@mail.gmail.com \
--to=balrogg@gmail.com \
--cc=av1474@comtv.ru \
--cc=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).