Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Institute of Technical Acoustics (ITA)
VABase
Commits
00f0cc59
Commit
00f0cc59
authored
Feb 16, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing net stream audio classes (moved to VACore due to dependencies to ITACoreLibs)
parent
2a6b6ebf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
189 deletions
+0
-189
include/VANetworkStreamAudioSignalSource.h
include/VANetworkStreamAudioSignalSource.h
+0
-67
include/_SourceFiles.cmake
include/_SourceFiles.cmake
+0
-1
src/VANetworkStreamAudioSignalSource.cpp
src/VANetworkStreamAudioSignalSource.cpp
+0
-21
src/_SourceFiles.cmake
src/_SourceFiles.cmake
+0
-1
tests/CMakeLists.txt
tests/CMakeLists.txt
+0
-10
tests/NetworkStreamAudioSignalSourceTest.cpp
tests/NetworkStreamAudioSignalSourceTest.cpp
+0
-89
No files found.
include/VANetworkStreamAudioSignalSource.h
deleted
100644 → 0
View file @
2a6b6ebf
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_VABASE_NETWORK_STREAM_AUDIO_SIGNAL_SOURCE
#define IW_VABASE_NETWORK_STREAM_AUDIO_SIGNAL_SOURCE
#include <VABaseDefinitions.h>
#include <VASamples.h>
#include <VAStruct.h>
//! Helper class for server-side network audio signal sources
/**
* Provides network functionality for an audio signal source.
* Transmit method has to be executed by user, status information
* for the queued samples on client side can be received.
*/
class
VABASE_API
CVANetworkStreamAudioSignalSource
{
public:
//! Create a network signal source
/**
* @param[in] sServerBindAddress Server name or IP
* @param[in] iServerBindPort Server port number
*/
CVANetworkStreamAudioSignalSource
(
const
std
::
string
&
sServerBindAddress
=
"localhost"
,
const
int
iServerBindPort
=
12480
);
virtual
~
CVANetworkStreamAudioSignalSource
();
//! Transmit samples of arbitrary lengths
/**
* Transmit a frame of samples (buffer for one or more channels) over the network
* connection. The entire length of the buffer(s) will be send and execution is blocked
* until finished.
*
* @param[in] oFrame Vector of samples in a buffer with same length
*
* @note Will raise VAException if problem with connection occurs
*/
int
Transmit
(
const
std
::
vector
<
CVASampleBuffer
>&
oFrame
);
//! Returns the internal number of queued samples at client side (last known state)
/**
* At client side, a ring buffer with at least the number of samples for one processing block
* is used.
*
* @return Number of queued samples at client side
*
* @note thread-safe
*/
int
GetNumQueuedSamples
();
private:
int
m_iNumQueuedSamples
;
//!< Client-side number of queued samples
};
#endif // IW_VABASE_NETWORK_STREAM_AUDIO_SIGNAL_SOURCE
include/_SourceFiles.cmake
View file @
00f0cc59
...
...
@@ -12,7 +12,6 @@ set( DirFiles
VACoreVersion.h
VAEventHandlerGlobalLock.h
VAException.h
VANetworkStreamAudioSignalSource.h
VAObject.h
VAObjectRegistry.h
VASamples.h
...
...
src/VANetworkStreamAudioSignalSource.cpp
deleted
100644 → 0
View file @
2a6b6ebf
#include <VANetworkStreamAudioSignalSource.h>
CVANetworkStreamAudioSignalSource
::
CVANetworkStreamAudioSignalSource
(
const
std
::
string
&
sServerBindAddress
/* = "localhost" */
,
const
int
iServerBindPort
/* = 12480 */
)
{
}
CVANetworkStreamAudioSignalSource
::~
CVANetworkStreamAudioSignalSource
()
{
}
int
CVANetworkStreamAudioSignalSource
::
GetNumQueuedSamples
()
{
return
0
;
}
int
CVANetworkStreamAudioSignalSource
::
Transmit
(
const
std
::
vector
<
CVASampleBuffer
>&
oFrame
)
{
return
0
;
}
\ No newline at end of file
src/_SourceFiles.cmake
View file @
00f0cc59
...
...
@@ -11,7 +11,6 @@ set( DirFiles
VACoreVersion.cpp
VAEventHandlerGlobalLock.cpp
VAException.cpp
VANetworkStreamAudioSignalSource.cpp
VAObject.cpp
VAObjectRegistry.cpp
VASamples.cpp
...
...
tests/CMakeLists.txt
View file @
00f0cc59
...
...
@@ -34,13 +34,3 @@ vista_install( StructTest )
vista_create_default_info_file
(
StructTest
)
set_property
(
TARGET StructTest PROPERTY FOLDER
"VA/Tests/VABase"
)
add_executable
(
NetworkStreamAudioSignalSourceTest NetworkStreamAudioSignalSourceTest.cpp
)
target_link_libraries
(
NetworkStreamAudioSignalSourceTest
${
VISTA_USE_PACKAGE_LIBRARIES
}
)
vista_configure_app
(
NetworkStreamAudioSignalSourceTest
)
vista_install
(
NetworkStreamAudioSignalSourceTest
)
vista_create_default_info_file
(
NetworkStreamAudioSignalSourceTest
)
set_property
(
TARGET NetworkStreamAudioSignalSourceTest PROPERTY FOLDER
"VA/Tests/VABase"
)
tests/NetworkStreamAudioSignalSourceTest.cpp
deleted
100644 → 0
View file @
2a6b6ebf
#include <VAException.h>
#include <VANetworkStreamAudioSignalSource.h>
#include <VASamples.h>
#include <VistaInterProcComm/Concurrency/VistaTicker.h>
#include <VistaBase/VistaTimeUtils.h>
#include <algorithm>
using
namespace
std
;
const
static
int
g_iBlockLength
=
128
;
const
static
double
g_dSampleRate
=
44.1e3
;
//! Example for a sample generator class
struct
CVATestSampleGenerator
{
inline
CVATestSampleGenerator
()
{
voBuffer
.
push_back
(
CVASampleBuffer
(
g_iBlockLength
)
);
// single channel
dFrequency
=
567.8
f
;
};
inline
void
CalculateMoreSamples
(
const
int
nSamples
)
{
// Generate a sinusoidal signal
for
(
int
i
=
0
;
i
<
nSamples
;
i
++
)
{
dVal
+=
i
/
double
(
g_iBlockLength
)
*
2.0
f
*
3.1415
f
*
dFrequency
;
voBuffer
[
0
].
GetData
()[
0
]
=
float
(
sin
(
dVal
)
);
}
dVal
=
fmod
(
dVal
,
2
*
3.1415
f
);
};
std
::
vector
<
CVASampleBuffer
>
voBuffer
;
double
dFrequency
;
private:
double
dVal
;
};
//! Example sample server class that provides a network audio feed based on an own timeout
class
CVATestSampleServer
:
public
CVANetworkStreamAudioSignalSource
,
public
VistaTicker
::
AfterPulseFunctor
{
public:
inline
CVATestSampleServer
()
{
double
dBlockRate
=
g_dSampleRate
/
double
(
g_iBlockLength
);
int
iTimeoutMilliseconds
=
int
(
std
::
round
(
dBlockRate
*
1.0e-3
)
);
m_pTimeoutTicker
=
new
VistaTicker
();
m_pTimeoutTicker
->
AddTrigger
(
new
VistaTicker
::
TriggerContext
(
iTimeoutMilliseconds
,
true
)
);
m_pTimeoutTicker
->
StartTicker
();
m_pTimeoutTicker
->
SetAfterPulseFunctor
(
this
);
};
inline
~
CVATestSampleServer
()
{
m_pTimeoutTicker
->
SetAfterPulseFunctor
(
NULL
);
m_pTimeoutTicker
->
StopTicker
();
delete
m_pTimeoutTicker
;
};
// Overload VistaTicker AfterPulseFunctor callback function
virtual
inline
bool
operator
()()
{
int
nNumSamples
=
CVANetworkStreamAudioSignalSource
::
GetNumQueuedSamples
();
// Choose your strategy ...
if
(
nNumSamples
>
0
)
{
m_oSampleGenerator
.
CalculateMoreSamples
(
nNumSamples
);
CVANetworkStreamAudioSignalSource
::
Transmit
(
m_oSampleGenerator
.
voBuffer
);
}
return
true
;
};
private:
VistaTicker
*
m_pTimeoutTicker
;
CVATestSampleGenerator
m_oSampleGenerator
;
};
int
main
(
int
,
char
**
)
{
CVATestSampleServer
oSampleServer
;
VistaTimeUtils
::
Sleep
(
int
(
10e3
)
);
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