r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / cinelerra / audioalsa.h
blob51224028649f1a2d4109c004396b4cd8d0de52e4
1 #ifndef AUDIOALSA_H
2 #define AUDIOALSA_H
4 #include "arraylist.h"
5 #include "audiodevice.h"
7 #ifdef HAVE_ALSA
8 #include "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 int close_input();
24 int64_t device_position();
25 int flush_device();
26 int interrupt_playback();
28 private:
29 int close_output();
30 void translate_name(char *output, char *input);
31 snd_pcm_format_t translate_format(int format);
32 void set_params(snd_pcm_t *dsp,
33 int channels,
34 int bits,
35 int samplerate,
36 int samples);
37 int create_format(snd_pcm_format_t *format, int bits, int channels, int rate);
38 snd_pcm_t* get_output();
39 snd_pcm_t* get_input();
40 snd_pcm_t *dsp_in, *dsp_out, *dsp_duplex;
41 int64_t samples_written;
42 Timer *timer;
43 int delay;
44 Mutex *timer_lock;
45 int interrupted;
48 #endif
49 #endif