VANetNetworkProtocol.h 39.6 KB
Newer Older
Jonas Stienen's avatar
Jonas Stienen committed
1
/*
2
 *  --------------------------------------------------------------------------------------------
Jonas Stienen's avatar
Jonas Stienen committed
3
 *
4
5
6
7
8
9
 *    VVV        VVV A           Virtual Acoustics (VA) | http://www.virtualacoustics.org
 *     VVV      VVV AAA          Licensed under the Apache License, Version 2.0
 *      VVV    VVV   AAA
 *       VVV  VVV     AAA        Copyright 2015-2017
 *        VVVVVV       AAA       Institute of Technical Acoustics (ITA)
 *         VVVV         AAA      RWTH Aachen University
Jonas Stienen's avatar
Jonas Stienen committed
10
 *
11
 *  --------------------------------------------------------------------------------------------
Jonas Stienen's avatar
Jonas Stienen committed
12
 */
13

14
15
#ifndef IW_VANET_NETWORK_PROTOCOL
#define IW_VANET_NETWORK_PROTOCOL
Jonas Stienen's avatar
Jonas Stienen committed
16

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
17
#include <VA.h>
Jonas Stienen's avatar
Jonas Stienen committed
18
19
20
21
22
23
24
25
26
27
#include <VANetDefinitions.h>

#include "VANetVistaCompatibility.h"

#include <VistaInterProcComm/Connections/VistaByteBufferSerializer.h>
#include <VistaInterProcComm/Connections/VistaByteBufferDeSerializer.h>

#include <list>
#include <string>

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
28
class CVAEvent;
Jonas Stienen's avatar
Jonas Stienen committed
29
class CVAException;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
30
class IVAEventHandler;
Jonas Stienen's avatar
Jonas Stienen committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class CVANetServerImpl;
class CVANetClientImpl;
class CVANetMessage;

class VistaConnectionIP;

/**
 * Basic implementation - non-threadsafe.
 *
 * This class implements the VA network protocol.
 *
 * The class defines the network package structure
 * and provides the necessary serialization and
 * deserialization.
 *
 * Instances of the class can only be used with one
 * purpose - either serializer and deserializer.
 *
 */
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
50
51
class CVANetNetworkProtocol
{
Jonas Stienen's avatar
Jonas Stienen committed
52
public:
53
54
	static const int VA_NET_PROTOCOL_VERSION_MAJOR = 2;
	static const int VA_NET_PROTOCOL_VERSION_MINOR = 0;
Jonas Stienen's avatar
Jonas Stienen committed
55
56
57
58
59
60
61

	/**
	 * Method identifier
	 *
	 * >>> ATTENTION!!! Never change these assignments or you end up in tears! <<<
	 */

62
	static const int VA_NP_INVALID = -1;
Jonas Stienen's avatar
Jonas Stienen committed
63

64
	static const int VA_NP_GET_VERSION_INFO = 0;
Jonas Stienen's avatar
Jonas Stienen committed
65
66

	// Base functions
67
68
69
70
	static const int VA_NP_GET_STATE = 100;
	static const int VA_NP_INITIALIZE = 101;
	static const int VA_NP_FINALIZE = 102;
	static const int VA_NP_RESET = 103;
Jonas Stienen's avatar
Jonas Stienen committed
71
72

	// Event handling   
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
73
74
	static const int VA_NP_ATTACH_EVENT_HANDLER = 201;
	static const int VA_NP_DETACH_EVENT_HANDLER = 202;
Jonas Stienen's avatar
Jonas Stienen committed
75
76

	// Module interface
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
77
	static const int VA_NP_GET_MODULES = 221;
78
	static const int VA_NP_CALL_MODULE = 222;
79
	static const int VA_NP_GET_SEARCH_PATHS = 230;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
80
	static const int VA_NP_FIND_FILE_PATH = 231;
81
82
83
	static const int VA_NP_GET_CORE_CONFIGURATION = 232;
	static const int VA_NP_GET_HARDWARE_CONFIGURATION = 233;
	static const int VA_NP_GET_FILE_LIST = 234;
84

Jonas Stienen's avatar
Jonas Stienen committed
85
	// Directivities
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
86
87
	static const int VA_NP_CREATE_DIRECTIVITY = 300;
	static const int VA_NP_DELETE_DIRECTIVITY = 301;
88
89
	static const int VA_NP_GET_DIRECTIVITY_INFO = 302;
	static const int VA_NP_GET_DIRECTIVITY_INFOS = 303;
90
91
92
93
	static const int VA_NP_GET_DIRECTIVITY_PARAMETERS = 304;
	static const int VA_NP_SET_DIRECTIVITY_PARAMETERS = 305;
	static const int VA_NP_GET_DIRECTIVITY_NAME = 306;
	static const int VA_NP_SET_DIRECTIVITY_NAME = 307;
94

Jonas Stienen's avatar
Jonas Stienen committed
95
	// Signal sources
96
97
98
	static const int VA_NP_GET_SIGNALSOURCE_INFO = 600;
	static const int VA_NP_GET_SIGNALSOURCE_INFOS = 601;
	static const int VA_NP_DELETE_SIGNALSOURCE = 602;
99
	static const int VA_NP_GET_SIGNAL_SOURCE_PARAMETERS = 603;
100
	static const int VA_NP_SET_SIGNALSOURCE_PARAMETERS = 604;
Jonas Stienen's avatar
Jonas Stienen committed
101

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
102
	static const int VA_NP_CREATE_SIGNAL_SOURCE_BUFFER_FROM_PARAMETERS = 610;
103
104
105
106
107
	static const int VA_NP_GET_SIGNAL_SOURCE_BUFFER_PLAYBACK_STATE = 611;
	static const int VA_NP_SET_SIGNAL_SOURCE_BUFFER_PLAYBACK_ACTION = 612;
	static const int VA_NP_SET_SIGNAL_SOURCE_BUFFER_PLAYBACK_POSITION = 613;
	static const int VA_NP_GET_SIGNAL_SOURCE_BUFFER_LOOPING = 614;
	static const int VA_NP_SET_SIGNAL_SOURCE_BUFFER_LOOPING = 615;
Jonas Stienen's avatar
Jonas Stienen committed
108

109
	static const int VA_NP_CREATE_SIGNAL_SOURCE_SEQUENCER = 620;
110
111
112
	static const int VA_NP_ADD_SIGNAL_SOURCE_SEQUENCER_SAMPLE = 621;
	static const int VA_NP_ADD_SIGNAL_SOURCE_SEQUENCER_PLAYBACK = 622;
	static const int VA_NP_REMOVE_SIGNAL_SOURCE_SEQUENCER_SAMPLE = 623;
Jonas Stienen's avatar
Jonas Stienen committed
113

114
	static const int VA_NP_CREATE_SIGNAL_SOURCE_NETWORK_STREAM = 630;
Jonas Stienen's avatar
Jonas Stienen committed
115

116
	static const int VA_NP_CREATE_SIGNAL_SOURCE_ENGINE = 640;
Jonas Stienen's avatar
Jonas Stienen committed
117

118
	static const int VA_NP_CREATE_SIGNAL_SOURCE_MACHINE = 650;
119

120
	static const int VA_NP_CREATE_SIGNAL_SOURCE_TEXT_TO_SPEECH = 660;
Jonas Stienen's avatar
Jonas Stienen committed
121
122

	// Synchronization functions
123
124
125
	static const int VA_NP_LOCK_UPDATE = 700;
	static const int VA_NP_UNLOCK_UPDATE = 701;
	static const int VA_NP_GET_UPDATE_LOCKED = 702;
Jonas Stienen's avatar
Jonas Stienen committed
126
127

