int sign;
int freq;
int nchannels;
- int align;
- int shift;
+ int bytes_per_frame;
int bytes_per_second;
int swap_endianness;
};
size_t samples;
QLIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
QLIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
- int ctl_caps;
struct audio_pcm_ops *pcm_ops;
QLIST_ENTRY (HWVoiceOut) entries;
} HWVoiceOut;
size_t samples;
QLIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
- int ctl_caps;
struct audio_pcm_ops *pcm_ops;
QLIST_ENTRY (HWVoiceIn) entries;
} HWVoiceIn;
int max_voices_in;
int voice_size_out;
int voice_size_in;
- int ctl_caps;
QLIST_ENTRY(audio_driver) next;
};
* size may be smaller
*/
size_t (*put_buffer_out)(HWVoiceOut *hw, void *buf, size_t size);
- int (*ctl_out) (HWVoiceOut *hw, int cmd, ...);
+ void (*enable_out)(HWVoiceOut *hw, bool enable);
+ void (*volume_out)(HWVoiceOut *hw, Volume *vol);
int (*init_in) (HWVoiceIn *hw, audsettings *as, void *drv_opaque);
void (*fini_in) (HWVoiceIn *hw);
size_t (*read) (HWVoiceIn *hw, void *buf, size_t size);
void *(*get_buffer_in)(HWVoiceIn *hw, size_t *size);
void (*put_buffer_in)(HWVoiceIn *hw, void *buf, size_t size);
- int (*ctl_in) (HWVoiceIn *hw, int cmd, ...);
+ void (*enable_in)(HWVoiceIn *hw, bool enable);
+ void (*volume_in)(HWVoiceIn *hw, Volume *vol);
};
void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size);
size_t audio_rate_get_bytes(struct audio_pcm_info *info, RateCtl *rate,
size_t bytes_avail);
-#define VOICE_ENABLE 1
-#define VOICE_DISABLE 2
-#define VOICE_VOLUME 3
-
-#define VOICE_VOLUME_CAP (1 << VOICE_VOLUME)
-
static inline size_t audio_ring_dist(size_t dst, size_t src, size_t len)
{
return (dst >= src) ? (dst - src) : (len - src + dst);