-
Notifications
You must be signed in to change notification settings - Fork 17
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
Refactor and clean up FlxSound #92
Refactor and clean up FlxSound #92
Conversation
Several spots used 4 spaces rather than a tab to indent lines of code. This has been fixed in FlxSound (TODO: Check elsewhere for same occurrence)
Removed repetitious code for stopping and cleaning up the old channel, and moved it all to a new function `cleanup()`.
According to [the documentation](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundChannel.html#position): > If the sound is looped, position is reset to 0 at the beginning of each loop. So I removed a block of code that was simply unecessary.
- Removed oodles of duplicate code. - Changed the way pausing sounds works.
Seriously, Adam? Naming variables the same name as classes is a big no-no!
NOTE! I don't have any project to test this on, so it still needs to be tested. FDT allowed me to compile it, so there weren't any syntax errors, but I'm not sure if any functionality has stopped. Though, it should work in theory. |
I've tested your code and found some problems:
I've tested all those problems using Adam's branch and I got the same results. Those bugs were not introduced by your refactoring. Since the objective of this pull request is to refactor |
I did not take
I actually noticed that bug in Adam's code, but this version should have fixed that. I don't see how pausing twice can affect anything in this version of the code.
I'm unclear of how this could be happening. Do you think you could share the test project you are using so I can use it to debug this code? |
Yes, I can share it. As soon as I have access to the computer where I tested it, I will upload the code to a temp repo. |
Here it is, @IQAndreas https://github.com/FlixelCommunity/FlixelSandbox . Knock yourself out :) |
I tested this one, and it seems to work just fine in the current
This actually has to do with the above issue and has also been fixed in the current version. Using
I haven't been able to reproduce this one either. |
I updated the Flixel Sandbox with the latest SWC if you want to test these yourself. NOTE: The SWC matches the current version of |
I've tested this pull request using the last version of Flixel Sandbox and it is working fine. All bugs I reported were gone. Maybe it was some cache problem related to FlashDevelop. |
The point was to make
FlxSound
more clear, and to avoid repetitious code (which if I may say so myself, was a great success). See the commits for full changelog.