Times in SFML are now Uint32 milliseconds instead of float seconds
Added the sf::Uint64 and sf::Int64 types
This commit is contained in:
parent
c1ce16f4d6
commit
e4c6c30e0b
83 changed files with 250 additions and 262 deletions
|
@ -101,10 +101,10 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the total duration of the music
|
||||
///
|
||||
/// \return Music duration, in seconds
|
||||
/// \return Music duration, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
float GetDuration() const;
|
||||
Uint32 GetDuration() const;
|
||||
|
||||
protected :
|
||||
|
||||
|
@ -124,10 +124,10 @@ protected :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the current playing position in the stream source
|
||||
///
|
||||
/// \param timeOffset New playing position, in seconds
|
||||
/// \param timeOffset New playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnSeek(float timeOffset);
|
||||
virtual void OnSeek(Uint32 timeOffset);
|
||||
|
||||
private :
|
||||
|
||||
|
@ -135,7 +135,7 @@ private :
|
|||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
priv::SoundFile* myFile; ///< Sound file
|
||||
float myDuration; ///< Music duration, in seconds
|
||||
Uint32 myDuration; ///< Music duration, in milliseconds
|
||||
std::vector<Int16> mySamples; ///< Temporary buffer of samples
|
||||
Mutex myMutex; ///< Mutex protecting the data
|
||||
};
|
||||
|
|
|
@ -149,12 +149,12 @@ public :
|
|||
/// The playing position can be changed when the sound is
|
||||
/// either paused or playing.
|
||||
///
|
||||
/// \param timeOffset New playing position, in seconds
|
||||
/// \param timeOffset New playing position, in milliseconds
|
||||
///
|
||||
/// \see GetPlayingOffset
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void SetPlayingOffset(float timeOffset);
|
||||
void SetPlayingOffset(Uint32 timeOffset);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the audio buffer attached to the sound
|
||||
|
@ -177,12 +177,12 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current playing position of the sound
|
||||
///
|
||||
/// \return Current playing position, in seconds
|
||||
/// \return Current playing position, in milliseconds
|
||||
///
|
||||
/// \see SetPlayingOffset
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
float GetPlayingOffset() const;
|
||||
Uint32 GetPlayingOffset() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current status of the sound (stopped, paused, playing)
|
||||
|
|
|
@ -191,12 +191,12 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the total duration of the sound
|
||||
///
|
||||
/// \return Sound duration, in seconds
|
||||
/// \return Sound duration, in milliseconds
|
||||
///
|
||||
/// \see GetSampleRate, GetChannelsCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
float GetDuration() const;
|
||||
Uint32 GetDuration() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Overload of assignment operator
|
||||
|
@ -249,7 +249,7 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
unsigned int myBuffer; ///< OpenAL buffer identifier
|
||||
std::vector<Int16> mySamples; ///< Samples buffer
|
||||
float myDuration; ///< Sound duration, in seconds
|
||||
Uint32 myDuration; ///< Sound duration, in milliseconds
|
||||
mutable SoundList mySounds; ///< List of sounds that are using this buffer
|
||||
};
|
||||
|
||||
|
|
|
@ -131,22 +131,22 @@ public :
|
|||
/// The playing position can be changed when the stream is
|
||||
/// either paused or playing.
|
||||
///
|
||||
/// \param timeOffset New playing position, in seconds
|
||||
/// \param timeOffset New playing position, in milliseconds
|
||||
///
|
||||
/// \see GetPlayingOffset
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void SetPlayingOffset(float timeOffset);
|
||||
void SetPlayingOffset(Uint32 timeOffset);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current playing position of the stream
|
||||
///
|
||||
/// \return Current playing position, in seconds
|
||||
/// \return Current playing position, in milliseconds
|
||||
///
|
||||
/// \see SetPlayingOffset
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
float GetPlayingOffset() const;
|
||||
Uint32 GetPlayingOffset() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set whether or not the stream should loop after reaching the end
|
||||
|
@ -232,10 +232,10 @@ private :
|
|||
/// This function must be overriden by derived classes to
|
||||
/// allow random seeking into the stream source.
|
||||
///
|
||||
/// \param timeOffset New playing position, in seconds
|
||||
/// \param timeOffset New playing position, in milliseconds
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnSeek(float timeOffset) = 0;
|
||||
virtual void OnSeek(Uint32 timeOffset) = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Fill a new buffer with audio samples, and append
|
||||
|
@ -357,7 +357,7 @@ private :
|
|||
/// return true;
|
||||
/// }
|
||||
///
|
||||
/// virtual void OnSeek(float timeOffset)
|
||||
/// virtual void OnSeek(Uint32 timeOffset)
|
||||
/// {
|
||||
/// // Change the current position in the stream source
|
||||
/// ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue