]> granicus.if.org Git - taglib/commitdiff
Fix the same bug that I fixed in MPEG last week -- allow the lib user to
authorScott Wheeler <wheeler@kde.org>
Sat, 10 Apr 2004 15:50:17 +0000 (15:50 +0000)
committerScott Wheeler <wheeler@kde.org>
Sat, 10 Apr 2004 15:50:17 +0000 (15:50 +0000)
specify the ID3v2FrameFactory in the FLAC::File construstor.

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@302629 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

flac/flacfile.cpp
flac/flacfile.h
mpeg/mpegfile.cpp

index 7346f9ed53c5bdc477bb214c86c49161d74d3dd4..4ba144d02e833977abfff2a49a8d0bce1e9f4caf 100644 (file)
@@ -88,12 +88,22 @@ public:
 ////////////////////////////////////////////////////////////////////////////////
 
 FLAC::File::File(const char *file, bool readProperties,
-                 Properties::ReadStyle propertiesStyle) : TagLib::File(file)
+                 Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
 {
   d = new FilePrivate;
   read(readProperties, propertiesStyle);
 }
 
+FLAC::File::File(const char *file, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
+{
+  d = new FilePrivate;
+  d->ID3v2FrameFactory = frameFactory;
+  read(readProperties, propertiesStyle);
+}
+
 FLAC::File::~File()
 {
   delete d;
index 56e506e0f86375ccbe129f3aac7fe9401407babb..2096fe6f43114dc678f05193bae7756cbb278549 100644 (file)
@@ -57,13 +57,26 @@ namespace TagLib {
     {
     public:
       /*!
-       * Contructs an FLAC file from \a file.  If \a readProperties is true the
+       * Contructs a FLAC file from \a file.  If \a readProperties is true the
        * file's audio properties will also be read using \a propertiesStyle.  If
        * false, \a propertiesStyle is ignored.
        */
       File(const char *file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs a FLAC file from \a file.  If \a readProperties is true the
+       * file's audio properties will also be read using \a propertiesStyle.  If
+       * false, \a propertiesStyle is ignored.
+       *
+       * If this file contains and ID3v2 tag the frames will be created using
+       * \a frameFactory.
+       */
+      // BIC: merge with the above constructor
+      File(const char *file, ID3v2::FrameFactory *frameFactory,
+           bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index bfb56e1235bc430ff6236cf8116f3dbe802aa467..196e85521b63cadd828814ce5092d1c1c8a70ac4 100644 (file)
@@ -315,7 +315,7 @@ ID3v2::Tag *MPEG::File::ID3v2Tag(bool create)
 
   // no ID3v2 tag exists and we've been asked to create one
 
-  d->ID3v2Tag = new ID3v2::Tag();
+  d->ID3v2Tag = new ID3v2::Tag;
   return d->ID3v2Tag;
 }