mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Hmm, that last one wasn't really quite ready. Now we actually check our list
of FileTypeResolvers. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@437391 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
ec86c487e8
commit
366a4bfe3f
11
fileref.cpp
11
fileref.cpp
@ -132,6 +132,15 @@ bool FileRef::operator!=(const FileRef &ref) const
|
||||
File *FileRef::create(const char *fileName, bool readAudioProperties,
|
||||
AudioProperties::ReadStyle audioPropertiesStyle) // static
|
||||
{
|
||||
|
||||
List<const FileTypeResolver *>::ConstIterator it = FileRefPrivate::fileTypeResolvers.begin();
|
||||
|
||||
for(; it != FileRefPrivate::fileTypeResolvers.end(); ++it) {
|
||||
File *file = (*it)->createFile(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(file)
|
||||
return file;
|
||||
}
|
||||
|
||||
// Ok, this is really dumb for now, but it works for testing.
|
||||
|
||||
String s = fileName;
|
||||
@ -145,7 +154,7 @@ File *FileRef::create(const char *fileName, bool readAudioProperties,
|
||||
return new FLAC::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
if(s.substr(s.size() - 4, 4).upper() == ".MPC")
|
||||
return new MPC::File(fileName, readAudioProperties, audioPropertiesStyle);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -95,7 +95,10 @@ namespace TagLib {
|
||||
* deleted. Deletion will happen automatically when the FileRef passes
|
||||
* out of scope.
|
||||
*/
|
||||
virtual File *createFile(const char *fileName) = 0;
|
||||
virtual File *createFile(const char *fileName,
|
||||
bool readAudioProperties = true,
|
||||
AudioProperties::ReadStyle
|
||||
audioPropertiesStyle = AudioProperties::Average) const = 0;
|
||||
};
|
||||
|
||||
FileRef();
|
||||
|
Loading…
Reference in New Issue
Block a user