aboutsummaryrefslogtreecommitdiff
path: root/audio/fmodaudio.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-05 18:55:28 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-11-05 18:55:28 +0000
commitc0fe3827ea18f7d29550f2ff2495cec2fe7a3d94 (patch)
tree2a9572602c93a5424a488929b56f29ac610a1641 /audio/fmodaudio.c
parentf04308e45274d0e74546870ea7b02aaef07b077e (diff)
audio merge (malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1601 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'audio/fmodaudio.c')
-rw-r--r--audio/fmodaudio.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/audio/fmodaudio.c b/audio/fmodaudio.c
index 36b8d47c43..072d8a830a 100644
--- a/audio/fmodaudio.c
+++ b/audio/fmodaudio.c
@@ -78,7 +78,7 @@ static void GCC_FMT_ATTR (2, 3) fmod_logerr2 (
{
va_list ap;
- AUD_log (AUDIO_CAP, "Can not initialize %s\n", typ);
+ AUD_log (AUDIO_CAP, "Could not initialize %s\n", typ);
va_start (ap, fmt);
AUD_vlog (AUDIO_CAP, fmt, ap);
@@ -356,17 +356,17 @@ static void fmod_fini_out (HWVoiceOut *hw)
}
}
-static int fmod_init_out (HWVoiceOut *hw, int freq, int nchannels, audfmt_e fmt)
+static int fmod_init_out (HWVoiceOut *hw, audsettings_t *as)
{
int bits16, mode, channel;
FMODVoiceOut *fmd = (FMODVoiceOut *) hw;
- mode = aud_to_fmodfmt (fmt, nchannels == 2 ? 1 : 0);
+ mode = aud_to_fmodfmt (as->fmt, as->nchannels == 2 ? 1 : 0);
fmd->fmod_sample = FSOUND_Sample_Alloc (
FSOUND_FREE, /* index */
conf.nb_samples, /* length */
mode, /* mode */
- freq, /* freq */
+ as->freq, /* freq */
255, /* volume */
128, /* pan */
255 /* priority */
@@ -386,10 +386,9 @@ static int fmod_init_out (HWVoiceOut *hw, int freq, int nchannels, audfmt_e fmt)
fmd->channel = channel;
/* FMOD always operates on little endian frames? */
- audio_pcm_init_info (&hw->info, freq, nchannels, fmt,
- audio_need_to_swap_endian (0));
+ audio_pcm_init_info (&hw->info, as, audio_need_to_swap_endian (0));
bits16 = (mode & FSOUND_16BITS) != 0;
- hw->bufsize = conf.nb_samples << (nchannels == 2) << bits16;
+ hw->samples = conf.nb_samples;
return 0;
}
@@ -417,7 +416,7 @@ static int fmod_ctl_out (HWVoiceOut *hw, int cmd, ...)
return 0;
}
-static int fmod_init_in (HWVoiceIn *hw, int freq, int nchannels, audfmt_e fmt)
+static int fmod_init_in (HWVoiceIn *hw, audsettings_t *as)
{
int bits16, mode;
FMODVoiceIn *fmd = (FMODVoiceIn *) hw;
@@ -426,12 +425,12 @@ static int fmod_init_in (HWVoiceIn *hw, int freq, int nchannels, audfmt_e fmt)
return -1;
}
- mode = aud_to_fmodfmt (fmt, nchannels == 2 ? 1 : 0);
+ mode = aud_to_fmodfmt (as->fmt, as->nchannels == 2 ? 1 : 0);
fmd->fmod_sample = FSOUND_Sample_Alloc (
FSOUND_FREE, /* index */
conf.nb_samples, /* length */
mode, /* mode */
- freq, /* freq */
+ as->freq, /* freq */
255, /* volume */
128, /* pan */
255 /* priority */
@@ -443,10 +442,9 @@ static int fmod_init_in (HWVoiceIn *hw, int freq, int nchannels, audfmt_e fmt)
}
/* FMOD always operates on little endian frames? */
- audio_pcm_init_info (&hw->info, freq, nchannels, fmt,
- audio_need_to_swap_endian (0));
+ audio_pcm_init_info (&hw->info, as, audio_need_to_swap_endian (0));
bits16 = (mode & FSOUND_16BITS) != 0;
- hw->bufsize = conf.nb_samples << (nchannels == 2) << bits16;
+ hw->samples = conf.nb_samples;
return 0;
}
@@ -479,7 +477,7 @@ static int fmod_run_in (HWVoiceIn *hw)
new_pos = FSOUND_Record_GetPosition ();
if (new_pos < 0) {
- fmod_logerr ("Can not get recording position\n");
+ fmod_logerr ("Could not get recording position\n");
return 0;
}