	// Sound sources
128
	static const int VA_NP_GET_SOUND_SOURCE_IDS = 800;
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
	static const int VA_NP_CREATE_SOUND_SOURCE = 801;
	static const int VA_NP_CREATE_SOUND_SOURCE_EXPLICIT_RENDERER = 831;
	static const int VA_NP_DELETE_SOUND_SOURCE = 802;
	static const int VA_NP_SET_SOUND_SOURCE_NAME = 803;
	static const int VA_NP_GET_SOUND_SOURCE_NAME = 804;
	static const int VA_NP_SET_SOUND_SOURCE_SIGNALSOURCE = 805;
	static const int VA_NP_GET_SOUND_SOURCE_SIGNALSOURCE = 806;
	static const int VA_NP_SET_SOUND_SOURCE_AURAMODE = 807;
	static const int VA_NP_GET_SOUND_SOURCE_AURAMODE = 808;
	static const int VA_NP_SET_SOUND_SOURCE_DIRECTIVITY = 809;
	static const int VA_NP_GET_SOUND_SOURCE_DIRECTIVITY = 810;
	static const int VA_NP_SET_SOUND_SOURCE_SOUND_POWER = 811;
	static const int VA_NP_GET_SOUND_SOURCE_SOUND_POWER = 812;
	static const int VA_NP_GET_SOUND_SOURCE_MUTED = 813;
	static const int VA_NP_SET_SOUND_SOURCE_MUTED = 814;
	static const int VA_NP_SET_SOUND_SOURCE_POSE = 819;
	static const int VA_NP_GET_SOUND_SOURCE_POSE = 820;
	static const int VA_NP_SET_SOUND_SOURCE_POSITION = 815;
	static const int VA_NP_GET_SOUND_SOURCE_POSITION = 816;
	static const int VA_NP_SET_SOUND_SOURCE_ORIENTATION = 821;
	static const int VA_NP_GET_SOUND_SOURCE_ORIENTATION = 822;
	static const int VA_NP_SET_SOUND_SOURCE_ORIENTATION_VU = 817;
	static const int VA_NP_GET_SOUND_SOURCE_ORIENTATION_VU = 818;
	static const int VA_NP_SET_SOUND_SOURCE_PARAMETERS = 829;
	static const int VA_NP_GET_SOUND_SOURCE_PARAMETERS = 830;
	static const int VA_NP_SET_SOUND_SOURCE_ENABLED = 832;
	static const int VA_NP_GET_SOUND_SOURCE_ENABLED = 833;
156
	static const int VA_NP_GET_SOUND_SOURCE_INFO = 834;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
157
	static const int VA_NP_GET_SOUND_SOURCE_GEOMETRY_MESH = 835;
158
	static const int VA_NP_SET_SOUND_SOURCE_GEOMETRY_MESH = 836;
Jonas Stienen's avatar
Jonas Stienen committed
159

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
160
	// Sound receivers
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
	static const int VA_NP_GET_SOUND_RECEIVER_IDS = 900;
	static const int VA_NP_CREATE_SOUND_RECEIVER = 901;
	static const int VA_NP_DELETE_SOUND_RECEIVER = 902;
	static const int VA_NP_GET_SOUND_RECEIVER_NAME = 903;
	static const int VA_NP_SET_SOUND_RECEIVER_NAME = 904;
	static const int VA_NP_GET_SOUND_RECEIVER_AURALIZATION_MODE = 905;
	static const int VA_NP_SET_SOUND_RECEIVER_AURALIZATION_MODE = 906;
	static const int VA_NP_GET_SOUND_RECEIVER_DIRECTIVITY = 907;
	static const int VA_NP_SET_SOUND_RECEIVER_DIRECTIVITY = 908;
	static const int VA_NP_SET_SOUND_RECEIVER_POSE = 919;
	static const int VA_NP_GET_SOUND_RECEIVER_POSE = 920;
	static const int VA_NP_SET_SOUND_RECEIVER_POSITION = 915;
	static const int VA_NP_GET_SOUND_RECEIVER_POSITION = 916;
	static const int VA_NP_SET_SOUND_RECEIVER_ORIENTATION = 921;
	static const int VA_NP_GET_SOUND_RECEIVER_ORIENTATION = 922;
	static const int VA_NP_SET_SOUND_RECEIVER_ORIENTATION_VU = 917;
	static const int VA_NP_GET_SOUND_RECEIVER_ORIENTATION_VU = 918;
	static const int VA_NP_GET_SOUND_RECEIVER_PARAMETERS = 925;
	static const int VA_NP_SET_SOUND_RECEIVER_PARAMETERS = 926;
	static const int VA_NP_SET_SOUND_RECEIVER_ENABLED = 927;
	static const int VA_NP_GET_SOUND_RECEIVER_ENABLED = 928;
182
183
184
185
186
187
188
189
	static const int VA_NP_GET_SOUND_RECEIVER_HEAD_ABOVE_TORSO_ORIENTATION = 929;
	static const int VA_NP_SET_SOUND_RECEIVER_HEAD_ABOVE_TORSO_ORIENTATION = 930;
	static const int VA_NP_GET_SOUND_RECEIVER_REAL_WORLD_POSITION_ORIENTATION_VU = 931;
	static const int VA_NP_SET_SOUND_RECEIVER_REAL_WORLD_POSITION_ORIENTATION_VU = 932;
	static const int VA_NP_GET_SOUND_RECEIVER_GEOMETRY_MESH = 933;
	static const int VA_NP_SET_SOUND_RECEIVER_GEOMETRY_MESH = 934;
	static const int VA_NP_GET_SOUND_RECEIVER_REAL_WORLD_POSE = 935;
	static const int VA_NP_SET_SOUND_RECEIVER_REAL_WORLD_POSE = 936;
190
191
	static const int VA_NP_GET_SOUND_RECEIVER_REAL_WORLD_TORSO_ORIENTATION = 937;
	static const int VA_NP_SET_SOUND_RECEIVER_REAL_WORLD_TORSO_ORIENTATION = 938;
192
	static const int VA_NP_GET_SOUND_RECEIVER_INFO = 939;
193
	static const int VA_NP_CREATE_SOUND_RECEIVER_EXPLICIT_RENDERER = 940;
194
195


Jonas Stienen's avatar
Jonas Stienen committed
196
197

