Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

audioalsa.h

Go to the documentation of this file.
00001 #ifndef AUDIOALSA_H
00002 #define AUDIOALSA_H
00003 
00004 #include "arraylist.h"
00005 #include "audiodevice.h"
00006 
00007 #ifdef HAVE_ALSA
00008 #include <alsa/asoundlib.h>
00009 
00010 class AudioALSA : public AudioLowLevel
00011 {
00012 public:
00013         AudioALSA(AudioDevice *device);
00014         ~AudioALSA();
00015 
00016         static void list_devices(ArrayList<char*> *devices, int pcm_title = 0);
00017         int open_input();
00018         int open_output();
00019         int open_duplex();
00020         int write_buffer(char *buffer, int size);
00021         int read_buffer(char *buffer, int size);
00022         int close_all();
00023         int close_input();
00024         int64_t device_position();
00025         int flush_device();
00026         int interrupt_playback();
00027 
00028 private:
00029         int close_output();
00030         void translate_name(char *output, char *input);
00031         snd_pcm_format_t translate_format(int format);
00032         void set_params(snd_pcm_t *dsp, 
00033                 int channels, 
00034                 int bits,
00035                 int samplerate,
00036                 int samples);
00037         int create_format(snd_pcm_format_t *format, int bits, int channels, int rate);
00038         snd_pcm_t* get_output();
00039         snd_pcm_t* get_input();
00040         snd_pcm_t *dsp_in, *dsp_out, *dsp_duplex;
00041         int64_t samples_written;
00042         Timer *timer;
00043         int delay;
00044         Mutex *timer_lock;
00045         int interrupted;
00046 };
00047 
00048 #endif
00049 #endif

Generated on Sun Jan 8 13:38:50 2006 for Cinelerra-svn by  doxygen 1.4.4