flacfile.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2003 by Allan Sandfeld Jensen
00003     email                : kde@carewolf.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_FLACFILE_H
00027 #define TAGLIB_FLACFILE_H
00028 
00029 #include "taglib_export.h"
00030 #include "tfile.h"
00031 
00032 #include "flacproperties.h"
00033 
00034 namespace TagLib {
00035 
00036   class Tag;
00037 
00038   namespace ID3v2 { class FrameFactory; class Tag; }
00039   namespace ID3v1 { class Tag; }
00040   namespace Ogg { class XiphComment; }
00041 
00043 
00053   namespace FLAC {
00054 
00056 
00064     class TAGLIB_EXPORT File : public TagLib::File
00065     {
00066     public:
00075       File(FileName file, bool readProperties = true,
00076            Properties::ReadStyle propertiesStyle = Properties::Average);
00077 
00086       // BIC: merge with the above constructor
00087       File(FileName file, ID3v2::FrameFactory *frameFactory,
00088            bool readProperties = true,
00089            Properties::ReadStyle propertiesStyle = Properties::Average);
00090 
00094       virtual ~File();
00095 
00104       virtual TagLib::Tag *tag() const;
00105 
00110       virtual Properties *audioProperties() const;
00111 
00119       virtual bool save();
00120 
00132       ID3v2::Tag *ID3v2Tag(bool create = false);
00133 
00145       ID3v1::Tag *ID3v1Tag(bool create = false);
00146 
00158       Ogg::XiphComment *xiphComment(bool create = false);
00159 
00167       void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
00168 
00175       ByteVector streamInfoData(); // BIC: remove
00176 
00183       long streamLength();  // BIC: remove
00184 
00185     private:
00186       File(const File &);
00187       File &operator=(const File &);
00188 
00189       void read(bool readProperties, Properties::ReadStyle propertiesStyle);
00190       void scan();
00191       long findID3v2();
00192       long findID3v1();
00193       ByteVector xiphCommentData() const;
00194       long findPaddingBreak(long nextPageOffset, long targetOffset, bool *isLast);
00195 
00196       class FilePrivate;
00197       FilePrivate *d;
00198     };
00199   }
00200 }
00201 
00202 #endif