ALSA project - the C library reference

Data Structures | Functions
Scope Plugin Extension
PCM Interface

## Data Structures
struct | snd_pcm_scope_ops_t

## Functions
snd_pcm_uframes_t | snd_pcm_meter_get_bufsize (snd_pcm_t *pcm)
| Get meter buffer size from a SND_PCM_TYPE_METER PCM. More...
unsigned int | snd_pcm_meter_get_channels (snd_pcm_t *pcm)
| Get meter channels from a SND_PCM_TYPE_METER PCM. More...
unsigned int | snd_pcm_meter_get_rate (snd_pcm_t *pcm)
| Get meter rate from a SND_PCM_TYPE_METER PCM. More...
snd_pcm_uframes_t | snd_pcm_meter_get_now (snd_pcm_t *pcm)
| Get meter "now" frame pointer from a SND_PCM_TYPE_METER PCM. More...
snd_pcm_uframes_t | snd_pcm_meter_get_boundary (snd_pcm_t *pcm)
| Get boundary for frame pointers from a SND_PCM_TYPE_METER PCM. More...
int | snd_pcm_meter_add_scope (snd_pcm_t *pcm, snd_pcm_scope_t *scope)
| Add a scope to a SND_PCM_TYPE_METER PCM. More...
snd_pcm_scope_t * | snd_pcm_meter_search_scope (snd_pcm_t *pcm, const char *name)
| Search an installed scope inside a SND_PCM_TYPE_METER PCM. More...
int | snd_pcm_scope_malloc (snd_pcm_scope_t **ptr)
| allocate an invalid snd_pcm_scope_t using standard malloc More...
void | snd_pcm_scope_set_ops (snd_pcm_scope_t *scope, const snd_pcm_scope_ops_t *val)
| Set callbacks for a SND_PCM_TYPE_METER PCM scope. More...
void | snd_pcm_scope_set_name (snd_pcm_scope_t *scope, const char *val)
| Set name of a SND_PCM_TYPE_METER PCM scope. More...
const char * | snd_pcm_scope_get_name (snd_pcm_scope_t *scope)
| Get name of a SND_PCM_TYPE_METER PCM scope. More...
void * | snd_pcm_scope_get_callback_private (snd_pcm_scope_t *scope)
| Get callbacks private value for a SND_PCM_TYPE_METER PCM scope. More...
void | snd_pcm_scope_set_callback_private (snd_pcm_scope_t *scope, void *val)
| Get callbacks private value for a SND_PCM_TYPE_METER PCM scope. More...
int | snd_pcm_scope_s16_open (snd_pcm_t *pcm, const char *name, snd_pcm_scope_t **scopep)
| Add a s16 pseudo scope to a SND_PCM_TYPE_METER PCM. More...
int16_t * | snd_pcm_scope_s16_get_channel_buffer (snd_pcm_scope_t *scope, unsigned int channel)
| Get s16 pseudo scope frames buffer for a channel. More...

## Detailed Description

See the PCM (digital audio) interface page for more details.

## Function Documentation

## ◆ snd_pcm_meter_add_scope()

int snd_pcm_meter_add_scope | ( | snd_pcm_t * | pcm,
|  | snd_pcm_scope_t * | scope
| ) |  |

Add a scope to a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle
  scope | Scope handle

Returns
  0 on success otherwise a negative error code

## ◆ snd_pcm_meter_get_boundary()

snd_pcm_uframes_t snd_pcm_meter_get_boundary | ( | snd_pcm_t * | pcm | ) |

Get boundary for frame pointers from a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle

Returns
  boundary in frames

## ◆ snd_pcm_meter_get_bufsize()

snd_pcm_uframes_t snd_pcm_meter_get_bufsize | ( | snd_pcm_t * | pcm | ) |

Get meter buffer size from a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle

Returns
  meter buffer size in frames

## ◆ snd_pcm_meter_get_channels()

unsigned int snd_pcm_meter_get_channels | ( | snd_pcm_t * | pcm | ) |

Get meter channels from a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle

Returns
  meter channels count

## ◆ snd_pcm_meter_get_now()

snd_pcm_uframes_t snd_pcm_meter_get_now | ( | snd_pcm_t * | pcm | ) |

Get meter "now" frame pointer from a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle

Returns
  "now" frame pointer in frames (0 ... boundary - 1) see snd_pcm_meter_get_boundary

## ◆ snd_pcm_meter_get_rate()

unsigned int snd_pcm_meter_get_rate | ( | snd_pcm_t * | pcm | ) |

Get meter rate from a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle

Returns
  approximate rate

## ◆ snd_pcm_meter_search_scope()

snd_pcm_scope_t * snd_pcm_meter_search_scope | ( | snd_pcm_t * | pcm,
|  | const char * | name
| ) |  |

Search an installed scope inside a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | PCM handle
  name | scope name

Returns
  pointer to found scope or NULL if none is found

## ◆ snd_pcm_scope_get_callback_private()

void * snd_pcm_scope_get_callback_private | ( | snd_pcm_scope_t * | scope | ) |

Get callbacks private value for a SND_PCM_TYPE_METER PCM scope.

Parameters

  scope | PCM meter scope

Returns
  Private data value

## ◆ snd_pcm_scope_get_name()

const char * snd_pcm_scope_get_name | ( | snd_pcm_scope_t * | scope | ) |

Get name of a SND_PCM_TYPE_METER PCM scope.

Parameters

  scope | PCM meter scope

Returns
  scope name

## ◆ snd_pcm_scope_malloc()

int snd_pcm_scope_malloc | ( | snd_pcm_scope_t ** | ptr | ) |

allocate an invalid snd_pcm_scope_t using standard malloc

Parameters

  ptr | returned pointer

Returns
  0 on success otherwise negative error code

## ◆ snd_pcm_scope_s16_get_channel_buffer()

int16_t * snd_pcm_scope_s16_get_channel_buffer | ( | snd_pcm_scope_t * | scope,
|  | unsigned int | channel
| ) |  |

Get s16 pseudo scope frames buffer for a channel.

Parameters

  scope | s16 pseudo scope handle
  channel | Channel

Returns
  Pointer to channel buffer

## ◆ snd_pcm_scope_s16_open()

int snd_pcm_scope_s16_open | ( | snd_pcm_t * | pcm,
|  | const char * | name,
|  | snd_pcm_scope_t ** | scopep
| ) |  |

Add a s16 pseudo scope to a SND_PCM_TYPE_METER PCM.

Parameters

  pcm | The pcm handle
  name | Scope name
  scopep | Pointer to newly created and added scope

Returns
  0 on success otherwise a negative error code

s16 pseudo scope convert SND_PCM_TYPE_METER PCM frames in CPU endian 16 bit frames for use with other scopes. Don't forget to insert it before and to not insert it more time (see snd_pcm_meter_search_scope)

## ◆ snd_pcm_scope_set_callback_private()

void snd_pcm_scope_set_callback_private | ( | snd_pcm_scope_t * | scope,
|  | void * | val
| ) |  |

Get callbacks private value for a SND_PCM_TYPE_METER PCM scope.

Parameters

  scope | PCM meter scope
  val | Private data value

## ◆ snd_pcm_scope_set_name()

void snd_pcm_scope_set_name | ( | snd_pcm_scope_t * | scope,
|  | const char * | val
| ) |  |

Set name of a SND_PCM_TYPE_METER PCM scope.

Parameters

  scope | PCM meter scope
  val | scope name

## ◆ snd_pcm_scope_set_ops()

void snd_pcm_scope_set_ops | ( | snd_pcm_scope_t * | scope,
|  | const snd_pcm_scope_ops_t * | val
| ) |  |

Set callbacks for a SND_PCM_TYPE_METER PCM scope.

Parameters

  scope | PCM meter scope
  val | callbacks