Table of Contents

include/AK/SoundEngine/Common/AkTypes.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
00003 released in source code form as part of the SDK installer package.
00004 
00005 Commercial License Usage
00006 
00007 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
00008 may use this file in accordance with the end user license agreement provided 
00009 with the software or, alternatively, in accordance with the terms contained in a
00010 written agreement between you and Audiokinetic Inc.
00011 
00012 Apache License Usage
00013 
00014 Alternatively, this file may be used under the Apache License, Version 2.0 (the 
00015 "Apache License"); you may not use this file except in compliance with the 
00016 Apache License. You may obtain a copy of the Apache License at 
00017 http://www.apache.org/licenses/LICENSE-2.0.
00018 
00019 Unless required by applicable law or agreed to in writing, software distributed
00020 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
00021 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
00022 the specific language governing permissions and limitations under the License.
00023 
00024   Version: <VERSION>  Build: <BUILDNUMBER>
00025   Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
00026 *******************************************************************************/
00027 
00028 // AkTypes.h
00029 
00030 /// \file 
00031 /// Data type definitions.
00032 
00033 #ifndef _AK_DATA_TYPES_H_
00034 #define _AK_DATA_TYPES_H_
00035 
00036 // Platform-specific section.
00037 //----------------------------------------------------------------------------------------------------
00038 #include <AK/AkPlatforms.h>
00039 
00040 
00041 //----------------------------------------------------------------------------------------------------
00042 
00043 #include <AK/SoundEngine/Common/AkSoundEngineExport.h>
00044 
00045 #ifndef NULL
00046     #ifdef __cplusplus
00047         #define NULL    0
00048     #else
00049         #define NULL    ((void *)0)
00050     #endif
00051 #endif
00052 
00053 #if defined(AK_CPU_X86_64) || defined(AK_CPU_ARM_64)
00054 #define AK_POINTER_64
00055 #endif // #if defined(AK_CPU_X86_64) || defined(AK_CPU_ARM_64)
00056 
00057 typedef AkInt32             AkAtomic32;         ///< Signed 32-bit integer - Atomic Declaration
00058 typedef AkInt64             AkAtomic64;         ///< Signed 64-bit integer - Atomic Declaration
00059 typedef AkUInt32            AkAtomicU32;        ///< Unsigned 32-bit integer - Atomic Declaration
00060 typedef AkIntPtr            AkAtomicPtr;        ///< Signed platform sized integer - Atomic Declaration
00061 
00062 typedef AkUInt32        AkUniqueID;                 ///< Unique 32-bit ID
00063 typedef AkUInt32        AkStateID;                  ///< State ID
00064 typedef AkUInt32        AkStateGroupID;             ///< State group ID
00065 typedef AkUInt32        AkPlayingID;                ///< Playing ID
00066 typedef AkInt32         AkTimeMs;                   ///< Time in ms
00067 typedef AkUInt16        AkPortNumber;               ///< Port number
00068 typedef AkReal32        AkPitchValue;               ///< Pitch value
00069 typedef AkReal32        AkVolumeValue;              ///< Volume value( also apply to LFE )
00070 typedef AkUInt64        AkGameObjectID;             ///< Game object ID
00071 typedef AkReal32        AkLPFType;                  ///< Low-pass filter type
00072 typedef AkInt32         AkMemPoolId;                ///< Memory pool ID
00073 typedef AkUInt32        AkPluginID;                 ///< Source or effect plug-in ID
00074 typedef AkUInt32        AkCodecID;                  ///< Codec plug-in ID
00075 typedef AkUInt32        AkAuxBusID;                 ///< Auxilliary bus ID
00076 typedef AkInt16         AkPluginParamID;            ///< Source or effect plug-in parameter ID
00077 typedef AkInt8          AkPriority;                 ///< Priority
00078 typedef AkUInt16        AkDataCompID;               ///< Data compression format ID
00079 typedef AkUInt16        AkDataTypeID;               ///< Data sample type ID
00080 typedef AkUInt8         AkDataInterleaveID;         ///< Data interleaved state ID
00081 typedef AkUInt32        AkSwitchGroupID;            ///< Switch group ID
00082 typedef AkUInt32        AkSwitchStateID;            ///< Switch ID
00083 typedef AkUInt32        AkRtpcID;                   ///< Real time parameter control ID
00084 typedef AkReal32        AkRtpcValue;                ///< Real time parameter control value
00085 typedef AkUInt32        AkBankID;                   ///< Run time bank ID
00086 typedef AkUInt32        AkFileID;                   ///< Integer-type file identifier
00087 typedef AkUInt32        AkDeviceID;                 ///< I/O device ID
00088 typedef AkUInt32        AkTriggerID;                ///< Trigger ID
00089 typedef AkUInt32        AkArgumentValueID;          ///< Argument value ID
00090 typedef AkUInt32        AkChannelMask;              ///< Channel mask (similar to WAVE_FORMAT_EXTENSIBLE). Bit values are defined in AkSpeakerConfig.h.
00091 typedef AkUInt32        AkModulatorID;              ///< Modulator ID
00092 typedef AkUInt32        AkAcousticTextureID;        ///< Acoustic Texture ID
00093 typedef AkUInt32        AkImageSourceID;            ///< Image Source ID
00094 typedef AkUInt64        AkOutputDeviceID;           ///< Audio Output device ID
00095 
00096 // Constants.
00097 static const AkPluginID                 AK_INVALID_PLUGINID                 = (AkPluginID)-1;       ///< Invalid FX ID
00098 static const AkGameObjectID             AK_INVALID_GAME_OBJECT              = (AkGameObjectID)-1;   ///< Invalid game object (may also mean all game objects)
00099 static const AkUniqueID                 AK_INVALID_UNIQUE_ID                =  0;                   ///< Invalid unique 32-bit ID
00100 static const AkRtpcID                   AK_INVALID_RTPC_ID                  =  AK_INVALID_UNIQUE_ID;///< Invalid RTPC ID
00101 static const AkPlayingID                AK_INVALID_PLAYING_ID               =  AK_INVALID_UNIQUE_ID;///< Invalid playing ID
00102 static const AkUInt32                   AK_DEFAULT_SWITCH_STATE             =  0;                   ///< Switch selected if no switch has been set yet
00103 static const AkMemPoolId                AK_INVALID_POOL_ID                  = -1;                   ///< Invalid pool ID
00104 static const AkMemPoolId                AK_DEFAULT_POOL_ID                  = -1;                   ///< Default pool ID, same as AK_INVALID_POOL_ID
00105 static const AkAuxBusID                 AK_INVALID_AUX_ID                   =  AK_INVALID_UNIQUE_ID;///< Invalid auxiliary bus ID (or no Aux bus ID)
00106 static const AkFileID                   AK_INVALID_FILE_ID                  = (AkFileID)-1;         ///< Invalid file ID
00107 static const AkDeviceID                 AK_INVALID_DEVICE_ID                = (AkDeviceID)-1;       ///< Invalid streaming device ID
00108 static const AkBankID                   AK_INVALID_BANK_ID                  =  AK_INVALID_UNIQUE_ID;///< Invalid bank ID
00109 static const AkArgumentValueID          AK_FALLBACK_ARGUMENTVALUE_ID        =  0;                   ///< Fallback argument value ID
00110 static const AkChannelMask              AK_INVALID_CHANNELMASK              =  0;                   ///< Invalid channel mask
00111 static const AkUInt32                   AK_INVALID_OUTPUT_DEVICE_ID         =  AK_INVALID_UNIQUE_ID;///< Invalid Device ID
00112 
00113 // Priority.
00114 static const AkPriority                 AK_DEFAULT_PRIORITY                 =  50;                  ///< Default sound / I/O priority
00115 static const AkPriority                 AK_MIN_PRIORITY                     =  0;                   ///< Minimal priority value [0,100]
00116 static const AkPriority                 AK_MAX_PRIORITY                     =  100;                 ///< Maximal priority value [0,100]
00117 
00118 // Default bank I/O settings.
00119 static const AkPriority                 AK_DEFAULT_BANK_IO_PRIORITY         = AK_DEFAULT_PRIORITY;  ///<  Default bank load I/O priority
00120 static const AkReal32                   AK_DEFAULT_BANK_THROUGHPUT          = 1*1024*1024/1000.f;   ///<  Default bank load throughput (1 Mb/ms)
00121 
00122 // Bank version
00123 static const AkUInt32                   AK_SOUNDBANK_VERSION =              132;                    ///<  Version of the soundbank reader
00124 
00125 /// Standard function call result.
00126 enum AKRESULT
00127 {
00128     AK_NotImplemented           = 0,    ///< This feature is not implemented.
00129     AK_Success                  = 1,    ///< The operation was successful.
00130     AK_Fail                     = 2,    ///< The operation failed.
00131     AK_PartialSuccess           = 3,    ///< The operation succeeded partially.
00132     AK_NotCompatible            = 4,    ///< Incompatible formats
00133     AK_AlreadyConnected         = 5,    ///< The stream is already connected to another node.
00134     AK_NameNotSet               = 6,    ///< Trying to open a file when its name was not set
00135     AK_InvalidFile              = 7,    ///< An unexpected value causes the file to be invalid.
00136     AK_AudioFileHeaderTooLarge  = 8,    ///< The file header is too large.
00137     AK_MaxReached               = 9,    ///< The maximum was reached.
00138     AK_InputsInUsed             = 10,   ///< Inputs are currently used.
00139     AK_OutputsInUsed            = 11,   ///< Outputs are currently used.
00140     AK_InvalidName              = 12,   ///< The name is invalid.
00141     AK_NameAlreadyInUse         = 13,   ///< The name is already in use.
00142     AK_InvalidID                = 14,   ///< The ID is invalid.
00143     AK_IDNotFound               = 15,   ///< The ID was not found.
00144     AK_InvalidInstanceID        = 16,   ///< The InstanceID is invalid.
00145     AK_NoMoreData               = 17,   ///< No more data is available from the source.
00146     AK_NoSourceAvailable        = 18,   ///< There is no child (source) associated with the node.
00147     AK_StateGroupAlreadyExists  = 19,   ///< The StateGroup already exists.
00148     AK_InvalidStateGroup        = 20,   ///< The StateGroup is not a valid channel.
00149     AK_ChildAlreadyHasAParent   = 21,   ///< The child already has a parent.
00150     AK_InvalidLanguage          = 22,   ///< The language is invalid (applies to the Low-Level I/O).
00151     AK_CannotAddItseflAsAChild  = 23,   ///< It is not possible to add itself as its own child.
00152     //AK_TransitionNotFound     = 24,   ///< The transition is not in the list.
00153     //AK_TransitionNotStartable = 25,   ///< Start allowed in the Running and Done states.
00154     //AK_TransitionNotRemovable = 26,   ///< Must not be in the Computing state.
00155     //AK_UsersListFull          = 27,   ///< No one can be added any more, could be AK_MaxReached.
00156     //AK_UserAlreadyInList      = 28,   ///< This user is already there.
00157     AK_UserNotInList            = 29,   ///< This user is not there.
00158     AK_NoTransitionPoint        = 30,   ///< Not in use.
00159     AK_InvalidParameter         = 31,   ///< Something is not within bounds.
00160     AK_ParameterAdjusted        = 32,   ///< Something was not within bounds and was relocated to the nearest OK value.
00161     AK_IsA3DSound               = 33,   ///< The sound has 3D parameters.
00162     AK_NotA3DSound              = 34,   ///< The sound does not have 3D parameters.
00163     AK_ElementAlreadyInList     = 35,   ///< The item could not be added because it was already in the list.
00164     AK_PathNotFound             = 36,   ///< This path is not known.
00165     AK_PathNoVertices           = 37,   ///< Stuff in vertices before trying to start it
00166     AK_PathNotRunning           = 38,   ///< Only a running path can be paused.
00167     AK_PathNotPaused            = 39,   ///< Only a paused path can be resumed.
00168     AK_PathNodeAlreadyInList    = 40,   ///< This path is already there.
00169     AK_PathNodeNotInList        = 41,   ///< This path is not there.
00170     AK_VoiceNotFound            = 42,   ///< Unknown in our voices list
00171     AK_DataNeeded               = 43,   ///< The consumer needs more.
00172     AK_NoDataNeeded             = 44,   ///< The consumer does not need more.
00173     AK_DataReady                = 45,   ///< The provider has available data.
00174     AK_NoDataReady              = 46,   ///< The provider does not have available data.
00175     AK_NoMoreSlotAvailable      = 47,   ///< Not enough space to load bank.
00176     AK_SlotNotFound             = 48,   ///< Bank error.
00177     AK_ProcessingOnly           = 49,   ///< No need to fetch new data.
00178     AK_MemoryLeak               = 50,   ///< Debug mode only.
00179     AK_CorruptedBlockList       = 51,   ///< The memory manager's block list has been corrupted.
00180     AK_InsufficientMemory       = 52,   ///< Memory error.
00181     AK_Cancelled                = 53,   ///< The requested action was cancelled (not an error).
00182     AK_UnknownBankID            = 54,   ///< Trying to load a bank using an ID which is not defined.
00183     AK_IsProcessing             = 55,   ///< Asynchronous pipeline component is processing.
00184     AK_BankReadError            = 56,   ///< Error while reading a bank.
00185     AK_InvalidSwitchType        = 57,   ///< Invalid switch type (used with the switch container)
00186     AK_VoiceDone                = 58,   ///< Internal use only.
00187     AK_UnknownEnvironment       = 59,   ///< This environment is not defined.
00188     AK_EnvironmentInUse         = 60,   ///< This environment is used by an object.
00189     AK_UnknownObject            = 61,   ///< This object is not defined.
00190     AK_NoConversionNeeded       = 62,   ///< Audio data already in target format, no conversion to perform.
00191     AK_FormatNotReady           = 63,   ///< Source format not known yet.
00192     AK_WrongBankVersion         = 64,   ///< The bank version is not compatible with the current bank reader.
00193     AK_DataReadyNoProcess       = 65,   ///< The provider has some data but does not process it (virtual voices).
00194     AK_FileNotFound             = 66,   ///< File not found.
00195     AK_DeviceNotReady           = 67,   ///< IO device not ready (may be because the tray is open)
00196     AK_CouldNotCreateSecBuffer  = 68,   ///< The direct sound secondary buffer creation failed.
00197     AK_BankAlreadyLoaded        = 69,   ///< The bank load failed because the bank is already loaded.
00198     AK_RenderedFX               = 71,   ///< The effect on the node is rendered.
00199     AK_ProcessNeeded            = 72,   ///< A routine needs to be executed on some CPU.
00200     AK_ProcessDone              = 73,   ///< The executed routine has finished its execution.
00201     AK_MemManagerNotInitialized = 74,   ///< The memory manager should have been initialized at this point.
00202     AK_StreamMgrNotInitialized  = 75,   ///< The stream manager should have been initialized at this point.
00203     AK_SSEInstructionsNotSupported = 76,///< The machine does not support SSE instructions (required on PC).
00204     AK_Busy                     = 77,   ///< The system is busy and could not process the request.
00205     AK_UnsupportedChannelConfig = 78,   ///< Channel configuration is not supported in the current execution context.
00206     AK_PluginMediaNotAvailable  = 79,   ///< Plugin media is not available for effect.
00207     AK_MustBeVirtualized        = 80,   ///< Sound was Not Allowed to play.
00208     AK_CommandTooLarge          = 81,   ///< SDK command is too large to fit in the command queue.
00209     AK_RejectedByFilter         = 82,   ///< A play request was rejected due to the MIDI filter parameters.
00210     AK_InvalidCustomPlatformName= 83,   ///< Detecting incompatibility between Custom platform of banks and custom platform of connected application
00211     AK_DLLCannotLoad            = 84,   ///< Plugin DLL could not be loaded, either because it is not found or one dependency is missing.
00212     AK_DLLPathNotFound          = 85,   ///< Plugin DLL search path could not be found.
00213     AK_NoJavaVM                 = 86,   ///< No Java VM provided in AkInitSettings.
00214     AK_OpenSLError              = 87,   ///< OpenSL returned an error.  Check error log for more details.
00215     AK_PluginNotRegistered      = 88,   ///< Plugin is not registered.  Make sure to implement a AK::PluginRegistration class for it and use AK_STATIC_LINK_PLUGIN in the game binary.
00216     AK_DataAlignmentError       = 89,   ///< A pointer to audio data was not aligned to the platform's required alignment (check AkTypes.h in the platform-specific folder)
00217     AK_DeviceNotCompatible      = 90,   ///< Incompatible Audio device.
00218     AK_DuplicateUniqueID        = 91,   ///< Two Wwise objects share the same ID.
00219     AK_InitBankNotLoaded        = 92,   ///< The Init bank was not loaded yet, the sound engine isn't completely ready yet.
00220 };
00221 
00222 /// Game sync group type
00223 enum AkGroupType
00224 {
00225     // should stay set as Switch = 0 and State = 1
00226     AkGroupType_Switch  = 0, ///< Type switch
00227     AkGroupType_State   = 1  ///< Type state
00228 };
00229 
00230 /// Configured audio settings
00231 struct AkAudioSettings
00232 {
00233     AkUInt32            uNumSamplesPerFrame;        ///< Number of samples per audio frame (256, 512, 1024 or 2048).
00234     AkUInt32            uNumSamplesPerSecond;       ///< Number of samples per second.
00235 };
00236 
00237 /// This structure allows the game to provide audio files to fill the external sources. See \ref AK::SoundEngine::PostEvent
00238 /// You can specify a streaming file or a file in-memory, regardless of the "Stream" option in the Wwise project.  
00239 /// \akwarning
00240 /// Make sure that only one of szFile, pInMemory or idFile is non-null. if both idFile and szFile are set, idFile is passed to low-level IO and szFile is used as stream name (for profiling purposes).
00241 /// \endakwarning
00242 struct AkExternalSourceInfo
00243 {
00244     AkUInt32 iExternalSrcCookie;    ///< Cookie identifying the source, given by hashing the name of the source given in the project.  See \ref AK::SoundEngine::GetIDFromString. \aknote If an event triggers the playback of more than one external source, they must be named uniquely in the project therefore have a unique cookie) in order to tell them apart when filling the AkExternalSourceInfo structures. \endaknote
00245     AkCodecID idCodec;              ///< Codec ID for the file.  One of the audio formats defined in AkTypes.h (AKCODECID_XXX)
00246     AkOSChar * szFile;              ///< File path for the source.  If not NULL, the source will be streaming from disk.  Set pInMemory to NULL. If idFile is set, this field is used as stream name (for profiling purposes).
00247     void* pInMemory;                ///< Pointer to the in-memory file.  If not NULL, the source will be read from memory.  Set szFile and idFile to NULL.
00248     AkUInt32 uiMemorySize;          ///< Size of the data pointed by pInMemory
00249     AkFileID idFile;                ///< File ID.  If not zero, the source will be streaming from disk.  This ID can be anything.  Note that you must override the low-level IO to resolve this ID to a real file.  See \ref streamingmanager_lowlevel for more information on overriding the Low Level IO.
00250 
00251     /// Default constructor.
00252     AkExternalSourceInfo()
00253         : iExternalSrcCookie( 0 )
00254         , idCodec( 0 )
00255         , szFile( 0 )
00256         , pInMemory( 0 )
00257         , uiMemorySize( 0 )
00258         , idFile( 0 ) {}
00259 
00260     /// Constructor: specify source by memory.
00261     AkExternalSourceInfo( 
00262         void* in_pInMemory,             ///< Pointer to the in-memory file.
00263         AkUInt32 in_uiMemorySize,       ///< Size of data.
00264         AkUInt32 in_iExternalSrcCookie, ///< Cookie.
00265         AkCodecID in_idCodec            ///< Codec ID.
00266         )
00267         : iExternalSrcCookie( in_iExternalSrcCookie )
00268         , idCodec( in_idCodec )
00269         , szFile( 0 )
00270         , pInMemory( in_pInMemory )
00271         , uiMemorySize( in_uiMemorySize )
00272         , idFile( 0 ) {}
00273 
00274     /// Constructor: specify source by streaming file name.
00275     AkExternalSourceInfo( 
00276         AkOSChar * in_pszFileName,      ///< File name.
00277         AkUInt32 in_iExternalSrcCookie, ///< Cookie.
00278         AkCodecID in_idCodec            ///< Codec ID.
00279         )
00280         : iExternalSrcCookie( in_iExternalSrcCookie )
00281         , idCodec( in_idCodec )
00282         , szFile( in_pszFileName )
00283         , pInMemory( 0 )
00284         , uiMemorySize( 0 )
00285         , idFile( 0 ) {}
00286 
00287     /// Constructor: specify source by streaming file ID.
00288     AkExternalSourceInfo( 
00289         AkFileID in_idFile,             ///< File ID.
00290         AkUInt32 in_iExternalSrcCookie, ///< Cookie.
00291         AkCodecID in_idCodec            ///< Codec ID.
00292         )
00293         : iExternalSrcCookie( in_iExternalSrcCookie )
00294         , idCodec( in_idCodec )
00295         , szFile( 0 )
00296         , pInMemory( 0 )
00297         , uiMemorySize( 0 )
00298         , idFile( in_idFile ) {}
00299 };
00300 
00301 /// Nature of the connection binding an input to a bus.
00302 enum AkConnectionType
00303 {
00304     ConnectionType_Direct = 0x0,            ///< Direct (main, dry) connection.
00305     ConnectionType_GameDefSend = 0x1,       ///< Connection by a game-defined send.
00306     ConnectionType_UserDefSend = 0x2,       ///< Connection by a user-defined send.
00307 };
00308 
00309 /// 3D vector.
00310 struct AkVector
00311 {
00312     inline AkVector operator+(const AkVector& b) const
00313     {
00314         AkVector v;
00315 
00316         v.X = X + b.X;
00317         v.Y = Y + b.Y;
00318         v.Z = Z + b.Z;
00319 
00320         return v;
00321     }
00322 
00323     inline void Zero()
00324     {
00325         X = 0; Y = 0; Z = 0;
00326     }
00327 
00328     AkReal32        X;  ///< X Position
00329     AkReal32        Y;  ///< Y Position
00330     AkReal32        Z;  ///< Z Position
00331 };
00332 
00333 /// Position and orientation of game objects.
00334 class AkTransform
00335 {
00336 public:
00337     //
00338     // Getters.
00339     //
00340 
00341     /// Get position vector.
00342     inline const AkVector & Position() const
00343     {
00344         return position;
00345     }
00346 
00347     /// Get orientation front vector.
00348     inline const AkVector & OrientationFront() const
00349     {
00350         return orientationFront;
00351     }
00352 
00353     /// Get orientation top vector.
00354     inline const AkVector & OrientationTop() const
00355     {
00356         return orientationTop;
00357     }
00358 
00359     //
00360     // Setters.
00361     //
00362 
00363     /// Set position and orientation. Orientation front and top should be orthogonal and normalized.
00364     inline void Set(
00365         const AkVector & in_position,           ///< Position vector.
00366         const AkVector & in_orientationFront,   ///< Orientation front
00367         const AkVector & in_orientationTop      ///< Orientation top
00368         )
00369     {
00370         position = in_position;
00371         orientationFront = in_orientationFront;
00372         orientationTop = in_orientationTop;
00373     }
00374 
00375     /// Set position and orientation. Orientation front and top should be orthogonal and normalized.
00376     inline void Set(
00377         AkReal32 in_positionX,                  ///< Position x
00378         AkReal32 in_positionY,                  ///< Position y
00379         AkReal32 in_positionZ,                  ///< Position z
00380         AkReal32 in_orientFrontX,               ///< Orientation front x
00381         AkReal32 in_orientFrontY,               ///< Orientation front y
00382         AkReal32 in_orientFrontZ,               ///< Orientation front z
00383         AkReal32 in_orientTopX,                 ///< Orientation top x
00384         AkReal32 in_orientTopY,                 ///< Orientation top y
00385         AkReal32 in_orientTopZ                  ///< Orientation top z
00386         )
00387     {
00388         position.X = in_positionX;
00389         position.Y = in_positionY;
00390         position.Z = in_positionZ;
00391         orientationFront.X = in_orientFrontX;
00392         orientationFront.Y = in_orientFrontY;
00393         orientationFront.Z = in_orientFrontZ;
00394         orientationTop.X = in_orientTopX;
00395         orientationTop.Y = in_orientTopY;
00396         orientationTop.Z = in_orientTopZ;
00397     }
00398     
00399     /// Set position.
00400     inline void SetPosition(
00401         const AkVector & in_position            ///< Position vector.
00402         )
00403     {
00404         position = in_position;
00405     }
00406 
00407     /// Set position.
00408     inline void SetPosition(
00409         AkReal32 in_x,                          ///< x
00410         AkReal32 in_y,                          ///< y
00411         AkReal32 in_z                           ///< z
00412         )
00413     {
00414         position.X = in_x;
00415         position.Y = in_y;
00416         position.Z = in_z;
00417     }
00418 
00419     /// Set orientation. Orientation front and top should be orthogonal and normalized.
00420     inline void SetOrientation(
00421         const AkVector & in_orientationFront,   ///< Orientation front
00422         const AkVector & in_orientationTop      ///< Orientation top
00423         )
00424     {
00425         orientationFront = in_orientationFront; 
00426         orientationTop = in_orientationTop;
00427     }   
00428 
00429     /// Set orientation. Orientation front and top should be orthogonal and normalized.
00430     inline void SetOrientation(
00431         AkReal32 in_orientFrontX,               ///< Orientation front x
00432         AkReal32 in_orientFrontY,               ///< Orientation front y
00433         AkReal32 in_orientFrontZ,               ///< Orientation front z
00434         AkReal32 in_orientTopX,                 ///< Orientation top x
00435         AkReal32 in_orientTopY,                 ///< Orientation top y
00436         AkReal32 in_orientTopZ                  ///< Orientation top z
00437         )
00438     {
00439         orientationFront.X = in_orientFrontX;
00440         orientationFront.Y = in_orientFrontY;
00441         orientationFront.Z = in_orientFrontZ;
00442         orientationTop.X = in_orientTopX;
00443         orientationTop.Y = in_orientTopY;
00444         orientationTop.Z = in_orientTopZ;
00445     }
00446 
00447 private:
00448     AkVector        orientationFront;   ///< Orientation of the listener
00449     AkVector        orientationTop;     ///< Top orientation of the listener
00450     AkVector        position;           ///< Position of the listener
00451 };
00452 
00453 /// Positioning information for a sound.
00454 typedef AkTransform AkSoundPosition;
00455 
00456 /// Positioning information for a listener.
00457 typedef AkTransform AkListenerPosition;
00458 
00459 /// Obstruction/occlusion pair for a position
00460 struct AkObstructionOcclusionValues
00461 {
00462     AkReal32 occlusion;    ///< OcclusionLevel: [0.0f..1.0f]
00463     AkReal32 obstruction;  ///< ObstructionLevel: [0.0f..1.0f]
00464 };
00465 
00466 /// Positioning information for a sound, with specified subset of its channels.
00467 struct AkChannelEmitter
00468 {
00469     AkTransform     position;       ///< Emitter position.
00470     AkChannelMask   uInputChannels; ///< Channels to which the above position applies.
00471 };
00472 
00473 /// Polar coordinates.
00474 struct AkPolarCoord
00475 {
00476     AkReal32        r;              ///< Norm/distance
00477     AkReal32        theta;          ///< Azimuth
00478 };
00479 
00480 /// Spherical coordinates.
00481 struct AkSphericalCoord : public AkPolarCoord
00482 {
00483     AkReal32        phi;            ///< Elevation
00484 };
00485 
00486 /// Emitter-listener pair: Positioning data pertaining to a single pair of emitter and listener.
00487 class AkEmitterListenerPair
00488 {
00489 public:
00490     /// Constructor.
00491     AkEmitterListenerPair() 
00492         : fDistance( 0.f )
00493         , fEmitterAngle( 0.f )
00494         , fListenerAngle( 0.f )
00495         , fDryMixGain( 1.f )
00496         , fGameDefAuxMixGain( 1.f )
00497         , fUserDefAuxMixGain( 1.f )
00498         , fOcclusion(0.f)
00499         , fObstruction(0.f)
00500         , fSpread(0.f)
00501         , fFocus(0.f)
00502         , uEmitterChannelMask( 0xFFFFFFFF )
00503         , m_uListenerID( 0 )
00504     {
00505     }
00506     /// Destructor.
00507     ~AkEmitterListenerPair() {}
00508 
00509     /// Get distance.
00510     inline AkReal32 Distance() const { return fDistance; }
00511 
00512     /// Get the absolute angle, in radians between 0 and pi, of the emitter's orientation relative to 
00513     /// the line that joins the emitter and the listener.
00514     inline AkReal32 EmitterAngle() const { return fEmitterAngle; }
00515 
00516     /// Get the absolute angle, in radians between 0 and pi, of the listener's orientation relative to
00517     /// the line that joins the emitter and the listener
00518     inline AkReal32 ListenerAngle() const { return fListenerAngle; }
00519 
00520     /// Get the occlusion factor for this emitter-listener pair
00521     inline AkReal32 Occlusion() const { return fOcclusion; }
00522 
00523     /// Get the obstruction factor for this emitter-listener pair
00524     inline AkReal32 Obstruction() const { return fObstruction; }
00525 
00526     /// Get the emitter-listener-pair-specific gain (due to distance and cone attenuation), linear [0,1], for a given connection type.
00527     inline AkReal32 GetGainForConnectionType(AkConnectionType in_eType) const 
00528     {
00529         if (in_eType == ConnectionType_Direct)
00530             return fDryMixGain;
00531         else if (in_eType == ConnectionType_GameDefSend)
00532             return fGameDefAuxMixGain;
00533         else
00534             return fUserDefAuxMixGain;
00535     }
00536 
00537     /// Get listener ID associated with the emitter-listener pair.
00538     inline AkGameObjectID ListenerID() const { return m_uListenerID; }
00539     
00540     AkTransform emitter;                /// Emitter position.
00541     AkReal32 fDistance;                 /// Distance between emitter and listener.
00542     AkReal32 fEmitterAngle;             /// Angle between position vector and emitter orientation.
00543     AkReal32 fListenerAngle;            /// Angle between position vector and listener orientation.
00544     AkReal32 fDryMixGain;               /// Emitter-listener-pair-specific gain (due to distance and cone attenuation) for direct connections.
00545     AkReal32 fGameDefAuxMixGain;        /// Emitter-listener-pair-specific gain (due to distance and cone attenuation) for game-defined send connections.
00546     AkReal32 fUserDefAuxMixGain;        /// Emitter-listener-pair-specific gain (due to distance and cone attenuation) for user-defined send connections.
00547     AkReal32 fOcclusion;                /// Emitter-listener-pair-specific occlusion factor
00548     AkReal32 fObstruction;              /// Emitter-listener-pair-specific obstruction factor
00549     AkReal32 fSpread;                   /// Emitter-listener-pair-specific spread
00550     AkReal32 fFocus;                    /// Emitter-listener-pair-specific focus
00551     AkChannelMask uEmitterChannelMask;  /// Channels of the emitter that apply to this ray.
00552 protected:
00553     AkGameObjectID m_uListenerID;       /// Listener game object ID.
00554 };
00555 
00556 /// Listener information.
00557 struct AkListener
00558 {
00559     AkListener()
00560         : fScalingFactor( 1.0f )
00561         , bSpatialized( true )
00562     {}
00563     AkListenerPosition  position;       /// Listener position (see AK::SoundEngine::SetPosition()).
00564     AkReal32            fScalingFactor; /// Listener scaling factor (see AK::SoundEngine::SetListenerScalingFactor()).
00565     bool                bSpatialized;   /// Whether listener is spatialized or not (see AK::SoundEngine::SetListenerSpatialization()).
00566 };
00567 
00568 // If you modify AkCurveInterpolation, don't forget to modify WAAPI validation schema accordingly.
00569 
00570 /// Curve interpolation types
00571 enum AkCurveInterpolation
00572 {
00573 //DONT GO BEYOND 15! (see below for details)
00574 //Curves from 0 to LastFadeCurve NEED TO BE A MIRROR IMAGE AROUND LINEAR (eg. Log3 is the inverse of Exp3)
00575     AkCurveInterpolation_Log3           = 0, ///< Log3
00576     AkCurveInterpolation_Sine           = 1, ///< Sine
00577     AkCurveInterpolation_Log1           = 2, ///< Log1
00578     AkCurveInterpolation_InvSCurve      = 3, ///< Inversed S Curve
00579     AkCurveInterpolation_Linear         = 4, ///< Linear (Default)
00580     AkCurveInterpolation_SCurve         = 5, ///< S Curve
00581     AkCurveInterpolation_Exp1           = 6, ///< Exp1
00582     AkCurveInterpolation_SineRecip      = 7, ///< Reciprocal of sine curve
00583     AkCurveInterpolation_Exp3           = 8, ///< Exp3
00584     AkCurveInterpolation_LastFadeCurve  = 8, ///< Update this value to reflect last curve available for fades
00585     AkCurveInterpolation_Constant       = 9  ///< Constant ( not valid for fading values )
00586 //DONT GO BEYOND 15! The value is stored on 5 bits,
00587 //but we can use only 4 bits for the actual values, keeping
00588 //the 5th bit at 0 to void problems when the value is
00589 //expanded to 32 bits.
00590 };
00591 #define AKCURVEINTERPOLATION_NUM_STORAGE_BIT 5 ///< Internal storage restriction, for internal use only.
00592 
00593 /// Auxiliary bus sends information per game object per given auxiliary bus.
00594 struct AkAuxSendValue
00595 {
00596     AkGameObjectID listenerID;  ///< Game object ID of the listener associated with this send. Use AK_INVALID_GAME_OBJECT as a wildcard to set the auxiliary send to all connected listeners (see AK::SoundEngine::SetListeners).
00597     AkAuxBusID auxBusID;        ///< Auxiliary bus ID.
00598     AkReal32 fControlValue;     ///< Value in the range [0.0f:1.0f], send level to auxiliary bus.   
00599 };
00600 
00601 /// Volume ramp specified by end points "previous" and "next".
00602 struct AkRamp
00603 {
00604     AkRamp() : fPrev( 1.f ), fNext( 1.f ) {}
00605     AkRamp( AkReal32 in_fPrev, AkReal32 in_fNext ) : fPrev( in_fPrev ), fNext( in_fNext ) {}
00606     AkRamp & operator*=(const AkRamp& in_rRhs) { fPrev *= in_rRhs.fPrev; fNext *= in_rRhs.fNext; return *this; }
00607 
00608     AkReal32 fPrev;
00609     AkReal32 fNext; 
00610 };
00611 inline AkRamp operator*(const AkRamp& in_rLhs, const AkRamp& in_rRhs) 
00612 {
00613     AkRamp result(in_rLhs);
00614     result *= in_rRhs;
00615     return result;
00616 }
00617 
00618 #ifndef AK_MEMPOOLATTRIBUTES
00619 
00620     /// Memory pool attributes.
00621     /// Block allocation type determines the method used to allocate
00622     /// a memory pool. Block management type determines the
00623     /// method used to manage memory blocks. Note that
00624     /// the list of values in this enum is platform-dependent.
00625     /// \sa
00626     /// - AkMemoryMgr::CreatePool()
00627     /// - AK::Comm::DEFAULT_MEMORY_POOL_ATTRIBUTES
00628     enum AkMemPoolAttributes
00629     {
00630         AkNoAlloc       = 0,    ///< CreatePool will not allocate memory.  You need to allocate the buffer yourself.
00631         AkMalloc        = 1,    ///< CreatePool will use AK::AllocHook() to allocate the memory block.
00632         AkAllocMask     = AkNoAlloc | AkMalloc,                     ///< Block allocation type mask.
00633 
00634         AkFixedSizeBlocksMode   = 1<<3,         ///< Block management type: Fixed-size blocks. Get blocks through GetBlock/ReleaseBlock API.  If not specified, use AkAlloc/AkFree.
00635         AkBlockMgmtMask = AkFixedSizeBlocksMode ///< Block management type mask.
00636     };
00637     #define AK_MEMPOOLATTRIBUTES
00638 
00639 #endif
00640 
00641 namespace AK
00642 {   
00643     /// External allocation hook for the Memory Manager. Called by the Audiokinetic 
00644     /// implementation of the Memory Manager when creating a pool of type AkMalloc.
00645     /// \aknote This needs to be defined by the client. \endaknote
00646     /// \return A pointer to the start of the allocated memory (NULL if the system is out of memory)
00647     /// \sa
00648     /// - \ref memorymanager
00649     /// - AK::FreeHook()
00650     AK_EXTERNFUNC( void *, AllocHook )( 
00651         size_t in_size          ///< Number of bytes to allocate
00652         );
00653 
00654     /// External deallocation hook for the Memory Manager. Called by the Audiokinetic 
00655     /// implementation of the Memory Manager when destroying a pool of type AkMalloc.
00656     /// \aknote This needs to be defined by the client. \endaknote
00657     /// \sa 
00658     /// - \ref memorymanager
00659     /// - AK::AllocHook()
00660     AK_EXTERNFUNC( void, FreeHook )( 
00661         void * in_pMemAddress   ///< Pointer to the start of memory allocated with AllocHook
00662         );
00663 }
00664 
00665 // ---------------------------------------------------------------
00666 // Languages
00667 // ---------------------------------------------------------------
00668 #define AK_MAX_LANGUAGE_NAME_SIZE   (32)
00669 
00670 // ---------------------------------------------------------------
00671 // File Type ID Definitions
00672 // ---------------------------------------------------------------
00673 
00674 // These correspond to IDs specified in the conversion plug-ins' XML
00675 // files. Audio sources persist them to "remember" their format.
00676 // DO NOT CHANGE THEM without talking to someone in charge of persistence!
00677 
00678 // Vendor ID.
00679 #define AKCOMPANYID_AUDIOKINETIC        (0)     ///< Audiokinetic inc.
00680 #define AKCOMPANYID_AUDIOKINETIC_EXTERNAL (1)   ///< Audiokinetic inc.
00681 #define AKCOMPANYID_MCDSP               (256)   ///< McDSP
00682 #define AKCOMPANYID_WAVEARTS            (257)   ///< WaveArts
00683 #define AKCOMPANYID_PHONETICARTS        (258)   ///< Phonetic Arts
00684 #define AKCOMPANYID_IZOTOPE             (259)   ///< iZotope
00685 #define AKCOMPANYID_CRANKCASEAUDIO      (261)   ///< Crankcase Audio
00686 #define AKCOMPANYID_IOSONO              (262)   ///< IOSONO
00687 #define AKCOMPANYID_AUROTECHNOLOGIES    (263)   ///< Auro Technologies
00688 #define AKCOMPANYID_DOLBY               (264)   ///< Dolby
00689 #define AKCOMPANYID_TWOBIGEARS          (265)   ///< Two Big Ears
00690 #define AKCOMPANYID_OCULUS              (266)   ///< Oculus
00691 #define AKCOMPANYID_BLUERIPPLESOUND     (267)   ///< Blue Ripple Sound
00692 #define AKCOMPANYID_ENZIEN              (268)   ///< Enzien Audio
00693 #define AKCOMPANYID_KROTOS              (269)   ///< Krotos (Dehumanizer)
00694 #define AKCOMPANYID_NURULIZE            (270)   ///< Nurulize
00695 #define AKCOMPANYID_SUPERPOWERED        (271)   ///< Super Powered
00696 #define AKCOMPANYID_GOOGLE              (272)   ///< Google
00697 //#define AKCOMPANYID_NVIDIA            (273)   ///< NVIDIA     // Commented out to avoid redefinition, provider is already defining it.
00698 //#define AKCOMPANYID_RESERVED          (274)   ///< Reserved   // Commented out to avoid redefinition, provider is already defining it.
00699 //#define AKCOMPANYID_MICROSOFT         (275)   ///< Microsoft  // Commented out to avoid redefinition, provider is already defining it.
00700 //#define AKCOMPANYID_YAMAHA            (276)   ///< YAMAHA     // Commented out to avoid redefinition, provider is already defining it.
00701 #define AKCOMPANYID_VISISONICS          (277)   ///< Visisonics
00702 
00703 // File/encoding types of Audiokinetic.
00704 #define AKCODECID_BANK                  (0)     ///< Bank encoding
00705 #define AKCODECID_PCM                   (1)     ///< PCM encoding
00706 #define AKCODECID_ADPCM                 (2)     ///< ADPCM encoding
00707 #define AKCODECID_XMA                   (3)     ///< XMA encoding
00708 #define AKCODECID_VORBIS                (4)     ///< Vorbis encoding
00709 #define AKCODECID_WIIADPCM              (5)     ///< ADPCM encoding on the Wii
00710 #define AKCODECID_PCMEX                 (7)     ///< Standard PCM WAV file parser for Wwise Authoring
00711 #define AKCODECID_EXTERNAL_SOURCE       (8)     ///< External Source (unknown encoding)
00712 #define AKCODECID_XWMA                  (9)     ///< xWMA encoding
00713 #define AKCODECID_AAC                   (10)    ///< AAC encoding (only available on Apple devices) -- see AkAACFactory.h
00714 #define AKCODECID_FILE_PACKAGE          (11)    ///< File package files generated by the File Packager utility.
00715 #define AKCODECID_ATRAC9                (12)    ///< ATRAC-9 encoding
00716 #define AKCODECID_VAG                   (13)    ///< VAG/HE-VAG encoding
00717 #define AKCODECID_PROFILERCAPTURE       (14)    ///< Profiler capture file (.prof) as written through AK::SoundEngine::StartProfilerCapture
00718 #define AKCODECID_ANALYSISFILE          (15)    ///< Analysis file
00719 #define AKCODECID_MIDI                  (16)    ///< MIDI file
00720 #define AKCODECID_OPUSNX                (17)    ///< OpusNX encoding
00721 #define AKCODECID_CAF                   (18)    ///< CAF file
00722 #define AKCODECID_AKOPUS                (19)    ///< Opus encoding
00723 
00724 #define AKPLUGINID_METER                (129)  ///< Meter Plugin
00725 #define AKPLUGINID_RECORDER             (132)  ///< Recorder Plugin
00726 
00727 #define AKEXTENSIONID_SPATIALAUDIO          (800)   ///< Spatial Audio
00728 #define AKEXTENSIONID_INTERACTIVEMUSIC      (801)   ///< Interactive Music
00729 
00730 //The following are internally defined
00731 #define AK_WAVE_FORMAT_VAG              0xFFFB
00732 #define AK_WAVE_FORMAT_AT9              0xFFFC
00733 #define AK_WAVE_FORMAT_VORBIS           0xFFFF
00734 #define AK_WAVE_FORMAT_AAC              0xAAC0
00735 #define AK_WAVE_FORMAT_OPUSNX           0x3039
00736 #define AK_WAVE_FORMAT_OPUS             0x3040
00737 #define WAVE_FORMAT_XMA2                0x166
00738 
00739 class IAkSoftwareCodec;
00740 /// Registered file source creation function prototype.
00741 AK_CALLBACK( IAkSoftwareCodec*, AkCreateFileSourceCallback )( void* in_pCtx );
00742 /// Registered bank source node creation function prototype.
00743 AK_CALLBACK( IAkSoftwareCodec*, AkCreateBankSourceCallback )( void* in_pCtx );
00744 
00745 //-----------------------------------------------------------------------------
00746 // Positioning
00747 //-----------------------------------------------------------------------------
00748 
00749 namespace AK
00750 {
00751     namespace SoundEngine
00752     {
00753         // If you modify MultiPositionType, don't forget to modify WAAPI validation schema accordingly.
00754 
00755         /// MultiPositionType.
00756         /// \sa
00757         /// - AK::SoundEngine::SetMultiplePosition()
00758         /// - \ref soundengine_3dpositions_multiplepos
00759         enum MultiPositionType
00760         {
00761             MultiPositionType_SingleSource,     ///< Used for normal sounds, not expected to pass to AK::SoundEngine::SetMultiplePosition() (if done, only the first position will be used).
00762             MultiPositionType_MultiSources,     ///< Simulate multiple sources in one sound playing, adding volumes. For instance, all the torches on your level emitting using only one sound.
00763             MultiPositionType_MultiDirections   ///< Simulate one sound coming from multiple directions. Useful for repositionning sounds based on wall openings or to simulate areas like forest or rivers ( in combination with spreading in the attenuation of the sounds ).
00764         };
00765     }
00766 }
00767 
00768 #define AK_PANNER_NUM_STORAGE_BITS 3
00769 /// Speaker panning type: type of panning logic when object is not 3D spatialized (i.e. when Ak3DSpatializationMode is AK_SpatializationMode_None).
00770 enum AkSpeakerPanningType
00771 {
00772     AK_DirectSpeakerAssignment  = 0,    ///< No panning: route to matching channels between input and output.
00773     AK_BalanceFadeHeight        = 1     ///< Balance-Fade-Height: Traditional "box" or "car"-like panner.
00774 };
00775 
00776 #define AK_POSSOURCE_NUM_STORAGE_BITS 3
00777 /// 3D position type: defines what acts as the emitter position for computing spatialization against the listener. Used when Ak3DSpatializationMode is AK_SpatializationMode_PositionOnly or AK_SpatializationMode_PositionAndOrientation.
00778 enum Ak3DPositionType
00779 {
00780     AK_3DPositionType_Emitter = 0,                  ///< 3D spatialization is computed directly from the emitter game object position.
00781     AK_3DPositionType_EmitterWithAutomation = 1,    ///< 3D spatialization is computed from the emitter game object position, translated by user-defined automation.
00782     AK_3DPositionType_ListenerWithAutomation = 2    ///< 3D spatialization is computed from the listener game object position, translated by user-defined automation.
00783 };
00784 
00785 /// Headphone / speakers panning rules
00786 enum AkPanningRule
00787 {
00788     AkPanningRule_Speakers      = 0,    ///< Left and right positioned 60 degrees apart (by default - see AK::SoundEngine::GetSpeakerAngles()).
00789     AkPanningRule_Headphones    = 1     ///< Left and right positioned 180 degrees apart.
00790 };
00791 
00792 #define AK_SPAT_NUM_STORAGE_BITS 3
00793 /// 3D spatialization mode.
00794 enum Ak3DSpatializationMode
00795 {
00796     AK_SpatializationMode_None = 0,                     ///< No spatialization
00797     AK_SpatializationMode_PositionOnly = 1,             ///< Spatialization based on emitter position only.
00798     AK_SpatializationMode_PositionAndOrientation = 2    ///< Spatialization based on both emitter position and emitter orientation.
00799 };
00800 
00801 /// Bus type bit field.
00802 enum AkBusHierarchyFlags
00803 {
00804     AkBusHierarchy_Primary      = 1 << 0,   ///< Flag is set to indicate the primary bus hierarchy.
00805     AkBusHierarchy_Secondary    = 1 << 1,   ///< Flag is set to indicate the secondary bus hierarchy.
00806     AkBusHierarchy_IsMaster     = 1 << 7    ///< Flag is set to indicate a master bus (may be used in combination with other flags).
00807 };
00808 
00809 #define AK_MAX_BITS_METERING_FLAGS  (5) // Keep in sync with AkMeteringFlags.
00810 
00811 /// Metering flags. Used for specifying bus metering, through AK::SoundEngine::RegisterBusVolumeCallback() or AK::IAkMixerPluginContext::SetMeteringFlags().
00812 enum AkMeteringFlags
00813 {
00814     AK_NoMetering               = 0,            ///< No metering.
00815     AK_EnableBusMeter_Peak      = 1 << 0,       ///< Enable computation of peak metering.
00816     AK_EnableBusMeter_TruePeak  = 1 << 1,       ///< Enable computation of true peak metering (most CPU and memory intensive).
00817     AK_EnableBusMeter_RMS       = 1 << 2,       ///< Enable computation of RMS metering.
00818     // 1 << 3 is reserved.
00819     AK_EnableBusMeter_KPower    = 1 << 4,       ///< Enable computation of K-weighted power metering (used as a basis for computing loudness, as defined by ITU-R BS.1770).
00820     AK_EnableBusMeter_3DMeter = 1 << 5
00821 };
00822 
00823 /// Plug-in type.
00824 /// \sa
00825 /// - AkPluginInfo
00826 enum AkPluginType
00827 {
00828     AkPluginTypeNone = 0,   ///< Unknown/invalid plug-in type.
00829     AkPluginTypeCodec = 1,  ///< Compressor/decompressor plug-in (allows support for custom audio file types).
00830     AkPluginTypeSource = 2, ///< Source plug-in: creates sound by synthesis method (no input, just output).
00831     AkPluginTypeEffect = 3, ///< Effect plug-in: applies processing to audio data.
00832     //AkPluginTypeMotionDevice = 4, ///< Motion Device plug-in: feeds movement data to devices. Deprecated by Motion refactor.
00833     //AkPluginTypeMotionSource = 5, ///< Motion Device source plug-in: feeds movement data to device busses. Deprecated by Motion refactor.
00834     AkPluginTypeMixer = 6,  ///< Mixer plug-in: mix voices at the bus level.
00835     AkPluginTypeSink = 7,   ///< Sink plug-in: implement custom sound engine end point.
00836     AkPluginTypeGlobalExtension = 8,    ///< Global Extension plug-in: (e.g. Spatial Audio, Interactive Music)
00837     AkPluginTypeMask = 0xf  ///< Plug-in type mask is 4 bits.
00838 };
00839 
00840 ////////////////////////////////////////////////////////////////////////////////
00841 // Wwise ID system
00842 ////////////////////////////////////////////////////////////////////////////////
00843 enum AkNodeType
00844 {
00845     AkNodeType_Default,
00846     AkNodeType_Bus
00847 };
00848 
00849 struct WwiseObjectIDext
00850 {
00851 public:
00852 
00853     bool operator == ( const WwiseObjectIDext& in_rOther ) const
00854     {
00855         return in_rOther.id == id && in_rOther.bIsBus == bIsBus;
00856     }
00857 
00858     AkNodeType GetType()
00859     {
00860         return bIsBus ? AkNodeType_Bus : AkNodeType_Default;
00861     }
00862 
00863     AkUniqueID  id;
00864     bool        bIsBus;
00865 };
00866 
00867 struct WwiseObjectID : public WwiseObjectIDext
00868 {
00869     WwiseObjectID()
00870     {
00871         id = AK_INVALID_UNIQUE_ID;
00872         bIsBus = false;
00873     }
00874 
00875     WwiseObjectID( AkUniqueID in_ID )
00876     {
00877         id = in_ID;
00878         bIsBus = false;
00879     }
00880 
00881     WwiseObjectID( AkUniqueID in_ID, bool in_bIsBus )
00882     {
00883         id = in_ID;
00884         bIsBus = in_bIsBus;
00885     }
00886 
00887     WwiseObjectID( AkUniqueID in_ID, AkNodeType in_eNodeType )
00888     {
00889         id = in_ID;
00890         bIsBus = in_eNodeType == AkNodeType_Bus;
00891     }
00892 };
00893 
00894 /// Public data structures for converted file format.
00895 namespace AkFileParser
00896 {
00897 #pragma pack(push, 1)
00898     /// Analyzed envelope point.
00899     struct EnvelopePoint
00900     {
00901         AkUInt32 uPosition;     /// Position of this point in samples at the source rate.
00902         AkUInt16 uAttenuation;  /// Approximate _attenuation_ at this location relative to this source's maximum, in dB (absolute value).
00903     };
00904 #pragma pack(pop)
00905 }
00906 
00907 #ifndef AK_OS_STRUCT_ALIGN
00908 #define AK_OS_STRUCT_ALIGN  4               ///< OS Structures need to be aligned at 4 bytes.
00909 #endif
00910 
00911 #ifndef AK_64B_OS_STRUCT_ALIGN
00912 #define AK_64B_OS_STRUCT_ALIGN  8               ///< OS Structures need to be aligned at 8 bytes.
00913 #endif
00914 
00915 #ifndef AK_ALIGN
00916 #define AK_ALIGN(__declaration__, uAlignmentSize) __declaration__ ///< Default definition for declaration that might need to be aligned on some platforms. By default, no alignment will be done.
00917 #endif
00918 
00919 #if !defined(AK_ENDIANNESS_LITTLE) && !defined(AK_ENDIANNESS_BIG)
00920 #define AK_ENDIANNESS_LITTLE
00921 #endif
00922 
00923 #ifndef AK_UNALIGNED
00924 #define AK_UNALIGNED                        ///< Refers to the __unaligned compilation flag available on some platforms. Note that so far, on the tested platform this should always be placed before the pointer symbol *.
00925 #endif
00926 
00927 #ifndef AK_FINAL
00928 #define AK_FINAL
00929 #endif
00930 
00931 #ifndef AK_ASYNC_OPEN_DEFAULT
00932 #define AK_ASYNC_OPEN_DEFAULT   (false)             ///< Refers to asynchronous file opening in default low-level IO.
00933 #endif
00934 
00935 #ifndef AK_COMM_DEFAULT_DISCOVERY_PORT
00936 #define AK_COMM_DEFAULT_DISCOVERY_PORT 24024    ///< Default discovery port for most platforms using IP sockets for communication.
00937 #endif
00938 
00939 #ifndef AK_CAPTURE_TYPE_FLOAT
00940 typedef AkInt16     AkCaptureType;          ///< Default value: capture type is short.
00941 #endif
00942 
00943 #define AkRegister
00944 
00945 #endif  //_AK_DATA_TYPES_H_