0N/A/*
2362N/A * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#include <Utilities.h>
0N/A#include <string.h>
0N/A#include <stdlib.h>
0N/A#include <fcntl.h>
0N/A/* does not work on Solaris 2.7 */
0N/A#include <sys/audio.h>
0N/A#include <sys/mixer.h>
0N/A#include <sys/types.h>
537N/A#ifndef __linux__
0N/A#include <stropts.h>
537N/A#endif
0N/A#include <sys/conf.h>
0N/A#include <sys/stat.h>
0N/A#include <unistd.h>
0N/A
0N/A#ifndef PLATFORM_API_SOLARISOS_UTILS_H_INCLUDED
0N/A#define PLATFORM_API_SOLARISOS_UTILS_H_INCLUDED
0N/A
0N/A/* defines for Solaris 2.7
0N/A #ifndef AUDIO_AUX1_OUT
0N/A #define AUDIO_AUX1_OUT (0x08) // output to aux1 out
0N/A #define AUDIO_AUX2_OUT (0x10) // output to aux2 out
0N/A #define AUDIO_SPDIF_OUT (0x20) // output to SPDIF port
0N/A #define AUDIO_AUX1_IN (0x08) // input from aux1 in
0N/A #define AUDIO_AUX2_IN (0x10) // input from aux2 in
0N/A #define AUDIO_SPDIF_IN (0x20) // input from SPDIF port
0N/A #endif
0N/A*/
0N/A
0N/A/* input from Codec inter. loopback */
0N/A#ifndef AUDIO_CODEC_LOOPB_IN
0N/A#define AUDIO_CODEC_LOOPB_IN (0x40)
0N/A#endif
0N/A
0N/A
0N/A#define MAX_NAME_LENGTH 300
0N/A
0N/Atypedef struct tag_AudioDevicePath {
0N/A char path[MAX_NAME_LENGTH];
0N/A ino_t st_ino; // inode number to detect duplicate devices
0N/A dev_t st_dev; // device ID to detect duplicate audio devices
0N/A} AudioDevicePath;
0N/A
0N/Atypedef struct tag_AudioDeviceDescription {
0N/A INT32 maxSimulLines;
0N/A char path[MAX_NAME_LENGTH+1];
0N/A char pathctl[MAX_NAME_LENGTH+4];
0N/A char name[MAX_NAME_LENGTH+1];
0N/A char vendor[MAX_NAME_LENGTH+1];
0N/A char version[MAX_NAME_LENGTH+1];
0N/A char description[MAX_NAME_LENGTH+1];
0N/A} AudioDeviceDescription;
0N/A
0N/Aint getAudioDeviceCount();
0N/A
0N/A/*
0N/A * adPath is an array of AudioDevicePath structures
0N/A * count contains initially the number of elements in adPath
0N/A * and will be set to the returned number of paths.
0N/A */
0N/Avoid getAudioDevices(AudioDevicePath* adPath, int* count);
0N/A
0N/A/*
0N/A * fills adDesc from the audio device given in path
0N/A * returns 0 if an error occured
0N/A * if getNames is 0, only path and pathctl are filled
0N/A */
0N/Aint getAudioDeviceDescription(char* path, AudioDeviceDescription* adDesc, int getNames);
0N/Aint getAudioDeviceDescriptionByIndex(int index, AudioDeviceDescription* adDesc, int getNames);
0N/A
0N/A
0N/A#endif // PLATFORM_API_SOLARISOS_UTILS_H_INCLUDED