Main Page   Compound List   File List   Compound Members   File Members  

cslmain.c File Reference

#include "cslmain.h"
#include "cslconfig.h"
#include "cslprivate.h"
#include "cslutils.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

Compounds

struct  DriverEntry

Functions

const char ** csl_list_drivers (unsigned int *n_backends_p)
 Return list of drivers. More...

CslErrorType csl_driver_init_mutex (const char *driver_name, CslDriverCaps required_caps, CslMutex *mutex, CslDriver **driver_p)
 Initialize the CSL library. More...

CslErrorType csl_driver_init (const char *driver_name, CslDriver **driver_p)
 Initialize the CSL library. More...

void csl_driver_shutdown (CslDriver *driver)
 Shutdown driver. More...

const char * csl_strerror (CslErrorType error_type)
 Return error description. More...

void csl_options_parse (CslOptions *options, int *argc_p, char **argv_p[])
 Parse command line options. More...

char * csl_options_describe (unsigned int indent)
 Describe command line options. More...

char * csl_options_dump (CslOptions *options)
 Dump CSL options. More...

char * csl_describe_pcm_format (unsigned int format)
 Describe a PCM format. More...


Function Documentation

char* csl_describe_pcm_format unsigned int    format
 

Describe a PCM format.

Given a PCM format value, return a string describing the selected format (e.g. "16bit, little-endian, signed")

Parameters:
pcm_format  The PCM format
Returns:
A newly allocated text string describing the format.

CslErrorType csl_driver_init const char *    driver_name,
CslDriver **    driver_p
 

Initialize the CSL library.

Call this function to initialize the CSL library. You need to call this to obtain a handle to a driver before performing any driver functions. For multithreaded applications you should use csl_driver_init_mutex instead.

Note:
The OSS backend looks at the environment variable OSS_DEVICE, and if defined, uses that for the audio device. Otherwise it uses /dev/dsp.
Parameters:
driver_name  Name of the driver desired. Use NULL to have CSL auto-detect a suitable driver. Pass CSL_DRIVER_NAME_ARTS or CSL_DRIVER_NAME_OSS or the string "arts" or "oss" to select a specific driver.
driver  Returns driver (which is a pointer to an opaque type) to be used in subsequent CSL calls.
Returns:
Error status
See also:
csl_driver_init_mutex , csl_driver_shutdown

CslErrorType csl_driver_init_mutex const char *    driver_name,
CslDriverCaps    required_caps,
CslMutex   mutex,
CslDriver **    driver_p
 

Initialize the CSL library.

Call this function to initialize the CSL library. You need to call this to obtain a handle to a driver before performing any driver functions. For non-multithreaded applications you can use csl_driver_init instead.

Note:
The OSS backend looks at the environment variable OSS_DEVICE, and if defined, uses that for the audio device. Otherwise it uses /dev/dsp.
Parameters:
driver_name  Name of the driver desired. Use NULL to have CSL auto-detect a suitable driver. Pass CSL_DRIVER_NAME_ARTS or CSL_DRIVER_NAME_OSS or the string "arts" or "oss" to select a specific driver.
required_caps  A set of driver capabilities that you desire, specified as one or more values of type CslDriverCaps bitwise ORed together.
mutex  A pointer to a variable of type CslMutex which is initialized with the user-defined lock, unlock, and destroy functions for ensuring mutual exclusion. This allows locking to be done in a portable way.
driver  Returns driver (which is a pointer to an opaque type) to be used in subsequent CSL calls.
Returns:
Error status
See also:
csl_driver_init , csl_driver_shutdown

void csl_driver_shutdown CslDriver   driver
 

Shutdown driver.

Shutdown a driver and release any resources associated with it. There is no way of determining if the call was successful. Be sure to close any PCM streams associated with the driver first.

Parameters:
driver  A handle to the driver
See also:
csl_driver_init , csl_driver_init_mutex , csl_pcm_close

const char** csl_list_drivers unsigned int *    n_backends_p
 

Return list of drivers.

Return a list of the available CSL back-end drivers.

Parameters:
n_backends  The number of backends found will be written to the variable pointed to.
Returns:
A pointer to the start of the list of driver names (null terminated strings).

char* csl_options_describe unsigned int    indent
 

Describe command line options.

Outputs a usage string describing the command line options supported by csl_parse_options. Typical output is:

 -B, -L          big/little endian
 -s, -u          signed/unsigned samples
 -F              float samples (32bit)
 -w [8|16]       number of bits (width is 16 or 8)
 -c <n_channels> number of channels
 -r <rate>       sampling frequency
 -D <level>      debugging level
 
Parameters:
indent  Number of spaces to pad before the output to support formatting in a usage message.
Returns:
String describing the options.
See also:
csl_parse_options , csl_describe_pcm_format

char* csl_options_dump CslOptions   options
 

Dump CSL options.

This function returns a debug string describing the CSL options.

Parameters:
options  Point to CslOptions variable.
Returns:
A string describing the options. The strings is dynamically allocated and must be freed using csl_free when no longer needed.

void csl_options_parse CslOptions   options,
int *    argc_p,
char **    argv_p[]
 

Parse command line options.

Parses the programs command line options and fills in a CslOptions variable.

Parameters:
options  Pointer to options variable in which to store result.
argv_p  Pointer to number of arguments, typically argc in main()
argv_p  Pointer to argument pointer, typically argv in main()
See also:
csl_describe_options

const char* csl_strerror CslErrorType    error_type
 

Return error description.

Return a string describing a CSL error code.

Parameters:
error_type  The error code.
Returns:
A string describing the error.
See also:
CslErrorType


Generated on Wed Oct 31 18:45:21 2001 for CSL by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001