	// Scene
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
198
199
	static const int VA_NP_SCENE_CREATE = 1000;
	static const int VA_NP_GET_SCENE_IDS = 1001;
200
	static const int VA_NP_GET_SCENE_INFO = 1002;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
201
202
203
204
205
	static const int VA_NP_GET_SCENE_NAME = 1003;
	static const int VA_NP_SET_SCENE_NAME = 1004;
	static const int VA_NP_GET_SCENE_ENABLED = 1005;
	static const int VA_NP_SET_SCENE_ENABLED = 1006;

206
	// Portals
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
	static const int VA_NP_CREATE_SOUND_PORTAL = 1600;
	static const int VA_NP_GET_SOUND_PORTAL_IDS = 1601;
	static const int VA_NP_GET_SOUND_PORTAL_NAME = 1602;
	static const int VA_NP_SET_SOUND_PORTAL_NAME = 1603;
	static const int VA_NP_GET_SOUND_PORTAL_PARAMETERS = 1604;
	static const int VA_NP_SET_SOUND_PORTAL_PARAMETERS = 1605;
	static const int VA_NP_GET_SOUND_PORTAL_POSITION = 1606;
	static const int VA_NP_SET_SOUND_PORTAL_POSITION = 1607;
	static const int VA_NP_GET_SOUND_PORTAL_ORIENTATION = 1608;
	static const int VA_NP_SET_SOUND_PORTAL_ORIENTATION = 1609;
	static const int VA_NP_GET_SOUND_PORTAL_ENABLED = 1610;
	static const int VA_NP_SET_SOUND_PORTAL_ENABLED = 1611;
	static const int VA_NP_GET_SOUND_PORTAL_MATERIAL = 1612;
	static const int VA_NP_SET_SOUND_PORTAL_MATERIAL = 1613;
	static const int VA_NP_GET_SOUND_PORTAL_NEXT_SOUND_PORTAL = 1614;
	static const int VA_NP_SET_SOUND_PORTAL_NEXT_SOUND_PORTAL = 1615;
	static const int VA_NP_GET_SOUND_PORTAL_SOUND_SOURCE = 1616;
	static const int VA_NP_SET_SOUND_PORTAL_SOUND_SOURCE = 1617;
	static const int VA_NP_GET_SOUND_PORTAL_SOUND_RECEIVER = 1618;
	static const int VA_NP_SET_SOUND_PORTAL_SOUND_RECEIVER = 1619;
227
	static const int VA_NP_GET_SOUND_PORTAL_INFO = 1620;
Jonas Stienen's avatar
Jonas Stienen committed
228

229
	// Geometry meshes
230
231
232
233
234
235
236
237
238
239
240
241
	static const int VA_NP_CREATE_GEOMETRY_MESH = 1700;
	static const int VA_NP_CREATE_GEOMETRY_MESH_FROM_PARAMETERS = 1701;
	static const int VA_NP_DELETE_GEOMETRY_MESH = 1702;
	static const int VA_NP_GET_GEOMETRY_MESH = 1703;
	static const int VA_NP_GET_GEOMETRY_MESH_IDS = 1704;
	static const int VA_NP_GET_GEOMETRY_MESH_PARAMETERS = 1705;
	static const int VA_NP_SET_GEOMETRY_MESH_PARAMETERS = 1706;
	static const int VA_NP_GET_GEOMETRY_MESH_NAME = 1707;
	static const int VA_NP_SET_GEOMETRY_MESH_NAME = 1708;
	static const int VA_NP_GET_GEOMETRY_MESH_ENABLED = 1709;
	static const int VA_NP_SET_GEOMETRY_MESH_ENABLED = 1710;

242
	// Acoustic materials
243
244
245
	static const int VA_NP_CREATE_ACOUSTIC_MATERIAL = 1400;
	static const int VA_NP_CREATE_ACOUSTIC_MATERIAL_FROM_PARAMETERS = 1401;
	static const int VA_NP_DELETE_ACOUSTIC_MATERIAL = 1402;
246
247
248
249
250
251
	static const int VA_NP_GET_ACOUSTIC_MATERIAL_INFO = 1403;
	static const int VA_NP_GET_ACOUSTIC_MATERIAL_INFOS = 1405;
	static const int VA_NP_GET_ACOUSTIC_MATERIAL_NAME = 1406;
	static const int VA_NP_SET_ACOUSTIC_MATERIAL_NAME = 1407;
	static const int VA_NP_GET_ACOUSTIC_MATERIAL_PARAMETERS = 1408;
	static const int VA_NP_SET_ACOUSTIC_MATERIAL_PARAMETERS = 1409;
252

253
	// Medium
254
255
256
257
258
259
260
261
262
263
264
265
266
	static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_SOUND_SPEED = 1500;
	static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_SOUND_SPEED = 1501;
	static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_TEMPERATURE = 1502;
	static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_TEMPERATURE = 1503;
	static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_STATIC_PRESSURE = 1504;
	static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_STATIC_PRESSURE = 1505;
	static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_RELATIVE_HUMIDITY = 1506;
	static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_RELATIVE_HUMIDITY = 1507;
	static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_SHIFT_SPEED = 1508;
	static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_SHIFT_SPEED = 1509;
	static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_PARAMETERS = 1510;
	static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_PARAMETERS = 1511;

267
	// Control
268
269
	static const int VA_NP_GET_INPUT_GAIN = 1100;
	static const int VA_NP_SET_INPUT_GAIN = 1101;
270
	static const int VA_NP_GET_INPUT_MUTED = 1102;
271
272
273
	static const int VA_NP_SET_INPUT_MUTED = 1103;
	static const int VA_NP_GET_OUTPUT_GAIN = 1104;
	static const int VA_NP_SET_OUTPUT_GAIN = 1105;
274
	static const int VA_NP_GET_OUTPUT_MUTED = 1106;
275
276
277
	static const int VA_NP_SET_OUTPUT_MUTED = 1107;
	static const int VA_NP_GET_GLOBAL_AURALIZATION_MODE = 1108;
	static const int VA_NP_SET_GLOBAL_AURALIZATION_MODE = 1109;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
278
279
	static const int VA_NP_GET_ACTIVE_SOUND_RECEIVER = 1110;
	static const int VA_NP_SET_ACTIVE_SOUND_RECEIVER = 1111;
280
281
282
	static const int VA_NP_GET_CORE_CLOCK = 1112;
	static const int VA_NP_SET_CORE_CLOCK = 1113;
	static const int VA_NP_SUBSTITUTE_MACROS = 1114;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
283
284
	static const int VA_NP_GET_ACTIVE_SOUND_RECEIVER_EXPLICIT_RENDERER = 1115;
	static const int VA_NP_SET_ACTIVE_SOUND_RECEIVER_EXPLICIT_RENDERER = 1116;
Jonas Stienen's avatar
Jonas Stienen committed
285

286
	// Renderers
287
288
	static const int VA_NP_RENDERER_GET_INFOS = 1200;
	static const int VA_NP_RENDERER_SET_MUTED = 1201;
289
	static const int VA_NP_RENDERER_GET_MUTED = 1202;
290
291
	static const int VA_NP_RENDERER_GET_GAIN = 1203;
	static const int VA_NP_RENDERER_SET_GAIN = 1204;
292
293
294
295
	static const int VA_NP_RENDERER_GET_AURALIZATION_MODE = 1205;
	static const int VA_NP_RENDERER_SET_AURALIZATION_MODE = 1206;
	static const int VA_NP_RENDERER_GET_PARAMETERS = 1207;
	static const int VA_NP_RENDERER_SET_PARAMETERS = 1208;
Jonas Stienen's avatar
Jonas Stienen committed
296

297
	// Reproductions
298
299
	static const int VA_NP_REPRODUCTION_GET_INFOS = 1300;
	static const int VA_NP_REPRODUCTION_SET_MUTED = 1301;
300
	static const int VA_NP_REPRODUCTION_GET_MUTED = 1302;
301
302
	static const int VA_NP_REPRODUCTION_GET_GAIN = 1303;
	static const int VA_NP_REPRODUCTION_SET_GAIN = 1304;
303
304
	static const int VA_NP_REPRODUCTION_GET_PARAMETERS = 1305;
	static const int VA_NP_REPRODUCTION_SET_PARAMETERS = 1306;
Jonas Stienen's avatar
Jonas Stienen committed
305
306

