Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITADataSources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITADataSources
Commits
7ee2ae14
Commit
7ee2ae14
authored
Feb 20, 2017
by
Anne Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfixes deiconnect not running
parent
01cb7c2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
src/ITANetAudioMessage.cpp
src/ITANetAudioMessage.cpp
+6
-7
src/ITANetAudioStreamingClient.cpp
src/ITANetAudioStreamingClient.cpp
+5
-3
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
+4
-5
No files found.
src/ITANetAudioMessage.cpp
View file @
7ee2ae14
...
@@ -27,7 +27,7 @@ CITANetAudioMessage::CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwap
...
@@ -27,7 +27,7 @@ CITANetAudioMessage::CITANetAudioMessage( VistaSerializingToolset::ByteOrderSwap
void
CITANetAudioMessage
::
ResetMessage
()
void
CITANetAudioMessage
::
ResetMessage
()
{
{
if
(
m_oIncoming
.
GetTailSize
()
>
0
)
if
(
m_oIncoming
.
GetTailSize
()
>
0
)
//
vstr::err() << "CITANetAudioMessage::ResetMessage() called before message was fully processed!" << std::endl;
vstr
::
err
()
<<
"CITANetAudioMessage::ResetMessage() called before message was fully processed!"
<<
std
::
endl
;
// wait till sending is complete -> this prevents us
// wait till sending is complete -> this prevents us
// from deleting the buffer while it is still being read
// from deleting the buffer while it is still being read
...
@@ -115,14 +115,13 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
...
@@ -115,14 +115,13 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
#if NET_AUDIO_SHOW_TRAFFIC
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] Waiting for incoming data"
<<
std
::
endl
;
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] Waiting for incoming data"
<<
std
::
endl
;
#endif
#endif
double
dTimeBefore
=
ITAClock
::
getDefaultClock
(
)
->
getTime
(
);
// WaitForIncomming Data int in ca ms
// WaitForIncomming Data int in ca ms
long
nIncomingBytes
=
m_pConnection
->
WaitForIncomingData
(
timeout
);
long
nIncomingBytes
=
m_pConnection
->
WaitForIncomingData
(
timeout
);
double
dTimeAfter
=
ITAClock
::
getDefaultClock
(
)
->
getTime
(
);
double
DTimeDiff
=
dTimeAfter
-
dTimeBefore
;
// TODO Timer entfernen
// TODO Timer entfernen
if
(
nIncomingBytes
==
-
1
)
if
(
nIncomingBytes
==
-
1
)
return
false
;
return
false
;
else
int
a
=
5
;
if
(
timeout
!=
0
)
if
(
timeout
!=
0
)
nIncomingBytes
=
m_pConnection
->
WaitForIncomingData
(
0
);
nIncomingBytes
=
m_pConnection
->
WaitForIncomingData
(
0
);
...
@@ -136,8 +135,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
...
@@ -136,8 +135,8 @@ bool CITANetAudioMessage::ReadMessage( int timeout)
#if NET_AUDIO_SHOW_TRAFFIC
#if NET_AUDIO_SHOW_TRAFFIC
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] Expecting "
<<
nMessagePayloadSize
<<
" bytes message payload"
<<
std
::
endl
;
vstr
::
out
()
<<
"CITANetAudioMessage [ Reading ] Expecting "
<<
nMessagePayloadSize
<<
" bytes message payload"
<<
std
::
endl
;
#endif
#endif
if
(
nMessagePayloadSize
<=
2
*
sizeof
(
VistaType
::
sint32
)
)
if
(
nMessagePayloadSize
<=
0
)
int
i
=
34
;
return
false
;
// we need at least the two protocol ints
// we need at least the two protocol ints
//assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
//assert( nMessagePayloadSize >= 2 * sizeof( VistaType::sint32 ) );
...
...
src/ITANetAudioStreamingClient.cpp
View file @
7ee2ae14
...
@@ -68,13 +68,14 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
...
@@ -68,13 +68,14 @@ CITANetAudioStreamingClient::CITANetAudioStreamingClient( CITANetAudioStream* pP
CITANetAudioStreamingClient
::~
CITANetAudioStreamingClient
()
CITANetAudioStreamingClient
::~
CITANetAudioStreamingClient
()
{
{
//try{
//try{
if
(
m_pConnection
->
GetIs
Open
())
if
(
m_pConnection
->
GetIs
Connected
())
{
{
m_pMessage
->
ResetMessage
();
m_pMessage
->
ResetMessage
();
m_pMessage
->
SetConnection
(
m_pConnection
);
m_pMessage
->
SetConnection
(
m_pConnection
);
m_pMessage
->
SetMessageType
(
CITANetAudioProtocol
::
NP_CLIENT_CLOSE
);
m_pMessage
->
SetMessageType
(
CITANetAudioProtocol
::
NP_CLIENT_CLOSE
);
m_pMessage
->
WriteBool
(
true
);
m_pMessage
->
WriteMessage
();
m_pMessage
->
WriteMessage
();
m_pClient
->
Disconnect
();
//
m_pClient->Disconnect();
}
}
delete
m_pClientLogger
;
delete
m_pClientLogger
;
//}
//}
...
@@ -154,8 +155,9 @@ bool CITANetAudioStreamingClient::LoopBody()
...
@@ -154,8 +155,9 @@ bool CITANetAudioStreamingClient::LoopBody()
vstr
::
out
(
)
<<
"[ITANetAudioStreamingServer] Unkown protocol type : "
<<
iMsgType
<<
std
::
endl
;
vstr
::
out
(
)
<<
"[ITANetAudioStreamingServer] Unkown protocol type : "
<<
iMsgType
<<
std
::
endl
;
break
;
break
;
}
}
oLog
.
iChannel
=
m_pStream
->
GetNumberOfChannels
(
);
oLog
.
iChannel
=
m_pStream
->
GetNumberOfChannels
();
oLog
.
iProtocolStatus
=
iMsgType
;
oLog
.
iProtocolStatus
=
iMsgType
;
oLog
.
iFreeSamples
=
m_pStream
->
GetRingBufferFreeSamples
();
oLog
.
dWorldTimeStamp
=
ITAClock
::
getDefaultClock
(
)
->
getTime
(
);
oLog
.
dWorldTimeStamp
=
ITAClock
::
getDefaultClock
(
)
->
getTime
(
);
m_pClientLogger
->
log
(
oLog
);
m_pClientLogger
->
log
(
oLog
);
}
}
...
...
tests/NetAudio/ITANetAudioStreamingClientTest.cpp
View file @
7ee2ae14
...
@@ -32,7 +32,7 @@ int main(int argc, char* argv[])
...
@@ -32,7 +32,7 @@ int main(int argc, char* argv[])
cout
<<
"Channel "
<<
iChannels
<<
endl
;
cout
<<
"Channel "
<<
iChannels
<<
endl
;
CITANetAudioStream
oNetAudioStream
(
iChannels
,
dSampleRate
,
iBlockLength
,
1
*
iBufferSize
);
CITANetAudioStream
oNetAudioStream
(
iChannels
,
dSampleRate
,
iBlockLength
,
1
*
iBufferSize
);
/*
ITAStreamPatchbay oPatchbay(dSampleRate, iBlockLength);
ITAStreamPatchbay oPatchbay(dSampleRate, iBlockLength);
oPatchbay.AddInput( &oNetAudioStream );
oPatchbay.AddInput( &oNetAudioStream );
int iOutputID = oPatchbay.AddOutput( 2 );
int iOutputID = oPatchbay.AddOutput( 2 );
...
@@ -40,8 +40,8 @@ int main(int argc, char* argv[])
...
@@ -40,8 +40,8 @@ int main(int argc, char* argv[])
int N = int( oNetAudioStream.GetNumberOfChannels( ) );
int N = int( oNetAudioStream.GetNumberOfChannels( ) );
for ( int i = 0; i < N; i++ )
for ( int i = 0; i < N; i++ )
oPatchbay.ConnectChannels( 0, i, 0, i % 2, 1 / double( N ) );
oPatchbay.ConnectChannels( 0, i, 0, i % 2, 1 / double( N ) );
*/
ITAStreamProbe
oProbe
(
oPatchbay
.
GetOutputDatasource
(
iOutputID
),
"ITANetAudioTest.stream.wav"
);
//
ITAStreamProbe oProbe( oPatchbay.GetOutputDatasource( iOutputID ), "ITANetAudioTest.stream.wav" );
ITAsioInitializeLibrary
();
ITAsioInitializeLibrary
();
...
@@ -90,7 +90,7 @@ int main(int argc, char* argv[])
...
@@ -90,7 +90,7 @@ int main(int argc, char* argv[])
}
}
ITAsioSetPlaybackDatasource
(
&
oProbe
);
ITAsioSetPlaybackDatasource
(
&
oNetAudioStream
);
if
(
ITAsioStart
()
!=
ASE_OK
)
{
if
(
ITAsioStart
()
!=
ASE_OK
)
{
ITAsioFinalizeLibrary
();
ITAsioFinalizeLibrary
();
...
@@ -133,7 +133,6 @@ int main(int argc, char* argv[])
...
@@ -133,7 +133,6 @@ int main(int argc, char* argv[])
return
255
;
return
255
;
}
}
ITAsioFinalizeLibrary
();
ITAsioFinalizeLibrary
();
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
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