Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
ceaa1585
Commit
ceaa1585
authored
Feb 06, 2017
by
Anne Heimes
Browse files
logs angepasst Netaudio
parent
9c1745ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ITANetAudioStream.cpp
View file @
ceaa1585
...
...
@@ -137,15 +137,18 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
m_iStreamingStatus
=
STOPPED
;
// Logging
std
::
string
paras
=
std
::
string
(
"NetAudioLogBaseData"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
iBufferSize
)
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
iChannels
)
+
std
::
string
(
".txt"
);
m_pAudioLogger
=
new
ITABufferedDataLoggerImplAudio
(
);
m_pAudioLogger
->
setOutputFile
(
"NetAudioLogBaseData.txt"
);
m_pAudioLogger
->
setOutputFile
(
paras
);
paras
=
std
::
string
(
"NetAudioLogStream"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
iBufferSize
)
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
iChannels
)
+
std
::
string
(
".txt"
);
m_pStreamLogger
=
new
ITABufferedDataLoggerImplStream
();
m_pStreamLogger
->
setOutputFile
(
"NetAudioLogStream.txt"
);
m_pStreamLogger
->
setOutputFile
(
paras
);
iAudioStreamingBlockID
=
0
;
paras
=
std
::
string
(
"NetAudioLogNet"
)
+
std
::
string
(
"_BS"
)
+
std
::
to_string
(
iBufferSize
)
+
std
::
string
(
"_Ch"
)
+
std
::
to_string
(
iChannels
)
+
std
::
string
(
".txt"
);
m_pNetLogger
=
new
ITABufferedDataLoggerImplNet
();
m_pNetLogger
->
setOutputFile
(
"NetAudioLogNet.txt"
);
m_pNetLogger
->
setOutputFile
(
paras
);
iNetStreamingBlockID
=
0
;
// Logging Base Data
...
...
src/ITANetAudioStreamingClient.cpp
View file @
ceaa1585
...
...
@@ -18,6 +18,7 @@ struct ITAClientLog : public ITALogDataBase
os
<<
"
\t
"
<<
"WorldTimeStamp"
;
os
<<
"
\t
"
<<
"ProtocolStatus"
;
os
<<
"
\t
"
<<
"FreeSamples"
;
os
<<
"
\t
"
<<
"Channel"
;
os
<<
std
::
endl
;
return
os
;
};
...
...
@@ -28,6 +29,7 @@ struct ITAClientLog : public ITALogDataBase
os
<<
"
\t
"
<<
std
::
setprecision
(
12
)
<<
dWorldTimeStamp
;
os
<<
"
\t
"
<<
iProtocolStatus
;
os
<<
"
\t
"
<<
iFreeSamples
;
os
<<
"
\t
"
<<
iChannel
;
os
<<
std
::
endl
;
return
os
;
};
...
...
@@ -36,6 +38,7 @@ struct ITAClientLog : public ITALogDataBase
double
dWorldTimeStamp
;
int
iProtocolStatus
;
//!< ... usw
int
iFreeSamples
;
int
iChannel
;
};
...
...
@@ -53,8 +56,10 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
m_oParams
.
iChannels
=
pParent
->
GetNumberOfChannels
();
m_oParams
.
dSampleRate
=
pParent
->
GetSampleRate
();
m_oParams
.
iBlockSize
=
pParent
->
GetBlocklength
();
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
(
"NetAudioLogClient.txt"
);
m_pClientLogger
->
setOutputFile
(
paras
);
iStreamingBlockId
=
0
;
m_pMessage
=
new
CITANetAudioMessage
(
VistaSerializingToolset
::
SWAPS_MULTIBYTE_VALUES
);
}
...
...
@@ -67,8 +72,9 @@ CITANetAudioStreamingClient::~CITANetAudioStreamingClient()
m_pMessage
->
ResetMessage
();
m_pMessage
->
SetConnection
(
m_pConnection
);
m_pMessage
->
SetMessageType
(
CITANetAudioProtocol
::
NP_CLIENT_CLOSE
);
//
m_pMessage->WriteMessage();
m_pMessage
->
WriteMessage
();
m_pClient
->
Disconnect
();
//Disconnect();
}
//}
//catch (ITAException e){
...
...
@@ -159,6 +165,7 @@ bool CITANetAudioStreamingClient::LoopBody()
case
CITANetAudioProtocol
::
NP_SERVER_GET_RINGBUFFER_FREE
:
break
;
}
oLog
.
iChannel
=
m_pStream
->
GetNumberOfChannels
();
oLog
.
iProtocolStatus
=
iAnswerType
;
oLog
.
dWorldTimeStamp
=
ITAClock
::
getDefaultClock
(
)
->
getTime
(
);
m_pClientLogger
->
log
(
oLog
);
...
...
@@ -180,7 +187,7 @@ void CITANetAudioStreamingClient::Disconnect()
m_bStopIndicated
=
true
;
StopGently
(
true
);
delete
m_pConnection
;
//
delete m_pConnection;
m_pConnection
=
NULL
;
m_bStopIndicated
=
false
;
...
...
src/ITANetAudioStreamingServer.cpp
View file @
ceaa1585
...
...
@@ -120,11 +120,11 @@ bool CITANetAudioStreamingServer::LoopBody()
}
case
CITANetAudioProtocol
::
NP_CLIENT_CLOSE
:
{
m_pMessage
->
SetAnswerType
(
CITANetAudioProtocol
::
NP_SERVER_CLOSE
);
m_pMessage
->
WriteAnswer
();
m_pConnection
=
NULL
;
StopGently
(
true
);
//
m_pMessage->SetAnswerType( CITANetAudioProtocol::NP_SERVER_CLOSE );
//
m_pMessage->WriteAnswer();
StopGently
(
false
);
//
m_pConnection = NULL;
Stop
();
return
false
;
...
...
tests/NetAudio/ITANetAudioStreamingServerTest.cpp
View file @
ceaa1585
...
...
@@ -41,6 +41,7 @@ int main(int argc, char** argv)
VistaTimeUtils
::
Sleep
(
100
);
}
VistaTimeUtils
::
Sleep
(
1000
);
VistaTimeUtils
::
Sleep
(
2000
);
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment