mirror of
https://github.com/taglib/taglib.git
synced 2025-07-14 11:04:17 -04:00
Add a list of the default file extensions that TagLib knows about, as requested
by Stefan. Also did a few additional updates on the API docs. CCMAIL:Stefan Gehn <mETz81@web.de> git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@438212 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
16
fileref.cpp
16
fileref.cpp
@ -100,6 +100,18 @@ void FileRef::addFileTypeResolver(const FileTypeResolver *resolver) // static
|
||||
FileRefPrivate::fileTypeResolvers.prepend(resolver);
|
||||
}
|
||||
|
||||
StringList FileRef::defaultFileExtensions()
|
||||
{
|
||||
StringList l;
|
||||
|
||||
l.append("ogg");
|
||||
l.append("flac");
|
||||
l.append("mp3");
|
||||
l.append("mpc");
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
bool FileRef::isNull() const
|
||||
{
|
||||
return !d->file || !d->file->isValid();
|
||||
@ -145,6 +157,10 @@ File *FileRef::create(const char *fileName, bool readAudioProperties,
|
||||
|
||||
String s = fileName;
|
||||
|
||||
// If this list is updated, the method defaultFileExtensions() should also be
|
||||
// updated. However at some point that list should be created at the same time
|
||||
// that a default file type resolver is created.
|
||||
|
||||
if(s.size() > 4) {
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".OGG")
|
||||
return new Vorbis::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
|
Reference in New Issue
Block a user