]> granicus.if.org Git - taglib/commitdiff
Duplicate contructors of File subclasses to accept IOStream*
authorLukáš Lalinský <lalinsky@gmail.com>
Mon, 11 Apr 2011 21:31:44 +0000 (23:31 +0200)
committerLukáš Lalinský <lalinsky@gmail.com>
Mon, 11 Apr 2011 21:31:44 +0000 (23:31 +0200)
28 files changed:
taglib/ape/apefile.cpp
taglib/ape/apefile.h
taglib/asf/asffile.cpp
taglib/asf/asffile.h
taglib/flac/flacfile.cpp
taglib/flac/flacfile.h
taglib/mp4/mp4file.cpp
taglib/mp4/mp4file.h
taglib/mpc/mpcfile.cpp
taglib/mpc/mpcfile.h
taglib/ogg/flac/oggflacfile.cpp
taglib/ogg/flac/oggflacfile.h
taglib/ogg/oggfile.cpp
taglib/ogg/oggfile.h
taglib/ogg/speex/speexfile.cpp
taglib/ogg/speex/speexfile.h
taglib/ogg/vorbis/vorbisfile.cpp
taglib/ogg/vorbis/vorbisfile.h
taglib/riff/aiff/aifffile.cpp
taglib/riff/aiff/aifffile.h
taglib/riff/rifffile.cpp
taglib/riff/rifffile.h
taglib/riff/wav/wavfile.cpp
taglib/riff/wav/wavfile.h
taglib/trueaudio/trueaudiofile.cpp
taglib/trueaudio/trueaudiofile.h
taglib/wavpack/wavpackfile.cpp
taglib/wavpack/wavpackfile.h

index 5d914756efe43858f801ccd643e7bb4bb5d0ca16..2973a47685d3032aeb07c12ea17e60e2b2240a59 100644 (file)
@@ -92,6 +92,13 @@ APE::File::File(FileName file, bool readProperties,
   read(readProperties, propertiesStyle);
 }
 
