Commit 05801ec2 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Merge finished

parents add2cea8 d532cfbc
# ITA Laboratory for Virtual Acoustics (VRLab) audio hardware setup
# by Jonas Stienen, Lukas Aspck
# by Jonas Stienen, Lukas Aspck
# Outputs: logical groups of output audio hardware
......@@ -64,7 +64,7 @@ Devices = WHP
Type = LS
Description = Neumann O300D broadband loudspeaker, front-left
Channels = 1
Position = -1.6131, 1.3725, -1.6131
Position = -1.6232, 1.2700, -1.6054
OrientationYPR = -135, 0, 0
DataFileName = Neumann_O300D_Directivity_DFT.daff
......@@ -72,7 +72,7 @@ DataFileName = Neumann_O300D_Directivity_DFT.daff
Type = LS
Description = Neumann O300D broadband loudspeaker, front-right
Channels = 2
Position = 1.6237, 1.3725, -1.6237
Position = 1.6562, 1.2700, -1.5858
OrientationYPR = 135, 0, 0
DataFileName = Neumann_O300D_Directivity_DFT.daff
......@@ -80,7 +80,7 @@ DataFileName = Neumann_O300D_Directivity_DFT.daff
Type = LS
Description = Neumann O300D broadband loudspeaker, rear-right
Channels = 3
Position = 1.6209, 1.3725, 1.6209
Position = 1.6225, 1.2700, 1.5918
OrientationYPR = 45, 0, 0
DataFileName = Neumann_O300D_Directivity_DFT.daff
......@@ -88,7 +88,7 @@ DataFileName = Neumann_O300D_Directivity_DFT.daff
Type = LS
Description = Neumann O300D broadband loudspeaker, rear-left
Channels = 4
Position = -1.6152, 1.3725, 1.6152
Position = -1.6232, 1.2700, 1.5983
OrientationYPR = -45, 0, 0
DataFileName = Neumann_O300D_Directivity_DFT.daff
......@@ -96,7 +96,7 @@ DataFileName = Neumann_O300D_Directivity_DFT.daff
Type = LS
Description = Neumann O110 broadband loudspeaker, top-front
Channels = 5
Position = 0, 2.6, -3
Position = 0, 2.5070, -1.9910
OrientationYPR = 180, -20, 0
DataFileName = Neumann_O110_Directivity_DFT.daff
......@@ -104,7 +104,7 @@ DataFileName = Neumann_O110_Directivity_DFT.daff
Type = LS
Description = Neumann O110 broadband loudspeaker, top-right
Channels = 6
Position = 3, 2.6, 0
Position = 1.9662, 2.5090, 0.0000
OrientationYPR = 90, -20, 0
DataFileName = Neumann_O110_Directivity_DFT.daff
......@@ -112,7 +112,7 @@ DataFileName = Neumann_O110_Directivity_DFT.daff
Type = LS
Description = Neumann O110 broadband loudspeaker, top-back
Channels = 7
Position = 0, 2.6, 3
Position = -0.0000, 2.5070, 1.9781
OrientationYPR = 0, -20, 0
DataFileName = Neumann_O110_Directivity_DFT.daff
......@@ -120,7 +120,7 @@ DataFileName = Neumann_O110_Directivity_DFT.daff
Type = LS
Description = Neumann O110 broadband loudspeaker, top-left
Channels = 8
Position = -3, 2.6, 0
Position = -1.9860, 2.5000, 0.0000
OrientationYPR = -90, -20, 0
DataFileName = Neumann_O110_Directivity_DFT.daff
......@@ -128,7 +128,7 @@ DataFileName = Neumann_O110_Directivity_DFT.daff
Type = LS
Description = Neumann O100 broadband loudspeaker, bottom-front
Channels = 9
Position = 0, 0.2, -3
Position = 0, 0.2420, -1.9823
OrientationYPR = 180, 20, 0
DataFileName = Neumann_O100_Directivity_DFT.daff
......@@ -136,7 +136,7 @@ DataFileName = Neumann_O100_Directivity_DFT.daff
Type = LS
Description = Neumann O110D broadband loudspeaker, bottom-right
Channels = 10
Position = 3, 0.2, 0
Position = 1.9782, 0.2450, 0.0000
OrientationYPR = 90, 20, 0
DataFileName = Neumann_O110D_Directivity_DFT.daff
......@@ -144,7 +144,7 @@ DataFileName = Neumann_O110D_Directivity_DFT.daff
Type = LS
Description = Neumann O100 broadband loudspeaker, bottom-back
Channels = 11
Position = 0, 0.2, 3
Position = 0.0, 0.2390, 1.9785
OrientationYPR = 0, 20, 0
DataFileName = Neumann_O100_Directivity_DFT.daff
......@@ -152,7 +152,7 @@ DataFileName = Neumann_O100_Directivity_DFT.daff
Type = LS
Description = Neumann O110D broadband loudspeaker, bottom-left
Channels = 12
Position = -3, 0.2, 0
Position = -1.9771, 0.2320, -0.0000
OrientationYPR = -90, 20, 0
DataFileName = Neumann_O110D_Directivity_DFT.daff
......
......@@ -18,6 +18,7 @@
#include <VAStruct.h>
#include <string>
#include <iostream>
#ifndef VACORE_DEFAULT_CONFIGFILE
#define VACORE_DEFAULT_CONFIGFILE "\"VACore.ini\""
......@@ -33,7 +34,7 @@ namespace VACore
* @param[in] oArgs Arguments with configuration for the core
* @return Pointer to the core instance (VA interface API from VABase)
*/
VACORE_API IVAInterface* CreateCoreInstance( const CVAStruct& oArgs );
VACORE_API IVAInterface* CreateCoreInstance( const CVAStruct& oArgs, std::ostream* pOutputStream = nullptr );
//! Parses input INI configuration file and converts it into a VA core config struct
/**
......@@ -56,9 +57,9 @@ namespace VACore
*
* @sa GetCoreConfigFromFile()
*/
inline IVAInterface* CreateCoreInstance( const std::string& sConfigFile = VACORE_DEFAULT_CONFIGFILE )
inline IVAInterface* CreateCoreInstance( const std::string& sConfigFile = VACORE_DEFAULT_CONFIGFILE, std::ostream* pOutputStream = nullptr )
{
return CreateCoreInstance( VACore::LoadCoreConfigFromFile( sConfigFile ) );
return CreateCoreInstance( VACore::LoadCoreConfigFromFile( sConfigFile ), pOutputStream );
};
//! Returns the filesystem path of the VACore shared lib (e.g. VACore.dll)
......
......@@ -44,7 +44,7 @@ void CVACoreConfig::Init( const CVAStruct& oData )
conf.OptInteger( "Debug/TriggerUpdateMilliseconds", iTriggerUpdateMilliseconds, 100 );
VA_TRACE( "Config", oData );
CVAStruct oMacroStruct( conf.OptStruct( "Macros" ) );
CVAStruct::const_iterator cit = oMacroStruct.Begin();
while( cit != oMacroStruct.End() )
......@@ -60,7 +60,28 @@ void CVACoreConfig::Init( const CVAStruct& oData )
cit++;
}
CVAStruct oPathsStruct( conf.OptStruct( "Paths" ) );
std::string sWorkingDirectory = VistaFileSystemDirectory::GetCurrentWorkingDirectory();
VA_INFO( "Core", "Current working directory: '" << sWorkingDirectory << "'" );
if( oPathsStruct.HasKey( "WorkingDirectory" ) )
{
std::string sPath = oPathsStruct[ "WorkingDirectory" ];
VistaFileSystemDirectory oDir( sPath );
if( oDir.Exists() )
{
VistaFileSystemDirectory::SetCurrentWorkingDirectory( sPath );
std::string sWorkingDirectory = VistaFileSystemDirectory::GetCurrentWorkingDirectory();
VA_INFO( "Config", "Found valid working directory path entry, switching to: '" << sWorkingDirectory << "'" );
}
else
{
std::string sWorkingDirectory = VistaFileSystemDirectory::GetCurrentWorkingDirectory();
VA_WARN( "Config", "Requested working directory path '" << sPath << "' not found, will fall back to '" << sWorkingDirectory << "'" );
}
}
cit = oPathsStruct.Begin();
while( cit != oPathsStruct.End() )
{
......@@ -68,8 +89,12 @@ void CVACoreConfig::Init( const CVAStruct& oData )
const CVAStructValue& oPathValue( cit++->second );
if( oPathValue.IsString() )
{
if( toLowercase( sPathName ) == "workingdirectory" )
continue;
std::string sPath = oPathValue;
VistaFileSystemDirectory oDir( sPath );
if( oDir.Exists() )
{
vsSearchPaths.push_back( sPath );
......@@ -78,7 +103,7 @@ void CVACoreConfig::Init( const CVAStruct& oData )
}
else
{
VA_VERBOSE( "Config", "Could not find path '" + sPath + "', removed from search path list." );
VA_INFO( "Config", "Could not find path '" + sPath + "', removed from search path list." );
}
}
else
......@@ -87,7 +112,7 @@ void CVACoreConfig::Init( const CVAStruct& oData )
}
}
oAudioDriverConfig.Init( conf.OptStruct("Audio driver") );
oAudioDriverConfig.Init( conf.OptStruct( "Audio driver" ) );
oHardwareSetup.Init( oData );
......
......@@ -179,10 +179,10 @@ catch( ... ) { throw getDefaultUnexpectedVAException(); } \
} catch( ... ) { throw; }
IVAInterface* VACore::CreateCoreInstance( const CVAStruct& oArgs )
IVAInterface* VACore::CreateCoreInstance( const CVAStruct& oArgs, std::ostream* pOutputStream )
{
VA_TRACE( "Config", oArgs );
return new CVACoreImpl( oArgs );
return new CVACoreImpl( oArgs, pOutputStream );
}
void VACore::StoreCoreConfigToFile( const CVAStruct& oConfig, const std::string& sConfigFilePath )
......@@ -197,7 +197,7 @@ CVAStruct VACore::LoadCoreConfigFromFile( const std::string& sConfigFilePath )
std::vector< VistaFileSystemDirectory > voIncludePaths;
voConfigFiles.push_back( VistaFileSystemFile( sConfigFilePath ) );
VA_PRINT( "VA working directory: '" << VistaFileSystemDirectory::GetCurrentWorkingDirectory() << "'" );
VA_INFO( "Core", "Working directory: '" << VistaFileSystemDirectory::GetCurrentWorkingDirectory() << "'" );
while( voConfigFiles.empty() == false )
{
......@@ -219,7 +219,7 @@ CVAStruct VACore::LoadCoreConfigFromFile( const std::string& sConfigFilePath )
}
if( !oCurrentConfigFile.Exists() )
{
{
VA_EXCEPT2( FILE_NOT_FOUND, "Configuration file '" + oCurrentConfigFile.GetLocalName() + "' not found, aborting." );
}
}
......@@ -278,7 +278,7 @@ std::string VACore::GetCoreLibFilePath()
#endif // WIN32
}
CVACoreImpl::CVACoreImpl( const CVAStruct& oArgs )
CVACoreImpl::CVACoreImpl( const CVAStruct& oArgs, std::ostream* pOutputStream )
: m_pAudioDriverBackend( nullptr ),
m_pGlobalSamplePool( nullptr ),
m_pGlobalSampler( nullptr ),
......@@ -317,6 +317,9 @@ CVACoreImpl::CVACoreImpl( const CVAStruct& oArgs )
{
VA_NO_REENTRANCE;
if( pOutputStream )
SetOutputStream( pOutputStream );
VA_TRY
{
// read configuration
......
......@@ -57,10 +57,10 @@ class ITAStreamPatchbay;
class CVACoreImpl : public IVAInterface, public CVAObject, public VistaTicker::AfterPulseFunctor
{
public:
CVACoreImpl( const CVAStruct& oArgs );
CVACoreImpl( const CVAStruct& oArgs, std::ostream* pos );
virtual ~CVACoreImpl();
void SetOutputStream( std::ostream* posDebug );
void SetOutputStream( std::ostream* pos );
void GetVersionInfo( CVAVersionInfo* ) const;
int GetState() const;
......
......@@ -105,9 +105,10 @@ public:
m_mID2Ref.erase( iID );
};
// Gibt zu einer ID das assozierte Objekt zurck
// (Gibt nullptr zurck, falls das Objekt nicht enthalten ist)
inline T* GetObject( int iID ) const
//! Gibt zu einer ID das assozierte Objekt zurck
/** (Gibt nullptr zurck, falls das Objekt nicht enthalten ist)
*/
inline T* GetObject( const int iID ) const
{
typename std::map< int, T* >::const_iterator cit = m_mID2Object.find( iID );
return ( cit == m_mID2Object.end() ? nullptr : cit->second );
......@@ -142,12 +143,14 @@ public:
return ( it == m_mID2Ref.end() ? -1 : ( it->second > 0 ? --( it->second ) : 0 ) );
};
// Wie GetObject(), erhht aber direkt den Referenzzhler
inline T* Request( int iID ) {
//! Wie GetObject(), erhht aber direkt den Referenzzhler
inline T* Request( const int iID )
{
T* pObject = GetObject( iID );
// Gltige ID? Dann Referenzzhler erhhen
if( pObject ) IncRefCount( iID );
if( pObject )
IncRefCount( iID );
return pObject;
};
......
......@@ -55,6 +55,7 @@ void CVADirectivityManager::Finalize()
void CVADirectivityManager::Reset()
{
VA_VERBOSE( "DirectivityManager", "Resetting" );
for( CVAObjectContainer< IVADirectivity >::iterator it = m_oDirectivities.begin(); it != m_oDirectivities.end(); ++it )
{
delete it->second;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment