Ardour  9.0-pre0-582-g084a23a80d
Alsa_pcmi Class Reference

#include <zita-alsa-pcmi.h>

Public Types

enum  {
  DEBUG_INIT = 0x001 , DEBUG_STAT = 0x002 , DEBUG_WAIT = 0x004 , DEBUG_DATA = 0x008 ,
  DEBUG_ALL = 0x00f , FORCE_16B = 0x100 , FORCE_2CH = 0x200 , TRY_INTLVD = 0x400
}
 

Public Member Functions

 Alsa_pcmi (const char *play_name, const char *capt_name, const char *ctrl_name, unsigned int rate, unsigned int frsize, unsigned int play_nfrags, unsigned int capt_nfrags, unsigned int debug=0)
 
 ~Alsa_pcmi (void)
 
void printinfo (void)
 
int pcm_start (void)
 
int pcm_stop (void)
 
int pcm_idle (int len)
 
snd_pcm_sframes_t pcm_wait (void)
 
int play_init (snd_pcm_uframes_t len)
 
void clear_chan (int chan, int len)
 
void play_chan (int chan, const float *src, int len, int step=1)
 
int play_done (int len)
 
int capt_init (snd_pcm_uframes_t len)
 
void capt_chan (int chan, float *dst, int len, int step=1)
 
int capt_done (int len)
 
int play_avail (void)
 
int capt_avail (void)
 
int play_delay (void)
 
int capt_delay (void)
 
float play_xrun (void) const
 
float capt_xrun (void) const
 
int state (void) const
 
size_t fsize (void) const
 
uint32_t fsamp (void) const
 
uint32_t play_nfrag (void) const
 
uint32_t capt_nfrag (void) const
 
uint32_t nplay (void) const
 
uint32_t ncapt (void) const
 
snd_pcm_t * play_handle (void) const
 
snd_pcm_t * capt_handle (void) const
 

Private Types

enum  { MAXPFD = 16 , MAXCHAN = 128 }
 
typedef char *(Alsa_pcmi::* clear_function) (char *, int)
 
typedef char *(Alsa_pcmi::* play_function) (const float *, char *, int, int)
 
typedef const char *(Alsa_pcmi::* capt_function) (const char *, float *, int, int)
 

Private Member Functions

void initialise (const char *play_name, const char *capt_name, const char *ctrl_name)
 
int set_hwpar (snd_pcm_t *handle, snd_pcm_hw_params_t *hwpar, const char *sname, unsigned int nfrag, unsigned int *nchan)
 
int set_swpar (snd_pcm_t *handle, snd_pcm_sw_params_t *swpar, const char *sname)
 
int recover (void)
 
float xruncheck (snd_pcm_status_t *stat)
 
char * clear_32 (char *dst, int nfrm)
 
char * clear_24 (char *dst, int nfrm)
 
char * clear_16 (char *dst, int nfrm)
 
char * play_floatne (const float *src, char *dst, int nfrm, int step)
 
char * play_floatre (const float *src, char *dst, int nfrm, int step)
 
char * play_32le (const float *src, char *dst, int nfrm, int step)
 
char * play_24le (const float *src, char *dst, int nfrm, int step)
 
char * play_16le (const float *src, char *dst, int nfrm, int step)
 
char * play_32be (const float *src, char *dst, int nfrm, int step)
 
char * play_24be (const float *src, char *dst, int nfrm, int step)
 
char * play_16be (const float *src, char *dst, int nfrm, int step)
 
const char * capt_floatne (const char *src, float *dst, int nfrm, int step)
 
const char * capt_floatre (const char *src, float *dst, int nfrm, int step)
 
const char * capt_32le (const char *src, float *dst, int nfrm, int step)
 
const char * capt_24le (const char *src, float *dst, int nfrm, int step)
 
const char * capt_16le (const char *src, float *dst, int nfrm, int step)
 
const char * capt_32be (const char *src, float *dst, int nfrm, int step)
 
const char * capt_24be (const char *src, float *dst, int nfrm, int step)
 
const char * capt_16be (const char *src, float *dst, int nfrm, int step)
 

Private Attributes

unsigned int _fsamp
 
snd_pcm_uframes_t _fsize
 
unsigned int _play_nfrag
 
unsigned int _real_nfrag
 
unsigned int _capt_nfrag
 
unsigned int _debug
 
int _state
 
snd_pcm_t * _play_handle
 
snd_pcm_t * _capt_handle
 
snd_ctl_t * _ctrl_handle
 
snd_pcm_hw_params_t * _play_hwpar
 
snd_pcm_sw_params_t * _play_swpar
 
