1/********************************************************************************************************************************** 2* 3* OpenAL cross platform audio library 4* Copyright (c) 2004, Apple Computer, Inc. All rights reserved. 5* 6* Redistribution and use in source and binary forms, with or without modification, are permitted provided 7* that the following conditions are met: 8* 9* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 10* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 11* disclaimer in the documentation and/or other materials provided with the distribution. 12* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of its contributors may be used to endorse or promote 13* products derived from this software without specific prior written permission. 14* 15* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS 17* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 18* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 20* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21* 22**********************************************************************************************************************************/ 23 24#ifndef __OAL_OSX__ 25#define __OAL_OSX__ 26 27#include <stdlib.h> 28#include <stdio.h> 29#include <string.h> 30#include <Carbon/Carbon.h> 31#include <AudioToolbox/AudioToolbox.h> 32#include "CAStreamBasicDescription.h" 33#include "oalImp.h" 34#include "MacOSX_OALExtensions.h" 35 36#define maxLen 256 37 38 39bool IsFormatSupported(UInt32 inFormatID); 40OSStatus FillInASBD(CAStreamBasicDescription &inASBD, UInt32 inFormatID, UInt32 inSampleRate); 41bool IsValidRenderQuality (UInt32 inRenderQuality); 42UInt32 GetDesiredRenderChannelsFor3DMixer(UInt32 inDeviceChannels); 43void GetDefaultDeviceName(ALCchar* outDeviceName, bool isInput); 44uintptr_t GetNewPtrToken (void); 45ALuint GetNewToken (void); 46UInt32 CalculateNeededMixerBusses(const ALCint *attrList, UInt32 inDefaultBusCount); 47const char* GetFormatString(UInt32 inToken); 48const char* GetALAttributeString(UInt32 inToken); 49const char* GetALCAttributeString(UInt32 inToken); 50void WaitOneRenderCycle(); 51void ReconfigureContextsOfThisDevice(uintptr_t inDeviceToken); 52 53#endif 54