int rpos, live, decr;
int samples;
uint8_t *dst;
- st_sample_t *src;
+ struct st_sample *src;
snd_pcm_sframes_t avail;
live = audio_pcm_hw_get_live_out (hw);
}
}
-static int alsa_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
{
ALSAVoiceOut *alsa = (ALSAVoiceOut *) hw;
struct alsa_params_req req;
struct alsa_params_obt obt;
snd_pcm_t *handle;
- audsettings_t obt_as;
+ struct audsettings obt_as;
req.fmt = aud_to_alsafmt (as->fmt);
req.freq = as->freq;
return -1;
}
-static int alsa_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int alsa_init_in (HWVoiceIn *hw, struct audsettings *as)
{
ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;
struct alsa_params_req req;
struct alsa_params_obt obt;
snd_pcm_t *handle;
- audsettings_t obt_as;
+ struct audsettings obt_as;
req.fmt = aud_to_alsafmt (as->fmt);
req.freq = as->freq;
for (i = 0; i < 2; ++i) {
void *src;
- st_sample_t *dst;
+ struct st_sample *dst;
snd_pcm_sframes_t nread;
snd_pcm_uframes_t len;
int enabled;
int nb_voices;
int greedy;
- audsettings_t settings;
+ struct audsettings settings;
};
static struct {
static AudioState glob_audio_state;
-volume_t nominal_volume = {
+struct mixeng_volume nominal_volume = {
0,
#ifdef FLOAT_MIXENG
1.0,
}
}
-static void audio_print_settings (audsettings_t *as)
+static void audio_print_settings (struct audsettings *as)
{
dolog ("frequency=%d nchannels=%d fmt=", as->freq, as->nchannels);
AUD_log (NULL, "\n");
}
-static int audio_validate_settings (audsettings_t *as)
+static int audio_validate_settings (struct audsettings *as)
{
int invalid;
return invalid ? -1 : 0;
}
-static int audio_pcm_info_eq (struct audio_pcm_info *info, audsettings_t *as)
+static int audio_pcm_info_eq (struct audio_pcm_info *info, struct audsettings *as)
{
int bits = 8, sign = 0;
&& info->swap_endianness == (as->endianness != AUDIO_HOST_ENDIANNESS);
}
-void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as)
+void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
{
int bits = 8, sign = 0, shift = 0;
/*
* Capture
*/
-static void noop_conv (st_sample_t *dst, const void *src,
- int samples, volume_t *vol)
+static void noop_conv (struct st_sample *dst, const void *src,
+ int samples, struct mixeng_volume *vol)
{
(void) src;
(void) dst;
static CaptureVoiceOut *audio_pcm_capture_find_specific (
AudioState *s,
- audsettings_t *as
+ struct audsettings *as
)
{
CaptureVoiceOut *cap;
{
HWVoiceIn *hw = sw->hw;
int samples, live, ret = 0, swlim, isamp, osamp, rpos, total = 0;
- st_sample_t *src, *dst = sw->buf;
+ struct st_sample *src, *dst = sw->buf;
rpos = audio_pcm_sw_get_rpos_in (sw) % hw->samples;
while (live) {
int left = hw->samples - rpos;
int to_capture = audio_MIN (live, left);
- st_sample_t *src;
+ struct st_sample *src;
struct capture_callback *cb;
src = hw->mix_buf + rpos;
CaptureVoiceOut *AUD_add_capture (
AudioState *s,
- audsettings_t *as,
+ struct audsettings *as,
struct audio_capture_ops *ops,
void *cb_opaque
)
/* XXX find a more elegant way */
hw->samples = 4096 * 4;
hw->mix_buf = audio_calloc (AUDIO_FUNC, hw->samples,
- sizeof (st_sample_t));
+ sizeof (struct st_sample));
if (!hw->mix_buf) {
dolog ("Could not allocate capture mix buffer (%d samples)\n",
hw->samples);
#define AUDIO_HOST_ENDIANNESS 0
#endif
-typedef struct {
+struct audsettings {
int freq;
int nchannels;
audfmt_e fmt;
int endianness;
-} audsettings_t;
+};
typedef enum {
AUD_CNOTIFY_ENABLE,
void AUD_remove_card (QEMUSoundCard *card);
CaptureVoiceOut *AUD_add_capture (
AudioState *s,
- audsettings_t *as,
+ struct audsettings *as,
struct audio_capture_ops *ops,
void *opaque
);
const char *name,
void *callback_opaque,
audio_callback_fn_t callback_fn,
- audsettings_t *settings
+ struct audsettings *settings
);
void AUD_close_out (QEMUSoundCard *card, SWVoiceOut *sw);
const char *name,
void *callback_opaque,
audio_callback_fn_t callback_fn,
- audsettings_t *settings
+ struct audsettings *settings
);
void AUD_close_in (QEMUSoundCard *card, SWVoiceIn *sw);
int rpos;
uint64_t ts_helper;
- st_sample_t *mix_buf;
+ struct st_sample *mix_buf;
int samples;
LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
int total_samples_captured;
uint64_t ts_helper;
- st_sample_t *conv_buf;
+ struct st_sample *conv_buf;
int samples;
LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
struct audio_pcm_info info;
t_sample *conv;
int64_t ratio;
- st_sample_t *buf;
+ struct st_sample *buf;
void *rate;
int total_hw_samples_mixed;
int active;
int empty;
HWVoiceOut *hw;
char *name;
- volume_t vol;
+ struct mixeng_volume vol;
struct audio_callback callback;
LIST_ENTRY (SWVoiceOut) entries;
};
int64_t ratio;
void *rate;
int total_hw_samples_acquired;
- st_sample_t *buf;
+ struct st_sample *buf;
f_sample *clip;
HWVoiceIn *hw;
char *name;
- volume_t vol;
+ struct mixeng_volume vol;
struct audio_callback callback;
LIST_ENTRY (SWVoiceIn) entries;
};
};
struct audio_pcm_ops {
- int (*init_out)(HWVoiceOut *hw, audsettings_t *as);
+ int (*init_out)(HWVoiceOut *hw, struct audsettings *as);
void (*fini_out)(HWVoiceOut *hw);
int (*run_out) (HWVoiceOut *hw);
int (*write) (SWVoiceOut *sw, void *buf, int size);
int (*ctl_out) (HWVoiceOut *hw, int cmd, ...);
- int (*init_in) (HWVoiceIn *hw, audsettings_t *as);
+ int (*init_in) (HWVoiceIn *hw, struct audsettings *as);
void (*fini_in) (HWVoiceIn *hw);
int (*run_in) (HWVoiceIn *hw);
int (*read) (SWVoiceIn *sw, void *buf, int size);
extern struct audio_driver dsound_audio_driver;
extern struct audio_driver esd_audio_driver;
extern struct audio_driver pa_audio_driver;
-extern volume_t nominal_volume;
+extern struct mixeng_volume nominal_volume;
-void audio_pcm_init_info (struct audio_pcm_info *info, audsettings_t *as);
+void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as);
void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len);
int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int len);
static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw)
{
- HWBUF = audio_calloc (AUDIO_FUNC, hw->samples, sizeof (st_sample_t));
+ HWBUF = audio_calloc (AUDIO_FUNC, hw->samples, sizeof (struct st_sample));
if (!HWBUF) {
dolog ("Could not allocate " NAME " buffer (%d samples)\n",
hw->samples);
samples = ((int64_t) sw->hw->samples << 32) / sw->ratio;
#endif
- sw->buf = audio_calloc (AUDIO_FUNC, samples, sizeof (st_sample_t));
+ sw->buf = audio_calloc (AUDIO_FUNC, samples, sizeof (struct st_sample));
if (!sw->buf) {
dolog ("Could not allocate buffer for `%s' (%d samples)\n",
SW_NAME (sw), samples);
SW *sw,
HW *hw,
const char *name,
- audsettings_t *as
+ struct audsettings *as
)
{
int err;
static HW *glue (audio_pcm_hw_find_specific_, TYPE) (
AudioState *s,
HW *hw,
- audsettings_t *as
+ struct audsettings *as
)
{
while ((hw = glue (audio_pcm_hw_find_any_, TYPE) (s, hw))) {
return NULL;
}
-static HW *glue (audio_pcm_hw_add_new_, TYPE) (AudioState *s, audsettings_t *as)
+static HW *glue (audio_pcm_hw_add_new_, TYPE) (AudioState *s,
+ struct audsettings *as)
{
HW *hw;
struct audio_driver *drv = s->drv;
return NULL;
}
-static HW *glue (audio_pcm_hw_add_, TYPE) (AudioState *s, audsettings_t *as)
+static HW *glue (audio_pcm_hw_add_, TYPE) (AudioState *s,
+ struct audsettings *as)
{
HW *hw;
static SW *glue (audio_pcm_create_voice_pair_, TYPE) (
AudioState *s,
const char *sw_name,
- audsettings_t *as
+ struct audsettings *as
)
{
SW *sw;
HW *hw;
- audsettings_t hw_as;
+ struct audsettings hw_as;
if (glue (conf.fixed_, TYPE).enabled) {
hw_as = glue (conf.fixed_, TYPE).settings;
const char *name,
void *callback_opaque ,
audio_callback_fn_t callback_fn,
- audsettings_t *as
+ struct audsettings *as
)
{
AudioState *s;
HWVoiceOut *hw = hwptr;
coreaudioVoiceOut *core = (coreaudioVoiceOut *) hwptr;
int rpos, live;
- st_sample_t *src;
+ struct st_sample *src;
#ifndef FLOAT_MIXENG
#ifdef RECIPROCAL
const float scale = 1.f / UINT_MAX;
return audio_pcm_sw_write (sw, buf, len);
}
-static int coreaudio_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
{
OSStatus status;
coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;
}
#ifdef DSBTYPE_IN
-static int dsound_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int dsound_init_in (HWVoiceIn *hw, struct audsettings *as)
#else
-static int dsound_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int dsound_init_out (HWVoiceOut *hw, struct audsettings *as)
#endif
{
int err;
HRESULT hr;
dsound *s = &glob_dsound;
WAVEFORMATEX wfx;
- audsettings_t obt_as;
+ struct audsettings obt_as;
#ifdef DSBTYPE_IN
const char *typ = "ADC";
DSoundVoiceIn *ds = (DSoundVoiceIn *) hw;
int set_primary;
int bufsize_in;
int bufsize_out;
- audsettings_t settings;
+ struct audsettings settings;
int latency_millis;
} conf = {
1,
LPDIRECTSOUND dsound;
LPDIRECTSOUNDCAPTURE dsound_capture;
LPDIRECTSOUNDBUFFER dsound_primary_buffer;
- audsettings_t settings;
+ struct audsettings settings;
} dsound;
static dsound glob_dsound;
return -1;
}
-static int waveformat_from_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
+static int waveformat_from_audio_settings (WAVEFORMATEX *wfx,
+ struct audsettings *as)
{
memset (wfx, 0, sizeof (*wfx));
return 0;
}
-static int waveformat_to_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
+static int waveformat_to_audio_settings (WAVEFORMATEX *wfx,
+ struct audsettings *as)
{
if (wfx->wFormatTag != WAVE_FORMAT_PCM) {
dolog ("Invalid wave format, tag is not PCM, but %d\n",
int src_len1 = dst_len;
int src_len2 = 0;
int pos = hw->rpos + dst_len;
- st_sample_t *src1 = hw->mix_buf + hw->rpos;
- st_sample_t *src2 = NULL;
+ struct st_sample *src1 = hw->mix_buf + hw->rpos;
+ struct st_sample *src2 = NULL;
if (pos > hw->samples) {
src_len1 = hw->samples - hw->rpos;
while (to_mix) {
ssize_t written;
int chunk = audio_MIN (to_mix, hw->samples - rpos);
- st_sample_t *src = hw->mix_buf + rpos;
+ struct st_sample *src = hw->mix_buf + rpos;
hw->clip (esd->pcm_buf, src, chunk);
return audio_pcm_sw_write (sw, buf, len);
}
-static int qesd_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int qesd_init_out (HWVoiceOut *hw, struct audsettings *as)
{
ESDVoiceOut *esd = (ESDVoiceOut *) hw;
- audsettings_t obt_as = *as;
+ struct audsettings obt_as = *as;
int esdfmt = ESD_STREAM | ESD_PLAY;
int err;
sigset_t set, old_set;
return audio_pcm_sw_read (sw, buf, len);
}
-static int qesd_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int qesd_init_in (HWVoiceIn *hw, struct audsettings *as)
{
ESDVoiceIn *esd = (ESDVoiceIn *) hw;
- audsettings_t obt_as = *as;
+ struct audsettings obt_as = *as;
int esdfmt = ESD_STREAM | ESD_RECORD;
int err;
sigset_t set, old_set;
int src_len1 = dst_len;
int src_len2 = 0;
int pos = hw->rpos + dst_len;
- st_sample_t *src1 = hw->mix_buf + hw->rpos;
- st_sample_t *src2 = NULL;
+ struct st_sample *src1 = hw->mix_buf + hw->rpos;
+ struct st_sample *src2 = NULL;
if (pos > hw->samples) {
src_len1 = hw->samples - hw->rpos;
}
}
-static int fmod_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int fmod_init_out (HWVoiceOut *hw, struct audsettings *as)
{
int bits16, mode, channel;
FMODVoiceOut *fmd = (FMODVoiceOut *) hw;
- audsettings_t obt_as = *as;
+ struct audsettings obt_as = *as;
mode = aud_to_fmodfmt (as->fmt, as->nchannels == 2 ? 1 : 0);
fmd->fmod_sample = FSOUND_Sample_Alloc (
return 0;
}
-static int fmod_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int fmod_init_in (HWVoiceIn *hw, struct audsettings *as)
{
int bits16, mode;
FMODVoiceIn *fmd = (FMODVoiceIn *) hw;
- audsettings_t obt_as = *as;
+ struct audsettings obt_as = *as;
if (conf.broken_adc) {
return -1;
uint64_t opos;
uint64_t opos_inc;
uint32_t ipos; /* position in the input stream (integer) */
- st_sample_t ilast; /* last sample in the input stream */
+ struct st_sample ilast; /* last sample in the input stream */
};
/*
qemu_free (opaque);
}
-void mixeng_clear (st_sample_t *buf, int len)
+void mixeng_clear (struct st_sample *buf, int len)
{
- memset (buf, 0, len * sizeof (st_sample_t));
+ memset (buf, 0, len * sizeof (struct st_sample));
}
#define QEMU_MIXENG_H
#ifdef FLOAT_MIXENG
-typedef float real_t;
-typedef struct { int mute; real_t r; real_t l; } volume_t;
-typedef struct { real_t l; real_t r; } st_sample_t;
+typedef float mixeng_real;
+struct mixeng_volume { int mute; mixeng_real r; mixeng_real l; };
+struct mixeng_sample { mixeng_real l; mixeng_real r; };
#else
-typedef struct { int mute; int64_t r; int64_t l; } volume_t;
-typedef struct { int64_t l; int64_t r; } st_sample_t;
+struct mixeng_volume { int mute; int64_t r; int64_t l; };
+struct st_sample { int64_t l; int64_t r; };
#endif
-typedef void (t_sample) (st_sample_t *dst, const void *src,
- int samples, volume_t *vol);
-typedef void (f_sample) (void *dst, const st_sample_t *src, int samples);
+typedef void (t_sample) (struct st_sample *dst, const void *src,
+ int samples, struct mixeng_volume *vol);
+typedef void (f_sample) (void *dst, const struct st_sample *src, int samples);
extern t_sample *mixeng_conv[2][2][2][3];
extern f_sample *mixeng_clip[2][2][2][3];
void *st_rate_start (int inrate, int outrate);
-void st_rate_flow (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
+void st_rate_flow (void *opaque, struct st_sample *ibuf, struct st_sample *obuf,
int *isamp, int *osamp);
-void st_rate_flow_mix (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
+void st_rate_flow_mix (void *opaque, struct st_sample *ibuf, struct st_sample *obuf,
int *isamp, int *osamp);
void st_rate_stop (void *opaque);
-void mixeng_clear (st_sample_t *buf, int len);
+void mixeng_clear (struct st_sample *buf, int len);
#endif /* mixeng.h */
#define ET glue (ENDIAN_CONVERSION, glue (_, IN_T))
#ifdef FLOAT_MIXENG
-static real_t inline glue (conv_, ET) (IN_T v)
+static mixeng_real inline glue (conv_, ET) (IN_T v)
{
IN_T nv = ENDIAN_CONVERT (v);
#ifdef RECIPROCAL
#ifdef SIGNED
- return nv * (1.f / (real_t) (IN_MAX - IN_MIN));
+ return nv * (1.f / (mixeng_real) (IN_MAX - IN_MIN));
#else
- return (nv - HALF) * (1.f / (real_t) IN_MAX);
+ return (nv - HALF) * (1.f / (mixeng_real) IN_MAX);
#endif
#else /* !RECIPROCAL */
#ifdef SIGNED
- return nv / (real_t) (IN_MAX - IN_MIN);
+ return nv / (mixeng_real) (IN_MAX - IN_MIN);
#else
- return (nv - HALF) / (real_t) IN_MAX;
+ return (nv - HALF) / (mixeng_real) IN_MAX;
#endif
#endif
}
-static IN_T inline glue (clip_, ET) (real_t v)
+static IN_T inline glue (clip_, ET) (mixeng_real v)
{
if (v >= 0.5) {
return IN_MAX;
#endif
static void glue (glue (conv_, ET), _to_stereo)
- (st_sample_t *dst, const void *src, int samples, volume_t *vol)
+ (struct st_sample *dst, const void *src, int samples, struct mixeng_volume *vol)
{
- st_sample_t *out = dst;
+ struct st_sample *out = dst;
IN_T *in = (IN_T *) src;
#ifdef CONFIG_MIXEMU
if (vol->mute) {
}
static void glue (glue (conv_, ET), _to_mono)
- (st_sample_t *dst, const void *src, int samples, volume_t *vol)
+ (struct st_sample *dst, const void *src, int samples, struct mixeng_volume *vol)
{
- st_sample_t *out = dst;
+ struct st_sample *out = dst;
IN_T *in = (IN_T *) src;
#ifdef CONFIG_MIXEMU
if (vol->mute) {
}
static void glue (glue (clip_, ET), _from_stereo)
- (void *dst, const st_sample_t *src, int samples)
+ (void *dst, const struct st_sample *src, int samples)
{
- const st_sample_t *in = src;
+ const struct st_sample *in = src;
IN_T *out = (IN_T *) dst;
while (samples--) {
*out++ = glue (clip_, ET) (in->l);
}
static void glue (glue (clip_, ET), _from_mono)
- (void *dst, const st_sample_t *src, int samples)
+ (void *dst, const struct st_sample *src, int samples)
{
- const st_sample_t *in = src;
+ const struct st_sample *in = src;
IN_T *out = (IN_T *) dst;
while (samples--) {
*out++ = glue (clip_, ET) (in->l + in->r);
return audio_pcm_sw_write (sw, buf, len);
}
-static int no_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int no_init_out (HWVoiceOut *hw, struct audsettings *as)
{
audio_pcm_init_info (&hw->info, as);
hw->samples = 1024;
return 0;
}
-static int no_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int no_init_in (HWVoiceIn *hw, struct audsettings *as)
{
audio_pcm_init_info (&hw->info, as);
hw->samples = 1024;
int err, rpos, live, decr;
int samples;
uint8_t *dst;
- st_sample_t *src;
+ struct st_sample *src;
struct audio_buf_info abinfo;
struct count_info cntinfo;
int bufsize;
}
}
-static int oss_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int oss_init_out (HWVoiceOut *hw, struct audsettings *as)
{
OSSVoiceOut *oss = (OSSVoiceOut *) hw;
struct oss_params req, obt;
int err;
int fd;
audfmt_e effective_fmt;
- audsettings_t obt_as;
+ struct audsettings obt_as;
oss->fd = -1;
return 0;
}
-static int oss_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int oss_init_in (HWVoiceIn *hw, struct audsettings *as)
{
OSSVoiceIn *oss = (OSSVoiceIn *) hw;
struct oss_params req, obt;
int err;
int fd;
audfmt_e effective_fmt;
- audsettings_t obt_as;
+ struct audsettings obt_as;
oss->fd = -1;
while (to_mix) {
int error;
int chunk = audio_MIN (to_mix, hw->samples - rpos);
- st_sample_t *src = hw->mix_buf + rpos;
+ struct st_sample *src = hw->mix_buf + rpos;
hw->clip (pa->pcm_buf, src, chunk);
}
}
-static int qpa_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int qpa_init_out (HWVoiceOut *hw, struct audsettings *as)
{
int error;
static pa_sample_spec ss;
- audsettings_t obt_as = *as;
+ struct audsettings obt_as = *as;
PAVoiceOut *pa = (PAVoiceOut *) hw;
ss.format = audfmt_to_pa (as->fmt, as->endianness);
return -1;
}
-static int qpa_init_in (HWVoiceIn *hw, audsettings_t *as)
+static int qpa_init_in (HWVoiceIn *hw, struct audsettings *as)
{
int error;
static pa_sample_spec ss;
- audsettings_t obt_as = *as;
+ struct audsettings obt_as = *as;
PAVoiceIn *pa = (PAVoiceIn *) hw;
ss.format = audfmt_to_pa (as->fmt, as->endianness);
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-void NAME (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
+void NAME (void *opaque, struct st_sample *ibuf, struct st_sample *obuf,
int *isamp, int *osamp)
{
struct rate *rate = opaque;
- st_sample_t *istart, *iend;
- st_sample_t *ostart, *oend;
- st_sample_t ilast, icur, out;
+ struct st_sample *istart, *iend;
+ struct st_sample *ostart, *oend;
+ struct st_sample ilast, icur, out;
#ifdef FLOAT_MIXENG
- real_t t;
+ mixeng_real t;
#else
int64_t t;
#endif
#ifdef RECIPROCAL
t = (rate->opos & UINT_MAX) * (1.f / UINT_MAX);
#else
- t = (rate->opos & UINT_MAX) / (real_t) UINT_MAX;
+ t = (rate->opos & UINT_MAX) / (mixeng_real) UINT_MAX;
#endif
out.l = (ilast.l * (1.0 - t)) + icur.l * t;
out.r = (ilast.r * (1.0 - t)) + icur.r * t;
decr = to_mix;
while (to_mix) {
int chunk = audio_MIN (to_mix, hw->samples - hw->rpos);
- st_sample_t *src = hw->mix_buf + hw->rpos;
+ struct st_sample *src = hw->mix_buf + hw->rpos;
/* dolog ("in callback to_mix %d, chunk %d\n", to_mix, chunk); */
hw->clip (buf, src, chunk);
sdl_close (&glob_sdl);
}
-static int sdl_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)
{
SDLVoiceOut *sdl = (SDLVoiceOut *) hw;
SDLAudioState *s = &glob_sdl;
int endianess;
int err;
audfmt_e effective_fmt;
- audsettings_t obt_as;
+ struct audsettings obt_as;
shift <<= as->nchannels == 2;
} WAVVoiceOut;
static struct {
- audsettings_t settings;
+ struct audsettings settings;
const char *wav_path;
} conf = {
{
WAVVoiceOut *wav = (WAVVoiceOut *) hw;
int rpos, live, decr, samples;
uint8_t *dst;
- st_sample_t *src;
+ struct st_sample *src;
int64_t now = qemu_get_clock (vm_clock);
int64_t ticks = now - wav->old_ticks;
int64_t bytes = (ticks * hw->info.bytes_per_second) / ticks_per_sec;
}
}
-static int wav_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int wav_init_out (HWVoiceOut *hw, struct audsettings *as)
{
WAVVoiceOut *wav = (WAVVoiceOut *) hw;
int bits16 = 0, stereo = 0;
0x02, 0x00, 0x44, 0xac, 0x00, 0x00, 0x10, 0xb1, 0x02, 0x00, 0x04,
0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00
};
- audsettings_t wav_as = conf.settings;
+ struct audsettings wav_as = conf.settings;
(void) as;
0x02, 0x00, 0x44, 0xac, 0x00, 0x00, 0x10, 0xb1, 0x02, 0x00, 0x04,
0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00
};
- audsettings_t as;
+ struct audsettings as;
struct audio_capture_ops ops;
int stereo, bits16, shift;
CaptureVoiceOut *cap;
static void open_voice (AC97LinkState *s, int index, int freq)
{
- audsettings_t as;
+ struct audsettings as;
as.freq = freq;
as.nchannels = 2;
int Adlib_init (AudioState *audio, qemu_irq *pic)
{
AdlibState *s = &glob_adlib;
- audsettings_t as;
+ struct audsettings as;
if (!audio) {
dolog ("No audio state\n");
static void cs_reset_voices (CSState *s, uint32_t val)
{
int xtal;
- audsettings_t as;
+ struct audsettings as;
#ifdef DEBUG_XLAW
if (val == 0 || val == 32)
(new_fmt & 2) ? AUD_FMT_S16 : AUD_FMT_U8,
d->shift);
if (new_freq) {
- audsettings_t as;
+ struct audsettings as;
as.freq = new_freq;
as.nchannels = 1 << (new_fmt & 1);
int GUS_init (AudioState *audio, qemu_irq *pic)
{
GUSState *s;
- audsettings_t as;
+ struct audsettings as;
if (!audio) {
dolog ("No audio state\n");
static void omap_eac_format_update(struct omap_eac_s *s)
{
- audsettings_t fmt;
+ struct audsettings fmt;
/* The hardware buffers at most one sample */
if (s->codec.rxlen)
int pcspk_audio_init(AudioState *audio, qemu_irq *pic)
{
PCSpkState *s = &pcspk_state;
- audsettings_t as = {PCSPK_SAMPLE_RATE, 1, AUD_FMT_U8, 0};
+ struct audsettings as = {PCSPK_SAMPLE_RATE, 1, AUD_FMT_U8, 0};
if (!audio) {
AUD_log(s_spk, "No audio state\n");
static void continue_dma8 (SB16State *s)
{
if (s->freq > 0) {
- audsettings_t as;
+ struct audsettings as;
s->audio_free = 0;
}
if (s->freq) {
- audsettings_t as;
+ struct audsettings as;
s->audio_free = 0;
static void legacy_reset (SB16State *s)
{
- audsettings_t as;
+ struct audsettings as;
s->freq = 11025;
s->fmt_signed = 0;
if (s->dma_running) {
if (s->freq) {
- audsettings_t as;
+ struct audsettings as;
s->audio_free = 0;
static void tsc2102_audio_output_update(struct tsc210x_state_s *s)
{
int enable;
- audsettings_t fmt;
+ struct audsettings fmt;
if (s->dac_voice[0]) {
tsc210x_out_flush(s, s->codec.out.len);
static void wm8750_set_format(struct wm8750_s *s)
{
int i;
- audsettings_t in_fmt;
- audsettings_t out_fmt;
- audsettings_t monoout_fmt;
+ struct audsettings in_fmt;
+ struct audsettings out_fmt;
+ struct audsettings monoout_fmt;
wm8750_out_flush(s);
int client_blue_shift, client_blue_max, server_blue_shift, server_blue_max;
CaptureVoiceOut *audio_cap;
- audsettings_t as;
+ struct audsettings as;
VncReadEvent *read_handler;
size_t read_handler_expect;