Aufgrund einer Wartung wird GitLab am 26.10. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 26.10. between 8:00 and 9:00 am.

Commit 44235669 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Line endings

parent b0cf97cc
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
#define INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
#include <ITADataSourcesDefinitions.h>
// ITA includes
#include <ITAException.h>
#include <ITASampleBuffer.h>
#include <ITASampleFrame.h>
#include <ITANetAudioProtocol.h>
// Vista includes
#include <VistaInterProcComm/Connections/VistaByteBufferSerializer.h>
#include <VistaInterProcComm/Connections/VistaByteBufferDeSerializer.h>
// STL includes
#include <string>
#include <vector>
class VistaConnectionIP;
//! Network audio messages
/*
* Messages consist of a message part and an answer part, each read or written
* separately. Messages have a two-int-header (SIZE, MSGTYPE), and
* answers have a two-int header (SIZE; ANSWERTYPE)
*/
class ITA_DATA_SOURCES_API CITANetAudioMessage
{
public:
CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers );
void SetConnection( VistaConnectionIP* );
VistaConnectionIP* GetConnection() const;
void ClearConnection();
void WriteMessage();
void ReadMessage();
void WriteAnswer();
void ReadAnswer();
void ResetMessage();
int GetIncomingMessageSize() const;
int GetOutgoingMessageSize() const;
bool GetOutgoingMessageHasData() const;
void SetMessageType( int nType );
void SetAnswerType( int nType );
int GetMessageType() const;
int GetAnswerType() const;
void WriteInt( const int );
void WriteBool( const bool );
void WriteDouble( const double );
void WriteException( const ITAException& );
void WriteFloat( const float );
void WriteString( const std::string& );
void WriteIntVector( const std::vector< int > );
void WriteFloatVector( const std::vector< float > );
/*
* ----------------------------------------------------------------
*
* ITA core libs
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2017
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
#define INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
#include <ITADataSourcesDefinitions.h>
// ITA includes
#include <ITAException.h>
#include <ITASampleBuffer.h>
#include <ITASampleFrame.h>
#include <ITANetAudioProtocol.h>
// Vista includes
#include <VistaInterProcComm/Connections/VistaByteBufferSerializer.h>
#include <VistaInterProcComm/Connections/VistaByteBufferDeSerializer.h>
// STL includes
#include <string>
#include <vector>
class VistaConnectionIP;
//! Network audio messages
/*
* Messages consist of a message part and an answer part, each read or written
* separately. Messages have a two-int-header (SIZE, MSGTYPE), and
* answers have a two-int header (SIZE; ANSWERTYPE)
*/
class ITA_DATA_SOURCES_API CITANetAudioMessage
{
public:
CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwapBehavior bSwapBuffers );
void SetConnection( VistaConnectionIP* );
VistaConnectionIP* GetConnection() const;
void ClearConnection();
void WriteMessage();
void ReadMessage();
void WriteAnswer();
void ReadAnswer();
void ResetMessage();
int GetIncomingMessageSize() const;
int GetOutgoingMessageSize() const;
bool GetOutgoingMessageHasData() const;
void SetMessageType( int nType );
void SetAnswerType( int nType );
int GetMessageType() const;
int GetAnswerType() const;
void WriteInt( const int );
void WriteBool( const bool );
void WriteDouble( const double );
void WriteException( const ITAException& );
void WriteFloat( const float );
void WriteString( const std::string& );
void WriteIntVector( const std::vector< int > );
void WriteFloatVector( const std::vector< float > );
void WriteStreamingParameters(const CITANetAudioProtocol::StreamingParameters &);
void WriteRingBufferSize(const int);
void WriteRingBufferFree(const int);
void WriteSampleFrame(ITASampleFrame*);
std::string ReadString();
int ReadInt();
bool ReadBool();
ITAException ReadException();
float ReadFloat();
double ReadDouble();
std::vector< int > ReadIntVector();
std::vector< float > ReadFloatVector();
void WriteSampleFrame(ITASampleFrame*);
std::string ReadString();
int ReadInt();
bool ReadBool();
ITAException ReadException();
float ReadFloat();
double ReadDouble();
std::vector< int > ReadIntVector();
std::vector< float > ReadFloatVector();
CITANetAudioProtocol::StreamingParameters ReadStreamingParameters();
int ReadRingBufferSize();
int ReadRingBufferFree();
void ReadSampleFrame(ITASampleFrame* pSampleFrame);
private:
int m_nMessageType;
int m_nMessageId;
int m_nAnswerType;
VistaByteBufferSerializer m_oOutgoing;
VistaByteBufferDeSerializer m_oIncoming;
std::vector< VistaType::byte > m_vecIncomingBuffer;
VistaConnectionIP* m_pConnection;
};
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
void ReadSampleFrame(ITASampleFrame* pSampleFrame);
private:
int m_nMessageType;
int m_nMessageId;
int m_nAnswerType;
VistaByteBufferSerializer m_oOutgoing;
VistaByteBufferDeSerializer m_oIncoming;
std::vector< VistaType::byte > m_vecIncomingBuffer;
VistaConnectionIP* m_pConnection;
};
#endif // INCLUDE_WATCHER_ITA_NET_AUDIO_MESSAGE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment