MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / loadMusic

Method loadMusic

framework/data.cpp:360–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360sp<MusicTrack> DataImpl::loadMusic(const UString &path)
361{
362 std::lock_guard<std::recursive_mutex> l(this->musicCacheLock);
363 auto alias = this->musicAliases.find(path);
364 if (alias != this->musicAliases.end())
365 {
366 LogInfo("Using alias \"%s\" for \"%s\"", path, alias->second);
367 return this->loadMusic(alias->second);
368 }
369
370 // No cache for music tracks, just stream of disk
371 for (auto &loader : this->musicLoaders)
372 {
373 auto track = loader->loadMusic(path);
374 if (track)
375 {
376 track->path = path;
377 return track;
378 }
379 }
380 LogInfo("Failed to load music track \"%s\"", path);
381 return nullptr;
382}
383
384sp<Image> DataImpl::loadImage(const UString &path, bool lazy)
385{

Callers 1

playMethod · 0.45

Calls 1

endMethod · 0.80

Tested by

no test coverage detected