Port FluidSim core and scenarios to C++20

This commit is contained in:
maxwes08
2026-10-22 23:52:20 +02:00
commit a859740a95
47 changed files with 3851 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#pragma once
#include "FluidSim/AudioOutputStream.hpp"
namespace fluidsim::port {
// Lifecycle wrapper matching the C# Audio.SoundEngine. The output stream owns
// the device callback, while this class gives the application one explicit
// start/stop and playback-control surface.
class SoundEngine {
public:
explicit SoundEngine(SimulationRingBuffer& source_buffer);
~SoundEngine();
SoundEngine(const SoundEngine&) = delete;
SoundEngine& operator=(const SoundEngine&) = delete;
void start();
void stop();
void set_speed(double speed);
double speed() const;
void set_volume(float volume);
float volume() const;
bool is_playing() const { return is_playing_; }
private:
AudioOutputStream stream_;
bool is_playing_{};
};
} // namespace fluidsim::port