27 #include <alsa/asoundlib.h> 36 #define ALSA_PCM_NEW_HW_PARAMS_API 37 #define ALSA_PCM_NEW_SW_PARAMS_API 50 typedef char* (*play_function)(
const float*,
char*, int, int);
51 typedef char* (*clear_function)(
char*, int, int);
53 enum { MAXPFD = 8, MAXPLAY = 4 };
55 bool setHwpar(snd_pcm_t* handle, snd_pcm_hw_params_t* hwpar);
56 bool setSwpar(snd_pcm_t* handle, snd_pcm_sw_params_t* swpar);
73 char* _play_ptr [MAXPLAY];
81 static char* clear_32le(
char* dst,
int step,
int nfrm);
82 static char* clear_24le(
char* dst,
int step,
int nfrm);
83 static char* clear_16le(
char* dst,
int step,
int nfrm);
84 static char* play_32le(
const float* src,
char* dst,
int step,
int nfrm);
85 static char* play_24le(
const float* src,
char* dst,
int step,
int nfrm);
86 static char* play_16le(
const float* src,
char* dst,
int step,
int nfrm);
87 int playInit(snd_pcm_uframes_t len);
88 snd_pcm_sframes_t pcmWait();
91 _play_ptr[chan] = _clear_func(_play_ptr[chan], _play_step, len);
95 AlsaDriver(QString,
unsigned, snd_pcm_uframes_t,
unsigned);
101 snd_pcm_uframes_t
fsize()
const {
return _frsize; }
103 void write(
int n,
float* l,
float* r);
119 void registerClient();
124 virtual bool init(
bool hot =
false);
125 virtual bool start(
bool hotPlug =
false);
127 float* getLBuffer(
long n);
128 float* getRBuffer(
long n);
130 virtual void startTransport();
131 virtual void stopTransport();
133 virtual int sampleRate()
const;
135 void write(
int n,
void* l);
137 virtual void midiRead();
138 virtual void updateOutPortCount(
int maxport);
snd_pcm_hw_params_t * _play_hwpar
Definition: alsa.h:65
snd_pcm_sw_params_t * _play_swpar
Definition: alsa.h:66
pthread_t thread
Definition: alsa.h:111
bool seekflag
Definition: alsa.h:115
snd_pcm_access_t _play_access
Definition: alsa.h:63
bool _xrun
Definition: alsa.h:76
int _pcnt
Definition: alsa.h:75
snd_pcm_t * playHandle() const
Definition: alsa.h:89
int _play_npfd
Definition: alsa.h:68
int _stat
Definition: alsa.h:74
struct pollfd PollFd
Definition: alsa.h:34
play_function _play_func
Definition: alsa.h:78
Definition: mididriver.h:68
AlsaDriver * alsa
Definition: alsa.h:112
Transport
Definition: seq.h:92
snd_pcm_uframes_t _capt_offs
Definition: alsa.h:70
MidiDriver * midiDriver
Definition: alsa.h:117
snd_pcm_uframes_t fsize() const
Definition: alsa.h:101
void clearChan(int chan, snd_pcm_uframes_t len)
Definition: alsa.h:90
unsigned int _nfrags
Definition: alsa.h:61
bool mmappedInterface
Definition: alsa.h:79
snd_pcm_format_t _play_format
Definition: alsa.h:62
snd_pcm_t * _play_handle
Definition: alsa.h:64
clear_function _clear_func
Definition: alsa.h:77
unsigned int sampleRate() const
Definition: alsa.h:102
snd_pcm_uframes_t _frsize
Definition: alsa.h:60
Transport state
Definition: alsa.h:114
Definition: aeolus.cpp:26
snd_pcm_uframes_t _play_offs
Definition: alsa.h:71
unsigned int _play_nchan
Definition: alsa.h:67
QString _name
Definition: alsa.h:49
virtual bool isRealtime() const
Definition: alsa.h:129
unsigned int _rate
Definition: alsa.h:59
volatile int runAlsa
Definition: alsa.h:113
int _play_step
Definition: alsa.h:72