From fdae7eec21643f70e7328db0b2c0371ce574645d Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 1 Oct 2021 19:18:42 -0700 Subject: [PATCH] File info: Implemented support for Album Artist and Codec fields --- Application/AppController.h | 1 + Base.lproj/InfoInspector.xib | 100 +++++++++++++----- Base.lproj/MainMenu.xib | 57 ++++++++-- .../TagLib/TagLib.xcodeproj/project.pbxproj | 22 ++-- .../TagLib/taglib/taglib/ape/apetag.cpp | 14 +++ Frameworks/TagLib/taglib/taglib/ape/apetag.h | 2 + .../TagLib/taglib/taglib/asf/asftag.cpp | 9 ++ Frameworks/TagLib/taglib/taglib/asf/asftag.h | 10 ++ .../TagLib/taglib/taglib/mod/modtag.cpp | 9 ++ Frameworks/TagLib/taglib/taglib/mod/modtag.h | 11 ++ .../TagLib/taglib/taglib/mp4/mp4tag.cpp | 14 +++ Frameworks/TagLib/taglib/taglib/mp4/mp4tag.h | 2 + .../taglib/taglib/mpeg/id3v1/id3v1tag.cpp | 9 ++ .../taglib/taglib/mpeg/id3v1/id3v1tag.h | 2 + .../taglib/taglib/mpeg/id3v2/id3v2tag.cpp | 12 +++ .../taglib/taglib/mpeg/id3v2/id3v2tag.h | 2 + .../TagLib/taglib/taglib/ogg/xiphcomment.cpp | 14 +++ .../TagLib/taglib/taglib/ogg/xiphcomment.h | 2 + .../TagLib/taglib/taglib/riff/wav/infotag.cpp | 9 ++ .../TagLib/taglib/taglib/riff/wav/infotag.h | 2 + Frameworks/TagLib/taglib/taglib/tag.cpp | 16 +++ Frameworks/TagLib/taglib/taglib/tag.h | 12 +++ Frameworks/TagLib/taglib/taglib/tagunion.cpp | 10 ++ Frameworks/TagLib/taglib/taglib/tagunion.h | 2 + Playlist/PlaylistEntry.h | 6 ++ Playlist/PlaylistEntry.m | 28 ++++- Plugins/AdPlug/AdPlug/AdPlugDecoder.mm | 1 + Plugins/FFMPEG/FFMPEGDecoder.m | 1 + Plugins/Flac/FlacDecoder.m | 1 + Plugins/GME/GameDecoder.h | 1 + .../HighlyComplete/HCDecoder.mm | 19 ++++ Plugins/MIDI/MIDI/MIDIDecoder.mm | 1 + Plugins/Musepack/MusepackDecoder.m | 1 + Plugins/Opus/Opus/OpusDecoder.m | 1 + Plugins/Shorten/ShortenDecoder.mm | 1 + Plugins/Syntrax/Syntrax/jxsDecoder.m | 1 + Plugins/TagLib/TagLibMetadataReader.m | 6 +- Plugins/Vorbis/VorbisDecoder.m | 1 + Plugins/WavPack/WavPackDecoder.m | 1 + Plugins/vgmstream/vgmstream/VGMDecoder.m | 23 ++++ en.lproj/InfoInspector.strings | 6 ++ en.lproj/MainMenu.strings | 6 ++ es.lproj/InfoInspector.strings | 6 ++ es.lproj/MainMenu.strings | 6 ++ 44 files changed, 413 insertions(+), 47 deletions(-) diff --git a/Application/AppController.h b/Application/AppController.h index d158249a9..a595acbd0 100644 --- a/Application/AppController.h +++ b/Application/AppController.h @@ -33,6 +33,7 @@ IBOutlet NSMenuItem *showIndexColumn; IBOutlet NSMenuItem *showTitleColumn; + IBOutlet NSMenuItem *showAlbumArtistColumn; IBOutlet NSMenuItem *showArtistColumn; IBOutlet NSMenuItem *showAlbumColumn; IBOutlet NSMenuItem *showGenreColumn; diff --git a/Base.lproj/InfoInspector.xib b/Base.lproj/InfoInspector.xib index 2c9296052..8568a237c 100644 --- a/Base.lproj/InfoInspector.xib +++ b/Base.lproj/InfoInspector.xib @@ -1,8 +1,8 @@ - + - + @@ -15,16 +15,16 @@ - - + + - + - + @@ -33,7 +33,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -185,7 +185,7 @@ - + @@ -200,7 +200,7 @@ - + @@ -212,7 +212,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -236,7 +236,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -259,8 +259,29 @@ + + + + + + + + + + + + + + + + + + + + + - + @@ -269,7 +290,7 @@ - + @@ -294,6 +315,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Base.lproj/MainMenu.xib b/Base.lproj/MainMenu.xib index c2336662e..8e5d8d4e5 100644 --- a/Base.lproj/MainMenu.xib +++ b/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -32,10 +32,10 @@ - + - + @@ -79,7 +79,7 @@ - + @@ -100,6 +100,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -195,7 +215,7 @@ - + @@ -251,6 +271,26 @@ + @@ -278,7 +318,7 @@ - + @@ -562,7 +602,7 @@ - + @@ -1755,6 +1795,7 @@ Gw + diff --git a/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj b/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj index 6bfb6574b..1a20609f6 100644 --- a/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj +++ b/Frameworks/TagLib/TagLib.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 174C7A370F4FD43100E18B0F /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 174C7A360F4FD43100E18B0F /* libz.dylib */; }; 32AE5A5A14E70ED600420CA0 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59A014E70ED600420CA0 /* config.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32AE5A5C14E70ED600420CA0 /* apefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32AE59A414E70ED600420CA0 /* apefile.cpp */; }; 32AE5A5D14E70ED600420CA0 /* apefile.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59A514E70ED600420CA0 /* apefile.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -149,12 +148,13 @@ 32AE5AFF14E70ED700420CA0 /* taglib_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE5A5914E70ED600420CA0 /* taglib_config.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32AE5B0014E70F4700420CA0 /* tlist.tcc in Headers */ = {isa = PBXBuildFile; fileRef = 32AE5A4614E70ED600420CA0 /* tlist.tcc */; settings = {ATTRIBUTES = (Public, ); }; }; 32AE5B0114E70F4A00420CA0 /* tmap.tcc in Headers */ = {isa = PBXBuildFile; fileRef = 32AE5A4814E70ED600420CA0 /* tmap.tcc */; settings = {ATTRIBUTES = (Public, ); }; }; - 4872B8881A675CCB00674347 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4872B8871A675CCB00674347 /* libiconv.dylib */; }; 83790D241809E8CA0073CF51 /* opusfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83790D201809E8CA0073CF51 /* opusfile.cpp */; }; 83790D261809E8CA0073CF51 /* opusproperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83790D221809E8CA0073CF51 /* opusproperties.cpp */; }; 83942C67269116530058BD3B /* flacfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 32AE59BF14E70ED600420CA0 /* flacfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; 83AF2CBE2622643300538240 /* apegenfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83AF2CBC2622643300538240 /* apegenfile.cpp */; }; 83AF2CBF2622643300538240 /* apegenfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AF2CBD2622643300538240 /* apegenfile.h */; }; + 83B46FCA2707EED200847FC9 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 83B46FC92707EED200847FC9 /* libiconv.tbd */; }; + 83B46FCC2707EEDB00847FC9 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 83B46FCB2707EEDB00847FC9 /* libz.tbd */; }; 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; EDE862FD25CF6BD70086EFD3 /* tpropertymap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDE862FC25CF6BD60086EFD3 /* tpropertymap.cpp */; }; EDE8630225CF6C260086EFD3 /* tfilestream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDE8630025CF6C260086EFD3 /* tfilestream.cpp */; }; @@ -358,7 +358,6 @@ 32AE5A5714E70ED600420CA0 /* wavpackproperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavpackproperties.cpp; sourceTree = ""; }; 32AE5A5814E70ED600420CA0 /* wavpackproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavpackproperties.h; sourceTree = ""; }; 32AE5A5914E70ED600420CA0 /* taglib_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = taglib_config.h; path = taglib/taglib_config.h; sourceTree = ""; }; - 4872B8871A675CCB00674347 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; }; 833F683D1CDBCAB300AFB9F0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 835C889822CC1889001B4B3F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 83790D201809E8CA0073CF51 /* opusfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opusfile.cpp; sourceTree = ""; }; @@ -367,6 +366,8 @@ 83790D231809E8CA0073CF51 /* opusproperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opusproperties.h; sourceTree = ""; }; 83AF2CBC2622643300538240 /* apegenfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = apegenfile.cpp; sourceTree = ""; }; 83AF2CBD2622643300538240 /* apegenfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apegenfile.h; sourceTree = ""; }; + 83B46FC92707EED200847FC9 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; }; + 83B46FCB2707EEDB00847FC9 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* TagLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TagLib.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EDE862FC25CF6BD60086EFD3 /* tpropertymap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tpropertymap.cpp; sourceTree = ""; }; @@ -488,8 +489,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4872B8881A675CCB00674347 /* libiconv.dylib in Frameworks */, - 174C7A370F4FD43100E18B0F /* libz.dylib in Frameworks */, + 83B46FCA2707EED200847FC9 /* libiconv.tbd in Frameworks */, + 83B46FCC2707EEDB00847FC9 /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -507,11 +508,11 @@ 0867D691FE84028FC02AAC07 /* TagLib */ = { isa = PBXGroup; children = ( - 4872B8871A675CCB00674347 /* libiconv.dylib */, 8E75700C09F318D70080F1EE /* Source */, 089C1665FE841158C02AAC07 /* Resources */, 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 034768DFFF38A50411DB9C8B /* Products */, + 83B46FC82707EED200847FC9 /* Frameworks */, ); name = TagLib; sourceTree = ""; @@ -897,6 +898,15 @@ path = opus; sourceTree = ""; }; + 83B46FC82707EED200847FC9 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83B46FCB2707EEDB00847FC9 /* libz.tbd */, + 83B46FC92707EED200847FC9 /* libiconv.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; 8E75700C09F318D70080F1EE /* Source */ = { isa = PBXGroup; children = ( diff --git a/Frameworks/TagLib/taglib/taglib/ape/apetag.cpp b/Frameworks/TagLib/taglib/taglib/ape/apetag.cpp index b8dfc2b96..bd9ece44b 100644 --- a/Frameworks/TagLib/taglib/taglib/ape/apetag.cpp +++ b/Frameworks/TagLib/taglib/taglib/ape/apetag.cpp @@ -123,6 +123,15 @@ String APE::Tag::title() const return d->itemListMap["TITLE"].values().toString(); } +String APE::Tag::albumartist() const +{ + if(!d->itemListMap["ALBUMARTIST"].isEmpty()) + return d->itemListMap["ALBUMARTIST"].values().toString(); + if(!d->itemListMap["ALBUM ARTIST"].isEmpty()) + return d->itemListMap["ALBUM ARTIST"].values().toString(); + return String(); +} + String APE::Tag::artist() const { if(d->itemListMap["ARTIST"].isEmpty()) @@ -198,6 +207,11 @@ void APE::Tag::setTitle(const String &s) addValue("TITLE", s, true); } +void APE::Tag::setAlbumArtist(const String &s) +{ + addValue("ALBUMARTIST", s, true); +} + void APE::Tag::setArtist(const String &s) { addValue("ARTIST", s, true); diff --git a/Frameworks/TagLib/taglib/taglib/ape/apetag.h b/Frameworks/TagLib/taglib/taglib/ape/apetag.h index 40ed38699..76f0a365c 100644 --- a/Frameworks/TagLib/taglib/taglib/ape/apetag.h +++ b/Frameworks/TagLib/taglib/taglib/ape/apetag.h @@ -88,6 +88,7 @@ namespace TagLib { // Reimplementations. virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -100,6 +101,7 @@ namespace TagLib { virtual float rgTrackPeak() const; virtual void setTitle(const String &s); + virtual void setAlbumArtist(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); diff --git a/Frameworks/TagLib/taglib/taglib/asf/asftag.cpp b/Frameworks/TagLib/taglib/taglib/asf/asftag.cpp index 063374e7f..cd3fc1379 100644 --- a/Frameworks/TagLib/taglib/taglib/asf/asftag.cpp +++ b/Frameworks/TagLib/taglib/taglib/asf/asftag.cpp @@ -55,6 +55,11 @@ String ASF::Tag::title() const return d->title; } +String ASF::Tag::albumartist() const +{ + return String(); +} + String ASF::Tag::artist() const { return d->artist; @@ -135,6 +140,10 @@ void ASF::Tag::setTitle(const String &value) d->title = value; } +void ASF::Tag::setAlbumArtist(const String &) +{ +} + void ASF::Tag::setArtist(const String &value) { d->artist = value; diff --git a/Frameworks/TagLib/taglib/taglib/asf/asftag.h b/Frameworks/TagLib/taglib/taglib/asf/asftag.h index 5363c5db4..fe48f287e 100644 --- a/Frameworks/TagLib/taglib/taglib/asf/asftag.h +++ b/Frameworks/TagLib/taglib/taglib/asf/asftag.h @@ -54,6 +54,11 @@ namespace TagLib { */ virtual String title() const; + /*! + * Returns the album artist name. + */ + virtual String albumartist() const; + /*! * Returns the artist name. */ @@ -108,6 +113,11 @@ namespace TagLib { */ virtual void setTitle(const String &s); + /*! + * Sets the artist to \a s. + */ + virtual void setAlbumArtist(const String &s); + /*! * Sets the artist to \a s. */ diff --git a/Frameworks/TagLib/taglib/taglib/mod/modtag.cpp b/Frameworks/TagLib/taglib/taglib/mod/modtag.cpp index 6737d0955..705b36a79 100644 --- a/Frameworks/TagLib/taglib/taglib/mod/modtag.cpp +++ b/Frameworks/TagLib/taglib/taglib/mod/modtag.cpp @@ -59,6 +59,11 @@ String Mod::Tag::title() const return d->title; } +String Mod::Tag::albumartist() const +{ + return String(); +} + String Mod::Tag::artist() const { return String(); @@ -119,6 +124,10 @@ void Mod::Tag::setTitle(const String &title) d->title = title; } +void Mod::Tag::setAlbumArtist(const String &) +{ +} + void Mod::Tag::setArtist(const String &) { } diff --git a/Frameworks/TagLib/taglib/taglib/mod/modtag.h b/Frameworks/TagLib/taglib/taglib/mod/modtag.h index 4b2d44b45..21d07b4fb 100644 --- a/Frameworks/TagLib/taglib/taglib/mod/modtag.h +++ b/Frameworks/TagLib/taglib/taglib/mod/modtag.h @@ -56,6 +56,12 @@ namespace TagLib { */ virtual String title() const; + /*! + * Not supported by module files. Therefore always returns String::null. + */ + virtual String albumartist() const; + + /*! * Not supported by module files. Therefore always returns String::null. */ @@ -127,6 +133,11 @@ namespace TagLib { */ virtual void setTitle(const String &title); + /*! + * Not supported by module files and therefore ignored. + */ + virtual void setAlbumArtist(const String &albumartist); + /*! * Not supported by module files and therefore ignored. */ diff --git a/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.cpp b/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.cpp index 89b770fe2..8c5d15e87 100644 --- a/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.cpp +++ b/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.cpp @@ -732,6 +732,14 @@ MP4::Tag::artist() const return String(); } +String +MP4::Tag::albumartist() const +{ + if(d->items.contains("aART")) + return d->items["aART"].toStringList().toString(", "); + return String(); +} + String MP4::Tag::album() const { @@ -802,6 +810,12 @@ MP4::Tag::setTitle(const String &value) setTextItem("\251nam", value); } +void +MP4::Tag::setAlbumArtist(const String &value) +{ + setTextItem("aART", value); +} + void MP4::Tag::setArtist(const String &value) { diff --git a/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.h b/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.h index 0f3923eaa..be5d21b22 100644 --- a/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.h +++ b/Frameworks/TagLib/taglib/taglib/mp4/mp4tag.h @@ -54,6 +54,7 @@ namespace TagLib { bool save(); virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -66,6 +67,7 @@ namespace TagLib { float rgTrackPeak() const; virtual void setTitle(const String &value); + virtual void setAlbumArtist(const String &value); virtual void setArtist(const String &value); virtual void setAlbum(const String &value); virtual void setComment(const String &value); diff --git a/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.cpp b/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.cpp index 4dca6599c..9bfd7d8d3 100644 --- a/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.cpp +++ b/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.cpp @@ -132,6 +132,11 @@ String ID3v1::Tag::title() const return d->title; } +String ID3v1::Tag::albumartist() const +{ + return String(); +} + String ID3v1::Tag::artist() const { return d->artist; @@ -187,6 +192,10 @@ void ID3v1::Tag::setTitle(const String &s) d->title = s; } +void ID3v1::Tag::setAlbumArtist(const String &) +{ +} + void ID3v1::Tag::setArtist(const String &s) { d->artist = s; diff --git a/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.h b/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.h index d314c93ea..e963f5902 100644 --- a/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.h +++ b/Frameworks/TagLib/taglib/taglib/mpeg/id3v1/id3v1tag.h @@ -136,6 +136,7 @@ namespace TagLib { // Reimplementations. virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -148,6 +149,7 @@ namespace TagLib { virtual float rgTrackPeak() const; virtual void setTitle(const String &s); + virtual void setAlbumArtist(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); diff --git a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp index 8a2ede855..7f0d01b28 100644 --- a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.cpp @@ -156,6 +156,13 @@ String ID3v2::Tag::artist() const return String(); } +String ID3v2::Tag::albumartist() const +{ + if(!d->frameListMap["TPE2"].isEmpty()) + return d->frameListMap["TPE2"].front()->toString(); + return String(); +} + String ID3v2::Tag::album() const { if(!d->frameListMap["TALB"].isEmpty()) @@ -282,6 +289,11 @@ void ID3v2::Tag::setArtist(const String &s) setTextFrame("TPE1", s); } +void ID3v2::Tag::setAlbumArtist(const String &s) +{ + setTextFrame("TPE2", s); +} + void ID3v2::Tag::setAlbum(const String &s) { setTextFrame("TALB", s); diff --git a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.h b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.h index 86fae6341..1cc95687a 100644 --- a/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.h +++ b/Frameworks/TagLib/taglib/taglib/mpeg/id3v2/id3v2tag.h @@ -157,6 +157,7 @@ namespace TagLib { // Reimplementations. virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -171,6 +172,7 @@ namespace TagLib { virtual float rgTrackPeak() const; virtual void setTitle(const String &s); + virtual void setAlbumArtist(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); diff --git a/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.cpp b/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.cpp index 63d77fbeb..b8c70ef17 100644 --- a/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.cpp +++ b/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.cpp @@ -85,6 +85,15 @@ String Ogg::XiphComment::title() const return d->fieldListMap["TITLE"].toString(); } +String Ogg::XiphComment::albumartist() const +{ + if(!d->fieldListMap["ALBUMARTIST"].isEmpty()) + return d->fieldListMap["ALBUMARTIST"].toString(); + if(!d->fieldListMap["ALBUM ARTIST"].isEmpty()) + return d->fieldListMap["ALBUM ARTIST"].toString(); + return String(); +} + String Ogg::XiphComment::artist() const { if(d->fieldListMap["ARTIST"].isEmpty()) @@ -172,6 +181,11 @@ void Ogg::XiphComment::setTitle(const String &s) addField("TITLE", s); } +void Ogg::XiphComment::setAlbumArtist(const String &s) +{ + addField("ALBUMARTIST", s); +} + void Ogg::XiphComment::setArtist(const String &s) { addField("ARTIST", s); diff --git a/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.h b/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.h index 2829c0d2a..6a583a39b 100644 --- a/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.h +++ b/Frameworks/TagLib/taglib/taglib/ogg/xiphcomment.h @@ -81,6 +81,7 @@ namespace TagLib { virtual ~XiphComment(); virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -93,6 +94,7 @@ namespace TagLib { virtual float rgTrackPeak() const; virtual void setTitle(const String &s); + virtual void setAlbumArtist(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); diff --git a/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.cpp b/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.cpp index a84e96569..8bdf8ef9c 100644 --- a/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.cpp +++ b/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.cpp @@ -93,6 +93,11 @@ String RIFF::Info::Tag::title() const return fieldText("INAM"); } +String RIFF::Info::Tag::albumartist() const +{ + return String(); +} + String RIFF::Info::Tag::artist() const { return fieldText("IART"); @@ -148,6 +153,10 @@ void RIFF::Info::Tag::setTitle(const String &s) setFieldText("INAM", s); } +void RIFF::Info::Tag::setAlbumArtist(const String &) +{ +} + void RIFF::Info::Tag::setArtist(const String &s) { setFieldText("IART", s); diff --git a/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.h b/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.h index dadc91a6e..1d9ef8ef9 100644 --- a/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.h +++ b/Frameworks/TagLib/taglib/taglib/riff/wav/infotag.h @@ -103,6 +103,7 @@ namespace TagLib { // Reimplementations virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -115,6 +116,7 @@ namespace TagLib { virtual float rgTrackPeak() const; virtual void setTitle(const String &s); + virtual void setAlbumArtist(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); diff --git a/Frameworks/TagLib/taglib/taglib/tag.cpp b/Frameworks/TagLib/taglib/taglib/tag.cpp index 3526226f8..7616d6b6c 100644 --- a/Frameworks/TagLib/taglib/taglib/tag.cpp +++ b/Frameworks/TagLib/taglib/taglib/tag.cpp @@ -47,6 +47,7 @@ Tag::~Tag() bool Tag::isEmpty() const { return (title().isEmpty() && + albumartist().isEmpty() && artist().isEmpty() && album().isEmpty() && comment().isEmpty() && @@ -60,6 +61,8 @@ PropertyMap Tag::properties() const PropertyMap map; if(!(title().isEmpty())) map["TITLE"].append(title()); + if(!(albumartist().isEmpty())) + map["ALBUMARTIST"].append(albumartist()); if(!(artist().isEmpty())) map["ARTIST"].append(artist()); if(!(album().isEmpty())) @@ -91,6 +94,16 @@ PropertyMap Tag::setProperties(const PropertyMap &origProps) } else setTitle(String()); + if(properties.contains("ALBUMARTIST") || + properties.contains("ALBUM ARTIST")) { + if (properties.contains("ALBUMARTIST")) + setAlbumArtist(properties["ALBUMARTIST"].front()); + else + setAlbumArtist(properties["ALBUM ARTIST"].front()); + oneValueSet.append("ALBUMARTIST"); + } else + setAlbumArtist(String()); + if(properties.contains("ARTIST")) { setArtist(properties["ARTIST"].front()); oneValueSet.append("ARTIST"); @@ -154,6 +167,7 @@ void Tag::duplicate(const Tag *source, Tag *target, bool overwrite) // static { if(overwrite) { target->setTitle(source->title()); + target->setAlbumArtist(source->albumartist()); target->setArtist(source->artist()); target->setAlbum(source->album()); target->setComment(source->comment()); @@ -164,6 +178,8 @@ void Tag::duplicate(const Tag *source, Tag *target, bool overwrite) // static else { if(target->title().isEmpty()) target->setTitle(source->title()); + if(target->albumartist().isEmpty()) + target->setAlbumArtist(source->albumartist()); if(target->artist().isEmpty()) target->setArtist(source->artist()); if(target->album().isEmpty()) diff --git a/Frameworks/TagLib/taglib/taglib/tag.h b/Frameworks/TagLib/taglib/taglib/tag.h index b7de76d7f..fd5422dcd 100644 --- a/Frameworks/TagLib/taglib/taglib/tag.h +++ b/Frameworks/TagLib/taglib/taglib/tag.h @@ -84,6 +84,12 @@ namespace TagLib { */ virtual String title() const = 0; + /*! + * Returns the album artist name; if no artist name is present in the tag + * String::null will be returned. + */ + virtual String albumartist() const = 0; + /*! * Returns the artist name; if no artist name is present in the tag * String::null will be returned. @@ -149,6 +155,12 @@ namespace TagLib { */ virtual void setTitle(const String &s) = 0; + /*! + * Sets the album artist to \a s. If \a s is String::null then this value will be + * cleared. + */ + virtual void setAlbumArtist(const String &s) = 0; + /*! * Sets the artist to \a s. If \a s is String::null then this value will be * cleared. diff --git a/Frameworks/TagLib/taglib/taglib/tagunion.cpp b/Frameworks/TagLib/taglib/taglib/tagunion.cpp index 46bb7cd65..213192cf5 100644 --- a/Frameworks/TagLib/taglib/taglib/tagunion.cpp +++ b/Frameworks/TagLib/taglib/taglib/tagunion.cpp @@ -178,6 +178,11 @@ String TagUnion::title() const stringUnion(title); } +String TagUnion::albumartist() const +{ + stringUnion(albumartist); +} + String TagUnion::artist() const { stringUnion(artist); @@ -233,6 +238,11 @@ void TagUnion::setTitle(const String &s) setUnion(Title, s); } +void TagUnion::setAlbumArtist(const String &s) +{ + setUnion(AlbumArtist, s); +} + void TagUnion::setArtist(const String &s) { setUnion(Artist, s); diff --git a/Frameworks/TagLib/taglib/taglib/tagunion.h b/Frameworks/TagLib/taglib/taglib/tagunion.h index 92efc8383..30514430b 100644 --- a/Frameworks/TagLib/taglib/taglib/tagunion.h +++ b/Frameworks/TagLib/taglib/taglib/tagunion.h @@ -60,6 +60,7 @@ namespace TagLib { void removeUnsupportedProperties(const StringList &unsupported); virtual String title() const; + virtual String albumartist() const; virtual String artist() const; virtual String album() const; virtual String comment() const; @@ -72,6 +73,7 @@ namespace TagLib { virtual float rgTrackPeak() const; virtual void setTitle(const String &s); + virtual void setAlbumArtist(const String &s); virtual void setArtist(const String &s); virtual void setAlbum(const String &s); virtual void setComment(const String &s); diff --git a/Playlist/PlaylistEntry.h b/Playlist/PlaylistEntry.h index 42550fa92..9369ba98d 100644 --- a/Playlist/PlaylistEntry.h +++ b/Playlist/PlaylistEntry.h @@ -26,6 +26,7 @@ NSURL *URL; NSString *artist; + NSString *albumartist; NSString *album; NSString *title; NSString *genre; @@ -50,6 +51,8 @@ BOOL Unsigned; float sampleRate; + NSString *codec; + NSString *endian; BOOL seekable; @@ -97,6 +100,7 @@ @property(retain) NSURL *URL; @property(retain) NSString *artist; +@property(retain) NSString *albumartist; @property(retain) NSString *album; @property(nonatomic, retain) NSString *title; @property(retain) NSString *genre; @@ -114,6 +118,8 @@ @property BOOL Unsigned; @property float sampleRate; +@property(retain) NSString *codec; + @property float replayGainAlbumGain; @property float replayGainAlbumPeak; @property float replayGainTrackGain; diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index eef22db41..39a2685b6 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -28,6 +28,7 @@ @synthesize URL; @synthesize artist; +@synthesize albumartist; @synthesize album; @synthesize genre; @synthesize year; @@ -41,6 +42,8 @@ @synthesize Unsigned; @synthesize sampleRate; +@synthesize codec; + @synthesize replayGainAlbumGain; @synthesize replayGainAlbumPeak; @synthesize replayGainTrackGain; @@ -89,7 +92,7 @@ + (NSSet *)keyPathsForValuesAffectingSpam { - return [NSSet setWithObjects:@"artist", @"title", @"album", @"track", @"totalFrames", @"currentPosition", @"bitrate", nil]; + return [NSSet setWithObjects:@"albumartist", @"artist", @"title", @"album", @"track", @"totalFrames", @"currentPosition", @"bitrate", nil]; } + (NSSet *)keyPathsForValuesAffectingPositionText @@ -131,6 +134,7 @@ self.URL = nil; self.artist = nil; + self.albumartist = nil; self.album = nil; self.title = nil; self.genre = nil; @@ -139,6 +143,7 @@ self.albumArtInternal = nil; self.endian = nil; + self.codec = nil; } // Get the URL if the title is blank @@ -167,12 +172,14 @@ { BOOL hasBitrate = (self.bitrate != 0); BOOL hasArtist = (self.artist != nil) && (![self.artist isEqualToString:@""]); + BOOL hasAlbumArtist = (self.albumartist != nil) && (![self.albumartist isEqualToString:@""]); BOOL hasAlbum = (self.album != nil) && (![self.album isEqualToString:@""]); BOOL hasTrack = (self.track != 0); BOOL hasLength = (self.totalFrames != 0); BOOL hasCurrentPosition = (self.currentPosition != 0) && (self.current); BOOL hasExtension = NO; BOOL hasTitle = (title != nil) && (![title isEqualToString:@""]); + BOOL hasCodec = (self.codec != nil) && (![self.codec isEqualToString:@""]); NSMutableString * filename = [NSMutableString stringWithString:[self filename]]; NSRange dotPosition = [filename rangeOfString:@"." options:NSBackwardsSearch]; @@ -192,7 +199,12 @@ if (hasExtension) { [elements addObject:@"["]; - [elements addObject:[extension uppercaseString]]; + if (hasCodec) { + [elements addObject:self.codec]; + } + else { + [elements addObject:[extension uppercaseString]]; + } if (hasBitrate) { [elements addObject:@"@"]; [elements addObject:[NSString stringWithFormat:@"%u", self.bitrate]]; @@ -202,7 +214,12 @@ } if (hasArtist) { - [elements addObject:self.artist]; + if (hasAlbumArtist) { + [elements addObject:self.albumartist]; + } + else { + [elements addObject:self.artist]; + } [elements addObject:@" - "]; } @@ -223,6 +240,11 @@ [elements addObject:filename]; } + if (hasAlbumArtist && hasArtist) { + [elements addObject:@" // "]; + [elements addObject:self.artist]; + } + if (hasCurrentPosition || hasLength) { SecondsFormatter *secondsFormatter = [[SecondsFormatter alloc] init]; [elements addObject:@" ("]; diff --git a/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm b/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm index 2e7996d47..10e041cac 100755 --- a/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm +++ b/Plugins/AdPlug/AdPlug/AdPlugDecoder.mm @@ -74,6 +74,7 @@ [NSNumber numberWithBool:NO], @"floatingPoint", [NSNumber numberWithInt:2], @"channels", //output from gme_play is in stereo [NSNumber numberWithBool:YES], @"seekable", + [NSString stringWithUTF8String:m_player->gettype().c_str()], @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/FFMPEG/FFMPEGDecoder.m b/Plugins/FFMPEG/FFMPEGDecoder.m index 3e7e9fc5c..86cab124f 100644 --- a/Plugins/FFMPEG/FFMPEGDecoder.m +++ b/Plugins/FFMPEG/FFMPEGDecoder.m @@ -479,6 +479,7 @@ int lockmgr_callback(void ** mutex, enum AVLockOp op) [NSNumber numberWithDouble:totalFrames], @"totalFrames", [NSNumber numberWithInt:bitrate], @"bitrate", [NSNumber numberWithBool:seekable], @"seekable", + [NSString stringWithUTF8String:avcodec_get_name(codecCtx->codec_id)], @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/Flac/FlacDecoder.m b/Plugins/Flac/FlacDecoder.m index 6b3d2c861..b0ad4c03f 100644 --- a/Plugins/Flac/FlacDecoder.m +++ b/Plugins/Flac/FlacDecoder.m @@ -317,6 +317,7 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:totalFrames],@"totalFrames", [NSNumber numberWithBool:[source seekable]], @"seekable", + @"FLAC",@"codec", @"big",@"endian", nil]; } diff --git a/Plugins/GME/GameDecoder.h b/Plugins/GME/GameDecoder.h index 85c986bad..05a8bc1ff 100755 --- a/Plugins/GME/GameDecoder.h +++ b/Plugins/GME/GameDecoder.h @@ -19,6 +19,7 @@ extern gme_err_t readCallback( void* data, void* out, long count ); id source; long length; long fade; + NSString* codec; } - (void)setSource:(id)s; diff --git a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm index 5bc4df8d0..cdd0faa08 100644 --- a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm +++ b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm @@ -261,6 +261,10 @@ static int psf_info_meta(void * context, const char * name, const char * value) { taglc = @"year"; } + else if ([taglc isEqualToString:@"album artist"]) + { + taglc = @"albumartist"; + } if ([taglc hasPrefix:@"replaygain_"]) { @@ -296,6 +300,7 @@ static int psf_info_meta(void * context, const char * name, const char * value) state->utf8 = true; } else if ([taglc isEqualToString:@"title"] || + [taglc isEqualToString:@"albumartist"] || [taglc isEqualToString:@"artist"] || [taglc isEqualToString:@"album"] || [taglc isEqualToString:@"year"] || @@ -1686,6 +1691,19 @@ static int usf_info(void * context, const char * name, const char * value) - (NSDictionary *)properties { + NSString* codec = nil; + switch (type) { + case 1: codec = @"PSF"; break; + case 2: codec = @"PSF2"; break; + case 0x11: codec = @"SSF"; break; + case 0x12: codec = @"DSF"; break; + case 0x21: codec = @"USF"; break; + case 0x22: codec = @"GSF"; break; + case 0x24: codec = @"2SF"; break; + case 0x25: codec = @"NCSF"; break; + case 0x41: codec = @"QSF"; break; + } + return [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:2], @"channels", [NSNumber numberWithInt:16], @"bitsPerSample", @@ -1698,6 +1716,7 @@ static int usf_info(void * context, const char * name, const char * value) [NSNumber numberWithFloat:replayGainTrackGain], @"replayGainTrackGain", [NSNumber numberWithFloat:replayGainTrackPeak], @"replayGainTrackPeak", [NSNumber numberWithFloat:volume], @"volume", + codec, @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/MIDI/MIDI/MIDIDecoder.mm b/Plugins/MIDI/MIDI/MIDIDecoder.mm index 1b54ada75..099b9be86 100755 --- a/Plugins/MIDI/MIDI/MIDIDecoder.mm +++ b/Plugins/MIDI/MIDI/MIDIDecoder.mm @@ -114,6 +114,7 @@ static OSType getOSType(const char * in_) [NSNumber numberWithBool:YES], @"floatingPoint", [NSNumber numberWithInt:2], @"channels", //output from gme_play is in stereo [NSNumber numberWithBool:YES], @"seekable", + @"MIDI", @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/Musepack/MusepackDecoder.m b/Plugins/Musepack/MusepackDecoder.m index e3582f565..f5d20786e 100644 --- a/Plugins/Musepack/MusepackDecoder.m +++ b/Plugins/Musepack/MusepackDecoder.m @@ -211,6 +211,7 @@ mpc_bool_t CanSeekProc(mpc_reader *p_reader) [NSNumber numberWithBool:YES], @"floatingPoint", [NSNumber numberWithInt:2], @"channels", [NSNumber numberWithBool:[source seekable]], @"seekable", + @"Musepack", @"codec", @"host",@"endian", nil]; } diff --git a/Plugins/Opus/Opus/OpusDecoder.m b/Plugins/Opus/Opus/OpusDecoder.m index 71ef93572..497488d17 100644 --- a/Plugins/Opus/Opus/OpusDecoder.m +++ b/Plugins/Opus/Opus/OpusDecoder.m @@ -144,6 +144,7 @@ opus_int64 sourceTell(void *_stream) [NSNumber numberWithDouble:totalFrames], @"totalFrames", [NSNumber numberWithInt:bitrate], @"bitrate", [NSNumber numberWithBool:([source seekable] && seekable)], @"seekable", + @"Opus", @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/Shorten/ShortenDecoder.mm b/Plugins/Shorten/ShortenDecoder.mm index 88511e9e3..28281d476 100644 --- a/Plugins/Shorten/ShortenDecoder.mm +++ b/Plugins/Shorten/ShortenDecoder.mm @@ -93,6 +93,7 @@ [NSNumber numberWithFloat:frequency],@"sampleRate", [NSNumber numberWithDouble:totalFrames],@"totalFrames", [NSNumber numberWithBool:seekable ],@"seekable", + @"Shorten",@"codec", @"little",@"endian", nil]; } diff --git a/Plugins/Syntrax/Syntrax/jxsDecoder.m b/Plugins/Syntrax/Syntrax/jxsDecoder.m index af7e19ec6..2df92938b 100755 --- a/Plugins/Syntrax/Syntrax/jxsDecoder.m +++ b/Plugins/Syntrax/Syntrax/jxsDecoder.m @@ -137,6 +137,7 @@ BOOL probe_length( Song * synSong, unsigned long * intro_length, unsigned long * [NSNumber numberWithBool:NO], @"floatingPoint", [NSNumber numberWithInt:2], @"channels", [NSNumber numberWithBool:YES], @"seekable", + @"Syntrax", @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/TagLib/TagLibMetadataReader.m b/Plugins/TagLib/TagLibMetadataReader.m index 93e52aa8b..676392629 100644 --- a/Plugins/TagLib/TagLibMetadataReader.m +++ b/Plugins/TagLib/TagLibMetadataReader.m @@ -71,11 +71,12 @@ if (tag) { - TagLib::String artist, title, album, genre, comment; + TagLib::String artist, albumartist, title, album, genre, comment; int year, track; float rgAlbumGain, rgAlbumPeak, rgTrackGain, rgTrackPeak; artist = tag->artist(); + albumartist = tag->albumartist(); title = tag->title();; album = tag->album(); genre = tag->genre(); @@ -98,6 +99,9 @@ if (!artist.isEmpty()) [dict setObject:[NSString stringWithUTF8String:artist.toCString(true)] forKey:@"artist"]; + + if (!albumartist.isEmpty()) + [dict setObject:[NSString stringWithUTF8String:albumartist.toCString(true)] forKey:@"albumartist"]; if (!album.isEmpty()) [dict setObject:[NSString stringWithUTF8String:album.toCString(true)] forKey:@"album"]; diff --git a/Plugins/Vorbis/VorbisDecoder.m b/Plugins/Vorbis/VorbisDecoder.m index a2e9ad511..2ca1a30cd 100644 --- a/Plugins/Vorbis/VorbisDecoder.m +++ b/Plugins/Vorbis/VorbisDecoder.m @@ -138,6 +138,7 @@ long sourceTell(void *datasource) [NSNumber numberWithDouble:totalFrames], @"totalFrames", [NSNumber numberWithInt:bitrate], @"bitrate", [NSNumber numberWithBool:([source seekable] && seekable)], @"seekable", + @"Vorbis", @"codec", @"host", @"endian", nil]; } diff --git a/Plugins/WavPack/WavPackDecoder.m b/Plugins/WavPack/WavPackDecoder.m index 838e627f1..a2aef18c5 100644 --- a/Plugins/WavPack/WavPackDecoder.m +++ b/Plugins/WavPack/WavPackDecoder.m @@ -290,6 +290,7 @@ int32_t WriteBytesProc(void *ds, void *data, int32_t bcount) [NSNumber numberWithBool:floatingPoint],@"floatingPoint", [NSNumber numberWithDouble:totalFrames],@"totalFrames", [NSNumber numberWithBool:[[wv source] seekable]], @"seekable", + @"Wavpack",@"codec", @"little",@"endian", nil]; } diff --git a/Plugins/vgmstream/vgmstream/VGMDecoder.m b/Plugins/vgmstream/vgmstream/VGMDecoder.m index 8d27e2b05..aac438722 100644 --- a/Plugins/vgmstream/vgmstream/VGMDecoder.m +++ b/Plugins/vgmstream/vgmstream/VGMDecoder.m @@ -11,6 +11,21 @@ #import "PlaylistController.h" +static NSString* get_description_tag(const char* description, const char *tag, char delimiter) { + // extract a "tag" from the description string + const char* pos = strstr(description, tag); + const char* eos = NULL; + if (pos != NULL) { + pos += strlen(tag); + eos = strchr(pos, delimiter); + if (eos == NULL) eos = pos + strlen(pos); + NSMutableData* data = [NSData dataWithBytes:pos length:(eos - pos + 1)]; + ((char *)[data mutableBytes])[eos - pos] = '\0'; + return [NSString stringWithUTF8String:[data bytes]]; + } + return nil; +} + @implementation VGMInfoCache +(id)sharedCache { @@ -48,6 +63,9 @@ long totalFrames = vgmstream_get_samples(stream); int bitrate = get_vgmstream_average_bitrate(stream); + + char description[1024]; + describe_vgmstream(stream, description, 1024); NSString * path = [url absoluteString]; NSRange fragmentRange = [path rangeOfString:@"#" options:NSBackwardsSearch]; @@ -67,12 +85,16 @@ NSNumber *year = [NSNumber numberWithInt:0]; NSNumber *track = [NSNumber numberWithInt:0]; NSString *title = @""; + + NSString *codec; NSNumber *rgTrackGain = [NSNumber numberWithInt:0]; NSNumber *rgTrackPeak = [NSNumber numberWithInt:0]; NSNumber *rgAlbumGain = [NSNumber numberWithInt:0]; NSNumber *rgAlbumPeak = [NSNumber numberWithInt:0]; + codec = get_description_tag(description, "encoding: ", 0); + STREAMFILE *tagFile = cogsf_create_from_url(tagurl); if (tagFile) { VGMSTREAM_TAGS *tags; @@ -134,6 +156,7 @@ rgAlbumPeak, @"replayGainAlbumPeak", rgTrackGain, @"replayGainTrackGain", rgTrackPeak, @"replayGainTrackPeak", + codec, @"codec", @"host", @"endian", nil]; diff --git a/en.lproj/InfoInspector.strings b/en.lproj/InfoInspector.strings index b801f1316..48f90b4af 100644 --- a/en.lproj/InfoInspector.strings +++ b/en.lproj/InfoInspector.strings @@ -73,3 +73,9 @@ /* Class = "NSTextFieldCell"; title = "N/A"; ObjectID = "87"; */ "87.title" = "N/A"; + +/* Class = "NSTextFieldCell"; title = "Album Artist:"; ObjectID = "vB6-9J-5qg"; */ +"vB6-9J-5qg.title" = "Album Artist:"; + +/* Class = "NSTextFieldCell"; title = "Codec:"; ObjectID = "QPg-Mb-Urn"; */ +"QPg-Mb-Urn.title" = "Codec:"; diff --git a/en.lproj/MainMenu.strings b/en.lproj/MainMenu.strings index 77672bc52..072db19bf 100644 --- a/en.lproj/MainMenu.strings +++ b/en.lproj/MainMenu.strings @@ -625,3 +625,9 @@ /* Class = "NSMenuItem"; title = "Properties"; ObjectID = "Eds-my-DQr"; */ "Eds-my-DQr.title" = "Properties"; + +/* Class = "NSTableColumn"; title = "Album Artist"; ObjectID = "yGV-gP-Wl6"; */ +"yGV-gP-Wl6.title" = "Album Artist"; + +/* Class = "NSTableColumn"; title = "Codec"; ObjectID = "3A3-9o-Gh9"; */ +"3A3-9o-Gh9.title" = "Codec"; diff --git a/es.lproj/InfoInspector.strings b/es.lproj/InfoInspector.strings index b801f1316..48f90b4af 100644 --- a/es.lproj/InfoInspector.strings +++ b/es.lproj/InfoInspector.strings @@ -73,3 +73,9 @@ /* Class = "NSTextFieldCell"; title = "N/A"; ObjectID = "87"; */ "87.title" = "N/A"; + +/* Class = "NSTextFieldCell"; title = "Album Artist:"; ObjectID = "vB6-9J-5qg"; */ +"vB6-9J-5qg.title" = "Album Artist:"; + +/* Class = "NSTextFieldCell"; title = "Codec:"; ObjectID = "QPg-Mb-Urn"; */ +"QPg-Mb-Urn.title" = "Codec:"; diff --git a/es.lproj/MainMenu.strings b/es.lproj/MainMenu.strings index 6b7eee521..8529f511f 100644 --- a/es.lproj/MainMenu.strings +++ b/es.lproj/MainMenu.strings @@ -622,3 +622,9 @@ /* Class = "NSMenuItem"; title = "Properties"; ObjectID = "Eds-my-DQr"; */ "Eds-my-DQr.title" = "Properties"; + +/* Class = "NSTableColumn"; title = "Album Artist"; ObjectID = "yGV-gP-Wl6"; */ +"yGV-gP-Wl6.title" = "Album Artist"; + +/* Class = "NSTableColumn"; title = "Codec"; ObjectID = "3A3-9o-Gh9"; */ +"3A3-9o-Gh9.title" = "Codec";