Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3982 from jmarshallnz/wav_tags

Support WAV/AIF tags via taglib
  • Loading branch information...
commit e91c182b28104251f867d0c3387c928736de876b 2 parents 1b62b15 + 953e504
@jmarshallnz jmarshallnz authored
View
10 XBMC.xcodeproj/project.pbxproj
@@ -139,7 +139,6 @@
18B7C89D129423A7009E7A26 /* MusicInfoTagLoaderNSF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C878129423A7009E7A26 /* MusicInfoTagLoaderNSF.cpp */; };
18B7C89F129423A7009E7A26 /* MusicInfoTagLoaderShn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C87C129423A7009E7A26 /* MusicInfoTagLoaderShn.cpp */; };
18B7C8A0129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C87E129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp */; };
- 18B7C8A1129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C880129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp */; };
18B7C8A4129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C886129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp */; };
18B7C8D712942546009E7A26 /* ButtonTranslator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C8CB12942546009E7A26 /* ButtonTranslator.cpp */; };
18B7C8D812942546009E7A26 /* KeyboardLayoutConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C8CD12942546009E7A26 /* KeyboardLayoutConfiguration.cpp */; };
@@ -1265,7 +1264,6 @@
DFF0F30D17528350002DA3A4 /* MusicInfoTagLoaderNSF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C878129423A7009E7A26 /* MusicInfoTagLoaderNSF.cpp */; };
DFF0F30E17528350002DA3A4 /* MusicInfoTagLoaderShn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C87C129423A7009E7A26 /* MusicInfoTagLoaderShn.cpp */; };
DFF0F30F17528350002DA3A4 /* MusicInfoTagLoaderSPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C87E129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp */; };
- DFF0F31017528350002DA3A4 /* MusicInfoTagLoaderWav.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C880129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp */; };
DFF0F31117528350002DA3A4 /* MusicInfoTagLoaderYM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C886129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp */; };
DFF0F31217528350002DA3A4 /* TagLibVFSStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE84CB5915A5B8A600A3810E /* TagLibVFSStream.cpp */; };
DFF0F31317528350002DA3A4 /* TagLoaderTagLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC0083015ACAC6E0099888C /* TagLoaderTagLib.cpp */; };
@@ -2680,7 +2678,6 @@
E499138E174E5F0E00741B6D /* MusicInfoTagLoaderNSF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C878129423A7009E7A26 /* MusicInfoTagLoaderNSF.cpp */; };
E499138F174E5F0E00741B6D /* MusicInfoTagLoaderShn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C87C129423A7009E7A26 /* MusicInfoTagLoaderShn.cpp */; };
E4991390174E5F0E00741B6D /* MusicInfoTagLoaderSPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C87E129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp */; };
- E4991391174E5F0E00741B6D /* MusicInfoTagLoaderWav.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C880129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp */; };
E4991392174E5F0E00741B6D /* MusicInfoTagLoaderYM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18B7C886129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp */; };
E4991393174E5F0E00741B6D /* TagLibVFSStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE84CB5915A5B8A600A3810E /* TagLibVFSStream.cpp */; };
E4991394174E5F0E00741B6D /* TagLoaderTagLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC0083015ACAC6E0099888C /* TagLoaderTagLib.cpp */; };
@@ -3465,8 +3462,6 @@
18B7C87D129423A7009E7A26 /* MusicInfoTagLoaderShn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MusicInfoTagLoaderShn.h; sourceTree = "<group>"; };
18B7C87E129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MusicInfoTagLoaderSPC.cpp; sourceTree = "<group>"; };
18B7C87F129423A7009E7A26 /* MusicInfoTagLoaderSPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MusicInfoTagLoaderSPC.h; sourceTree = "<group>"; };
- 18B7C880129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MusicInfoTagLoaderWav.cpp; sourceTree = "<group>"; };
- 18B7C881129423A7009E7A26 /* MusicInfoTagLoaderWav.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MusicInfoTagLoaderWav.h; sourceTree = "<group>"; };
18B7C886129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MusicInfoTagLoaderYM.cpp; sourceTree = "<group>"; };
18B7C887129423A7009E7A26 /* MusicInfoTagLoaderYM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MusicInfoTagLoaderYM.h; sourceTree = "<group>"; };
18B7C8CB12942546009E7A26 /* ButtonTranslator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonTranslator.cpp; sourceTree = "<group>"; };
@@ -6058,8 +6053,6 @@
18B7C87D129423A7009E7A26 /* MusicInfoTagLoaderShn.h */,
18B7C87E129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp */,
18B7C87F129423A7009E7A26 /* MusicInfoTagLoaderSPC.h */,
- 18B7C880129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp */,
- 18B7C881129423A7009E7A26 /* MusicInfoTagLoaderWav.h */,
18B7C886129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp */,
18B7C887129423A7009E7A26 /* MusicInfoTagLoaderYM.h */,
AE84CB5915A5B8A600A3810E /* TagLibVFSStream.cpp */,
@@ -10376,7 +10369,6 @@
18B7C89D129423A7009E7A26 /* MusicInfoTagLoaderNSF.cpp in Sources */,
18B7C89F129423A7009E7A26 /* MusicInfoTagLoaderShn.cpp in Sources */,
18B7C8A0129423A7009E7A26 /* MusicInfoTagLoaderSPC.cpp in Sources */,
- 18B7C8A1129423A7009E7A26 /* MusicInfoTagLoaderWav.cpp in Sources */,
18B7C8A4129423A7009E7A26 /* MusicInfoTagLoaderYM.cpp in Sources */,
18B7C8D712942546009E7A26 /* ButtonTranslator.cpp in Sources */,
18B7C8D812942546009E7A26 /* KeyboardLayoutConfiguration.cpp in Sources */,
@@ -11391,7 +11383,6 @@
DFF0F30D17528350002DA3A4 /* MusicInfoTagLoaderNSF.cpp in Sources */,
DFF0F30E17528350002DA3A4 /* MusicInfoTagLoaderShn.cpp in Sources */,
DFF0F30F17528350002DA3A4 /* MusicInfoTagLoaderSPC.cpp in Sources */,
- DFF0F31017528350002DA3A4 /* MusicInfoTagLoaderWav.cpp in Sources */,
DFF0F31117528350002DA3A4 /* MusicInfoTagLoaderYM.cpp in Sources */,
DFF0F31217528350002DA3A4 /* TagLibVFSStream.cpp in Sources */,
DFF0F31317528350002DA3A4 /* TagLoaderTagLib.cpp in Sources */,
@@ -12442,7 +12433,6 @@
E499138E174E5F0E00741B6D /* MusicInfoTagLoaderNSF.cpp in Sources */,
E499138F174E5F0E00741B6D /* MusicInfoTagLoaderShn.cpp in Sources */,
E4991390174E5F0E00741B6D /* MusicInfoTagLoaderSPC.cpp in Sources */,
- E4991391174E5F0E00741B6D /* MusicInfoTagLoaderWav.cpp in Sources */,
E4991392174E5F0E00741B6D /* MusicInfoTagLoaderYM.cpp in Sources */,
E4991393174E5F0E00741B6D /* TagLibVFSStream.cpp in Sources */,
E4991394174E5F0E00741B6D /* TagLoaderTagLib.cpp in Sources */,
View
2  project/VS2010Express/XBMC.vcxproj
@@ -748,7 +748,6 @@
<ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderNSF.cpp" />
<ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderShn.cpp" />
<ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderSPC.cpp" />
- <ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderWav.cpp" />
<ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderYM.cpp" />
<ClCompile Include="..\..\xbmc\music\tags\TagLibVFSStream.cpp" />
<ClCompile Include="..\..\xbmc\music\tags\TagLoaderTagLib.cpp" />
@@ -1139,7 +1138,6 @@
<ClInclude Include="..\..\xbmc\interfaces\python\swig.h" />
<ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h" />
<ClInclude Include="..\..\xbmc\music\MusicDbUrl.h" />
- <ClInclude Include="..\..\xbmc\music\tags\MusicInfoTagLoaderWav.h" />
<ClInclude Include="..\..\xbmc\music\tags\TagLibVFSStream.h" />
<ClInclude Include="..\..\xbmc\music\tags\TagLoaderTagLib.h" />
<ClInclude Include="..\..\xbmc\network\httprequesthandler\HTTPImageHandler.h" />
View
6 project/VS2010Express/XBMC.vcxproj.filters
@@ -2839,9 +2839,6 @@
<ClCompile Include="..\..\xbmc\music\tags\TagLoaderTagLib.cpp">
<Filter>music\tags</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\music\tags\MusicInfoTagLoaderWav.cpp">
- <Filter>music\tags</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\interfaces\python\test\TestSwig.cpp">
<Filter>interfaces\python\test</Filter>
</ClCompile>
@@ -5801,9 +5798,6 @@
<ClInclude Include="..\..\xbmc\music\tags\TagLoaderTagLib.h">
<Filter>music\tags</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\music\tags\MusicInfoTagLoaderWav.h">
- <Filter>music\tags</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\interfaces\json-rpc\AddonsOperations.h">
<Filter>interfaces\json-rpc</Filter>
</ClInclude>
View
1  xbmc/music/tags/Makefile
@@ -8,7 +8,6 @@ SRCS=\
MusicInfoTagLoaderNSF.cpp \
MusicInfoTagLoaderShn.cpp \
MusicInfoTagLoaderSPC.cpp \
- MusicInfoTagLoaderWav.cpp \
MusicInfoTagLoaderYM.cpp \
TagLoaderTagLib.cpp \
TagLibVFSStream.cpp \
View
8 xbmc/music/tags/MusicInfoTagLoaderFactory.cpp
@@ -23,7 +23,6 @@
#include "TagLoaderTagLib.h"
#include "MusicInfoTagLoaderCDDA.h"
#include "MusicInfoTagLoaderShn.h"
-#include "MusicInfoTagLoaderWav.h"
#ifdef HAS_MOD_PLAYER
#include "cores/ModPlayer.h"
#endif
@@ -74,6 +73,8 @@ IMusicInfoTagLoader* CMusicInfoTagLoaderFactory::CreateLoader(const CStdString&
strExtension == "m4a" || strExtension == "mp4" ||
strExtension == "mpc" || strExtension == "mpp" || strExtension == "mp+" ||
strExtension == "ogg" || strExtension == "oga" || strExtension == "oggstream" ||
+ strExtension == "aif" || strExtension == "aiff" ||
+ strExtension == "wav" ||
#ifdef HAS_MOD_PLAYER
ModPlayer::IsSupportedFormat(strExtension) ||
strExtension == "mod" || strExtension == "nsf" || strExtension == "nsfstream" ||
@@ -96,11 +97,6 @@ IMusicInfoTagLoader* CMusicInfoTagLoaderFactory::CreateLoader(const CStdString&
CMusicInfoTagLoaderSHN *pTagLoader = new CMusicInfoTagLoaderSHN();
return (IMusicInfoTagLoader*)pTagLoader;
}
- else if (strExtension == "wav")
- {
- CMusicInfoTagLoaderWAV *pTagLoader = new CMusicInfoTagLoaderWAV();
- return (IMusicInfoTagLoader*)pTagLoader;
- }
else if (strExtension == "spc")
{
CMusicInfoTagLoaderSPC *pTagLoader = new CMusicInfoTagLoaderSPC();
View
58 xbmc/music/tags/MusicInfoTagLoaderWav.cpp
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "MusicInfoTagLoaderWav.h"
-#include "cores/paplayer/WAVcodec.h"
-#include "MusicInfoTag.h"
-#include "utils/log.h"
-
-using namespace MUSIC_INFO;
-
-CMusicInfoTagLoaderWAV::CMusicInfoTagLoaderWAV(void)
-{}
-
-CMusicInfoTagLoaderWAV::~CMusicInfoTagLoaderWAV()
-{}
-
-bool CMusicInfoTagLoaderWAV::Load(const CStdString& strFileName, CMusicInfoTag& tag, EmbeddedArt *art)
-{
- try
- {
- // WAV has no tag information other than the duration.
-
- // Load our codec class
- WAVCodec codec;
- if (codec.Init(strFileName, 4096))
- {
- tag.SetURL(strFileName);
- tag.SetDuration((int)(codec.m_TotalTime/1000));
- tag.SetLoaded(false);
- codec.DeInit();
- return true;
- }
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "Tag loader wav: exception in file %s", strFileName.c_str());
- }
-
- return false;
-}
-
View
35 xbmc/music/tags/MusicInfoTagLoaderWav.h
@@ -1,35 +0,0 @@
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "ImusicInfoTagLoader.h"
-
-namespace MUSIC_INFO
-{
-
-class CMusicInfoTagLoaderWAV: public IMusicInfoTagLoader
-{
-public:
- CMusicInfoTagLoaderWAV(void);
- virtual ~CMusicInfoTagLoaderWAV();
-
- virtual bool Load(const CStdString& strFileName, CMusicInfoTag& tag, EmbeddedArt *art = NULL);
-};
-}
View
10 xbmc/music/tags/TagLoaderTagLib.cpp
@@ -129,6 +129,8 @@ bool CTagLoaderTagLib::Load(const CStdString& strFileName, CMusicInfoTag& tag, c
TagLib::TrueAudio::File* ttaFile = NULL;
TagLib::WavPack::File* wvFile = NULL;
TagLib::XM::File* xmFile = NULL;
+ TagLib::RIFF::WAV::File * wavFile = NULL;
+ TagLib::RIFF::AIFF::File * aiffFile = NULL;
if (strExtension == "ape")
file = apeFile = new APE::File(stream);
@@ -154,6 +156,10 @@ bool CTagLoaderTagLib::Load(const CStdString& strFileName, CMusicInfoTag& tag, c
file = ttaFile = new TrueAudio::File(stream, ID3v2::FrameFactory::instance());
else if (strExtension == "wv")
file = wvFile = new WavPack::File(stream);
+ else if (strExtension == "aif" || strExtension == "aiff")
+ file = aiffFile = new RIFF::AIFF::File(stream);
+ else if (strExtension == "wav")
+ file = wavFile = new RIFF::WAV::File(stream);
else if (strExtension == "xm")
file = xmFile = new XM::File(stream);
else if (strExtension == "ogg")
@@ -208,6 +214,10 @@ bool CTagLoaderTagLib::Load(const CStdString& strFileName, CMusicInfoTag& tag, c
xiph = dynamic_cast<Ogg::XiphComment *>(oggVorbisFile->tag());
else if (ttaFile)
id3v2 = ttaFile->ID3v2Tag(false);
+ else if (aiffFile)
+ id3v2 = aiffFile->tag();
+ else if (wavFile)
+ id3v2 = wavFile->tag();
else if (wvFile)
ape = wvFile->APETag(false);
else if (mpcFile)
View
1  xbmc/music/tags/TagLoaderTagLib.h
@@ -35,6 +35,7 @@
#include <taglib/s3mfile.h>
#include <taglib/trueaudiofile.h>
#include <taglib/vorbisfile.h>
+#include <taglib/wavfile.h>
#include <taglib/wavpackfile.h>
#include <taglib/xmfile.h>
Please sign in to comment.
Something went wrong with that request. Please try again.