From 1f6995b11cf26430b4735dae4cdda56d29dce076 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 20 Sep 2010 07:52:40 +0000 Subject: [PATCH] cdda - Added a per-channel volume setting function [Barry Rodewald] --- src/emu/sound/cdda.c | 15 +++++++++++++++ src/emu/sound/cdda.h | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c index bf6ab47f6ed..1c25d7d17ab 100644 --- a/src/emu/sound/cdda.c +++ b/src/emu/sound/cdda.c @@ -303,6 +303,21 @@ void cdda_set_volume(running_device *device,int volume) stream_set_output_gain(cdda->stream,1,volume / 100.0); } +/*------------------------------------------------- + cdda_set_channel_volume - sets CD-DA volume level + for either speaker, used for fade in/out effects +-------------------------------------------------*/ + +void cdda_set_channel_volume(running_device *device, int channel, int volume) +{ + cdda_info *cdda = get_safe_token(device); + + if(channel == 0) + stream_set_output_gain(cdda->stream,0,volume / 100.0); + if(channel == 1) + stream_set_output_gain(cdda->stream,1,volume / 100.0); +} + /************************************************************************** * Generic get_info **************************************************************************/ diff --git a/src/emu/sound/cdda.h b/src/emu/sound/cdda.h index 0131a47ad9f..116555596ad 100644 --- a/src/emu/sound/cdda.h +++ b/src/emu/sound/cdda.h @@ -11,7 +11,8 @@ running_device *cdda_from_cdrom(running_machine *machine, void *file); void cdda_start_audio(running_device *device, UINT32 startlba, UINT32 numblocks); void cdda_stop_audio(running_device *device); void cdda_pause_audio(running_device *device, int pause); -void cdda_set_volume(running_device *device,int volume); +void cdda_set_volume(running_device *device, int volume); +void cdda_set_channel_volume(running_device *device, int channel, int volume); UINT32 cdda_get_audio_lba(running_device *device); int cdda_audio_active(running_device *device);