	// Internally used literals
307
308
	static const int VA_NP_SPECIAL_BUFFERED_MESSAGE = 42001;
	static const int VA_NP_SPECIAL_CLIENT_EVENT = 42002;
Jonas Stienen's avatar
Jonas Stienen committed
309

310
311
312
	static const int VA_NP_SPECIAL_ANSWER = 42003;
	static const int VA_NP_SPECIAL_EXCEPTION = 42004;
	static const int VA_NP_SPECIAL_NO_EXCEPTION = 42005;
Jonas Stienen's avatar
Jonas Stienen committed
313
314


315
316
317
318
	static const int VA_NET_CLIENT_CLOSE = -1001;
	static const int VA_NET_SERVER_CLOSE = -1002;
	static const int VA_NET_SERVER_RESET = -1003;
	static const int VA_NET_SERVER_DISCONNECT = -1004;
Jonas Stienen's avatar
Jonas Stienen committed
319

320
321
322
323
	static const int VA_EVENT_FAIL = 0;
	static const int VA_EVENT_CORE_EVENT = 1;
	static const int VA_EVENT_PROGRESS_UPDATE = 2;
	static const int VA_EVENT_NET_EVENT = 3;
Jonas Stienen's avatar
Jonas Stienen committed
324

325
	static const int VA_NO_EXCEPTION_INDICATOR = -31415926;
Jonas Stienen's avatar
Jonas Stienen committed
326
327
328

public:
	CVANetNetworkProtocol();
329
	~CVANetNetworkProtocol();
330

Jonas Stienen's avatar
Jonas Stienen committed
331
	bool InitializeAsServer( CVANetServerImpl* pServer );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
332
	void SetRealVACore( IVAInterface* pRealCore );
Jonas Stienen's avatar
Jonas Stienen committed
333

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
334
	bool InitializeAsClient( CVANetClientImpl* pServer, VistaConnectionIP* m_pCommandChannel, VistaConnectionIP* m_pHeadChannel, const int iExceptionhandlingmode, const bool m_bBufferSynchronisedModification );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
335

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
336
337
	int ClientProcessEventMessageFromServer( VistaConnectionIP* pConnection, std::list<IVAEventHandler*> liCoreEventHandler );
	void ServerCallFunctionByMessageType( const int nMessageType, VistaConnectionIP* pConnection );
338
	bool ProcessMessageFromClient( VistaConnectionIP* pAnswerConnection );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
339
	void ServerPrepareEventMessage( const CVAEvent* pEvent, CVANetMessage* pMessage );
Jonas Stienen's avatar
Jonas Stienen committed
340
341

	// for client side only
342
343
	void SetExceptionHandlingMode( const int nMode );
	int GetExceptionHandlingMode() const;
Jonas Stienen's avatar
Jonas Stienen committed
344

345
346
	bool GetBufferSynchronisedModification() const;
	void SetBufferSynchronisedModifications( const bool bSet );
Jonas Stienen's avatar
Jonas Stienen committed
347

348
349
	void HandleConnectionClose( VistaConnectionIP* pConnection );

Jonas Stienen's avatar
Jonas Stienen committed
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
private:
	enum MESSAGE_MODE
	{
		// Command Message will return an answer
		// all exceptions that occur will always be transmitted over network
		MESSAGE_WITH_ANSWER,

		// Command Message does not an return answer (no return value)
		// all exceptions that occur will always be transmitted over network
		MESSAGE_ENFORCED_EXCEPTION,

		// Command Message does not an return answer (no return value)
		// exceptions that occur will only be transmitted if the user requests
		// it on client side (configurable)
		MESSAGE_CONDITIONAL_EXCEPTION,

		// Command Message does not return an answer (no return value),
		// and also allows buffering between Begin- and End-Synchronised-Modification 
		// (if the appropriate buffering flag is set on the client).
		// All exceptions will only be transmitted if the user requests
		// it on client-side (configurable), or after the EndSynchronisedModification call
		MESSAGE_ALLOWS_BUFFERING,

		// Note: Any function that has a return value, cannot be buffered and
		//       any exceptions will be transmitted automatically.
	};

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
377
	CVANetMessage* ClientInitMessage( const int nCommanId, MESSAGE_MODE eMessageMode );
Jonas Stienen's avatar
Jonas Stienen committed
378
379
380
381
382
383
384
385
386
387
388
389
390
391
	void ClientSendCommand( CVANetMessage* pMessage );

	CVANetMessage* ServerGetMessage();
	void ServerSendAnswer( CVANetMessage* pMessage );

	void ClientPrepareMessageBuffering();
	int ClientEndMessageBuffering();

public:

	/**
	 * Client/Server actions for individual requests
	 */

392
393
394
395
396
397
	void ClientGetVersionInfo( CVAVersionInfo* pVersionInfo );
	void ServerGetVersionInfo();
	void ClientAttachEventHandler();
	void ServerAttachEventHandler( VistaConnectionIP* pConn );
	void ClientDetachEventHandler();
	void ServerDetachEventHandler( VistaConnectionIP* pConn );
Jonas Stienen's avatar
Jonas Stienen committed
398

399
400
	int ClientGetState();
	void ServerGetState();
Jonas Stienen's avatar
Jonas Stienen committed
401

402
403
	void ClientInitialize();
	void ServerInitialize();
Jonas Stienen's avatar
Jonas Stienen committed
404

405
406
	void ClientFinalize();
	void ServerFinalize();
Jonas Stienen's avatar
Jonas Stienen committed
407

408
409
	void ClientReset();
	void ServerReset();
Jonas Stienen's avatar
Jonas Stienen committed
410

411
412
	void ClientGetModules( std::vector< CVAModuleInfo >& m_viModuleInfos );
	void ServerGetModules();
Jonas Stienen's avatar
Jonas Stienen committed
413

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
414
415
416
	CVAStruct ClientGetSearchPaths();
	void ServerGetSearchPaths();

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
417
	std::string ClientFindFilePath( const std::string& sFilePath );
418
	void ServerFindFilePath();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
419

420
421
	CVAStruct ClientGetCoreConfiguration( const bool bFilterEnabled = true );
	void ServerGetCoreConfiguration();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
422
	CVAStruct ClientGetHardwareConfiguration();
423
424
425
426
	void ServerGetHardwareConfiguration();
	CVAStruct ClientGetFileList( const bool bRecursive = true, const std::string& sSuffixFilter = "*" );
	void ServerGetFileList();

427
428
	CVAStruct ClientCallModule( const std::string& sModuleName, const CVAStruct& oArgs );
	void ServerCallModule();
Jonas Stienen's avatar
Jonas Stienen committed
429

430
431
	int ClientCreateDirectivityFromParameters( const CVAStruct& oParams, const std::string& sName = "" );
	void ServerCreateDirectivityFromParameters();
Jonas Stienen's avatar
Jonas Stienen committed
432

433
434
	bool ClientDeleteDirectivity( const int iID );
	void ServerDeleteDirectivity();
Jonas Stienen's avatar
Jonas Stienen committed
435

436
437
	CVADirectivityInfo ClientGetDirectivityInfo( const int iID );
	void ServerGetDirectivityInfo();
Jonas Stienen's avatar
Jonas Stienen committed
438

439
440
	void ClientGetDirectivityInfos( std::vector<CVADirectivityInfo>& vdiDest );
	void ServerGetDirectivityInfos();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
441

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
442
443
444
445
446
	void ClientSetDirectivityName( const int iID, const std::string& sName );
	void ServerSetDirectivityName();
	std::string ClientGetDirectivityName( const int iID );
	void ServerGetDirectivityName();

447
448
449
450
	CVAStruct ClientGetDirectivityParameters( const int iID, const CVAStruct& oParams );
	void ServerGetDirectivityParameters();
	void ClientSetDirectivityParameters( const int iID, const CVAStruct& oParams );
	void ServerSetDirectivityParameters();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
451
452


453
454
	std::string ClientCreateSignalSourceBufferFromParameters( const CVAStruct& oParams, const std::string& sName = "" );
	void ServerCreateSignalSourceBufferFromParameters();
455

456
457
	std::string ClientCreateTextToSpeechSignalSource( const std::string& sName = "" );
	void ServerCreateTextToSpeechSignalSource();
458

459
460
	std::string ClientCreateSequencerSignalSource( const std::string& sName = "" );
	void ServerCreateSequencerSignalSource();
461

462
463
	std::string ClientCreateNetworkStreamSignalSource( const std::string& sInterface, int iPort, const std::string& sName = "" );
	void ServerCreateNetworkStreamSignalSource();
Jonas Stienen's avatar
Jonas Stienen committed
464

465
466
	std::string ClientCreateEngineSignalSource( const CVAStruct& oParams, const std::string& sName = "" );
	void ServerCreateEngineSignalSource();
Jonas Stienen's avatar
Jonas Stienen committed
467

468
469
	std::string ClientCreateSignalSourceMachine( const CVAStruct& oParams, const std::string& sName = "" );
	void ServerCreateSignalSourceMachine();
Jonas Stienen's avatar
Jonas Stienen committed
470

471
472
	bool ClientDeleteSignalSource( const std::string& sID );
	void ServerDeleteSignalSource();
Jonas Stienen's avatar
Jonas Stienen committed
473

474
475
476
477
	CVASignalSourceInfo ClientGetSignalSourceInfo( const std::string& sSignalSourceID );
	void ServerGetSignalSourceInfo();
	void ClientGetSignalSourceInfos( std::vector< CVASignalSourceInfo >& vssiDest );
	void ServerGetSignalSourceInfos();
Jonas Stienen's avatar
Jonas Stienen committed
478

479
480
	int ClientGetSignalSourceBufferPlaybackState( const std::string& sSignalSourceID );
	void ServerGetSignalSourceBufferPlaybackState();
Jonas Stienen's avatar
Jonas Stienen committed
481

482
483
	void ClientSetSignalSourceBufferPlaybackAction( const std::string& sSignalSourceID, const int iPlayState );
	void ServerSetSignalSourceBufferPlaybackAction();
Jonas Stienen's avatar
Jonas Stienen committed
484

485
486
	void ClientSetSignalSourceBufferPlaybackPosition( const std::string& sSignalSourceID, const double dPlaybackPosition );
	void ServerSetAudiofileSignalSourcePlaybackPosition();
Jonas Stienen's avatar
Jonas Stienen committed
487

488
489
490
491
	bool ClientGetSignalSourceBufferLooping( const std::string& );
	void ServerGetSignalSourceBufferLooping();
	void ClientSetSignalSourceBufferLooping( const std::string&, const bool bLoopingEnabled );
	void ServerSetSignalSourceBufferLooping();
Jonas Stienen's avatar
Jonas Stienen committed
492

493
494
495
496
	void ClientSetSignalSourceParameters( const std::string& sSignalSourceID, const CVAStruct& oParams );
	void ServerSetSignalSourceParameters();
	CVAStruct ClientGetSignalSourceParameters( const std::string& sSignalSourceID, const CVAStruct& oParams );
	void ServerGetSignalSourceParameters();
Jonas Stienen's avatar
Jonas Stienen committed
497

498
499
	int ClientAddSignalSourceSequencerSample( const std::string& sSignalSourceID, const CVAStruct& oArgs );
	void ServerAddSignalSourceSequencerSample();
500
501
502
503
504
	int ClientAddSignalSourceSequencerPlayback( const std::string& sSignalSourceID, const int iSoundID, const int iFlags, const double dTimeCode );
	void ServerAddSignalSourceSequencerPlayback();
	void ClientRemoveSignalSourceSequencerSample( const std::string& sSignalSourceID, const int iSoundID );
	void ServerRemoveSignalSourceSequencerSample();

Jonas Stienen's avatar
Jonas Stienen committed
505

506
507
	void ClientLockUpdate();
	void ServerLockUpdate();
508

509
510
	int ClientUnlockUpdate();
	void ServerUnlockUpdate();
Jonas Stienen's avatar
Jonas Stienen committed
511

512
513
	bool ClientGetUpdateLocked();
	void ServerGetUpdateLocked();
Jonas Stienen's avatar
Jonas Stienen committed
514
515


516
517
	void ClientGetSoundSourceIDs( std::vector<  int >& vSoundSourceIDs );
	void ServerGetSoundSourceIDs();
Jonas Stienen's avatar
Jonas Stienen committed
518

519
520
	int ClientCreateSoundSource( const std::string& sName );
	void ServerCreateSoundSource();
Jonas Stienen's avatar
Jonas Stienen committed
521

522
523
	int ClientCreateSoundSourceExplicitRenderer( const std::string& sRendererID, const std::string& sName );
	void ServerCreateSoundSourceExplicitRenderer();
Jonas Stienen's avatar
Jonas Stienen committed
524

525
526
	int ClientDeleteSoundSource( const int iID );
	void ServerDeleteSoundSource();
527

528
529
530
531
	void ClientSetSoundSourceEnabled( const int iID, const bool bEnabled );
	void ServerSetSoundSourceEnabled();
	bool ClientGetSoundSourceEnabled( const int iID );
	void ServerGetSoundSourceEnabled();
Jonas Stienen's avatar
Jonas Stienen committed
532

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
533
534
535
	CVASoundSourceInfo ClientGetSoundSourceInfo( const int iID );
	void ServerGetSoundSourceInfo();

536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
	std::string ClientGetSoundSourceName( const int iSoundSourceID );
	void ServerGetSoundSourceName();
	void ClientSetSoundSourceName( const int iSoundSourceID, const std::string& sName );
	void ServerSetSoundSourceName();

	std::string ClientGetSoundSourceSignalSource( const int iSoundSourceID );
	void ServerGetSoundSourceSignalSource();
	void ClientSetSoundSourceSignalSource( const int iSoundSourceIDconst, const std::string& sSignalSourceID );
	void ServerSetSoundSourceSignalSource();

	int ClientGetSoundSourceAuralizationMode( const int iSoundSourceID );
	void ServerGetSoundSourceAuralizationMode();
	void ClientSetSoundSourceAuralizationMode( const int iSoundSourceID, const int iAuralizationMode );
	void ServerSetSoundSourceAuralizationMode();

	void ClientSetSoundSourceParameters( const int iID, const CVAStruct& oParams );
	void ServerSetSoundSourceParameters();
	CVAStruct ClientGetSoundSourceParameters( const int iID, const CVAStruct& oArgs );
	void ServerGetSoundSourceParameters();

	int ClientGetSoundSourceDirectivity( const int iSoundSourceID );
	void ServerGetSoundSourceDirectivity();
	void ClientSetSoundSourceDirectivity( const int iSoundSourceID, const int iDirectivityID );
	void ServerSetSoundSourceDirectivity();

	double ClientGetSoundSourceSoundPower( const int iSoundSourceID );
	void ServerGetSoundSourceSoundPower();
	void ClientSetSoundSourceSoundPower( const int iSoundSourceID, const double dPower );
	void ServerSetSoundSourceSoundPower();

	bool ClientGetSoundSourceMuted( const int iSoundSourceID );
	void ServerGetSoundSourceMuted();
	void ClientSetSoundSourceMuted( const int iSoundSourceID, const bool bMuted );
	void ServerSetSoundSourceMuted();

	void ClientGetSoundSourcePose( const int iSoundSourceID, VAVec3& vPos, VAQuat& qOrient );
	void ServerGetSoundSourcePose();
	void ClientSetSoundSourcePose( const int iSoundSourceID, const VAVec3& vPos, const VAQuat& qOrient );
	void ServerSetSoundSourcePose();

	VAVec3 ClientGetSoundSourcePosition( const int iSoundSourceID );
	void ServerGetSoundSourcePosition();
	void ClientSetSoundSourcePosition( const int iID, const VAVec3& v3Pos );
	void ServerSetSoundSourcePosition();

	VAQuat ClientGetSoundSourceOrientation( const int iSoundSourceID );
	void ServerGetSoundSourceOrientation();
	void ClientSetSoundSourceOrientation( const int iID, const VAQuat& qOrient );
	void ServerSetSoundSourceOrientation();

	void ClientGetSoundSourceOrientationVU( const int iSoundSourceID, VAVec3& v3View, VAVec3& v3Up );
	void ServerGetSoundSourceOrientationVU();
	void ClientSetSoundSourceOrientationVU( const int iID, const VAVec3& v3View, const VAVec3& v3Up );
	void ServerSetSoundSourceOrientationVU();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
590
591
592
593
594

	int ClientGetSoundSourceGeometryMesh( const int iID );
	void ServerGetSoundSourceGeometryMesh();
	void ClientSetSoundSourceGeometryMesh( const int iSoundSourceID, const int iGeometryMeshID );
	void ServerSetSoundSourceGeometryMesh();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
595

Jonas Stienen's avatar
Jonas Stienen committed
596

597
598
	void ClientGetSoundReceiverIDs( std::vector<int>& viIDs );
	void ServerGetSoundReceiverIDs();
Jonas Stienen's avatar
Jonas Stienen committed
599

600
601
602
603
	int ClientCreateSoundReceiver( const std::string& sName );
	void ServerCreateSoundReceiver();
	int ClientCreateSoundReceiverExplicitRenderer( const std::string& sRendererID, const std::string& sName );
	void ServerCreateSoundReceiverExplicitRenderer();
Jonas Stienen's avatar
Jonas Stienen committed
604

605
606
	int ClientDeleteSoundReceiver( const int iID );
	void ServerDeleteSoundReceiver();
607
608
	CVASoundReceiverInfo ClientGetSoundReceiverInfo( const int iID );
	void ServerGetSoundReceiverInfo();
Jonas Stienen's avatar
Jonas Stienen committed
609

610
611
612
613
	void ClientSetSoundReceiverEnabled( const int, const bool );
	void ServerSetSoundReceiverEnabled();
	bool ClientGetSoundReceiverEnabled( int );
	void ServerGetSoundReceiverEnabled();
Jonas Stienen's avatar
Jonas Stienen committed
614

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
615
616
617
618
	void ClientSetActiveSoundReceiverExplicitRenderer( int, const std::string& );
	void ServerSetActiveSoundReceiverExplicitRenderer();
	int ClientGetActiveSoundReceiverExplicitRenderer( const std::string& );
	void ServerGetActiveSoundReceiverExplicitRenderer();
619

620
621
622
623
	std::string ClientGetSoundReceiverName( const int iID );
	void ServerGetSoundReceiverName();
	void ClientSetSoundReceiverName( int iID, const std::string& sName );
	void ServerSetSoundReceiverName();
624

625
626
627
628
	int ClientGetSoundReceiverAuralizationMode( const int iID );
	void ServerGetSoundReceiverAuralizationMode();
	void ClientSetSoundReceiverAuralizationMode( const int iID, const int iAuralizationMode );
	void ServerSetSoundReceiverAuralizationMode();
629

630
631
632
633
	void ClientSetSoundReceiverParameters( const int iID, const CVAStruct& oParams );
	void ServerSetSoundReceiverParameters();
	CVAStruct ClientGetSoundReceiverParameters( const int iID, const CVAStruct& oArgs );
	void ServerGetSoundReceiverParameters();
634

635
636
637
638
	int ClientGetSoundReceiverDirectivity( const int iSoundReceiverID );
	void ServerGetSoundReceiverDirectivity();
	void ClientSetSoundReceiverDirectivity( const int iSoundReceiverID, const int iDirectivityID );
	void ServerSetSoundReceiverDirectivity();
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
639

640
641
642
643
	void ClientGetSoundReceiverPose( const int iID, VAVec3& v3Pos, VAQuat& qOrient );
	void ServerGetSoundReceiverPose();
	void ClientSetSoundReceiverPose( const int iID, const VAVec3& v3Pos, const VAQuat& qOrient );
	void ServerSetSoundReceiverPose();
644

645
646
647
648
	VAVec3 ClientGetSoundReceiverPosition( const int iID );
	void ServerGetSoundReceiverPosition();
	void ClientSetSoundReceiverPosition( const int iID, const VAVec3& v3Pos );
	void ServerSetSoundReceiverPosition();
649

650
651
652
653
	VAQuat ClientGetSoundReceiverOrientation( const int iID );
	void ServerGetSoundReceiverOrientation();
	void ClientSetSoundReceiverOrientation( const int iID, const VAQuat& qOrient );
	void ServerSetSoundReceiverOrientation();
654

655
656
657
658
	void ClientGetSoundReceiverOrientationVU( const int iID, VAVec3& v3View, VAVec3& v3Up );
	void ServerGetSoundReceiverOrientationVU();
	void ClientSetSoundReceiverOrientationVU( const int iID, const VAVec3& v3View, const VAVec3& v3Up );
	void ServerSetSoundReceiverOrientationVU();
Jonas Stienen's avatar
Jonas Stienen committed
659

660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
	VAQuat ClientGetSoundReceiverHeadAboveTorsoOrientation( const int iID );
	void ServerGetSoundReceiverHeadAboveTorsoOrientation();
	void ClientSetSoundReceiverHeadAboveTorsoOrientation( const int iID, const VAQuat& qOrient );
	void ServerSetSoundReceiverHeadAboveTorsoOrientation();

	int ClientGetSoundReceiverGeometryMesh( const int iID );
	void ServerGetSoundReceiverGeometryMesh();
	void ClientSetSoundReceiverGeometryMesh( const int iSoundReceiverID, const int iGeometryMeshID );
	void ServerSetSoundReceiverGeometryMesh();

	void ClientGetSoundReceiverRealWorldPose( const int iID, VAVec3& v3Pos, VAQuat& qOrient );
	void ServerGetSoundReceiverRealWorldPose();
	void ClientSetSoundReceiverRealWorldPose( const int iID, const VAVec3& v3Pos, const VAQuat& qOrient );
	void ServerSetSoundReceiverRealWorldPose();

