Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/segmentation.h

Go to the documentation of this file.
00001 #ifndef SEGMENTATION_H
00002 #define SEGMENTATION_H
00003 
00004 #include "defs.h"
00005 
00006 #include <QList>
00007 
00008 /*
00009  * This class is basically a pirate of CLAM::DiscontinuousSegmentation
00010  * for storing chord detection information without copying the whole of
00011  * CLAM into Mixxx, thanks CLAM guys :)
00012  *  - Adam
00013  */
00014 
00015 template <class T>
00016 class Segmentation {
00017 
00018 public:
00019         Segmentation<T>() :
00020                 m_start(),
00021                 m_end(),
00022                 m_info() {
00023         }
00024         
00025         int getSegCount();
00026 
00027         // We have no typedef for time?
00028         float getSegStart(const int index) {
00029                 return m_start[index];
00030         }
00031 
00032         float getSegEnd(const int index) {
00033                 return m_end[index];
00034         }
00035 
00036         T getSegInfo(const int index) {
00037                 return m_info[index];
00038         }
00039 
00040         void addSeg(const float start, const float end, const T& info) {
00041                 m_start.push_back(start);
00042                 m_end.push_back(end);
00043                 m_info.push_back(info);
00044         }
00045 
00046 private:
00047         QList<int> m_start;
00048         QList<int> m_end;
00049         QList<T> m_info;
00050 };
00051 
00052 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines