ITANetAudioMessage.cpp 13.9 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
1 2 3 4
#include "ITANetAudioMessage.h"

#include <ITAClock.h>
#include <ITADataLog.h>
Anne's avatar
Anne committed
5 6 7 8
#include <ITAStringUtils.h>

#include <VistaInterProcComm/Connections/VistaConnectionIP.h>
#include <VistaBase/VistaExceptionBase.h>
9
#include <VistaBase/VistaStreamUtils.h>
10 11

#include <algorithm>
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
12
#include <cstring>
Anne's avatar
Anne committed
13
#include <cassert>
14 15
#include <iostream>
#include <iomanip>
Anne's avatar
Anne committed
16 17 18

static int S_nMessageIds = 0;

19
struct ITANetAudioMessageLog : public ITALogDataBase
Anne Heimes's avatar
Anne Heimes committed
20
{
21
	inline static std::ostream& outputDesc( std::ostream& os )
Anne Heimes's avatar
Anne Heimes committed
22 23 24 25
	{
		os << "BlockId";
		os << "\t" << "WorldTimeStamp";
		os << "\t" << "MessageType";
26 27 28
		os << "\t" << "Action";
		os << "\t" << "InternalProcessingTime";
		os << "\t" << "PayloadSize";
Anne Heimes's avatar
Anne Heimes committed
29 30 31 32
		os << std::endl;
		return os;
	};

33
	inline std::ostream& outputData( std::ostream& os ) const
Anne Heimes's avatar
Anne Heimes committed
34 35
	{
		os << uiBlockId;
36
		os << "\t" << std::setprecision( 12 ) << dWorldTimeStamp;
Anne Heimes's avatar
Anne Heimes committed
37
		os << "\t" << sMessageType;
38 39
		os << "\t" << sAction;
		os << "\t" << std::setprecision( 12 ) << dInternalProcessingTime;
Anne Heimes's avatar
Anne Heimes committed
40 41 42 43 44 45
		os << "\t" << nMessagePayloadSize;
		os << std::endl;
		return os;
	};

	unsigned int uiBlockId; //!< Block identifier (audio streaming)
46
	double dWorldTimeStamp; //!< Time stamp at beginning of logged message process
Anne Heimes's avatar
Anne Heimes committed
47
	std::string sMessageType; //!< Protocol message type
48 49 50
	std::string sAction; //!< Triggered action
	double dInternalProcessingTime; //!< Processing within message class
	VistaType::sint32 nMessagePayloadSize; //!< Data
Anne Heimes's avatar
Anne Heimes committed
51 52 53

};

54
class ITABufferedDataLoggerImplProtocol : public ITABufferedDataLogger < ITANetAudioMessageLog > {};
Anne Heimes's avatar
Anne Heimes committed
55

56 57 58 59
CITANetAudioMessage::CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers )
	: m_vecIncomingBuffer( 2048 )
	, m_oOutgoing( 2048 )
	, m_pConnection( NULL )
60
	, m_iBytesReceivedTotal( 0 )
Jonas Stienen's avatar
Jonas Stienen committed
61
	, m_sMessageLoggerBaseName( "ITANetAudioMessage" )
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
62
	, m_bDebuggingEnabled( false )
Anne's avatar
Anne committed
63
{
Jonas Stienen's avatar
Jonas Stienen committed
64
	m_pMessageLogger = new ITABufferedDataLoggerImplProtocol();
65
	m_pMessageLogger->setOutputFile( m_sMessageLoggerBaseName + ".log" );
Jonas Stienen's avatar
Jonas Stienen committed
66

Anne Heimes's avatar
Anne Heimes committed
67
	m_nMessageId = 0;
68 69
	m_oOutgoing.SetByteorderSwapFlag( bSwapBuffers );
	m_oIncoming.SetByteorderSwapFlag( bSwapBuffers );
Jonas Stienen's avatar
Jonas Stienen committed
70

Anne's avatar
Anne committed
71 72 73 74 75
	ResetMessage();
}

