aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/Linux/kodi.metainfo.xml.in4
-rw-r--r--xbmc/music/tags/TagLibVFSStream.cpp45
-rw-r--r--xbmc/music/tags/TagLibVFSStream.h19
-rw-r--r--xbmc/music/tags/TagLoaderTagLib.cpp58
4 files changed, 101 insertions, 25 deletions
diff --git a/tools/Linux/kodi.metainfo.xml.in b/tools/Linux/kodi.metainfo.xml.in
index 998c631d9c..8d29eefac0 100644
--- a/tools/Linux/kodi.metainfo.xml.in
+++ b/tools/Linux/kodi.metainfo.xml.in
@@ -134,4 +134,8 @@
<control>gamepad</control>
<control>tablet</control>
</recommends>
+ <branding>
+ <color type="primary" scheme_preference="light">#E8F8FF</color>
+ <color type="primary" scheme_preference="dark">#082838</color>
+ </branding>
</component>
diff --git a/xbmc/music/tags/TagLibVFSStream.cpp b/xbmc/music/tags/TagLibVFSStream.cpp
index 1d2b454abb..c5f9c2473f 100644
--- a/xbmc/music/tags/TagLibVFSStream.cpp
+++ b/xbmc/music/tags/TagLibVFSStream.cpp
@@ -11,6 +11,7 @@
#include <limits.h>
+#include <taglib/taglib.h>
#include <taglib/tiostream.h>
using namespace XFILE;
@@ -57,9 +58,17 @@ FileName TagLibVFSStream::name() const
/*!
* Reads a block of size \a length at the current get pointer.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ByteVector TagLibVFSStream::readBlock(unsigned long length)
+#else
ByteVector TagLibVFSStream::readBlock(TagLib::ulong length)
+#endif
{
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ ByteVector byteVector(static_cast<unsigned int>(length));
+#else
ByteVector byteVector(static_cast<TagLib::uint>(length));
+#endif
ssize_t read = m_file.Read(byteVector.data(), length);
if (read > 0)
byteVector.resize(read);
@@ -90,7 +99,11 @@ void TagLibVFSStream::writeBlock(const ByteVector &data)
* \note This method is slow since it requires rewriting all of the file
* after the insertion point.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+void TagLibVFSStream::insert(const ByteVector& data, TagLib::offset_t start, size_t replace)
+#else
void TagLibVFSStream::insert(const ByteVector &data, TagLib::ulong start, TagLib::ulong replace)
+#endif
{
if (data.size() == replace)
{
@@ -114,7 +127,11 @@ void TagLibVFSStream::insert(const ByteVector &data, TagLib::ulong start, TagLib
// First, make sure that we're working with a buffer that is longer than
// the *difference* in the tag sizes. We want to avoid overwriting parts
// that aren't yet in memory, so this is necessary.
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ unsigned long bufferLength = bufferSize();
+#else
TagLib::ulong bufferLength = bufferSize();
+#endif
while (data.size() - replace > bufferLength)
bufferLength += bufferSize();
@@ -123,7 +140,11 @@ void TagLibVFSStream::insert(const ByteVector &data, TagLib::ulong start, TagLib
long readPosition = start + replace;
long writePosition = start;
ByteVector buffer;
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ ByteVector aboutToOverwrite(static_cast<unsigned int>(bufferLength));
+#else
ByteVector aboutToOverwrite(static_cast<TagLib::uint>(bufferLength));
+#endif
// This is basically a special case of the loop below. Here we're just
// doing the same steps as below, but since we aren't using the same buffer
@@ -158,7 +179,11 @@ void TagLibVFSStream::insert(const ByteVector &data, TagLib::ulong start, TagLib
// Check to see if we just read the last block. We need to call clear()
// if we did so that the last write succeeds.
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ if (static_cast<unsigned long>(bytesRead) < bufferLength)
+#else
if (TagLib::ulong(bytesRead) < bufferLength)
+#endif
clear();
// Seek to the write position and write our buffer. Increment the
@@ -180,16 +205,32 @@ void TagLibVFSStream::insert(const ByteVector &data, TagLib::ulong start, TagLib
* \note This method is slow since it involves rewriting all of the file
* after the removed portion.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+void TagLibVFSStream::removeBlock(TagLib::offset_t start, size_t length)
+#else
void TagLibVFSStream::removeBlock(TagLib::ulong start, TagLib::ulong length)
+#endif
{
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ unsigned long bufferLength = bufferSize();
+#else
TagLib::ulong bufferLength = bufferSize();
+#endif
long readPosition = start + length;
long writePosition = start;
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ ByteVector buffer(static_cast<unsigned int>(bufferLength));
+#else
ByteVector buffer(static_cast<TagLib::uint>(bufferLength));
+#endif
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ unsigned long bytesRead = 1;
+#else
TagLib::ulong bytesRead = 1;
+#endif
while(bytesRead != 0)
{
@@ -198,7 +239,11 @@ void TagLibVFSStream::removeBlock(TagLib::ulong start, TagLib::ulong length)
if (read < 0)
return;// explicit error
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ bytesRead = static_cast<unsigned long>(read);
+#else
bytesRead = static_cast<TagLib::ulong>(read);
+#endif
readPosition += bytesRead;
// Check to see if we just read the last block. We need to call clear()
diff --git a/xbmc/music/tags/TagLibVFSStream.h b/xbmc/music/tags/TagLibVFSStream.h
index d567055353..2302c04dd9 100644
--- a/xbmc/music/tags/TagLibVFSStream.h
+++ b/xbmc/music/tags/TagLibVFSStream.h
@@ -10,6 +10,7 @@
#include "filesystem/File.h"
+#include <taglib/taglib.h>
#include <taglib/tiostream.h>
namespace MUSIC_INFO
@@ -36,7 +37,11 @@ namespace MUSIC_INFO
/*!
* Reads a block of size \a length at the current get pointer.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ TagLib::ByteVector readBlock(unsigned long length) override;
+#else
TagLib::ByteVector readBlock(TagLib::ulong length) override;
+#endif
/*!
* Attempts to write the block \a data at the current get pointer. If the
@@ -56,7 +61,13 @@ namespace MUSIC_INFO
* \note This method is slow since it requires rewriting all of the file
* after the insertion point.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ void insert(const TagLib::ByteVector& data,
+ TagLib::offset_t start = 0,
+ size_t replace = 0) override;
+#else
void insert(const TagLib::ByteVector &data, TagLib::ulong start = 0, TagLib::ulong replace = 0) override;
+#endif
/*!
* Removes a block of the file starting a \a start and continuing for
@@ -65,7 +76,11 @@ namespace MUSIC_INFO
* \note This method is slow since it involves rewriting all of the file
* after the removed portion.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ void removeBlock(TagLib::offset_t start = 0, size_t length = 0) override;
+#else
void removeBlock(TagLib::ulong start = 0, TagLib::ulong length = 0) override;
+#endif
/*!
* Returns true if the file is read only (or if the file can not be opened).
@@ -110,7 +125,11 @@ namespace MUSIC_INFO
/*!
* Returns the buffer size that is used for internal buffering.
*/
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ static unsigned int bufferSize() { return 1024; }
+#else
static TagLib::uint bufferSize() { return 1024; }
+#endif
private:
std::string m_strFileName;
diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp
index 6eb591a0c4..f4f676067a 100644
--- a/xbmc/music/tags/TagLoaderTagLib.cpp
+++ b/xbmc/music/tags/TagLoaderTagLib.cpp
@@ -472,7 +472,11 @@ bool CTagLoaderTagLib::ParseTag(ID3v2::Tag *id3v2, EmbeddedArt *art, MUSIC_INFO:
if (picture)
{
std::string mime = picture->mimeType().to8Bit(true);
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ unsigned int size = picture->picture().size();
+#else
TagLib::uint size = picture->picture().size();
+#endif
tag.SetCoverArtInfo(size, mime);
if (art)
art->Set(reinterpret_cast<const uint8_t*>(picture->picture().data()), size, mime);
@@ -500,19 +504,19 @@ bool CTagLoaderTagLib::ParseTag(APE::Tag *ape, EmbeddedArt *art, CMusicInfoTag&
for (APE::ItemListMap::ConstIterator it = itemListMap.begin(); it != itemListMap.end(); ++it)
{
if (it->first == "ARTIST")
- SetArtist(tag, StringListToVectorString(it->second.toStringList()));
+ SetArtist(tag, StringListToVectorString(it->second.values()));
else if (it->first == "ARTISTSORT")
- SetArtistSort(tag, StringListToVectorString(it->second.toStringList()));
+ SetArtistSort(tag, StringListToVectorString(it->second.values()));
else if (it->first == "ARTISTS")
- SetArtistHints(tag, StringListToVectorString(it->second.toStringList()));
+ SetArtistHints(tag, StringListToVectorString(it->second.values()));
else if (it->first == "ALBUMARTIST" || it->first == "ALBUM ARTIST")
- SetAlbumArtist(tag, StringListToVectorString(it->second.toStringList()));
+ SetAlbumArtist(tag, StringListToVectorString(it->second.values()));
else if (it->first == "ALBUMARTISTSORT")
- SetAlbumArtistSort(tag, StringListToVectorString(it->second.toStringList()));
+ SetAlbumArtistSort(tag, StringListToVectorString(it->second.values()));
else if (it->first == "ALBUMARTISTS" || it->first == "ALBUM ARTISTS")
- SetAlbumArtistHints(tag, StringListToVectorString(it->second.toStringList()));
+ SetAlbumArtistHints(tag, StringListToVectorString(it->second.values()));
else if (it->first == "COMPOSERSORT")
- SetComposerSort(tag, StringListToVectorString(it->second.toStringList()));
+ SetComposerSort(tag, StringListToVectorString(it->second.values()));
else if (it->first == "ALBUM")
tag.SetAlbum(it->second.toString().to8Bit(true));
else if (it->first == "TITLE")
@@ -528,7 +532,7 @@ bool CTagLoaderTagLib::ParseTag(APE::Tag *ape, EmbeddedArt *art, CMusicInfoTag&
else if (it->first == "ORIGINALYEAR")
tag.SetOriginalDate(it->second.toString().to8Bit(true));
else if (it->first == "GENRE")
- SetGenre(tag, StringListToVectorString(it->second.toStringList()));
+ SetGenre(tag, StringListToVectorString(it->second.values()));
else if (it->first == "MOOD")
tag.SetMood(it->second.toString().to8Bit(true));
else if (it->first == "COMMENT")
@@ -538,32 +542,32 @@ bool CTagLoaderTagLib::ParseTag(APE::Tag *ape, EmbeddedArt *art, CMusicInfoTag&
else if (it->first == "ENCODEDBY")
{}
else if (it->first == "COMPOSER")
- AddArtistRole(tag, "Composer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Composer", StringListToVectorString(it->second.values()));
else if (it->first == "CONDUCTOR")
- AddArtistRole(tag, "Conductor", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Conductor", StringListToVectorString(it->second.values()));
else if (it->first == "BAND")
- AddArtistRole(tag, "Band", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Band", StringListToVectorString(it->second.values()));
else if (it->first == "ENSEMBLE")
- AddArtistRole(tag, "Ensemble", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Ensemble", StringListToVectorString(it->second.values()));
else if (it->first == "LYRICIST")
- AddArtistRole(tag, "Lyricist", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Lyricist", StringListToVectorString(it->second.values()));
else if (it->first == "WRITER")
- AddArtistRole(tag, "Writer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Writer", StringListToVectorString(it->second.values()));
else if ((it->first == "MIXARTIST") || (it->first == "REMIXER"))
- AddArtistRole(tag, "Remixer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Remixer", StringListToVectorString(it->second.values()));
else if (it->first == "ARRANGER")
- AddArtistRole(tag, "Arranger", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Arranger", StringListToVectorString(it->second.values()));
else if (it->first == "ENGINEER")
- AddArtistRole(tag, "Engineer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Engineer", StringListToVectorString(it->second.values()));
else if (it->first == "PRODUCER")
- AddArtistRole(tag, "Producer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Producer", StringListToVectorString(it->second.values()));
else if (it->first == "DJMIXER")
- AddArtistRole(tag, "DJMixer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "DJMixer", StringListToVectorString(it->second.values()));
else if (it->first == "MIXER")
- AddArtistRole(tag, "Mixer", StringListToVectorString(it->second.toStringList()));
+ AddArtistRole(tag, "Mixer", StringListToVectorString(it->second.values()));
else if (it->first == "PERFORMER")
// Picard uses PERFORMER tag as musician credits list formatted "name (instrument)"
- AddArtistInstrument(tag, StringListToVectorString(it->second.toStringList()));
+ AddArtistInstrument(tag, StringListToVectorString(it->second.values()));
else if (it->first == "LABEL")
tag.SetRecordLabel(it->second.toString().to8Bit(true));
else if (it->first == "COMPILATION")
@@ -579,11 +583,11 @@ bool CTagLoaderTagLib::ParseTag(APE::Tag *ape, EmbeddedArt *art, CMusicInfoTag&
else if (it->first == "REPLAYGAIN_ALBUM_PEAK")
replayGainInfo.ParsePeak(ReplayGain::ALBUM, it->second.toString().toCString(true));
else if (it->first == "MUSICBRAINZ_ARTISTID")
- tag.SetMusicBrainzArtistID(SplitMBID(StringListToVectorString(it->second.toStringList())));
+ tag.SetMusicBrainzArtistID(SplitMBID(StringListToVectorString(it->second.values())));
else if (it->first == "MUSICBRAINZ_ALBUMARTISTID")
- tag.SetMusicBrainzAlbumArtistID(SplitMBID(StringListToVectorString(it->second.toStringList())));
+ tag.SetMusicBrainzAlbumArtistID(SplitMBID(StringListToVectorString(it->second.values())));
else if (it->first == "MUSICBRAINZ_ALBUMARTIST")
- SetAlbumArtist(tag, StringListToVectorString(it->second.toStringList()));
+ SetAlbumArtist(tag, StringListToVectorString(it->second.values()));
else if (it->first == "MUSICBRAINZ_ALBUMID")
tag.SetMusicBrainzAlbumID(it->second.toString().to8Bit(true));
else if (it->first == "MUSICBRAINZ_RELEASEGROUPID")
@@ -591,7 +595,7 @@ bool CTagLoaderTagLib::ParseTag(APE::Tag *ape, EmbeddedArt *art, CMusicInfoTag&
else if (it->first == "MUSICBRAINZ_TRACKID")
tag.SetMusicBrainzTrackID(it->second.toString().to8Bit(true));
else if (it->first == "MUSICBRAINZ_ALBUMTYPE")
- SetReleaseType(tag, StringListToVectorString(it->second.toStringList()));
+ SetReleaseType(tag, StringListToVectorString(it->second.values()));
else if (it->first == "BPM")
tag.SetBPM(it->second.toString().toInt());
else if (it->first == "MUSICBRAINZ_ALBUMSTATUS")
@@ -789,7 +793,11 @@ bool CTagLoaderTagLib::ParseTag(Ogg::XiphComment *xiph, EmbeddedArt *art, CMusic
std::string mime = pictures[i].mimeType().toCString();
if (mime.compare(0, 6, "image/") != 0)
continue;
+#if (TAGLIB_MAJOR_VERSION >= 2)
+ unsigned int size = pictures[i].data().size();
+#else
TagLib::uint size = pictures[i].data().size();
+#endif
tag.SetCoverArtInfo(size, mime);
if (art)
art->Set(reinterpret_cast<const uint8_t*>(pictures[i].data().data()), size, mime);