SFML community forums

Help => Audio => Topic started by: kileyi on January 08, 2019, 05:19:38 am

Title: How to usse Music::setLoopPoints
Post by: kileyi on January 08, 2019, 05:19:38 am
Got trouble using this function.

This function requires TimeSpan,and TimeSpan requires Time.

And Time can't pass number direct into it.

Like float start = 1.807;
float loop = 3.371;

So how can I pass time to it?Any example?
Title: Re: How to usse Music::setLoopPoints
Post by: Laurent on January 08, 2019, 07:39:05 am
Have you read the documentation and tutorials first?
Title: Re: How to usse Music::setLoopPoints
Post by: kileyi on January 08, 2019, 11:44:59 am
Yes,I think I have read some of them about audio part,I didn't find anything about this function.

And the API document does not give any example how to use this.

Just some useless parameter shown same as Visual Studio tip does.

https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Music.php#ae7b339f0a957dfad045f3f28083a015e

And I have tried google,no example.

So I hope to get some example here.

========================================
OK, never mind.I was stupid.I thought sf::Time shoud use like sf::Time(1.807) or something like this.

Turns out it is sf::seconds(1.807) which is sf::Time type.

Not what I was expected this is working this way.
Title: Re: How to usse Music::setLoopPoints
Post by: Laurent on January 08, 2019, 12:50:29 pm
Yes, I meant documentation about sf::Time, obviously ;)

Glad that you made it work.