aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-04-02 23:29:33 +0200
committerdec05eba <dec05eba@protonmail.com>2021-04-02 23:29:33 +0200
commit3ca7ed72c2f3a046e94213a8c26d80eafde9585c (patch)
tree67959bc624c4af5ad9d2e9ae805295097ca0a4ea /include
parent42ab6b1f7ad01cf87fa611b22313172a30eaff51 (diff)
FileManager: show video thumbnails, update thumbnail if name is the same but the content has changed (last modified time changed)
Diffstat (limited to 'include')
-rw-r--r--include/AsyncImageLoader.hpp1
-rw-r--r--include/FileAnalyzer.hpp9
2 files changed, 8 insertions, 2 deletions
diff --git a/include/AsyncImageLoader.hpp b/include/AsyncImageLoader.hpp
index 0366415..69746d2 100644
--- a/include/AsyncImageLoader.hpp
+++ b/include/AsyncImageLoader.hpp
@@ -25,6 +25,7 @@ namespace QuickMedia {
sf::Clock texture_applied_time;
};
+ // This function is async
bool create_thumbnail(const Path &thumbnail_path, const Path &thumbnail_path_resized, sf::Vector2i resize_target_size);
constexpr int NUM_IMAGE_LOAD_THREADS = 4;
diff --git a/include/FileAnalyzer.hpp b/include/FileAnalyzer.hpp
index be0cc25..51a7aa8 100644
--- a/include/FileAnalyzer.hpp
+++ b/include/FileAnalyzer.hpp
@@ -15,6 +15,7 @@ namespace QuickMedia {
VIDEO_AVI,
VIDEO_MP4,
VIDEO_WEBM,
+ VIDEO_FLV,
AUDIO_BASIC,
AUDIO_AIFF,
AUDIO_MPEG,
@@ -33,13 +34,17 @@ namespace QuickMedia {
bool is_content_type_audio(ContentType content_type);
bool is_content_type_image(ContentType content_type);
const char* content_type_to_string(ContentType content_type);
+ bool is_image_ext(const char *ext);
+ bool is_video_ext(const char *ext);
- bool video_get_first_frame(const char *filepath, const char *destination_path);
+ // Set |width| or |height| to 0 to disable scaling.
+ // This function is async.
+ bool video_get_first_frame(const char *filepath, const char *destination_path, int width = 0, int height = 0);
class FileAnalyzer {
public:
FileAnalyzer();
- bool load_file(const char *filepath);
+ bool load_file(const char *filepath, bool load_file_metadata = true);
ContentType get_content_type() const;
size_t get_file_size() const;
std::optional<Dimensions> get_dimensions() const;