snd_pcm_hw_params_t * _capt_hwpar
 
snd_pcm_sw_params_t * _capt_swpar
 
snd_pcm_format_t _play_format
 
snd_pcm_format_t _capt_format
 
snd_pcm_access_t _play_access
 
snd_pcm_access_t _capt_access
 
unsigned int _play_nchan
 
unsigned int _capt_nchan
 
float _play_xrun
 
float _capt_xrun
 
bool _synced
 
int _play_npfd
 
int _capt_npfd
 
struct pollfd _poll_fd [MAXPFD]
 
snd_pcm_uframes_t _capt_offs
 
snd_pcm_uframes_t _play_offs
 
int _play_step
 
int _capt_step
 
char * _play_ptr [MAXCHAN]
 
const char * _capt_ptr [MAXCHAN]
 
clear_function _clear_func
 
play_function _play_func
 
capt_function _capt_func
 
void * _dummy [16]
 

Detailed Description

Definition at line 28 of file zita-alsa-pcmi.h.

Member Typedef Documentation

◆ capt_function

typedef const char*(Alsa_pcmi::* Alsa_pcmi::capt_function) (const char *, float *, int, int)
private

Definition at line 114 of file zita-alsa-pcmi.h.

◆ clear_function

typedef char*(Alsa_pcmi::* Alsa_pcmi::clear_function) (char *, int)
private

Definition at line 112 of file zita-alsa-pcmi.h.

◆ play_function

typedef char*(Alsa_pcmi::* Alsa_pcmi::play_function) (const float *, char *, int, int)
private

Definition at line 113 of file zita-alsa-pcmi.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEBUG_INIT 
DEBUG_STAT 
DEBUG_WAIT 
DEBUG_DATA 
DEBUG_ALL 
FORCE_16B 
FORCE_2CH 
TRY_INTLVD 

Definition at line 43 of file zita-alsa-pcmi.h.

◆ anonymous enum

anonymous enum
private
Enumerator
MAXPFD 
MAXCHAN 

Definition at line 116 of file zita-alsa-pcmi.h.

Constructor & Destructor Documentation

◆ Alsa_pcmi()

Alsa_pcmi::Alsa_pcmi ( const char *  play_name,
const char *  capt_name,
const char *  ctrl_name,
unsigned int  rate,
unsigned int  frsize,
unsigned int  play_nfrags,
unsigned int  capt_nfrags,
unsigned int  debug = 0 
)

◆ ~Alsa_pcmi()

Alsa_pcmi::~Alsa_pcmi ( void  )

Member Function Documentation

◆ capt_16be()

const char* Alsa_pcmi::capt_16be ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_16le()

const char* Alsa_pcmi::capt_16le ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_24be()

const char* Alsa_pcmi::capt_24be ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_24le()

const char* Alsa_pcmi::capt_24le ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_32be()

const char* Alsa_pcmi::capt_32be ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_32le()

const char* Alsa_pcmi::capt_32le ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_avail()

int Alsa_pcmi::capt_avail ( void  )
inline

Definition at line 76 of file zita-alsa-pcmi.h.

◆ capt_chan()

void Alsa_pcmi::capt_chan ( int  chan,
float *  dst,
int  len,
int  step = 1 
)

◆ capt_delay()

int Alsa_pcmi::capt_delay ( void  )
inline

Definition at line 88 of file zita-alsa-pcmi.h.

◆ capt_done()

int Alsa_pcmi::capt_done ( int  len)

◆ capt_floatne()

const char* Alsa_pcmi::capt_floatne ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_floatre()

const char* Alsa_pcmi::capt_floatre ( const char *  src,
float *  dst,
int  nfrm,
int  step 
)
private

◆ capt_handle()

snd_pcm_t* Alsa_pcmi::capt_handle ( void  ) const
inline

Definition at line 109 of file zita-alsa-pcmi.h.

◆ capt_init()

int Alsa_pcmi::capt_init ( snd_pcm_uframes_t  len)

◆ capt_nfrag()

uint32_t Alsa_pcmi::capt_nfrag ( void  ) const
inline

Definition at line 103 of file zita-alsa-pcmi.h.

◆ capt_xrun()

float Alsa_pcmi::capt_xrun ( void  ) const
inline

Definition at line 96 of file zita-alsa-pcmi.h.

◆ clear_16()

char* Alsa_pcmi::clear_16 ( char *  dst,
int  nfrm 
)
private

◆ clear_24()

char* Alsa_pcmi::clear_24 ( char *  dst,
int  nfrm 
)
private

◆ clear_32()

char* Alsa_pcmi::clear_32 ( char *  dst,
int  nfrm 
)
private

