r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / audioalsa.h
blob46ace72b397f29a5003e2bd19130950defb181fb
1 #ifndef AUDIOALSA_H
2 #define AUDIOALSA_H
4 #include "arraylist.h"
5 #include "audiodevice.h"
7 #ifdef HAVE_ALSA
8 #include <alsa/asoundlib.h>
10 class AudioALSA : public AudioLowLevel
12 public:
13 AudioALSA(AudioDevice *device);
14 ~AudioALSA();
16 static void list_devices(ArrayList<char*> *devices, int pcm_title = 0);
17 int open_input();
18 int open_output();
19 int open_duplex();
20 int write_buffer(char *buffer, int size);
21 int read_buffer(char *buffer, int size);
22 int close_all();
23 int64_t device_position();
24 int flush_device();
25 int interrupt_playback();
27 private:
28 void translate_name(char *output, char *input);
29 snd_pcm_format_t translate_format(int format);
30 void set_params(snd_pcm_t *dsp,
31 int channels,
32 int bits,
33 int samplerate,
34 int samples);
35 int create_format(snd_pcm_format_t *format, int bits, int channels, int rate);
36 snd_pcm_t* get_output();
37 snd_pcm_t* get_input();
38 snd_pcm_t *dsp_in, *dsp_out, *dsp_duplex;
41 #endif
42 #endif