1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Martin Gasser.
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
23 #include "maths/MathUtilities.h"
35 void TCSGram::getTCSVector(int iPosition, TCSVector& rTCSVector) const
38 rTCSVector = TCSVector();
39 else if (iPosition >= m_VectorList.size())
40 rTCSVector = TCSVector();
42 rTCSVector = m_VectorList[iPosition].second;
45 long TCSGram::getTime(size_t uPosition) const
47 return m_VectorList[uPosition].first;
51 void TCSGram::addTCSVector(const TCSVector& rTCSVector)
53 size_t uSize = m_VectorList.size();
54 long lMilliSeconds = static_cast<long>(uSize*m_dFrameDurationMS);
55 std::pair<long, TCSVector> p;
56 p.first = lMilliSeconds;
57 p.second = rTCSVector;
59 m_VectorList.push_back(p);
62 long TCSGram::getDuration() const
64 size_t uSize = m_VectorList.size();
65 return static_cast<long>(uSize*m_dFrameDurationMS);
68 void TCSGram::printDebug()
70 vectorlist_t::iterator vectorIterator = m_VectorList.begin();
72 while (vectorIterator != m_VectorList.end())
74 vectorIterator->second.printDebug();