SFML / CSFML

Official binding of SFML for C
https://www.sfml-dev.org
Other
342 stars 121 forks source link

`setChannelCount` when using `SoundBufferRecorder` #256

Closed mgrojo closed 1 week ago

mgrojo commented 3 months ago

When using SoundBufferRecorder, how is one supposed to set the channel count?

My impression is that, either a function sfSoundBufferRecorder_setChannelCount function is missing, or there should be a way to get a SoundRecorder from a SoundBufferRecorder in order to call sfSoundRecorder_setChannelCount.

ChrisThrasher commented 1 week ago

@mgrojo Can you check out https://github.com/SFML/CSFML/pull/294?

mgrojo commented 1 week ago

@mgrojo Can you check out #294?

It looks fine to me. Note however, that I wanted to confirm that they can be added to my binding, but I couldn't get latest CSFML to build with latest SFML, both in master branch.

$ make
Consolidate compiler generated dependencies of target csfml-system
[ 10%] Built target csfml-system
Consolidate compiler generated dependencies of target csfml-window
[ 12%] Building CXX object src/CSFML/Window/CMakeFiles/csfml-window.dir/Cursor.cpp.o
/home/mgr/src/github/SFML/CSFML/src/CSFML/Window/Cursor.cpp: In function ‘sfCursor* sfCursor_createFromPixels(const uint8_t*, sfVector2u, sfVector2u)’:
/home/mgr/src/github/SFML/CSFML/src/CSFML/Window/Cursor.cpp:36:31: error: createFromPixels’ is not a member of ‘sf::Cursor’
   36 |     auto cursor = sf::Cursor::createFromPixels(pixels, convertVector2(size), convertVector2(hotspot));
      |                               ^~~~~~~~~~~~~~~~
/home/mgr/src/github/SFML/CSFML/src/CSFML/Window/Cursor.cpp: In function ‘sfCursor* sfCursor_createFromSystem(sfCursorType)’:
/home/mgr/src/github/SFML/CSFML/src/CSFML/Window/Cursor.cpp:47:31: error: createFromSystem’ is not a member of ‘sf::Cursor’
   47 |     auto cursor = sf::Cursor::createFromSystem(static_cast<sf::Cursor::Type>(type));
      |                               ^~~~~~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-language-extension-token’ may have been intended to silence earlier diagnostics
make[2]: *** [src/CSFML/Window/CMakeFiles/csfml-window.dir/build.make:90: src/CSFML/Window/CMakeFiles/csfml-window.dir/Cursor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:265: src/CSFML/Window/CMakeFiles/csfml-window.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Have I done something wrong, or aren't both branches kept in line?

In any case, my binding is not updated for version 3, so I guess I won't be able to test this change on my side, for the moment.

eXpl0it3r commented 1 week ago

Can you double check that the SFML headers used are actually pointing to the mentioned SFML commit?

Our CI wouldn't pass, if we couldn't build CSFML with the latest SFML version, so this should work.

ChrisThrasher commented 1 week ago

CSFML's CI pipeline continuously builds with the latest commit from SFML so those commit hashes you're using should be compatible. If you want to come over to the SFML Discord I'm happy to debug your build issues.

In any case, my binding is not updated for version 3, so I guess I won't be able to test this change on my side, for the moment.

Seems reasonable to backport this fix to v2. https://github.com/SFML/CSFML/pull/300

ChrisThrasher commented 1 week ago

These functions were just merged into 2.6.x so you should be good to update your bindings now!

mgrojo commented 1 week ago

With the 2.6.x branches, I was able to update my binding and test the two new functions. Thanks a lot!