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

Adding new add_frame function that can have a limited length. because of...

Adding new add_frame function that can have a limited length. because of ambiguity, the add_frame starting at a certain pos is now called add_frame_pos. If you use add_frame this way, make sure to update your codegit diff
parent 8e0112ab
......@@ -43,17 +43,8 @@ namespace ITABase
void SetItem( const std::string& sItem );
std::string GetItem() const;
virtual inline void PushProgressUpdate( std::string sSection, std::string sItem, float fProgressPercentage ) const
{
m_sSection = sSection;
PushProgressUpdate( sItem, fProgressPercentage );
};
virtual inline void PushProgressUpdate( std::string sItem, float fProgressPercentage ) const
{
m_sItem = sItem;
//PushProgressUpdate( fProgressPercentage );
};
virtual inline void PushProgressUpdate( std::string sSection, std::string sItem, float fProgressPercentage ) const;
virtual inline void PushProgressUpdate( std::string sItem, float fProgressPercentage ) const;
//!< Please implement push message, will be called by function
/**
......
......@@ -259,6 +259,7 @@ public:
* - Mssen gleiche Anzahl Kanle und Lngen haben!
*/
void add_frame( const ITASampleFrame* psfSource );
void add_frame( const ITASampleFrame* psfSource, int iNumSamples );
void sub_frame( const ITASampleFrame* psfSource );
void mul_frame( const ITASampleFrame* psfSource );
void div_frame( const ITASampleFrame* psfSource );
......@@ -270,7 +271,7 @@ public:
void div_frame( const ITASampleFrame& sfSource );
// mit bergabe der Position - keine identische Lnge bentigt
void add_frame( const ITASampleFrame* psfSource, int iPos );
void add_frame_pos( const ITASampleFrame* psfSource, int iPos );
// Kombinierte Operatoren
......
......@@ -6,7 +6,7 @@ ITABase::IProgressHandler::IProgressHandler( std::string sName /*= "unnamed" */
}
ITABase::IProgressHandler::~IProgressHandler()
ITABase::IProgressHandler::~IProgressHandler()
{
}
......@@ -21,22 +21,34 @@ std::string ITABase::IProgressHandler::GetName() const
return m_sName;
}
void ITABase::IProgressHandler::SetSection( const std::string& sName )
void ITABase::IProgressHandler::SetSection( const std::string& sSection )
{
m_sName = sName;
m_sSection = sSection;
}
std::string ITABase::IProgressHandler::GetSection() const
{
return m_sName;
return m_sSection;
}
void ITABase::IProgressHandler::SetItem( const std::string& sName )
void ITABase::IProgressHandler::SetItem( const std::string& sItem )
{
m_sName = sName;
m_sItem = sItem;
}
std::string ITABase::IProgressHandler::GetItem() const
{
return m_sName;
return m_sItem;
}
void ITABase::IProgressHandler::PushProgressUpdate( std::string sSection, std::string sItem, float fProgressPercentage ) const
{
m_sSection = sSection;
PushProgressUpdate( sItem, fProgressPercentage );
}
void ITABase::IProgressHandler::PushProgressUpdate( std::string sItem, float fProgressPercentage ) const
{
m_sItem = sItem;
PushProgressUpdate( fProgressPercentage );
}
......@@ -13,7 +13,7 @@ ITASampleFrame::ITASampleFrame()
{
}
ITASampleFrame::ITASampleFrame( const int iChannels, const int iLength, const bool bZeroinit /* = true */)
ITASampleFrame::ITASampleFrame( const int iChannels, const int iLength, const bool bZeroinit /* = true */ )
: m_iChannels( 0 )
, m_iLength( 0 )
{
......@@ -330,15 +330,29 @@ void ITASampleFrame::div_buf( const ITASampleBuffer& sbSource )
void ITASampleFrame::add_frame( const ITASampleFrame* psfSource )
{
if( !psfSource ) ITA_EXCEPT1( INVALID_PARAMETER, "Nullpointer passed" );
if( psfSource->m_iChannels != m_iChannels ) ITA_EXCEPT1( INVALID_PARAMETER, "Number of channels do not match" );
if( psfSource->m_iLength != m_iLength ) ITA_EXCEPT1( INVALID_PARAMETER, "Lengths do not match" );
assert( psfSource->GetLength() == GetLength() );
add_frame( psfSource, GetLength() );
}
void ITASampleFrame::add_frame( const ITASampleFrame* psfSource, int iNumSamples )
{
if( !psfSource )
ITA_EXCEPT1( INVALID_PARAMETER, "Nullpointer passed" );
if( psfSource->m_iChannels != m_iChannels )
ITA_EXCEPT1( INVALID_PARAMETER, "Number of channels do not match" );
if( psfSource->m_iLength < iNumSamples )
ITA_EXCEPT1( INVALID_PARAMETER, "Lengths of given sample frame too short" );
if( m_iLength < iNumSamples )
ITA_EXCEPT1( INVALID_PARAMETER, "Too man samples to be added to this sample frame" );
for( int i = 0; i < m_iChannels; ++i )
m_vChannels[ i ].add_buf( &( psfSource->m_vChannels[ i ] ) );
m_vChannels[ i ].add_buf( &( psfSource->m_vChannels[ i ] ), iNumSamples );
}
void ITASampleFrame::add_frame( const ITASampleFrame* psfSource, int iPos )
void ITASampleFrame::add_frame_pos( const ITASampleFrame* psfSource, int iPos )
{
if( !psfSource ) ITA_EXCEPT1( INVALID_PARAMETER, "Nullpointer passed" );
if( psfSource->m_iChannels != m_iChannels ) ITA_EXCEPT1( INVALID_PARAMETER, "Number of channels do not match" );
......@@ -348,8 +362,6 @@ void ITASampleFrame::add_frame( const ITASampleFrame* psfSource, int iPos )
m_vChannels[ i ].add_buf_pos( &( psfSource->m_vChannels[ i ] ), iPos );
}
void ITASampleFrame::sub_frame( const ITASampleFrame* psfSource )
{
if( !psfSource ) ITA_EXCEPT1( INVALID_PARAMETER, "Nullpointer passed" );
......
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