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
vista_use_package( sndfile )
vista_use_package( samplerate )
vista_use_package( IPP QUIET )
vista_use_package( PCRE QUIET )
vista_use_package( SimpleIni QUIET )
vista_use_package( SPLINE REQUIRED )
......@@ -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!)" )
endif( )
if( ITA_BASE_WITH_REGULAR_EXPRESSIONS )
vista_use_package( PCRE QUIET )
endif( )
# includes
include_directories( "include" )
......@@ -59,7 +62,6 @@ include_directories( "include" )
# files
set( ITABaseHeader
"include/ITAASCIITable.h"
"include/ITAAudioSample.h"
"include/ITABaseDefinitions.h"
"include/ITABlockMath.h"
......@@ -99,7 +101,6 @@ set( ITABaseHeader
"include/ITAWinPCClock.h"
)
set( ITABaseSources
"src/ITAASCIITable.cpp"
"src/ITABlockMath.cpp"
"src/ITABufferedAudioFileWriter.cpp"
"src/ITAClock.cpp"
......@@ -193,7 +194,8 @@ endif( )
if( VPCRE_FOUND AND ITA_BASE_WITH_REGULAR_EXPRESSIONS )
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( )
list( APPEND ITABaseSources "src/ITAStringUtils.cpp" )
endif( )
......
......@@ -25,7 +25,7 @@
#include <string>
//! Quantization type
ITA_BASE_API enum struct ITAQuantization
enum struct ITAQuantization
{
ITA_UNKNOWN_QUANTIZATION,
ITA_INT16,
......@@ -40,7 +40,7 @@ ITA_BASE_API enum struct ITAQuantization
ITA_BASE_API std::string toString( ITAQuantization eQuantization );
//! Domain type
ITA_BASE_API enum struct ITADomain
enum struct ITADomain
{
ITA_UNKNOWN_DOMAIN,
ITA_TIME_DOMAIN,
......
......@@ -4,59 +4,58 @@
#include <numeric>
#include <limits>
using namespace ITABase;
CMagnitudeSpectrum::CMagnitudeSpectrum( const int nNumBands )
ITABase::CMagnitudeSpectrum::CMagnitudeSpectrum( const int nNumBands )
: CITASpectrum( nNumBands )
{
}
std::vector< float > CMagnitudeSpectrum::GetMagnitudesCopy() const
std::vector< float > ITABase::CMagnitudeSpectrum::GetMagnitudesCopy() const
{
return CITASpectrum::GetValuesCopy();
}
const std::vector< float >& CMagnitudeSpectrum::GetMagnitudes() const
const std::vector< float >& ITABase::CMagnitudeSpectrum::GetMagnitudes() const
{
return CITASpectrum::GetValues();
}
void CMagnitudeSpectrum::SetMagnitudes( const std::vector< float >& vfMagnitudes )
void ITABase::CMagnitudeSpectrum::SetMagnitudes( const std::vector< float >& 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 );
}
// ----- ----------- -------------------
CDecibelMagnitudeSpectrum::CDecibelMagnitudeSpectrum( const int iNumBands )
ITABase::CDecibelMagnitudeSpectrum::CDecibelMagnitudeSpectrum( const int iNumBands )
: CMagnitudeSpectrum( iNumBands )
{
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++ )
m_vfValues[ n ] = 0;
}
void CDecibelMagnitudeSpectrum::SetZero()
void ITABase::CDecibelMagnitudeSpectrum::SetZero()
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
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++ )
{
......@@ -67,7 +66,7 @@ bool CDecibelMagnitudeSpectrum::IsIdentity() const
return true;
}
bool CDecibelMagnitudeSpectrum::IsZero() const
bool ITABase::CDecibelMagnitudeSpectrum::IsZero() const
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
{
......@@ -80,30 +79,30 @@ bool CDecibelMagnitudeSpectrum::IsZero() const
// ----- ----------- -------------------
CGainMagnitudeSpectrum::CGainMagnitudeSpectrum( const int iNumBands )
ITABase::CGainMagnitudeSpectrum::CGainMagnitudeSpectrum( const int iNumBands )
: CMagnitudeSpectrum( iNumBands )
{
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++ )
m_vfValues[ n ] = 1.0f;
}
void CGainMagnitudeSpectrum::SetZero()
void ITABase::CGainMagnitudeSpectrum::SetZero()
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
m_vfValues[ n ] = 0.0f;
}
bool CGainMagnitudeSpectrum::IsIdentity() const
bool ITABase::CGainMagnitudeSpectrum::IsIdentity() const
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
{
......@@ -114,7 +113,7 @@ bool CGainMagnitudeSpectrum::IsIdentity() const
return true;
}
bool CGainMagnitudeSpectrum::IsZero() const
bool ITABase::CGainMagnitudeSpectrum::IsZero() const
{
for( size_t n = 0; n < m_vfValues.size(); n++ )
{
......
......@@ -93,7 +93,7 @@ std::string BitmaskToString(int iMask, int iNumBits) {
}
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;
else {
std::stringstream ssStream;
......@@ -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 s;
char buf[128];
if (db == ITAConstants::DECIBEL_MINUS_INFINITY)
if (db == ITAConstants::MINUS_INFINITY_D)
s = "-inf";
else {
// 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