23 #ifndef INCLUDED_AUDIO_ALSA_SINK_H
24 #define INCLUDED_AUDIO_ALSA_SINK_H
27 #define ALSA_PCM_NEW_HW_PARAMS_API
28 #define ALSA_PCM_NEW_SW_PARAMS_API
32 #include <alsa/asoundlib.h>
50 unsigned int d_sampling_rate;
51 std::string d_device_name;
52 snd_pcm_t *d_pcm_handle;
53 snd_pcm_hw_params_t *d_hw_params;
54 snd_pcm_sw_params_t *d_sw_params;
55 snd_pcm_format_t d_format;
56 unsigned int d_nperiods;
57 unsigned int d_period_time_us;
58 snd_pcm_uframes_t d_period_size;
59 unsigned int d_buffer_size_bytes;
62 bool d_special_case_mono_to_stereo;
69 void output_error_msg (
const char *msg,
int err);
70 void bail (
const char *msg,
int err)
throw (std::runtime_error);
80 int work (
int noutput_items,
86 bool write_buffer (
const void *buffer,
unsigned nframes,
unsigned sizeof_frame);