mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
audio: split ctl_* functions into enable_* and volume_*
This way we no longer need vararg functions, improving compile time error detection. Also now it's possible to check actually what commands are supported, without needing to manually update ctl_caps. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 2b08b3773569c5be055d0a0fb2f29ff64e79f0f4.1568927990.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
857271a29c
commit
571a8c522e
12 changed files with 222 additions and 320 deletions
|
@ -285,20 +285,9 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int sdl_ctl_out (HWVoiceOut *hw, int cmd, ...)
|
||||
static void sdl_enable_out(HWVoiceOut *hw, bool enable)
|
||||
{
|
||||
(void) hw;
|
||||
|
||||
switch (cmd) {
|
||||
case VOICE_ENABLE:
|
||||
SDL_PauseAudio (0);
|
||||
break;
|
||||
|
||||
case VOICE_DISABLE:
|
||||
SDL_PauseAudio (1);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
SDL_PauseAudio(!enable);
|
||||
}
|
||||
|
||||
static void *sdl_audio_init(Audiodev *dev)
|
||||
|
@ -334,7 +323,7 @@ static struct audio_pcm_ops sdl_pcm_ops = {
|
|||
.write = sdl_write,
|
||||
.get_buffer_out = sdl_get_buffer_out,
|
||||
.put_buffer_out = sdl_put_buffer_out_nowrite,
|
||||
.ctl_out = sdl_ctl_out,
|
||||
.enable_out = sdl_enable_out,
|
||||
};
|
||||
|
||||
static struct audio_driver sdl_audio_driver = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue