141 static const std::string subsystem_name;
142 std::string name()
override;
143 bool is_initialized()
override;
144 std::expected<void, Subsystem::Error> initialize()
override;
145 std::expected<void, Subsystem::Error> terminate()
override;
153 static std::optional<SoundAsset> load(
const std::filesystem::path& path);
156 static std::optional<Stream> request_stream(
const SoundAsset&
id);
157 static void release_stream(Stream stream);
159 static void play(
const Sound& sound);
160 static void stop(
const Sound& sound);
161 static void set_volume(
const Sound& sound,
float volume);
165 static bool initialized;
166 static tenno::shared_ptr<Driver> driver;
178 virtual std::expected<void, std::string> initialize() = 0;
179 virtual std::expected<void, std::string> terminate() = 0;
181 virtual std::optional<Stream> request_stream(
const SoundAsset& sound) = 0;
182 virtual void release_stream(Stream stream) = 0;
184 virtual std::optional<SoundAsset> load(
const std::filesystem::path& path) = 0;
185 virtual void unload(
const SoundAsset& sound) = 0;
187 virtual void play(Stream stream) = 0;
188 virtual void stop(Stream stream) = 0;
189 virtual void set_volume(Stream stream,
float volume) = 0;