29 snd_pcm_sw_params_malloc(&sParams);
31 assert(
"Couldn't malloc SW params");
36 snd_pcm_sw_params_free(sParams);
45 return snd_pcm_sw_params_current(
getPCM(), sParams);
53 return snd_pcm_sw_params(
getPCM(), sParams);
62 return snd_pcm_sw_params_set_start_threshold(
getPCM(), sParams, thresh);
71 return snd_pcm_sw_params_set_avail_min(
getPCM(), sParams, cnt);
78 void *
getAddress(
const snd_pcm_channel_area_t *areas, snd_pcm_uframes_t offset)
const {
79 return (
void*)((
char*)(areas->addr)+(areas->first+offset*areas->step)/8);
87 template<
typename SAMPLE_TYPE>
89 return areas->step/
sizeof(SAMPLE_TYPE)/8;;
96 return snd_pcm_sw_params_dump(sParams,
log);
virtual snd_pcm_t * getPCM()
void * getAddress(const snd_pcm_channel_area_t *areas, snd_pcm_uframes_t offset) const
int getChannelCount(const snd_pcm_channel_area_t *areas) const
#define PCM_NOT_OPEN_CHECK(pcm)
int setSWThreshold(snd_pcm_uframes_t thresh)
snd_output_t * log
The log stream if enabled.
int setAvailMin(snd_pcm_uframes_t cnt)
snd_pcm_sw_params_t * sParams
PCM software params.