![]() |
|
00001 /*************************************************************************** 00002 copyright : (C) 2002 - 2008 by Scott Wheeler 00003 email : wheeler@kde.org 00004 ***************************************************************************/ 00005 00006 /*************************************************************************** 00007 * This library is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU Lesser General Public License version * 00009 * 2.1 as published by the Free Software Foundation. * 00010 * * 00011 * This library is distributed in the hope that it will be useful, but * 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * Lesser General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU Lesser General Public * 00017 * License along with this library; if not, write to the Free Software * 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 00019 * 02110-1301 USA * 00020 * * 00021 * Alternatively, this file is available under the Mozilla Public * 00022 * License Version 1.1. You may obtain a copy of the License at * 00023 * http://www.mozilla.org/MPL/ * 00024 ***************************************************************************/ 00025 00026 #ifndef TAGLIB_FILEREF_H 00027 #define TAGLIB_FILEREF_H 00028 00029 #include "tfile.h" 00030 #include "tstringlist.h" 00031 00032 #include "taglib_export.h" 00033 #include "audioproperties.h" 00034 00035 namespace TagLib { 00036 00037 class Tag; 00038 00040 00059 class TAGLIB_EXPORT FileRef 00060 { 00061 public: 00062 00064 00092 class TAGLIB_EXPORT FileTypeResolver 00093 { 00094 TAGLIB_IGNORE_MISSING_DESTRUCTOR 00095 public: 00105 virtual File *createFile(FileName fileName, 00106 bool readAudioProperties = true, 00107 AudioProperties::ReadStyle 00108 audioPropertiesStyle = AudioProperties::Average) const = 0; 00109 }; 00110 00114 FileRef(); 00115 00125 explicit FileRef(FileName fileName, 00126 bool readAudioProperties = true, 00127 AudioProperties::ReadStyle 00128 audioPropertiesStyle = AudioProperties::Average); 00129 00134 explicit FileRef(File *file); 00135 00139 FileRef(const FileRef &ref); 00140 00144 virtual ~FileRef(); 00145 00157 Tag *tag() const; 00158 00163 AudioProperties *audioProperties() const; 00164 00180 File *file() const; 00181 00185 bool save(); 00186 00199 static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver); 00200 00217 static StringList defaultFileExtensions(); 00218 00222 bool isNull() const; 00223 00227 FileRef &operator=(const FileRef &ref); 00228 00232 bool operator==(const FileRef &ref) const; 00233 00238 bool operator!=(const FileRef &ref) const; 00239 00251 static File *create(FileName fileName, 00252 bool readAudioProperties = true, 00253 AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); 00254 00255 00256 private: 00257 class FileRefPrivate; 00258 FileRefPrivate *d; 00259 }; 00260 00261 } // namespace TagLib 00262 00263 #endif