CLAM-Development  1.4.0
SegmentatorConfig.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 #ifndef _SegmentatorConfig_
23 #define _SegmentatorConfig_
24 
25 #include "SearchArray.hxx"
26 #include "ProcessingConfig.hxx"
27 #include <iosfwd>
28 
29 namespace CLAM {
30 
31 typedef struct //may need further additions
32 {
38 
39 inline bool operator<(const TDescriptorsParams& param1,const TDescriptorsParams& param2)
40 {
41  if (param1.id<param2.id) return true;
42  else return false;
43 }
44 
45 inline bool operator>=(const TDescriptorsParams& param1,const TDescriptorsParams& param2)
46 {
47  if (param1.id>=param2.id) return true;
48  else return false;
49 }
50 
51 inline bool operator==(const TDescriptorsParams& param1,const TDescriptorsParams& param2)
52 {
53  if (param1.id==param2.id) return true;
54  else return false;
55 }
56 
57 inline bool operator==(const TDescriptorsParams& param1,TIndex id)
58 {
59  if (param1.id==id) return true;
60  else return false;
61 }
62 
63 std::ostream& operator << (std::ostream& myStream, const TDescriptorsParams& a);
64 
65 std::istream& operator >> (std::istream& myStream, const TDescriptorsParams& a);
66 
71 {
72 friend class Segmentator;
73 public:
75  DYN_ATTRIBUTE (0, public, int, MinSegmentLength);
76  DYN_ATTRIBUTE (1, public, Array<TDescriptorsParams>, DescriptorsParams);
77 protected:
78  void DefaultInit();
79 /*Public Interface*/
80 public:
81  void AddDescParams(const TDescriptorsParams& descParams);
82  bool FindDescParams(TDescriptorsParams& descParams);
83  void ClearDescParams();
84 
86  mDescriptorsSearch=frame;
87  }
89  return mDescriptorsSearch;
90  }
92  return mDescriptorsSearch;
93  }
95 private:
96  SearchArray<TDescriptorsParams> mDescriptorsSearch;
97 };
98 
99 } // namespace CLAM
100 
101 #endif
102