Commit d212d013 authored by Anne's avatar Anne

Streaming Paras beim Start überarbeitet

parent 8abdf74e
......@@ -72,17 +72,19 @@ public:
int iChannels;
double dSampleRate;
int iBlockSize;
int iBufferSize;
inline StreamingParameters()
{
iChannels = 0;
dSampleRate = 0.0f;
iBlockSize = 0;
iBufferSize = 0;
};
inline bool operator==( const StreamingParameters& rhs )
{
if( ( iChannels == rhs.iChannels ) && ( dSampleRate == rhs.dSampleRate ) && ( iBlockSize == rhs.iBlockSize ) )
if ( ( iChannels == rhs.iChannels ) && ( dSampleRate == rhs.dSampleRate ) && ( iBlockSize == rhs.iBlockSize ) && ( iBufferSize == rhs.iBufferSize ) )
return true;
else
return false;
......
......@@ -311,8 +311,9 @@ CITANetAudioProtocol::StreamingParameters CITANetAudioMessage::ReadStreamingPara
CITANetAudioProtocol::StreamingParameters oParams;
oParams.iChannels = ReadInt();
oParams.dSampleRate = ReadDouble();
oParams.iBlockSize = ReadInt();
oParams.dSampleRate = ReadDouble( );
oParams.iBlockSize = ReadInt( );
oParams.iBufferSize = ReadInt( );
return oParams;
}
......@@ -322,6 +323,7 @@ void CITANetAudioMessage::WriteStreamingParameters( const CITANetAudioProtocol::
WriteInt( oParams.iChannels );
WriteDouble( oParams.dSampleRate );
WriteInt( oParams.iBlockSize );
WriteInt( oParams.iBufferSize );
}
int CITANetAudioMessage::ReadRingBufferSize()
......
......@@ -54,8 +54,9 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
m_pClient = new CITANetAudioClient();
m_oParams.iChannels = pParent->GetNumberOfChannels();
m_oParams.dSampleRate = pParent->GetSampleRate();
m_oParams.iBlockSize = pParent->GetBlocklength();
m_oParams.dSampleRate = pParent->GetSampleRate( );
m_oParams.iBlockSize = pParent->GetBlocklength( );
m_oParams.iBufferSize = pParent->GetRingBufferSize( );
std::string paras = std::string("NetAudioLogClient") + std::string("_BS") + std::to_string(pParent->GetBlocklength()) + std::string("_Ch") + std::to_string(pParent->GetNumberOfChannels()) + std::string(".txt");
m_pClientLogger = new ITABufferedDataLoggerImplClient( );
......
......@@ -47,6 +47,7 @@ bool CITANetAudioStreamingServer::Start( const std::string& sAddress, int iPort
CITANetAudioProtocol::StreamingParameters oClientParams = m_pMessage->ReadStreamingParameters( );
bool bOK = false;
m_oServerParams.iBufferSize = oClientParams.iBufferSize;
if ( m_oServerParams == oClientParams )
{
bOK = true;
......
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