23 #ifndef INCLUDED_AUDIO_ALSA_SOURCE_H
24 #define INCLUDED_AUDIO_ALSA_SOURCE_H
27 #define ALSA_PCM_NEW_HW_PARAMS_API
28 #define ALSA_PCM_NEW_SW_PARAMS_API
32 #include <alsa/asoundlib.h>
53 unsigned int d_sampling_rate;
54 std::string d_device_name;
55 snd_pcm_t *d_pcm_handle;
56 snd_pcm_hw_params_t *d_hw_params;
57 snd_pcm_sw_params_t *d_sw_params;
58 snd_pcm_format_t d_format;
59 unsigned int d_nperiods;
60 unsigned int d_period_time_us;
61 snd_pcm_uframes_t d_period_size;
62 unsigned int d_buffer_size_bytes;
65 unsigned int d_hw_nchan;
66 bool d_special_case_stereo_to_mono;
72 void output_error_msg (
const char *msg,
int err);
73 void bail (
const char *msg,
int err)
throw (std::runtime_error);
83 int work (
int noutput_items,
88 bool read_buffer (
void *buffer,
unsigned nframes,
unsigned sizeof_frame);