trunk/src/emu/sound/cdda.c
| r20133 | r20134 | |
| 18 | 18 | UINT8 * audio_cache; |
| 19 | 19 | UINT32 audio_samples; |
| 20 | 20 | UINT32 audio_bptr; |
| 21 | INT16 audio_volume[2]; |
| 21 | 22 | }; |
| 22 | 23 | |
| 23 | 24 | INLINE cdda_info *get_safe_token(device_t *device) |
| r20133 | r20134 | |
| 40 | 41 | { |
| 41 | 42 | cdda_info *info = (cdda_info *)param; |
| 42 | 43 | get_audio_data(info, &outputs[0][0], &outputs[1][0], samples); |
| 44 | info->audio_volume[0] = (INT16)outputs[0][0]; |
| 45 | info->audio_volume[1] = (INT16)outputs[1][0]; |
| 43 | 46 | } |
| 44 | 47 | |
| 45 | 48 | |
| r20133 | r20134 | |
| 312 | 315 | cdda->stream->set_output_gain(channel,volume / 100.0); |
| 313 | 316 | } |
| 314 | 317 | |
| 318 | |
| 319 | /*------------------------------------------------- |
| 320 | cdda_get_channel_volume - sets CD-DA volume level |
| 321 | for either speaker, used for volume control display |
| 322 | -------------------------------------------------*/ |
| 323 | |
| 324 | INT16 cdda_get_channel_volume(device_t *device, int channel) |
| 325 | { |
| 326 | cdda_info *cdda = get_safe_token(device); |
| 327 | |
| 328 | return cdda->audio_volume[channel]; |
| 329 | } |
| 330 | |
| 315 | 331 | const device_type CDDA = &device_creator<cdda_device>; |
| 316 | 332 | |
| 317 | 333 | cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
trunk/src/emu/sound/cdda.h
| r20133 | r20134 | |
| 13 | 13 | void cdda_pause_audio(device_t *device, int pause); |
| 14 | 14 | void cdda_set_volume(device_t *device, int volume); |
| 15 | 15 | void cdda_set_channel_volume(device_t *device, int channel, int volume); |
| 16 | INT16 cdda_get_channel_volume(device_t *device, int channel); |
| 16 | 17 | |
| 17 | 18 | UINT32 cdda_get_audio_lba(device_t *device); |
| 18 | 19 | int cdda_audio_active(device_t *device); |