void CITANetAudioMessage::ResetMessage()
{
76
	const double dInTime = ITAClock::getDefaultClock()->getTime();
Anne Heimes's avatar
Anne Heimes committed
77

78
	ITANetAudioMessageLog oLog;
Anne Heimes's avatar
Anne Heimes committed
79
	oLog.uiBlockId = m_nMessageId;
Anne Heimes's avatar
Anne Heimes committed
80
	oLog.sMessageType = "RESET_MESSAGE";
Anne Heimes's avatar
Anne Heimes committed
81
	oLog.nMessagePayloadSize = 0;
82 83 84
	oLog.dWorldTimeStamp = dInTime;

	oLog.sAction = "reset_message";
Anne Heimes's avatar
Anne Heimes committed
85

86
	if( m_oIncoming.GetTailSize() > 0 )
Anne Heimes's avatar
Anne Heimes committed
87
	{
Anne Heimes's avatar
Anne Heimes committed
88
		vstr::err() << "CITANetAudioMessage::ResetMessage() called before message was fully processed!" << std::endl;
Jonas Stienen's avatar
Jonas Stienen committed
89
		oLog.sAction = "reset_failed";
Anne Heimes's avatar
Anne Heimes committed
90 91
	}

Anne's avatar
Anne committed
92 93 94
	// wait till sending is complete -> this prevents us
	// from deleting the buffer while it is still being read
	// by the connection
95
	if( m_pConnection != NULL )
96
		m_pConnection->WaitForSendFinish(); // can be time-costly
Anne's avatar
Anne committed
97 98 99 100

	m_nMessageId = S_nMessageIds++;

	m_oOutgoing.ClearBuffer();
101 102 103
	m_oOutgoing.WriteInt32( 0 ); // Payload size
	m_oOutgoing.WriteInt32( 0 ); // Message Type
	m_oOutgoing.WriteInt32( 0 ); // Identifier
Anne's avatar
Anne committed
104

105
	m_oIncoming.SetBuffer( NULL, 0 );
Anne's avatar
Anne committed
106

Anne's avatar
Anne committed
107
	m_nMessageType = -1;
Anne Heimes's avatar
Anne Heimes committed
108

109
	oLog.dInternalProcessingTime = ITAClock::getDefaultClock()->getTime() - dInTime;
Jonas Stienen's avatar
Jonas Stienen committed
110
	m_pMessageLogger->log( oLog );
111

Anne's avatar
Anne committed
112
#if NET_AUDIO_SHOW_TRAFFIC
113
	vstr::out() << "CITANetAudioMessage [Preparing] (id=" << std::setw( 4 ) << m_nMessageId << ")" << std::endl;
114
#endif
Anne's avatar
Anne committed
115 116
}

117
void CITANetAudioMessage::SetConnection( VistaConnectionIP* pConn )
Anne's avatar
Anne committed
118 119 120 121 122 123
{
	m_pConnection = pConn;
}

