/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright (c) 1992-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _MULTIMEDIA_AUDIO_DEVICE_H
#define _MULTIMEDIA_AUDIO_DEVICE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following macros read the current audio device configuration
* and convert the data encoding format into an Audio_hdr.
* 'F' is an open audio file descriptor.
* 'H' is a pointer to an Audio_hdr.
* The structure '*H' is updated after the device state has been read.
*/
#define audio_get_play_config(F, H) \
audio__setplayhdr((F), (H), AUDIO__PLAY)
#define audio_get_record_config(F, H) \
audio__setplayhdr((F), (H), AUDIO__RECORD)
/*
* The following macros attempt to reconfigure the audio device so that
* it operates on data encoded according to a given Audio_hdr.
* 'F' is an open audio file descriptor.
* 'H' is a pointer to an Audio_hdr describing the desired encoding.
* The structure '*H' is updated after the device state has been read
* to reflect the actual state of the device.
*
* AUDIO_SUCCESS is returned if the device configuration matches the
* requested encoding. AUDIO_ERR_NOEFFECT is returned if it does not.
*/
#define audio_set_play_config(F, H) \
#define audio_set_record_config(F, H) \
/*
* Note that requests to pause a channel that is not open will have no effect.
* In such cases, AUDIO_ERR_NOEFFECT is returned.
*/
#define audio_pause(F) \
#define audio_pause_play(F) \
#define audio_pause_record(F) \
#define audio_resume(F) \
#define audio_resume_play(F) \
#define audio_resume_record(F) \
/*
* The following macros get individual state values.
* 'F' is an open audio file descriptor.
* 'V' is a pointer to an unsigned int.
* The value '*V' is updated after the device state has been read.
*/
#define audio_get_play_port(F, V) \
#define audio_get_record_port(F, V) \
#define audio_get_play_balance(F, V) \
#define audio_get_record_balance(F, V) \
#define audio_get_play_samples(F, V) \
#define audio_get_record_samples(F, V) \
#define audio_get_play_error(F, V) \
#define audio_get_record_error(F, V) \
#define audio_get_play_eof(F, V) \
#define audio_get_play_open(F, V) \
#define audio_get_record_open(F, V) \
#define audio_get_play_active(F, V) \
#define audio_get_record_active(F, V) \
#define audio_get_play_waiting(F, V) \
#define audio_get_record_waiting(F, V) \
/*
* The following macros set individual state values.
* 'F' is an open audio file descriptor.
* 'V' is a pointer to an unsigned int.
* The value '*V' is updated after the device state has been read.
*/
#define audio_set_play_port(F, V) \
#define audio_set_record_port(F, V) \
/*
* The value returned for these is the value *before* the state was changed.
* This allows you to atomically read and reset their values.
*/
#define audio_set_play_balance(F, V) \
#define audio_set_record_balance(F, V) \
#define audio_set_play_samples(F, V) \
#define audio_set_record_samples(F, V) \
#define audio_set_play_error(F, V) \
#define audio_set_record_error(F, V) \
#define audio_set_play_eof(F, V) \
/* The value can only be set to one. It is reset to zero on close(). */
#define audio_set_play_waiting(F, V) \
#define audio_set_record_waiting(F, V) \
/*
* Gain routines take double values, mapping the valid range of gains
* to a floating-point value between zero and one, inclusive.
* The value returned will likely be slightly different than the value set.
* This is because the value is quantized by the device.
*
* Make sure that 'V' is a (double *)!
*/
#define audio_get_play_gain(F, V) \
#define audio_get_record_gain(F, V) \
#define audio_get_monitor_gain(F, V) \
audio__setgain((F), (V), AUDIO__MONGAIN)
#define audio_set_play_gain(F, V) \
#define audio_set_record_gain(F, V) \
#define audio_set_monitor_gain(F, V) \
/*
* Note that requests to flush a channel that is not open will have no effect.
*/
#define audio_flush(F) \
audio__flush((F), AUDIO__PLAYREC)
#define audio_flush_play(F) \
audio__flush((F), AUDIO__PLAY)
#define audio_flush_record(F) \
audio__flush((F), AUDIO__RECORD)
#ifdef __cplusplus
}
#endif
#endif /* !_MULTIMEDIA_AUDIO_DEVICE_H */