12#ifndef __AUDIO_SUPPORTED_FILE_H__
13#define __AUDIO_SUPPORTED_FILE_H__
27#define SUPPORTED_FILE_DND_PREFIX Z_DND_STRING_PREFIX "SupportedFile::"
46static const cyaml_strval_t file_type_strings[] = {
47 {
"MIDI", FILE_TYPE_MIDI },
48 {
"mp3", FILE_TYPE_MP3 },
49 {
"FLAC", FILE_TYPE_FLAC },
50 {
"ogg", FILE_TYPE_OGG },
51 {
"wav", FILE_TYPE_WAV },
52 {
"directory", FILE_TYPE_DIR },
54 {
"other", FILE_TYPE_OTHER },
84static const cyaml_schema_field_t supported_file_fields_schema[] = {
93static const cyaml_schema_value_t supported_file_schema = {
105supported_file_new_from_uri (
const char * uri, GError ** error);
int supported_file_type_is_midi(ZFileType type)
Returns if the SupportedFile is a midi file.
SupportedFile * supported_file_new_from_path(const char *path)
Creates a new SupportedFile from the given absolute path.
void supported_file_free(SupportedFile *self)
Frees the instance and all its members.
int supported_file_type_is_supported(ZFileType type)
Returns if the given type is supported.
char * supported_file_type_get_description(ZFileType type)
Returns a human readable description of the given file type.
int supported_file_type_is_audio(ZFileType type)
Returns if the SupportedFile is an audio file.
NONNULL char * supported_file_get_info_text_for_label(const SupportedFile *self)
Returns a pango markup to be used in GTK labels.
NONNULL bool supported_file_should_autoplay(const SupportedFile *self)
Returns whether the given file should auto-play (shorter than 1 min).
NONNULL ZFileType supported_file_get_type(const char *file)
Returns the file type of the given file path.
SupportedFile * supported_file_clone(const SupportedFile *src)
Clones the given SupportedFile.
#define YAML_VALUE_PTR_NULLABLE(cc, fields_schema)
Schema to be used as a pointer that can be NULL.
const char * supported_file_type_get_ext(ZFileType type)
Returns the most common extension for the given filetype.
const char * supported_file_get_icon_name(const SupportedFile *const self)
Gets the corresponding icon name for the given SupportedFile's type.
@ FILE_TYPE_PARENT_DIR
Special entry ".." for the parent dir.
Metadata for a supported file.
char * label
Human readable label.
char * abs_path
Absolute path.
ZFileType type
Type of file.
WrappedObjectWithChangeSignal * gobj
MIDI file, if midi.
A GObject-ified normal C object with a signal that interested parties can listen to for changes.