void CITANetAudioMessage::WriteMessage()
{
124 125 126
	const double dInTime = ITAClock::getDefaultClock()->getTime();
	ITANetAudioMessageLog oLog;
	oLog.dWorldTimeStamp = dInTime;
127
	VistaType::byte* pBuffer = ( VistaType::byte* ) m_oOutgoing.GetBuffer();
Anne's avatar
Anne committed
128 129 130
	VistaType::sint32 iSwapDummy;

	// rewrite size dummy
131
	iSwapDummy = m_oOutgoing.GetBufferSize() - sizeof( VistaType::sint32 );
Anne Heimes's avatar
Anne Heimes committed
132
	oLog.nMessagePayloadSize = iSwapDummy;
133 134
	if( m_oOutgoing.GetByteorderSwapFlag() )
		VistaSerializingToolset::Swap4( &iSwapDummy );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
135
	std::memcpy( pBuffer, &iSwapDummy, sizeof( VistaType::sint32 ) );
Anne's avatar
Anne committed
136

137
	pBuffer += sizeof( VistaType::sint32 );
Anne's avatar
Anne committed
138 139 140

	// rewrite type dummy
	iSwapDummy = m_nMessageType;
Anne Heimes's avatar
Anne Heimes committed
141
	oLog.sMessageType = CITANetAudioProtocol::GetNPMessageID( m_nMessageType );
142 143
	if( m_oOutgoing.GetByteorderSwapFlag() )
		VistaSerializingToolset::Swap4( &iSwapDummy );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
144
	std::memcpy( pBuffer, &iSwapDummy, sizeof( VistaType::sint32 ) );
145

146
	pBuffer += sizeof( VistaType::sint32 );
Anne's avatar
Anne committed
147 148 149

	// rewrite messageid dummy
	iSwapDummy = m_nMessageId;
Anne Heimes's avatar
Anne Heimes committed
150
	oLog.uiBlockId = m_nMessageId;
151 152
	if( m_oOutgoing.GetByteorderSwapFlag() )
		VistaSerializingToolset::Swap4( &iSwapDummy );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
153
	std::memcpy( pBuffer, &iSwapDummy, sizeof( VistaType::sint32 ) );
154 155
	oLog.sAction = "write_message";
	oLog.dInternalProcessingTime = ITAClock::getDefaultClock()->getTime() - dInTime;
Jonas Stienen's avatar
Jonas Stienen committed
156
	m_pMessageLogger->log( oLog );
Anne's avatar
Anne committed
157
#if NET_AUDIO_SHOW_TRAFFIC
158
	vstr::out() << "CITANetAudioMessage [  Writing] " << m_nMessageType << " (id=" << std::setw( 4 ) << m_nMessageId << ")" << std::endl;
159
#endif
Anne's avatar
Anne committed
160

161
	try
Anne's avatar
Anne committed
162
	{
163
		// It appears safe to send even very big data payload, so we will send at once
Anne's avatar
Anne committed
164
		int iRawBufferSize = m_oOutgoing.GetBufferSize();
165 166
		int nRet = m_pConnection->Send( m_oOutgoing.GetBuffer(), iRawBufferSize );

Anne's avatar
Anne committed
167
#if NET_AUDIO_SHOW_TRAFFIC
168
		vstr::out() << "CITANetAudioMessage [  Writing] " << m_nMessageType << " (id=" << std::setw( 4 ) << m_nMessageId << ") RAW BUFFER DONE" << std::endl;
169 170
#endif

171
		m_pConnection->WaitForSendFinish();
172 173
		if( nRet != m_oOutgoing.GetBufferSize() )
			VISTA_THROW( "ITANetAudioMessage: could not send all data from output buffer via network connection", 255 );
Anne's avatar
Anne committed
174
	}
175
	catch( VistaExceptionBase& ex )
Anne's avatar
Anne committed
176
	{
177
		ITA_EXCEPT1( NETWORK_ERROR, ex.GetExceptionText() );
Anne's avatar
Anne committed
178 179 180 181
	}
}


