$Source: /home/cltien/cvs/BeOS/inc/sound.h,v $
$Revision: 1.1.1.1 $
$Author: cltien $
$Date: 1999/10/12 18:38:08 $
Data structures and control calls for using the sound driver
+++++ */
Copyright 1999, Be Incorporated. All Rights Reserved.
This file may be used under the terms of the Be Sample Code License.
*/
#ifndef _SOUND_H
#define _SOUND_H
#ifndef _DRIVERS_H
#include <Drivers.h>
#endif
enum adc_source {
line=0, aux1, mic, loopback
};
enum sample_rate {
kHz_8_0 = 0, kHz_5_51, kHz_16_0, kHz_11_025, kHz_27_42, kHz_18_9,
kHz_32_0, kHz_22_05, kHz_37_8 = 9, kHz_44_1 = 11, kHz_48_0, kHz_33_075,
kHz_9_6, kHz_6_62
};
enum sample_format {
linear_8bit_unsigned_mono = 0, linear_8bit_unsigned_stereo,
ulaw_8bit_companded_mono, ulaw_8bit_companded_stereo,
linear_16bit_little_endian_mono, linear_16bit_little_endian_stereo,
alaw_8bit_companded_mono, alaw_8bit_companded_stereo,
sample_format_reserved_1, sample_format_reserved_2,
adpcm_4bit_mono, adpcm_4bit_stereo,
linear_16bit_big_endian_mono, linear_16bit_big_endian_stereo,
sample_format_reserved_3, sample_format_reserved_4
};
struct channel {
enum adc_source adc_source;
char adc_gain;
char mic_gain_enable;
char aux1_mix_gain;
char aux1_mix_mute;
char aux2_mix_gain;
char aux2_mix_mute;
char line_mix_gain;
char line_mix_mute;
char dac_attn;
char dac_mute;
};
typedef struct sound_setup {
struct channel left;
struct channel right;
enum sample_rate sample_rate;
enum sample_format playback_format;
enum sample_format capture_format;
char dither_enable;
char loop_attn;
char loop_enable;
char output_boost;
char highpass_enable;
char mono_gain;
char mono_mute;
} sound_setup;
control opcodes for sound driver
----- */
enum {
SOUND_GET_PARAMS = B_DEVICE_OP_CODES_END,
SOUND_SET_PARAMS,
SOUND_SET_PLAYBACK_COMPLETION_SEM,
SOUND_SET_CAPTURE_COMPLETION_SEM,
SOUND_GET_PLAYBACK_TIMESTAMP,
SOUND_GET_CAPTURE_TIMESTAMP,
SOUND_DEBUG_ON,
SOUND_DEBUG_OFF,
SOUND_UNSAFE_WRITE,
SOUND_UNSAFE_READ,
SOUND_LOCK_FOR_DMA,
SOUND_SET_CAPTURE_PREFERRED_BUF_SIZE,
SOUND_SET_PLAYBACK_PREFERRED_BUF_SIZE,
SOUND_GET_CAPTURE_PREFERRED_BUF_SIZE,
SOUND_GET_PLAYBACK_PREFERRED_BUF_SIZE,
SOUND_GET_SPDIF_IN_OUT_LOOPBACK,
SOUND_SET_SPDIF_IN_OUT_LOOPBACK,
SOUND_GET_SPDIF_OUT,
SOUND_SET_SPDIF_OUT,
SOUND_GET_SPDIF_MONITOR,
SOUND_SET_SPDIF_MONITOR,
SOUND_GET_SPDIF_OUT_LEVEL,
SOUND_SET_SPDIF_OUT_LEVEL,
SOUND_GET_SPDIF_IN_FORMAT,
SOUND_SET_SPDIF_IN_FORMAT,
SOUND_GET_SPDIF_IN_OUT_COPYRIGHT,
SOUND_SET_SPDIF_IN_OUT_COPYRIGHT,
SOUND_GET_SPDIF_IN_VALIDITY,
SOUND_SET_SPDIF_IN_VALIDITY,
SOUND_GET_4_CHANNEL_DUPLICATE,
SOUND_SET_4_CHANNEL_DUPLICATE,
SOUND_GET_DEVICE_ID,
SOUND_GET_INTERNAL_CHIP_ID,
SOUND_GET_DRIVER_VERSION
};
#endif