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

Functions

int snd_timer_query_open (snd_timer_query_t **timer, const char *name, int mode)
 Opens a new connection to the timer query interface.
 
int snd_timer_query_open_lconf (snd_timer_query_t **timer, const char *name, int mode, snd_config_t *lconf)
 Opens a new connection to the timer query interface using local configuration.
 
int snd_timer_query_close (snd_timer_query_t *timer)
 close timer query handle
 
int snd_timer_query_next_device (snd_timer_query_t *timer, snd_timer_id_t *tid)
 obtain the next timer identification
 
size_t snd_timer_ginfo_sizeof (void)
 get size of the snd_timer_ginfo_t structure in bytes
 
int snd_timer_ginfo_malloc (snd_timer_ginfo_t **info)
 allocate a new snd_timer_ginfo_t structure
 
void snd_timer_ginfo_free (snd_timer_ginfo_t *info)
 frees the snd_timer_ginfo_t structure
 
void snd_timer_ginfo_copy (snd_timer_ginfo_t *dst, const snd_timer_ginfo_t *src)
 copy one snd_timer_info_t structure to another
 
int snd_timer_ginfo_set_tid (snd_timer_ginfo_t *obj, snd_timer_id_t *tid)
 set timer identification
 
snd_timer_id_t * snd_timer_ginfo_get_tid (snd_timer_ginfo_t *obj)
 get timer identification
 
unsigned int snd_timer_ginfo_get_flags (snd_timer_ginfo_t *obj)
 get timer flags
 
int snd_timer_ginfo_get_card (snd_timer_ginfo_t *obj)
 get associated card with timer
 
char * snd_timer_ginfo_get_id (snd_timer_ginfo_t *obj)
 get timer identification
 
char * snd_timer_ginfo_get_name (snd_timer_ginfo_t *obj)
 get timer name
 
unsigned long snd_timer_ginfo_get_resolution (snd_timer_ginfo_t *obj)
 get timer resolution in ns
 
unsigned long snd_timer_ginfo_get_resolution_min (snd_timer_ginfo_t *obj)
 get timer minimal resolution in ns
 
unsigned long snd_timer_ginfo_get_resolution_max (snd_timer_ginfo_t *obj)
 get timer maximal resolution in ns
 
unsigned int snd_timer_ginfo_get_clients (snd_timer_ginfo_t *obj)
 get current timer clients
 
int snd_timer_query_info (snd_timer_query_t *timer, snd_timer_ginfo_t *info)
 obtain the timer global information
 
int snd_timer_query_params (snd_timer_query_t *timer, snd_timer_gparams_t *params)
 set the timer global parameters
 
int snd_timer_query_status (snd_timer_query_t *timer, snd_timer_gstatus_t *status)
 get the timer global status
 
size_t snd_timer_id_sizeof ()
 get size of the snd_timer_id_t structure in bytes
 
int snd_timer_id_malloc (snd_timer_id_t **info)
 allocate a new snd_timer_id_t structure
 
void snd_timer_id_free (snd_timer_id_t *info)
 frees the snd_timer_id_t structure
 
void snd_timer_id_copy (snd_timer_id_t *dst, const snd_timer_id_t *src)
 copy one snd_timer_id_t structure to another
 
void snd_timer_id_set_class (snd_timer_id_t *tid, int dev_class)
 set timer class
 
int snd_timer_id_get_class (snd_timer_id_t *tid)
 get timer class
 
void snd_timer_id_set_sclass (snd_timer_id_t *tid, int dev_sclass)
 set timer sub-class
 
int snd_timer_id_get_sclass (snd_timer_id_t *tid)
 get timer sub-class
 
void snd_timer_id_set_card (snd_timer_id_t *tid, int card)
 set timer card
 
int snd_timer_id_get_card (snd_timer_id_t *tid)
 get timer card
 
void snd_timer_id_set_device (snd_timer_id_t *tid, int device)
 set timer device
 
int snd_timer_id_get_device (snd_timer_id_t *tid)
 get timer device
 
void snd_timer_id_set_subdevice (snd_timer_id_t *tid, int subdevice)
 set timer subdevice
 
int snd_timer_id_get_subdevice (snd_timer_id_t *tid)
 get timer subdevice
 

Detailed Description

Author
Jaroslav Kysela perex.nosp@m.@per.nosp@m.ex.cz
Date
2001

Timer Query Interface is designed to obtain identification of timers.

Function Documentation

◆ snd_timer_ginfo_copy()

void snd_timer_ginfo_copy ( snd_timer_ginfo_t * dst,
const snd_timer_ginfo_t * src )

copy one snd_timer_info_t structure to another

Parameters
dstdestination snd_timer_info_t structure
srcsource snd_timer_info_t structure

◆ snd_timer_ginfo_free()

void snd_timer_ginfo_free ( snd_timer_ginfo_t * info)

frees the snd_timer_ginfo_t structure

Parameters
infopointer to the snd_timer_ginfo_t structure to free

Frees the given snd_timer_info_t structure using the standard free C library function.

◆ snd_timer_ginfo_get_card()

int snd_timer_ginfo_get_card ( snd_timer_ginfo_t * obj)

get associated card with timer

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
associated card

◆ snd_timer_ginfo_get_clients()

unsigned int snd_timer_ginfo_get_clients ( snd_timer_ginfo_t * obj)

get current timer clients

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
current timer clients

◆ snd_timer_ginfo_get_flags()

unsigned int snd_timer_ginfo_get_flags ( snd_timer_ginfo_t * obj)

get timer flags

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
timer flags

◆ snd_timer_ginfo_get_id()

char * snd_timer_ginfo_get_id ( snd_timer_ginfo_t * obj)

get timer identification

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
timer identification

◆ snd_timer_ginfo_get_name()

char * snd_timer_ginfo_get_name ( snd_timer_ginfo_t * obj)

get timer name

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
timer name

◆ snd_timer_ginfo_get_resolution()

unsigned long snd_timer_ginfo_get_resolution ( snd_timer_ginfo_t * obj)

get timer resolution in ns

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
timer resolution in ns

◆ snd_timer_ginfo_get_resolution_max()

unsigned long snd_timer_ginfo_get_resolution_max ( snd_timer_ginfo_t * obj)

get timer maximal resolution in ns

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
timer maximal resolution in ns

◆ snd_timer_ginfo_get_resolution_min()

unsigned long snd_timer_ginfo_get_resolution_min ( snd_timer_ginfo_t * obj)

get timer minimal resolution in ns

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
timer minimal resolution in ns

◆ snd_timer_ginfo_get_tid()

snd_timer_id_t * snd_timer_ginfo_get_tid ( snd_timer_ginfo_t * obj)

get timer identification

Parameters
objpointer to #snd_timer_ginfo_t structure
Returns
pointer to snd_timer_id_t

◆ snd_timer_ginfo_malloc()

int snd_timer_ginfo_malloc ( snd_timer_ginfo_t ** info)

allocate a new snd_timer_ginfo_t structure

Parameters
inforeturned pointer
Returns
0 on success otherwise a negative error code if fails

Allocates a new snd_timer_info_t structure using the standard malloc C library function.

◆ snd_timer_ginfo_set_tid()

int snd_timer_ginfo_set_tid ( snd_timer_ginfo_t * obj,
snd_timer_id_t * tid )

set timer identification

Parameters
objpointer to #snd_timer_ginfo_t structure
tidpointer to #snd_timer_id_t structure
Returns
zero on success otherwise a negative error number

◆ snd_timer_ginfo_sizeof()

size_t snd_timer_ginfo_sizeof ( void )

get size of the snd_timer_ginfo_t structure in bytes

Returns
size of the snd_timer_ginfo_t structure in bytes

◆ snd_timer_id_copy()

void snd_timer_id_copy ( snd_timer_id_t * dst,
const snd_timer_id_t * src )

copy one snd_timer_id_t structure to another

Parameters
dstdestination snd_timer_id_t structure
srcsource snd_timer_id_t structure

◆ snd_timer_id_free()

void snd_timer_id_free ( snd_timer_id_t * info)

frees the snd_timer_id_t structure

Parameters
infopointer to the snd_timer_id_t structure to free

Frees the given snd_timer_id_t structure using the standard free C library function.

◆ snd_timer_id_get_card()

int snd_timer_id_get_card ( snd_timer_id_t * tid)

get timer card

Parameters
tidpointer to #snd_timer_id_t structure
Returns
timer card number
Examples
/test/timer.c.

◆ snd_timer_id_get_class()

int snd_timer_id_get_class ( snd_timer_id_t * tid)

get timer class

Parameters
tidpointer to #snd_timer_id_t structure
Returns
timer class
Examples
/test/timer.c.

◆ snd_timer_id_get_device()

int snd_timer_id_get_device ( snd_timer_id_t * tid)

get timer device

Parameters
tidpointer to #snd_timer_id_t structure
Returns
timer device number
Examples
/test/timer.c.

◆ snd_timer_id_get_sclass()

int snd_timer_id_get_sclass ( snd_timer_id_t * tid)

get timer sub-class

Parameters
tidpointer to #snd_timer_id_t structure
Returns
timer sub-class
Examples
/test/timer.c.

◆ snd_timer_id_get_subdevice()

int snd_timer_id_get_subdevice ( snd_timer_id_t * tid)

get timer subdevice

Parameters
tidpointer to #snd_timer_id_t structure
Returns
timer subdevice number
Examples
/test/timer.c.

◆ snd_timer_id_malloc()

int snd_timer_id_malloc ( snd_timer_id_t ** info)

allocate a new snd_timer_id_t structure

Parameters
inforeturned pointer
Returns
0 on success otherwise a negative error code if fails

Allocates a new snd_timer_id_t structure using the standard malloc C library function.

◆ snd_timer_id_set_card()

void snd_timer_id_set_card ( snd_timer_id_t * tid,
int card )

set timer card

Parameters
tidpointer to #snd_timer_id_t structure
cardcard number

◆ snd_timer_id_set_class()

void snd_timer_id_set_class ( snd_timer_id_t * tid,
int dev_class )

set timer class

Parameters
tidpointer to #snd_timer_id_t structure
dev_classclass of timer device
Examples
/test/timer.c.

◆ snd_timer_id_set_device()

void snd_timer_id_set_device ( snd_timer_id_t * tid,
int device )

set timer device

Parameters
tidpointer to #snd_timer_id_t structure
devicedevice number

◆ snd_timer_id_set_sclass()

void snd_timer_id_set_sclass ( snd_timer_id_t * tid,
int dev_sclass )

set timer sub-class

Parameters
tidpointer to #snd_timer_id_t structure
dev_sclasssub-class of timer device

◆ snd_timer_id_set_subdevice()

void snd_timer_id_set_subdevice ( snd_timer_id_t * tid,
int subdevice )

set timer subdevice

Parameters
tidpointer to #snd_timer_id_t structure
subdevicesubdevice number

◆ snd_timer_id_sizeof()

size_t snd_timer_id_sizeof ( )

get size of the snd_timer_id_t structure in bytes

Returns
size of the snd_timer_id_t structure in bytes

◆ snd_timer_query_close()

int snd_timer_query_close ( snd_timer_query_t * timer)

close timer query handle

Parameters
timertimer handle
Returns
0 on success otherwise a negative error code

Closes the specified timer handle and frees all associated resources.

Examples
/test/timer.c.

◆ snd_timer_query_info()

int snd_timer_query_info ( snd_timer_query_t * timer,
snd_timer_ginfo_t * info )

obtain the timer global information

Parameters
timertimer handle
infotimer information
Returns
0 on success otherwise a negative error code

◆ snd_timer_query_next_device()

int snd_timer_query_next_device ( snd_timer_query_t * timer,
snd_timer_id_t * tid )

obtain the next timer identification

Parameters
timertimer handle
tidtimer identification
Returns
0 on success otherwise a negative error code

if tid->dev_class is -1, then the first device is returned if result tid->dev_class is -1, no more devices are left

Examples
/test/timer.c.

◆ snd_timer_query_open()

int snd_timer_query_open ( snd_timer_query_t ** timer,
const char * name,
int mode )

Opens a new connection to the timer query interface.

Parameters
timerReturned handle (NULL if not wanted)
nameASCII identifier of the RawMidi handle
modeOpen mode
Returns
0 on success otherwise a negative error code

Opens a new connection to the RawMidi interface specified with an ASCII identifier and mode.

Examples
/test/timer.c.

◆ snd_timer_query_open_lconf()

int snd_timer_query_open_lconf ( snd_timer_query_t ** timer,
const char * name,
int mode,
snd_config_t * lconf )

Opens a new connection to the timer query interface using local configuration.

Parameters
timerReturned handle (NULL if not wanted)
nameASCII identifier of the RawMidi handle
modeOpen mode
lconfLocal configuration
Returns
0 on success otherwise a negative error code

Opens a new connection to the RawMidi interface specified with an ASCII identifier and mode.

◆ snd_timer_query_params()

int snd_timer_query_params ( snd_timer_query_t * timer,
snd_timer_gparams_t * params )

set the timer global parameters

Parameters
timertimer handle
paramstimer parameters
Returns
0 on success otherwise a negative error code

◆ snd_timer_query_status()

int snd_timer_query_status ( snd_timer_query_t * timer,
snd_timer_gstatus_t * status )

get the timer global status

Parameters
timertimer handle
statustimer status
Returns
0 on success otherwise a negative error code