summaryrefslogtreecommitdiff
path: root/src/SFML/Audio/SoundSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFML/Audio/SoundSource.cpp')
-rw-r--r--src/SFML/Audio/SoundSource.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/SFML/Audio/SoundSource.cpp b/src/SFML/Audio/SoundSource.cpp
index 977769e..d9f291d 100644
--- a/src/SFML/Audio/SoundSource.cpp
+++ b/src/SFML/Audio/SoundSource.cpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
+// Copyright (C) 2007-2016 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -75,6 +75,7 @@ void SoundSource::setVolume(float volume)
alCheck(alSourcef(m_source, AL_GAIN, volume * 0.01f));
}
+
////////////////////////////////////////////////////////////
void SoundSource::setPosition(float x, float y, float z)
{
@@ -171,6 +172,24 @@ float SoundSource::getAttenuation() const
////////////////////////////////////////////////////////////
+SoundSource& SoundSource::operator =(const SoundSource& right)
+{
+ // Leave m_source untouched -- it's not necessary to destroy and
+ // recreate the OpenAL sound source, hence no copy-and-swap idiom
+
+ // Assign the sound attributes
+ setPitch(right.getPitch());
+ setVolume(right.getVolume());
+ setPosition(right.getPosition());
+ setRelativeToListener(right.isRelativeToListener());
+ setMinDistance(right.getMinDistance());
+ setAttenuation(right.getAttenuation());
+
+ return *this;
+}
+
+
+////////////////////////////////////////////////////////////
SoundSource::Status SoundSource::getStatus() const
{
ALint status;