Unify FLAC::File constructors

This commit is contained in:
Lukáš Lalinský 2012-11-04 09:58:56 +01:00
parent 9cede44af6
commit 6e2d5bc1dc
2 changed files with 16 additions and 32 deletions

View File

@ -104,31 +104,26 @@ public:
// public members
////////////////////////////////////////////////////////////////////////////////
FLAC::File::File(FileName file, bool readProperties,
Properties::ReadStyle propertiesStyle) :
FLAC::File::File(FileName file,
bool readProperties, Properties::ReadStyle propertiesStyle,
ID3v2::FrameFactory *frameFactory) :
TagLib::File(file)
{
d = new FilePrivate;
if(frameFactory)
d->ID3v2FrameFactory = frameFactory;
if(isOpen())
read(readProperties, propertiesStyle);
}
FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory,
bool readProperties, Properties::ReadStyle propertiesStyle) :
TagLib::File(file)
{
d = new FilePrivate;
d->ID3v2FrameFactory = frameFactory;
if(isOpen())
read(readProperties, propertiesStyle);
}
FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
bool readProperties, Properties::ReadStyle propertiesStyle) :
FLAC::File::File(IOStream *stream,
bool readProperties, Properties::ReadStyle propertiesStyle,
ID3v2::FrameFactory *frameFactory) :
TagLib::File(stream)
{
d = new FilePrivate;
d->ID3v2FrameFactory = frameFactory;
if(frameFactory)
d->ID3v2FrameFactory = frameFactory;
if(isOpen())
read(readProperties, propertiesStyle);
}

View File

@ -66,17 +66,6 @@ namespace TagLib {
class TAGLIB_EXPORT File : public TagLib::File
{
public:
/*!
* 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.
*
* \deprecated This constructor will be dropped in favor of the one below
* in a future version.
*/
File(FileName 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
@ -85,10 +74,10 @@ namespace TagLib {
* If this file contains and ID3v2 tag the frames will be created using
* \a frameFactory.
*/
// BIC: merge with the above constructor
File(FileName file, ID3v2::FrameFactory *frameFactory,
File(FileName file,
bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
Properties::ReadStyle propertiesStyle = Properties::Average,
ID3v2::FrameFactory *frameFactory = 0);
/*!
* Contructs a FLAC file from \a file. If \a readProperties is true the
@ -101,10 +90,10 @@ namespace TagLib {
* \note TagLib will *not* take ownership of the stream, the caller is
* responsible for deleting it after the File object.
*/
// BIC: merge with the above constructor
File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
File(IOStream *stream,
bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
Properties::ReadStyle propertiesStyle = Properties::Average,
ID3v2::FrameFactory *frameFactory = 0);
/*!
* Destroys this instance of the File.