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

Merge branch 'develop' into ba_2016_heimes

parents 7782df12 75010435
Copyright 2015-2016 Institute of Technical Acoustics, RWTH Aachen University. Any usage and distribution is prohibited, unless explicitly granted by the authors.
\ No newline at end of file
Copyright 2015-2017 Institute of Technical Acoustics, RWTH Aachen University. Any usage and distribution is prohibited, unless explicitly granted by the authors.
\ No newline at end of file
/*
* ----------------------------------------------------------------
*
* 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
......@@ -6,12 +6,13 @@ include( VistaCommon )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
if( ITA_CORE_LIBS_BUILD_STATIC AND DEFINED ITA_CORE_LIBS_BUILD_STATIC )
if( ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
endif( )
# todo fix with if( vista_staic )!
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( )
add_executable( BufferDataSourceTest BufferDataSourceTest.cpp )
target_link_libraries( BufferDataSourceTest ${VISTA_USE_PACKAGE_LIBRARIES} )
......
cmake_minimum_required( VERSION 2.8 )
if( NOT ITADATASOURCES_COMMON_BUILD )
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
......
cmake_minimum_required( VERSION 2.8 )
if( NOT ITADATASOURCES_COMMON_BUILD )
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
add_definitions( -DITA_DATA_SOURCES_DLL )
# Loopback
add_executable( ITAJackLoopback ITAJackLoopback.cpp )
target_link_libraries( ITAJackLoopback ${VISTA_USE_PACKAGE_LIBRARIES} )
......
cmake_minimum_required( VERSION 2.8 )
if( NOT ITADATASOURCES_COMMON_BUILD )
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
add_definitions( -DITA_DATA_SOURCES_DLL )
add_executable( ITAPortaudioInterfaceRecorder ITAPortaudioInterfaceRecorder.cpp )
target_link_libraries( ITAPortaudioInterfaceRecorder ${VISTA_USE_PACKAGE_LIBRARIES} )
......
cmake_minimum_required( VERSION 2.9 )
if( NOT ITADATASOURCES_COMMON_BUILD )
project( ITANetAudioTests )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
project( ITANetAudioTests )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
vista_use_package( ITADataSources REQUIRED FIND_DEPENDENCIES )
......
cmake_minimum_required( VERSION 2.9 )
if( NOT ITADATASOURCES_COMMON_BUILD )
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
project( ITADataSourcesTest )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
vista_use_package( ITABase REQUIRED FIND_DEPENDENCIES )
......
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