バージョン

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_NotEnoughMemoryToStart,
00159 
00160             Num_ErrorCodes // THIS STAYS AT END OF ENUM
00161         };
00162 
00163         /// Function prototype of local output function pointer.
00164         AK_CALLBACK( void, LocalOutputFunc )(
00165             ErrorCode in_eErrorCode,    ///< Error code number value
00166             const AkOSChar* in_pszError,    ///< Message or error string to be displayed
00167             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00168             AkPlayingID in_playingID,   ///< Related Playing ID if applicable, AK_INVALID_PLAYING_ID otherwise
00169             AkGameObjectID in_gameObjID ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00170             );
00171 
00172         extern const AkOSChar* s_aszErrorCodes[ Num_ErrorCodes ];
00173 
00174         /// Post a monitoring message or error code. This will be displayed in the Wwise capture
00175         /// log.
00176         /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
00177         ///         In optimized mode, this function returns AK_NotCompatible.
00178         /// \remark This function is provided as a tracking tool only. It does nothing if it is 
00179         ///         called in the optimized/release configuration and return AK_NotCompatible.
00180         AK_EXTERNAPIFUNC( AKRESULT, PostCode )( 
00181             ErrorCode in_eError,        ///< Message or error code to be displayed
00182             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00183             AkPlayingID in_playingID = AK_INVALID_PLAYING_ID,   ///< Related Playing ID if applicable
00184             AkGameObjectID in_gameObjID = AK_INVALID_GAME_OBJECT, ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00185             AkUniqueID in_audioNodeID = AK_INVALID_UNIQUE_ID, ///< Related Audio Node ID if applicable, AK_INVALID_UNIQUE_ID otherwise
00186             bool in_bIsBus = false      ///< true if in_audioNodeID is a bus
00187             );
00188 #ifdef AK_SUPPORT_WCHAR
00189         /// Post a unicode monitoring message or error string. This will be displayed in the Wwise capture
00190         /// log.
00191         /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
00192         ///         In optimized mode, this function returns AK_NotCompatible.
00193         /// \remark This function is provided as a tracking tool only. It does nothing if it is 
00194         ///         called in the optimized/release configuration and return AK_NotCompatible.
00195         AK_EXTERNAPIFUNC( AKRESULT, PostString )( 
00196             const wchar_t* in_pszError, ///< Message or error string to be displayed
00197             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00198             AkPlayingID in_playingID = AK_INVALID_PLAYING_ID,   ///< Related Playing ID if applicable
00199             AkGameObjectID in_gameObjID = AK_INVALID_GAME_OBJECT, ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00200             AkUniqueID in_audioNodeID = AK_INVALID_UNIQUE_ID, ///< Related Audio Node ID if applicable, AK_INVALID_UNIQUE_ID otherwise
00201             bool in_bIsBus = false      ///< true if in_audioNodeID is a bus
00202             );
00203 #endif // #ifdef AK_SUPPORT_WCHAR
00204         /// Post a monitoring message or error string. This will be displayed in the Wwise capture
00205         /// log.
00206         /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
00207         ///         In optimized mode, this function returns AK_NotCompatible.
00208         /// \remark This function is provided as a tracking tool only. It does nothing if it is 
00209         ///         called in the optimized/release configuration and return AK_NotCompatible.
00210         AK_EXTERNAPIFUNC( AKRESULT, PostString )( 
00211             const char* in_pszError,    ///< Message or error string to be displayed
00212             ErrorLevel in_eErrorLevel,  ///< Specifies whether it should be displayed as a message or an error
00213             AkPlayingID in_playingID = AK_INVALID_PLAYING_ID,   ///< Related Playing ID if applicable
00214             AkGameObjectID in_gameObjID = AK_INVALID_GAME_OBJECT, ///< Related Game Object ID if applicable, AK_INVALID_GAME_OBJECT otherwise
00215             AkUniqueID in_audioNodeID = AK_INVALID_UNIQUE_ID, ///< Related Audio Node ID if applicable, AK_INVALID_UNIQUE_ID otherwise
00216             bool in_bIsBus = false      ///< true if in_audioNodeID is a bus
00217             );
00218 
00219         /// Enable/Disable local output of monitoring messages or errors. Pass 0 to disable,
00220         /// or any combination of ErrorLevel_Message and ErrorLevel_Error to enable. 
00221         /// \return AK_Success.
00222         ///         In optimized/release configuration, this function returns AK_NotCompatible.
00223         AK_EXTERNAPIFUNC( AKRESULT, SetLocalOutput )(
00224             AkUInt32 in_uErrorLevel = ErrorLevel_All, ///< ErrorLevel(s) to enable in output. Default parameters enable all.
00225             LocalOutputFunc in_pMonitorFunc = 0       ///< Handler for local output. If NULL, the standard platform debug output method is used.
00226             );
00227 
00228         /// Get the time stamp shown in the capture log along with monitoring messages.
00229         /// \return Time stamp in milliseconds.
00230         ///         In optimized/release configuration, this function returns 0.
00231         AK_EXTERNAPIFUNC( AkTimeMs, GetTimeStamp )();
00232     }
00233 }
00234 
00235 // Macros.
00236 #ifndef AK_OPTIMIZED
00237     #define AK_MONITOR_ERROR( in_eErrorCode )\
00238     AK::Monitor::PostCode( in_eErrorCode, AK::Monitor::ErrorLevel_Error )
00239 #else
00240     #define AK_MONITOR_ERROR( in_eErrorCode )
00241 #endif
00242 
00243 #ifdef AK_MONITOR_IMPLEMENT_ERRORCODES
00244 namespace AK
00245 {
00246     namespace Monitor
00247     {
00248         const AkOSChar* s_aszErrorCodes[ Num_ErrorCodes ] =
00249         {
00250             AKTEXT("No error"), // ErrorCode_NoError
00251             AKTEXT("File not found"), // ErrorCode_FileNotFound,
00252             AKTEXT("Cannot open file"), // ErrorCode_CannotOpenFile,
00253             AKTEXT("Not enough memory to start stream"), // ErrorCode_CannotStartStreamNoMemory,
00254             AKTEXT("IO device error"), // ErrorCode_IODevice,
00255             AKTEXT("IO settings incompatible with user requirements"), // ErrorCode_IncompatibleIOSettings
00256 
00257             AKTEXT("Plug-in unsupported channel configuration"), // ErrorCode_PluginUnsupportedChannelConfiguration,
00258             AKTEXT("Plug-in media unavailable"), // ErrorCode_PluginMediaUnavailable,
00259             AKTEXT("Plug-in initialization failure"), // ErrorCode_PluginInitialisationFailed,
00260             AKTEXT("Plug-in execution failure"), // ErrorCode_PluginProcessingFailed,
00261             AKTEXT("Invalid plug-in execution mode"), // ErrorCode_PluginExecutionInvalid
00262             AKTEXT("Could not allocate effect"), // ErrorCode_PluginAllocationFailed
00263 
00264             AKTEXT("Seek table required to seek in Vorbis sources. Please update conversion settings."), // ErrorCode_VorbisRequireSeekTable,
00265 
00266             AKTEXT("Vorbis decoder failure"), // ErrorCode_VorbisDecodeError,
00267             AKTEXT("AAC decoder failure"), // ErrorCode_AACDecodeError
00268 
00269             AKTEXT("Failed creating xWMA decoder"), // ErrorCode_xWMACreateDecoderFailed,
00270 
00271             AKTEXT("Failed creating ATRAC9 decoder"), // ErrorCode_ATRAC9CreateDecoderFailed
00272             AKTEXT("Failed creating ATRAC9 decoder: no more ATRAC9 decoding channels available"), // ErrorCode_ATRAC9CreateDecoderFailedChShortage
00273             AKTEXT("ATRAC9 decoding failed"), // ErrorCode_ATRAC9DecodeFailed
00274             AKTEXT("ATRAC9 context clear failed"), // ErrorCode_ATRAC9ClearContextFailed
00275             AKTEXT("ATRAC9 loop section is too small"), // ErrorCode_ATRAC9LoopSectionTooSmall
00276 
00277             AKTEXT("Invalid file header"), // ErrorCode_InvalidAudioFileHeader,
00278             AKTEXT("File header too large (due to markers or envelope)"), // ErrorCode_AudioFileHeaderTooLarge,
00279             AKTEXT("File or loop region is too small to be played properly"), // ErrorCode_FileTooSmall,
00280 
00281             AKTEXT("Transition not sample-accurate due to mixed channel configurations"), // ErrorCode_TransitionNotAccurateChannel,
00282             AKTEXT("Transition not sample-accurate due to source starvation"), // ErrorCode_TransitionNotAccurateStarvation,
00283             AKTEXT("Nothing to play"), // ErrorCode_NothingToPlay, 
00284             AKTEXT("Play Failed"), // ErrorCode_PlayFailed, // Notification meaning the play asked was not done for an out of control reason
00285                                             // For example, if The Element has a missing source file.
00286 
00287             AKTEXT("Stinger could not be scheduled in this segment or was dropped"), // ErrorCode_StingerCouldNotBeScheduled,
00288             AKTEXT("Segment look-ahead is longer than previous segment in sequence"), // ErrorCode_TooLongSegmentLookAhead,
00289             AKTEXT("Cannot schedule music switch transition in upcoming segments: using Exit Cue"), // ErrorCode_CannotScheduleMusicSwitch,
00290             AKTEXT("Cannot schedule music segments: Stopping music"), // ErrorCode_TooManySimultaneousMusicSegments,
00291             AKTEXT("Music system is stopped because a music playlist is modified"), // ErrorCode_PlaylistStoppedForEditing
00292             AKTEXT("Rescheduling music clips because a track was modified"), // ErrorCode_MusicClipsRescheduledAfterTrackEdit
00293 
00294             AKTEXT("Failed creating source"), // ErrorCode_CannotPlaySource_Create,
00295             AKTEXT("Virtual source failed becoming physical"), // ErrorCode_CannotPlaySource_VirtualOff,
00296             AKTEXT("Error while computing virtual source elapsed time"), // ErrorCode_CannotPlaySource_TimeSkip,
00297             AKTEXT("Inconsistent source status"), // ErrorCode_CannotPlaySource_InconsistentState,
00298             AKTEXT("Media was not loaded for this source"),// ErrorCode_MediaNotLoaded,
00299             AKTEXT("Voice Starvation"), // ErrorCode_VoiceStarving,
00300             AKTEXT("Source starvation"), // ErrorCode_StreamingSourceStarving,
00301             AKTEXT("XMA decoder starvation"), // ErrorCode_XMADecoderSourceStarving,
00302             AKTEXT("XMA decoding error"), // ErrorCode_XMADecodingError
00303             AKTEXT("Invalid XMA data - Make sure data is allocated from APU memory and is aligned to 2K."), // ErrorCode_InvalidXMAData
00304 
00305             AKTEXT("Plug-in not registered"), // ErrorCode_PluginNotRegistered,
00306             AKTEXT("Codec plug-in not registered"), // ErrorCode_CodecNotRegistered,
00307             AKTEXT("Plug-in version doesn't match sound engine version.  Please ensure the plug-in is compatible with this version of Wwise"), //ErrorCode_PluginVersionMismatch
00308 
00309             AKTEXT("Event ID not found"), // ErrorCode_EventIDNotFound,
00310 
00311             AKTEXT("Invalid State Group ID"), // ErrorCode_InvalidGroupID,
00312             AKTEXT("Selected Child Not Available"), // ErrorCode_SelectedChildNotAvailable,
00313             AKTEXT("Selected Node Not Available"), // ErrorCode_SelectedNodeNotAvailable,
00314             AKTEXT("Selected Media Not Available"),// ErrorCode_SelectedMediaNotAvailable,
00315             AKTEXT("No Valid Switch"), // ErrorCode_NoValidSwitch,
00316 
00317             AKTEXT("Selected node not available. Make sure the structure associated to the event is loaded or that the event has been prepared"), // ErrorCode_SelectedNodeNotAvailablePlay,
00318 
00319             AKTEXT("Motion voice starvation"), // ErrorCode_FeedbackVoiceStarving,
00320 
00321             AKTEXT("Bank Load Failed"), // ErrorCode_BankLoadFailed,
00322             AKTEXT("Bank Unload Failed"), // ErrorCode_BankUnloadFailed,
00323             AKTEXT("Error while loading bank"), // ErrorCode_ErrorWhileLoadingBank,
00324             AKTEXT("Insufficient Space to Load Bank"), // ErrorCode_InsufficientSpaceToLoadBank,
00325 
00326             AKTEXT("Lower engine command list is full"), // ErrorCode_LowerEngineCommandListFull,
00327 
00328             AKTEXT("No marker in file; seeking to specified location"), // ErrorCode_SeekNoMarker
00329             AKTEXT("Cannot seek in sound that is within a continuous container with special transitions"), // ErrorCode_CannotSeekContinuous
00330             AKTEXT("Seeking after end of file. Playback will stop"), // ErrorCode_SeekAfterEof
00331 
00332             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,
00333 
00334             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,
00335             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,
00336             AKTEXT("The requested game object is not a listener."), // ErrorCode_GameObjectIsNotListener,
00337             AKTEXT("The requested game object is not an emitter."), // ErrorCode_GameObjectIsNotEmitter,
00338             
00339             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
00340             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
00341 
00342             AKTEXT("External source missing from PostEvent call"), // ErrorCode_ExternalSourceNotResolved
00343             AKTEXT("Source file is of different format than expected"), //ErrorCode_FileFormatMismatch
00344             AKTEXT("Audio command queue is full, blocking caller.  Reduce number of calls to sound engine or boost command queue memory."), // ErrorCode_CommandQueueFull
00345             AKTEXT("Audio command is too large to fit in the command queue.  Break the command in smaller pieces."), //ErrorCode_CommandTooLarge
00346 
00347             AKTEXT("Failed creating XMA decoder: no more XMA voices available"), // ErrorCode_XMACreateDecoderLimitReached
00348             AKTEXT("Failed seeking in XMA source: stream buffer is smaller than XMA block size"), // ErrorCode_XMAStreamBufferTooSmall
00349 
00350             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
00351             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
00352 
00353             AKTEXT("Ignoring seek after end of playlist"), // ErrorCode_SeekAfterEndOfPlaylist
00354             
00355             AKTEXT("Seek table required to seek in Opus sources. Please update conversion settings."), // ErrorCode_OpusRequireSeekTable,
00356             AKTEXT("Opus decoder failure"), // ErrorCode_OpusDecodeError,
00357             AKTEXT("Failed creating Opus decoder"), // ErrorCode_OpusCreateDecoderFailed
00358 
00359 AKTEXT("Not enough memory to start sound."),    //ErrorCode_NotEnoughMemoryToStart
00360 
00361         };
00362     }
00363 }
00364 #endif // AK_MONITOR_IMPLEMENT_ERRORCODES
00365 
00366 #endif // _AKMONITORERROR_H

このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう