版本

menu_open

include/AK/SoundEngine/Common/AkQueryParameters.h

浏览该文件的文档。
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 // AkQueryParameters.h
00029 
00030 /// \file 
00031 /// The sound engine parameter query interface.
00032 
00033 
00034 #ifndef _AK_QUERYPARAMS_H_
00035 #define _AK_QUERYPARAMS_H_
00036 
00037 #include <AK/SoundEngine/Common/AkSoundEngineExport.h>
00038 #include <AK/SoundEngine/Common/AkTypes.h>
00039 #include <AK/SoundEngine/Common/AkCommonDefs.h>
00040 #include <AK/Tools/Common/AkArray.h>
00041 
00042 /// Positioning information obtained from an object
00043 struct AkPositioningInfo
00044 {
00045     AkReal32            fCenterPct;         ///< Center % [0..1]
00046     AkPannerType        pannerType;         ///< Positioning Type (2D, 3D)
00047     AkPositionSourceType posSourceType;     ///< Positioning source (GameDef or UserDef)
00048     bool                bUpdateEachFrame;   ///< Update at each frame (valid only with game-defined)
00049     bool                bUseSpatialization; ///< Use spatialization
00050     bool                bUseAttenuation;    ///< Use attenuation parameter set
00051 
00052     bool                bUseConeAttenuation; ///< Use the cone attenuation
00053     AkReal32            fInnerAngle;        ///< Inner angle
00054     AkReal32            fOuterAngle;        ///< Outer angle
00055     AkReal32            fConeMaxAttenuation; ///< Cone max attenuation
00056     AkLPFType           LPFCone;            ///< Cone low pass filter value
00057     AkLPFType           HPFCone;            ///< Cone low pass filter value
00058 
00059     AkReal32            fMaxDistance;       ///< Maximum distance
00060     AkReal32            fVolDryAtMaxDist;   ///< Volume dry at maximum distance
00061     AkReal32            fVolAuxGameDefAtMaxDist;    ///< Volume wet at maximum distance (if any) (based on the Game defined distance attenuation)
00062     AkReal32            fVolAuxUserDefAtMaxDist;    ///< Volume wet at maximum distance (if any) (based on the User defined distance attenuation)
00063     AkLPFType           LPFValueAtMaxDist;  ///< Low pass filter value at max distance (if any)
00064     AkLPFType           HPFValueAtMaxDist;  ///< High pass filter value at max distance (if any)
00065 };
00066 
00067 /// Object information structure for QueryAudioObjectsIDs
00068 struct AkObjectInfo
00069 {
00070     AkUniqueID  objID;      ///< Object ID
00071     AkUniqueID  parentID;   ///< Object ID of the parent 
00072     AkInt32     iDepth;     ///< Depth in tree
00073 };
00074 
00075 // Audiokinetic namespace
00076 namespace AK
00077 {
00078     // Audiokinetic sound engine namespace
00079     namespace SoundEngine
00080     {
00081         /// Query namespace
00082         /// \remarks The functions in this namespace are thread-safe, unless stated otherwise.
00083         ///
00084         /// \warning Unless noted otherwise in the function definition that it will not acquire the main audio lock, the functions in this namespace 
00085         /// might stall for several milliseconds before returning (as they cannot execute while the 
00086         /// main sound engine thread is busy). They should therefore not be called from any 
00087         /// game critical thread, such as the main game loop.
00088         ///
00089         /// \warning There might be a significant delay between a Sound Engine call (such as PostEvent) and
00090         /// the information being reflected in a Query (such as GetIsGameObjectActive). 
00091 
00092         namespace Query
00093         {
00094             ////////////////////////////////////////////////////////////////////////
00095             /// @name Game Objects
00096             //@{
00097 
00098             /// Get the position of a game object.
00099             /// \return AK_Success if succeeded, or AK_IDNotFound if the game object was not registered
00100             /// \sa 
00101             /// - \ref soundengine_3dpositions
00102             AK_EXTERNAPIFUNC( AKRESULT, GetPosition )( 
00103                 AkGameObjectID in_GameObjectID,             ///< Game object identifier
00104                 AkSoundPosition& out_rPosition              ///< Position to get
00105                 );
00106 
00107             //@}
00108 
00109             ////////////////////////////////////////////////////////////////////////
00110             /// @name Listeners
00111             //@{
00112 
00113             /// Get a game object's listeners.  
00114             /// \return AK_Success if succeeded, or AK_IDNotFound if the game object was not registered
00115             /// \sa 
00116             /// - \ref soundengine_listeners_multi_assignobjects
00117             AK_EXTERNAPIFUNC( AKRESULT, GetListeners )(
00118                 AkGameObjectID in_GameObjectID,             ///< Source game object identifier
00119                 AkGameObjectID* out_ListenerObjectIDs,      ///< Pointer to an array of AkGameObjectID's.  Will be populated with the IDs of the listeners of in_GameObjectID. Pass NULL to querry the size required.
00120                 AkUInt32& oi_uNumListeners                  ///< Pass in the the available number of elements in the array 'out_ListenerObjectIDs'. After return, the number of valid elements filled in the array.
00121                 );
00122 
00123             /// Get a listener's position.
00124             /// \return AK_Success if succeeded, or AK_InvalidParameter if the index is out of range
00125             /// \sa 
00126             /// - \ref soundengine_listeners_settingpos
00127             AK_EXTERNAPIFUNC( AKRESULT, GetListenerPosition )( 
00128                 AkGameObjectID in_uIndex,                       ///< Listener index (0: first listener, 7: 8th listener)
00129                 AkListenerPosition& out_rPosition           ///< Position set
00130                 );
00131 
00132             /// Get a listener's spatialization parameters. 
00133             /// \return AK_Success if succeeded, or AK_InvalidParameter if the index is out of range
00134             /// \sa 
00135             /// - AK::SoundEngine::SetListenerSpatialization().
00136             /// - \ref soundengine_listeners_spatial
00137             AK_EXTERNAPIFUNC( AKRESULT, GetListenerSpatialization )(
00138                 AkUInt32 in_uIndex,                         ///< Listener index (0: first listener, 7: 8th listener)
00139                 bool& out_rbSpatialized,                    ///< Spatialization enabled
00140                 AK::SpeakerVolumes::VectorPtr & out_pVolumeOffsets, ///< Per-speaker vector of volume offsets, in decibels. Use the functions of AK::SpeakerVolumes::Vector to interpret it.
00141                 AkChannelConfig &out_channelConfig          ///< Channel configuration associated with out_rpVolumeOffsets. 
00142                 );
00143             
00144             //@}
00145 
00146 
00147             ////////////////////////////////////////////////////////////////////////
00148             /// @name Game Syncs
00149             //@{
00150 
00151             /// Enum used to request a specific RTPC Value.
00152             /// Also used to inform the user of where the RTPC Value comes from.
00153             ///
00154             /// For example, the user may request the GameObject specific value by specifying RTPCValue_GameObject
00155             /// and can receive the Global Value if there was no GameObject specific value, and even the 
00156             /// default value is there was no Global value either.
00157             /// \sa 
00158             /// - \ref GetRTPCValue
00159             enum RTPCValue_type
00160             {
00161                 RTPCValue_Default,      ///< The value is the Default RTPC.
00162                 RTPCValue_Global,       ///< The value is the Global RTPC.
00163                 RTPCValue_GameObject,   ///< The value is the game object specific RTPC.
00164                 RTPCValue_PlayingID,    ///< The value is the playing ID specific RTPC.
00165                 RTPCValue_Unavailable   ///< The value is not available for the RTPC specified.
00166             };
00167 
00168             /// Get the value of a real-time parameter control (by ID)
00169             /// An RTPC can have a any combination of a global value, a unique value for each game object, or a unique value for each playing ID.  
00170             /// The value requested is determined by RTPCValue_type, in_gameObjectID and in_playingID.  
00171             /// If a value at the requested scope (determined by RTPCValue_type) is not found, the value that is available at the the next broadest scope will be returned, and io_rValueType will be changed to indicate this.
00172             /// \note
00173             ///     When looking up RTPC values via playing ID (ie. io_rValueType is RTPC_PlayingID), in_gameObjectID can be set to a specific game object (if it is available to the caller) to use as a fall back value.
00174             ///     If the game object is unknown or unavailable, AK_INVALID_GAME_OBJECT can be passed in in_gameObjectID, and the game object will be looked up via in_playingID.  
00175             ///     However in this case, it is not possible to retrieve a game object value as a fall back value if the playing id does not exist.  It is best to pass in the game object if possible.
00176             ///     
00177             /// \return AK_Success if succeeded, AK_IDNotFound if the game object was not registered, or AK_Fail if the RTPC value could not be obtained
00178             /// \sa 
00179             /// - \ref soundengine_rtpc
00180             /// - \ref RTPCValue_type
00181             AK_EXTERNAPIFUNC(AKRESULT, GetRTPCValue)(
00182                 AkRtpcID in_rtpcID,                 ///< ID of the RTPC
00183                 AkGameObjectID in_gameObjectID,     ///< Associated game object ID, ignored if io_rValueType is RTPCValue_Global.
00184                 AkPlayingID in_playingID,           ///< Associated playing ID, ignored if io_rValueType is not RTPC_PlayingID.
00185                 AkRtpcValue& out_rValue,            ///< Value returned
00186                 RTPCValue_type& io_rValueType       ///< In/Out value, the user must specify the requested type. The function will return in this variable the type of the returned value.
00187                 );
00188 
00189 #ifdef AK_SUPPORT_WCHAR
00190 
00191             /// Get the value of a real-time parameter control (by ID)
00192             /// An RTPC can have a any combination of a global value, a unique value for each game object, or a unique value for each playing ID.  
00193             /// The value requested is determined by RTPCValue_type, in_gameObjectID and in_playingID.  
00194             /// If a value at the requested scope (determined by RTPCValue_type) is not found, the value that is available at the the next broadest scope will be returned, and io_rValueType will be changed to indicate this.
00195             /// \note
00196             ///     When looking up RTPC values via playing ID (ie. io_rValueType is RTPC_PlayingID), in_gameObjectID can be set to a specific game object (if it is available to the caller) to use as a fall back value.
00197             ///     If the game object is unknown or unavailable, AK_INVALID_GAME_OBJECT can be passed in in_gameObjectID, and the game object will be looked up via in_playingID.  
00198             ///     However in this case, it is not possible to retrieve a game object value as a fall back value if the playing id does not exist.  It is best to pass in the game object if possible.
00199             ///     
00200             /// \return AK_Success if succeeded, AK_IDNotFound if the game object was not registered or the rtpc name could not be found, or AK_Fail if the RTPC value could not be obtained
00201             /// \sa 
00202             /// - \ref soundengine_rtpc
00203             /// - \ref RTPCValue_type
00204             AK_EXTERNAPIFUNC(AKRESULT, GetRTPCValue)(
00205                 const wchar_t* in_pszRtpcName,      ///< String name of the RTPC
00206                 AkGameObjectID in_gameObjectID,     ///< Associated game object ID, ignored if io_rValueType is RTPCValue_Global.
00207                 AkPlayingID in_playingID,           ///< Associated playing ID, ignored if io_rValueType is not RTPC_PlayingID.
00208                 AkRtpcValue& out_rValue,            ///< Value returned
00209                 RTPCValue_type& io_rValueType       ///< In/Out value, the user must specify the requested type. The function will return in this variable the type of the returned value.              );
00210                 );
00211 
00212 #endif //AK_SUPPORT_WCHAR
00213 
00214             /// Get the value of a real-time parameter control (by ID)
00215             /// An RTPC can have a any combination of a global value, a unique value for each game object, or a unique value for each playing ID.  
00216             /// The value requested is determined by RTPCValue_type, in_gameObjectID and in_playingID.  
00217             /// If a value at the requested scope (determined by RTPCValue_type) is not found, the value that is available at the the next broadest scope will be returned, and io_rValueType will be changed to indicate this.
00218             /// \note
00219             ///     When looking up RTPC values via playing ID (ie. io_rValueType is RTPC_PlayingID), in_gameObjectID can be set to a specific game object (if it is available to the caller) to use as a fall back value.
00220             ///     If the game object is unknown or unavailable, AK_INVALID_GAME_OBJECT can be passed in in_gameObjectID, and the game object will be looked up via in_playingID.  
00221             ///     However in this case, it is not possible to retrieve a game object value as a fall back value if the playing id does not exist.  It is best to pass in the game object if possible.
00222             ///     
00223             /// \return AK_Success if succeeded, AK_IDNotFound if the game object was not registered or the rtpc name could not be found, or AK_Fail if the RTPC value could not be obtained
00224             /// \sa 
00225             /// - \ref soundengine_rtpc
00226             /// - \ref RTPCValue_type
00227             AK_EXTERNAPIFUNC(AKRESULT, GetRTPCValue)(
00228                 const char* in_pszRtpcName,         ///< String name of the RTPC
00229                 AkGameObjectID in_gameObjectID,     ///< Associated game object ID, ignored if io_rValueType is RTPCValue_Global.
00230                 AkPlayingID in_playingID,           ///< Associated playing ID, ignored if io_rValueType is not RTPC_PlayingID.
00231                 AkRtpcValue& out_rValue,            ///< Value returned
00232                 RTPCValue_type& io_rValueType       ///< In/Out value, the user must specify the requested type. The function will return in this variable the type of the returned value.              );
00233                 );
00234 
00235             /// Get the state of a switch group (by IDs).
00236             /// \return AK_Success if succeeded, or AK_IDNotFound if the game object was not registered
00237             /// \sa 
00238             /// - \ref soundengine_switch
00239             AK_EXTERNAPIFUNC( AKRESULT, GetSwitch )( 
00240                 AkSwitchGroupID in_switchGroup,             ///< ID of the switch group
00241                 AkGameObjectID  in_gameObjectID,            ///< Associated game object ID
00242                 AkSwitchStateID& out_rSwitchState           ///< ID of the switch
00243                 );
00244 
00245 #ifdef AK_SUPPORT_WCHAR
00246             /// Get the state of a switch group.
00247             /// \return AK_Success if succeeded, or AK_IDNotFound if the game object was not registered or the switch group name can not be found
00248             /// \sa 
00249             /// - \ref soundengine_switch
00250             AK_EXTERNAPIFUNC( AKRESULT, GetSwitch )( 
00251                 const wchar_t* in_pstrSwitchGroupName,          ///< String name of the switch group
00252                 AkGameObjectID in_GameObj,                  ///< Associated game object ID
00253                 AkSwitchStateID& out_rSwitchState           ///< ID of the switch
00254                 );
00255 #endif //AK_SUPPORT_WCHAR
00256 
00257             /// Get the state of a switch group.
00258             /// \return AK_Success if succeeded, or AK_IDNotFound if the game object was not registered or the switch group name can not be found
00259             /// \sa 
00260             /// - \ref soundengine_switch
00261             AK_EXTERNAPIFUNC( AKRESULT, GetSwitch )( 
00262                 const char* in_pstrSwitchGroupName,         ///< String name of the switch group
00263                 AkGameObjectID in_GameObj,                  ///< Associated game object ID
00264                 AkSwitchStateID& out_rSwitchState           ///< ID of the switch
00265                 );
00266 
00267             /// Get the state of a state group (by IDs).
00268             /// \return AK_Success if succeeded
00269             /// \sa 
00270             /// - \ref soundengine_states
00271             AK_EXTERNAPIFUNC( AKRESULT, GetState )( 
00272                 AkStateGroupID in_stateGroup,               ///< ID of the state group
00273                 AkStateID& out_rState                       ///< ID of the state
00274                 );
00275 
00276 #ifdef AK_SUPPORT_WCHAR
00277             /// Get the state of a state group.
00278             /// \return AK_Success if succeeded, or AK_IDNotFound if the state group name can not be found
00279             /// \sa 
00280             /// - \ref soundengine_states
00281             AK_EXTERNAPIFUNC( AKRESULT, GetState )( 
00282                 const wchar_t* in_pstrStateGroupName,           ///< String name of the state group
00283                 AkStateID& out_rState                       ///< ID of the state
00284                 );
00285 #endif //AK_SUPPORT_WCHAR
00286 
00287             /// Get the state of a state group.
00288             /// \return AK_Success if succeeded, or AK_IDNotFound if the state group name can not be found
00289             /// \sa 
00290             /// - \ref soundengine_states
00291             AK_EXTERNAPIFUNC( AKRESULT, GetState )( 
00292                 const char* in_pstrStateGroupName,              ///< String name of the state group
00293                 AkStateID& out_rState                       ///< ID of the state
00294                 );
00295 
00296             //@}
00297 
00298             ////////////////////////////////////////////////////////////////////////
00299             /// @name Environments
00300             //@{
00301 
00302             /// Get the environmental ratios used by the specified game object.
00303             /// The array size cannot exceed AK_MAX_AUX_PER_OBJ.
00304             /// To clear the game object's environments, in_uNumEnvValues must be 0.
00305             /// \aknote The actual maximum number of environments in which a game object can be is AK_MAX_AUX_PER_OBJ. \endaknote
00306             /// \sa 
00307             /// - \ref soundengine_environments
00308             /// - \ref soundengine_environments_dynamic_aux_bus_routing
00309             /// - \ref soundengine_environments_id_vs_string
00310             /// \return AK_Success if succeeded, or AK_InvalidParameter if io_ruNumEnvValues is 0 or out_paEnvironmentValues is NULL, or AK_PartialSuccess if more environments exist than io_ruNumEnvValues
00311             /// AK_InvalidParameter
00312             AK_EXTERNAPIFUNC( AKRESULT, GetGameObjectAuxSendValues )( 
00313                 AkGameObjectID      in_gameObjectID,        ///< Associated game object ID
00314                 AkAuxSendValue*     out_paAuxSendValues,    ///< Variable-size array of AkAuxSendValue structures
00315                                                                 ///< (it may be NULL if no aux send must be set, and its size 
00316                                                                 ///< cannot exceed AK_MAX_AUX_PER_OBJ)
00317                 AkUInt32&           io_ruNumSendValues      ///< The number of Auxilliary busses at the pointer's address
00318                                                             ///< (it must be 0 if no aux bus is set, and can not exceed AK_MAX_AUX_PER_OBJ)
00319                 );
00320 
00321             /// Get the environmental dry level to be used for the specified game object
00322             /// The control value is a number ranging from 0.0f to 1.0f.
00323             /// 0.0f stands for 0% dry, while 1.0f stands for 100% dry.
00324             /// \aknote Reducing the dry level does not mean increasing the wet level. \endaknote
00325             /// \sa 
00326             /// - \ref soundengine_environments
00327             /// - \ref soundengine_environments_setting_dry_environment
00328             /// - \ref soundengine_environments_id_vs_string
00329             /// \return AK_Success if succeeded, or AK_IDNotFound if the game object was not registered
00330             AK_EXTERNAPIFUNC( AKRESULT, GetGameObjectDryLevelValue )( 
00331                 AkGameObjectID      in_EmitterID,           ///< Associated emitter game object ID
00332                 AkGameObjectID      in_ListenerID,          ///< Associated listener game object ID
00333                 AkReal32&           out_rfControlValue      ///< Dry level control value, ranging from 0.0f to 1.0f
00334                                                             ///< (0.0f stands for 0% dry, while 1.0f stands for 100% dry)
00335                 );
00336 
00337             /// Get a game object's obstruction and occlusion levels.
00338             /// \sa 
00339             /// - \ref soundengine_obsocc
00340             /// - \ref soundengine_environments
00341             /// \return AK_Success if succeeded, AK_IDNotFound if the game object was not registered
00342             AK_EXTERNAPIFUNC( AKRESULT, GetObjectObstructionAndOcclusion )(  
00343                 AkGameObjectID in_EmitterID,            ///< Associated game object ID
00344                 AkGameObjectID in_ListenerID,           ///< Listener object ID
00345                 AkReal32& out_rfObstructionLevel,       ///< ObstructionLevel: [0.0f..1.0f]
00346                 AkReal32& out_rfOcclusionLevel          ///< OcclusionLevel: [0.0f..1.0f]
00347                 );
00348 
00349             //@}
00350 
00351             /// Get the list of audio object IDs associated to an event.
00352             /// \aknote It is possible to call QueryAudioObjectIDs with io_ruNumItems = 0 to get the total size of the
00353             /// structure that should be allocated for out_aObjectInfos. \endaknote
00354             /// \return AK_Success if succeeded, AK_IDNotFound if the eventID cannot be found, AK_InvalidParameter if out_aObjectInfos is NULL while io_ruNumItems > 0
00355             /// or AK_UnknownObject if the event contains an unknown audio object, 
00356             /// or AK_PartialSuccess if io_ruNumItems was set to 0 to query the number of available items.
00357             AK_EXTERNAPIFUNC( AKRESULT, QueryAudioObjectIDs )(
00358                 AkUniqueID in_eventID,              ///< Event ID
00359                 AkUInt32& io_ruNumItems,            ///< Number of items in array provided / Number of items filled in array
00360                 AkObjectInfo* out_aObjectInfos      ///< Array of AkObjectInfo items to fill
00361                 );
00362 
00363 #ifdef AK_SUPPORT_WCHAR
00364             /// Get the list of audio object IDs associated to a event name.
00365             /// \aknote It is possible to call QueryAudioObjectIDs with io_ruNumItems = 0 to get the total size of the
00366             /// structure that should be allocated for out_aObjectInfos. \endaknote
00367             /// \return AK_Success if succeeded, AK_IDNotFound if the event name cannot be found, AK_InvalidParameter if out_aObjectInfos is NULL while io_ruNumItems > 0
00368             /// or AK_UnknownObject if the event contains an unknown audio object, 
00369             /// or AK_PartialSuccess if io_ruNumItems was set to 0 to query the number of available items.
00370             AK_EXTERNAPIFUNC( AKRESULT, QueryAudioObjectIDs )(
00371                 const wchar_t* in_pszEventName,     ///< Event name
00372                 AkUInt32& io_ruNumItems,            ///< Number of items in array provided / Number of items filled in array
00373                 AkObjectInfo* out_aObjectInfos      ///< Array of AkObjectInfo items to fill
00374                 );
00375 #endif //AK_SUPPORT_WCHAR
00376 
00377             /// Get the list of audio object IDs associated to an event name.
00378             /// \aknote It is possible to call QueryAudioObjectIDs with io_ruNumItems = 0 to get the total size of the
00379             /// structure that should be allocated for out_aObjectInfos. \endaknote
00380             /// \return AK_Success if succeeded, AK_IDNotFound if the event name cannot be found, AK_InvalidParameter if out_aObjectInfos is NULL while io_ruNumItems > 0
00381             /// or AK_UnknownObject if the event contains an unknown audio object, 
00382             /// or AK_PartialSuccess if io_ruNumItems was set to 0 to query the number of available items.
00383             AK_EXTERNAPIFUNC( AKRESULT, QueryAudioObjectIDs )(
00384                 const char* in_pszEventName,        ///< Event name
00385                 AkUInt32& io_ruNumItems,            ///< Number of items in array provided / Number of items filled in array
00386                 AkObjectInfo* out_aObjectInfos      ///< Array of AkObjectInfo items to fill
00387                 );
00388 
00389             /// Get positioning information associated to an audio object.
00390             /// \return AK_Success if succeeded, AK_IDNotFound if the object ID cannot be found, AK_NotCompatible if the audio object cannot expose positioning
00391             AK_EXTERNAPIFUNC( AKRESULT, GetPositioningInfo )( 
00392                 AkUniqueID in_ObjectID,                     ///< Audio object ID
00393                 AkPositioningInfo& out_rPositioningInfo     ///< Positioning information structure to be filled
00394                 );
00395 
00396             /// List passed to GetActiveGameObjects.
00397             /// After calling this function, the list will contain the list of all game objects that are currently active in the sound engine.
00398             /// Being active means that either a sound is playing or pending to be played using this game object.
00399             /// The caller is responsible for calling Term() on the list when the list is not required anymore
00400             /// \sa 
00401             /// - \ref GetActiveGameObjects
00402             typedef AkArray<AkGameObjectID, AkGameObjectID, ArrayPoolDefault, 32> AkGameObjectsList;
00403 
00404             /// Fill the provided list with all the game object IDs that are currently active in the sound engine.
00405             /// The function may be used to avoid updating game objects positions that are not required at the moment.
00406             /// After calling this function, the list will contain the list of all game objects that are currently active in the sound engine.
00407             /// Being active means that either a sound is playing or pending to be played using this game object.
00408             /// \sa 
00409             /// - \ref AkGameObjectsList
00410             AK_EXTERNAPIFUNC( AKRESULT, GetActiveGameObjects )( 
00411                 AkGameObjectsList& io_GameObjectList    ///< returned list of active game objects.
00412                 );
00413 
00414             /// Query if the specified game object is currently active.
00415             /// Being active means that either a sound is playing or pending to be played using this game object.
00416             AK_EXTERNAPIFUNC( bool, GetIsGameObjectActive )( 
00417                 AkGameObjectID in_GameObjId ///< Game object ID
00418                 );
00419 
00420             /// Game object and max distance association.
00421             /// \sa 
00422             /// - \ref AkRadiusList
00423             struct GameObjDst
00424             {
00425                 /// Default constructor
00426                 GameObjDst()
00427                     : m_gameObjID( AK_INVALID_GAME_OBJECT )
00428                     , m_dst( -1.0f )
00429                 {}
00430 
00431                 /// Easy constructor
00432                 GameObjDst( AkGameObjectID in_gameObjID, AkReal32 in_dst )
00433                     : m_gameObjID( in_gameObjID )
00434                     , m_dst( in_dst )
00435                 {}
00436 
00437                 AkGameObjectID  m_gameObjID;    ///< Game object ID
00438                 AkReal32        m_dst;          ///< MaxDistance
00439             };
00440 
00441             /// List passed to GetMaxRadius.
00442             /// \sa 
00443             /// - \ref AK::SoundEngine::Query::GetMaxRadius
00444             typedef AkArray<GameObjDst, const GameObjDst&, ArrayPoolDefault, 32> AkRadiusList;
00445 
00446             /// Returns the maximum distance used in attenuations associated to all sounds currently playing.
00447             /// This may be used for example by the game to know if some processing need to be performed on the game side, that would not be required
00448             /// if the object is out of reach anyway.
00449             ///
00450             /// Example usage:
00451             /// \code
00452             /// /*******************************************************/
00453             /// AkRadiusList RadLst; //creating the list( array ).
00454             /// // Do not reserve any size for the array, 
00455             /// // the system will reserve the correct size.
00456             ///
00457             /// GetMaxRadius( RadLst );
00458             /// // Use the content of the list
00459             /// (...)
00460             ///
00461             /// RadLst.Term();// the user is responsible to free the memory allocated
00462             /// /*******************************************************/
00463             /// \endcode
00464             ///
00465             /// \aknote The returned value is NOT the distance from a listener to an object but
00466             /// the maximum attenuation distance of all sounds playing on this object. This is
00467             /// not related in any way to the curent 3D position of the object. \endaknote
00468             ///
00469             /// \return 
00470             /// - AK_Success if succeeded
00471             /// - AK_InsuficientMemory if there was not enough memory
00472             ///
00473             /// \aknote 
00474             /// The Scaling factor (if one was specified on the game object) is included in the return value.
00475             /// The Scaling factor is not updated once a sound starts playing since it 
00476             /// is computed only when the playback starts with the initial scaling factor of this game object. Scaling factor will 
00477             /// be re-computed for every playback instance, always using the scaling factor available at this time.
00478             /// \endaknote
00479             ///
00480             /// \sa 
00481             /// - \ref AkRadiusList
00482             AK_EXTERNAPIFUNC( AKRESULT, GetMaxRadius )(
00483                 AkRadiusList & io_RadiusList    ///< List that will be filled with AK::SoundEngine::Query::GameObjDst objects.
00484                 );
00485 
00486             /// Returns the maximum distance used in attenuations associated to sounds playing using the specified game object.
00487             /// This may be used for example by the game to know if some processing need to be performed on the game side, that would not be required
00488             /// if the object is out of reach anyway.
00489             /// 
00490             /// \aknote The returned value is NOT the distance from a listener to an object but the maximum attenuation distance of all sounds playing on this object. \endaknote
00491             ///
00492             /// \return
00493             /// - A negative number if the game object specified is not playing.
00494             /// - 0, if the game object was only associated to sounds playing using no distance attenuation ( like 2D sounds ).
00495             /// - A positive number represents the maximum of all the distance attenuations playing on this game object.
00496             ///
00497             /// \aknote 
00498             /// The Scaling factor (if one was specified on the game object) is included in the return value.
00499             /// The Scaling factor is not updated once a sound starts playing since it 
00500             /// is computed only when the playback starts with the initial scaling factor of this game object. Scaling factor will 
00501             /// be re-computed for every playback instance, always using the scaling factor available at this time.
00502             /// \endaknote
00503             ///
00504             /// \sa 
00505             /// - \ref AK::SoundEngine::SetAttenuationScalingFactor
00506             AK_EXTERNAPIFUNC( AkReal32, GetMaxRadius )(
00507                 AkGameObjectID in_GameObjId ///< Game object ID
00508                 );
00509 
00510             /// Get the Event ID associated to the specified PlayingID.
00511             /// This function does not acquire the main audio lock.
00512             ///
00513             /// \return AK_INVALID_UNIQUE_ID on failure.
00514             AK_EXTERNAPIFUNC( AkUniqueID, GetEventIDFromPlayingID )(
00515                 AkPlayingID in_playingID ///< Associated PlayingID
00516                 );
00517 
00518             /// Get the ObjectID associated to the specified PlayingID.
00519             /// This function does not acquire the main audio lock.
00520             ///
00521             /// \return AK_INVALID_GAME_OBJECT on failure.
00522             AK_EXTERNAPIFUNC( AkGameObjectID, GetGameObjectFromPlayingID )(
00523                 AkPlayingID in_playingID ///< Associated PlayingID
00524                 );
00525 
00526             /// Get the list PlayingIDs associated with the given game object.
00527             /// This function does not acquire the main audio lock.
00528             ///
00529             /// \aknote It is possible to call GetPlayingIDsFromGameObject with io_ruNumItems = 0 to get the total size of the
00530             /// structure that should be allocated for out_aPlayingIDs. \endaknote
00531             /// \return AK_Success if succeeded, AK_InvalidParameter if out_aPlayingIDs is NULL while io_ruNumItems > 0
00532             AK_EXTERNAPIFUNC( AKRESULT, GetPlayingIDsFromGameObject )(
00533                 AkGameObjectID in_GameObjId,        ///< Game object ID
00534                 AkUInt32& io_ruNumIDs,              ///< Number of items in array provided / Number of items filled in array
00535                 AkPlayingID* out_aPlayingIDs        ///< Array of AkPlayingID items to fill
00536                 );
00537 
00538             /// Get the value of a custom property of integer or boolean type.
00539             AK_EXTERNAPIFUNC( AKRESULT, GetCustomPropertyValue )(
00540                 AkUniqueID in_ObjectID,         ///< Object ID, this is the 32bit ShortID of the AudioFileSource or Sound object found in the .wwu XML file. At runtime it can only be retrieved by the AK_Duration callback when registered with PostEvent(), or by calling Query::QueryAudioObjectIDs() to get all the shortIDs associated with an event.
00541                 AkUInt32 in_uPropID,            ///< Property ID of your custom property found under the Custom Properties tab of the Wwise project settings.
00542                 AkInt32& out_iValue             ///< Property Value
00543                 );
00544 
00545             /// Get the value of a custom property of real type.
00546             AK_EXTERNAPIFUNC( AKRESULT, GetCustomPropertyValue )(
00547                 AkUniqueID in_ObjectID,         ///< Object ID, this is the 32bit ShortID of the AudioFileSource or Sound object found in the .wwu XML file. At runtime it can only be retrieved by the AK_Duration callback when registered with PostEvent(), or by calling Query::QueryAudioObjectIDs() to get all the shortIDs associated with an event.
00548                 AkUInt32 in_uPropID,            ///< Property ID of your custom property found under the Custom Properties tab of the Wwise project settings.
00549                 AkReal32& out_fValue            ///< Property Value
00550                 );
00551 
00552         } //namespace Query
00553     } //namespace SoundEngine
00554 } //namespace AK
00555 
00556 #endif // _AK_QUERYPARAMS_H_

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