Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Source.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 "Audaspace.h"
26
27#include <atomic>
28
30
36{
37private:
41 std::atomic<float> m_azimuth;
42
46 std::atomic<float> m_elevation;
47
51 std::atomic<float> m_distance;
52
53 // delete copy constructor and operator=
54 Source(const Source&) = delete;
55 Source& operator=(const Source&) = delete;
56
57public:
64 Source(float azimuth, float elevation, float distance = 0.0);
65
70 float getAzimuth();
71
76 float getElevation();
77
82 float getDistance();
83
88 float getVolume();
89
94 void setAzimuth(float azimuth);
95
100 void setElevation(float elevation);
101
106 void setDistance(float distance);
107};
108
The main header file of the library defining the namespace and basic data types.
#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
This class stores the azimuth and elevation angles of a sound and allows to change them dynamically.
Definition Source.h:36
float getVolume()
Retrieves the current volume value based on the distance.
void setElevation(float elevation)
Changes the elevation value.
float getDistance()
Retrieves the current distance value.
void setAzimuth(float azimuth)
Changes the azimuth value.
float getElevation()
Retrieves the current elevation value.
Source(float azimuth, float elevation, float distance=0.0)
Creates a Source instance with an initial value.
void setDistance(float distance)
Changes the distance value.
float getAzimuth()
Retrieves the current azimuth value.