Synchronized with trunk
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1372 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
commit
57194f4d4b
7 changed files with 234 additions and 137 deletions
|
@ -32,10 +32,13 @@
|
|||
#include <SFML/System/Resource.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
|
||||
namespace sf
|
||||
{
|
||||
class Sound;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Storage for audio samples defining a sound
|
||||
///
|
||||
|
@ -220,12 +223,34 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
bool Update(unsigned int channelsCount, unsigned int sampleRate);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Add a sound to the list of sounds that use this buffer
|
||||
///
|
||||
/// \param sound Sound instance to attach
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void AttachSound(Sound* sound) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Remove a sound from the list of sounds that use this buffer
|
||||
///
|
||||
/// \param sound Sound instance to detach
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DetachSound(Sound* sound) const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Types
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef std::set<Sound*> SoundList; ///< Set of unique sound instances
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int myBuffer; ///< OpenAL buffer identifier
|
||||
std::vector<Int16> mySamples; ///< Samples buffer
|
||||
float myDuration; ///< Sound duration, in seconds
|
||||
mutable SoundList mySounds; ///< List of sounds that are using this buffer
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue