Improved API documentation (copied from SFML)

This commit is contained in:
Laurent Gomila committed 2011-09-02 20:15:45 +02:00
1 parent c84a787d0a
commit d734c9df5c
50 files changed
+1606 -1478

No files matched your search

+30 -19
View File
@@ -32,15 +32,19 @@
////////////////////////////////////////////////////////////
/// Change the global volume of all the sounds
/// \brief Change the global volume of all the sounds and musics
///
/// \param volume : New global volume, in the range [0, 100]
/// The volume is a number between 0 and 100; it is combined with
/// the individual volume of each sound / music.
/// The default value for the volume is 100 (maximum).
///
/// \param volume New global volume, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetGlobalVolume(float volume);
////////////////////////////////////////////////////////////
/// Get the current value of the global volume of all the sounds
/// \brief Get the current value of the global volume
///
/// \return Current global volume, in the range [0, 100]
///
@@ -48,41 +52,48 @@ CSFML_API void sfListener_SetGlobalVolume(float volume);
CSFML_API float sfListener_GetGlobalVolume(void);
////////////////////////////////////////////////////////////
/// Change the position of the listener
/// \brief Set the position of the listener in the scene
///
/// \param x : X position of the listener in the world
/// \param y : Y position of the listener in the world
/// \param z : Z position of the listener in the world
/// The default listener's position is (0, 0, 0).
///
/// \param x X coordinate of the listener's position
/// \param y Y coordinate of the listener's position
/// \param z Z coordinate of the listener's position
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetPosition(float x, float y, float z);
////////////////////////////////////////////////////////////
/// Get the current position of the listener
/// \brief Get the current position of the listener in the scene
///
/// \param x : X position of the listener in the world
/// \param y : Y position of the listener in the world
/// \param z : Z position of the listener in the world
/// \param x X coordinate of the listener's position
/// \param y Y coordinate of the listener's position
/// \param z Z coordinate of the listener's position
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_GetPosition(float* x, float* y, float* z);
////////////////////////////////////////////////////////////
/// Change the orientation of the listener
/// \brief Set the orientation of the listener in the scene
///
/// \param x : X component of the listener's direction
/// \param y : Y component of the listener's direction
/// \param z : Z component of the listener's direction
/// The orientation defines the 3D axes of the listener
/// (left, up, front) in the scene. The orientation vector
/// doesn't have to be normalized.
/// The default listener's orientation is (0, 0, -1).
///
/// \param x X coordinate of the listener's orientation
/// \param y Y coordinate of the listener's orientation
/// \param z Z coordinate of the listener's orientation
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_SetDirection(float x, float y, float z);
////////////////////////////////////////////////////////////
/// Get the current orientation of the listener
/// \brief Get the current orientation of the listener in the scene
///
/// \param x : X component of the listener's direction
/// \param y : Y component of the listener's direction
/// \param z : Z component of the listener's direction
/// \param x X coordinate of the listener's orientation
/// \param y Y coordinate of the listener's orientation
/// \param z Z coordinate of the listener's orientation
///
////////////////////////////////////////////////////////////
CSFML_API void sfListener_GetDirection(float* x, float* y, float* z);
+154 -81
View File
@@ -36,9 +36,15 @@
////////////////////////////////////////////////////////////
/// Create a new music and load it from a file
/// \brief Create a new music and load it from a file
///
/// \param filename : Path of the music file to open
/// This function doesn't start playing the music (call
/// sfMusic_Play to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \param filename Path of the music file to open
///
/// \return A new sfMusic object (NULL if failed)
///
@@ -46,10 +52,16 @@
CSFML_API sfMusic* sfMusic_CreateFromFile(const char* filename);
////////////////////////////////////////////////////////////
/// Create a new music and load it from a file in memory
/// \brief Create a new music and load it from a file in memory
///
/// \param data : Pointer to the file data in memory
/// \param sizeInBytes : Size of the data to load, in bytes
/// This function doesn't start playing the music (call
/// sfMusic_Play to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes
///
/// \return A new sfMusic object (NULL if failed)
///
@@ -57,9 +69,15 @@ CSFML_API sfMusic* sfMusic_CreateFromFile(const char* filename);
CSFML_API sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// Create a new music and load it from a custom stream
/// \brief Create a new music and load it from a custom stream
///
/// \param stream : Source stream to read from
/// This function doesn't start playing the music (call
/// sfMusic_Play to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \param stream Source stream to read from
///
/// \return A new sfMusic object (NULL if failed)
///
@@ -67,26 +85,31 @@ CSFML_API sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes
CSFML_API sfMusic* sfMusic_CreateFromStream(sfInputStream* stream);
////////////////////////////////////////////////////////////
/// Destroy an existing music
/// \brief Destroy a music
///
/// \param music : Music to delete
/// \param music Music to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Destroy(sfMusic* music);
////////////////////////////////////////////////////////////
/// Set a music loop state
/// \brief Set whether or not a music should loop after reaching the end
///
/// \param music : Music to set the loop state
/// \param loop : sfTrue to play in loop, sfFalse to play once
/// If set, the music will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfMusic_SetLoop(music, sfFalse) is called.
/// The default looping state for musics is false.
///
/// \param music Music object
/// \param loop sfTrue to play in loop, sfFalse to play once
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetLoop(sfMusic* music, sfBool loop);
////////////////////////////////////////////////////////////
/// Tell whether or not a music is looping
/// \brief Tell whether or not a music is in loop mode
///
/// \param music : Music to get the loop state from
/// \param music Music object
///
/// \return sfTrue if the music is looping, sfFalse otherwise
///
@@ -94,9 +117,9 @@ CSFML_API void sfMusic_SetLoop(sfMusic* music, sfBool loop);
CSFML_API sfBool sfMusic_GetLoop(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get a music duration
/// \brief Get the total duration of a music
///
/// \param music : Music to get the duration from
/// \param music Music object
///
/// \return Music duration, in milliseconds
///
@@ -104,33 +127,48 @@ CSFML_API sfBool sfMusic_GetLoop(const sfMusic* music);
CSFML_API sfUint32 sfMusic_GetDuration(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Start playing a music
/// \brief Start or resume playing a music
///
/// \param music : Music to play
/// This function starts the music if it was stopped, resumes
/// it if it was paused, and restarts it from beginning if it
/// was it already playing.
/// This function uses its own thread so that it doesn't block
/// the rest of the program while the music is played.
///
/// \param music Music object
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Play(sfMusic* music);
////////////////////////////////////////////////////////////
/// Pause a music
/// \brief Pause a music
///
/// \param music : Music to pause
/// This function pauses the music if it was playing,
/// otherwise (music already paused or stopped) it has no effect.
///
/// \param music Music object
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Pause(sfMusic* music);
////////////////////////////////////////////////////////////
/// Stop playing a music
/// \brief Stop playing a music
///
/// \param music : Music to stop
/// This function stops the music if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike sfMusic_Pause).
///
/// \param music Music object
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_Stop(sfMusic* music);
////////////////////////////////////////////////////////////
/// Return the number of channels of a music (1 = mono, 2 = stereo)
/// \brief Return the number of channels of a music
///
/// \param music : Music to get the channels count from
/// 1 channel means a mono sound, 2 means stereo, etc.
///
/// \param music Music object
///
/// \return Number of channels
///
@@ -138,29 +176,32 @@ CSFML_API void sfMusic_Stop(sfMusic* music);
CSFML_API unsigned int sfMusic_GetChannelsCount(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the stream sample rate of a music
/// \brief Get the sample rate of a music
///
/// \param music : Music to get the sample rate from
/// The sample rate is the number of audio samples played per
/// second. The higher, the better the quality.
///
/// \return Stream frequency (number of samples per second)
/// \param music Music object
///
/// \return Sample rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfMusic_GetSampleRate(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the status of a music (stopped, paused, playing)
/// \brief Get the current status of a music (stopped, paused, playing)
///
/// \param music : Music to get the status from
/// \param music Music object
///
/// \return Current status of the sound
/// \return Current status
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the current playing position of a music
/// \brief Get the current playing position of a music
///
/// \param music : Music to get the position from
/// \param music Music object
///
/// \return Current playing position, in milliseconds
///
@@ -168,112 +209,144 @@ CSFML_API sfSoundStatus sfMusic_GetStatus(const sfMusic* music);
CSFML_API sfUint32 sfMusic_GetPlayingOffset(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Set the pitch of a music
/// \brief Set the pitch of a music
///
/// \param music : Music to modify
/// \param pitch : New pitch
/// The pitch represents the perceived fundamental frequency
/// of a sound; thus you can make a music more acute or grave
/// by changing its pitch. A side effect of changing the pitch
/// is to modify the playing speed of the music as well.
/// The default value for the pitch is 1.
///
/// \param music Music object
/// \param pitch New pitch to apply to the music
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPitch(sfMusic* music, float pitch);
////////////////////////////////////////////////////////////
/// Set the volume of a music
/// \brief Set the volume of a music
///
/// \param music : Music to modify
/// \param volume : Volume (in range [0, 100])
/// The volume is a value between 0 (mute) and 100 (full volume).
/// The default value for the volume is 100.
///
/// \param music Music object
/// \param volume Volume of the music
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetVolume(sfMusic* music, float volume);
////////////////////////////////////////////////////////////
/// Set the position of a music
/// \brief Set the 3D position of a music in the audio scene
///
/// \param music : Music to modify
/// \param x : X position of the sound in the world
/// \param y : Y position of the sound in the world
/// \param z : Z position of the sound in the world
/// Only musics with one channel (mono musics) can be
/// spatialized.
/// The default position of a music is (0, 0, 0).
///
/// \param music Music object
/// \param x X coordinate of the position of the music in the scene
/// \param y Y coordinate of the position of the music in the scene
/// \param z Z coordinate of the position of the music in the scene
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPosition(sfMusic* music, float x, float y, float z);
////////////////////////////////////////////////////////////
/// Make the music's position relative to the listener's
/// position, or absolute.
/// The default value is false (absolute)
/// \brief Make a musics's position relative to the listener or absolute
///
/// \param music : Music to modify
/// \param relative : True to set the position relative, false to set it absolute
/// Making a music relative to the listener will ensure that it will always
/// be played the same way regardless the position of the listener.
/// This can be useful for non-spatialized musics, musics that are
/// produced by the listener, or musics attached to it.
/// The default value is false (position is absolute).
///
/// \param music Music object
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetRelativeToListener(sfMusic* music, sfBool relative);
////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance,
/// the listener will hear the music at its maximum volume.
/// The default minimum distance is 1.0
/// \brief Set the minimum distance of a music
///
/// \param music : Music to modify
/// \param distance : New minimum distance for the music
/// The "minimum distance" of a music is the maximum
/// distance at which it is heard at its maximum volume. Further
/// than the minimum distance, it will start to fade out according
/// to its attenuation factor. A value of 0 ("inside the head
/// of the listener") is an invalid value and is forbidden.
/// The default value of the minimum distance is 1.
///
/// \param music Music object
/// \param distance New minimum distance of the music
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetMinDistance(sfMusic* music, float distance);
////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the
/// more the sound will be attenuated with distance from listener.
/// The default attenuation factor 1.0
/// \brief Set the attenuation factor of a music
///
/// \param music : Music to modify
/// \param attenuation : New attenuation factor for the sound
/// The attenuation is a multiplicative factor which makes
/// the music more or less loud according to its distance
/// from the listener. An attenuation of 0 will produce a
/// non-attenuated music, i.e. its volume will always be the same
/// whether it is heard from near or from far. On the other hand,
/// an attenuation value such as 100 will make the music fade out
/// very quickly as it gets further from the listener.
/// The default value of the attenuation is 1.
///
/// \param music Music object
/// \param attenuation New attenuation factor of the music
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetAttenuation(sfMusic* music, float attenuation);
////////////////////////////////////////////////////////////
/// Set the current playing position of a music
/// \brief Change the current playing position of a music
///
/// \param music : Music to modify
/// \param timeOffset : New playing position, in milliseconds
/// The playing position can be changed when the music is
/// either paused or playing.
///
/// \param music Music object
/// \param timeOffset New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_SetPlayingOffset(sfMusic* music, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// Get the pitch of a music
/// \brief Get the pitch of a music
///
/// \param music : Music to get the pitch from
/// \param music Music object
///
/// \return Pitch value
/// \return Pitch of the music
///
////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetPitch(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the volume of a music
/// \brief Get the volume of a music
///
/// \param music : Music to get the volume from
/// \param music Music object
///
/// \return Volume value (in range [1, 100])
/// \return Volume of the music, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetVolume(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the position of a music
/// \brief Get the 3D position of a music in the audio scene
///
/// \param music : Music to get the position from
/// \param x : X position of the sound in the world
/// \param y : Y position of the sound in the world
/// \param z : Z position of the sound in the world
/// \param music Music object
/// \param x X position of the music in the world
/// \param y Y position of the music in the world
/// \param z Z position of the music in the world
///
////////////////////////////////////////////////////////////
CSFML_API void sfMusic_GetPosition(const sfMusic* music, float* x, float* y, float* z);
////////////////////////////////////////////////////////////
/// Tell if the music's position is relative to the listener's
/// position, or if it's absolute
/// \brief Tell whether a music's position is relative to the
/// listener or is absolute
///
/// \param music : Music to check
/// \param music Music object
///
/// \return sfTrue if the position is relative, sfFalse if it's absolute
///
@@ -281,21 +354,21 @@ CSFML_API void sfMusic_GetPosition(const sfMusic* music, float* x, float* y, flo
CSFML_API sfBool sfMusic_IsRelativeToListener(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the minimum distance of a music
/// \brief Get the minimum distance of a music
///
/// \param music : Music to get the minimum distance from
/// \param music Music object
///
/// \return Minimum distance for the music
/// \return Minimum distance of the music
///
////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetMinDistance(const sfMusic* music);
////////////////////////////////////////////////////////////
/// Get the attenuation factor of a music
/// \brief Get the attenuation factor of a music
///
/// \param music : Music to get the attenuation factor from
/// \param music Music object
///
/// \return Attenuation factor for the a music
/// \return Attenuation factor of the music
///
////////////////////////////////////////////////////////////
CSFML_API float sfMusic_GetAttenuation(const sfMusic* music);
+132 -78
View File
@@ -34,87 +34,109 @@
////////////////////////////////////////////////////////////
/// Construct a new sound
/// \brief Create a new sound
///
/// \return A new sfSound object (NULL if failed)
/// \return A new sfSound object
///
////////////////////////////////////////////////////////////
CSFML_API sfSound* sfSound_Create(void);
////////////////////////////////////////////////////////////
/// Copy an existing sound
/// \brief Create a new sound by copying an existing one
///
/// \param sound : Sound to copy
/// \param sound Sound to copy
///
/// \return Copied object
/// \return A new sfSound object which is a copy of \a sound
///
////////////////////////////////////////////////////////////
CSFML_API sfSound* sfSound_Copy(sfSound* sound);
////////////////////////////////////////////////////////////
/// Destroy an existing sound
/// \brief Destroy a sound
///
/// \param sound : Sound to delete
/// \param sound Sound to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_Destroy(sfSound* sound);
////////////////////////////////////////////////////////////
/// Start playing a sound
/// \brief Start or resume playing a sound
///
/// \param sound : Sound to play
/// This function starts the sound if it was stopped, resumes
/// it if it was paused, and restarts it from beginning if it
/// was it already playing.
/// This function uses its own thread so that it doesn't block
/// the rest of the program while the sound is played.
///
/// \param sound Sound object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_Play(sfSound* sound);
////////////////////////////////////////////////////////////
/// Pause a sound
/// \brief Pause a sound
///
/// \param sound : Sound to pause
/// This function pauses the sound if it was playing,
/// otherwise (sound already paused or stopped) it has no effect.
///
/// \param sound Sound object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_Pause(sfSound* sound);
////////////////////////////////////////////////////////////
/// Stop playing a sound
/// \brief Stop playing a sound
///
/// \param sound : Sound to stop
/// This function stops the sound if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike sfSound_Pause).
///
/// \param sound Sound object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_Stop(sfSound* sound);
////////////////////////////////////////////////////////////
/// Bind a sound buffer to a sound
/// \brief Set the source buffer containing the audio data to play
///
/// \param sound : Sound to set the loop state
/// \param buffer : Buffer to bind
/// It is important to note that the sound buffer is not copied,
/// thus the sfSoundBuffer object must remain alive as long
/// as it is attached to the sound.
///
/// \param sound Sound object
/// \param buffer Sound buffer to attach to the sound
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetBuffer(sfSound* sound, const sfSoundBuffer* buffer);
////////////////////////////////////////////////////////////
/// Get the sound buffer bound to a sound
/// \brief Get the audio buffer attached to a sound
///
/// \param sound : Sound to get the buffer from
/// \param sound Sound object
///
/// \return Pointer to the sound's buffer
/// \return Sound buffer attached to the sound (can be NULL)
///
////////////////////////////////////////////////////////////
CSFML_API const sfSoundBuffer* sfSound_GetBuffer(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Set a sound loop state
/// \brief Set whether or not a sound should loop after reaching the end
///
/// \param sound : Sound to set the loop state
/// \param loop : sfTrue to play in loop, sfFalse to play once
/// If set, the sound will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfSound_SetLoop(sound, sfFalse) is called.
/// The default looping state for sounds is false.
///
/// \param sound Sound object
/// \param loop sfTrue to play in loop, sfFalse to play once
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetLoop(sfSound* sound, sfBool loop);
////////////////////////////////////////////////////////////
/// Tell whether or not a sound is looping
/// \brief Tell whether or not a soud is in loop mode
///
/// \param sound : Sound to get the loop state from
/// \param sound Sound object
///
/// \return sfTrue if the sound is looping, sfFalse otherwise
///
@@ -122,122 +144,154 @@ CSFML_API void sfSound_SetLoop(sfSound* sound, sfBool loop);
CSFML_API sfBool sfSound_GetLoop(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Get the status of a sound (stopped, paused, playing)
/// \brief Get the current status of a sound (stopped, paused, playing)
///
/// \param sound : Sound to get the status from
/// \param sound Sound object
///
/// \return Current status of the sound
/// \return Current status
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfSound_GetStatus(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Set the pitch of a sound
/// \brief Set the pitch of a sound
///
/// \param sound : Sound to modify
/// \param pitch : New pitch
/// The pitch represents the perceived fundamental frequency
/// of a sound; thus you can make a sound more acute or grave
/// by changing its pitch. A side effect of changing the pitch
/// is to modify the playing speed of the sound as well.
/// The default value for the pitch is 1.
///
/// \param sound Sound object
/// \param pitch New pitch to apply to the sound
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPitch(sfSound* sound, float pitch);
////////////////////////////////////////////////////////////
/// Set the volume of a sound
/// \brief Set the volume of a sound
///
/// \param sound : Sound to modify
/// \param volume : Volume (in range [0, 100])
/// The volume is a value between 0 (mute) and 100 (full volume).
/// The default value for the volume is 100.
///
/// \param sound Sound object
/// \param volume Volume of the sound
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetVolume(sfSound* sound, float volume);
////////////////////////////////////////////////////////////
/// Set the position of a sound
/// \brief Set the 3D position of a sound in the audio scene
///
/// \param sound : Sound to modify
/// \param x : X position of the sound in the world
/// \param y : Y position of the sound in the world
/// \param z : Z position of the sound in the world
/// Only sounds with one channel (mono sounds) can be
/// spatialized.
/// The default position of a sound is (0, 0, 0).
///
/// \param sound Sound object
/// \param x X coordinate of the position of the sound in the scene
/// \param y Y coordinate of the position of the sound in the scene
/// \param z Z coordinate of the position of the sound in the scene
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPosition(sfSound* sound, float x, float y, float z);
////////////////////////////////////////////////////////////
/// Make the sound's position relative to the listener's
/// position, or absolute.
/// The default value is false (absolute)
/// \brief Make the sound's position relative to the listener or absolute
///
/// \param sound : Sound to modify
/// \param relative : True to set the position relative, false to set it absolute
/// Making a sound relative to the listener will ensure that it will always
/// be played the same way regardless the position of the listener.
/// This can be useful for non-spatialized sounds, sounds that are
/// produced by the listener, or sounds attached to it.
/// The default value is false (position is absolute).
///
/// \param sound Sound object
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetRelativeToListener(sfSound* sound, sfBool relative);
////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance,
/// the listener will hear the sound at its maximum volume.
/// The default minimum distance is 1.0
/// \brief Set the minimum distance of a sound
///
/// \param sound : Sound to modify
/// \param distance : New minimum distance for the sound
/// The "minimum distance" of a sound is the maximum
/// distance at which it is heard at its maximum volume. Further
/// than the minimum distance, it will start to fade out according
/// to its attenuation factor. A value of 0 ("inside the head
/// of the listener") is an invalid value and is forbidden.
/// The default value of the minimum distance is 1.
///
/// \param sound Sound object
/// \param distance New minimum distance of the sound
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetMinDistance(sfSound* sound, float distance);
////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the
/// more the sound will be attenuated with distance from listener.
/// The default attenuation factor is 1.0
/// \brief Set the attenuation factor of a sound
///
/// \param sound : Sound to modify
/// \param attenuation : New attenuation factor for the sound
/// The attenuation is a multiplicative factor which makes
/// the sound more or less loud according to its distance
/// from the listener. An attenuation of 0 will produce a
/// non-attenuated sound, i.e. its volume will always be the same
/// whether it is heard from near or from far. On the other hand,
/// an attenuation value such as 100 will make the sound fade out
/// very quickly as it gets further from the listener.
/// The default value of the attenuation is 1.
///
/// \param sound Sound object
/// \param attenuation New attenuation factor of the sound
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetAttenuation(sfSound* sound, float attenuation);
////////////////////////////////////////////////////////////
/// Set the current playing position of a sound
/// \brief Change the current playing position of a sound
///
/// \param sound : Sound to modify
/// \param timeOffset : New playing position, in milliseconds
/// The playing position can be changed when the sound is
/// either paused or playing.
///
/// \param sound Sound object
/// \param timeOffset New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_SetPlayingOffset(sfSound* sound, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// Get the pitch of a sound
/// \brief Get the pitch of a sound
///
/// \param sound : Sound to get the pitch from
/// \param sound Sound object
///
/// \return Pitch value
/// \return Pitch of the sound
///
////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetPitch(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Get the volume of a sound
/// \brief Get the volume of a sound
///
/// \param sound : Sound to get the volume from
/// \param sound Sound object
///
/// \return Volume value (in range [1, 100])
/// \return Volume of the sound, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetVolume(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Get the position of a sound
/// \brief Get the 3D position of a sound in the audio scene
///
/// \param sound : Sound to get the position from
/// \param x : X position of the sound in the world
/// \param y : Y position of the sound in the world
/// \param z : Z position of the sound in the world
/// \param sound Sound object
/// \param x X position of the sound in the world
/// \param y Y position of the sound in the world
/// \param z Z position of the sound in the world
///
////////////////////////////////////////////////////////////
CSFML_API void sfSound_GetPosition(const sfSound* sound, float* x, float* y, float* z);
////////////////////////////////////////////////////////////
/// Tell if the sound's position is relative to the listener's
/// position, or if it's absolute
/// \brief Tell whether a sound's position is relative to the
/// listener or is absolute
///
/// \param sound : Sound to check
/// \param sound Sound object
///
/// \return sfTrue if the position is relative, sfFalse if it's absolute
///
@@ -245,29 +299,29 @@ CSFML_API void sfSound_GetPosition(const sfSound* sound, float* x, float* y, flo
CSFML_API sfBool sfSound_IsRelativeToListener(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound
/// \brief Get the minimum distance of a sound
///
/// \param sound : Sound to get the minimum distance from
/// \param sound Sound object
///
/// \return Minimum distance for the sound
/// \return Minimum distance of the sound
///
////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetMinDistance(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound
/// \brief Get the attenuation factor of a sound
///
/// \param sound : Sound to get the attenuation factor from
/// \param sound Sound object
///
/// \return Attenuation factor for the sound
/// \return Attenuation factor of the sound
///
////////////////////////////////////////////////////////////
CSFML_API float sfSound_GetAttenuation(const sfSound* sound);
////////////////////////////////////////////////////////////
/// Get the current playing position of a sound
/// \brief Get the current playing position of a sound
///
/// \param sound : Sound to get the position from
/// \param sound Sound object
///
/// \return Current playing position, in milliseconds
///
+75 -33
View File
@@ -30,13 +30,18 @@
////////////////////////////////////////////////////////////
#include <SFML/Config.h>
#include <SFML/Audio/Types.h>
#include <SFML/System/InputStream.h>
#include <stddef.h>
////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file
/// \brief Create a new sound buffer and load it from a file
///
/// \param filename : Path of the music file to open
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \param filename Path of the sound file to load
///
/// \return A new sfSoundBuffer object (NULL if failed)
///
@@ -44,10 +49,14 @@
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename);
////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file in memory
/// \brief Create a new sound buffer and load it from a file in memory
///
/// \param data : Pointer to the file data in memory
/// \param sizeInBytes : Size of the data to load, in bytes
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes
///
/// \return A new sfSoundBuffer object (NULL if failed)
///
@@ -55,14 +64,29 @@ CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename);
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from an array of
/// samples in memory - assumed format for samples is
/// 16 bits signed integer
/// \brief Create a new sound buffer and load it from a custom stream
///
/// \param samples : Pointer to the samples in memory
/// \param samplesCount : Number of samples pointed by Samples
/// \param channelsCount : Number of channels (1 = mono, 2 = stereo, ...)
/// \param sampleRate : Frequency (number of samples to play per second)
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \param stream Source stream to read from
///
/// \return A new sfSoundBuffer object (NULL if failed)
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* stream);
////////////////////////////////////////////////////////////
/// \brief Create a new sound buffer and load it from an array of samples in memory
///
/// The assumed format of the audio samples is 16 bits signed integer
/// (sfInt16).
///
/// \param samples Pointer to the array of samples in memory
/// \param samplesCount Number of samples in the array
/// \param channelsCount Number of channels (1 = mono, 2 = stereo, ...)
/// \param sampleRate Sample rate (number of samples to play per second)
///
/// \return A new sfSoundBuffer object (NULL if failed)
///
@@ -70,48 +94,59 @@ CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// Copy an existing sound buffer
/// \brief Create a new sound buffer by copying an existing one
///
/// \param soundBuffer : Sound buffer to copy
/// \param soundBuffer Sound buffer to copy
///
/// \return Copied object
/// \return A new sfSoundBuffer object which is a copy of \a soundBuffer
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer
/// \brief Destroy a sound buffer
///
/// \param soundBuffer : Sound buffer to delete
/// \param soundBuffer Sound buffer to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Save a sound buffer to a file
/// \brief Save a sound buffer to an audio file
///
/// \param soundBuffer : Sound buffer to save
/// \param filename : Path of the sound file to write
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
/// w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.
///
/// \return sfTrue if saving has been successful
/// \param soundBuffer Sound buffer object
/// \param filename Path of the sound file to write
///
/// \return sfTrue if saving succeeded, sfFalse if it failed
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
////////////////////////////////////////////////////////////
/// Return the samples contained in a sound buffer
/// \brief Get the array of audio samples stored in a sound buffer
///
/// \param soundBuffer : Sound buffer to get samples from
/// The format of the returned samples is 16 bits signed integer
/// (sfInt16). The total number of samples in this array
/// is given by the sfSoundBuffer_GetSamplesCount function.
///
/// \return Pointer to the array of sound samples, in 16 bits signed integer format
/// \param soundBuffer Sound buffer object
///
/// \return Read-only pointer to the array of sound samples
///
////////////////////////////////////////////////////////////
CSFML_API const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Return the number of samples contained in a sound buffer
/// \brief Get the number of samples stored in a sound buffer
///
/// \param soundBuffer : Sound buffer to get samples count from
/// The array of samples can be accessed with the
/// sfSoundBuffer_GetSamples function.
///
/// \param soundBuffer Sound buffer object
///
/// \return Number of samples
///
@@ -119,19 +154,26 @@ CSFML_API const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuff
CSFML_API size_t sfSoundBuffer_GetSamplesCount(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer
/// \brief Get the sample rate of a sound buffer
///
/// \param soundBuffer : Sound buffer to get sample rate from
/// The sample rate is the number of samples played per second.
/// The higher, the better the quality (for example, 44100
/// samples/s is CD quality).
///
/// \return Sound frequency (number of samples per second)
/// \param soundBuffer Sound buffer object
///
/// \return Sample rate (number of samples per second)
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Return the number of channels of a sound buffer (1 = mono, 2 = stereo, ...)
/// \brief Get the number of channels used by a sound buffer
///
/// \param soundBuffer : Sound buffer to get channels count from
/// If the sound is mono then the number of channels will
/// be 1, 2 for stereo, etc.
///
/// \param soundBuffer Sound buffer object
///
/// \return Number of channels
///
@@ -139,9 +181,9 @@ CSFML_API unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuf
CSFML_API unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer
/// \brief Get the total duration of a sound buffer
///
/// \param soundBuffer : Sound buffer to get duration from
/// \param soundBuffer Sound buffer object
///
/// \return Sound duration, in milliseconds
///
+30 -16
View File
@@ -33,7 +33,7 @@
////////////////////////////////////////////////////////////
/// Construct a new sound buffer recorder
/// \brief Create a new sound buffer recorder
///
/// \return A new sfSoundBufferRecorder object (NULL if failed)
///
@@ -41,48 +41,62 @@
CSFML_API sfSoundBufferRecorder* sfSoundBufferRecorder_Create(void);
////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer recorder
/// \brief Destroy a sound buffer recorder
///
/// \param soundBufferRecorder : Sound buffer recorder to delete
/// \param soundBufferRecorder Sound buffer recorder to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundBufferRecorder_Destroy(sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// Start the capture.
/// Warning : only one capture can happen at the same time
/// \brief Start the capture of a sound recorder recorder
///
/// \param soundBufferRecorder : Sound buffer recorder to start
/// \param sampleRate : Sound frequency (the more samples, the higher the quality)
/// The \a sampleRate parameter defines the number of audio samples
/// captured per second. The higher, the better the quality
/// (for example, 44100 samples/sec is CD quality).
/// This function uses its own thread so that it doesn't block
/// the rest of the program while the capture runs.
/// Please note that only one capture can happen at the same time.
///
/// \param soundBufferRecorder Sound buffer recorder object
/// \param sampleRate Desired capture rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundBufferRecorder_Start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// Stop the capture
/// \brief Stop the capture of a sound recorder
///
/// \param soundBufferRecorder : Sound buffer recorder to stop
/// \param soundBufferRecorder Sound buffer recorder object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundBufferRecorder_Stop(sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer recorder
/// \brief Get the sample rate of a sound buffer recorder
///
/// \param soundBufferRecorder : Sound buffer recorder to get sample rate from
/// The sample rate defines the number of audio samples
/// captured per second. The higher, the better the quality
/// (for example, 44100 samples/sec is CD quality).
///
/// \return Frequency, in samples per second
/// \param soundBufferRecorder Sound buffer recorder object
///
/// \return Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundBufferRecorder_GetSampleRate(const sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// Get the sound buffer containing the captured audio data
/// of a sound buffer recorder
/// \brief Get the sound buffer containing the captured audio data
///
/// \param soundBufferRecorder : Sound buffer recorder to get the sound buffer from
/// The sound buffer is valid only after the capture has ended.
/// This function provides a read-only access to the internal
/// sound buffer, but it can be copied if you need to
/// make any modification to it.
///
/// \return Pointer to the sound buffer (you don't need to destroy it after use)
/// \param soundBufferRecorder Sound buffer recorder object
///
/// \return Read-only access to the sound buffer
///
////////////////////////////////////////////////////////////
CSFML_API const sfSoundBuffer* sfSoundBufferRecorder_GetBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
+32 -20
View File
@@ -39,13 +39,12 @@ typedef void (*sfSoundRecorderStopCallback)(void*);
////////////////////////////////////////////////////////////
/// Construct a new sound recorder with callback functions
/// for processing captured samples
/// \brief Construct a new sound recorder from callback functions
///
/// \param onStart : Callback function which will be called when a new capture starts (can be NULL)
/// \param onProcess : Callback function which will be called each time there's audio data to process
/// \param onStop : Callback function which will be called when the current capture stops (can be NULL)
/// \param userData : Data to pass to the callback function (can be NULL)
/// \param onStart Callback function which will be called when a new capture starts (can be NULL)
/// \param onProcess Callback function which will be called each time there's audio data to process
/// \param onStop Callback function which will be called when the current capture stops (can be NULL)
/// \param userData Data to pass to the callback function (can be NULL)
///
/// \return A new sfSoundRecorder object (NULL if failed)
///
@@ -56,46 +55,59 @@ CSFML_API sfSoundRecorder* sfSoundRecorder_Create(sfSoundRecorderStartCallback
void* userData);
////////////////////////////////////////////////////////////
/// Destroy an existing sound recorder
/// \brief Destroy a sound recorder
///
/// \param soundRecorder : Sound recorder to delete
/// \param soundRecorder Sound recorder to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundRecorder_Destroy(sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// Start the capture.
/// Warning : only one capture can happen at the same time
/// \brief Start the capture of a sound recorder
///
/// \param soundRecorder : Sound recorder to start
/// \param sampleRate : Sound frequency (the more samples, the higher the quality)
/// The \a sampleRate parameter defines the number of audio samples
/// captured per second. The higher, the better the quality
/// (for example, 44100 samples/sec is CD quality).
/// This function uses its own thread so that it doesn't block
/// the rest of the program while the capture runs.
/// Please note that only one capture can happen at the same time.
///
/// \param soundRecorder Sound recorder object
/// \param sampleRate Desired capture rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundRecorder_Start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// Stop the capture
/// \brief Stop the capture of a sound recorder
///
/// \param soundRecorder : Sound recorder to stop
/// \param soundRecorder Sound recorder object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundRecorder_Stop(sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// Get the sample rate of a sound recorder
/// \brief Get the sample rate of a sound recorder
///
/// \param soundRecorder : Sound recorder to get sample rate from
/// The sample rate defines the number of audio samples
/// captured per second. The higher, the better the quality
/// (for example, 44100 samples/sec is CD quality).
///
/// \return Frequency, in samples per second
/// \param soundRecorder Sound recorder object
///
/// \return Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundRecorder_GetSampleRate(const sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// Tell if the system supports sound capture.
/// If not, this class won't be usable
/// \brief Check if the system supports audio capture
///
/// \return sfTrue if audio capture is supported
/// This function should always be called before using
/// the audio capture features. If it returns false, then
/// any attempt to use sfSoundRecorder will fail.
///
/// \return sfTrue if audio capture is supported, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundRecorder_IsAvailable(void);
+4
View File
@@ -31,6 +31,10 @@
#include <SFML/Config.h>
////////////////////////////////////////////////////////////
/// \brief Enumeration of statuses for sounds and musics
///
////////////////////////////////////////////////////////////
typedef enum
{
sfStopped, ///< Sound / music is not playing
+137 -83
View File
@@ -34,8 +34,8 @@
////////////////////////////////////////////////////////////
/// sfSoundStreamChunk defines the data to fill by the
/// OnGetData callback
/// \brief defines the data to fill by the OnGetData callback
///
////////////////////////////////////////////////////////////
typedef struct
{
@@ -48,15 +48,15 @@ typedef void (*sfSoundStreamSeekCallback)(sfUint32, void*); ///<
////////////////////////////////////////////////////////////
/// Construct a new sound stream
/// \brief Create a new sound stream
///
/// \param onGetData : Function called when the stream needs more data (can't be NULL)
/// \param onSeek : Function called when the stream seeks (can't be NULL)
/// \param channelsCount : Number of channels to use (1 = mono, 2 = stereo)
/// \param sampleRate : Sample rate of the sound (44100 = CD quality)
/// \param userData : Data to pass to the callback functions
/// \param onGetData Function called when the stream needs more data (can't be NULL)
/// \param onSeek Function called when the stream seeks (can't be NULL)
/// \param channelsCount Number of channels to use (1 = mono, 2 = stereo)
/// \param sampleRate Sample rate of the sound (44100 = CD quality)
/// \param userData Data to pass to the callback functions
///
/// \return A new sfSoundStream object (NULL if failed)
/// \return A new sfSoundStream object
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGetData,
@@ -66,52 +66,66 @@ CSFML_API sfSoundStream* sfSoundStream_Create(sfSoundStreamGetDataCallback onGet
void* userData);
////////////////////////////////////////////////////////////
/// Destroy an existing sound stream
/// \brief Destroy a sound stream
///
/// \param soundStream : Sound stream to delete
/// \param soundStream Sound stream to destroy
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Destroy(sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Start playing a sound stream
/// \brief Start or resume playing a sound stream
///
/// \param soundStream : Sound stream to play
/// This function starts the stream if it was stopped, resumes
/// it if it was paused, and restarts it from beginning if it
/// was it already playing.
/// This function uses its own thread so that it doesn't block
/// the rest of the program while the music is played.
///
/// \param soundStream Sound stream object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Play(sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Pause a sound stream
/// \brief Pause a sound stream
///
/// \param soundStream : Sound stream to pause
/// This function pauses the stream if it was playing,
/// otherwise (stream already paused or stopped) it has no effect.
///
/// \param soundStream Sound stream object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Pause(sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Stop playing a sound stream
/// \brief Stop playing a sound stream
///
/// \param soundStream : Sound stream to stop
/// This function stops the stream if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike sfSoundStream_Pause).
///
/// \param soundStream Sound stream object
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_Stop(sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the status of a sound stream (stopped, paused, playing)
/// \brief Get the current status of a sound stream (stopped, paused, playing)
///
/// \param soundStream : Sound stream to get the status from
/// \param soundStream Sound stream object
///
/// \return Current status of the sound stream
/// \return Current status
///
////////////////////////////////////////////////////////////
CSFML_API sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Return the number of channels of a sound stream
/// (1 = mono, 2 = stereo)
/// \brief Return the number of channels of a sound stream
///
/// \param soundStream : Sound stream to get the channels count from
/// 1 channel means a mono sound, 2 means stereo, etc.
///
/// \param soundStream Sound stream object
///
/// \return Number of channels
///
@@ -119,131 +133,171 @@ CSFML_API sfSoundStatus sfSoundStream_GetStatus(const sfSoundStream* soundStream
CSFML_API unsigned int sfSoundStream_GetChannelsCount(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the sample rate of a sound stream
/// \brief Get the sample rate of a sound stream
///
/// \param soundStream : Sound stream to get the sample rate from
/// The sample rate is the number of audio samples played per
/// second. The higher, the better the quality.
///
/// \return Stream frequency (number of samples per second)
/// \param soundStream Sound stream object
///
/// \return Sample rate, in number of samples per second
///
////////////////////////////////////////////////////////////
CSFML_API unsigned int sfSoundStream_GetSampleRate(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Set the pitch of a sound stream
/// \brief Set the pitch of a sound stream
///
/// \param soundStream : Sound stream to modify
/// \param pitch : New pitch
/// The pitch represents the perceived fundamental frequency
/// of a sound; thus you can make a stream more acute or grave
/// by changing its pitch. A side effect of changing the pitch
/// is to modify the playing speed of the stream as well.
/// The default value for the pitch is 1.
///
/// \param soundStream Sound stream object
/// \param pitch New pitch to apply to the stream
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetPitch(sfSoundStream* soundStream, float pitch);
////////////////////////////////////////////////////////////
/// Set the volume of a sound stream
/// \brief Set the volume of a sound stream
///
/// \param soundStream : Sound stream to modify
/// \param volume : Volume (in range [0, 100])
/// The volume is a value between 0 (mute) and 100 (full volume).
/// The default value for the volume is 100.
///
/// \param soundStream Sound stream object
/// \param volume Volume of the stream
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetVolume(sfSoundStream* soundStream, float volume);
////////////////////////////////////////////////////////////
/// Set the position of a sound stream
/// \brief Set the 3D position of a sound stream in the audio scene
///
/// \param soundStream : Sound stream to modify
/// \param x : X position of the sound stream in the world
/// \param y : Y position of the sound stream in the world
/// \param z : Z position of the sound stream in the world
/// Only streams with one channel (mono streams) can be
/// spatialized.
/// The default position of a stream is (0, 0, 0).
///
/// \param soundStream Sound stream object
/// \param x X coordinate of the position of the stream in the scene
/// \param y Y coordinate of the position of the stream in the scene
/// \param z Z coordinate of the position of the stream in the scene
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetPosition(sfSoundStream* soundStream, float x, float y, float z);
////////////////////////////////////////////////////////////
/// Make the sound stream's position relative to the listener's
/// position, or absolute.
/// The default value is false (absolute)
/// \brief Make a sound stream's position relative to the listener or absolute
///
/// \param soundStream : Sound stream to modify
/// \param relative : True to set the position relative, false to set it absolute
/// Making a stream relative to the listener will ensure that it will always
/// be played the same way regardless the position of the listener.
/// This can be useful for non-spatialized streams, streams that are
/// produced by the listener, or streams attached to it.
/// The default value is false (position is absolute).
///
/// \param soundStream Sound stream object
/// \param relative sfTrue to set the position relative, sfFalse to set it absolute
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetRelativeToListener(sfSoundStream* soundStream, sfBool relative);
////////////////////////////////////////////////////////////
/// Set the minimum distance - closer than this distance,
/// the listener will hear the sound stream at its maximum volume.
/// The default minimum distance is 1.0
/// \brief Set the minimum distance of a sound stream
///
/// \param soundStream : Sound stream to modify
/// \param distance : New minimum distance for the sound stream
/// The "minimum distance" of a stream is the maximum
/// distance at which it is heard at its maximum volume. Further
/// than the minimum distance, it will start to fade out according
/// to its attenuation factor. A value of 0 ("inside the head
/// of the listener") is an invalid value and is forbidden.
/// The default value of the minimum distance is 1.
///
/// \param soundStream Sound stream object
/// \param distance New minimum distance of the stream
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetMinDistance(sfSoundStream* soundStream, float distance);
////////////////////////////////////////////////////////////
/// Set the attenuation factor - the higher the attenuation, the
/// more the sound stream will be attenuated with distance from listener.
/// The default attenuation factor 1.0
/// \brief Set the attenuation factor of a sound stream
///
/// \param soundStream : Sound stream to modify
/// \param attenuation : New attenuation factor for the sound stream
/// The attenuation is a multiplicative factor which makes
/// the stream more or less loud according to its distance
/// from the listener. An attenuation of 0 will produce a
/// non-attenuated stream, i.e. its volume will always be the same
/// whether it is heard from near or from far. On the other hand,
/// an attenuation value such as 100 will make the stream fade out
/// very quickly as it gets further from the listener.
/// The default value of the attenuation is 1.
///
/// \param soundStream Sound stream object
/// \param attenuation New attenuation factor of the stream
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetAttenuation(sfSoundStream* soundStream, float attenuation);
////////////////////////////////////////////////////////////
/// Set the current playing position of a stream
/// \brief Change the current playing position of a sound stream
///
/// \param soundStream : Sound stream to modify
/// \param timeOffset : New playing position, in milliseconds
/// The playing position can be changed when the stream is
/// either paused or playing.
///
/// \param soundStream Sound stream object
/// \param timeOffset New playing position, in milliseconds
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetPlayingOffset(sfSoundStream* soundStream, sfUint32 timeOffset);
////////////////////////////////////////////////////////////
/// Set a stream loop state
/// \brief Set whether or not a sound stream should loop after reaching the end
///
/// \param soundStream : Stream to set the loop state
/// \param loop : sfTrue to play in loop, sfFalse to play once
/// If set, the stream will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// sfSoundStream_SetLoop(stream, sfFalse) is called.
/// The default looping state for sound streams is false.
///
/// \param soundStream Sound stream object
/// \param loop sfTrue to play in loop, sfFalse to play once
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_SetLoop(sfSoundStream* soundStream, sfBool loop);
////////////////////////////////////////////////////////////
/// Get the pitch of a sound stream
/// \brief Get the pitch of a sound stream
///
/// \param soundStream : Sound stream to get the pitch from
/// \param soundStream Sound stream object
///
/// \return Pitch value
/// \return Pitch of the stream
///
////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetPitch(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the volume of a sound stream
/// \brief Get the volume of a sound stream
///
/// \param soundStream : Sound stream to get the volume from
/// \param soundStream Sound stream object
///
/// \return Volume value (in range [1, 100])
/// \return Volume of the stream, in the range [0, 100]
///
////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetVolume(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the position of a sound stream
/// \brief Get the 3D position of a sound stream in the audio scene
///
/// \param soundStream : Sound stream to get the position from
/// \param x : X position of the sound stream in the world
/// \param y : Y position of the sound stream in the world
/// \param z : Z position of the sound stream in the world
/// \param soundStream Sound stream object
/// \param x X position of the stream in the world
/// \param y Y position of the stream in the world
/// \param z Z position of the stream in the world
///
////////////////////////////////////////////////////////////
CSFML_API void sfSoundStream_GetPosition(const sfSoundStream* soundStream, float* x, float* y, float* z);
////////////////////////////////////////////////////////////
/// Tell if the sound stream's position is relative to the listener's
/// position, or if it's absolute
/// \brief Tell whether a sound stream's position is relative to the
/// listener or is absolute
///
/// \param soundStream : Sound stream to check
/// \param soundStream Sound stream object
///
/// \return sfTrue if the position is relative, sfFalse if it's absolute
///
@@ -251,39 +305,39 @@ CSFML_API void sfSoundStream_GetPosition(const sfSoundStream* soundStream, float
CSFML_API sfBool sfSoundStream_IsRelativeToListener(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the minimum distance of a sound stream
/// \brief Get the minimum distance of a sound stream
///
/// \param soundStream : Sound stream to get the minimum distance from
/// \param soundStream Sound stream object
///
/// \return Minimum distance for the sound stream
/// \return Minimum distance of the stream
///
////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetMinDistance(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the attenuation factor of a sound stream
/// \brief Get the attenuation factor of a sound stream
///
/// \param soundStream : Sound stream to get the attenuation factor from
/// \param soundStream Sound stream object
///
/// \return Attenuation factor for the sound stream
/// \return Attenuation factor of the stream
///
////////////////////////////////////////////////////////////
CSFML_API float sfSoundStream_GetAttenuation(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Tell whether or not a stream is looping
/// \brief Tell whether or not a sound stream is in loop mode
///
/// \param soundStream : Soundstream to get the loop state from
/// \param soundStream Sound stream object
///
/// \return sfTrue if the stream is looping, sfFalse otherwise
/// \return sfTrue if the music is looping, sfFalse otherwise
///
////////////////////////////////////////////////////////////
CSFML_API sfBool sfSoundStream_GetLoop(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// Get the current playing position of a sound stream
/// \brief Get the current playing position of a sound stream
///
/// \param soundStream : Sound stream to get the position from
/// \param soundStream Sound stream object
///
/// \return Current playing position, in milliseconds
///