ALSA project - the C library reference
Loading...
Searching...
No Matches
pcm_hooks.c File Reference

PCM Hook Interface. More...

Functions

int snd_pcm_hooks_open (snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int close_slave)
 Creates a new hooks PCM.
 
int _snd_pcm_hooks_open (snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)
 Creates a new hooks PCM.
 
snd_pcm_t * snd_pcm_hook_get_pcm (snd_pcm_hook_t *hook)
 Get PCM handle for a PCM hook.
 
void * snd_pcm_hook_get_private (snd_pcm_hook_t *hook)
 Get callback function private data for a PCM hook.
 
void snd_pcm_hook_set_private (snd_pcm_hook_t *hook, void *private_data)
 Set callback function private data for a PCM hook.
 
int snd_pcm_hook_add (snd_pcm_hook_t **hookp, snd_pcm_t *pcm, snd_pcm_hook_type_t type, snd_pcm_hook_func_t func, void *private_data)
 Add a PCM hook at end of hooks chain.
 
int snd_pcm_hook_remove (snd_pcm_hook_t *hook)
 Remove a PCM hook.
 
int _snd_pcm_hook_ctl_elems_install (snd_pcm_t *pcm, snd_config_t *conf)
 Install CTL settings using hardware associated with PCM handle.
 

Detailed Description

PCM Hook Interface.

Author
Abramo Bagnara abram.nosp@m.o@al.nosp@m.sa-pr.nosp@m.ojec.nosp@m.t.org
Jaroslav Kysela perex.nosp@m.@per.nosp@m.ex.cz
Date
2000-2001

Function Documentation

◆ _snd_pcm_hook_ctl_elems_install()

int _snd_pcm_hook_ctl_elems_install ( snd_pcm_t * pcm,
snd_config_t * conf )

Install CTL settings using hardware associated with PCM handle.

Parameters
pcmPCM handle
confConfiguration node with CTL settings
Returns
zero on success otherwise a negative error code

◆ _snd_pcm_hooks_open()

int _snd_pcm_hooks_open ( snd_pcm_t ** pcmp,
const char * name,
snd_config_t * root,
snd_config_t * conf,
snd_pcm_stream_t stream,
int mode )

Creates a new hooks PCM.

Parameters
pcmpReturns created PCM handle
nameName of PCM
rootRoot configuration node
confConfiguration node with hooks PCM description
streamPCM Stream
modePCM Mode
Return values
zeroon success otherwise a negative error code
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.

◆ snd_pcm_hook_add()

int snd_pcm_hook_add ( snd_pcm_hook_t ** hookp,
snd_pcm_t * pcm,
snd_pcm_hook_type_t type,
snd_pcm_hook_func_t func,
void * private_data )

Add a PCM hook at end of hooks chain.

Parameters
hookpReturned PCM hook handle
pcmPCM handle
typePCM hook type
funcPCM hook callback function
private_dataPCM hook private data
Returns
0 on success otherwise a negative error code

Warning: an hook callback function cannot remove an hook of the same type different from itself

◆ snd_pcm_hook_get_pcm()

snd_pcm_t * snd_pcm_hook_get_pcm ( snd_pcm_hook_t * hook)

Get PCM handle for a PCM hook.

Parameters
hookPCM hook handle
Returns
PCM handle

◆ snd_pcm_hook_get_private()

void * snd_pcm_hook_get_private ( snd_pcm_hook_t * hook)

Get callback function private data for a PCM hook.

Parameters
hookPCM hook handle
Returns
callback function private data

◆ snd_pcm_hook_remove()

int snd_pcm_hook_remove ( snd_pcm_hook_t * hook)

Remove a PCM hook.

Parameters
hookPCM hook handle
Returns
0 on success otherwise a negative error code

Warning: an hook callback cannot remove an hook of the same type different from itself

◆ snd_pcm_hook_set_private()

void snd_pcm_hook_set_private ( snd_pcm_hook_t * hook,
void * private_data )

Set callback function private data for a PCM hook.

Parameters
hookPCM hook handle
private_dataThe private data value

◆ snd_pcm_hooks_open()

int snd_pcm_hooks_open ( snd_pcm_t ** pcmp,
const char * name,
snd_pcm_t * slave,
int close_slave )

Creates a new hooks PCM.

Parameters
pcmpReturns created PCM handle
nameName of PCM
slaveSlave PCM
close_slaveIf set, slave PCM handle is closed when hooks PCM is closed
Return values
zeroon success otherwise a negative error code
Warning
Using of this function might be dangerous in the sense of compatibility reasons. The prototype might be freely changed in future.