182
bool CITANetAudioMessage::ReadMessage( int timeout )
Anne's avatar
Anne committed
183
{
184 185 186 187
	ITANetAudioMessageLog oLog;
	const double dInTime = ITAClock::getDefaultClock()->getTime();
	oLog.dWorldTimeStamp = dInTime;

Anne's avatar
Anne committed
188
#if NET_AUDIO_SHOW_TRAFFIC
189
	vstr::out() << "CITANetAudioMessage [ Reading ] Waiting for incoming data" << std::endl;
Anne's avatar
Anne committed
190
#endif
Anne's avatar
Anne committed
191
	// WaitForIncomming Data int in ca ms
Anne's avatar
Anne committed
192
	long nIncomingBytes = m_pConnection->WaitForIncomingData( timeout );
Anne's avatar
Anne committed
193
	// TODO Timer entfernen
194
	if( nIncomingBytes == -1 )
Anne's avatar
Anne committed
195
		return false;
Anne's avatar
Anne committed
196

197
	//if (timeout != 0)
198
	//nIncomingBytes = m_pConnection->WaitForIncomingData( 0 );
Anne's avatar
Anne committed
199
#if NET_AUDIO_SHOW_TRAFFIC
200
	vstr::out() << "CITANetAudioMessage [ Reading ] " << nIncomingBytes << " bytes incoming" << std::endl;
Anne's avatar
Anne committed
201
#endif
202

203 204
	VistaType::sint32 nMessagePayloadSize;
	int nBytesRead = m_pConnection->ReadInt32( nMessagePayloadSize );
205
	assert( nBytesRead == sizeof( VistaType::sint32 ) );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
206
	oLog.nMessagePayloadSize = nMessagePayloadSize;
Anne's avatar
Anne committed
207
#if NET_AUDIO_SHOW_TRAFFIC
208
	vstr::out() << "CITANetAudioMessage [ Reading ] Expecting " << nMessagePayloadSize << " bytes message payload" << std::endl;
Anne's avatar
Anne committed
209
#endif
210
	if( nMessagePayloadSize <= 0 )
Anne Heimes's avatar
Anne Heimes committed
211
		return false;
212
	// we need at least the two protocol ints
213
	//assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
Anne's avatar
Anne committed
214

215 216
	if( nMessagePayloadSize > ( int ) m_vecIncomingBuffer.size() )
		m_vecIncomingBuffer.resize( nMessagePayloadSize );
217

218
	// Receive all incoming data (potentially splitted)
219 220

	while( ( unsigned long ) nMessagePayloadSize > m_iBytesReceivedTotal )
Anne's avatar
Anne committed
221
	{
Anne's avatar
Anne committed
222
		int iIncommingBytes = m_pConnection->WaitForIncomingData( 0 );
Anne's avatar
Anne committed
223
		int iBytesReceived;
224 225
		if( nMessagePayloadSize < iIncommingBytes )
			iBytesReceived = m_pConnection->Receive( &m_vecIncomingBuffer[ m_iBytesReceivedTotal ], nMessagePayloadSize - m_iBytesReceivedTotal );
Anne's avatar
Anne committed
226
		else
227
			iBytesReceived = m_pConnection->Receive( &m_vecIncomingBuffer[ m_iBytesReceivedTotal ], iIncommingBytes );
Anne Heimes's avatar
Anne Heimes committed
228
		m_iBytesReceivedTotal += iBytesReceived;
229
#if NET_AUDIO_SHOW_TRAFFIC
230
		vstr::out() << "[ CITANetAudioMessage ] " << std::setw( 3 ) << std::floor( iBytesReceivedTotal / float( nMessagePayloadSize ) * 100.0f ) << "% transmitted" << std::endl;
Anne's avatar
Anne committed
231
#endif
Anne's avatar
Anne committed
232
	}
233
	m_iBytesReceivedTotal = 0;
Anne's avatar
Anne committed
234

235
	oLog.sAction = "read_message";
236 237
	// Transfer data into members
	m_oIncoming.SetBuffer( &m_vecIncomingBuffer[ 0 ], nMessagePayloadSize, false );
Anne's avatar
Anne committed
238 239
	m_nMessageType = ReadInt();
	m_nMessageId = ReadInt();
Anne Heimes's avatar
Anne Heimes committed
240
	oLog.sMessageType = CITANetAudioProtocol::GetNPMessageID( m_nMessageType );
Anne Heimes's avatar
Anne Heimes committed
241
	oLog.uiBlockId = m_nMessageId;
242
	oLog.dWorldTimeStamp = ITAClock::getDefaultClock()->getTime() - dInTime;
Jonas Stienen's avatar
Jonas Stienen committed
243
	m_pMessageLogger->log( oLog );
Anne's avatar
Anne committed
244

Anne's avatar
Anne committed
245
#if NET_AUDIO_SHOW_TRAFFIC
246
	vstr::out() << "CITANetAudioMessage [ Reading ] Finished receiving " << m_nMessageType << " (id=" << std::setw( 4 ) << m_nMessageId << ")" << std::endl;
247
#endif
248
	return true;
249
}
Anne's avatar
Anne committed
250 251 252 253 254 255

int CITANetAudioMessage::GetMessageType() const
{
	return m_nMessageType;
}

256
void CITANetAudioMessage::SetMessageType( int nType )
Anne's avatar
Anne committed
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
{
	m_nMessageType = nType;
}

int CITANetAudioMessage::GetIncomingMessageSize() const
{
	return m_oIncoming.GetTailSize();
}

int CITANetAudioMessage::GetOutgoingMessageSize() const
{
	return m_oOutgoing.GetBufferSize();
}

bool CITANetAudioMessage::GetOutgoingMessageHasData() const
{
273
	return ( m_oOutgoing.GetBufferSize() > 4 * sizeof( VistaType::sint32 ) );
Anne's avatar
Anne committed
274 275
}

