diff options
author | Kővágó, Zoltán <dirty.ice.hu@gmail.com> | 2019-09-19 23:24:22 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-09-23 12:28:47 +0200 |
commit | 571a8c522e0095239598347ac0add93337c1e0bf (patch) | |
tree | 7f105479a79bd3193575d39b2f841cae01836811 /audio/wavaudio.c | |
parent | 857271a29c2c0e5deb05deb540a2580d1d408b34 (diff) |
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>
Diffstat (limited to 'audio/wavaudio.c')
-rw-r--r-- | audio/wavaudio.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 85f5ff9c28..47efdc1b1e 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -173,14 +173,13 @@ static void wav_fini_out (HWVoiceOut *hw) wav->f = NULL; } -static int wav_ctl_out (HWVoiceOut *hw, int cmd, ...) +static void wav_enable_out(HWVoiceOut *hw, bool enable) { WAVVoiceOut *wav = (WAVVoiceOut *) hw; - if (cmd == VOICE_ENABLE) { + if (enable) { audio_rate_start(&wav->rate); } - return 0; } static void *wav_audio_init(Audiodev *dev) @@ -198,7 +197,7 @@ static struct audio_pcm_ops wav_pcm_ops = { .init_out = wav_init_out, .fini_out = wav_fini_out, .write = wav_write_out, - .ctl_out = wav_ctl_out, + .enable_out = wav_enable_out, }; static struct audio_driver wav_audio_driver = { |