Audaspace  1.3.0
A high level audio library.
ImpulseResponse.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2015-2016 Juan Francisco Crespo Galán
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16 
17 #pragma once
18 
25 #include "util/StreamBuffer.h"
26 #include "util/FFTPlan.h"
27 #include "IReader.h"
28 
29 #include <memory>
30 #include <vector>
31 
33 
41 {
42 private:
48  std::vector<std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>>> m_processedIR;
49 
53  Specs m_specs;
54 
58  int m_length;
59 
60  // delete copy constructor and operator=
61  ImpulseResponse(const ImpulseResponse&) = delete;
62  ImpulseResponse& operator=(const ImpulseResponse&) = delete;
63 
64 public:
71  ImpulseResponse(std::shared_ptr<StreamBuffer> impulseResponse, std::shared_ptr<FFTPlan> plan);
72 
78  ImpulseResponse(std::shared_ptr<StreamBuffer> impulseResponse);
79 
84  Specs getSpecs();
85 
90  int getLength();
91 
97  std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> getChannel(int n);
98 
99 private:
105  void processImpulseResponse(std::shared_ptr<IReader> reader, std::shared_ptr<FFTPlan> plan);
106 };
107 
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
This class represents an impulse response that can be used in convolution.
Definition: ImpulseResponse.h:40
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
Specification of a sound source.
Definition: Specification.h:109
The StreamBuffer class.
The IReader interface.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
The FFTPlan class.