276
void CITANetAudioMessage::WriteString( const std::string& sValue )
Anne's avatar
Anne committed
277
{
278 279
	m_oOutgoing.WriteInt32( ( VistaType::sint32 )sValue.size() );
	if( !sValue.empty() ) m_oOutgoing.WriteString( sValue );
Anne's avatar
Anne committed
280 281
}

282
void CITANetAudioMessage::WriteInt( const int iValue )
Anne's avatar
Anne committed
283
{
284
	m_oOutgoing.WriteInt32( ( VistaType::sint32 )iValue );
Anne's avatar
Anne committed
285 286
}

287
void CITANetAudioMessage::WriteBool( const bool bValue )
Anne's avatar
Anne committed
288
{
289
	m_oOutgoing.WriteBool( bValue );
Anne's avatar
Anne committed
290 291
}

292
void CITANetAudioMessage::WriteFloat( const float fValue )
Anne's avatar
Anne committed
293
{
294
	m_oOutgoing.WriteFloat32( fValue );
Anne's avatar
Anne committed
295 296
}

297
void CITANetAudioMessage::WriteDouble( const double dValue )
Anne's avatar
Anne committed
298
{
299
	m_oOutgoing.WriteFloat64( dValue );
Anne's avatar
Anne committed
300 301 302 303 304
}

std::string CITANetAudioMessage::ReadString()
{
	VistaType::sint32 nSize;
305 306
	int nReturn = m_oIncoming.ReadInt32( nSize );
	assert( nReturn == sizeof( VistaType::sint32 ) );
Anne's avatar
Anne committed
307 308

	// Empty string?
309
	if( nSize == 0 ) return "";
Anne's avatar
Anne committed
310 311

	std::string sValue;
312 313
	nReturn = m_oIncoming.ReadString( sValue, nSize );
	assert( nReturn == nSize );
Anne's avatar
Anne committed
314 315 316 317 318 319
	return sValue;
}

int CITANetAudioMessage::ReadInt()
{
	VistaType::sint32 nValue;
320 321 322 323
	int nReturn = m_oIncoming.ReadInt32( nValue );
	if( nReturn == -1 )
		ITA_EXCEPT1( UNKNOWN, "Could not read integer value from incoming message" );
	assert( nReturn == sizeof( VistaType::sint32 ) );
Anne's avatar
Anne committed
324 325 326 327 328 329
	return nValue;
}

bool CITANetAudioMessage::ReadBool()
{
	bool bValue;
330 331
	int nReturn = m_oIncoming.ReadBool( bValue );
	assert( nReturn == sizeof( bool ) );
Anne's avatar
Anne committed
332 333 334 335 336
	return bValue;
}
float CITANetAudioMessage::ReadFloat()
{
	float fValue;
337 338
	int nReturn = m_oIncoming.ReadFloat32( fValue );
	assert( nReturn == sizeof( float ) );
Anne's avatar
Anne committed
339 340 341 342 343
	return fValue;
}
double CITANetAudioMessage::ReadDouble()
{
	double dValue;
344 345
	int nReturn = m_oIncoming.ReadFloat64( dValue );
	assert( nReturn == sizeof( double ) );
Anne's avatar
Anne committed
346 347 348 349
	return dValue;
}


350
void CITANetAudioMessage::WriteException( const ITAException& oException )
Anne's avatar
Anne committed
351
{
352 353 354
	WriteInt( oException.iErrorCode );
	WriteString( oException.sModule );
	WriteString( oException.sReason );
Anne's avatar
Anne committed
355 356 357 358 359 360 361
}

ITAException CITANetAudioMessage::ReadException()
{
	int iErrorCode = ReadInt();
	std::string sModule = ReadString();
	std::string sReason = ReadString();
362
	return ITAException( iErrorCode, sModule, sReason );
Anne's avatar
Anne committed
363 364 365 366 367 368 369
}

VistaConnectionIP* CITANetAudioMessage::GetConnection() const
{
	return m_pConnection;
}

370 371
void CITANetAudioMessage::ClearConnection()
{
Anne's avatar
Anne committed
372
	m_pConnection = NULL;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
373 374
	if( GetIsDebuggingEnabled() == false )
		m_pMessageLogger->setOutputFile( "" ); // disable output
Jonas Stienen's avatar
Jonas Stienen committed
375
	delete m_pMessageLogger;
Anne's avatar
Anne committed
376 377
}

