バージョン

menu_open
Wwise SDK 2024.1.1
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  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 /// \file AK/Comm/AkCommunication.h
28 /// The main communication interface (between the in-game sound engine and
29 /// authoring tool).
30 /// \sa
31 /// - \ref initialization_comm
32 /// - \ref termination_comm
33 
34 #ifndef _AK_COMMUNICATION_H
35 #define _AK_COMMUNICATION_H
36 
38 
39 #define AK_COMM_SETTINGS_MAX_STRING_SIZE 64
40 #define AK_COMM_SETTINGS_MAX_URL_SIZE 128
41 
42 /// Platform-independent initialization settings of communication module between the Wwise sound engine
43 /// and authoring tool.
44 /// \sa
45 /// - AK::Comm::Init()
47 {
50  {
51  szAppNetworkName[0] = 0;
52  szCommProxyServerUrl[0] = 0;
53  }
54 
55  /// Ports used for communication between the Wwise authoring application and your game.
56  /// All of these ports are opened in the game when Wwise communication is enabled.
57  ///
58  /// \sa
59  /// - \ref initialization_comm_ports
60  /// - AK::Comm::GetDefaultInitSettings()
61  /// - AK::Comm::Init()
62  struct Ports
63  {
64  /// Constructor
67 #if defined( AK_COMM_NO_DYNAMIC_PORTS )
69 #else
70  , uCommand( 0 )
71 #endif
72  {
73  }
74 
75  /// This is where the authoring application broadcasts "Game Discovery" requests
76  /// to discover games running on the network. Default value: 24024.
77  ///
78  /// \warning Unlike the other port in this structure, this port cannot be dynamic: setting it
79  /// to 0 will disable discovery. Refer to \ref initialization_comm_ports_discovery_broadcast
80  /// for more details.
82 
83  /// Used by the "command" channel.
84  /// \remark Set to 0 to request a dynamic/ephemeral port.
86  };
87 
88  /// Ports used for communication between the Wwise authoring application and your game.
89  /// \sa
90  /// - \ref initialization_comm
91  /// - AkCommSettings::Ports
92  /// - AK::Comm::Init()
94 
95  /// Allows selecting the communication system used to connect remotely the Authoring tool on the device.
97  {
98  AkCommSystem_Socket, /// The recommended default communication system
99  AkCommSystem_HTCS, /// HTCS when available only, will default to AkCommSystem_Socket if the HTCS system is not available.
100  AkCommSystem_Last /// End of enum, invalid value.
101  };
102 
103  /// Select the device of the communication system.
104  /// By default, connecting to the Authoring tool
105  /// \sa
106  /// - \ref initialization_comm
107  /// - AkCommSettings::AkCommSystem
108  /// - AK::Comm::Init()
110 
111  /// Tells if the base console communication library should be initialized.
112  /// If set to false, the game should load/initialize the console's communication library prior to calling this function.
113  /// Set to false only if your game already use sockets before the sound engine initialization.
114  /// Some consoles have critical requirements for initialization, see \ref initialization_comm_console_lib
116 
117  /// Optional name that will be displayed over network remote connection of Wwise.
118  /// It must be a NULL terminated string.
120 
121  /// Optional URL of Comm proxy server (only applicable for platforms incapable of acting as raw UDP/TCP servers)
123 };
124 
125 namespace AK
126 {
127  namespace Comm
128  {
129  ///////////////////////////////////////////////////////////////////////
130  /// @name Initialization
131  //@{
132 
133  /// Initializes the communication module. When this is called, and AK::SoundEngine::RenderAudio()
134  /// is called periodically, you may use the authoring tool to connect to the sound engine.
135  ///
136  /// \warning This function must be called after the sound engine and memory manager have
137  /// been properly initialized.
138  ///
139  ///
140  /// \remark The AkCommSettings structure should be initialized with
141  /// AK::Comm::GetDefaultInitSettings(). You can then change some of the parameters
142  /// before calling this function.
143  ///
144  /// \return
145  /// - AK_Success if initialization was successful.
146  /// - AK_InvalidParameter if one of the settings is invalid.
147  /// - AK_InsufficientMemory if the specified pool size is too small for initialization.
148  /// - AK_Fail for other errors.
149  ///
150  /// \sa
151  /// - \ref initialization_comm
152  /// - AK::Comm::GetDefaultInitSettings()
153  /// - AkCommSettings::Ports
155  const AkCommSettings & in_settings///< Initialization settings.
156  );
157 
158  /// Gets the last error from the OS-specific communication library.
159  /// \return The system error code. Check the code in the platform manufacturer documentation for details about the error.
161 
162  /// Gets the communication module's default initialization settings values.
163  /// \sa
164  /// - \ref initialization_comm
165  /// - AK::Comm::Init()
167  AkCommSettings & out_settings ///< Returned default initialization settings.
168  );
169 
170  /// Terminates the communication module.
171  /// \warning This function must be called before the memory manager is terminated.
172  /// \sa
173  /// - \ref termination_comm
174  AK_EXTERNAPIFUNC( void, Term )();
175 
176  /// Terminates and reinitialize the communication module using current settings.
177  ///
178  /// \return
179  /// - AK_Success if initialization was successful.
180  /// - AK_InvalidParameter if one of the settings is invalid.
181  /// - AK_InsufficientMemory if the specified pool size is too small for initialization.
182  /// - AK_Fail for other errors.
183  ///
184  /// \sa
185  /// - \ref AK::SoundEngine::iOS::WakeupFromSuspend()
187 
188 
189  /// Get the initialization settings currently in use by the CommunicationSystem
190  ///
191  /// \return
192  /// - AK_Success if initialization was successful.
194 
195 
196  /// Get the port currently in used by the command channel.
197  ///
198  /// \return
199  /// - Port number.
201 
202  //@}
203  }
204 }
205 
206 #endif // _AK_COMMUNICATION_H
char szCommProxyServerUrl[AK_COMM_SETTINGS_MAX_URL_SIZE]
Optional URL of Comm proxy server (only applicable for platforms incapable of acting as raw UDP/TCP s...
uint16_t AkUInt16
Unsigned 16-bit integer
Definition of data structures for AkAudioObject
char szAppNetworkName[AK_COMM_SETTINGS_MAX_STRING_SIZE]
#define AK_EXTERNAPIFUNC(_type, _name)
AKRESULT
Standard function call result.
Definition: AkTypes.h:134
AKSOUNDENGINE_API AKRESULT Reset()
AKSOUNDENGINE_API AKRESULT Init(const AkCommSettings &in_settings)
AKSOUNDENGINE_API AkInt32 GetLastError()
int32_t AkInt32
Signed 32-bit integer
AKSOUNDENGINE_API const AkCommSettings & GetCurrentSettings()
AKSOUNDENGINE_API void Term()
#define AK_COMM_SETTINGS_MAX_URL_SIZE
AKSOUNDENGINE_API void GetDefaultInitSettings(AkCommSettings &out_settings)
#define AK_COMM_NO_DYNAMIC_PORTS
Platform does not support dynamic/ephemeral ports for communication
Definition: AkTypes.h:152
AkCommSystem
Allows selecting the communication system used to connect remotely the Authoring tool on the device.
@ AkCommSystem_Last
HTCS when available only, will default to AkCommSystem_Socket if the HTCS system is not available.
AkCommSystem commSystem
@ AkCommSystem_HTCS
The recommended default communication system
#define AK_COMM_SETTINGS_MAX_STRING_SIZE
AKSOUNDENGINE_API AkUInt16 GetCommandPort()
#define AK_COMM_DEFAULT_DISCOVERY_PORT
Default discovery port for most platforms using IP sockets for communication.
Definition: AkTypes.h:1275

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

サポートは必要ですか?

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

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

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

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

Wwiseからはじめよう