| 1 | // This file is part of Dust Racing 2D. |
| 2 | // Copyright (C) 2013 Jussi Lind <[email protected]> |
| 3 | // |
| 4 | // Dust Racing 2D is free software: you can redistribute it and/or modify |
| 5 | // it under the terms of the GNU General Public License as published by |
| 6 | // the Free Software Foundation, either version 3 of the License, or |
| 7 | // (at your option) any later version. |
| 8 | // Dust Racing 2D is distributed in the hope that it will be useful, |
| 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | // GNU General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with Dust Racing 2D. If not, see <http://www.gnu.org/licenses/>. |
| 15 | |
| 16 | #include "source.hpp" |
| 17 | |
| 18 | namespace STFH { |
| 19 | |
| 20 | Source::Source() |
| 21 | : m_pitch(1.0) |
| 22 | , m_volume(1.0) |
| 23 | , m_maxDist(0.0) |
| 24 | , m_refDist(0.0) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | void Source::setData(DataPtr data) |
| 29 | { |
| 30 | m_data = data; |
| 31 | } |
| 32 | |
| 33 | void Source::setVolume(float volume) |
| 34 | { |
| 35 | m_volume = volume; |
| 36 | } |
| 37 | |
| 38 | float Source::volume() const |
| 39 | { |
| 40 | return m_volume; |
| 41 | } |
| 42 | |
| 43 | void Source::setPitch(float pitch) |
| 44 | { |
| 45 | m_pitch = pitch; |
| 46 | } |
| 47 | |
| 48 | float Source::pitch() const |
| 49 | { |
| 50 | return m_pitch; |
| 51 | } |
| 52 | |
| 53 | void Source::setLocation(const Location & location) |
| 54 | { |
| 55 | m_location = location; |
| 56 | } |
| 57 | |
| 58 | const Location & Source::location() const |
| 59 | { |
| 60 | return m_location; |
| 61 | } |
| 62 | |
| 63 | void Source::setMaxDist(float maxDist) |
| 64 | { |
| 65 | m_maxDist = maxDist; |
| 66 | } |
| 67 | |
| 68 | void Source::setReferenceDist(float refDist) |
| 69 | { |
| 70 | m_refDist = refDist; |
| 71 | } |
| 72 | |
| 73 | Source::~Source() |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | } // namespace STFH |