バージョン

menu_open
Wwise SDK 2021.1.14
AkCommunication.h
[詳解]
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.
4 
5 Commercial License Usage
6 
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.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: v2021.1.14 Build: 6590
25  Copyright (c) 2006-2023 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /// \file AK/Comm/AkCommunication.h
29 /// The main communication interface (between the in-game sound engine and
30 /// authoring tool).
31 /// \sa
32 /// - \ref initialization_comm
33 /// - \ref termination_comm
34 
35 #ifndef _AK_COMMUNICATION_H
36 #define _AK_COMMUNICATION_H
37 
41 
42 #define AK_COMM_SETTINGS_MAX_STRING_SIZE 64
43 
44 /// Platform-independent initialization settings of communication module between the Wwise sound engine
45 /// and authoring tool.
46 /// \sa
47 /// - AK::Comm::Init()
49 {
52  {
53  szAppNetworkName[0] = 0;
54  }
55 
56  /// Ports used for communication between the Wwise authoring application and your game.
57  /// All of these ports are opened in the game when Wwise communication is enabled.
58  /// When using HIO type communication, the ports are in fact channels and they must be 3
59  /// consecutives channels in the order they are defined in the Port structure.
60  ///
61  /// \sa
62  /// - \ref initialization_comm_ports
63  /// - AK::Comm::GetDefaultInitSettings()
64  /// - AK::Comm::Init()
65  struct Ports
66  {
67  /// Constructor
70 #if defined( AK_COMM_NO_DYNAMIC_PORTS )
73 #else
74  , uCommand( 0 )
75  , uNotification( 0 )
76 #endif
77  {
78  }
79 
80  /// This is where the authoring application broadcasts "Game Discovery" requests
81  /// to discover games running on the network. Default value: 24024.
82  ///
83  /// \warning Unlike the other ports in this structure, this port cannot be dynamic
84  /// (cannot be set to 0). Refer to \ref initialization_comm_ports_discovery_broadcast
85  /// for more details.
87 
88  /// Used by the "command" channel.
89  /// \remark Set to 0 to request a dynamic/ephemeral port.
91 
92  /// Used by the "notification" channel.
93  /// \remark Set to 0 to request a dynamic/ephemeral port.
95  };
96 
97  /// Ports used for communication between the Wwise authoring application and your game.
98  /// \sa
99  /// - \ref initialization_comm
100  /// - AkCommSettings::Ports
101  /// - AK::Comm::Init()
103 
104  /// Allows selecting the communication system used to connect remotely the Authoring tool on the device.
106  {
107  AkCommSystem_Socket, /// The recommended default communication system
108  AkCommSystem_HTCS /// HTCS when available only, will default to AkCommSystem_Socket if the HTCS system is not available.
109  };
110 
111  /// Select the device of the communication system.
112  /// By default, connecting to the Authoring tool
113  /// \sa
114  /// - \ref initialization_comm
115  /// - AkCommSettings::AkCommSystem
116  /// - AK::Comm::Init()
118 
119  /// Tells if the base console communication library should be initialized.
120  /// If set to false, the game should load/initialize the console's communication library prior to calling this function.
121  /// Set to false only if your game already use sockets before the sound engine initialization.
122  /// Some consoles have critical requirements for initialization, see \ref initialization_comm_console_lib
124 
125  /// Optional name that will be displayed over network remote connection of Wwise.
126  /// It must be a NULL terminated string.
128 };
129 
130 namespace AK
131 {
132  namespace Comm
133  {
134  ///////////////////////////////////////////////////////////////////////
135  /// @name Initialization
136  //@{
137 
138  /// Initializes the communication module. When this is called, and AK::SoundEngine::RenderAudio()
139  /// is called periodically, you may use the authoring tool to connect to the sound engine.
140  ///
141  /// \warning This function must be called after the sound engine and memory manager have
142  /// been properly initialized.
143  ///
144  ///
145  /// \remark The AkCommSettings structure should be initialized with
146  /// AK::Comm::GetDefaultInitSettings(). You can then change some of the parameters
147  /// before calling this function.
148  ///
149  /// \return
150  /// - AK_Success if initialization was successful.
151  /// - AK_InvalidParameter if one of the settings is invalid.
152  /// - AK_InsufficientMemory if the specified pool size is too small for initialization.
153  /// - AK_Fail for other errors.
154  ///
155  /// \sa
156  /// - \ref initialization_comm
157  /// - AK::Comm::GetDefaultInitSettings()
158  /// - AkCommSettings::Ports
160  const AkCommSettings & in_settings///< Initialization settings.
161  );
162 
163  /// Gets the last error from the OS-specific communication library.
164  /// \return The system error code. Check the code in the platform manufacturer documentation for details about the error.
166 
167  /// Gets the communication module's default initialization settings values.
168  /// \sa
169  /// - \ref initialization_comm
170  /// - AK::Comm::Init()
172  AkCommSettings & out_settings ///< Returned default initialization settings.
173  );
174 
175  /// Terminates the communication module.
176  /// \warning This function must be called before the memory manager is terminated.
177  /// \sa
178  /// - \ref termination_comm
179  AK_EXTERNAPIFUNC( void, Term )();
180 
181  /// Terminates and reinitialize the communication module using current settings.
182  ///
183  /// \return
184  /// - AK_Success if initialization was successful.
185  /// - AK_InvalidParameter if one of the settings is invalid.
186  /// - AK_InsufficientMemory if the specified pool size is too small for initialization.
187  /// - AK_Fail for other errors.
188  ///
189  /// \sa
190  /// - \ref AK::SoundEngine::iOS::WakeupFromSuspend()
192 
193 
194  /// Get the initialization settings currently in use by the CommunicationSystem
195  ///
196  /// \return
197  /// - AK_Success if initialization was successful.
199 
200  //@}
201  }
202 }
203 
204 #endif // _AK_COMMUNICATION_H
Audiokinetic namespace
char szAppNetworkName[AK_COMM_SETTINGS_MAX_STRING_SIZE]
Definition: AkCommunication.h:127
#define AK_EXTERNAPIFUNC(_type, _name)
AKRESULT
Standard function call result.
Definition: AkTypes.h:132
AKSOUNDENGINE_API AKRESULT Reset()
AKSOUNDENGINE_API AKRESULT Init(const AkCommSettings &in_settings)
AKSOUNDENGINE_API AkInt32 GetLastError()
AKSOUNDENGINE_API const AkCommSettings & GetCurrentSettings()
AKSOUNDENGINE_API void Term()
#define AK_COMM_NO_DYNAMIC_PORTS
Platform does not support dynamic/ephemeral ports for communication
Definition: AkTypes.h:61
AKSOUNDENGINE_API void GetDefaultInitSettings(AkCommSettings &out_settings)
AkUInt16 uDiscoveryBroadcast
Definition: AkCommunication.h:86
AkCommSystem
Allows selecting the communication system used to connect remotely the Authoring tool on the device.
Definition: AkCommunication.h:106
uint16_t AkUInt16
Unsigned 16-bit integer
Definition: AkTypes.h:58
AkCommSystem commSystem
Definition: AkCommunication.h:117
Ports()
Constructor
Definition: AkCommunication.h:68
bool bInitSystemLib
Definition: AkCommunication.h:123
int32_t AkInt32
Signed 32-bit integer
Definition: AkTypes.h:64
@ AkCommSystem_HTCS
The recommended default communication system
Definition: AkCommunication.h:108
#define AK_COMM_SETTINGS_MAX_STRING_SIZE
Definition: AkCommunication.h:42
#define AK_COMM_DEFAULT_DISCOVERY_PORT
Default discovery port for most platforms using IP sockets for communication.
Definition: AkTypes.h:956
AkUInt16 uNotification
Definition: AkCommunication.h:94

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

サポートは必要ですか?

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

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

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

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

Wwiseからはじめよう