-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Revamp the sound engine. #236
Conversation
Also add a few @deprecated annotations to discouraged constructors
Conflicts: src/de/gurkenlabs/litiengine/physics/PhysicsEngine.java
Just as a first note: The |
I've never really asked this before, but why are all these components singletons, instead of static classes? |
It's a design decision we've made. The main benefit is that the |
Keep in mind that this implementation has a major bug in it which is why this is only a draft pull request. I assigned you in the hopes that you would be able to fix it. |
@TheRamenChef Thank's for the hint, I've just started to play around with the implementation and it also seems like the sound volume is not applied to the sound playbacks anymore. I'm currently not sure if this should be merged to the master before |
The volume isn't dB gain; it's an actual multiplier on the amplitude of the sound wave. You should get a noticeable response from setting it to 0.1 or such. |
The problem appeared to be with the Future's implementation of the cancel method. Whatever it was, it seems to be gone now.
I've managed to fix the issue, whatever it was. This pull request is now live. If you want to undo the sound engine being made static, go ahead. |
Perfect, will do so this weekend. |
I just set it to a minimum in the settings but this doesn't have any influence and the sounds are still played at normal volume. The music volume is evaluated properly it seems. |
Oh, you were talking about the sound volume in the settings. I just forgot to implement that. I've done that now. |
Key components of the engine are accessed via the Game class in a Singleton manner instead of static classes. Make sure that PhysicsEngine, RenderEngine and SoundEngine can only be initialized by the Game class.
It's working now; the Travis CI build seems to have the same problem as my early pull requests. |
I think the breaking CI on the branch was due to some changes I recently made to the Travis configuration that were not merged to the branch. So the actual build succeeded but the SonarQube part failed. |
The main feature of this pull request is a total rewrite of the
SoundPlayback
implementation. Notable changes include:Track
interface for more complex music, such as music with an intro.Also included is an implementation of layer opacity that I had previously forgotten to write.
This is currently marked as a draft pull request as there is a major bug in my implementation that makes some sounds not play. It's extremely annoying, as it's highly intermittent and I've been unable to determine the cause. It is assigned a thread, but for some reason the task exits before it can write any data to the line, but it's not being cancelled, because if it was, it would hit a breakpoint. You have implemented a sound playback before; what am I doing wrong?