summaryrefslogtreecommitdiff
path: root/src/SFML/Audio/Music.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFML/Audio/Music.cpp')
-rw-r--r--[-rwxr-xr-x]src/SFML/Audio/Music.cpp39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/SFML/Audio/Music.cpp b/src/SFML/Audio/Music.cpp
index ebcda09..a4d9d76 100755..100644
--- a/src/SFML/Audio/Music.cpp
+++ b/src/SFML/Audio/Music.cpp
@@ -39,7 +39,6 @@ namespace sf
////////////////////////////////////////////////////////////
Music::Music(std::size_t BufferSize) :
myFile (NULL),
-myLoop (false),
myDuration(0.f),
mySamples (BufferSize)
{
@@ -105,24 +104,6 @@ bool Music::OpenFromMemory(const char* Data, std::size_t SizeInBytes)
////////////////////////////////////////////////////////////
-/// Set the music loop state
-////////////////////////////////////////////////////////////
-void Music::SetLoop(bool Loop)
-{
- myLoop = Loop;
-}
-
-
-////////////////////////////////////////////////////////////
-/// Tell whether or not the music is looping
-////////////////////////////////////////////////////////////
-bool Music::GetLoop() const
-{
- return myLoop;
-}
-
-
-////////////////////////////////////////////////////////////
/// /see SoundStream::OnStart
////////////////////////////////////////////////////////////
bool Music::OnStart()
@@ -141,25 +122,7 @@ bool Music::OnGetData(SoundStream::Chunk& Data)
Data.NbSamples = myFile->Read(&mySamples[0], mySamples.size());
// Check if we have reached the end of the audio file
- if (Data.NbSamples < mySamples.size())
- {
- // Check if we must loop
- if (myLoop)
- {
- if (OnStart())
- {
- // We succeeded to restart the audio playback
- Data.NbSamples += myFile->Read(&mySamples[Data.NbSamples], mySamples.size() - Data.NbSamples);
- return true;
- }
- }
-
- // No more audio samples to read : we stop the playback
- return false;
- }
-
- // End of audio file has not been reached, continue playback
- return true;
+ return Data.NbSamples == mySamples.size();
}