[SFML]Troubles with music

Hello everyone,
First of all I have no idea if it's the right place to talk about SFML, but I know a lot of you guys use it, so just tell me if I should post this elsewhere.
I have a really noobish question today, I just want to check if a music is NOT playing, here is what I've done:
1
2
3
//music is a sf::Music
if(!(music->getStatus() == sf::Music::Playing/*music->playing*/))//if there's no music playing
	loadMusic(randNumber(0U,NUMBER_OF_TRACKS));


Of course I tried both of the possibilities, the commented one and the other, but none of them seem to be working :( .
How am I supposed to do then?
Thanks for your replies
1
2
3
4
5
6
7
8
9
10
11
12
13
if ( music->getStatus() != sf::Music::Playing )
{
    // not playing
    ....
}

// or...

if ( music->getStatus() == sf::Music::Playing || music->getStatus() == sf::Music::Paused )
{
    // not playing
    ....
}
Last edited on
Why do you create a pointer to the music object? In SFML that is not required
Topic archived. No new replies allowed.