Hi,
am i misreading something in the documentation or there is a problem here ? (found nothing in the forum with getStatus keyword nor in the github bugtracker).
#include <iostream>
#include <SFML/Audio.hpp>
int main()
{
sf::Music music;
if (!music.openFromFile("music.ogg"))
return -1; // error
music.play();
music.pause();
std::cout << music.getStatus();
if(music.getStatus()!= sf::Music::Paused)
{
std::cout << "Problem ?" << std::endl;
}
else
{
std::cout << "OK" << std::endl;
}
return 0;
// or loop ..
}
Output :
2Problem ?
Using mingw 4.7, linking statically to SFML.
Thank you for the help.
Have you tried with sf::Sound?
#include <iostream>
#include <SFML/Audio.hpp>
int main()
{
sf::SoundBuffer buffer;
if (!buffer.loadFromFile("music.ogg"))
return -1;
sf::Sound sound;
sound.setBuffer(buffer);
sound.play();
sound.pause();
std::cout << sound.getStatus();
if(sound.getStatus()!= sf::Sound::Paused)
{
std::cout << "Problem ?" << std::endl;
}
else
{
std::cout << "OK" << std::endl;
}
return 0;
}
Output :
1OK
I'm using SFML-2.1 release (not any snapshot from github)