	void ClientGetSoundReceiverRealWorldPositionOrientationVU( const int iID, VAVec3& v3Pos, VAVec3& v3View, VAVec3& v3Up );
	void ServerGetSoundReceiverRealWorldPositionOrientationVU();
	void ClientSetSoundReceiverRealWorldPositionOrientationVU( const int iID, const VAVec3& v3Pos, const VAVec3& v3View, const VAVec3& v3Up );
	void ServerSetSoundReceiverRealWorldPositionOrientationVU();

680
681
682
683
	VAQuat ClientGetSoundReceiverRealWorldTorsoOrientation( const int iID );
	void ServerGetSoundReceiverRealWorldTorsoOrientation();
	void ClientSetSoundReceiverRealWorldTorsoOrientation( const int iID, const VAQuat& qOrient );
	void ServerSetSoundReceiverRealWorldTorsoOrientation();
684

Jonas Stienen's avatar
Jonas Stienen committed
685

686
687
	std::string ClientCreateScene( const CVAStruct& oParams, const std::string& sName );
	void ServerCreateScene();
Jonas Stienen's avatar
Jonas Stienen committed
688

689
690
	void ClientGetSceneIDs( std::vector< std::string >& vsIDs );
	void ServerGetSceneIDs();
Jonas Stienen's avatar
Jonas Stienen committed
691

692
693
	CVASceneInfo ClientGetSceneInfo( const std::string& sID );
	void ServerGetSceneInfo();
Jonas Stienen's avatar
Jonas Stienen committed
694

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
695
696
697
698
699
700
701
702
703
704
	std::string ClientGetSceneName( const std::string& sID );
	void ServerGetSceneName();
	void ClientSetSceneName( const std::string& sID, const std::string& sName );
	void ServerSetSceneName();

	bool ClientGetSceneEnabled( const std::string& sID );
	void ServerGetSceneEnabled();
	void ClientSetSceneEnabled( const std::string& sID, const bool bEnabled );
	void ServerSetSceneEnabled();

705
706
707
708

	int ClientCreateSoundPortal( const std::string& sName );
	void ServerCreateSoundPortal();

709
710
	void ClientGetSoundPortalIDs( std::vector<int>& vPortalIDs );
	void ServerGetSoundPortalIDs();
Jonas Stienen's avatar
Jonas Stienen committed
711

712
713
	CVASoundPortalInfo ClientGetSoundPortalInfo( const int iID );
	void ServerGetSoundPortalInfo();
Jonas Stienen's avatar
Jonas Stienen committed
714

715
716
717
	std::string ClientGetSoundPortalName( const int iPortalID );
	void ServerGetSoundPortalName();
	void ClientSetSoundPortalName( const int iPortalID, const std::string& sName );
718
	void ServerSetSoundPortalName();
719

720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
	int ClientGetSoundPortalMaterial( const int iSoundPortalID );
	void ServerGetSoundPortalMaterial();
	void ClientSetSoundPortalMaterial( const int iSoundPortalID, const int iMaterialID );
	void ServerSetSoundPortalMaterial();

	int ClientGetSoundPortalNextPortal( const int iSoundPortalID );
	void ServerGetSoundPortalNextPortal();
	void ClientSetSoundPortalNextPortal( const int iSoundPortalID, const int iNextSoundPortalID );
	void ServerSetSoundPortalNextPortal();

	int ClientGetSoundPortalSoundReceiver( const int iSoundPortalID );
	void ServerGetSoundPortalSoundReceiver();
	void ClientSetSoundPortalSoundReceiver( const int iSoundPortalID, const int iSoundReceiverID );
	void ServerSetSoundPortalSoundReceiver();

	int ClientGetSoundPortalSoundSource( const int iSoundPortalID );
	void ServerGetSoundPortalSoundSource();
	void ClientSetSoundPortalSoundSource( const int iSoundPortalID, const int iSoundSourceID );
	void ServerSetSoundPortalSoundSource();

	VAVec3 ClientGetSoundPortalPosition( const int iSoundPortalID );
	void ServerGetSoundPortalPosition();
	void ClientSetSoundPortalPosition( const int iSoundPortalID, const VAVec3& vPos );
	void ServerSetSoundPortalPosition();

	VAQuat ClientGetSoundPortalOrientation( const int iSoundPortalID );
	void ServerGetSoundPortalOrientation();
	void ClientSetSoundPortalOrientation( const int iSoundPortalID, const VAQuat& qOrient );
	void ServerSetSoundPortalOrientation();

	bool ClientGetSoundPortalEnabled( const int iSoundPortalID );
	void ServerGetSoundPortalEnabled();
	void ClientSetSoundPortalEnabled( const int iSoundPortalID, const bool bEnabled );
	void ServerSetSoundPortalEnabled();

755
	CVAStruct ClientGetSoundPortalParameters( const int iPortalID, const CVAStruct& oArgs );
756
757
758
	void ServerGetSoundPortalParameters();
	void ClientSetSoundPortalParameters( const int iPortalID, const CVAStruct& oParams );
	void ServerSetSoundPortalParameters();
Jonas Stienen's avatar
Jonas Stienen committed
759
760


761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
	int ClientCreateGeometryMesh( const CVAGeometryMesh& oMesh, const std::string& sName );
	void ServerCreateGeometryMesh();
	int ClientCreateGeometryMeshFromParameters( const CVAStruct& oParams, const std::string& sName );
	void ServerCreateGeometryMeshFromParameters();
	bool ClientDeleteGeometryMesh( const int iID );
	void ServerDeleteGeometryMesh();
	CVAGeometryMesh ClientGetGeometryMesh( const int iID );
	void ServerGetGeometryMesh();
	void ClientGetGeometryMeshIDs( std::vector< int >& viIDs );
	void ServerGetGeometryMeshIDs();
	void ClientSetGeometryMeshName( const int iID, const std::string& sName );
	void ServerClientSetGeometryMeshName();
	std::string ClientGetGeometryMeshName( const int iID );
	void ServerGetGeometryMeshName();
	void ClientSetGeometryMeshParameters( const int iID, const CVAStruct& oParams );
	void ServerSetGeometryMeshParameters();
	CVAStruct ClientGetGeometryMeshParameters( const int iID, const CVAStruct& oParams );
	void ServerGetGeometryMeshParameters();
	void ClientSetGeometryMeshEnabled( const int iID, const bool bEnabled );
	void ServerSetGeometryMeshEnabled();
	bool ClientGetGeometryMeshEnabled( const int iID );
	void ServerGetGeometryMeshEnabled();


785
786
787
788
	double ClientGetCoreClock();
	void ServerGetCoreClock();
	void ClientSetCoreClock( const double dSeconds );
	void ServerSetCoreClock();
Jonas Stienen's avatar
Jonas Stienen committed
789
790


791
792
	double ClientGetInputGain();
	void ServerGetInputGain();
793

794
795
	void ClientSetInputGain( double dGain );
	void ServerSetInputGain();
Jonas Stienen's avatar
Jonas Stienen committed
796

797
798
	bool ClientGetInputMuted();
	void ServerGetInputMuted();
Jonas Stienen's avatar
Jonas Stienen committed
799

800
801
	void ClientSetInputMuted( bool bMuted );
	void ServerSetInputMuted();
Jonas Stienen's avatar
Jonas Stienen committed
802

803
804
	double ClientGetOutputGain();
	void ServerGetOutputGain();
805

806
807
	void ClientSetOutputGain( double dGain );
	void ServerSetOutputGain();
Jonas Stienen's avatar
Jonas Stienen committed
808

809
810
	bool ClientGetOutputMuted();
	void ServerGetOutputMuted();
Jonas Stienen's avatar
Jonas Stienen committed
811

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
812
	void ClientSetOutputMuted( const bool bMuted );
813
	void ServerSetOutputMuted();
Jonas Stienen's avatar
Jonas Stienen committed
814

815
816
	int ClientGetGlobalAuralizationMode();
	void ServerGetGlobalAuralizationMode();
Jonas Stienen's avatar
Jonas Stienen committed
817

818
819
	void ClientSetGlobalAuralizationMode( int iAuralizationMode );
	void ServerSetGlobalAuralizationMode();
Jonas Stienen's avatar
Jonas Stienen committed
820

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
821
822
	int ClientGetActiveSoundReceiver();
	void ServerGetActiveSoundReceiver();
823

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
824
825
	void ClientSetActiveSoundReceiver( const int iID );
	void ServerSetActiveSoundReceiver();
826

827
828
	std::string ClientSubstituteMacros( const std::string& sStr );
	void ServerSubstituteMacros();
Jonas Stienen's avatar
Jonas Stienen committed
829

830
831
	void ClientSetRenderingModuleGain( const std::string&, const double );
	void ServerSetRenderingModuleGain();
Jonas Stienen's avatar
Jonas Stienen committed
832

833
834
	void ClientSetRenderingModuleMuted( const std::string&, const bool );
	void ServerSetRenderingModuleMuted();
Jonas Stienen's avatar
Jonas Stienen committed
835

836
837
	bool ClientGetRenderingModuleMuted( const std::string& );
	void ServerGetRenderingModuleMuted();
Jonas Stienen's avatar
Jonas Stienen committed
838

839
840
	double ClientGetRenderingModuleGain( const std::string& );
	void ServerGetRenderingModuleGain();
Jonas Stienen's avatar
Jonas Stienen committed
841

842
843
844
845
846
847
848
849
850
851
852
853
	void ClientSetRenderingModuleParameters( const std::string&, const CVAStruct& );
	void ServerSetRenderingModuleParameters();

	CVAStruct ClientGetRenderingModuleParameters( const std::string&, const CVAStruct& );
	void ServerGetRenderingModuleParameters();

	void ClientSetRenderingModuleAuralizationMode( const std::string&, const int );
	void ServerSetRenderingModuleAuralizationMode();

	int ClientGetRenderingModuleAuralizationMode( const std::string& );
	void ServerGetRenderingModuleAuralizationMode();

854
855
	void ClientGetRenderingModuleInfos( std::vector< CVAAudioRendererInfo >&, bool );
	void ServerGetRenderingModuleInfos();
Jonas Stienen's avatar
Jonas Stienen committed
856

857
858
	void ClientSetReproductionModuleGain( const std::string&, const double );
	void ServerSetReproductionModuleGain();
Jonas Stienen's avatar
Jonas Stienen committed
859

860
861
	void ClientSetReproductionModuleMuted( const std::string&, const bool );
	void ServerSetReproductionModuleMuted();
Jonas Stienen's avatar
Jonas Stienen committed
862

863
864
	bool ClientGetReproductionModuleMuted( const std::string& );
	void ServerGetReproductionModuleMuted();
Jonas Stienen's avatar
Jonas Stienen committed
865

866
867
	double ClientGetReproductionModuleGain( const std::string& );
	void ServerGetReproductionModuleGain();
Jonas Stienen's avatar
Jonas Stienen committed
868

869
870
	void ClientGetReproductionModuleInfos( std::vector< CVAAudioReproductionInfo >&, const bool );
	void ServerGetReproductionModuleInfos();
Jonas Stienen's avatar
Jonas Stienen committed
871

872
873
874
875
876
877
	void ClientSetReproductionModuleParameters( const std::string&, const CVAStruct& );
	void ServerSetReproductionModuleParameters();

	CVAStruct ClientGetReproductionModuleParameters( const std::string&, const CVAStruct& );
	void ServerGetReproductionModuleParameters();

Jonas Stienen's avatar
Jonas Stienen committed
878

879
880
881
882
883
884
885
	int ClientCreateAcousticMaterial( const CVAAcousticMaterial& oMaterial, const std::string& sName );
	void ServerCreateAcousticMaterial();
	int ClientCreateAcousticMaterialFromParameters( const CVAStruct& oParams, const std::string& sName );
	void ServerCreateAcousticMaterialFromParameters();
	bool ClientDeleteAcousticMaterial( const int iID );
	void ServerDeleteAcousticMaterial();

886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
	CVAAcousticMaterial ClientGetAcousticMaterialInfo( const int iID );
	void ServerGetAcousticMaterialInfo();

	void ClientGetAcousticMaterialInfos( std::vector< CVAAcousticMaterial >& voDest );
	void ServerGetAcousticMaterialInfos();

	std::string ClientGetAcousticMaterialName( const int iID );
	void ServerGetAcousticMaterialName();
	void ClientSetAcousticMaterialName( const int iID, const std::string& sName );
	void ServerSetAcousticMaterialName();

	CVAStruct ClientGetAcousticMaterialParameters( const int iID, const CVAStruct& oParams );
	void ServerGetAcousticMaterialParameters();
	void ClientSetAcousticMaterialParameters( const int iID, const CVAStruct& oParams );
	void ServerSetAcousticMaterialParameters();

902

903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
	void ClientSetHomogeneousMediumSoundSpeed( const double dSoundSpeed );
	void ServerSetHomogeneousMediumSoundSpeed();
	double ClientGetHomogeneousMediumSoundSpeed();
	void ServerGetHomogeneousMediumSoundSpeed();

	void ClientSetHomogeneousMediumTemperature( const double dDegreesCentigrade );
	void ServerSetHomogeneousMediumTemperature();
	double ClientGetHomogeneousMediumTemperature();
	void ServerGetHomogeneousMediumTemperature();

	void ClientSetHomogeneousMediumStaticPressure( const double dPressurePascal );
	void ServerSetHomogeneousMediumStaticPressure();
	double ClientGetHomogeneousMediumStaticPressure();
	void ServerGetHomogeneousMediumStaticPressure();

	void ClientSetHomogeneousMediumRelativeHumidity( const double dRelativeHumidityPercent );
	void ServerSetHomogeneousMediumRelativeHumidity();
	double ClientGetHomogeneousMediumRelativeHumidity();
	void ServerGetHomogeneousMediumRelativeHumidity();

	void ClientSetHomogeneousMediumShiftSpeed( const VAVec3& v3TranslationSpeed );
	void ServerSetHomogeneousMediumShiftSpeed();
	VAVec3 ClientGetHomogeneousMediumShiftSpeed();
	void ServerGetHomogeneousMediumShiftSpeed();

	void ClientSetHomogeneousMediumParameters( const CVAStruct& oParams );
	void ServerSetHomogeneousMediumParameters();
930
	CVAStruct ClientGetHomogeneousMediumParameters( const CVAStruct& oArgs );
931
932
933
	void ServerGetHomogeneousMediumParameters();


Jonas Stienen's avatar
Jonas Stienen committed
934
935
936
937
938
939
940
private:
	VistaConnectionIP*			m_pCommandChannel;
	VistaConnectionIP*			m_pHeadChannel;
	VistaConnectionIP*			m_pLastAnswerConnection;

	CVANetClientImpl*			m_pClient;
	CVANetServerImpl*			m_pServer;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
941
	IVAInterface*					m_pRealCore;
Jonas Stienen's avatar
Jonas Stienen committed
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959

	bool						m_bBufferSynchronisedModification;
	bool						m_bBufferingActive;

	CVANetMessage*				m_pMessage;
	CVANetMessage*				m_pBufferedMessage;
	int							m_nCurrentMessageMode;

	CVANetMessage*				m_pEventMessage;
	VistaByteBufferDeSerializer	m_oIncomingEvent;
	std::vector<VANetCompat::byte>			m_vecEventBuffer;

	//VistaByteBufferSerializer	m_oHeadMessage;

	int							m_iExceptionHandlingMode;
	int							m_iReceiveTimeout;
};

960
#endif // IW_VANET_NETWORK_PROTOCOL