Ardour  8.7-15-gadf511264b
TCSgram.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  QM DSP Library
5 
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Martin Gasser.
8 
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.
14 */
15 
16 #ifndef _TCSGram_
17 #define _TCSGram_
18 
19 #include <vector>
20 #include <valarray>
21 #include <utility>
22 
23 #include "TonalEstimator.h"
24 
25 typedef std::vector<std::pair<long, TCSVector> > vectorlist_t;
26 
27 class TCSGram
28 {
29 public:
32  void getTCSVector(int, TCSVector&) const;
33  void addTCSVector(const TCSVector&);
34  long getTime(size_t) const;
35  long getDuration() const;
36  void printDebug();
37  int getSize() const { return m_VectorList.size(); }
38  void reserve(size_t uSize) { m_VectorList.reserve(uSize); }
39  void clear() { m_VectorList.clear(); }
40  void setFrameDuration(const double dFrameDurationMS) { m_dFrameDurationMS = dFrameDurationMS; }
41  void setNumBins(const unsigned int uNumBins) { m_uNumBins = uNumBins; }
42  void normalize();
43 protected:
45  unsigned int m_uNumBins;
47 };
48 
49 #endif
std::vector< std::pair< long, TCSVector > > vectorlist_t
Definition: TCSgram.h:25
void setFrameDuration(const double dFrameDurationMS)
Definition: TCSgram.h:40
unsigned int m_uNumBins
Definition: TCSgram.h:45
void getTCSVector(int, TCSVector &) const
void clear()
Definition: TCSgram.h:39
long getTime(size_t) const
void setNumBins(const unsigned int uNumBins)
Definition: TCSgram.h:41
int getSize() const
Definition: TCSgram.h:37
vectorlist_t m_VectorList
Definition: TCSgram.h:44
void printDebug()
void addTCSVector(const TCSVector &)
void reserve(size_t uSize)
Definition: TCSgram.h:38
double m_dFrameDurationMS
Definition: TCSgram.h:46
long getDuration() const
void normalize()