Libgdx Request -> Expose OpenAL sourceIDs

Changing the pitch with a libgdx music object is not possible. Reason is that the android backend can’t handle it or whatever.

So, since I have many PC only libgdx projects, I just wanted to hack it in using lwjgl:

org.lwjgl.openal.AL10.alSourcef(SOURCE_ID, org.lwjgl.openal.AL10.AL_PITCH,  PITCH_AMOUNT);

right.

However there is noooo way that I can see that you can actually get the source id from a music object.
I looked at the lwjgl backend source and it is there obviously “private int sourceID”, its just not exposed via getter.
I understand its kinda low level and stuff, but can I request that you add this guys ? I mean I am doing the pitching myself already, just give me the sourceID :smiley:

Done.

As a token of appreciation, here is a picture of daigo and justin. (Because I know you like Street Fighter :D)

Haha, cool. Well, Daigo is cool, Justin isn’t.

You can always submit pull requests through GitHub. :slight_smile:

I’m not pro at git, meaning I never did a pull request, but I’m not a total beginner…
so I just pull libgdx, do this specific change, and then do a pull request and there you go ?

Basic steps are as follows…

  1. Get git command line client or the GitHub application for Win/Mac.

  2. Find the repo you want to patch up:
    https://github.com/libgdx/libgdx

  3. Click the “Fork” button in the top right. This will create a libgdx repo under your name.

  4. Click “Clone in Desktop” (if you’re using the GUI app) or use the following command:

cd /path/to/projects
git clone https://github.com/libgdx/libgdx.git

Note the first line simply cd’s to the directory where you want to store all your github repos. I keep mine in [icode]/projects[/icode] for quick typing.

  1. Now you need to run the following to get LibGDX repo up and running:
cd libgdx
ant -f fetch.xml

The first line cd’s into the libgdx repo you just cloned. The second pulls all the JARs and binaries.

  1. Run Eclipse and choose File -> Import -> Existing Project into Workspace and open the libgdx folder. You will see a bunch of projects, you can select them all. I’d strongly encourage using Eclipse’s Working Sets (or a different workspace) to avoid cluttering with your own projects.

  2. Make some changes and push them back to master with:

git add -A .
git commit -m "your commit message"
git push

(This is done in the libgdx directory you cloned earlier)

  1. Open your GitHub forked repo:
    https://github.com/YOUR-USERNAME/libgdx

And choose “Compare” (above “latest commit” line). From there you can click “Create a pull request”

Seems complicated but once you get the hang of it you’ll find yourself patching up a lot of open source projects. :slight_smile: