]> granicus.if.org Git - taglib/commitdiff
Add a constructor that takes an ID3v2::FrameFactory.
authorScott Wheeler <wheeler@kde.org>
Tue, 30 Mar 2004 13:50:26 +0000 (13:50 +0000)
committerScott Wheeler <wheeler@kde.org>
Tue, 30 Mar 2004 13:50:26 +0000 (13:50 +0000)
CCMAIL:Jonathan Giannuzzi <psyduck@altern.org>

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

mpeg/mpegfile.cpp
mpeg/mpegfile.h

index 96a4af0c9aeed392d40bf507f8c97e1c83b18c00..bfb56e1235bc430ff6236cf8116f3dbe802aa467 100644 (file)
@@ -167,8 +167,8 @@ namespace TagLib {
 class MPEG::File::FilePrivate
 {
 public:
-  FilePrivate() :
-    ID3v2FrameFactory(ID3v2::FrameFactory::instance()),
+  FilePrivate(ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
+    ID3v2FrameFactory(frameFactory),
     ID3v2Tag(0),
     ID3v2Location(-1),
     ID3v2OriginalSize(0),
@@ -219,6 +219,17 @@ MPEG::File::File(const char *file, bool readProperties,
   }
 }
 
+MPEG::File::File(const char *file, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(file)
+{
+  d = new FilePrivate(frameFactory);
+  if(isOpen()) {
+    d->tag = new MPEGTag(this);
+    read(readProperties, propertiesStyle);
+  }
+}
+
 MPEG::File::~File()
 {
   delete d;
index f76fd693d2bfba9d5ceee5dee8ff7882d07ed59e..ff0ddbc6feda2484cc1594865992c6ee8bb7c36e 100644 (file)
@@ -69,6 +69,17 @@ namespace TagLib {
       File(const char *file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an MPEG 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.  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.
        */