版本

menu_open

include/AK/Tools/Common/AkMonitorError.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 #ifndef _AKMONITORERROR_H
00029 #define _AKMONITORERROR_H
00030 
00031 #include <AK/SoundEngine/Common/AkSoundEngineExport.h>
00032 #include <AK/SoundEngine/Common/AkTypes.h>
00033 
00034 namespace AK
00035 {
00036     // Error monitoring.
00037 
00038     namespace Monitor
00039     {
00040         ///  ErrorLevel
00041         enum ErrorLevel
00042         {
00043             ErrorLevel_Message  = (1<<0), // used as bitfield
00044             ErrorLevel_Error    = (1<<1),
00045             
00046             ErrorLevel_All = ErrorLevel_Message | ErrorLevel_Error
00047         };
00048         /// ErrorCode
00049         enum ErrorCode
00050         {
00051             ErrorCode_NoError = 0, // 0-based index into AK::Monitor::s_aszErrorCodes table 
00052             ErrorCode_FileNotFound, 
00053             ErrorCode_CannotOpenFile,
00054             ErrorCode_CannotStartStreamNoMemory,
00055             ErrorCode_IODevice,
00056             ErrorCode_IncompatibleIOSettings,
00057 
00058             ErrorCode_PluginUnsupportedChannelConfiguration,
00059             ErrorCode_PluginMediaUnavailable,
00060             ErrorCode_PluginInitialisationFailed,
00061             ErrorCode_PluginProcessingFailed,
00062             ErrorCode_PluginExecutionInvalid,
00063             ErrorCode_PluginAllocationFailed,
00064 
00065             ErrorCode_VorbisRequireSeekTable,
00066 
00067             ErrorCode_VorbisDecodeError,
00068             ErrorCode_AACDecodeError,
00069             
00070             ErrorCode_xWMACreateDecoderFailed,//Deprecated, keep in place for legacy maintenance.
00071 
00072             ErrorCode_ATRAC9CreateDecoderFailed,
00073             ErrorCode_ATRAC9CreateDecoderFailedChShortage,
00074             ErrorCode_ATRAC9DecodeFailed,
00075             ErrorCode_ATRAC9ClearContextFailed,
00076             ErrorCode_ATRAC9LoopSectionTooSmall,
00077 
00078             ErrorCode_InvalidAudioFileHeader,
00079             ErrorCode_AudioFileHeaderTooLarge,
00080             ErrorCode_FileTooSmall,
00081 
00082             ErrorCode_TransitionNotAccurateChannel,
00083             ErrorCode_TransitionNotAccurateStarvation,
00084             ErrorCode_NothingToPlay, 
00085             ErrorCode_PlayFailed,
00086 
00087             ErrorCode_StingerCouldNotBeScheduled,
00088             ErrorCode_TooLongSegmentLookAhead,
00089             ErrorCode_CannotScheduleMusicSwitch,
00090             ErrorCode_TooManySimultaneousMusicSegments,
00091             ErrorCode_PlaylistStoppedForEditing,
00092             ErrorCode_MusicClipsRescheduledAfterTrackEdit,
00093 
00094             ErrorCode_CannotPlaySource_Create,
00095             ErrorCode_CannotPlaySource_VirtualOff,
00096             ErrorCode_CannotPlaySource_TimeSkip,
00097             ErrorCode_CannotPlaySource_InconsistentState,
00098             ErrorCode_MediaNotLoaded,
00099             ErrorCode_VoiceStarving,
00100             ErrorCode_StreamingSourceStarving,
00101             ErrorCode_XMADecoderSourceStarving,
00102             ErrorCode_XMADecodingError,
00103             ErrorCode_InvalidXMAData,
00104 
00105             ErrorCode_PluginNotRegistered,
00106             ErrorCode_CodecNotRegistered,
00107             ErrorCode_PluginVersionMismatch,
00108 
00109             ErrorCode_EventIDNotFound,
00110 
00111             ErrorCode_InvalidGroupID,
00112             ErrorCode_SelectedChildNotAvailable,
00113             ErrorCode_SelectedNodeNotAvailable,
00114             ErrorCode_SelectedMediaNotAvailable,
00115             ErrorCode_NoValidSwitch,
00116 
00117             ErrorCode_SelectedNodeNotAvailablePlay,
00118 
00119             ErrorCode_FeedbackVoiceStarving,
00120 
00121             ErrorCode_BankLoadFailed,
00122             ErrorCode_BankUnloadFailed,
00123             ErrorCode_ErrorWhileLoadingBank,
00124             ErrorCode_InsufficientSpaceToLoadBank,
00125             
00126             ErrorCode_LowerEngineCommandListFull,
00127 
00128             ErrorCode_SeekNoMarker,
00129             ErrorCode_CannotSeekContinuous,
00130             ErrorCode_SeekAfterEof,
00131 
00132             ErrorCode_UnknownGameObject,
00133             ErrorCode_UnknownEmitter, 
00134             ErrorCode_UnknownListener, 
00135             ErrorCode_GameObjectIsNotListener,
00136             ErrorCode_GameObjectIsNotEmitter,
00137             ErrorCode_UnknownGameObjectEvent,
00138             ErrorCode_GameObjectIsNotEmitterEvent,
00139 
00140             ErrorCode_ExternalSourceNotResolved,
00141             ErrorCode_FileFormatMismatch,
00142 
00143             ErrorCode_CommandQueueFull,
00144             ErrorCode_CommandTooLarge,
00145 
00146             ErrorCode_XMACreateDecoderLimitReached,
00147             ErrorCode_XMAStreamBufferTooSmall,
00148 
00149             ErrorCode_ModulatorScopeError_Inst,
00150             ErrorCode_ModulatorScopeError_Obj,
00151 
00152             ErrorCode_SeekAfterEndOfPlaylist,
00153 
00154             ErrorCode_OpusRequireSeekTable,
00155             ErrorCode_OpusDecodeError,
00156             ErrorCode_OpusCreateDecoderFailed,
00157 
00158             ErrorCode_SourcePluginNotFound,
00159 
00160             ErrorCode_VirtualVoiceLimit,
00161 
00162             ErrorCode_AudioDeviceShareSetNotFound,
00163 
00164             ErrorCode_NotEnoughMemoryToStart,
00165 
00166             Num_ErrorCodes // THIS STAYS AT END OF ENUM
00167         };
00168 
00169         /// Function prototype of local output function pointer.
00170         AK_CALLBACK( void, LocalOutputFunc )(
00171             ErrorCode in_eErrorCode,    ///< Error code number value
00172             const AkOSChar* in_pszError,    ///< Message or error string to be displayed
00173             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00174             AkPlayingID in_playingID,   ///< Related Playing ID if applicable, AK_INVALID_PLAYING_ID otherwise
00175             AkGameObjectID in_gameObjID ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00176             );
00177 
00178         extern const AkOSChar* s_aszErrorCodes[ Num_ErrorCodes ];
00179 
00180         /// Post a monitoring message or error code. This will be displayed in the Wwise capture
00181         /// log.
00182         /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
00183         ///         In optimized mode, this function returns AK_NotCompatible.
00184         /// \remark This function is provided as a tracking tool only. It does nothing if it is 
00185         ///         called in the optimized/release configuration and return AK_NotCompatible.
00186         AK_EXTERNAPIFUNC( AKRESULT, PostCode )( 
00187             ErrorCode in_eError,        ///< Message or error code to be displayed
00188             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00189             AkPlayingID in_playingID = AK_INVALID_PLAYING_ID,   ///< Related Playing ID if applicable
00190             AkGameObjectID in_gameObjID = AK_INVALID_GAME_OBJECT, ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00191             AkUniqueID in_audioNodeID = AK_INVALID_UNIQUE_ID, ///< Related Audio Node ID if applicable, AK_INVALID_UNIQUE_ID otherwise
00192             bool in_bIsBus = false      ///< true if in_audioNodeID is a bus
00193             );
00194 #ifdef AK_SUPPORT_WCHAR
00195         /// Post a unicode monitoring message or error string. This will be displayed in the Wwise capture
00196         /// log.
00197         /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
00198         ///         In optimized mode, this function returns AK_NotCompatible.
00199         /// \remark This function is provided as a tracking tool only. It does nothing if it is 
00200         ///         called in the optimized/release configuration and return AK_NotCompatible.
00201         AK_EXTERNAPIFUNC( AKRESULT, PostString )( 
00202             const wchar_t* in_pszError, ///< Message or error string to be displayed
00203             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00204             AkPlayingID in_playingID = AK_INVALID_PLAYING_ID,   ///< Related Playing ID if applicable
00205             AkGameObjectID in_gameObjID = AK_INVALID_GAME_OBJECT, ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00206             AkUniqueID in_audioNodeID = AK_INVALID_UNIQUE_ID, ///< Related Audio Node ID if applicable, AK_INVALID_UNIQUE_ID otherwise
00207             bool in_bIsBus = false      ///< true if in_audioNodeID is a bus
00208             );
00209 #endif // #ifdef AK_SUPPORT_WCHAR
00210         /// Post a monitoring message or error string. This will be displayed in the Wwise capture
00211         /// log.
00212         /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
00213         ///         In optimized mode, this function returns AK_NotCompatible.
00214         /// \remark This function is provided as a tracking tool only. It does nothing if it is 
00215         ///         called in the optimized/release configuration and return AK_NotCompatible.
00216         AK_EXTERNAPIFUNC( AKRESULT, PostString )( 
00217             const char* in_pszError,    ///< Message or error string to be displayed
00218             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00219             AkPlayingID in_playingID = AK_INVALID_PLAYING_ID,   ///< Related Playing ID if applicable
00220             AkGameObjectID in_gameObjID = AK_INVALID_GAME_OBJECT, ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00221             AkUniqueID in_audioNodeID = AK_INVALID_UNIQUE_ID, ///< Related Audio Node ID if applicable, AK_INVALID_UNIQUE_ID otherwise
00222             bool in_bIsBus = false      ///< true if in_audioNodeID is a bus
00223             );
00224 
00225         /// Enable/Disable local output of monitoring messages or errors. Pass 0 to disable,
00226         /// or any combination of ErrorLevel_Message and ErrorLevel_Error to enable. 
00227         /// \return AK_Success.
00228         ///         In optimized/release configuration, this function returns AK_NotCompatible.
00229         AK_EXTERNAPIFUNC( AKRESULT, SetLocalOutput )(
00230             AkUInt32 in_uErrorLevel = ErrorLevel_All, ///< ErrorLevel(s) to enable in output. Default parameters enable all.
00231             LocalOutputFunc in_pMonitorFunc = 0       ///< Handler for local output. If NULL, the standard platform debug output method is used.
00232             );
00233 
00234         /// Get the time stamp shown in the capture log along with monitoring messages.
00235         /// \return Time stamp in milliseconds.
00236         ///         In optimized/release configuration, this function returns 0.
00237         AK_EXTERNAPIFUNC( AkTimeMs, GetTimeStamp )();
00238     }
00239 }
00240 
00241 // Macros.
00242 #ifndef AK_OPTIMIZED
00243     #define AK_MONITOR_ERROR( in_eErrorCode )\
00244     AK::Monitor::PostCode( in_eErrorCode, AK::Monitor::ErrorLevel_Error )
00245 #else
00246     #define AK_MONITOR_ERROR( in_eErrorCode )
00247 #endif
00248 
00249 #ifdef AK_MONITOR_IMPLEMENT_ERRORCODES
00250 namespace AK
00251 {
00252     namespace Monitor
00253     {
00254         const AkOSChar* s_aszErrorCodes[ Num_ErrorCodes ] =
00255         {
00256             AKTEXT("No error"), // ErrorCode_NoError
00257             AKTEXT("File not found"), // ErrorCode_FileNotFound,
00258             AKTEXT("Cannot open file"), // ErrorCode_CannotOpenFile,
00259             AKTEXT("Not enough memory to start stream"), // ErrorCode_CannotStartStreamNoMemory,
00260             AKTEXT("IO device error"), // ErrorCode_IODevice,
00261             AKTEXT("IO settings incompatible with user requirements"), // ErrorCode_IncompatibleIOSettings
00262 
00263             AKTEXT("Plug-in unsupported channel configuration"), // ErrorCode_PluginUnsupportedChannelConfiguration,
00264             AKTEXT("Plug-in media unavailable"), // ErrorCode_PluginMediaUnavailable,
00265             AKTEXT("Plug-in initialization failure"), // ErrorCode_PluginInitialisationFailed,
00266             AKTEXT("Plug-in execution failure"), // ErrorCode_PluginProcessingFailed,
00267             AKTEXT("Invalid plug-in execution mode"), // ErrorCode_PluginExecutionInvalid
00268             AKTEXT("Could not allocate effect"), // ErrorCode_PluginAllocationFailed
00269 
00270 AKTEXT("Seek table required to seek in Vorbis sources. Please update conversion settings."), // ErrorCode_VorbisRequireSeekTable,
00271 
00272 AKTEXT("Vorbis decoder failure"), // ErrorCode_VorbisDecodeError,
00273 AKTEXT("AAC decoder failure"), // ErrorCode_AACDecodeError
00274 
00275 AKTEXT("Failed creating xWMA decoder"), // ErrorCode_xWMACreateDecoderFailed,
00276 
00277 AKTEXT("Failed creating ATRAC9 decoder"), // ErrorCode_ATRAC9CreateDecoderFailed
00278 AKTEXT("Failed creating ATRAC9 decoder: no more ATRAC9 decoding channels available"), // ErrorCode_ATRAC9CreateDecoderFailedChShortage
00279 AKTEXT("ATRAC9 decoding failed"), // ErrorCode_ATRAC9DecodeFailed
00280 AKTEXT("ATRAC9 context clear failed"), // ErrorCode_ATRAC9ClearContextFailed
00281 AKTEXT("ATRAC9 loop section is too small"), // ErrorCode_ATRAC9LoopSectionTooSmall
00282 
00283 AKTEXT("Invalid file header"), // ErrorCode_InvalidAudioFileHeader,
00284 AKTEXT("File header too large (due to markers or envelope)"), // ErrorCode_AudioFileHeaderTooLarge,
00285 AKTEXT("File or loop region is too small to be played properly"), // ErrorCode_FileTooSmall,
00286 
00287 AKTEXT("Transition not sample-accurate due to mixed channel configurations"), // ErrorCode_TransitionNotAccurateChannel,
00288 AKTEXT("Transition not sample-accurate due to source starvation"), // ErrorCode_TransitionNotAccurateStarvation,
00289 AKTEXT("Nothing to play"), // ErrorCode_NothingToPlay, 
00290 AKTEXT("Play Failed"), // ErrorCode_PlayFailed, // Notification meaning the play asked was not done for an out of control reason
00291 // For example, if The Element has a missing source file.
00292 
00293 AKTEXT("Stinger could not be scheduled in this segment or was dropped"), // ErrorCode_StingerCouldNotBeScheduled,
00294 AKTEXT("Segment look-ahead plus pre-entry duration is longer than previous segment in sequence"), // ErrorCode_TooLongSegmentLookAhead,
00295 AKTEXT("Cannot schedule music switch transition in upcoming segments: using Exit Cue"), // ErrorCode_CannotScheduleMusicSwitch,
00296 AKTEXT("Cannot schedule music segments: Stopping music"), // ErrorCode_TooManySimultaneousMusicSegments,
00297 AKTEXT("Music system is stopped because a music playlist is modified"), // ErrorCode_PlaylistStoppedForEditing
00298 AKTEXT("Rescheduling music clips because a track was modified"), // ErrorCode_MusicClipsRescheduledAfterTrackEdit
00299 
00300 AKTEXT("Failed creating source"), // ErrorCode_CannotPlaySource_Create,
00301 AKTEXT("Virtual source failed becoming physical"), // ErrorCode_CannotPlaySource_VirtualOff,
00302 AKTEXT("Error while computing virtual source elapsed time"), // ErrorCode_CannotPlaySource_TimeSkip,
00303 AKTEXT("Inconsistent source status"), // ErrorCode_CannotPlaySource_InconsistentState,
00304 AKTEXT("Media was not loaded for this source"),// ErrorCode_MediaNotLoaded,
00305 AKTEXT("Voice Starvation"), // ErrorCode_VoiceStarving,
00306 AKTEXT("Source starvation"), // ErrorCode_StreamingSourceStarving,
00307 AKTEXT("XMA decoder starvation"), // ErrorCode_XMADecoderSourceStarving,
00308 AKTEXT("XMA decoding error"), // ErrorCode_XMADecodingError
00309 AKTEXT("Invalid XMA data - Make sure data is allocated from APU memory and is aligned to 2K."), // ErrorCode_InvalidXMAData
00310 
00311 AKTEXT("Plug-in not registered"), // ErrorCode_PluginNotRegistered,
00312 AKTEXT("Codec plug-in not registered"), // ErrorCode_CodecNotRegistered,
00313 AKTEXT("Plug-in version doesn't match sound engine version.  Please ensure the plug-in is compatible with this version of Wwise"), //ErrorCode_PluginVersionMismatch
00314 
00315 AKTEXT("Event ID not found"), // ErrorCode_EventIDNotFound,
00316 
00317 AKTEXT("Invalid State Group ID"), // ErrorCode_InvalidGroupID,
00318 AKTEXT("Selected Child Not Available"), // ErrorCode_SelectedChildNotAvailable,
00319 AKTEXT("Selected Node Not Available"), // ErrorCode_SelectedNodeNotAvailable,
00320 AKTEXT("Selected Media Not Available"),// ErrorCode_SelectedMediaNotAvailable,
00321 AKTEXT("No Valid Switch"), // ErrorCode_NoValidSwitch,
00322 
00323 AKTEXT("Selected node not available. Make sure the structure associated to the event is loaded or that the event has been prepared"), // ErrorCode_SelectedNodeNotAvailablePlay,
00324 
00325 AKTEXT("Motion voice starvation"), // ErrorCode_FeedbackVoiceStarving,
00326 
00327 AKTEXT("Bank Load Failed"), // ErrorCode_BankLoadFailed,
00328 AKTEXT("Bank Unload Failed"), // ErrorCode_BankUnloadFailed,
00329 AKTEXT("Error while loading bank"), // ErrorCode_ErrorWhileLoadingBank,
00330 AKTEXT("Insufficient Space to Load Bank"), // ErrorCode_InsufficientSpaceToLoadBank,
00331 
00332 AKTEXT("Lower engine command list is full"), // ErrorCode_LowerEngineCommandListFull,
00333 
00334 AKTEXT("No marker in file; seeking to specified location"), // ErrorCode_SeekNoMarker
00335 AKTEXT("Cannot seek in sound that is within a continuous container with special transitions"), // ErrorCode_CannotSeekContinuous
00336 AKTEXT("Seeking after end of file. Playback will stop"), // ErrorCode_SeekAfterEof
00337 
00338 AKTEXT("Unknown game object ID. Make sure the game object is registered before using it and do not use it once it was unregistered."), // ErrorCode_UnknownGameObject,
00339 
00340 AKTEXT("Unknown emitter game object ID. Make sure the game object is registered before using it and do not use it once it was unregistered."), // ErrorCode_UnknownEmitter,
00341 AKTEXT("Unknown listener game object ID. Make sure the game object is registered before using it and do not use it once it was unregistered."), // ErrorCode_UnknownListener,
00342 AKTEXT("The requested game object is not a listener."), // ErrorCode_GameObjectIsNotListener,
00343 AKTEXT("The requested game object is not an emitter."), // ErrorCode_GameObjectIsNotEmitter,
00344 
00345 AKTEXT("Unknown emitter game object ID on event. Make sure the game object is registered before using it and do not use it once it was unregistered."), // ErrorCode_UnknownGameObjectEvent
00346 AKTEXT("The requested game object for an event was not registered as an emitter. Make sure the game object is registered as an emitter before using it to post an event."), // ErrorCode_GameObjectIsNotEmitterEvent
00347 
00348 AKTEXT("External source missing from PostEvent call"), // ErrorCode_ExternalSourceNotResolved
00349 AKTEXT("Source file is of different format than expected"), //ErrorCode_FileFormatMismatch
00350 AKTEXT("Audio command queue is full, blocking caller.  Reduce number of calls to sound engine or boost command queue memory."), // ErrorCode_CommandQueueFull
00351 AKTEXT("Audio command is too large to fit in the command queue.  Break the command in smaller pieces."), //ErrorCode_CommandTooLarge
00352 
00353 AKTEXT("Failed creating XMA decoder: no more XMA voices available"), // ErrorCode_XMACreateDecoderLimitReached
00354 AKTEXT("Failed seeking in XMA source: stream buffer is smaller than XMA block size"), // ErrorCode_XMAStreamBufferTooSmall
00355 
00356 AKTEXT("Triggered a note-scoped or playing-instance-scoped modulator in a global context (such as a bus or bus effect).  Modulator will have global scope."), // ErrorCode_ModulatorScopeError_Inst
00357 AKTEXT("Triggered a game-object-scoped modulator in a global context (such as a bus or bus effect).  Modulator will have global scope."), // ErrorCode_ModulatorScopeError_Obj
00358 
00359 AKTEXT("Ignoring seek after end of playlist"), // ErrorCode_SeekAfterEndOfPlaylist
00360 
00361 AKTEXT("Seek table required to seek in Opus sources. Please update conversion settings."), // ErrorCode_OpusRequireSeekTable,
00362 AKTEXT("Opus decoder failure"), // ErrorCode_OpusDecodeError,
00363 AKTEXT("Failed creating Opus decoder"), // ErrorCode_OpusCreateDecoderFailed
00364 
00365 AKTEXT("Source plugin not found in currently loaded banks."), //ErrorCode_SourcePluginNotFound
00366 
00367 AKTEXT("Number of Resume and/or Play-From-Beginning virtual voices has reached warning limit (see Project Settings > Log tab). There may be some infinite, leaked voices.") , // ErrorCode_VirtualVoiceLimit
00368 
00369 AKTEXT("AK::SoundEngine::AddOutput() - Device ShareSet not found in Init bank."),   //ErrorCode_AudioDeviceShareSetNotFound
00370 
00371 AKTEXT("Not enough memory to start sound."),    //ErrorCode_NotEnoughMemoryToStart
00372 
00373         };
00374     }
00375 }
00376 #endif // AK_MONITOR_IMPLEMENT_ERRORCODES
00377 
00378 #endif // _AKMONITORERROR_H

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