libKeyFinder
A small C++11 library for estimating the musical key of digital audio.
lowpassfilterfactory.h
1 /*************************************************************************
2 
3  Copyright 2011-2015 Ibrahim Sha'ath
4 
5  This file is part of LibKeyFinder.
6 
7  LibKeyFinder is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  LibKeyFinder is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with LibKeyFinder. If not, see <http://www.gnu.org/licenses/>.
19 
20 *************************************************************************/
21 
22 #ifndef LOWPASSFILTERFACTORY_H
23 #define LOWPASSFILTERFACTORY_H
24 
25 #include "constants.h"
26 #include "lowpassfilter.h"
27 
28 namespace KeyFinder {
29 
31  public:
34  const LowPassFilter* getLowPassFilter(unsigned int order, unsigned int frameRate, double cornerFrequency, unsigned int fftFrameSize);
35  private:
37  std::vector<LowPassFilterWrapper*> lowPassFilters;
38  std::mutex lowPassFilterFactoryMutex;
39  };
40 
42  public:
43  LowPassFilterWrapper(unsigned int order, unsigned int frameRate, double cornerFrequency, unsigned int fftFrameSize, const LowPassFilter* const filter);
45  const LowPassFilter* getLowPassFilter() const;
46  unsigned int getOrder() const;
47  unsigned int getFrameRate() const;
48  double getCornerFrequency() const;
49  unsigned int getFftFrameSize() const;
50  private:
51  unsigned int order;
52  unsigned int frameRate;
53  double cornerFrequency;
54  unsigned int fftFrameSize;
55  const LowPassFilter* lowPassFilter;
56  };
57 
58 }
59 
60 #endif
Definition: lowpassfilterfactory.h:41
Definition: lowpassfilterfactory.h:30
Definition: lowpassfilter.h:33