1#ifndef RHYTHMGAME_SONGASSETSTORE_H
2#define RHYTHMGAME_SONGASSETSTORE_H
7#include <QTemporaryDir>
14#include <unordered_map>
18#ifdef RHYTHMGAME_USE_BACKBEAT
39 std::function<bool(
const std::filesystem::path& virtualPath)>;
44#ifdef RHYTHMGAME_USE_BACKBEAT
45 void setBackbeatSource(std::shared_ptr<BackbeatSource>
source);
48 [[nodiscard]]
auto read(
const std::filesystem::path& virtualPath,
49 const std::atomic_bool* stop =
nullptr) const
51 [[nodiscard]] auto
materialize(const std::filesystem::
path& virtualPath,
52 const std::atomic_bool* stop =
nullptr) const
53 -> std::filesystem::
path;
55 const std::filesystem::
path& virtualDirectory,
56 const std::vector<std::filesystem::
path>& relativePaths,
57 const std::atomic_bool* stop =
nullptr) const
58 -> std::unordered_map<std::filesystem::
path, std::filesystem::
path>;
62 std::atomic_bool* stop =
nullptr) const;
65 const std::filesystem::
path& virtualPath) const ->
bool;
66 [[nodiscard]] auto
isVirtual(const std::filesystem::
path& virtualPath) const
72 const std::filesystem::
path&
path) ->
bool;
74 const std::filesystem::
path&
path) -> QString;
76 const std::filesystem::
path&
path) ->
bool;
77 [[nodiscard]] static auto
imageUrl(const std::filesystem::
path& virtualPath)
79 [[nodiscard]] static auto
imageUrl(const QString& virtualDirectory,
80 const QString& relativePath) -> QString;
81 [[nodiscard]] static auto
audioUrl(const std::filesystem::
path& virtualPath)
85 -> std::filesystem::
path;
88 const QString& virtualDirectory,
89 const QString& relativePath) const;
90 Q_INVOKABLE [[nodiscard]] QString
localFile(
91 const QString& virtualPath) const;
93 const QString& virtualPath) const;
98 void materializeRequested(
99 const std::vector<std::filesystem::
path>& virtualPaths,
100 const std::atomic_bool* stop =
nullptr) const;
102 QTemporaryDir temporaryDirectory;
103 std::filesystem::
path materializationDirectory;
104 std::unique_ptr<
Impl> impl;
105#ifdef RHYTHMGAME_USE_BACKBEAT
106 std::shared_ptr<BackbeatSource> backbeat;
ReplaySource source
Definition BeatorajaReplayImporter.cpp:71
QString path
Definition Lr2SkinParser.cpp:87
Definition SongAssetStore.cpp:907
Definition SongAssetStore.h:28
static auto isAudioUrl(const QString &source) -> bool
Definition SongAssetStore.cpp:1513
static auto pathFromUrl(const QString &source) -> std::filesystem::path
Definition SongAssetStore.cpp:1519
auto isVirtual(const std::filesystem::path &virtualPath) const -> bool
Definition SongAssetStore.cpp:1138
auto read(const std::filesystem::path &virtualPath, const std::atomic_bool *stop=nullptr) const -> QByteArray
Definition SongAssetStore.cpp:1352
static auto imageUrl(const std::filesystem::path &virtualPath) -> QString
Definition SongAssetStore.cpp:1457
std::function< bool(const std::filesystem::path &virtualPath)> WantsContents
Definition SongAssetStore.h:39
Q_INVOKABLE QString containingFolder(const QString &virtualPath) const
Definition SongAssetStore.cpp:1564
std::function< void(ArchiveEntry entry)> EntryVisitor
Definition SongAssetStore.h:40
auto isArchived(const std::filesystem::path &virtualPath) const -> bool
Definition SongAssetStore.cpp:1205
~SongAssetStore() override
void walkArchive(const std::filesystem::path &archivePath, const WantsContents &wantsContents, const EntryVisitor &visitor, std::atomic_bool *stop=nullptr) const
Definition SongAssetStore.cpp:1214
static auto archiveSupportError(const std::filesystem::path &path) -> QString
Definition SongAssetStore.cpp:1168
auto materializeRelative(const std::filesystem::path &virtualDirectory, const std::vector< std::filesystem::path > &relativePaths, const std::atomic_bool *stop=nullptr) const -> std::unordered_map< std::filesystem::path, std::filesystem::path >
Definition SongAssetStore.cpp:1255
Q_INVOKABLE QString localFile(const QString &virtualPath) const
Definition SongAssetStore.cpp:1546
static auto audioUrl(const std::filesystem::path &virtualPath) -> QString
Definition SongAssetStore.cpp:1504
auto materialize(const std::filesystem::path &virtualPath, const std::atomic_bool *stop=nullptr) const -> std::filesystem::path
Definition SongAssetStore.cpp:1402
Q_INVOKABLE QString imageSource(const QString &virtualDirectory, const QString &relativePath) const
Definition SongAssetStore.cpp:1539
static auto isArchivePath(const std::filesystem::path &path) -> bool
Definition SongAssetStore.cpp:1149
static auto isSplitArchivePath(const std::filesystem::path &path) -> bool
Definition SongAssetStore.cpp:1187
static auto isSupportedArchivePath(const std::filesystem::path &path) -> bool
Definition SongAssetStore.cpp:1158
Classes and functions related to loading and managing resources such as charts, sounds,...
Definition ProfileArenaIdentityProvider.h:12
Definition SongAssetStore.h:33
std::optional< QByteArray > contents
Definition SongAssetStore.h:35
std::filesystem::path virtualPath
Definition SongAssetStore.h:34