Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to usse Music::setLoopPoints  (Read 3724 times)

0 Members and 1 Guest are viewing this topic.

kileyi

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
How to usse Music::setLoopPoints
« 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?
« Last Edit: January 08, 2019, 11:43:49 am by kileyi »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to usse Music::setLoopPoints
« Reply #1 on: January 08, 2019, 07:39:05 am »
Have you read the documentation and tutorials first?
Laurent Gomila - SFML developer

kileyi

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: How to usse Music::setLoopPoints
« Reply #2 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.
« Last Edit: January 08, 2019, 12:03:20 pm by kileyi »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to usse Music::setLoopPoints
« Reply #3 on: January 08, 2019, 12:50:29 pm »
Yes, I meant documentation about sf::Time, obviously ;)

Glad that you made it work.
Laurent Gomila - SFML developer

 

anything