r999: maintainers added to README_en.
[cinelerra_cv/mob.git] / cinelerra / audioalsa.h
blob95214cd41f93d1805f98b84c948828d793b59665
1 #ifndef AUDIOALSA_H
2 #define AUDIOALSA_H
4 #include "adeviceprefs.inc"
5 #include "arraylist.h"
6 #include "audiodevice.h"
8 #ifdef HAVE_ALSA
9 #include <alsa/asoundlib.h>
11 class AudioALSA : public AudioLowLevel
13 public:
14 AudioALSA(AudioDevice *device);
15 ~AudioALSA();
17 static void list_devices(ArrayList<char*> *devices, int pcm_title = 0, int mode = MODEPLAY);
18 int open_input();
19 int open_output();
20 int open_duplex();
21 int write_buffer(char *buffer, int size);
22 int read_buffer(char *buffer, int size);
23 int close_all();
24 int close_input();
25 int64_t device_position();
26 int flush_device();
27 int interrupt_playback();
29 private:
30 int close_output();
31 void translate_name(char *output, char *input);
32 snd_pcm_format_t translate_format(int format);
33 void set_params(snd_pcm_t *dsp,
34 int channels,
35 int bits,
36 int samplerate,
37 int samples);
38 int create_format(snd_pcm_format_t *format, int bits, int channels, int rate);
39 snd_pcm_t* get_output();
40 snd_pcm_t* get_input();
41 snd_pcm_t *dsp_in, *dsp_out, *dsp_duplex;
42 int64_t samples_written;
43 Timer *timer;
44 int delay;
45 Mutex *timer_lock;
46 int interrupted;
49 #endif
50 #endif