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)
VACore
Commits
8140242c
Commit
8140242c
authored
Feb 01, 2017
by
Jonas Stienen
Browse files
Removing little warning that is problematic with gcc
parent
86933971
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/VACoreImpl.cpp
View file @
8140242c
...
...
@@ -1809,9 +1809,8 @@ void CVACoreImpl::GetSoundSourceIDs(std::vector<int>& vSoundSourceIDs) {
}
VA_RETHROW
;
}
int
CVACoreImpl
::
CreateSoundSource
(
const
std
::
string
&
sName
,
int
iAuralizationMode
,
double
dVolume
)
{
int
CVACoreImpl
::
CreateSoundSource
(
const
std
::
string
&
sName
,
int
iAuralizationMode
,
double
dVolume
)
{
VA_NO_REENTRANCE
;
VA_CHECK_INITIALIZED
;
...
...
@@ -1819,41 +1818,44 @@ int CVACoreImpl::CreateSoundSource(const std::string& sName,
if
(
!
bSync
)
LockScene
();
VA_TRY
{
VA_TRY
{
// Parameter berprfen
if
(
!
IsValidAuralizationMode
(
iAuralizationMode
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid auralization mode"
);
if
(
!
IsValidVolume
(
dVolume
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid volume"
);
if
(
!
IsValidAuralizationMode
(
iAuralizationMode
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid auralization mode"
);
if
(
!
IsValidVolume
(
dVolume
)
)
VA_EXCEPT2
(
INVALID_PARAMETER
,
"Invalid volume"
);
// Grenzen prfen
if
((
VACORE_MAX_NUM_SOURCES
!=
0
)
&&
m_pNewSceneState
)
{
if
(
(
VACORE_MAX_NUM_SOURCES
!=
0
)
&&
m_pNewSceneState
)
{
int
iSourcesRemain
=
VACORE_MAX_NUM_SOURCES
-
m_pNewSceneState
->
GetNumSoundSources
();
if
(
iSourcesRemain
<=
0
)
{
if
(
iSourcesRemain
<=
0
)
{
std
::
stringstream
ss
;
ss
<<
"Maximum number of sound sources reached. This version of VA only supports up to "
<<
VACORE_MAX_NUM_SOURCES
<<
" sound sources."
;
VA_EXCEPT2
(
INVALID_PARAMETER
,
ss
.
str
());
VA_EXCEPT2
(
INVALID_PARAMETER
,
ss
.
str
()
);
}
}
// Schallquelle anlegen
int
iSourceID
=
m_pNewSceneState
->
AddSoundSource
();
assert
(
iSourceID
!=
-
1
);
// HINWEIS: Zunchst hier die statische Beschreibung der Quelle anlegen
CVASoundSourceDesc
*
pDesc
=
m_pSceneMan
->
CreateSoundSourceDesc
(
iSourceID
);
CVASoundSourceDesc
*
pDesc
=
m_pSceneMan
->
CreateSoundSourceDesc
(
iSourceID
);
// Keine Signalquelle zugewiesen. Wichtig: Stillepuffer einsetzen!
pDesc
->
pSignalSourceInputBuf
=
m_pSignalSourceMan
->
GetSilenceBuffer
();
// Initiale Werte setzen
m_pSceneMan
->
SetSoundSourceName
(
iSourceID
,
sName
);
CVASoundSourceState
*
pSourceState
=
m_pNewSceneState
->
AlterSoundSourceState
(
iSourceID
);
m_pSceneMan
->
SetSoundSourceName
(
iSourceID
,
sName
);
CVASoundSourceState
*
pSourceState
=
m_pNewSceneState
->
AlterSoundSourceState
(
iSourceID
);
assert
(
pSourceState
);
pSourceState
->
SetAuralizationMode
(
iAuralizationMode
);
pSourceState
->
SetVolume
(
dVolume
);
pSourceState
->
SetAuralizationMode
(
iAuralizationMode
);
pSourceState
->
SetVolume
(
dVolume
);
// Ereignis generieren
CVACoreEvent
ev
;
ev
.
iEventType
=
CVACoreEvent
::
VA_COREEVENT_SOUNDSOURCE_CREATED
;
...
...
@@ -1863,21 +1865,25 @@ int CVACoreImpl::CreateSoundSource(const std::string& sName,
ev
.
iAuralizationMode
=
iAuralizationMode
;
ev
.
dVolume
=
dVolume
;
m_pCoreEventMan
->
EnqueueEvent
(
ev
);
m_pCoreEventMan
->
EnqueueEvent
(
ev
);
if
(
!
bSync
)
UnlockScene
();
/*
VA_INFO("Core", "Created sound source (ID=" << iSourceID << ", Name=\"" << sName
<< "\", AMode=" << IVACore::GetAuralizationModeStr(iAuralizationMode, true) << ", Volume="
<< IVACore::GetVolumeStrDecibel(dVolume) << ")");
VA_INFO("Core", "Created sound source (ID=" << iSourceID << ", Name=\"" << sName
<< "\", AMode=" << IVACore::GetAuralizationModeStr(iAuralizationMode, true) << ", Volume="
<< IVACore::GetVolumeStrDecibel(dVolume) << ")");
*/
return
iSourceID
;
}
VA_FINALLY
{
if
(
bSync
)
UnlockScene
();
}
VA_FINALLY
{
if
(
bSync
)
UnlockScene
();
throw
;
}
}
...
...
@@ -4473,7 +4479,7 @@ int CVACoreImpl::CallObject(const CVAStruct& oArgs, CVAStruct& oReturn) {
const
CVAStruct
&
oGetDebug
(
oArgs
[
"debug"
]
);
if
(
oGetDebug
.
HasKey
(
"loglevel"
)
)
{
oReturn
[
"debug"
][
"loglevel"
]
=
VALog_GetLogLevel
();
oReturn
[
std
::
string
(
"debug"
)
][
std
::
string
(
"loglevel"
)
]
=
VALog_GetLogLevel
();
VA_VERBOSE
(
GetObjectName
(),
"Returned log level"
);
bValidCommand
=
true
;
}
...
...
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