Porting from ITimeArithmetics to CTime
Posted: Fri Feb 11, 2022 7:21 am
Hi,
OV 3.0 replaced the ITimeArithmetics class with CTime.
I have this old code that coverts samples (positions in the signal represented by samples) to OV own representation of time:
So it uses the sampleCountToTime method. In the release notes of OV 3.0 (scroll down) it was not specified which was the equivalent in the new class CTime. I think it is the constructor of CTime. So I re-wrote the code like this:
This is to show other users how I did it and maybe someone from the OV can comment/confirm.
OV 3.0 replaced the ITimeArithmetics class with CTime.
I have this old code that coverts samples (positions in the signal represented by samples) to OV own representation of time:
Code: Select all
uint64_t l_ui64SampleStartTime = m_ui64StartTimeBase + ITimeArithmetics::sampleCountToTime(m_ui64OutputSamplingFrequency, m_ui64TotalSampleCount);
uint64_t l_ui64SampleEndTime = m_ui64StartTimeBase + ITimeArithmetics::sampleCountToTime(m_ui64OutputSamplingFrequency, m_ui64TotalSampleCount + m_ui32OutputSampleCountPerSentBlock);
Code: Select all
const uint64_t l_ui64SampleStartTime = CTime(m_ui64OutputSamplingFrequency, m_ui64TotalSampleCount).time();
const uint64_t l_ui64SampleEndTime = CTime(m_ui64OutputSamplingFrequency, m_ui64TotalSampleCount + m_ui32OutputSampleCountPerSentBlock).time();