Wwise SDK 2022.1.7
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
5 Commercial License Usage
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
12  Copyright (c) 2023 Audiokinetic Inc.
13 *******************************************************************************/
14 #include <AK/SoundEngine/Common/AkSoundEngine.h> // Sound engine
16 #define AK_MAX_ERROR_LENGTH 1000
18 // AkErrorMessageTranslator.h
19 /// \file
20 /// Contains the interface for a message translator
21 #pragma once
24 {
25 public:
27  m_isReadyForTranslation{ false },
28  m_fallBackTranslator{ nullptr }
29  {}
31  /// ErrorMessageTranslator class destructor.
34  /**
35  Terminate the translator
36  */
37  virtual void Term() = 0;
39  /**
40  Sets the fallBackTranslator to the given fallback translator.
41  The class that created the previously affected fallBackTranslator has
42  the responsibilty to delete it.
43  */
44  void SetFallBackTranslator(AkErrorMessageTranslator* in_fallBackTranslator) { m_fallBackTranslator = in_fallBackTranslator; }
46  /**
47  Resolve names associated to the wwise tag(s) in the error message if possible
48  @param[in] in_pszError The error message to translate
49  @param[out] out_translatedPszError The final result of the translation
50  @param[in] in_maxPszErrorSize The maximum size of the translatedPszError and also the maximum size of the m_translationBuffer
51  @param[in] in_args The variable arguments used in the tranlsation
52  @param[in] in_uArgSize The total size of variable arguments, in bytes
53  @return bool Whether or not the translation was successful
54  */
55  virtual bool Translate(const AkOSChar* in_pszError, AkOSChar* out_translatedPszError, AkInt32 in_maxPszErrorSize, char* in_args, AkUInt32 in_uArgSize);
57 protected:
59  {
60  const AkOSChar* m_pTag = nullptr;
61  const AkOSChar* m_pStartBlock = nullptr;
62  const char* m_args = nullptr;
66  bool m_infoIsParsed = false;
67  };
72  /**
73  Copy the given string to the parsingInformation.
74  @param[out] out_parsedInfo The modified translatedPszError
75  @param[in] in_maxSize The maximum space in the parsedInfo buffer
76  @param[in] in_stringSize The size of the string to print in the translatedPszError
77  @param[in] in_string The string to print in the translatedPszError
78  */
79  void CharPrintResult(AkOSChar* out_parsedInfo, AkInt32 in_maxSize, AkInt32 in_stringSize, const char* in_string);
81  /**
82  A translator specific function to get some informations based on the given tag.
83  If the information is found, modify the translatedPszError and position
84  @param[in] in_pTagList The list of tag to parse
85  @param[in] in_uCount The number of tags to parse.
86  @param[out] out_uTranslated The number of tags already translated.
87  @return bool Whether or not all the tag were parsed
88  */
89  virtual bool GetInfo(TagInformation *in_pTagList, AkUInt32 in_uCount, AkUInt32& out_uTranslated) = 0;
90 private:
91  /**
92  Extract all the tags from the pszError
93  @param[in] in_pszError The error message to extract the tag from
94  @param[in] in_args The variable arguments used in the parsing
95  @param[in] in_uArgSize The size of the arguments used in the parsing
96  @param[out] out_tagList The list of TagInformation with a standard tag
97  @param[out] out_uCount The number of tags in out_TagsList
98  @param[out] out_uTranslated The number of tags already translated in out_TagsList.
99  @return bool True if we need extra translation of the tags.
100  */
101  bool ExtractTags(const AkOSChar* in_pszError, char* in_args, AkUInt32 in_uArgSize, TagInformation* out_tagList, AkUInt32& out_uCount, AkUInt32& out_uTranslated);
102 };
virtual bool Translate(const AkOSChar *in_pszError, AkOSChar *out_translatedPszError, AkInt32 in_maxPszErrorSize, char *in_args, AkUInt32 in_uArgSize)
virtual bool GetInfo(TagInformation *in_pTagList, AkUInt32 in_uCount, AkUInt32 &out_uTranslated)=0
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkNumeralTypes.h:37
char AkOSChar
Generic character string.
Definition: AkTypes.h:60
int32_t AkInt32
Signed 32-bit integer.
Definition: AkNumeralTypes.h:43
void SetFallBackTranslator(AkErrorMessageTranslator *in_fallBackTranslator)
virtual ~AkErrorMessageTranslator()
ErrorMessageTranslator class destructor.
virtual void Term()=0
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkNumeralTypes.h:38
AkErrorMessageTranslator * m_fallBackTranslator
void CharPrintResult(AkOSChar *out_parsedInfo, AkInt32 in_maxSize, AkInt32 in_stringSize, const char *in_string)

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise