diff options
-rw-r--r-- | Makefile.in | 5 | ||||
-rw-r--r-- | XBMC.xcodeproj/project.pbxproj | 24 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | project/VS2008Express/XBMC for Windows.sln | 11 | ||||
-rw-r--r-- | project/VS2008Express/XBMC.vcproj | 8 | ||||
-rw-r--r-- | project/VS2010Express/XBMC for Windows.sln | 10 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj | 6 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj.filters | 6 | ||||
-rw-r--r-- | xbmc/FileSystem/FileCurl.cpp | 7 | ||||
-rw-r--r-- | xbmc/FileSystem/FileCurl.h | 1 | ||||
-rw-r--r-- | xbmc/FileSystem/FileShoutcast.cpp | 400 | ||||
-rw-r--r-- | xbmc/FileSystem/FileShoutcast.h | 46 | ||||
-rw-r--r-- | xbmc/FileSystem/Makefile.in | 1 | ||||
-rw-r--r-- | xbmc/FileSystem/ShoutcastRipFile.cpp | 499 | ||||
-rw-r--r-- | xbmc/FileSystem/ShoutcastRipFile.h | 87 | ||||
-rw-r--r-- | xbmc/cores/paplayer/PAPlayer.cpp | 26 | ||||
-rw-r--r-- | xbmc/cores/paplayer/PAPlayer.h | 3 |
17 files changed, 64 insertions, 1077 deletions
diff --git a/Makefile.in b/Makefile.in index d7f28e4742..b36a01cf60 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37,7 +37,6 @@ BIN_DIRS= \ xbmc/lib/libPython/xbmcmodule \ xbmc/lib/libRTV \ xbmc/lib/libscrobbler \ - xbmc/lib/libshout \ xbmc/lib/libUPnP \ xbmc/lib/libXBMS \ xbmc/lib/libXDAAP \ @@ -241,8 +240,6 @@ xbmc/lib/libscrobbler/scrobbler.a: force $(MAKE) -C xbmc/lib/libscrobbler xbmc/lib/libRTV/librtv-@ARCH@.a: force $(MAKE) -C xbmc/lib/libRTV -xbmc/lib/libshout/libshout-@ARCH@.a: force - $(MAKE) -C xbmc/lib/libshout xbmc/lib/libUPnP/libupnp-@ARCH@.a: force $(MAKE) -C xbmc/lib/libUPnP xbmc/lib/libXBMS/libxbms-@ARCH@.a: force @@ -388,7 +385,6 @@ xcode_depends: \ xbmc/lib/libXBMS/libxbms-@ARCH@.a \ xbmc/lib/libRTV/librtv-@ARCH@.a \ xbmc/lib/libXDAAP/libxdaap-@ARCH@.a \ - xbmc/lib/libshout/libshout-@ARCH@.a \ xbmc/lib/libjsonrpc/libjsonrpc.a \ xbmc/lib/libhttpapi/libhttpapi.a \ lib/jsoncpp/jsoncpp/src/lib_json/libjsoncpp.a \ @@ -426,7 +422,6 @@ OBJSXBMC= \ xbmc/lib/libPython/xbmcmodule/xbmcmodule.a \ xbmc/lib/libscrobbler/scrobbler.a \ xbmc/lib/libRTV/librtv-@ARCH@.a \ - xbmc/lib/libshout/libshout-@ARCH@.a \ xbmc/lib/libUPnP/libupnp-@ARCH@.a \ xbmc/lib/libXDAAP/libxdaap-@ARCH@.a \ xbmc/lib/libjsonrpc/libjsonrpc.a \ diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj index 1fc2978677..cb073b1e02 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -271,7 +271,6 @@ 810C9F630D67BD2F0095F5DD /* PltMediaConnect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 810C9F600D67BD2F0095F5DD /* PltMediaConnect.cpp */; }; 810C9FA90D67D1FB0095F5DD /* MythDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 810C9FA50D67D1FB0095F5DD /* MythDirectory.cpp */; }; 810C9FAA0D67D1FB0095F5DD /* MythFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 810C9FA70D67D1FB0095F5DD /* MythFile.cpp */; }; - 810CA01C0D68A6E20095F5DD /* libshout-x86-osx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E30B3E8E0D5D59290030A311 /* libshout-x86-osx.a */; }; 815EE6350E17F1DC009FBE3C /* DVDInputStreamRTMP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 815EE6330E17F1DC009FBE3C /* DVDInputStreamRTMP.cpp */; }; 83A72B910FBC8DB000171871 /* CoreAudioRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83A72B8E0FBC8DB000171871 /* CoreAudioRenderer.cpp */; }; 83A72B940FBC8DFF00171871 /* CoreAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83A72B920FBC8DFF00171871 /* CoreAudio.cpp */; }; @@ -567,7 +566,6 @@ E38E20520D25F9FD00618676 /* RarDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17460D25F9FA00618676 /* RarDirectory.cpp */; }; E38E20530D25F9FD00618676 /* RarManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17480D25F9FA00618676 /* RarManager.cpp */; }; E38E20540D25F9FD00618676 /* RTVDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E174B0D25F9FA00618676 /* RTVDirectory.cpp */; }; - E38E20560D25F9FD00618676 /* ShoutcastRipFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E174F0D25F9FA00618676 /* ShoutcastRipFile.cpp */; }; E38E20570D25F9FD00618676 /* SIDFileDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17510D25F9FA00618676 /* SIDFileDirectory.cpp */; }; E38E20580D25F9FD00618676 /* SmartPlaylistDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17530D25F9FA00618676 /* SmartPlaylistDirectory.cpp */; }; E38E205B0D25F9FD00618676 /* StackDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17590D25F9FA00618676 /* StackDirectory.cpp */; }; @@ -1278,7 +1276,6 @@ F5A1C9840F6B06CF00A96ABD /* RarDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17460D25F9FA00618676 /* RarDirectory.cpp */; }; F5A1C9850F6B06CF00A96ABD /* RarManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17480D25F9FA00618676 /* RarManager.cpp */; }; F5A1C9860F6B06CF00A96ABD /* RTVDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E174B0D25F9FA00618676 /* RTVDirectory.cpp */; }; - F5A1C9880F6B06CF00A96ABD /* ShoutcastRipFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E174F0D25F9FA00618676 /* ShoutcastRipFile.cpp */; }; F5A1C9890F6B06CF00A96ABD /* SIDFileDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17510D25F9FA00618676 /* SIDFileDirectory.cpp */; }; F5A1C98A0F6B06CF00A96ABD /* SmartPlaylistDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17530D25F9FA00618676 /* SmartPlaylistDirectory.cpp */; }; F5A1C98B0F6B06CF00A96ABD /* StackDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E17590D25F9FA00618676 /* StackDirectory.cpp */; }; @@ -2217,7 +2214,6 @@ C8D0B2AE1265A9A800F0C0AC /* SystemGlobals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemGlobals.cpp; sourceTree = "<group>"; }; E306D12C0DDF7B590052C2AD /* XBMCHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBMCHelper.cpp; sourceTree = "<group>"; }; E306D12D0DDF7B590052C2AD /* XBMCHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMCHelper.h; sourceTree = "<group>"; }; - E30B3E8E0D5D59290030A311 /* libshout-x86-osx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libshout-x86-osx.a"; path = "xbmc/lib/libshout/libshout-x86-osx.a"; sourceTree = "<group>"; }; E33206370D5070AA00435CE3 /* DVDDemuxVobsub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDDemuxVobsub.cpp; sourceTree = "<group>"; }; E33466A50D2E5103005A65EC /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; E33979940D62FD47004ECDDA /* DVDInputStreamTV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDInputStreamTV.cpp; sourceTree = "<group>"; }; @@ -2804,8 +2800,6 @@ E38E17490D25F9FA00618676 /* RarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RarManager.h; sourceTree = "<group>"; }; E38E174B0D25F9FA00618676 /* RTVDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTVDirectory.cpp; sourceTree = "<group>"; }; E38E174C0D25F9FA00618676 /* RTVDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTVDirectory.h; sourceTree = "<group>"; }; - E38E174F0D25F9FA00618676 /* ShoutcastRipFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShoutcastRipFile.cpp; sourceTree = "<group>"; }; - E38E17500D25F9FA00618676 /* ShoutcastRipFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoutcastRipFile.h; sourceTree = "<group>"; }; E38E17510D25F9FA00618676 /* SIDFileDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SIDFileDirectory.cpp; sourceTree = "<group>"; }; E38E17520D25F9FA00618676 /* SIDFileDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SIDFileDirectory.h; sourceTree = "<group>"; }; E38E17530D25F9FA00618676 /* SmartPlaylistDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmartPlaylistDirectory.cpp; sourceTree = "<group>"; }; @@ -3080,8 +3074,6 @@ E38E1A220D25F9FB00618676 /* errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errors.h; sourceTree = "<group>"; }; E38E1A250D25F9FB00618676 /* scrobbler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scrobbler.cpp; sourceTree = "<group>"; }; E38E1A260D25F9FB00618676 /* scrobbler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scrobbler.h; sourceTree = "<group>"; }; - E38E1A280D25F9FB00618676 /* filelib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filelib.h; sourceTree = "<group>"; }; - E38E1A2D0D25F9FB00618676 /* rip_manager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rip_manager.h; sourceTree = "<group>"; }; E38E1AB80D25F9FB00618676 /* SConstruct */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SConstruct; sourceTree = "<group>"; }; E38E1ABD0D25F9FB00618676 /* MediaCrawler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaCrawler.cpp; sourceTree = "<group>"; }; E38E1ABE0D25F9FB00618676 /* MediaCrawler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaCrawler.h; sourceTree = "<group>"; }; @@ -3872,7 +3864,6 @@ E35EF2550D380C3D00DB5CD5 /* QuickTime.framework in Frameworks */, E35EF3240D380E1E00DB5CD5 /* Carbon.framework in Frameworks */, E3EB8F080D5D5C0300FFF489 /* libvorbis.dylib in Frameworks */, - 810CA01C0D68A6E20095F5DD /* libshout-x86-osx.a in Frameworks */, E3BBB7A20D7EA8B200CAAFD3 /* libpcre.dylib in Frameworks */, 88ECB6590DE013C4003396A7 /* DiskArbitration.framework in Frameworks */, 88ECB6E70DE07BA6003396A7 /* libfontconfig.1.dylib in Frameworks */, @@ -5606,8 +5597,6 @@ E4DC97520FFE5BA8008E0C07 /* SAPFile.cpp */, F5A7B37C113AFB900059D6AA /* SFTPDirectory.cpp */, F5A7B37D113AFB900059D6AA /* SFTPDirectory.h */, - E38E174F0D25F9FA00618676 /* ShoutcastRipFile.cpp */, - E38E17500D25F9FA00618676 /* ShoutcastRipFile.h */, E38E17510D25F9FA00618676 /* SIDFileDirectory.cpp */, E38E17520D25F9FA00618676 /* SIDFileDirectory.h */, E38E17530D25F9FA00618676 /* SmartPlaylistDirectory.cpp */, @@ -5760,7 +5749,6 @@ E38E19820D25F9FB00618676 /* libPython */, E38E1A130D25F9FB00618676 /* libRTV */, E38E1A210D25F9FB00618676 /* libscrobbler */, - E38E1A270D25F9FB00618676 /* libshout */, F5E55E601076B34F006E788A /* libsquish */, E38E1A550D25F9FB00618676 /* libUPnP */, E38E1C780D25F9FC00618676 /* libXBMS */, @@ -5934,15 +5922,6 @@ path = libscrobbler; sourceTree = "<group>"; }; - E38E1A270D25F9FB00618676 /* libshout */ = { - isa = PBXGroup; - children = ( - E38E1A280D25F9FB00618676 /* filelib.h */, - E38E1A2D0D25F9FB00618676 /* rip_manager.h */, - ); - path = libshout; - sourceTree = "<group>"; - }; E38E1A550D25F9FB00618676 /* libUPnP */ = { isa = PBXGroup; children = ( @@ -6962,7 +6941,6 @@ E38E256C0D263A1C00618676 /* librtv-x86-osx.a */, F5DC8816110A4B8900EE1B15 /* libxbms-x86-osx.a */, E38E25680D2639F100618676 /* libxdaap-x86-osx.a */, - E30B3E8E0D5D59290030A311 /* libshout-x86-osx.a */, 810CA0050D683DEF0095F5DD /* libSDL-x86-osx.a */, 810CA0080D683DEF0095F5DD /* libSDL_mixer-x86-osx.a */, ); @@ -7499,7 +7477,6 @@ E38E20520D25F9FD00618676 /* RarDirectory.cpp in Sources */, E38E20530D25F9FD00618676 /* RarManager.cpp in Sources */, E38E20540D25F9FD00618676 /* RTVDirectory.cpp in Sources */, - E38E20560D25F9FD00618676 /* ShoutcastRipFile.cpp in Sources */, E38E20570D25F9FD00618676 /* SIDFileDirectory.cpp in Sources */, E38E20580D25F9FD00618676 /* SmartPlaylistDirectory.cpp in Sources */, E38E205B0D25F9FD00618676 /* StackDirectory.cpp in Sources */, @@ -8370,7 +8347,6 @@ F5A1C9840F6B06CF00A96ABD /* RarDirectory.cpp in Sources */, F5A1C9850F6B06CF00A96ABD /* RarManager.cpp in Sources */, F5A1C9860F6B06CF00A96ABD /* RTVDirectory.cpp in Sources */, - F5A1C9880F6B06CF00A96ABD /* ShoutcastRipFile.cpp in Sources */, F5A1C9890F6B06CF00A96ABD /* SIDFileDirectory.cpp in Sources */, F5A1C98A0F6B06CF00A96ABD /* SmartPlaylistDirectory.cpp in Sources */, F5A1C98B0F6B06CF00A96ABD /* StackDirectory.cpp in Sources */, diff --git a/configure.in b/configure.in index bf4cdfbdc3..4511bd7682 100644 --- a/configure.in +++ b/configure.in @@ -1402,7 +1402,6 @@ OUTPUT_FILES="Makefile \ xbmc/lib/libhttpapi/Makefile \ lib/jsoncpp/jsoncpp/src/lib_json/Makefile \ xbmc/lib/libjsonrpc/Makefile \ - xbmc/lib/libshout/Makefile \ xbmc/lib/libsquish/Makefile \ xbmc/lib/libid3tag/Makefile \ xbmc/lib/cximage-6.0/Makefile \ diff --git a/project/VS2008Express/XBMC for Windows.sln b/project/VS2008Express/XBMC for Windows.sln index 8f6ff64f0b..5df6cbdb02 100644 --- a/project/VS2008Express/XBMC for Windows.sln +++ b/project/VS2008Express/XBMC for Windows.sln @@ -9,7 +9,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XBMC", "XBMC.vcproj", "{3A6 {7A74ED4B-2BF5-47D7-B43E-C80F714417FB} = {7A74ED4B-2BF5-47D7-B43E-C80F714417FB}
{E465056A-C6F3-45EE-B791-CAF8E0CE629D} = {E465056A-C6F3-45EE-B791-CAF8E0CE629D}
{B2975495-FBE4-4F94-AAC5-B21A9842BF50} = {B2975495-FBE4-4F94-AAC5-B21A9842BF50}
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6} = {76850A99-4EC7-4196-B3EA-E4120A00E8A6}
{BDD2CB99-93C5-4A70-ACBF-396FFB961AD3} = {BDD2CB99-93C5-4A70-ACBF-396FFB961AD3}
{5013769A-0784-4CE8-9D9D-09AC7F731B4F} = {5013769A-0784-4CE8-9D9D-09AC7F731B4F}
{510441AC-B9E1-4B31-9C0C-EB3AD39D90C4} = {510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}
@@ -50,8 +49,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad2_dll", "..\..\xbmc\ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcmyth_dll", "..\..\xbmc\lib\cmyth\Win32\libcmyth.vcproj", "{F9E6874D-60A8-49BA-9393-A2105E63ABCF}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libshout", "..\..\xbmc\lib\libshout\libshout\libshout.vcproj", "{76850A99-4EC7-4196-B3EA-E4120A00E8A6}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsamplerate", "..\..\xbmc\lib\libsamplerate\libsamplerate_win32\libsamplerate_win32.vcproj", "{5013769A-0784-4CE8-9D9D-09AC7F731B4F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsqlite", "..\..\xbmc\lib\sqLite\sqlite\libsqlite_win32\libsqlite_win32.vcproj", "{9E74DF3B-9343-4689-B0EC-4451617F9489}"
@@ -289,14 +286,6 @@ Global {F9E6874D-60A8-49BA-9393-A2105E63ABCF}.Release (DirectX)|Win32.Build.0 = Release|Win32
{F9E6874D-60A8-49BA-9393-A2105E63ABCF}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32
{F9E6874D-60A8-49BA-9393-A2105E63ABCF}.Release (OpenGL)|Win32.Build.0 = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (DirectX)|Win32.Build.0 = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (OpenGL)|Win32.Build.0 = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (DirectX)|Win32.ActiveCfg = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (DirectX)|Win32.Build.0 = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (OpenGL)|Win32.Build.0 = Release|Win32
{5013769A-0784-4CE8-9D9D-09AC7F731B4F}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32
{5013769A-0784-4CE8-9D9D-09AC7F731B4F}.Debug (DirectX)|Win32.Build.0 = Debug|Win32
{5013769A-0784-4CE8-9D9D-09AC7F731B4F}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32
diff --git a/project/VS2008Express/XBMC.vcproj b/project/VS2008Express/XBMC.vcproj index 48d1a7ef54..0f9070079c 100644 --- a/project/VS2008Express/XBMC.vcproj +++ b/project/VS2008Express/XBMC.vcproj @@ -4301,10 +4301,6 @@ >
</File>
<File
- RelativePath="..\..\xbmc\FileSystem\ShoutcastRipFile.cpp"
- >
- </File>
- <File
RelativePath="..\..\xbmc\FileSystem\SIDFileDirectory.cpp"
>
</File>
@@ -5942,10 +5938,6 @@ >
</File>
<File
- RelativePath="..\..\xbmc\FileSystem\ShoutcastRipFile.h"
- >
- </File>
- <File
RelativePath="..\..\xbmc\utils\SingleLock.h"
>
</File>
diff --git a/project/VS2010Express/XBMC for Windows.sln b/project/VS2010Express/XBMC for Windows.sln index a405500b34..8276c5d3cb 100644 --- a/project/VS2010Express/XBMC for Windows.sln +++ b/project/VS2010Express/XBMC for Windows.sln @@ -31,8 +31,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad2_dll", "..\..\xbmc\ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcmyth_dll", "..\..\xbmc\lib\cmyth\Win32\libcmyth.vcxproj", "{F9E6874D-60A8-49BA-9393-A2105E63ABCF}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libshout", "..\..\xbmc\lib\libshout\libshout\libshout.vcxproj", "{76850A99-4EC7-4196-B3EA-E4120A00E8A6}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsamplerate", "..\..\xbmc\lib\libsamplerate\libsamplerate_win32\libsamplerate_win32.vcxproj", "{5013769A-0784-4CE8-9D9D-09AC7F731B4F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsqlite", "..\..\xbmc\lib\sqLite\sqlite\libsqlite_win32\libsqlite_win32.vcxproj", "{9E74DF3B-9343-4689-B0EC-4451617F9489}"
@@ -227,14 +225,6 @@ Global {F9E6874D-60A8-49BA-9393-A2105E63ABCF}.Release (DirectX)|Win32.Build.0 = Release|Win32
{F9E6874D-60A8-49BA-9393-A2105E63ABCF}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32
{F9E6874D-60A8-49BA-9393-A2105E63ABCF}.Release (OpenGL)|Win32.Build.0 = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (DirectX)|Win32.Build.0 = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Debug (OpenGL)|Win32.Build.0 = Debug|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (DirectX)|Win32.ActiveCfg = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (DirectX)|Win32.Build.0 = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (OpenGL)|Win32.ActiveCfg = Release|Win32
- {76850A99-4EC7-4196-B3EA-E4120A00E8A6}.Release (OpenGL)|Win32.Build.0 = Release|Win32
{5013769A-0784-4CE8-9D9D-09AC7F731B4F}.Debug (DirectX)|Win32.ActiveCfg = Debug|Win32
{5013769A-0784-4CE8-9D9D-09AC7F731B4F}.Debug (DirectX)|Win32.Build.0 = Debug|Win32
{5013769A-0784-4CE8-9D9D-09AC7F731B4F}.Debug (OpenGL)|Win32.ActiveCfg = Debug|Win32
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index 043b2c2b3a..164581b392 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -800,7 +800,6 @@ <ClCompile Include="..\..\xbmc\FileSystem\SAPDirectory.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\SAPFile.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\SFTPDirectory.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\ShoutcastRipFile.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\SIDFileDirectory.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\SmartPlaylistDirectory.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\SpecialProtocol.cpp" />
@@ -1617,7 +1616,6 @@ <ClInclude Include="..\..\xbmc\SettingsControls.h" />
<ClInclude Include="..\..\xbmc\utils\SharedSection.h" />
<ClInclude Include="..\..\xbmc\Shortcut.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\ShoutcastRipFile.h" />
<ClInclude Include="..\..\xbmc\utils\SingleLock.h" />
<ClInclude Include="..\..\xbmc\Song.h" />
<ClInclude Include="..\..\xbmc\SortFileItem.h" />
@@ -1825,10 +1823,6 @@ <Project>{5013769a-0784-4ce8-9d9d-09ac7f731b4f}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
- <ProjectReference Include="..\..\xbmc\lib\libshout\libshout\libshout.vcxproj">
- <Project>{76850a99-4ec7-4196-b3ea-e4120a00e8a6}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
<ProjectReference Include="..\..\xbmc\lib\libsquish\vs7\squish\squish_2010.vcxproj">
<Project>{6a8518c3-d81a-4428-bd7f-c37933088ac1}</Project>
<Private>true</Private>
diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index 736731764d..ead1f96d42 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -1563,9 +1563,6 @@ <ClCompile Include="..\..\xbmc\FileSystem\SFTPDirectory.cpp">
<Filter>Source Files\Filesystem</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\ShoutcastRipFile.cpp">
- <Filter>Source Files\Filesystem</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\SIDFileDirectory.cpp">
<Filter>Source Files\Filesystem</Filter>
</ClCompile>
@@ -3929,9 +3926,6 @@ <ClInclude Include="..\..\xbmc\Shortcut.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\ShoutcastRipFile.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\utils\SingleLock.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/xbmc/FileSystem/FileCurl.cpp b/xbmc/FileSystem/FileCurl.cpp index 85d7e259fe..339115b06c 100644 --- a/xbmc/FileSystem/FileCurl.cpp +++ b/xbmc/FileSystem/FileCurl.cpp @@ -326,6 +326,7 @@ CFileCurl::CFileCurl() m_password = ""; m_httpauth = ""; m_state = new CReadState(); + m_skipshout = false; } //Has to be called before Open() @@ -711,6 +712,8 @@ void CFileCurl::ParseAndCorrectUrl(CURL &url2) SetCookie(value); else if (name.Equals("Encoding")) SetContentEncoding(value); + else if (name.Equals("noshout") && value.Equals("true")) + m_skipshout = true; else SetRequestHeader(name, value); } @@ -849,9 +852,9 @@ bool CFileCurl::Open(const CURL& url) // check if this stream is a shoutcast stream. sometimes checking the protocol line is not enough so examine other headers as well. // shoutcast streams should be handled by FileShoutcast. - if (m_state->m_httpheader.GetProtoLine().Left(3) == "ICY" || !m_state->m_httpheader.GetValue("icy-notice1").IsEmpty() + if ((m_state->m_httpheader.GetProtoLine().Left(3) == "ICY" || !m_state->m_httpheader.GetValue("icy-notice1").IsEmpty() || !m_state->m_httpheader.GetValue("icy-name").IsEmpty() - || !m_state->m_httpheader.GetValue("icy-br").IsEmpty() ) + || !m_state->m_httpheader.GetValue("icy-br").IsEmpty()) && !m_skipshout) { CLog::Log(LOGDEBUG,"FileCurl - file <%s> is a shoutcast stream. re-opening", m_url.c_str()); throw new CRedirectException(new CFileShoutcast); diff --git a/xbmc/FileSystem/FileCurl.h b/xbmc/FileSystem/FileCurl.h index 1a784492e5..50caaa69d1 100644 --- a/xbmc/FileSystem/FileCurl.h +++ b/xbmc/FileSystem/FileCurl.h @@ -152,6 +152,7 @@ namespace XFILE bool m_useOldHttpVersion; bool m_seekable; bool m_multisession; + bool m_skipshout; CRingBuffer m_buffer; // our ringhold buffer char * m_overflowBuffer; // in the rare case we would overflow the above buffer diff --git a/xbmc/FileSystem/FileShoutcast.cpp b/xbmc/FileSystem/FileShoutcast.cpp index 70a559b9a7..034a603912 100644 --- a/xbmc/FileSystem/FileShoutcast.cpp +++ b/xbmc/FileSystem/FileShoutcast.cpp @@ -33,178 +33,33 @@ #include "GUIWindowManager.h" #include "URL.h" #include "utils/TimeUtils.h" -#include "LocalizeStrings.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -// prevent inclusion of config.h from libshout -#define __SRCONFIG_H__ -#include "lib/libshout/rip_manager.h" -#include "lib/libshout/filelib.h" -#undef __SRCONFIG_H__ - -#include "RingBuffer.h" -#include "ShoutcastRipFile.h" #include "utils/GUIInfoManager.h" #include "utils/log.h" -//using namespace std; On VS2010 error_code conflicts with std::error_code using namespace XFILE; using namespace MUSIC_INFO; -#ifndef HAS_SHOUTCAST -extern "C" -{ - error_code rip_manager_start(void (*status_callback)(int message, void *data), RIP_MANAGER_OPTIONS *options) { return 0; } - void rip_manager_stop() { } - void set_rip_manager_options_defaults(RIP_MANAGER_OPTIONS*) {} - int rip_manager_get_content_type() { return 0; } -} -#endif - -const int SHOUTCASTTIMEOUT = 60; -static CRingBuffer m_ringbuf; - -static FileState m_fileState; -static CShoutcastRipFile m_ripFile; - - -static RIP_MANAGER_INFO m_ripInfo; -static ERROR_INFO m_errorInfo; - - - -void rip_callback(int message, void *data) -{ - switch (message) - { - RIP_MANAGER_INFO *info; - case RM_UPDATE: - info = (RIP_MANAGER_INFO*)data; - memcpy(&m_ripInfo, info, sizeof(m_ripInfo)); - if (info->status == RM_STATUS_BUFFERING) - { - m_fileState.bBuffering = true; - } - else if ( info->status == RM_STATUS_RIPPING) - { - m_ripFile.SetRipManagerInfo( &m_ripInfo ); - m_fileState.bBuffering = false; - } - else if (info->status == RM_STATUS_RECONNECTING) - { } - break; - case RM_ERROR: - ERROR_INFO *errInfo; - errInfo = (ERROR_INFO*)data; - memcpy(&m_errorInfo, errInfo, sizeof(m_errorInfo)); - m_fileState.bRipError = true; - OutputDebugString("error\n"); - break; - case RM_DONE: - OutputDebugString("done\n"); - m_fileState.bRipDone = true; - break; - case RM_NEW_TRACK: - char *trackName; - trackName = (char*) data; - m_ripFile.SetTrackname( trackName ); - break; - case RM_STARTED: - m_fileState.bRipStarted = true; - OutputDebugString("Started\n"); - break; - } - -} - -extern "C" { -error_code filelib_write_show(char *buf, u_long size) -{ - if ((unsigned int)size > m_ringbuf.getSize()) - { - CLog::Log(LOGERROR, "Shoutcast chunk too big: %lu", size); - return SR_ERROR_BUFFER_FULL; - } - while (m_ringbuf.getMaxWriteSize() < (unsigned int)size) Sleep(10); - m_ringbuf.WriteData(buf, size); - m_ripFile.Write( buf, size ); //will only write, if it has to - if (m_fileState.bBuffering) - { - if (rip_manager_get_content_type() == CONTENT_TYPE_OGG) - { - if (m_ringbuf.getMaxReadSize() > (m_ringbuf.getSize() / 8) ) - { - // hack because ogg streams are very broke, force it to go. - m_fileState.bBuffering = false; - } - } - } - - return SR_SUCCESS; -} -} - -CFileShoutcast* m_pShoutCastRipper = NULL; - CFileShoutcast::CFileShoutcast() { - // FIXME: without this check - // the playback stops when CFile::Stat() - // or CFile::Exists() is called - - // Do we already have another file - // using the ripper? - if (!m_pShoutCastRipper) - { - m_fileState.bBuffering = true; - m_fileState.bRipDone = false; - m_fileState.bRipStarted = false; - m_fileState.bRipError = false; - m_ringbuf.Create(1024*1024); // must be big enough. some stations use 192kbps. - m_pShoutCastRipper = this; - } + m_lastTime = CTimeUtils::GetTimeMS(); + m_discarded = 0; + m_currint = 0; + m_buffer = NULL; } CFileShoutcast::~CFileShoutcast() { - // FIXME: without this check - // the playback stops when CFile::Stat() - // or CFile::Exists() is called - - // Has this object initialized the ripper? - if (m_pShoutCastRipper==this) - { - rip_manager_stop(); - m_pShoutCastRipper = NULL; - m_ripFile.Reset(); - m_ringbuf.Destroy(); - } + Close(); } -bool CFileShoutcast::CanRecord() -{ - if ( !m_fileState.bRipStarted ) - return false; - return m_ripFile.CanRecord(); -} - -bool CFileShoutcast::Record() -{ - return m_ripFile.Record(); -} - -void CFileShoutcast::StopRecording() -{ - m_ripFile.StopRecording(); -} - - int64_t CFileShoutcast::GetPosition() { - return 0; + return m_file.GetPosition()-m_discarded; } int64_t CFileShoutcast::GetLength() @@ -212,201 +67,50 @@ int64_t CFileShoutcast::GetLength() return 0; } - bool CFileShoutcast::Open(const CURL& url) { - m_lastTime = CTimeUtils::GetTimeMS(); - - CGUIDialogProgress* dlgProgress = NULL; - - // dvdplayer can deadlock with progress dialog so check first - if (g_application.GetCurrentPlayer() == EPC_PAPLAYER) - { - dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); - } - - set_rip_manager_options_defaults(&m_opt); - - strcpy(m_opt.output_directory, "./"); - m_opt.proxyurl[0] = '\0'; - - // Use a proxy, if the GUI was configured as such - bool bProxyEnabled = g_guiSettings.GetBool("network.usehttpproxy"); - if (bProxyEnabled) - { - const CStdString &strProxyServer = g_guiSettings.GetString("network.httpproxyserver"); - const CStdString &strProxyPort = g_guiSettings.GetString("network.httpproxyport"); - // Should we check for valid strings here -#ifndef _LINUX - _snprintf( m_opt.proxyurl, MAX_URL_LEN, "http://%s:%s", strProxyServer.c_str(), strProxyPort.c_str() ); -#else - snprintf( m_opt.proxyurl, MAX_URL_LEN, "http://%s:%s", strProxyServer.c_str(), strProxyPort.c_str() ); -#endif - } - - CStdString strUrl = url.Get(); - strUrl.Replace("shout://", "http://"); - strncpy(m_opt.url, strUrl.c_str(), MAX_URL_LEN); - sprintf(m_opt.useragent, "x%s", url.GetFileName().c_str()); - if (dlgProgress) - { - dlgProgress->SetHeading(260); - dlgProgress->SetLine(0, 259); - dlgProgress->SetLine(1, strUrl); - dlgProgress->SetLine(2, ""); - if (!dlgProgress->IsDialogRunning()) - dlgProgress->StartModal(); - dlgProgress->Progress(); - } + CURL url2(url); + url2.SetProtocolOptions("noshout=true&Icy-MetaData=1"); - if (rip_manager_start(rip_callback, &m_opt) != SR_SUCCESS) - { - if (dlgProgress) dlgProgress->Close(); - return false; - } - int iShoutcastTimeout = 10 * SHOUTCASTTIMEOUT; //i.e: 10 * 10 = 100 * 100ms = 10s - int iCount = 0; - while (!m_fileState.bRipDone && !m_fileState.bRipStarted && !m_fileState.bRipError && (!dlgProgress || !dlgProgress->IsCanceled())) + bool result=false; + if ((result=m_file.Open(url2.Get()))) { - if (iCount <= iShoutcastTimeout) //Normally, this isn't the problem, - //because if RIP_MANAGER fails, this would be here - //with m_fileState.bRipError - { - Sleep(100); - } - else - { - if (dlgProgress) - { - dlgProgress->SetLine(1, 257); - dlgProgress->SetLine(2, "Connection timed out..."); - Sleep(1500); - dlgProgress->Close(); - } - return false; - } - iCount++; + m_tag.SetTitle(m_file.GetHttpHeader().GetValue("icy-name")); + if (m_tag.GetTitle().IsEmpty()) + m_tag.SetTitle(m_file.GetHttpHeader().GetValue("ice-name")); // icecast + m_tag.SetGenre(m_file.GetHttpHeader().GetValue("icy-genre")); + if (m_tag.GetGenre().IsEmpty()) + m_tag.SetGenre(m_file.GetHttpHeader().GetValue("ice-genre")); // icecast + m_tag.SetLoaded(true); + g_infoManager.SetCurrentSongTag(m_tag); } + m_metaint = atoi(m_file.GetHttpHeader().GetValue("icy-metaint").c_str()); + m_buffer = new char[16*255]; - if (dlgProgress && dlgProgress->IsCanceled()) - { - Close(); - dlgProgress->Close(); - return false; - } - - /* store content type of stream */ - m_mimetype = rip_manager_get_content_type(); - - //CHANGED CODE: Don't reset timer anymore. - - while (!m_fileState.bRipDone && !m_fileState.bRipError && m_fileState.bBuffering && (!dlgProgress || !dlgProgress->IsCanceled())) - { - if (iCount <= iShoutcastTimeout) //Here is the real problem: Sometimes the buffer fills just to - //slowly, thus the quality of the stream will be bad, and should be - //aborted... - { - Sleep(100); - char szTmp[1024]; - //g_dialog.SetCaption(0, "Shoutcast" ); - sprintf(szTmp, g_localizeStrings.Get(23052).c_str(), m_ringbuf.getMaxReadSize()); - if (dlgProgress) - { - dlgProgress->SetLine(2, szTmp ); - dlgProgress->Progress(); - } - - sprintf(szTmp, "%s", m_ripInfo.filename); - for (int i = 0; i < (int)strlen(szTmp); i++) - szTmp[i] = tolower((unsigned char)szTmp[i]); - szTmp[50] = 0; - if (dlgProgress) - { - dlgProgress->SetLine(1, szTmp ); - dlgProgress->Progress(); - } - } - else //it's not really a connection timeout, but it's here, - //where things get boring, if connection is slow. - //trust me, i did a lot of testing... Doesn't happen often, - //but if it does it sucks to wait here forever. - //CHANGED: Other message here - { - if (dlgProgress) - { - dlgProgress->SetLine(1, 257); - dlgProgress->SetLine(2, "Connection to server too slow..."); - dlgProgress->Close(); - } - return false; - } - iCount++; - } - if (dlgProgress && dlgProgress->IsCanceled()) - { - Close(); - dlgProgress->Close(); - return false; - } - if ( m_fileState.bRipError ) - { - if (dlgProgress) - { - dlgProgress->SetLine(1, 257); - dlgProgress->SetLine(2, 16029); - CLog::Log(LOGERROR, "%s: error - %s", __FUNCTION__, m_errorInfo.error_str); - dlgProgress->Progress(); - - Sleep(1500); - dlgProgress->Close(); - } - return false; - } - if (dlgProgress) - { - dlgProgress->SetLine(2, 261); - dlgProgress->Progress(); - dlgProgress->Close(); - } - return true; + return result; } unsigned int CFileShoutcast::Read(void* lpBuf, int64_t uiBufSize) { - if (m_fileState.bRipDone) + if (m_currint >= m_metaint && m_metaint > 0) { - OutputDebugString("Read done\n"); - return 0; + unsigned char header; + m_file.Read(&header,1); + ReadTruncated(m_buffer, header*16); + ExtractTagInfo(m_buffer); + m_discarded += header*16+1; + m_currint = 0; } - - int slept=0; - while (m_ringbuf.getMaxReadSize() <= 0) - { - Sleep(10); - if (slept += 10 > SHOUTCASTTIMEOUT*1000) - return -1; - } - - int iRead = m_ringbuf.getMaxReadSize(); - if (iRead > uiBufSize) iRead = (int)uiBufSize; - m_ringbuf.ReadData((char*)lpBuf, iRead); - if (CTimeUtils::GetTimeMS() - m_lastTime > 500) { m_lastTime = CTimeUtils::GetTimeMS(); - CMusicInfoTag tag; - GetMusicInfoTag(tag); - g_infoManager.SetCurrentSongTag(tag); + g_infoManager.SetCurrentSongTag(m_tag); } - return iRead; -} -void CFileShoutcast::outputTimeoutMessage(const char* message) -{ - //g_dialog.SetCaption(0, "Shoutcast" ); - //g_dialog.SetMessage(0, message ); - //g_dialog.Render(); - Sleep(1500); + unsigned int toRead = std::min((unsigned int)uiBufSize,(unsigned int)m_metaint-m_currint); + toRead = m_file.Read(lpBuf,toRead); + m_currint += toRead; + return toRead; } int64_t CFileShoutcast::Seek(int64_t iFilePosition, int iWhence) @@ -416,37 +120,25 @@ int64_t CFileShoutcast::Seek(int64_t iFilePosition, int iWhence) void CFileShoutcast::Close() { - OutputDebugString("Shoutcast Stopping\n"); - if ( m_ripFile.IsRecording() ) - m_ripFile.StopRecording(); - m_ringbuf.Clear(); - rip_manager_stop(); - m_ripFile.Reset(); - OutputDebugString("Shoutcast Stopped\n"); + delete[] m_buffer; + m_file.Close(); } -bool CFileShoutcast::IsRecording() +void CFileShoutcast::ExtractTagInfo(const char* buf) { - return m_ripFile.IsRecording(); + char temp[1024]; + if (sscanf(buf,"StreamTitle='%[^']",temp) > 0) + m_tag.SetTitle(temp); } -bool CFileShoutcast::GetMusicInfoTag(CMusicInfoTag& tag) +void CFileShoutcast::ReadTruncated(char* buf2, int size) { - m_ripFile.GetMusicInfoTag(tag); - return true; -} - -CStdString CFileShoutcast::GetContent() -{ - switch (m_mimetype) + char* buf = buf2; + while (size > 0) { - case CONTENT_TYPE_MP3: - return "audio/mpeg"; - case CONTENT_TYPE_OGG: - return "audio/ogg"; - case CONTENT_TYPE_AAC: - return "audio/aac"; - default: - return "application/octet-stream"; + int read = m_file.Read(buf,size); + size -= read; + buf += read; } } + diff --git a/xbmc/FileSystem/FileShoutcast.h b/xbmc/FileSystem/FileShoutcast.h index 740abcf676..c7582e1f5f 100644 --- a/xbmc/FileSystem/FileShoutcast.h +++ b/xbmc/FileSystem/FileShoutcast.h @@ -23,37 +23,15 @@ // ////////////////////////////////////////////////////////////////////// -#if !defined(AFX_FILESHOUTCAST_H__6B6082E6_547E_44C4_8801_9890781659C0__INCLUDED_) -#define AFX_FILESHOUTCAST_H__6B6082E6_547E_44C4_8801_9890781659C0__INCLUDED_ - -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "IFile.h" +#include "FileCurl.h" #include "StdString.h" - -// prevent inclusion of config.h from libshout -#define __SRCONFIG_H__ -#include "lib/libshout/rip_manager.h" -#undef __SRCONFIG_H__ - -namespace MUSIC_INFO -{ - class CMusicInfoTag; -} +#include "MusicInfoTag.h" namespace XFILE { -typedef struct FileStateSt -{ - bool bBuffering; - bool bRipDone; - bool bRipStarted; - bool bRipError; -} -FileState; - class CFileShoutcast : public IFile { public: @@ -67,17 +45,17 @@ public: virtual unsigned int Read(void* lpBuf, int64_t uiBufSize); virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); virtual void Close(); - virtual bool CanRecord(); - virtual bool Record(); - virtual void StopRecording(); - virtual bool IsRecording(); - virtual bool GetMusicInfoTag(MUSIC_INFO::CMusicInfoTag& tag); - virtual CStdString GetContent(); protected: - void outputTimeoutMessage(const char* message); + void ExtractTagInfo(const char* buf); + void ReadTruncated(char* buf2, int size); + unsigned int m_lastTime; - int m_mimetype; - RIP_MANAGER_OPTIONS m_opt; + CFileCurl m_file; + int m_metaint; + int m_discarded; // data used for tags + int m_currint; + char* m_buffer; // buffer used for tags + MUSIC_INFO::CMusicInfoTag m_tag; }; } -#endif // !defined(AFX_FILESHOUTCAST_H__6B6082E6_547E_44C4_8801_9890781659C0__INCLUDED_) + diff --git a/xbmc/FileSystem/Makefile.in b/xbmc/FileSystem/Makefile.in index 1eb7c0dd43..8e69be4cf2 100644 --- a/xbmc/FileSystem/Makefile.in +++ b/xbmc/FileSystem/Makefile.in @@ -72,7 +72,6 @@ SRCS=AddonsDirectory.cpp \ RTVDirectory.cpp \ SAPDirectory.cpp \ SAPFile.cpp \ - ShoutcastRipFile.cpp \ SIDFileDirectory.cpp \ SmartPlaylistDirectory.cpp \ SMBDirectory.cpp \ diff --git a/xbmc/FileSystem/ShoutcastRipFile.cpp b/xbmc/FileSystem/ShoutcastRipFile.cpp deleted file mode 100644 index f9c3f782c9..0000000000 --- a/xbmc/FileSystem/ShoutcastRipFile.cpp +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.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, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#include "ShoutcastRipFile.h" -#include "Id3Tag.h" -#include "FileSystem/Directory.h" -#include "FileItem.h" -#include "GUISettings.h" -#include "Util.h" - -// prevent inclusion of config.h from libshout -#define __SRCONFIG_H__ -#include "lib/libshout/rip_manager.h" -#undef __SRCONFIG_H__ - -using namespace MUSIC_INFO; - -#define MAX_RECORDED_TRACKS 999 - -#ifndef _LINUX -#if !defined(WIN32) -#define WIN32 1 -#endif -#endif - -#ifdef _WIN32 -extern "C" FILE *fopen_utf8(const char *_Filename, const char *_Mode); -#else -#define fopen_utf8 fopen -#endif - -namespace SHOUTCAST -{ -// prevent inclusion of config.h from libshout -#define __SRCONFIG_H__ -#include "lib/libshout/rip_manager.h" -#undef __SRCONFIG_H__ -} - -CShoutcastRipFile::CShoutcastRipFile() -{ - m_recState.bRecording = false; - m_recState.bCanRecord = false; - m_recState.bTrackChanged = false; - m_recState.bFilenameSet = false; - m_recState.bStreamSet = false; - m_iTrackCount = 1; - m_szFileName[0] = '\0'; - m_szFilteredFileName[0] = '\0'; - m_szStreamName[0] = '\0'; - m_ripFile = NULL; - m_logFile = NULL; -} - -CShoutcastRipFile::~CShoutcastRipFile() -{ - m_recState.bRecording = false; - m_recState.bCanRecord = false; - m_recState.bTrackChanged = false; - m_recState.bFilenameSet = false; - m_recState.bStreamSet = false; - m_iTrackCount = 1; - m_szFileName[0] = '\0'; - m_szFilteredFileName[0] = '\0'; - m_szStreamName[0] = '\0'; - if ( m_ripFile != NULL ) - { - fclose( m_ripFile ); - m_ripFile = NULL; - } - if ( m_logFile != NULL ) - { - fclose( m_logFile ); - m_logFile = NULL; - } -} - -void CShoutcastRipFile::Reset() -{ - m_recState.bRecording = false; - m_recState.bCanRecord = false; - m_recState.bTrackChanged = false; - m_recState.bFilenameSet = false; - m_recState.bStreamSet = false; - m_iTrackCount = 1; - m_szFileName[0] = '\0'; - m_szFilteredFileName[0] = '\0'; - m_szStreamName[0] = '\0'; - if ( m_ripFile != NULL ) - { - fclose( m_ripFile ); - m_ripFile = NULL; - } - if ( m_logFile != NULL ) - { - fclose( m_logFile ); - m_logFile = NULL; - } -} - -//SetRipManagerInfo() will be called frequently, depending on meta size -void CShoutcastRipFile::SetRipManagerInfo( const RIP_MANAGER_INFO* ripInfo ) -{ - RIP_MANAGER_INFO info; - memcpy(&info, ripInfo, sizeof(info)); - if ( m_recState.bFilenameSet && m_recState.bStreamSet ) //wait for RM to give all info needed - { - //we got everything we need - //look if we have some metainformation (change of trackname) - //RM returns Trackname like StreamName, if there is no Meta-Info - //(or maybe he is not capable sometimes?!?) - if ( strcmp( m_szFileName, m_szStreamName ) != 0 ) - m_recState.bHasMetaData = true; - else - m_recState.bHasMetaData = false; - m_recState.bCanRecord = true; //now we are ready for recording... - } - else - { - //put relevant data to members - if ( !m_recState.bFilenameSet ) //check for filename - { - strcpy( m_szFileName, info.filename ); - if ( m_szFileName[0] != '\0' ) //recheck, just to be sure... - { - m_recState.bFilenameSet = true; - } - } - if ( !m_recState.bStreamSet ) //and for stream name - { - strcpy( m_szStreamName, info.streamname ); - if ( m_szStreamName[0] != '\0' ) //recheck, just to be sure... - { - m_recState.bStreamSet = true; - } - } - } -} - -bool CShoutcastRipFile::Record() -{ - //open file for logging now - if ( m_logFile == NULL ) //will be done only the first time or if path not set! - { - char logFilename[1024]; - CStdString strHomePath = g_guiSettings.GetString("audiocds.recordingpath"); -#ifndef _LINUX - sprintf(logFilename, "%s\\recordings.log", strHomePath.c_str() ); -#else - sprintf(logFilename, "%s/recordings.log", strHomePath.c_str() ); -#endif - m_logFile = fopen_utf8( logFilename, "at+"); - } - - PrepareRecording(); - m_ripFile = fopen_utf8( m_szFilteredFileName, "wb+" ); - - char logRecording[2048]; - //we log this, for users that want to change id3 tags afterward... - sprintf(logRecording, "%s ( StreamName: %s ) ( TrackName: %s )\n", - m_szFilteredFileName, - m_szStreamName, - m_szFileName ); - if ( m_logFile != NULL ) - { - fwrite(logRecording, strlen(logRecording), 1, m_logFile); - fflush( m_logFile ); //Flush, if file isn't proberly closed afterwards (when user turns off xbox) - } - // XTRACE(logRecording); - if ( m_ripFile != NULL ) - { - m_recState.bRecording = true; - } - else - { - m_recState.bRecording = false; - } - - return m_recState.bRecording; -} - -bool CShoutcastRipFile::CanRecord() -{ - - return m_recState.bCanRecord; -} - -void CShoutcastRipFile::StopRecording() -{ - m_recState.bRecording = false; //stop writing, so we can write ID3 info - if (m_ripFile) - { - fclose(m_ripFile); - m_ripFile = NULL; - // Write collected ID3 Data to file - CID3Tag id3tag; - id3tag.SetMusicInfoTag(m_Tag); - id3tag.Write(m_szFilteredFileName); - } -} - -bool CShoutcastRipFile::IsRecording() -{ - return m_recState.bRecording; -} - -void CShoutcastRipFile::Write( char *buf, unsigned long size ) -{ - if ( m_recState.bRecording && m_ripFile != NULL ) - { - fwrite(buf, size, 1, m_ripFile); - } -} - -void CShoutcastRipFile::SetTrackname( const char *trackName ) -{ - if ( m_recState.bRecording && m_recState.bHasMetaData) //if we are already recording, swap the file - { - StopRecording(); - memset( m_szFileName, '\0', sizeof(m_szFileName)); //clear buffer - strcpy( m_szFileName, trackName ); //swap - m_iTrackCount++; - Record(); - } - else - { - memset( m_szFileName, '\0', sizeof(m_szFileName)); //clear buffer - strcpy( m_szFileName, trackName ); //swap only filenames - if ( strcmp( m_szFileName, m_szStreamName ) != 0 ) //sometimes it takes a moment for RM to get the real TrackName - m_recState.bHasMetaData = true; - } -} - -void CShoutcastRipFile::PrepareRecording( ) -{ - //"init" - m_Tag.Clear(); - memset( m_szFilteredFileName, '\0', sizeof(m_szFilteredFileName)); //clear buffer - - - //Get the directory - //first copy the fileName to preserve info of the original RM message - strcpy(m_szFilteredFileName, m_szFileName ); - char directoryName[1124]; - GetDirectoryName(directoryName); - RemoveIllegalChars( directoryName ); - - - - //sometimes it happens, that .mp3 is already at the end, then strip it - int lastFour = strlen( m_szFilteredFileName ) - 4; - if ( strcmp( &m_szFilteredFileName[lastFour], ".mp3") == 0 ) - { - m_szFilteredFileName[lastFour] = '\0'; - } - RemoveLastSpace( m_szFilteredFileName ); - RemoveIllegalChars( m_szFilteredFileName ); //first remove all unsupported chars - //now distinguish between - if ( m_recState.bHasMetaData ) - { - //The filename of RM will be something like "Oasis - Champagne Supernova", thus - //So, we will make a file i.e "f:music\Record\Limbik Frequencies\Oasis - Champagne Supernova.mp3" - - CStdString strHomePath = g_guiSettings.GetString("audiocds.recordingpath"); - char szFilePath[1024]; -#ifndef _LINUX - sprintf( szFilePath, "%s\\%s", strHomePath.c_str(), directoryName ); -#else - sprintf( szFilePath, "%s/%s", strHomePath.c_str(), directoryName ); -#endif - SetFilename( szFilePath, m_szFilteredFileName ); - //get the artist and trackname - char szArtist[1124]; - char szTrackName[1124]; - char szTokens[1024]; - char* cursor; - bool tokenUsed = false; - bool foundArtist = false; - bool foundTrackName = false; - strcpy( szTokens, m_szFileName ); - cursor = strtok(szTokens, "-"); - while (cursor != NULL) - { - tokenUsed = false; - //we will look for two strings, - //sometimes there's a track number, wich we will throw away - if ( !foundArtist ) - { - if ( atoi( cursor ) == 0 ) - { - //its a string - strcpy(szArtist, cursor ); - foundArtist = true; - tokenUsed = true; - } - } - if ( !foundTrackName && !tokenUsed ) - { - if ( atoi( cursor ) == 0 ) - { - //its a string - strcpy(szTrackName, cursor ); - foundTrackName = true; - tokenUsed = true; - } - } - cursor = strtok (NULL, "-"); - } - if ( foundTrackName ) //lets hope we found a track name, else it will be unknown - m_Tag.SetTitle(szTrackName); - if ( foundArtist ) //lets hope we found an artist, else it will be unknown - m_Tag.SetArtist(szArtist); - m_Tag.SetAlbum(directoryName); //Jazzmusique (Album is like Directory) - } - else - { - //here we will make a file i.e "f:music\Record\Jazzmusique\Jazzmusique - 3.mp3" - CStdString strHomePath = g_guiSettings.GetString("audiocds.recordingpath"); - char szFilePath[1024]; - char szTitle[1124]; //i.e. - - //Set the filename -#ifndef _LINUX - sprintf( szFilePath, "%s\\%s", strHomePath.c_str(), directoryName ); -#else - sprintf( szFilePath, "%s/%s", strHomePath.c_str(), directoryName ); -#endif - SetFilename( szFilePath, directoryName ); //file name like Directory - - //set the remaining tags - sprintf( szTitle, "%s %i", directoryName, m_iTrackCount ); - m_Tag.SetTitle( szTitle ); //Jazzmusique 3 - m_Tag.SetAlbum( directoryName ); //Jazzmusique (Album is like Directory) - m_Tag.SetArtist( "Shoutcast" ); //Shoutcast - } -} - -void CShoutcastRipFile::SetFilename( const char* filePath, const char* fileName ) -{ - //first look if we need to create the directory - XFILE::CDirectory::Create(filePath); - CFileItemList items; - XFILE::CDirectory::GetDirectory(filePath, items, ".mp3", false); - items.SetFastLookup(true); - - CStdString file; - for (int i = m_iTrackCount; i <= MAX_RECORDED_TRACKS; i++ ) - { - if ( m_recState.bHasMetaData ) - file.Format("%i - %s.mp3", i, fileName); // will be "TRACKNUMBER - FILENAME.mp3" - else - file.Format("%s - %i.mp3", fileName, i); // will be "FILENAME - TRACKNUMBER.mp3" - file = CUtil::AddFileToFolder(filePath, CUtil::MakeLegalFileName(file)); - if (!items.Get(file)) - { - strcpy( m_szFilteredFileName, file.c_str() ); - //set the appropriate trackNumber - m_Tag.SetTrackNumber(i); - if ( !m_recState.bHasMetaData ) - m_iTrackCount = i; - return; - } - } - //if its the MAX_RECORDED_TRACKS. file, we overwrite it - strcpy( m_szFilteredFileName, file.c_str() ); - return; -} - -void CShoutcastRipFile::RemoveIllegalChars( char *szRemoveIllegal ) -{ - static char legalChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!#$%&'()-@[]^_`{}~ "; - char *cursor; - for (cursor = szRemoveIllegal; *(cursor += strspn(cursor, legalChars)); /**/ ) - *cursor = '_'; -} - - -//Sets the directory to a stripped stream name. -//Here is where most problems occure: It is hard to implement something fast -//which works for all streams and results in a meaningful name... -void CShoutcastRipFile::GetDirectoryName( char* directoryName ) -{ - char szStrippedStreamName[30]; //max 30 chars - memmove(szStrippedStreamName, m_szStreamName, 30); - // First start only at the place, where the first alphabetical character occures - //this is for example: "...::::Beatblender::::...." - char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - int pos = strcspn (szStrippedStreamName, alphabet);; - memmove(directoryName, szStrippedStreamName + pos, 29 - pos ); - directoryName[29] = '\0'; //the last one should be \0 - - //sometimes streams look like "Streamname - Shitty info", - //then remove that Shitty info - CutAfterLastChar(directoryName, '-' ); - - //or then theylook like "Streamname: Shitty info - other shitty info", :-( - //then remove that Shitty info - CutAfterLastChar(directoryName, ':' ); - - RemoveLastSpace(directoryName); //also remove the last space, else if used as path -> crash -} - -void CShoutcastRipFile::CutAfterLastChar( char* szToBeCutted, int where ) -{ - char * cursor; - cursor = strchr( szToBeCutted, where ); - if ( cursor != NULL ) - szToBeCutted[cursor - szToBeCutted] = '\0'; -} - -void CShoutcastRipFile::RemoveLastSpace( char* szToBeRemoved ) -{ - if ( szToBeRemoved[strlen(szToBeRemoved) - 1] == ' ' ) - szToBeRemoved[strlen(szToBeRemoved) - 1] = '\0'; -} - -void CShoutcastRipFile::GetMusicInfoTag(CMusicInfoTag& tag) -{ - if ( m_recState.bFilenameSet && m_recState.bStreamSet ) - { - tag.Clear(); - //now distinguish between - if ( m_recState.bHasMetaData ) - { - //The filename of RM will be something like "Oasis - Champagne Supernova", thus - //So, we will make a file i.e "f:music\Record\Limbik Frequencies\Oasis - Champagne Supernova.mp3" - //get the artist and trackname - char szArtist[1124]; - char szTrackName[1124]; - char szTokens[1024]; - char* cursor; - bool tokenUsed = false; - bool foundArtist = false; - bool foundTrackName = false; - strcpy( szTokens, m_szFileName ); - cursor = strtok(szTokens, "-"); - if (!cursor) cursor = strtok(szTokens, ","); - while (cursor != NULL) - { - tokenUsed = false; - //we will look for two strings, - //sometimes there's a track number, wich we will throw away - if ( !foundArtist ) - { - if ( atoi( cursor ) == 0 ) - { - //its a string - strcpy(szArtist, cursor ); - foundArtist = true; - tokenUsed = true; - } - } - if ( !foundTrackName && !tokenUsed ) - { - if ( atoi( cursor ) == 0 ) - { - //its a string - strcpy(szTrackName, cursor ); - foundTrackName = true; - tokenUsed = true; - } - } - cursor = strtok (NULL, "-"); - //if (!cursor) cursor=strtok(NULL,","); - } - if ( foundTrackName ) //lets hope we found a track name, else it will be unknown - tag.SetTitle(szTrackName); - else - tag.SetTitle(m_szStreamName); - if ( foundArtist ) //lets hope we found an artist, else it will be unknown - tag.SetArtist(szArtist); - tag.SetAlbum(m_szStreamName); //Jazzmusique (Album is like Directory) - } - else - { - tag.Clear(); - tag.SetTitle(m_szStreamName); - } - - } -} diff --git a/xbmc/FileSystem/ShoutcastRipFile.h b/xbmc/FileSystem/ShoutcastRipFile.h deleted file mode 100644 index 5abf4590c3..0000000000 --- a/xbmc/FileSystem/ShoutcastRipFile.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef CShoutcastRipFile_H -#define CShoutcastRipFile_H -/* - * Copyright (C) 2005-2008 Team XBMC - * http://www.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, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - - -#include "MusicInfoTag.h" - -typedef struct RecStateSt -{ - bool bRecording; - bool bCanRecord; - bool bTrackChanged; - bool bFilenameSet; - bool bStreamSet; - bool bHasMetaData; -} -RecState; - -/* prototype */ -typedef struct RIP_MANAGER_INFOst RIP_MANAGER_INFO; - -//if one would like to make other IFiles recordable, it would be -//great, to define a superclass for this one with differend useful -//functions for all, like FilterFileName(), Record(),... -class CShoutcastRipFile -{ -public: - - CShoutcastRipFile(); - virtual ~CShoutcastRipFile(); - - - void SetRipManagerInfo( const RIP_MANAGER_INFO* ripInfo ); - void SetTrackname( const char* trackname ); - - - bool Record(); - bool CanRecord(); - void StopRecording(); - bool IsRecording(); - void Write( char *buf, unsigned long size ); - void Reset(); - void GetMusicInfoTag(MUSIC_INFO::CMusicInfoTag& tag); -protected: - - -private: - - void PrepareRecording( ); - void RemoveIllegalChars( char *szRemoveIllegal ); - void GetDirectoryName( char* directoryName ); - void SetFilename( const char* filePath, const char* fileName ); - void CutAfterLastChar( char* szToBeCutted, int where ); - void RemoveLastSpace( char* szToBeRemoved ); - - - RecState m_recState; - int m_iTrackCount; - char m_szFileName[1024]; //FIXME: i think, that length could be optimized here - char m_szFilteredFileName[1024]; - char m_szStreamName[1024]; - FILE* m_ripFile; - FILE* m_logFile; - MUSIC_INFO::CMusicInfoTag m_Tag; -}; - - -#endif diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp index 6b8fe67679..a5a064ee99 100644 --- a/xbmc/cores/paplayer/PAPlayer.cpp +++ b/xbmc/cores/paplayer/PAPlayer.cpp @@ -47,8 +47,6 @@ #define TIME_TO_CACHE_NEXT_FILE 5000L // 5 seconds #define TIME_TO_CROSS_FADE 10000L // 10 seconds -extern XFILE::CFileShoutcast* m_pShoutCastRipper; - // PAP: Psycho-acoustic Audio Player // Supporting all open audio codec standards. // First one being nullsoft's nsv audio decoder format @@ -1089,30 +1087,6 @@ bool PAPlayer::SkipNext() return false; } -bool PAPlayer::CanRecord() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->CanRecord(); -} - -bool PAPlayer::IsRecording() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->IsRecording(); -} - -bool PAPlayer::Record(bool bOnOff) -{ - if (!m_pShoutCastRipper) return false; - if (bOnOff && IsRecording()) return true; - if (bOnOff == false && IsRecording() == false) return true; - if (bOnOff) - return m_pShoutCastRipper->Record(); - - m_pShoutCastRipper->StopRecording(); - return true; -} - void PAPlayer::WaitForStream() { // should we wait for our other stream as well? diff --git a/xbmc/cores/paplayer/PAPlayer.h b/xbmc/cores/paplayer/PAPlayer.h index 3507e85cc8..23f3b4bfed 100644 --- a/xbmc/cores/paplayer/PAPlayer.h +++ b/xbmc/cores/paplayer/PAPlayer.h @@ -89,9 +89,6 @@ public: virtual void SeekTime(__int64 iTime = 0); // Skip to next track/item inside the current media (if supported). virtual bool SkipNext(); - virtual bool CanRecord() ; - virtual bool IsRecording(); - virtual bool Record(bool bOnOff) ; void StreamCallback( LPVOID pPacketContext ); |