MediaCover.h 969 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <filesystem>
  3. #include <utility>
  4. #include "Types.h"
  5. namespace WallpaperEngine::Media {
  6. class MediaSource;
  7. }
  8. namespace WallpaperEngine::FileSystem::Adapters {
  9. struct MediaCoverFactory final : Factory {
  10. MediaCoverFactory (Media::MediaSource& source) : source (source) { }
  11. [[nodiscard]] bool handlesMountpoint (const std::filesystem::path& path) const override;
  12. [[nodiscard]] AdapterSharedPtr create (const std::filesystem::path& path) const override;
  13. Media::MediaSource& source;
  14. };
  15. struct MediaCoverAdapter final : Adapter {
  16. explicit MediaCoverAdapter (Media::MediaSource& source) : source (source) { }
  17. [[nodiscard]] ReadStreamSharedPtr open (const std::filesystem::path& path) const override;
  18. [[nodiscard]] bool exists (const std::filesystem::path& path) const override;
  19. [[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const override;
  20. Media::MediaSource& source;
  21. };
  22. }