Added the sf::Time class

This commit is contained in:
Laurent Gomila 2012-01-19 23:51:06 +01:00
parent e775bd0169
commit 4116ad033c
58 changed files with 880 additions and 227 deletions

View file

@ -46,9 +46,9 @@ int main()
// Display captured sound informations
std::cout << "Sound information :" << std::endl;
std::cout << " " << buffer.GetDuration() / 1000.f << " seconds" << std::endl;
std::cout << " " << buffer.GetSampleRate() << " samples / seconds" << std::endl;
std::cout << " " << buffer.GetChannelCount() << " channels" << std::endl;
std::cout << " " << buffer.GetDuration().AsSeconds() << " seconds" << std::endl;
std::cout << " " << buffer.GetSampleRate() << " samples / seconds" << std::endl;
std::cout << " " << buffer.GetChannelCount() << " channels" << std::endl;
// Choose what to do with the recorded sound data
char choice;
@ -76,11 +76,11 @@ int main()
while (sound.GetStatus() == sf::Sound::Playing)
{
// Display the playing position
std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << sound.GetPlayingOffset() / 1000.f << " sec";
std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << sound.GetPlayingOffset().AsSeconds() << " sec";
std::cout << std::flush;
// Leave some CPU time for other threads
sf::Sleep(100);
sf::Sleep(sf::Milliseconds(100));
}
}