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
f1f254e7
Commit
f1f254e7
authored
Oct 17, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving more source code, now all looks tidy
parent
91cbae21
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
5569 additions
and
5236 deletions
+5569
-5236
src/core/_SourceFiles.cmake
src/core/_SourceFiles.cmake
+23
-1
src/core/clock.cpp
src/core/clock.cpp
+45
-0
src/core/config.cpp
src/core/config.cpp
+143
-0
src/core/control.cpp
src/core/control.cpp
+211
-0
src/core/core.cpp
src/core/core.cpp
+0
-5028
src/core/dummy.cpp
src/core/dummy.cpp
+14
-0
src/core/events.cpp
src/core/events.cpp
+64
-0
src/core/file_handling.cpp
src/core/file_handling.cpp
+175
-0
src/core/finalize.cpp
src/core/finalize.cpp
+161
-0
src/core/homogeneous_medium.cpp
src/core/homogeneous_medium.cpp
+116
-0
src/core/init.cpp
src/core/init.cpp
+0
-207
src/core/initialize.cpp
src/core/initialize.cpp
+774
-0
src/core/locking.cpp
src/core/locking.cpp
+127
-0
src/core/module.cpp
src/core/module.cpp
+94
-0
src/core/object.cpp
src/core/object.cpp
+184
-0
src/core/progress.cpp
src/core/progress.cpp
+71
-0
src/core/rendering.cpp
src/core/rendering.cpp
+214
-0
src/core/reproduction.cpp
src/core/reproduction.cpp
+234
-0
src/core/reset.cpp
src/core/reset.cpp
+92
-0
src/core/scene.cpp
src/core/scene.cpp
+89
-0
src/core/signal_source.cpp
src/core/signal_source.cpp
+521
-0
src/core/sound_portal.cpp
src/core/sound_portal.cpp
+164
-0
src/core/sound_receiver.cpp
src/core/sound_receiver.cpp
+1005
-0
src/core/sound_source.cpp
src/core/sound_source.cpp
+873
-0
src/core/state.cpp
src/core/state.cpp
+25
-0
src/core/thread_loop.cpp
src/core/thread_loop.cpp
+112
-0
src/core/version.cpp
src/core/version.cpp
+38
-0
No files found.
src/core/_SourceFiles.cmake
View file @
f1f254e7
...
...
@@ -3,12 +3,34 @@ set( RelativeSourceGroup "src\\core" )
set
(
SubDirs
)
set
(
DirFiles
clock.cpp
config.cpp
control.cpp
core.h
core.cpp
directivity.cpp
events.cpp
file_handling.cpp
finalize.cpp
geometry.cpp
init.cpp
homogeneous_medium.cpp
initialize.cpp
locking.cpp
material.cpp
module.cpp
object.cpp
progress.cpp
rendering.cpp
reproduction.cpp
reset.cpp
scene.cpp
signal_source.cpp
sound_portal.cpp
sound_receiver.cpp
sound_source.cpp
state.cpp
thread_loop.cpp
version.cpp
_SourceFiles.cmake
)
set
(
DirFiles_SourceGroup
"
${
RelativeSourceGroup
}
"
)
...
...
src/core/clock.cpp
0 → 100644
View file @
f1f254e7
/*
* --------------------------------------------------------------------------------------------
*
* 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
*
* --------------------------------------------------------------------------------------------
*/
#include "core.h"
double
CVACoreImpl
::
GetCoreClock
()
const
{
// Clock ist immer da, reentrance hier erlaubt
double
dNow
=
m_pClock
->
getTime
();
double
dOffset
=
(
double
)
m_fCoreClockOffset
;
return
(
dNow
-
dOffset
);
}
void
CVACoreImpl
::
SetCoreClock
(
const
double
dSeconds
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
VA_TRY
{
if
(
dSeconds
<
0
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Time must not be negative"
);
// Aktuelle Zeit holen
double
dNow
=
m_pClock
->
getTime
();
double
dOffset
=
dSeconds
-
dNow
;
// TODO: Sollte eigentlich ber doubles gehen. Leider noch keine AtomicDoubles...
m_fCoreClockOffset
=
(
float
)
dOffset
;
VA_VERBOSE
(
"Core"
,
"Set clock to "
<<
timeToString
(
dSeconds
)
);
}
VA_RETHROW
;
}
src/core/config.cpp
0 → 100644
View file @
f1f254e7
/*
* --------------------------------------------------------------------------------------------
*
* 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
*
* --------------------------------------------------------------------------------------------
*/
#include "core.h"
const
CVACoreConfig
*
CVACoreImpl
::
GetCoreConfig
()
const
{
return
&
m_oCoreConfig
;
}
void
VACore
::
StoreCoreConfigToFile
(
const
CVAStruct
&
oConfig
,
const
std
::
string
&
sConfigFilePath
)
{
StoreStructToINIFile
(
sConfigFilePath
,
oConfig
);
}
CVAStruct
VACore
::
LoadCoreConfigFromFile
(
const
std
::
string
&
sConfigFilePath
)
{
CVAStruct
oFinalCoreConfigStruct
,
oCurrentConfig
;
VistaFileSystemFile
oConfigFile
(
sConfigFilePath
);
std
::
list
<
VistaFileSystemFile
>
voConfigFiles
;
std
::
vector
<
VistaFileSystemDirectory
>
voIncludePaths
;
if
(
oConfigFile
.
Exists
()
&&
oConfigFile
.
GetParentDirectory
().
empty
()
==
false
)
voIncludePaths
.
push_back
(
oConfigFile
.
GetParentDirectory
()
);
voConfigFiles
.
push_back
(
VistaFileSystemFile
(
sConfigFilePath
)
);
VA_INFO
(
"Core"
,
"Working directory: '"
<<
VistaFileSystemDirectory
::
GetCurrentWorkingDirectory
()
<<
"'"
);
while
(
voConfigFiles
.
empty
()
==
false
)
{
VistaFileSystemFile
oCurrentConfigFile
(
voConfigFiles
.
front
()
);
voConfigFiles
.
pop_front
();
if
(
oCurrentConfigFile
.
Exists
()
==
false
)
{
for
(
size_t
n
=
0
;
n
<
voIncludePaths
.
size
();
n
++
)
{
std
::
string
sCombinedFilePath
=
voIncludePaths
[
n
].
GetName
()
+
PATH_SEPARATOR
+
oCurrentConfigFile
.
GetLocalName
();
oCurrentConfigFile
.
SetName
(
sCombinedFilePath
);
if
(
oCurrentConfigFile
.
Exists
()
&&
oCurrentConfigFile
.
IsFile
()
)
{
VA_INFO
(
"Config"
,
"Including further configuration file '"
+
oCurrentConfigFile
.
GetLocalName
()
+
"' from include path '"
+
voIncludePaths
[
n
].
GetName
()
+
"'"
);
break
;
}
}
if
(
!
oCurrentConfigFile
.
Exists
()
)
{
VA_EXCEPT2
(
FILE_NOT_FOUND
,
"Configuration file '"
+
oCurrentConfigFile
.
GetLocalName
()
+
"' not found, aborting."
);
}
}
VA_VERBOSE
(
"Config"
,
std
::
string
(
"Reading INI file '"
)
+
oCurrentConfigFile
.
GetLocalName
()
+
"'"
);
LoadStructFromINIFIle
(
oCurrentConfigFile
.
GetName
(),
oCurrentConfig
);
if
(
oCurrentConfig
.
HasKey
(
"paths"
)
)
{
const
CVAStruct
&
oPaths
(
oCurrentConfig
[
"paths"
]
);
CVAStruct
::
const_iterator
it
=
oPaths
.
Begin
();
while
(
it
!=
oPaths
.
End
()
)
{
const
CVAStructValue
&
oIncludePath
(
(
it
++
)
->
second
);
VistaFileSystemDirectory
oNewPathDir
(
oIncludePath
);
if
(
oNewPathDir
.
Exists
()
&&
oNewPathDir
.
IsDirectory
()
)
voIncludePaths
.
push_back
(
oNewPathDir
);
}
}
if
(
oCurrentConfig
.
HasKey
(
"files"
)
)
{
const
CVAStruct
&
oPaths
(
oCurrentConfig
[
"files"
]
);
CVAStruct
::
const_iterator
it
=
oPaths
.
Begin
();
while
(
it
!=
oPaths
.
End
()
)
{
const
CVAStructValue
&
oIncludeFile
(
(
it
++
)
->
second
);
voConfigFiles
.
push_back
(
VistaFileSystemFile
(
oIncludeFile
)
);
}
}
oCurrentConfig
.
RemoveKey
(
"files"
);
// Merge structs (check for uniqueness)
oFinalCoreConfigStruct
.
Merge
(
oCurrentConfig
,
true
);
}
return
oFinalCoreConfigStruct
;
}
CVAStruct
CVACoreImpl
::
GetCoreConfiguration
(
const
bool
bFilterEnabled
)
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
CVAStruct
oCoreConfig
;
if
(
bFilterEnabled
)
{
CVAStruct
::
const_iterator
cit
=
m_oCoreConfig
.
GetStruct
().
Begin
();
while
(
cit
!=
m_oCoreConfig
.
GetStruct
().
End
()
)
{
const
std
::
string
sKey
(
cit
->
first
);
const
CVAStructValue
&
oVal
(
cit
->
second
);
++
cit
;
if
(
oVal
.
IsStruct
()
)
{
const
CVAStruct
&
oSection
(
oVal
.
GetStruct
()
);
if
(
oSection
.
HasKey
(
"enabled"
)
)
if
(
bool
(
oSection
[
"enabled"
]
)
==
false
)
continue
;
// Only skip if explicitly not enabled
oCoreConfig
[
sKey
]
=
oVal
;
}
}
}
else
{
oCoreConfig
=
m_oCoreConfig
.
GetStruct
();
}
return
oCoreConfig
;
}
CVAStruct
CVACoreImpl
::
GetHardwareConfiguration
()
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
return
m_oCoreConfig
.
oHardwareSetup
.
GetStruct
();
}
src/core/control.cpp
0 → 100644
View file @
f1f254e7
/*
* --------------------------------------------------------------------------------------------
*
* 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
*
* --------------------------------------------------------------------------------------------
*/
#include "core.h"
bool
CVACoreImpl
::
GetInputMuted
()
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
return
m_bInputMuted
;
}
void
CVACoreImpl
::
SetInputMuted
(
const
bool
bMuted
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
VA_TRY
{
if
(
m_bInputMuted
==
bMuted
)
return
;
m_bInputMuted
=
bMuted
;
if
(
m_pInputAmp
)
{
if
(
m_bInputMuted
)
m_pInputAmp
->
SetGain
(
0.0
f
);
else
m_pInputAmp
->
SetGain
(
(
float
)
m_dInputGain
);
}
VA_INFO
(
"Core"
,
"Input mute toggled"
);
CVAEvent
ev
;
ev
.
iEventType
=
CVAEvent
::
INPUT_MUTING_CHANGED
;
ev
.
pSender
=
this
;
ev
.
bMuted
=
m_bInputMuted
;
m_pEventManager
->
BroadcastEvent
(
ev
);
}
VA_RETHROW
;
}
double
CVACoreImpl
::
GetInputGain
()
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
return
m_dInputGain
;
}
void
CVACoreImpl
::
SetInputGain
(
double
dGain
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
VA_TRY
{
if
(
!
GetVolumeValid
(
dGain
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid gain"
);
if
(
m_dInputGain
==
dGain
)
return
;
m_dInputGain
=
dGain
;
if
(
m_pInputAmp
)
{
if
(
m_bInputMuted
)
m_pInputAmp
->
SetGain
(
0
);
else
m_pInputAmp
->
SetGain
(
(
float
)
dGain
);
}
// Ereignis generieren
CVAEvent
ev
;
ev
.
iEventType
=
CVAEvent
::
INPUT_GAIN_CHANGED
;
ev
.
pSender
=
this
;
ev
.
dVolume
=
dGain
;
m_pEventManager
->
BroadcastEvent
(
ev
);
VA_VERBOSE
(
"Core"
,
"Set input gain = "
<<
IVAInterface
::
GetVolumeStrDecibel
(
dGain
)
);
}
VA_RETHROW
;
}
double
CVACoreImpl
::
GetOutputGain
()
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
return
m_dOutputGain
;
}
void
CVACoreImpl
::
SetOutputGain
(
const
double
dGain
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
VA_TRY
{
if
(
!
GetVolumeValid
(
dGain
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid gain"
);
if
(
m_dOutputGain
==
dGain
)
return
;
m_dOutputGain
=
dGain
;
if
(
m_pOutputPatchbay
)
{
if
(
m_bOutputMuted
)
m_pOutputPatchbay
->
SetOutputGain
(
0
,
0.0
f
);
else
m_pOutputPatchbay
->
SetOutputGain
(
0
,
dGain
);
}
// Ereignis generieren
CVAEvent
ev
;
ev
.
iEventType
=
CVAEvent
::
OUTPUT_GAIN_CHANGED
;
ev
.
pSender
=
this
;
ev
.
dVolume
=
dGain
;
m_pEventManager
->
BroadcastEvent
(
ev
);
VA_VERBOSE
(
"Core"
,
"Set output gain = "
<<
IVAInterface
::
GetVolumeStrDecibel
(
dGain
)
);
}
VA_RETHROW
;
}
bool
CVACoreImpl
::
GetOutputMuted
()
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
return
m_bOutputMuted
;
}
void
CVACoreImpl
::
SetOutputMuted
(
const
bool
bMuted
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
VA_TRY
{
if
(
m_bOutputMuted
==
bMuted
)
return
;
m_bOutputMuted
=
bMuted
;
VA_INFO
(
"Core"
,
"Output mute toggled"
);
if
(
m_pOutputPatchbay
)
m_pOutputPatchbay
->
SetOutputMuted
(
0
,
bMuted
);
// Ereignis generieren
CVAEvent
ev
;
ev
.
iEventType
=
CVAEvent
::
OUTPUT_MUTING_CHANGED
;
ev
.
pSender
=
this
;
ev
.
bMuted
=
m_bOutputMuted
;
m_pEventManager
->
BroadcastEvent
(
ev
);
}
VA_RETHROW
;
}
int
CVACoreImpl
::
GetGlobalAuralizationMode
()
const
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
return
m_iGlobalAuralizationMode
;
}
void
CVACoreImpl
::
SetGlobalAuralizationMode
(
const
int
iAuralizationMode
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
VA_TRY
{
if
(
!
GetAuralizationModeValid
(
iAuralizationMode
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid auralization mode"
);
if
(
m_iGlobalAuralizationMode
==
iAuralizationMode
)
{
return
;
}
m_iGlobalAuralizationMode
=
iAuralizationMode
;
// Neuberechnung der Schallpfade triggern
m_pCoreThread
->
Trigger
();
// Ereignis generieren
CVAEvent
ev
;
ev
.
iEventType
=
CVAEvent
::
GLOBAL_AURALIZATION_MODE_CHANGED
;
ev
.
pSender
=
this
;
ev
.
iAuralizationMode
=
iAuralizationMode
;
m_pEventManager
->
BroadcastEvent
(
ev
);
VA_VERBOSE
(
"Core"
,
"Set global auralization mode = "
<<
IVAInterface
::
GetAuralizationModeStr
(
iAuralizationMode
,
true
)
);
}
VA_RETHROW
;
}
src/core/core.cpp
View file @
f1f254e7
Changes suppressed. Click to show.
...
...
@@ -19,105 +19,6 @@ IVAInterface* VACore::CreateCoreInstance( const CVAStruct& oArgs, std::ostream*
return
new
CVACoreImpl
(
oArgs
,
pOutputStream
);
}
void
VACore
::
StoreCoreConfigToFile
(
const
CVAStruct
&
oConfig
,
const
std
::
string
&
sConfigFilePath
)
{
StoreStructToINIFile
(
sConfigFilePath
,
oConfig
);
}
CVAStruct
VACore
::
LoadCoreConfigFromFile
(
const
std
::
string
&
sConfigFilePath
)
{
CVAStruct
oFinalCoreConfigStruct
,
oCurrentConfig
;
VistaFileSystemFile
oConfigFile
(
sConfigFilePath
);
std
::
list
<
VistaFileSystemFile
>
voConfigFiles
;
std
::
vector
<
VistaFileSystemDirectory
>
voIncludePaths
;
if
(
oConfigFile
.
Exists
()
&&
oConfigFile
.
GetParentDirectory
().
empty
()
==
false
)
voIncludePaths
.
push_back
(
oConfigFile
.
GetParentDirectory
()
);
voConfigFiles
.
push_back
(
VistaFileSystemFile
(
sConfigFilePath
)
);
VA_INFO
(
"Core"
,
"Working directory: '"
<<
VistaFileSystemDirectory
::
GetCurrentWorkingDirectory
()
<<
"'"
);
while
(
voConfigFiles
.
empty
()
==
false
)
{
VistaFileSystemFile
oCurrentConfigFile
(
voConfigFiles
.
front
()
);
voConfigFiles
.
pop_front
();
if
(
oCurrentConfigFile
.
Exists
()
==
false
)
{
for
(
size_t
n
=
0
;
n
<
voIncludePaths
.
size
();
n
++
)
{
std
::
string
sCombinedFilePath
=
voIncludePaths
[
n
].
GetName
()
+
PATH_SEPARATOR
+
oCurrentConfigFile
.
GetLocalName
();
oCurrentConfigFile
.
SetName
(
sCombinedFilePath
);
if
(
oCurrentConfigFile
.
Exists
()
&&
oCurrentConfigFile
.
IsFile
()
)
{
VA_INFO
(
"Config"
,
"Including further configuration file '"
+
oCurrentConfigFile
.
GetLocalName
()
+
"' from include path '"
+
voIncludePaths
[
n
].
GetName
()
+
"'"
);
break
;
}
}
if
(
!
oCurrentConfigFile
.
Exists
()
)
{
VA_EXCEPT2
(
FILE_NOT_FOUND
,
"Configuration file '"
+
oCurrentConfigFile
.
GetLocalName
()
+
"' not found, aborting."
);
}
}
VA_VERBOSE
(
"Config"
,
std
::
string
(
"Reading INI file '"
)
+
oCurrentConfigFile
.
GetLocalName
()
+
"'"
);
LoadStructFromINIFIle
(
oCurrentConfigFile
.
GetName
(),
oCurrentConfig
);
if
(
oCurrentConfig
.
HasKey
(
"paths"
)
)
{
const
CVAStruct
&
oPaths
(
oCurrentConfig
[
"paths"
]
);
CVAStruct
::
const_iterator
it
=
oPaths
.
Begin
();
while
(
it
!=
oPaths
.
End
()
)
{
const
CVAStructValue
&
oIncludePath
(
(
it
++
)
->
second
);
VistaFileSystemDirectory
oNewPathDir
(
oIncludePath
);
if
(
oNewPathDir
.
Exists
()
&&
oNewPathDir
.
IsDirectory
()
)
voIncludePaths
.
push_back
(
oNewPathDir
);
}
}
if
(
oCurrentConfig
.
HasKey
(
"files"
)
)
{
const
CVAStruct
&
oPaths
(
oCurrentConfig
[
"files"
]
);
CVAStruct
::
const_iterator
it
=
oPaths
.
Begin
();
while
(
it
!=
oPaths
.
End
()
)
{
const
CVAStructValue
&
oIncludeFile
(
(
it
++
)
->
second
);
voConfigFiles
.
push_back
(
VistaFileSystemFile
(
oIncludeFile
)
);
}
}
oCurrentConfig
.
RemoveKey
(
"files"
);
// Merge structs (check for uniqueness)
oFinalCoreConfigStruct
.
Merge
(
oCurrentConfig
,
true
);
}
return
oFinalCoreConfigStruct
;
}
#ifdef WIN32
// Trick um DLL-Pfad zu ermitteln
EXTERN_C
IMAGE_DOS_HEADER
__ImageBase
;
#endif
std
::
string
VACore
::
GetCoreLibFilePath
()
{
#ifdef WIN32
CHAR
pszPath
[
MAX_PATH
+
1
]
=
{
0
};
GetModuleFileNameA
(
(
HINSTANCE
)
&
__ImageBase
,
pszPath
,
_countof
(
pszPath
)
);
return
std
::
string
(
pszPath
);
#else
VA_EXCEPT2
(
NOT_IMPLEMENTED
,
"This function is not implemented for your platform. Sorry."
);
return
""
;
#endif // WIN32
}
CVACoreImpl
::
CVACoreImpl
(
const
CVAStruct
&
oArgs
,
std
::
ostream
*
pOutputStream
)
:
m_pAudioDriverBackend
(
nullptr
)
,
m_pGlobalSamplePool
(
nullptr
)
...
...
@@ -226,134 +127,6 @@ void CVACoreImpl::SetOutputStream( std::ostream* posDebug )
VALog_setErrorStream
(
posDebug
);
}
void
CVACoreImpl
::
GetVersionInfo
(
CVAVersionInfo
*
pVersionInfo
)
const
{
if
(
!
pVersionInfo
)
return
;
std
::
stringstream
ss
;
ss
<<
VACORE_VERSION_MAJOR
<<
"."
<<
VACORE_VERSION_MINOR
;
pVersionInfo
->
sVersion
=
ss
.
str
();
ss
.
clear
();
#ifdef VACORE_CMAKE_DATE
ss
<<
VACORE_CMAKE_DATE
;
#else
ss
<<
"Unkown date"
;
#endif
pVersionInfo
->
sDate
=
ss
.
str
();
pVersionInfo
->
sFlags
=
""
;
#ifdef DEBUG
pVersionInfo
->
sComments
=
"debug"
;
#else
pVersionInfo
->
sComments
=
"release"
;
#endif
}
void
CVACoreImpl
::
AttachEventHandler
(
IVAEventHandler
*
pCoreEventHandler
)
{
VA_TRY
{
// Immer mglich. Unabhngig vom Zustand. Thread-safety wird im Manager geregelt.
m_pEventManager
->
AttachHandler
(
pCoreEventHandler
);
}
VA_RETHROW
;
}
void
CVACoreImpl
::
DetachEventHandler
(
IVAEventHandler
*
pCoreEventHandler
)
{
VA_TRY
{
// Immer mglich. Unabhngig vom Zustand. Thread-safety wird im Manager geregelt.
m_pEventManager
->
DetachHandler
(
pCoreEventHandler
);
}
VA_RETHROW
;
}
int
CVACoreImpl
::
GetState
()
const
{
VA_VERBOSE
(
"Core"
,
"Core state requested, current state is "
<<
m_iState
);
return
m_iState
;
}
void
CVACoreImpl
::
Reset
()
{
VA_CHECK_INITIALIZED
;
// Wait for core thread
while
(
!
m_pCoreThread
->
TryBreak
()
)
VASleep
(
20
);
VA_NO_REENTRANCE
;
if
(
GetUpdateLocked
()
)
{
VA_WARN
(
"Core"
,
"Encountered locked scene during reset. Please unlock before resetting, skipping."
);
m_pCoreThread
->
Continue
();
}
VA_TRY
{
VA_INFO
(
"Core"
,
"Resetting core"
);
// Reset audio renderers
std
::
vector
<
CVAAudioRendererDesc
>::
iterator
it
=
m_voRenderers
.
begin
();
while
(
it
!=
m_voRenderers
.
end
()
)
{
CVAAudioRendererDesc
&
oRend
(
*
it
++
);
oRend
.
pInstance
->
Reset
();