migrate from std::filesystem::path to io::path (WIP)

This commit is contained in:
MihailRis 2025-01-30 22:23:13 +03:00
parent 1e22882284
commit e0314803c0
72 changed files with 1189 additions and 791 deletions

View file

@ -5,6 +5,7 @@
#include <string>
#include "io/io.hpp"
#include "audio/audio.hpp"
#include "debug/Logger.hpp"
#include "typedefs.hpp"
@ -43,11 +44,11 @@ static inline std::string vorbis_error_message(int code) {
}
std::unique_ptr<audio::PCM> ogg::load_pcm(
const fs::path& file, bool headerOnly
const io::path& file, bool headerOnly
) {
OggVorbis_File vf;
int code;
if ((code = ov_fopen(file.u8string().c_str(), &vf))) {
if ((code = ov_fopen(io::resolve(file).u8string().c_str(), &vf))) {
throw std::runtime_error("vorbis: " + vorbis_error_message(code));
}
std::vector<char> data;
@ -166,10 +167,10 @@ public:
}
};
std::unique_ptr<PCMStream> ogg::create_stream(const fs::path& file) {
std::unique_ptr<PCMStream> ogg::create_stream(const io::path& file) {
OggVorbis_File vf;
int code;
if ((code = ov_fopen(file.u8string().c_str(), &vf))) {
if ((code = ov_fopen(io::resolve(file).u8string().c_str(), &vf))) {
throw std::runtime_error("vorbis: " + vorbis_error_message(code));
}
return std::make_unique<OggStream>(vf);