From 15163b7af21e388fa4f6ec0eff1b1d80882a0fad Mon Sep 17 00:00:00 2001 From: "Stephen F. Booth" Date: Mon, 29 Oct 2018 18:15:50 -0500 Subject: [PATCH] Resolved merge conflicts --- taglib/ebml/matroska/ebmlmatroskafile.cpp | 4 ++-- taglib/ebml/matroska/ebmlmatroskafile.h | 23 +++++++++++++++++++---- taglib/fileref.cpp | 6 ++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/taglib/ebml/matroska/ebmlmatroskafile.cpp b/taglib/ebml/matroska/ebmlmatroskafile.cpp index 21515d39..766e9628 100644 --- a/taglib/ebml/matroska/ebmlmatroskafile.cpp +++ b/taglib/ebml/matroska/ebmlmatroskafile.cpp @@ -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); diff --git a/taglib/ebml/matroska/ebmlmatroskafile.h b/taglib/ebml/matroska/ebmlmatroskafile.h index 57b93d91..dc5a26e9 100644 --- a/taglib/ebml/matroska/ebmlmatroskafile.h +++ b/taglib/ebml/matroska/ebmlmatroskafile.h @@ -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. diff --git a/taglib/fileref.cpp b/taglib/fileref.cpp index 3f74a4c6..fcd169ab 100644 --- a/taglib/fileref.cpp +++ b/taglib/fileref.cpp @@ -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; }