MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / isAudioFile

Method isAudioFile

Telegram/SourceFiles/data/data_document.cpp:1838–1858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1836}
1837
1838bool DocumentData::isAudioFile() const {
1839 if (isVoiceMessage() || isVideoFile()) {
1840 return false;
1841 } else if (isSong()) {
1842 return true;
1843 }
1844 const auto prefix = u"audio/"_q;
1845 if (!_mimeString.startsWith(prefix, Qt::CaseInsensitive)) {
1846 if (_filename.endsWith(u".opus"_q, Qt::CaseInsensitive)) {
1847 return true;
1848 }
1849 return false;
1850 } else if (!_filename.isEmpty()
1851 && _nameType != Core::NameType::Audio
1852 && _nameType != Core::NameType::Video) {
1853 return false;
1854 }
1855 const auto left = _mimeString.mid(prefix.size());
1856 const auto types = { u"x-wav"_q, u"wav"_q, u"mp4"_q };
1857 return ranges::contains(types, left);
1858}
1859
1860bool DocumentData::isSharedMediaMusic() const {
1861 return isSong();

Callers 15

setSessionMethod · 0.80
moveInPlaylistMethod · 0.80
playMethod · 0.80
paintMethod · 0.80
updateStatusTextMethod · 0.80
ExtractRingtoneNameFunction · 0.80
setTypeFromAudioMethod · 0.80
IsItemGoodForTypeFunction · 0.80
TryFilePreviewFunction · 0.80
toGroupPreviewMethod · 0.80
toPreviewMethod · 0.80

Calls 2

isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected