![]() |
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * 00019 * 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 public: 00095 // do not fix compiler warning about missing virtual destructor 00096 // since this would not be binary compatible 00097 // let Scott fix it whenever he thinks BIC changes can next be applied 00107 virtual File *createFile(FileName fileName, 00108 bool readAudioProperties = true, 00109 AudioProperties::ReadStyle 00110 audioPropertiesStyle = AudioProperties::Average) const = 0; 00111 }; 00112 00116 FileRef(); 00117 00127 explicit FileRef(FileName fileName, 00128 bool readAudioProperties = true, 00129 AudioProperties::ReadStyle 00130 audioPropertiesStyle = AudioProperties::Average); 00131 00136 explicit FileRef(File *file); 00137 00141 FileRef(const FileRef &ref); 00142 00146 virtual ~FileRef(); 00147 00156 Tag *tag() const; 00157 00162 AudioProperties *audioProperties() const; 00163 00179 File *file() const; 00180 00184 bool save(); 00185 00198 static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver); 00199 00216 static StringList defaultFileExtensions(); 00217 00221 bool isNull() const; 00222 00226 FileRef &operator=(const FileRef &ref); 00227 00231 bool operator==(const FileRef &ref) const; 00232 00237 bool operator!=(const FileRef &ref) const; 00238 00250 static File *create(FileName fileName, 00251 bool readAudioProperties = true, 00252 AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); 00253 00254 00255 private: 00256 class FileRefPrivate; 00257 FileRefPrivate *d; 00258 }; 00259 00260 } // namespace TagLib 00261 00262 #endif