qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume


From: andrzej zaborowski
Subject: Re: [Qemu-devel] [PATCH 1/2] Introduce AUD_set_volume
Date: Fri, 2 May 2008 04:08:07 +0200

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]