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

39
src/sound_engine.cpp Normal file
View File

@@ -0,0 +1,39 @@
#include "FluidSim/SoundEngine.hpp"
namespace fluidsim::port {
SoundEngine::SoundEngine(SimulationRingBuffer& source_buffer) : stream_(source_buffer) {}
SoundEngine::~SoundEngine() {
stop();
}
void SoundEngine::start() {
if (is_playing_) return;
stream_.play();
is_playing_ = true;
}
void SoundEngine::stop() {
if (!is_playing_) return;
stream_.stop();
is_playing_ = false;
}
void SoundEngine::set_speed(double speed_value) {
stream_.set_speed(speed_value);
}
double SoundEngine::speed() const {
return stream_.speed();
}
void SoundEngine::set_volume(float volume_value) {
stream_.setVolume(volume_value);
}
float SoundEngine::volume() const {
return stream_.getVolume();
}
} // namespace fluidsim::port