/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _AUDIO_CLIENT_H
#define _AUDIO_CLIENT_H
/*
* Structure implementation in audio_impl.h
*/
typedef struct audio_client_ops {
const char *aco_minor_prefix;
void (*aco_dev_fini)(void *);
cred_t *, int *);
struct pollhead **);
void *auclnt_get_private(audio_client_t *);
void auclnt_set_private(audio_client_t *, void *);
int auclnt_drain(audio_client_t *);
int auclnt_start_drain(audio_client_t *);
int auclnt_set_rate(audio_stream_t *, int);
int auclnt_get_rate(audio_stream_t *);
int auclnt_set_format(audio_stream_t *, int);
int auclnt_get_format(audio_stream_t *);
int auclnt_set_channels(audio_stream_t *, int);
int auclnt_get_channels(audio_stream_t *);
void auclnt_start(audio_stream_t *);
void auclnt_stop(audio_stream_t *);
void auclnt_set_paused(audio_stream_t *);
void auclnt_clear_paused(audio_stream_t *);
void auclnt_flush(audio_stream_t *);
int auclnt_get_oflag(audio_client_t *);
int auclnt_open(audio_client_t *, int);
void auclnt_close(audio_client_t *);
void auclnt_pollwakeup(audio_client_t *, short);
/*
* Return the process id that performed the original open() of the client.
*/
/*
* Return the credentials of the process that opened the client.
*/
/*
* Get an opaque handle the underlying device for an audio client.
*/
void auclnt_release_dev(audio_dev_t *);
int auclnt_get_dev_index(audio_dev_t *);
int auclnt_get_dev_number(audio_dev_t *);
void auclnt_set_dev_number(audio_dev_t *, int);
const char *auclnt_get_dev_name(audio_dev_t *);
const char *auclnt_get_dev_driver(audio_dev_t *);
int auclnt_get_dev_instance(audio_dev_t *);
const char *auclnt_get_dev_description(audio_dev_t *);
const char *auclnt_get_dev_version(audio_dev_t *);
const char *auclnt_get_dev_hw_info(audio_dev_t *, void **);
/*
* Walk all the open client structures for a named audio device.
* Clients can use this to find "peer" clients accessing the same
* audio device. (This is useful for implementing special linkages,
*/
void auclnt_dev_walk_clients(audio_dev_t *,
int (*)(audio_client_t *, void *), void *);
/*
* This is used to check for updates to volume and control status.
* Its a polling-based interface because that's what our clients (OSS)
* need, and its far lighter weight than forcing an asynchronous
* callback on everything.
*/
/*
* Audio control functions for use by clients.
*/
/*
* This will walk all controls registered to my device and callback
* to walker for each one with its audio_ctrl_desc_t..
*
* Note that walk_func may return values to continue (AUDIO_WALK_CONTINUE)
* or stop walk (AUDIO_WALK_STOP).
*
*/
void auclnt_walk_controls(audio_dev_t *,
int (*)(audio_ctrl_t *, void *), void *);
/*
* This will search all controls attached to a clients
* audio device for a control with the desired name.
*
* On successful return a ctrl handle will be returned. On
* failure NULL is returned.
*/
/*
* Given a known control, get its attributes.
*
* The caller must supply a audio_ctrl_desc_t structure. Also the
* values in the structure are ignored when making the call and filled
* in by this function.
*
* If an error occurs then a non-zero is returned.
*/
/*
* This is used to read the current value of a control.
* Note, this will cause a callback into the driver to get the value.
*
* On return zero is returned on success else errno is returned.
*/
/*
* This is used to write a value to a control.
* Note, this will cause a callback into the driver to write the value.
*
* On return zero is returned on success else errno is returned.
*
*/
/*
* Walk all the audio devices on the system. Useful for clients
* like sndstat, which may need to inquire about every audio device
* on the system.
*/
void auclnt_release(audio_client_t *);
void auclnt_hold(audio_client_t *);
int auclnt_serialize(audio_client_t *);
void auclnt_unserialize(audio_client_t *);
/*
* Engine rlated accesses. Note that normally clients don't need this level
* of information.
*/
void auclnt_dev_walk_engines(audio_dev_t *,
int (*)(audio_engine_t *, void *), void *);
int auclnt_engine_get_rate(audio_engine_t *);
/*
* Retrieve minor-specific data for the instance. This allows for
* personality modules to store persistent state data on a physical
* device (e.g. to store persistent settings.) Synchronization of
* stored settings between personality modules is up to the
* personality modules themselves.
*/
/*
* Simpler warning message, alternative to cmn_err.
*/
#endif /* _AUDIO_CLIENT_H */