+APE::File::File(IOStream *stream, bool readProperties,
+                Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 APE::File::~File()
 {
   delete d;
index a4bc80d90066f7793e20f2946031e737a919607b..2f22fddec9319179b6cfabadd396d1891195c318 100644 (file)
@@ -91,6 +91,14 @@ namespace TagLib {
       File(FileName file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an WavPack 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(IOStream *stream, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index 734898d44d150420a75d7438cb74247a29807e15..cb71b580f722749ebbe07ae2649a348cfcafc43c 100644 (file)
@@ -369,6 +369,13 @@ ASF::File::File(FileName file, bool readProperties, Properties::ReadStyle proper
   read(readProperties, propertiesStyle);
 }
 
+ASF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) 
+  : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 ASF::File::~File()
 {
   for(unsigned int i = 0; i < d->objects.size(); i++) {
index 45e603dc0c656dbae5c1c84eb34f251ad7c6d43c..f0acd728a96f460384e0151015752370ae06a844 100644 (file)
@@ -57,6 +57,16 @@ namespace TagLib {
        */
       File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an ASF 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.
+       *
+       * \note In the current implementation, both \a readProperties and
+       * \a propertiesStyle are ignored.
+       */
+      File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index f882ae7bda6e119c8f57340bdfe5f051fcbb7d04..058fa78684bc839b90ba4c8d2cb6593c6c1db65c 100644 (file)
@@ -119,6 +119,15 @@ FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
   read(readProperties, propertiesStyle);
 }
 
+FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(stream)
+{
+  d = new FilePrivate;
+  d->ID3v2FrameFactory = frameFactory;
+  read(readProperties, propertiesStyle);
+}
+
 FLAC::File::~File()
 {
   delete d;
index 64e67bc0627065f8e606d35118a734aca55bd30f..e9251fedb1b6425096a81ca68e532d21094b2904 100644 (file)
@@ -90,6 +90,19 @@ namespace TagLib {
            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(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+           bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index 2d59a8e59d7425631db7008b74221aa006a59fcc..d6ef4ebdf1d902d1680316f5b561e7a734a314a3 100644 (file)
@@ -72,6 +72,13 @@ MP4::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle a
   read(readProperties, audioPropertiesStyle);
 }
 
+MP4::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle audioPropertiesStyle)
+    : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, audioPropertiesStyle);
+}
+
 MP4::File::~File()
 {
   delete d;
index 5c28d7747acc1cfb29b7f3dcf569361c900a0df7..c3613f768b144dbfc0219bbb700be4aaa90eda71 100644 (file)
@@ -58,6 +58,16 @@ namespace TagLib {
        */
       File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs a MP4 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.
+       *
+       * \note In the current implementation, both \a readProperties and
+       * \a propertiesStyle are ignored.
+       */
+      File(IOStream *stream, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index 9e9d6b883977f15d115dae1712788d6bfa1e7787..216c1b3bcac10e38109c9184961ec021d14d8ffd 100644 (file)
@@ -96,6 +96,13 @@ MPC::File::File(FileName file, bool readProperties,
   read(readProperties, propertiesStyle);
 }
 
+MPC::File::File(IOStream *stream, bool readProperties,
+                Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 MPC::File::~File()
 {
   delete d;
index 6adc0ffb98d929abc956a758e80e5a6fa67cba8f..93471cf1256ba4fa88cd8ef1f8f5a879fd30b83c 100644 (file)
@@ -88,6 +88,14 @@ namespace TagLib {
       File(FileName file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an MPC 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(IOStream *stream, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index 22d7b81f6be508eb36253a32c26058e6cd635ebf..3addbffaa9b19760f7cd9a2df6c7954a8db0306b 100644 (file)
@@ -75,6 +75,13 @@ Ogg::FLAC::File::File(FileName file, bool readProperties,
   read(readProperties, propertiesStyle);
 }
 
+Ogg::FLAC::File::File(IOStream *stream, bool readProperties,
+                      Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 Ogg::FLAC::File::~File()
 {
   delete d;
index 5882a696d3ea756b154b40a608adf2ddde0a0206..d4373795f1d2e398240cc619db020b9309c61178 100644 (file)
@@ -71,6 +71,14 @@ namespace TagLib {
       File(FileName file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an Ogg/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(IOStream *stream, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index f29ba14a8a337f24e36e4783ff5da5ece1f820a2..01bb5c9d190b383be10ee9aceb2d513248224dbc 100644 (file)
@@ -213,6 +213,11 @@ Ogg::File::File(FileName file) : TagLib::File(file)
   d = new FilePrivate;
 }
 
+Ogg::File::File(IOStream *stream) : TagLib::File(stream)
+{
+  d = new FilePrivate;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // private members
 ////////////////////////////////////////////////////////////////////////////////
index da1fcb69bbb60bebd2c5b595a700d7d23238c491..1ecf2b9b0019c82af0c2968236f7d99df23134fa 100644 (file)
@@ -92,6 +92,17 @@ namespace TagLib {
        */
       File(FileName file);
 
+      /*!
+       * Contructs an Ogg 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.
+       *
+       * \note This constructor is protected since Ogg::File shouldn't be
+       * instantiated directly but rather should be used through the codec
+       * specific subclasses.
+       */
+      File(IOStream *stream);
+
     private:
       File(const File &);
       File &operator=(const File &);
index 604ac7c64db947894f5d7c5752e2b55ba7027183..3a4940a26a3e40c3dd92a0960d1eda67164a1edc 100644 (file)
@@ -65,6 +65,13 @@ Speex::File::File(FileName file, bool readProperties,
   read(readProperties, propertiesStyle);
 }
 
+Speex::File::File(IOStream *stream, bool readProperties,
+                   Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 Speex::File::~File()
 {
   delete d;
index 508b7aaaf040bd41130677c29129cc87a587b228..c14cf2aa60d61d87d915716c175630a41f35e079 100644 (file)
@@ -63,6 +63,14 @@ namespace TagLib {
         File(FileName file, bool readProperties = true,
              Properties::ReadStyle propertiesStyle = Properties::Average);
 
+        /*!
+         * Contructs a Speex 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(IOStream *stream, bool readProperties = true,
+             Properties::ReadStyle propertiesStyle = Properties::Average);
+
         /*!
          * Destroys this instance of the File.
          */
index 1098ec38970f0cd1a4cb9a4369e9efca89158083..60056f83388467570f4d528f1937586cddbb808d 100644 (file)
@@ -68,6 +68,13 @@ Vorbis::File::File(FileName file, bool readProperties,
   read(readProperties, propertiesStyle);
 }
 
+Vorbis::File::File(IOStream *stream, bool readProperties,
+                   Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 Vorbis::File::~File()
 {
   delete d;
index 3e33c113cbcb80b4979c091ae2f9699613dcaa01..299d9c2d3c7f56e268e2a809424a9775f716ca03 100644 (file)
@@ -70,6 +70,14 @@ namespace TagLib {
       File(FileName file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs a Vorbis 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(IOStream *stream, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index 425bfa020167702717fef3b6b3b1a10a4e845990..9f6be7ff1e7960854b95dc866ad408a326bd3ee8 100644 (file)
@@ -65,6 +65,14 @@ RIFF::AIFF::File::File(FileName file, bool readProperties,
     read(readProperties, propertiesStyle);
 }
 
+RIFF::AIFF::File::File(IOStream *stream, bool readProperties,
+                       Properties::ReadStyle propertiesStyle) : RIFF::File(stream, BigEndian)
+{
+  d = new FilePrivate;
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
 RIFF::AIFF::File::~File()
 {
   delete d;
index b9b0809f9cc663ab5ad0ad1137b7d41cf485da7e..cac429341cee0608bcdccafdd37ce54a84159f38 100644 (file)
@@ -65,6 +65,14 @@ namespace TagLib {
         File(FileName file, bool readProperties = true,
              Properties::ReadStyle propertiesStyle = Properties::Average);
 
+        /*!
+         * Contructs an AIFF 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(IOStream *stream, bool readProperties = true,
+             Properties::ReadStyle propertiesStyle = Properties::Average);
+
         /*!
          * Destroys this instance of the File.
          */
index 8d23bcd6983a475cd19dc88d4fd73be2ee740027..984568d19a16854fa136d0a2f52e6e3c8f65ee92 100644 (file)
@@ -79,6 +79,15 @@ RIFF::File::File(FileName file, Endianness endianness) : TagLib::File(file)
     read();
 }
 
+RIFF::File::File(IOStream *stream, Endianness endianness) : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  d->endianness = endianness;
+
+  if(isOpen())
+    read();
+}
+
 TagLib::uint RIFF::File::riffSize() const
 {
   return d->size;
index 99282564275a02f4a547bfe0fda9661f49f81cb1..e418dbb6751f8c362b9078952b480c35cdb563b2 100644 (file)
@@ -56,6 +56,7 @@ namespace TagLib {
       enum Endianness { BigEndian, LittleEndian };
 
       File(FileName file, Endianness endianness);
+      File(IOStream *stream, Endianness endianness);
 
       /*!
        * \return The size of the main RIFF chunk.
index 9ec3b510881e43b87d9500160b976c0c0373226c..70d9a35cfecffa10252f0683b5c52d261470e0ca 100644 (file)
@@ -65,6 +65,14 @@ RIFF::WAV::File::File(FileName file, bool readProperties,
     read(readProperties, propertiesStyle);
 }
 
+RIFF::WAV::File::File(IOStream *stream, bool readProperties,
+                       Properties::ReadStyle propertiesStyle) : RIFF::File(stream, LittleEndian)
+{
+  d = new FilePrivate;
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
 RIFF::WAV::File::~File()
 {
   delete d;
index b44668c32d92ddac3e79a644f2771850b462afeb..341932b940b4406ea3ee55997c3c6a3c46a98369 100644 (file)
@@ -65,6 +65,14 @@ namespace TagLib {
         File(FileName file, bool readProperties = true,
              Properties::ReadStyle propertiesStyle = Properties::Average);
 
+        /*!
+         * Contructs an WAV 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(IOStream *stream, bool readProperties = true,
+             Properties::ReadStyle propertiesStyle = Properties::Average);
+
         /*!
          * Destroys this instance of the File.
          */
index 0f362da9fc3563f6bd698d963d698c86c84e8df0..b584b7fdedfe160525c10f869c4cbd6554fe68bf 100644 (file)
@@ -99,6 +99,23 @@ TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
     read(readProperties, propertiesStyle);
 }
 
+TrueAudio::File::File(IOStream *stream, bool readProperties,
+                 Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
+TrueAudio::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+                 bool readProperties, Properties::ReadStyle propertiesStyle) :
+  TagLib::File(stream)
+{
+  d = new FilePrivate(frameFactory);
+  if(isOpen())
+    read(readProperties, propertiesStyle);
+}
+
 TrueAudio::File::~File()
 {
   delete d;
index 32cbf4b1af3b3e9bd8fa8a8e20f9c97f93ee8a53..9c8662333eaf2154afd80fc67db95c2f6dc81fb8 100644 (file)
@@ -96,6 +96,24 @@ namespace TagLib {
            bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an TrueAudio 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(IOStream *stream, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
+      /*!
+       * Contructs an TrueAudio 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.
+       */
+      File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
+           bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */
index 999a5445dc5aa64fec60b3883937db80271ee51a..19e4c77d7a3c6b0378cd9219ca8f86b21ed9edc4 100644 (file)
@@ -88,6 +88,13 @@ WavPack::File::File(FileName file, bool readProperties,
   read(readProperties, propertiesStyle);
 }
 
+WavPack::File::File(IOStream *stream, bool readProperties,
+                Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
+{
+  d = new FilePrivate;
+  read(readProperties, propertiesStyle);
+}
+
 WavPack::File::~File()
 {
   delete d;
index 3415a329baebc49ec86c35918e6fc7edfe7ea682..5173c136e25797f95e73176fbc0d0bde00be2119 100644 (file)
@@ -87,6 +87,14 @@ namespace TagLib {
       File(FileName file, bool readProperties = true,
            Properties::ReadStyle propertiesStyle = Properties::Average);
 
+      /*!
+       * Contructs an WavPack 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(IOStream *stream, bool readProperties = true,
+           Properties::ReadStyle propertiesStyle = Properties::Average);
+
       /*!
        * Destroys this instance of the File.
        */