#include <Hardware.H>
Hardware class for the ALSA lib, representing one sound card.
Definition at line 26 of file Hardware.H.
◆ Hardware()
ALSA::Hardware::Hardware |
( |
| ) |
|
|
inline |
◆ ~Hardware()
virtual ALSA::Hardware::~Hardware |
( |
| ) |
|
|
inlinevirtual |
◆ copyFrom()
void ALSA::Hardware::copyFrom |
( |
snd_pcm_hw_params_t * |
hParamsIn | ) |
|
|
inline |
Copy the input hw_params to the class
- Parameters
-
hParamsIn | the hw_params to copy |
Definition at line 83 of file Hardware.H.
◆ dumpHWParams()
int ALSA::Hardware::dumpHWParams |
( |
| ) |
|
|
inline |
◆ fillParams()
int ALSA::Hardware::fillParams |
( |
| ) |
|
|
inline |
Fill params with a full configuration space for a PCM. Note you have to call setAccess, setFormat, setChannels, setSampleRate if you call this.
- Returns
- >= 0 on success
Definition at line 51 of file Hardware.H.
◆ formatDescription()
const char* ALSA::Hardware::formatDescription |
( |
const snd_pcm_format_t |
format | ) |
const |
|
inline |
◆ getAccess()
int ALSA::Hardware::getAccess |
( |
void |
| ) |
|
|
inline |
Get the access mode for the hardware
- Returns
- <0 on error or the access mode
Definition at line 116 of file Hardware.H.
◆ getChannels()
int ALSA::Hardware::getChannels |
( |
| ) |
|
|
inline |
Get the channel count
- Returns
- >= 0 on success returns the channel count
Definition at line 222 of file Hardware.H.
◆ getDeviceName()
const char* ALSA::Hardware::getDeviceName |
( |
| ) |
|
|
inline |
◆ getFormat()
int ALSA::Hardware::getFormat |
( |
snd_pcm_format_t & |
format | ) |
|
|
inline |
Get the format from a configuration space
- Parameters
-
params | Configuration space |
format | returned format |
- Returns
- format otherwise a negative error code if the configuration space does not contain a single value
Definition at line 195 of file Hardware.H.
◆ getFormatPhysicalWidth()
int ALSA::Hardware::getFormatPhysicalWidth |
( |
| ) |
|
|
inline |
Get the bits per sample.
- Returns
- <0 on error or the bits per sample.
Definition at line 202 of file Hardware.H.
◆ getHWParams()
int ALSA::Hardware::getHWParams |
( |
| ) |
|
|
inline |
Set the hardware params
- Returns
- >= 0 on success
Definition at line 42 of file Hardware.H.
◆ getMaxChannels()
int ALSA::Hardware::getMaxChannels |
( |
| ) |
|
|
inline |
Get the maximum number of channels for this device.
- Returns
- <0 on error, the maximum number of channels this device can drive.
Definition at line 234 of file Hardware.H.
◆ getPeriodSize() [1/2]
int ALSA::Hardware::getPeriodSize |
( |
snd_pcm_uframes_t * |
p, |
|
|
int * |
dir = NULL |
|
) |
| |
|
inline |
Get the period size
- Parameters
-
p | Returned approximate period size in frames |
dir | The direction to search in (-1,0,1) |
- Returns
- >= 0 on success
Definition at line 275 of file Hardware.H.
◆ getPeriodSize() [2/2]
int ALSA::Hardware::getPeriodSize |
( |
int * |
dir = NULL | ) |
|
|
inline |
Get the period size
- Parameters
-
p | Returned approximate period size in frames |
dir | The direction to search in (-1,0,1) |
- Returns
- >= 0 on success
Definition at line 284 of file Hardware.H.
◆ getSampleRate()
int ALSA::Hardware::getSampleRate |
( |
int |
dir = 0 | ) |
|
|
inline |
Get the sample rate
- Parameters
-
rate | The current sample rate. |
dir | The direction to search in (-1,0,1) |
- Returns
- >= 0 on success
Definition at line 261 of file Hardware.H.
◆ rateResample()
int ALSA::Hardware::rateResample |
( |
unsigned int |
state | ) |
|
|
inline |
Alter the sample rate resample.
- Parameters
-
state | True to resample and fals to not resample. |
- Returns
- >= 0 on success
Definition at line 91 of file Hardware.H.
◆ resetParams()
int ALSA::Hardware::resetParams |
( |
| ) |
|
|
inline |
Reset the params with a full configuration space for a PCM. Note you have to call setAccess, setFormat, setChannels, setSampleRate if you call this.
- Returns
- >= 0 on success
Definition at line 63 of file Hardware.H.
◆ setAccess()
int ALSA::Hardware::setAccess |
( |
snd_pcm_access_t |
access | ) |
|
|
inline |
Set the type of channel layout in the buffer
- Parameters
-
access | is the type of channel layout, one of SND_PCM_ACCESS_MMAP_INTERLEAVED mmap access with simple interleaved channels SND_PCM_ACCESS_MMAP_NONINTERLEAVED mmap access with simple non interleaved channels SND_PCM_ACCESS_MMAP_COMPLEX mmap access with complex placement SND_PCM_ACCESS_RW_INTERLEAVED snd_pcm_readi/snd_pcm_writei access SND_PCM_ACCESS_RW_NONINTERLEAVED snd_pcm_readn/snd_pcm_writen access |
- Returns
- >= 0 on success
Definition at line 105 of file Hardware.H.
◆ setBufSize()
int ALSA::Hardware::setBufSize |
( |
snd_pcm_uframes_t |
bufSize | ) |
|
|
inline |
Set the buffer size
- Parameters
-
- Returns
- <0 on error.
Definition at line 303 of file Hardware.H.
◆ setChannels()
int ALSA::Hardware::setChannels |
( |
unsigned int |
cnt | ) |
|
|
inline |
Set the number of channels
- Parameters
-
cnt | The number of channels. |
- Returns
- >= 0 on success
Definition at line 214 of file Hardware.H.
◆ setFormat()
int ALSA::Hardware::setFormat |
( |
snd_pcm_format_t |
format | ) |
|
|
inline |
Set the sample type
- Parameters
-
- Returns
- >= 0 on success SND_PCM_FORMAT_S8 Signed 8 bit SND_PCM_FORMAT_U8 Unsigned 8 bit SND_PCM_FORMAT_S16_LE Signed 16 bit Little Endian SND_PCM_FORMAT_S16_BE Signed 16 bit Big Endian SND_PCM_FORMAT_U16_LE Unsigned 16 bit Little Endian SND_PCM_FORMAT_U16_BE Unsigned 16 bit Big Endian SND_PCM_FORMAT_S24_LE Signed 24 bit Little Endian using low three bytes in 32-bit word SND_PCM_FORMAT_S24_BE Signed 24 bit Big Endian using low three bytes in 32-bit word SND_PCM_FORMAT_U24_LE Unsigned 24 bit Little Endian using low three bytes in 32-bit word SND_PCM_FORMAT_U24_BE Unsigned 24 bit Big Endian using low three bytes in 32-bit word SND_PCM_FORMAT_S32_LE Signed 32 bit Little Endian SND_PCM_FORMAT_S32_BE Signed 32 bit Big Endian SND_PCM_FORMAT_U32_LE Unsigned 32 bit Little Endian SND_PCM_FORMAT_U32_BE Unsigned 32 bit Big Endian SND_PCM_FORMAT_FLOAT_LE Float 32 bit Little Endian, Range -1.0 to 1.0 SND_PCM_FORMAT_FLOAT_BE Float 32 bit Big Endian, Range -1.0 to 1.0 SND_PCM_FORMAT_FLOAT64_LE Float 64 bit Little Endian, Range -1.0 to 1.0 SND_PCM_FORMAT_FLOAT64_BE Float 64 bit Big Endian, Range -1.0 to 1.0 SND_PCM_FORMAT_IEC958_SUBFRAME_LE IEC-958 Little Endian SND_PCM_FORMAT_IEC958_SUBFRAME_BE IEC-958 Big Endian SND_PCM_FORMAT_MU_LAW Mu-Law SND_PCM_FORMAT_A_LAW A-Law SND_PCM_FORMAT_IMA_ADPCM Ima-ADPCM SND_PCM_FORMAT_MPEG MPEG SND_PCM_FORMAT_GSM GSM SND_PCM_FORMAT_SPECIAL Special SND_PCM_FORMAT_S24_3LE Signed 24bit Little Endian in 3bytes format SND_PCM_FORMAT_S24_3BE Signed 24bit Big Endian in 3bytes format SND_PCM_FORMAT_U24_3LE Unsigned 24bit Little Endian in 3bytes format SND_PCM_FORMAT_U24_3BE Unsigned 24bit Big Endian in 3bytes format SND_PCM_FORMAT_S20_3LE Signed 20bit Little Endian in 3bytes format SND_PCM_FORMAT_S20_3BE Signed 20bit Big Endian in 3bytes format SND_PCM_FORMAT_U20_3LE Unsigned 20bit Little Endian in 3bytes format SND_PCM_FORMAT_U20_3BE Unsigned 20bit Big Endian in 3bytes format SND_PCM_FORMAT_S18_3LE Signed 18bit Little Endian in 3bytes format SND_PCM_FORMAT_S18_3BE Signed 18bit Big Endian in 3bytes format SND_PCM_FORMAT_U18_3LE Unsigned 18bit Little Endian in 3bytes format SND_PCM_FORMAT_U18_3BE Unsigned 18bit Big Endian in 3bytes format SND_PCM_FORMAT_G723_24 G.723 (ADPCM) 24 kbit/s, 8 samples in 3 bytes SND_PCM_FORMAT_G723_24_1B G.723 (ADPCM) 24 kbit/s, 1 sample in 1 byte SND_PCM_FORMAT_G723_40 G.723 (ADPCM) 40 kbit/s, 8 samples in 3 bytes SND_PCM_FORMAT_G723_40_1B G.723 (ADPCM) 40 kbit/s, 1 sample in 1 byte SND_PCM_FORMAT_DSD_U8 Direct Stream Digital (DSD) in 1-byte samples (x8) SND_PCM_FORMAT_DSD_U16_LE Direct Stream Digital (DSD) in 2-byte samples (x16)
SND_PCM_FORMAT_S16 Signed 16 bit CPU endian SND_PCM_FORMAT_U16 Unsigned 16 bit CPU endian SND_PCM_FORMAT_S24 Signed 24 bit CPU endian SND_PCM_FORMAT_U24 Unsigned 24 bit CPU endian SND_PCM_FORMAT_S32 Signed 32 bit CPU endian SND_PCM_FORMAT_U32 Unsigned 32 bit CPU endian SND_PCM_FORMAT_FLOAT Float 32 bit CPU endian SND_PCM_FORMAT_FLOAT64 Float 64 bit CPU endian SND_PCM_FORMAT_IEC958_SUBFRAME IEC-958 CPU Endian
Definition at line 182 of file Hardware.H.
◆ setHWParams()
int ALSA::Hardware::setHWParams |
( |
| ) |
|
|
inlineprotected |
Set the hardware params
- Returns
- >= 0 on success
Definition at line 33 of file Hardware.H.
◆ setPeriodSize()
int ALSA::Hardware::setPeriodSize |
( |
snd_pcm_uframes_t * |
p, |
|
|
int * |
dir = 0 |
|
) |
| |
|
inline |
Set the period size
- Parameters
-
p | approximate period size in frames |
dir | The direction to search in (-1,0,1) |
- Returns
- >= 0 on success
Definition at line 294 of file Hardware.H.
◆ setSampleRate()
int ALSA::Hardware::setSampleRate |
( |
unsigned int |
rrate, |
|
|
int |
dir = 0 |
|
) |
| |
|
inline |
Set the sample rate closest to the desired rate.
- Parameters
-
rrate | The desired sample rate. |
dir | The direction to search in (-1,0,1) |
- Returns
- >= 0 on success
Definition at line 248 of file Hardware.H.
◆ hParams
snd_pcm_hw_params_t* ALSA::Hardware::hParams |
|
private |
The documentation for this class was generated from the following file: