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