Moving from old atomic implementation to c++11 atomics and providing some copy...

Moving from old atomic implementation to c++11 atomics and providing some copy constructors for msvc14 compat
parent 1fe9575e
...@@ -10,7 +10,6 @@ vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaBase VistaInterProcCom ...@@ -10,7 +10,6 @@ vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaBase VistaInterProcCom
vista_use_package( sndfile ) vista_use_package( sndfile )
vista_use_package( samplerate ) vista_use_package( samplerate )
vista_use_package( IPP QUIET ) vista_use_package( IPP QUIET )
vista_use_package( PCRE QUIET )
vista_use_package( SimpleIni QUIET ) vista_use_package( SimpleIni QUIET )
vista_use_package( SPLINE REQUIRED ) vista_use_package( SPLINE REQUIRED )
...@@ -52,6 +51,10 @@ if( NOT DEFINED ITA_BASE_WITH_OLD_RAVEN_OPS ) ...@@ -52,6 +51,10 @@ if( NOT DEFINED ITA_BASE_WITH_OLD_RAVEN_OPS )
set( ITA_BASE_WITH_OLD_RAVEN_OPS OFF CACHE BOOL "Build with old ITAOps helper functions implementation (legacy code for RAVEN compatibility, adds GPL-licensed libs!)" ) set( ITA_BASE_WITH_OLD_RAVEN_OPS OFF CACHE BOOL "Build with old ITAOps helper functions implementation (legacy code for RAVEN compatibility, adds GPL-licensed libs!)" )
endif( ) endif( )
if( ITA_BASE_WITH_REGULAR_EXPRESSIONS )
vista_use_package( PCRE QUIET )
endif( )
# includes # includes
include_directories( "include" ) include_directories( "include" )
...@@ -59,7 +62,6 @@ include_directories( "include" ) ...@@ -59,7 +62,6 @@ include_directories( "include" )
# files # files
set( ITABaseHeader set( ITABaseHeader
"include/ITAASCIITable.h"
"include/ITAAudioSample.h" "include/ITAAudioSample.h"
"include/ITABaseDefinitions.h" "include/ITABaseDefinitions.h"
"include/ITABlockMath.h" "include/ITABlockMath.h"
...@@ -99,7 +101,6 @@ set( ITABaseHeader ...@@ -99,7 +101,6 @@ set( ITABaseHeader
"include/ITAWinPCClock.h" "include/ITAWinPCClock.h"
) )
set( ITABaseSources set( ITABaseSources
"src/ITAASCIITable.cpp"
"src/ITABlockMath.cpp" "src/ITABlockMath.cpp"
"src/ITABufferedAudioFileWriter.cpp" "src/ITABufferedAudioFileWriter.cpp"
"src/ITAClock.cpp" "src/ITAClock.cpp"
...@@ -193,7 +194,8 @@ endif( ) ...@@ -193,7 +194,8 @@ endif( )
if( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS ) if( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS )
add_definitions( -DPCRE_STATIC ) add_definitions( -DPCRE_STATIC )
list( APPEND ITABaseSources "src/ITAStringUtilsPCRE.cpp" ) list( APPEND ITABaseHeaders "include/ITAASCIITable.h" )
list( APPEND ITABaseSources "src/ITAStringUtilsPCRE.cpp" "src/ITAASCIITable.cpp" )
else( ) else( )
list( APPEND ITABaseSources "src/ITAStringUtils.cpp" ) list( APPEND ITABaseSources "src/ITAStringUtils.cpp" )
endif( ) endif( )
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <string> #include <string>
//! Quantization type //! Quantization type
ITA_BASE_API enum struct ITAQuantization enum struct ITAQuantization
{ {
ITA_UNKNOWN_QUANTIZATION, ITA_UNKNOWN_QUANTIZATION,
ITA_INT16, ITA_INT16,
...@@ -40,7 +40,7 @@ ITA_BASE_API enum struct ITAQuantization ...@@ -40,7 +40,7 @@ ITA_BASE_API enum struct ITAQuantization
ITA_BASE_API std::string toString( ITAQuantization eQuantization ); ITA_BASE_API std::string toString( ITAQuantization eQuantization );
//! Domain type //! Domain type
ITA_BASE_API enum struct ITADomain enum struct ITADomain
{ {
ITA_UNKNOWN_DOMAIN, ITA_UNKNOWN_DOMAIN,
ITA_TIME_DOMAIN, ITA_TIME_DOMAIN,
......
...@@ -4,59 +4,58 @@ ...@@ -4,59 +4,58 @@
#include <numeric> #include <numeric>
#include <limits> #include <limits>
using namespace ITABase;
CMagnitudeSpectrum::CMagnitudeSpectrum( const int nNumBands ) ITABase::CMagnitudeSpectrum::CMagnitudeSpectrum( const int nNumBands )
: CITASpectrum( nNumBands ) : CITASpectrum( nNumBands )
{ {
} }
std::vector< float > CMagnitudeSpectrum::GetMagnitudesCopy() const std::vector< float > ITABase::CMagnitudeSpectrum::GetMagnitudesCopy() const
{ {
return CITASpectrum::GetValuesCopy(); return CITASpectrum::GetValuesCopy();
} }
const std::vector< float >& CMagnitudeSpectrum::GetMagnitudes() const const std::vector< float >& ITABase::CMagnitudeSpectrum::GetMagnitudes() const
{ {
return CITASpectrum::GetValues(); return CITASpectrum::GetValues();
} }
void CMagnitudeSpectrum::SetMagnitudes( const std::vector< float >& vfMagnitudes ) void ITABase::CMagnitudeSpectrum::SetMagnitudes( const std::vector< float >& vfMagnitudes )
{ {
CITASpectrum::SetValues( vfMagnitudes ); CITASpectrum::SetValues( vfMagnitudes );
} }
void CMagnitudeSpectrum::SetMagnitude( const int iFrequencyBandIndex, const float fMagnitudeValue ) void ITABase::CMagnitudeSpectrum::SetMagnitude( const int iFrequencyBandIndex, const float fMagnitudeValue )
{ {
CITASpectrum::SetValue( iFrequencyBandIndex, fMagnitudeValue ); CITASpectrum::SetValue( iFrequencyBandIndex, fMagnitudeValue );
} }
// ----- ----------- ------------------- // ----- ----------- -------------------
CDecibelMagnitudeSpectrum::CDecibelMagnitudeSpectrum( const int iNumBands ) ITABase::CDecibelMagnitudeSpectrum::CDecibelMagnitudeSpectrum( const int iNumBands )
: CMagnitudeSpectrum( iNumBands ) : CMagnitudeSpectrum( iNumBands )
{ {
CITASpectrum::SetValueUnit( "dB" ); CITASpectrum::SetValueUnit( "dB" );
} }
CDecibelMagnitudeSpectrum::~CDecibelMagnitudeSpectrum() ITABase::CDecibelMagnitudeSpectrum::~CDecibelMagnitudeSpectrum()
{ {
} }
void CDecibelMagnitudeSpectrum::SetIdentity() void ITABase::CDecibelMagnitudeSpectrum::SetIdentity()
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
m_vfValues[ n ] = 0; m_vfValues[ n ] = 0;
} }
void CDecibelMagnitudeSpectrum::SetZero() void ITABase::CDecibelMagnitudeSpectrum::SetZero()
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
m_vfValues[ n ] = -std::numeric_limits< float >::infinity(); m_vfValues[ n ] = -std::numeric_limits< float >::infinity();
} }
bool CDecibelMagnitudeSpectrum::IsIdentity() const bool ITABase::CDecibelMagnitudeSpectrum::IsIdentity() const
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
{ {
...@@ -67,7 +66,7 @@ bool CDecibelMagnitudeSpectrum::IsIdentity() const ...@@ -67,7 +66,7 @@ bool CDecibelMagnitudeSpectrum::IsIdentity() const
return true; return true;
} }
bool CDecibelMagnitudeSpectrum::IsZero() const bool ITABase::CDecibelMagnitudeSpectrum::IsZero() const
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
{ {
...@@ -80,30 +79,30 @@ bool CDecibelMagnitudeSpectrum::IsZero() const ...@@ -80,30 +79,30 @@ bool CDecibelMagnitudeSpectrum::IsZero() const
// ----- ----------- ------------------- // ----- ----------- -------------------
CGainMagnitudeSpectrum::CGainMagnitudeSpectrum( const int iNumBands ) ITABase::CGainMagnitudeSpectrum::CGainMagnitudeSpectrum( const int iNumBands )
: CMagnitudeSpectrum( iNumBands ) : CMagnitudeSpectrum( iNumBands )
{ {
CITASpectrum::SetValueUnit( "gain" ); CITASpectrum::SetValueUnit( "gain" );
} }
CGainMagnitudeSpectrum::~CGainMagnitudeSpectrum() ITABase::CGainMagnitudeSpectrum::~CGainMagnitudeSpectrum()
{ {
} }
void CGainMagnitudeSpectrum::SetIdentity() void ITABase::CGainMagnitudeSpectrum::SetIdentity()
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
m_vfValues[ n ] = 1.0f; m_vfValues[ n ] = 1.0f;
} }
void CGainMagnitudeSpectrum::SetZero() void ITABase::CGainMagnitudeSpectrum::SetZero()
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
m_vfValues[ n ] = 0.0f; m_vfValues[ n ] = 0.0f;
} }
bool CGainMagnitudeSpectrum::IsIdentity() const bool ITABase::CGainMagnitudeSpectrum::IsIdentity() const
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
{ {
...@@ -114,7 +113,7 @@ bool CGainMagnitudeSpectrum::IsIdentity() const ...@@ -114,7 +113,7 @@ bool CGainMagnitudeSpectrum::IsIdentity() const
return true; return true;
} }
bool CGainMagnitudeSpectrum::IsZero() const bool ITABase::CGainMagnitudeSpectrum::IsZero() const
{ {
for( size_t n = 0; n < m_vfValues.size(); n++ ) for( size_t n = 0; n < m_vfValues.size(); n++ )
{ {
......
...@@ -93,7 +93,7 @@ std::string BitmaskToString(int iMask, int iNumBits) { ...@@ -93,7 +93,7 @@ std::string BitmaskToString(int iMask, int iNumBits) {
} }
std::string DecibelToString(double dDecibelValue, std::string sMinusInfinity, std::string sUnit) { std::string DecibelToString(double dDecibelValue, std::string sMinusInfinity, std::string sUnit) {
if (dDecibelValue == ITAConstants::DECIBEL_MINUS_INFINITY) if (dDecibelValue == ITAConstants::MINUS_INFINITY_D)
return sMinusInfinity + std::string(" ") + sUnit; return sMinusInfinity + std::string(" ") + sUnit;
else { else {
std::stringstream ssStream; std::stringstream ssStream;
...@@ -283,7 +283,7 @@ std::vector< std::string > splitString( const std::string& s, const std::string& ...@@ -283,7 +283,7 @@ std::vector< std::string > splitString( const std::string& s, const std::string&
std::string ratio_to_db_str_internal(double db, std::string sSuffix) { std::string ratio_to_db_str_internal(double db, std::string sSuffix) {
std::string s; std::string s;
char buf[128]; char buf[128];
if (db == ITAConstants::DECIBEL_MINUS_INFINITY) if (db == ITAConstants::MINUS_INFINITY_D)
s = "-inf"; s = "-inf";
else { else {
// Auf eine Nachkommastelle runden, Aufrunden bei 0.05 -> 0.1 // Auf eine Nachkommastelle runden, Aufrunden bei 0.05 -> 0.1
......
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