Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VACore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
6
Issues
6
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)
VACore
Commits
5663a6d7
Commit
5663a6d7
authored
Feb 23, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring and WIP dummy audio backend, which will be renamed to virtual audio backend
parent
227cbd4f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
63 deletions
+118
-63
src/Drivers/Audio/VAASIOBackend.h
src/Drivers/Audio/VAASIOBackend.h
+2
-1
src/Drivers/Audio/VADummyAudioDriverBackend.cpp
src/Drivers/Audio/VADummyAudioDriverBackend.cpp
+35
-9
src/Drivers/Audio/VADummyAudioDriverBackend.h
src/Drivers/Audio/VADummyAudioDriverBackend.h
+32
-10
src/VACoreImpl.cpp
src/VACoreImpl.cpp
+48
-42
src/VACoreImpl.h
src/VACoreImpl.h
+1
-1
No files found.
src/Drivers/Audio/VAASIOBackend.h
View file @
5663a6d7
...
...
@@ -29,7 +29,8 @@
* fr ASIO mittels des ITAsioInterface
*/
class
CVAASIOBackend
:
public
IVAAudioDriverBackend
{
class
CVAASIOBackend
:
public
IVAAudioDriverBackend
{
public:
/**
* Ldt die Konfigurationsdatei "ASIO.ini" und liest diese ein.
...
...
src/Drivers/Audio/VADummyAudioDriverBackend.cpp
View file @
5663a6d7
...
...
@@ -8,14 +8,15 @@
#include <cassert>
CVADummyAudioDriverBackend
::
CVADummyAudioDriverBackend
(
const
CVAAudioDriverConfig
&
config
)
:
m_oConfig
(
config
),
m_pStreamPump
(
NULL
)
CVADummyAudioDriverBackend
::
CVADummyAudioDriverBackend
(
const
CVAAudioDriverConfig
*
pConfig
)
:
CVAObject
(
"VirtualAudioDriver"
)
,
m_oConfig
(
*
pConfig
)
,
m_pDataSource
(
NULL
)
,
m_bStarted
(
false
)
{
m_oOutputStreamProps
.
dSamplerate
=
config
.
dSamplerate
;
m_oOutputStreamProps
.
uiChannels
=
(
unsigned
int
)
config
.
iOutputs
;
m_oOutputStreamProps
.
uiBlocklength
=
(
unsigned
int
)
config
.
iBuffersize
;
m_pStreamPump
=
new
ITAStreamPump
(
m_oOutputStreamProps
.
dSamplerate
=
m_oConfig
.
dSampleRate
;
m_oOutputStreamProps
.
uiChannels
=
(
unsigned
int
)
m_oConfig
.
iOutputChannels
;
m_oOutputStreamProps
.
uiBlocklength
=
(
unsigned
int
)
m_oConfig
.
iBuffersize
;
}
CVADummyAudioDriverBackend
::~
CVADummyAudioDriverBackend
()
...
...
@@ -35,7 +36,7 @@ std::string CVADummyAudioDriverBackend::getDeviceName() const
int
CVADummyAudioDriverBackend
::
getNumberOfInputs
()
const
{
return
m_
config
.
iInput
s
;
return
m_
oConfig
.
iInputChannel
s
;
}
const
ITAStreamProperties
*
CVADummyAudioDriverBackend
::
getOutputStreamProperties
()
const
...
...
@@ -43,9 +44,14 @@ const ITAStreamProperties* CVADummyAudioDriverBackend::getOutputStreamProperties
return
&
m_oOutputStreamProps
;
}
void
CVADummyAudioDriverBackend
::
setOutputStreamDatasource
(
ITADatasource
*
pDatasource
)
void
CVADummyAudioDriverBackend
::
setOutputStreamDatasource
(
ITADatasource
*
pDatasource
)
{
m_pDataSource
=
pDatasource
;
}
ITADatasource
*
CVADummyAudioDriverBackend
::
getInputStreamDatasource
()
const
{
return
nullptr
;
}
void
CVADummyAudioDriverBackend
::
initialize
()
...
...
@@ -60,10 +66,30 @@ void CVADummyAudioDriverBackend::finalize()
void
CVADummyAudioDriverBackend
::
startStreaming
()
{
m_bStarted
=
true
;
}
bool
CVADummyAudioDriverBackend
::
isStreaming
()
{
return
m_bStarted
;
}
void
CVADummyAudioDriverBackend
::
stopStreaming
()
{
m_bStarted
=
false
;
}
CVAStruct
CVADummyAudioDriverBackend
::
CallObject
(
const
CVAStruct
&
oArgs
)
{
CVAStruct
oReturn
;
if
(
oArgs
.
HasKey
(
"trigger"
)
&&
m_pDataSource
)
m_pDataSource
->
IncrementBlockPointer
();
if
(
oArgs
.
HasKey
(
"help"
)
||
oArgs
.
HasKey
(
"info"
)
)
{
oReturn
[
"usage"
]
=
"Call this virtual audio device with key 'trigger' to trigger another audio block increment"
;
}
return
oReturn
;
}
src/Drivers/Audio/VADummyAudioDriverBackend.h
View file @
5663a6d7
#ifndef __VA_DUMMYAUDIODRIVERBACKEND_H__
#define __VA_DUMMYAUDIODRIVERBACKEND_H__
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A Virtual Acoustics (VA) | http://www.virtualacoustics.org
* VVV VVV AAA Licensed under the Apache License, Version 2.0
* VVV VVV AAA
* VVV VVV AAA Copyright 2015-2018
* VVVVVV AAA Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University
*
* --------------------------------------------------------------------------------------------
*/
#ifndef IW_VACORE_DUMMY_AUDIO_DRIVER_BACKEND
#define IW_VACORE_DUMMY_AUDIO_DRIVER_BACKEND
#include "VAAudioDriverBackend.h"
#include "VAAudioDriverConfig.h"
#include <VAObject.h>
#include <ITAStreamProperties.h>
#include <ITA
StreamPump
.h>
#include <ITA
Datasource
.h>
class
ITAStreamPump
;
#pragma warning( disable : 4512 ) // yep no copy constructor
class
CVADummyAudioDriverBackend
:
public
IVAAudioDriverBackend
{
class
CVADummyAudioDriverBackend
:
public
IVAAudioDriverBackend
,
public
CVAObject
{
public:
CVADummyAudioDriverBackend
(
const
CVAAudioDriverConfig
&
pConfig
);
CVADummyAudioDriverBackend
(
const
CVAAudioDriverConfig
*
pConfig
);
~
CVADummyAudioDriverBackend
();
std
::
string
getDriverName
()
const
;
std
::
string
getDeviceName
()
const
;
int
getNumberOfInputs
()
const
;
const
ITAStreamProperties
*
getOutputStreamProperties
()
const
;
void
setOutputStreamDatasource
(
ITADatasource
*
pDatasource
);
void
setOutputStreamDatasource
(
ITADatasource
*
pDatasource
);
ITADatasource
*
getInputStreamDatasource
()
const
;
void
initialize
();
void
finalize
();
void
startStreaming
();
bool
isStreaming
();
void
stopStreaming
();
CVAStruct
CallObject
(
const
CVAStruct
&
oArgs
);
private:
const
CVAAudioDriverConfig
m_oConfig
;
ITAStreamProperties
m_oOutputStreamProps
;
ITAStreamPump
m_pStreamPump
;
ITADatasource
*
m_pDataSource
;
bool
m_bStarted
;
};
#endif //
__VA_DUMMYAUDIODRIVERBACKEND_H__
#endif //
IW_VACORE_DUMMY_AUDIO_DRIVER_BACKEND
src/VACoreImpl.cpp
View file @
5663a6d7
...
...
@@ -49,6 +49,9 @@
#ifdef VACORE_WITH_AUDIO_BACKEND_PORTAUDIO
#include "Drivers/Audio/VAPortaudioBackend.h"
#endif
#ifdef VACORE_WITH_AUDIO_BACKEND_DUMMY
#include "Drivers/Audio/VADummyAudioDriverBackend.h"
#endif
// ITA includes
#include <ITAASCIITable.h>
...
...
@@ -223,7 +226,7 @@ CVAStruct VACore::LoadCoreConfigFromFile( const std::string& sConfigFilePath )
}
if
(
!
oCurrentConfigFile
.
Exists
()
)
{
{
VA_EXCEPT2
(
FILE_NOT_FOUND
,
"Configuration file '"
+
oCurrentConfigFile
.
GetLocalName
()
+
"' not found, aborting."
);
}
}
...
...
@@ -283,41 +286,40 @@ std::string VACore::GetCoreLibFilePath()
}
CVACoreImpl
::
CVACoreImpl
(
const
CVAStruct
&
oArgs
,
std
::
ostream
*
pOutputStream
)
:
m_pAudioDriverBackend
(
nullptr
),
m_pGlobalSamplePool
(
nullptr
),
m_pGlobalSampler
(
nullptr
),
m_pSignalSourceManager
(
nullptr
),
m_pDirectivityManager
(
nullptr
),
m_pSceneManager
(
nullptr
),
m_pNewSceneState
(
nullptr
),
m_iCurActiveSoundReceiver
(
-
1
),
m_iNewActiveSoundReceiver
(
-
1
),
m_iUpdActiveSoundReceiver
(
-
1
),
m_pEventManager
(
nullptr
),
m_pCoreThread
(
nullptr
),
m_pInputAmp
(
nullptr
),
m_pR2RPatchbay
(
nullptr
),
m_pOutputPatchbay
(
nullptr
),
m_pInputStreamDetector
(
nullptr
),
m_pOutputStreamDetector
(
nullptr
),
m_pOutputTracker
(
nullptr
),
m_pStreamProbeDeviceInput
(
nullptr
),
m_pStreamProbeFinal
(
nullptr
),
m_pCurSceneState
(
nullptr
),
m_pClock
(
ITAClock
::
getDefaultClock
()
),
m_pTicker
(
NULL
),
m_lSyncModOwner
(
-
1
),
m_lSyncModSpinCount
(
0
),
m_iState
(
VA_CORESTATE_CREATED
),
// TODO: Welche Default-Wert mssen erst in Initialize gesetzt werden?
m_iGlobalAuralizationMode
(
IVAInterface
::
VA_AURAMODE_ALL
),
m_dOutputGain
(
1
),
m_dInputGain
(
1
),
m_bOutputMuted
(
false
),
m_bInputMuted
(
false
),
m_dStreamClockOffset
(
0
),
m_fCoreClockOffset
(
0
),
// --= Profiling =--
m_pmCoreThreadLoopTotalDuration
(
"Core thread loop"
)
:
m_pAudioDriverBackend
(
nullptr
)
,
m_pGlobalSamplePool
(
nullptr
)
,
m_pGlobalSampler
(
nullptr
)
,
m_pSignalSourceManager
(
nullptr
)
,
m_pDirectivityManager
(
nullptr
)
,
m_pSceneManager
(
nullptr
)
,
m_pNewSceneState
(
nullptr
)
,
m_iCurActiveSoundReceiver
(
-
1
)
,
m_iNewActiveSoundReceiver
(
-
1
)
,
m_iUpdActiveSoundReceiver
(
-
1
)
,
m_pEventManager
(
nullptr
)
,
m_pCoreThread
(
nullptr
)
,
m_pInputAmp
(
nullptr
)
,
m_pR2RPatchbay
(
nullptr
)
,
m_pOutputPatchbay
(
nullptr
)
,
m_pInputStreamDetector
(
nullptr
)
,
m_pOutputStreamDetector
(
nullptr
)
,
m_pOutputTracker
(
nullptr
)
,
m_pStreamProbeDeviceInput
(
nullptr
)
,
m_pStreamProbeFinal
(
nullptr
)
,
m_pCurSceneState
(
nullptr
)
,
m_pClock
(
ITAClock
::
getDefaultClock
()
)
,
m_pTicker
(
NULL
)
,
m_lSyncModOwner
(
-
1
)
,
m_lSyncModSpinCount
(
0
)
,
m_iState
(
VA_CORESTATE_CREATED
)
,
m_iGlobalAuralizationMode
(
IVAInterface
::
VA_AURAMODE_ALL
)
,
m_dOutputGain
(
1
)
,
m_dInputGain
(
1
)
,
m_bOutputMuted
(
false
)
,
m_bInputMuted
(
false
)
,
m_dStreamClockOffset
(
0
)
,
m_fCoreClockOffset
(
0
)
,
m_oCoreThreadLoopTotalDuration
(
"Core thread loop"
)
{
VA_NO_REENTRANCE
;
...
...
@@ -382,7 +384,7 @@ CVACoreImpl::~CVACoreImpl()
VA_TRACE
(
"Core"
,
"CVACoreImpl instance deleted ["
<<
this
<<
"]"
);
// Profiling ausgeben
VA_VERBOSE
(
"Core"
,
m_
pm
CoreThreadLoopTotalDuration
.
ToString
()
);
VA_VERBOSE
(
"Core"
,
m_
o
CoreThreadLoopTotalDuration
.
ToString
()
);
}
void
CVACoreImpl
::
SetOutputStream
(
std
::
ostream
*
posDebug
)
...
...
@@ -893,7 +895,7 @@ void CVACoreImpl::GetModules( std::vector< CVAModuleInfo >& viModuleInfos ) cons
viModuleInfos
[
i
].
sName
=
v
[
i
].
sName
;
viModuleInfos
[
i
].
sDesc
=
v
[
i
].
sDesc
;
}
}
}
VA_RETHROW
;
#else // VACORE_MODULE_INTERFACE_ENABLED
...
...
@@ -902,7 +904,7 @@ void CVACoreImpl::GetModules( std::vector< CVAModuleInfo >& viModuleInfos ) cons
#endif // VACORE_MODULE_INTERFACE_ENABLED
}
}
CVAStruct
CVACoreImpl
::
CallModule
(
const
std
::
string
&
sModuleName
,
const
CVAStruct
&
oArgs
)
{
...
...
@@ -4327,7 +4329,11 @@ void CVACoreImpl::InitializeAudioDriver()
#endif
#ifdef VACORE_WITH_AUDIO_BACKEND_DUMMY
if
(
m_oCoreConfig
.
oAudioDriverConfig
.
sDriver
==
"Dummy"
)
m_pAudioDriverBackend
=
new
CVADummyBackend
(
&
m_oCoreConfig
.
oAudioDriverConfig
);
{
CVADummyAudioDriverBackend
*
pAudioDriverBackend
=
new
CVADummyAudioDriverBackend
(
&
m_oCoreConfig
.
oAudioDriverConfig
);
RegisterModule
(
pAudioDriverBackend
);
m_pAudioDriverBackend
=
pAudioDriverBackend
;
}
#endif
if
(
m_pAudioDriverBackend
==
nullptr
)
...
...
@@ -4871,7 +4877,7 @@ void CVACoreImpl::FinishProgress()
void
CVACoreImpl
::
CoreThreadLoop
()
{
m_
pm
CoreThreadLoopTotalDuration
.
start
();
m_
o
CoreThreadLoopTotalDuration
.
start
();
assert
(
m_pCurSceneState
!=
nullptr
);
assert
(
m_pCurSceneState
->
GetNumReferences
()
>=
1
);
...
...
@@ -4940,7 +4946,7 @@ void CVACoreImpl::CoreThreadLoop()
pNewSceneState
->
RemoveReference
();
}
m_
pm
CoreThreadLoopTotalDuration
.
stop
();
m_
o
CoreThreadLoopTotalDuration
.
stop
();
// @todo: signal event to process object calls (in-sync exec with internal core)
...
...
src/VACoreImpl.h
View file @
5663a6d7
...
...
@@ -455,7 +455,7 @@ private:
// --= Profiling =--
CVAProfilerMeasure
m_
pm
CoreThreadLoopTotalDuration
;
CVAProfilerMeasure
m_
o
CoreThreadLoopTotalDuration
;
// -------------------------------------------------
...
...
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