#include "./sound_loader_wav.hpp" #include "./soloud_filesystem_file_impl.hpp" #include namespace MM { std::shared_ptr<::SoLoud::Wav> SoundLoaderWavFile::load(const std::string& path, Engine& engine) const { auto& fs = engine.getService(); if (!fs.isFile(path.c_str())) { // TODO: log error return nullptr; } auto h = fs.open(path.c_str()); MM::SoLoud::FilesystemFile sl_f(h, engine); auto ptr = std::make_shared<::SoLoud::Wav>(); auto r = ptr->loadFile(&sl_f); if (r != ::SoLoud::SO_NO_ERROR) { // TODO: log error return nullptr; } return ptr; } } // MM