◆ clear_chan()

void Alsa_pcmi::clear_chan ( int  chan,
int  len 
)

◆ fsamp()

uint32_t Alsa_pcmi::fsamp ( void  ) const
inline

Definition at line 100 of file zita-alsa-pcmi.h.

◆ fsize()

size_t Alsa_pcmi::fsize ( void  ) const
inline

Definition at line 99 of file zita-alsa-pcmi.h.

◆ initialise()

void Alsa_pcmi::initialise ( const char *  play_name,
const char *  capt_name,
const char *  ctrl_name 
)
private

◆ ncapt()

uint32_t Alsa_pcmi::ncapt ( void  ) const
inline

Definition at line 106 of file zita-alsa-pcmi.h.

◆ nplay()

uint32_t Alsa_pcmi::nplay ( void  ) const
inline

Definition at line 105 of file zita-alsa-pcmi.h.

◆ pcm_idle()

int Alsa_pcmi::pcm_idle ( int  len)

◆ pcm_start()

int Alsa_pcmi::pcm_start ( void  )

◆ pcm_stop()

int Alsa_pcmi::pcm_stop ( void  )

◆ pcm_wait()

snd_pcm_sframes_t Alsa_pcmi::pcm_wait ( void  )

◆ play_16be()

char* Alsa_pcmi::play_16be ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_16le()

char* Alsa_pcmi::play_16le ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_24be()

char* Alsa_pcmi::play_24be ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_24le()

char* Alsa_pcmi::play_24le ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_32be()

char* Alsa_pcmi::play_32be ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_32le()

char* Alsa_pcmi::play_32le ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_avail()

int Alsa_pcmi::play_avail ( void  )
inline

Definition at line 71 of file zita-alsa-pcmi.h.

◆ play_chan()

void Alsa_pcmi::play_chan ( int  chan,
const float *  src,
int  len,
int  step = 1 
)

◆ play_delay()

int Alsa_pcmi::play_delay ( void  )
inline

Definition at line 81 of file zita-alsa-pcmi.h.

◆ play_done()

int Alsa_pcmi::play_done ( int  len)

◆ play_floatne()

char* Alsa_pcmi::play_floatne ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_floatre()

char* Alsa_pcmi::play_floatre ( const float *  src,
char *  dst,
int  nfrm,
int  step 
)
private

◆ play_handle()

snd_pcm_t* Alsa_pcmi::play_handle ( void  ) const
inline

Definition at line 108 of file zita-alsa-pcmi.h.

◆ play_init()

int Alsa_pcmi::play_init ( snd_pcm_uframes_t  len)

◆ play_nfrag()

uint32_t Alsa_pcmi::play_nfrag ( void  ) const
inline

Definition at line 102 of file zita-alsa-pcmi.h.

◆ play_xrun()

float Alsa_pcmi::play_xrun ( void  ) const
inline

Definition at line 95 of file zita-alsa-pcmi.h.

◆ printinfo()

void Alsa_pcmi::printinfo ( void  )

◆ recover()

int Alsa_pcmi::recover ( void  )
private

◆ set_hwpar()

int Alsa_pcmi::set_hwpar ( snd_pcm_t *  handle,
snd_pcm_hw_params_t *  hwpar,
const char *  sname,
unsigned int  nfrag,
unsigned int *  nchan 
)
private

◆ set_swpar()

int Alsa_pcmi::set_swpar ( snd_pcm_t *  handle,
snd_pcm_sw_params_t *  swpar,
const char *  sname 
)
private

◆ state()

int Alsa_pcmi::state ( void  ) const
inline

Definition at line 98 of file zita-alsa-pcmi.h.

◆ xruncheck()

float Alsa_pcmi::xruncheck ( snd_pcm_status_t *  stat)
private

Member Data Documentation

◆ _capt_access

snd_pcm_access_t Alsa_pcmi::_capt_access
private

Definition at line 164 of file zita-alsa-pcmi.h.

◆ _capt_format

snd_pcm_format_t Alsa_pcmi::_capt_format
private

Definition at line 162 of file zita-alsa-pcmi.h.

◆ _capt_func

capt_function Alsa_pcmi::_capt_func
private

Definition at line 181 of file zita-alsa-pcmi.h.

◆ _capt_handle

snd_pcm_t* Alsa_pcmi::_capt_handle
private

Definition at line 155 of file zita-alsa-pcmi.h.

◆ _capt_hwpar

snd_pcm_hw_params_t* Alsa_pcmi::_capt_hwpar
private

Definition at line 159 of file zita-alsa-pcmi.h.

◆ _capt_nchan

unsigned int Alsa_pcmi::_capt_nchan
private

