AudioDevice.h revision 4ab75253616c6d68e967c10221bb663c0bfa99df
/*
* 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
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _MULTIMEDIA_AUDIODEVICE_H
#define _MULTIMEDIA_AUDIODEVICE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef NO_EXTERN_C
#ifdef __cplusplus
extern "C" {
#endif
#endif /* NO_EXTERN_C */
#include <AudioUnixfile.h>
// Enumerate known device types
enum AudioDeviceType {
AudioDeviceUnknown, // unknown device type
AudioDeviceAMD, // AM79C30
AudioDeviceSBPRO, // SoundBlaster Pro
AudioDeviceSB16, // SoundBlaster 16
AudioDeviceSPECTRUM, // MediaVision Audio Spectrum 16
AudioDeviceMULTISOUND, // Turtle Beach MultiSound
AudioDeviceCODEC // MMCodec with no DBRI
};
// The audio information structure is defined as a class so that
// it is automatically initialized whenever allocated.
AudioInfo(); // Constructor
{ return (&info); }
void Clear(); // Reset
};
typedef audio_prinfo_t AudioPRinfo;
// This is the 'base' class for audio devices
//
// Since audio devices can theoretically have separate input and output
// encoding formats, there are separate methods for input and output headers.
// For compatibility with other AudioStream classes, GetHeader() gets the
// input data encoding and SetHeader() sets the output data encoding.
static const char *AUDIO_ENV; // Default device env name
static const char *AUDIO_DEV; // Default device name
// open with a given pathname
const char *, int);
AudioHdr& h) const; // header to set
const AudioHdr& h, // header to encode
Boolean, // true to raise, false to lower
AudioInfo&, // info structure
unsigned int *); // ptr to gain field in info
// Check rate tolerance
unsigned int, unsigned int);
// class AudioUnixfile methods specialized here
{ return (AUDIO_ERR_BADARG); }
{ return (AUDIO_ERR_BADARG); }
// class AudioStream methods specialized here
// Constructor with path
// class AudioUnixfile methods specialized here
// ... with search path
// Read from position
void* buf, // buffer to fill
// Write at position
void* buf, // buffer to copy
// class AudioStream methods specialized here
// Set header
const AudioHdr& h); // header to copy
// class Audio methods specialized here
// Device control and status functions
// Get device state
// Set device state
// TRUE if device-compatible hdr
AudioHdr& h); // header to check
// Set input encoding
AudioHdr& h); // header to copy (updated)
// Set output encoding
AudioHdr& h); // header to copy (updated)
};
#ifdef NO_EXTERN_C
#ifdef __cplusplus
}
#endif
#endif /* NO_EXTERN_C */
#endif /* !_MULTIMEDIA_AUDIODEVICE_H */