Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlxSound: add loopTime, closes #1662 #1736

Merged
merged 3 commits into from
Mar 15, 2016
Merged

FlxSound: add loopTime, closes #1662 #1736

merged 3 commits into from
Mar 15, 2016

Conversation

winterismute
Copy link
Contributor

Also, tiny cleanup of some FlxSound things.
Related for example to request #1662

…bled.

Also, tiny cleanup of some FlxSound things.
/**
* In case of looping, from where to restart the sound when it loops back
*/
private var loopPoint(default, set):Float;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be public (otherwise what's the point of making it a property with a setter?) and declared after looping.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure I like the name... How about loopTime (there already is a time) or loopPosition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally it was loopPosition, I changed it because, well, we already have a Position too :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopTime probably makes the most sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure honestly... But you can decide.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the connection to the already existing time property seems sensible.

@winterismute winterismute changed the title Allows to specify from where to restart a sound after looping, if eabled Allows to specify from where to restart a sound after looping, if enabled Feb 21, 2016
@@ -79,8 +79,9 @@ class SoundFrontEnd
* @param Volume How loud the sound should be, from 0 to 1.
* @param Looped Whether to loop this music.
* @param Group The group to add this sound to.
* @param LoopPoint Point at which the sound will restart when looping back (in case of looping)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be LoopTime

… second argument of sound.play() instead), now the event is always used. Fixed naming
@winterismute
Copy link
Contributor Author

I have fixed the possibility of looping using the second argument of Sound.play(), now we always use the event. In native builds has 0 effect on performance, not sure about flash, although it leads to nicer code.
Fixed the naming as pointed out by @gamedevsam too.

@Gama11 Gama11 changed the title Allows to specify from where to restart a sound after looping, if enabled FlxSound: add loopTime Mar 15, 2016
@Gama11 Gama11 changed the title FlxSound: add loopTime FlxSound: add loopTime, closes #1662 Mar 15, 2016
@Gama11
Copy link
Member

Gama11 commented Mar 15, 2016

Thanks!

Gama11 added a commit that referenced this pull request Mar 15, 2016
@Gama11 Gama11 merged commit 53c3981 into HaxeFlixel:dev Mar 15, 2016
Gama11 added a commit that referenced this pull request Mar 15, 2016
Aurel300 pushed a commit to larsiusprime/haxeflixel that referenced this pull request Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants