diff --git a/src/ITANetAudioMessage.cpp b/src/ITANetAudioMessage.cpp index eaf94a23787a75ecd8c7bc21ff8d19504fe51105..27e83d6764dc0df3f4972323abd69717ee076dbd 100644 --- a/src/ITANetAudioMessage.cpp +++ b/src/ITANetAudioMessage.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -124,7 +124,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout) if ( nIncomingBytes == -1) return false; - nIncomingBytes = m_pConnection->WaitForIncomingData( 0 ); + if (timeout != 0) + nIncomingBytes = m_pConnection->WaitForIncomingData( 0 ); #if NET_AUDIO_SHOW_TRAFFIC vstr::out() << "CITANetAudioMessage [ Reading ] " << nIncomingBytes << " bytes incoming" << std::endl; #endif @@ -135,8 +136,10 @@ bool CITANetAudioMessage::ReadMessage( int timeout) #if NET_AUDIO_SHOW_TRAFFIC vstr::out() << "CITANetAudioMessage [ Reading ] Expecting " << nMessagePayloadSize << " bytes message payload" << std::endl; #endif + if (nMessagePayloadSize <= 2 * sizeof(VistaType::sint32)) + int i = 34; // we need at least the two protocol ints - assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) ); + //assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) ); if( nMessagePayloadSize > ( int ) m_vecIncomingBuffer.size() ) m_vecIncomingBuffer.resize( nMessagePayloadSize ); @@ -165,6 +168,7 @@ bool CITANetAudioMessage::ReadMessage( int timeout) #if NET_AUDIO_SHOW_TRAFFIC vstr::out() << "CITANetAudioMessage [ Reading ] Finished receiving " << m_nMessageType << " (id=" << std::setw( 4 ) << m_nMessageId << ")" << std::endl; #endif + return true; } int CITANetAudioMessage::GetMessageType() const diff --git a/src/ITANetAudioStreamingClient.cpp b/src/ITANetAudioStreamingClient.cpp index f1310874795a3274914578666c2452fe077f9d3a..809c15744a32d86eab4d15672af9c81cc12e2521 100644 --- a/src/ITANetAudioStreamingClient.cpp +++ b/src/ITANetAudioStreamingClient.cpp @@ -1,184 +1,184 @@ -#include - -#include -#include -#include -#include -#include - -#include -#include - -//! Audio streaming log item -struct ITAClientLog : public ITALogDataBase -{ - inline static std::ostream& outputDesc( std::ostream& os ) - { - os << "BlockId"; - os << "\t" << "WorldTimeStamp"; - os << "\t" << "ProtocolStatus"; - os << "\t" << "FreeSamples"; - os << "\t" << "Channel"; - os << std::endl; - return os; - }; - - inline std::ostream& outputData( std::ostream& os ) const - { - os << uiBlockId; - os << "\t" << std::setprecision( 12 ) << dWorldTimeStamp; - os << "\t" << iProtocolStatus; - os << "\t" << iFreeSamples; - os << "\t" << iChannel; - os << std::endl; - return os; - }; - - unsigned int uiBlockId; //!< Block identifier (audio streaming) - double dWorldTimeStamp; - int iProtocolStatus; //!< ... usw - int iFreeSamples; - int iChannel; - -}; - -class ITABufferedDataLoggerImplClient : public ITABufferedDataLogger < ITAClientLog > {}; - - -CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pParent ) - : m_oBlockIncrementEvent( VistaThreadEvent::WAITABLE_EVENT ) - , m_pStream( pParent ) - , m_pConnection( NULL ) - , m_bStopIndicated( false ) -{ - m_pClient = new CITANetAudioClient(); - - m_oParams.iChannels = pParent->GetNumberOfChannels(); - m_oParams.dSampleRate = pParent->GetSampleRate( ); - m_oParams.iBlockSize = pParent->GetBlocklength( ); - m_oParams.iRingBufferSize = 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( ); - m_pClientLogger->setOutputFile(paras); - iStreamingBlockId = 0; - m_pMessage = new CITANetAudioMessage( VistaSerializingToolset::SWAPS_MULTIBYTE_VALUES ); -} - -CITANetAudioStreamingClient::~CITANetAudioStreamingClient() -{ - //try{ - if (m_pConnection->GetIsOpen()) - { - m_pMessage->ResetMessage(); - m_pMessage->SetConnection(m_pConnection); - m_pMessage->SetMessageType(CITANetAudioProtocol::NP_CLIENT_CLOSE); - m_pMessage->WriteMessage(); - m_pClient->Disconnect(); - } - delete m_pClientLogger; - //} - //catch (ITAException e){ - // std::cout << e << std::endl; - //} -} - -bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, int iPort ) -{ - if( GetIsConnected() ) - return false; - - if( !m_pClient->Connect( sAddress, iPort ) ) - ITA_EXCEPT1( INVALID_PARAMETER, "Could not connect to " + sAddress ); - - m_pConnection = m_pClient->GetConnection(); - - m_pMessage->ResetMessage(); - m_pMessage->SetConnection( m_pConnection ); - - // Validate streaming parameters of server and client - m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_OPEN ); - m_pMessage->WriteStreamingParameters( m_oParams ); - m_pMessage->WriteMessage( ); - m_pMessage->ResetMessage( ); - - while ( !m_pMessage->ReadMessage( 0 ) ); - - assert( m_pMessage->GetMessageType( ) == CITANetAudioProtocol::NP_SERVER_OPEN ); - bool bOK = m_pMessage->ReadBool(); - - if( !bOK ) - ITA_EXCEPT1( INVALID_PARAMETER, "Streaming server declined connection, detected streaming parameter mismatch." ); - - Run(); - - return true; -} - -bool CITANetAudioStreamingClient::LoopBody() -{ - ITAClientLog oLog; - oLog.uiBlockId = ++iStreamingBlockId; - - if( m_bStopIndicated ) - return true; - - // Send message to server that samples can be received - - m_pMessage->ResetMessage( ); - // Read answer - if ( m_pMessage->ReadMessage( 0 ) ) - { - int iMsgType = m_pMessage->GetMessageType( ); - switch ( iMsgType ) - { - case CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES: - // Receive samples from net message and forward them to the stream ring buffer - - m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer ); - if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) ) - m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) ); - //else - // Fehler - - break; - case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES: - m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES ); +#include + +#include +#include +#include +#include +#include + +#include +#include + +//! Audio streaming log item +struct ITAClientLog : public ITALogDataBase +{ + inline static std::ostream& outputDesc( std::ostream& os ) + { + os << "BlockId"; + os << "\t" << "WorldTimeStamp"; + os << "\t" << "ProtocolStatus"; + os << "\t" << "FreeSamples"; + os << "\t" << "Channel"; + os << std::endl; + return os; + }; + + inline std::ostream& outputData( std::ostream& os ) const + { + os << uiBlockId; + os << "\t" << std::setprecision( 12 ) << dWorldTimeStamp; + os << "\t" << iProtocolStatus; + os << "\t" << iFreeSamples; + os << "\t" << iChannel; + os << std::endl; + return os; + }; + + unsigned int uiBlockId; //!< Block identifier (audio streaming) + double dWorldTimeStamp; + int iProtocolStatus; //!< ... usw + int iFreeSamples; + int iChannel; + +}; + +class ITABufferedDataLoggerImplClient : public ITABufferedDataLogger < ITAClientLog > {}; + + +CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pParent ) + : m_oBlockIncrementEvent( VistaThreadEvent::WAITABLE_EVENT ) + , m_pStream( pParent ) + , m_pConnection( NULL ) + , m_bStopIndicated( false ) +{ + m_pClient = new CITANetAudioClient(); + + m_oParams.iChannels = pParent->GetNumberOfChannels(); + m_oParams.dSampleRate = pParent->GetSampleRate( ); + m_oParams.iBlockSize = pParent->GetBlocklength( ); + m_oParams.iRingBufferSize = 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( ); + m_pClientLogger->setOutputFile(paras); + iStreamingBlockId = 0; + m_pMessage = new CITANetAudioMessage( VistaSerializingToolset::SWAPS_MULTIBYTE_VALUES ); +} + +CITANetAudioStreamingClient::~CITANetAudioStreamingClient() +{ + //try{ + if (m_pConnection->GetIsOpen()) + { + m_pMessage->ResetMessage(); + m_pMessage->SetConnection(m_pConnection); + m_pMessage->SetMessageType(CITANetAudioProtocol::NP_CLIENT_CLOSE); + m_pMessage->WriteMessage(); + m_pClient->Disconnect(); + } + delete m_pClientLogger; + //} + //catch (ITAException e){ + // std::cout << e << std::endl; + //} +} + +bool CITANetAudioStreamingClient::Connect( const std::string& sAddress, int iPort ) +{ + if( GetIsConnected() ) + return false; + + if( !m_pClient->Connect( sAddress, iPort ) ) + ITA_EXCEPT1( INVALID_PARAMETER, "Could not connect to " + sAddress ); + + m_pConnection = m_pClient->GetConnection(); + + m_pMessage->ResetMessage(); + m_pMessage->SetConnection( m_pConnection ); + + // Validate streaming parameters of server and client + m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_OPEN ); + m_pMessage->WriteStreamingParameters( m_oParams ); + m_pMessage->WriteMessage( ); + m_pMessage->ResetMessage( ); + + while ( !m_pMessage->ReadMessage( 0 ) ); + + assert( m_pMessage->GetMessageType( ) == CITANetAudioProtocol::NP_SERVER_OPEN ); + bool bOK = m_pMessage->ReadBool(); + + if( !bOK ) + ITA_EXCEPT1( INVALID_PARAMETER, "Streaming server declined connection, detected streaming parameter mismatch." ); + + Run(); + + return true; +} + +bool CITANetAudioStreamingClient::LoopBody() +{ + ITAClientLog oLog; + oLog.uiBlockId = ++iStreamingBlockId; + + if( m_bStopIndicated ) + return true; + + // Send message to server that samples can be received + + m_pMessage->ResetMessage( ); + // Read answer + if ( m_pMessage->ReadMessage( 0 ) ) + { + int iMsgType = m_pMessage->GetMessageType( ); + switch ( iMsgType ) + { + case CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES: + // Receive samples from net message and forward them to the stream ring buffer + + m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer ); + if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) ) + m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength( ) ); + //else + // Fehler + + break; + case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES: + m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES ); m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples( ) ); - m_pMessage->WriteMessage( ); - break; - case CITANetAudioProtocol::NP_SERVER_CLOSE: - Disconnect( ); + m_pMessage->WriteMessage( ); + break; + case CITANetAudioProtocol::NP_SERVER_CLOSE: + Disconnect( ); break; default: vstr::out( ) << "[ITANetAudioStreamingServer] Unkown protocol type : " << iMsgType << std::endl; break; - } - oLog.iChannel = m_pStream->GetNumberOfChannels( ); - oLog.iProtocolStatus = iMsgType; - oLog.dWorldTimeStamp = ITAClock::getDefaultClock( )->getTime( ); - m_pClientLogger->log( oLog ); - } - return false; -} - -void CITANetAudioStreamingClient::TriggerBlockIncrement() -{ - m_oBlockIncrementEvent.SignalEvent(); -} - -bool CITANetAudioStreamingClient::GetIsConnected() const -{ - return m_pClient->GetIsConnected(); -} - -void CITANetAudioStreamingClient::Disconnect() -{ - m_bStopIndicated = true; - StopGently( true ); - - //delete m_pConnection; - m_pConnection = NULL; - - m_bStopIndicated = false; -} + } + oLog.iChannel = m_pStream->GetNumberOfChannels( ); + oLog.iProtocolStatus = iMsgType; + oLog.dWorldTimeStamp = ITAClock::getDefaultClock( )->getTime( ); + m_pClientLogger->log( oLog ); + } + return false; +} + +void CITANetAudioStreamingClient::TriggerBlockIncrement() +{ + m_oBlockIncrementEvent.SignalEvent(); +} + +bool CITANetAudioStreamingClient::GetIsConnected() const +{ + return m_pClient->GetIsConnected(); +} + +void CITANetAudioStreamingClient::Disconnect() +{ + m_bStopIndicated = true; + StopGently( true ); + + //delete m_pConnection; + m_pConnection = NULL; + + m_bStopIndicated = false; +} diff --git a/tests/NetAudio/CMakeLists.txt b/tests/NetAudio/CMakeLists.txt index 4c654fc7adc22b9c2f41a92d63f824cef8252843..8354b74bf3ec66cda5d24a977a689317b58a7ea4 100644 --- a/tests/NetAudio/CMakeLists.txt +++ b/tests/NetAudio/CMakeLists.txt @@ -72,10 +72,10 @@ vista_install_all_dlls( bin ) set_property( TARGET ITANetAudioTest PROPERTY FOLDER "ITACoreLibs/Tests/ITADataSources/NetAudio" ) if( NOT DEFINED ITA_NETAUDIO_SERVER_WITH_TESTS ) - set( ITA_NETAUDIO_SERVER_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 1024 2" ) + set( ITA_NETAUDIO_SERVER_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 32 2" ) endif( ) if( NOT DEFINED ITA_NETAUDIO_CLIENT_WITH_TESTS ) - set( ITA_NETAUDIO_CLIENT_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 1024 2 1024" ) + set( ITA_NETAUDIO_CLIENT_WITH_TESTS "default value" CACHE STRING "localhost 12480 44100 32 2 3200" ) endif( ) vista_set_target_msvc_arguments( ITANetAudioStreamingPortaudioClientTest ITA_NETAUDIO_CLIENT_WITH_TESTS ) diff --git a/tests/NetAudio/ITANetAudioStreamingClientTest.cpp b/tests/NetAudio/ITANetAudioStreamingClientTest.cpp index 19018a4b05e89b0f298f43966b6af5ef1a449e02..de55472dbf89cc0482c02c6c7d91c4826199ea19 100644 --- a/tests/NetAudio/ITANetAudioStreamingClientTest.cpp +++ b/tests/NetAudio/ITANetAudioStreamingClientTest.cpp @@ -18,13 +18,6 @@ int main(int argc, char* argv[]) if (argc != 7) { - cout << "argc = " << argc << endl; - cout << "sServerName = " << argv[1] << endl; - cout << "iServerPort = " << argv[2] << endl; - cout << "dSampleRate = " << argv[3] << endl; - cout << "iBlockLength = " << argv[4] << endl; - cout << "iChannels = " << argv[5] << endl; - cout << "iBufferSize = " << argv[6] << endl; fprintf(stderr, "Fehler: Syntax = ServerName ServerPort SampleRate BufferSize Channel RingBufferSize!\n"); } diff --git a/tests/NetAudio/NatLogUnderruns.m b/tests/NetAudio/NatLogUnderruns.m index ff761eac05a1c4a43cd761233efc2b06d427cc7a..6648b466b85ac17d80d2325b80551025cf80bc62 100644 --- a/tests/NetAudio/NatLogUnderruns.m +++ b/tests/NetAudio/NatLogUnderruns.m @@ -2,7 +2,7 @@ close all; clear all; ChannelVec = [2]; -BlockSize = '1024'; +BlockSize = '32'; NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']); NetAudioLogClient = {NetAudioLogClient.name}; NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t'); diff --git a/tests/NetAudio/NetAudioLog.m b/tests/NetAudio/NetAudioLog.m index 75e44743909018513a578bb68f3dd896c8b6624d..ce61f5b47092cc6e2a81f7fdf5f22a53cfb22090 100644 --- a/tests/NetAudio/NetAudioLog.m +++ b/tests/NetAudio/NetAudioLog.m @@ -1,10 +1,10 @@ %% Einlesen der Logs close all; clear all; -NetAudioLogNet = readtable( 'NetAudioLogNet_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t'); -NetAudioLogStream = readtable( 'NetAudioLogStream_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t') -NetAudioLogClient = readtable( 'NetAudioLogClient_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' ); -NetAudioLogBaseData = readtable( 'NetAudioLogBaseData_BS1024_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' ); +NetAudioLogNet = readtable( 'NetAudioLogNet_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t'); +NetAudioLogStream = readtable( 'NetAudioLogStream_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t') +NetAudioLogClient = readtable( 'NetAudioLogClient_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' ); +NetAudioLogBaseData = readtable( 'NetAudioLogBaseData_BS32_Ch2.txt', 'FileType', 'text', 'Delimiter', '\t' ); % Save Base Data Channel = NetAudioLogBaseData.Channel(1); diff --git a/tests/NetAudio/NetAudioServerLog.m b/tests/NetAudio/NetAudioServerLog.m index 6c7c6d8a4585ce32170c0c09cfa5ec993d6ee51d..4a97a2561d551614b1e5787cff6d6b718667f96e 100644 --- a/tests/NetAudio/NetAudioServerLog.m +++ b/tests/NetAudio/NetAudioServerLog.m @@ -1,7 +1,7 @@ %% Einlesen der Logs close all; clear all; -BlockSize = '1024'; +BlockSize = '32'; NetAudioLogServer = dir(['NetAudioLogServer_BS' BlockSize '*.txt']); NetAudioLogServer = {NetAudioLogServer.name}; NetAudioLogServerTab = readtable(NetAudioLogServer{1}, 'FileType', 'text', 'Delimiter', '\t'); @@ -18,34 +18,51 @@ for k=2:numel(NetAudioLogServer) end NetAudioLogServerTab.WorldTimeStamp = NetAudioLogServerTab.WorldTimeStamp - minTime; -% NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']); -% NetAudioLogClient = {NetAudioLogClient.name}; -% NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t'); -% minTime = NetAudioLogClientTab.WorldTimeStamp(1); -% maxTime = NetAudioLogClientTab.WorldTimeStamp(end); -% for k=2:numel(NetAudioLogClient) -% temp = readtable(NetAudioLogClient{k}, 'FileType', 'text', 'Delimiter', '\t'); -% NetAudioLogClientTab = [NetAudioLogClientTab; temp]; -% minTime = min(minTime, temp.WorldTimeStamp(1)); -% maxTime = max(maxTime, temp.WorldTimeStamp(end)); -% end +NetAudioLogClient = dir(['NetAudioLogClient_BS' BlockSize '*.txt']); +NetAudioLogClient = {NetAudioLogClient.name}; +NetAudioLogClientTab = readtable(NetAudioLogClient{1}, 'FileType', 'text', 'Delimiter', '\t'); +minTime = NetAudioLogClientTab.WorldTimeStamp(1); +maxTime = NetAudioLogClientTab.WorldTimeStamp(end); +for k=2:numel(NetAudioLogClient) + temp = readtable(NetAudioLogClient{k}, 'FileType', 'text', 'Delimiter', '\t'); + NetAudioLogClientTab = [NetAudioLogClientTab; temp]; + minTime = min(minTime, temp.WorldTimeStamp(1)); + maxTime = max(maxTime, temp.WorldTimeStamp(end)); +end %% Protocolstatus ersetzten -Protocol = {'100', 'NP_CLIENT_OPEN';... - '101', 'NP_CLIENT_CLOSE';... - '111', 'NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES';... - '200', 'NP_SERVER_OPEN';... - '201', 'NP_SERVER_CLOSE';... - '211', 'NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES';... - '222', 'NP_SERVER_SENDING_SAMPLES'}; +Protocol = {'100', 'NP CLIENT OPEN';... + '101', 'NP CLIENT CLOSE';... + '111', 'NP CLIENT SENDING RINGBUFFER FREE SAMPLES';... + '200', 'NP SERVER OPEN';... + '201', 'NP SERVER CLOSE';... + '211', 'NP SERVER GET RINGBUFFER FREE SAMPLES';... + '222', 'NP SERVER SENDING SAMPLES'}; %NumPro = zeros(size(NetAudioLogServerTab.ProtocolStatus)); -for k = (1:size(Protocol,1)) -%NumPro( NetAudioLogServerTab.ProtocolStatus == 211) = 'NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES'; -end +Time100 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 100)); +Time101 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 101)); +Time111 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 111)); +Time200 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 200)); +Time201 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 201)); +Time211 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 211)); +Time222 = NetAudioLogServerTab.WorldTimeStamp(find(NetAudioLogServerTab.ProtocolStatus == 222)); +Time = {Time100 Time101 Time111 Time200 Time201 Time211 Time222}; %% Plot Protocol -plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.ProtocolStatus) +%plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.ProtocolStatus) hold on; -%plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples) +plot(NetAudioLogServerTab.WorldTimeStamp, NetAudioLogServerTab.FreeSamples) +legende = {}; +legende{1} = 'Freie Samples'; +i = 2; +for k = (1:7) + if size(Time{k}, 1) ~= 0 + plot(Time{k}, k* 100 * ones(size(Time{k})),'.') + legende{i} = Protocol{k,2}; + i = i + 1; + end +end +legend(legende); +legend('show'); \ No newline at end of file