Hi all,
I got a problem with playing a track again.
I got a std::vector<sf::Music*> with 2 tracks I can play every track once, but when i start playing again the first element nothing happens.
My question is how to repeat a played song again, without using the loop-function?
I tryed:
- stop() and then play()
- setPlayingOffset (sf::milisecond(0))
- setLoop(true) play() setLoop(false)
relevant code
void MusicManager::update()
{
// m_isPlaying is true when manager start playing the first track
if(!m_isPlaying || m_music[m_currentIndex]->getStatus() == sf::Music::Playing)
return;
if(m_currentIndex + 1 < m_music.size())
++m_currentIndex;
else
m_currentIndex = 0;
m_music[m_currentIndex]->play();
}
Any suggestions?
Thnx.
Koschi