Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
BinauralSound.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 "ISound.h"
26#include "HRTF.h"
27#include "Source.h"
28#include "util/ThreadPool.h"
29#include "util/FFTPlan.h"
30
31#include <memory>
32#include <vector>
33
35
40{
41private:
45 std::shared_ptr<ISound> m_sound;
46
50 std::shared_ptr<HRTF> m_hrtfs;
51
55 std::shared_ptr<Source> m_source;
56
60 std::shared_ptr<ThreadPool> m_threadPool;
61
65 std::shared_ptr<FFTPlan> m_plan;
66
67 // delete copy constructor and operator=
68 BinauralSound(const BinauralSound&) = delete;
69 BinauralSound& operator=(const BinauralSound&) = delete;
70
71public:
81 BinauralSound(std::shared_ptr<ISound> sound, std::shared_ptr<HRTF> hrtfs, std::shared_ptr<Source> source, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan);
82
91 BinauralSound(std::shared_ptr<ISound> sound, std::shared_ptr<HRTF> hrtfs, std::shared_ptr<Source> source, std::shared_ptr<ThreadPool> threadPool);
92
93 virtual std::shared_ptr<IReader> createReader();
94
99 std::shared_ptr<HRTF> getHRTFs();
100
105 void setHRTFs(std::shared_ptr<HRTF> hrtfs);
106
111 std::shared_ptr<Source> getSource();
112
117 void setSource(std::shared_ptr<Source> source);
118};
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
The FFTPlan class.
The HRTF class.
The ISound interface.
The Source class.
The ThreadPool class.
This class represents a sound that can sound different depending on its realtive position with the li...
Definition BinauralSound.h:40
std::shared_ptr< Source > getSource()
Retrieves the Source object being used.
void setSource(std::shared_ptr< Source > source)
Changes the Source object used to change the source position of the sound.
BinauralSound(std::shared_ptr< ISound > sound, std::shared_ptr< HRTF > hrtfs, std::shared_ptr< Source > source, std::shared_ptr< ThreadPool > threadPool, std::shared_ptr< FFTPlan > plan)
Creates a new ConvolverSound.
BinauralSound(std::shared_ptr< ISound > sound, std::shared_ptr< HRTF > hrtfs, std::shared_ptr< Source > source, std::shared_ptr< ThreadPool > threadPool)
Creates a new BinauralSound.
std::shared_ptr< HRTF > getHRTFs()
Retrieves the HRTF set being used.
void setHRTFs(std::shared_ptr< HRTF > hrtfs)
Changes the set of HRTFs used for convolution, it'll only affect newly created readers.
virtual std::shared_ptr< IReader > createReader()
Creates a reader for playback of the sound source.
This class represents a type of sound source and saves the necessary values for it.
Definition ISound.h:40