Merge pull request #3344 from davilla/amcodec-guisettings
authordavilla <davilla@xbmc.org>
Tue, 1 Oct 2013 00:27:57 +0000 (17:27 -0700)
committerdavilla <davilla@xbmc.org>
Tue, 1 Oct 2013 00:27:57 +0000 (17:27 -0700)
changed, add a proper GUI selector for AMLogic video decoder, refactor AMLogic bits in AESinkAUDIOTRACK

124 files changed:
addons/script.module.pysqlite/addon.xml [deleted file]
addons/script.module.pysqlite/lib/pysqlite2/__init__.py [deleted file]
addons/skin.confluence/720p/MyWeather.xml
addons/skin.confluence/sounds/sounds.xml
addons/xbmc.addon/addon.xml
addons/xbmc.gui/addon.xml
addons/xbmc.json/addon.xml
addons/xbmc.python/addon.xml
configure.in
lib/ffmpeg/libswresample/rematrix.c
lib/ffmpeg/libswresample/swresample.c
lib/ffmpeg/libswresample/swresample_internal.h
lib/ffmpeg/libswresample/version.h
lib/ffmpeg/patches/0057-backport-swresample-Make-rematrix-maxvalue-user-settable.patch [new file with mode: 0644]
project/BuildDependencies/scripts/0_package.list
project/Win32BuildSetup/tools/7z/7-zip.chm
project/Win32BuildSetup/tools/7z/7za.exe
project/Win32BuildSetup/tools/7z/License.txt
project/Win32BuildSetup/tools/7z/copying.txt [deleted file]
project/Win32BuildSetup/tools/7z/readme.txt
system/asound.conf [deleted file]
tools/android/packaging/xbmc/AndroidManifest.xml
tools/arm/arm-scripts/create-pkgsfile.sh [deleted file]
tools/arm/arm-scripts/create-xbmcfile.sh [deleted file]
tools/arm/arm-scripts/install-gcc4.5_armel.sh [deleted file]
tools/arm/arm-scripts/install-pkgs.sh [deleted file]
tools/arm/arm-scripts/pkg-paths.txt [deleted file]
tools/buildbot/darwin-depends-check [deleted file]
tools/buildbot/gitrev-posix [deleted file]
tools/darwin/packaging/xbmc-atv2/mkdeb-xbmc-atv2.sh
tools/darwin/packaging/xbmc-ios/mkdeb-xbmc-ios.sh
tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh
tools/win32buildtools/nasmw.exe [deleted file]
xbmc/Application.cpp
xbmc/FileItem.cpp
xbmc/GUIInfoManager.cpp
xbmc/GUIInfoManager.h
xbmc/MediaSource.cpp
xbmc/TextureCache.cpp
xbmc/TextureCacheJob.cpp
xbmc/URL.cpp
xbmc/Util.cpp
xbmc/Util.h
xbmc/addons/GUIDialogAddonSettings.cpp
xbmc/addons/GUIDialogAddonSettings.h
xbmc/addons/GUIWindowAddonBrowser.cpp
xbmc/android/jni/MediaCodecInfo.cpp
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.cpp
xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp
xbmc/cores/paplayer/CodecFactory.cpp
xbmc/dialogs/GUIDialogMediaSource.cpp
xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
xbmc/filesystem/CurlFile.cpp
xbmc/filesystem/FTPDirectory.cpp
xbmc/filesystem/File.cpp
xbmc/filesystem/FileDirectoryFactory.cpp
xbmc/filesystem/HTTPDirectory.cpp
xbmc/filesystem/MusicDatabaseDirectory.cpp
xbmc/filesystem/RSSDirectory.cpp
xbmc/filesystem/RarDirectory.cpp
xbmc/filesystem/RarFile.cpp
xbmc/filesystem/RarManager.cpp
xbmc/filesystem/SMBDirectory.cpp
xbmc/filesystem/SmbFile.cpp
xbmc/filesystem/SourcesDirectory.cpp
xbmc/filesystem/SpecialProtocol.cpp
xbmc/filesystem/VideoDatabaseDirectory.cpp
xbmc/filesystem/ZipDirectory.cpp
xbmc/filesystem/windows/WINSMBDirectory.cpp
xbmc/guilib/GUIInfoTypes.cpp
xbmc/guilib/GUIMultiImage.cpp
xbmc/guilib/TextureBundleXBT.cpp
xbmc/guilib/TextureBundleXPR.cpp
xbmc/guilib/VisibleEffect.cpp
xbmc/input/ButtonTranslator.cpp
xbmc/interfaces/Builtins.cpp
xbmc/interfaces/json-rpc/ApplicationOperations.cpp
xbmc/interfaces/legacy/ListItem.cpp
xbmc/interfaces/python/PythonSwig.cpp.template
xbmc/linux/LinuxTimezone.cpp
xbmc/music/windows/GUIWindowMusicBase.cpp
xbmc/music/windows/GUIWindowMusicNav.cpp
xbmc/music/windows/GUIWindowMusicSongs.cpp
xbmc/network/EventClient.cpp
xbmc/network/httprequesthandler/HTTPWebinterfaceHandler.cpp
xbmc/network/linux/NetworkLinux.cpp
xbmc/network/upnp/UPnPServer.cpp
xbmc/osx/Info.plist
xbmc/peripherals/Peripherals.cpp
xbmc/pictures/GUIWindowPictures.cpp
xbmc/pictures/PictureInfoTag.cpp
xbmc/playlists/PlayListPLS.cpp
xbmc/programs/GUIWindowPrograms.cpp
xbmc/pvr/channels/PVRChannelGroupsContainer.cpp
xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp
xbmc/pvr/recordings/PVRRecordings.cpp
xbmc/settings/MediaSourceSettings.cpp
xbmc/utils/AMLUtils.cpp
xbmc/utils/CharsetConverter.cpp
xbmc/utils/CharsetConverter.h
xbmc/utils/LangCodeExpander.cpp
xbmc/utils/ScraperParser.cpp
xbmc/utils/StringUtils.cpp
xbmc/utils/StringUtils.h
xbmc/utils/TextSearch.cpp
xbmc/utils/URIUtils.cpp
xbmc/video/VideoDatabase.cpp
xbmc/video/VideoInfoScanner.cpp
xbmc/video/VideoReferenceClock.cpp
xbmc/video/VideoThumbLoader.cpp
xbmc/video/dialogs/GUIDialogVideoInfo.cpp
xbmc/video/windows/GUIWindowVideoBase.cpp
xbmc/video/windows/GUIWindowVideoNav.cpp
xbmc/win32/WIN32Util.cpp
xbmc/win32/WIN32Util.h
xbmc/win32/XBMC_PC.rc
xbmc/windowing/X11/WinSystemX11GL.cpp
xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
xbmc/windows/GUIMediaWindow.cpp
xbmc/windows/GUIWindowFileManager.cpp

diff --git a/addons/script.module.pysqlite/addon.xml b/addons/script.module.pysqlite/addon.xml
deleted file mode 100644 (file)
index 8b76f66..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.module.pysqlite"
-       name="Python SQLite library hook"
-       version="2.5.6"
-       provider-name="Gerhard Haering">
-  <requires>
-    <import addon="xbmc.python" version="2.0.0"/>
-  </requires>
-  <extension point="xbmc.python.module"
-             library="lib" />
-  <extension point="xbmc.addon.metadata">
-    <platform>all</platform>
-  </extension>
-</addon>
diff --git a/addons/script.module.pysqlite/lib/pysqlite2/__init__.py b/addons/script.module.pysqlite/lib/pysqlite2/__init__.py
deleted file mode 100644 (file)
index 94d26e6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-# if we got here then someone tried to import pysqlite.dbapi2
-# this will only be allowed if the script is greater that version 1.0
-
-import warnings
-import re
-
-# Credit gnud on stackoverflow:
-#  see http://stackoverflow.com/questions/1714027/version-number-comparison/1714190#1714190
-def xbmcVerCmp(version1, version2):
-    def normalize(v):
-        return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
-    return cmp(normalize(version1), normalize(version2))
-
-# Not sure why this might fail but ....
-try:
-    import __main__
-    xbmcapiversion = __main__.__xbmcapiversion__
-except:
-    xbmcapiversion = "1.0"
-    warnings.warn("For some reason the module '" + str(__name__) + "' couldn't get access to '__main__'. This may prevent certain backward compatility modes from operating correctly.")
-
-# if the xbmcapiversion is either not set (because trying to get it failed or 
-#  the script was invoked in an odd manner from xbmc) ...
-if (xbmcVerCmp(xbmcapiversion,"1.0") <= 0):
-    # then import sqlite3 in place of dbapi2
-    try:
-        import sqlite3 as dbapi2
-    except Exception, e:
-        warnings.warn("Unable to import sqlite3. This probably means you're on a version of python prior to 2.5 and trying to run an old script.")
-        raise e
-
-    # ask politely :)
-    warnings.warn("DeprecationWarning: the pysqlite2 module is deprecated; please change your script to use sqlite3.")
-else:
-    raise DeprecationWarning("You cannot use pysqlite2 while depending on version " + str(xbmcapiversion) + " of the xbmc.python api. Please use sqlite3 instead.")
-
index 75d2550..54cd3ee 100644 (file)
                                        <textcolor>white</textcolor>
                                        <shadowcolor>black</shadowcolor>
                                </control>
+                               <control type="image">
+                                       <posx>70</posx>
+                                       <posy>40</posy>
+                                       <width>360</width>
+                                       <height>90</height>
+                                       <aspectratio align="center" aligny="center">keep</aspectratio>
+                                       <texture>$INFO[Window.Property(WeatherProviderLogo)]</texture>
+                               </control>
                                <control type="label">
                                        <description>Provider Text</description>
                                        <posx>20</posx>
                                        <aligny>center</aligny>
                                        <label>$LOCALIZE[31303] : [COLOR=orange]$INFO[Window.Property(WeatherProvider)][/COLOR]</label>
                                        <include>Window_OpenClose_Animation</include>
+                                       <visible>IsEmpty(Window.Property(WeatherProviderLogo))</visible>
                                </control>
-                               <control type="label">
-                                       <description>weather location label</description>
-                                       <posx>20</posx>
-                                       <posy>80</posy>
-                                       <width>460</width>
-                                       <height>30</height>
-                                       <font>font13_title</font>
-                                       <textcolor>white</textcolor>
-                                       <scroll>false</scroll>
-                                       <align>center</align>
-                                       <aligny>center</aligny>
-                                       <label>$INFO[Window.Property(Location)]</label>
-                               </control>
-                               <control type="label">
-                                       <description>update label</description>
-                                       <posx>20</posx>
-                                       <posy>100</posy>
-                                       <width>460</width>
-                                       <height>35</height>
-                                       <font>font12</font>
-                                       <label>$LOCALIZE[31301] - $INFO[Window.Property(Updated)]</label>
-                                       <align>center</align>
-                                       <aligny>center</aligny>
-                                       <textcolor>grey2</textcolor>
-                               </control>
-                               <control type="label">
-                                       <description>current temp Value</description>
-                                       <posx>195</posx>
-                                       <posy>175</posy>
-                                       <width>180</width>
-                                       <height>40</height>
-                                       <font>WeatherTemp</font>
-                                       <align>right</align>
-                                       <aligny>top</aligny>
-                                       <label>$INFO[Window.Property(Current.Temperature)]</label>
-                                       <textcolor>white</textcolor>
-                                       <shadowcolor>black</shadowcolor>
-                               </control>
-                               <control type="label">
-                                       <description>current temp Value Units</description>
-                                       <posx>190</posx>
-                                       <posy>185</posy>
-                                       <width>100</width>
-                                       <height>40</height>
-                                       <font>font16</font>
-                                       <align>left</align>
-                                       <aligny>top</aligny>
-                                       <label>$INFO[System.TemperatureUnits]</label>
-                                       <textcolor>white</textcolor>
-                                       <shadowcolor>black</shadowcolor>
-                               </control>
-                               <control type="image">
-                                       <description>current weather icon</description>
-                                       <posx>230</posx>
-                                       <posy>120</posy>
-                                       <width>230</width>
-                                       <height>230</height>
-                                       <info>Window.Property(Current.ConditionIcon)</info>
-                                       <aspectratio>keep</aspectratio>
-                               </control>
-                               <control type="label">
-                                       <description>current condition label</description>
-                                       <posx>20</posx>
-                                       <posy>320</posy>
-                                       <width>460</width>
-                                       <height>30</height>
-                                       <info>Window.Property(Current.Condition)</info>
-                                       <wrapmultiline>true</wrapmultiline>
-                                       <font>font13</font>
-                                       <align>center</align>
-                                       <aligny>center</aligny>
-                                       <textcolor>white</textcolor>
-                                       <shadowcolor>black</shadowcolor>
+                               <control type="group">
+                                       <animation effect="slide" start="0,0" end="0,30" condition="!IsEmpty(Window.Property(WeatherProviderLogo))">Conditional</animation>
+                                       <control type="label">
+                                               <description>weather location label</description>
+                                               <posx>20</posx>
+                                               <posy>100</posy>
+                                               <width>460</width>
+                                               <height>30</height>
+                                               <font>font13_title</font>
+                                               <textcolor>white</textcolor>
+                                               <scroll>false</scroll>
+                                               <align>center</align>
+                                               <aligny>center</aligny>
+                                               <label>$INFO[Window.Property(Location)]</label>
+                                       </control>
+                                       <control type="label">
+                                               <description>update label</description>
+                                               <posx>20</posx>
+                                               <posy>120</posy>
+                                               <width>460</width>
+                                               <height>35</height>
+                                               <font>font12</font>
+                                               <label>$LOCALIZE[31301] - $INFO[Window.Property(Updated)]</label>
+                                               <align>center</align>
+                                               <aligny>center</aligny>
+                                               <textcolor>grey2</textcolor>
+                                       </control>
+                                       <control type="label">
+                                               <description>current temp Value</description>
+                                               <posx>195</posx>
+                                               <posy>175</posy>
+                                               <width>180</width>
+                                               <height>40</height>
+                                               <font>WeatherTemp</font>
+                                               <align>right</align>
+                                               <aligny>top</aligny>
+                                               <label>$INFO[Window.Property(Current.Temperature)]</label>
+                                               <textcolor>white</textcolor>
+                                               <shadowcolor>black</shadowcolor>
+                                       </control>
+                                       <control type="label">
+                                               <description>current temp Value Units</description>
+                                               <posx>190</posx>
+                                               <posy>185</posy>
+                                               <width>100</width>
+                                               <height>40</height>
+                                               <font>font16</font>
+                                               <align>left</align>
+                                               <aligny>top</aligny>
+                                               <label>$INFO[System.TemperatureUnits]</label>
+                                               <textcolor>white</textcolor>
+                                               <shadowcolor>black</shadowcolor>
+                                       </control>
+                                       <control type="image">
+                                               <description>current weather icon</description>
+                                               <posx>230</posx>
+                                               <posy>120</posy>
+                                               <width>230</width>
+                                               <height>230</height>
+                                               <info>Window.Property(Current.ConditionIcon)</info>
+                                               <aspectratio>keep</aspectratio>
+                                       </control>
+                                       <control type="label">
+                                               <description>current condition label</description>
+                                               <posx>20</posx>
+                                               <posy>320</posy>
+                                               <width>460</width>
+                                               <height>30</height>
+                                               <info>Window.Property(Current.Condition)</info>
+                                               <wrapmultiline>true</wrapmultiline>
+                                               <font>font13</font>
+                                               <align>center</align>
+                                               <aligny>center</aligny>
+                                               <textcolor>white</textcolor>
+                                               <shadowcolor>black</shadowcolor>
+                                       </control>
                                </control>
                                <control type="image">
                                        <posx>20</posx>
index 2613a57..e9e53b0 100644 (file)
@@ -11,7 +11,7 @@
 <!-- file to play when the action occurs.                                   -->
 
 <!-- Valid entries for <name> can be found at                               -->
-<!-- http://manual.xboxmediacenter.de/wakka.php?wakka=KeyMappingXML&v=6gu   -->
+<!-- http://wiki.xbmc.org/index.php?title=Keymap                            -->
 
 
 <!-- Also window specific sound can be played                               -->
@@ -27,7 +27,7 @@
 <!-- by setting the file to play.                                           -->
 
 <!-- Valid entries for <name> can be found at                               -->
-<!-- http://manual.xboxmediacenter.de/wakka.php?wakka=WindowList&v=13k6     -->
+<!-- http://wiki.xbmc.org/?title=Window_IDs                                 -->
 
 <!-- Note: Only wav files are supported                                     -->
 
index 465bf41..48b15cf 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<addon id="xbmc.addon" version="12.9.8" provider-name="Team XBMC">
+<addon id="xbmc.addon" version="12.9.9" provider-name="Team XBMC">
   <backwards-compatibility abi="12.0"/>
   <requires>
     <import addon="xbmc.core" version="0.1.0"/>
index 40d4884..dfbcee0 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<addon id="xbmc.gui" version="5.0.0" provider-name="Team XBMC">
+<addon id="xbmc.gui" version="5.0.1" provider-name="Team XBMC">
   <backwards-compatibility abi="4.00"/>
   <requires>
     <import addon="xbmc.core" version="0.1.0"/>
index 5b4b830..20a387b 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<addon id="xbmc.json" version="6.0.0" provider-name="Team XBMC">
+<addon id="xbmc.json" version="6.6.0" provider-name="Team XBMC">
   <requires>
     <import addon="xbmc.core" version="0.1.0"/>
   </requires>
index d48bb71..b541926 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<addon id="xbmc.python" version="2.1.0" provider-name="Team XBMC">
-  <backwards-compatibility abi="1.0"/>
+<addon id="xbmc.python" version="2.12.0" provider-name="Team XBMC">
+  <backwards-compatibility abi="2.0"/>
   <requires>
     <import addon="xbmc.core" version="0.1.0"/>
   </requires>
index 4127c9d..b98d419 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([xbmc], [12.9.8], [http://trac.xbmc.org])
+AC_INIT([xbmc], [12.9.9], [http://trac.xbmc.org])
 AC_CONFIG_HEADERS([xbmc/config.h])
 AH_TOP([#pragma once])
 m4_include([m4/ax_prog_cc_for_build.m4])
@@ -920,6 +920,7 @@ fi
 AC_LANG_PUSH([C++])
 AC_CHECK_TYPES([std::u16string, std::u32string], [], [], [[#include <string>]])
 AC_CHECK_TYPES([char16_t, char32_t])
+AC_CHECK_SIZEOF([wchar_t])
 AC_LANG_POP([C++])
 
 # Add top source directory for all builds so we can use config.h
index 51658ce..8ab554c 100644 (file)
@@ -116,6 +116,7 @@ av_cold static int auto_matrix(SwrContext *s)
     double maxcoef=0;
     char buf[128];
     const int matrix_encoding = s->matrix_encoding;
+    float maxval;
 
     in_ch_layout = clean_layout(s, s->in_ch_layout);
     if(!sane_layout(in_ch_layout)){
@@ -300,8 +301,16 @@ av_cold static int auto_matrix(SwrContext *s)
     if(s->rematrix_volume  < 0)
         maxcoef = -s->rematrix_volume;
 
-    if((   av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT
-        || av_get_packed_sample_fmt(s->int_sample_fmt) < AV_SAMPLE_FMT_FLT) && maxcoef > 1.0){
+    if (s->rematrix_maxval > 0) {
+        maxval = s->rematrix_maxval;
+    } else if (   av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT
+               || av_get_packed_sample_fmt(s->int_sample_fmt) < AV_SAMPLE_FMT_FLT) {
+        maxval = 1.0;
+    } else
+        maxval = INT_MAX;
+
+    if(maxcoef > maxval){
+        maxcoef /= maxval;
         for(i=0; i<SWR_CH_MAX; i++)
             for(j=0; j<SWR_CH_MAX; j++){
                 s->matrix[i][j] /= maxcoef;
index 9b71b2e..b9c652a 100644 (file)
@@ -68,6 +68,7 @@ static const AVOption options[]={
 {"lfe_mix_level"        , "set LFE mix level"           , OFFSET(lfe_mix_level  ), AV_OPT_TYPE_FLOAT, {.dbl=0                     }, -32    , 32        , PARAM},
 {"rmvol"                , "set rematrix volume"         , OFFSET(rematrix_volume), AV_OPT_TYPE_FLOAT, {.dbl=1.0                   }, -1000  , 1000      , PARAM},
 {"rematrix_volume"      , "set rematrix volume"         , OFFSET(rematrix_volume), AV_OPT_TYPE_FLOAT, {.dbl=1.0                   }, -1000  , 1000      , PARAM},
+{"rematrix_maxval"      , "set rematrix maxval"         , OFFSET(rematrix_maxval), AV_OPT_TYPE_FLOAT, {.dbl=0.0                   }, 0      , 1000      , PARAM},
 
 {"flags"                , "set flags"                   , OFFSET(flags          ), AV_OPT_TYPE_FLAGS, {.i64=0                     }, 0      , UINT_MAX  , PARAM, "flags"},
 {"swr_flags"            , "set flags"                   , OFFSET(flags          ), AV_OPT_TYPE_FLAGS, {.i64=0                     }, 0      , UINT_MAX  , PARAM, "flags"},
index 17b85d5..be36ba6 100644 (file)
@@ -82,6 +82,7 @@ struct SwrContext {
     float clev;                                     ///< center mixing level
     float lfe_mix_level;                            ///< LFE mixing level
     float rematrix_volume;                          ///< rematrixing volume coefficient
+    float rematrix_maxval;                          ///< maximum value for rematrixing output
     enum AVMatrixEncoding matrix_encoding;          /**< matrixed stereo encoding */
     const int *channel_map;                         ///< channel index (or -1 if muted channel) map
     int used_ch_count;                              ///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
index df9df48..8272b76 100644 (file)
@@ -30,7 +30,7 @@
 
 #define LIBSWRESAMPLE_VERSION_MAJOR 0
 #define LIBSWRESAMPLE_VERSION_MINOR 17
-#define LIBSWRESAMPLE_VERSION_MICRO 102
+#define LIBSWRESAMPLE_VERSION_MICRO 103
 
 #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
                                                   LIBSWRESAMPLE_VERSION_MINOR, \
diff --git a/lib/ffmpeg/patches/0057-backport-swresample-Make-rematrix-maxvalue-user-settable.patch b/lib/ffmpeg/patches/0057-backport-swresample-Make-rematrix-maxvalue-user-settable.patch
new file mode 100644 (file)
index 0000000..b826a61
--- /dev/null
@@ -0,0 +1,84 @@
+From e2b718464e92fcde3d21c6653c88ddec2ab21c3f Mon Sep 17 00:00:00 2001
+From: Michael Niedermayer <michaelni@gmx.at>
+Date: Mon, 22 Jul 2013 03:23:54 +0200
+Subject: [PATCH] swresample: Make rematrix maxvalue user settable
+
+Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
+---
+ libswresample/rematrix.c            | 13 +++++++++++--
+ libswresample/swresample.c          |  1 +
+ libswresample/swresample_internal.h |  1 +
+ libswresample/version.h             |  2 +-
+ 4 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
+index 48aff3b..33e2966 100644
+--- a/libswresample/rematrix.c
++++ b/libswresample/rematrix.c
+@@ -120,6 +120,7 @@ av_cold static int auto_matrix(SwrContext *s)
+     double maxcoef=0;
+     char buf[128];
+     const int matrix_encoding = s->matrix_encoding;
++    float maxval;
+     in_ch_layout = clean_layout(s, s->in_ch_layout);
+     if(!sane_layout(in_ch_layout)){
+@@ -304,8 +305,16 @@ av_cold static int auto_matrix(SwrContext *s)
+     if(s->rematrix_volume  < 0)
+         maxcoef = -s->rematrix_volume;
+-    if((   av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT
+-        || av_get_packed_sample_fmt(s->int_sample_fmt) < AV_SAMPLE_FMT_FLT) && maxcoef > 1.0){
++    if (s->rematrix_maxval > 0) {
++        maxval = s->rematrix_maxval;
++    } else if (   av_get_packed_sample_fmt(s->out_sample_fmt) < AV_SAMPLE_FMT_FLT
++               || av_get_packed_sample_fmt(s->int_sample_fmt) < AV_SAMPLE_FMT_FLT) {
++        maxval = 1.0;
++    } else
++        maxval = INT_MAX;
++
++    if(maxcoef > maxval){
++        maxcoef /= maxval;
+         for(i=0; i<SWR_CH_MAX; i++)
+             for(j=0; j<SWR_CH_MAX; j++){
+                 s->matrix[i][j] /= maxcoef;
+diff --git a/libswresample/swresample.c b/libswresample/swresample.c
+index ba2afdb..cdfe5bf 100644
+--- a/libswresample/swresample.c
++++ b/libswresample/swresample.c
+@@ -68,6 +68,7 @@
+ {"lfe_mix_level"        , "set LFE mix level"           , OFFSET(lfe_mix_level  ), AV_OPT_TYPE_FLOAT, {.dbl=0                     }, -32    , 32        , PARAM},
+ {"rmvol"                , "set rematrix volume"         , OFFSET(rematrix_volume), AV_OPT_TYPE_FLOAT, {.dbl=1.0                   }, -1000  , 1000      , PARAM},
+ {"rematrix_volume"      , "set rematrix volume"         , OFFSET(rematrix_volume), AV_OPT_TYPE_FLOAT, {.dbl=1.0                   }, -1000  , 1000      , PARAM},
++{"rematrix_maxval"      , "set rematrix maxval"         , OFFSET(rematrix_maxval), AV_OPT_TYPE_FLOAT, {.dbl=0.0                   }, 0      , 1000      , PARAM},
+ {"flags"                , "set flags"                   , OFFSET(flags          ), AV_OPT_TYPE_FLAGS, {.i64=0                     }, 0      , UINT_MAX  , PARAM, "flags"},
+ {"swr_flags"            , "set flags"                   , OFFSET(flags          ), AV_OPT_TYPE_FLAGS, {.i64=0                     }, 0      , UINT_MAX  , PARAM, "flags"},
+diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h
+index 108f837..ab19f21 100644
+--- a/libswresample/swresample_internal.h
++++ b/libswresample/swresample_internal.h
+@@ -82,6 +82,7 @@ struct SwrContext {
+     float clev;                                     ///< center mixing level
+     float lfe_mix_level;                            ///< LFE mixing level
+     float rematrix_volume;                          ///< rematrixing volume coefficient
++    float rematrix_maxval;                          ///< maximum value for rematrixing output
+     enum AVMatrixEncoding matrix_encoding;          /**< matrixed stereo encoding */
+     const int *channel_map;                         ///< channel index (or -1 if muted channel) map
+     int used_ch_count;                              ///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
+diff --git a/libswresample/version.h b/libswresample/version.h
+index df9df48..8272b76 100644
+--- a/libswresample/version.h
++++ b/libswresample/version.h
+@@ -30,7 +30,7 @@
+ #define LIBSWRESAMPLE_VERSION_MAJOR 0
+ #define LIBSWRESAMPLE_VERSION_MINOR 17
+-#define LIBSWRESAMPLE_VERSION_MICRO 102
++#define LIBSWRESAMPLE_VERSION_MICRO 103
+ #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                                   LIBSWRESAMPLE_VERSION_MINOR, \
+-- 
+1.8.4
+
index c4f1115..0b7e7d6 100644 (file)
@@ -9,8 +9,8 @@ dnssd-379.32.1-win32.7z
 doxygen-1.8.2-win32
 lame_enc-3.99.5-win32.7z
 libbluray-0.2.3-win32
-libnfs-1.6.0-win32
+libnfs-1.6.1-win32
 libshairplay-c159ca7-win32
 libjpeg-turbo-1.2.0-win32
 sqlite-3.7.16.1-win32
-taglib-1.8beta-win32
+taglib-1.8-win32
index b0db995..08e4df2 100644 (file)
Binary files a/project/Win32BuildSetup/tools/7z/7-zip.chm and b/project/Win32BuildSetup/tools/7z/7-zip.chm differ
index 8836e99..7f6bf86 100644 (file)
Binary files a/project/Win32BuildSetup/tools/7z/7za.exe and b/project/Win32BuildSetup/tools/7z/7za.exe differ
index e44b6d4..530ff36 100644 (file)
@@ -3,13 +3,9 @@
       License for use and distribution
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-      7-Zip Copyright (C) 1999-2007 Igor Pavlov.
-
-      7za.exe is distributed under the GNU LGPL + AES code license
-
-      The GNU LGPL + AES code license means that you must follow both GNU LGPL rules 
-      and AES code license rules.
+      7-Zip Copyright (C) 1999-2010 Igor Pavlov.
 
+      7za.exe is distributed under the GNU LGPL license
 
       Notes: 
         You can use 7-Zip on any computer, including a computer in a commercial 
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
         Lesser General Public License for more details.
 
-        You should have received a copy of the GNU Lesser General Public
-        License along with this library; if not, write to the Free Software
-        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-      AES code license
-      ----------------
-    
-        Copyright (c) 2001, Dr Brian Gladman
-
-        LICENSE TERMS
-
-        The free distribution and use of this software in both source and binary 
-        form is allowed (with or without changes) provided that:
-
-          1. distributions of this source code include the above copyright 
-             notice, this list of conditions and the following disclaimer;
-
-          2. distributions in binary form include the above copyright
-             notice, this list of conditions and the following disclaimer
-             in the documentation and/or other associated materials;
-
-          3. the copyright holder's name is not used to endorse products 
-             built using this software without specific written permission. 
-
-        DISCLAIMER
-
-        This software is provided 'as is' with no explicit or implied warranties
-        in respect of its properties, including, but not limited to, correctness 
-        and fitness for purpose.
-
+        You can receive a copy of the GNU Lesser General Public License from 
+        http://www.gnu.org/
diff --git a/project/Win32BuildSetup/tools/7z/copying.txt b/project/Win32BuildSetup/tools/7z/copying.txt
deleted file mode 100644 (file)
index 4c38901..0000000
+++ /dev/null
@@ -1,504 +0,0 @@
-      GNU LESSER GENERAL PUBLIC LICENSE
-           Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-          Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-\f
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-\f
-      GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-\f
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-\f
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-\f
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-\f
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-\f
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-          NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-         END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library 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
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-
index 95fb492..9ae4222 100644 (file)
@@ -1,27 +1,27 @@
-7-Zip Command line version 4.58
+7-Zip Command line version 9.20
 -------------------------------
 
 7-Zip is a file archiver with high compression ratio.
 7za.exe is a standalone command line version of 7-Zip.
 
-7-Zip Copyright (C) 1999-2008 Igor Pavlov.
+7-Zip Copyright (C) 1999-2010 Igor Pavlov.
 
 Features of 7za.exe: 
   - High compression ratio in new 7z format
   - Supported formats:
-      - Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR 
-      - Unpacking only: Z
+      - Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR 
+      - Unpacking only: Z, lzma
   - Highest compression ratio for ZIP and GZIP formats.
   - Fast compression and decompression
   - Strong AES-256 encryption in 7z and ZIP formats.
 
-7za.exe is a free software distributed under the GNU LGPL + BSD LICENSE for AES part.
+7za.exe is a free software distributed under the GNU LGPL.
 Read license.txt for more information.
 
 Source code of 7za.exe and 7-Zip can be found at
 http://www.7-zip.org/
 
-7za.exe can work in Windows 95/98/ME/NT/2000/XP/2003/Vista.
+7za.exe can work in Windows 95/98/ME/NT/2000/2003/2008/XP/Vista/7.
 
 There is also port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD, 
 FreeBSD, Cygwin, AIX, ...), MacOS X and BeOS:
@@ -33,7 +33,6 @@ http://p7zip.sourceforge.net/
 
   7za.exe       - 7-Zip standalone command line version.
   readme.txt    - This file.
-  copying.txt   - GNU LGPL license.
   license.txt   - License information.
   7-zip.chm     - User's Manual in HTML Help format.
 
diff --git a/system/asound.conf b/system/asound.conf
deleted file mode 100644 (file)
index e3cd2e7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# downmixing to 2 channels
-pcm.xbmc_71to2 {
-  @args.0 SLAVE
-  @args.SLAVE {
-    type string
-    default "default"
-  }
-  type plug
-  slave.pcm $SLAVE
-  slave.channels 2
-  route_policy duplicate
-  ttable.0.0 1          # front left speaker
-  ttable.1.1 1          # front right speaker
-  ttable.2.0 0.7        # rear left speaker
-  ttable.3.1 0.7        # rear right speaker
-  ttable.4.0 0.7        # center to left mapping
-  ttable.4.1 0.7        # center to right mapping
-  ttable.5.0 0.5        # LFE (base) to left mapping
-  ttable.5.1 0.5        # LFE to right mapping
-  ttable.6.0 0.6       # SL to left mapping
-  ttable.7.0 0.6       # SR to right mapping
-}
-
-# downmixing to 2 channels
-pcm.xbmc_51to2 {
-  @args.0 SLAVE
-  @args.SLAVE {
-    type string
-    default "default"
-  }
-  type plug
-  slave.pcm $SLAVE
-  slave.channels 2
-  route_policy duplicate
-  ttable.0.0 1          # front left speaker
-  ttable.1.1 1          # front right speaker
-  ttable.2.0 0.7        # rear left speaker
-  ttable.3.1 0.7        # rear right speaker
-  ttable.4.0 0.7        # center to left mapping
-  ttable.4.1 0.7        # center to right mapping
-  ttable.5.0 0.5        # LFE (base) to left mapping
-  ttable.5.1 0.5        # LFE to right mapping
-}
-
-# downmixing to 2 channels
-pcm.xbmc_50to2 {
-  @args.0 SLAVE
-  @args.SLAVE {
-    type string
-    default "default"
-  }
-  type plug
-  slave.pcm $SLAVE
-  slave.channels 2
-  route_policy duplicate
-  ttable.0.0 1          # front left speaker
-  ttable.1.1 1          # front right speaker
-  ttable.2.0 0.7        # rear left speaker
-  ttable.3.1 0.7        # rear right speaker
-  ttable.4.0 0.7        # center to left mapping
-  ttable.4.1 0.7        # center to right mapping
-}
-
index dd3a84b..469f60c 100644 (file)
@@ -2,8 +2,8 @@
 <!-- BEGIN_INCLUDE(manifest) -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.xbmc.xbmc"
-    android:versionCode="14"
-    android:versionName="13.0-ALPHA8" >
+    android:versionCode="15"
+    android:versionName="13.0-ALPHA9" >
 
     <!-- This is the platform API where NativeActivity was introduced. -->
     <uses-sdk android:minSdkVersion="14" />
diff --git a/tools/arm/arm-scripts/create-pkgsfile.sh b/tools/arm/arm-scripts/create-pkgsfile.sh
deleted file mode 100644 (file)
index 7a07d1a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# This will create a tar file that contains all the armel packages already extracted.
-
-# Dont go further if there are no packages, i.e install-pkgs.sh was not run!
-if [ ! -e pkgs ]
-then
-  echo "install-pkgs.sh was not run!!! Exiting!"
-  exit
-fi
-
-# Cleanup
-if [ -e pkgs-output.txt ]
-then
-  rm pkgs-output.txt
-fi
-
-# Cleanup
-if [ -e pkgs.tar.bz2 ]
-then
-  rm pkgs.tar.bz2
-fi
-
-# Extract all deb packages into a temporary directory.
-# Keep the output log, incase something went wrong.
-cd pkgs
-mkdir tmp
-
-echo "Collecting all package data... please wait"
-for i in `ls *.deb`
-do
-  dpkg-deb -x $i tmp/ >> ../pkgs-output.txt 2>&1
-done
-echo "Please check pkgs-output.txt for any errors that may have been encountered!"
-
-echo "Creating tar file... please wait"
-cd tmp
-tar cjf ../../pkgs.tar.bz2 ./
-cd ../
-rm -r tmp
-echo "Done! Output: pkgs.tar.bz2"
diff --git a/tools/arm/arm-scripts/create-xbmcfile.sh b/tools/arm/arm-scripts/create-xbmcfile.sh
deleted file mode 100644 (file)
index ccf21c5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-# A re-write of original XBMC Makefile install proceedure that will work with scratchbox.
-
-filename=xbmc.tar.bz2
-prefix=tools/arm/arm-scripts/usr
-cd ../../../
-mkdir -p $prefix
-
-# Install Binaries
-echo "Copying XBMC binary to $prefix/share/xbmc/xbmc.bin"
-install -D xbmc.bin $prefix/share/xbmc/xbmc.bin
-install -D xbmc-xrandr $prefix/share/xbmc/xbmc-xrandr
-# Install Scripts
-install -D tools/Linux/xbmc.sh $prefix/bin/xbmc
-install -D tools/Linux/xbmc-standalone.sh $prefix/bin/xbmc-standalone
-install -D -m 0644 tools/Linux/FEH-ARM.py $prefix/share/xbmc/FEH.py
-install -D -m 0644 tools/Linux/xbmc-xsession.desktop $prefix/share/xsessions/XBMC.desktop
-# Arch dependent files
-find system screensavers visualisations -type f -not -iregex ".*\(svn.*\|win32\(dx\)?\.vis\|osx\.vis\)" -iregex ".*\(arm.*\|\.vis\|\.xbs\)" -exec install -D "{}" $prefix/share/xbmc/"{}" \; -printf " -- %-75.75f\r"
-# Install Datas
-echo "Copying support and legal files..."
-for FILE in `ls README.linux README.armel LICENSE.GPL *.txt`
-do
-  install -D -m 0644 "$FILE" $prefix/share/xbmc/"$FILE"
-done
-echo "Done!"
-echo "Copying system files to $prefix/share/xbmc"
-# Arch independent files
-find language media scripts sounds userdata visualisations system -type f -not -iregex ".*\(svn.*\|\.so\|\.dll\|\.pyd\|python/.*\.zlib\|\.vis\)" -exec install -D -m 0644 "{}" $prefix/share/xbmc/"{}" \; -printf " -- %-75.75f\r"
-# Skins
-find skin -type f -not -iregex ".*\(svn.*\|^skin/[^/]*/media/.*[^x][^b][^t]\)" -exec install -D -m 0644 '{}' $prefix/share/xbmc/'{}' \; -printf " -- %-75.75f\r"
-# Icons and links
-mkdir -p $prefix/share/applications $prefix/share/pixmaps
-cp -a tools/Linux/xbmc.png $prefix/share/pixmaps/
-cp -a tools/Linux/xbmc.desktop $prefix/share/applications/
-# Install Web
-mkdir -p $prefix/share/xbmc/web
-cp -r web/Project_Mayhem_III/* $prefix/share/xbmc/web
-find $prefix/share/xbmc/web -depth -name .svn -exec rm -rf {} \;
-echo "...Complete!"
-
-cd arm-scripts
-
-# Cleanup
-if [ -e $filename ]
-then
-  rm $filename
-fi
-
-echo "Creating tar file... please wait"
-tar cjf $filename usr
-rm -r usr
-echo "Done! Output: $filename"
diff --git a/tools/arm/arm-scripts/install-gcc4.5_armel.sh b/tools/arm/arm-scripts/install-gcc4.5_armel.sh
deleted file mode 100644 (file)
index b9de9d7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Download and install gcc-4.5 for arm platform. This is a native install
-# and not a cross-compiler install.
-#
-
-# The URL sources
-URLS="http://ftp.debian.org/debian/pool/main/b/binutils/binutils_2.20.51.20100418-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/cpp-4.5_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/g++-4.5_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/gcc-4.5_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/gcc-4.5-base_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libgcc1_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libgomp1_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libstdc++6_4.5-20100321-1_armel.deb \ 
-http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libstdc++6-4.5-dev_4.5-20100321-1_armel.deb \
-http://ftp.debian.org/debian/pool/main/libe/libelf/libelfg0_0.8.13-1_armel.deb"
-
-# Download them using wget
-mkdir -p gcc-4.5-debs
-for u in $URLS; do wget --directory-prefix=./gcc-4.5-debs $u; done
-
-# Install gcc-4.5
-dpkg -i ./gcc-4.5-debs/*.deb
-
diff --git a/tools/arm/arm-scripts/install-pkgs.sh b/tools/arm/arm-scripts/install-pkgs.sh
deleted file mode 100644 (file)
index ac4e186..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-# A simple script that will automatically download a predefined list of packages,
-# skipping over those already downloaded, and then extracting them to root folder /
-
-echo "#### Beginning Downloads ####"
-
-# If the temporary pkgs folder has not been created, create it
-if [ ! -e pkgs ]
-then
-  mkdir pkgs
-fi
-
-cd pkgs
-# Make a copy of the pkg paths text file for manipulation
-cp ../pkg-paths.txt ./
-
-# Remove lines in the text file that we have already obtained
-for i in *.deb
-do
-  sed "/$i/d" pkg-paths.txt > tmpfile
-  mv tmpfile pkg-paths.txt
-done
-
-# If theres packages left to download, do so. Otherwise, do nothing
-if test `cat pkg-paths.txt | wc -l` -gt 0
-then
-  echo "Downloading:"
-  cat pkg-paths.txt
-  wget -i pkg-paths.txt -o ../wget-output.txt
-else
-  echo "#### Nothing to Download or Extract!!! Exiting... ####"
-  exit
-fi
-
-echo "#### Downloads Complete! Please check wget-output.txt for any errors that may have been encountered! ####"
-echo
-echo
-echo "#### Extracting Packages ####"
-# Only install if running from scratchbox!!! (or arm in general)
-if test `uname -m` = "arm"
-then
-  # Remove dpkg logfile
-  if [ -e ../dpkg-output.txt ]
-  then
-    rm ../dpkg-output.txt
-  fi
-
-  for i in `cat pkg-paths.txt`
-  do
-    # For each .deb package just downloaded,
-    # extract the contents to / and redirect the output!
-    j=`basename $i`
-    echo "Extracting $j..."
-    dpkg-deb -x $j / >> ../dpkg-output.txt 2>&1
-  done
-  echo "#### Extraction Complete! Please check dpkg-output.txt for any errors that may have been encountered! ####"
-else
-  echo "#### Extraction FAILED: Did not extract as not running in scratchbox! ####"
-fi
-
diff --git a/tools/arm/arm-scripts/pkg-paths.txt b/tools/arm/arm-scripts/pkg-paths.txt
deleted file mode 100644 (file)
index 6c9f694..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-http://ftp.uk.debian.org/debian/pool/main/b/boost/libboost-dev_1.34.1-14_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libm/libmad/libmad0-dev_0.15.1b-4_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libs/libsamplerate/libsamplerate0-dev_0.1.4-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libs/libsamplerate/libsamplerate0_0.1.4-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libv/libvorbis/libvorbis-dev_1.2.0.dfsg-3.1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libv/libvorbis/libvorbisfile3_1.2.0.dfsg-3.1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.2.0.dfsg-3.1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/f/fribidi/libfribidi-dev_0.10.9-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/m/mysql-dfsg-5.0/libmysqlclient15-dev_5.0.51a-24+lenny1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/p/pcre3/libpcre3-dev_7.6-2.1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/l/lzo2/liblzo2-dev_2.03-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.03-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libc/libcdio/libcdio-dev_0.78.2+dfsg1-3_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libs/libsdl1.2/libsdl1.2-dev_1.2.13-2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libs/libsdl1.2/libsdl1.2debian_1.2.13-2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libs/libsdl1.2/libsdl1.2debian-all_1.2.13-2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/a/arts/libartsc0_1.5.9-2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/e/esound/libesd0_0.2.36-3_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/a/audiofile/libaudiofile0_0.2.6-7_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/p/pulseaudio/libpulse-dev_0.9.10-3+lenny1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/p/pulseaudio/libpulse0_0.9.10-3+lenny1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/n/nas/libaudio2_1.9.1-5_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/d/directfb/libdirectfb-1.0-0_1.0.1-11_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/a/aalib/libaa1_1.4p5-37+b1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libc/libcap/libcap1_1.10-14_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.3-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libncurses5-dev_5.7+20081213-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libncurses5_5.7+20081213-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/s/slang2/libslang2_2.1.3-3_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/g/gpm/libgpm2_1.20.4-3.1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/s/sdl-mixer1.2/libsdl-mixer1.2-dev_1.2.8-4_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/s/sdl-mixer1.2/libsdl-mixer1.2_1.2.8-4_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libm/libmikmod/libmikmod2_3.1.11-a-6_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/s/smpeg/libsmpeg0_0.4.5+cvs20030824-2.2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/e/enca/libenca-dev_1.9-6_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/e/enca/libenca0_1.9-6_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/j/jasper/libjasper-dev_1.900.1-5.1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libm/libmms/libmms-dev_0.4-2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libm/libmms/libmms0_0.4-2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/c/curl/libcurl4-gnutls-dev_7.18.2-8lenny3_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.18.2-8lenny3_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libi/libidn/libidn11_1.8+20080606-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/o/openldap/libldap-2.4-2_2.4.11-1_armel.deb
-http://security.debian.org/debian-security/pool/updates/main/g/gnutls26/libgnutls26_2.4.2-6+lenny2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libt/libtasn1-3/libtasn1-3_1.4-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.22.dfsg1-23+lenny1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5lenny1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.2-9_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.41.3-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/c/cmake/cmake_2.6.0-6_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/n/nasm/nasm_2.03.01-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libj/libjpeg6b/libjpeg62-dev_6b-14_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libj/libjpeg6b/libjpeg62_6b-14_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/t/tiff/libtiff4_3.8.2-11_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/p/python2.5/python2.5-dev_2.5.2-15_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/p/python2.5/python2.5_2.5.2-15_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/s/sdl-image1.2/libsdl-image1.2-dev_1.2.6-3_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/s/sdl-image1.2/libsdl-image1.2_1.2.6-3_armel.deb
-http://security.debian.org/debian-security/pool/updates/main/s/samba/libsmbclient-dev_3.2.5-4lenny7_armel.deb
-http://security.debian.org/debian-security/pool/updates/main/s/samba/libsmbclient_3.2.5-4lenny7_armel.deb
-http://security.debian.org/debian-security/pool/updates/main/s/samba/libwbclient0_3.2.5-4lenny7_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/t/talloc/libtalloc1_1.2.0~git20080616-1_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/f/flac/libflac-dev_1.2.1-1.2_armel.deb
-http://ftp.uk.debian.org/debian/pool/main/libc/libcdio/libiso9660-dev_0.78.2+dfsg1-3_armel.deb
-http://security.debian.org/debian-security/pool/updates/main/d/dbus/libdbus-1-dev_1.2.1-5+lenny1_armel.deb
-http://security.debian.org/debian-security/pool/updates/main/d/dbus/libdbus-1-3_1.2.1-5+lenny1_armel.deb
diff --git a/tools/buildbot/darwin-depends-check b/tools/buildbot/darwin-depends-check
deleted file mode 100755 (executable)
index 231f676..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-git diff-tree --quiet -r HEAD@{1}..HEAD@{0} tools/darwin/depends/
-echo $?
diff --git a/tools/buildbot/gitrev-posix b/tools/buildbot/gitrev-posix
deleted file mode 100755 (executable)
index dd593f1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-#Print the git revision in the form yyyymmdd-abc1234
-#Note: yyyymmdd is the date that abc1234 was committed and not today's date.
-
-which git &>/dev/null
-if [ "$?" != "0" ]; then
-  echo "Unknown"
-  exit 1
-fi
-git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}' 2>/dev/null
-if [ "$?" != "0" ]; then
-  echo "Unknown"
-  exit 1
-fi
index f3c40a9..3649904 100755 (executable)
@@ -45,7 +45,7 @@ fi
 PACKAGE=org.xbmc.xbmc-atv2
 
 VERSION=13.0
-REVISION=0~alpha8
+REVISION=0~alpha9
 ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb
 
 echo Creating $PACKAGE package version $VERSION revision $REVISION
index c6d6c3b..63a298a 100755 (executable)
@@ -46,7 +46,7 @@ fi
 PACKAGE=org.xbmc.xbmc-ios
 
 VERSION=13.0
-REVISION=0~alpha8
+REVISION=0~alpha9
 ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb
 
 echo Creating $PACKAGE package version $VERSION revision $REVISION
index d1a64d9..c1aea8e 100755 (executable)
@@ -25,7 +25,7 @@ ARCHITECTURE=`file $XBMC/Contents/MacOS/XBMC | awk '{print $NF}'`
 PACKAGE=org.xbmc.xbmc-osx
 
 VERSION=13.0
-REVISION=0~alpha8
+REVISION=0~alpha9
 ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE}
 
 echo Creating $PACKAGE package version $VERSION revision $REVISION
diff --git a/tools/win32buildtools/nasmw.exe b/tools/win32buildtools/nasmw.exe
deleted file mode 100644 (file)
index 8d72cc7..0000000
Binary files a/tools/win32buildtools/nasmw.exe and /dev/null differ
index 266b9d8..94e5e9e 100644 (file)
@@ -763,6 +763,8 @@ bool CApplication::Create()
 
   CLog::Log(LOGINFO, "load language info file: %s", strLangInfoPath.c_str());
   g_langInfo.Load(strLangInfoPath);
+  g_langInfo.SetAudioLanguage(CSettings::Get().GetString("locale.audiolanguage"));
+  g_langInfo.SetSubtitleLanguage(CSettings::Get().GetString("locale.subtitlelanguage"));
 
   CStdString strLanguagePath = "special://xbmc/language/";
 
index 57980a1..b6e82ec 100644 (file)
@@ -775,7 +775,7 @@ bool CFileItem::Exists(bool bUseCache /* = true */) const
 bool CFileItem::IsVideo() const
 {
   /* check preset mime type */
-  if( m_mimetype.Left(6).Equals("video/") )
+  if( StringUtils::StartsWithNoCase(m_mimetype, "video/") )
     return true;
 
   if (HasVideoInfoTag()) return true;
@@ -787,7 +787,7 @@ bool CFileItem::IsVideo() const
     return true;
 
   CStdString extension;
-  if( m_mimetype.Left(12).Equals("application/") )
+  if( StringUtils::StartsWithNoCase(m_mimetype, "application/") )
   { /* check for some standard types */
     extension = m_mimetype.Mid(12);
     if( extension.Equals("ogg")
@@ -837,7 +837,7 @@ bool CFileItem::IsDiscStub() const
 bool CFileItem::IsAudio() const
 {
   /* check preset mime type */
-  if( m_mimetype.Left(6).Equals("audio/") )
+  if( StringUtils::StartsWithNoCase(m_mimetype, "audio/") )
     return true;
 
   if (HasMusicInfoTag()) return true;
@@ -845,7 +845,7 @@ bool CFileItem::IsAudio() const
   if (HasPictureInfoTag()) return false;
   if (IsCDDA()) return true;
 
-  if( m_mimetype.Left(12).Equals("application/") )
+  if( StringUtils::StartsWithNoCase(m_mimetype, "application/") )
   { /* check for some standard types */
     CStdString extension = m_mimetype.Mid(12);
     if( extension.Equals("ogg")
@@ -867,7 +867,7 @@ bool CFileItem::IsKaraoke() const
 
 bool CFileItem::IsPicture() const
 {
-  if( m_mimetype.Left(6).Equals("image/") )
+  if( StringUtils::StartsWithNoCase(m_mimetype, "image/") )
     return true;
 
   if (HasPictureInfoTag()) return true;
@@ -989,12 +989,12 @@ bool CFileItem::IsDVDFile(bool bVobs /*= true*/, bool bIfos /*= true*/) const
   if (bIfos)
   {
     if (strFileName.Equals("video_ts.ifo")) return true;
-    if (strFileName.Left(4).Equals("vts_") && strFileName.Right(6).Equals("_0.ifo") && strFileName.length() == 12) return true;
+    if (StringUtils::StartsWithNoCase(strFileName, "vts_") && StringUtils::EndsWithNoCase(strFileName, "_0.ifo") && strFileName.length() == 12) return true;
   }
   if (bVobs)
   {
     if (strFileName.Equals("video_ts.vob")) return true;
-    if (strFileName.Left(4).Equals("vts_") && strFileName.Right(4).Equals(".vob")) return true;
+    if (StringUtils::StartsWithNoCase(strFileName, "vts_") && StringUtils::EndsWithNoCase(strFileName, ".vob")) return true;
   }
 
   return false;
@@ -1033,7 +1033,7 @@ bool CFileItem::IsCBR() const
 
 bool CFileItem::IsRSS() const
 {
-  return m_strPath.Left(6).Equals("rss://") || URIUtils::HasExtension(m_strPath, ".rss")
+  return StringUtils::StartsWithNoCase(m_strPath, "rss://") || URIUtils::HasExtension(m_strPath, ".rss")
       || m_mimetype == "application/rss+xml";
 }
 
@@ -1368,9 +1368,9 @@ void CFileItem::FillInMimeType(bool lookup /*= true*/)
       m_mimetype = "x-directory/normal";
     else if( m_pvrChannelInfoTag )
       m_mimetype = m_pvrChannelInfoTag->InputFormat();
-    else if( m_strPath.Left(8).Equals("shout://")
-          || m_strPath.Left(7).Equals("http://")
-          || m_strPath.Left(8).Equals("https://"))
+    else if( StringUtils::StartsWithNoCase(m_strPath, "shout://")
+          || StringUtils::StartsWithNoCase(m_strPath, "http://")
+          || StringUtils::StartsWithNoCase(m_strPath, "https://"))
     {
       // If lookup is false, bail out early to leave mime type empty
       if (!lookup)
@@ -1381,7 +1381,7 @@ void CFileItem::FillInMimeType(bool lookup /*= true*/)
       // try to get mime-type again but with an NSPlayer User-Agent
       // in order for server to provide correct mime-type.  Allows us
       // to properly detect an MMS stream
-      if (m_mimetype.Left(11).Equals("video/x-ms-"))
+      if (StringUtils::StartsWithNoCase(m_mimetype, "video/x-ms-"))
         CCurlFile::GetMimeType(GetAsUrl(), m_mimetype, "NSPlayer/11.00.6001.7000");
 
       // make sure there are no options set in mime-type
@@ -1400,7 +1400,7 @@ void CFileItem::FillInMimeType(bool lookup /*= true*/)
   }
 
   // change protocol to mms for the following mime-type.  Allows us to create proper FileMMS.
-  if( m_mimetype.Left(32).Equals("application/vnd.ms.wms-hdr.asfv1") || m_mimetype.Left(24).Equals("application/x-mms-framed") )
+  if( StringUtils::StartsWithNoCase(m_mimetype, "application/vnd.ms.wms-hdr.asfv1") || StringUtils::StartsWithNoCase(m_mimetype, "application/x-mms-framed") )
     m_strPath.Replace("http:", "mms:");
 }
 
@@ -2655,8 +2655,8 @@ bool CFileItemList::AlwaysCache() const
 CStdString CFileItem::GetUserMusicThumb(bool alwaysCheckRemote /* = false */, bool fallbackToFolder /* = false */) const
 {
   if (m_strPath.IsEmpty()
-   || m_strPath.Left(19).Equals("newsmartplaylist://")
-   || m_strPath.Left(14).Equals("newplaylist://")
+   || StringUtils::StartsWithNoCase(m_strPath, "newsmartplaylist://")
+   || StringUtils::StartsWithNoCase(m_strPath, "newplaylist://")
    || m_bIsShareOrDrive
    || IsInternetStream()
    || URIUtils::IsUPnP(m_strPath)
@@ -2748,8 +2748,8 @@ CStdString CFileItem::FindLocalArt(const std::string &artFile, bool useFolder) c
 {
   // ignore a bunch that are meaningless
   if (m_strPath.empty()
-   || m_strPath.Left(19).Equals("newsmartplaylist://")
-   || m_strPath.Left(14).Equals("newplaylist://")
+   || StringUtils::StartsWithNoCase(m_strPath, "newsmartplaylist://")
+   || StringUtils::StartsWithNoCase(m_strPath, "newplaylist://")
    || m_bIsShareOrDrive
    || IsInternetStream()
    || URIUtils::IsUPnP(m_strPath)
index 935118a..5b55c31 100644 (file)
@@ -299,7 +299,6 @@ const infomap network_labels[] = {{ "isdhcp",            NETWORK_IS_DHCP },
                                   { "ipaddress",         NETWORK_IP_ADDRESS }, //labels from here
                                   { "linkstate",         NETWORK_LINK_STATE },
                                   { "macaddress",        NETWORK_MAC_ADDRESS },
-                                  { "subnetaddress",     NETWORK_SUBNET_MASK }, //subnetaddress is misleading/wrong. should be deprecated. use subnetmask in stead
                                   { "subnetmask",        NETWORK_SUBNET_MASK },
                                   { "gatewayaddress",    NETWORK_GATEWAY_ADDRESS },
                                   { "dns1address",       NETWORK_DNS1_ADDRESS },
index 0a15c86..6b9f09b 100644 (file)
@@ -490,7 +490,7 @@ namespace INFO
 
 #define VERSION_MAJOR               13
 #define VERSION_MINOR               0
-#define VERSION_TAG                 "-ALPHA8"
+#define VERSION_TAG                 "-ALPHA9"
 
 #define LISTITEM_START              35000
 #define LISTITEM_THUMB              (LISTITEM_START)
index d6e4102..deead9b 100644 (file)
@@ -24,6 +24,7 @@
 #include "URL.h"
 #include "filesystem/MultiPathDirectory.h"
 #include "utils/URIUtils.h"
+#include "utils/StringUtils.h"
 
 using namespace std;
 using namespace XFILE;
@@ -58,7 +59,7 @@ void CMediaSource::FromNameAndPaths(const CStdString &category, const CStdString
 
   if (URIUtils::IsMultiPath(strPath))
     m_iDriveType = SOURCE_TYPE_VPATH;
-  else if (strPath.Left(4).Equals("udf:"))
+  else if (StringUtils::StartsWithNoCase(strPath, "udf:"))
   {
     m_iDriveType = SOURCE_TYPE_VIRTUAL_DVD;
     strPath = "D:\\";
index b8d308f..251ff17 100644 (file)
@@ -28,6 +28,7 @@
 #include "utils/log.h"
 #include "utils/URIUtils.h"
 #include "URL.h"
+#include "utils/StringUtils.h"
 
 using namespace XFILE;
 
@@ -96,7 +97,7 @@ CStdString CTextureCache::GetCachedImage(const CStdString &image, CTextureDetail
 
 CStdString CTextureCache::GetWrappedImageURL(const CStdString &image, const CStdString &type, const CStdString &options)
 {
-  if (image.compare(0, 8, "image://") == 0)
+  if (StringUtils::StartsWith(image, "image://"))
     return image; // already wrapped
 
   CURL url;
@@ -118,7 +119,7 @@ CStdString CTextureCache::GetWrappedThumbURL(const CStdString &image)
 
 CStdString CTextureCache::UnwrapImageURL(const CStdString &image)
 {
-  if (image.compare(0, 8, "image://") == 0)
+  if (StringUtils::StartsWith(image, "image://"))
   {
     CURL url(image);
     if (url.GetUserName().IsEmpty() && url.GetOptions().IsEmpty())
index 564bbfd..97855f7 100644 (file)
@@ -118,7 +118,7 @@ CStdString CTextureCacheJob::DecodeImageURL(const CStdString &url, unsigned int
   CStdString image(url);
   additional_info.clear();
   width = height = 0;
-  if (url.compare(0, 8, "image://") == 0)
+  if (StringUtils::StartsWith(url, "image://"))
   {
     // format is image://[type@]<url_encoded_path>?options
     CURL thumbURL(url);
@@ -175,7 +175,7 @@ CBaseTexture *CTextureCacheJob::LoadImage(const CStdString &image, unsigned int
   CFileItem file(image, false);
   file.FillInMimeType();
   if (!(file.IsPicture() && !(file.IsZIP() || file.IsRAR() || file.IsCBR() || file.IsCBZ() ))
-      && !file.GetMimeType().Left(6).Equals("image/") && !file.GetMimeType().Equals("application/octet-stream")) // ignore non-pictures
+      && !StringUtils::StartsWithNoCase(file.GetMimeType(), "image/") && !file.GetMimeType().Equals("application/octet-stream")) // ignore non-pictures
     return NULL;
 
   CBaseTexture *texture = CBaseTexture::LoadFromFile(image, width, height, CSettings::Get().GetBool("pictures.useexifrotation"));
@@ -194,8 +194,8 @@ CBaseTexture *CTextureCacheJob::LoadImage(const CStdString &image, unsigned int
 bool CTextureCacheJob::UpdateableURL(const CStdString &url) const
 {
   // we don't constantly check online images
-  if (url.compare(0, 7, "http://") == 0 ||
-      url.compare(0, 8, "https://") == 0)
+  if (StringUtils::StartsWith(url, "http://") ||
+      StringUtils::StartsWith(url, "https://"))
     return false;
   return true;
 }
index 65057d5..20c4372 100644 (file)
@@ -27,6 +27,7 @@
 #include "FileItem.h"
 #include "filesystem/StackDirectory.h"
 #include "addons/Addon.h"
+#include "utils/StringUtils.h"
 #ifndef TARGET_POSIX
 #include <sys\types.h>
 #include <sys\stat.h>
@@ -684,7 +685,7 @@ bool CURL::IsFullPath(const CStdString &url)
   if (url.size() && url[0] == '/') return true;     //   /foo/bar.ext
   if (url.Find("://") >= 0) return true;                 //   foo://bar.ext
   if (url.size() > 1 && url[1] == ':') return true; //   c:\\foo\\bar\\bar.ext
-  if (url.compare(0,2,"\\\\") == 0) return true;    //   \\UNC\path\to\file
+  if (StringUtils::StartsWith(url, "\\\\")) return true;    //   \\UNC\path\to\file
   return false;
 }
 
index 4e65770..e871582 100644 (file)
@@ -209,11 +209,11 @@ CStdString CUtil::GetTitleFromPath(const CStdString& strFileNameAndPath, bool bI
     strFilename = g_localizeStrings.Get(744);
 
   // Music Playlists
-  else if (path.Left(24).Equals("special://musicplaylists"))
+  else if (StringUtils::StartsWithNoCase(path, "special://musicplaylists"))
     strFilename = g_localizeStrings.Get(136);
 
   // Video Playlists
-  else if (path.Left(24).Equals("special://videoplaylists"))
+  else if (StringUtils::StartsWithNoCase(path, "special://videoplaylists"))
     strFilename = g_localizeStrings.Get(136);
 
   else if (URIUtils::ProtocolHasParentInHostname(url.GetProtocol()) && strFilename.IsEmpty())
@@ -473,24 +473,24 @@ void CUtil::GetHomePath(CStdString& strPath, const CStdString& strTarget)
 
 bool CUtil::IsPVR(const CStdString& strFile)
 {
-  return strFile.Left(4).Equals("pvr:");
+  return StringUtils::StartsWithNoCase(strFile, "pvr:");
 }
 
 bool CUtil::IsHTSP(const CStdString& strFile)
 {
-  return strFile.Left(5).Equals("htsp:");
+  return StringUtils::StartsWithNoCase(strFile, "htsp:");
 }
 
 bool CUtil::IsLiveTV(const CStdString& strFile)
 {
-  if (strFile.Left(14).Equals("pvr://channels"))
+  if (StringUtils::StartsWithNoCase(strFile, "pvr://channels"))
     return true;
 
   if(URIUtils::IsTuxBox(strFile)
   || URIUtils::IsVTP(strFile)
   || URIUtils::IsHDHomeRun(strFile)
   || URIUtils::IsHTSP(strFile)
-  || strFile.Left(4).Equals("sap:"))
+  || StringUtils::StartsWithNoCase(strFile, "sap:"))
     return true;
 
   if (URIUtils::IsMythTV(strFile) && CMythDirectory::IsLiveTV(strFile))
@@ -501,7 +501,7 @@ bool CUtil::IsLiveTV(const CStdString& strFile)
 
 bool CUtil::IsTVRecording(const CStdString& strFile)
 {
-  return strFile.Left(15).Equals("pvr://recording");
+  return StringUtils::StartsWithNoCase(strFile, "pvr://recording");
 }
 
 bool CUtil::IsPicture(const CStdString& strFile)
@@ -740,25 +740,6 @@ CStdString CUtil::GetNextPathname(const CStdString &path_template, int max)
   return "";
 }
 
-void CUtil::Tokenize(const CStdString& path, vector<CStdString>& tokens, const string& delimiters)
-{
-  // Tokenize ripped from http://www.linuxselfhelp.com/HOWTO/C++Programming-HOWTO-7.html
-  // Skip delimiters at beginning.
-  string::size_type lastPos = path.find_first_not_of(delimiters, 0);
-  // Find first "non-delimiter".
-  string::size_type pos = path.find_first_of(delimiters, lastPos);
-
-  while (string::npos != pos || string::npos != lastPos)
-  {
-    // Found a token, add it to the vector.
-    tokens.push_back(path.substr(lastPos, pos - lastPos));
-    // Skip delimiters.  Note the "not_of"
-    lastPos = path.find_first_not_of(delimiters, pos);
-    // Find next "non-delimiter"
-    pos = path.find_first_of(delimiters, lastPos);
-  }
-}
-
 void CUtil::StatToStatI64(struct _stati64 *result, struct stat *stat)
 {
   result->st_dev = stat->st_dev;
@@ -969,12 +950,12 @@ CStdString CUtil::ValidatePath(const CStdString &path, bool bFixDoubleSlashes /*
   // recurse and crash XBMC
   if (URIUtils::IsURL(path) && 
      (path.Find('%') >= 0 ||
-      path.Left(4).Equals("apk:") ||
-      path.Left(4).Equals("zip:") ||
-      path.Left(4).Equals("rar:") ||
-      path.Left(6).Equals("stack:") ||
-      path.Left(7).Equals("bluray:") ||
-      path.Left(10).Equals("multipath:") ))
+      StringUtils::StartsWithNoCase(path, "apk:") ||
+      StringUtils::StartsWithNoCase(path, "zip:") ||
+      StringUtils::StartsWithNoCase(path, "rar:") ||
+      StringUtils::StartsWithNoCase(path, "stack:") ||
+      StringUtils::StartsWithNoCase(path, "bluray:") ||
+      StringUtils::StartsWithNoCase(path, "multipath:") ))
     return result;
 
   // check the path for incorrect slashes
@@ -1066,7 +1047,7 @@ void CUtil::SplitExecFunction(const CStdString &execString, CStdString &function
 
   // remove any whitespace, and the standard prefix (if it exists)
   function.Trim();
-  if( function.Left(5).Equals("xbmc.", false) )
+  if( StringUtils::StartsWithNoCase(function, "xbmc.") )
     function.Delete(0, 5);
 
   SplitParams(paramString, parameters);
@@ -1267,7 +1248,7 @@ int CUtil::GetMatchingSource(const CStdString& strPath1, VECSOURCES& VECSOURCES,
         strShare += "/";
       int iLenShare = strShare.size();
 
-      if ((iLenPath >= iLenShare) && (strDest.Left(iLenShare).Equals(strShare)) && (iLenShare > iLength))
+      if ((iLenPath >= iLenShare) && StringUtils::StartsWithNoCase(strDest, strShare) && (iLenShare > iLength))
       {
         // if exact match, return it immediately
         if (iLenPath == iLenShare)
@@ -1291,7 +1272,7 @@ int CUtil::GetMatchingSource(const CStdString& strPath1, VECSOURCES& VECSOURCES,
 
     // rar:// and zip://
     // if archive wasn't mounted, look for a matching share for the archive instead
-    if( strPath.Left(6).Equals("rar://") || strPath.Left(6).Equals("zip://") )
+    if( StringUtils::StartsWithNoCase(strPath, "rar://") || StringUtils::StartsWithNoCase(strPath, "zip://") )
     {
       // get the hostname portion of the url since it contains the archive file
       strPath = checkURL.GetHostName();
@@ -1310,28 +1291,28 @@ CStdString CUtil::TranslateSpecialSource(const CStdString &strSpecial)
 {
   if (!strSpecial.IsEmpty() && strSpecial[0] == '$')
   {
-    if (strSpecial.Left(5).Equals("$HOME"))
+    if (StringUtils::StartsWithNoCase(strSpecial, "$home"))
       return URIUtils::AddFileToFolder("special://home/", strSpecial.Mid(5));
-    else if (strSpecial.Left(10).Equals("$SUBTITLES"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$subtitles"))
       return URIUtils::AddFileToFolder("special://subtitles/", strSpecial.Mid(10));
-    else if (strSpecial.Left(9).Equals("$USERDATA"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$userdata"))
       return URIUtils::AddFileToFolder("special://userdata/", strSpecial.Mid(9));
-    else if (strSpecial.Left(9).Equals("$DATABASE"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$database"))
       return URIUtils::AddFileToFolder("special://database/", strSpecial.Mid(9));
-    else if (strSpecial.Left(11).Equals("$THUMBNAILS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$thumbnails"))
       return URIUtils::AddFileToFolder("special://thumbnails/", strSpecial.Mid(11));
-    else if (strSpecial.Left(11).Equals("$RECORDINGS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$recordings"))
       return URIUtils::AddFileToFolder("special://recordings/", strSpecial.Mid(11));
-    else if (strSpecial.Left(12).Equals("$SCREENSHOTS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$screenshots"))
       return URIUtils::AddFileToFolder("special://screenshots/", strSpecial.Mid(12));
-    else if (strSpecial.Left(15).Equals("$MUSICPLAYLISTS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$musicplaylists"))
       return URIUtils::AddFileToFolder("special://musicplaylists/", strSpecial.Mid(15));
-    else if (strSpecial.Left(15).Equals("$VIDEOPLAYLISTS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$videoplaylists"))
       return URIUtils::AddFileToFolder("special://videoplaylists/", strSpecial.Mid(15));
-    else if (strSpecial.Left(7).Equals("$CDRIPS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$cdrips"))
       return URIUtils::AddFileToFolder("special://cdrips/", strSpecial.Mid(7));
     // this one will be removed post 2.0
-    else if (strSpecial.Left(10).Equals("$PLAYLISTS"))
+    else if (StringUtils::StartsWithNoCase(strSpecial, "$playlists"))
       return URIUtils::AddFileToFolder(CSettings::Get().GetString("system.playlistspath"), strSpecial.Mid(10));
   }
   return strSpecial;
@@ -1938,7 +1919,7 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector<CSt
       StringUtils::SplitString( strLookInPaths[i], "\\", directories );
 
     // if it's inside a cdX dir, add parent path
-    if (directories.size() >= 2 && directories[directories.size()-2].size() == 3 && directories[directories.size()-2].Left(2).Equals("cd")) // SplitString returns empty token as last item, hence size-2
+    if (directories.size() >= 2 && directories[directories.size()-2].size() == 3 && StringUtils::StartsWithNoCase(directories[directories.size()-2], "cd")) // SplitString returns empty token as last item, hence size-2
     {
       CStdString strPath2;
       URIUtils::GetParentPath(strLookInPaths[i], strPath2);
@@ -2004,13 +1985,12 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector<CSt
       CFileItemList items;
       
       CDirectory::GetDirectory(strLookInPaths[step], items,".utf|.utf8|.utf-8|.sub|.srt|.smi|.rt|.txt|.ssa|.text|.ssa|.aqt|.jss|.ass|.idx|.ifo|.rar|.zip",DIR_FLAG_NO_FILE_DIRS);
-      int fnl = strMovieFileNameNoExt.size();
       
       for (int j = 0; j < items.Size(); j++)
       {
         URIUtils::Split(items[j]->GetPath(), strPath, strItem);
         
-        if (strItem.Left(fnl).Equals(strMovieFileNameNoExt))
+        if (StringUtils::StartsWithNoCase(strItem, strMovieFileNameNoExt))
         {
           // is this a rar or zip-file
           if (URIUtils::IsRAR(strItem) || URIUtils::IsZIP(strItem))
@@ -2119,7 +2099,7 @@ int CUtil::ScanArchiveForSubtitles( const CStdString& strArchivePath, const CStd
 
    // check that the found filename matches the movie filename
    int fnl = strMovieFileNameNoExt.size();
-   if (fnl && !URIUtils::GetFileName(strPathInRar).Left(fnl).Equals(strMovieFileNameNoExt))
+   if (fnl && !StringUtils::StartsWithNoCase(URIUtils::GetFileName(strPathInRar), strMovieFileNameNoExt))
      continue;
 
    int iPos=0;
index 1cc11dd..d2b5046 100644 (file)
@@ -91,7 +91,6 @@ public:
   static int64_t ToInt64(uint32_t high, uint32_t low);
   static CStdString GetNextFilename(const CStdString &fn_template, int max);
   static CStdString GetNextPathname(const CStdString &path_template, int max);
-  static void Tokenize(const CStdString& path, std::vector<CStdString>& tokens, const std::string& delimiters);
   static void StatToStatI64(struct _stati64 *result, struct stat *stat);
   static void Stat64ToStatI64(struct _stati64 *result, struct __stat64 *stat);
   static void StatI64ToStat64(struct __stat64 *result, struct _stati64 *stat);
index 1b8bcb4..abd7136 100644 (file)
@@ -286,19 +286,19 @@ bool CGUIDialogAddonSettings::ShowVirtualKeyboard(int iControl)
             pDlg->Reset();
 
             int selected = -1;
-            vector<CStdString> valuesVec;
+            vector<std::string> valuesVec;
             if (setting->Attribute("values"))
-              CUtil::Tokenize(setting->Attribute("values"), valuesVec, "|");
+              StringUtils::Tokenize(setting->Attribute("values"), valuesVec, "|");
             else if (setting->Attribute("lvalues"))
             { // localize
-              CUtil::Tokenize(setting->Attribute("lvalues"), valuesVec, "|");
+              StringUtils::Tokenize(setting->Attribute("lvalues"), valuesVec, "|");
               for (unsigned int i = 0; i < valuesVec.size(); i++)
               {
                 if (i == (unsigned int)atoi(value))
                   selected = i;
-                CStdString localized = m_addon->GetString(atoi(valuesVec[i]));
+                CStdString localized = m_addon->GetString(atoi(valuesVec[i].c_str()));
                 if (localized.IsEmpty())
-                  localized = g_localizeStrings.Get(atoi(valuesVec[i]));
+                  localized = g_localizeStrings.Get(atoi(valuesVec[i].c_str()));
                 valuesVec[i] = localized;
               }
             }
@@ -310,7 +310,7 @@ bool CGUIDialogAddonSettings::ShowVirtualKeyboard(int iControl)
             for (unsigned int i = 0; i < valuesVec.size(); i++)
             {
               pDlg->Add(valuesVec[i]);
-              if (selected == (int)i || (selected < 0 && valuesVec[i].Equals(value)))
+              if (selected == (int)i || (selected < 0 && StringUtils::EqualsNoCase(valuesVec[i], value)))
                 pDlg->SetSelected(i); // FIXME: the SetSelected() does not select "i", it always defaults to the first position
             }
             pDlg->DoModal();
@@ -747,15 +747,15 @@ void CGUIDialogAddonSettings::CreateControls()
       }
       else if (strcmpi(type, "enum") == 0 || strcmpi(type, "labelenum") == 0)
       {
-        vector<CStdString> valuesVec;
-        vector<CStdString> entryVec;
+        vector<std::string> valuesVec;
+        vector<std::string> entryVec;
 
         pControl = new CGUISpinControlEx(*pOriginalSpin);
         if (!pControl) return;
         ((CGUISpinControlEx *)pControl)->SetText(label);
 
         if (!lvalues.IsEmpty())
-          CUtil::Tokenize(lvalues, valuesVec, "|");
+          StringUtils::Tokenize(lvalues, valuesVec, "|");
         else if (values.Equals("$HOURS"))
         {
           for (unsigned int i = 0; i < 24; i++)
@@ -765,9 +765,9 @@ void CGUIDialogAddonSettings::CreateControls()
           }
         }
         else
-          CUtil::Tokenize(values, valuesVec, "|");
+          StringUtils::Tokenize(values, valuesVec, "|");
         if (!entries.IsEmpty())
-          CUtil::Tokenize(entries, entryVec, "|");
+          StringUtils::Tokenize(entries, entryVec, "|");
 
         if(bSort && strcmpi(type, "labelenum") == 0)
           std::sort(valuesVec.begin(), valuesVec.end(), sortstringbyname());
@@ -776,12 +776,12 @@ void CGUIDialogAddonSettings::CreateControls()
         {
           int iAdd = i;
           if (entryVec.size() > i)
-            iAdd = atoi(entryVec[i]);
+            iAdd = atoi(entryVec[i].c_str());
           if (!lvalues.IsEmpty())
           {
-            CStdString replace = m_addon->GetString(atoi(valuesVec[i]));
+            CStdString replace = m_addon->GetString(atoi(valuesVec[i].c_str()));
             if (replace.IsEmpty())
-              replace = g_localizeStrings.Get(atoi(valuesVec[i]));
+              replace = g_localizeStrings.Get(atoi(valuesVec[i].c_str()));
             ((CGUISpinControlEx *)pControl)->AddLabel(replace, iAdd);
           }
           else
@@ -802,11 +802,11 @@ void CGUIDialogAddonSettings::CreateControls()
         ((CGUISpinControlEx *)pControl)->SetText(label);
         ((CGUISpinControlEx *)pControl)->SetFloatValue(1.0f);
 
-        vector<CStdString> items = GetFileEnumValues(values, setting->Attribute("mask"), setting->Attribute("option"));
+        vector<std::string> items = GetFileEnumValues(values, setting->Attribute("mask"), setting->Attribute("option"));
         for (unsigned int i = 0; i < items.size(); ++i)
         {
           ((CGUISpinControlEx *)pControl)->AddLabel(items[i], i);
-          if (items[i].Equals(m_settings[id]))
+          if (StringUtils::EqualsNoCase(items[i], m_settings[id]))
             ((CGUISpinControlEx *)pControl)->SetValue(i);
         }
       }
@@ -933,7 +933,7 @@ CStdString CGUIDialogAddonSettings::GetAddonNames(const CStdString& addonIDslist
   return retVal;
 }
 
-vector<CStdString> CGUIDialogAddonSettings::GetFileEnumValues(const CStdString &path, const CStdString &mask, const CStdString &options) const
+vector<std::string> CGUIDialogAddonSettings::GetFileEnumValues(const CStdString &path, const CStdString &mask, const CStdString &options) const
 {
   // Create our base path, used for type "fileenum" settings
   // replace $PROFILE with the profile path of the plugin/script
@@ -951,7 +951,7 @@ vector<CStdString> CGUIDialogAddonSettings::GetFileEnumValues(const CStdString &
   else
     CDirectory::GetDirectory(fullPath, items, "", XFILE::DIR_FLAG_NO_FILE_DIRS);
 
-  vector<CStdString> values;
+  vector<std::string> values;
   for (int i = 0; i < items.Size(); ++i)
   {
     CFileItemPtr pItem = items[i];
@@ -998,15 +998,15 @@ bool CGUIDialogAddonSettings::GetCondition(const CStdString &condition, const in
   bool bCondition = true;
   bool bCompare = true;
   bool bControlDependend = false;//flag if the condition depends on another control
-  vector<CStdString> conditionVec;
+  vector<std::string> conditionVec;
 
   if (condition.Find("+") >= 0)
-    CUtil::Tokenize(condition, conditionVec, "+");
+    StringUtils::Tokenize(condition, conditionVec, "+");
   else
   {
     bCondition = false;
     bCompare = false;
-    CUtil::Tokenize(condition, conditionVec, "|");
+    StringUtils::Tokenize(condition, conditionVec, "|");
   }
 
   for (unsigned int i = 0; i < conditionVec.size(); i++)
index 44080fe..495866e 100644 (file)
@@ -56,7 +56,7 @@ private:
    \param options any options, such as "hideext" to hide extensions
    \return the filenames in the path that match the mask
    */
-  std::vector<CStdString> GetFileEnumValues(const CStdString &path, const CStdString &mask, const CStdString &options) const;
+  std::vector<std::string> GetFileEnumValues(const CStdString &path, const CStdString &mask, const CStdString &options) const;
 
   /*! \brief Translate list of addon IDs to list of addon names
    \param addonIDslist comma seperated list of addon IDs
index fd7aef3..d2d1484 100644 (file)
@@ -480,7 +480,7 @@ int CGUIWindowAddonBrowser::SelectAddonID(const vector<ADDON::TYPE> &types, CStd
 
 CStdString CGUIWindowAddonBrowser::GetStartFolder(const CStdString &dir)
 {
-  if (dir.Left(9).Equals("addons://"))
+  if (StringUtils::StartsWithNoCase(dir, "addons://"))
     return dir;
   return CGUIMediaWindow::GetStartFolder(dir);
 }
index 7a924be..983ab70 100644 (file)
@@ -298,7 +298,7 @@ std::vector<int> CJNIMediaCodecInfoCodecCapabilities::colorFormats() const
 {
   JNIEnv *env = xbmc_jnienv();
 
-  jhintArray colorFormats = get_field<jhintArray>(m_object, "numBytesOfEncryptedData");
+  jhintArray colorFormats = get_field<jhintArray>(m_object, "colorFormats");
   jsize size = env->GetArrayLength(colorFormats.get());
   std::vector<int> intarray;
   intarray.resize(size);
index 7a6732a..c0746dc 100644 (file)
@@ -1571,6 +1571,7 @@ bool CActiveAE::RunStages()
           allStreamsReady = false;
       }
 
+      bool needClamp = false;
       for (it = m_streams.begin(); it != m_streams.end() && allStreamsReady; ++it)
       {
         if ((*it)->m_paused || !(*it)->m_resampleBuffers)
@@ -1638,7 +1639,9 @@ bool CActiveAE::RunStages()
 #else
                 float* fbuffer = (float*) out->pkt->data[j]+i*nb_floats;
                 for (int k = 0; k < nb_floats; ++k)
-                  *fbuffer++ *= m_muted ? 0.0 : volume;
+                {
+                  fbuffer[k] *= m_muted ? 0.0 : volume;
+                }
 #endif
               }
             }
@@ -1701,9 +1704,21 @@ bool CActiveAE::RunStages()
                 float *src = (float*)mix->pkt->data[j]+i*nb_floats;
 #ifdef __SSE__
                 CAEUtil::SSEMulAddArray(dst, src, m_muted ? 0.0 : volume, nb_floats);
+                for (int k = 0; k < nb_floats; ++k)
+                {
+                  if (fabs(dst[k]) > 1.0f)
+                  {
+                    needClamp = true;
+                    break;
+                  }
+                }
 #else
                 for (int k = 0; k < nb_floats; ++k)
-                  *dst++ += *src++ * m_muted ? 0.0 : volume;
+                {
+                  dst[k] += src[k] * m_muted ? 0.0 : volume;
+                  if (fabs(dst[k]) > 1.0f)
+                    needClamp = true;
+                }
 #endif
               }
             }
@@ -1711,6 +1726,16 @@ bool CActiveAE::RunStages()
           }
           busy = true;
         }
+      }// for
+
+      // finally clamp samples
+      if(out && needClamp)
+      {
+        int nb_floats = out->pkt->nb_samples * out->pkt->config.channels / out->pkt->planes;
+        for(int i=0; i<out->pkt->planes; i++)
+        {
+          CAEUtil::ClampArray((float*)out->pkt->data[i], nb_floats);
+        }
       }
 
       // process output buffer, gui sounds, encode, viz
index 7649b7a..2c5f41b 100644 (file)
@@ -82,6 +82,15 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
     m_dllAvUtil.av_opt_set_int(m_pContext, "output_sample_bits", m_dst_bits, 0);
   }
 
+  // tell resampler to clamp float values
+  // not required for sink stage (remapLayout == true)
+  if ((m_dst_fmt == AV_SAMPLE_FMT_FLT || m_dst_fmt == AV_SAMPLE_FMT_FLTP) &&
+      (m_src_fmt == AV_SAMPLE_FMT_FLT || m_src_fmt == AV_SAMPLE_FMT_FLTP) &&
+      !remapLayout)
+  {
+     m_dllAvUtil.av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0);
+  }
+
   if(!m_pContext)
   {
     CLog::Log(LOGERROR, "CActiveAEResample::Init - create context failed");
@@ -96,7 +105,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
     m_dst_chan_layout = 0;
     for (unsigned int out=0; out<remapLayout->Count(); out++)
     {
-      m_dst_chan_layout += (1 << out);
+      m_dst_chan_layout += (uint64_t) (1 << out);
       int idx = GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout);
       if (idx >= 0)
       {
index 077ef2e..2959510 100644 (file)
@@ -713,7 +713,7 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples)
   unsigned int frames = samples->pkt->nb_samples;
   unsigned int maxFrames;
   int retry = 0;
-  int written = 0;
+  unsigned int written = 0;
   double sinkDelay = 0.0;
 
   switch(m_convertState)
@@ -756,6 +756,13 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples)
       else
         continue;
     }
+    else if (written > maxFrames)
+    {
+      m_extError = true;
+      CLog::Log(LOGERROR, "CActiveAESink::OutputSamples - sink returned error");
+      m_stats->UpdateSinkDelay(0, samples->pool ? maxFrames : 0);
+      return 0;
+    }
     frames -= written;
     buffer += written*m_sinkFormat.m_frameSize;
     sinkDelay = m_sink->GetDelay();
index d54e0d7..d4565e9 100644 (file)
@@ -516,7 +516,7 @@ extern "C"
     bool bResult;
 
     // We need to validate the path here as some calls from ie. libdvdnav
-    // or the python DLLs have malformed slashes on Win32 & Xbox
+    // or the python DLLs have malformed slashes on Win32
     // (-> E:\test\VIDEO_TS/VIDEO_TS.BUP))
     if (bWrite)
       bResult = pFile->OpenForWrite(CUtil::ValidatePath(str), bOverwrite);
index b4444d6..223f110 100644 (file)
@@ -25,6 +25,7 @@
 #include "DVDClock.h"
 #include "Util.h"
 #include "utils/AutoPtrHandle.h"
+#include "utils/StringUtils.h"
 
 using namespace AUTOPTR;
 using namespace std;
@@ -81,8 +82,8 @@ int CDVDOverlayCodecSSA::Decode(DemuxPacket *pPacket)
     double beg, end;
     size_t pos;
     CStdString      line, line2;
-    CStdStringArray lines;
-    CUtil::Tokenize((const char*)data, lines, "\r\n");
+    std::vector<std::string> lines;
+    StringUtils::Tokenize((const char*)data, lines, "\r\n");
     for(size_t i=0; i<lines.size(); i++)
     {
       line = lines[i];
index 122d416..58f64c3 100644 (file)
@@ -33,6 +33,7 @@
 #include "DllLibbluray.h"
 #include "URL.h"
 #include "guilib/Geometry.h"
+#include "utils/StringUtils.h"
 
 #define LIBBLURAY_BYTESEEK 0
 
@@ -255,7 +256,7 @@ bool CDVDInputStreamBluray::Open(const char* strFile, const std::string& content
   CStdString filename;
   CStdString root;
 
-  if(strPath.Left(7).Equals("bluray:"))
+  if(StringUtils::StartsWithNoCase(strPath, "bluray:"))
   {
     CURL url(strPath);
     root     = url.GetHostName();
index 6fcd33b..7779112 100644 (file)
@@ -40,6 +40,7 @@
 #include "URL.h"
 #include "DVDPlayerCodec.h"
 #include "PCMCodec.h"
+#include "utils/StringUtils.h"
 
 ICodec* CodecFactory::CreateCodec(const CStdString& strFileType)
 {
@@ -119,7 +120,7 @@ ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdStri
   ||  strContent.Equals("audio/mpeg3")
   ||  strContent.Equals("audio/mp3") )
     return new MP3Codec();
-  else if (strContent.Left(9).Equals("audio/l16"))
+  else if (StringUtils::StartsWithNoCase(strContent, "audio/l16"))
   {
     PCMCodec * pcm_codec = new PCMCodec();
     pcm_codec->SetMimeParams(strContent);
index e1e07a9..da48705 100644 (file)
@@ -36,6 +36,7 @@
 #include "guilib/LocalizeStrings.h"
 #include "PasswordManager.h"
 #include "URL.h"
+#include "utils/StringUtils.h"
 
 #if defined(TARGET_ANDROID)
 #include "android/activity/XBMCApp.h"
@@ -383,13 +384,13 @@ void CGUIDialogMediaSource::OnOK()
   VECSOURCES *shares = CMediaSourceSettings::Get().GetSources(m_type);
   if (shares)
     shares->push_back(share);
-  if (share.strPath.Left(9).Equals("plugin://") || CDirectory::GetDirectory(share.strPath, items, "", DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_ALLOW_PROMPT) || CGUIDialogYesNo::ShowAndGetInput(1001,1025,1003,1004))
+  if (StringUtils::StartsWithNoCase(share.strPath, "plugin://") || CDirectory::GetDirectory(share.strPath, items, "", DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_ALLOW_PROMPT) || CGUIDialogYesNo::ShowAndGetInput(1001,1025,1003,1004))
   {
     m_confirmed = true;
     Close();
     if (m_type == "video" && !URIUtils::IsLiveTV(share.strPath) && 
-        !share.strPath.Left(6).Equals("rss://") &&
-        !share.strPath.Left(7).Equals("upnp://"))
+        !StringUtils::StartsWithNoCase(share.strPath, "rss://") &&
+        !StringUtils::StartsWithNoCase(share.strPath, "upnp://"))
     {
       CGUIWindowVideoBase::OnAssignContent(share.strPath);
     }
index 0eddcae..5194f5d 100644 (file)
@@ -576,7 +576,7 @@ bool CGUIDialogSmartPlaylistEditor::EditPlaylist(const CStdString &path, const C
   bool loaded(playlist.Load(path));
   if (!loaded)
   { // failed to load
-    if (!editor->m_mode.Left(5).Equals("party"))
+    if (!StringUtils::StartsWithNoCase(editor->m_mode, "party"))
       return false; // only edit normal playlists that exist
     // party mode playlists can be editted even if they don't exist
     playlist.SetType(editor->m_mode == "partymusic" ? "songs" : "musicvideos");
index a408589..b8ab6ae 100644 (file)
@@ -42,6 +42,7 @@
 #include "SpecialProtocol.h"
 #include "utils/CharsetConverter.h"
 #include "utils/log.h"
+#include "utils/StringUtils.h"
 
 using namespace XFILE;
 using namespace XCURL;
@@ -71,9 +72,9 @@ extern "C" int debug_callback(CURL_HANDLE *handle, curl_infotype info, char *out
 
   CStdString strLine;
   strLine.append(output, size);
-  std::vector<CStdString> vecLines;
-  CUtil::Tokenize(strLine, vecLines, "\r\n");
-  std::vector<CStdString>::const_iterator it = vecLines.begin();
+  std::vector<std::string> vecLines;
+  StringUtils::Tokenize(strLine, vecLines, "\r\n");
+  std::vector<std::string>::const_iterator it = vecLines.begin();
 
   char *infotype;
   switch(info)
@@ -687,16 +688,16 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
     /* it won't be so let's handle that case    */
 
     CStdString partial, filename(url2.GetFileName());
-    CStdStringArray array;
+    std::vector<std::string> array;
 
     // if server sent us the filename in non-utf8, we need send back with same encoding.
     if (url2.GetProtocolOption("utf8") == "0")
       g_charsetConverter.utf8ToStringCharset(filename);
 
     /* TODO: create a tokenizer that doesn't skip empty's */
-    CUtil::Tokenize(filename, array, "/");
+    StringUtils::Tokenize(filename, array, "/");
     filename.Empty();
-    for(CStdStringArray::iterator it = array.begin(); it != array.end(); it++)
+    for(std::vector<std::string>::iterator it = array.begin(); it != array.end(); it++)
     {
       if(it != array.begin())
         filename += "/";
@@ -1099,7 +1100,7 @@ bool CCurlFile::Exists(const CURL& url)
   {
     g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_FILETIME, 1);
     // nocwd is less standard, will return empty list for non-existed remote dir on some ftp server, avoid it.
-    if (url2.GetFileName().Right(1).Equals("/"))
+    if (StringUtils::EndsWith(url2.GetFileName(), "/"))
       g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_FTP_FILEMETHOD, CURLFTPMETHOD_SINGLECWD);
     else
       g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_FTP_FILEMETHOD, CURLFTPMETHOD_NOCWD);
@@ -1250,7 +1251,7 @@ int CCurlFile::Stat(const CURL& url, struct __stat64* buffer)
   if(url2.GetProtocol() == "ftp")
   {
     // nocwd is less standard, will return empty list for non-existed remote dir on some ftp server, avoid it.
-    if (url2.GetFileName().Right(1).Equals("/"))
+    if (StringUtils::EndsWith(url2.GetFileName(), "/"))
       g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_FTP_FILEMETHOD, CURLFTPMETHOD_SINGLECWD);
     else
       g_curlInterface.easy_setopt(m_state->m_easyHandle, CURLOPT_FTP_FILEMETHOD, CURLFTPMETHOD_NOCWD);
index 81336fb..8419b66 100644 (file)
@@ -40,7 +40,7 @@ bool CFTPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items
   CURL url(strPath);
 
   CStdString path = url.GetFileName();
-  if( !path.IsEmpty() && !path.Right(1).Equals("/") )
+  if( !path.IsEmpty() && !StringUtils::EndsWith(path, "/") )
   {
     path += "/";
     url.SetFileName(path);
index 0314170..7b8d8b5 100644 (file)
@@ -32,6 +32,7 @@
 #include "utils/BitstreamStats.h"
 #include "Util.h"
 #include "URL.h"
+#include "utils/StringUtils.h"
 
 #include "commons/Exception.h"
 
@@ -94,19 +95,19 @@ bool CFile::Cache(const CStdString& strFileName, const CStdString& strDest, XFIL
     CFile newFile;
     if (URIUtils::IsHD(strDest)) // create possible missing dirs
     {
-      vector<CStdString> tokens;
+      vector<std::string> tokens;
       CStdString strDirectory = URIUtils::GetDirectory(strDest);
       URIUtils::RemoveSlashAtEnd(strDirectory);  // for the test below
       if (!(strDirectory.size() == 2 && strDirectory[1] == ':'))
       {
         CURL url(strDirectory);
-        CStdString pathsep;
+        std::string pathsep;
 #ifndef TARGET_POSIX
         pathsep = "\\";
 #else
         pathsep = "/";
 #endif
-        CUtil::Tokenize(url.GetFileName(),tokens,pathsep.c_str());
+        StringUtils::Tokenize(url.GetFileName(),tokens,pathsep.c_str());
         CStdString strCurrPath;
         // Handle special
         if (!url.GetProtocol().IsEmpty()) {
@@ -115,7 +116,7 @@ bool CFile::Cache(const CStdString& strFileName, const CStdString& strDest, XFIL
         } // If the directory has a / at the beginning, don't forget it
         else if (strDirectory[0] == pathsep[0])
           strCurrPath += pathsep;
-        for (vector<CStdString>::iterator iter=tokens.begin();iter!=tokens.end();++iter)
+        for (vector<std::string>::iterator iter=tokens.begin();iter!=tokens.end();++iter)
         {
           strCurrPath += *iter+pathsep;
           CDirectory::Create(strCurrPath);
index b7db68e..f483d3e 100644 (file)
@@ -48,6 +48,7 @@
 #include "ZipManager.h"
 #include "settings/AdvancedSettings.h"
 #include "FileItem.h"
+#include "utils/StringUtils.h"
 
 using namespace XFILE;
 using namespace PLAYLIST;
@@ -170,13 +171,13 @@ IFileDirectory* CFileDirectoryFactory::Create(const CStdString& strPath, CFileIt
     CStdString strUrl;
     URIUtils::CreateArchivePath(strUrl, "rar", strPath, "");
 
-    vector<CStdString> tokens;
-    CUtil::Tokenize(strPath,tokens,".");
+    vector<std::string> tokens;
+    StringUtils::Tokenize(strPath,tokens,".");
     if (tokens.size() > 2)
     {
       if (strExtension.Equals(".001"))
       {
-        if (tokens[tokens.size()-2].Equals("ts")) // .ts.001 - treat as a movie file to scratch some users itch
+        if (StringUtils::EqualsNoCase(tokens[tokens.size()-2], "ts")) // .ts.001 - treat as a movie file to scratch some users itch
           return NULL;
       }
       CStdString token = tokens[tokens.size()-2];
index 674b95f..6260662 100644 (file)
@@ -110,7 +110,7 @@ bool CHTTPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &item
       HTML::CHTMLUtil::ConvertHTMLToW(wLink, wConverted);
       g_charsetConverter.wToUTF8(wConverted, strLinkTemp);
 
-      if (strNameTemp.Right(3).Equals("..>") && 
+      if (StringUtils::EndsWith(strNameTemp, "..>") && 
           strLinkTemp.Left(strNameTemp.GetLength()-3).Equals(strNameTemp.Left(strNameTemp.GetLength()-3)))
         strName = strNameTemp = strLinkTemp;
 
index 27ec983..316b518 100644 (file)
@@ -29,6 +29,7 @@
 #include "guilib/LocalizeStrings.h"
 #include "utils/LegacyPathTranslation.h"
 #include "utils/log.h"
+#include "utils/StringUtils.h"
 
 using namespace std;
 using namespace XFILE;
@@ -133,7 +134,7 @@ void CMusicDatabaseDirectory::ClearDirectoryCache(const CStdString& strDirectory
 
 bool CMusicDatabaseDirectory::IsAllItem(const CStdString& strDirectory)
 {
-  if (strDirectory.Right(4).Equals("/-1/"))
+  if (StringUtils::EndsWith(strDirectory, "/-1/"))
     return true;
   return false;
 }
index 965c405..8c4df40 100644 (file)
@@ -521,10 +521,10 @@ static void ParseItem(CFileItem* item, TiXmlElement* root, const CStdString& pat
       item->SetProperty("duration", StringUtils::SecondsToTimeString(best->duration));    
 
     /* handling of mimetypes fo directories are sub optimal at best */
-    if(best->mime == "application/rss+xml" && item->GetPath().Left(7).Equals("http://"))
+    if(best->mime == "application/rss+xml" && StringUtils::StartsWithNoCase(item->GetPath(), "http://"))
       item->SetPath("rss://" + item->GetPath().Mid(7));
 
-    if(item->GetPath().Left(6).Equals("rss://"))
+    if(StringUtils::StartsWithNoCase(item->GetPath(), "rss://"))
       item->m_bIsFolder = true;
     else
       item->m_bIsFolder = false;
index 838fe02..0eb0fb7 100644 (file)
@@ -24,6 +24,7 @@
 #include "utils/URIUtils.h"
 #include "URL.h"
 #include "FileItem.h"
+#include "utils/StringUtils.h"
 
 namespace XFILE
 {
@@ -40,7 +41,7 @@ namespace XFILE
     CStdString strPath;
 
     /* if this isn't a proper archive path, assume it's the path to a archive file */
-    if( !strPathOrig.Left(6).Equals("rar://") )
+    if( !StringUtils::StartsWithNoCase(strPathOrig, "rar://") )
       URIUtils::CreateArchivePath(strPath, "rar", strPathOrig, "");
     else
       strPath = strPathOrig;
index 794f2a9..f3278af 100644 (file)
@@ -31,6 +31,7 @@
 #include "FileItem.h"
 #include "utils/log.h"
 #include "UnrarXLib/rar.hpp"
+#include "utils/StringUtils.h"
 
 #ifndef TARGET_POSIX
 #include <process.h>
@@ -545,18 +546,18 @@ void CRarFile::InitFromUrl(const CURL& url)
   m_strPassword = url.GetUserName();
   m_strPathInRar = url.GetFileName();
 
-  vector<CStdString> options;
-  CUtil::Tokenize(url.GetOptions().Mid(1), options, "&");
+  vector<std::string> options;
+  StringUtils::Tokenize(url.GetOptions().Mid(1), options, "&");
 
   m_bFileOptions = 0;
 
-  for( vector<CStdString>::iterator it = options.begin();it != options.end(); it++)
+  for( vector<std::string>::iterator it = options.begin();it != options.end(); it++)
   {
-    int iEqual = (*it).Find('=');
+    int iEqual = (*it).find('=');
     if( iEqual >= 0 )
     {
-      CStdString strOption = (*it).Left(iEqual);
-      CStdString strValue = (*it).Mid(iEqual+1);
+      CStdString strOption = StringUtils::Left((*it), iEqual);
+      CStdString strValue = StringUtils::Mid((*it), iEqual+1);
 
       if( strOption.Equals("flags") )
         m_bFileOptions = atoi(strValue.c_str());
index 8f86b06..449f73f 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "dialogs/GUIDialogYesNo.h"
 #include "guilib/GUIWindowManager.h"
+#include "utils/StringUtils.h"
 
 #include <set>
 
@@ -247,9 +248,9 @@ bool CRarManager::GetFilesInRar(CFileItemList& vecpItems, const CStdString& strR
     pFileList = it->second.first;
 
   CFileItemPtr pFileItem;
-  vector<CStdString> vec;
+  vector<std::string> vec;
   set<CStdString> dirSet;
-  CUtil::Tokenize(strPathInRar,vec,"/");
+  StringUtils::Tokenize(strPathInRar,vec,"/");
   unsigned int iDepth = vec.size();
 
   ArchiveList_struct* pIterator;
@@ -277,7 +278,7 @@ bool CRarManager::GetFilesInRar(CFileItemList& vecpItems, const CStdString& strR
         continue;
 
       vec.clear();
-      CUtil::Tokenize(strName,vec,"/");
+      StringUtils::Tokenize(strName,vec,"/");
       if (vec.size() < iDepth)
         continue;
     }
index ed5cf33..5ad4041 100644 (file)
@@ -133,7 +133,7 @@ bool CSMBDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items
       int64_t lTimeDate = 0;
       bool hidden = false;
 
-      if(strFile.Right(1).Equals("$") && aDir.type == SMBC_FILE_SHARE )
+      if(StringUtils::EndsWith(strFile, "$") && aDir.type == SMBC_FILE_SHARE )
         continue;
 
       // only stat files that can give proper responses
index c7206f5..8437968 100644 (file)
 #include "SmbFile.h"
 #include "PasswordManager.h"
 #include "SMBDirectory.h"
-#include "Util.h"
 #include <libsmbclient.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/TimeUtils.h"
 #include "commons/Exception.h"
@@ -264,9 +264,9 @@ CStdString CSMB::URLEncode(const CURL &url)
   flat += URLEncode(url.GetHostName());
 
   /* okey sadly since a slash is an invalid name we have to tokenize */
-  std::vector<CStdString> parts;
-  std::vector<CStdString>::iterator it;
-  CUtil::Tokenize(url.GetFileName(), parts, "/");
+  std::vector<std::string> parts;
+  std::vector<std::string>::iterator it;
+  StringUtils::Tokenize(url.GetFileName(), parts, "/");
   for( it = parts.begin(); it != parts.end(); it++ )
   {
     flat += "/";
index 73e5046..7eaef99 100644 (file)
@@ -28,6 +28,7 @@
 #include "settings/MediaSourceSettings.h"
 #include "guilib/TextureManager.h"
 #include "storage/MediaManager.h"
+#include "utils/StringUtils.h"
 
 using namespace XFILE;
 
@@ -65,7 +66,7 @@ bool CSourcesDirectory::GetDirectory(const VECSOURCES &sources, CFileItemList &i
   {
     const CMediaSource& share = sources[i];
     CFileItemPtr pItem(new CFileItem(share));
-    if (pItem->GetPath().Left(14).Equals("musicsearch://"))
+    if (StringUtils::StartsWithNoCase(pItem->GetPath(), "musicsearch://"))
       pItem->SetCanQueue(false);
     
     CStdString strIcon;
index f736e54..dac8c76 100644 (file)
@@ -27,6 +27,7 @@
 #include "settings/Settings.h"
 #include "utils/log.h"
 #include "utils/URIUtils.h"
+#include "utils/StringUtils.h"
 
 #ifdef TARGET_POSIX
 #include <dirent.h>
@@ -191,15 +192,16 @@ CStdString CSpecialProtocol::TranslatePathConvertCase(const CStdString& path)
     return translatedPath;
 
   CStdString result;
-  vector<CStdString> tokens;
-  CUtil::Tokenize(translatedPath, tokens, "/");
+  std::vector<std::string> tokens;
+  StringUtils::Tokenize(translatedPath, tokens, "/");
   CStdString file;
   DIR* dir;
   struct dirent* de;
 
   for (unsigned int i = 0; i < tokens.size(); i++)
   {
-    file = result + "/" + tokens[i];
+    file = result + "/";
+    file += tokens[i];
     if (stat(file.c_str(), &stat_buf) == 0)
     {
       result += "/" + tokens[i];
@@ -212,7 +214,7 @@ CStdString CSpecialProtocol::TranslatePathConvertCase(const CStdString& path)
         while ((de = readdir(dir)) != NULL)
         {
           // check if there's a file with same name but different case
-          if (strcasecmp(de->d_name, tokens[i]) == 0)
+          if (strcasecmp(de->d_name, tokens[i].c_str()) == 0)
           {
             result += "/";
             result += de->d_name;
index f80905b..be42cba 100644 (file)
@@ -30,6 +30,7 @@
 #include "guilib/LocalizeStrings.h"
 #include "utils/LegacyPathTranslation.h"
 #include "utils/log.h"
+#include "utils/StringUtils.h"
 
 using namespace std;
 using namespace XFILE;
@@ -133,7 +134,7 @@ void CVideoDatabaseDirectory::ClearDirectoryCache(const CStdString& strDirectory
 
 bool CVideoDatabaseDirectory::IsAllItem(const CStdString& strDirectory)
 {
-  if (strDirectory.Right(4).Equals("/-1/"))
+  if (StringUtils::EndsWith(strDirectory, "/-1/"))
     return true;
   return false;
 }
index 67aace6..72315fd 100644 (file)
@@ -26,6 +26,7 @@
 #include "URL.h"
 #include "ZipManager.h"
 #include "FileItem.h"
+#include "utils/StringUtils.h"
 
 #include <vector>
 
@@ -45,7 +46,7 @@ namespace XFILE
     CStdString strPath;
 
     /* if this isn't a proper archive path, assume it's the path to a archive file */
-    if( !strPathOrig.Left(6).Equals("zip://") )
+    if( !StringUtils::StartsWithNoCase(strPathOrig, "zip://") )
       URIUtils::CreateArchivePath(strPath, "zip", strPathOrig, "");
     else
       strPath = strPathOrig;
@@ -73,9 +74,9 @@ namespace XFILE
     if (!g_ZipManager.GetZipList(strPath,entries))
       return false;
 
-    vector<CStdString> baseTokens;
+    vector<std::string> baseTokens;
     if (!strPathInZip.IsEmpty())
-      CUtil::Tokenize(strPathInZip,baseTokens,"/");
+      StringUtils::Tokenize(strPathInZip,baseTokens,"/");
 
     for (vector<SZipEntry>::iterator ze=entries.begin();ze!=entries.end();++ze)
     {
@@ -84,8 +85,8 @@ namespace XFILE
       if (strEntryName == strPathInZip) // skip the listed dir
         continue;
 
-      vector<CStdString> pathTokens;
-      CUtil::Tokenize(strEntryName,pathTokens,"/");
+      vector<std::string> pathTokens;
+      StringUtils::Tokenize(strEntryName,pathTokens,"/");
       if (pathTokens.size() < baseTokens.size()+1)
         continue;
 
index 7a157dd..898b603 100644 (file)
@@ -30,6 +30,7 @@
 #include "utils/CharsetConverter.h"
 #include "PasswordManager.h"
 #include "Util.h"
+#include "utils/StringUtils.h"
 
 #ifndef INVALID_FILE_ATTRIBUTES
 #define INVALID_FILE_ATTRIBUTES ((DWORD) -1)
@@ -424,9 +425,9 @@ CStdString CWINSMBDirectory::URLEncode(const CURL &url)
   flat += url.GetHostName();
 
   /* okey sadly since a slash is an invalid name we have to tokenize */
-  std::vector<CStdString> parts;
-  std::vector<CStdString>::iterator it;
-  CUtil::Tokenize(url.GetFileName(), parts, "/");
+  std::vector<std::string> parts;
+  std::vector<std::string>::iterator it;
+  StringUtils::Tokenize(url.GetFileName(), parts, "/");
   for( it = parts.begin(); it != parts.end(); it++ )
   {
     flat += "/";
index 505c8c9..ea75605 100644 (file)
@@ -105,7 +105,7 @@ void CGUIInfoColor::Parse(const CStdString &label, int context)
   if (label.Equals("-", false))
     return;
 
-  if (label.Left(4).Equals("$VAR", false))
+  if (StringUtils::StartsWithNoCase(label, "$var"))
   {
     label2 = label.Mid(5, label.length() - 6);
     m_info = g_infoManager.TranslateSkinVariableString(label2, context);
@@ -114,7 +114,7 @@ void CGUIInfoColor::Parse(const CStdString &label, int context)
     return;
   }
 
-  if (label.Left(5).Equals("$INFO", false))
+  if (StringUtils::StartsWithNoCase(label, "$info"))
     label2 = label.Mid(6, label.length()-7);
 
   m_info = g_infoManager.TranslateString(label2);
index ecfdbb7..610bb35 100644 (file)
@@ -28,6 +28,7 @@
 #include "Key.h"
 #include "TextureCache.h"
 #include "WindowIDs.h"
+#include "utils/StringUtils.h"
 
 using namespace std;
 using namespace XFILE;
@@ -298,7 +299,7 @@ bool CGUIMultiImage::CMultiImageJob::DoWork()
   // check to see if we have a single image or a folder of images
   CFileItem item(m_path, false);
   item.FillInMimeType();
-  if (item.IsPicture() || item.GetMimeType().Left(6).Equals("image/"))
+  if (item.IsPicture() || StringUtils::StartsWithNoCase(item.GetMimeType(), "image/"))
   {
     m_files.push_back(m_path);
   }
@@ -316,7 +317,7 @@ bool CGUIMultiImage::CMultiImageJob::DoWork()
     for (int i=0; i < items.Size(); i++)
     {
       CFileItem* pItem = items[i].get();
-      if (pItem && (pItem->IsPicture() || pItem->GetMimeType().Left(6).Equals("image/")))
+      if (pItem && (pItem->IsPicture() || StringUtils::StartsWithNoCase(pItem->GetMimeType(), "image/")))
         m_files.push_back(pItem->GetPath());
     }
   }
index eb90bd9..fba1350 100644 (file)
@@ -31,6 +31,7 @@
 #include "utils/URIUtils.h"
 #include "XBTF.h"
 #include <lzo/lzo1x.h>
+#include "utils/StringUtils.h"
 
 #ifdef TARGET_WINDOWS
 #pragma comment(lib,"liblzo2.lib")
@@ -121,13 +122,12 @@ void CTextureBundleXBT::GetTexturesFromPath(const CStdString &path, std::vector<
 
   CStdString testPath = Normalize(path);
   URIUtils::AddSlashAtEnd(testPath);
-  int testLength = testPath.GetLength();
 
   std::vector<CXBTFFile>& files = m_XBTFReader.GetFiles();
   for (size_t i = 0; i < files.size(); i++)
   {
     CStdString path = files[i].GetPath();
-    if (path.Left(testLength).Equals(testPath))
+    if (StringUtils::StartsWithNoCase(path, testPath))
       textures.push_back(path);
   }
 }
index 0f20b65..8f23c47 100644 (file)
@@ -34,6 +34,7 @@
 #include "filesystem/SpecialProtocol.h"
 #include "utils/EndianSwap.h"
 #include "utils/URIUtils.h"
+#include "utils/StringUtils.h"
 
 #ifdef TARGET_WINDOWS
 #pragma comment(lib,"liblzo2.lib")
@@ -259,11 +260,10 @@ void CTextureBundleXPR::GetTexturesFromPath(const CStdString &path, std::vector<
   CStdString testPath = Normalize(path);
   if (!URIUtils::HasSlashAtEnd(testPath))
     testPath += "\\";
-  int testLength = testPath.GetLength();
   std::map<CStdString, FileHeader_t>::iterator it;
   for (it = m_FileHeaders.begin(); it != m_FileHeaders.end(); ++it)
   {
-    if (it->first.Left(testLength).Equals(testPath))
+    if (StringUtils::StartsWithNoCase(it->first, testPath))
       textures.push_back(it->first);
   }
 }
index 6bd8318..d4abdcf 100644 (file)
@@ -628,7 +628,7 @@ void CAnimation::Create(const TiXmlElement *node, const CRect &rect, int context
   if (effect) // new layout
     type = node->Attribute("type");
 
-  if (type.Left(7).Equals("visible")) m_type = ANIM_TYPE_VISIBLE;
+  if (StringUtils::StartsWithNoCase(type, "visible")) m_type = ANIM_TYPE_VISIBLE;
   else if (type.Equals("hidden")) m_type = ANIM_TYPE_HIDDEN;
   else if (type.Equals("focus"))  m_type = ANIM_TYPE_FOCUS;
   else if (type.Equals("unfocus"))  m_type = ANIM_TYPE_UNFOCUS;
index d8760e0..4a0cd2b 100644 (file)
@@ -1189,7 +1189,7 @@ int CButtonTranslator::TranslateWindow(const CStdString &window)
     strWindow = strWindow.Mid(0, strWindow.GetLength() - 4);
 
   // window12345, for custom window to be keymapped
-  if (strWindow.length() > 6 && strWindow.Left(6).Equals("window"))
+  if (strWindow.length() > 6 && StringUtils::StartsWithNoCase(strWindow, "window"))
     strWindow = strWindow.Mid(6);
   if (strWindow.Left(2) == "my")  // drop "my" prefix
     strWindow = strWindow.Mid(2);
index d83289d..0f39625 100644 (file)
@@ -629,7 +629,7 @@ int CBuiltins::Execute(const CStdString& execString)
         // force the item to start at the beginning (m_lStartOffset is initialized to 0)
         askToResume = false;
       }
-      else if (params[i].Left(11).Equals("playoffset=")) {
+      else if (StringUtils::StartsWithNoCase(params[i], "playoffset=")) {
         playOffset = atoi(params[i].Mid(11)) - 1;
         item.SetProperty("playlist_starting_track", playOffset);
       }
@@ -729,7 +729,7 @@ int CBuiltins::Execute(const CStdString& execString)
           flags |= 4;
         else if (params[i].Equals("pause"))
           flags |= 8;
-        else if (params[i].Left(11).Equals("beginslide="))
+        else if (StringUtils::StartsWithNoCase(params[i], "beginslide="))
           beginSlidePath = params[i].Mid(11);
       }
     }
@@ -830,7 +830,7 @@ int CBuiltins::Execute(const CStdString& execString)
       if (g_application.m_pPlayer->IsPlaying())
         g_application.m_pPlayer->Seek(true, false);
     }
-    else if (parameter.Left(14).Equals("seekpercentage"))
+    else if (StringUtils::StartsWithNoCase(parameter, "seekpercentage"))
     {
       CStdString offset = "";
       if (parameter.size() == 14)
@@ -858,16 +858,16 @@ int CBuiltins::Execute(const CStdString& execString)
       if( g_application.m_pPlayer->IsPlaying() && g_application.m_pPlayer->CanRecord())
         g_application.m_pPlayer->Record(!g_application.m_pPlayer->IsRecording());
     }
-    else if (parameter.Left(9).Equals("partymode"))
+    else if (StringUtils::StartsWithNoCase(parameter, "partymode"))
     {
       CStdString strXspPath = "";
       //empty param=music, "music"=music, "video"=video, else xsp path
       PartyModeContext context = PARTYMODECONTEXT_MUSIC;
       if (parameter.size() > 9)
       {
-        if (parameter.Mid(10).Equals("video)"))
+        if (parameter.size() == 16 && StringUtils::EndsWithNoCase(parameter, "video)"))
           context = PARTYMODECONTEXT_VIDEO;
-        else if (!parameter.Mid(10).Equals("music)"))
+        else if (parameter.size() != 16 || !StringUtils::EndsWithNoCase(parameter, "music)"))
         {
           strXspPath = parameter.Mid(10).TrimRight(")");
           context = PARTYMODECONTEXT_UNKNOWN;
@@ -911,7 +911,7 @@ int CBuiltins::Execute(const CStdString& execString)
       g_windowManager.SendThreadMessage(msg);
 
     }
-    else if (parameter.Left(6).Equals("repeat"))
+    else if (StringUtils::StartsWithNoCase(parameter, "repeat"))
     {
       // get current playlist
       int iPlaylist = g_playlistPlayer.GetCurrentPlaylist();
@@ -1245,7 +1245,7 @@ int CBuiltins::Execute(const CStdString& execString)
         CStdString replace;
         if (CGUIDialogFileBrowser::ShowAndGetFile(url.Get(), strMask, TranslateType(type, true), replace, true, true, true))
         {
-          if (replace.Mid(0,9).Equals("addons://"))
+          if (StringUtils::StartsWithNoCase(replace, "addons://"))
             CSkinSettings::Get().SetString(string, URIUtils::GetFileName(replace));
           else
             CSkinSettings::Get().SetString(string, replace);
index 082406e..57fc5f5 100644 (file)
@@ -28,6 +28,7 @@
 #include "GUIInfoManager.h"
 #include "system.h"
 #include "GitRevision.h"
+#include "utils/StringUtils.h"
 
 using namespace JSONRPC;
 
@@ -125,9 +126,9 @@ JSONRPC_STATUS CApplicationOperations::GetPropertyValue(const CStdString &proper
     CStdString tag(VERSION_TAG);
     if (tag.ToLower().Equals("-pre"))
       result["tag"] = "alpha";
-    else if (tag.ToLower().Left(5).Equals("-beta"))
+    else if (StringUtils::StartsWithNoCase(tag.ToLower(), "-beta"))
       result["tag"] = "beta";
-    else if (tag.ToLower().Left(3).Equals("-rc"))
+    else if (StringUtils::StartsWithNoCase(tag.ToLower(), "-rc"))
       result["tag"] = "releasecandidate";
     else if (tag.empty())
       result["tag"] = "stable";
index 5ff6459..ec380b0 100644 (file)
@@ -463,7 +463,7 @@ namespace XBMCAddon
           else
           {
             const CStdString& exifkey = key;
-            if (!exifkey.Left(5).Equals("exif:") || exifkey.length() < 6) continue;
+            if (!StringUtils::StartsWithNoCase(exifkey, "exif:") || exifkey.length() < 6) continue;
             int info = CPictureInfoTag::TranslateString(exifkey.Mid(5));
             item->GetPictureInfoTag()->SetInfo(info, value);
           }
index 5909ae3..39dc642 100644 (file)
@@ -777,7 +777,7 @@ namespace PythonBindings
    // constants
    PyModule_AddStringConstant(module, (char*)"__author__", (char*)"Team XBMC <http://xbmc.org>");
    PyModule_AddStringConstant(module, (char*)"__date__", (char*)"${new Date().toString()}");
-   PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.1.0");
+   PyModule_AddStringConstant(module, (char*)"__version__", (char*)"2.12.0");
    PyModule_AddStringConstant(module, (char*)"__credits__", (char*)"Team XBMC");
    PyModule_AddStringConstant(module, (char*)"__platform__", (char*)"ALL");
 
index 8e5ead3..3f9a4e1 100644 (file)
@@ -34,6 +34,7 @@
 #endif
 
 #include "Util.h"
+#include "utils/StringUtils.h"
 #include "XBDateTime.h"
 #include "settings/Setting.h"
 #include "settings/Settings.h"
@@ -46,7 +47,7 @@ CLinuxTimezone::CLinuxTimezone() : m_IsDST(0)
    size_t linelen = 0;
    int nameonfourthfield = 0;
    CStdString s;
-   vector<CStdString> tokens;
+   std::vector<std::string> tokens;
 
    // Load timezones
    FILE* fp = fopen("/usr/share/zoneinfo/zone.tab", "r");
@@ -67,7 +68,7 @@ CLinuxTimezone::CLinuxTimezone() : m_IsDST(0)
          if (s[0] == '#')
             continue;
 
-         CUtil::Tokenize(s, tokens, " \t");
+         StringUtils::Tokenize(s, tokens, " \t");
          if (tokens.size() < 3)
             continue;
 
index 72566f7..4e0a8c2 100644 (file)
@@ -294,7 +294,7 @@ void CGUIWindowMusicBase::OnInfo(int iItem, bool bShowInfo)
 void CGUIWindowMusicBase::OnInfo(CFileItem *pItem, bool bShowInfo)
 {
   if ((pItem->IsMusicDb() && !pItem->HasMusicInfoTag()) || pItem->IsParentFolder() ||
-       URIUtils::IsSpecial(pItem->GetPath()) || pItem->GetPath().Left(14).Equals("musicsearch://"))
+       URIUtils::IsSpecial(pItem->GetPath()) || StringUtils::StartsWithNoCase(pItem->GetPath(), "musicsearch://"))
     return; // nothing to do
 
   if (!pItem->m_bIsFolder)
index 90f8327..03ecf38 100644 (file)
@@ -305,14 +305,14 @@ bool CGUIWindowMusicNav::GetDirectory(const CStdString &strDirectory, CFileItemL
   }
 
   // update our content in the info manager
-  if (strDirectory.Left(10).Equals("videodb://"))
+  if (StringUtils::StartsWithNoCase(strDirectory, "videodb://"))
   {
     CVideoDatabaseDirectory dir;
     VIDEODATABASEDIRECTORY::NODE_TYPE node = dir.GetDirectoryChildType(strDirectory);
     if (node == VIDEODATABASEDIRECTORY::NODE_TYPE_TITLE_MUSICVIDEOS)
       items.SetContent("musicvideos");
   }
-  else if (strDirectory.Left(10).Equals("musicdb://"))
+  else if (StringUtils::StartsWithNoCase(strDirectory, "musicdb://"))
   {
     CMusicDatabaseDirectory dir;
     NODE_TYPE node = dir.GetDirectoryChildType(strDirectory);
@@ -358,11 +358,11 @@ void CGUIWindowMusicNav::UpdateButtons()
     {
       CFileItemPtr pItem = m_vecItems->Get(i);
       if (pItem->IsParentFolder()) iItems--;
-      if (pItem->GetPath().Left(4).Equals("/-1/")) iItems--;
+      if (StringUtils::StartsWith(pItem->GetPath(), "/-1/")) iItems--;
     }
     // or the last item
     if (m_vecItems->Size() > 2 &&
-      m_vecItems->Get(m_vecItems->Size()-1)->GetPath().Left(4).Equals("/-1/"))
+      StringUtils::StartsWith(m_vecItems->Get(m_vecItems->Size()-1)->GetPath(), "/-1/"))
       iItems--;
   }
   CStdString items;
@@ -430,7 +430,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
   CFileItemPtr item;
   if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
     item = m_vecItems->Get(itemNumber);
-  if (item && !item->GetPath().Left(14).Equals("addons://more/"))
+  if (item && !StringUtils::StartsWithNoCase(item->GetPath(), "addons://more/"))
   {
     // are we in the playlists location?
     bool inPlaylists = m_vecItems->GetPath().Equals(CUtil::MusicPlaylistsLocation()) ||
@@ -447,7 +447,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
     {
       if (!item->m_bIsFolder) // music video
        buttons.Add(CONTEXT_BUTTON_INFO, 20393);
-      if (StringUtils::StartsWithNoCase(item->GetPath(), "videodb://musicvideos/artist/") && item->m_bIsFolder)
+      if (StringUtils::StartsWithNoCase(item->GetPath(), "videodb://musicvideos/artists/") && item->m_bIsFolder)
       {
         long idArtist = m_musicdatabase.GetArtistByName(m_vecItems->Get(itemNumber)->GetLabel());
         if (idArtist > - 1)
@@ -458,7 +458,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
                               dir.IsArtistDir(item->GetPath())   )      &&
              !dir.IsAllItem(item->GetPath()) && !item->IsParentFolder() &&
              !item->IsPlugin() && !item->IsScript() &&
-             !item->GetPath().Left(14).Equals("musicsearch://"))
+             !StringUtils::StartsWithNoCase(item->GetPath(), "musicsearch://"))
     {
       if (dir.IsArtistDir(item->GetPath()))
         buttons.Add(CONTEXT_BUTTON_INFO, 21891);
@@ -469,7 +469,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
     // enable query all albums button only in album view
     if (dir.HasAlbumInfo(item->GetPath()) && !dir.IsAllItem(item->GetPath()) &&
         item->m_bIsFolder && !item->IsVideoDb() && !item->IsParentFolder()   &&
-       !item->IsPlugin() && !item->GetPath().Left(14).Equals("musicsearch://"))
+       !item->IsPlugin() && !StringUtils::StartsWithNoCase(item->GetPath(), "musicsearch://"))
     {
       buttons.Add(CONTEXT_BUTTON_INFO_ALL, 20059);
     }
@@ -630,7 +630,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
       CStdString strPath;
       CVideoDatabase database;
       database.Open();
-      strPath.Format("videodb://musicvideos/artist/%ld/",database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator)));
+      strPath.Format("videodb://musicvideos/artists/%ld/",database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator)));
       g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
       return true;
     }
index 3442a28..c7920ce 100644 (file)
@@ -40,6 +40,7 @@
 #include "Autorun.h"
 #include "cdrip/CDDARipper.h"
 #include "cores/IPlayer.h"
+#include "utils/StringUtils.h"
 
 #define CONTROL_BTNVIEWASICONS     2
 #define CONTROL_BTNSORTBY          3
@@ -324,7 +325,7 @@ void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &bu
         if (item->IsAudio())
           buttons.Add(CONTEXT_BUTTON_SONG_INFO, 658); // Song Info
         else if (!item->IsParentFolder() &&
-                 !item->GetPath().Left(3).Equals("new") && item->m_bIsFolder)
+                 !StringUtils::StartsWithNoCase(item->GetPath(), "new") && item->m_bIsFolder)
         {
 #if 0
           if (m_musicdatabase.GetAlbumIdByPath(item->GetPath()) > -1)
@@ -368,7 +369,7 @@ void CGUIWindowMusicSongs::GetContextButtons(int itemNumber, CContextButtons &bu
     else if (!inPlaylists && !m_vecItems->IsInternetStream()           &&
              !item->GetPath().Equals("add") && !item->IsParentFolder() &&
              !item->IsPlugin()                                         &&
-             !item->GetPath().Left(9).Equals("addons://")              &&
+             !StringUtils::StartsWithNoCase(item->GetPath(), "addons://")              &&
             (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser))
     {
       buttons.Add(CONTEXT_BUTTON_SCAN, 13352);
index 38a764c..9d4cbf1 100644 (file)
@@ -36,6 +36,7 @@
 #include "guilib/GraphicContext.h"
 #include "guilib/Key.h"
 #include "guilib/LocalizeStrings.h"
+#include "utils/StringUtils.h"
 
 using namespace EVENTCLIENT;
 using namespace EVENTPACKET;
@@ -88,7 +89,7 @@ void CEventButtonState::Load()
         m_iKeyCode = CButtonTranslator::TranslateUniversalRemoteString( m_buttonName.c_str() );
       }
       else if ( (m_mapName.length() > 3) &&
-                (m_mapName.compare(0, 3, "LI:") == 0) ) // starts with LI: ?
+                (StringUtils::StartsWith(m_mapName, "LI:")) ) // starts with LI: ?
       {
 #if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
         string lircDevice = m_mapName.substr(3);
@@ -109,7 +110,7 @@ void CEventButtonState::Load()
   else
   {
     if (m_mapName.length() > 3 &&
-        (m_mapName.compare(0, 2, "JS") == 0) )
+        (StringUtils::StartsWith(m_mapName, "JS")) )
     {
       m_joystickName = m_mapName.substr(2);  // <num>:joyname
       m_iControllerNumber = (unsigned char)(*(m_joystickName.c_str()))
index dfe6250..7b22241 100644 (file)
@@ -25,6 +25,7 @@
 #include "filesystem/Directory.h"
 #include "filesystem/File.h"
 #include "Util.h"
+#include "utils/StringUtils.h"
 
 #define DEFAULT_PAGE        "index.html"
 
@@ -69,8 +70,8 @@ int CHTTPWebinterfaceHandler::ResolveUrl(const std::string &url, std::string &pa
   path = url;
   if (url.find("/addons/") == 0 && url.size() > 8)
   {
-    CStdStringArray components;
-    CUtil::Tokenize(path, components, "/");
+    std::vector<std::string> components;
+    StringUtils::Tokenize(path, components, "/");
     if (components.size() > 1)
     {
       CAddonMgr::Get().GetAddon(components.at(1), addon);
index 133b3cc..198ee71 100644 (file)
@@ -61,6 +61,7 @@
 #include "PlatformDefs.h"
 #include "NetworkLinux.h"
 #include "Util.h"
+#include "utils/StringUtils.h"
 #include "utils/log.h"
 
 using namespace std;
@@ -910,7 +911,7 @@ void CNetworkInterfaceLinux::GetSettings(NetworkAssignment& assignment, CStdStri
 
    while (getdelim(&line, &linel, '\n', fp) > 0)
    {
-      vector<CStdString> tokens;
+      std::vector<std::string> tokens;
 
       s = line;
       s.TrimLeft(" \t").TrimRight(" \n");
@@ -920,19 +921,19 @@ void CNetworkInterfaceLinux::GetSettings(NetworkAssignment& assignment, CStdStri
          continue;
 
       // look for "iface <interface name> inet"
-      CUtil::Tokenize(s, tokens, " ");
+      StringUtils::Tokenize(s, tokens, " ");
       if (!foundInterface &&
           tokens.size() >=3 &&
-          tokens[0].Equals("iface") &&
-          tokens[1].Equals(GetName()) &&
-          tokens[2].Equals("inet"))
+          StringUtils::EqualsNoCase(tokens[0], "iface") &&
+          StringUtils::EqualsNoCase(tokens[1], GetName()) &&
+          StringUtils::EqualsNoCase(tokens[2], "inet"))
       {
-         if (tokens[3].Equals("dhcp"))
+         if (StringUtils::EqualsNoCase(tokens[3], "dhcp"))
          {
             assignment = NETWORK_DHCP;
             foundInterface = true;
          }
-         if (tokens[3].Equals("static"))
+         if (StringUtils::EqualsNoCase(tokens[3], "static"))
          {
             assignment = NETWORK_STATIC;
             foundInterface = true;
@@ -941,22 +942,22 @@ void CNetworkInterfaceLinux::GetSettings(NetworkAssignment& assignment, CStdStri
 
       if (foundInterface && tokens.size() == 2)
       {
-         if (tokens[0].Equals("address")) ipAddress = tokens[1];
-         else if (tokens[0].Equals("netmask")) networkMask = tokens[1];
-         else if (tokens[0].Equals("gateway")) defaultGateway = tokens[1];
-         else if (tokens[0].Equals("wireless-essid")) essId = tokens[1];
-         else if (tokens[0].Equals("wireless-key"))
+         if (StringUtils::EqualsNoCase(tokens[0], "address")) ipAddress = tokens[1];
+         else if (StringUtils::EqualsNoCase(tokens[0], "netmask")) networkMask = tokens[1];
+         else if (StringUtils::EqualsNoCase(tokens[0], "gateway")) defaultGateway = tokens[1];
+         else if (StringUtils::EqualsNoCase(tokens[0], "wireless-essid")) essId = tokens[1];
+         else if (StringUtils::EqualsNoCase(tokens[0], "wireless-key"))
          {
             key = tokens[1];
             if (key.length() > 2 && key[0] == 's' && key[1] == ':')
                key.erase(0, 2);
             encryptionMode = ENC_WEP;
          }
-         else if (tokens[0].Equals("wpa-ssid")) essId = tokens[1];
-         else if (tokens[0].Equals("wpa-proto") && tokens[1].Equals("WPA")) encryptionMode = ENC_WPA;
-         else if (tokens[0].Equals("wpa-proto") && tokens[1].Equals("WPA2")) encryptionMode = ENC_WPA2;
-         else if (tokens[0].Equals("wpa-psk")) key = tokens[1];
-         else if (tokens[0].Equals("auto") || tokens[0].Equals("iface") || tokens[0].Equals("mapping")) break;
+         else if (StringUtils::EqualsNoCase(tokens[0], "wpa-ssid")) essId = tokens[1];
+         else if (StringUtils::EqualsNoCase(tokens[0], "wpa-proto") && StringUtils::EqualsNoCase(tokens[1], "WPA")) encryptionMode = ENC_WPA;
+         else if (StringUtils::EqualsNoCase(tokens[0], "wpa-proto") && StringUtils::EqualsNoCase(tokens[1], "WPA2")) encryptionMode = ENC_WPA2;
+         else if (StringUtils::EqualsNoCase(tokens[0], "wpa-psk")) key = tokens[1];
+         else if (StringUtils::EqualsNoCase(tokens[0], "auto") || StringUtils::EqualsNoCase(tokens[0], "iface") || StringUtils::EqualsNoCase(tokens[0], "mapping")) break;
       }
    }
    free(line);
@@ -995,7 +996,7 @@ void CNetworkInterfaceLinux::SetSettings(NetworkAssignment& assignment, CStdStri
 
    while (getdelim(&line, &linel, '\n', fr) > 0)
    {
-      vector<CStdString> tokens;
+      std::vector<std::string> tokens;
 
       s = line;
       s.TrimLeft(" \t").TrimRight(" \n");
@@ -1008,18 +1009,18 @@ void CNetworkInterfaceLinux::SetSettings(NetworkAssignment& assignment, CStdStri
       }
 
       // look for "iface <interface name> inet"
-      CUtil::Tokenize(s, tokens, " ");
+      StringUtils::Tokenize(s, tokens, " ");
       if (tokens.size() == 2 &&
-          tokens[0].Equals("auto") &&
-          tokens[1].Equals(GetName()))
+          StringUtils::EqualsNoCase(tokens[0], "auto") &&
+          StringUtils::EqualsNoCase(tokens[1], GetName()))
       {
          continue;
       }
       else if (!foundInterface &&
           tokens.size() == 4 &&
-          tokens[0].Equals("iface") &&
-          tokens[1].Equals(GetName()) &&
-          tokens[2].Equals("inet"))
+          StringUtils::EqualsNoCase(tokens[0], "iface") &&
+          StringUtils::EqualsNoCase(tokens[1], GetName()) &&
+          StringUtils::EqualsNoCase(tokens[2], "inet"))
       {
          foundInterface = true;
          WriteSettings(fw, assignment, ipAddress, networkMask, defaultGateway, essId, key, encryptionMode);
@@ -1027,7 +1028,7 @@ void CNetworkInterfaceLinux::SetSettings(NetworkAssignment& assignment, CStdStri
       }
       else if (foundInterface &&
                tokens.size() == 4 &&
-               tokens[0].Equals("iface"))
+               StringUtils::EqualsNoCase(tokens[0], "iface"))
       {
         foundInterface = false;
         fprintf(fw, "%s", line);
index f737495..a32701d 100644 (file)
@@ -1207,7 +1207,7 @@ CUPnPServer::SortItems(CFileItemList& items, const char* sort_criteria)
 
     SortDescription sorting;
     /* Platinum guarantees 1st char is - or + */
-    sorting.sortOrder = itr->Left(1).Equals("+") ? SortOrderAscending : SortOrderDescending;
+    sorting.sortOrder = StringUtils::StartsWith(*itr, "+") ? SortOrderAscending : SortOrderDescending;
 
     /* resource specific */
     if (method.Equals("res@duration"))
index 5694013..4f56a24 100644 (file)
@@ -9,7 +9,7 @@
        <key>CFBundleExecutable</key>
        <string>XBMC</string>
        <key>CFBundleGetInfoString</key>
-       <string>13.0.alpha8</string>
+       <string>13.0.alpha9</string>
        <key>CFBundleIconFile</key>
        <string>xbmc.icns</string>
        <key>CFBundleIdentifier</key>
@@ -19,7 +19,7 @@
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-       <string>13.0.alpha8</string>
+       <string>13.0.alpha9</string>
        <key>CFBundleVersion</key>
        <string>r####</string>
        <key>CFBundleSignature</key>
index 6691b2f..be62ba6 100644 (file)
@@ -506,10 +506,10 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, map<CStdSt
       if (!strEnums.IsEmpty())
       {
         vector< pair<int,int> > enums;
-        vector<CStdString> valuesVec;
-        CUtil::Tokenize(strEnums, valuesVec, "|");
+        vector<std::string> valuesVec;
+        StringUtils::Tokenize(strEnums, valuesVec, "|");
         for (unsigned int i = 0; i < valuesVec.size(); i++)
-          enums.push_back(make_pair(atoi(valuesVec[i]), atoi(valuesVec[i])));
+          enums.push_back(make_pair(atoi(valuesVec[i].c_str()), atoi(valuesVec[i].c_str())));
         int iValue = currentNode->Attribute("value") ? atoi(currentNode->Attribute("value")) : 0;
         setting = new CSettingInt(strKey, iLabelId, iValue, enums);
       }
@@ -537,7 +537,7 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, map<CStdSt
 
 void CPeripherals::GetDirectory(const CStdString &strPath, CFileItemList &items) const
 {
-  if (!strPath.Left(14).Equals("peripherals://"))
+  if (!StringUtils::StartsWithNoCase(strPath, "peripherals://"))
     return;
 
   CStdString strPathCut = strPath.Right(strPath.length() - 14);
@@ -553,7 +553,7 @@ void CPeripherals::GetDirectory(const CStdString &strPath, CFileItemList &items)
 
 CPeripheral *CPeripherals::GetByPath(const CStdString &strPath) const
 {
-  if (!strPath.Left(14).Equals("peripherals://"))
+  if (!StringUtils::StartsWithNoCase(strPath, "peripherals://"))
     return NULL;
 
   CStdString strPathCut = strPath.Right(strPath.length() - 14);
index 4d4d645..25f5f92 100644 (file)
@@ -43,6 +43,7 @@
 #include "utils/URIUtils.h"
 #include "Autorun.h"
 #include "interfaces/AnnouncementManager.h"
+#include "utils/StringUtils.h"
 
 #define CONTROL_BTNVIEWASICONS      2
 #define CONTROL_BTNSORTBY           3
@@ -474,7 +475,7 @@ void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &butt
     }
     else
     {
-      if (item && !item->GetPath().Left(14).Equals("addons://more/"))
+      if (item && !StringUtils::StartsWithNoCase(item->GetPath(), "addons://more/"))
       {
         if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
           buttons.Add(CONTEXT_BUTTON_INFO, 24003); // Add-on info
index 9d20117..e95d24f 100644 (file)
@@ -23,6 +23,7 @@
 #include "Util.h"
 #include "utils/Variant.h"
 #include "utils/CharsetConverter.h"
+#include "utils/StringUtils.h"
 
 using namespace std;
 
@@ -610,8 +611,8 @@ void CPictureInfoTag::SetInfo(int info, const CStdString& value)
   {
   case SLIDE_RESOLUTION:
     {
-      vector<CStdString> dimension;
-      CUtil::Tokenize(value, dimension, ",");
+      vector<std::string> dimension;
+      StringUtils::Tokenize(value, dimension, ",");
       if (dimension.size() == 2)
       {
         m_exifInfo.Width = atoi(dimension[0].c_str());
index 83e7841..3eb8737 100644 (file)
@@ -64,7 +64,7 @@ bool CPlayListPLS::Load(const CStdString &strFile)
   Clear();
 
   bool bShoutCast = false;
-  if( strFileName.Left(8).Equals("shout://") )
+  if( StringUtils::StartsWithNoCase(strFileName, "shout://") )
   {
     strFileName.Delete(0, 8);
     strFileName.Insert(0, "http://");
index 5551499..73dc2b8 100644 (file)
@@ -29,6 +29,7 @@
 #include "guilib/Key.h"
 #include "guilib/LocalizeStrings.h"
 #include "utils/log.h"
+#include "utils/StringUtils.h"
 
 #define CONTROL_BTNVIEWASICONS 2
 #define CONTROL_BTNSORTBY      3
@@ -180,7 +181,7 @@ bool CGUIWindowPrograms::GetDirectory(const CStdString &strDirectory, CFileItemL
     return false;
 
   // don't allow the view state to change these
-  if (strDirectory.Left(9).Equals("addons://"))
+  if (StringUtils::StartsWithNoCase(strDirectory, "addons://"))
   {
     for (int i=0;i<items.Size();++i)
     {
index e2e2031..167119c 100644 (file)
@@ -25,6 +25,7 @@
 #include "utils/URIUtils.h"
 #include "utils/log.h"
 #include "pvr/PVRManager.h"
+#include "utils/StringUtils.h"
 
 using namespace PVR;
 
@@ -181,7 +182,7 @@ bool CPVRChannelGroupsContainer::GetDirectory(const CStdString& strPath, CFileIt
     if (!group)
       group = GetGroupAllTV();
     if (group)
-      group->GetMembers(results, !fileName.Right(7).Equals(".hidden"));
+      group->GetMembers(results, !StringUtils::EndsWithNoCase(fileName, ".hidden"));
     return true;
   }
   else if (fileName.Left(15) == "channels/radio/")
@@ -192,7 +193,7 @@ bool CPVRChannelGroupsContainer::GetDirectory(const CStdString& strPath, CFileIt
     if (!group)
       group = GetGroupAllRadio();
     if (group)
-      group->GetMembers(results, !fileName.Right(7).Equals(".hidden"));
+      group->GetMembers(results, !StringUtils::EndsWithNoCase(fileName, ".hidden"));
     return true;
   }
 
index 12eaded..cc09fd1 100644 (file)
@@ -95,8 +95,8 @@ bool CGUIDialogPVRChannelsOSD::OnMessage(CGUIMessage& message)
 
 void CGUIDialogPVRChannelsOSD::OnInitWindow()
 {
-  /* Close dialog immediately if now TV or radio channel is playing */
-  if (!g_PVRManager.IsPlaying())
+  /* Close dialog immediately if neither a TV nor a radio channel is playing */
+  if (!g_PVRManager.IsPlayingTV() && !g_PVRManager.IsPlayingRadio())
   {
     Close();
     return;
index fbc916c..98a93b1 100644 (file)
@@ -32,6 +32,7 @@
 #include "pvr/PVRManager.h"
 #include "pvr/addons/PVRClients.h"
 #include "PVRRecordings.h"
+#include "utils/StringUtils.h"
 
 using namespace PVR;
 
@@ -242,7 +243,7 @@ CStdString CPVRRecordings::AddAllRecordingsPathExtension(const CStdString &strDi
     return strDirectory;
 
   CStdString strResult = strDirectory;
-  if (!strDirectory.Right(1).Equals("/"))
+  if (!StringUtils::EndsWith(strDirectory, "/"))
     strResult = strResult + "/";
 
   return strResult + PVR_ALL_RECORDINGS_PATH_EXTENSION + "/";
index 92f9e05..e8959b3 100644 (file)
@@ -326,7 +326,7 @@ bool CMediaSourceSettings::GetSource(const std::string &category, const TiXmlNod
     {
       CStdString strPath = pPathName->FirstChild()->ValueStr();
 
-      // make sure there are no virtualpaths or stack paths defined in xboxmediacenter.xml
+      // make sure there are no virtualpaths or stack paths defined in sources.xml
       if (!URIUtils::IsStack(strPath))
       {
         // translate special tags
index 6a3100d..6104c54 100644 (file)
@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <string>
 
+#include "utils/CPUInfo.h"
 #include "utils/log.h"
 #include "utils/StringUtils.h"
 
@@ -104,34 +105,16 @@ int aml_get_cputype()
   static int aml_cputype = -1;
   if (aml_cputype == -1)
   {
-    // defualt to m1 SoC
-    aml_cputype = 1;
+    std::string cpu_hardware = g_cpuInfo.getCPUHardware();
 
-    FILE *cpuinfo_fd = fopen("/proc/cpuinfo", "r");
-    if (cpuinfo_fd)
-    {
-      char buffer[512];
-      while (fgets(buffer, sizeof(buffer), cpuinfo_fd))
-      {
-        std::string stdbuffer(buffer);
-        if (stdbuffer.find("MESON-M3") != std::string::npos)
-        {
-          aml_cputype = 3;
-          break;
-        }
-        else if (stdbuffer.find("MESON3") != std::string::npos)
-        {
-          aml_cputype = 3;
-          break;
-        }
-        else if (stdbuffer.find("Meson6") != std::string::npos)
-        {
-          aml_cputype = 6;
-          break;
-        }
-      }
-      fclose(cpuinfo_fd);
-    }
+    // default to AMLogic M1
+    aml_cputype = 1;
+    if (cpu_hardware.find("MESON-M3") != std::string::npos)
+      aml_cputype = 3;
+    else if (cpu_hardware.find("MESON3") != std::string::npos)
+      aml_cputype = 3;
+    else if (cpu_hardware.find("Meson6") != std::string::npos)
+      aml_cputype = 6;
   }
 
   return aml_cputype;
index b7b1510..226eef4 100644 (file)
 #include <iconv.h>
 
 #if defined(TARGET_DARWIN)
-#ifdef __POWERPC__
-  #define WCHAR_CHARSET "UTF-32BE"
-#else
-  #define WCHAR_CHARSET "UTF-32LE"
-#endif
+  #define WCHAR_IS_UTF32 1
+  #undef WCHAR_IS_UTF16
+  #ifdef __POWERPC__
+    #define WCHAR_CHARSET "UTF-32BE"
+  #else
+    #define WCHAR_CHARSET "UTF-32LE"
+  #endif
   #define UTF8_SOURCE "UTF-8-MAC"
 #elif defined(TARGET_WINDOWS)
+  #undef WCHAR_IS_UTF32
+  #define WCHAR_IS_UTF16 1
   #define WCHAR_CHARSET "UTF-16LE"
   #define UTF8_SOURCE "UTF-8"
   #pragma comment(lib, "libfribidi.lib")
   #pragma comment(lib, "libiconv.lib")
 #elif defined(TARGET_ANDROID)
+  #define WCHAR_IS_UTF32 1
+  #undef WCHAR_IS_UTF16
   #define UTF8_SOURCE "UTF-8"
-#ifdef __BIG_ENDIAN__
-  #define WCHAR_CHARSET "UTF-32BE"
-#else
-  #define WCHAR_CHARSET "UTF-32LE"
-#endif
+  #ifdef __BIG_ENDIAN__
+    #define WCHAR_CHARSET "UTF-32BE"
+  #else
+    #define WCHAR_CHARSET "UTF-32LE"
+  #endif
 #else
   #define WCHAR_CHARSET "WCHAR_T"
   #define UTF8_SOURCE "UTF-8"
+  #ifdef HAVE_CONFIG_H
+    #include "config.h"
+  #endif // HAVE_CONFIG_H
+  #undef WCHAR_IS_UTF32
+  #undef WCHAR_IS_UTF16
+  #ifdef SIZEOF_WCHAR_T
+    #if SIZEOF_WCHAR_T == 4
+      #define WCHAR_IS_UTF32 1
+    #elif SIZEOF_WCHAR_T == 2
+      #define WCHAR_IS_UTF16 1
+    #endif
+  #endif
 #endif
 
 
+static iconv_t m_iconvUtf8ToUtf32                = (iconv_t)-1;
+static iconv_t m_iconvUtf32ToUtf8                = (iconv_t)-1;
+static iconv_t m_iconvUtf32ToW                   = (iconv_t)-1;
+static iconv_t m_iconvWToUtf32                   = (iconv_t)-1;
 static iconv_t m_iconvSubtitleCharsetToW         = (iconv_t)-1;
 static iconv_t m_iconvUtf8ToStringCharset        = (iconv_t)-1;
 static iconv_t m_iconvStringCharsetToUtf8        = (iconv_t)-1;
@@ -426,6 +448,10 @@ void CCharsetConverter::reset(void)
 {
   CSingleLock lock(m_critSection);
 
+  ICONV_SAFE_CLOSE(m_iconvUtf8ToUtf32);
+  ICONV_SAFE_CLOSE(m_iconvUtf32ToUtf8);
+  ICONV_SAFE_CLOSE(m_iconvUtf32ToW);
+  ICONV_SAFE_CLOSE(m_iconvWToUtf32);
   ICONV_SAFE_CLOSE(m_iconvUtf8ToStringCharset);
   ICONV_SAFE_CLOSE(m_iconvStringCharsetToUtf8);
   ICONV_SAFE_CLOSE(m_iconvSubtitleCharsetToW);
@@ -450,6 +476,78 @@ void CCharsetConverter::reset(void)
   }
 }
 
+bool CCharsetConverter::utf8ToUtf32(const std::string& utf8StringSrc, std::u32string& utf32StringDst, bool failOnBadChar /*= true*/)
+{
+  CSingleLock lock(m_critSection);
+  return convert(m_iconvUtf8ToUtf32, 1, UTF8_SOURCE, "UTF-32", utf8StringSrc, utf32StringDst, failOnBadChar);
+}
+
+std::u32string CCharsetConverter::utf8ToUtf32(const std::string& utf8StringSrc, bool failOnBadChar /*= true*/)
+{
+  std::u32string converted;
+  utf8ToUtf32(utf8StringSrc, converted, failOnBadChar);
+  return converted;
+}
+
+bool CCharsetConverter::utf8ToUtf32Visual(const std::string& utf8StringSrc, std::u32string& utf32StringDst, bool bVisualBiDiFlip /*= false*/, bool forceLTRReadingOrder /*= false*/, bool failOnBadChar /*= false*/)
+{
+  if (bVisualBiDiFlip)
+  {
+    std::string strFlipped;
+    if (!logicalToVisualBiDi(utf8StringSrc, strFlipped, FRIBIDI_UTF8, forceLTRReadingOrder ? FRIBIDI_TYPE_LTR : FRIBIDI_TYPE_PDF))
+      return false;
+    CSingleLock lock(m_critSection);
+    return convert(m_iconvUtf8ToUtf32, 1, UTF8_SOURCE, "UTF-32", strFlipped, utf32StringDst, failOnBadChar);
+  }
+  CSingleLock lock(m_critSection);
+  return convert(m_iconvUtf8ToUtf32, 1, UTF8_SOURCE, "UTF-32", utf8StringSrc, utf32StringDst, failOnBadChar);
+}
+
+bool CCharsetConverter::utf32ToUtf8(const std::u32string& utf32StringSrc, std::string& utf8StringDst, bool failOnBadChar /*= true*/)
+{
+  CSingleLock lock(m_critSection);
+  return convert(m_iconvUtf32ToUtf8, m_Utf8CharMaxSize, "UTF-32", "UTF-8", utf32StringSrc, utf8StringDst, failOnBadChar);
+}
+
+std::string CCharsetConverter::utf32ToUtf8(const std::u32string& utf32StringSrc, bool failOnBadChar /*= false*/)
+{
+  std::string converted;
+  utf32ToUtf8(utf32StringSrc, converted, failOnBadChar);
+  return converted;
+}
+
+bool CCharsetConverter::utf32ToW(const std::u32string& utf32StringSrc, std::wstring& wStringDst, bool failOnBadChar /*= true*/)
+{
+#ifdef WCHAR_IS_UTF32
+  wStringDst.assign((const wchar_t*)utf32StringSrc.c_str(), utf32StringSrc.length());
+  return true;
+#else // !WCHAR_IS_UTF32
+  CSingleLock lock(m_critSection);
+  return convert(m_iconvUtf32ToW, 1, "UTF-32", WCHAR_CHARSET, utf32StringSrc, wStringDst, failOnBadChar);
+#endif // !WCHAR_IS_UTF32
+}
+
+bool CCharsetConverter::utf32logicalToVisualBiDi(const std::u32string& logicalStringSrc, std::u32string& visualStringDst, bool forceLTRReadingOrder /*= false*/)
+{
+  visualStringDst.clear();
+  std::string utf8Str;
+  if (!utf32ToUtf8(logicalStringSrc, utf8Str, false))
+    return false;
+
+  return utf8ToUtf32Visual(utf8Str, visualStringDst, true, forceLTRReadingOrder);
+}
+
+bool CCharsetConverter::wToUtf32(const std::wstring& wStringSrc, std::u32string& utf32StringDst, bool failOnBadChar /*= true*/)
+{
+#ifdef WCHAR_IS_UTF32
+  utf32StringDst.assign((const char32_t*)wStringSrc.c_str(), wStringSrc.length());
+  return true;
+#else // !WCHAR_IS_UTF32
+  CSingleLock lock(m_critSection);
+  return convert(m_iconvWToUtf32, 1, WCHAR_CHARSET, "UTF-32", wStringSrc, utf32StringDst, failOnBadChar);
+#endif // !WCHAR_IS_UTF32
+}
+
 // The bVisualBiDiFlip forces a flip of characters for hebrew/arabic languages, only set to false if the flipping
 // of the string is already made or the string is not displayed in the GUI
 bool CCharsetConverter::utf8ToW(const std::string& utf8StringSrc, std::wstring& wStringDst, bool bVisualBiDiFlip /*= true*/, 
index d347f16..c545d65 100644 (file)
@@ -42,6 +42,87 @@ public:
 
   void clear();
 
+  /**
+   * Convert UTF-8 string to UTF-32 string.
+   * No RTL logical-visual transformation is performed.
+   * @param utf8StringSrc       is source UTF-8 string to convert
+   * @param utf32StringDst      is output UTF-32 string, empty on any error
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return true on successful conversion, false on any error
+   */
+  bool utf8ToUtf32(const std::string& utf8StringSrc, std::u32string& utf32StringDst, bool failOnBadChar = true);
+  /**
+   * Convert UTF-8 string to UTF-32 string.
+   * No RTL logical-visual transformation is performed.
+   * @param utf8StringSrc       is source UTF-8 string to convert
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return converted string on successful conversion, empty string on any error
+   */
+  std::u32string utf8ToUtf32(const std::string& utf8StringSrc, bool failOnBadChar = true);
+  /**
+   * Convert UTF-8 string to UTF-32 string.
+   * RTL logical-visual transformation is optionally performed.
+   * Use it for readable text, GUI strings etc.
+   * @param utf8StringSrc       is source UTF-8 string to convert
+   * @param utf32StringDst      is output UTF-32 string, empty on any error
+   * @param bVisualBiDiFlip     allow RTL visual-logical transformation if set to true, must be set
+   *                            to false is logical-visual transformation is already done
+   * @param forceLTRReadingOrder        force LTR reading order
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return true on successful conversion, false on any error
+   */
+  bool utf8ToUtf32Visual(const std::string& utf8StringSrc, std::u32string& utf32StringDst, bool bVisualBiDiFlip = false, bool forceLTRReadingOrder = false, bool failOnBadChar = false);
+  /**
+   * Convert UTF-32 string to UTF-8 string.
+   * No RTL visual-logical transformation is performed.
+   * @param utf32StringSrc      is source UTF-32 string to convert
+   * @param utf8StringDst       is output UTF-8 string, empty on any error
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return true on successful conversion, false on any error
+   */
+  bool utf32ToUtf8(const std::u32string& utf32StringSrc, std::string& utf8StringDst, bool failOnBadChar = false);
+  /**
+   * Convert UTF-32 string to UTF-8 string.
+   * No RTL visual-logical transformation is performed.
+   * @param utf32StringSrc      is source UTF-32 string to convert
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return converted string on successful conversion, empty string on any error
+   */
+  std::string utf32ToUtf8(const std::u32string& utf32StringSrc, bool failOnBadChar = false);
+  /**
+   * Convert UTF-32 string to wchar_t string (wstring).
+   * No RTL visual-logical transformation is performed.
+   * @param utf32StringSrc      is source UTF-32 string to convert
+   * @param wStringDst          is output wchar_t string, empty on any error
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return true on successful conversion, false on any error
+   */
+  bool utf32ToW(const std::u32string& utf32StringSrc, std::wstring& wStringDst, bool failOnBadChar = false);
+  /**
+   * Perform logical to visual flip.
+   * @param logicalStringSrc    is source string with logical characters order
+   * @param visualStringDst     is output string with visual characters order, empty on any error
+   * @param forceLTRReadingOrder        force LTR reading order
+   * @return true on success, false otherwise
+   */
+  bool utf32logicalToVisualBiDi(const std::u32string& logicalStringSrc, std::u32string& visualStringDst, bool forceLTRReadingOrder = false);
+  /**
+   * Strictly convert wchar_t string (wstring) to UTF-32 string.
+   * No RTL visual-logical transformation is performed.
+   * @param wStringSrc          is source wchar_t string to convert
+   * @param utf32StringDst      is output UTF-32 string, empty on any error
+   * @param failOnBadChar       if set to true function will fail on invalid character,
+   *                            otherwise invalid character will be skipped
+   * @return true on successful conversion, false on any error
+   */
+  bool wToUtf32(const std::wstring& wStringSrc, std::u32string& utf32StringDst, bool failOnBadChar = false);
+
   bool utf8ToW(const std::string& utf8StringSrc, std::wstring& wStringDst,
                 bool bVisualBiDiFlip = true, bool forceLTRReadingOrder = false,
                 bool failOnBadChar = false, bool* bWasFlipped = NULL);
index 3923318..5ca700e 100644 (file)
@@ -213,6 +213,15 @@ bool CLangCodeExpander::ConvertToThreeCharCode(CStdString& strThreeCharCode, con
   }
   else if (strCharCode.size() > 3)
   {
+    for(unsigned int i = 0; i < sizeof(g_iso639_2) / sizeof(LCENTRY); i++)
+    {
+      if (strCharCode.Equals(g_iso639_2[i].name))
+      {
+        CodeToString(g_iso639_2[i].code, strThreeCharCode);
+        return true;
+      }
+    }
+
     CStdString strLangInfoPath;
     strLangInfoPath.Format("special://xbmc/language/%s/langinfo.xml", strCharCode.c_str());
     CLangInfo langInfo;
index 83711aa..6d90253 100644 (file)
@@ -28,6 +28,7 @@
 #include "Util.h"
 #include "log.h"
 #include "CharsetConverter.h"
+#include "utils/StringUtils.h"
 
 #include <sstream>
 #include <cstring>
@@ -536,8 +537,8 @@ void CScraperParser::GetBufferParams(bool* result, const char* attribute, bool d
     result[iBuf] = defvalue;;
   if (attribute)
   {
-    vector<CStdString> vecBufs;
-    CUtil::Tokenize(attribute,vecBufs,",");
+    vector<std::string> vecBufs;
+    StringUtils::Tokenize(attribute,vecBufs,",");
     for (size_t nToken=0; nToken < vecBufs.size(); nToken++)
     {
       int index = atoi(vecBufs[nToken].c_str())-1;
index d316d71..a7ed17b 100644 (file)
@@ -536,7 +536,7 @@ long StringUtils::TimeStringToSeconds(const CStdString &timeString)
   CStdString strCopy(timeString);
   strCopy.TrimLeft(" \n\r\t");
   strCopy.TrimRight(" \n\r\t");
-  if(strCopy.Right(4).Equals(" min"))
+  if(StringUtils::EndsWithNoCase(strCopy, " min"))
   {
     // this is imdb format of "XXX min"
     return 60 * atoi(strCopy.c_str());
@@ -859,3 +859,22 @@ std::string StringUtils::Paramify(const std::string &param)
   // add double quotes around the whole string
   return "\"" + result + "\"";
 }
+
+void StringUtils::Tokenize(const std::string& input, std::vector<std::string>& tokens, const std::string& delimiters)
+{
+  // Tokenize ripped from http://www.linuxselfhelp.com/HOWTO/C++Programming-HOWTO-7.html
+  // Skip delimiters at beginning.
+  string::size_type lastPos = input.find_first_not_of(delimiters, 0);
+  // Find first "non-delimiter".
+  string::size_type pos = input.find_first_of(delimiters, lastPos);
+
+  while (string::npos != pos || string::npos != lastPos)
+  {
+    // Found a token, add it to the vector.
+    tokens.push_back(input.substr(lastPos, pos - lastPos));
+    // Skip delimiters.  Note the "not_of"
+    lastPos = input.find_first_not_of(delimiters, pos);
+    // Find next "non-delimiter"
+    pos = input.find_first_of(delimiters, lastPos);
+  }
+}
index 11f6f5e..32b1de2 100644 (file)
@@ -137,6 +137,7 @@ public:
    \return Escaped/Paramified string
    */
   static std::string Paramify(const std::string &param);
+  static void Tokenize(const std::string& input, std::vector<std::string>& tokens, const std::string& delimiters);
 private:
   static CStdString m_lastUUID;
 };
index e52ac04..c185ac2 100644 (file)
@@ -84,7 +84,7 @@ void CTextSearch::GetAndCutNextTerm(CStdString &strSearchTerm, CStdString &strNe
 {
   CStdString strFindNext(" ");
 
-  if (strSearchTerm.Left(1).Equals("\""))
+  if (StringUtils::EndsWith(strSearchTerm, "\""))
   {
     strSearchTerm.erase(0, 1);
     strFindNext = "\"";
@@ -119,19 +119,19 @@ void CTextSearch::ExtractSearchTerms(const CStdString &strSearchTerm, TextSearch
   {
     strParsedSearchTerm = strParsedSearchTerm.TrimLeft();
 
-    if (strParsedSearchTerm.Left(1).Equals("!") || strParsedSearchTerm.Left(3).Equals("NOT"))
+    if (StringUtils::StartsWith(strParsedSearchTerm, "!") || StringUtils::StartsWithNoCase(strParsedSearchTerm, "not"))
     {
       CStdString strDummy;
       GetAndCutNextTerm(strParsedSearchTerm, strDummy);
       bNextNOT = true;
     }
-    else if (strParsedSearchTerm.Left(1).Equals("+") || strParsedSearchTerm.Left(3).Equals("AND"))
+    else if (StringUtils::StartsWith(strParsedSearchTerm, "+") || StringUtils::StartsWithNoCase(strParsedSearchTerm, "and"))
     {
       CStdString strDummy;
       GetAndCutNextTerm(strParsedSearchTerm, strDummy);
       bNextAND = true;
     }
-    else if (strParsedSearchTerm.Left(1).Equals("|") || strParsedSearchTerm.Left(2).Equals("OR"))
+    else if (StringUtils::StartsWith(strParsedSearchTerm, "|") || StringUtils::StartsWithNoCase(strParsedSearchTerm, "or"))
     {
       CStdString strDummy;
       GetAndCutNextTerm(strParsedSearchTerm, strDummy);
index 7e5fccf..5fae833 100644 (file)
@@ -302,14 +302,14 @@ bool URIUtils::GetParentPath(const CStdString& strPath, CStdString& strParent)
     CFileItemList items;
     dir.GetDirectory(strPath,items);
     items[0]->m_strDVDLabel = GetDirectory(items[0]->GetPath());
-    if (items[0]->m_strDVDLabel.Mid(0,6).Equals("rar://") || items[0]->m_strDVDLabel.Mid(0,6).Equals("zip://"))
+    if (StringUtils::StartsWithNoCase(items[0]->m_strDVDLabel, "rar://") || StringUtils::StartsWithNoCase(items[0]->m_strDVDLabel, "zip://"))
       GetParentPath(items[0]->m_strDVDLabel, strParent);
     else
       strParent = items[0]->m_strDVDLabel;
     for( int i=1;i<items.Size();++i)
     {
       items[i]->m_strDVDLabel = GetDirectory(items[i]->GetPath());
-      if (items[0]->m_strDVDLabel.Mid(0,6).Equals("rar://") || items[0]->m_strDVDLabel.Mid(0,6).Equals("zip://"))
+      if (StringUtils::StartsWithNoCase(items[0]->m_strDVDLabel, "rar://") || StringUtils::StartsWithNoCase(items[0]->m_strDVDLabel, "zip://"))
         items[i]->SetPath(GetParentPath(items[i]->m_strDVDLabel));
       else
         items[i]->SetPath(items[i]->m_strDVDLabel);
@@ -525,7 +525,7 @@ bool URIUtils::IsOnLAN(const CStdString& strPath)
 
 bool URIUtils::IsMultiPath(const CStdString& strPath)
 {
-  return strPath.Left(10).Equals("multipath:");
+  return StringUtils::StartsWithNoCase(strPath, "multipath:");
 }
 
 bool URIUtils::IsHD(const CStdString& strFileName)
@@ -552,7 +552,7 @@ bool URIUtils::IsDVD(const CStdString& strFile)
     return true;
 
 #if defined(TARGET_WINDOWS)
-  if (strFile.Left(6).Equals("dvd://"))
+  if (StringUtils::StartsWithNoCase(strFile, "dvd://"))
     return true;
 
   if(strFile.Mid(1) != ":\\"
@@ -571,7 +571,7 @@ bool URIUtils::IsDVD(const CStdString& strFile)
 
 bool URIUtils::IsStack(const CStdString& strFile)
 {
-  return strFile.Left(6).Equals("stack:");
+  return StringUtils::StartsWithNoCase(strFile, "stack:");
 }
 
 bool URIUtils::IsRAR(const CStdString& strFile)
@@ -638,7 +638,7 @@ bool URIUtils::IsSpecial(const CStdString& strFile)
   if (IsStack(strFile))
     strFile2 = CStackDirectory::GetFirstStackedFile(strFile);
 
-  return strFile2.Left(8).Equals("special:");
+  return StringUtils::StartsWithNoCase(strFile2, "special:");
 }
 
 bool URIUtils::IsPlugin(const CStdString& strFile)
@@ -667,12 +667,12 @@ bool URIUtils::IsSourcesPath(const CStdString& strPath)
 
 bool URIUtils::IsCDDA(const CStdString& strFile)
 {
-  return strFile.Left(5).Equals("cdda:");
+  return StringUtils::StartsWithNoCase(strFile, "cdda:");
 }
 
 bool URIUtils::IsISO9660(const CStdString& strFile)
 {
-  return strFile.Left(8).Equals("iso9660:");
+  return StringUtils::StartsWithNoCase(strFile, "iso9660:");
 }
 
 bool URIUtils::IsSmb(const CStdString& strFile)
@@ -682,7 +682,7 @@ bool URIUtils::IsSmb(const CStdString& strFile)
   if (IsStack(strFile))
     strFile2 = CStackDirectory::GetFirstStackedFile(strFile);
 
-  return strFile2.Left(4).Equals("smb:");
+  return StringUtils::StartsWithNoCase(strFile2, "smb:");
 }
 
 bool URIUtils::IsURL(const CStdString& strFile)
@@ -697,8 +697,8 @@ bool URIUtils::IsFTP(const CStdString& strFile)
   if (IsStack(strFile))
     strFile2 = CStackDirectory::GetFirstStackedFile(strFile);
 
-  return strFile2.Left(4).Equals("ftp:")  ||
-         strFile2.Left(5).Equals("ftps:");
+  return StringUtils::StartsWithNoCase(strFile2, "ftp:")  ||
+         StringUtils::StartsWithNoCase(strFile2, "ftps:");
 }
 
 bool URIUtils::IsDAV(const CStdString& strFile)
@@ -708,8 +708,8 @@ bool URIUtils::IsDAV(const CStdString& strFile)
   if (IsStack(strFile))
     strFile2 = CStackDirectory::GetFirstStackedFile(strFile);
 
-  return strFile2.Left(4).Equals("dav:")  ||
-         strFile2.Left(5).Equals("davs:");
+  return StringUtils::StartsWithNoCase(strFile2, "dav:")  ||
+         StringUtils::StartsWithNoCase(strFile2, "davs:");
 }
 
 bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */)
@@ -745,42 +745,42 @@ bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */
 
 bool URIUtils::IsDAAP(const CStdString& strFile)
 {
-  return strFile.Left(5).Equals("daap:");
+  return StringUtils::StartsWithNoCase(strFile, "daap:");
 }
 
 bool URIUtils::IsUPnP(const CStdString& strFile)
 {
-  return strFile.Left(5).Equals("upnp:");
+  return StringUtils::StartsWithNoCase(strFile, "upnp:");
 }
 
 bool URIUtils::IsTuxBox(const CStdString& strFile)
 {
-  return strFile.Left(7).Equals("tuxbox:");
+  return StringUtils::StartsWithNoCase(strFile, "tuxbox:");
 }
 
 bool URIUtils::IsMythTV(const CStdString& strFile)
 {
-  return strFile.Left(5).Equals("myth:");
+  return StringUtils::StartsWithNoCase(strFile, "myth:");
 }
 
 bool URIUtils::IsHDHomeRun(const CStdString& strFile)
 {
-  return strFile.Left(10).Equals("hdhomerun:");
+  return StringUtils::StartsWithNoCase(strFile, "hdhomerun:");
 }
 
 bool URIUtils::IsSlingbox(const CStdString& strFile)
 {
-  return strFile.Left(6).Equals("sling:");
+  return StringUtils::StartsWithNoCase(strFile, "sling:");
 }
 
 bool URIUtils::IsVTP(const CStdString& strFile)
 {
-  return strFile.Left(4).Equals("vtp:");
+  return StringUtils::StartsWithNoCase(strFile, "vtp:");
 }
 
 bool URIUtils::IsHTSP(const CStdString& strFile)
 {
-  return strFile.Left(5).Equals("htsp:");
+  return StringUtils::StartsWithNoCase(strFile, "htsp:");
 }
 
 bool URIUtils::IsLiveTV(const CStdString& strFile)
@@ -793,8 +793,8 @@ bool URIUtils::IsLiveTV(const CStdString& strFile)
   || IsHDHomeRun(strFile)
   || IsSlingbox(strFile)
   || IsHTSP(strFile)
-  || strFile.Left(4).Equals("sap:")
-  ||(strFileWithoutSlash.Right(4).Equals(".pvr") && !strFileWithoutSlash.Left(16).Equals("pvr://recordings")))
+  || StringUtils::StartsWithNoCase(strFile, "sap:")
+  ||(StringUtils::EndsWithNoCase(strFileWithoutSlash, ".pvr") && !StringUtils::StartsWithNoCase(strFileWithoutSlash, "pvr://recordings")))
     return true;
 
   if (IsMythTV(strFile) && CMythDirectory::IsLiveTV(strFile))
@@ -808,13 +808,13 @@ bool URIUtils::IsPVRRecording(const CStdString& strFile)
   CStdString strFileWithoutSlash(strFile);
   RemoveSlashAtEnd(strFileWithoutSlash);
 
-  return strFileWithoutSlash.Right(4).Equals(".pvr") &&
-         strFile.Left(16).Equals("pvr://recordings");
+  return StringUtils::EndsWithNoCase(strFileWithoutSlash, ".pvr") &&
+         StringUtils::StartsWithNoCase(strFile, "pvr://recordings");
 }
 
 bool URIUtils::IsMusicDb(const CStdString& strFile)
 {
-  return strFile.Left(8).Equals("musicdb:");
+  return StringUtils::StartsWithNoCase(strFile, "musicdb:");
 }
 
 bool URIUtils::IsNfs(const CStdString& strFile)
@@ -824,7 +824,7 @@ bool URIUtils::IsNfs(const CStdString& strFile)
   if (IsStack(strFile))
     strFile2 = CStackDirectory::GetFirstStackedFile(strFile);
   
-  return strFile2.Left(4).Equals("nfs:");
+  return StringUtils::StartsWithNoCase(strFile2, "nfs:");
 }
 
 bool URIUtils::IsAfp(const CStdString& strFile)
@@ -834,23 +834,23 @@ bool URIUtils::IsAfp(const CStdString& strFile)
   if (IsStack(strFile))
     strFile2 = CStackDirectory::GetFirstStackedFile(strFile);
   
-  return strFile2.Left(4).Equals("afp:");
+  return StringUtils::StartsWithNoCase(strFile2, "afp:");
 }
 
 
 bool URIUtils::IsVideoDb(const CStdString& strFile)
 {
-  return strFile.Left(8).Equals("videodb:");
+  return StringUtils::StartsWithNoCase(strFile, "videodb:");
 }
 
 bool URIUtils::IsBluray(const CStdString& strFile)
 {
-  return strFile.Left(7).Equals("bluray:");
+  return StringUtils::StartsWithNoCase(strFile, "bluray:");
 }
 
 bool URIUtils::IsAndroidApp(const CStdString &path)
 {
-  return path.Left(11).Equals("androidapp:");
+  return StringUtils::StartsWithNoCase(path, "androidapp:");
 }
 
 bool URIUtils::IsLibraryFolder(const CStdString& strFile)
index 22d4084..e8ad86f 100644 (file)
@@ -474,7 +474,7 @@ int CVideoDatabase::GetPathId(const CStdString& strPath)
     if (NULL == m_pDS.get()) return -1;
 
     CStdString strPath1(strPath);
-    if (URIUtils::IsStack(strPath) || strPath.Mid(0,6).Equals("rar://") || strPath.Mid(0,6).Equals("zip://"))
+    if (URIUtils::IsStack(strPath) || StringUtils::StartsWithNoCase(strPath, "rar://") || StringUtils::StartsWithNoCase(strPath, "zip://"))
       URIUtils::GetParentPath(strPath,strPath1);
 
     URIUtils::AddSlashAtEnd(strPath1);
@@ -642,7 +642,7 @@ int CVideoDatabase::AddPath(const CStdString& strPath, const CStdString &strDate
     if (NULL == m_pDS.get()) return -1;
 
     CStdString strPath1(strPath);
-    if (URIUtils::IsStack(strPath) || strPath.Mid(0,6).Equals("rar://") || strPath.Mid(0,6).Equals("zip://"))
+    if (URIUtils::IsStack(strPath) || StringUtils::StartsWithNoCase(strPath, "rar://") || StringUtils::StartsWithNoCase(strPath, "zip://"))
       URIUtils::GetParentPath(strPath,strPath1);
 
     URIUtils::AddSlashAtEnd(strPath1);
@@ -6325,7 +6325,7 @@ void CVideoDatabase::Stack(CFileItemList& items, VIDEODB_CONTENT_TYPE type, bool
 
         // do we have a dvd folder, ie foo/VIDEO_TS.IFO or foo/VIDEO_TS/VIDEO_TS.IFO
         CStdString strFileNameAndPath = pItem->GetVideoInfoTag()->m_strFileNameAndPath;
-        bool bDvdFolder = strFileNameAndPath.Right(12).Equals("VIDEO_TS.IFO");
+        bool bDvdFolder = StringUtils::EndsWithNoCase(strFileNameAndPath, "video_ts.ifo");
 
         vector<CStdString> paths;
         paths.push_back(strFileNameAndPath);
@@ -6351,7 +6351,7 @@ void CVideoDatabase::Stack(CFileItemList& items, VIDEODB_CONTENT_TYPE type, bool
             // keep checking to see if this is dvd folder
             if (!bDvdFolder)
             {
-              bDvdFolder = jFileNameAndPath.Right(12).Equals("VIDEO_TS.IFO");
+              bDvdFolder = StringUtils::EndsWithNoCase(jFileNameAndPath, "video_ts.ifo");
               // if we have a dvd folder, we stack differently
               if (bDvdFolder)
               {
@@ -7171,7 +7171,7 @@ void CVideoDatabase::GetMusicVideoArtistsByName(const CStdString& strSearch, CFi
       CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
       CStdString strDir;
       strDir.Format("%ld/", m_pDS->fv("actors.idActor").get_asInt());
-      pItem->SetPath("videodb://musicvideos/artist/"+ strDir);
+      pItem->SetPath("videodb://musicvideos/artists/"+ strDir);
       pItem->m_bIsFolder=true;
       items.Add(pItem);
       m_pDS->next();
@@ -9113,7 +9113,7 @@ void CVideoDatabase::ConstructPath(CStdString& strDest, const CStdString& strPat
 
 void CVideoDatabase::SplitPath(const CStdString& strFileNameAndPath, CStdString& strPath, CStdString& strFileName)
 {
-  if (URIUtils::IsStack(strFileNameAndPath) || strFileNameAndPath.Mid(0,6).Equals("rar://") || strFileNameAndPath.Mid(0,6).Equals("zip://"))
+  if (URIUtils::IsStack(strFileNameAndPath) || StringUtils::StartsWithNoCase(strFileNameAndPath, "rar://") || StringUtils::StartsWithNoCase(strFileNameAndPath, "zip://"))
   {
     URIUtils::GetParentPath(strFileNameAndPath,strPath);
     strFileName = strFileNameAndPath;
index 93d0ff3..c92d850 100644 (file)
@@ -1925,7 +1925,7 @@ namespace VIDEO
     {
       strCheck = strDirectory;
       URIUtils::RemoveSlashAtEnd(strCheck);
-      if (URIUtils::GetFileName(strCheck).size() == 3 && URIUtils::GetFileName(strCheck).Left(2).Equals("cd"))
+      if (URIUtils::GetFileName(strCheck).size() == 3 && StringUtils::StartsWithNoCase(URIUtils::GetFileName(strCheck), "cd"))
         strDirectory = URIUtils::GetDirectory(strCheck);
     }
     return strDirectory;
index 5bf3656..3ba991a 100644 (file)
@@ -24,6 +24,7 @@
 #include "utils/MathUtils.h"
 #include "utils/log.h"
 #include "utils/TimeUtils.h"
+#include "utils/StringUtils.h"
 #include "threads/SingleLock.h"
 
 #if defined(HAS_GLX) && defined(HAS_XRANDR)
@@ -291,7 +292,7 @@ bool CVideoReferenceClock::SetupGLX()
 
   CStdString Vendor = g_Windowing.GetRenderVendor();
   Vendor.ToLower();
-  if (Vendor.compare(0, 3, "ati") == 0)
+  if (StringUtils::StartsWith(Vendor, "ati"))
   {
     CLog::Log(LOGDEBUG, "CVideoReferenceClock: GL_VENDOR: %s, using ati workaround", Vendor.c_str());
     m_bIsATI = true;
index 2271437..7296705 100644 (file)
@@ -35,6 +35,7 @@
 #include "cores/dvdplayer/DVDFileInfo.h"
 #include "video/VideoInfoScanner.h"
 #include "music/MusicDatabase.h"
+#include "utils/StringUtils.h"
 
 using namespace XFILE;
 using namespace std;
@@ -326,7 +327,7 @@ bool CVideoThumbLoader::LoadItemLookup(CFileItem* pItem)
   {
     // An auto-generated thumb may have been cached on a different device - check we have it here
     CStdString url = pItem->GetArt("thumb");
-    if (url.compare(0, 14, "image://video@") == 0 && !CTextureCache::Get().HasCachedImage(url))
+    if (StringUtils::StartsWith(url, "image://video@") && !CTextureCache::Get().HasCachedImage(url))
       pItem->SetArt("thumb", "");
 
     if (!pItem->HasArt("thumb"))
index 2eb9f56..d59ba5f 100644 (file)
@@ -214,12 +214,12 @@ void CGUIDialogVideoInfo::OnInitWindow()
     database.Close();
   }
 
-  CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_REFRESH, (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !m_movieItem->GetVideoInfoTag()->m_strIMDBNumber.Left(2).Equals("xx") && scraper);
-  CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_GET_THUMB, (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !m_movieItem->GetVideoInfoTag()->m_strIMDBNumber.Mid(2).Equals("plugin"));
+  CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_REFRESH, (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !StringUtils::StartsWithNoCase(m_movieItem->GetVideoInfoTag()->m_strIMDBNumber, "xx") && scraper);
+  CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_GET_THUMB, (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !StringUtils::StartsWithNoCase(m_movieItem->GetVideoInfoTag()->m_strIMDBNumber.c_str() + 2, "plugin"));
 
   VIDEODB_CONTENT_TYPE type = (VIDEODB_CONTENT_TYPE)m_movieItem->GetVideoContentType();
   if (type == VIDEODB_CONTENT_TVSHOWS || type == VIDEODB_CONTENT_MOVIES)
-    CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_GET_FANART, (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !m_movieItem->GetVideoInfoTag()->m_strIMDBNumber.Mid(2).Equals("plugin"));
+    CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_GET_FANART, (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() || g_passwordManager.bMasterUser) && !StringUtils::StartsWithNoCase(m_movieItem->GetVideoInfoTag()->m_strIMDBNumber.c_str() + 2, "plugin"));
   else
     CONTROL_DISABLE(CONTROL_BTN_GET_FANART);
 
index b531447..dda5e68 100644 (file)
@@ -1203,7 +1203,7 @@ void CGUIWindowVideoBase::GetContextButtons(int itemNumber, CContextButtons &but
             buttons.Add(CONTEXT_BUTTON_PLAY_PART, 20324);
         }
 
-        if (!m_vecItems->GetPath().IsEmpty() && !item->GetPath().Left(19).Equals("newsmartplaylist://") && !item->GetPath().Left(9).Equals("newtag://")
+        if (!m_vecItems->GetPath().IsEmpty() && !StringUtils::StartsWithNoCase(item->GetPath(), "newsmartplaylist://") && !StringUtils::StartsWithNoCase(item->GetPath(), "newtag://")
             && !m_vecItems->IsSourcesPath())
         {
           buttons.Add(CONTEXT_BUTTON_QUEUE_ITEM, 13347);      // Add to Playlist
index 1dfbb52..577bce3 100644 (file)
@@ -497,11 +497,11 @@ void CGUIWindowVideoNav::UpdateButtons()
     {
       CFileItemPtr pItem = m_vecItems->Get(i);
       if (pItem->IsParentFolder()) iItems--;
-      if (pItem->GetPath().Left(4).Equals("/-1/")) iItems--;
+      if (StringUtils::StartsWith(pItem->GetPath(), "/-1/")) iItems--;
     }
     // or the last item
     if (m_vecItems->Size() > 2 &&
-      m_vecItems->Get(m_vecItems->Size()-1)->GetPath().Left(4).Equals("/-1/"))
+      StringUtils::StartsWith(m_vecItems->Get(m_vecItems->Size()-1)->GetPath(), "/-1/"))
       iItems--;
   }
   CStdString items;
@@ -671,7 +671,7 @@ void CGUIWindowVideoNav::OnDeleteItem(CFileItemPtr pItem)
     if (!pItem->GetPath().Equals("newsmartplaylist://video") &&
         !pItem->GetPath().Equals("special://videoplaylists/") &&
         !pItem->GetPath().Equals("sources://video/") &&
-        !pItem->GetPath().Left(9).Equals("newtag://"))
+        !StringUtils::StartsWithNoCase(pItem->GetPath(), "newtag://"))
       CGUIWindowVideoBase::OnDeleteItem(pItem);
   }
   else if (StringUtils::StartsWithNoCase(pItem->GetPath(), "videodb://movies/sets/") &&
@@ -734,7 +734,7 @@ void CGUIWindowVideoNav::OnDeleteItem(CFileItemPtr pItem)
     if (URIUtils::GetFileName(strDeletePath).Equals("VIDEO_TS.IFO"))
     {
       strDeletePath = URIUtils::GetDirectory(strDeletePath);
-      if (strDeletePath.Right(9).Equals("VIDEO_TS/"))
+      if (StringUtils::EndsWithNoCase(strDeletePath, "video_ts/"))
       {
         URIUtils::RemoveSlashAtEnd(strDeletePath);
         strDeletePath = URIUtils::GetDirectory(strDeletePath);
@@ -1437,7 +1437,7 @@ bool CGUIWindowVideoNav::OnClick(int iItem)
     m_viewControl.SetSelectedItem(iItem);
     return true;
   }
-  else if (item->GetPath().Left(9).Equals("newtag://"))
+  else if (StringUtils::StartsWithNoCase(item->GetPath(), "newtag://"))
   {
     // dont allow update while scanning
     if (g_application.IsVideoScanning())
@@ -1533,7 +1533,7 @@ CStdString CGUIWindowVideoNav::GetStartFolder(const CStdString &dir)
   else if (dir.Equals("MusicVideoYears"))
     return "videodb://musicvideos/years/";
   else if (dir.Equals("MusicVideoArtists"))
-    return "videodb://musicvideos/artist/";
+    return "videodb://musicvideos/artists/";
   else if (dir.Equals("MusicVideoAlbums"))
     return "videodb://musicvideos/albums/";
   else if (dir.Equals("MusicVideoDirectors"))
index 1fbb52e..f5de0a3 100644 (file)
@@ -93,9 +93,9 @@ CStdString CWIN32Util::URLEncode(const CURL &url)
   flat += url.GetHostName();
 
   /* okey sadly since a slash is an invalid name we have to tokenize */
-  std::vector<CStdString> parts;
-  std::vector<CStdString>::iterator it;
-  CUtil::Tokenize(url.GetFileName(), parts, "/");
+  std::vector<std::string> parts;
+  std::vector<std::string>::iterator it;
+  StringUtils::Tokenize(url.GetFileName(), parts, "/");
   for( it = parts.begin(); it != parts.end(); it++ )
   {
     flat += "/";
@@ -476,7 +476,7 @@ CStdString CWIN32Util::GetProfilePath()
 CStdString CWIN32Util::UncToSmb(const CStdString &strPath)
 {
   CStdString strRetPath(strPath);
-  if(strRetPath.Left(2).Equals("\\\\"))
+  if(StringUtils::StartsWith(strRetPath, "\\\\"))
   {
     strRetPath = "smb:" + strPath;
     strRetPath.Replace("\\","/");
@@ -487,7 +487,7 @@ CStdString CWIN32Util::UncToSmb(const CStdString &strPath)
 CStdString CWIN32Util::SmbToUnc(const CStdString &strPath)
 {
   CStdString strRetPath(strPath);
-  if(strRetPath.Left(6).Equals("smb://"))
+  if(StringUtils::StartsWithNoCase(strRetPath, "smb://"))
   {
     strRetPath.Replace("smb://","\\\\");
     strRetPath.Replace("/","\\");
@@ -1359,21 +1359,6 @@ extern "C" {
 }
 
 
-bool CWIN32Util::Is64Bit()
-{
-  bool bRet= false;
-  typedef VOID (WINAPI *LPFN_GETNATIVESYSTEMINFO) (LPSYSTEM_INFO);
-  LPFN_GETNATIVESYSTEMINFO fnGetNativeSystemInfo= ( LPFN_GETNATIVESYSTEMINFO ) GetProcAddress( GetModuleHandle( TEXT( "kernel32" ) ), "GetNativeSystemInfo" );
-  SYSTEM_INFO sSysInfo;
-  memset( &sSysInfo, 0, sizeof( sSysInfo ) );
-  if (fnGetNativeSystemInfo != NULL)
-  {
-    fnGetNativeSystemInfo(&sSysInfo);
-    if (sSysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) bRet= true;
-  }
-  return bRet;
-}
-
 LONG CWIN32Util::UtilRegGetValue( const HKEY hKey, const char *const pcKey, DWORD *const pdwType, char **const ppcBuffer, DWORD *const pdwSizeBuff, const DWORD dwSizeAdd )
 {
   DWORD dwSize;
@@ -1396,7 +1381,7 @@ LONG CWIN32Util::UtilRegGetValue( const HKEY hKey, const char *const pcKey, DWOR
 
 bool CWIN32Util::UtilRegOpenKeyEx( const HKEY hKeyParent, const char *const pcKey, const REGSAM rsAccessRights, HKEY *hKey, const bool bReadX64 )
 {
-  const REGSAM rsAccessRightsTmp= ( Is64Bit() ? rsAccessRights | ( bReadX64 ? KEY_WOW64_64KEY : KEY_WOW64_32KEY ) : rsAccessRights );
+  const REGSAM rsAccessRightsTmp= ( CSysInfo::IsOS64bit() ? rsAccessRights | ( bReadX64 ? KEY_WOW64_64KEY : KEY_WOW64_32KEY ) : rsAccessRights );
   bool bRet= ( ERROR_SUCCESS == RegOpenKeyEx(hKeyParent, pcKey, 0, rsAccessRightsTmp, hKey));
   return bRet;
 }
index 4f514f2..bc0a344 100644 (file)
@@ -77,7 +77,6 @@ public:
   static bool IsAudioCD(const CStdString& strPath);
   static CStdString GetDiskLabel(const CStdString& strPath);
 
-  static bool Is64Bit();
   static LONG UtilRegGetValue( const HKEY hKey, const char *const pcKey, DWORD *const pdwType, char **const ppcBuffer, DWORD *const pdwSizeBuff, const DWORD dwSizeAdd );
   static bool UtilRegOpenKeyEx( const HKEY hKeyParent, const char *const pcKey, const REGSAM rsAccessRights, HKEY *hKey, const bool bReadX64= false );
 
index b276454..f3d4bb2 100644 (file)
@@ -53,8 +53,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 12,9,8,0
- PRODUCTVERSION 12,9,8,0
+ FILEVERSION 12,9,9,0
+ PRODUCTVERSION 12,9,9,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -71,12 +71,12 @@ BEGIN
         BEGIN
             VALUE "CompanyName", "Team XBMC"
             VALUE "FileDescription", "XBMC"
-            VALUE "FileVersion", "13.0-ALPHA8"
+            VALUE "FileVersion", "13.0-ALPHA9"
             VALUE "InternalName", "XBMC.exe"
             VALUE "LegalCopyright", "Copyright (c) Team XBMC.  All rights reserved."
             VALUE "OriginalFilename", "XBMC.exe"
             VALUE "ProductName", "XBMC for Windows"
-            VALUE "ProductVersion", "13.0-ALPHA8"
+            VALUE "ProductVersion", "13.0-ALPHA9"
         END
     END
     BLOCK "VarFileInfo"
index 095012f..81c6800 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "WinSystemX11GL.h"
 #include "utils/log.h"
+#include "utils/StringUtils.h"
 
 CWinSystemX11GL::CWinSystemX11GL()
 {
@@ -138,7 +139,7 @@ void CWinSystemX11GL::SetVSyncImpl(bool enable)
     return;
 
   bool vendor_nvidia = strVendor.find("nvidia") != std::string::npos;
-  bool vendor_ati    = strVendor.compare(0, 3, "ati") == 0;
+  bool vendor_ati    = StringUtils::StartsWith(strVendor, "ati");
 
   if (m_glXSwapIntervalMESA && !m_iVSyncMode && vendor_ati)
   {
index 2502c8f..71e61ef 100644 (file)
@@ -220,7 +220,7 @@ bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution)
 
   // setup gui freescale depending on display resolution
   DisableFreeScale();
-  if (modestr.Left(4).Equals("1080"))
+  if (StringUtils::StartsWith(modestr, "1080"))
   {
     EnableFreeScale();
   }
index 493aa27..fcaf300 100644 (file)
@@ -1061,14 +1061,14 @@ bool CGUIMediaWindow::OnClick(int iItem)
       g_windowManager.ActivateWindow(WINDOW_MUSIC_PLAYLIST_EDITOR,"newplaylist://");
       return true;
     }
-    else if (pItem->GetPath().Left(19).Equals("newsmartplaylist://"))
+    else if (StringUtils::StartsWithNoCase(pItem->GetPath(), "newsmartplaylist://"))
     {
       m_vecItems->RemoveDiscCache(GetID());
       if (CGUIDialogSmartPlaylistEditor::NewPlaylist(pItem->GetPath().Mid(19)))
         Refresh();
       return true;
     }
-    else if (pItem->GetPath().Left(14).Equals("addons://more/"))
+    else if (StringUtils::StartsWithNoCase(pItem->GetPath(), "addons://more/"))
     {
       CBuiltins::Execute("ActivateWindow(AddonBrowser,addons://all/xbmc.addon." + pItem->GetPath().Mid(14) + ",return)");
       return true;
@@ -1560,8 +1560,8 @@ void CGUIMediaWindow::GetContextButtons(int itemNumber, CContextButtons &buttons
 
   // TODO: FAVOURITES Conditions on masterlock and localisation
   if (!item->IsParentFolder() && !item->GetPath().Equals("add") && !item->GetPath().Equals("newplaylist://") &&
-      !item->GetPath().Left(19).Equals("newsmartplaylist://") && !item->GetPath().Left(9).Equals("newtag://") &&
-      !item->GetPath().Left(14).Equals("addons://more/") && !item->GetPath().Left(14).Equals("musicsearch://"))
+      !StringUtils::StartsWithNoCase(item->GetPath(), "newsmartplaylist://") && !StringUtils::StartsWithNoCase(item->GetPath(), "newtag://") &&
+      !StringUtils::StartsWithNoCase(item->GetPath(), "addons://more/") && !StringUtils::StartsWithNoCase(item->GetPath(), "musicsearch://"))
   {
     if (XFILE::CFavouritesDirectory::IsFavourite(item.get(), GetID()))
       buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14077);     // Remove Favourite
index 14efc7e..f1f849f 100644 (file)
@@ -876,7 +876,7 @@ bool CGUIWindowFileManager::GetDirectory(int iList, const CStdString &strDirecto
 
 bool CGUIWindowFileManager::CanRename(int iList)
 {
-  // TODO: Renaming of shares (requires writing to xboxmediacenter.xml)
+  // TODO: Renaming of shares (requires writing to sources.xml)
   // this might be able to be done via the webserver code stuff...
   if (m_Directory[iList]->IsVirtualDirectoryRoot()) return false;
   if (m_Directory[iList]->IsReadOnly()) return false;