getHeadphoneState documentation is missing changeCallback function parameters

Hi, found this little issue while debugging my headphone detection code.

Both Lua and C API documentation fail to mention playdate.sound.getHeadphoneState changeCallback function's parameters.

The function seems to receive two booleans that I assume are the same headphone and mic that getHeadphoneState itself returns.

Thanks for the note! I've added an explanation of the callback arguments to the Lua docs. The C function does have the callback signature in the getHeadphoneState function:

void playdate->sound->getHeadphoneState(int* headphone, int* mic, 
                                        int (*changeCallback)(int headphone, int mic));

But maybe that's not clear enough? Do you have any suggestions for improvement?

1 Like

Oh, I didn't even notice as the description text was identical in both versions :sweat_smile:

I think the signature is enough for C. In Lua all parameters are optional by default, so it needs an explanation.

1 Like