1 /*************************************************************************** 2 copyright : (C) 2011 by Mathias Panzenböck 3 email : [email protected] 4 ***************************************************************************/ 5 6 /*************************************************************************** 7 * This library is free software; you can redistribute it and/or modify * 8 * it under the terms of the GNU Lesser General Public License version * 9 * 2.1 as published by the Free Software Foundation. * 10 * * 11 * This library is distributed in the hope that it will be useful, but * 12 * WITHOUT ANY WARRANTY; without even the implied warranty of * 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 14 * Lesser General Public License for more details. * 15 * * 16 * You should have received a copy of the GNU Lesser General Public * 17 * License along with this library; if not, write to the Free Software * 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * 19 * MA 02110-1301 USA * 20 ***************************************************************************/ 21 22 #ifndef TAGLIB_ITFILE_H 23 #define TAGLIB_ITFILE_H 24 25 #include "tfile.h" 26 #include "audioproperties.h" 27 #include "taglib_export.h" 28 #include "modfilebase.h" 29 #include "modtag.h" 30 #include "itproperties.h" 31 32 namespace TagLib { 33 34 namespace IT { 35 36 class TAGLIB_EXPORT File : public Mod::FileBase { 37 public: 38 /*! 39 * Constructs a Impulse Tracker file from \a file. 40 * 41 * \note In the current implementation, both \a readProperties and 42 * \a propertiesStyle are ignored. The audio properties are always 43 * read. 44 */ 45 File(FileName file, bool readProperties = true, 46 AudioProperties::ReadStyle propertiesStyle = 47 AudioProperties::Average); 48 49 /*! 50 * Constructs a Impulse Tracker file from \a stream. 51 * 52 * \note In the current implementation, both \a readProperties and 53 * \a propertiesStyle are ignored. The audio properties are always 54 * read. 55 * 56 * \note TagLib will *not* take ownership of the stream, the caller is 57 * responsible for deleting it after the File object. 58 */ 59 File(IOStream *stream, bool readProperties = true, 60 AudioProperties::ReadStyle propertiesStyle = 61 AudioProperties::Average); 62 63 /*! 64 * Destroys this instance of the File. 65 */ 66 virtual ~File(); 67 68 Mod::Tag *tag() const; 69 70 /*! 71 * Forwards to Mod::Tag::properties(). 72 * BIC: will be removed once File::toDict() is made virtual 73 */ 74 PropertyMap properties() const; 75 76 /*! 77 * Forwards to Mod::Tag::setProperties(). 78 * BIC: will be removed once File::setProperties() is made virtual 79 */ 80 PropertyMap setProperties(const PropertyMap &); 81 82 /*! 83 * Returns the IT::Properties for this file. If no audio properties 84 * were read then this will return a null pointer. 85 */ 86 IT::Properties *audioProperties() const; 87 88 /*! 89 * Save the file. 90 * This is the same as calling save(AllTags); 91 * 92 * \note Saving Impulse Tracker tags is not supported. 93 */ 94 bool save(); 95 96 97 private: 98 File(const File &); 99 File &operator=(const File &); 100 101 void read(bool readProperties); 102 103 class FilePrivate; 104 FilePrivate *d; 105 }; 106 } 107 } 108 109 #endif 110