Definition at line 166 of file zita-alsa-pcmi.h.

◆ _capt_nfrag

unsigned int Alsa_pcmi::_capt_nfrag
private

Definition at line 151 of file zita-alsa-pcmi.h.

◆ _capt_npfd

int Alsa_pcmi::_capt_npfd
private

Definition at line 171 of file zita-alsa-pcmi.h.

◆ _capt_offs

snd_pcm_uframes_t Alsa_pcmi::_capt_offs
private

Definition at line 173 of file zita-alsa-pcmi.h.

◆ _capt_ptr

const char* Alsa_pcmi::_capt_ptr[MAXCHAN]
private

Definition at line 178 of file zita-alsa-pcmi.h.

◆ _capt_step

int Alsa_pcmi::_capt_step
private

Definition at line 176 of file zita-alsa-pcmi.h.

◆ _capt_swpar

snd_pcm_sw_params_t* Alsa_pcmi::_capt_swpar
private

Definition at line 160 of file zita-alsa-pcmi.h.

◆ _capt_xrun

float Alsa_pcmi::_capt_xrun
private

Definition at line 168 of file zita-alsa-pcmi.h.

◆ _clear_func

clear_function Alsa_pcmi::_clear_func
private

Definition at line 179 of file zita-alsa-pcmi.h.

◆ _ctrl_handle

snd_ctl_t* Alsa_pcmi::_ctrl_handle
private

Definition at line 156 of file zita-alsa-pcmi.h.

◆ _debug

unsigned int Alsa_pcmi::_debug
private

Definition at line 152 of file zita-alsa-pcmi.h.

◆ _dummy

void* Alsa_pcmi::_dummy[16]
private

Definition at line 182 of file zita-alsa-pcmi.h.

◆ _fsamp

unsigned int Alsa_pcmi::_fsamp
private

Definition at line 147 of file zita-alsa-pcmi.h.

◆ _fsize

snd_pcm_uframes_t Alsa_pcmi::_fsize
private

Definition at line 148 of file zita-alsa-pcmi.h.

◆ _play_access

snd_pcm_access_t Alsa_pcmi::_play_access
private

Definition at line 163 of file zita-alsa-pcmi.h.

◆ _play_format

snd_pcm_format_t Alsa_pcmi::_play_format
private

Definition at line 161 of file zita-alsa-pcmi.h.

◆ _play_func

play_function Alsa_pcmi::_play_func
private

Definition at line 180 of file zita-alsa-pcmi.h.

◆ _play_handle

snd_pcm_t* Alsa_pcmi::_play_handle
private

Definition at line 154 of file zita-alsa-pcmi.h.

◆ _play_hwpar

snd_pcm_hw_params_t* Alsa_pcmi::_play_hwpar
private

Definition at line 157 of file zita-alsa-pcmi.h.

◆ _play_nchan

unsigned int Alsa_pcmi::_play_nchan
private

Definition at line 165 of file zita-alsa-pcmi.h.

◆ _play_nfrag

unsigned int Alsa_pcmi::_play_nfrag
private

Definition at line 149 of file zita-alsa-pcmi.h.

◆ _play_npfd

int Alsa_pcmi::_play_npfd
private

Definition at line 170 of file zita-alsa-pcmi.h.

◆ _play_offs

snd_pcm_uframes_t Alsa_pcmi::_play_offs
private

Definition at line 174 of file zita-alsa-pcmi.h.

◆ _play_ptr

char* Alsa_pcmi::_play_ptr[MAXCHAN]
private

Definition at line 177 of file zita-alsa-pcmi.h.

◆ _play_step

int Alsa_pcmi::_play_step
private

Definition at line 175 of file zita-alsa-pcmi.h.

◆ _play_swpar

snd_pcm_sw_params_t* Alsa_pcmi::_play_swpar
private

Definition at line 158 of file zita-alsa-pcmi.h.

◆ _play_xrun

float Alsa_pcmi::_play_xrun
private

Definition at line 167 of file zita-alsa-pcmi.h.

◆ _poll_fd

struct pollfd Alsa_pcmi::_poll_fd[MAXPFD]
private

Definition at line 171 of file zita-alsa-pcmi.h.

◆ _real_nfrag

unsigned int Alsa_pcmi::_real_nfrag
private

Definition at line 150 of file zita-alsa-pcmi.h.

◆ _state

int Alsa_pcmi::_state
private

Definition at line 153 of file zita-alsa-pcmi.h.

◆ _synced

bool Alsa_pcmi::_synced
private

Definition at line 169 of file zita-alsa-pcmi.h.


The documentation for this class was generated from the following file: