comparison dsp/tonal/TCSgram.cpp @ 482:cbe668c7d724

Untabify, indent, tidy
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 31 May 2019 11:02:28 +0100
parents 7e8d1f26b098
children
comparison
equal deleted inserted replaced
481:de5f557a270f 482:cbe668c7d724
21 #include <limits> 21 #include <limits>
22 22
23 #include "maths/MathUtilities.h" 23 #include "maths/MathUtilities.h"
24 24
25 TCSGram::TCSGram() : 25 TCSGram::TCSGram() :
26 m_uNumBins(6) 26 m_uNumBins(6)
27 { 27 {
28 } 28 }
29 29
30 TCSGram::~TCSGram() 30 TCSGram::~TCSGram()
31 { 31 {
32 } 32 }
33 33
34 34
35 void TCSGram::getTCSVector(int iPosition, TCSVector& rTCSVector) const 35 void TCSGram::getTCSVector(int iPosition, TCSVector& rTCSVector) const
36 { 36 {
37 if (iPosition < 0) 37 if (iPosition < 0) {
38 rTCSVector = TCSVector(); 38 rTCSVector = TCSVector();
39 else if (iPosition >= int(m_VectorList.size())) 39 } else if (iPosition >= int(m_VectorList.size())) {
40 rTCSVector = TCSVector(); 40 rTCSVector = TCSVector();
41 else 41 } else {
42 rTCSVector = m_VectorList[iPosition].second; 42 rTCSVector = m_VectorList[iPosition].second;
43 }
43 } 44 }
44 45
45 long TCSGram::getTime(size_t uPosition) const 46 long TCSGram::getTime(size_t uPosition) const
46 { 47 {
47 return m_VectorList[uPosition].first; 48 return m_VectorList[uPosition].first;
48 } 49 }
49 50
50 51
51 void TCSGram::addTCSVector(const TCSVector& rTCSVector) 52 void TCSGram::addTCSVector(const TCSVector& rTCSVector)
52 { 53 {
53 size_t uSize = m_VectorList.size(); 54 size_t uSize = m_VectorList.size();
54 long lMilliSeconds = static_cast<long>(uSize*m_dFrameDurationMS); 55 long lMilliSeconds = static_cast<long>(uSize*m_dFrameDurationMS);
55 std::pair<long, TCSVector> p; 56 std::pair<long, TCSVector> p;
56 p.first = lMilliSeconds; 57 p.first = lMilliSeconds;
57 p.second = rTCSVector; 58 p.second = rTCSVector;
58 59
59 m_VectorList.push_back(p); 60 m_VectorList.push_back(p);
60 } 61 }
61 62
62 long TCSGram::getDuration() const 63 long TCSGram::getDuration() const
63 { 64 {
64 size_t uSize = m_VectorList.size(); 65 size_t uSize = m_VectorList.size();
65 return static_cast<long>(uSize*m_dFrameDurationMS); 66 return static_cast<long>(uSize*m_dFrameDurationMS);
66 } 67 }
67 68
68 void TCSGram::printDebug() 69 void TCSGram::printDebug()
69 { 70 {
70 vectorlist_t::iterator vectorIterator = m_VectorList.begin(); 71 vectorlist_t::iterator vectorIterator = m_VectorList.begin();
71 72
72 while (vectorIterator != m_VectorList.end()) 73 while (vectorIterator != m_VectorList.end()) {
73 { 74 vectorIterator->second.printDebug();
74 vectorIterator->second.printDebug(); 75 vectorIterator++;
75 vectorIterator++; 76 }
76 }
77 } 77 }