Base+Userland: Add support for QOA files everywhere

This adds MIME type sniffing,
`file` support,
LaunchServer support to open QOA in SoundPlayer,
and audio icons
This commit is contained in:
kleines Filmröllchen 2023-02-27 13:03:06 +01:00 committed by Andrew Kaster
parent 0f7a5006d1
commit 61bb9103c2
5 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,7 @@ presenter=*.presenter
python=*.py
ruby=*.rb
shell=*.sh,*.bash,*.zsh
sound=*.wav,*.flac,*.mp3
sound=*.wav,*.flac,*.mp3,*.qoa
spreadsheet=*.sheets,*.csv
text=*.txt
truetype=*.ttf

View file

@ -17,6 +17,7 @@ flac=/bin/SoundPlayer
m3u=/bin/SoundPlayer
m3u8=/bin/SoundPlayer
mp3=/bin/SoundPlayer
qoa=/bin/SoundPlayer
txt=/bin/TextEditor
font=/bin/FontEditor
sheets=/bin/Spreadsheet

View file

@ -4,5 +4,5 @@ Executable=/bin/SoundPlayer
Category=Media
[Launcher]
FileTypes=mp3,flac,m3u,m3u8,wav
MimeTypes=audio/mpeg,audio/wave,audio/flac
FileTypes=mp3,flac,m3u,m3u8,qoa,wav
MimeTypes=audio/mpeg,audio/wave,audio/flac,audio/qoa

View file

@ -145,6 +145,7 @@ StringView guess_mime_type_based_on_filename(StringView path)
__ENUMERATE_MIME_TYPE_HEADER(png, "image/png", 0, 8, 0x89, 'P', 'N', 'G', 0x0D, 0x0A, 0x1A, 0x0A) \
__ENUMERATE_MIME_TYPE_HEADER(ppm, "image/x-portable-pixmap", 0, 3, 0x50, 0x33, 0x0A) \
__ENUMERATE_MIME_TYPE_HEADER(qcow, "extra/qcow", 0, 3, 'Q', 'F', 'I') \
__ENUMERATE_MIME_TYPE_HEADER(qoa, "audio/qoa", 0, 4, 'q', 'o', 'a', 'f') \
__ENUMERATE_MIME_TYPE_HEADER(qoi, "image/x-qoi", 0, 4, 'q', 'o', 'i', 'f') \
__ENUMERATE_MIME_TYPE_HEADER(rtf, "application/rtf", 0, 6, 0x7B, 0x5C, 0x72, 0x74, 0x66, 0x31) \
__ENUMERATE_MIME_TYPE_HEADER(sevenzip, "application/x-7z-compressed", 0, 6, 0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C) \

View file

@ -116,6 +116,7 @@ static Optional<DeprecatedString> elf_details(StringView description, StringView
__ENUMERATE_MIME_TYPE_DESCRIPTION("audio/flac"sv, "FLAC audio"sv, description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("audio/midi"sv, "MIDI notes"sv, description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("audio/mpeg"sv, "MP3 audio"sv, description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("audio/qoa"sv, "Quite OK Audio"sv, description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("audio/wave"sv, "WAVE audio"sv, description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("extra/blender"sv, "Blender project file"sv, description_only) \
__ENUMERATE_MIME_TYPE_DESCRIPTION("extra/elf"sv, "ELF"sv, elf_details) \