378
void CITANetAudioMessage::WriteIntVector( const std::vector< int > viData )
Anne's avatar
Anne committed
379
{
380 381 382 383
	int iSize = ( int ) viData.size();
	WriteInt( iSize );
	for( int i = 0; i < iSize; i++ )
		WriteInt( viData[ i ] );
Anne's avatar
Anne committed
384 385 386 387 388 389
}

std::vector<int> CITANetAudioMessage::ReadIntVector()
{
	std::vector<int> viData;
	int iSize = ReadInt();
390 391
	for( int i = 0; i < iSize; i++ )
		viData.push_back( ReadInt() );
Anne's avatar
Anne committed
392 393 394 395 396 397 398 399 400

	return viData;
}

CITANetAudioProtocol::StreamingParameters CITANetAudioMessage::ReadStreamingParameters()
{
	CITANetAudioProtocol::StreamingParameters oParams;

	oParams.iChannels = ReadInt();
401
	oParams.dSampleRate = ReadDouble();
402 403
	oParams.iBlockSize = ReadInt();
	oParams.iRingBufferSize = ReadInt();
Anne's avatar
Anne committed
404 405 406 407

	return oParams;
}

408
void CITANetAudioMessage::WriteStreamingParameters( const CITANetAudioProtocol::StreamingParameters & oParams )
Anne's avatar
Anne committed
409
{
410 411
	WriteInt( oParams.iChannels );
	WriteDouble( oParams.dSampleRate );
412 413
	WriteInt( oParams.iBlockSize );
	WriteInt( oParams.iRingBufferSize );
Anne's avatar
Anne committed
414
}
415 416 417 418

int CITANetAudioMessage::ReadRingBufferSize()
{
	return ReadInt();
419 420 421
}

void CITANetAudioMessage::WriteRingBufferSize( const int iBufferSize )
422
{
423 424 425
	WriteInt( iBufferSize );
}

426 427
int CITANetAudioMessage::ReadRingBufferFree()
{
428 429 430 431 432 433 434 435 436
	return ReadInt();
}

void CITANetAudioMessage::WriteRingBufferFree( const int iBufferFree )
{
	WriteInt( iBufferFree );
}

void CITANetAudioMessage::ReadSampleFrame( ITASampleFrame* pSampleFrame )
437 438
{
	int iChannels = ReadInt();
439 440 441 442 443 444 445 446 447 448
	int iSamples = ReadInt();
	if( pSampleFrame->channels() != iChannels || pSampleFrame->GetLength() != iSamples )
		pSampleFrame->init( iChannels, iSamples, false );

	for( int i = 0; i < iChannels; i++ )
		for( int j = 0; j < iSamples; j++ )
			( *pSampleFrame )[ i ][ j ] = ReadFloat();
}

void CITANetAudioMessage::WriteSampleFrame( ITASampleFrame* pSamples )
449
{
450 451 452 453 454 455 456 457
	WriteInt( pSamples->channels() );
	WriteInt( pSamples->GetLength() );

	for( int i = 0; i < pSamples->channels(); i++ )
		for( int j = 0; j < pSamples->GetLength(); j++ )
			WriteFloat( ( *pSamples )[ i ][ j ] );
}

Jonas Stienen's avatar
Jonas Stienen committed
458 459 460 461 462 463 464 465 466 467
void CITANetAudioMessage::SetMessageLoggerBaseName( const std::string& sBaseName )
{
	assert( !sBaseName.empty() );
	if( m_pMessageLogger )
		m_pMessageLogger->setOutputFile( sBaseName + ".log" );
}

std::string CITANetAudioMessage::GetMessageLoggerBaseName() const
{
	return m_sMessageLoggerBaseName;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
468 469 470 471 472 473 474 475 476 477 478
}

void CITANetAudioMessage::SetDebuggingEnabled( bool bEnabled )
{
	m_bDebuggingEnabled = bEnabled;
}

bool CITANetAudioMessage::GetIsDebuggingEnabled() const
{
	return m_bDebuggingEnabled;
}