SegmentDescriptors.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  *                         UNIVERSITAT POMPEU FABRA
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __SegmentDescriptors_H__
00023 #define __SegmentDescriptors_H__
00024 
00025 #include "Descriptor.hxx"
00026 
00027 #include "AudioDescriptors.hxx"
00028 #include "FrameDescriptors.hxx"
00029 #include "MorphologicalSegmentDescriptors.hxx"
00030 #include "List.hxx"
00031 
00032 namespace CLAM 
00033 {
00034 
00035 class Segment;
00036 
00037 /*
00038  * This class holds Descriptors computed from Segment data
00039  *
00040  */
00041 class SegmentDescriptors : public Descriptor 
00042 {
00043 public:
00044         DYNAMIC_TYPE_USING_INTERFACE (SegmentDescriptors, 9, Descriptor);
00047         DYN_ATTRIBUTE (0, public, FrameDescriptors, MeanD);
00050         DYN_ATTRIBUTE (1, public, FrameDescriptors, MaxD);
00053         DYN_ATTRIBUTE (2, public, FrameDescriptors, MinD);
00056         DYN_ATTRIBUTE (3, public, FrameDescriptors, VarianceD);
00057 
00059         DYN_ATTRIBUTE (4,public, TData, Fundamental);
00060 
00061         DYN_ATTRIBUTE (5,public, AudioDescriptors, AudioD);
00062         
00064         DYN_ATTRIBUTE (6,public, Array<FrameDescriptors>, FramesD);
00065 
00069         DYN_ATTRIBUTE (7,public, MorphologicalSegmentDescriptors, MorphologicalSegmentD);
00070 
00072         DYN_ATTRIBUTE (8,public, List<SegmentDescriptors>, ChildrenD);
00073 
00074 public:
00075 
00076         SegmentDescriptors(Segment* pSegment);
00077 
00078         void SetpSegment(const Segment* pSegment);
00079         const Segment* GetpSegment() const;
00080         FrameDescriptors& GetFrameD(TIndex pos) {return GetFramesD()[pos];}
00081         void Compute();
00082         void ConcreteCompute();
00083         void SetFramePrototype(const FrameDescriptors& proto,int nFrames);
00084 
00085 
00086 
00087 private:
00088         void DefaultInit();
00089         void CopyInit(const SegmentDescriptors & copied);
00090 
00091 private:
00092         const Segment* mpSegment;
00093         StatsTmpl<false,FrameDescriptors,FrameDescriptors>* mSegmentStats;
00094 
00095 };
00096 
00097 } // namespace CLAM
00098 
00099 #endif /* __SegmentDescriptors_H__ */
00100 
Generated by  doxygen 1.6.3