Merge branch 'sandsmark-taglib2' into taglib2

This commit is contained in:
Stephen F. Booth 2018-10-29 18:16:12 -05:00
commit 96a4d896ba
3 changed files with 27 additions and 6 deletions

View File

@ -134,7 +134,7 @@ EBML::Matroska::File::~File()
}
}
EBML::Matroska::File::File(FileName file) : EBML::File(file), d(0)
EBML::Matroska::File::File(FileName file, bool, AudioProperties::ReadStyle) : EBML::File(file), d(0)
{
if(isValid() && isOpen()) {
d = FilePrivate::checkAndCreate(this);
@ -145,7 +145,7 @@ EBML::Matroska::File::File(FileName file) : EBML::File(file), d(0)
}
}
EBML::Matroska::File::File(IOStream *stream) : EBML::File(stream), d(0)
EBML::Matroska::File::File(IOStream *stream, bool, AudioProperties::ReadStyle) : EBML::File(stream), d(0)
{
if(isValid() && isOpen()) {
d = FilePrivate::checkAndCreate(this);

View File

@ -28,6 +28,7 @@
#define TAGLIB_EBMLMATROSKAFILE_H
#include "ebmlelement.h"
#include "audioproperties.h"
namespace TagLib {
@ -47,14 +48,28 @@ namespace TagLib {
virtual ~File();
/*!
* Constructs a Matroska File from a file name.
* Constructs a Matroska 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. The audio properties are always
* read.
*/
explicit File(FileName file);
explicit File(FileName file, bool readProperties = true,
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*!
* Constructs a Matroska File from a stream.
* Constructs a Matroska file from \a stream. 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. The audio properties are always
* read.
*/
explicit File(IOStream *stream);
explicit File(IOStream *stream, bool readproperties = true,
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*!
* Returns the pointer to a tag that allow access on common tags.

View File

@ -54,6 +54,7 @@
#include "xmfile.h"
#include "dsffile.h"
#include "dsdifffile.h"
#include "ebmlmatroskafile.h"
using namespace TagLib;
@ -141,6 +142,9 @@ namespace
return new DSDIFF::File(stream, readAudioProperties, audioPropertiesStyle);
if(ext == "DSF")
return new DSF::File(stream, readAudioProperties, audioPropertiesStyle);
if (ext == "MKA" || ext == "MKV") {
return new EBML::Matroska::File(stream, readAudioProperties, audioPropertiesStyle);
}
return 0;
}
@ -363,6 +367,8 @@ StringList FileRef::defaultFileExtensions()
l.append("dsf");
l.append("dff");
l.append("dsdiff"); // alias for "dff"
l.append("mka");
l.append("mkv");
return l;
}