mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 06:35:46 +01:00
make probably-audio-file suffix detection case insensitive
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3207 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
5fae2ae363
commit
395193416f
1 changed files with 29 additions and 19 deletions
|
|
@ -696,29 +696,39 @@ AudioFileSource::setup_peakfile ()
|
|||
bool
|
||||
AudioFileSource::safe_file_extension(ustring file)
|
||||
{
|
||||
return !(file.rfind(".wav") == ustring::npos &&
|
||||
file.rfind(".aiff")== ustring::npos &&
|
||||
file.rfind(".caf")== ustring::npos &&
|
||||
file.rfind(".aif") == ustring::npos &&
|
||||
file.rfind(".amb") == ustring::npos &&
|
||||
file.rfind(".snd") == ustring::npos &&
|
||||
file.rfind(".au") == ustring::npos &&
|
||||
file.rfind(".raw") == ustring::npos &&
|
||||
file.rfind(".sf") == ustring::npos &&
|
||||
file.rfind(".cdr") == ustring::npos &&
|
||||
file.rfind(".smp") == ustring::npos &&
|
||||
file.rfind(".maud")== ustring::npos &&
|
||||
file.rfind(".vwe") == ustring::npos &&
|
||||
file.rfind(".paf") == ustring::npos &&
|
||||
const char* suffixes[] = {
|
||||
".wav", ".WAV",
|
||||
".aiff", ".AIFF",
|
||||
".caf", ".CAF",
|
||||
".aif", ".AIF",
|
||||
".amb", ".AMB",
|
||||
".snd", ".SND",
|
||||
".au", ".AU",
|
||||
".raw", ".RAW",
|
||||
".sf", ".SF",
|
||||
".cdr", ".CDR",
|
||||
".smp", ".SMP",
|
||||
".maud", ".MAUD",
|
||||
".vwe", ".VWE",
|
||||
".paf",
|
||||
#ifdef HAVE_FLAC
|
||||
file.rfind(".flac")== ustring::npos &&
|
||||
".flac", ".FLAC",
|
||||
#endif // HAVE_FLAC
|
||||
#ifdef HAVE_COREAUDIO
|
||||
file.rfind(".mp3") == ustring::npos &&
|
||||
file.rfind(".aac") == ustring::npos &&
|
||||
file.rfind(".mp4") == ustring::npos &&
|
||||
".mp3", ".MP3",
|
||||
".aac", ".AAC",
|
||||
".mp4", ".MP4",
|
||||
#endif // HAVE_COREAUDIO
|
||||
file.rfind(".voc") == ustring::npos);
|
||||
".voc", ".VOC"
|
||||
};
|
||||
|
||||
for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) {
|
||||
if (file.rfind (suffixes[n]) == file.length() - strlen (suffixes[n])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue