Skip to content

Conversation

Marioalexsan
Copy link
Member

@Marioalexsan Marioalexsan commented Apr 29, 2025

Fixes #394.

Implements overriding for protected methods in sfMusic and sfSoundStream by using the pattern described here.

The Chunk struct was also updated since the data types were different from the ones used in the C++ library:

// CSFML old struct
typedef struct
{
    int16_t*     samples;     ///< Pointer to the audio samples
    unsigned int sampleCount; ///< Number of samples pointed by Samples
} sfSoundStreamChunk;

// SFML's struct
struct Chunk
{
    const std::int16_t* samples{};     //!< Pointer to the audio samples
    std::size_t         sampleCount{}; //!< Number of samples pointed by Samples
};

Additionally, ci.yml was updated so that a newer version of CMake would be fetched. mirroring the current code in the SFML repo. Without this, CI would fail due to an unsupported old version (< 3.5) being fetched.

@eXpl0it3r eXpl0it3r added this to the 3.0 milestone Apr 30, 2025
@eXpl0it3r eXpl0it3r modified the milestones: 3.0.0, 3.0.1 Aug 31, 2025
@eXpl0it3r
Copy link
Member

Looking at sfSoundRecorder_create where we pass the callbacks directly, wouldn't that also be an option for sfSoundStream? Instead of separate callback function setters, they are set at creation.

Do we really want to provide overrides for sfMusic? Isn't that more comparable to sfSoundRecorder and sfSoundBufferRecorder? While we haven't marked sf::Music as final, there's rarely a point in extending it, as it's just a more fancy sf::SoundStream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protected SFML Methods cannot be consumed by CSFML consumers
2 participants