4#ifndef __AUDIO_SUPPORTED_FILE_H__
5#define __AUDIO_SUPPORTED_FILE_H__
9#include "utils/utf8_string.h"
17#define SUPPORTED_FILE_DND_PREFIX Z_DND_STRING_PREFIX "FileDescriptor::"
42 FileDescriptor () =
default;
44 FileDescriptor (
const fs::path &abs_path);
53 static std::unique_ptr<FileDescriptor>
94 auto get_label ()
const {
return label_; }
utils::Utf8String get_info_text_for_label() const
Returns a pango markup to be used in GTK labels.
static bool is_type_midi(FileType type)
Returns if the FileDescriptor is a midi file.
static std::optional< utils::Utf8String > get_type_ext(FileType type)
Returns the most common extension for the given filetype.
utils::Utf8String get_icon_name() const
Gets the corresponding icon name for the given FileDescriptor's type.
fs::path abs_path_
Absolute path.
bool should_autoplay() const
Returns whether the given file should auto-play (shorter than 1 min).
static std::unique_ptr< FileDescriptor > new_from_uri(const utils::Utf8String &uri)
Creates a new FileDescriptor from a URI.
utils::Utf8String label_
Human readable label.
FileType type_
Type of file.
static utils::Utf8String get_type_description(FileType type)
Returns a human readable description of the given file type.
static bool is_type_audio(FileType type)
Returns if the FileDescriptor is an audio file.
bool hidden_
Hidden or not.
static bool is_type_supported(FileType type)
Returns if the given type is supported.
static FileType get_type_from_path(const fs::path &file)
Returns the file type of the given file path.
@ ParentDirectory
Special entry ".." for the parent dir.