CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Processing
SDIFIO
SDIFInStreaming.cxx
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
#include "
SDIFInStreaming.hxx
"
23
#include "
SpectrumConfig.hxx
"
24
#include "
ErrOpenFile.hxx
"
25
#include "
Frame.hxx
"
26
#include "
Segment.hxx
"
27
#include "
SpectralPeakArray.hxx
"
28
#include "
Fundamental.hxx
"
29
#include "
SDIFFile.hxx
"
30
#include "
SDIFFrame.hxx
"
31
#include "
SDIFMatrix.hxx
"
32
#include "
ProcessingFactory.hxx
"
33
34
namespace
CLAM
35
{
36
37
namespace
Hidden
38
{
39
static
const
char
*
metadata
[] = {
40
"key"
,
"SDIFInStreaming"
,
41
// "category", "SDIF I/O",
42
// "description", "SDIFInStreaming",
43
0
44
};
45
static
FactoryRegistrator<ProcessingFactory, SDIFInStreaming>
reg
=
metadata
;
46
}
47
48
SDIFInStreaming::SDIFInStreaming
():
49
mFundamentalOutput(
"Fundamental"
,this),
50
mResidualSpectrumOutput(
"Residual Spectrum"
,this),
51
mSpectralPeakArrayOutput(
"Sinusoidal Peaks"
,this),
52
mSDIFReader(
SDIFInConfig
())
53
{
54
Configure
(
SDIFInConfig
());
55
}
56
57
SDIFInStreaming::SDIFInStreaming
(
const
SDIFInConfig
& c):
58
mFundamentalOutput(
"Fundamental"
,this),
59
mResidualSpectrumOutput(
"Residual Spectrum"
,this),
60
mSpectralPeakArrayOutput(
"Sinusoidal Peaks"
,this),
61
mSDIFReader(c)
62
{
63
Configure
(c);
64
}
65
66
SDIFInStreaming::~SDIFInStreaming
()
67
{
68
}
69
70
bool
SDIFInStreaming::ConcreteConfigure(
const
ProcessingConfig
& c)
71
{
72
CopyAsConcreteConfig
(mConfig, c);
73
74
mSDIFReader.
Configure
(mConfig);
75
76
return
true
;
77
}
78
79
const
ProcessingConfig
&
SDIFInStreaming::GetConfig
()
const
80
{
81
return
mConfig;
82
}
83
84
bool
SDIFInStreaming::Do
(
void
)
85
{
86
bool
result = mSDIFReader.
ReadFrame
(
mFundamentalOutput
.
GetData
(),
87
mSpectralPeakArrayOutput
.
GetData
(),
88
mResidualSpectrumOutput
.
GetData
() );
89
90
mFundamentalOutput
.
Produce
();
91
mResidualSpectrumOutput
.
Produce
();
92
mSpectralPeakArrayOutput
.
Produce
();
93
94
return
result;
95
}
96
97
}
// namespace CLAM
98
Generated by
1.8.1