diff options
author | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2016-01-13 22:01:13 +0100 |
---|---|---|
committer | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2016-01-13 22:01:13 +0100 |
commit | dcbd35d6682e5c1bc5c990ca4359b33539b40de6 (patch) | |
tree | 12625382deff21a876a5091abb959963683756da | |
parent | 8ea87966085f545a2c3f76076880fc0a5c4672c7 (diff) | |
parent | 0a9852a4e06a3109d8ecbfc6d29cc7411e1b1cd5 (diff) |
Merge pull request #8832 from Memphiz/mrmc_backports3
27 files changed, 572 insertions, 95 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj index 38f9816b9e..03cfd692f5 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -754,6 +754,11 @@ DF34892A13FD9C780026A711 /* AirPlayServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34892813FD9C780026A711 /* AirPlayServer.cpp */; }; DF34898213FDAAF60026A711 /* HttpParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34898113FDAAF60026A711 /* HttpParser.cpp */; }; DF374B2418AC2BA20076B514 /* CoreAudioHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C8AE852189DE47400C33786 /* CoreAudioHelpers.cpp */; }; + DF396ED61C42AC5100214C1A /* AESinkDARWINIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF396ED51C42AC5100214C1A /* AESinkDARWINIOS.mm */; }; + DF396ED11C42A25F00214C1A /* DarwinNSUserDefaults.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF396ECD1C42A25F00214C1A /* DarwinNSUserDefaults.mm */; }; + DF396ED21C42A25F00214C1A /* DarwinNSUserDefaults.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF396ECD1C42A25F00214C1A /* DarwinNSUserDefaults.mm */; }; + DF396ED31C42A25F00214C1A /* DictionaryUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF396ECF1C42A25F00214C1A /* DictionaryUtils.mm */; }; + DF396ED41C42A25F00214C1A /* DictionaryUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF396ECF1C42A25F00214C1A /* DictionaryUtils.mm */; }; DF402A581644613B001C56B8 /* AddonModuleXbmc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF1ACFD115FCE50700E10810 /* AddonModuleXbmc.cpp */; }; DF402A591644613B001C56B8 /* AddonModuleXbmcaddon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF1ACFD515FCE50700E10810 /* AddonModuleXbmcaddon.cpp */; }; DF402A5A1644613B001C56B8 /* AddonModuleXbmcgui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF1ACFD915FCE50700E10810 /* AddonModuleXbmcgui.cpp */; }; @@ -926,7 +931,7 @@ DFD717601C0A031B0025D964 /* IOSScreenManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = DFD7174F1C0A031B0025D964 /* IOSScreenManager.mm */; }; DFD717611C0A031B0025D964 /* XBMCApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = DFD717511C0A031B0025D964 /* XBMCApplication.m */; }; DFD717621C0A031B0025D964 /* XBMCController.mm in Sources */ = {isa = PBXBuildFile; fileRef = DFD717531C0A031B0025D964 /* XBMCController.mm */; }; - DFD717641C0A03540025D964 /* IOS-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DFD717631C0A03540025D964 /* IOS-Info.plist */; }; + DFD717641C0A03540025D964 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DFD717631C0A03540025D964 /* Info.plist */; }; DFD882E817DD189E001516FE /* StringValidation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD882E517DD189E001516FE /* StringValidation.cpp */; }; DFD882E917DD189E001516FE /* StringValidation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD882E517DD189E001516FE /* StringValidation.cpp */; }; DFD882F717DD1A5B001516FE /* AddonPythonInvoker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DFD882F417DD1A5B001516FE /* AddonPythonInvoker.cpp */; }; @@ -2146,7 +2151,6 @@ F5BDB80C120202F400F0B710 /* DVDSubtitleTagSami.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5BDB80B120202F400F0B710 /* DVDSubtitleTagSami.cpp */; }; F5BDB81A1202032400F0B710 /* DVDSubtitleTagMicroDVD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5BDB8191202032400F0B710 /* DVDSubtitleTagMicroDVD.cpp */; }; F5CC228B1814F7E9006B5E91 /* AESinkDARWINOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5CC22891814F7E9006B5E91 /* AESinkDARWINOSX.cpp */; }; - F5CC228E1814F7F7006B5E91 /* AESinkDARWINIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5CC228C1814F7F7006B5E91 /* AESinkDARWINIOS.cpp */; }; F5CC22DF1814FF3B006B5E91 /* ActiveAE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5CC22D31814FF3B006B5E91 /* ActiveAE.cpp */; }; F5CC22E01814FF3B006B5E91 /* ActiveAEBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5CC22D51814FF3B006B5E91 /* ActiveAEBuffer.cpp */; }; F5CC22E21814FF3B006B5E91 /* ActiveAESink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5CC22D91814FF3B006B5E91 /* ActiveAESink.cpp */; }; @@ -3558,6 +3562,12 @@ DF34892913FD9C780026A711 /* AirPlayServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirPlayServer.h; sourceTree = "<group>"; }; DF34897A13FDAA270026A711 /* HttpParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpParser.h; sourceTree = "<group>"; }; DF34898113FDAAF60026A711 /* HttpParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpParser.cpp; sourceTree = "<group>"; }; + DF396ED51C42AC5100214C1A /* AESinkDARWINIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AESinkDARWINIOS.mm; path = Sinks/AESinkDARWINIOS.mm; sourceTree = "<group>"; }; + DF396ECC1C42A25F00214C1A /* DarwinNSUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DarwinNSUserDefaults.h; sourceTree = "<group>"; }; + DF396ECD1C42A25F00214C1A /* DarwinNSUserDefaults.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DarwinNSUserDefaults.mm; sourceTree = "<group>"; }; + DF396ECE1C42A25F00214C1A /* DictionaryUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryUtils.h; sourceTree = "<group>"; }; + DF396ECF1C42A25F00214C1A /* DictionaryUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DictionaryUtils.mm; sourceTree = "<group>"; }; + DF396ED01C42A25F00214C1A /* NSLogDebugHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSLogDebugHelpers.h; sourceTree = "<group>"; }; DF3C3D181752BED3000989C3 /* copyframeworks-ios.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "copyframeworks-ios.command"; sourceTree = "<group>"; }; DF3C3D191752BED3000989C3 /* copyframeworks-osx.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "copyframeworks-osx.command"; sourceTree = "<group>"; }; DF3C3D1B1752BED3000989C3 /* CopyRootFiles-ios.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "CopyRootFiles-ios.command"; sourceTree = "<group>"; }; @@ -3794,7 +3804,7 @@ DFD717521C0A031B0025D964 /* XBMCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMCController.h; sourceTree = "<group>"; }; DFD717531C0A031B0025D964 /* XBMCController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XBMCController.mm; sourceTree = "<group>"; }; DFD717541C0A031B0025D964 /* XBMCDebugHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XBMCDebugHelpers.h; sourceTree = "<group>"; }; - DFD717631C0A03540025D964 /* IOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "IOS-Info.plist"; sourceTree = "<group>"; }; + DFD717631C0A03540025D964 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; DFD882E517DD189E001516FE /* StringValidation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringValidation.cpp; sourceTree = "<group>"; }; DFD882E617DD189E001516FE /* StringValidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringValidation.h; sourceTree = "<group>"; }; DFD882F417DD1A5B001516FE /* AddonPythonInvoker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonPythonInvoker.cpp; path = python/AddonPythonInvoker.cpp; sourceTree = "<group>"; }; @@ -4730,7 +4740,6 @@ F5BDB8191202032400F0B710 /* DVDSubtitleTagMicroDVD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDSubtitleTagMicroDVD.cpp; sourceTree = "<group>"; }; F5CC22891814F7E9006B5E91 /* AESinkDARWINOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AESinkDARWINOSX.cpp; path = Sinks/AESinkDARWINOSX.cpp; sourceTree = "<group>"; }; F5CC228A1814F7E9006B5E91 /* AESinkDARWINOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AESinkDARWINOSX.h; path = Sinks/AESinkDARWINOSX.h; sourceTree = "<group>"; }; - F5CC228C1814F7F7006B5E91 /* AESinkDARWINIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AESinkDARWINIOS.cpp; path = Sinks/AESinkDARWINIOS.cpp; sourceTree = "<group>"; }; F5CC228D1814F7F7006B5E91 /* AESinkDARWINIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AESinkDARWINIOS.h; path = Sinks/AESinkDARWINIOS.h; sourceTree = "<group>"; }; F5CC22D31814FF3B006B5E91 /* ActiveAE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveAE.cpp; sourceTree = "<group>"; }; F5CC22D41814FF3B006B5E91 /* ActiveAE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveAE.h; sourceTree = "<group>"; }; @@ -7205,8 +7214,13 @@ DFD7173D1C0A031B0025D964 /* ios */, DFD7172F1C09FEC60025D964 /* AutoPool.h */, DFD717301C09FEC60025D964 /* AutoPool.mm */, + DF396ECC1C42A25F00214C1A /* DarwinNSUserDefaults.h */, + DF396ECD1C42A25F00214C1A /* DarwinNSUserDefaults.mm */, DFD717321C09FEC60025D964 /* DarwinUtils.h */, DFD717331C09FEC60025D964 /* DarwinUtils.mm */, + DF396ECE1C42A25F00214C1A /* DictionaryUtils.h */, + DF396ECF1C42A25F00214C1A /* DictionaryUtils.mm */, + DF396ED01C42A25F00214C1A /* NSLogDebugHelpers.h */, DFD717341C09FEC60025D964 /* OSXGNUReplacements.c */, DFD717351C09FEC60025D964 /* OSXGNUReplacements.h */, ); @@ -7216,7 +7230,7 @@ DFD7173D1C0A031B0025D964 /* ios */ = { isa = PBXGroup; children = ( - DFD717631C0A03540025D964 /* IOS-Info.plist */, + DFD717631C0A03540025D964 /* Info.plist */, DFD7173F1C0A031B0025D964 /* Default-568h@2x.png */, DFD717401C0A031B0025D964 /* Default-667h@2x.png */, DFD717411C0A031B0025D964 /* Default-736h@3x.png */, @@ -8719,7 +8733,7 @@ isa = PBXGroup; children = ( 7C8AE7FE189DE3A700C33786 /* osx */, - F5CC228C1814F7F7006B5E91 /* AESinkDARWINIOS.cpp */, + DF396ED51C42AC5100214C1A /* AESinkDARWINIOS.mm */, F5CC228D1814F7F7006B5E91 /* AESinkDARWINIOS.h */, F5CC22891814F7E9006B5E91 /* AESinkDARWINOSX.cpp */, F5CC228A1814F7E9006B5E91 /* AESinkDARWINOSX.h */, @@ -8948,7 +8962,7 @@ DFD717561C0A031B0025D964 /* Default-568h@2x.png in Resources */, 7CCDA1E4192753E30074CF51 /* RdrConnectionManagerSCPD.xml in Resources */, 7CCDA1EF192753E30074CF51 /* RenderingControlSCPD.xml in Resources */, - DFD717641C0A03540025D964 /* IOS-Info.plist in Resources */, + DFD717641C0A03540025D964 /* Info.plist in Resources */, 7CCDA1F1192753E30074CF51 /* RenderingControlSCPD_Full.xml in Resources */, DFD717581C0A031B0025D964 /* Default-736h@3x.png in Resources */, 391416BF1B4A3EFA00BBF0AA /* guiinfo in Resources */, @@ -9308,6 +9322,7 @@ E38E20A00D25F9FD00618676 /* GUIDialogVisualisationPresetList.cpp in Sources */, E38E20A20D25F9FD00618676 /* GUIDialogVolumeBar.cpp in Sources */, DF91E9401C0A29530011084D /* main.cpp in Sources */, + DF396ED31C42A25F00214C1A /* DictionaryUtils.mm in Sources */, E38E20A30D25F9FD00618676 /* GUIDialogYesNo.cpp in Sources */, E38E20A40D25F9FD00618676 /* GUILargeTextureManager.cpp in Sources */, E38E20A50D25F9FD00618676 /* GUIMediaWindow.cpp in Sources */, @@ -9558,6 +9573,7 @@ F599CD74108E6A7A0010EC2A /* DarwinStorageProvider.cpp in Sources */, E4A249F71095C880003D74C6 /* AutorunMediaJob.cpp in Sources */, F5A9D3091097C9370050490F /* AliasShortcutUtils.cpp in Sources */, + DF396ED11C42A25F00214C1A /* DarwinNSUserDefaults.mm in Sources */, 7CCA95BF1BC6E6670091D308 /* RendererVDA.cpp in Sources */, 431AE5DA109C1A63007428C3 /* OverlayRendererUtil.cpp in Sources */, 7C45DBE910F325C400D4BBF3 /* DAVDirectory.cpp in Sources */, @@ -10332,6 +10348,7 @@ E49911DC174E5D3700741B6D /* DVDFactoryInputStream.cpp in Sources */, E49911DD174E5D3700741B6D /* DVDInputStream.cpp in Sources */, E49911DE174E5D3700741B6D /* DVDInputStreamBluray.cpp in Sources */, + DF396ED21C42A25F00214C1A /* DarwinNSUserDefaults.mm in Sources */, E49911DF174E5D3700741B6D /* DVDInputStreamFFmpeg.cpp in Sources */, E49911E0174E5D3700741B6D /* DVDInputStreamFile.cpp in Sources */, E49911E2174E5D3700741B6D /* DVDInputStreamHttp.cpp in Sources */, @@ -10808,6 +10825,7 @@ E49913DF174E5F8D00741B6D /* PlayList.cpp in Sources */, E49913E0174E5F8D00741B6D /* PlayListB4S.cpp in Sources */, E49913E1174E5F8D00741B6D /* PlayListFactory.cpp in Sources */, + DF396ED41C42A25F00214C1A /* DictionaryUtils.mm in Sources */, E49913E2174E5F8D00741B6D /* PlayListM3U.cpp in Sources */, E49913E3174E5F8D00741B6D /* PlayListPLS.cpp in Sources */, E49913E4174E5F8D00741B6D /* PlayListURL.cpp in Sources */, @@ -11039,6 +11057,7 @@ E4991547174E642900741B6D /* ThumbLoader.cpp in Sources */, E4991548174E642900741B6D /* ThumbnailCache.cpp in Sources */, E4991549174E642900741B6D /* URL.cpp in Sources */, + DF396ED61C42AC5100214C1A /* AESinkDARWINIOS.mm in Sources */, E499154A174E642900741B6D /* Util.cpp in Sources */, E499154B174E642900741B6D /* XBApplicationEx.cpp in Sources */, E499154C174E642900741B6D /* XBDateTime.cpp in Sources */, @@ -11128,7 +11147,6 @@ 7C1409AA184015C9009F9411 /* InfoExpression.cpp in Sources */, AE4E87A717354C4A00D15206 /* XSLTUtils.cpp in Sources */, 7C15DCBD1892481400FCE564 /* InfoBool.cpp in Sources */, - F5CC228E1814F7F7006B5E91 /* AESinkDARWINIOS.cpp in Sources */, F5CC22DF1814FF3B006B5E91 /* ActiveAE.cpp in Sources */, F5CC22E01814FF3B006B5E91 /* ActiveAEBuffer.cpp in Sources */, F5CC22E21814FF3B006B5E91 /* ActiveAESink.cpp in Sources */, @@ -11494,7 +11512,7 @@ $XBMC_DEPENDS/include/python2.7, $XBMC_DEPENDS/include/libxml2, ); - INFOPLIST_FILE = "$(SRCROOT)/xbmc/platform/darwin/ios/IOS-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/xbmc/platform/darwin/ios/Info.plist"; INSTALL_PATH = "$(HOME)/Library/Bundles"; TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; @@ -11535,7 +11553,7 @@ $XBMC_DEPENDS/include/python2.7, $XBMC_DEPENDS/include/libxml2, ); - INFOPLIST_FILE = "$(SRCROOT)/xbmc/platform/darwin/ios/IOS-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/xbmc/platform/darwin/ios/Info.plist"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; diff --git a/configure.ac b/configure.ac index 8a4e2494ce..3b76b070a9 100644 --- a/configure.ac +++ b/configure.ac @@ -2415,7 +2415,7 @@ OUTPUT_FILES="Makefile \ tools/darwin/packaging/osx/mkdmg-osx.sh \ tools/darwin/packaging/migrate_to_kodi_ios.sh \ xbmc/platform/darwin/osx/Info.plist \ - xbmc/platform/darwin/ios/IOS-Info.plist \ + xbmc/platform/darwin/ios/Info.plist \ project/cmake/kodi-config.cmake \ project/cmake/xbmc-config.cmake \ tools/android/packaging/xbmc/AndroidManifest.xml \ diff --git a/docs/README.osx b/docs/README.osx index c42d411f7e..42f4e335ce 100644 --- a/docs/README.osx +++ b/docs/README.osx @@ -32,6 +32,7 @@ codecs that support a multitude of music and video formats. On Mavericks (OSX 10.9.x) we recommend using Xcode 6.1. On Yosemite (OSX 10.10.x) we recommend using Xcode 6.4. +On El Capitan (OSX 10.11.x) we recommend using Xcode 7.2. NOTE TO NEW OS X USERS: All lines that are prefixed with the '$' character are commands that need to be typed into a Terminal window. Note that the '$' @@ -67,7 +68,7 @@ constellations of Xcode and osx versions (to be updated once we know more): 3. XCode 6.2.0 against OSX SDK 10.10 (Y) 4. XCode 6.3.0 against OSX SDK 10.10 (Y) 5. Xcode 6.4.0 against OSX SDK 10.10 (Y) -6. Xcode 7.x against OSX SDK 10.11 (Y) +6. Xcode 7.x against OSX SDK 10.11 (EC) ----------------------------------------------------------------------------- 3.2 Install Kodi build depends @@ -175,7 +176,7 @@ Or the release version: You can also build via Xcode from the command-line using the following: - $ xcodebuild -configuration Release ONLY_ACTIVE_ARCH=YES ARCHS=i386 VALID_ARCHS=i386 \ + $ xcodebuild -configuration Release ONLY_ACTIVE_ARCH=YES ARCHS=x86_64 VALID_ARCHS=x86_64 \ -target "Kodi.app" -project Kodi.xcodeproj You can specify "Release" instead of "Debug" as a configuration. Be sure to set *_ARCHS diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 7d7b332c41..84545057c4 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -476,10 +476,7 @@ bool CApplication::Create() if (!CLog::Init(CSpecialProtocol::TranslatePath(g_advancedSettings.m_logFolder).c_str())) { - std::string lcAppName = CCompileInfo::GetAppName(); - StringUtils::ToLower(lcAppName); - fprintf(stderr,"Could not init logging classes. Permission errors on ~/.%s (%s)\n", lcAppName.c_str(), - CSpecialProtocol::TranslatePath(g_advancedSettings.m_logFolder).c_str()); + fprintf(stderr,"Could not init logging classes. Log folder error (%s)\n", CSpecialProtocol::TranslatePath(g_advancedSettings.m_logFolder).c_str()); return false; } @@ -571,7 +568,7 @@ bool CApplication::Create() CLog::Log(LOGNOTICE, "Local hostname: %s", hostname.c_str()); std::string lowerAppName = CCompileInfo::GetAppName(); StringUtils::ToLower(lowerAppName); - CLog::Log(LOGNOTICE, "Log File is located: %s%s.log", g_advancedSettings.m_logFolder.c_str(), lowerAppName.c_str()); + CLog::Log(LOGNOTICE, "Log File is located: %s/%s.log", g_advancedSettings.m_logFolder.c_str(), lowerAppName.c_str()); CRegExp::LogCheckUtf8Support(); CLog::Log(LOGNOTICE, "-----------------------------------------------------------------------"); @@ -1106,7 +1103,9 @@ bool CApplication::Initialize() StringUtils::Format(g_localizeStrings.Get(178).c_str(), g_sysinfo.GetAppName().c_str()), "special://xbmc/media/icon256x256.png", EventLevel::Basic))); +#if !defined(TARGET_DARWIN_IOS) g_peripherals.Initialise(); +#endif // Load curl so curl_global_init gets called before any service threads // are started. Unloading will have no effect as curl is never fully unloaded. @@ -3600,6 +3599,8 @@ void CApplication::OnPlayBackEnded() #endif #ifdef TARGET_ANDROID CXBMCApp::OnPlayBackEnded(); +#elif defined(TARGET_DARWIN_IOS) + CDarwinUtils::EnableOSScreenSaver(true); #endif CVariant data(CVariant::VariantTypeObject); @@ -3625,6 +3626,9 @@ void CApplication::OnPlayBackStarted() #endif #ifdef TARGET_ANDROID CXBMCApp::OnPlayBackStarted(); +#elif defined(TARGET_DARWIN_IOS) + if (m_pPlayer->IsPlayingVideo()) + CDarwinUtils::EnableOSScreenSaver(false); #endif CGUIMessage msg(GUI_MSG_PLAYBACK_STARTED, 0, 0); @@ -3662,6 +3666,8 @@ void CApplication::OnPlayBackStopped() #endif #ifdef TARGET_ANDROID CXBMCApp::OnPlayBackStopped(); +#elif defined(TARGET_DARWIN_IOS) + CDarwinUtils::EnableOSScreenSaver(true); #endif CVariant data(CVariant::VariantTypeObject); @@ -3679,6 +3685,8 @@ void CApplication::OnPlayBackPaused() #endif #ifdef TARGET_ANDROID CXBMCApp::OnPlayBackPaused(); +#elif defined(TARGET_DARWIN_IOS) + CDarwinUtils::EnableOSScreenSaver(true); #endif CVariant param; @@ -3694,6 +3702,9 @@ void CApplication::OnPlayBackResumed() #endif #ifdef TARGET_ANDROID CXBMCApp::OnPlayBackResumed(); +#elif defined(TARGET_DARWIN_IOS) + if (m_pPlayer->IsPlayingVideo()) + CDarwinUtils::EnableOSScreenSaver(false); #endif CVariant param; @@ -3886,6 +3897,9 @@ void CApplication::ResetSystemIdleTimer() { // reset system idle timer m_idleTimer.StartZero(); +#if defined(TARGET_DARWIN_IOS) + CDarwinUtils::ResetSystemIdleTimer(); +#endif } void CApplication::ResetScreenSaver() @@ -4495,8 +4509,9 @@ void CApplication::Process() m_slowTimer.Reset(); ProcessSlow(); } - +#if !defined(TARGET_DARWIN) g_cpuInfo.getUsedPercentage(); // must call it to recalculate pct values +#endif } // We get called every 500ms diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDARWINIOS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDARWINIOS.mm index 859542f2d5..c7a707dfcb 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkDARWINIOS.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkDARWINIOS.mm @@ -19,6 +19,8 @@ */ #include "cores/AudioEngine/Sinks/AESinkDARWINIOS.h" + +#define BOOL XBMC_BOOL #include "cores/AudioEngine/Utils/AEUtil.h" #include "cores/AudioEngine/Utils/AERingBuffer.h" #include "cores/AudioEngine/Sinks/osx/CoreAudioHelpers.h" @@ -27,6 +29,7 @@ #include "utils/StringUtils.h" #include "threads/Condition.h" #include "windowing/WindowingFactory.h" +#undef BOOL #include <sstream> #include <AudioToolbox/AudioToolbox.h> diff --git a/xbmc/filesystem/SFTPFile.cpp b/xbmc/filesystem/SFTPFile.cpp index fdfb1afabc..2438dbde8e 100644 --- a/xbmc/filesystem/SFTPFile.cpp +++ b/xbmc/filesystem/SFTPFile.cpp @@ -31,6 +31,11 @@ #pragma comment(lib, "ssh.lib") #endif +#if defined(TARGET_DARWIN_IOS) +#include "utils/StringUtils.h" +#include "platform/darwin/DarwinUtils.h" +#endif + #ifndef S_ISDIR #define S_ISDIR(m) ((m & _S_IFDIR) != 0) #endif @@ -378,7 +383,15 @@ bool CSFTPSession::Connect(const std::string &host, unsigned int port, const std CLog::Log(LOGERROR, "SFTPSession: Failed to set port '%d' for session", port); return false; } - +#if defined(TARGET_DARWIN_IOS) + std::string home = CDarwinUtils::GetUserHomeDirectory(); + std::string sshFolder = StringUtils::Format("%s/.ssh", home.c_str()); + if (ssh_options_set(m_session, SSH_OPTIONS_SSH_DIR, sshFolder.c_str()) < 0) + { + CLog::Log(LOGERROR, "SFTPSession: Failed to set .ssh folder to '%s' for session", sshFolder.c_str()); + return false; + } +#endif ssh_options_set(m_session, SSH_OPTIONS_LOG_VERBOSITY, 0); ssh_options_set(m_session, SSH_OPTIONS_TIMEOUT, &timeout); #else diff --git a/xbmc/filesystem/SMBFile.cpp b/xbmc/filesystem/SMBFile.cpp index b4db511121..566aaf597a 100644 --- a/xbmc/filesystem/SMBFile.cpp +++ b/xbmc/filesystem/SMBFile.cpp @@ -27,12 +27,14 @@ #include "PasswordManager.h" #include "SMBDirectory.h" #include <libsmbclient.h> +#include "filesystem/SpecialProtocol.h" #include "settings/AdvancedSettings.h" #include "settings/Settings.h" #include "threads/SingleLock.h" #include "utils/log.h" #include "Util.h" #include "utils/StringUtils.h" +#include "utils/URIUtils.h" #include "utils/TimeUtils.h" #include "commons/Exception.h" @@ -97,10 +99,11 @@ void CSMB::Init() // http://us1.samba.org/samba/docs/man/manpages-3/libsmbclient.7.html // http://us1.samba.org/samba/docs/man/manpages-3/smb.conf.5.html char smb_conf[MAX_PATH]; - snprintf(smb_conf, sizeof(smb_conf), "%s/.smb", getenv("HOME")); + std::string home = CSpecialProtocol::TranslatePath("special://home"); + URIUtils::RemoveSlashAtEnd(home); if (mkdir(smb_conf, 0755) == 0) { - snprintf(smb_conf, sizeof(smb_conf), "%s/.smb/smb.conf", getenv("HOME")); + snprintf(smb_conf, sizeof(smb_conf), "%s/.smb/smb.conf", home.c_str()); FILE* f = fopen(smb_conf, "w"); if (f != NULL) { @@ -116,7 +119,7 @@ void CSMB::Init() fprintf(f, "\tlanman auth = yes\n"); fprintf(f, "\tsocket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536\n"); - fprintf(f, "\tlock directory = %s/.smb/\n", getenv("HOME")); + fprintf(f, "\tlock directory = %s/.smb/\n", home.c_str()); // set wins server if there's one. name resolve order defaults to 'lmhosts host wins bcast'. // if no WINS server has been specified the wins method will be ignored. diff --git a/xbmc/filesystem/posix/PosixDirectory.cpp b/xbmc/filesystem/posix/PosixDirectory.cpp index 979861716e..f23037d20e 100644 --- a/xbmc/filesystem/posix/PosixDirectory.cpp +++ b/xbmc/filesystem/posix/PosixDirectory.cpp @@ -44,7 +44,7 @@ bool CPosixDirectory::GetDirectory(const CURL& url, CFileItemList &items) { std::string root = url.Get(); - if (IsAliasShortcut(root)) + if (IsAliasShortcut(root, true)) TranslateAliasShortcut(root); DIR *dir = opendir(root.c_str()); @@ -133,7 +133,7 @@ bool CPosixDirectory::Exists(const CURL& url) { std::string path = url.Get(); - if (IsAliasShortcut(path)) + if (IsAliasShortcut(path, true)) TranslateAliasShortcut(path); struct stat buffer; diff --git a/xbmc/filesystem/posix/PosixFile.cpp b/xbmc/filesystem/posix/PosixFile.cpp index 567b8af474..11a3d57ee1 100644 --- a/xbmc/filesystem/posix/PosixFile.cpp +++ b/xbmc/filesystem/posix/PosixFile.cpp @@ -56,7 +56,7 @@ CPosixFile::~CPosixFile() static std::string getFilename(const CURL& url) { std::string filename(url.GetFileName()); - if (IsAliasShortcut(filename)) + if (IsAliasShortcut(filename, false)) TranslateAliasShortcut(filename); return filename; diff --git a/xbmc/linux/XFileUtils.cpp b/xbmc/linux/XFileUtils.cpp index 74243fc42d..84f06aeeb4 100644 --- a/xbmc/linux/XFileUtils.cpp +++ b/xbmc/linux/XFileUtils.cpp @@ -60,7 +60,7 @@ HANDLE FindFirstFile(LPCSTR szPath,LPWIN32_FIND_DATA lpFindData) std::string strPath(szPath); - if (IsAliasShortcut(strPath)) + if (IsAliasShortcut(strPath, false)) TranslateAliasShortcut(strPath); if (strPath.empty()) @@ -150,7 +150,7 @@ BOOL FindNextFile(HANDLE hHandle, LPWIN32_FIND_DATA lpFindData) std::string strFileName = hHandle->m_FindFileResults[hHandle->m_nFindFileIterator++]; std::string strFileNameTest = hHandle->m_FindFileDir + strFileName; - if (IsAliasShortcut(strFileNameTest)) + if (IsAliasShortcut(strFileNameTest, false)) TranslateAliasShortcut(strFileNameTest); struct stat64 fileStat; diff --git a/xbmc/platform/Makefile.in b/xbmc/platform/Makefile.in index e70ca60b15..9d2961da8c 100644 --- a/xbmc/platform/Makefile.in +++ b/xbmc/platform/Makefile.in @@ -7,6 +7,8 @@ SRCS += XbmcContext.cpp ifeq ($(findstring osx,@ARCH@), osx) SRCS += darwin/AutoPool.mm SRCS += darwin/DarwinUtils.mm +SRCS += darwin/DictionaryUtils.mm +SRCS += darwin/DarwinNSUserDefaults.mm SRCS += darwin/osx/HotKeyController.m SRCS += darwin/OSXGNUReplacements.c SRCS += darwin/osx/OSXTextInputResponder.mm diff --git a/xbmc/platform/darwin/DarwinNSUserDefaults.h b/xbmc/platform/darwin/DarwinNSUserDefaults.h new file mode 100644 index 0000000000..6e23cc483f --- /dev/null +++ b/xbmc/platform/darwin/DarwinNSUserDefaults.h @@ -0,0 +1,39 @@ +#pragma once +/* + * Copyright (C) 2015 Team MrMC + * https://github.com/MrMC + * + * 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 MrMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include <string> + +class CDarwinNSUserDefaults +{ +public: + static bool Synchronize(); + + static bool GetKey(const std::string &key, std::string &value); + static bool SetKey(const std::string &key, const std::string &value, bool synchronize); + static bool DeleteKey(const std::string &key, bool synchronize); + static bool KeyExists(const std::string &key); + + static bool IsKeyFromPath(const std::string &key); + static bool GetKeyFromPath(const std::string &path, std::string &value); + static bool SetKeyFromPath(const std::string &path, const std::string &value, bool synchronize); + static bool DeleteKeyFromPath(const std::string &path, bool synchronize); + static bool KeyFromPathExists(const std::string &key); +}; diff --git a/xbmc/platform/darwin/DarwinNSUserDefaults.mm b/xbmc/platform/darwin/DarwinNSUserDefaults.mm new file mode 100644 index 0000000000..140ae14395 --- /dev/null +++ b/xbmc/platform/darwin/DarwinNSUserDefaults.mm @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2015 Team MrMC + * https://github.com/MrMC + * + * 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 MrMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#import "platform/darwin/DarwinNSUserDefaults.h" +#import "filesystem/SpecialProtocol.h" +#import "utils/log.h" + +#import <Foundation/NSString.h> +#import <Foundation/NSUserDefaults.h> + + +static bool translatePathIntoKey(const std::string &path, std::string &key) +{ + size_t pos; + std::string translated_key = CSpecialProtocol::TranslatePath(path); + if ((pos = translated_key.find("Caches/userdata")) != std::string::npos) + { + key = translated_key.erase(0, pos); + return true; + } + + return false; +} + +bool CDarwinNSUserDefaults::Synchronize() +{ + return [[NSUserDefaults standardUserDefaults] synchronize] == YES; +} + +bool CDarwinNSUserDefaults::GetKey(const std::string &key, std::string &value) +{ + if (!key.empty()) + { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *nsstring_key = [NSString stringWithUTF8String: key.c_str()]; + NSString *nsstring_value = [defaults stringForKey:nsstring_key]; + if (nsstring_value) + { + value = [nsstring_value UTF8String]; + if (!value.empty()) + return true; + } + } + + return false; +} + +bool CDarwinNSUserDefaults::SetKey(const std::string &key, const std::string &value, bool synchronize) +{ + if (!key.empty() && !value.empty()) + { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + NSString *nsstring_key = [NSString stringWithUTF8String: key.c_str()]; + NSString *nsstring_value = [NSString stringWithUTF8String: value.c_str()]; + + [defaults setObject:nsstring_value forKey:nsstring_key]; + if (synchronize) + return [defaults synchronize] == YES; + else + return true; + } + + return false; +} + +bool CDarwinNSUserDefaults::DeleteKey(const std::string &key, bool synchronize) +{ + if (!key.empty()) + { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *nsstring_key = [NSString stringWithUTF8String: key.c_str()]; + [defaults removeObjectForKey:nsstring_key]; + if (synchronize) + return [defaults synchronize] == YES; + else + return true; + } + + return false; +} + +bool CDarwinNSUserDefaults::KeyExists(const std::string &key) +{ + if (!key.empty()) + { + NSString *nsstring_key = [NSString stringWithUTF8String: key.c_str()]; + if ([[NSUserDefaults standardUserDefaults] objectForKey:nsstring_key]) + return true; + } + + return false; +} + +bool CDarwinNSUserDefaults::IsKeyFromPath(const std::string &path) +{ + std::string translated_key; + if (translatePathIntoKey(path, translated_key) && !translated_key.empty()) + { + CLog::Log(LOGDEBUG, "found key %s", translated_key.c_str()); + return true; + } + + return false; +} + +bool CDarwinNSUserDefaults::GetKeyFromPath(const std::string &path, std::string &value) +{ + std::string translated_key; + if (translatePathIntoKey(path, translated_key) && !translated_key.empty()) + return CDarwinNSUserDefaults::GetKey(translated_key, value); + + return false; +} + +bool CDarwinNSUserDefaults::SetKeyFromPath(const std::string &path, const std::string &value, bool synchronize) +{ + std::string translated_key; + if (translatePathIntoKey(path, translated_key) && !translated_key.empty() && !value.empty()) + return CDarwinNSUserDefaults::SetKey(translated_key, value, synchronize); + + return false; +} + +bool CDarwinNSUserDefaults::DeleteKeyFromPath(const std::string &path, bool synchronize) +{ + std::string translated_key; + if (translatePathIntoKey(path, translated_key) && !translated_key.empty()) + return CDarwinNSUserDefaults::DeleteKey(translated_key, synchronize); + + return false; +} + +bool CDarwinNSUserDefaults::KeyFromPathExists(const std::string &path) +{ + std::string translated_key; + if (translatePathIntoKey(path, translated_key) && !translated_key.empty()) + return CDarwinNSUserDefaults::KeyExists(translated_key); + + return false; +} diff --git a/xbmc/platform/darwin/DarwinUtils.h b/xbmc/platform/darwin/DarwinUtils.h index 857f83deb4..1667158776 100644 --- a/xbmc/platform/darwin/DarwinUtils.h +++ b/xbmc/platform/darwin/DarwinUtils.h @@ -42,16 +42,19 @@ public: static const char *GetOSXVersionString(void); static int GetFrameworkPath(bool forPython, char* path, size_t *pathsize); static int GetExecutablePath(char* path, size_t *pathsize); + static const char *GetUserHomeDirectory(void); static const char *GetAppRootFolder(void); static bool IsIosSandboxed(void); static bool HasVideoToolboxDecoder(void); static int BatteryLevel(void); + static void EnableOSScreenSaver(bool enable); + static void ResetSystemIdleTimer(); static void SetScheduling(int message); static void PrintDebugString(std::string debugString); static bool CFStringRefToString(CFStringRef source, std::string& destination); static bool CFStringRefToUTF8String(CFStringRef source, std::string& destination); static const std::string& GetManufacturer(void); - static bool IsAliasShortcut(const std::string& path); + static bool IsAliasShortcut(const std::string& path, bool isdirectory); static void TranslateAliasShortcut(std::string& path); static bool CreateAliasShortcut(const std::string& fromPath, const std::string& toPath); }; diff --git a/xbmc/platform/darwin/DarwinUtils.mm b/xbmc/platform/darwin/DarwinUtils.mm index 9d29905cc9..4fe0ec26b3 100644 --- a/xbmc/platform/darwin/DarwinUtils.mm +++ b/xbmc/platform/darwin/DarwinUtils.mm @@ -24,6 +24,7 @@ #include "DllPaths.h" #include "GUIUserMessages.h" #include "utils/log.h" +#include "utils/URIUtils.h" #include "CompileInfo.h" #undef BOOL @@ -396,6 +397,22 @@ int CDarwinUtils::GetExecutablePath(char* path, size_t *pathsize) return 0; } +const char* CDarwinUtils::GetUserHomeDirectory(void) +{ + static std::string appHomeFolder; + if (appHomeFolder.empty()) + { +#if defined(TARGET_DARWIN_IOS) + appHomeFolder = URIUtils::AddFileToFolder(CDarwinUtils::GetAppRootFolder(), CCompileInfo::GetAppName()); +#else + appHomeFolder = URIUtils::AddFileToFolder(getenv("HOME"), "Library/Application Support"); + appHomeFolder = URIUtils::AddFileToFolder(appHomeFolder, CCompileInfo::GetAppName()); +#endif + } + + return appHomeFolder.c_str(); +} + const char* CDarwinUtils::GetAppRootFolder(void) { static std::string rootFolder = ""; @@ -523,6 +540,16 @@ int CDarwinUtils::BatteryLevel(void) return batteryLevel * 100; } +void CDarwinUtils::EnableOSScreenSaver(bool enable) +{ + +} + +void CDarwinUtils::ResetSystemIdleTimer() +{ + +} + void CDarwinUtils::SetScheduling(int message) { int policy; @@ -629,12 +656,26 @@ const std::string& CDarwinUtils::GetManufacturer(void) return manufName; } -bool CDarwinUtils::IsAliasShortcut(const std::string& path) +bool CDarwinUtils::IsAliasShortcut(const std::string& path, bool isdirectory) { bool ret = false; #if defined(TARGET_DARWIN_OSX) - NSString *nsPath = [NSString stringWithUTF8String:path.c_str()]; - NSURL *nsUrl = [NSURL fileURLWithPath:nsPath]; + CCocoaAutoPool pool; + + NSURL *nsUrl; + if (isdirectory) + { + std::string cleanpath = path; + URIUtils::RemoveSlashAtEnd(cleanpath); + NSString *nsPath = [NSString stringWithUTF8String:cleanpath.c_str()]; + nsUrl = [NSURL fileURLWithPath:nsPath isDirectory:TRUE]; + } + else + { + NSString *nsPath = [NSString stringWithUTF8String:path.c_str()]; + nsUrl = [NSURL fileURLWithPath:nsPath isDirectory:FALSE]; + } + NSNumber* wasAliased = nil; if (nsUrl != nil) diff --git a/xbmc/platform/darwin/DictionaryUtils.h b/xbmc/platform/darwin/DictionaryUtils.h new file mode 100644 index 0000000000..f86516a6a3 --- /dev/null +++ b/xbmc/platform/darwin/DictionaryUtils.h @@ -0,0 +1,36 @@ +#pragma once + +/* + * Copyright (C) 2015 Team MrMC + * https://github.com/MrMC + * + * 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 MrMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#import <CoreFoundation/CFNumber.h> +#import <CoreFoundation/CFDictionary.h> + +Boolean GetDictionaryBoolean(CFDictionaryRef theDict, const void* key); +long GetDictionaryLong(CFDictionaryRef theDict, const void* key); +int GetDictionaryInt(CFDictionaryRef theDict, const void* key); +float GetDictionaryFloat(CFDictionaryRef theDict, const void* key); +double GetDictionaryDouble(CFDictionaryRef theDict, const void* key); + +void CFDictionarySetSInt32(CFMutableDictionaryRef dictionary, CFStringRef key, SInt32 numberSInt32); +void CFDictionarySetDouble(CFMutableDictionaryRef dictionary, CFStringRef key, double numberDouble); +void CFMutableDictionarySetData(CFMutableDictionaryRef dict, CFStringRef key, const uint8_t *value, int length); +void CFMutableDictionarySetObject(CFMutableDictionaryRef dict, CFStringRef key, CFTypeRef *value); +void CFMutableDictionarySetString(CFMutableDictionaryRef dict, CFStringRef key, const char *value); diff --git a/xbmc/platform/darwin/DictionaryUtils.mm b/xbmc/platform/darwin/DictionaryUtils.mm new file mode 100644 index 0000000000..8319206328 --- /dev/null +++ b/xbmc/platform/darwin/DictionaryUtils.mm @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2015 Team MrMC + * https://github.com/MrMC + * + * 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 MrMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#import <CoreFoundation/CFString.h> +#import "platform/darwin/DictionaryUtils.h" + + +//------------------------------------------------------------------------------------------ +Boolean GetDictionaryBoolean(CFDictionaryRef theDict, const void* key) +{ + // get a boolean from the dictionary + Boolean value = false; + CFBooleanRef boolRef; + boolRef = (CFBooleanRef)CFDictionaryGetValue(theDict, key); + if (boolRef != NULL) + value = CFBooleanGetValue(boolRef); + return value; +} +//------------------------------------------------------------------------------------------ +long GetDictionaryLong(CFDictionaryRef theDict, const void* key) +{ + // get a long from the dictionary + long value = 0; + CFNumberRef numRef; + numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); + if (numRef != NULL) + CFNumberGetValue(numRef, kCFNumberLongType, &value); + return value; +} +//------------------------------------------------------------------------------------------ +int GetDictionaryInt(CFDictionaryRef theDict, const void* key) +{ + // get a long from the dictionary + int value = 0; + CFNumberRef numRef; + numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); + if (numRef != NULL) + CFNumberGetValue(numRef, kCFNumberIntType, &value); + return value; +} +//------------------------------------------------------------------------------------------ +float GetDictionaryFloat(CFDictionaryRef theDict, const void* key) +{ + // get a long from the dictionary + int value = 0; + CFNumberRef numRef; + numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); + if (numRef != NULL) + CFNumberGetValue(numRef, kCFNumberFloatType, &value); + return value; +} +//------------------------------------------------------------------------------------------ +double GetDictionaryDouble(CFDictionaryRef theDict, const void* key) +{ + // get a long from the dictionary + double value = 0.0; + CFNumberRef numRef; + numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); + if (numRef != NULL) + CFNumberGetValue(numRef, kCFNumberDoubleType, &value); + return value; +} +//------------------------------------------------------------------------------------------ +void CFDictionarySetSInt32(CFMutableDictionaryRef dictionary, CFStringRef key, SInt32 numberSInt32) +{ + CFNumberRef number; + + number = CFNumberCreate(NULL, kCFNumberSInt32Type, &numberSInt32); + CFDictionarySetValue(dictionary, key, number); + CFRelease(number); +} +//------------------------------------------------------------------------------------------ +// helper function that inserts an double into a dictionary +void CFDictionarySetDouble(CFMutableDictionaryRef dictionary, CFStringRef key, double numberDouble) +{ + CFNumberRef number; + + number = CFNumberCreate(NULL, kCFNumberDoubleType, &numberDouble); + CFDictionaryAddValue(dictionary, key, number); + CFRelease(number); +} + +void CFMutableDictionarySetData(CFMutableDictionaryRef dict, CFStringRef key, const uint8_t *value, int length) +{ + CFDataRef data = CFDataCreate(NULL, value, length); + CFDictionarySetValue(dict, key, data); + CFRelease(data); +} + +void CFMutableDictionarySetObject(CFMutableDictionaryRef dict, CFStringRef key, CFTypeRef *value) +{ + CFDictionarySetValue(dict, key, value); + CFRelease(value); +} + +void CFMutableDictionarySetString(CFMutableDictionaryRef dict, CFStringRef key, const char *value) +{ + CFStringRef string = CFStringCreateWithCString(NULL, value, kCFStringEncodingASCII); + CFDictionarySetValue(dict, key, string); + CFRelease(string); +} diff --git a/xbmc/platform/darwin/NSLogDebugHelpers.h b/xbmc/platform/darwin/NSLogDebugHelpers.h new file mode 100644 index 0000000000..6a43ee12d7 --- /dev/null +++ b/xbmc/platform/darwin/NSLogDebugHelpers.h @@ -0,0 +1,46 @@ + /* + * NSLogDebugHelpers.h + * xbmclauncher + * + * Created by Stephan Diederich on 21.09.08. + * Copyright 2008 University Heidelberg. All rights reserved. + * + * Copyright (C) 2008-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/>. + * + * Stuff below was taken from LoggingUtils.h of ATVFiles + * + * Just some utility macros for logging... + * + * Created by Eric Steil III on 4/1/07. + * Copyright (C) 2007-2008 Eric Steil III + * + */ +#define DEBUG +#ifdef DEBUG +#define LOG(s, ...) NSLog(@"[DEBUG] " s, ##__VA_ARGS__) +#define ILOG(s, ...) NSLog(@"[INFO] " s, ##__VA_ARGS__) +#define ELOG(s, ...) NSLog(@"[ERROR] " s, ##__VA_ARGS__) +#define DLOG(s, ...) LOG(s, ##__VA_ARGS__) +#else +#define LOG(s, ...) +#define ILOG(s, ...) NSLog(@"[INFO] " s, ##__VA_ARGS__) +#define ELOG(s, ...) NSLog(@"[ERROR] " s, ##__VA_ARGS__) +#define DLOG(s, ...) LOG(s, ##__VA_ARGS__) +#endif + +#define PRINT_SIGNATURE() LOG(@"%s", __PRETTY_FUNCTION__) diff --git a/xbmc/platform/darwin/ios/.gitignore b/xbmc/platform/darwin/ios/.gitignore index 445dd98e6c..0f51b93689 100644 --- a/xbmc/platform/darwin/ios/.gitignore +++ b/xbmc/platform/darwin/ios/.gitignore @@ -1,2 +1,2 @@ -IOS-Info.plist +Info.plist diff --git a/xbmc/platform/darwin/ios/IOS-Info.plist.in b/xbmc/platform/darwin/ios/Info.plist.in index a7909d83ee..a7909d83ee 100644 --- a/xbmc/platform/darwin/ios/IOS-Info.plist.in +++ b/xbmc/platform/darwin/ios/Info.plist.in diff --git a/xbmc/platform/darwin/osx/.gitignore b/xbmc/platform/darwin/osx/.gitignore index 4e432c2326..dcbc96dcdc 100644 --- a/xbmc/platform/darwin/osx/.gitignore +++ b/xbmc/platform/darwin/osx/.gitignore @@ -1 +1,2 @@ Info.plist +Makefile diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index b7e2929aba..669c3a1821 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -194,11 +194,35 @@ void CAdvancedSettings::Initialize() m_videoCleanStringRegExps.push_back("[ _\\,\\.\\(\\)\\[\\]\\-](ac3|dts|custom|dc|remastered|divx|divx5|dsr|dsrip|dutch|dvd|dvd5|dvd9|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|r3|r5|bd5|se|svcd|swedish|german|read.nfo|nfofix|unrated|extended|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|3d|hrhd|hrhdtv|hddvd|bluray|x264|h264|xvid|xvidvd|xxx|www.www|cd[1-9]|\\[.*\\])([ _\\,\\.\\(\\)\\[\\]\\-]|$)"); m_videoCleanStringRegExps.push_back("(\\[.*\\])"); + // this vector will be inserted at the end to + // m_moviesExcludeFromScanRegExps, m_tvshowExcludeFromScanRegExps and + // m_audioExcludeFromScanRegExps + m_allExcludeFromScanRegExps.clear(); + m_allExcludeFromScanRegExps.push_back(".+\\.ite$"); // ignore itunes extras dir + m_allExcludeFromScanRegExps.push_back("[\\/]\\.\\_"); + m_allExcludeFromScanRegExps.push_back("\\.DS_Store"); + m_allExcludeFromScanRegExps.push_back("\\.AppleDouble"); + m_moviesExcludeFromScanRegExps.clear(); m_moviesExcludeFromScanRegExps.push_back("-trailer"); m_moviesExcludeFromScanRegExps.push_back("[!-._ \\\\/]sample[-._ \\\\/]"); m_moviesExcludeFromScanRegExps.push_back("[\\/](proof|subs)[\\/]"); + m_moviesExcludeFromScanRegExps.insert(m_moviesExcludeFromScanRegExps.end(), + m_allExcludeFromScanRegExps.begin(), + m_allExcludeFromScanRegExps.end()); + + + m_tvshowExcludeFromScanRegExps.clear(); m_tvshowExcludeFromScanRegExps.push_back("[!-._ \\\\/]sample[-._ \\\\/]"); + m_tvshowExcludeFromScanRegExps.insert(m_tvshowExcludeFromScanRegExps.end(), + m_allExcludeFromScanRegExps.begin(), + m_allExcludeFromScanRegExps.end()); + + + m_audioExcludeFromScanRegExps.clear(); + m_tvshowExcludeFromScanRegExps.insert(m_tvshowExcludeFromScanRegExps.end(), + m_allExcludeFromScanRegExps.begin(), + m_allExcludeFromScanRegExps.end()); m_folderStackRegExps.clear(); m_folderStackRegExps.push_back("((cd|dvd|dis[ck])[0-9]+)$"); @@ -299,7 +323,11 @@ void CAdvancedSettings::Initialize() m_curlDisableIPV6 = false; //Certain hardware/OS combinations have trouble //with ipv6. +#if defined(TARGET_DARWIN_IOS) + m_startFullScreen = true; +#else m_startFullScreen = false; +#endif m_showExitButton = true; m_splashImage = true; @@ -347,7 +375,11 @@ void CAdvancedSettings::Initialize() m_enableMultimediaKeys = false; +#if defined(TARGET_DARWIN_IOS) + m_canWindowed = false; +#else m_canWindowed = true; +#endif m_guiVisualizeDirtyRegions = false; m_guiAlgorithmDirtyRegions = 3; m_guiDirtyRegionNoFlipTimeout = 0; @@ -380,9 +412,9 @@ void CAdvancedSettings::Initialize() #if defined(TARGET_DARWIN) std::string logDir = getenv("HOME"); #if defined(TARGET_DARWIN_OSX) - logDir += "/Library/Logs/"; + logDir += "/Library/Logs/"; #else // ios - logDir += "/" + std::string(CDarwinUtils::GetAppRootFolder()) + "/"; + logDir += "/" + std::string(CDarwinUtils::GetAppRootFolder()) + "/"; #endif m_logFolder = logDir; #else @@ -1133,6 +1165,7 @@ void CAdvancedSettings::Clear() m_videoExcludeFromListingRegExps.clear(); m_videoStackRegExps.clear(); m_folderStackRegExps.clear(); + m_allExcludeFromScanRegExps.clear(); m_audioExcludeFromScanRegExps.clear(); m_audioExcludeFromListingRegExps.clear(); m_pictureExcludeFromListingRegExps.clear(); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index 6d18af26c0..cd129fb84b 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -213,6 +213,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler std::string m_videoCleanDateTimeRegExp; std::vector<std::string> m_videoCleanStringRegExps; std::vector<std::string> m_videoExcludeFromListingRegExps; + std::vector<std::string> m_allExcludeFromScanRegExps; std::vector<std::string> m_moviesExcludeFromScanRegExps; std::vector<std::string> m_tvshowExcludeFromScanRegExps; std::vector<std::string> m_audioExcludeFromListingRegExps; diff --git a/xbmc/utils/AliasShortcutUtils.cpp b/xbmc/utils/AliasShortcutUtils.cpp index 850ae18637..ef96f70a6a 100644 --- a/xbmc/utils/AliasShortcutUtils.cpp +++ b/xbmc/utils/AliasShortcutUtils.cpp @@ -27,7 +27,7 @@ #include "AliasShortcutUtils.h" -bool IsAliasShortcut(const std::string& path) +bool IsAliasShortcut(const std::string& path, bool isdirectory) { bool rtn = false; @@ -36,7 +36,7 @@ bool IsAliasShortcut(const std::string& path) // reported as an alias when clearly, they are not. Trap them out. if (!URIUtils::HasExtension(path, ".alias"))// TODO - check if this is still needed with the new API { - rtn = CDarwinUtils::IsAliasShortcut(path); + rtn = CDarwinUtils::IsAliasShortcut(path, isdirectory); } #elif defined(TARGET_POSIX) // Linux does not use alias or shortcut methods diff --git a/xbmc/utils/AliasShortcutUtils.h b/xbmc/utils/AliasShortcutUtils.h index 73b50834f5..83baa747a3 100644 --- a/xbmc/utils/AliasShortcutUtils.h +++ b/xbmc/utils/AliasShortcutUtils.h @@ -21,5 +21,5 @@ #include <string> -bool IsAliasShortcut(const std::string& path); +bool IsAliasShortcut(const std::string& path, bool isdirectory); void TranslateAliasShortcut(std::string &path); diff --git a/xbmc/utils/Variant.cpp b/xbmc/utils/Variant.cpp index 8d887cb7bc..1c5c500677 100644 --- a/xbmc/utils/Variant.cpp +++ b/xbmc/utils/Variant.cpp @@ -32,10 +32,12 @@ #define wcstoll _wcstoi64 #define wcstoull _wcstoui64 #else // TARGET_WINDOWS +#if !defined(TARGET_DARWIN) #define strtoll(str, endptr, base) (int64_t)strtod(str, endptr) #define strtoull(str, endptr, base) (uint64_t)strtod(str, endptr) #define wcstoll(str, endptr, base) (int64_t)wcstod(str, endptr) #define wcstoull(str, endptr, base) (uint64_t)wcstod(str, endptr) +#endif #endif // TARGET_WINDOWS #endif // strtoll diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm index d3aacac9a7..f3778ae2de 100644 --- a/xbmc/windowing/osx/WinSystemOSX.mm +++ b/xbmc/windowing/osx/WinSystemOSX.mm @@ -40,6 +40,7 @@ #include "platform/darwin/osx/XBMCHelper.h" #include "utils/SystemInfo.h" #include "platform/darwin/osx/CocoaInterface.h" +#include "platform/darwin/DictionaryUtils.h" #include "platform/darwin/DarwinUtils.h" #undef BOOL @@ -200,63 +201,6 @@ CRect CGRectToCRect(CGRect cgrect) cgrect.origin.y + cgrect.size.height); return crect; } - -//------------------------------------------------------------------------------------------ -Boolean GetDictionaryBoolean(CFDictionaryRef theDict, const void* key) -{ - // get a boolean from the dictionary - Boolean value = false; - CFBooleanRef boolRef; - boolRef = (CFBooleanRef)CFDictionaryGetValue(theDict, key); - if (boolRef != NULL) - value = CFBooleanGetValue(boolRef); - return value; -} -//------------------------------------------------------------------------------------------ -long GetDictionaryLong(CFDictionaryRef theDict, const void* key) -{ - // get a long from the dictionary - long value = 0; - CFNumberRef numRef; - numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); - if (numRef != NULL) - CFNumberGetValue(numRef, kCFNumberLongType, &value); - return value; -} -//------------------------------------------------------------------------------------------ -int GetDictionaryInt(CFDictionaryRef theDict, const void* key) -{ - // get a long from the dictionary - int value = 0; - CFNumberRef numRef; - numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); - if (numRef != NULL) - CFNumberGetValue(numRef, kCFNumberIntType, &value); - return value; -} -//------------------------------------------------------------------------------------------ -float GetDictionaryFloat(CFDictionaryRef theDict, const void* key) -{ - // get a long from the dictionary - int value = 0; - CFNumberRef numRef; - numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); - if (numRef != NULL) - CFNumberGetValue(numRef, kCFNumberFloatType, &value); - return value; -} -//------------------------------------------------------------------------------------------ -double GetDictionaryDouble(CFDictionaryRef theDict, const void* key) -{ - // get a long from the dictionary - double value = 0.0; - CFNumberRef numRef; - numRef = (CFNumberRef)CFDictionaryGetValue(theDict, key); - if (numRef != NULL) - CFNumberGetValue(numRef, kCFNumberDoubleType, &value); - return value; -} - //--------------------------------------------------------------------------------- void SetMenuBarVisible(bool visible) { |