CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Processing
Analysis
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
{
33
TIndex
id
;
34
TData
threshold
;
35
TData
percentil
;
36
TData
nPreviousFrames
;
37
}
TDescriptorsParams
;
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
70
class
SegmentatorConfig
:
public
ProcessingConfig
71
{
72
friend
class
Segmentator
;
73
public
:
74
DYNAMIC_TYPE_USING_INTERFACE
(
SegmentatorConfig
,2,
ProcessingConfig
);
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
85
void
SetDescriptorsSearch
(
const
SearchArray<TDescriptorsParams>
& frame) {
86
mDescriptorsSearch=frame;
87
}
88
const
SearchArray<TDescriptorsParams>
&
GetDescriptorsSearch
()
const
{
89
return
mDescriptorsSearch;
90
}
91
SearchArray<TDescriptorsParams>
&
GetDescriptorsSearch
() {
92
return
mDescriptorsSearch;
93
}
94
~SegmentatorConfig
(){};
95
private
:
96
SearchArray<TDescriptorsParams>
mDescriptorsSearch;
97
};
98
99
}
// namespace CLAM
100
101
#endif
102
Generated by
1.8.1