aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--Makefile.in12
-rw-r--r--README.linux4
-rw-r--r--README.ubuntu2
-rw-r--r--XBMC-ATV2.xcodeproj/project.pbxproj60
-rw-r--r--XBMC-IOS.xcodeproj/project.pbxproj56
-rw-r--r--XBMC.xcodeproj/project.pbxproj74
-rw-r--r--addons/skin.confluence/720p/DialogAddonInfo.xml4
-rw-r--r--addons/skin.confluence/720p/Home.xml7
-rw-r--r--addons/skin.confluence/720p/IncludesHomeMenuItems.xml17
-rw-r--r--addons/skin.confluence/720p/ViewsAddonBrowser.xml6
-rw-r--r--addons/skin.confluence/720p/ViewsMusicLibrary.xml4
-rw-r--r--addons/skin.confluence/720p/custom_SkinSetting_1111.xml478
-rw-r--r--addons/skin.confluence/720p/includes.xml10
-rw-r--r--addons/skin.confluence/build.bat2
-rw-r--r--addons/skin.confluence/language/Catalan/strings.xml13
-rw-r--r--addons/skin.confluence/language/Chinese (Simple)/strings.xml12
-rw-r--r--addons/skin.confluence/language/Slovenian/strings.xml180
-rw-r--r--addons/skin.confluence/media/flagging/lists/1080.pngbin3720 -> 3686 bytes
-rw-r--r--addons/skin.confluence/media/flagging/lists/720.pngbin3720 -> 3686 bytes
-rw-r--r--configure.in5
-rw-r--r--language/Slovenian/langinfo.xml4
-rw-r--r--language/Slovenian/strings.xml2970
-rw-r--r--lib/DllWAVPack.h163
-rw-r--r--lib/SlingboxLib/Makefile6
-rw-r--r--lib/SlingboxLib/SlingboxLib.cpp985
-rw-r--r--lib/SlingboxLib/SlingboxLib.h408
-rw-r--r--lib/ffmpeg/libavformat/flvdec.c68
-rw-r--r--lib/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch105
-rw-r--r--lib/jsoncpp/AUTHORS1
-rw-r--r--lib/jsoncpp/README.txt132
-rw-r--r--lib/jsoncpp/SConstruct248
-rw-r--r--lib/jsoncpp/doc/doxyfile.in1534
-rw-r--r--lib/jsoncpp/doc/footer.html23
-rw-r--r--lib/jsoncpp/doc/header.html24
-rw-r--r--lib/jsoncpp/doc/jsoncpp.dox126
-rw-r--r--lib/jsoncpp/doc/readme.txt1
-rw-r--r--lib/jsoncpp/doc/roadmap.dox45
-rw-r--r--lib/jsoncpp/include/json/autolink.h24
-rw-r--r--lib/jsoncpp/include/json/config.h82
-rw-r--r--lib/jsoncpp/include/json/features.h47
-rw-r--r--lib/jsoncpp/include/json/forwards.h42
-rw-r--r--lib/jsoncpp/include/json/json.h15
-rw-r--r--lib/jsoncpp/include/json/reader.h201
-rw-r--r--lib/jsoncpp/include/json/value.h1101
-rw-r--r--lib/jsoncpp/include/json/writer.h183
-rw-r--r--lib/jsoncpp/makefiles/vs71/jsoncpp.sln46
-rw-r--r--lib/jsoncpp/makefiles/vs71/jsontest.vcproj119
-rw-r--r--lib/jsoncpp/makefiles/vs71/lib_json.vcproj214
-rw-r--r--lib/jsoncpp/makefiles/vs71/test_lib_json.vcproj130
-rw-r--r--lib/jsoncpp/scons-tools/globtool.py53
-rw-r--r--lib/jsoncpp/scons-tools/srcdist.py179
-rw-r--r--lib/jsoncpp/scons-tools/substinfile.py79
-rw-r--r--lib/jsoncpp/scons-tools/targz.py82
-rw-r--r--lib/jsoncpp/src/jsontestrunner/main.cpp269
-rw-r--r--lib/jsoncpp/src/jsontestrunner/sconscript9
-rw-r--r--lib/jsoncpp/src/lib_json/Makefile.in9
-rw-r--r--lib/jsoncpp/src/lib_json/json_batchallocator.h130
-rw-r--r--lib/jsoncpp/src/lib_json/json_internalarray.inl453
-rw-r--r--lib/jsoncpp/src/lib_json/json_internalmap.inl612
-rw-r--r--lib/jsoncpp/src/lib_json/json_reader.cpp870
-rw-r--r--lib/jsoncpp/src/lib_json/json_tool.h93
-rw-r--r--lib/jsoncpp/src/lib_json/json_value.cpp1840
-rw-r--r--lib/jsoncpp/src/lib_json/json_valueiterator.inl297
-rw-r--r--lib/jsoncpp/src/lib_json/json_writer.cpp836
-rw-r--r--lib/jsoncpp/src/lib_json/sconscript8
-rw-r--r--lib/jsoncpp/src/test_lib_json/jsontest.cpp608
-rw-r--r--lib/jsoncpp/src/test_lib_json/jsontest.h259
-rw-r--r--lib/jsoncpp/src/test_lib_json/main.cpp271
-rw-r--r--lib/jsoncpp/src/test_lib_json/sconscript10
-rw-r--r--lib/jsoncpp/test/cleantests.py10
-rw-r--r--lib/jsoncpp/test/data/test_array_01.expected1
-rw-r--r--lib/jsoncpp/test/data/test_array_01.json1
-rw-r--r--lib/jsoncpp/test/data/test_array_02.expected2
-rw-r--r--lib/jsoncpp/test/data/test_array_02.json1
-rw-r--r--lib/jsoncpp/test/data/test_array_03.expected6
-rw-r--r--lib/jsoncpp/test/data/test_array_03.json1
-rw-r--r--lib/jsoncpp/test/data/test_array_04.expected5
-rw-r--r--lib/jsoncpp/test/data/test_array_04.json1
-rw-r--r--lib/jsoncpp/test/data/test_array_05.expected100
-rw-r--r--lib/jsoncpp/test/data/test_array_05.json1
-rw-r--r--lib/jsoncpp/test/data/test_array_06.expected5
-rw-r--r--lib/jsoncpp/test/data/test_array_06.json4
-rw-r--r--lib/jsoncpp/test/data/test_basic_01.expected1
-rw-r--r--lib/jsoncpp/test/data/test_basic_01.json1
-rw-r--r--lib/jsoncpp/test/data/test_basic_02.expected1
-rw-r--r--lib/jsoncpp/test/data/test_basic_02.json1
-rw-r--r--lib/jsoncpp/test/data/test_basic_03.expected3
-rw-r--r--lib/jsoncpp/test/data/test_basic_03.json3
-rw-r--r--lib/jsoncpp/test/data/test_basic_04.expected2
-rw-r--r--lib/jsoncpp/test/data/test_basic_04.json2
-rw-r--r--lib/jsoncpp/test/data/test_basic_05.expected2
-rw-r--r--lib/jsoncpp/test/data/test_basic_05.json2
-rw-r--r--lib/jsoncpp/test/data/test_basic_06.expected2
-rw-r--r--lib/jsoncpp/test/data/test_basic_06.json2
-rw-r--r--lib/jsoncpp/test/data/test_basic_07.expected2
-rw-r--r--lib/jsoncpp/test/data/test_basic_07.json2
-rw-r--r--lib/jsoncpp/test/data/test_basic_08.expected2
-rw-r--r--lib/jsoncpp/test/data/test_basic_08.json3
-rw-r--r--lib/jsoncpp/test/data/test_basic_09.expected2
-rw-r--r--lib/jsoncpp/test/data/test_basic_09.json4
-rw-r--r--lib/jsoncpp/test/data/test_comment_01.expected8
-rw-r--r--lib/jsoncpp/test/data/test_comment_01.json8
-rw-r--r--lib/jsoncpp/test/data/test_complex_01.expected20
-rw-r--r--lib/jsoncpp/test/data/test_complex_01.json17
-rw-r--r--lib/jsoncpp/test/data/test_integer_01.expected1
-rw-r--r--lib/jsoncpp/test/data/test_integer_01.json2
-rw-r--r--lib/jsoncpp/test/data/test_integer_02.expected1
-rw-r--r--lib/jsoncpp/test/data/test_integer_02.json2
-rw-r--r--lib/jsoncpp/test/data/test_integer_03.expected1
-rw-r--r--lib/jsoncpp/test/data/test_integer_03.json2
-rw-r--r--lib/jsoncpp/test/data/test_integer_04.expected2
-rw-r--r--lib/jsoncpp/test/data/test_integer_04.json3
-rw-r--r--lib/jsoncpp/test/data/test_integer_05.expected2
-rw-r--r--lib/jsoncpp/test/data/test_integer_05.json2
-rw-r--r--lib/jsoncpp/test/data/test_integer_06_64bits.expected1
-rw-r--r--lib/jsoncpp/test/data/test_integer_06_64bits.json2
-rw-r--r--lib/jsoncpp/test/data/test_integer_07_64bits.expected1
-rw-r--r--lib/jsoncpp/test/data/test_integer_07_64bits.json2
-rw-r--r--lib/jsoncpp/test/data/test_integer_08_64bits.expected1
-rw-r--r--lib/jsoncpp/test/data/test_integer_08_64bits.json2
-rw-r--r--lib/jsoncpp/test/data/test_large_01.expected2122
-rw-r--r--lib/jsoncpp/test/data/test_large_01.json2
-rw-r--r--lib/jsoncpp/test/data/test_object_01.expected1
-rw-r--r--lib/jsoncpp/test/data/test_object_01.json1
-rw-r--r--lib/jsoncpp/test/data/test_object_02.expected2
-rw-r--r--lib/jsoncpp/test/data/test_object_02.json1
-rw-r--r--lib/jsoncpp/test/data/test_object_03.expected4
-rw-r--r--lib/jsoncpp/test/data/test_object_03.json5
-rw-r--r--lib/jsoncpp/test/data/test_object_04.expected2
-rw-r--r--lib/jsoncpp/test/data/test_object_04.json3
-rw-r--r--lib/jsoncpp/test/data/test_preserve_comment_01.expected3
-rw-r--r--lib/jsoncpp/test/data/test_preserve_comment_01.json14
-rw-r--r--lib/jsoncpp/test/data/test_real_01.expected2
-rw-r--r--lib/jsoncpp/test/data/test_real_01.json3
-rw-r--r--lib/jsoncpp/test/data/test_real_02.expected2
-rw-r--r--lib/jsoncpp/test/data/test_real_02.json3
-rw-r--r--lib/jsoncpp/test/data/test_real_03.expected2
-rw-r--r--lib/jsoncpp/test/data/test_real_03.json3
-rw-r--r--lib/jsoncpp/test/data/test_real_04.expected2
-rw-r--r--lib/jsoncpp/test/data/test_real_04.json3
-rw-r--r--lib/jsoncpp/test/data/test_real_05.expected3
-rw-r--r--lib/jsoncpp/test/data/test_real_05.json3
-rw-r--r--lib/jsoncpp/test/data/test_real_06.expected3
-rw-r--r--lib/jsoncpp/test/data/test_real_06.json3
-rw-r--r--lib/jsoncpp/test/data/test_real_07.expected3
-rw-r--r--lib/jsoncpp/test/data/test_real_07.json3
-rw-r--r--lib/jsoncpp/test/data/test_string_01.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_01.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_02.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_02.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_03.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_03.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_01.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_01.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_02.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_02.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_03.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_03.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_04.expected1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_04.json1
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_05.expected2
-rw-r--r--lib/jsoncpp/test/data/test_string_unicode_05.json1
-rw-r--r--lib/jsoncpp/test/generate_expected.py11
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail1.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail10.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail11.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail12.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail13.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail14.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail15.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail16.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail17.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail18.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail19.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail2.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail20.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail21.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail22.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail23.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail24.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail25.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail26.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail27.json2
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail28.json2
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail29.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail3.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail30.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail31.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail32.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail33.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail4.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail5.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail6.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail7.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail8.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/fail9.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/pass1.json58
-rw-r--r--lib/jsoncpp/test/jsonchecker/pass2.json1
-rw-r--r--lib/jsoncpp/test/jsonchecker/pass3.json6
-rw-r--r--lib/jsoncpp/test/jsonchecker/readme.txt3
-rw-r--r--lib/jsoncpp/test/pyjsontestrunner.py64
-rw-r--r--lib/jsoncpp/test/runjsontests.py134
-rw-r--r--lib/jsoncpp/test/rununittests.py73
-rw-r--r--lib/win32/libwavpack/Makefile.in13
-rw-r--r--lib/win32/libwavpack/bits.c259
-rw-r--r--lib/win32/libwavpack/changelog.txt106
-rw-r--r--lib/win32/libwavpack/extra1.c563
-rw-r--r--lib/win32/libwavpack/extra2.c792
-rw-r--r--lib/win32/libwavpack/filters.h121
-rw-r--r--lib/win32/libwavpack/float.c371
-rw-r--r--lib/win32/libwavpack/license.txt25
-rw-r--r--lib/win32/libwavpack/md5.c263
-rw-r--r--lib/win32/libwavpack/md5.h26
-rw-r--r--lib/win32/libwavpack/metadata.c310
-rw-r--r--lib/win32/libwavpack/pack.c1413
-rw-r--r--lib/win32/libwavpack/unpack.c1453
-rw-r--r--lib/win32/libwavpack/unpack3.c2010
-rw-r--r--lib/win32/libwavpack/unpack3.h113
-rw-r--r--lib/win32/libwavpack/utils.c640
-rw-r--r--lib/win32/libwavpack/wavpack.h658
-rw-r--r--lib/win32/libwavpack/wavpackdll.vcproj258
-rw-r--r--lib/win32/libwavpack/wavpackdll.vcxproj158
-rw-r--r--lib/win32/libwavpack/wavpackdll.vcxproj.filters65
-rw-r--r--lib/win32/libwavpack/words.c1437
-rw-r--r--lib/win32/libwavpack/wputils.c2106
-rw-r--r--lib/win32/libwavpack/wputils.h163
-rw-r--r--project/BuildDependencies/scripts/yajl_d.bat13
-rw-r--r--project/BuildDependencies/scripts/yajl_d.txt2
-rw-r--r--project/VS2010Express/XBMC for Windows.sln2
-rw-r--r--project/VS2010Express/XBMC.vcxproj30
-rw-r--r--project/VS2010Express/XBMC.vcxproj.filters48
-rw-r--r--system/keymaps/keyboard.xml2
-rw-r--r--system/keymaps/mouse.xml14
-rwxr-xr-xtools/buildbot/darwin-depends-check3
-rw-r--r--tools/darwin/depends/Makefile.in2
-rw-r--r--tools/darwin/depends/Makefile.include.in1
-rw-r--r--tools/darwin/depends/afpfs-ng/Makefile2
-rw-r--r--tools/darwin/depends/autoconf/Makefile2
-rw-r--r--tools/darwin/depends/automake/Makefile2
-rw-r--r--tools/darwin/depends/cmake/Makefile2
-rw-r--r--tools/darwin/depends/configure.in17
-rw-r--r--tools/darwin/depends/curl/Makefile2
-rw-r--r--tools/darwin/depends/expat/Makefile2
-rw-r--r--tools/darwin/depends/fontconfig/Makefile2
-rw-r--r--tools/darwin/depends/freetype2/Makefile2
-rw-r--r--tools/darwin/depends/fribidi/Makefile2
-rw-r--r--tools/darwin/depends/gas-preprocessor/Makefile2
-rw-r--r--tools/darwin/depends/gettext/02-gettext-tools-stpncpy.patch12
-rw-r--r--tools/darwin/depends/gettext/Makefile5
-rw-r--r--tools/darwin/depends/help2man/Makefile2
-rw-r--r--tools/darwin/depends/jpeg/Makefile2
-rw-r--r--tools/darwin/depends/libGLEW/Makefile2
-rw-r--r--tools/darwin/depends/libass/Makefile2
-rw-r--r--tools/darwin/depends/libbluray/Makefile2
-rw-r--r--tools/darwin/depends/libcdio/Makefile2
-rw-r--r--tools/darwin/depends/libflac/Makefile2
-rw-r--r--tools/darwin/depends/libgcrypt/Makefile2
-rw-r--r--tools/darwin/depends/libgpg-error/Makefile2
-rw-r--r--tools/darwin/depends/liblzo2/Makefile2
-rw-r--r--tools/darwin/depends/libmad/Makefile2
-rw-r--r--tools/darwin/depends/libmicrohttpd/Makefile2
-rw-r--r--tools/darwin/depends/libmodplug/Makefile2
-rw-r--r--tools/darwin/depends/libmpeg2/Makefile2
-rw-r--r--tools/darwin/depends/libnfs/Makefile51
-rw-r--r--tools/darwin/depends/libnfs/Makefile.in.patch102
-rw-r--r--tools/darwin/depends/libnfs/nfs.x.patch11
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/auth.h215
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/auth_unix.h106
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/clnt.h445
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h124
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/pmap_prot.h147
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h95
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/rpc.h93
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/rpc_msg.h243
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/svc.h360
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/svc_auth.h73
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/types.h102
-rw-r--r--tools/darwin/depends/libnfs/rpcinc/xdr.h430
-rw-r--r--tools/darwin/depends/libogg/Makefile2
-rw-r--r--tools/darwin/depends/libpng/Makefile2
-rw-r--r--tools/darwin/depends/librtmp/Makefile2
-rw-r--r--tools/darwin/depends/libsamplerate/Makefile2
-rw-r--r--tools/darwin/depends/libsdl/Makefile2
-rw-r--r--tools/darwin/depends/libsdl_image/Makefile2
-rw-r--r--tools/darwin/depends/libsdl_mixer/Makefile2
-rw-r--r--tools/darwin/depends/libssh2/Makefile2
-rw-r--r--tools/darwin/depends/libtool/Makefile2
-rw-r--r--tools/darwin/depends/libvorbis/Makefile2
-rw-r--r--tools/darwin/depends/libwavpack/Makefile37
-rw-r--r--tools/darwin/depends/mysqlclient/Makefile2
-rw-r--r--tools/darwin/depends/openssl/Makefile4
-rw-r--r--tools/darwin/depends/pcre/Makefile2
-rw-r--r--tools/darwin/depends/pkg-config/Makefile2
-rw-r--r--tools/darwin/depends/python26/Makefile.ios2
-rw-r--r--tools/darwin/depends/python26/Makefile.osx2
-rw-r--r--tools/darwin/depends/readline/Makefile2
-rw-r--r--tools/darwin/depends/samba/Makefile2
-rw-r--r--tools/darwin/depends/sqlite3/Makefile2
-rw-r--r--tools/darwin/depends/tar/Makefile2
-rw-r--r--tools/darwin/depends/tiff/Makefile2
-rw-r--r--tools/darwin/depends/yasm/Makefile2
-rw-r--r--tools/osx/ios-depends/Makefile2
-rw-r--r--tools/osx/ios-depends/libwavpack/Makefile52
-rw-r--r--tools/osx/ios-depends/openssl/Makefile2
-rw-r--r--tools/osx/osx-depends/Makefile2
-rw-r--r--tools/osx/osx-depends/libwavpack/Makefile52
-rw-r--r--tools/osx/osx-depends/openssl/Makefile2
-rwxr-xr-xtools/osx/packaging/xbmc-startuptweeks/mkdeb-xbmc-startuptweeks.sh84
-rw-r--r--xbmc/Application.cpp69
-rw-r--r--xbmc/Application.h1
-rw-r--r--xbmc/DllPaths_generated.h.in1
-rw-r--r--xbmc/DllPaths_win32.h1
-rw-r--r--xbmc/FileItem.cpp7
-rw-r--r--xbmc/FileItem.h1
-rw-r--r--xbmc/GUIInfoManager.cpp25
-rw-r--r--xbmc/Util.cpp16
-rw-r--r--xbmc/XBDateTime.h4
-rw-r--r--xbmc/cores/dvdplayer/DVDAudio.cpp2
-rw-r--r--xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp3
-rw-r--r--xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamTV.cpp7
-rw-r--r--xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h8
-rw-r--r--xbmc/cores/paplayer/CodecFactory.cpp3
-rw-r--r--xbmc/cores/paplayer/Makefile.in1
-rw-r--r--xbmc/cores/paplayer/WAVPackcodec.cpp332
-rw-r--r--xbmc/cores/paplayer/WAVPackcodec.h65
-rw-r--r--xbmc/filesystem/FactoryDirectory.cpp2
-rw-r--r--xbmc/filesystem/FileCache.cpp1
-rw-r--r--xbmc/filesystem/FileFactory.cpp2
-rw-r--r--xbmc/filesystem/FileHD.cpp1
-rw-r--r--xbmc/filesystem/FileSFTP.cpp55
-rw-r--r--xbmc/filesystem/FileSFTP.h7
-rw-r--r--xbmc/filesystem/HDDirectory.cpp27
-rw-r--r--xbmc/filesystem/Makefile.in1
-rw-r--r--xbmc/filesystem/SFTPDirectory.cpp2
-rw-r--r--xbmc/filesystem/Slingbox.cpp622
-rw-r--r--xbmc/filesystem/Slingbox.h91
-rw-r--r--xbmc/guilib/GUIDialog.cpp2
-rw-r--r--xbmc/guilib/GUIInfoTypes.cpp47
-rw-r--r--xbmc/guilib/GUIInfoTypes.h5
-rw-r--r--xbmc/guilib/Key.cpp3
-rw-r--r--xbmc/guilib/Key.h10
-rw-r--r--xbmc/guilib/Texture.cpp10
-rw-r--r--xbmc/input/ButtonTranslator.cpp52
-rw-r--r--xbmc/input/ButtonTranslator.h2
-rw-r--r--xbmc/input/MouseStat.cpp15
-rw-r--r--xbmc/input/MouseStat.h8
-rw-r--r--xbmc/interfaces/AnnouncementManager.cpp17
-rw-r--r--xbmc/interfaces/json-rpc/AVPlayerOperations.cpp37
-rw-r--r--xbmc/interfaces/json-rpc/AVPlayerOperations.h32
-rw-r--r--xbmc/interfaces/json-rpc/AVPlaylistOperations.cpp33
-rw-r--r--xbmc/interfaces/json-rpc/AVPlaylistOperations.h20
-rw-r--r--xbmc/interfaces/json-rpc/AudioLibrary.cpp82
-rw-r--r--xbmc/interfaces/json-rpc/AudioLibrary.h17
-rw-r--r--xbmc/interfaces/json-rpc/FileItemHandler.cpp28
-rw-r--r--xbmc/interfaces/json-rpc/FileItemHandler.h10
-rw-r--r--xbmc/interfaces/json-rpc/FileOperations.cpp33
-rw-r--r--xbmc/interfaces/json-rpc/FileOperations.h8
-rw-r--r--xbmc/interfaces/json-rpc/IClient.h22
-rw-r--r--xbmc/interfaces/json-rpc/ITransportLayer.h7
-rw-r--r--xbmc/interfaces/json-rpc/InputOperations.cpp15
-rw-r--r--xbmc/interfaces/json-rpc/InputOperations.h14
-rw-r--r--xbmc/interfaces/json-rpc/JSONRPC.cpp95
-rw-r--r--xbmc/interfaces/json-rpc/JSONRPC.h21
-rw-r--r--xbmc/interfaces/json-rpc/JSONServiceDescription.cpp165
-rw-r--r--xbmc/interfaces/json-rpc/JSONServiceDescription.h29
-rw-r--r--xbmc/interfaces/json-rpc/JSONUtils.h136
-rw-r--r--xbmc/interfaces/json-rpc/PicturePlayerOperations.cpp30
-rw-r--r--xbmc/interfaces/json-rpc/PicturePlayerOperations.h26
-rw-r--r--xbmc/interfaces/json-rpc/PlayerOperations.cpp3
-rw-r--r--xbmc/interfaces/json-rpc/PlayerOperations.h2
-rw-r--r--xbmc/interfaces/json-rpc/PlaylistOperations.cpp29
-rw-r--r--xbmc/interfaces/json-rpc/PlaylistOperations.h22
-rw-r--r--xbmc/interfaces/json-rpc/ServiceDescription.h210
-rw-r--r--xbmc/interfaces/json-rpc/ServiceDescription.json48
-rw-r--r--xbmc/interfaces/json-rpc/SystemOperations.cpp15
-rw-r--r--xbmc/interfaces/json-rpc/SystemOperations.h12
-rw-r--r--xbmc/interfaces/json-rpc/VideoLibrary.cpp124
-rw-r--r--xbmc/interfaces/json-rpc/VideoLibrary.h37
-rw-r--r--xbmc/interfaces/json-rpc/XBMCOperations.cpp23
-rw-r--r--xbmc/interfaces/json-rpc/XBMCOperations.h14
-rw-r--r--xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp3
-rw-r--r--xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h2
-rw-r--r--xbmc/music/MusicDatabase.cpp12
-rw-r--r--xbmc/music/tags/MusicInfoTagLoaderWavPack.cpp4
-rw-r--r--xbmc/network/TCPServer.cpp3
-rw-r--r--xbmc/network/TCPServer.h3
-rw-r--r--xbmc/network/WebServer.cpp5
-rw-r--r--xbmc/network/WebServer.h2
-rw-r--r--xbmc/powermanagement/PowerManager.cpp36
-rw-r--r--xbmc/settings/AdvancedSettings.cpp2
-rw-r--r--xbmc/settings/GUIWindowSettingsCategory.cpp3
-rw-r--r--xbmc/utils/JSONVariantParser.cpp213
-rw-r--r--xbmc/utils/JSONVariantParser.h87
-rw-r--r--xbmc/utils/JSONVariantWriter.cpp100
-rw-r--r--xbmc/utils/JSONVariantWriter.h32
-rw-r--r--xbmc/utils/Makefile2
-rw-r--r--xbmc/utils/PCMRemap.cpp9
-rw-r--r--xbmc/utils/StringUtils.cpp2
-rw-r--r--xbmc/utils/URIUtils.cpp6
-rw-r--r--xbmc/utils/URIUtils.h1
-rw-r--r--xbmc/utils/Variant.cpp350
-rw-r--r--xbmc/utils/Variant.h63
-rw-r--r--xbmc/video/VideoDatabase.cpp96
-rw-r--r--xbmc/video/VideoInfoDownloader.cpp16
-rw-r--r--xbmc/windowing/WinEventsSDL.cpp2
406 files changed, 9102 insertions, 31098 deletions
diff --git a/.gitignore b/.gitignore
index e391ebfb5d..cf8cbb292e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -385,7 +385,6 @@ project/Win32BuildSetup/dependencies/libcdio-10.dll
/system/players/dvdplayer/libmad.dll
# /system/players/paplayer
-/system/players/paplayer/wavpack.dll
/system/players/paplayer/libmodplug.dll
/system/players/paplayer/StSoundLibrary.dll
/system/players/paplayer/vorbisfile.dll
@@ -881,11 +880,6 @@ project/Win32BuildSetup/dependencies/libcdio-10.dll
/lib/win32/libsamplerate/libsamplerate_win32/Debug
/lib/win32/libsamplerate/libsamplerate_win32/Release
-# /lib/win32/libwavpack/
-/lib/win32/libwavpack/Makefile
-/lib/win32/libwavpack/Debug
-/lib/win32/libwavpack/Release
-
# /lib/win32/sqlite
/lib/win32/sqlite/libsqlite_win32/Debug
/lib/win32/sqlite/libsqlite_win32/Release
diff --git a/Makefile.in b/Makefile.in
index f1d517790f..bea42afaae 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -62,6 +62,7 @@ BIN_DIRS= \
xbmc/dbwrappers \
lib/UnrarXLib \
lib/libsquish \
+ lib/SlingboxLib \
xbmc/visualizations \
xbmc/screensavers \
xbmc/utils \
@@ -123,8 +124,7 @@ LIB_DIRS=\
lib/libid3tag \
lib/libapetag \
lib/cpluff \
- lib/xbmc-dll-symbols \
- lib/jsoncpp/src/lib_json
+ lib/xbmc-dll-symbols
SS_DIRS=\
xbmc/screensavers/rsxs-0.9/xbmc
@@ -328,8 +328,6 @@ lib/libUPnP/libupnp.a: force
$(MAKE) -C lib/libUPnP
lib/libXDAAP/libxdaap.a: force
$(MAKE) -C lib/libXDAAP
-lib/jsoncpp/src/lib_json/libjsoncpp.a: force
- $(MAKE) -C lib/jsoncpp/src/lib_json
xbmc/interfaces/http-api/http-api.a: force
$(MAKE) -C xbmc/interfaces/http-api
xbmc/interfaces/json-rpc/json-rpc.a: force
@@ -340,6 +338,8 @@ lib/UnrarXLib/UnrarXLib.a: force
$(MAKE) -C lib/UnrarXLib
lib/libsquish/libsquish.a: force
$(MAKE) -C lib/libsquish
+lib/SlingboxLib/SlingboxLib.a: force
+ $(MAKE) -C lib/SlingboxLib
xbmc/linux/linux.a: force
$(MAKE) -C xbmc/linux
xbmc/threads/posix/threads_posix.a: force
@@ -436,7 +436,7 @@ xcode_depends: \
lib/libapetag/.libs/libapetag.a \
lib/libRTV/librtv.a \
lib/libXDAAP/libxdaap.a \
- lib/jsoncpp/src/lib_json/libjsoncpp.a
+ lib/SlingboxLib/SlingboxLib.a
# platform independend objects
OBJSXBMC= \
@@ -487,10 +487,10 @@ OBJSXBMC= \
xbmc/interfaces/interfaces.a \
xbmc/cdrip/cdrip.a \
xbmc/interfaces/json-rpc/json-rpc.a \
- lib/jsoncpp/src/lib_json/libjsoncpp.a \
xbmc/interfaces/http-api/http-api.a \
xbmc/dbwrappers/dbwrappers.a \
lib/libsquish/libsquish.a \
+ lib/SlingboxLib/SlingboxLib.a \
lib/libapetag/.libs/libapetag.a \
lib/xbmc-dll-symbols/dll-symbols.a \
xbmc/rendering/rendering.a \
diff --git a/README.linux b/README.linux
index 6f479cf26c..d62e40dbf3 100644
--- a/README.linux
+++ b/README.linux
@@ -50,10 +50,10 @@ Build-Depends: debhelper (>= 7.0.50~), python-support, cmake,
libavahi-common-dev, libavahi-client-dev, libxrandr-dev, libavcodec-dev,
libavformat-dev, libavutil-dev, libpostproc-dev, libswscale-dev,
libmpeg2-4-dev, libass-dev (>= 0.9.8), libmpcdec-dev, libflac-dev,
- libwavpack-dev, python-dev, gawk, gperf, nasm [!amd64], libcwiid1-dev,
+ python-dev, gawk, gperf, nasm [!amd64], libcwiid1-dev,
libbluetooth-dev, zlib1g-dev, libsmbclient-dev,
libiso9660-dev, libssl-dev, lsb-release, libvdpau-dev, libmicrohttpd-dev,
- libmodplug-dev, librtmp-dev, libcrystalhd-dev, curl, python-dev
+ libmodplug-dev, librtmp-dev, libcrystalhd-dev, curl, python-dev, libyajl-dev
*** For developers and anyone else who compiles frequently it is recommended to
use ccache
diff --git a/README.ubuntu b/README.ubuntu
index a18b5eccc5..2c0b7f7d8c 100644
--- a/README.ubuntu
+++ b/README.ubuntu
@@ -44,7 +44,7 @@ Two methods exist to install the required Ubuntu packages:
For Ubuntu (all versions >= 7.04):
- # sudo apt-get install subversion make g++ gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libwavpack-dev libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev
+ # sudo apt-get install subversion make g++ gcc gawk pmount libtool nasm yasm automake cmake gperf zip unzip bison libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl3 libcurl4-gnutls-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbisenc2 libsmbclient-dev libmysqlclient-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate-dev libmpeg3-dev libflac-dev libiso9660-dev libass-dev libssl-dev fp-compiler gdc libmpeg2-4-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs python-dev libyajl-dev
For Ubuntu Maverick (10.10):
# sudo apt-get install autopoint
diff --git a/XBMC-ATV2.xcodeproj/project.pbxproj b/XBMC-ATV2.xcodeproj/project.pbxproj
index 479ade0319..d9005ba277 100644
--- a/XBMC-ATV2.xcodeproj/project.pbxproj
+++ b/XBMC-ATV2.xcodeproj/project.pbxproj
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ 18404DFB1396C43B00863BBA /* Slingbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18404DF91396C43B00863BBA /* Slingbox.cpp */; };
+ 18404DFD1396C44F00863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DFC1396C44F00863BBA /* SlingboxLib.a */; };
+ 1840B796139968DB007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B792139968DB007C848B /* JSONVariantParser.cpp */; };
+ 1840B797139968DB007C848B /* JSONVariantWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B794139968DB007C848B /* JSONVariantWriter.cpp */; };
18ACF8E313597B0000B67371 /* RecentlyAddedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18ACF8E113597B0000B67371 /* RecentlyAddedJob.cpp */; };
4D5D2E131301753F006ABC13 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D5D2E121301753F006ABC13 /* CFNetwork.framework */; };
7C99B73F133D372300FC2B16 /* CacheCircular.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C99B73D133D372300FC2B16 /* CacheCircular.cpp */; };
@@ -205,7 +209,6 @@
F56C793B131EC154000AD0F6 /* SPCCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C732B131EC151000AD0F6 /* SPCCodec.cpp */; };
F56C793C131EC154000AD0F6 /* TimidityCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C732D131EC151000AD0F6 /* TimidityCodec.cpp */; };
F56C793D131EC154000AD0F6 /* WAVcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C732F131EC151000AD0F6 /* WAVcodec.cpp */; };
- F56C793E131EC154000AD0F6 /* WAVPackcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7331131EC151000AD0F6 /* WAVPackcodec.cpp */; };
F56C793F131EC154000AD0F6 /* YMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7333131EC151000AD0F6 /* YMCodec.cpp */; };
F56C7941131EC154000AD0F6 /* AudioRendererFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C733A131EC151000AD0F6 /* AudioRendererFactory.cpp */; };
F56C7942131EC154000AD0F6 /* NullDirectSound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C733B131EC151000AD0F6 /* NullDirectSound.cpp */; };
@@ -877,7 +880,6 @@
F56C7DE0131EF8D9000AD0F6 /* PltMediaServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7D6A131EF8D9000AD0F6 /* PltMediaServer.cpp */; };
F56C7DE1131EF8D9000AD0F6 /* PltSyncMediaBrowser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7D6C131EF8D9000AD0F6 /* PltSyncMediaBrowser.cpp */; };
F56C7DE2131EF8D9000AD0F6 /* PltLightSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7D72131EF8D9000AD0F6 /* PltLightSample.cpp */; };
- F56C7EE1131F0965000AD0F6 /* libjsoncpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F56C7EE0131F0965000AD0F6 /* libjsoncpp.a */; };
F56C7F30131F0BB4000AD0F6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F56C7F2E131F0BB4000AD0F6 /* InfoPlist.strings */; };
F56C7FB0131F36BF000AD0F6 /* DVDVideoCodecVideoToolBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C7FAE131F36BF000AD0F6 /* DVDVideoCodecVideoToolBox.cpp */; };
F57A1DBD1329FB0A00498CC7 /* SourcesDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F57A1DBB1329FB0A00498CC7 /* SourcesDirectory.cpp */; };
@@ -916,6 +918,13 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 18404DF91396C43B00863BBA /* Slingbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slingbox.cpp; sourceTree = "<group>"; };
+ 18404DFA1396C43B00863BBA /* Slingbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slingbox.h; sourceTree = "<group>"; };
+ 18404DFC1396C44F00863BBA /* SlingboxLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = SlingboxLib.a; path = lib/SlingboxLib/SlingboxLib.a; sourceTree = "<group>"; };
+ 1840B792139968DB007C848B /* JSONVariantParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantParser.cpp; sourceTree = "<group>"; };
+ 1840B793139968DB007C848B /* JSONVariantParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantParser.h; sourceTree = "<group>"; };
+ 1840B794139968DB007C848B /* JSONVariantWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantWriter.cpp; sourceTree = "<group>"; };
+ 1840B795139968DB007C848B /* JSONVariantWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantWriter.h; sourceTree = "<group>"; };
18ACF8E113597B0000B67371 /* RecentlyAddedJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecentlyAddedJob.cpp; sourceTree = "<group>"; };
18ACF8E213597B0000B67371 /* RecentlyAddedJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecentlyAddedJob.h; sourceTree = "<group>"; };
4D5D2E121301753F006ABC13 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
@@ -944,7 +953,6 @@
F56C7055131EC150000AD0F6 /* DllStSound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllStSound.h; sourceTree = "<group>"; };
F56C7056131EC150000AD0F6 /* DllTimidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllTimidity.h; sourceTree = "<group>"; };
F56C7057131EC150000AD0F6 /* DllVorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllVorbisfile.h; sourceTree = "<group>"; };
- F56C7058131EC150000AD0F6 /* DllWAVPack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllWAVPack.h; sourceTree = "<group>"; };
F56C705A131EC150000AD0F6 /* tinystr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinystr.cpp; sourceTree = "<group>"; };
F56C705B131EC150000AD0F6 /* tinystr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinystr.h; sourceTree = "<group>"; };
F56C705C131EC150000AD0F6 /* tinyxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml.cpp; sourceTree = "<group>"; };
@@ -1156,11 +1164,6 @@
F56C7211131EC151000AD0F6 /* EncoderWav.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EncoderWav.cpp; sourceTree = "<group>"; };
F56C7212131EC151000AD0F6 /* EncoderWav.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncoderWav.h; sourceTree = "<group>"; };
F56C7214131EC151000AD0F6 /* lame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lame.h; sourceTree = "<group>"; };
- F56C7216131EC151000AD0F6 /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = "<group>"; };
- F56C7217131EC151000AD0F6 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ogg.h; sourceTree = "<group>"; };
- F56C7218131EC151000AD0F6 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = os_types.h; sourceTree = "<group>"; };
- F56C7219131EC151000AD0F6 /* vorbisenc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisenc.h; sourceTree = "<group>"; };
- F56C721A131EC151000AD0F6 /* vorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisfile.h; sourceTree = "<group>"; };
F56C721D131EC151000AD0F6 /* PlayerCoreConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlayerCoreConfig.h; path = playercorefactory/PlayerCoreConfig.h; sourceTree = "<group>"; };
F56C721E131EC151000AD0F6 /* PlayerCoreFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlayerCoreFactory.cpp; path = playercorefactory/PlayerCoreFactory.cpp; sourceTree = "<group>"; };
F56C721F131EC151000AD0F6 /* PlayerCoreFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlayerCoreFactory.h; path = playercorefactory/PlayerCoreFactory.h; sourceTree = "<group>"; };
@@ -1413,8 +1416,6 @@
F56C732E131EC151000AD0F6 /* TimidityCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimidityCodec.h; sourceTree = "<group>"; };
F56C732F131EC151000AD0F6 /* WAVcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WAVcodec.cpp; sourceTree = "<group>"; };
F56C7330131EC151000AD0F6 /* WAVcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAVcodec.h; sourceTree = "<group>"; };
- F56C7331131EC151000AD0F6 /* WAVPackcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WAVPackcodec.cpp; sourceTree = "<group>"; };
- F56C7332131EC151000AD0F6 /* WAVPackcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAVPackcodec.h; sourceTree = "<group>"; };
F56C7333131EC151000AD0F6 /* YMCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YMCodec.cpp; sourceTree = "<group>"; };
F56C7334131EC151000AD0F6 /* YMCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YMCodec.h; sourceTree = "<group>"; };
F56C7338131EC151000AD0F6 /* IAudioRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IAudioRenderer.h; path = AudioRenderers/IAudioRenderer.h; sourceTree = "<group>"; };
@@ -1756,7 +1757,6 @@
F56C7493131EC152000AD0F6 /* VirtualDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualDirectory.h; sourceTree = "<group>"; };
F56C7498131EC152000AD0F6 /* ZeroconfDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZeroconfDirectory.h; sourceTree = "<group>"; };
F56C7499131EC152000AD0F6 /* ZeroconfDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZeroconfDirectory.cpp; sourceTree = "<group>"; };
- F56C749A131EC152000AD0F6 /* zconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zconf.h; sourceTree = "<group>"; };
F56C749B131EC152000AD0F6 /* ZipDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipDirectory.cpp; sourceTree = "<group>"; };
F56C749C131EC152000AD0F6 /* ZipDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipDirectory.h; sourceTree = "<group>"; };
F56C749D131EC152000AD0F6 /* ZipManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipManager.cpp; sourceTree = "<group>"; };
@@ -2797,7 +2797,6 @@
F56C7D72131EF8D9000AD0F6 /* PltLightSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PltLightSample.cpp; sourceTree = "<group>"; };
F56C7D73131EF8D9000AD0F6 /* PltLightSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PltLightSample.h; sourceTree = "<group>"; };
F56C7D78131EF8D9000AD0F6 /* SsdpProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SsdpProxy.h; sourceTree = "<group>"; };
- F56C7EE0131F0965000AD0F6 /* libjsoncpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjsoncpp.a; path = lib/jsoncpp/src/lib_json/libjsoncpp.a; sourceTree = "<group>"; };
F56C7F2F131F0BB4000AD0F6 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = "<group>"; };
F56C7FAE131F36BF000AD0F6 /* DVDVideoCodecVideoToolBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDVideoCodecVideoToolBox.cpp; sourceTree = "<group>"; };
F56C7FAF131F36BF000AD0F6 /* DVDVideoCodecVideoToolBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDVideoCodecVideoToolBox.h; sourceTree = "<group>"; };
@@ -2884,7 +2883,7 @@
F56B15FF12CD695C009B4C96 /* CoreGraphics.framework in Frameworks */,
F56B161B12CD69DB009B4C96 /* ImageIO.framework in Frameworks */,
4D5D2E131301753F006ABC13 /* CFNetwork.framework in Frameworks */,
- F56C7EE1131F0965000AD0F6 /* libjsoncpp.a in Frameworks */,
+ 18404DFD1396C44F00863BBA /* SlingboxLib.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2930,7 +2929,6 @@
F56C7055131EC150000AD0F6 /* DllStSound.h */,
F56C7056131EC150000AD0F6 /* DllTimidity.h */,
F56C7057131EC150000AD0F6 /* DllVorbisfile.h */,
- F56C7058131EC150000AD0F6 /* DllWAVPack.h */,
F56C7059131EC150000AD0F6 /* tinyXML */,
F56C7060131EC150000AD0F6 /* libexif */,
F56C7062131EC150000AD0F6 /* libhdhomerun */,
@@ -2939,7 +2937,6 @@
F56C707D131EC150000AD0F6 /* libRTV */,
F56C7088131EC150000AD0F6 /* libsquish */,
F56C7CA5131EF8D8000AD0F6 /* libUPnP */,
- F56C7163131EC151000AD0F6 /* libXBMS */,
F56C7164131EC151000AD0F6 /* libXDAAP */,
F56C716A131EC151000AD0F6 /* UnrarXLib */,
);
@@ -3037,13 +3034,6 @@
name = libsquish;
sourceTree = "<group>";
};
- F56C7163131EC151000AD0F6 /* libXBMS */ = {
- isa = PBXGroup;
- children = (
- );
- path = libXBMS;
- sourceTree = "<group>";
- };
F56C7164131EC151000AD0F6 /* libXDAAP */ = {
isa = PBXGroup;
children = (
@@ -3355,11 +3345,6 @@
F56C7215131EC151000AD0F6 /* oggvorbis */ = {
isa = PBXGroup;
children = (
- F56C7216131EC151000AD0F6 /* codec.h */,
- F56C7217131EC151000AD0F6 /* ogg.h */,
- F56C7218131EC151000AD0F6 /* os_types.h */,
- F56C7219131EC151000AD0F6 /* vorbisenc.h */,
- F56C721A131EC151000AD0F6 /* vorbisfile.h */,
);
path = oggvorbis;
sourceTree = "<group>";
@@ -3775,8 +3760,6 @@
F56C732E131EC151000AD0F6 /* TimidityCodec.h */,
F56C732F131EC151000AD0F6 /* WAVcodec.cpp */,
F56C7330131EC151000AD0F6 /* WAVcodec.h */,
- F56C7331131EC151000AD0F6 /* WAVPackcodec.cpp */,
- F56C7332131EC151000AD0F6 /* WAVPackcodec.h */,
F56C7333131EC151000AD0F6 /* YMCodec.cpp */,
F56C7334131EC151000AD0F6 /* YMCodec.h */,
);
@@ -4062,6 +4045,8 @@
F56C744D131EC152000AD0F6 /* SFTPDirectory.h */,
F56C744E131EC152000AD0F6 /* SIDFileDirectory.cpp */,
F56C744F131EC152000AD0F6 /* SIDFileDirectory.h */,
+ 18404DF91396C43B00863BBA /* Slingbox.cpp */,
+ 18404DFA1396C43B00863BBA /* Slingbox.h */,
F56C7450131EC152000AD0F6 /* SmartPlaylistDirectory.cpp */,
F56C7451131EC152000AD0F6 /* SmartPlaylistDirectory.h */,
F56C7452131EC152000AD0F6 /* SMBDirectory.h */,
@@ -4086,7 +4071,6 @@
F56C7493131EC152000AD0F6 /* VirtualDirectory.h */,
F56C7498131EC152000AD0F6 /* ZeroconfDirectory.h */,
F56C7499131EC152000AD0F6 /* ZeroconfDirectory.cpp */,
- F56C749A131EC152000AD0F6 /* zconf.h */,
F56C749B131EC152000AD0F6 /* ZipDirectory.cpp */,
F56C749C131EC152000AD0F6 /* ZipDirectory.h */,
F56C749D131EC152000AD0F6 /* ZipManager.cpp */,
@@ -5066,6 +5050,10 @@
F56C7745131EC154000AD0F6 /* JobManager.cpp */,
F56C7746131EC154000AD0F6 /* JobManager.h */,
F56C7747131EC154000AD0F6 /* Job.h */,
+ 1840B792139968DB007C848B /* JSONVariantParser.cpp */,
+ 1840B793139968DB007C848B /* JSONVariantParser.h */,
+ 1840B794139968DB007C848B /* JSONVariantWriter.cpp */,
+ 1840B795139968DB007C848B /* JSONVariantWriter.h */,
F56C7748131EC154000AD0F6 /* LCD.cpp */,
F56C7749131EC154000AD0F6 /* LCD.h */,
F56C774A131EC154000AD0F6 /* log.cpp */,
@@ -5659,10 +5647,10 @@
isa = PBXGroup;
children = (
F589AE7012890B9E00D8079E /* libapetag.a */,
- F56C7EE0131F0965000AD0F6 /* libjsoncpp.a */,
F589AE7D12890BEF00D8079E /* libsquish.a */,
F589AE7E12890BEF00D8079E /* librtv.a */,
F589AE8012890BEF00D8079E /* libxdaap.a */,
+ 18404DFC1396C44F00863BBA /* SlingboxLib.a */,
);
name = "Internal Libs";
sourceTree = "<group>";
@@ -5788,7 +5776,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "#!/bin/bash\n\necho \"copy root files\"\n\nif [ \"$ACTION\" = build ] ; then\n\n# for external testing\nTARGET_NAME=$PRODUCT_NAME.$WRAPPER_EXTENSION\n#SRCROOT=/Users/Shared/xbmc_svn/XBMC\n#TARGET_BUILD_DIR=/Users/Shared/xbmc_svn/XBMC/build/Debug\n\n# rsync command with exclusions for items we don't want in the app package\nSYNC=\"rsync -aq --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *x86-osx.* --exclude *.zlib --exclude *.zip --exclude *.a --exclude *.pyd --exclude *x86-osx.so --exclude *powerpc-osx.so\"\n\n# rsync command for excluding pngs and jpgs as well. Note that if the skin itself is not compiled\n# using XBMCTex then excluding the pngs and jpgs will most likely make the skin unusable \n#SYNCSKIN=\"rsync -aq --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.png --exclude *.jpg --exclude *.bat\"\nSYNCSKIN=\"rsync -aq --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.bat\"\n\n# rsync command for including everything but the skins\nADDONSYNC=\"rsync -aq --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude skin.confluence --exclude screensaver.rsxs*\"\n\n# binary name is XBMC but we build XBMC.bin so to get a clean binary each time\nmv $TARGET_BUILD_DIR/$TARGET_NAME/XBMC.bin $TARGET_BUILD_DIR/$TARGET_NAME/XBMC\n\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/language\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/media\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/sounds\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/system\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/userdata\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/media\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/tools/osx\"\n\n${SYNC} \"$SRCROOT/LICENSE.GPL\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/\"\n${SYNC} \"$SRCROOT/xbmc/osx/Credits.html\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/\"\n#${SYNC} \"$SRCROOT/tools/osx\"\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/tools\"\n${ADDONSYNC} \"$SRCROOT/addons\"\t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/language\"\t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/media\" \t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNCSKIN} \"$SRCROOT/addons/skin.confluence\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons\"\n${SYNC} \"$SRCROOT/addons/skin.confluence/backgrounds\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons/skin.confluence\"\n${SYNC} \"$SRCROOT/addons/skin.confluence/icon.png\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons/skin.confluence\"\n${SYNC} \"$SRCROOT/sounds\" \t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/system\" \t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/userdata\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n\n# copy extra packages if applicable\nif [ -d \"$SRCROOT/extras/system\" ]; then\n\t${SYNC} \"$SRCROOT/extras/system/\" \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\nfi\n\n# copy extra user packages if applicable\nif [ -d \"$SRCROOT/extras/user\" ]; then\n\tmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/Resources/XBMC/extras/user\"\n\t${SYNC} \"$SRCROOT/extras/user/\" \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/extras/user\"\nfi\n\nfi";
+ shellScript = "#!/bin/bash\n\necho \"copy root files\"\n\nif [ \"$ACTION\" = build ] ; then\n\n# for external testing\nTARGET_NAME=$PRODUCT_NAME.$WRAPPER_EXTENSION\n#SRCROOT=/Users/Shared/xbmc_svn/XBMC\n#TARGET_BUILD_DIR=/Users/Shared/xbmc_svn/XBMC/build/Debug\n\n# rsync command with exclusions for items we don't want in the app package\nSYNC=\"rsync -aq --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *x86-osx.* --exclude *.zlib --exclude *.a --exclude *.pyd --exclude *x86-osx.so --exclude *powerpc-osx.so\"\n\n# rsync command for excluding pngs and jpgs as well. Note that if the skin itself is not compiled\n# using XBMCTex then excluding the pngs and jpgs will most likely make the skin unusable \n#SYNCSKIN=\"rsync -aq --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.png --exclude *.jpg --exclude *.bat\"\nSYNCSKIN=\"rsync -aq --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude *.dll --exclude *.DLL --exclude *linux.* --exclude *.bat\"\n\n# rsync command for including everything but the skins\nADDONSYNC=\"rsync -aq --exclude CVS* --exclude .svn* --exclude .cvsignore* --exclude .cvspass* --exclude .DS_Store* --exclude skin.confluence --exclude screensaver.rsxs*\"\n\n# binary name is XBMC but we build XBMC.bin so to get a clean binary each time\nmv $TARGET_BUILD_DIR/$TARGET_NAME/XBMC.bin $TARGET_BUILD_DIR/$TARGET_NAME/XBMC\n\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/language\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/media\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/sounds\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/system\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/userdata\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/media\"\nmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/tools/osx\"\n\n${SYNC} \"$SRCROOT/LICENSE.GPL\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/\"\n${SYNC} \"$SRCROOT/xbmc/osx/Credits.html\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/\"\n#${SYNC} \"$SRCROOT/tools/osx\"\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/tools\"\n${ADDONSYNC} \"$SRCROOT/addons\"\t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/language\"\t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/media\" \t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNCSKIN} \"$SRCROOT/addons/skin.confluence\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons\"\n${SYNC} \"$SRCROOT/addons/skin.confluence/backgrounds\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons/skin.confluence\"\n${SYNC} \"$SRCROOT/addons/skin.confluence/icon.png\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/addons/skin.confluence\"\n${SYNC} \"$SRCROOT/sounds\" \t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/system\" \t\t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n${SYNC} \"$SRCROOT/userdata\" \t\"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\n\n# copy extra packages if applicable\nif [ -d \"$SRCROOT/extras/system\" ]; then\n\t${SYNC} \"$SRCROOT/extras/system/\" \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome\"\nfi\n\n# copy extra user packages if applicable\nif [ -d \"$SRCROOT/extras/user\" ]; then\n\tmkdir -p \"$TARGET_BUILD_DIR/$TARGET_NAME/Resources/XBMC/extras/user\"\n\t${SYNC} \"$SRCROOT/extras/user/\" \"$TARGET_BUILD_DIR/$TARGET_NAME/XBMCData/XBMCHome/extras/user\"\nfi\n\nfi";
showEnvVarsInLog = 0;
};
F589B48D128A697C00D8079E /* copy frameworks */ = {
@@ -5998,7 +5986,6 @@
F56C793B131EC154000AD0F6 /* SPCCodec.cpp in Sources */,
F56C793C131EC154000AD0F6 /* TimidityCodec.cpp in Sources */,
F56C793D131EC154000AD0F6 /* WAVcodec.cpp in Sources */,
- F56C793E131EC154000AD0F6 /* WAVPackcodec.cpp in Sources */,
F56C793F131EC154000AD0F6 /* YMCodec.cpp in Sources */,
F56C7941131EC154000AD0F6 /* AudioRendererFactory.cpp in Sources */,
F56C7942131EC154000AD0F6 /* NullDirectSound.cpp in Sources */,
@@ -6692,6 +6679,9 @@
18ACF8E313597B0000B67371 /* RecentlyAddedJob.cpp in Sources */,
C807119F135DB842002F601B /* InputOperations.cpp in Sources */,
C8EC5D51136954E400CCC10D /* XBMC_keytable.cpp in Sources */,
+ 18404DFB1396C43B00863BBA /* Slingbox.cpp in Sources */,
+ 1840B796139968DB007C848B /* JSONVariantParser.cpp in Sources */,
+ 1840B797139968DB007C848B /* JSONVariantWriter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6765,6 +6755,7 @@
"\"$(SRCROOT)/lib/jsoncpp/src/lib_json\"",
"\"$(SRCROOT)/xbmc/interfaces/json-rpc\"",
"\"$(SRCROOT)/xbmc/interfaces/http-api\"",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
OTHER_LDFLAGS = (
"-Wl,-headerpad_max_install_names",
@@ -6784,6 +6775,7 @@
"-lmicrohttpd",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
@@ -6851,6 +6843,7 @@
"\"$(SRCROOT)/lib/jsoncpp/src/lib_json\"",
"\"$(SRCROOT)/xbmc/interfaces/json-rpc\"",
"\"$(SRCROOT)/xbmc/interfaces/http-api\"",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
OTHER_LDFLAGS = (
"-Wl,-headerpad_max_install_names",
@@ -6870,6 +6863,7 @@
"-lmicrohttpd",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
diff --git a/XBMC-IOS.xcodeproj/project.pbxproj b/XBMC-IOS.xcodeproj/project.pbxproj
index c6e068c00e..ceaf517be7 100644
--- a/XBMC-IOS.xcodeproj/project.pbxproj
+++ b/XBMC-IOS.xcodeproj/project.pbxproj
@@ -7,6 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
+ 18404DD31396C3D200863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DD21396C3D200863BBA /* SlingboxLib.a */; };
+ 18404DD61396C3F300863BBA /* Slingbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18404DD41396C3F300863BBA /* Slingbox.cpp */; };
+ 1840B77A1399616D007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B7761399616D007C848B /* JSONVariantParser.cpp */; };
+ 1840B77B1399616D007C848B /* JSONVariantWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B7781399616D007C848B /* JSONVariantWriter.cpp */; };
18ACF8FD13597B5700B67371 /* RecentlyAddedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18ACF8FB13597B5700B67371 /* RecentlyAddedJob.cpp */; };
3255316612B2D02400837CD2 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3255316512B2D02400837CD2 /* CoreAudio.framework */; };
4D5D2E1E1301758F006ABC13 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D5D2E1D1301758F006ABC13 /* CFNetwork.framework */; };
@@ -307,7 +311,6 @@
F56C8931131F42ED000AD0F6 /* SPCCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C832A131F42E7000AD0F6 /* SPCCodec.cpp */; };
F56C8932131F42ED000AD0F6 /* TimidityCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C832C131F42E7000AD0F6 /* TimidityCodec.cpp */; };
F56C8933131F42ED000AD0F6 /* WAVcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C832E131F42E7000AD0F6 /* WAVcodec.cpp */; };
- F56C8934131F42ED000AD0F6 /* WAVPackcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8330131F42E7000AD0F6 /* WAVPackcodec.cpp */; };
F56C8935131F42ED000AD0F6 /* YMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8332131F42E7000AD0F6 /* YMCodec.cpp */; };
F56C8936131F42ED000AD0F6 /* PlayerCoreFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8336131F42E7000AD0F6 /* PlayerCoreFactory.cpp */; };
F56C8937131F42ED000AD0F6 /* PlayerSelectionRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F56C8338131F42E7000AD0F6 /* PlayerSelectionRule.cpp */; };
@@ -880,7 +883,6 @@
F56C8BAB131F4466000AD0F6 /* XBMCEAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F56C8BA5131F4466000AD0F6 /* XBMCEAGLView.mm */; };
F56C8BB9131F44AA000AD0F6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F56C8BB7131F44AA000AD0F6 /* InfoPlist.strings */; };
F56C8C09131F47EA000AD0F6 /* libapetag.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F56C8C03131F47EA000AD0F6 /* libapetag.a */; };
- F56C8C0C131F47EA000AD0F6 /* libjsoncpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F56C8C06131F47EA000AD0F6 /* libjsoncpp.a */; };
F56C8C11131F4811000AD0F6 /* libsquish.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F56C8C0D131F4811000AD0F6 /* libsquish.a */; };
F56C8C12131F4811000AD0F6 /* librtv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F56C8C0E131F4811000AD0F6 /* librtv.a */; };
F56C8C14131F4811000AD0F6 /* libxdaap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F56C8C10131F4811000AD0F6 /* libxdaap.a */; };
@@ -916,6 +918,13 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 18404DD21396C3D200863BBA /* SlingboxLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = SlingboxLib.a; path = lib/SlingboxLib/SlingboxLib.a; sourceTree = "<group>"; };
+ 18404DD41396C3F300863BBA /* Slingbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slingbox.cpp; sourceTree = "<group>"; };
+ 18404DD51396C3F300863BBA /* Slingbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slingbox.h; sourceTree = "<group>"; };
+ 1840B7761399616D007C848B /* JSONVariantParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantParser.cpp; sourceTree = "<group>"; };
+ 1840B7771399616D007C848B /* JSONVariantParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantParser.h; sourceTree = "<group>"; };
+ 1840B7781399616D007C848B /* JSONVariantWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantWriter.cpp; sourceTree = "<group>"; };
+ 1840B7791399616D007C848B /* JSONVariantWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantWriter.h; sourceTree = "<group>"; };
18ACF8FB13597B5700B67371 /* RecentlyAddedJob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecentlyAddedJob.cpp; sourceTree = "<group>"; };
18ACF8FC13597B5700B67371 /* RecentlyAddedJob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecentlyAddedJob.h; sourceTree = "<group>"; };
3255316512B2D02400837CD2 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
@@ -943,7 +952,6 @@
F56C803B131F42E5000AD0F6 /* DllStSound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllStSound.h; sourceTree = "<group>"; };
F56C803C131F42E5000AD0F6 /* DllTimidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllTimidity.h; sourceTree = "<group>"; };
F56C803D131F42E5000AD0F6 /* DllVorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllVorbisfile.h; sourceTree = "<group>"; };
- F56C803E131F42E5000AD0F6 /* DllWAVPack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllWAVPack.h; sourceTree = "<group>"; };
F56C8040131F42E5000AD0F6 /* tinystr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinystr.cpp; sourceTree = "<group>"; };
F56C8041131F42E5000AD0F6 /* tinystr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinystr.h; sourceTree = "<group>"; };
F56C8042131F42E5000AD0F6 /* tinyxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml.cpp; sourceTree = "<group>"; };
@@ -1348,10 +1356,6 @@
F56C81F4131F42E6000AD0F6 /* EncoderWav.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncoderWav.h; sourceTree = "<group>"; };
F56C81F6131F42E6000AD0F6 /* lame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lame.h; sourceTree = "<group>"; };
F56C81F8131F42E6000AD0F6 /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codec.h; sourceTree = "<group>"; };
- F56C81F9131F42E6000AD0F6 /* ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ogg.h; sourceTree = "<group>"; };
- F56C81FA131F42E6000AD0F6 /* os_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = os_types.h; sourceTree = "<group>"; };
- F56C81FB131F42E6000AD0F6 /* vorbisenc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisenc.h; sourceTree = "<group>"; };
- F56C81FC131F42E6000AD0F6 /* vorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisfile.h; sourceTree = "<group>"; };
F56C81FF131F42E6000AD0F6 /* IOSAudioRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSAudioRenderer.cpp; path = AudioRenderers/IOSAudioRenderer.cpp; sourceTree = "<group>"; };
F56C8200131F42E6000AD0F6 /* IOSAudioRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSAudioRenderer.h; path = AudioRenderers/IOSAudioRenderer.h; sourceTree = "<group>"; };
F56C8201131F42E6000AD0F6 /* IAudioRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IAudioRenderer.h; path = AudioRenderers/IAudioRenderer.h; sourceTree = "<group>"; };
@@ -1634,8 +1638,6 @@
F56C832D131F42E7000AD0F6 /* TimidityCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimidityCodec.h; sourceTree = "<group>"; };
F56C832E131F42E7000AD0F6 /* WAVcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WAVcodec.cpp; sourceTree = "<group>"; };
F56C832F131F42E7000AD0F6 /* WAVcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAVcodec.h; sourceTree = "<group>"; };
- F56C8330131F42E7000AD0F6 /* WAVPackcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WAVPackcodec.cpp; sourceTree = "<group>"; };
- F56C8331131F42E7000AD0F6 /* WAVPackcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAVPackcodec.h; sourceTree = "<group>"; };
F56C8332131F42E7000AD0F6 /* YMCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YMCodec.cpp; sourceTree = "<group>"; };
F56C8333131F42E7000AD0F6 /* YMCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YMCodec.h; sourceTree = "<group>"; };
F56C8335131F42E7000AD0F6 /* PlayerCoreConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlayerCoreConfig.h; path = playercorefactory/PlayerCoreConfig.h; sourceTree = "<group>"; };
@@ -1955,7 +1957,6 @@
F56C8476131F42E8000AD0F6 /* VirtualDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualDirectory.h; sourceTree = "<group>"; };
F56C847B131F42E9000AD0F6 /* ZeroconfDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZeroconfDirectory.h; sourceTree = "<group>"; };
F56C847C131F42E9000AD0F6 /* ZeroconfDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZeroconfDirectory.cpp; sourceTree = "<group>"; };
- F56C847D131F42E9000AD0F6 /* zconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zconf.h; sourceTree = "<group>"; };
F56C847E131F42E9000AD0F6 /* ZipDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipDirectory.cpp; sourceTree = "<group>"; };
F56C847F131F42E9000AD0F6 /* ZipDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipDirectory.h; sourceTree = "<group>"; };
F56C8480131F42E9000AD0F6 /* ZipManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipManager.cpp; sourceTree = "<group>"; };
@@ -2800,7 +2801,6 @@
F56C8BA6131F4466000AD0F6 /* XBMCIOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "XBMCIOS-Info.plist"; sourceTree = "<group>"; };
F56C8BB8131F44AA000AD0F6 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = "<group>"; };
F56C8C03131F47EA000AD0F6 /* libapetag.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libapetag.a; path = lib/libapetag/.libs/libapetag.a; sourceTree = "<group>"; };
- F56C8C06131F47EA000AD0F6 /* libjsoncpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjsoncpp.a; path = lib/jsoncpp/src/lib_json/libjsoncpp.a; sourceTree = "<group>"; };
F56C8C0D131F4811000AD0F6 /* libsquish.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsquish.a; path = lib/libsquish/libsquish.a; sourceTree = "<group>"; };
F56C8C0E131F4811000AD0F6 /* librtv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = librtv.a; path = lib/libRTV/librtv.a; sourceTree = "<group>"; };
F56C8C10131F4811000AD0F6 /* libxdaap.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxdaap.a; path = lib/libXDAAP/libxdaap.a; sourceTree = "<group>"; };
@@ -2881,10 +2881,10 @@
F56B160812CD6999009B4C96 /* ImageIO.framework in Frameworks */,
4D5D2E1E1301758F006ABC13 /* CFNetwork.framework in Frameworks */,
F56C8C09131F47EA000AD0F6 /* libapetag.a in Frameworks */,
- F56C8C0C131F47EA000AD0F6 /* libjsoncpp.a in Frameworks */,
F56C8C11131F4811000AD0F6 /* libsquish.a in Frameworks */,
F56C8C12131F4811000AD0F6 /* librtv.a in Frameworks */,
F56C8C14131F4811000AD0F6 /* libxdaap.a in Frameworks */,
+ 18404DD31396C3D200863BBA /* SlingboxLib.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2930,7 +2930,6 @@
F56C803B131F42E5000AD0F6 /* DllStSound.h */,
F56C803C131F42E5000AD0F6 /* DllTimidity.h */,
F56C803D131F42E5000AD0F6 /* DllVorbisfile.h */,
- F56C803E131F42E5000AD0F6 /* DllWAVPack.h */,
F56C803F131F42E5000AD0F6 /* tinyXML */,
F56C8046131F42E5000AD0F6 /* libexif */,
F56C8048131F42E5000AD0F6 /* libhdhomerun */,
@@ -2939,7 +2938,6 @@
F56C8063131F42E5000AD0F6 /* libRTV */,
F56C806E131F42E5000AD0F6 /* libsquish */,
F56C8070131F42E5000AD0F6 /* libUPnP */,
- F56C8145131F42E6000AD0F6 /* libXBMS */,
F56C8146131F42E6000AD0F6 /* libXDAAP */,
F56C814C131F42E6000AD0F6 /* UnrarXLib */,
);
@@ -3396,13 +3394,6 @@
path = TextToHeader;
sourceTree = "<group>";
};
- F56C8145131F42E6000AD0F6 /* libXBMS */ = {
- isa = PBXGroup;
- children = (
- );
- path = libXBMS;
- sourceTree = "<group>";
- };
F56C8146131F42E6000AD0F6 /* libXDAAP */ = {
isa = PBXGroup;
children = (
@@ -3715,10 +3706,6 @@
isa = PBXGroup;
children = (
F56C81F8131F42E6000AD0F6 /* codec.h */,
- F56C81F9131F42E6000AD0F6 /* ogg.h */,
- F56C81FA131F42E6000AD0F6 /* os_types.h */,
- F56C81FB131F42E6000AD0F6 /* vorbisenc.h */,
- F56C81FC131F42E6000AD0F6 /* vorbisfile.h */,
);
path = oggvorbis;
sourceTree = "<group>";
@@ -4178,8 +4165,6 @@
F56C832D131F42E7000AD0F6 /* TimidityCodec.h */,
F56C832E131F42E7000AD0F6 /* WAVcodec.cpp */,
F56C832F131F42E7000AD0F6 /* WAVcodec.h */,
- F56C8330131F42E7000AD0F6 /* WAVPackcodec.cpp */,
- F56C8331131F42E7000AD0F6 /* WAVPackcodec.h */,
F56C8332131F42E7000AD0F6 /* YMCodec.cpp */,
F56C8333131F42E7000AD0F6 /* YMCodec.h */,
);
@@ -4421,6 +4406,8 @@
F56C8430131F42E8000AD0F6 /* SFTPDirectory.h */,
F56C8431131F42E8000AD0F6 /* SIDFileDirectory.cpp */,
F56C8432131F42E8000AD0F6 /* SIDFileDirectory.h */,
+ 18404DD41396C3F300863BBA /* Slingbox.cpp */,
+ 18404DD51396C3F300863BBA /* Slingbox.h */,
F56C8433131F42E8000AD0F6 /* SmartPlaylistDirectory.cpp */,
F56C8434131F42E8000AD0F6 /* SmartPlaylistDirectory.h */,
F56C8435131F42E8000AD0F6 /* SMBDirectory.h */,
@@ -4445,7 +4432,6 @@
F56C8476131F42E8000AD0F6 /* VirtualDirectory.h */,
F56C847B131F42E9000AD0F6 /* ZeroconfDirectory.h */,
F56C847C131F42E9000AD0F6 /* ZeroconfDirectory.cpp */,
- F56C847D131F42E9000AD0F6 /* zconf.h */,
F56C847E131F42E9000AD0F6 /* ZipDirectory.cpp */,
F56C847F131F42E9000AD0F6 /* ZipDirectory.h */,
F56C8480131F42E9000AD0F6 /* ZipManager.cpp */,
@@ -5434,6 +5420,10 @@
F56C8734131F42EC000AD0F6 /* JobManager.cpp */,
F56C8735131F42EC000AD0F6 /* JobManager.h */,
F56C8736131F42EC000AD0F6 /* Job.h */,
+ 1840B7761399616D007C848B /* JSONVariantParser.cpp */,
+ 1840B7771399616D007C848B /* JSONVariantParser.h */,
+ 1840B7781399616D007C848B /* JSONVariantWriter.cpp */,
+ 1840B7791399616D007C848B /* JSONVariantWriter.h */,
F56C8737131F42EC000AD0F6 /* LCD.cpp */,
F56C8738131F42EC000AD0F6 /* LCD.h */,
F56C8739131F42EC000AD0F6 /* log.cpp */,
@@ -5659,10 +5649,10 @@
isa = PBXGroup;
children = (
F56C8C03131F47EA000AD0F6 /* libapetag.a */,
- F56C8C06131F47EA000AD0F6 /* libjsoncpp.a */,
F56C8C0D131F4811000AD0F6 /* libsquish.a */,
F56C8C0E131F4811000AD0F6 /* librtv.a */,
F56C8C10131F4811000AD0F6 /* libxdaap.a */,
+ 18404DD21396C3D200863BBA /* SlingboxLib.a */,
);
name = "Internal Libs";
sourceTree = "<group>";
@@ -6115,7 +6105,6 @@
F56C8931131F42ED000AD0F6 /* SPCCodec.cpp in Sources */,
F56C8932131F42ED000AD0F6 /* TimidityCodec.cpp in Sources */,
F56C8933131F42ED000AD0F6 /* WAVcodec.cpp in Sources */,
- F56C8934131F42ED000AD0F6 /* WAVPackcodec.cpp in Sources */,
F56C8935131F42ED000AD0F6 /* YMCodec.cpp in Sources */,
F56C8936131F42ED000AD0F6 /* PlayerCoreFactory.cpp in Sources */,
F56C8937131F42ED000AD0F6 /* PlayerSelectionRule.cpp in Sources */,
@@ -6707,6 +6696,9 @@
18ACF8FD13597B5700B67371 /* RecentlyAddedJob.cpp in Sources */,
C80711AD135DB85F002F601B /* InputOperations.cpp in Sources */,
C8EC5D26136953E100CCC10D /* XBMC_keytable.cpp in Sources */,
+ 18404DD61396C3F300863BBA /* Slingbox.cpp in Sources */,
+ 1840B77A1399616D007C848B /* JSONVariantParser.cpp in Sources */,
+ 1840B77B1399616D007C848B /* JSONVariantWriter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -6779,6 +6771,7 @@
"\"$(SRCROOT)/lib/jsoncpp/src/lib_json\"",
"\"$(SRCROOT)/xbmc/interfaces/http-api\"",
"\"$(SRCROOT)/xbmc/interfaces/json-rpc\"",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
OTHER_LDFLAGS = (
"-Wl,-headerpad_max_install_names",
@@ -6796,6 +6789,7 @@
"-lmicrohttpd",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
@@ -6864,6 +6858,7 @@
"\"$(SRCROOT)/lib/jsoncpp/src/lib_json\"",
"\"$(SRCROOT)/xbmc/interfaces/http-api\"",
"\"$(SRCROOT)/xbmc/interfaces/json-rpc\"",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
OTHER_LDFLAGS = (
"-Wl,-headerpad_max_install_names",
@@ -6881,6 +6876,7 @@
"-lmicrohttpd",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj
index 1eeabf7b47..95f44d95d9 100644
--- a/XBMC.xcodeproj/project.pbxproj
+++ b/XBMC.xcodeproj/project.pbxproj
@@ -41,6 +41,14 @@
183C454D130C4D55006AA317 /* xbmcvfsmodule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 189047D11301DEAB00C11012 /* xbmcvfsmodule.cpp */; settings = {COMPILER_FLAGS = "-I$XBMC_DEPENDS/include/python2.6"; }; };
183FDF8A11AF0B0500B81E9C /* PluginSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 183FDF8811AF0B0500B81E9C /* PluginSource.cpp */; };
183FDF8B11AF0B0500B81E9C /* PluginSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 183FDF8811AF0B0500B81E9C /* PluginSource.cpp */; };
+ 18404D9E1396C13500863BBA /* Slingbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18404D9C1396C13500863BBA /* Slingbox.cpp */; };
+ 18404DA61396C31B00863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DA51396C31B00863BBA /* SlingboxLib.a */; };
+ 18404E701396E05D00863BBA /* Slingbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18404D9C1396C13500863BBA /* Slingbox.cpp */; };
+ 18404E711396E06C00863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DA51396C31B00863BBA /* SlingboxLib.a */; };
+ 1840B74D13993D8A007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B74B13993D8A007C848B /* JSONVariantParser.cpp */; };
+ 1840B74E13993D8A007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B74B13993D8A007C848B /* JSONVariantParser.cpp */; };
+ 1840B75313993DA0007C848B /* JSONVariantWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B75113993DA0007C848B /* JSONVariantWriter.cpp */; };
+ 1840B75413993DA0007C848B /* JSONVariantWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B75113993DA0007C848B /* JSONVariantWriter.cpp */; };
184C472F1296BC6E0006DB3E /* Service.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 184C472D1296BC6E0006DB3E /* Service.cpp */; };
184C47301296BC6E0006DB3E /* Service.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 184C472D1296BC6E0006DB3E /* Service.cpp */; };
18ACF84313596C9B00B67371 /* RecentlyAddedJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 18ACF84113596C9B00B67371 /* RecentlyAddedJob.cpp */; };
@@ -687,7 +695,6 @@
E38E1FDA0D25F9FD00618676 /* SPCCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16350D25F9FA00618676 /* SPCCodec.cpp */; };
E38E1FDB0D25F9FD00618676 /* TimidityCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16370D25F9FA00618676 /* TimidityCodec.cpp */; };
E38E1FDC0D25F9FD00618676 /* WAVcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16390D25F9FA00618676 /* WAVcodec.cpp */; };
- E38E1FDD0D25F9FD00618676 /* WAVPackcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E163D0D25F9FA00618676 /* WAVPackcodec.cpp */; };
E38E1FDF0D25F9FD00618676 /* YMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16410D25F9FA00618676 /* YMCodec.cpp */; };
E38E1FE50D25F9FD00618676 /* ssrc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16560D25F9FA00618676 /* ssrc.cpp */; };
E38E1FE70D25F9FD00618676 /* LinuxRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E165B0D25F9FA00618676 /* LinuxRenderer.cpp */; };
@@ -1271,7 +1278,6 @@
F5A1C92A0F6B06CF00A96ABD /* SPCCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16350D25F9FA00618676 /* SPCCodec.cpp */; };
F5A1C92B0F6B06CF00A96ABD /* TimidityCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16370D25F9FA00618676 /* TimidityCodec.cpp */; };
F5A1C92C0F6B06CF00A96ABD /* WAVcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16390D25F9FA00618676 /* WAVcodec.cpp */; };
- F5A1C92D0F6B06CF00A96ABD /* WAVPackcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E163D0D25F9FA00618676 /* WAVPackcodec.cpp */; };
F5A1C92F0F6B06CF00A96ABD /* YMCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16410D25F9FA00618676 /* YMCodec.cpp */; };
F5A1C9310F6B06CF00A96ABD /* ssrc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E16560D25F9FA00618676 /* ssrc.cpp */; };
F5A1C9320F6B06CF00A96ABD /* LinuxRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38E165B0D25F9FA00618676 /* LinuxRenderer.cpp */; };
@@ -1739,8 +1745,6 @@
F5A2BD0F0F7AD92C0006ABA0 /* Zeroconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F7C280F77217400C25D29 /* Zeroconf.cpp */; };
F5A7A6211127980A0059D6AA /* posix-realtime-stub.c in Sources */ = {isa = PBXBuildFile; fileRef = F5A7A61F1127980A0059D6AA /* posix-realtime-stub.c */; };
F5A7A6221127980A0059D6AA /* posix-realtime-stub.c in Sources */ = {isa = PBXBuildFile; fileRef = F5A7A61F1127980A0059D6AA /* posix-realtime-stub.c */; };
- F5A7A6F1112893330059D6AA /* libjsoncpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5A7A6F0112893330059D6AA /* libjsoncpp.a */; };
- F5A7A6F2112893330059D6AA /* libjsoncpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5A7A6F0112893330059D6AA /* libjsoncpp.a */; };
F5A7A702112893E50059D6AA /* AnnouncementManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5A7A700112893E50059D6AA /* AnnouncementManager.cpp */; };
F5A7A703112893E50059D6AA /* AnnouncementManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5A7A700112893E50059D6AA /* AnnouncementManager.cpp */; };
F5A7A85B112908F00059D6AA /* WebServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5A7A859112908F00059D6AA /* WebServer.cpp */; };
@@ -1875,6 +1879,13 @@
18308CB51303370800AA309E /* stdio_utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdio_utf8.h; sourceTree = "<group>"; };
183FDF8811AF0B0500B81E9C /* PluginSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginSource.cpp; sourceTree = "<group>"; };
183FDF8911AF0B0500B81E9C /* PluginSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginSource.h; sourceTree = "<group>"; };
+ 18404D9C1396C13500863BBA /* Slingbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slingbox.cpp; sourceTree = "<group>"; };
+ 18404D9D1396C13500863BBA /* Slingbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slingbox.h; sourceTree = "<group>"; };
+ 18404DA51396C31B00863BBA /* SlingboxLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = SlingboxLib.a; path = lib/SlingboxLib/SlingboxLib.a; sourceTree = "<group>"; };
+ 1840B74B13993D8A007C848B /* JSONVariantParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantParser.cpp; sourceTree = "<group>"; };
+ 1840B74C13993D8A007C848B /* JSONVariantParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantParser.h; sourceTree = "<group>"; };
+ 1840B75113993DA0007C848B /* JSONVariantWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSONVariantWriter.cpp; sourceTree = "<group>"; };
+ 1840B75213993DA0007C848B /* JSONVariantWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONVariantWriter.h; sourceTree = "<group>"; };
184C472D1296BC6E0006DB3E /* Service.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Service.cpp; sourceTree = "<group>"; };
184C472E1296BC6E0006DB3E /* Service.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Service.h; sourceTree = "<group>"; };
189047D11301DEAB00C11012 /* xbmcvfsmodule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbmcvfsmodule.cpp; sourceTree = "<group>"; };
@@ -1886,8 +1897,6 @@
18B49FF41152BFA5001AF8A6 /* AddonManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddonManager.cpp; sourceTree = "<group>"; };
18B49FF51152BFA5001AF8A6 /* AddonManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddonManager.h; sourceTree = "<group>"; };
18B49FF61152BFA5001AF8A6 /* DllAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllAddon.h; sourceTree = "<group>"; };
- 18B49FF71152BFA5001AF8A6 /* DllScreenSaver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllScreenSaver.h; sourceTree = "<group>"; };
- 18B49FF81152BFA5001AF8A6 /* DllVisualisation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllVisualisation.h; sourceTree = "<group>"; };
18B49FF91152BFA5001AF8A6 /* fft.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fft.cpp; sourceTree = "<group>"; };
18B49FFA1152BFA5001AF8A6 /* fft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fft.h; sourceTree = "<group>"; };
18B49FFB1152BFA5001AF8A6 /* IAddon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IAddon.h; sourceTree = "<group>"; };
@@ -2703,7 +2712,6 @@
E38E15FC0D25F9FA00618676 /* DllStSound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllStSound.h; sourceTree = "<group>"; };
E38E15FD0D25F9FA00618676 /* DllTimidity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllTimidity.h; sourceTree = "<group>"; };
E38E15FE0D25F9FA00618676 /* DllVorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllVorbisfile.h; sourceTree = "<group>"; };
- E38E15FF0D25F9FA00618676 /* DllWAVPack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DllWAVPack.h; sourceTree = "<group>"; };
E38E160A0D25F9FA00618676 /* FLACcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FLACcodec.cpp; sourceTree = "<group>"; };
E38E160B0D25F9FA00618676 /* FLACcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FLACcodec.h; sourceTree = "<group>"; };
E38E160E0D25F9FA00618676 /* ICodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICodec.h; sourceTree = "<group>"; };
@@ -2711,22 +2719,18 @@
E38E16140D25F9FA00618676 /* MP3codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP3codec.h; sourceTree = "<group>"; };
E38E161B0D25F9FA00618676 /* NSFCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NSFCodec.cpp; sourceTree = "<group>"; };
E38E161C0D25F9FA00618676 /* NSFCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSFCodec.h; sourceTree = "<group>"; };
- E38E16220D25F9FA00618676 /* vorbisfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbisfile.h; sourceTree = "<group>"; };
E38E16230D25F9FA00618676 /* OGGcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OGGcodec.cpp; sourceTree = "<group>"; };
E38E16240D25F9FA00618676 /* OGGcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OGGcodec.h; sourceTree = "<group>"; };
E38E162A0D25F9FA00618676 /* ReplayGain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplayGain.cpp; sourceTree = "<group>"; };
E38E162B0D25F9FA00618676 /* ReplayGain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplayGain.h; sourceTree = "<group>"; };
E38E16310D25F9FA00618676 /* SIDCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SIDCodec.cpp; sourceTree = "<group>"; };
E38E16320D25F9FA00618676 /* SIDCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SIDCodec.h; sourceTree = "<group>"; };
- E38E16340D25F9FA00618676 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = "<group>"; };
E38E16350D25F9FA00618676 /* SPCCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SPCCodec.cpp; sourceTree = "<group>"; };
E38E16360D25F9FA00618676 /* SPCCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPCCodec.h; sourceTree = "<group>"; };
E38E16370D25F9FA00618676 /* TimidityCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimidityCodec.cpp; sourceTree = "<group>"; };
E38E16380D25F9FA00618676 /* TimidityCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimidityCodec.h; sourceTree = "<group>"; };
E38E16390D25F9FA00618676 /* WAVcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WAVcodec.cpp; sourceTree = "<group>"; };
E38E163A0D25F9FA00618676 /* WAVcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAVcodec.h; sourceTree = "<group>"; };
- E38E163D0D25F9FA00618676 /* WAVPackcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WAVPackcodec.cpp; sourceTree = "<group>"; };
- E38E163E0D25F9FA00618676 /* WAVPackcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAVPackcodec.h; sourceTree = "<group>"; };
E38E16410D25F9FA00618676 /* YMCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YMCodec.cpp; sourceTree = "<group>"; };
E38E16420D25F9FA00618676 /* YMCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YMCodec.h; sourceTree = "<group>"; };
E38E16560D25F9FA00618676 /* ssrc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ssrc.cpp; sourceTree = "<group>"; };
@@ -2952,7 +2956,6 @@
E38E178B0D25F9FA00618676 /* VideoDatabaseDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoDatabaseDirectory.h; sourceTree = "<group>"; };
E38E178C0D25F9FA00618676 /* VirtualDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VirtualDirectory.cpp; sourceTree = "<group>"; };
E38E178D0D25F9FA00618676 /* VirtualDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualDirectory.h; sourceTree = "<group>"; };
- E38E17920D25F9FA00618676 /* zconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zconf.h; sourceTree = "<group>"; };
E38E17930D25F9FA00618676 /* ZipDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipDirectory.cpp; sourceTree = "<group>"; };
E38E17940D25F9FA00618676 /* ZipDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipDirectory.h; sourceTree = "<group>"; };
E38E17950D25F9FA00618676 /* ZipManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipManager.cpp; sourceTree = "<group>"; };
@@ -3577,7 +3580,6 @@
E4DF6CD80EFF85EB00C28243 /* CHANGELOG.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG.txt; sourceTree = "<group>"; };
E4DF6CD90EFF85EB00C28243 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
E4DF6CDA0EFF85EB00C28243 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
- E4DF6CDC0EFF861200C28243 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.txt; path = xbmc/lib/libUPnP/Neptune/README.txt; sourceTree = SOURCE_ROOT; };
E4E91BB70E7F7338001F0546 /* NptXbmcFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NptXbmcFile.cpp; sourceTree = "<group>"; };
F50629780E57B9680066625A /* MultiPathFile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MultiPathFile.cpp; sourceTree = "<group>"; };
F50629790E57B9680066625A /* MultiPathFile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultiPathFile.h; sourceTree = "<group>"; };
@@ -3686,7 +3688,6 @@
F5A1CBD20F6B06CF00A96ABD /* XBMC */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = XBMC; sourceTree = BUILT_PRODUCTS_DIR; };
F5A7A61F1127980A0059D6AA /* posix-realtime-stub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "posix-realtime-stub.c"; sourceTree = "<group>"; };
F5A7A6201127980A0059D6AA /* posix-realtime-stub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "posix-realtime-stub.h"; sourceTree = "<group>"; };
- F5A7A6F0112893330059D6AA /* libjsoncpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjsoncpp.a; path = lib/jsoncpp/src/lib_json/libjsoncpp.a; sourceTree = "<group>"; };
F5A7A700112893E50059D6AA /* AnnouncementManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnnouncementManager.cpp; sourceTree = "<group>"; };
F5A7A701112893E50059D6AA /* AnnouncementManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnouncementManager.h; sourceTree = "<group>"; };
F5A7A859112908F00059D6AA /* WebServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebServer.cpp; sourceTree = "<group>"; };
@@ -3834,7 +3835,6 @@
F59879080FBAA0C3008EF4FB /* QuartzCore.framework in Frameworks */,
43352CEE1071634600706B8A /* libsquish.a in Frameworks */,
F5DC888B110A654000EE1B15 /* libapetag.a in Frameworks */,
- F5A7A6F1112893330059D6AA /* libjsoncpp.a in Frameworks */,
F56C8CE2131F5DAF000AD0F6 /* libc.dylib in Frameworks */,
F56C8CE7131F5DC6000AD0F6 /* libz.dylib in Frameworks */,
F56C8CEA131F5DCC000AD0F6 /* libm.dylib in Frameworks */,
@@ -3842,6 +3842,7 @@
F56C8CF0131F5DED000AD0F6 /* libxml2.dylib in Frameworks */,
F56C8CF3131F5DFD000AD0F6 /* libiconv.dylib in Frameworks */,
F56C8CF6131F5E0B000AD0F6 /* libncurses.dylib in Frameworks */,
+ 18404DA61396C31B00863BBA /* SlingboxLib.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3865,7 +3866,6 @@
F5A1CBBB0F6B06CF00A96ABD /* DiskArbitration.framework in Frameworks */,
F59879090FBAA0C3008EF4FB /* QuartzCore.framework in Frameworks */,
F5DC888C110A654000EE1B15 /* libapetag.a in Frameworks */,
- F5A7A6F2112893330059D6AA /* libjsoncpp.a in Frameworks */,
F56C8CE3131F5DAF000AD0F6 /* libc.dylib in Frameworks */,
F56C8CE8131F5DC6000AD0F6 /* libz.dylib in Frameworks */,
F56C8CEB131F5DCC000AD0F6 /* libm.dylib in Frameworks */,
@@ -3876,6 +3876,7 @@
F5B5D64D133FC2C1007A4B4C /* libsquish.a in Frameworks */,
F5B5D64E133FC2E7007A4B4C /* librtv.a in Frameworks */,
F5B5D650133FC312007A4B4C /* libxdaap.a in Frameworks */,
+ 18404E711396E06C00863BBA /* SlingboxLib.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3961,8 +3962,6 @@
F52BFFDA115D5574004B1D66 /* AddonStatusHandler.cpp */,
F52BFFD9115D5574004B1D66 /* AddonStatusHandler.h */,
18B49FF61152BFA5001AF8A6 /* DllAddon.h */,
- 18B49FF71152BFA5001AF8A6 /* DllScreenSaver.h */,
- 18B49FF81152BFA5001AF8A6 /* DllVisualisation.h */,
18B49FFB1152BFA5001AF8A6 /* IAddon.h */,
18B49FFC1152BFA5001AF8A6 /* Scraper.cpp */,
18B49FFD1152BFA5001AF8A6 /* Scraper.h */,
@@ -5411,8 +5410,6 @@
E38E16380D25F9FA00618676 /* TimidityCodec.h */,
E38E16390D25F9FA00618676 /* WAVcodec.cpp */,
E38E163A0D25F9FA00618676 /* WAVcodec.h */,
- E38E163D0D25F9FA00618676 /* WAVPackcodec.cpp */,
- E38E163E0D25F9FA00618676 /* WAVPackcodec.h */,
E38E16410D25F9FA00618676 /* YMCodec.cpp */,
E38E16420D25F9FA00618676 /* YMCodec.h */,
);
@@ -5422,7 +5419,6 @@
E38E161D0D25F9FA00618676 /* ogg */ = {
isa = PBXGroup;
children = (
- E38E16220D25F9FA00618676 /* vorbisfile.h */,
);
path = ogg;
sourceTree = "<group>";
@@ -5437,7 +5433,6 @@
E38E16330D25F9FA00618676 /* spc */ = {
isa = PBXGroup;
children = (
- E38E16340D25F9FA00618676 /* Types.h */,
);
path = spc;
sourceTree = "<group>";
@@ -5628,6 +5623,8 @@
F5A7B37D113AFB900059D6AA /* SFTPDirectory.h */,
E38E17510D25F9FA00618676 /* SIDFileDirectory.cpp */,
E38E17520D25F9FA00618676 /* SIDFileDirectory.h */,
+ 18404D9C1396C13500863BBA /* Slingbox.cpp */,
+ 18404D9D1396C13500863BBA /* Slingbox.h */,
E38E17530D25F9FA00618676 /* SmartPlaylistDirectory.cpp */,
E38E17540D25F9FA00618676 /* SmartPlaylistDirectory.h */,
E38E17560D25F9FA00618676 /* SMBDirectory.h */,
@@ -5652,7 +5649,6 @@
E38E178D0D25F9FA00618676 /* VirtualDirectory.h */,
E49ACD8A100745C400A86ECD /* ZeroconfDirectory.h */,
E49ACD8B100745C400A86ECD /* ZeroconfDirectory.cpp */,
- E38E17920D25F9FA00618676 /* zconf.h */,
E38E17930D25F9FA00618676 /* ZipDirectory.cpp */,
E38E17940D25F9FA00618676 /* ZipDirectory.h */,
E38E17950D25F9FA00618676 /* ZipManager.cpp */,
@@ -5776,7 +5772,6 @@
E38E15FC0D25F9FA00618676 /* DllStSound.h */,
E38E15FD0D25F9FA00618676 /* DllTimidity.h */,
E38E15FE0D25F9FA00618676 /* DllVorbisfile.h */,
- E38E15FF0D25F9FA00618676 /* DllWAVPack.h */,
18B7CA0212944A8E009E7A26 /* tinyXML */,
E38E18820D25F9FA00618676 /* libexif */,
E38E196D0D25F9FB00618676 /* libhdhomerun */,
@@ -5785,7 +5780,6 @@
E38E1A130D25F9FB00618676 /* libRTV */,
F5E55E601076B34F006E788A /* libsquish */,
E38E1A550D25F9FB00618676 /* libUPnP */,
- E38E1C780D25F9FC00618676 /* libXBMS */,
E38E1C840D25F9FC00618676 /* libXDAAP */,
E38E1CE40D25F9FC00618676 /* UnrarXLib */,
);
@@ -6201,7 +6195,6 @@
E38E1B340D25F9FB00618676 /* Neptune */ = {
isa = PBXGroup;
children = (
- E4DF6CDC0EFF861200C28243 /* README.txt */,
E38E1BCF0D25F9FC00618676 /* Documents */,
E38E1BD20D25F9FC00618676 /* Extras */,
E38E1BD90D25F9FC00618676 /* Source */,
@@ -6423,13 +6416,6 @@
path = Xml1;
sourceTree = "<group>";
};
- E38E1C780D25F9FC00618676 /* libXBMS */ = {
- isa = PBXGroup;
- children = (
- );
- path = libXBMS;
- sourceTree = "<group>";
- };
E38E1C840D25F9FC00618676 /* libXDAAP */ = {
isa = PBXGroup;
children = (
@@ -6697,6 +6683,10 @@
F57B6F7E1071B8B500079ACB /* JobManager.cpp */,
F57B6F7F1071B8B500079ACB /* JobManager.h */,
7CAA205B107AFC280096DE39 /* Job.h */,
+ 1840B74B13993D8A007C848B /* JSONVariantParser.cpp */,
+ 1840B74C13993D8A007C848B /* JSONVariantParser.h */,
+ 1840B75113993DA0007C848B /* JSONVariantWriter.cpp */,
+ 1840B75213993DA0007C848B /* JSONVariantWriter.h */,
E38E1E550D25F9FD00618676 /* LCD.cpp */,
E38E1E560D25F9FD00618676 /* LCD.h */,
E38E1E5B0D25F9FD00618676 /* log.cpp */,
@@ -6784,10 +6774,10 @@
isa = PBXGroup;
children = (
F5DC888A110A654000EE1B15 /* libapetag.a */,
- F5A7A6F0112893330059D6AA /* libjsoncpp.a */,
43352CED1071634600706B8A /* libsquish.a */,
E38E256C0D263A1C00618676 /* librtv.a */,
E38E25680D2639F100618676 /* libxdaap.a */,
+ 18404DA51396C31B00863BBA /* SlingboxLib.a */,
);
name = "internal libs";
sourceTree = "<group>";
@@ -7224,7 +7214,6 @@
E38E1FDA0D25F9FD00618676 /* SPCCodec.cpp in Sources */,
E38E1FDB0D25F9FD00618676 /* TimidityCodec.cpp in Sources */,
E38E1FDC0D25F9FD00618676 /* WAVcodec.cpp in Sources */,
- E38E1FDD0D25F9FD00618676 /* WAVPackcodec.cpp in Sources */,
E38E1FDF0D25F9FD00618676 /* YMCodec.cpp in Sources */,
E38E1FE50D25F9FD00618676 /* ssrc.cpp in Sources */,
E38E1FE70D25F9FD00618676 /* LinuxRenderer.cpp in Sources */,
@@ -8020,6 +8009,9 @@
18ACF84313596C9B00B67371 /* RecentlyAddedJob.cpp in Sources */,
C807114D135DB5CC002F601B /* InputOperations.cpp in Sources */,
C8EC5D0E1369519D00CCC10D /* XBMC_keytable.cpp in Sources */,
+ 18404D9E1396C13500863BBA /* Slingbox.cpp in Sources */,
+ 1840B74D13993D8A007C848B /* JSONVariantParser.cpp in Sources */,
+ 1840B75313993DA0007C848B /* JSONVariantWriter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -8111,7 +8103,6 @@
F5A1C92A0F6B06CF00A96ABD /* SPCCodec.cpp in Sources */,
F5A1C92B0F6B06CF00A96ABD /* TimidityCodec.cpp in Sources */,
F5A1C92C0F6B06CF00A96ABD /* WAVcodec.cpp in Sources */,
- F5A1C92D0F6B06CF00A96ABD /* WAVPackcodec.cpp in Sources */,
F5A1C92F0F6B06CF00A96ABD /* YMCodec.cpp in Sources */,
F5A1C9310F6B06CF00A96ABD /* ssrc.cpp in Sources */,
F5A1C9320F6B06CF00A96ABD /* LinuxRenderer.cpp in Sources */,
@@ -8905,6 +8896,9 @@
43EA4297136C1D9E002C82A5 /* RenderCapture.cpp in Sources */,
43EA429B136C1E2F002C82A5 /* xbmcvfsmodule.cpp in Sources */,
43EA42B0136C2274002C82A5 /* InputOperations.cpp in Sources */,
+ 18404E701396E05D00863BBA /* Slingbox.cpp in Sources */,
+ 1840B74E13993D8A007C848B /* JSONVariantParser.cpp in Sources */,
+ 1840B75413993DA0007C848B /* JSONVariantWriter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -8978,6 +8972,7 @@
"$(SRCROOT)/lib/jsoncpp/src/lib_json",
"$(SRCROOT)/xbmc/interfaces/http-api",
"$(SRCROOT)/xbmc/interfaces/json-rpc",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
LINK_WITH_STANDARD_LIBRARIES = YES;
OTHER_LDFLAGS = (
@@ -8999,6 +8994,7 @@
"-lSDL_mixer",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
@@ -9067,6 +9063,7 @@
"$(SRCROOT)/lib/jsoncpp/src/lib_json",
"$(SRCROOT)/xbmc/interfaces/http-api",
"$(SRCROOT)/xbmc/interfaces/json-rpc",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
LINK_WITH_STANDARD_LIBRARIES = YES;
OTHER_LDFLAGS = (
@@ -9088,6 +9085,7 @@
"-lSDL_mixer",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
@@ -9214,6 +9212,7 @@
"$(SRCROOT)/lib/jsoncpp/src/lib_json",
"$(SRCROOT)/xbmc/interfaces/http-api",
"$(SRCROOT)/xbmc/interfaces/json-rpc",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
LINK_WITH_STANDARD_LIBRARIES = YES;
OTHER_LDFLAGS = (
@@ -9235,6 +9234,7 @@
"-lSDL_mixer",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
@@ -9304,6 +9304,7 @@
"$(SRCROOT)/lib/jsoncpp/src/lib_json",
"$(SRCROOT)/xbmc/interfaces/http-api",
"$(SRCROOT)/xbmc/interfaces/json-rpc",
+ "\"$(SRCROOT)/lib/SlingboxLib\"",
);
LINK_WITH_STANDARD_LIBRARIES = YES;
OTHER_LDFLAGS = (
@@ -9325,6 +9326,7 @@
"-lSDL_mixer",
"-lsmbclient",
"-lpython2.6",
+ "-lyajl",
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
);
diff --git a/addons/skin.confluence/720p/DialogAddonInfo.xml b/addons/skin.confluence/720p/DialogAddonInfo.xml
index 0182ae13c6..8b9b55d72d 100644
--- a/addons/skin.confluence/720p/DialogAddonInfo.xml
+++ b/addons/skin.confluence/720p/DialogAddonInfo.xml
@@ -169,12 +169,12 @@
</control>
<control type="image">
<description>Rating value</description>
- <posx>160</posx>
+ <posx>155</posx>
<posy>90</posy>
<width>160</width>
<height>32</height>
<aspectratio align="left">keep</aspectratio>
- <texture>LeftRating/$INFO[ListItem.Property(Addon.StarRating)]</texture>
+ <texture fallback="LeftRating/rating0.png">$INFO[ListItem.Property(Addon.StarRating),LeftRating/]</texture>
</control>
<control type="label">
<description>Summary txt</description>
diff --git a/addons/skin.confluence/720p/Home.xml b/addons/skin.confluence/720p/Home.xml
index 28e99632af..a6a29e5981 100644
--- a/addons/skin.confluence/720p/Home.xml
+++ b/addons/skin.confluence/720p/Home.xml
@@ -478,6 +478,13 @@
<visible>Container(9000).HasFocus(6)</visible>
<include>HomeSubMenuPlayDisc</include> <!-- Buttons for the grouplist -->
</control>
+ <control type="grouplist" id="9014">
+ <include>HomeSubMenuCommonValues</include>
+ <onleft>9013</onleft>
+ <onright>9013</onright>
+ <visible>Container(9000).HasFocus(4)</visible>
+ <include>HomeSubMenuPictures</include> <!-- Buttons for the grouplist -->
+ </control>
</control>
<control type="image">
<posx>-100</posx>
diff --git a/addons/skin.confluence/720p/IncludesHomeMenuItems.xml b/addons/skin.confluence/720p/IncludesHomeMenuItems.xml
index d40ccdefff..23baa6464c 100644
--- a/addons/skin.confluence/720p/IncludesHomeMenuItems.xml
+++ b/addons/skin.confluence/720p/IncludesHomeMenuItems.xml
@@ -147,4 +147,21 @@
<texture border="0,0,0,3">HomeSubEnd.png</texture>
</control>
</include>
+ <include name="HomeSubMenuPictures">
+ <control type="image" id="90141">
+ <width>35</width>
+ <height>35</height>
+ <texture border="0,0,0,3" flipx="true">HomeSubEnd.png</texture>
+ </control>
+ <control type="button" id="90142">
+ <include>ButtonHomeSubCommonValues</include>
+ <label>24001</label>
+ <onclick>ActivateWindow(Pictures,Addons,return)</onclick>
+ </control>
+ <control type="image" id="90146">
+ <width>35</width>
+ <height>35</height>
+ <texture border="0,0,0,3">HomeSubEnd.png</texture>
+ </control>
+ </include>
</includes>
diff --git a/addons/skin.confluence/720p/ViewsAddonBrowser.xml b/addons/skin.confluence/720p/ViewsAddonBrowser.xml
index 54a1628ecd..f1e9c81fbc 100644
--- a/addons/skin.confluence/720p/ViewsAddonBrowser.xml
+++ b/addons/skin.confluence/720p/ViewsAddonBrowser.xml
@@ -212,12 +212,12 @@
</control>
<control type="image">
<description>Rating value</description>
- <posx>165</posx>
+ <posx>155</posx>
<posy>60</posy>
<width>160</width>
<height>32</height>
<aspectratio align="left">keep</aspectratio>
- <texture>LeftRating/$INFO[ListItem.Property(Addon.StarRating)]</texture>
+ <texture fallback="LeftRating/rating0.png">$INFO[ListItem.Property(Addon.StarRating),LeftRating/]</texture>
</control>
<control type="image">
<posx>0</posx>
@@ -466,7 +466,7 @@
<width>150</width>
<height>30</height>
<aspectratio align="left">keep</aspectratio>
- <texture>LeftRating/$INFO[ListItem.Property(Addon.StarRating)]</texture>
+ <texture fallback="LeftRating/rating0.png">$INFO[ListItem.Property(Addon.StarRating),LeftRating/]</texture>
</control>
<control type="image">
<posx>0</posx>
diff --git a/addons/skin.confluence/720p/ViewsMusicLibrary.xml b/addons/skin.confluence/720p/ViewsMusicLibrary.xml
index 70ece19384..97af228ca0 100644
--- a/addons/skin.confluence/720p/ViewsMusicLibrary.xml
+++ b/addons/skin.confluence/720p/ViewsMusicLibrary.xml
@@ -221,7 +221,7 @@
<width>150</width>
<height>30</height>
<aspectratio>keep</aspectratio>
- <texture>CenterRating/$INFO[ListItem.StarRating]</texture>
+ <texture>$INFO[ListItem.StarRating,CenterRating/]</texture>
</control>
</control>
</control>
@@ -435,7 +435,7 @@
<width>160</width>
<height>32</height>
<aspectratio>keep</aspectratio>
- <texture>LeftRating/$INFO[ListItem.StarRating]</texture>
+ <texture>$INFO[ListItem.StarRating,LeftRating/]</texture>
</control>
<control type="textbox">
<description>Description Value for Album</description>
diff --git a/addons/skin.confluence/720p/custom_SkinSetting_1111.xml b/addons/skin.confluence/720p/custom_SkinSetting_1111.xml
index ed380c00e2..cb53fae551 100644
--- a/addons/skin.confluence/720p/custom_SkinSetting_1111.xml
+++ b/addons/skin.confluence/720p/custom_SkinSetting_1111.xml
@@ -676,42 +676,49 @@
<content>
<item id="1">
<label>3</label>
+ <label2>Home_Custom_Back_Video_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/videos.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Video_Folder)]</thumb>
</item>
<item id="2">
<label>2</label>
+ <label2>Home_Custom_Back_Music_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/music.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Music_Folder)]</thumb>
</item>
<item id="3">
<label>1</label>
+ <label2>Home_Custom_Back_Pictures_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/pictures.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Pictures_Folder)]</thumb>
</item>
<item id="4">
<label>0</label>
+ <label2>Home_Custom_Back_Programs_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/programs.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Programs_Folder)]</thumb>
</item>
<item id="5">
<label>8</label>
+ <label2>Home_Custom_Back_Weather_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/weather.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Weather_Folder)]</thumb>
</item>
<item id="7">
<label>13000</label>
+ <label2>Home_Custom_Back_Settings_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/settings.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Settings_Folder)]</thumb>
</item>
<item id="8">
<label>24001</label>
+ <label2>Home_Custom_Back_Addons_Folder</label2>
<onclick>-</onclick>
<icon>special://skin/backgrounds/Addons.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Addons_Folder)]</thumb>
@@ -728,425 +735,62 @@
<control type="group">
<posx>95</posx>
<posy>110</posy>
- <control type="group">
- <visible>Container(9003).HasFocus(1)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Video_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Video_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Video_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- </control>
- <control type="group">
- <visible>Container(9003).HasFocus(2)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Music_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Music_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Music_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- </control>
- <control type="group">
- <visible>Container(9003).HasFocus(3)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Pictures_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Pictures_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Pictures_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- </control>
- <control type="group">
- <visible>Container(9003).HasFocus(4)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Programs_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Programs_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Programs_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- </control>
- <control type="group">
- <visible>Container(9003).HasFocus(5)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Weather_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Weather_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Weather_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
+ <control type="button" id="300">
+ <description>Single Image button</description>
+ <posx>5</posx>
+ <posy>0</posy>
+ <width>180</width>
+ <height>40</height>
+ <label>31113</label>
+ <font>font12_title</font>
+ <textcolor>grey2</textcolor>
+ <focusedcolor>white</focusedcolor>
+ <align>center</align>
+ <texturenofocus border="5">button-nofocus.png</texturenofocus>
+ <texturefocus border="5">button-focus.png</texturefocus>
+ <onclick>Skin.SetImage($INFO[Container(9003).ListItem.Label2])</onclick>
+ <onleft>302</onleft>
+ <onright>301</onright>
+ <onup>304</onup>
+ <ondown>304</ondown>
</control>
- <control type="group">
- <visible>Container(9003).HasFocus(7)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Settings_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Settings_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Settings_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
+ <control type="button" id="301">
+ <description>Multi Image button</description>
+ <posx>190</posx>
+ <posy>0</posy>
+ <width>180</width>
+ <height>40</height>
+ <label>31114</label>
+ <font>font12_title</font>
+ <textcolor>grey2</textcolor>
+ <focusedcolor>white</focusedcolor>
+ <align>center</align>
+ <texturenofocus border="5">button-nofocus.png</texturenofocus>
+ <texturefocus border="5">button-focus.png</texturefocus>
+ <onclick>Skin.SetPath($INFO[Container(9003).ListItem.Label2])</onclick>
+ <onleft>300</onleft>
+ <onright>302</onright>
+ <onup>304</onup>
+ <ondown>304</ondown>
</control>
- <control type="group">
- <visible>Container(9003).HasFocus(8)</visible>
- <control type="button" id="300">
- <description>Single Image button</description>
- <posx>5</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31113</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetImage(Home_Custom_Back_Addons_Folder)</onclick>
- <onleft>302</onleft>
- <onright>301</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="301">
- <description>Multi Image button</description>
- <posx>190</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>31114</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.SetPath(Home_Custom_Back_Addons_Folder)</onclick>
- <onleft>300</onleft>
- <onright>302</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
- <control type="button" id="302">
- <description>Default Image button</description>
- <posx>375</posx>
- <posy>0</posy>
- <width>180</width>
- <height>40</height>
- <label>571</label>
- <font>font12_title</font>
- <textcolor>grey2</textcolor>
- <focusedcolor>white</focusedcolor>
- <align>center</align>
- <texturenofocus border="5">button-nofocus.png</texturenofocus>
- <texturefocus border="5">button-focus.png</texturefocus>
- <onclick>Skin.Reset(Home_Custom_Back_Addons_Folder)</onclick>
- <onleft>301</onleft>
- <onright>300</onright>
- <onup>304</onup>
- <ondown>304</ondown>
- </control>
+ <control type="button" id="302">
+ <description>Default Image button</description>
+ <posx>375</posx>
+ <posy>0</posy>
+ <width>180</width>
+ <height>40</height>
+ <label>571</label>
+ <font>font12_title</font>
+ <textcolor>grey2</textcolor>
+ <focusedcolor>white</focusedcolor>
+ <align>center</align>
+ <texturenofocus border="5">button-nofocus.png</texturenofocus>
+ <texturefocus border="5">button-focus.png</texturefocus>
+ <onclick>Skin.Reset($INFO[Container(9003).ListItem.Label2])</onclick>
+ <onleft>301</onleft>
+ <onright>300</onright>
+ <onup>304</onup>
+ <ondown>304</ondown>
</control>
</control>
<control type="multiimage">
diff --git a/addons/skin.confluence/720p/includes.xml b/addons/skin.confluence/720p/includes.xml
index 131b62d0d4..3f09909b87 100644
--- a/addons/skin.confluence/720p/includes.xml
+++ b/addons/skin.confluence/720p/includes.xml
@@ -10,11 +10,11 @@
<include file="IncludesHomeRecentlyAdded.xml" />
<include file="IncludesHomeMenuItems.xml" />
<include file="IncludesBackgroundBuilding.xml" />
- <include file="Weather+\10DayForecast.xml" />
- <include file="Weather+\36HourForecast.xml" />
- <include file="Weather+\WeekendForecast.xml" />
- <include file="Weather+\HourlyForecast.xml" />
- <include file="Weather+\MapsVideo.xml" />
+ <include file="weather+\10DayForecast.xml" />
+ <include file="weather+\36HourForecast.xml" />
+ <include file="weather+\WeekendForecast.xml" />
+ <include file="weather+\HourlyForecast.xml" />
+ <include file="weather+\MapsVideo.xml" />
<constant name="FanartCrossfadeTime">500</constant>
<constant name="IconCrossfadeTime">400</constant>
diff --git a/addons/skin.confluence/build.bat b/addons/skin.confluence/build.bat
index b91a3577c5..8735a13a0b 100644
--- a/addons/skin.confluence/build.bat
+++ b/addons/skin.confluence/build.bat
@@ -1,7 +1,7 @@
@echo off
ECHO ----------------------------------------
echo Creating Confluence Build Folder
-rmdir ..\..\project\Win32BuildSetup\BUILD_WIN32\Xbmc\addons\skin.confluence\ /S /Q
+IF Exist ..\..\project\Win32BuildSetup\BUILD_WIN32\Xbmc\addons\skin.confluence rmdir ..\..\project\Win32BuildSetup\BUILD_WIN32\Xbmc\addons\skin.confluence /S /Q
md ..\..\project\Win32BuildSetup\BUILD_WIN32\Xbmc\addons\skin.confluence\media\
Echo .svn>exclude.txt
diff --git a/addons/skin.confluence/language/Catalan/strings.xml b/addons/skin.confluence/language/Catalan/strings.xml
index bc612448c8..b6f5a02f80 100644
--- a/addons/skin.confluence/language/Catalan/strings.xml
+++ b/addons/skin.confluence/language/Catalan/strings.xml
@@ -164,4 +164,17 @@
<string id="31408">[B]CONFIGUREU ELS COMPLEMENTS[/B][CR][CR]Gestioneu els complements instal·lats · Cerqueu i instal·leu complements des de xbmc.org[CR]Modifiqueu els paràmetres dels complements</string>
<string id="31421">Seleccioneu el vostre perfil d'usuari[CR]per iniciar la sessió i continuar</string>
+
+ <!-- Weather plugin -->
+ <string id="31900">Mapes del temps</string>
+ <string id="31901">Pronòstic 36 hores</string>
+ <string id="31902">Predicció per hores</string>
+ <string id="31903">Previsió del cap de setmana</string>
+ <string id="31904">Pronòstic de 10 dies</string>
+ <string id="31905">Pronòstic</string>
+ <string id="31906">Mapes i vídeo</string>
+ <string id="31907">Vídeo del pronòstic [COLOR=grey2](Reproducció a pantalla completa)[/COLOR]</string>
+ <string id="31908">Possibilitat de precipitació</string>
+ <string id="31909">S'està obtenint la informació del pronòstic...</string>
+
</strings>
diff --git a/addons/skin.confluence/language/Chinese (Simple)/strings.xml b/addons/skin.confluence/language/Chinese (Simple)/strings.xml
index 80c508387d..621e4c1fba 100644
--- a/addons/skin.confluence/language/Chinese (Simple)/strings.xml
+++ b/addons/skin.confluence/language/Chinese (Simple)/strings.xml
@@ -165,4 +165,16 @@
<string id="31408">[B]设置扩展功能[/B][CR][CR]管ç†ä½ å®‰è£…的扩展功能 · 在xbmc.orgæµè§ˆå¹¶å®‰è£…扩展功能 · 修改扩展功能设置</string>
<string id="31421">选择您的用户é…置文件[CR]登录并继续</string>
+
+ <!-- Weather plugin -->
+ <string id="31900">气象图</string>
+ <string id="31901">36å°æ—¶é¢„报</string>
+ <string id="31902">æ¯å°æ—¶é¢„报</string>
+ <string id="31903">一周预报</string>
+ <string id="31904">10日预报</string>
+ <string id="31905">天气预报</string>
+ <string id="31906">å›¾åƒ &amp; 视频</string>
+ <string id="31907">视频预报 [COLOR=grey2](全å±æ’­æ”¾ï¼‰[/COLOR]</string>
+ <string id="31908">é™é›¨æ¦‚率</string>
+ <string id="31909">获å–天气信æ¯...</string>
</strings>
diff --git a/addons/skin.confluence/language/Slovenian/strings.xml b/addons/skin.confluence/language/Slovenian/strings.xml
new file mode 100644
index 0000000000..f02e3346c3
--- /dev/null
+++ b/addons/skin.confluence/language/Slovenian/strings.xml
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<strings>
+ <!-- Misc labels -->
+ <string id="31000">Prilagodite vaše</string>
+ <string id="31001">Ljubim</string>
+ <string id="31002">Sovražim</string>
+ <string id="31003">Zapusti</string>
+ <string id="31004">Delam...</string>
+ <string id="31005">Skrij informacije</string>
+ <string id="31006">Možnosti pogleda</string>
+ <string id="31007">VtiÄniki</string>
+ <string id="31008">Celozaslonski naÄin</string>
+
+ <string id="31020">Nazadnje dodano</string>
+ <string id="31021">Video - Datoteke</string>
+ <string id="31022">Glasba - Datoteke</string>
+ <string id="31023">Predvajam</string>
+ <string id="31024">Stran</string>
+ <string id="31025">Elementi</string>
+ <string id="31026">Razne možnosti</string>
+ <string id="31027">Lokacija</string>
+
+ <!-- View Type labels -->
+ <string id="31028">Plakati</string>
+ <string id="31029">Ozadja</string>
+ <string id="31030">Celoten seznam</string>
+ <string id="31031">SliÄice</string>
+ <string id="31032">Slike</string>
+ <string id="31033">Informacije</string>
+
+ <!-- Extra labels -->
+ <string id="31040">Trenutno predvajam</string>
+
+ <string id="31042">PREDVAJANJE</string>
+ <string id="31043">PREKINJENO</string>
+ <string id="31044">PREVIJANJE NAPREJ</string>
+ <string id="31045">NAZAJ</string>
+ <string id="31046">ZvoÄne lastnosti</string>
+ <string id="31047">Trenutna prednastavitev</string>
+ <string id="31048">Prednastavitve vizualizacije</string>
+ <string id="31049">ÄŒas zakljuÄka</string>
+ <string id="31050">Razvrsti: NaraÅ¡ÄajoÄe</string>
+ <string id="31051">Razvrsti: PadajoÄe</string>
+
+
+ <!-- Playlist Editor labels -->
+ <string id="31055">Odpri predvajalni seznam</string>
+ <string id="31056">Shrani predvajalni seznam</string>
+ <string id="31057">Zapri predvajalni seznam</string>
+ <string id="31058">Sistemske glasbene datoteke</string>
+ <string id="31059">Trenutni predvajalni seznam</string>
+ <string id="31060">Ta datoteka je združena. Izberite del za predvajanje.</string>
+ <string id="31061">Trenutno izbrano</string>
+
+ <!-- Skin Settings labels -->
+ <string id="31100"></string>
+ <string id="31101">Nastavitve domaÄega okna</string>
+ <string id="31102">Ozadje</string>
+ <string id="31103">Prikaži "Prekinjeno" v projekciji slik</string>
+ <string id="31104">Predvajaj napovednike v oknu [COLOR=grey3](Samo okno z informacijami o videu)[/COLOR]</string>
+ <string id="31105"></string>
+ <string id="31106">Razne nastavitve</string>
+ <string id="31107">Skrij oznake videa, prebrane iz datotek [COLOR=grey3](Blu-ray, HD-DVD)[/COLOR]</string>
+ <string id="31108">Skrij gumbe v glavnem menuju</string>
+ <string id="31109">Ozadja medijev</string>
+ <string id="31110">Uredi ozadje za tip medija</string>
+ <string id="31111">Skrij</string>
+ <string id="31112">Možnosti</string>
+ <string id="31113">Ena slika</string>
+ <string id="31114">VeÄ slik</string>
+ <string id="31115">Poljubno</string>
+ <string id="31116"></string>
+ <string id="31117">Prikaži nazadnje dodane videe</string>
+ <string id="31118">Podmenu programov na domaÄem oknu</string>
+ <string id="31119">Skrij ozadja</string>
+ <string id="31120">OZNAKA GUMBA</string>
+ <string id="31121"></string> <!-- blanked 2010-11-12 -->
+ <string id="31122">Vreme</string>
+ <string id="31123">Uporabi "Plakate" namesto "Transparentov" za TV serije</string>
+ <string id="31124">Prikaži "Trenutno predvajam" video v ozadju</string>
+ <string id="31125">Prikaži "Trenutno predvajam" vizualizacijo v ozadju</string>
+
+ <string id="31126"></string> <!-- blanked 2010-11-12 -->
+ <string id="31127"></string> <!-- blanked 2010-11-12 -->
+ <string id="31128">Besedilo pesmi</string>
+ <string id="31129"></string> <!-- blanked 2010-11-12 -->
+ <string id="31130"></string> <!-- blanked 2010-11-12 -->
+
+ <string id="31131"></string> <!-- blanked 2010-12-23 -->
+ <string id="31132">Dodatek besedil pesmi</string>
+ <string id="31133">Dodatek podnapisov</string>
+ <string id="31134">Podmenu videjev na domaÄem oknu</string>
+ <string id="31135">Podmenu glasbe na domaÄem oknu</string>
+ <string id="31136">Podmenu slik na domaÄem oknu</string>
+
+ <string id="31140">Glasbeni OSD</string>
+ <string id="31141">Video OSD</string>
+
+ <!-- Script labels -->
+ <string id="31200">Bližnjice</string>
+ <string id="31201">Kategorije</string>
+ <string id="31202">Prikaži igralce</string>
+ <string id="31203">Izberite svojo pesem</string>
+ <string id="31204">Povezave</string>
+ <string id="31205">Vir besedila pesmi</string>
+
+ <!-- Extra labels -->
+ <string id="31300">Temperatura</string>
+ <string id="31301">Zadnja posodobitev</string>
+ <string id="31302">Menu</string>
+ <string id="31303"></string>
+ <string id="31304">Slika</string>
+ <string id="31305">Ni zaznanega diska</string>
+ <string id="31306">Izvrzi</string>
+ <string id="31307">Skrij ozadje</string>
+ <string id="31308">Podrobnosti o filmu</string>
+ <string id="31309">Uporabljen pomnilnik:</string>
+ <string id="31310">Å tevilka pesmi</string>
+ <string id="31311">Ozadje[CR][CR]Ni na voljo[CR][CR] Kliknite na gumb in ga nastavite</string>
+ <string id="31312">Trenutni ponudnik</string>
+ <string id="31313">Izberi ponudnika</string>
+ <string id="31314">Možnosti iskanja</string>
+ <string id="31315">Osnovno</string>
+ <string id="31316"></string>
+ <string id="31317">Nastavi pot ozadij</string>
+ <string id="31318">Majhno ozadje</string>
+ <string id="31319">Izbran profil</string>
+ <string id="31320">Zadnja prijava</string>
+ <string id="31321">Izbirnik pesmi za karaoke</string>
+ <string id="31322">Predvajano</string>
+ <string id="31323">Najnovejši filmi</string>
+ <string id="31324">Najnovejše epizode</string>
+ <string id="31325">Možnosti predvajalnega seznama</string>
+ <string id="31326">Ustvarjeno</string>
+ <string id="31327">LoÄljivost</string>
+ <string id="31328">Nazadnje dodano</string>
+ <string id="31329">[B]Zakasnitev nastavljena![/B] [COLOR=grey2] - Sistem se bo izkljuÄil po[/COLOR]</string>
+ <string id="31330">Kliknite gumb za predvajanje[CR][CR]Napovednika filma</string>
+ <string id="31331">Podrobnosti o albumu</string>
+
+ <!-- Video and Music OSD Labels -->
+ <string id="31351">Prekini</string>
+ <string id="31352">Ustavi</string>
+ <string id="31353">Previj naprej</string>
+ <string id="31354">Nazaj</string>
+ <string id="31355">Filmski menu</string>
+ <string id="31356">Prenesi podnapise</string>
+ <string id="31357"></string>
+
+ <!-- Skin Fontsets -->
+ <string id="31390">Privzeto</string>
+ <string id="31391">Privzeto brez velikih zaÄetnic</string>
+ <string id="31392">Arial</string>
+
+ <!-- Description Labels -->
+ <string id="31400">[B]PRILAGODITE NASTAVITVE IZGLEDA[/B][CR][CR]Zamenjajte preobleko • DoloÄite jezik in regijo • Spremenite možnosti seznamov[CR]Nastavite ohranjevalnik zaslona</string>
+ <string id="31401">[B]PRILAGODITE NASTAVITVE VIDEA[/B][CR][CR]Upravljajte s knjižnico videa • Nastavite možnosti predvajanja videa[CR]Spremenite možnosti seznamov videa • DoloÄite pisavo podnapisov</string>
+ <string id="31402">[B]PRILAGODITE NASTAVITVE GLASBE[/B][CR][CR]Upravljajte s knjižnico glasbe • Nastavite možnosti predvajanja glasbe[CR]Spremenite možnosti seznamov glasbe • Nastavite objavo pesmi • Nastavite karaoke</string>
+ <string id="31403">[B]PRILAGODITE NASTAVITVE SLIK[/B][CR][CR]Spremenite možnosti seznamov slik • Nastavite projekcije slik</string>
+ <string id="31404">[B]PRILAGODITE NASTAVITVE VREMENA[/B][CR][CR]Izberite tri mesta, za katere bo na voljo vremenska napoved</string>
+ <string id="31405">[B]PRILAGODITE NASTAVITVE OMREŽJA[/B][CR][CR]Nastavite upravljanje XBMC preko UPnP in HTTP • Nastavite deljenje datotek[CR]Nastavite možnosti internetne povezave</string>
+ <string id="31406">[B]PRILAGODITE NASTAVITVE SISTEMA[/B][CR][CR]Nastavite in prilagodite zaslon • Nastavite zvoÄni izhod • Nastavite oddaljeno upravljanje[CR]Nastavite varÄevanje z energijo • VkljuÄite razhroÅ¡Äevanje • DoloÄite glavno geslo</string>
+ <string id="31407">[B]PRILAGODITE NASTAVITVE PREOBLEKE[/B][CR][CR]Nastavite preobleko Confluence • Dodajte in odstranite elemente na domaÄem oknu[CR]Spremenite ozadja preobleke</string>
+ <string id="31408">[B]PRILAGODITE DODATKE[/B][CR][CR]Upravljajte nameÅ¡Äene dodatke • Brskajte in namestite nove dodatke iz xbmc.org[CR]Nastavite dodatke</string>
+
+ <string id="31421">Izberite vaš XBMC uporabniški profil[CR]za prijavo in nadaljujte</string>
+
+ <!-- Weather plugin -->
+ <string id="31900">Vremenska slika</string>
+ <string id="31901">36-urna napoved</string>
+ <string id="31902">Napoved za vsako uro</string>
+ <string id="31903">Tedenska napoved</string>
+ <string id="31904">10-dnevna napoved</string>
+ <string id="31905">Napoved</string>
+ <string id="31906">Mape &amp; Video</string>
+ <string id="31907">Video napoved [COLOR=grey2](celozaslonsko predvajanje)[/COLOR]</string>
+ <string id="31908">Možnost padavin</string>
+ <string id="31909">Prenašam vremenske informacije...</string>
+
+ </strings>
diff --git a/addons/skin.confluence/media/flagging/lists/1080.png b/addons/skin.confluence/media/flagging/lists/1080.png
index bf61d77ceb..dbfb91b026 100644
--- a/addons/skin.confluence/media/flagging/lists/1080.png
+++ b/addons/skin.confluence/media/flagging/lists/1080.png
Binary files differ
diff --git a/addons/skin.confluence/media/flagging/lists/720.png b/addons/skin.confluence/media/flagging/lists/720.png
index bf61d77ceb..dbfb91b026 100644
--- a/addons/skin.confluence/media/flagging/lists/720.png
+++ b/addons/skin.confluence/media/flagging/lists/720.png
Binary files differ
diff --git a/configure.in b/configure.in
index 9f16719bad..193df2e530 100644
--- a/configure.in
+++ b/configure.in
@@ -574,7 +574,6 @@ AC_CHECK_HEADER([ogg/ogg.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([vorbis/vorbisfile.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([vorbis/vorbisenc.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([libmodplug/modplug.h],, AC_MSG_ERROR($missing_library))
-AC_CHECK_HEADER([wavpack/wavpack.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([FLAC/stream_decoder.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([bz2], [main],, AC_MSG_ERROR($missing_library))
@@ -589,6 +588,7 @@ AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
+AC_CHECK_LIB([yajl], [main],, AC_MSG_ERROR($missing_library))
PKG_CHECK_MODULES([FONTCONFIG], [fontconfig],
[INCLUDES="$INCLUDES $FONTCONFIG_CFLAGS"; LIBS="$LIBS $FONTCONFIG_LIBS"],
AC_MSG_ERROR($missing_library))
@@ -688,7 +688,6 @@ XB_FIND_SONAME([VORBISFILE], [vorbisfile])
XB_FIND_SONAME([MODPLUG], [modplug])
XB_FIND_SONAME([ASS], [ass])
XB_FIND_SONAME([MPEG2], [mpeg2])
-XB_FIND_SONAME([WAVPACK], [wavpack])
# WebServer
if test "$use_webserver" = "yes"; then
@@ -1387,7 +1386,6 @@ OUTPUT_FILES="Makefile \
lib/libXDAAP/Makefile \
lib/cmyth/Makefile \
lib/libhdhomerun/Makefile \
- lib/jsoncpp/src/lib_json/Makefile \
lib/libsquish/Makefile \
lib/libid3tag/Makefile \
lib/cximage-6.0/Makefile \
@@ -1437,7 +1435,6 @@ AC_SUBST(LIBMAD_BASENAME)
AC_SUBST(LIBOGG_BASENAME)
AC_SUBST(LIBVORBISENC_BASENAME)
AC_SUBST(LIBVORBIS_BASENAME)
-AC_SUBST(LIBWAVPACK_BASENAME)
AC_SUBST(LIBASS_BASENAME)
AC_SUBST(LIBMEPG2_BASENAME)
AC_SUBST_FILE(XBMC_STANDALONE_SH_PULSE)
diff --git a/language/Slovenian/langinfo.xml b/language/Slovenian/langinfo.xml
index b320ffdd81..2a6d698814 100644
--- a/language/Slovenian/langinfo.xml
+++ b/language/Slovenian/langinfo.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<language locale="sl">
<charsets>
<gui>CP1250</gui>
@@ -12,7 +12,7 @@
</dvd>
<regions>
- <region name="OSREDNJE SLOVENSKA" locale="SI">
+ <region name="Slovenija" locale="SI">
<dateshort>D.M.YYYY</dateshort>
<datelong>D. MMMM YYYY</datelong>
<time symbolAM="" symbolPM="">H:mm:ss</time>
diff --git a/language/Slovenian/strings.xml b/language/Slovenian/strings.xml
index 0a300e430e..0114f912a0 100644
--- a/language/Slovenian/strings.xml
+++ b/language/Slovenian/strings.xml
@@ -1,12 +1,16 @@
-<?xml version="1.0" encoding="windows-1250" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--Translator: Tadej Novak-->
+<!--Email: tadej@tano.si-->
+<!--Date of translation: 31/05/2011-->
<!--$Revision$-->
<strings>
<string id="0">Programi</string>
<string id="1">Slike</string>
<string id="2">Glasba</string>
<string id="3">Video</string>
- <string id="4">TV Vodiè</string>
+ <string id="4">TV vodiÄ</string>
<string id="5">Nastavitve</string>
+ <string id="6">XBMC SVN</string>
<string id="7">Moje datoteke</string>
<string id="8">Vreme</string>
<string id="9">XBMC Media Center</string>
@@ -14,7 +18,7 @@
<string id="11">Ponedeljek</string>
<string id="12">Torek</string>
<string id="13">Sreda</string>
- <string id="14">Èetrtek</string>
+ <string id="14">ÄŒetrtek</string>
<string id="15">Petek</string>
<string id="16">Sobota</string>
<string id="17">Nedelja</string>
@@ -32,62 +36,101 @@
<string id="31">November</string>
<string id="32">December</string>
- <string id="98">Samodejni pogled</string>
- <string id="99">Samodejno velik pogled</string>
+ <string id="41">Pon</string>
+ <string id="42">Tor</string>
+ <string id="43">Sre</string>
+ <string id="44">ÄŒet</string>
+ <string id="45">Pet</string>
+ <string id="46">Sob</string>
+ <string id="47">Ned</string>
+
+ <string id="51">Jan</string>
+ <string id="52">Feb</string>
+ <string id="53">Mar</string>
+ <string id="54">Apr</string>
+ <string id="55">Maj</string>
+ <string id="56">Jun</string>
+ <string id="57">Jul</string>
+ <string id="58">Avg</string>
+ <string id="59">Sep</string>
+ <string id="60">Okt</string>
+ <string id="61">Nov</string>
+ <string id="62">Dec</string>
+
+ <string id="71">S</string>
+ <string id="72">SSV</string>
+ <string id="73">SV</string>
+ <string id="74">VSV</string>
+ <string id="75">V</string>
+ <string id="76">VJV</string>
+ <string id="77">JV</string>
+ <string id="78">JJV</string>
+ <string id="79">J</string>
+ <string id="80">JJZ</string>
+ <string id="81">JZ</string>
+ <string id="82">ZJZ</string>
+ <string id="83">Z</string>
+ <string id="84">ZSZ</string>
+ <string id="85">SZ</string>
+ <string id="86">SSZ</string>
+ <string id="87">VAR</string>
+
+ <string id="98">Pogled: Samodejno</string>
+ <string id="99">Pogled: Samodejna velikost</string>
<string id="100">Pogled: Ikone</string>
- <string id="101">Pogled: Lista</string>
- <string id="102">Skeniraj</string>
- <string id="103">Sortiraj : Ime</string>
- <string id="104">Sortiraj : Datum</string>
- <string id="105">Sortiraj : Velikost</string>
+ <string id="101">Pogled: Seznam</string>
+ <string id="102">PreiÅ¡Äi</string>
+ <string id="103">Razvrsti: Ime</string>
+ <string id="104">Razvrsti: Datum</string>
+ <string id="105">Razvrsti: Velikost</string>
<string id="106">Ne</string>
<string id="107">Da</string>
- <string id="108">Predogled Slik</string>
- <string id="109">Ustvari slièico</string>
- <string id="110">Ustvari slièice</string>
- <string id="111">Bližnjice</string>
+ <string id="108">Projekcija slik</string>
+ <string id="109">Ustvari sliÄico</string>
+ <string id="110">Ustvari sliÄice</string>
+ <string id="111">Bližnjice</string>
<string id="112">Pavza</string>
- <string id="113">Moji dokumenti: Izvor</string>
- <string id="114">Moji dokumenti: Cilj</string>
+ <string id="113">Posodobitev ni uspela</string>
+ <string id="114">Namestitev ni uspela</string>
<string id="115">Kopiraj</string>
<string id="116">Premakni</string>
- <string id="117">Izbriši</string>
+ <string id="117">Izbriši</string>
<string id="118">Preimenuj</string>
<string id="119">Nova mapa</string>
<string id="120">Potrdi kopiranje datotek</string>
<string id="121">Potrdi premikanje datotek</string>
- <string id="122">Potrdi brisanje datotek</string>
+ <string id="122">Potrdi brisanje datotek?</string>
<string id="123">Ali naj kopiram datoteke?</string>
<string id="124">Ali naj prenesem datoteke?</string>
- <string id="125">Ali naj zbrišem datoteke?</string>
+ <string id="125">Ali naj izbrišem datoteke? - Izbris datotek ne more biti razveljavljen!</string>
<string id="126">Status</string>
- <string id="127">Datotek</string>
- <string id="128">Splošno</string>
- <string id="129">Predogled slik</string>
+ <string id="127">Elementi</string>
+ <string id="128">Splošno</string>
+ <string id="129">Projekcija slik</string>
<string id="130">Sistemske informacije</string>
<string id="131">Zaslon</string>
<string id="132">Albumi</string>
<string id="133">Izvajalci</string>
<string id="134">Pesmi</string>
- <string id="135">Žanri</string>
- <string id="136">Predvajalni seznam</string>
+ <string id="135">Žanri</string>
+ <string id="136">Predvajalni seznami</string>
<string id="137">Iskanje</string>
- <string id="138">SISTEMSKE INFORMACIJE</string>
+ <string id="138">Sistemske informacije</string>
<string id="139">Temperature:</string>
<string id="140">CPU:</string>
<string id="141">GPU:</string>
- <string id="142">Èas:</string>
- <string id="143">Sedanji:</string>
- <string id="144">Verzija:</string>
- <string id="145">Omrežje:</string>
+ <string id="142">ÄŒas:</string>
+ <string id="143">Trenutno:</string>
+ <string id="144">RazliÄica:</string>
+ <string id="145">Omrežje:</string>
<string id="146">Tip:</string>
- <string id="147">Statièen:</string>
+ <string id="147">StatiÄen</string>
<string id="148">DHCP</string>
- <string id="149">MAC:</string>
- <string id="150">IP</string>
+ <string id="149">MAC naslov</string>
+ <string id="150">IP naslov</string>
<string id="151">Povezava:</string>
- <string id="152">Polovièni duplex</string>
- <string id="153">Celi duplex</string>
+ <string id="152">PoloviÄni duplex</string>
+ <string id="153">Celotni duplex</string>
<string id="154">Shramba</string>
<string id="155">Pogon</string>
<string id="156">Prosto</string>
@@ -97,290 +140,286 @@
<string id="160">Prosto</string>
<string id="161">Ni dosegljiv</string>
<string id="162">DVD vratca odprta</string>
- <string id="163">Berem,...</string>
- <string id="164">Ni medija...</string>
- <string id="165">Medij prisoten,..</string>
+ <string id="163">Berem</string>
+ <string id="164">Ni medija</string>
+ <string id="165">Medij prisoten</string>
<string id="166">Preobleka</string>
- <string id="167">Omogoèi FTP strežnik</string>
- <string id="168">Omogoèi Internetno sinhronizacijo èasa</string>
- <string id="169">Resolucija</string>
- <string id="170">Album:</string>
- <string id="171">Izvajalec:</string>
- <string id="172">Datum izdaje:</string>
- <string id="173">Razvrstitev:</string>
- <string id="174">Žanr:</string>
- <string id="175">Ton:</string>
- <string id="176">Stil:</string>
- <string id="177">Ocena:</string>
- <string id="178">Posnetki:</string>
+
+ <string id="169">LoÄljivost</string>
+ <string id="170">Prilagodi osveževanje zaslona videu</string>
+
+ <string id="172">Datum izdaje</string>
+ <string id="173">Prikaži video v razmerju 4:3 kot</string>
+
+ <string id="175">Razpoloženja</string>
+ <string id="176">Stili</string>
+
<string id="179">Pesem</string>
<string id="180">Trajanje</string>
<string id="181">Izberi Album</string>
<string id="182">Posnetki</string>
- <string id="183">Ocena:</string>
- <string id="184">Osveži</string>
- <string id="185">Išèem Album</string>
- <string id="186">Potrdi</string>
- <string id="187">Ne najdem albumov</string>
+ <string id="183">Ocena</string>
+ <string id="184">Osveži</string>
+ <string id="185">IÅ¡Äem Album</string>
+ <string id="186">OK</string>
+ <string id="187">Ne najdem albumov!</string>
<string id="188">Izberi vse</string>
- <string id="189">Pregledujem info. o mediju</string>
+ <string id="189">Pregledujem informacije o mediju</string>
<string id="190">Shrani</string>
- <string id="191">Razporedi</string>
- <string id="192">Poèisti</string>
- <string id="193">Skeniraj</string>
- <string id="194">Poizvedujem,..</string>
- <string id="195">Ne najdem IMDB info.!</string>
+ <string id="191">NakljuÄno</string>
+ <string id="192">PoÄisti</string>
+ <string id="193">PreiÅ¡Äi</string>
+ <string id="194">Poizvedujem...</string>
+ <string id="195">Ne najdem informacije!</string>
<string id="196">Izberi film:</string>
- <string id="197">Poizvedujem IMDB info.</string>
- <string id="198">Nalagam filmske podrobnosti </string>
- <string id="199">Režiser:</string>
- <string id="200">Pisec:</string>
- <string id="201">Leto:</string>
- <string id="202">Tagline:</string>
- <string id="203">Plot outline:</string>
- <string id="204">Rang:</string>
- <string id="205">Glasovi:</string>
+ <string id="197">Poizvedujem informacije o %s</string>
+ <string id="198">Nalagam podrobnosti o filmu</string>
+ <string id="199">Spletni vmesnik</string>
+
+ <string id="202">Moto</string>
+ <string id="203">Oris zgodbe</string>
+
+ <string id="205">Ocene:</string>
<string id="206">Igralci</string>
- <string id="207">Plot</string>
+ <string id="207">Zgodba</string>
<string id="208">Predvajaj</string>
<string id="209">Naslednji</string>
- <string id="210">Prejšnji</string>
- <string id="213">Kalibriraj uporabniški vmesnik</string>
- <string id="214">Video kalibracija</string>
- <string id="215">Mehèanje</string>
- <string id="216">Poveèava</string>
- <string id="217">Kolièina Pixlov</string>
+ <string id="210">Prejšnji</string>
+ <string id="213">Kalibriraj uporabniški vmesnik...</string>
+ <string id="214">Prilagoditve slike...</string>
+ <string id="215">MehÄanje</string>
+ <string id="216">PoveÄava</string>
+ <string id="217">KoliÄina pikslov</string>
<string id="218">DVD pogon</string>
<string id="219">Prosim vstavite medij</string>
- <string id="220">Daljinsko deljenje</string>
- <string id="221">Mreža ni povezana</string>
- <string id="222">Preklièi</string>
+ <string id="220">Skupna raba</string>
+ <string id="221">Omrežje ni povezano</string>
+ <string id="222">PrekliÄi</string>
<string id="224">Hitrost</string>
- <string id="225">Èas predogleda slike</string>
- <string id="227">Preišèi Audio nosilce na freedb</string>
- <string id="228">Razpostavi Predvajalni seznam ob zagonu</string>
- <string id="229">HDD èas ustavitve</string>
- <string id="230">Video Filtri</string>
- <string id="231">Nobena</string>
- <string id="232">Toèka</string>
+ <string id="225">Vertical Shift</string>
+ <string id="226">Testni vzorci...</string>
+ <string id="227">Poizvedi za imena pesmi na CD-ju na freedb.org</string>
+ <string id="228">NakljuÄni predvajalni seznam ob zagonu</string>
+ <string id="229">ÄŒas ustavitve HDD</string>
+ <string id="230">Video filtri</string>
+ <string id="231">Brez</string>
+ <string id="232">ToÄka</string>
<string id="233">Linearno</string>
- <string id="234">Antisotropièno</string>
+ <string id="234">AntisotropiÄno</string>
<string id="235">Quincunx</string>
- <string id="236">Gaussianovo kubièno</string>
- <string id="237">Pomanševanje</string>
- <string id="238">Poveèevanje</string>
- <string id="239">Oèisti Predvajalni seznam ob izhodu</string>
- <string id="240">DVD-Video</string>
- <string id="241">VCD/SVCD</string>
- <string id="242">Audio-CD</string>
- <string id="243">XBOX Igre</string>
- <string id="244">Video</string>
- <string id="245">Glasba</string>
- <string id="246">Slike</string>
+ <string id="236">Gaussovo kubiÄno</string>
+ <string id="237">Pomanševanje</string>
+ <string id="238">PoveÄevanje</string>
+ <string id="239">PoÄisti predvajalni seznam na koncu</string>
+ <string id="240">Tip prikaza</string>
+ <string id="241">Celozaslonsko #%d</string>
+ <string id="242">V oknu</string>
+ <string id="243">Stopnja osveževanja</string>
+ <string id="244">Celozaslonsko</string>
+ <string id="245">Spr. velikosti: (%i,%i)->(%i,%i) (PoveÄava x%2.2f) AR:%2.2f:1 (Piksli: %2.2f:1) (VShift: %2.2f)</string>
+
<string id="247">Skripte</string>
<string id="248">Jezik</string>
<string id="249">Glasba</string>
<string id="250">Vizualizacija</string>
<string id="251">Izberi ciljno mapo</string>
- <string id="252">Stereo zvok na vse zvoènike</string>
- <string id="253">Število kanalov</string>
- <string id="254">DTS sprejemnik </string>
+ <string id="252">Stereo zvok na vse zvoÄnike</string>
+ <string id="253">Å tevilo kanalov</string>
+ <string id="254">- DTS sprejemnik</string>
<string id="255">CDDB</string>
- <string id="256">Poizvedujem freedb za CDDB info</string>
+ <string id="256">Pridobivam informacije o CD-ju</string>
<string id="257">Napaka</string>
- <string id="258">Vkljuèi Tag branje</string>
+ <string id="258">VkljuÄi branje oznak</string>
<string id="259">Odpiranje</string>
<string id="260">Shoutcast</string>
- <string id="261">Èakam na zaèetek...</string>
- <string id="262">Izhodne Skripte</string>
- <string id="263">Uporabi Web Strežnik</string>
+ <string id="261">ÄŒakam na zaÄetek...</string>
+ <string id="262">Izhodne skripte</string>
+ <string id="263">Dovoli upravljanje z XBMC preko HTTP</string>
<string id="264">Snemaj</string>
- <string id="265">Zakljuèi snemanje</string>
- <string id="266">Sortiraj : posnetek</string>
- <string id="267">Sortiraj : Èas</string>
- <string id="268">Sortiraj : Naslov</string>
- <string id="269">Sortiraj : Izvajalec</string>
- <string id="270">Sortiraj : Album</string>
- <string id="271">100 najbolših</string>
- <string id="272">Overscan kompezacija zgoraj levo</string>
- <string id="273">Overscan kompenzacija spodaj desno</string>
- <string id="274">Pozicija podnapisov</string>
- <string id="275">Nastavitev kolièine pixlov</string>
- <string id="276">Premakni kurzor za spreminjanje velikosti zaslona</string>
- <string id="277">Premakni kurzor za nastavitev lege podnapisov</string>
- <string id="278">S kurzorjem spremeni pravokotnik v popolni kvadrat</string>
- <string id="279">Nastavitev ni moè naložiti</string>
+ <string id="265">Ustavi snemanje</string>
+ <string id="266">Razvrsti: Posnetek</string>
+ <string id="267">Razvrsti: ÄŒas</string>
+ <string id="268">Razvrsti: Naslov</string>
+ <string id="269">Razvrsti: Izvajalec</string>
+ <string id="270">Razvrsti: Album</string>
+ <string id="271">Top 100</string>
+ <string id="272">Prilagajanje zaslona zgoraj levo</string>
+ <string id="273">Prilagajanje zaslona spodaj desno</string>
+ <string id="274">Položaj podnapisov</string>
+ <string id="275">Nastavitev koliÄine pixlov</string>
+ <string id="276">Premakni puÅ¡Äico za prilagoditev zaslonu</string>
+ <string id="277">Premakni Ärto za nastavitev položaja podnapisov </string>
+ <string id="278">Preoblikuj pravokotnik v popolni kvadrat</string>
+ <string id="279">Nastavitev ni mogoÄe prebrati</string>
<string id="280">Uporabljam privzete nastavitve</string>
- <string id="281">Prosimo preverite .xml datoteke</string>
- <string id="282">najdeno %i datotek</string>
+ <string id="281">Preverite XML datoteke</string>
+ <string id="282">Najdeno %i datotek</string>
<string id="283">Rezultati iskanja</string>
<string id="284">Ni rezultatov</string>
- <string id="286">Postprocesni Filter</string>
+
<string id="287">Podnapisi</string>
<string id="288">Pisava</string>
- <string id="289">- velikost</string>
- <string id="290">Dinamièna Kompresija</string>
- <string id="291">Video</string>
- <string id="292">Audio</string>
- <string id="293">Podnapisi</string>
+ <string id="289">- Velikost</string>
+ <string id="290">DinamiÄna kompresija</string>
+ <string id="291">Slika</string>
+ <string id="292">Zvok</string>
+ <string id="293">Prebrskaj za podnapise</string>
<string id="294">Ustvari zaznamek</string>
- <string id="296">Izbriši zaznamke</string>
- <string id="297">Audio èasovni zamik</string>
+ <string id="296">Izbriši zaznamke</string>
+ <string id="297">Zamik zvoka</string>
<string id="298">Zaznamki</string>
+ <string id="299">- AAC sprejemnik</string>
+ <string id="300">- MP1 sprejemnik</string>
+ <string id="301">- MP2 sprejemnik</string>
+ <string id="302">- MP3 sprejemnik</string>
<string id="303">Zamik</string>
<string id="304">Jezik</string>
- <string id="305">Vkljuèeno</string>
- <string id="306">Brez-prepletanja</string>
- <string id="307">- samodejno postprocesiranje</string>
- <string id="308">- Vertikalni deblokirni filter</string>
- <string id="309">- horizontalni deblokirni filter</string>
- <string id="310">- samodejna osvetlitev/Kontrast</string>
- <string id="311">- dering</string>
+ <string id="305">VkljuÄeno</string>
+ <string id="306">Brez prepletanja</string>
+
<string id="312">(0=auto)</string>
- <string id="313">Èišèenje baze podatkov</string>
+ <string id="313">ÄŒiÅ¡Äenje baze podatkov</string>
<string id="314">Pripravljanje...</string>
<string id="315">Napaka v podatkovni bazi</string>
<string id="316">Poizvedujem za pesmimi...</string>
- <string id="317">Podatkovna baza je zbrisana uspešno</string>
- <string id="318">Brišem pesmi...</string>
+ <string id="317">Podatkovna baza je uspeÅ¡no oÄiÅ¡Äena</string>
+ <string id="318">Brišem pesmi...</string>
<string id="319">Napaka pri brisanju pesmi</string>
- <string id="320">Brišem izvajalce...</string>
- <string id="321">Napaka pri brisanju Izvajalcev</string>
- <string id="322">Brišem žanre...</string>
- <string id="323">Napaka pri brisanju žanrov</string>
- <string id="324">Brišem poti....</string>
+ <string id="320">Brišem izvajalce...</string>
+ <string id="321">Napaka pri brisanju izvajalcev</string>
+ <string id="322">Brišem žanre...</string>
+ <string id="323">Napaka pri brisanju žanrov</string>
+ <string id="324">Brišem poti....</string>
<string id="325">Napaka pri brisanju poti</string>
- <string id="326">Brišem albume...</string>
- <string id="327">Napaka pri brisanju Albumov</string>
+ <string id="326">Brišem albume...</string>
+ <string id="327">Napaka pri brisanju albumov</string>
<string id="328">Zapisujem spremembe...</string>
<string id="329">Napaka pri zapisovanju sprememb</string>
- <string id="330">Dejanje bo vzelo nekaj èasa...</string>
+ <string id="330">Dejanje bo vzelo nekaj Äasa...</string>
<string id="331">Stiskam podatkovno bazo....</string>
<string id="332">Napaka pri stiskanju podatkovne baze</string>
- <string id="333">Želiš izbrisati glasbeno bazo?</string>
- <string id="334">Izbriši glasbeno bazo</string>
- <string id="335">Zaèetek</string>
- <string id="336">Izrisna konverzacija</string>
- <string id="337">Audio izhod</string>
+ <string id="333">Želite oÄistiti knjižnico?</string>
+ <string id="334">OÄisti knjižnico</string>
+ <string id="335">ZaÄni</string>
+ <string id="336">Pretvorba izrisa</string>
+ <string id="337">ZvoÄni izhod</string>
<string id="338">Analogno</string>
- <string id="339">Digitalno</string>
- <string id="340">Razlièni izvajalci</string>
- <string id="341">Predvajaj Disk</string>
+ <string id="339">OptiÄno/Coax</string>
+ <string id="340">RazliÄni izvajalci</string>
+ <string id="341">Predvajaj medij</string>
<string id="342">Filmi</string>
- <string id="343">Prilagodi hitrost slièic</string>
+ <string id="343">Prilagodi hitrost sliÄic</string>
<string id="344">Igralci</string>
<string id="345">Leto</string>
+ <string id="346">OjaÄaj zvok pri združevanju kanalov</string>
<string id="350">Programi</string>
- <string id="351">Izkljuèeno</string>
+ <string id="351">IzkljuÄeno</string>
<string id="352">Zamegljeno</string>
- <string id="353">Èrno</string>
- <string id="354">Sledi Matrice</string>
- <string id="355">Èas delovanja ohranjevalnika</string>
- <string id="356">Ohranjevalnik zaslona</string>
- <string id="357">Èas izklopa konzole</string>
- <string id="358">Vsi Albumi</string>
- <string id="359">Nedavno dodani Albumi</string>
+ <string id="353">ÄŒrno</string>
+ <string id="354">Sledi matrice</string>
+ <string id="355">Zamik ohranjevalnika zaslona</string>
+ <string id="356">NaÄin ohranjevalnika zaslona</string>
+ <string id="357">NaÄin zakasnjenega izklopa</string>
+ <string id="358">Vsi albumi</string>
+ <string id="359">Nedavno dodani albumi</string>
<string id="360">Ohranjevalnik</string>
- <string id="361">R. prikaz.slik</string>
+ <string id="361">R. proj. slik</string>
<string id="362">Zameglitev ohranjevalnika zaslona</string>
- <string id="363">Razvrsti po: Datotekah</string>
- <string id="364">- Ojaèevalec ima funkcijo AC3 </string>
- <string id="365">Razvrsti : Ime</string>
- <string id="366">Razvrsti : Leto</string>
- <string id="367">Razvrsti : Rang</string>
- <string id="368">IMDB</string>
+ <string id="363">Razvrsti: Datoteka</string>
+ <string id="364">- Dolby Digital (AC3) sprejemnik</string>
+ <string id="365">Razvrsti: Ime</string>
+ <string id="366">Razvrsti: Leto</string>
+ <string id="367">Razvrsti: Ocena</string>
+ <string id="368">IMDb</string>
<string id="369">Naslov</string>
- <string id="370">Nevihte</string>
- <string id="371">Delno</string>
- <string id="372">Pretežno</string>
- <string id="373">Jasno</string>
- <string id="374">Oblaèno</string>
- <string id="375">Sneg</string>
- <string id="376">Dež</string>
- <string id="377">Rahel</string>
- <string id="378">Dopoldan</string>
- <string id="379">Popoldan</string>
- <string id="380">Odtrgani oblak</string>
- <string id="381">Nekaj</string>
- <string id="382">Razpršeno</string>
- <string id="383">Veter</string>
- <string id="384">Moèno</string>
- <string id="385">Meglice</string>
- <string id="386">Jasno</string>
- <string id="387">Oblaki</string>
- <string id="388">Zgodaj</string>
- <string id="389">Nevihta</string>
- <string id="390">Flurries</string>
- <string id="391">Nizko</string>
- <string id="392">Srednje</string>
- <string id="393">Visoko</string>
- <string id="394">Megleno</string>
- <string id="395">Haze</string>
- <string id="396">Izberi Lokacijo</string>
- <string id="397">Osveži èas</string>
+ <string id="370">nevihte</string>
+ <string id="371">delno</string>
+ <string id="372">pretežno</string>
+ <string id="373">jasno</string>
+ <string id="374">oblaÄno</string>
+ <string id="375">sneg</string>
+ <string id="376">dež</string>
+ <string id="377">rahel</string>
+ <string id="378">dopoldan</string>
+ <string id="379">popoldan</string>
+ <string id="380">plohe</string>
+ <string id="381">nekaj</string>
+ <string id="382">razpršene</string>
+ <string id="383">veter</string>
+ <string id="384">moÄan</string>
+ <string id="385">Å¡ibak</string>
+ <string id="386">jasno</string>
+ <string id="387">oblaki</string>
+ <string id="388">zgodaj</string>
+ <string id="389">ploha</string>
+ <string id="390">nalivi</string>
+ <string id="391">nizko</string>
+ <string id="392">srednje</string>
+ <string id="393">visoko</string>
+ <string id="394">megla</string>
+ <string id="395">toÄa</string>
+ <string id="396">Izberi lokacijo</string>
+ <string id="397">Čas osveževanja</string>
<string id="398">Temperaturne enote</string>
<string id="399">Hitrostne enote</string>
<string id="400">Vreme</string>
- <string id="401">Temperatura</string>
- <string id="402">Obèuti se kot</string>
- <string id="403">UV Indeks</string>
+ <string id="401">Temp.</string>
+ <string id="402">ObÄuti se kot</string>
+ <string id="403">UV indeks</string>
<string id="404">Veter</string>
- <string id="405">T.vlažnosti</string>
- <string id="406">Vlažnost</string>
- <string id="407">Od</string>
- <string id="408">piha</string>
- <string id="409">Privzeto</string>
+ <string id="405">RosiÅ¡Äe</string>
+ <string id="406">Vlažnost</string>
- <string id="410">Povezujem se z Weather.com strežnikom</string>
+ <string id="409">Privzeto</string>
+ <string id="410">Povezujem se z vremenskim strežnikom</string>
<string id="411">Pridobivam vremensko napoved za:</string>
- <string id="412">Vremenske napovedi ni moè prejeti!</string>
- <string id="413">Manualno</string>
+ <string id="412">Vremenske napovedi ni mogoÄe prejeti</string>
+ <string id="413">RoÄno</string>
<string id="414">Ni recenzije za izbrani album</string>
- <string id="415">Prenašam slièice...</string>
- <string id="416">Ni prisoten</string>
- <string id="417">Izgled: Velike Ikone</string>
- <string id="418">Moj Video/Žanr</string>
- <string id="419">Moj Video/Igralci</string>
- <string id="420">Moj Video/Leta</string>
- <string id="421">Moj Video/Naslovi</string>
- <string id="422">Izbriši info o Albumu</string>
- <string id="423">Izbriši CDDB Info</string>
+ <string id="415">PrenaÅ¡am sliÄice...</string>
+ <string id="416">Ni na voljo</string>
+ <string id="417">Pogled: Velike Ikone</string>
+ <string id="418">Min.</string>
+ <string id="419">Maks.</string>
+ <string id="420">HDMI</string>
+
+ <string id="422">Izbriši informacije o albumu</string>
+ <string id="423">Izbriši informacije o CD-ju</string>
<string id="424">Izberi</string>
- <string id="425">Informacij o albumu ni</string>
- <string id="426">Informacij o CDDB ni</string>
- <string id="427">Disk:</string>
- <string id="428">Vstavi pravi CD/DVD</string>
- <string id="429">Prosim vstavi naslednji CD/DVD</string>
- <string id="430">Sortiraj po: DVD#</string>
- <string id="431">Brez medpomnilnika</string>
- <string id="432">Izbriši film iz baze</string>
- <string id="433">Ali ste preprièani glede odstranitve</string>
- <string id="434">filma ?</string>
- <string id="435">Posnetek</string>
- <string id="436">Leto:</string>
- <string id="437">Trajanje:</string>
+ <string id="425">Ni informacij o albumu</string>
+ <string id="426">Ni informacij o CD-ju</string>
+ <string id="427">Medij</string>
+ <string id="428">Vstavi pravilen CD/DVD</string>
+ <string id="429">Prosim vstavi naslednji CD/DVD:</string>
+ <string id="430">Razvrsti: DVD#</string>
+ <string id="431">Brez zaÄasnega pomnilnika</string>
+ <string id="432">Izbriši film iz baze</string>
+ <string id="433">ResniÄno odstrani '%s'?</string>
+ <string id="434">%s s hitrostjo %i %s</string>
+
+ <string id="437">Odstranljivi medij</string>
<string id="438">Odpiram datoteko</string>
- <string id="439">Medpomnilnik</string>
+ <string id="439">ZaÄasni pomnilnik</string>
<string id="440">Trdi disk</string>
<string id="441">UDF</string>
- <string id="442">LAN</string>
+ <string id="442">Krajevno omrežje</string>
<string id="443">Internet</string>
<string id="444">Video</string>
- <string id="445">Audio</string>
+ <string id="445">Glasba</string>
<string id="446">DVD</string>
<string id="447">Samodejni zagon</string>
<string id="448">LCD</string>
- <string id="449">Vkljuèen</string>
+ <string id="449">VkljuÄen</string>
<string id="450">Stolpci</string>
- <string id="451">Vrstica 1 Naslov</string>
- <string id="452">Vrstica 2 Naslov</string>
- <string id="453">Vrstica 3 Naslov</string>
- <string id="454">Vrstica 4 Naslov</string>
+ <string id="451">Vrstica 1 naslov</string>
+ <string id="452">Vrstica 2 naslov</string>
+ <string id="453">Vrstica 3 naslov</string>
+ <string id="454">Vrstica 4 naslov</string>
<string id="455">Vrstice</string>
- <string id="456">:</string>
+ <string id="456">NaÄin</string>
<string id="457">Preklopi pogled</string>
- <string id="459">Podmeniji</string>
- <string id="460">Audio Stream</string>
+ <string id="459">Podnapisi</string>
+ <string id="460">ZvoÄna sled</string>
<string id="461">[aktiven]</string>
<string id="462">Podnapisi</string>
<string id="463">Osvelitev ozadja</string>
@@ -388,365 +427,430 @@
<string id="465">Kontrast</string>
<string id="466">Gama jakost</string>
<string id="467">Tip</string>
- <string id="468">Premakni kurzor za spremembo pozicije OSD-ja</string>
- <string id="469">OSD Pozicija</string>
+ <string id="468">Premakni kurzor za spremembo položaja OSD-ja</string>
+ <string id="469">OSD položaj</string>
<string id="470">Zasluge</string>
- <string id="471">Modèip</string>
- <string id="474">Izkljuèi</string>
+ <string id="471">ModÄip</string>
+ <string id="474">IzkljuÄi</string>
<string id="475">Samo glasba</string>
- <string id="476">Glasba in video</string>
- <string id="477">Ne morem naložiti Predvajalnega seznama</string>
+ <string id="476">Glasba &amp; video</string>
+ <string id="477">Ne morem naložiti predvajalnega seznama</string>
<string id="478">OSD</string>
- <string id="479">Izgled ter jezik</string>
+ <string id="479">Preobleka &amp; jezik</string>
<string id="480">Izgled</string>
- <string id="481">Audio opcije</string>
- <string id="482">Vse o XBMC</string>
- <string id="483">album 2</string>
- <string id="484">Izvajalec</string>
- <string id="485">Izbriši album</string>
+ <string id="481">ZvoÄne nastavitve</string>
+ <string id="482">O XBMC</string>
+
+ <string id="485">Izbriši album</string>
<string id="486">Ponovi</string>
<string id="487">Ponovi enkrat</string>
- <string id="488">Ponovi mape</string>
- <string id="489">Samodejni zagon naslednje datoteke</string>
+ <string id="488">Ponovi mapo</string>
+ <string id="489">Samodejno predvajanje naslednje datoteke</string>
<string id="491">- Uporabi velike ikone</string>
- <string id="492">Zamenjaj dimenzije Vobsubs</string>
- <string id="493">Napredne opcije (Samo za eksperte)</string>
- <string id="494">Overall Audio Headroom</string>
- <string id="495">Nastavi video na GUI resolucijo</string>
- <string id="496">Kalibracija</string>
- <string id="497">Skrij konènice datotek</string>
- <string id="498">Sortiraj : Tip</string>
- <string id="499">Ne morem se povezati z www.allmusic.com</string>
- <string id="500">Neuspel prenos informacije o Albumu</string>
- <string id="501">Išèem imena Albumov....</string>
+ <string id="492">Sprememba velikosti Vobsubs</string>
+ <string id="493">Napredne nastavitve (Samo za strokovnjake!)</string>
+ <string id="494">Overall audio headroom</string>
+ <string id="495">PoveÄaj video na loÄljivost GUI</string>
+ <string id="496">Prilagajanje</string>
+ <string id="497">Prikaži konÄnice datotek</string>
+ <string id="498">Razvrsti: Tip</string>
+ <string id="499">Ne morem se povezati s spletno storitvijo</string>
+ <string id="500">Neuspel prenos informacije o albumu</string>
+ <string id="501">IÅ¡Äem imena albumov...</string>
<string id="502">Odprt</string>
<string id="503">Zaseden</string>
<string id="504">Prazen</string>
<string id="505">Nalagam informacije iz datotek...</string>
- <string id="507">Razvrsti : Uporaba</string>
- <string id="510">Vkljuèi Vizualizacijo</string>
- <string id="511">Uporabi preklop med video naèini</string>
- <string id="512">Zaèetno okno</string>
- <string id="513">Domaèe okno</string>
- <string id="514">Roène nastavitve</string>
- <string id="515">Žanr</string>
- <string id="516">Izdelaj arhiv z transparentno datoteko</string>
+ <string id="507">Razvrsti: Uporaba</string>
+ <string id="510">VkljuÄi vizualizacijo</string>
+ <string id="511">VkljuÄi preklop med naÄini slike</string>
+ <string id="512">ZaÄetno okno</string>
+ <string id="513">DomaÄe okno</string>
+ <string id="514">RoÄne nastavitve</string>
+ <string id="515">Žanr</string>
+
<string id="517">Nazadnje predvajani Albumi</string>
- <string id="518">Zaženi</string>
- <string id="519">Zaženi v...</string>
- <string id="520">Uredi XBE naslov</string>
+ <string id="518">Zaženi</string>
+ <string id="519">Zaženi v...</string>
+
<string id="521">Kompilacije</string>
<string id="522">Odstrani izvor</string>
<string id="523">Zamenjaj medij</string>
- <string id="524">Izberi Predvajalni seznam</string>
- <string id="525">Nov Predvajalni seznam...</string>
- <string id="526">Dodaj v Predvajalni seznam</string>
- <string id="527">Roèno dodaj v knjižnico</string>
+ <string id="524">Izberi predvajalni seznam</string>
+ <string id="525">Nov predvajalni seznam...</string>
+ <string id="526">Dodaj v predvajalni seznam</string>
+ <string id="527">RoÄno dodaj v knjižnico</string>
<string id="528">Vnesi naslov</string>
- <string id="529">Napaka: podvojeni naslov</string>
- <string id="530">Izberi žanr</string>
- <string id="531">Nov žanr</string>
- <string id="532">Roèna Addition</string>
- <string id="533">Vnesi žanr</string>
+ <string id="529">Napaka: Podvojen naslov</string>
+ <string id="530">Izberi žanr</string>
+ <string id="531">Nov žanr</string>
+ <string id="532">RoÄni vnos</string>
+ <string id="533">Vnesi žanr</string>
<string id="534">Pogled: %s</string>
- <string id="535">seznam</string>
- <string id="536">ikone</string>
- <string id="537">seznam 3</string>
- <string id="538">ikone 2</string>
- <string id="539">široko</string>
- <string id="540">široko 2</string>
- <string id="541">album</string>
- <string id="542">DVD</string>
- <string id="543">DVD 2</string>
+ <string id="535">Seznam</string>
+ <string id="536">Ikone</string>
+ <string id="537">Velik seznam</string>
+ <string id="538">Velike ikone</string>
+ <string id="539">Å iroko</string>
+ <string id="540">Veliko in Å¡iroko</string>
+ <string id="541">Ikone albumov</string>
+ <string id="542">Ikone DVD</string>
+ <string id="543">DVD</string>
<string id="544">Informacije o mediju</string>
+ <string id="545">ZvoÄna izhodna naprava</string>
+ <string id="546">Naprava za preusmeritev zvoka</string>
+ <string id="547">Ni biografije za tega izvajalca</string>
+ <string id="548">Pretvori veÄkanalni zvok v stereo</string>
<string id="550">Razvrsti: %s</string>
- <string id="551">ime</string>
- <string id="552">datum</string>
- <string id="553">velikost</string>
- <string id="554">posnetek</string>
- <string id="555">èas</string>
- <string id="556">naslov</string>
- <string id="557">izvajalec</string>
- <string id="558">album</string>
+ <string id="551">Ime</string>
+ <string id="552">Datum</string>
+ <string id="553">Velikost</string>
+ <string id="554">Posnetek</string>
+ <string id="555">ÄŒas</string>
+ <string id="556">Naslov</string>
+ <string id="557">Izvajalec</string>
+ <string id="558">Album</string>
<string id="559">Predvajalni seznam</string>
<string id="560">ID</string>
- <string id="561">datoteka</string>
+ <string id="561">Datoteka</string>
<string id="562">Leto</string>
<string id="563">Ocena</string>
<string id="564">Tip</string>
- <string id="565">uporaba</string>
+ <string id="565">Uporaba</string>
<string id="566">Izvajalec albuma</string>
- <string id="567">Števec predvajanj</string>
+ <string id="567">Å tevec predvajanj</string>
<string id="568">Nazadnje predvajano</string>
- <string id="569">Komentiraj</string>
- <string id="570">Dodatn datum</string>
+ <string id="569">Komentar</string>
+ <string id="570">Datum vnosa</string>
<string id="571">Privzeto</string>
<string id="572">Studio</string>
+ <string id="573">Pot</string>
+ <string id="574">Država</string>
+ <string id="575">Napredek</string>
+ <string id="576">KoliÄina predvajanj</string>
- <string id="580">Smer sortiranja</string>
- <string id="581">Naèin sortiranja</string>
- <string id="582">Naèin pogleda</string>
- <string id="583">Zapomni si pogled za razliène mape</string>
- <string id="584">Narašèajoèe</string>
- <string id="585">Padajoèe</string>
- <string id="586">Uredi Predvajalni seznam</string>
+ <string id="580">Smer razvrÅ¡Äanja</string>
+ <string id="581">NaÄin razvrÅ¡Äanja</string>
+ <string id="582">Pogled</string>
+ <string id="583">Zapomni si pogled za razliÄne mape</string>
+ <string id="584">NaraÅ¡ÄajoÄe</string>
+ <string id="585">PadajoÄe</string>
+ <string id="586">Uredi predvajalni seznam</string>
<string id="587">Filter</string>
- <string id="588">Ustavi zabavni naèin</string>
- <string id="589">Zabavni naèin</string>
- <string id="590">Nakljuèno</string>
- <string id="591">Izkljuèi</string>
+ <string id="588">Ustavi zabavni naÄin</string>
+ <string id="589">Zabavni naÄin</string>
+ <string id="590">NakljuÄno</string>
+ <string id="591">IzkljuÄi</string>
<string id="592">Eno</string>
<string id="593">Vse</string>
- <string id="594">Izkljuèi</string>
- <string id="595">Ponovi: Izkljuèen</string>
+ <string id="594">IzkljuÄi</string>
+ <string id="595">Ponovi: IzkljuÄen</string>
<string id="596">Ponovi: Enkrat</string>
<string id="597">Ponovi: Vse</string>
- <string id="600">Zripaj Audio CD</string>
+ <string id="600">Pretvori zvoÄni CD</string>
<string id="601">Srednji</string>
<string id="602">Standardni</string>
<string id="603">Ekstremni</string>
<string id="604">Konstantna bitna hitrost</string>
- <string id="605">Ripanje...</string>
- <string id="606">Številka posnetka:</string>
+ <string id="605">Pretvarjanje...</string>
+
<string id="607">Do:</string>
- <string id="608">Ne morem zripati CD-ja ali zapisa</string>
- <string id="609">CDDAR IP pot ni nastavljena v sources.xml</string>
- <string id="610">Ripaj Audio posnetek</string>
+ <string id="608">Ne morem pretvoriti CD-ja ali zapisa</string>
+ <string id="609">CDDARipPath ni nastavljen.</string>
+ <string id="610">Pretvori zvoÄni posnetek</string>
+ <string id="611">Vnesi Å¡tevilo</string>
+ <string id="612">Bits/Sample</string>
+ <string id="613">Sample Frequency</string>
- <string id="620">CD Ripanje</string>
+ <string id="620">ZvoÄni CD-ji</string>
<string id="621">Enkoder</string>
<string id="622">Kvaliteta</string>
<string id="623">Bitna hitrost</string>
- <string id="624">Upoštevaj številko pesmi</string>
+ <string id="624">VkljuÄi Å¡tevilko pesmi</string>
<string id="625">Vse pesmi od</string>
<string id="629">Pogled</string>
<string id="630">Normalno</string>
- <string id="631">Pomanjšaj</string>
- <string id="632">Razširi na 4:3</string>
- <string id="633">Razširi na 14:9</string>
- <string id="634">Razširi na 16:9</string>
+ <string id="631">PoveÄaj</string>
+ <string id="632">Razpotegni 4:3</string>
+ <string id="633">Å iroka poveÄava</string>
+ <string id="634">Razpotegni 16:9</string>
<string id="635">Originalna velikost</string>
<string id="636">Po meri</string>
- <string id="637">Ponovi Gain</string>
- <string id="638">Ponovi Gain naèin</string>
- <string id="639">Uporabi nasta.zapisov</string>
- <string id="640">Uporabi nasta.Albumov</string>
- <string id="641">Predn.- Predvajaj prejete datoteke </string>
- <string id="642">Predn. - Ne predvajaj prejetih datotek</string>
- <string id="643">Prepreèi CLIP na prejetih datotekah</string>
- <string id="644">Obreži èrne robove</string>
+ <string id="637">Poenotenje glasnosti</string>
+ <string id="638">Nastavitve poenotenja glasnosti</string>
+ <string id="639">Uporabi nivoje posnetkov</string>
+ <string id="640">Uporabi nivoje albuma</string>
+ <string id="641">PreAmp nivo - Poenoti glasnost dobljenih datotek</string>
+ <string id="642">PreAmp nivo - Ne poenoti glasnosti dobljenih datotek</string>
+ <string id="643">PrepreÄi stikanje poenotenih datotek</string>
+ <string id="644">Obreži Ärne robove</string>
<string id="645">Potrebno je razpakirati velike datoteke. Nadaljujem?</string>
- <string id="646">Odstrani iz baze</string>
- <string id="647">Izvozi video knjižnico</string>
- <string id="648">Uvozi video knjižnico</string>
- <string id="649">Uvažam</string>
- <string id="650">Izvažam</string>
- <string id="651">Prebrskaj za knjižnico</string>
+ <string id="646">Odstrani iz knjižnice</string>
+ <string id="647">Izvozi video knjižnico</string>
+ <string id="648">Uvozi video knjižnico</string>
+ <string id="649">Uvažam</string>
+ <string id="650">Izvažam</string>
+ <string id="651">Prebrskaj za knjižnico</string>
<string id="652">Leta</string>
- <string id="653">Posodobi knjinico</string>
- <string id="654">Prikaži debug informacije</string>
- <string id="655">Prebrskaj za Executable</string>
- <string id="656">Prebrskaj za Predvajalni seznam</string>
+ <string id="653">Posodobi knjižnico</string>
+ <string id="654">Prikaži razhroÅ¡Äevalne informacije</string>
+ <string id="655">Prebrskaj za program</string>
+ <string id="656">Prebrskaj za predvajalni seznam</string>
<string id="657">Prebrskaj za mapo</string>
<string id="658">Informacija o pesmi</string>
- <string id="659">Komentar:</string>
- <string id="660">Ojaèanje glasnosti</string>
-
- <string id="700">Èišèenje knjižnice</string>
- <string id="701">Odstrani stare pesmi iz knjižnice</string>
- <string id="702">Ta povezava je že bila skenirana</string>
- <string id="705">Omrežje</string>
- <string id="706">HTTP Proxy gostitelj</string>
- <string id="707">HTTP Proxy vrata</string>
- <string id="708">Uporabi HTTP Proxy</string>
- <string id="709">XLink Kai XNadimek</string>
- <string id="710">XLink Kai Geslo</string>
+ <string id="659">Nelinearni razteg</string>
+
+ <string id="660">OjaÄitev glasnosti</string>
+ <string id="661">Izberi mapo za izvoz</string>
+ <string id="662">Datoteka ni veÄ na voljo.</string>
+ <string id="663">Ali jo želiš odstraniti iz knjižnice?</string>
+ <string id="664">Prebrskaj za skripto</string>
+ <string id="665">Nivo stiskanja</string>
+
+ <string id="700">ÄŒiÅ¡Äenje knjižnice</string>
+ <string id="701">Odstrani stare pesmi iz knjižnice</string>
+ <string id="702">Ta pot je že bila preiskana</string>
+ <string id="705">Omrežje</string>
+ <string id="706">- Strežnik</string>
+
+ <string id="708">Uporabi HTTP proxy strežnik za povezavo do interneta</string>
+
<string id="711">Internetni Protokol (IP)</string>
- <string id="712">Izbrana napaèna vrata.Vrednost mora biti med 1 in 65535.</string>
- <string id="713">HTTP Proxy</string>
- <string id="714">XLink Kai</string>
- <string id="715">Nastavitev</string>
- <string id="716">Samodejno(DHCP)</string>
- <string id="717">Roèno (Statièen)</string>
- <string id="718">Privzeto (Dashboard)</string>
- <string id="719">- IP Naslov</string>
- <string id="720">- maska podomrežja</string>
- <string id="721">- privzeti prehod</string>
- <string id="722">- DNS strežnik</string>
- <string id="723">Shrani in ponovno zaženi</string>
- <string id="724">Vnešen je bil napaèen naslov.Vrednosti morajo biti tipa AAA.BBB.CCC.DDD</string>
+ <string id="712">Izbrana napaÄna vrata. Vrednost mora biti med 1 in 65535.</string>
+ <string id="713">HTTP proxy</string>
+
+ <string id="715">- Nastavitev</string>
+ <string id="716">Samodejno (DHCP)</string>
+ <string id="717">RoÄno (StatiÄno)</string>
+
+ <string id="719">- IP naslov</string>
+ <string id="720">- Maska podomrežja</string>
+ <string id="721">- Privzeti prehod</string>
+ <string id="722">- DNS strežnik</string>
+ <string id="723">Shrani &amp; ponovno zaženi</string>
+ <string id="724">VneÅ¡en je bil napaÄen naslov. Vrednosti morajo biti oblike AAA.BBB.CCC.DDD</string>
<string id="725">z vrednostmi od 0 do 255.</string>
- <string id="726">Spremembe niso shranjene.Nadaljujem brez shranjevanja?</string>
- <string id="727">WEB strežnik</string>
- <string id="728">FTP strežnik</string>
- <string id="729">Internetni Èas</string>
- <string id="730">Vrata Web strežnika</string>
- <string id="731">Èasovni strežnik</string>
- <string id="732">Shrani in Uporabi</string>
- <string id="733">Geslo Web Strežnika</string>
- <string id="734">Ni prehoda</string>
- <string id="735">Nabor znakov</string>
- <string id="736">- stil</string>
- <string id="737">- barva</string>
+ <string id="726">Spremembe niso shranjene. Nadaljujem brez shranjevanja?</string>
+ <string id="727">Spletni strežnik</string>
+ <string id="728">FTP strežnik</string>
+
+ <string id="730">- Vrata</string>
+
+ <string id="732">Shrani &amp; uporabi</string>
+ <string id="733">- Geslo</string>
+ <string id="734">Brez</string>
+ <string id="735">- Nabor znakov</string>
+ <string id="736">- Stil</string>
+ <string id="737">- Barva</string>
<string id="738">Normalno</string>
<string id="739">Krepko</string>
- <string id="740">Poševno</string>
- <string id="741">Poševno ojaèano</string>
+ <string id="740">Poševno</string>
+ <string id="741">PoÅ¡evno ojaÄano</string>
<string id="742">Bela</string>
<string id="743">Rumena</string>
<string id="744">Datoteke</string>
- <string id="745">Ni skeniranih informacij za ta pogled</string>
- <string id="746">Preklopi na datoteèni pogled</string>
+ <string id="745">Ni preiskanih informacij za ta pogled</string>
+ <string id="746">IzkljuÄi naÄin knjižnice</string>
<string id="747">Napaka pri nalaganju slike</string>
- <string id="748">Uredi povezavo</string>
- <string id="749">Dodaj skupno rabo</string>
- <string id="750">Ali ste preprièani?</string>
- <string id="751">Odstranjujem skupno rabo</string>
- <string id="752">Uredi povezavo skupne rabe</string>
- <string id="753">Uredi ime skupne rabe</string>
- <string id="754">Dodaj Programsko bljižnico</string>
- <string id="755">Uredi Programsko pot</string>
- <string id="756">Uredi ime Programa</string>
+ <string id="748">Uredi pot</string>
+ <string id="749">Zrcali sliko</string>
+ <string id="750">Ali ste prepriÄani?</string>
+ <string id="751">Odstranjujem vir</string>
+
+ <string id="754">Dodaj bljižnico do programa</string>
+ <string id="755">Uredi pot programa</string>
+ <string id="756">Uredi ime programa</string>
<string id="757">Uredi globino poti</string>
- <string id="758">Odstranjujem povezavo do programa</string>
+
<string id="759">Pogled: Velik seznam</string>
<string id="760">Rumena</string>
<string id="761">Bela</string>
<string id="762">Modra</string>
<string id="763">Svetlo zelena</string>
<string id="764">Rumeno zelena</string>
- <string id="765">Cyan</string>
- <string id="766">Reserved</string>
- <string id="767">Reserved</string>
- <string id="768">Reserved</string>
- <string id="769">Reserved</string>
+ <string id="765">Turkizna</string>
+ <string id="766">Svetlo siva</string>
+ <string id="767">Siva</string>
+ <!-- strings 768 and 769 reserved for more subtitle colors -->
+
<string id="770">Napaka %i: skupna raba ni dostopna</string>
- <string id="771">- Samodejni Fatx omejevalec</string>
- <string id="772">Audio</string>
- <string id="773">Išèem</string>
- <string id="774">Mapa za predogled</string>
-
- <string id="998">XLink Kai</string>
- <string id="999">Igranje preko interneta</string>
- <string id="1000">Predogled ohranjevalnika </string>
- <string id="1001">Povezava ni mogoèa</string>
- <string id="1002">XBMC se ni mogel povezat na omrežno lokacijo</string>
- <string id="1003">Problem je lahko nastal zaradi nepovezanosti z omrežjem</string>
- <string id="1004">Bi želeli dodati vseeno?</string>
- <string id="1005">Vnesi ime za ta skupno rabo</string>
- <string id="1006">IP Naslov</string>
- <string id="1007">Dodaj omrežno lokacijo</string>
+
+ <string id="772">ZvoÄni izhod</string>
+ <string id="773">IÅ¡Äem</string>
+ <string id="774">Mapa za projekcijo slik</string>
+ <string id="775">Omrežna povezava</string>
+ <string id="776">- Ime brezžiÄnega omrežja (ESSID)</string>
+ <string id="777">- Geslo brezžiÄnega omrežja</string>
+ <string id="778">- Varnost brezžiÄnega omrežja</string>
+ <string id="779">Shrani in uveljavi nastavitve omrežne povezave</string>
+ <string id="780">Brez enkripcije</string>
+ <string id="781">WEP</string>
+ <string id="782">WPA</string>
+ <string id="783">WPA2</string>
+ <string id="784">Uveljavljam nastavitve omrežne povezave. Prosim poÄakajte trenutek.</string>
+ <string id="785">Omrežna povezava se je uspešno zagnala.</string>
+ <string id="786">Omrežne povezave ni bilo mogoÄe zagnati.</string>
+ <string id="787">Povezava je onemogoÄena</string>
+ <string id="788">Omrežna povezava se je uspeÅ¡no izkljuÄila.</string>
+ <string id="789">Ime brezžiÄnega omrežja (ESSID)</string>
+
+ <string id="791">Dovoli programom na tem sistemu, da upravljajo z XBMC</string>
+ <string id="792">Vrata</string>
+ <string id="793">ObmoÄje vrat</string>
+ <string id="794">Dovoli programom na drugih sistemih, da upravljajo z XBMC</string>
+ <string id="795">Osnovni zamik (ms)</string>
+ <string id="796">Nadaljevalni zamik (ms)</string>
+ <string id="797">NajveÄje Å¡tevilo povezav</string>
+ <string id="798">Internetni dostop</string>
+
+ <string id="850">Vnešena je nepravilna številka vrat</string>
+ <string id="851">Veljavno obmoÄje vrat je 1-65535</string>
+ <string id="852">Veljavno obmoÄje vrat je 1024-65535</string>
+
+ <string id="998">Dodaj glasbo...</string>
+ <string id="999">Dodaj video...</string>
+ <string id="1000">- Predogled</string>
+ <string id="1001">Povezava ni mogoÄa</string>
+ <string id="1002">XBMC se ni mogel povezati na omrežno lokacijo.</string>
+ <string id="1003">Problem je lahko nastal zaradi nepovezanosti z omrežjem.</string>
+ <string id="1004">Želite vseeno dodati vsebino?</string>
+
+ <string id="1006">IP naslov</string>
+ <string id="1007">Dodaj omrežno lokacijo</string>
<string id="1008">Protokol</string>
- <string id="1009">Naslov strežnika</string>
- <string id="1010">Ime strežnika</string>
- <string id="1011">Oddaljena povezava</string>
+ <string id="1009">Naslov strežnika</string>
+ <string id="1010">Ime strežnika</string>
+ <string id="1011">Oddaljena pot</string>
<string id="1012">Mapa skupne rabe</string>
<string id="1013">Vrata</string>
- <string id="1014">Uporabniško ime</string>
- <string id="1015">Omrežni strežnik</string>
- <string id="1016">Vnesi mrežni naslov strežnika</string>
- <string id="1017">Vnesi pot do strežnika</string>
- <string id="1018">Vnesi številko vrat</string>
- <string id="1019">Vnesi uporabniško ime</string>
+ <string id="1014">Uporabniško ime</string>
+ <string id="1015">Prebrskaj za omrežni strežnik</string>
+ <string id="1016">Vnesite omrežni naslov strežnika</string>
+ <string id="1017">Vnesite pot do strežnika</string>
+ <string id="1018">Vnesite Å¡tevilko vrat</string>
+ <string id="1019">Vnesite uporabniško ime</string>
<string id="1020">Dodaj %s izvor</string>
- <string id="1021">Vnesi poti ali prebrskaj za lokacijo medija</string>
- <string id="1022">Vnesi ime za ta izvor</string>
+ <string id="1021">Vnesi poti ali prebrskaj za lokacijo medija.</string>
+ <string id="1022">Vnesi ime za ta izvor.</string>
<string id="1023">Prebrskaj za novo skupno rabo</string>
<string id="1024">Prebrskaj</string>
- <string id="1025">Ne morem priklicati informacij o mapi</string>
+ <string id="1025">Ne morem priklicati informacij o mapi.</string>
<string id="1026">Dodaj izvor</string>
<string id="1027">Uredi izvor</string>
<string id="1028">Uredi %s izvor</string>
- <string id="1029">Vnesi novo ime</string>
- <string id="1030">sliko</string>
- <string id="1031">slikovno mapo</string>
- <string id="1032">Dodaj mrežno lokacijo...</string>
+ <string id="1029">Vnesi novo oznako</string>
+ <string id="1030">Prebrskaj za sliko</string>
+ <string id="1031">Prebrskaj za mapo slik</string>
+ <string id="1032">Dodaj omrežno lokacijo...</string>
<string id="1033">Prebrskaj za datoteko</string>
<string id="1034">Podmenu</string>
- <string id="1035">Vkljuèi podmenu gumbe</string>
+ <string id="1035">VkljuÄi gumbe podmenuja</string>
<string id="1036">Priljubljene</string>
- <string id="1037">Video vstavki</string>
- <string id="1038">Glasba vstavki</string>
- <string id="1039">Slike vstavki</string>
+ <string id="1037">Video dodatki</string>
+ <string id="1038">Glasbeni dodatki</string>
+ <string id="1039">Slikovni dodatki</string>
<string id="1040">Nalagam mapo</string>
- <string id="1041">Retrieved %i items</string>
- <string id="1042">Retrieved %i of %i items</string>
- <string id="1043">Programi vstavki</string>
- <string id="1044">Nastavi slièico vstavku</string>
- <string id="1045">Nastavitve vstavka</string>
+ <string id="1041">Prenešenih %i elementov</string>
+ <string id="1042">Prenešenih %i od %i elementov</string>
+ <string id="1043">Programski dodatki</string>
+ <string id="1044">Nastavi sliÄico dodatku</string>
+ <string id="1045">Nastavitve dodatka</string>
+ <string id="1046">Dostopne toÄke</string>
+ <string id="1047">Drugo...</string>
+ <string id="1048">- Uporabniško ime</string>
+ <string id="1049">Nastavitve skripte</string>
+ <string id="1050">Singli</string>
+ <string id="1051">Vnesite spletni naslov</string>
<string id="1200">SMB odjemalec</string>
<string id="1202">Delovna skupina</string>
- <string id="1203">Privzeto uporabniško ime</string>
+ <string id="1203">Privzeto uporabniško ime</string>
<string id="1204">Privzeto geslo</string>
- <string id="1207">WINS strežnik</string>
+ <string id="1207">WINS strežnik</string>
+ <string id="1208">Odpri SMB skupno rabo</string>
<string id="1210">Odstrani</string>
<string id="1211">Glasba</string>
<string id="1212">Video</string>
<string id="1213">Slike</string>
<string id="1214">Datoteke</string>
- <string id="1215">Glasba in video</string>
- <string id="1216">Glasba in slike</string>
- <string id="1217">Glasba in datoteke</string>
- <string id="1218">Video in slike</string>
- <string id="1219">Video in datoteke</string>
- <string id="1220">Slike in datoteke</string>
- <string id="1221">Glasba, video in slike</string>
- <string id="1222">Glasba, video, slike in datoteke</string>
- <string id="1223">Izkljuèeno</string>
- <string id="1226">Datoteke, glasba in video</string>
- <string id="1227">Datoteke, slike in glasba</string>
- <string id="1228">Datoteke, slike in video</string>
- <string id="1229">Glasba in programi</string>
- <string id="1230">Video in programi</string>
- <string id="1231">Slike in programi</string>
- <string id="1232">Glasba, video, slike in programi</string>
- <string id="1233">Programi, video in glasba</string>
- <string id="1234">Programi, slike in glasba</string>
- <string id="1235">Programi, slike in Video</string>
-
- <string id="1245">FTP uporabniško ime</string>
- <string id="1246">FTP uporabniško geslo</string>
- <string id="1247">Uprabniško geslo je uspešno nastavljeno</string>
-
- <string id="1250">Xbox povezava</string>
- <string id="1251">Samodejno zaznaj XBOX</string>
+ <string id="1215">Glasba &amp; video</string>
+ <string id="1216">Glasba &amp; slike</string>
+ <string id="1217">Glasba &amp; datoteke</string>
+ <string id="1218">Video &amp; slike</string>
+ <string id="1219">Video &amp; datoteke</string>
+ <string id="1220">Slike &amp; datoteke</string>
+ <string id="1221">Glasba, video &amp; slike</string>
+ <string id="1222">Glasba, video, slike &amp; datoteke</string>
+ <string id="1223">IzkljuÄeno</string>
+ <string id="1226">Datoteke, glasba &amp; video</string>
+ <string id="1227">Datoteke, slike &amp; glasba</string>
+ <string id="1228">Datoteke, slike &amp; video</string>
+ <string id="1229">Glasba &amp; programi</string>
+ <string id="1230">Video &amp; programi</string>
+ <string id="1231">Slike &amp; programi</string>
+ <string id="1232">Glasba, video, slike &amp; programi</string>
+ <string id="1233">Programi, video &amp; glasba</string>
+ <string id="1234">Programi, slike &amp; glasba</string>
+ <string id="1235">Programi, slike &amp; video</string>
+
+ <string id="1250">Samodejna zaznava</string>
+ <string id="1251">Samodejno zaznaj sistem</string>
<string id="1252">Vzdevek</string>
- <string id="1253">Kreiraj FTP povezavo v Mojih datotekah</string>
- <string id="1254">Vprašaj za povezavo</string>
- <string id="1255">Pošlji FTP uporabniško ime in geslo</string>
- <string id="1256">Ping Interval</string>
- <string id="1257">Povežem z samodejno zaznanim Xbox-om?</string>
- <string id="1396">Drifting</string>
+ <string id="1254">Vprašaj za povezavo</string>
+ <string id="1255">Pošlji FTP uporabniško ime in geslo</string>
+ <string id="1256">Ping interval</string>
+ <string id="1257">Povežem z samodejno zaznanim sistemom?</string>
+
+ <string id="1260">Oznani storitve drugim sistemom preko Zeroconf</string>
+
+ <string id="1300">Poljubna zvoÄna naprava</string>
+ <string id="1301">Poljubna naprava za preusmeritev zvoka</string>
+
+ <string id="1396">zameti</string>
<string id="1397">in</string>
- <string id="1398">Zmrzovanje</string>
- <string id="1399">Pozno</string>
- <string id="1400">Izolirano</string>
- <string id="1401">Nevihte</string>
- <string id="1402">Grom</string>
- <string id="1403">Sonèno</string>
- <string id="1404">Težko</string>
+ <string id="1398">zmrzovanje</string>
+ <string id="1399">pozne</string>
+ <string id="1400">izolirane</string>
+ <string id="1401">nevihte</string>
+ <string id="1402">grom</string>
+ <string id="1403">sonÄno</string>
+ <string id="1404">moÄan</string>
<string id="1405">v</string>
- <string id="1406">the</string>
- <string id="1407">Vicinity</string>
- <string id="1408">Led</string>
- <string id="1409">Kristali</string>
- <string id="1410">Hladno</string>
+ <string id="1406"></string>
+ <string id="1407">bližini</string>
+ <string id="1408">led</string>
+ <string id="1409">kristali</string>
+ <string id="1410">mirno</string>
<string id="1411">z</string>
<string id="1412">vetrovno</string>
- <string id="1413">drizzle</string>
- <string id="1414">T-Storm</string>
+ <string id="1413">pršenje</string>
+ <string id="1414">nevihta</string>
+ <string id="1415">pršenje</string>
+ <string id="1416">megleno</string>
+ <string id="1417">toÄa</string>
+ <string id="1418">nevihte</string>
+ <string id="1419">plohe</string>
+ <string id="1420">zmerno</string>
+ <string id="1421">zelo visoko</string>
+ <string id="1422">vetrovno</string>
+ <string id="1423">meglice</string>
<!-- strings through to 1450 reserved for weather translation -->
- <string id="2050">Èas delovanja:</string>
+ <string id="1450">Postavi zaslon v pripravljenost, ko ni dejaven</string>
+ <!-- strings through to 1470 reserved for power-saving -->
- <string id="4501">Tip LCD zaslona</string>
+ <string id="2050">ÄŒas delovanja</string>
+
+ <string id="2100">Napaka v skripti! : %s</string>
+ <string id="2101">Potrebna je nova razliÄica - Glej zapisnik</string>
+
+ <string id="4501">VkljuÄi LCD/VFD</string>
<string id="10000">Domov</string>
<string id="10001">Programi</string>
@@ -754,81 +858,70 @@
<string id="10003">Datoteke</string>
<string id="10004">Nastavitve</string>
<string id="10005">Glasba</string>
- <string id="10006">Videi</string>
+ <string id="10006">Video</string>
<string id="10007">Sistemske informacije</string>
- <string id="10008">Nastavitve-&gt;Splošno</string>
- <string id="10009">Nastavitve-&gt;Zaslon</string>
- <string id="10010">Nastavitve-&gt;Izgled&gt;GUI Kalibracija</string>
- <string id="10011">Nastavitve-&gt;Videi-&gt;Kalibracija zaslona</string>
- <string id="10012">Nastavitve-&gt;Slike</string>
- <string id="10013">Nastavitve-&gt;Programi</string>
- <string id="10014">Nastavitve-&gt;Vreme</string>
- <string id="10015">Nastavitve-&gt;Glasba</string>
- <string id="10016">Nastavitve-&gt;Sistem</string>
- <string id="10017">Nastavitve-&gt;Videi</string>
- <string id="10018">Nastavitve-&gt;Omrežje</string>
- <string id="10019">Nastavitve-&gt;Izgled</string>
+ <string id="10008">Nastavitve - Splošno</string>
+ <string id="10009">Nastavitve - Zaslon</string>
+ <string id="10010">Nastavitve - Izgled - Prilagajanje GUI</string>
+ <string id="10011">Nastavitve - Video - Prilagajanje zaslona</string>
+ <string id="10012">Nastavitve - Slike</string>
+ <string id="10013">Nastavitve - Programi</string>
+ <string id="10014">Nastavitve - Vreme</string>
+ <string id="10015">Nastavitve - Glasba</string>
+ <string id="10016">Nastavitve - Sistem</string>
+ <string id="10017">Nastavitve - Video</string>
+ <string id="10018">Nastavitve - Omrežje</string>
+ <string id="10019">Nastavitve - Izgled</string>
<string id="10020">Skripte</string>
- <string id="10021">Videi/Žanri</string>
- <string id="10022">Videi/Igralci</string>
- <string id="10023">Videi/Leta</string>
- <string id="10025">Videi/Naslovi</string>
- <string id="10028">Videi/Predvajalni seznam</string>
- <string id="10034">Nastavitve-&gt;Profili</string>
+ <string id="10021">Spletni brskalnik</string>
+
+ <string id="10028">Video/Predvajalni seznam</string>
+ <string id="10034">Nastavitve - Profili</string>
<string id="10100">Da/Ne dialog</string>
- <string id="10101">Dialog napredka dialog</string>
+ <string id="10101">Dialog napredka</string>
+
+ <string id="10210">IÅ¡Äem podnapise...</string>
+ <string id="10211">IÅ¡Äem ali zaÄasno shranjujem podnapise...</string>
+ <string id="10212">konÄujem</string>
+ <string id="10213">medpomnenje</string>
+ <string id="10214">Odpiram pretok</string>
<string id="10500">Glasba/Predvajalni seznam</string>
<string id="10501">Glasba/Datoteke</string>
- <string id="10502">Glasba/Knjižnica</string>
- <string id="10503">Glasba/100 najboljših</string>
- <string id="10504">100 najboljših skladb</string>
- <string id="10505">100 najboljših albumov</string>
+ <string id="10502">Glasba/Knjižnica</string>
+ <string id="10503">Urejevalnik predvajalnega seznama</string>
+ <string id="10504">Top 100 pesmi</string>
+ <string id="10505">Top 100 albumov</string>
<string id="10506">Programi</string>
- <string id="10507">Konfiguracija</string>
+ <string id="10507">Nastavitve</string>
<string id="10508">Vremenska napoved</string>
- <string id="10509">Mrežno igranje</string>
- <string id="10510">Ekstenzije</string>
+ <string id="10509">Omrežno igranje</string>
+ <string id="10510">Razširitve</string>
<string id="10511">Sistemske informacije</string>
- <string id="10512">Glasba - Albumi</string>
- <string id="10513">Glasba- Izvajalci</string>
- <string id="10514">Glasba - Žanri</string>
- <string id="10515">Glasba - 100 najbolših</string>
- <string id="10516">Glasba - Knjižnica</string>
- <string id="10517">Glasba - Predvajam</string>
- <string id="10518">Videi - Igralci</string>
- <string id="10519">Videi - Žanri</string>
- <string id="10520">Videi- Naslov</string>
- <string id="10521">Videi - Leto</string>
- <string id="10522">Videi - Predvajam</string>
- <string id="10523">Album Info.</string>
- <string id="10524">Film Info.</string>
-
- <string id="12000">Izberi dialog</string>
- <string id="12001">Glasba/info.</string>
- <string id="12002">Potrdi Dialog</string>
- <string id="12003">Videi/Info.</string>
- <string id="12004">Skripte/Info.</string>
- <string id="12005">Celozaslonski Video</string>
- <string id="12006">Audio vizualizacija</string>
- <string id="12007">Slike/predogled slik</string>
- <string id="12008">Filestacking dialog</string>
- <string id="12009">Ponovna gradnja index-ov...</string>
- <string id="12010">Vrni se na Glasbo</string>
- <string id="12011">Vrni se na Videi</string>
- <string id="12012">Nadgradi Trainer listo</string>
- <string id="12013">Trainer</string>
- <string id="12014">Trainerjev ni moè najti</string>
- <string id="12015">Nastavitve Trainerjev</string>
- <string id="12016">Vsi registrirani Treinerji manjkajo.Nadgradi listo</string>
- <string id="12017">Samodejno zaženi iz zadnje znane pozicije</string>
- <string id="12018">Ne</string>
- <string id="12019">Da</string>
- <string id="12020">Vprašaj</string>
- <string id="12021">Zaèni na zaèetku</string>
- <string id="12022">Zaèni iz zadnje znane pozicije</string>
- <string id="12023">Potrjujem obstojeèe trenerje...</string>
+
+ <string id="10516">Glasba - Knjižnica</string>
+ <string id="10517">Trenutno predvajam - Glasba</string>
+
+ <string id="10522">Trenutno predvajam - Video</string>
+ <string id="10523">Informacije o albumu</string>
+ <string id="10524">Informacije o filmu</string>
+
+ <string id="12000">Izberi</string>
+ <string id="12001">Glasba/Informacije</string>
+ <string id="12002">Potrdi</string>
+ <string id="12003">Video/Informacije</string>
+ <string id="12004">Skripte/Informacije</string>
+ <string id="12005">Celozaslonska slika</string>
+ <string id="12006">Vizualizacija glasbe</string>
+
+ <string id="12008">Združevanje datotek v skupine</string>
+ <string id="12009">Ponovno indeksiranje...</string>
+ <string id="12010">Vrni se na glasbeni pogled</string>
+ <string id="12011">Vrni se na video pogled</string>
+
+ <string id="12021">ZaÄni na zaÄetku</string>
+ <string id="12022">ZaÄni na %s</string>
<string id="12310">0</string>
<string id="12311">1</string>
@@ -841,523 +934,563 @@
<string id="12318">8</string>
<string id="12319">9</string>
<string id="12320">c</string>
- <string id="12321">Potrdi</string>
+ <string id="12321">Ok</string>
<string id="12322">*</string>
- <string id="12325">Zaklenjeno!Vnesi pravilno geslo...</string>
+ <string id="12325">Zaklenjeno! Vnesi geslo...</string>
<string id="12326">Vnesi geslo</string>
- <string id="12327">Vnesi administratorsko geslo</string>
- <string id="12328">Vnesi kodo za odklep</string>
+ <string id="12327">Vnesi glavno geslo</string>
+ <string id="12328">Vnesi geslo za odklep</string>
<string id="12329">ali pritisni C za izhod</string>
- <string id="12330">Pritisni kombinacijo tipk na plošèku in pritisni Start</string>
- <string id="12331">pritisni Start ali Back na plošèku za izhod</string>
- <string id="12332">Nastavi zašèito</string>
- <string id="12333">Odkleni zašèito</string>
- <string id="12334">Resetiraj zašèito</string>
- <string id="12335">Odstrani zašèito</string>
- <string id="12337">Numerièno geslo</string>
- <string id="12338">Kombinacija tipk na plošèku</string>
+ <string id="12330">Pritisni kombinacijo tipk na ploÅ¡Äku in</string>
+ <string id="12331">pritisni OK ali Nazaj za prekinitev</string>
+ <string id="12332">Nastavi zaÅ¡Äito</string>
+ <string id="12333">Odkleni</string>
+ <string id="12334">Resetiraj zaÅ¡Äito</string>
+ <string id="12335">Odstrani zaÅ¡Äito</string>
+ <string id="12337">Å tevilÄno geslo</string>
+ <string id="12338">Kombinacija tipk na ploÅ¡Äku</string>
<string id="12339">Celotno geslo</string>
<string id="12340">Vnesi novo geslo</string>
<string id="12341">Ponovno vnesi novo geslo</string>
- <string id="12342">Geslo je napaèno,</string>
- <string id="12343">ponovnih poizkusov</string>
- <string id="12344">Vnešeno geslo se ne ujema</string>
- <string id="12345">Vstop prepovedan</string>
- <string id="12346">Število ponovnih vnosov gesla je preseženo</string>
- <string id="12347">XBOX se bo sedaj ugasnila.</string>
+ <string id="12342">Geslo je napaÄno,</string>
+ <string id="12343">ponovnih poizkusov </string>
+ <string id="12344">Vnešeni gesli se ne ujemata.</string>
+ <string id="12345">Dostop zavrnjen</string>
+ <string id="12346">Število ponovnih vnosov gesla je preseženo.</string>
+ <string id="12347">Sistem se bo sedaj izkljuÄil.</string>
<string id="12348">Predmet zaklenjen</string>
- <string id="12353">Ponovno aktiviraj kljuèavnico</string>
- <string id="12356">Zamenjaj geslo</string>
- <string id="12357">Share geslo</string>
- <string id="12358">Vnos je prazen.Poizkusi ponovno</string>
- <string id="12360">Admin koda</string>
- <string id="12362">Ugasni konzolo èe je število dovoljenih poizkusov èez mejo</string>
- <string id="12367">Admin geslo ni veljaveno!</string>
- <string id="12368">Prosim vnesite pravileno Admin geslo!</string>
- <string id="12373">Nastavitve in Moji Dokumenti</string>
+ <string id="12353">Ponovno aktiviraj zaÅ¡Äito</string>
+ <string id="12356">Spremeni zaÅ¡Äito</string>
+ <string id="12357">Vir zaÅ¡Äite</string>
+ <string id="12358">Vnos je prazen. Poskusi znova</string>
+ <string id="12360">Glavno geslo</string>
+ <string id="12362">Ugasni sistem, Äe se preseže Å¡tevilo ponovnih vnosov</string>
+ <string id="12367">Glavno geslo ni veljavno</string>
+ <string id="12368">Prosim vnesite pravilno glavno geslo</string>
+ <string id="12373">Nastavitve &amp; moje datoteke</string>
<string id="12376">Nastavi kot privzeto za vse filme</string>
- <string id="12377">To dejanje bo zbrisalo vse prejšnje posnete podatke</string>
- <string id="12378">Prikaži vsako sliko za</string>
- <string id="12379">Uporabi PAN in ZOOM efekt</string>
- <string id="12380">Predvajaj NTSC v PAL</string>
- <string id="12381">Predvajaj PAL v NTSC</string>
- <string id="12382">Predvajaj NTSC v PAL60</string>
- <string id="12383">12 urni èasovni prikaz</string>
- <string id="12384">24 urni èasovni prikaz</string>
+ <string id="12377">To dejanje bo razveljavilo vse prejšnje nastavitve</string>
+ <string id="12378">ÄŒas prikaza vsake slike</string>
+ <string id="12379">Uporabi pan in zoom efekt</string>
+
+ <string id="12383">12 urni Äasovni prikaz</string>
+ <string id="12384">24 urni Äasovni prikaz</string>
<string id="12385">Dan/Mesec</string>
<string id="12386">Mesec/Dan</string>
- <string id="12387">Preišèi podatkovno bazo</string>
- <string id="12390">Sistemski èas delovanja</string>
+
+ <string id="12390">ÄŒas delovanja sistema</string>
<string id="12391">Minute</string>
<string id="12392">Ure</string>
<string id="12393">Dnevi</string>
- <string id="12394">Skupni èas delovanja</string>
+ <string id="12394">Skupni Äas delovanja</string>
<string id="12600">Vreme</string>
- <string id="12900">Ohranjevalnik</string>
+ <string id="12900">Ohranjevalnik zaslona</string>
<string id="12901">Celozaslonski OSD</string>
<string id="13000">Sistem</string>
- <string id="13001">Takojšnja ustavitev trdega diska</string>
- <string id="13002">Samo video</string>
+ <string id="13001">Takojšnja ustavitev trdega diska</string>
+ <string id="13002">Samo slika</string>
<string id="13003">- Zakasnitev</string>
- <string id="13004">- Minimalen datoteèni èas</string>
+ <string id="13004">- Najkrajše trajanje datoteke</string>
<string id="13005">Ugasni</string>
- <string id="13006">Dashboard</string>
- <string id="13007">Uporabi svojo pot do MSDash</string>
+
+ <string id="13008">Funkcija ugašanja</string>
+ <string id="13009">Izhod</string>
+ <string id="13010">Zaustavi</string>
+ <string id="13011">V pripravljenost</string>
+ <string id="13012">Izhod</string>
+ <string id="13013">Ponovni zagon</string>
+ <string id="13014">Pomanjšaj</string>
+ <string id="13015">Ukaz gumba za izklop</string>
+ <string id="13016">IzkljuÄi sistem</string>
+
+ <string id="13020">Je druga seja aktivna, ssh?</string>
+ <string id="13021">PrikljuÄen zunanji trdi disk</string>
+ <string id="13022">Nepravilna odstranitev naprave</string>
+ <string id="13023">Naprava je uspeÅ¡no izkljuÄena</string>
+ <string id="13024">VkljuÄena igralna palica</string>
+ <string id="13025">IzkljuÄena igralna palica</string>
+
+ <string id="13050">Nivo baterije je nizek</string>
<string id="13100">Filter proti utripanju</string>
+ <string id="13101">Izbere gonilnik (zahteva ponovni zagon)</string>
<string id="13105">Vertikalna sinhronizacija</string>
- <string id="13106">Onemogoèeno</string>
- <string id="13107">Vkljuèeno med predvajanjem videa</string>
- <string id="13108">Vedno vkljuèeno</string>
-
- <string id="13150">HDD geslo:</string>
- <string id="13151">HDD temperatura:</string>
- <string id="13152">DVD model:</string>
- <string id="13153">DVD frmware:</string>
- <string id="13154">HDD model:</string>
- <string id="13155">HDD serijska:</string>
- <string id="13156">HDD firmware:</string>
- <string id="13157">HDD geslo:</string>
- <string id="13158">HDD stanje :</string>
- <string id="13159">Maska podomrežja:</string>
- <string id="13160">Prehod:</string>
- <string id="13161">Primarni DNS</string>
- <string id="13162">Neuspešna inicializacija</string>
+ <string id="13106">OnemogoÄeno</string>
+ <string id="13107">VkljuÄeno med predvajanjem videa</string>
+ <string id="13108">Vedno vkljuÄeno</string>
+ <string id="13109">Preveri &amp; uveljavi loÄljivost</string>
+ <string id="13110">Shrani loÄljivost?</string>
+ <string id="13111">Ali želiÅ¡ obdržati loÄljivost?</string>
- <string id="13163">Plošèki na vratih:</string>
- <string id="13164">Tipkovnica na vratih:</string>
- <string id="13165">Miška na vratih:</string>
- <string id="13166">Slušalke z mikrofonom na vratih:</string>
- <string id="13167">Spominska kartica na vratih:</string>
- <string id="13168">IR-Daljinec na vratih:</string>
- <string id="13169">Preskoèi Cd izbor</string>
+ <string id="13112">ZviÅ¡evanje loÄljivosti visoke kvalitete</string>
+ <string id="13113">OnemogoÄeno</string>
+ <string id="13114">VkljuÄeno za SD vsebine</string>
+ <string id="13115">Vedno vkljuÄeno</string>
+ <string id="13116">NaÄin zviÅ¡evanja loÄljivosti</string>
+ <string id="13117">Bicubic</string>
+ <string id="13118">Lanczos</string>
+ <string id="13119">Sinc</string>
+ <string id="13120">VDPAU</string>
+ <string id="13121">VDPAU HQ nivo zviÅ¡evanja loÄljivosti</string>
+ <string id="13122">VDPAU studijska pretvorba barv</string>
+
+ <string id="13130">IzkljuÄi ostale zaslone</string>
+ <string id="13131">OnemogoÄeno</string>
+ <string id="13132">IzkljuÄi zaslone</string>
+
+ <string id="13140">Zaznane so aktivne povezave!</string>
+ <string id="13141">ÄŒe nadaljujete, mogoÄe ne boste veÄ mogli upravljati z XBMC</string>
+ <string id="13142">. Ste prepriÄani, da želite ustaviti strežnik Dogodkov?</string>
+
+ <string id="13144">Spremeni naÄin Apple Remote?</string>
+ <string id="13145">ÄŒe trenutno uporabljate Apple Remote za upravljanje</string>
+ <string id="13146">XBMC, lahko spremeba teh nastavitev vpliva na zmožnost</string>
+ <string id="13147">nadaljnega upravljanja. Želite nadaljevati?</string>
+
+ <string id="13159">Maska podomrežja:</string>
+ <string id="13160">Prehod:</string>
+ <string id="13161">Primarni DNS</string>
+ <string id="13162">Neuspešna inicializacija</string>
<string id="13170">Nikoli</string>
<string id="13171">Takoj</string>
- <string id="13172">Èez %i sek</string>
- <string id="13173">Datum priklopa diska:</string>
- <string id="13174">Števec ciklov diska:</string>
+ <string id="13172">ÄŒez %i sek</string>
+ <string id="13173">HDD datum namestitve:</string>
+ <string id="13174">HDD Å¡tevec vrtljajev:</string>
<string id="13200">Profili</string>
- <string id="13201">Izbriši profil '%s'?</string>
- <string id="13204">Zadnji naložen profil:</string>
+ <string id="13201">Izbriši profil '%s'?</string>
+ <string id="13204">Zadnji naložen profil:</string>
<string id="13205">Neznano</string>
- <string id="13206">Prepiši</string>
- <string id="13208">Alarm ura</string>
- <string id="13209">Alarm ura interval (v minutah)</string>
+ <string id="13206">Prepiši</string>
+ <string id="13208">Budilka</string>
+ <string id="13209">Interval budilke (v minutah)</string>
<string id="13210">Zagon, alarm v %im</string>
<string id="13211">Alarm!</string>
- <string id="13212">Odpovedano z %im%is </string>
+ <string id="13212">Odpovedano s preostalimi %im%is</string>
+ <string id="13213">%2.0fm</string> <!--minutes (left from countdown)-->
+ <string id="13214">%2.0fs</string> <!--seconds (left from countdown)-->
- <string id="13249">Poišèi podnapise v RAR datotekah</string>
+ <string id="13249">PoiÅ¡Äi podnapise v RAR datotekah</string>
<string id="13250">Prebrskaj za podnapise...</string>
<string id="13251">Premakni predmet</string>
<string id="13252">Premakni predmet sem</string>
- <string id="13253">Preklièi Premik</string>
+ <string id="13253">PrekliÄi premik</string>
<string id="13270">Strojna oprema:</string>
- <string id="13271">CPU hitrost:</string>
+ <string id="13271">Zasedenost CPU:</string>
- <string id="13274">Konzola je povezana, vendar DNS ni na voljo.</string>
+ <string id="13274">Povezava je vzpostavljena, vendar DNS ni na voljo.</string>
<string id="13275">Trdi disk</string>
- <string id="13276">DVD-Enota</string>
+ <string id="13276">DVD-ROM</string>
<string id="13277">Shramba</string>
<string id="13278">Privzeto</string>
- <string id="13279">Omrežje</string>
+ <string id="13279">Omrežje</string>
<string id="13280">Video</string>
<string id="13281">Strojna oprema</string>
- <string id="13282">_</string>
- <string id="13283">Verzija Kernela:</string>
- <string id="13284">CPU Hitrost:</string>
- <string id="13285">Zaznan BIOS:</string>
- <string id="13286">Video Enkoder:</string>
- <string id="13287">Resolucija zaslona:</string>
- <string id="13288">XBOX Verzija:</string>
- <string id="13289">XBOX Serijska št.:</string>
- <string id="13290">XBOX Proizvajalec:</string>
- <string id="13291">ModÈip:</string>
+
+ <string id="13283">Operacijski sistem:</string>
+ <string id="13284">Hitrost CPU:</string>
+
+ <string id="13286">Video enkoder:</string>
+ <string id="13287">LoÄljivost zaslona:</string>
+
<string id="13292">A/V kabel:</string>
- <string id="13293">Video in XBE Regija:</string>
- <string id="13294">DVD Regija:</string>
+
+ <string id="13294">DVD regija:</string>
<string id="13295">Internet:</string>
- <string id="13296">Xbox je povezan</string>
- <string id="13297">Xbox ni povezan.Preveri mrežne nastavitve.</string>
- <string id="13298">XBLIVE geslo:</string>
- <string id="13299">Željena temperatura</string>
+ <string id="13296">Povezava je vzpostavljena</string>
+ <string id="13297">Povezava ni vzpostavljena. Preverite omrežne nastavitve.</string>
+
+ <string id="13299">Željena temperatura</string>
<string id="13300">Hitrost ventilatorja</string>
<string id="13301">Samodejna kontrola temperature</string>
- <string id="13302">Roèna nastavitev hitrosti ventilatorja</string>
- <string id="13303">Izgled pisav</string>
- <string id="13304">Vkljuèi Flipping Bi-Directional Strings</string>
- <string id="13305">Uporabi RSS novice</string>
- <string id="13306">Skrij ostale datoteke v mapi</string>
- <string id="13307">Naèin poimenovanja pesmi</string>
- <string id="13308">Želiš ponovno zagnati XBOX</string>
+ <string id="13302">RoÄna nastavitev hitrosti ventilatorja</string>
+ <string id="13303">- Pisave</string>
+ <string id="13304">VkljuÄi flipping bi-directional strings</string>
+ <string id="13305">Prikaži RSS</string>
+ <string id="13306">Prikaži datoteke v starševski mapi</string>
+ <string id="13307">NaÄin poimenovanja pesmi</string>
+ <string id="13308">Želite ponovno zagnati sistem</string>
<string id="13309">namesto samo XBMC?</string>
- <string id="13310">Zoom efekt</string>
+ <string id="13310">Efekt poveÄave</string>
<string id="13311">Efekt lebdenja</string>
- <string id="13312">Odprava èrnih robov</string>
- <string id="13313">Ponovno zaženi</string>
- <string id="13314">Navzkrižni prehod</string>
- <string id="13315">Regeneriraj slike</string>
- <string id="13316">Recurzivne slike</string>
- <string id="13317">Poglej prezentacijo</string>
- <string id="13318">Recurzivna prezentacija</string>
- <string id="13319">Nakljuèno</string>
+ <string id="13312">Odprava Ärnih robov</string>
+ <string id="13313">Ponovno zaženi</string>
+ <string id="13314">Navzkrižni prehod</string>
+ <string id="13315">Regeneriraj sliÄice</string>
+ <string id="13316">Rekurzivne sliÄice</string>
+ <string id="13317">Poglej projekcijo slik</string>
+ <string id="13318">Rekurzivna projekcija slik</string>
+ <string id="13319">NakljuÄno</string>
<string id="13320">Stereo</string>
- <string id="13321">Samo Levo</string>
- <string id="13322">Samo Desno</string>
- <string id="13323">Vkljuèi CD+G</string>
+ <string id="13321">Samo levo</string>
+ <string id="13322">Samo desno</string>
+ <string id="13323">VkljuÄi podporo za karaoke</string>
<string id="13324">Transparentno ozadje</string>
<string id="13325">Transparentno ospredje</string>
<string id="13326">A/V zamik</string>
<string id="13327">Karaoke</string>
<string id="13328">%s ni najden</string>
<string id="13329">Napaka pri odpiranju %s</string>
- <string id="13330">Ne morem naložiti %s</string>
- <string id="13331">NAPAKA: izven obsega spomina</string>
+ <string id="13330">Ne morem naložiti %s</string>
+ <string id="13331">Napaka: Ni dovolj spomina</string>
<string id="13332">Premakni navzgor</string>
<string id="13333">Premakni navzdol</string>
<string id="13334">Uredi oznako</string>
<string id="13335">Napravi privzeto</string>
<string id="13336">Tipka odstrani</string>
- <string id="13338">Sprednja LED</string>
- <string id="13339">Barva sprednje LED</string>
- <string id="13340">Privzeto</string>
+
+ <string id="13340">Pusti kot je</string>
<string id="13341">Zelena</string>
- <string id="13342">Oranžna</string>
- <string id="13343">Rdeèa</string>
- <string id="13344">Kroženje</string>
+ <string id="13342">Oranžna</string>
+ <string id="13343">RdeÄa</string>
+ <string id="13344">Kroženje</string>
<string id="13345">Ugasni LED med predvajanjem</string>
<string id="13346">Informacije o filmu</string>
- <string id="13347">Poizvedba o predmetu</string>
- <string id="13348">Preišèi IMDb...</string>
- <string id="13349">Napravi poizvedbo za vse datoteke</string>
- <string id="13350">Sedaj predvajam...</string>
+ <string id="13347">Postavi v vrsto</string>
+ <string id="13348">PreiÅ¡Äi IMDb...</string>
+ <string id="13349">IÅ¡Äi za nove vsebine</string>
+ <string id="13350">Trenutno predvajam...</string>
<string id="13351">Informacije o albumu</string>
- <string id="13352">Skeniraj vse v bazo</string>
- <string id="13353">Ustavi skeniranje</string>
+ <string id="13352">Dodaj predmet v bazo</string>
+ <string id="13353">Ustavi iskanje</string>
<string id="13354">Metoda izrisa</string>
- <string id="13355">Nizko kvalitetno senèenje</string>
- <string id="13356">Strojni Overlay</string>
- <string id="13357">Visoko kvalitetno senèenje</string>
+ <string id="13355">Nizkokvalitetno senÄenje</string>
+ <string id="13356">Strojno prekrivanje</string>
+ <string id="13357">Visokokvalitetno senÄenje</string>
<string id="13358">Predvajaj predmet</string>
- <string id="13359">Nastavi sliko izvajalca</string>
- <string id="13360">Generiraj slike</string>
+ <string id="13359">Nastavi sliÄico izvajalca</string>
+ <string id="13360">Generiraj sliÄice</string>
<string id="13361">Uporabi govor</string>
- <string id="13375">Vkljuèi napravo</string>
+ <string id="13375">VkljuÄi napravo</string>
<string id="13376">Glasnost</string>
- <string id="13377">Privzeti pogled</string>
+ <string id="13377">Privzet pogled</string>
<string id="13378">Privzeta svetlost</string>
- <string id="13379">Privzeti kontrast</string>
+ <string id="13379">Privzet kontrast</string>
<string id="13380">Privzeta gama </string>
- <string id="13381">Ponovi video</string>
+ <string id="13381">Nadaljuj video</string>
<string id="13382">Glasovna maska - Port 1</string>
<string id="13383">Glasovna maska - Port 2</string>
<string id="13384">Glasovna maska - Port 3</string>
<string id="13385">Glasovna maska - Port 4</string>
- <string id="13386">Uporabi iskanje po èasu</string>
- <string id="13387">Predloga za poimenovanje posnetkov</string>
- <string id="13388">Prednastavitve</string>
+ <string id="13386">Uporabi iskanje po Äasu</string>
+ <string id="13387">Predloga za poimenovanje posnetkov - pravilno</string>
+ <string id="13388">Prednastavitev</string>
<string id="13389">Ni prednastavitev za vizualizacijo</string>
<string id="13390">Ni nastavitev za vizualizacijo</string>
<string id="13391">Odpri/Zapri</string>
<string id="13392">Uporabi vizualizacijo pri predvajanju glasbe</string>
- <string id="13393">Preraèunaj velikost</string>
- <string id="13394">Preraèunaj velikost mape</string>
- <string id="13395">Video nastavitve</string>
- <string id="13396">Nastavitve: Audio in Podnapisi</string>
- <string id="13397">Vkljuèi Podnapise</string>
- <string id="13398">Oznake</string>
- <string id="13399">Pri sortiranju izpusti "The"</string>
- <string id="13400">Navzkrižni prehod albumskih posnetkov</string>
+ <string id="13393">PreraÄunaj velikost</string>
+ <string id="13394">PreraÄunavam velikost mape</string>
+ <string id="13395">Nastavitve slike</string>
+ <string id="13396">Nastavitve zvoka in podnapisov</string>
+ <string id="13397">VkljuÄi podnapise</string>
+ <string id="13398">Bližnjice</string>
+ <string id="13399">Pri razvrÅ¡Äanju izpusti Älene (npr. "the")</string>
+ <string id="13400">Navzkrižni prehod posnetkov v istem albumu</string>
<string id="13401">Prebrskaj za %s</string>
- <string id="13402">Prikaži pozicijo posnetka</string>
- <string id="13403">Izbriši Privzeto</string>
- <string id="13404">Ponovi</string>
- <string id="13405">Pridobi slièice</string>
+ <string id="13402">Prikaži pozicijo posnetka</string>
+ <string id="13403">Izbriši privzeto</string>
+ <string id="13404">Nadaljuj</string>
+ <string id="13405">Pridobi sliÄico</string>
<string id="13406">Informacije o sliki</string>
- <string id="13407">%s Presets</string>
- <string id="13408">(IMDb Rating)</string>
- <string id="13409">Top 250:</string>
-
- <string id="14000">Združi</string>
- <string id="14001">Razdruži</string>
- <string id="14003">Prenašam Predvajalni seznam...</string>
- <string id="14004">Prenašam Stream listo...</string>
- <string id="14005">Parsam stream listo....</string>
- <string id="14006">Prenos stream liste ni uspel</string>
- <string id="14007">Prenenos datoteke predvajalne liste ni uspel</string>
- <string id="14008">Vkljuèi Kai opozorila</string>
+ <string id="13407">%s prednastavitev</string>
+ <string id="13408">(IMDb uporabniška ocena)</string>
+ <string id="13409">Top 250</string>
+ <string id="13410">Objavi na Last.fm</string>
+ <string id="13411">Najmanjša hitrost ventilatorja</string>
+ <string id="13412">Predvajaj od tukaj</string>
+ <string id="13413">Prenašam</string>
+ <string id="13414">VkljuÄi izvajalce, ki se pojavljajo le na kompilacijah</string>
+ <string id="13415">Metoda izrisa</string>
+ <string id="13416">Samodejno zaznaj</string>
+ <string id="13417">Osnovni senÄilniki (ARB)</string>
+ <string id="13418">Napredni senÄilniki (GLSL)</string>
+ <string id="13419">Programska oprema</string>
+ <string id="13420">Varno odstrani</string>
+ <string id="13421">VDPAU</string>
+ <string id="13422">Tukaj zaÄni projekcijo slik</string>
+ <string id="13423">Zapomni si za to pot</string>
+ <string id="13424">Uporabi medpomnenje pikslov</string>
+ <string id="13425">Dovoli strojno pospeševanje (VDPAU)</string>
+ <string id="13426">Dovoli strojno pospeševanje (VAAPI)</string>
+ <string id="13427">Dovoli strojno pospeševanje (DXVA2)</string>
+ <string id="13428">Dovoli strojno pospeševanje (CrystalHD)</string>
+ <string id="13429">Dovoli strojno pospeševanje (VDADecoder)</string>
+ <string id="13430">Dovoli strojno pospeševanje (OpenMax)</string>
+ <string id="13431">SenÄilniki pikslov</string>
+ <string id="13432">Dovoli strojno pospeševanje (VideoToolbox)</string>
+
+ <string id="13500">A/V metoda sinhroniziranja</string>
+ <string id="13501">ZvoÄna ura</string>
+ <string id="13502">Slikovna ura (Zavrži zvok)</string>
+ <string id="13503">Slikovna ura (Pretvori zvok)</string>
+ <string id="13504">NajveÄja koliÄina pretvorbe (%)</string>
+ <string id="13505">Kvaliteta pretvorbe</string>
+ <string id="13506">Nizka(hitro)</string>
+ <string id="13507">Srednja</string>
+ <string id="13508">Visoka</string>
+ <string id="13509">Zelo visoka(poÄasno!)</string>
+ <string id="13510">Sinhroniziraj predvajanje z zaslonom</string>
+
+ <string id="13550">Ustavi med spremembo osveževanja zaslona</string>
+ <string id="13551">OnemogoÄeno</string>
+ <string id="13552">%.1f sekunda</string>
+ <string id="13553">%.1f sekund</string>
+
+ <string id="13600">Apple upravljalnik</string>
+
+ <string id="13602">Dovoli zagon XBMC preko upravljalnika</string>
+ <string id="13603">Zamik zaporedja</string>
+
+ <string id="13610">OnemogoÄeno</string>
+ <string id="13611">ObiÄajno</string>
+ <string id="13612">Univerzalni upravljalnik</string>
+ <string id="13613">Multi-upravljalnik (Harmony)</string>
+
+ <string id="13620">Apple Remote Napaka</string>
+ <string id="13621">Podpora za Apple Remote je lahko vkljuÄena.</string>
+
+ <string id="14000">Združi</string>
+ <string id="14001">Razdruži</string>
+ <string id="14003">Prenašam predvajalni seznam...</string>
+ <string id="14004">Prenašam seznam pretokov...</string>
+ <string id="14005">Berem seznam pretokov...</string>
+ <string id="14006">Prenos seznama pretokov ni uspel</string>
+ <string id="14007">Prenos predvajalnega seznama ni uspel</string>
+
<string id="14009">Mapa za igre</string>
- <string id="14010">Samodejni prikaz slièic baziran na</string>
- <string id="14011">Vkljuèi samodejni preklop na slikovni pogled</string>
+ <string id="14010">Samodejni prikaz sliÄic temeljujoÄ na</string>
+ <string id="14011">VkljuÄi samodejni preklop na slikovni pogled</string>
<string id="14012">- Uporabi velike ikone</string>
- <string id="14013">- Prekinjalo temeljeèe na</string>
+ <string id="14013">- Preklop temeljujoÄ na</string>
<string id="14014">- Odstotkih</string>
- <string id="14015">Ni datotek in vsaj ena slièica</string>
- <string id="14016">Vsaj ena datoteka in ena slièica</string>
- <string id="14017">Procenti slièic</string>
- <string id="14018">Možnosti</string>
- <string id="14019">Spremeni podroèno kodo 1</string>
- <string id="14020">Spremeni podroèno kodo 2</string>
- <string id="14021">Spremeni podroèno kodo 3</string>
- <string id="14022">Knjižnica</string>
+ <string id="14015">Ni datotek in vsaj ena sliÄica</string>
+ <string id="14016">Vsaj ena datoteka in ena sliÄica</string>
+ <string id="14017">Odstotki sliÄic</string>
+ <string id="14018">Možnosti</string>
+ <string id="14019">Spremeni podroÄno kodo 1</string>
+ <string id="14020">Spremeni podroÄno kodo 2</string>
+ <string id="14021">Spremeni podroÄno kodo 3</string>
+ <string id="14022">Knjižnica</string>
<string id="14023">Brez TV</string>
- <string id="14024">Vnesi najbližje veèje mesto</string>
- <string id="14025">Video/Audio/DVD/HDD medpomnilnik</string>
- <string id="14026">Video medpomnilnik - DVDRom</string>
- <string id="14027">- Lokalno omrežje</string>
+ <string id="14024">Vnesi najbližje veÄje mesto</string>
+ <string id="14025">Video/Glasba/DVD zaÄasni pomnilnik - Trdi disk</string>
+ <string id="14026">Video zaÄasni pomnilnik - DVD-ROM</string>
+ <string id="14027">- Krajevno omrežje</string>
<string id="14028">- Internet</string>
- <string id="14030">Audio medpomnilnik - DVDRom</string>
- <string id="14031">- Lokalno omrežje</string>
+ <string id="14030">Glasbeni zaÄasni pomnilnik - DVD-ROM</string>
+ <string id="14031">- Krajevno omrežje</string>
<string id="14032">- Internet</string>
- <string id="14034">DVD medpomnilnik - DVDRom</string>
- <string id="14035">- Lokalno omrežje</string>
- <string id="14036">Strežniki</string>
- <string id="14037">Izgled in poèutje</string>
- <string id="14038">Omrežne nastavitve spremenjene</string>
- <string id="14039">XBMC zahteva ponovni zagon, da spremeni vaše</string>
- <string id="14040">mrežne nastavitve. Ali želiš ponovno zagnati program?</string>
- <string id="14041">Post Procesiranje</string>
- <string id="14042">Strojni IP naslov</string>
- <string id="14043">- Izklop med delovanjem</string>
- <string id="14044">%i minut</string>
- <string id="14045">%i sekund</string>
+ <string id="14034">DVD zaÄasni pomnilnik - DVD-ROM</string>
+ <string id="14035">- Krajevno omrežje</string>
+ <string id="14036">Storitve</string>
+
+ <string id="14038">Omrežne nastavitve spremenjene</string>
+ <string id="14039">XBMC zahteva ponovni zagon, da spremeni vaše</string>
+ <string id="14040">omrežne nastavitve. Ali želite ponovno zagnati program?</string>
+ <string id="14041">Omejitev pasovne Å¡irine internetne povezave</string>
+
+ <string id="14043">- Izklop med predvajanjem</string>
+ <string id="14044">%i min</string>
+ <string id="14045">%i s</string>
<string id="14046">%i ms</string>
<string id="14047">%i %%</string>
<string id="14048">%i kbps</string>
<string id="14049">%i kb</string>
<string id="14050">%i.0 dB</string>
- <string id="14051">Èasovni zapis</string>
+ <string id="14051">ÄŒasovni zapis</string>
<string id="14052">Datumski zapis</string>
- <string id="14053">GIU filtri</string>
- <string id="14054">Uporabi internetne poizvedbe</string>
- <string id="14055">Uporabi skeniranje v ozadju</string>
- <string id="14056">Ustavi skeniranje</string>
- <string id="14057">Ni mogoèe med skeniranjem medijskih info.</string>
- <string id="14058">Filmski grain efekt</string>
- <string id="14059">Poizvedi za slièice na oddaljeni skupni rabi</string>
- <string id="14060">Nepoznan tip medpomnilnika - Internet</string>
+ <string id="14053">GUI filtri</string>
+
+ <string id="14055">Uporabi iskanje v ozadju</string>
+ <string id="14056">Ustavi iskanje</string>
+ <string id="14057">Ni mogoÄe med iskanjem medijskih info.</string>
+ <string id="14058">Efekt zrnatosti filma</string>
+ <string id="14059">Poizvedi za sliÄice na oddaljeni skupni rabi</string>
+ <string id="14060">Nepoznan tip zaÄasnega pomnilnika - Internet</string>
<string id="14061">Samodejno</string>
- <string id="14062">Vnesi uporabniško ime za</string>
- <string id="14063">Datum in èas</string>
+ <string id="14062">Vnesi uporabniško ime za</string>
+ <string id="14063">Datum &amp; Äas</string>
<string id="14064">Nastavi datum</string>
- <string id="14065">Nastavi èas</string>
- <string id="14066">Vnesi èas v 24 urnem HH:MM formatu</string>
+ <string id="14065">Nastavi Äas</string>
+ <string id="14066">Vnesi Äas v 24 urnem HH:MM formatu</string>
<string id="14067">Vnesi datum v DD/MM/YYYY formatu</string>
<string id="14068">Vnesi IP naslov</string>
<string id="14069">Uporabim te nastavitve sedaj?</string>
<string id="14070">Uporabim spremembe sedaj?</string>
<string id="14071">Dovoli preimenovanje datotek ter brisanje</string>
- <string id="14072">Vkljuèi XLink Kai</string>
- <string id="14073">XLink Kai ni vkljuèen.</string>
- <string id="14074">Nastavi èasovni pas</string>
- <string id="14075">Uporabi prestopno uro</string>
+
+ <string id="14074">Nastavi Äasovni pas</string>
+ <string id="14075">Uporabi prestopni Äas</string>
<string id="14076">Dodaj med priljubljene</string>
<string id="14077">Odstrani iz priljubljenih</string>
- <string id="14078">Barve teme</string>
-
- <string id="15000">XLink Kai</string>
- <string id="15001">Storitev ni vzpostavljena</string>
- <string id="15002">Posusim ponovno vzpostaviti povezavo?</string>
- <string id="15003">Vnesi svoje sporoèilo</string>
- <string id="15004">Bil si povabljen v igro %s.</string>
- <string id="15005">Datum: %s</string>
- <string id="15006">Od: %s</string>
- <string id="15007">Povabilo</string>
- <string id="15008">Bil si povabljen da se prikljuèiš %s.</string>
- <string id="15009">Odklopljen</string>
- <string id="15010">Prijatelji</string>
- <string id="15011">Pogled: Prijatelji</string>
- <string id="15012">Pridruži se</string>
- <string id="15013">Glas</string>
- <string id="15014">Povabi</string>
+ <string id="14078">- Barve</string>
+ <string id="14079">Država Äasovnega pasu</string>
+ <string id="14080">ÄŒasovni pas</string>
+ <string id="14081">Seznam datotek</string>
+ <string id="14082">Prikaži EXIF slikovne informacije</string>
+ <string id="14083">Uporabi celozaslonsko okno namesto pravega celozaslonskega naÄina</string>
+ <string id="14084">Pesmi postavi v vrsto ob izboru</string>
+ <string id="14085">Samodejno predvajaj zvoÄne CD-je</string>
+ <string id="14086">Predvajanje</string>
+ <string id="14087">DVD-ji</string>
+ <string id="14088">Samodejno predvajaj DVD-je</string>
+ <string id="14089">Pisava podnapisov</string>
+ <string id="14090">Jezik</string>
+ <string id="14091">Nabor znakov</string>
+ <string id="14092">RazhroÅ¡Äevanje</string>
+ <string id="14093">Varnost</string>
+ <string id="14094">Naprave vnosa</string>
+ <string id="14095">VarÄevanje energije</string>
+
<string id="15015">Odstrani</string>
<string id="15016">Igre</string>
- <string id="15017">Pogled: Igre</string>
- <string id="15018">Potrdi</string>
+
<string id="15019">Dodaj</string>
- <string id="15020">Gostitelj</string>
- <string id="15021">Arene</string>
- <string id="15022">Pogled: Arene</string>
- <string id="15023">Predvajaj</string>
- <string id="15024">Dodaj</string>
- <string id="15025">Gostitelj</string>
- <string id="15026">Zaèni pogovor</string>
- <string id="15027">Pogled: Pogovor</string>
- <string id="15028">Tipkovnica</string>
- <string id="15029">Za pridružitev tej Areni je potrebno Geslo.</string>
- <string id="15030">Servis se je izkljuèil</string>
- <string id="15031">XLink Kai avtentikacija</string>
- <string id="15032">Vaše uporabniško ime in/ali geslo je bilo zavrnjeno s strani</string>
- <string id="15033">strežnika.Prosimo preverite svojo konfiguracijo.</string>
- <string id="15034">se je ravno prijavil</string>
- <string id="15035">ti je poslal vabilo za pogovor</string>
- <string id="15036">je poslal vabilo </string>
- <string id="15037">XBMC ni v stanju potrdila, da je omrežje dosegljivo</string>
- <string id="15038">Lahko prièakujete težave pri povezovanju ali gostiteljstvu iger </string>
- <string id="15039">XBMC ni uspel locirati igre samodejno</string>
- <string id="15040">Vstavi igralni plošèek v konzolo ali pritisni "A" za izhod</string>
- <string id="15041">in zaženi igro roèno.</string>
- <string id="15042">Dostop zavrnjen</string>
- <string id="15043">%s se prikljuèuje pogovoru</string>
- <string id="15044">%s zapušèa pogovor</string>
- <string id="15045">Vnesi svojo zasebno sporoèilo</string>
- <string id="15046">Trenutna Arena</string>
- <string id="15047">Vnesi geslo za tvojo areno</string>
- <string id="15048">Vnesi informacije za tvojo areno</string>
- <string id="15049">Gosti igro</string>
- <string id="15050">Gosti v privatni areni</string>
- <string id="15051">Limit igralcev</string>
+
<string id="15052">Geslo</string>
- <string id="15053">Opis</string>
- <string id="15054">Dialog povabila</string>
- <string id="15055">Izberi igro:</string>
- <string id="15056">Vnesi sporoèilo:</string>
- <string id="15057">Pošlji</string>
- <string id="15058">Gostitelj</string>
- <string id="15059">Povabilo sprejeto!</string>
- <string id="15060">Sporoèilo tu</string>
- <string id="15061">Povabljen si v igro %s.</string>
- <string id="15100">Knjižnica</string>
+
+ <string id="15100">Knjižnica</string>
<string id="15101">Podatkovna baza</string>
- <string id="15102">* Vsi Albumi</string>
+ <string id="15102">* Vsi albumi</string>
<string id="15103">* Vsi izvajalci</string>
<string id="15104">* Vse pesmi</string>
- <string id="15105">* Vsi Žanri</string>
- <string id="15106">Zapomni si izbrano datoteko pri naslednji izbiri</string>
- <string id="15107">Buffering...</string>
+ <string id="15105">* Vsi žanri</string>
+
+ <string id="15107">Medpomnenje...</string>
<string id="15108">Navigacijski zvoki</string>
<string id="15109">Privzeto</string>
- <string id="15111">Tema preobleke</string>
+ <string id="15111">- Tema</string>
<string id="15112">Privzeta tema</string>
<string id="15200">Last.FM</string>
- <string id="15201">Prenesi pesmi na Last.FM</string>
- <string id="15202">Last.FM Uporabniško ime</string>
- <string id="15203">Last.FM Geslo</string>
- <string id="15204">Povezava ni mogoèa: Spim.....</string>
+ <string id="15201">Objavi pesmi na Last.FM</string>
+ <string id="15202">Last.FM uporabniško ime</string>
+ <string id="15203">Last.FM geslo</string>
+ <string id="15204">Povezava ni mogoÄa: Spim.....</string>
<string id="15205">Prosimo posodobite XBMC</string>
- <string id="15206">Nepravilna avtorizacija: Preveri uporabniško ime in geslo</string>
+ <string id="15206">Nepravilna avtorizacija: Preverite uporabniško ime in geslo</string>
<string id="15207">Povezan</string>
<string id="15208">Brez povezave</string>
- <string id="15209">Posreduj interval %i</string>
- <string id="15210">V medpomnilniku: %i pesmi</string>
- <string id="15211">Posredujem...</string>
- <string id="15212">Posredujem v %i sek</string>
+ <string id="15209">Interval objave %i</string>
+ <string id="15210">V zaÄasnem pomnilniku: %i pesmi</string>
+ <string id="15211">Objavljam...</string>
+ <string id="15212">Objavljam v %i s</string>
<string id="15213">Predvajaj z uporabo...</string>
- <string id="15214">Uporabi gladko A/V Sinhronizacijo</string>
- <string id="15215">Skrij imena datotek v gumbkovnem pogledu</string>
- <string id="15216">Predvajaj v Party naèinu</string>
+ <string id="15214">Uporabi gladko A/V sinhronizacijo</string>
+ <string id="15215">Skrij imena datotek v pogledu sliÄic</string>
+ <string id="15216">Predvajaj v zabavnem naÄinu</string>
+ <string id="15217">Objavi pesmi na Libre.fm</string>
+ <string id="15218">Libre.fm uporabniško ime</string>
+ <string id="15219">Libre.fm geslo</string>
+ <string id="15220">Libre.fm</string>
+ <string id="15221">Objava pesmi</string>
- <string id="15250">Prenesi Last.FM radio postajo na Last.FM</string>
- <string id="15251">Povezujem se na Last.FM...</string>
+ <string id="15250">Objavi Last.fm radio postajo na Last.FM</string>
+ <string id="15251">Povezujem se na Last.fm...</string>
<string id="15252">Izberi postajo...</string>
<string id="15253">Izberi podobnega izvajalca...</string>
- <string id="15254">Poišèi podobne tage...</string>
+ <string id="15254">PoiÅ¡Äi podobne oznake...</string>
<string id="15255">Tvoj profil (%name%)</string>
- <string id="15256">Vsi najbolši tagi</string>
- <string id="15257">Najbolši izvajalci za tag %name%</string>
- <string id="15258">Najbolši albumi za tag %name%</string>
- <string id="15259">Najboljše skladbe za tag %name%</string>
- <string id="15260">Poslušaj tag %name% Last.FM radio</string>
+ <string id="15256">Vse najbolše oznake</string>
+ <string id="15257">Najbolši izvajalci za oznako %name%</string>
+ <string id="15258">Najbolši albumi za oznako %name%</string>
+ <string id="15259">Najboljše pesmi za oznako %name%</string>
+ <string id="15260">Poslušaj oznako %name% Last.fm radio</string>
<string id="15261">Podobni izvajalci kot %name%</string>
- <string id="15262">Najbolši %name% albumi</string>
- <string id="15263">Najbolši %name% zapisa</string>
- <string id="15264">Najbolši %name% tagi</string>
- <string id="15265">Najveèji privrženci %name%</string>
- <string id="15266">Poslušaj %name% privrženèev Last.FM radio</string>
- <string id="15267">Poslušaj %name% zadjnega podobnega izvajalca fm. radia</string>
- <string id="15268">Najbolši izvajalci za uporabnika %name%</string>
- <string id="15269">Najbolši albumi za uporabnika %name%</string>
- <string id="15270">Najbolši zapisi za uporabnika %name%</string>
+ <string id="15262">Najbolši %name% albumi</string>
+ <string id="15263">Najbolše %name% pesmi</string>
+ <string id="15264">Najbolše %name% oznake</string>
+ <string id="15265">NajveÄji privrženci %name%</string>
+ <string id="15266">Poslušaj %name% privržencev Last.fm radio</string>
+ <string id="15267">Poslušaj %name% zadjnega podobnega izvajalca fm. radia</string>
+ <string id="15268">Najbolši izvajalci za uporabnika %name%</string>
+ <string id="15269">Najbolši albumi za uporabnika %name%</string>
+ <string id="15270">Najbolše pesmi za uporabnika %name%</string>
<string id="15271">Prijatelji uporabnika %name%</string>
<string id="15272">Sosedje uporabnika %name%</string>
- <string id="15273">Tedenska lestvica umetnikov za %name%</string>
+ <string id="15273">Tedenska lestvica izvajalcev za %name%</string>
<string id="15274">Tedenska lestvica albumov za %name%</string>
- <string id="15275">Tedenska lestvica skladb za %name%</string>
- <string id="15276">Poslušaj %name% sosedski Last.FM radio</string>
- <string id="15277">Poslušaj %name% osebni Last.FM radio</string>
- <string id="15278">Poslušaj %name% željen zapis Last.FM radio</string>
- <string id="15279">Prenašam listo iz Last.FM</string>
- <string id="15280">Ne morem prenesti liste iz Last.FM</string>
+ <string id="15275">Tedenska lestvica pesmi za %name%</string>
+ <string id="15276">Poslušaj %name% sosedski Last.fm radio</string>
+ <string id="15277">Poslušaj %name% osebni Last.fm radio</string>
+ <string id="15278">Poslušaj %name% miks Last.fm radio</string>
+ <string id="15279">Prenašam seznam iz Last.fm</string>
+ <string id="15280">Ne morem prenesti seznama iz Last.FM</string>
<string id="15281">Vnesi ime izvajalca za iskanje </string>
- <string id="15282">Vnesi tag ime za iskanje podobnih</string>
- <string id="15283">Zadnje poslušane skladbe %name%</string>
- <string id="15284">Poslušaj %name%'s priporoèila Last.FM radio</string>
- <string id="15285">Top tags for user %name%</string>
- <string id="15286">Poslušaj %name%-ov seznam Last.FM radio</string>
- <string id="15287">Želiš dodati trenutno skladbo med priljubljene?</string>
- <string id="15288">Želiš prepovedati trenutno skladbo</string>
+ <string id="15282">Vnesi oznako za iskanje podobnih</string>
+ <string id="15283">Zadnje poslušane skladbe %name%</string>
+ <string id="15284">PosluÅ¡aj priporoÄila %name% Last.FM radio</string>
+ <string id="15285">Najbolj priljubljene oznake %name%</string>
+
+ <string id="15287">Želite dodati trenutno skladbo med priljubljene?</string>
+ <string id="15288">Želite prepovedati trenutno skladbo</string>
<string id="15289">Dodano med priljubljene: '%s'.</string>
- <string id="15290">Ni bilo mogoèe dodati '%s' med priljubljene.</string>
+ <string id="15290">Ni bilo mogoÄe dodati '%s' med priljubljene.</string>
<string id="15291">Prepovedano: '%s'.</string>
- <string id="15292">Ni bilo moè prepovedati '%s'.</string>
- <string id="15293">Tracks recently loved by %name%</string>
- <string id="15294">Tracks recently banned by %name%</string>
- <string id="15295">Remove from loved tracks</string>
- <string id="15296">Un-ban</string>
- <string id="15297">Do you want to remove this track from your loved tracks?</string>
- <string id="15298">Do you want to un-ban this track?</string>
-
- <string id="15300">Povezava ni bila najdena oz. je napaèna</string>
- <string id="15301">Povezava z strežnikom ni mogoèa</string>
- <string id="15302">Ni strežnikov</string>
- <string id="15303">Workgroup ni bil najden</string>
-
- <string id="15310">Odpiram multi-path bookmark</string>
- <string id="15311">Povezava:</string>
+ <string id="15292">Ni bilo mogoÄe prepovedati '%s'.</string>
+ <string id="15293">Zadnje priljubljene pesmi %name%</string>
+ <string id="15294">Zadnje prepovedane pesmi %name%</string>
+ <string id="15295">Odstrani iz priljubljenih</string>
+ <string id="15296">Dovoli</string>
+ <string id="15297">Želite odstraniti to skladbo iz priljubljenih?</string>
+ <string id="15298">Želite dovoliti to skladbo?</string>
+
+ <string id="15300">Povezava ni bila najdena oz. je neveljavna</string>
+ <string id="15301">Povezava z strežnikom ni mogoÄa</string>
+ <string id="15302">Ni strežnikov</string>
+ <string id="15303">Delovne skupine ni mogoÄe najti</string>
+
+ <string id="15310">Odpiram vir z veÄ potmi</string>
+ <string id="15311">Pot:</string>
- <string id="16000">Generalno</string>
- <string id="16001">Nastavi audio strojno opremo</string>
- <string id="16002">CDDB lookup</string>
+ <string id="16000">Splošno</string>
+
+ <string id="16002">Poizvedba na spletu</string>
<string id="16003">Predvajalnik</string>
- <string id="16004">Predvajaj iz DVD enote</string>
-
- <string id="16008">Vnesi nov naslov</string>
- <string id="16009">Vnesi ime filma</string>
- <string id="16010">Vnesi ime profila</string>
- <string id="16011">Vnesi ime Albuma</string>
- <string id="16012">Vnesi ime predvajalne liste</string>
- <string id="16013">Vnesi podatkovno ime</string>
- <string id="16014">Vnesi ime mape</string>
- <string id="16015">Vnesi direktorij</string>
- <string id="16016">Omogoèene opcije: %A, %T, %N, %B, %D, %G, %Y, %F, %S</string>
- <string id="16017">Vnesi iskalni niz</string>
- <string id="16018">Noben</string>
+ <string id="16004">Predvajaj iz medija</string>
+
+ <string id="16008">Vnesite nov naslov</string>
+ <string id="16009">Vnesite ime filma</string>
+ <string id="16010">Vnesite ime profila</string>
+ <string id="16011">Vnesite ime albuma</string>
+ <string id="16012">Vnesite ime predvajalnega seznama</string>
+ <string id="16013">Vnesite novo ime datoteke</string>
+ <string id="16014">Vnesite ime mape</string>
+ <string id="16015">Vnesite direktorij</string>
+ <string id="16016">Možnosti: %A, %T, %N, %B, %D, %G, %Y, %F, %S</string>
+ <string id="16017">Vnesite iskalni niz</string>
+ <string id="16018">Brez</string>
<string id="16019">Samodejna izbira</string>
- <string id="16020">DeInterlace</string>
- <string id="16021">Sinhronizacija Odd</string>
- <string id="16022">Sinhronizacija Even</string>
+ <string id="16020">Razpletanje</string>
+ <string id="16021">Bob</string>
+ <string id="16022">Bob (obrnjeno)</string>
<string id="16023">Uporaba prepletanja</string>
- <string id="16024">Odjavljam...</string>
- <string id="16025">Vnesi ime Izvajalca</string>
- <string id="16026">Predvajalna lista zavrnjena</string>
- <string id="16027">Preveè napak </string>
-
- <string id="16030">Party Mode prepreèen</string>
- <string id="16031">Nobena pesem v bazi ne izpolnjuje pogojev</string>
- <string id="16032">Ne morem inicializirati podatkovne baze</string>
- <string id="16033">Ne morem odpreti podatkovne baze</string>
- <string id="16034">Pesmi nisem mogel pridobiti iz baze</string>
- <string id="16035">Party naèin predvajalni seznam</string>
+ <string id="16024">Preklic...</string>
+ <string id="16025">Vnesite ime izvajalca</string>
+ <string id="16026">Predvajanje ni uspelo</string>
+ <string id="16027">Ene ali veÄ datotek ni mogoÄe predvajati.</string>
+ <string id="16028">Vnesite vrednost</string>
+ <string id="16029">Preberite veÄ informacij v zapisniku.</string>
+ <string id="16030">Zabavni naÄin preklican.</string>
+ <string id="16031">Nobena pesem v bazi ne izpolnjuje pogojev.</string>
+ <string id="16032">Ne morem inicializirati podatkovne baze.</string>
+ <string id="16033">Ne morem odpreti podatkovne baze.</string>
+ <string id="16034">Ne morem pridobiti pesmi iz baze</string>
+ <string id="16035">Predvajalni seznam zabavnega naÄina</string>
<string id="16100">Vsi posnetki</string>
<string id="16101">Nepogledani</string>
<string id="16102">Pogledani</string>
- <string id="16103">Oznaèi kot pogledan</string>
- <string id="16104">Oznaèi kot Nepogledan</string>
- <string id="16105">Uredi Naslov</string>
- <string id="16106">Uporabljaj samo NTSC-M &amp; NTSC-J</string>
- <string id="16107">Uporabljaj samo NTSC-M</string>
- <string id="16108">Uporabljaj samo NTSC-J</string>
- <string id="16109">Uporabljaj samo PAL-60</string>
- <string id="16110">Za 60hz igre</string>
+ <string id="16103">OznaÄi kot pogledan</string>
+ <string id="16104">OznaÄi kot nepogledan</string>
+ <string id="16105">Uredi naslov</string>
<string id="16200">Operacija je bila preklicana</string>
<string id="16201">Kopiranje ni uspelo</string>
@@ -1367,159 +1500,186 @@
<string id="16205">Izbris ni uspel</string>
<string id="16206">Izbris najmanj ene datoteke ni uspel</string>
- <string id="20000">CDDA Rip Mapa</string>
+ <string id="16300">NaÄin spreminjanja velikosti videa</string>
+ <string id="16301">Najbližji sosed</string>
+ <string id="16302">Bilinear</string>
+ <string id="16303">Bicubic</string>
+ <string id="16304">Lanczos2</string>
+ <string id="16305">Lanczos3</string>
+ <string id="16306">Sinc8</string>
+ <string id="16307">Bicubic (programsko)</string>
+ <string id="16308">Lanczos (programsko)</string>
+ <string id="16309">Sinc (programsko)</string>
+ <string id="16310">Temporal</string>
+ <string id="16311">Temporal/Spatial</string>
+ <string id="16312">(VDPAU)Zmanjševanje šuma</string>
+ <string id="16313">(VDPAU)Ostrenje</string>
+ <string id="16314">Inverse Telecine</string>
+ <string id="16315">Lanczos3 optimalno</string>
+ <string id="16316">Samodejno</string>
+ <string id="16317">Temporal (Half)</string>
+ <string id="16318">Temporal/Spatial (Half)</string>
+ <string id="16319">DXVA</string>
+
+ <string id="16400">Post-procesiranje</string>
+
+ <string id="17500">Prikaži Äas to zamaknjenega izklopa</string>
+
+ <string id="19000">Preklopi na kanal</string>
+
+ <string id="20000">Mapa za shranjeno glasbo</string>
<string id="20001">Uporabi zunanji DVD predvajalnik</string>
<string id="20002">Zunanji DVD Predvajalnik</string>
<string id="20003">Trainer mapa</string>
<string id="20004">Mapa za namizne posnetke</string>
- <string id="20005">Mapa za posnetke</string>
- <string id="20006">Mapa za predvajalno listo </string>
+
+ <string id="20006">Mapa za predvajalne sezname</string>
<string id="20007">Posnetki</string>
<string id="20008">Namizni posnetki</string>
<string id="20009">Uporabi XBMC</string>
- <string id="20010">Slika umetnika</string>
- <string id="20011">Glasbena predvajalna lista</string>
- <string id="20012">Video predvajalna lista</string>
- <string id="20013">Želiš zagnati igro?</string>
- <string id="20014">Razporedi: predvajalna lista</string>
- <string id="20015">IMDb slika</string>
- <string id="20016">Prisotna slika</string>
- <string id="20017">Lokalna slika</string>
- <string id="20018">Brez slike</string>
- <string id="20019">Izberi slièico</string>
- <string id="20020">Naenkrat ni moè uporabljati KAI in Trainerja</string>
- <string id="20021">Iberi katerega želiš uporabiti</string>
+
+ <string id="20011">Glasbeni predvajalni seznami</string>
+ <string id="20012">Video predvajalni seznami</string>
+ <string id="20013">Želite zagnati igro?</string>
+ <string id="20014">Razporedi: Predvajalni seznam</string>
+ <string id="20015">Oddaljena sliÄica</string>
+ <string id="20016">Trenutna sliÄica</string>
+ <string id="20017">Krajevna sliÄica</string>
+ <string id="20018">Brez sliÄice</string>
+ <string id="20019">Izberi sliÄico</string>
+
<!-- string id 20022 will always be set to an empty string (LocalizeStrings.cpp)-->
<string id="20022"></string>
<string id="20023">Konflikt</string>
- <string id="20024">Novo skeniranje</string>
- <string id="20025">Skeniraj vse</string>
+ <string id="20024">Novo iskanje</string>
+ <string id="20025">PreiÅ¡Äi vse</string>
<string id="20026">Regija</string>
<!-- string id's 20027 thru 20034 are reserved for temperaturestrings (LocalizeStrings.cpp)-->
+ <string id="20037">Kratek opis</string>
<string id="20038">Zakleni glasbeni del</string>
<string id="20039">Zakleni video del</string>
<string id="20040">Zakleni slikovni del</string>
<string id="20041">Zakleni programski ter skriptni del</string>
- <string id="20042">Zakleni raziskovalca</string>
+ <string id="20042">Zakleni brskalnik datotek</string>
<string id="20043">Zakleni nastavitve</string>
- <string id="20044">Zaženi sveže</string>
- <string id="20045">Vstopi v Master opcijo</string>
- <string id="20046">Izstopi iz Master opcije</string>
- <string id="20047">Kreiraj profil '%s' ?</string>
- <string id="20048">Zaženi z svežimi nastavitvami</string>
- <string id="20049">Najbolša možna</string>
+ <string id="20044">ZaÄni sveže</string>
+ <string id="20045">Vstopi v upravljalski naÄin</string>
+ <string id="20046">Izstopi iz upravljalskega naÄina</string>
+ <string id="20047">Ustvari profil '%s'?</string>
+ <string id="20048">ZaÄni z svežimi nastavitvami</string>
+ <string id="20049">Najboljša možna</string>
<string id="20050">Samodejno preklopi med 16x9 in 4x3</string>
<string id="20051">Obravnavaj razdeljene datoteke kot eno datoteko</string>
<string id="20052">Pozor</string>
- <string id="20053">Zapustil Master opcijo</string>
- <string id="20054">Vstopil v Master opcijo</string>
- <string id="20055">Allmusic.com slika</string>
- <string id="20056">Izvorna slièica</string>
- <string id="20057">Odstrani slièico</string>
+ <string id="20053">Zapustili ste upravljalski naÄin</string>
+ <string id="20054">Vstopili ste v upravljalski naÄin</string>
+ <string id="20055">Allmusic.com sliÄica</string>
+
+ <string id="20057">Odstrani sliÄico</string>
<string id="20058">Dodaj profil...</string>
- <string id="20059">Info poizvedba za vse albume</string>
- <string id="20060">Medijske informacije</string>
- <string id="20061">Loèeno</string>
+ <string id="20059">Poizvedba informacij za vse albume</string>
+ <string id="20060">Informacije o mediju</string>
+ <string id="20061">LoÄeno</string>
<string id="20062">Privzeta skupna raba</string>
- <string id="20063">Privzeta skupna raba(samo branje)</string>
+ <string id="20063">Privzeta skupna raba (samo za branje)</string>
<string id="20064">Privzeto kopiranje</string>
<string id="20065">Slika profila</string>
<string id="20066">Nastavitve zaklepanja</string>
<string id="20067">Uredi profil</string>
<string id="20068">Zaklepanje profila</string>
- <string id="20069">Ne morem kreirati mape</string>
+ <string id="20069">Ne morem ustvariti mape</string>
<string id="20070">Direktorij z profili</string>
- <string id="20071">Zaèni z svežimi medijskimi vsebinami</string>
- <string id="20072">Preprièaj se da je izbrana mapa zapisljiva</string>
+ <string id="20071">ZaÄni z svežimi multimedijskimi viri</string>
+ <string id="20072">PrepriÄajte se, da je izbrana mapa zapisljiva</string>
<string id="20073">in da je ime nove mape pravilno</string>
- <string id="20074">MPAA Vrednosti:</string>
- <string id="20075">Vnesi Master zaklepno kodo</string>
- <string id="20076">Vprašaj za Master zaklepno kodo pri zagonu</string>
- <string id="20077">Nastavi preobleko</string>
- <string id="20078">- ni bližnjice -</string>
- <string id="20079">Vkljuèi animacije</string>
- <string id="20080">Izkljuèi RSS novice med predvajanjem glasbe</string>
- <string id="20081">Vkljuèi gumb za oštevilèenje</string>
- <string id="20082">Prikaži XLink Kai informacije</string>
- <string id="20083">Prikaži glasbene informacije</string>
- <string id="20084">Prikaži vremenske informacije</string>
- <string id="20085">Prikaži sistemske informacije</string>
- <string id="20086">Prikaži prosti del na trdem disku C: E: F:</string>
- <string id="20087">Prikaži prosti del na trdem disku E: F: G:</string>
+ <string id="20074">MPAA ocena</string>
+ <string id="20075">Vnesi glavno geslo</string>
+ <string id="20076">Vprašaj za glavno geslo pri zagonu</string>
+ <string id="20077">Nastavitve preobleke</string>
+ <string id="20078">- ni bližnjic -</string>
+ <string id="20079">VkljuÄi animacije</string>
+ <string id="20080">IzkljuÄi RSS med predvajanjem glasbe</string>
+ <string id="20081">VkljuÄi gumbe bližnjic</string>
+ <string id="20082">Prikaži programe v glavnem menuju</string>
+ <string id="20083">Prikaži glasbene informacije</string>
+ <string id="20084">Prikaži vremenske informacije</string>
+ <string id="20085">Prikaži sistemske informacije</string>
+ <string id="20086">Prikaži prosti del na trdem disku C: E: F:</string>
+ <string id="20087">Prikaži prosti del na trdem disku E: F: G:</string>
<string id="20088">Vremenske informacije</string>
<string id="20089">Prostor na trdem disku</string>
- <string id="20090">Vnesi naziv za obstojeèo skupno rabo</string>
- <string id="20091">Zaklepna koda</string>
- <string id="20092">Naloži profil</string>
+ <string id="20090">Vnesi naziv za obstojeÄo skupno rabo</string>
+ <string id="20091">Geslo za zaklepanje</string>
+ <string id="20092">Naloži profil</string>
<string id="20093">Ime profila</string>
- <string id="20094">Podatki o mediju</string>
- <string id="20095">Vnesi zaklepno kodo za profil</string>
+ <string id="20094">Multimedijski vir</string>
+ <string id="20095">Vnesi geslo za zaklepanje za profil</string>
<string id="20096">Prijavno okno</string>
- <string id="20097">Preiskujem informacije o albumu</string>
- <string id="20098">Preiskujem informacije za album</string>
- <string id="20099">Ne morem ripati CD-ja ali zapisa med predvajanjem Cd-ja</string>
- <string id="20100">Master zaklepna koda in nastavitve</string>
- <string id="20101">Vnos Master kode, vedno vkljuèi Master naèin</string>
+ <string id="20097">Prenašam informacije o albumu</string>
+ <string id="20098">Prenašam informacije za album</string>
+ <string id="20099">Ne morem shraniti CD-ja ali zapisa med predvajanjem</string>
+ <string id="20100">Glavno geslo in nastavitve</string>
+ <string id="20101">Vnos glavnega gesla vedno vkljuÄi upravljalski naÄin</string>
<string id="20102">ali kopiram iz privzete?</string>
<string id="20103">Shranim spremembe v profil?</string>
<string id="20104">Najdene stare nastavitve</string>
- <string id="20105">Jih želite uporabit?</string>
- <string id="20106">Stare medijske datoteke najdene</string>
- <string id="20107">Loèeno (zakljenjeno)</string>
+ <string id="20105">Jih želite uporabit?</string>
+ <string id="20106">Najdeni stari multimedijski viri</string>
+ <string id="20107">LoÄeno (zakljenjeno)</string>
<string id="20108">Root</string>
- <string id="20109">Poveèava preobleke</string>
- <string id="20110">UPnP odjemalec</string>
- <string id="20111">Samodejni zagon</string>
- <string id="20112">Zadnji vpis: %s</string>
- <string id="20113">Nikoli vpisan</string>
+ <string id="20109">- PoveÄava</string>
+ <string id="20110">UPnP nastavitve</string>
+ <string id="20111">Samodejni zagon odjemalca UPnP</string>
+ <string id="20112">Zadnja prijava: %s</string>
+ <string id="20113">Nikoli prijavljen</string>
<string id="20114">Profil %i / %i</string>
- <string id="20115">Uporabniški vpis / Izberi profil</string>
- <string id="20116">Uporabi zakleni se na vpisno okno</string>
- <string id="20117">Napaèna zašèitna koda.</string>
- <string id="20118">Dejanje potrebuje nastavitev Master zašèite.</string>
- <string id="20119">Želite opraviti nastavitve sedaj?</string>
- <string id="20120">NAlagam programske info.</string>
- <string id="20121">Žuriraj!</string>
- <string id="20122">Drži</string>
- <string id="20123">Mešanje pijaè</string>
+ <string id="20115">Uporabniška prijava / Izberi profil</string>
+ <string id="20116">Uporabi zaklepanje ob prijavi</string>
+ <string id="20117">NapaÄna zaÅ¡Äitno geslo.</string>
+ <string id="20118">Dejanje potrebuje nastavitev glavnega gesla.</string>
+ <string id="20119">Želite opraviti nastavitve sedaj?</string>
+ <string id="20120">Nalagam programske info.</string>
+ <string id="20121">Žuriraj!</string>
+ <string id="20122">Drži</string>
+ <string id="20123">MeÅ¡anje pijaÄ</string>
<string id="20124">Polnjenje stekla</string>
- <string id="20125">Prijavljen kot</string>
+ <string id="20125">Prijavljen kot</string>
<string id="20126">Odjavi se</string>
- <string id="20128">Pojdi na Root</string>
+ <string id="20128">Pojdi na root</string>
<string id="20129">Valovanje</string>
<string id="20130">Valovanje (invertirano)</string>
<string id="20131">Zatemni</string>
- <string id="20132">Ponovno zaženi video</string>
- <string id="20133">Uredi mrežno lokacijo</string>
- <string id="20134">Odstrani omrežno lokacijo</string>
- <string id="20135">Želiš preskenirati mapo?</string>
+ <string id="20132">Ponovno zaženi video</string>
+ <string id="20133">Uredi omrežno lokacijo</string>
+ <string id="20134">Odstrani omrežno lokacijo</string>
+ <string id="20135">Želite preiskati mapo?</string>
<string id="20136">Spominska naprava</string>
- <string id="20137">Spominska naprava priklopljena</string>
- <string id="20138">Spominske naprave ni mogoèe priklopiti</string>
+ <string id="20137">Spominska naprava prikljuÄiti</string>
+ <string id="20138">Spominske naprave ni mogoÄe prikljuÄiti</string>
<string id="20139">Na portu %i, slot %i</string>
<string id="20140">Zakleni ohranjevalnik</string>
<string id="20141">Nastavi</string>
- <string id="20142">Uporabniško ime</string>
+ <string id="20142">Uporabniško ime</string>
<string id="20143">Vnesi geslo za</string>
- <string id="20144">Izklopni timer</string>
- <string id="20145">Izklopni interval (v minutah)</string>
- <string id="20146">Vkljuèen, izklop èez %im</string>
- <string id="20147">Izkljuèitev èez 30 minut</string>
- <string id="20148">Izkljuèitev èez 60 minut</string>
- <string id="20149">Izkljuèitev èez 120 minut</string>
- <string id="20150">Po želji nastavljiv izklopni timer</string>
- <string id="20151">Izkljuèi izklopni timer</string>
+ <string id="20144">Zakasnitev izklopa</string>
+ <string id="20145">Interval zakasnitve izklopa (v minutah)</string>
+ <string id="20146">VkljuÄen, izklop Äez %im</string>
+ <string id="20147">IzkljuÄitev Äez 30 minut</string>
+ <string id="20148">IzkljuÄitev Äez 60 minut</string>
+ <string id="20149">IzkljuÄitev Äez 120 minut</string>
+ <string id="20150">Poljubna zakasnitev izklopa</string>
+ <string id="20151">IzkljuÄi zakasnitev izklopa</string>
<string id="20152">Nastavitve zaklepa za %s</string>
<string id="20153">Prebrskaj...</string>
- <string id="20154">Osnovne Informacije</string>
+ <string id="20154">Osnovne informacije</string>
<string id="20155">Informacije o shrambi</string>
- <string id="20156">HDD Informacije</string>
- <string id="20157">DVD-ROM Informacije</string>
- <string id="20158">Mrežne informacije</string>
+ <string id="20156">Informacije o trdem disku</string>
+ <string id="20157">DVD-ROM informacije</string>
+ <string id="20158">Omrežne informacije</string>
<string id="20159">Video informacije</string>
- <string id="20160">Info. strojne opreme</string>
+ <string id="20160">Informacije o strojni opremi</string>
<string id="20161">Skupaj</string>
<string id="20162">Uporabljeno</string>
<string id="20163">od</string>
@@ -1530,311 +1690,625 @@
<string id="20168">Potreben je ponovni zagon</string>
<string id="20169">Teden</string>
<string id="20170">Linija</string>
- <string id="20171">Windows Omrežje (SMB)</string>
- <string id="20172">XBMSP Strežnik</string>
- <string id="20173">FTP Strežnik</string>
+ <string id="20171">Omrežje Windows (SMB)</string>
+ <string id="20172">XBMSP strežnik</string>
+ <string id="20173">FTP strežnik</string>
<string id="20174">Skupna raba iTunes glasbe (DAAP)</string>
- <string id="20175">UPnP Strežnik</string>
- <string id="20176">Prikaži video informacije</string>
+ <string id="20175">UPnP strežnik</string>
+ <string id="20176">Prikaži video informacije</string>
<string id="20177">Uporabi</string>
<string id="20178">Shift</string>
<string id="20179">Caps Lock</string>
<string id="20180">Simboli</string>
<string id="20181">Nazaj</string>
<string id="20182">Presledek</string>
- <string id="20183">Osveži preobleko</string>
- <string id="20184">Rotiraj z uporabo EXIF informacije</string>
- <string id="20185"></string>
- <string id="20186">Prosim poèakaj</string>
- <string id="20187">Shranjujem EEPROM</string>
- <string id="20188">Shranjujem BIOS</string>
- <string id="20189"></string>
- <string id="20190">Po meri</string>
+ <string id="20183">Osveži preobleko</string>
+ <string id="20184">Obrni z uporabo EXIF informacije</string>
+ <string id="20185">Uporabi plakate za TV serije</string>
+ <string id="20186">Prosim poÄakajte</string>
+
+ <string id="20189">VkljuÄi samodejno premikanje zgodbe &amp; ocen</string>
+ <string id="20190">Poljubno</string>
+ <string id="20191">VkljuÄi zapisovanje razhroÅ¡Äevanja</string>
+ <string id="20192">Prenesi dodatne informacije med posodabljanjem</string>
+ <string id="20193">Privzeta storitev za informacije o albumih</string>
+ <string id="20194">Privzeta storitev za informacije o izvajalcih</string>
+ <string id="20195">Spremeni ponudnika</string>
+ <string id="20196">Izvozi glasbeno knjižnico</string>
+ <string id="20197">Uvozi glasbeno knjižnico</string>
+ <string id="20198">Ni najdenega izvajalca!</string>
+ <string id="20199">Prenašanje informacij o izvajalcu ni uspelo</string>
<!-- string id's 20200 thru 20211 are reserved for speedstrings (LocalizeStrings.cpp)-->
- <string id="20250">Party on! (videos)</string>
- <string id="20251">Mixing drinks (videos)</string>
- <string id="20252">Filling glasses (videos)</string>
-
- <string id="20191"></string>
- <string id="20192"></string>
- <string id="20193"></string>
- <string id="20194"></string>
- <string id="20195"></string>
- <string id="20196"></string>
- <string id="20197"></string>
- <string id="20198"></string>
- <string id="20199"></string>
- <string id="20300"></string>
- <string id="20301"></string>
- <string id="20302"></string>
- <string id="20303"></string>
- <string id="20304"></string>
- <string id="20305"></string>
-
- <string id="20306">Neznano. Prosim dodaj MD5 iz xbmc.log v BiosIDs.ini.</string>
+ <string id="20250">Žuriraj! (videi)</string>
+ <string id="20251">MeÅ¡anje pijaÄ (videi)</string>
+ <string id="20252">Polnenje kozarcev (videi)</string>
+ <string id="20253">WebDAV strežnik (HTTP)</string>
+ <string id="20254">WebDAV strežnik (HTTPS)</string>
+ <string id="20255">Uredi profil ob prvi prijavi</string>
+ <string id="20256">HTS Tvheadend odjemalec</string>
+ <string id="20257">VDR Streamdev odjemalec</string>
+ <string id="20258">MythTV odjemalec</string>
+
+ <string id="20300">Mapa spletnega strežnika (HTTP)</string>
+ <string id="20301">Mapa spletnega strežnika (HTTPS)</string>
+ <string id="20302">Ni mogoÄe pisati v mapo:</string>
+ <string id="20303">Želite preskoÄiti in nadaljevati?</string>
+ <string id="20304">RSS</string>
+
<string id="20307">Sekundarni DNS</string>
- <string id="20308">DHCP Strežnik:</string>
+ <string id="20308">DHCP strežnik:</string>
<string id="20309">Ustvari novo mapo</string>
<string id="20310">Zatemni LCD pri predvajanju</string>
- <string id="20311">Neznano na matièni plošèi (zašèiteno)</string>
+ <string id="20311">Neznano (zaÅ¡Äiteno)</string>
<string id="20312">Zatemni LCD pri pavzi</string>
- <string id="20313">Vkljuèi LED med pavzo</string>
- <string id="20314">Video - knjižnica</string>
- <string id="20315">Shranjene pozicije</string>
- <string id="20316">Sortiraj: ID</string>
- <string id="20317">Prenesi shranjene pozicije</string>
- <string id="20318">Shrani igro namešèeno na HDD</string>
- <string id="20319">Napaka pri prenosu shranjene pozicije</string>
- <string id="20320">Izberi shranjeno pozicijo in jo namesti</string>
- <string id="20321">Ni shranjenih pozicij za prenos</string>
- <string id="20322">Pojdi v shranjene pozicije</string>
- <string id="20323">Shranjene pozicije</string>
+
+ <string id="20314">Video - Knjižnica</string>
+
+ <string id="20316">Razvrsti: ID</string>
+
<string id="20324">Igraj odlomek...</string>
- <string id="20325">Ponastavitev kalibracije</string>
- <string id="20326">To bo ponastavilo kalibracijske vrednosti za %s</string>
+ <string id="20325">Ponastavitev prilagoditev</string>
+ <string id="20326">To bo ponastavilo vrednosti prilagoditev za %s</string>
<string id="20327">na privzete vrednosti.</string>
<string id="20328">Prebrskaj za ciljem</string>
- <string id="20329"></string>
- <string id="20330">Uporabi imena map za Lookups</string>
+
+ <string id="20330">Uporabi imena map za poizvedbe</string>
<string id="20331">Datoteka</string>
- <string id="20332">Uporabi ime datoteke ali mape v lookups?</string>
+ <string id="20332">Uporabi ime datoteke ali mape v poizvedbah?</string>
<string id="20333">Nastavi vsebino</string>
<string id="20334">Mapa</string>
- <string id="20335">Look for content recursively?</string>
+ <string id="20335">Brebrskaj za vsebine tudi v podmapah?</string>
<string id="20336">Odkleni izvore</string>
<string id="20337">Igralec</string>
<string id="20338">Film</string>
<string id="20339">Director</string>
- <string id="20340">Do you want to remove all items within</string>
- <string id="20341">this path from the library?</string>
+ <string id="20340">Želite odstraniti vse elemente</string>
+ <string id="20341">s to potjo iz knjižnice XBMC?</string>
<string id="20342">Filmi</string>
- <string id="20343">TV Shows</string>
+ <string id="20343">TV serije</string>
<string id="20344">Ta mapa vsebuje</string>
- <string id="20345">Zaženi avtomatizirano iskanje</string>
- <string id="20346">Scan Recursively</string>
- <string id="20347">as</string>
- <string id="20348">Directors</string>
- <string id="20349">No video files found in this path!</string>
+ <string id="20345">Zaženi samodejno iskanje</string>
+ <string id="20346">PreiÅ¡Äi tudi podmape</string>
+ <string id="20347">kot</string>
+ <string id="20348">Režiserji</string>
+ <string id="20349">Na tej poti ni nobenih video datotek!</string>
<string id="20350">glasov</string>
- <string id="20351">TV Show informacija</string>
+ <string id="20351">Informacija o TV seriji</string>
<string id="20352">Informacija o epizodi</string>
- <string id="20353">Dalagam detajle za TV Show </string>
- <string id="20354">Fetching Episode Guide</string>
- <string id="20355">Loading Info For Episodes In Directory</string>
- <string id="20356">Izberi TV Show:</string>
- <string id="20357">Vnesi ime za TV Show </string>
+ <string id="20353">Dalagam podrobnosti o TV seriji</string>
+ <string id="20354">Prenašam opis epizod</string>
+ <string id="20355">IÅ¡Äem epizode v mapi</string>
+ <string id="20356">Izberi TV serijo:</string>
+ <string id="20357">Vnesi ime TV serije</string>
<string id="20358">Sezona %i</string>
<string id="20359">Epizoda</string>
<string id="20360">Epizode</string>
- <string id="20361">Nalagam detajle za epizodo</string>
- <string id="20362">Odstrani Epizode iz knjižnice</string>
- <string id="20363">Odstrani TV Show iz knjižnice</string>
- <string id="20364">TV Show</string>
- <string id="20365">Episoda Plot</string>
+ <string id="20361">Nalagam podrobnosti o epizodi</string>
+ <string id="20362">Odstrani epizode iz knjižnice</string>
+ <string id="20363">Odstrani TV serijo iz knjižnice</string>
+ <string id="20364">TV serija</string>
+ <string id="20365">Zgodba epizode</string>
<string id="20366">* Vse sezone</string>
<string id="20367">Skrij pogledane</string>
- <string id="20368">Prod Code</string>
- <string id="20369">Skrij plot za nepogledane predmete</string>
- <string id="20370">* Hidden to prevent spoilers *</string>
- <string id="20371">Nastavi slièico za sezono</string>
+ <string id="20368">Prod. Å¡t.</string>
+ <string id="20369">Skrij zgodbo nepogledanih predmetov</string>
+ <string id="20370">* Skrito zaradi skrivanja zgodbe *</string>
+ <string id="20371">Nastavi sliÄico za sezono</string>
<string id="20372">Slika sezone</string>
<string id="20373">Sezona</string>
- <string id="20374">Prenašam informacije o Videu</string>
- <string id="20375">Unassign Content</string>
- <string id="20376">First Aired:</string>
- <string id="20377">Osveži informacije o TV Show</string>
- <string id="20378">Osfeži informacije za vse epizode?</string>
- <string id="20379">Mapa vsebuje en TV Show</string>
- <string id="20380">Izkljuèi mapo iz iskanja</string>
- <string id="20381">Specials</string>
- <string id="20382">Samodejno izberi slièico sezone</string>
- <string id="20383">Mapa vsebuje samostojene Video</string>
- <string id="20384">Povezava do TV Show</string>
- <string id="20385">Odstrani povezavo do TV Show</string>
+ <string id="20374">Prenašam informacije o filmu</string>
+ <string id="20375">Odstrani vsebino</string>
+ <string id="20376">Prvotni naslov</string>
+ <string id="20377">Osveži informacije o TV seriji</string>
+ <string id="20378">Osveži informacije za vse epizode?</string>
+ <string id="20379">Mapa vsebuje eno TV serijo</string>
+ <string id="20380">IzkljuÄi mapo iz iskanja</string>
+ <string id="20381">Posebne epizode</string>
+ <string id="20382">Samodejno izberi sliÄico sezone</string>
+ <string id="20383">Mapa vsebuje samostojne videe</string>
+ <string id="20384">Povezava do TV serije</string>
+ <string id="20385">Odstrani povezavo do TV serije</string>
<string id="20386">Nazadnje dodani filmi</string>
<string id="20387">Nazadnje dodane epizode</string>
- <string id="20388">Studios</string>
+ <string id="20388">Studiji</string>
<string id="20389">Videospoti</string>
<string id="20390">Nazadnje dodani videospoti</string>
<string id="20391">Videospot</string>
- <string id="20392">Odstrani Videospot iz knjižnice</string>
+ <string id="20392">Odstrani videospot iz knjižnice</string>
<string id="20393">Informacije o videospotu</string>
<string id="20394">Nalagam informacije o videospotu</string>
- <string id="20395">Mixed</string>
+ <string id="20395">Mešano</string>
<string id="20396">Pojdi na albume po izvajalcu</string>
- <string id="20397">Pojdi na album Album</string>
+ <string id="20397">Pojdi na album</string>
<string id="20398">Predvajaj pesem</string>
<string id="20399">Pojdi na videospote iz albuma</string>
<string id="20400">Pojdi na videospote po izvajalcu</string>
- <string id="20401">Predvajaj videospote</string>
- <string id="20402">Samodejno poberi slièico igralca</string>
- <string id="20403">Nastavi slièico igralca</string>
- <string id="20404">Studio:</string>
+ <string id="20401">Predvajaj videospot</string>
+ <string id="20402">Samodejno naloži sliÄico igralca ob dodajanju v knjižnico</string>
+ <string id="20403">Nastavi sliÄico igralca</string>
+
<string id="20405">Odstrani zaznamek epizode</string>
<string id="20406">Ustvari zaznamek epizode</string>
- <string id="20407">Scraper Settings</string>
- <string id="20408">Prenašam informacije o videospotu</string>
- <string id="20409">Prenašam TV-Show informacije</string>
- <string id="20410">Prikolica</string>
+ <string id="20407">Nastavitve ponudnika</string>
+ <string id="20408">Prenašam informacije o videospotu</string>
+ <string id="20409">Prenašam informacije o TV seriji</string>
+ <string id="20410">Napovednik</string>
+ <string id="20411">Prikaži vse</string>
+ <string id="20412">Prikaži skupaj vse epizode TV serije</string>
+ <string id="20413">Prenesi ozadje</string>
+ <string id="20414">Prikaži ozadje v video in glasbenih knjižnicah</string>
+ <string id="20415">IÅ¡Äem nove vsebine</string>
+ <string id="20416">PrviÄ na sporedu</string>
+ <string id="20417">Scenarist</string>
+ <string id="20418">ÄŒista imena datotek in map</string>
+
+ <string id="20420">Nikoli</string>
+ <string id="20421">ÄŒe vsebuje le eno sezono</string>
+ <string id="20422">Vedno</string>
+ <string id="20423">Ima napovednik</string>
+ <string id="20424">Nepravilno</string>
+ <string id="20425">Projekcija ozadij</string>
+ <string id="20426">Izvozi v eno datoteko</string>
+ <string id="20427">ali za vsak vnos loÄeno?</string>
+ <string id="20428">Ena datoteka</string>
+ <string id="20429">LoÄeno</string>
+ <string id="20430">Izvozi sliÄice in ozadja?</string>
+ <string id="20431">Prepiši stare datoteke?</string>
+ <string id="20432">IzloÄi pot iz posodobitev knjižnice</string>
+ <string id="20433">IzloÄi sliÄice in informacije o videu</string>
+ <string id="20434">Zbirke</string>
+ <string id="20435">Nastavi sliÄico filmske zbirke</string>
+ <string id="20436">Izvozi sliÄice izvajalcev?</string>
+ <string id="20437">Izberi ozadje</string>
+ <string id="20438">Krajevno ozadje</string>
+ <string id="20439">Brez ozadja</string>
+ <string id="20440">Trenutno ozadje</string>
+ <string id="20441">Oddaljeno ozadje</string>
+ <string id="20442">Spremeni vsebino</string>
+ <string id="20443">Želite osvežiti informacije</string>
+ <string id="20444">vseh elementov s to potjo?</string>
+ <string id="20445">Ozadje</string>
+ <string id="20446">Najdene krajevno shranjene informacije.</string>
+ <string id="20447">Zanemari in prenesi z interneta?</string>
+ <string id="20448">Ne morem prenesti informacij</string>
+ <string id="20449">Ne morem se povezati na oddaljeni strežnik</string>
+ <string id="20450">Želite nadaljevati z iskanjem?</string>
+ <string id="20451">Države</string>
+ <string id="20452">epizoda</string>
+ <string id="20453">epizode</string>
+ <string id="20454">Listener</string>
+ <string id="20455">Listeners</string>
<!-- up to 21329 is reserved for the video db !! !-->
- <string id="21330">Prikaži skrite datoteke in mape</string>
+ <string id="21330">Prikaži skrite datoteke in mape</string>
<string id="21331">TuxBox odjemalec</string>
- <string id="21332">WARNING: Target TuxBox device is in Recording-Mode!</string>
- <string id="21333">The Stream will be Stopped!</string>
- <string id="21334">Zap to Channel: %s Failed!</string>
- <string id="21335">Are you sure to start the stream?</string>
- <string id="21336">Connecting to: %s</string>
- <string id="21337">TuxBox Device</string>
+ <string id="21332">OPOZORILO: Željena naprava TuxBox je v snemalnem naÄinu!</string>
+ <string id="21333">Pretok bo ustavljen!</string>
+ <string id="21334">Povezava s kanalom: %s ni uspel!</string>
+ <string id="21335">Ste prepriÄani, da želite zaÄeti pretok?</string>
+ <string id="21336">Povezan z: %s</string>
+ <string id="21337">TuxBox naprava</string>
<!-- up to 21355 is reserved for the TuxBox Client!! !-->
- <string id="21356">UPnP Glasba</string>
- <string id="21357">UPnP Video</string>
- <string id="21358">UPnP Pictures</string>
- <string id="21359">Dodaj Media skupno rabo...</string>
- <string id="21360">Vkljuèi UPnP strežnik</string>
- <string id="21361">Urejaj UPnP skupno rabo glasbe</string>
- <string id="21362">Urejaj UPnP Video skupno rabo</string>
- <string id="21363">Urejaj UPnP skupno rabo Slik</string>
- <string id="21364">Uredi Media skupno rabo</string>
- <string id="21365">Odstrani Media skupno rabo</string>
+ <string id="21359">Dodaj multimedijsko skupno rabo...</string>
+ <string id="21360">Deli video in glasbo preko UPnP</string>
+
+ <string id="21364">Uredi multimedijsko skupno rabo</string>
+ <string id="21365">Odstrani multimedijsko skupno rabo</string>
<string id="21366">Mapa s podnapisi</string>
- <string id="21367">Movie &amp; Dodatna mapa s podnapisi</string>
+ <string id="21367">Film &amp; dodatna mapa s podnapisi</string>
- <string id="21370">Vkljuèi navigacijske zvoke med predvajanjem vsebine</string>
- <string id="21371">Slièice</string>
- <string id="21372">Privzeta DVD regija</string>
- <string id="21373">Video nastavitve</string>
- <string id="21374">Video naèin</string>
- <string id="21375">Normal</string>
- <string id="21376">Letterbox</string>
- <string id="21377">Widescreen</string>
- <string id="21378">Omogoèi 480p</string>
- <string id="21379">Omogoèi 720p</string>
- <string id="21380">Omogoèi 1080i</string>
- <string id="21381">Vnesi ime za Predvajalni seznam</string>
- <string id="21382">Onemogoèi ikono "Dodaj izvor" v seznamih datotek</string>
- <string id="21383">Vkljuèi drsnike</string>
- <string id="21384">Uporabi filter "Pogledani" v video knjižnici</string>
+ <string id="21369">VkljuÄi miÅ¡ko</string>
+ <string id="21370">VkljuÄi navigacijske zvoke med predvajanjem vsebine</string>
+ <string id="21371">SliÄica</string>
+ <string id="21372">Vsiljena DVD regija</string>
+ <string id="21373">Izhod slike</string>
+ <string id="21374">Razmerje slike</string>
+ <string id="21375">ObiÄajno</string>
+ <string id="21376">ÄŒrni robovi</string>
+ <string id="21377">Å irokozaslonsko</string>
+ <string id="21378">OmogoÄi 480p</string>
+ <string id="21379">OmogoÄi 720p</string>
+ <string id="21380">OmogoÄi 1080i</string>
+ <string id="21381">Vnesi ime predvajalnega seznama</string>
+ <string id="21382">Prikaži gumb "Dodaj izvor" v seznamih datotek</string>
+ <string id="21383">VkljuÄi drsnike</string>
+ <string id="21384">OmogoÄi preklop filtriranja pogledanih vsebin v video knjižnici</string>
<string id="21385">Odpri</string>
- <string id="21386">Acoustic Management Level</string>
+ <string id="21386">Upravljanje z akustiÄnimi nivoji</string>
<string id="21387">Hitro</string>
<string id="21388">Tiho</string>
- <string id="21389">Omogoèi ozadja po meri</string>
- <string id="21390">Power Management Level</string>
- <string id="21391">High Power</string>
- <string id="21392">Low Power</string>
- <string id="21393">High Standby</string>
- <string id="21394">Low Standby</string>
- <string id="21395">Unable to cache files bigger than 4 gb</string>
- <string id="21396">Chapter</string>
- <string id="21397">Visoko kvalitetno senèenje V2</string>
- <string id="21398">Omogoèi predvajalni seznam ob zagonu</string>
- <string id="21399">Uporabi TWEEN animacije</string>
+ <string id="21389">OmogoÄi ozadja po meri</string>
+ <string id="21390">Upravljanje z nivoji varÄevanja energije</string>
+ <string id="21391">Velika moÄ</string>
+ <string id="21392">Nizka moÄ</string>
+ <string id="21393">Dolga pripravljenost</string>
+ <string id="21394">Kratka pripravljenost</string>
+ <string id="21395">NemogoÄe zaÄasno pomnenje datotek veÄjih od 4GB</string>
+ <string id="21396">Poglavje</string>
+ <string id="21397">Visoko kvalitetno senÄenje v2</string>
+ <string id="21398">OmogoÄi predvajalni seznam ob zagonu</string>
+ <string id="21399">Uporabi tween animacije</string>
<string id="21400">vsebuje</string>
<string id="21401">ne vsebuje</string>
<string id="21402">je</string>
<string id="21403">ni</string>
- <string id="21404">priène z</string>
- <string id="21405">konèa z</string>
- <string id="21406">veèje kot</string>
+ <string id="21404">priÄne z</string>
+ <string id="21405">konÄa z</string>
+ <string id="21406">veÄje kot</string>
<string id="21407">manj kot</string>
<string id="21408">po</string>
<string id="21409">pred</string>
<string id="21410">v zadnjih</string>
<string id="21411">ne v zadnjih</string>
-
+ <string id="21412">Ponudniki</string>
+ <string id="21413">Privzet ponudnik filmov</string>
+ <string id="21414">Privzet ponudnik TV serij</string>
+ <string id="21415">Privzet ponudnik videospotov</string>
+ <string id="21416">OmogoÄi zasilno vraÄanje glede na jezik ponudnika</string>
+ <string id="21417">- Nastavitve</string>
+ <string id="21418">VeÄjezikovno</string>
+ <string id="21419">Ni prisotnih ponudnikov</string>
<string id="21420">Vrednost ustrezanja</string>
- <string id="21421">Novo pravilo pametnega predvajalnega seznama</string>
- <string id="21422">Match songs where</string>
+ <string id="21421">Pravilo pametnega predvajalnega seznama</string>
+ <string id="21422">OznaÄi elemente kjer</string>
<string id="21423">Novo pravilo...</string>
- <string id="21424">Pesem mora ustrezati</string>
- <string id="21425">vsa pravila</string>
- <string id="21426">eno ali veè pravil</string>
+ <string id="21424">Elementi morajo ustrezati</string>
+ <string id="21425">vsem pravilom</string>
+ <string id="21426">enemu ali veÄ pravilom</string>
<string id="21427">Omeji na</string>
<string id="21428">Brez omejitve</string>
- <string id="21429">Urejeno po</string>
- <string id="21430">Narašèajoèe</string>
- <string id="21431">padajoèe</string>
+ <string id="21429">RazvrÅ¡Äeno po</string>
+ <string id="21430">naraÅ¡ÄajoÄe</string>
+ <string id="21431">padajoÄe</string>
<string id="21432">Uredi pameten predvajalni seznam</string>
<string id="21433">Ime predvajalnega sezmama</string>
- <string id="21434">Najdi pesmi z ujemanjem</string>
+ <string id="21434">Najdi pesmi kjer</string>
<string id="21435">Uredi</string>
- <string id="21436">%i pesmi</string>
+ <string id="21436">%i elementov</string>
<string id="21437">Nov pameten predvajalni seznam...</string>
<string id="21438">%c pogon</string>
- <string id="21439">Uredo Party naèin pravila</string>
+ <string id="21439">Uredi pravila zabavnega naÄina</string>
+ <string id="21440">DomaÄa mapa</string>
+ <string id="21441">Å tevilo ogledov</string>
+ <string id="21442">Ime epizode</string>
+ <string id="21443">LoÄljivost slike</string>
+ <string id="21444">ZvoÄni kanali</string>
+ <string id="21445">Slikovni kodek</string>
+ <string id="21446">ZvoÄni kodek</string>
+ <string id="21447">Jezik zvoka</string>
+ <string id="21448">Jezik podnapisov</string>
+ <string id="21449">Oddaljeno upravljanje pošilja ukaze tipkovnice</string>
+ <string id="21450">- Uredi</string>
+ <string id="21451">Potrebna je internetna povezava.</string>
+ <string id="21452">Prenesi veÄ...</string>
+ <string id="21453">Korenski datoteÄni sistem</string>
<string id="21800">Ime datoteke</string>
<string id="21801">Pot datoteke</string>
<string id="21802">Velikost datoteke</string>
- <string id="21803">Èas/datum datoteke</string>
- <string id="21804">Slide Index</string>
- <string id="21805">Resolucija</string>
+ <string id="21803">ÄŒas/datum datoteke</string>
+ <string id="21804">Å tevilka diapozitiva</string>
+ <string id="21805">LoÄljivost</string>
<string id="21806">Komentar</string>
- <string id="21807">Barvno/ÈB</string>
- <string id="21808">Jpeg Process</string>
+ <string id="21807">Barvno/ÄŒB</string>
+ <string id="21808">JPEG postopek</string>
- <string id="21820">Datum/èas</string>
+ <string id="21820">Datum/ÄŒas</string>
<string id="21821">Opis</string>
- <string id="21822">Camera Make</string>
- <string id="21823">Camera Model</string>
- <string id="21824">Exif Comment</string>
+ <string id="21822">Znamka fotoaparata</string>
+ <string id="21823">Model fotoaparata</string>
+ <string id="21824">EXIF komentar</string>
<string id="21825">Firmware</string>
- <string id="21826">Aperture</string>
- <string id="21827">Focal Length</string>
- <string id="21828">Focus Distance</string>
+ <string id="21826">Zaslonka</string>
+ <string id="21827">GoriÅ¡Äna razdalja</string>
+ <string id="21828">Oddaljenost ostrenja</string>
<string id="21829">Exposure</string>
<string id="21830">Exposure Time</string>
<string id="21831">Exposure Bias</string>
<string id="21832">Exposure Mode</string>
- <string id="21833">Flash Used</string>
- <string id="21834">Whitebalance</string>
- <string id="21835">Light Source</string>
+ <string id="21833">Uporaba bliskavice</string>
+ <string id="21834">Beline</string>
+ <string id="21835">Vir svetlobe</string>
<string id="21836">Metering Mode</string>
<string id="21837">ISO</string>
- <string id="21838">Digital Zoom</string>
- <string id="21839">CCD Width</string>
- <string id="21840">GPS Latitude</string>
- <string id="21841">GPS Longitude</string>
- <string id="21842">GPS Altitude</string>
- <string id="21843">Orientation</string>
-
- <string id="21860">Supplemental Categories</string>
- <string id="21861">Keywords</string>
- <string id="21862">Caption</string>
- <string id="21863">Author</string>
- <string id="21864">Headline</string>
- <string id="21865">Special Instructions</string>
- <string id="21866">Category</string>
+ <string id="21838">Digitalna poveÄava</string>
+ <string id="21839">Å irina CCD</string>
+ <string id="21840">GPS Zemljepisna Å¡irina</string>
+ <string id="21841">GPS Zemljepisna dolžina</string>
+ <string id="21842">GPS Nadmorska višina</string>
+ <string id="21843">Orientacija</string>
+
+ <string id="21860">Nadomestne kategorije</string>
+ <string id="21861">KljuÄne besede</string>
+ <string id="21862">Zapis</string>
+ <string id="21863">Avtor</string>
+ <string id="21864">Naslov</string>
+ <string id="21865">Posebna navodila</string>
+ <string id="21866">Kategorija</string>
<string id="21867">Byline</string>
<string id="21868">Byline Title</string>
- <string id="21869">Credit</string>
- <string id="21870">Source</string>
- <string id="21871">Copyright Notice</string>
- <string id="21872">Object Name</string>
- <string id="21873">City</string>
- <string id="21874">State</string>
- <string id="21875">Country</string>
- <string id="21876">Original Tx Reference</string>
- <string id="21877">Date Created</string>
- <string id="21878">Copyright Flag</string>
- <string id="21879">Country Code</string>
- <string id="21880">Reference Service</string>
- <string id="21881">Vkljuèi UPnP Renderer</string>
- <string id="21882">Poskusi preskoèiti intro pred DVD Menu-jem</string>
- <string id="21883">Ripped Audio CDs</string>
+ <string id="21869">Zasluge</string>
+ <string id="21870">Vir</string>
+ <string id="21871">Avtorske pravice</string>
+ <string id="21872">Ime predmeta</string>
+ <string id="21873">Mesto</string>
+ <string id="21874">Zvezna država</string>
+ <string id="21875">Država</string>
+ <string id="21876">Izvorna Tx referenca</string>
+ <string id="21877">Datum objave</string>
+ <string id="21878">Oznaka avtorskih pravic</string>
+ <string id="21879">Koda države</string>
+ <string id="21880">Storitev referenc</string>
+ <string id="21881">Dovoli upravljanje z XBMC preko UPnP</string>
+ <string id="21882">Poskusi preskoÄiti uvod pred DVD menujem</string>
+ <string id="21883">Shranjena glasba</string>
+ <string id="21884">Prenesi informacije vseh izvajalcev</string>
+ <string id="21885">Prenašam informacije o albumu</string>
+ <string id="21886">Prenašam informacije o izvajalcu</string>
+ <string id="21887">Življenjepis</string>
+ <string id="21888">Diskografija</string>
+ <string id="21889">IÅ¡Äem izvajalca</string>
+ <string id="21890">Izberi izvajalca</string>
+ <string id="21891">Informacije o izvajalcu</string>
+ <string id="21892">Inštrumenti</string>
+ <string id="21893">Rojstvo</string>
+ <string id="21894">Ustanovljena</string>
+ <string id="21895">Teme</string>
+ <string id="21896">Razidena</string>
+ <string id="21897">Smrt</string>
+ <string id="21898">Leta aktivnosti</string>
+ <string id="21899">Založba</string>
+ <string id="21900">Rojstvo/Ustanovitev</string>
<!-- strings 21900 thru 21999 reserved for slideshow info -->
- <string id="22000">Posodobi knjižnico ob zagonu</string>
- <string id="22001">Vedno posodabljaj knjižnico v ozadju</string>
+ <string id="22000">Posodobi knjižnico ob zagonu</string>
+ <string id="22001">Posodabljaj knjižnico v ozadju</string>
+ <string id="22002">- DNS pripona</string>
- <string id="29999">Uveljavi nastavitve filtra proti utripanju za igre</string>
+ <string id="22003">%2.3fs</string>
+ <string id="22004">Zaostanek za: %2.3fs</string>
+ <string id="22005">Prehitevanje za: %2.3fs</string>
+ <string id="22006">Zamik podnapisov</string>
+ <string id="22007">Gonilnik OpenGL:</string>
+ <string id="22008">Izris OpenGL:</string>
+ <string id="22009">RazliÄica OpenGL:</string>
+ <string id="22010">Temperatura GPU:</string>
+ <string id="22011">Temperatura CPU:</string>
+ <string id="22012">Celoten pomnilnik</string>
+ <string id="22013">Podatki o profilu</string>
+ <string id="22014">Zatemni med prekinitvijo predvajanja videa</string>
+ <string id="22015">Vsi posnetki</string>
+ <string id="22016">Po naslovu</string>
+ <string id="22017">Po skupini</string>
+ <string id="22018">Programi v živo</string>
+ <string id="22019">Posnetki po naslovu</string>
+ <string id="22020">VodiÄ</string>
+ <string id="22021">PopaÄi razmerje slike, da se izognete Ärnim robovom</string>
+ <string id="22022">V seznamih prikaži video datoteke</string>
+ <string id="22023">Gonilnik DirectX:</string>
+ <string id="22024">RazliÄica Direct3D:</string>
+
+ <!-- strings 22030 thru 22060 reserved for karaoke -->
+ <string id="22030">Pisava</string>
+ <string id="22031">- Velikost</string>
+ <string id="22032">- Barve</string>
+ <string id="22033">- Nabor znakov</string>
+ <string id="22034">Izvozi naslove karaok kot HTML</string>
+ <string id="22035">Izvozi naslove karaok kot CSV</string>
+ <string id="22036">Uvozi naslove karaok...</string>
+ <string id="22037">Samodejno prikaži izbor pesmi</string>
+ <string id="22038">Izvozi naslove karaok...</string>
+ <string id="22039">Vnesi Å¡tevilko pesmi</string>
+ <string id="22040">bela/zelena</string>
+ <string id="22041">bela/rdeÄa</string>
+ <string id="22042">bela/modra</string>
+ <string id="22043">Ärna/bela</string>
+
+ <string id="22079">Privzeta možnost izbire</string>
+ <string id="22080">Izberi</string>
+ <string id="22081">Prikaži veÄ informacij</string>
+ <string id="22082">VeÄ...</string>
+ <string id="22083">Predvajaj vse</string>
+
+ <string id="23049">Teletekst ni na voljo</string>
+ <string id="23050">VkljuÄi teletekst</string>
+ <string id="23051">Del %i</string>
+ <string id="23052">Medpomnjenje %i bytov</string>
+ <string id="23053">Ustavlja</string>
+ <string id="23054">TeÄe</string>
+
+ <!-- strings 23100 thru 23150 reserved for external player -->
+ <string id="23100">Aktiven zunanji predvajalnik</string>
+ <string id="23101">Kliknite OK za prekinitev predvajalnika</string>
+
+ <string id="23104">Kliknite OK, ko se predvajanje konÄa</string>
+
+ <!-- strings 24000 thru 24299 reserved for the Add-ons framework -->
+ <string id="24000">Dodatek</string>
+ <string id="24001">Dodatki</string>
+ <string id="24002">Možnosti dodatka</string>
+ <string id="24003">Informacije o dodatku</string>
+
+ <string id="24005">Multimedijski viri</string>
+ <string id="24007">Informacije o filmu</string>
+ <string id="24008">Ohranjevalnik zaslona</string>
+ <string id="24009">Skripta</string>
+ <string id="24010">Vizualizacija</string>
+ <string id="24011">SkladiÅ¡Äe dodatkov</string>
+ <string id="24012">Podnapisi</string>
+ <string id="24013">Besedilo pesmi</string>
+ <string id="24014">Informacije o TV serijah</string>
+ <string id="24015">Informacije o videospotih</string>
+ <string id="24016">Informacije o albumih</string>
+ <string id="24017">Informacije o izvajalcih</string>
+ <string id="24018">Storitve</string>
+
+ <string id="24020">Prilagodi</string>
+ <string id="24021">OnemogoÄi</string>
+ <string id="24022">OmogoÄi</string>
+ <string id="24023">Dodatek je onemogoÄen</string>
+ <string id="24027">Vreme</string>
+ <string id="24028">Weather.com (obiÄajno)</string>
+ <string id="24030">Tega dodatka ni mogoÄe dodatno nastaviti</string>
+ <string id="24031">Napaka pri nalaganju nastavitev</string>
+ <string id="24032">Vsi dodatki</string>
+ <string id="24033">Prenesi dodatke</string>
+ <string id="24034">Preveri za posodobitve</string>
+ <string id="24035">Vsili osvežitev</string>
+ <string id="24036">Zgodovina sprememb</string>
+ <string id="24037">Odstrani</string>
+ <string id="24038">Namesti</string>
+ <string id="24039">OnemogoÄeni dodatki</string>
+ <string id="24040">(PoÄisti trenutne nastavitve)</string>
+ <string id="24041">Namesti iz zip datoteke</string>
+ <string id="24042">Prenašam %i%%</string>
+ <string id="24043">Na voljo so posodobitve</string>
+ <string id="24044">Odvisnostim ni zadoÅ¡Äeno</string>
+ <string id="24045">Dodatek nima pravilne strukture</string>
+
+ <string id="24050">Dodatki na voljo</string>
+ <string id="24051">RazliÄica:</string>
+ <string id="24052">Opozorilo</string>
+ <string id="24053">Licenca:</string>
+ <string id="24054">Zgodovina sprememb</string>
+ <string id="24059">Želite omogoÄiti ta dodatek?</string>
+ <string id="24060">Želite onemogoÄiti ta dodatek?</string>
+ <string id="24061">Na voljo je posodobitev dodatka!</string>
+ <string id="24062">OmogoÄeni dodatki</string>
+ <string id="24063">Samodejna posodobitev</string>
+ <string id="24064">Dodatek je omogoÄen</string>
+ <string id="24065">Dodatek je posodobljen</string>
+ <string id="24066">PrekliÄem prenos dodatka?</string>
+ <string id="24067">Dodatki, ki se trenutno prenašajo</string>
+ <string id="24068">Na voljo je posodobitev</string>
+ <string id="24069">Posodobitev</string>
+
+ <string id="24070">Dodatka ni mogoÄe zagnati.</string>
+ <string id="24071">Pojavila se je neznana napaka.</string>
+ <string id="24072">Potrebne so dodatne nastavitve</string>
+ <string id="24073">Ni se mogoÄe povezati</string>
+ <string id="24074">Potrebuje ponoven zagon</string>
+ <string id="24075">OnemogoÄi</string>
+ <string id="24080">Poskusim ponovno povezati?</string>
+ <string id="24089">Ponovni zagoni dodatkov</string>
+ <string id="24090">Zakleni upravljalnik z dodatki</string>
+
+ <string id="24096">Dodatek je bil v skladiÅ¡Äu oznaÄen kot nedelujoÄ.</string>
+ <string id="24097">Ga želite onemogoÄiti na vaÅ¡em sistemu?</string>
+ <string id="24098">NedelujoÄ</string>
+ <string id="24099">Želite preklopiti na to preobleko?</string>
+ <string id="25000">Obvestila</string>
+
+ <!-- strings 29800 thru 29998 reserved strings used only in the default Project Mayhem III skin and not c++ code -->
+ <string id="29800">NaÄin knjižnice</string>
+ <string id="29801">Tipkovnica QWERTY</string>
+ <string id="29802">Pretvori zvok v uporabi</string>
<!-- strings 30000 thru 30999 reserved for plugins and plugin settings -->
<!-- strings 31000 thru 31999 reserved for skins -->
+ <!-- strings 32000 thru 32999 reserved for scripts -->
+ <!-- strings 33000 thru 33999 reserved for common strings used in addons -->
+ <string id="33001">Kvaliteta napovednika</string>
+ <string id="33002">Pretok</string>
+ <string id="33003">Prenesi</string>
+ <string id="33004">Prenesi &amp; predvajaj</string>
+ <string id="33005">Prenesi &amp; shrani</string>
+ <string id="33006">Danes</string>
+ <string id="33007">Jutri</string>
+ <string id="33008">Shranjujem</string>
+ <string id="33009">Kopiram</string>
+ <string id="33010">Nastavi mapo prenosov</string>
+ <string id="33011">Trajanje iskanja</string>
+ <string id="33012">Kratko</string>
+ <string id="33013">Dolgo</string>
+ <string id="33014">Uporabi DVD predvajalnik namesto obiÄajnega</string>
+ <string id="33015">Vprašaj za prenos pred predvajanjem</string>
+ <string id="33016">Odlomki</string>
+ <string id="33017">Ponovno zaženi vtiÄnik za vklop</string>
+ <string id="33018">ZveÄer</string>
+ <string id="33019">Jutri zveÄer</string>
+ <string id="33020">Stanje</string>
+ <string id="33021">Padavine</string>
+ <string id="33022">Dež</string>
+ <string id="33023">Vlažno</string>
+ <string id="33024">ObÄuti se</string>
+ <string id="33025">Opazovano</string>
+ <string id="33026">Odmik od obiÄajnega</string>
+ <string id="33027">SonÄni vzhod</string>
+ <string id="33028">SonÄni zahod</string>
+ <string id="33029">Podrobnosti</string>
+ <string id="33030">Izgled</string>
+ <string id="33031">Coverflow</string>
+ <string id="33032">Prevedi besedilo</string>
+ <string id="33033">Zgradi seznam %s kategorije</string>
+ <string id="33034">36 ur</string>
+ <string id="33035">Zemljevidi</string>
+ <string id="33036">Vsako uro</string>
+ <string id="33037">Vikend</string>
+ <string id="33038">%s dan</string>
+ <string id="33049">Opozorilo</string>
+ <string id="33050">Opozorila</string>
+ <string id="33051">Izberite vaš</string>
+ <string id="33052">Preveri</string>
+ <string id="33053">Nastavite</string>
+ <string id="33054">Letni Äasi</string>
+ <string id="33055">Uporabite vaš</string>
+ <string id="33056">Glejte vaš</string>
+ <string id="33057">Poslušajte</string>
+ <string id="33058">Poglejte vaš</string>
+ <string id="33059">Nastavite</string>
+ <string id="33060">Zapusti</string>
+ <string id="33061">Menu</string>
+ <string id="33062">Predvajaj</string>
+ <string id="33063">Možnosti</string>
+ <string id="33065">Urejevalnik</string>
+ <string id="33066">O vašem</string>
+ <string id="33067">Ocena</string>
+ <string id="33068">Ozadje</string>
+ <string id="33069">Ozadja</string>
+ <string id="33070">Poljubno ozadje</string>
+ <string id="33071">Poljubna ozadja</string>
+ <string id="33072">Preberite Berime</string>
+ <string id="33073">Preberite Zgodovino sprememb</string>
+ <string id="33074">Ta razliÄica %s za delovanje zahteva</string>
+ <string id="33075">XBMC revizije %s ali višje.</string>
+ <string id="33076">Posodobite XBMC.</string>
+ <string id="33077">Ni najdenih nobenih podatkov!</string>
+ <string id="33078">Naslednja stran</string>
+ <string id="33079">Ljubim</string>
+ <string id="33080">Sovražim</string>
+ <string id="33081">Ta datoteka je združena. Izberite del za predvajanje.</string>
+ <string id="33082">Pot do skripte</string>
+ <string id="33083">VkljuÄi gumb poljubne skripte</string>
+
+ <string id="33100">Ni mogoÄe zagnati</string>
+ <string id="33101">Spletni strežnik</string>
+ <string id="33102">Strežnik dogodkov</string>
+ <string id="33103">Strežnik oddaljene komunikacije</string>
+
+ <!-- translators: no need to add these to your language files -->
+ <string id="34000">Lame</string>
+ <string id="34001">Vorbis</string>
+ <string id="34002">Wav</string>
+ <string id="34003">DXVA2</string>
+ <string id="34004">VAAPI</string>
+ <string id="34005">Flac</string>
+
+ <string id="34100">Sistem zvoÄnikov</string>
+ <string id="34101">2.0</string>
+ <string id="34102">2.1</string>
+ <string id="34103">3.0</string>
+ <string id="34104">3.1</string>
+ <string id="34105">4.0</string>
+ <string id="34106">4.1</string>
+ <string id="34107">5.0</string>
+ <string id="34108">5.1</string>
+ <string id="34109">7.0</string>
+ <string id="34110">7.1</string>
+ <!-- 34112-34200 reserved for future use -->
</strings>
diff --git a/lib/DllWAVPack.h b/lib/DllWAVPack.h
deleted file mode 100644
index f98edc2c3e..0000000000
--- a/lib/DllWAVPack.h
+++ /dev/null
@@ -1,163 +0,0 @@
-#pragma once
-
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
-#if defined(WIN32)
- #include "wavpack.h"
-#else
- #include <wavpack/wavpack.h>
-#endif
-#include "DynamicDll.h"
-#include "utils/log.h"
-
-#if defined(_LINUX)
-// API changes from 4.2 to 4.60.1.
-// Windows is using 4.2 from in tree source
-// Linux/OSX/iOS is using 4.60.1 system lib from upstream.
-// We can't tell the difference between them.
-#define stream_reader WavpackStreamReader
-#define blockout_f WavpackBlockOutput
-#endif
-
-class DllWavPackInterface
-{
-public:
- virtual ~DllWavPackInterface() {}
- virtual WavpackContext *WavpackOpenFileInputEx (stream_reader *reader, void *wv_id, void *wvc_id, char *error, int flags, int norm_offset)=0;
- virtual WavpackContext *WavpackOpenFileInput (const char *infilename, char *error, int flags, int norm_offset)=0;
- virtual int WavpackGetVersion (WavpackContext *wpc)=0;
- virtual unsigned int WavpackUnpackSamples (WavpackContext *wpc, int *buffer, unsigned int samples)=0;
- virtual unsigned int WavpackGetNumSamples (WavpackContext *wpc)=0;
- virtual unsigned int WavpackGetSampleIndex (WavpackContext *wpc)=0;
- virtual int WavpackGetNumErrors (WavpackContext *wpc)=0;
- virtual int WavpackLossyBlocks (WavpackContext *wpc)=0;
- virtual int WavpackSeekSample (WavpackContext *wpc, unsigned int sample)=0;
- virtual WavpackContext *WavpackCloseFile (WavpackContext *wpc)=0;
- virtual unsigned int WavpackGetSampleRate (WavpackContext *wpc)=0;
- virtual int WavpackGetBitsPerSample (WavpackContext *wpc)=0;
- virtual int WavpackGetBytesPerSample (WavpackContext *wpc)=0;
- virtual int WavpackGetNumChannels (WavpackContext *wpc)=0;
- virtual int WavpackGetReducedChannels (WavpackContext *wpc)=0;
- virtual int WavpackGetMD5Sum (WavpackContext *wpc, unsigned char data[16])=0;
- virtual unsigned int WavpackGetWrapperBytes (WavpackContext *wpc)=0;
- virtual unsigned char *WavpackGetWrapperData (WavpackContext *wpc)=0;
- virtual void WavpackFreeWrapper (WavpackContext *wpc)=0;
- virtual double WavpackGetProgress (WavpackContext *wpc)=0;
- virtual unsigned int WavpackGetFileSize (WavpackContext *wpc)=0;
- virtual double WavpackGetRatio (WavpackContext *wpc)=0;
- virtual double WavpackGetAverageBitrate (WavpackContext *wpc, int count_wvc)=0;
- virtual double WavpackGetInstantBitrate (WavpackContext *wpc)=0;
- virtual int WavpackGetTagItem (WavpackContext *wpc, const char *item, char *value, int size)=0;
- virtual int WavpackAppendTagItem (WavpackContext *wpc, const char *item, const char *value)=0;
- virtual int WavpackWriteTag (WavpackContext *wpc)=0;
- virtual WavpackContext *WavpackOpenFileOutput (blockout_f blockout, void *wv_id, void *wvc_id)=0;
- virtual int WavpackSetConfiguration (WavpackContext *wpc, WavpackConfig *config, unsigned int total_samples)=0;
- virtual int WavpackAddWrapper (WavpackContext *wpc, void *data, unsigned int bcount)=0;
- virtual int WavpackStoreMD5Sum (WavpackContext *wpc, unsigned char data[16])=0;
- virtual int WavpackPackInit (WavpackContext *wpc)=0;
- virtual int WavpackPackSamples (WavpackContext *wpc, int *sample_buffer, unsigned int sample_count)=0;
- virtual int WavpackFlushSamples (WavpackContext *wpc)=0;
- virtual void WavpackUpdateNumSamples (WavpackContext *wpc, void *first_block)=0;
- virtual void *WavpackGetWrapperLocation (void *first_block)=0;
-};
-
-class DllWavPack : public DllDynamic, DllWavPackInterface
-{
- DECLARE_DLL_WRAPPER(DllWavPack, DLL_PATH_WAVPACK_CODEC)
- DEFINE_METHOD6(WavpackContext*, WavpackOpenFileInputEx, (stream_reader* p1, void* p2, void* p3, char* p4, int p5, int p6))
- DEFINE_METHOD4(WavpackContext*, WavpackOpenFileInput, (const char* p1, char* p2, int p3, int p4))
- DEFINE_METHOD1(int, WavpackGetVersion, (WavpackContext* p1))
- DEFINE_METHOD3(unsigned int, WavpackUnpackSamples, (WavpackContext * p1, int * p2, unsigned int p3))
- DEFINE_METHOD1(unsigned int, WavpackGetNumSamples, (WavpackContext* p1))
- DEFINE_METHOD1(unsigned int, WavpackGetSampleIndex, (WavpackContext * p1))
- DEFINE_METHOD1(int, WavpackGetNumErrors, (WavpackContext * p1))
- DEFINE_METHOD1(int, WavpackLossyBlocks, (WavpackContext *p1))
- DEFINE_METHOD2(int, WavpackSeekSample, (WavpackContext *p1, unsigned int p2))
- DEFINE_METHOD1(WavpackContext*, WavpackCloseFile, (WavpackContext *p1))
- DEFINE_METHOD1(unsigned int, WavpackGetSampleRate, (WavpackContext *p1))
- DEFINE_METHOD1(int, WavpackGetBitsPerSample, (WavpackContext *p1))
- DEFINE_METHOD1(int, WavpackGetBytesPerSample, (WavpackContext *p1))
- DEFINE_METHOD1(int, WavpackGetNumChannels, (WavpackContext *p1))
- DEFINE_METHOD1(int, WavpackGetReducedChannels, (WavpackContext *p1))
- DEFINE_METHOD2(int, WavpackGetMD5Sum, (WavpackContext *p1, unsigned char p2[16]))
- DEFINE_METHOD1(unsigned int, WavpackGetWrapperBytes, (WavpackContext *p1))
- DEFINE_METHOD1(unsigned char*, WavpackGetWrapperData, (WavpackContext *p1))
- DEFINE_METHOD1(void, WavpackFreeWrapper, (WavpackContext *p1))
- DEFINE_METHOD1(double, WavpackGetProgress, (WavpackContext *p1))
- DEFINE_METHOD1(unsigned int, WavpackGetFileSize, (WavpackContext *p1))
- DEFINE_METHOD1(double, WavpackGetRatio, (WavpackContext *p1))
- DEFINE_METHOD2(double, WavpackGetAverageBitrate, (WavpackContext *p1, int p2))
- DEFINE_METHOD1(double, WavpackGetInstantBitrate, (WavpackContext *p1))
- DEFINE_METHOD4(int, WavpackGetTagItem, (WavpackContext *p1, const char *p2, char *p3, int p4))
- DEFINE_METHOD3(int, WavpackAppendTagItem, (WavpackContext *p1, const char *p2, const char *p3))
- DEFINE_METHOD1(int, WavpackWriteTag, (WavpackContext *p1))
- DEFINE_METHOD3(WavpackContext*, WavpackOpenFileOutput, (blockout_f p1, void *p2, void *p3))
- DEFINE_METHOD3(int, WavpackSetConfiguration, (WavpackContext *p1, WavpackConfig *p2, unsigned int p3))
- DEFINE_METHOD3(int, WavpackAddWrapper, (WavpackContext *p1, void *p2, unsigned int p3))
- DEFINE_METHOD2(int, WavpackStoreMD5Sum, (WavpackContext *p1, unsigned char p2[16]))
- DEFINE_METHOD1(int, WavpackPackInit, (WavpackContext *p1))
- DEFINE_METHOD3(int, WavpackPackSamples, (WavpackContext *p1, int *p2, unsigned int p3))
- DEFINE_METHOD1(int, WavpackFlushSamples, (WavpackContext *p1))
- DEFINE_METHOD2(void, WavpackUpdateNumSamples, (WavpackContext *p1, void *p2))
- DEFINE_METHOD1(void*, WavpackGetWrapperLocation, (void *p1))
- BEGIN_METHOD_RESOLVE()
- RESOLVE_METHOD(WavpackOpenFileInputEx)
- RESOLVE_METHOD(WavpackOpenFileInput)
- RESOLVE_METHOD(WavpackGetVersion)
- RESOLVE_METHOD(WavpackUnpackSamples)
- RESOLVE_METHOD(WavpackGetNumSamples)
- RESOLVE_METHOD(WavpackGetSampleIndex)
- RESOLVE_METHOD(WavpackGetNumErrors)
- RESOLVE_METHOD(WavpackLossyBlocks)
- RESOLVE_METHOD(WavpackSeekSample)
- RESOLVE_METHOD(WavpackCloseFile)
- RESOLVE_METHOD(WavpackGetSampleRate)
- RESOLVE_METHOD(WavpackGetBitsPerSample)
- RESOLVE_METHOD(WavpackGetBytesPerSample)
- RESOLVE_METHOD(WavpackGetNumChannels)
- RESOLVE_METHOD(WavpackGetReducedChannels)
- RESOLVE_METHOD(WavpackGetMD5Sum)
- RESOLVE_METHOD(WavpackGetWrapperBytes)
- RESOLVE_METHOD(WavpackGetWrapperData)
- RESOLVE_METHOD(WavpackFreeWrapper)
- RESOLVE_METHOD(WavpackGetProgress)
- RESOLVE_METHOD(WavpackGetFileSize)
- RESOLVE_METHOD(WavpackGetRatio)
- RESOLVE_METHOD(WavpackGetAverageBitrate)
- RESOLVE_METHOD(WavpackGetInstantBitrate)
- RESOLVE_METHOD(WavpackGetTagItem)
- RESOLVE_METHOD(WavpackAppendTagItem)
- RESOLVE_METHOD(WavpackWriteTag)
- RESOLVE_METHOD(WavpackOpenFileOutput)
- RESOLVE_METHOD(WavpackSetConfiguration)
- RESOLVE_METHOD(WavpackAddWrapper)
- RESOLVE_METHOD(WavpackStoreMD5Sum)
- RESOLVE_METHOD(WavpackPackInit)
- RESOLVE_METHOD(WavpackPackSamples)
- RESOLVE_METHOD(WavpackFlushSamples)
- RESOLVE_METHOD(WavpackUpdateNumSamples)
- RESOLVE_METHOD(WavpackGetWrapperLocation)
- END_METHOD_RESOLVE()
-};
diff --git a/lib/SlingboxLib/Makefile b/lib/SlingboxLib/Makefile
new file mode 100644
index 0000000000..dbf848c8f8
--- /dev/null
+++ b/lib/SlingboxLib/Makefile
@@ -0,0 +1,6 @@
+SRCS=SlingboxLib.cpp
+
+LIB=SlingboxLib.a
+
+include ../../Makefile.include
+-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
diff --git a/lib/SlingboxLib/SlingboxLib.cpp b/lib/SlingboxLib/SlingboxLib.cpp
new file mode 100644
index 0000000000..6f77545ae4
--- /dev/null
+++ b/lib/SlingboxLib/SlingboxLib.cpp
@@ -0,0 +1,985 @@
+//
+// Copyright (C) 2010-2011 Stonyx
+// http://www.stonyx.com
+//
+// This library is free software. You can redistribute it and/or modify it
+// under the terms of the GNU General Public License Version 2 (or at your
+// option any later version) as published by The Free Software Foundation.
+//
+// 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
+// General Public License for more details.
+//
+// If you did not received a copy of the GNU General Public License along
+// with this library see http://www.gnu.org/copyleft/gpl.html or write to
+// The Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+
+#include "SlingboxLib.h"
+
+#if defined _WIN32 || defined _WIN64
+#include <ws2tcpip.h>
+typedef int socklen_t;
+#else
+#include <errno.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#define INVALID_SOCKET (SOCKET)(~0)
+#define SOCKET_ERROR (-1)
+#endif
+
+// ********************
+// Public Functions
+// ********************
+
+// Default constructor.
+CSlingbox::CSlingbox()
+{
+ // Set all variables to default/invalid values
+ m_socCommunication = INVALID_SOCKET;
+ m_socStream = INVALID_SOCKET;
+ memset(m_szAddress, 0, sizeof(m_szAddress));
+ m_uiPort = 0;
+ m_usCode = 0;
+ m_usSequence = 0;
+ m_iChannel = -1;
+ m_iInput = -1;
+ memset(&m_receivedMessages, 0, sizeof(m_receivedMessages));
+}
+
+// Alternative constructor used to set the address (IP or hostname) and port of the
+// Slingbox we want to connect to. If no port is specified default port 5001 is used.
+CSlingbox::CSlingbox(const char * szAddress, unsigned int uiPort /* = 5001 */)
+{
+ // Call default constructor
+ CSlingbox();
+
+ // Set address and port variables to passed values
+ SetAddress(szAddress, uiPort);
+}
+
+// Destructor.
+CSlingbox::~CSlingbox()
+{
+ // Close all connections if they are still open
+ if (m_socStream != INVALID_SOCKET)
+ CloseSocket(m_socStream);
+ if (m_socCommunication != INVALID_SOCKET)
+ CloseSocket(m_socCommunication);
+}
+
+// Function used to find a Slingbox. Address and port of found Slingbox can be
+// retrieved with the GetAddress function afterwards.
+bool CSlingbox::FindSlingbox(unsigned int uiTimeout /* = 10 */)
+{
+ // Open a UDP connection
+ SOCKET socSocket = OpenSocket(NULL, 0, true);
+ if (socSocket != INVALID_SOCKET)
+ {
+ // Prepare and send data
+ uint32_t uiData[8];
+ memset(uiData, 0, sizeof(uiData));
+ uiData[0] = 0x00000101;
+ uiData[1] = 0x00000002;
+ if (Broadcast(socSocket, 5004, uiData, sizeof(uiData), uiTimeout) <= 0)
+ return false;
+
+ // Reset address and port variables
+ memset(m_szAddress, 0, sizeof(m_szAddress));
+ m_uiPort = 0;
+
+ // Give the Slingbox time to respond
+ Wait(250);
+
+ // Look for correct return message and properly set variables
+ if (!ReceiveMessage(socSocket, true, uiTimeout) ||
+ !m_receivedMessages.bFindMessage ||
+ strlen(m_szAddress) == 0 || m_uiPort == 0)
+ {
+ CloseSocket(socSocket);
+ return false;
+ }
+
+ // Close socket
+ CloseSocket(socSocket);
+ }
+ else
+ {
+ return false;
+ }
+
+ return true;
+}
+
+// Function used to retrieve the address and port of a Slingbox found with the
+// FindSlingbox function.
+void CSlingbox::GetAddress(char * szAddress, unsigned int uiAddressLength,
+ unsigned int * uiPort)
+{
+ // Copy requested data into passed pointers
+ memset(szAddress, 0, uiAddressLength);
+ strncpy(szAddress, m_szAddress, uiAddressLength - 1);
+ *uiPort = m_uiPort;
+}
+
+// Function used to set the address (IP or hostname) and port of the Slingbox we
+// want to connect to. If no port is specified default port 5001 is used.
+void CSlingbox::SetAddress(const char * szAddress, unsigned int uiPort /* = 5001 */)
+{
+ // Set address and port variables to passed values
+ strncpy(m_szAddress, szAddress, sizeof(m_szAddress) - 1);
+ m_uiPort = uiPort;
+}
+
+// Function used to login into the Slingbox.
+bool CSlingbox::Connect(bool bLoginAsAdmin, const char * szPassword)
+{
+ // Check if a communication connection is already open
+ if (m_socCommunication != INVALID_SOCKET)
+ return false;
+
+#if defined _WIN32 || defined _WIN64
+ // Enable use of the Winsock DLL
+ WSADATA wsaData;
+ if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
+ return false;
+#endif
+
+ // Open the communication connection
+ m_socCommunication = OpenSocket(m_szAddress, m_uiPort);
+ if (m_socCommunication == INVALID_SOCKET)
+ {
+#if defined _WIN32 || defined _WIN64
+ // Finish using the Winsock DLL
+ WSACleanup();
+#endif
+
+ return false;
+ }
+
+ // Prepare and send string
+ char * szString = "GET /stream.asf HTTP/1.1\r\nAccept: */*\r\n"
+ "Pragma: Sling-Connection-Type=Control, Session-Id=0\r\n\r\n";
+ if (Send(m_socCommunication, (void *)szString, strlen(szString)) <= 0)
+ {
+ // Close the communication connection
+ CloseSocket(m_socCommunication);
+ m_socCommunication = INVALID_SOCKET;
+
+#if defined _WIN32 || defined _WIN64
+ // Finish using the Winsock DLL
+ WSACleanup();
+#endif
+
+ return false;
+ }
+
+ // Invalidate variables
+ m_usCode = 0;
+ m_usSequence = 0;
+ m_iChannel = -1;
+ m_iInput = -1;
+
+ // Prepare and send the connect message
+ ConnectMessage message(bLoginAsAdmin, szPassword);
+ if (!SendReceiveMessage(m_socCommunication, &message) ||
+ !m_receivedMessages.bConnectMessage)
+ {
+ // Close the communication connection
+ CloseSocket(m_socCommunication);
+ m_socCommunication = INVALID_SOCKET;
+
+#if defined _WIN32 || defined _WIN64
+ // Finish using the Winsock DLL
+ WSACleanup();
+#endif
+
+ return false;
+ }
+
+ // Check if we got a valid code
+ if (m_usCode == 0)
+ {
+ // Close the communication connection
+ CloseSocket(m_socCommunication);
+ m_socCommunication = INVALID_SOCKET;
+
+#if defined _WIN32 || defined _WIN64
+ // Finish using the Winsock DLL
+ WSACleanup();
+#endif
+
+ return false;
+ }
+
+ return true;
+}
+
+// Function used to send the initialization message and initialize the stream.
+bool CSlingbox::InitializeStream()
+{
+ // Prepare and send start message
+ InitializationMessage message;
+ return SendReceiveMessage(m_socCommunication, &message) &&
+ m_receivedMessages.bInitializationMessage;
+}
+
+// Function used to set the stream settings.
+bool CSlingbox::StreamSettings(Resolution eResolution /* = RESOLUTION320X240 */,
+ uint32_t uiVideoBitrate /* = 704 */, uint32_t uiFrameRate /* = 30 */,
+ uint32_t uiVideoSmoothing /* = 50 */, uint32_t uiAudioBitrate /* = 64 */,
+ uint32_t uiIFrameInterval /* = 10 */)
+{
+ // Check if a resolution was specified that requires encryption
+ if (eResolution == RESOLUTION320X480 ||
+ eResolution == RESOLUTION640X240 ||
+ eResolution == RESOLUTION640X480)
+ {
+ // Enable encryption to enable requested resolution
+ EncryptionMessage message;
+ if (!SendReceiveMessage(m_socCommunication, &message) ||
+ !m_receivedMessages.bEncryptionMessage)
+ return false;
+ }
+
+ // Create and send video message with all the stream details
+ SettingsMessage message(eResolution, uiVideoBitrate, uiFrameRate, uiVideoSmoothing,
+ uiAudioBitrate, uiIFrameInterval);
+ if (!SendReceiveMessage(m_socCommunication, &message) ||
+ !m_receivedMessages.bSettingsMessage)
+ return false;
+
+ // Give the Slingbox time to change settings
+ Wait(500);
+
+ return true;
+}
+
+// Function used to start the stream.
+bool CSlingbox::StartStream()
+{
+ // Check if a stream connection is already open
+ if (m_socStream != INVALID_SOCKET)
+ return false;
+
+ // Open a new connection
+ m_socStream = OpenSocket(m_szAddress, m_uiPort);
+ if (m_socStream != INVALID_SOCKET)
+ {
+ // Prepare and send string
+ char szString[128] = "GET /stream.asf HTTP/1.1\r\nAccept: */*\r\n"
+ "Pragma: Sling-Connection-Type=Stream, Session-Id=";
+ sprintf(&szString[strlen(szString)], "%u", m_usCode);
+ strcpy(&szString[strlen(szString)], "\r\n\r\n");
+ if (Send(m_socStream, (void *)szString, strlen(szString)) <= 0)
+ {
+ // Close the stream connection
+ CloseSocket(m_socStream);
+ m_socStream = INVALID_SOCKET;
+
+ return false;
+ }
+
+ // Invalidate channel and input variables
+ m_iChannel = -1;
+ m_iInput = -1;
+
+ // Give the Slingbox time to respond
+ Wait(250);
+
+ // Check for correct return message
+ if (!ReceiveMessage(m_socCommunication) ||
+ !(m_receivedMessages.bChannelStatusMessage ||
+ m_receivedMessages.bInputStatusMessage))
+ {
+ // Close the stream connection
+ CloseSocket(m_socStream);
+ m_socStream = INVALID_SOCKET;
+
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return true;
+}
+
+// Function used to read the stream. Returns number of bytes actually received
+// or -1 if an error occured.
+int CSlingbox::ReadStream(void * pBuffer, unsigned int uiSize)
+{
+ return Receive(m_socStream, pBuffer, uiSize);
+}
+
+// Function used to stop the stream.
+bool CSlingbox::StopStream()
+{
+ // Close the stream connection
+ bool bSuccess = CloseSocket(m_socStream);
+ m_socStream = INVALID_SOCKET;
+
+ // Invalidate channel and input variables
+ m_iChannel = -1;
+ m_iInput = -1;
+
+ return bSuccess;
+}
+
+// Function used to disconnect from the Slingbox
+bool CSlingbox::Disconnect()
+{
+ // Prepare variables
+ bool bSuccess = true;
+
+ // Prepare and send the disconnect message
+ DisconnectMessage message;
+ if (!SendReceiveMessage(m_socCommunication, &message) ||
+ !m_receivedMessages.bDisconnectMessage)
+ bSuccess = false;
+
+ // Close the stream connection if it's still active
+ if (m_socStream != INVALID_SOCKET && !StopStream())
+ bSuccess = false;
+
+ // Close the communication connection
+ if (!CloseSocket(m_socCommunication))
+ bSuccess = false;
+ m_socCommunication = INVALID_SOCKET;
+
+#if defined _WIN32 || defined _WIN64
+ // Finish using the Winsock DLL
+ if (WSACleanup() != 0)
+ bSuccess = false;
+#endif
+
+ // Invalidate variables
+ m_usCode = 0;
+ m_usSequence = 0;
+ m_iChannel = -1;
+ m_iInput = -1;
+
+ return bSuccess;
+}
+
+// Function used to check if a connection to the Slingbox is active
+bool CSlingbox::IsConnected()
+{
+ // Prepare and send status message
+ StatusMessage message;
+ return SendReceiveMessage(m_socCommunication, &message) &&
+ m_receivedMessages.bStatusMessage;
+}
+
+// Function used to change the channel up.
+bool CSlingbox::ChannelUp()
+{
+ // Prepare and send channel message
+ ChannelMessage message;
+ message.Up();
+ if (!SendMessage(m_socCommunication, &message))
+ return false;
+
+ // Invalidate channel variable
+ m_iChannel = -1;
+
+ // Give the Slingbox time to change things
+ Wait(1000);
+
+ // Check for return message
+ return ReceiveMessage(m_socCommunication) &&
+ m_receivedMessages.bChannelMessage;
+}
+
+// Function used to change the channel down.
+bool CSlingbox::ChannelDown()
+{
+ // Prepare and send channel message
+ ChannelMessage message;
+ message.Down();
+ if (!SendMessage(m_socCommunication, &message))
+ return false;
+
+ // Invalidate channel variable
+ m_iChannel = -1;
+
+ // Give the Slingbox time to change things
+ Wait(1000);
+
+ // Check for return message
+ return ReceiveMessage(m_socCommunication) &&
+ m_receivedMessages.bChannelMessage;
+}
+
+// Function used to set the channel.
+bool CSlingbox::SetChannel(unsigned int uiChannel)
+{
+ // Prepare and send channel message
+ ChannelMessage message(uiChannel);
+ if (!SendMessage(m_socCommunication, &message))
+ return false;
+
+ // Invalidate channel variable
+ m_iChannel = -1;
+
+ // Give the Slingbox time to change things
+ Wait(1000);
+
+ // Check for return message
+ return ReceiveMessage(m_socCommunication) &&
+ m_receivedMessages.bChannelMessage;
+}
+
+// Function used to set the input.
+bool CSlingbox::SetInput(unsigned int uiInput)
+{
+ // Prepare and send input message
+ InputMessage message(uiInput);
+ if (!SendMessage(m_socCommunication, &message))
+ return false;
+
+ // Invalidate input variable
+ m_iInput = -1;
+
+ // Give the Slingbox time to change things
+ Wait(1000);
+
+ // Check for return message
+ return ReceiveMessage(m_socCommunication) &&
+ m_receivedMessages.bInputMessage;
+}
+
+// Function used to get the current channel. Returns -1 if valid data is not
+// available.
+int CSlingbox::GetChannel()
+{
+ return m_iChannel;
+}
+
+// Function used to get the current input. Returns -1 if valid data is not
+// available.
+int CSlingbox::GetInput()
+{
+ return m_iInput;
+}
+
+// Function used to send IR commands.
+bool CSlingbox::SendIRCommand(uint8_t ucCode)
+{
+ // Prepare and send IR message
+ IRMessage message(ucCode);
+ if (!SendMessage(m_socCommunication, &message))
+ return false;
+
+ // Give the Slingbox time to send command
+ Wait(1000);
+
+ // Check for return message
+ return ReceiveMessage(m_socCommunication) &&
+ m_receivedMessages.bIRMessage;
+}
+
+// ********************
+// Protected Functions
+// ********************
+
+// Function used to send a message and receive messages.
+bool CSlingbox::SendReceiveMessage(SOCKET socSocket, MessageHeader * pHeader,
+ bool bEncrypt /* = true */, unsigned int uiTimeout /* = 10 */)
+{
+ // Send message
+ if (!SendMessage(socSocket, pHeader, bEncrypt, uiTimeout))
+ return false;
+
+ // Give the Slingbox time to respond
+ Wait(250);
+
+ // Receive messages
+ if (!ReceiveMessage(socSocket, false, uiTimeout))
+ return false;
+
+ return true;
+}
+
+// Function used to send a messages to the Slingbox.
+bool CSlingbox::SendMessage(SOCKET socSocket, MessageHeader * pHeader,
+ bool bEncode /* = true */, unsigned int uiTimeout /* = 10 */)
+{
+ // Set message code and sequence numbers
+ pHeader->m_usCode = m_usCode;
+ pHeader->m_usSequence = m_usSequence;
+ m_usSequence++;
+
+ // Check if we need to encode the data from the message
+ if (bEncode)
+ {
+ void* pPointer = ((uint8_t *)pHeader) + sizeof(MessageHeader);
+ Encode(pPointer, pHeader->m_usSize);
+ pHeader->m_usEncoded = 0x2000;
+ }
+
+ // Send the message
+ if (Send(socSocket, pHeader, sizeof(MessageHeader) +
+ pHeader->m_usSize, uiTimeout) <= 0)
+ return false;
+
+ return true;
+}
+
+// Function used to receive messages from the Slingbox and process them.
+bool CSlingbox::ReceiveMessage(SOCKET socSocket, bool bUDPMessage /* = false */,
+ unsigned int uiTimeout /* = 10 */)
+{
+ // Prepare variables
+ bool bMessageReceived = false;
+ int iReceived;
+ int iProcessed = 0;
+ uint8_t ucBuffer[1024];
+ sockaddr sSocketAddress;
+ memset(&sSocketAddress, 0, sizeof(sSocketAddress));
+
+ // Reset received messages struct
+ memset(&m_receivedMessages, 0, sizeof(m_receivedMessages));
+
+ // Get the data
+ if (bUDPMessage)
+ {
+ iReceived = ReceiveFrom(socSocket, ucBuffer, sizeof(ucBuffer), uiTimeout,
+ &sSocketAddress);
+ }
+ else
+ {
+ iReceived = Receive(socSocket, ucBuffer, sizeof(ucBuffer), uiTimeout);
+ }
+
+ // Check for errors
+ if (iReceived == SOCKET_ERROR)
+ return false;
+
+ // Loop until we've processed all received data
+ while (iProcessed < iReceived)
+ {
+ // Prepare pointer
+ MessageHeader * pHeader = (MessageHeader *)(ucBuffer + iProcessed);
+
+ // Make sure it's a message and we got enough data to work with
+ if (pHeader->m_usHeader == 0x0101 && (iReceived - iProcessed) >=
+ (int)(sizeof(MessageHeader) + pHeader->m_usSize))
+ {
+ // Signal that we've recevied a message
+ bMessageReceived = true;
+
+ // Decode the message data
+ if (pHeader->m_usEncoded == 0x2000)
+ {
+ Decode((uint8_t *)pHeader + sizeof(MessageHeader), pHeader->m_usSize);
+ pHeader->m_usEncoded = 0x0000;
+ }
+
+ // Find message
+ if (pHeader->m_usMessageID == 0x0002 && pHeader->m_usSize == 0x005C)
+ {
+ m_receivedMessages.bFindMessage = true;
+
+ // Remove the port information from the structure received from ReceiveFrom
+ if (sSocketAddress.sa_family == AF_INET)
+ ((sockaddr_in *)&sSocketAddress)->sin_port = 0;
+ else if (sSocketAddress.sa_family == AF_INET6)
+ ((sockaddr_in6 *)&sSocketAddress)->sin6_port = 0;
+
+ // Convert the address received from ReceiveFrom to a string
+#if defined _WIN32 || defined _WIN64
+ unsigned long ulSizeOfAddress = sizeof(m_szAddress);
+ WSAAddressToString(&sSocketAddress, sizeof(sSocketAddress), NULL,
+ m_szAddress, &ulSizeOfAddress);
+#else
+ socklen_t iSizeOfAddress = sizeof(m_szAddress);
+ if (sSocketAddress.sa_family == AF_INET)
+ inet_ntop(sSocketAddress.sa_family,
+ &((sockaddr_in *)&sSocketAddress)->sin_addr, m_szAddress, iSizeOfAddress);
+ else if (sSocketAddress.sa_family == AF_INET6)
+ inet_ntop(sSocketAddress.sa_family,
+ &((sockaddr_in6 *)&sSocketAddress)->sin6_addr, m_szAddress, iSizeOfAddress);
+#endif
+
+ // Get the port information from the received data
+ m_uiPort = ucBuffer[120] + (ucBuffer[121] << 8);
+ }
+ // Connect message
+ else if (pHeader->m_usMessageID == 0x0067 && pHeader->m_usSize == 0x0008)
+ {
+ m_receivedMessages.bConnectMessage = true;
+
+ m_usCode = pHeader->m_usCode;
+ }
+ // Initialization message
+ else if (pHeader->m_usMessageID == 0x007E)
+ {
+ m_receivedMessages.bInitializationMessage = true;
+ }
+ // Encryption message
+ else if (pHeader->m_usMessageID == 0x00A6)
+ {
+ m_receivedMessages.bEncryptionMessage = true;
+ }
+ // Settings message
+ else if (pHeader->m_usMessageID == 0x00B5)
+ {
+ m_receivedMessages.bSettingsMessage = true;
+ }
+ // Disconnect message
+ else if (pHeader->m_usMessageID == 0x0068)
+ {
+ m_receivedMessages.bDisconnectMessage = true;
+ }
+ // Status message
+ else if (pHeader->m_usMessageID == 0x0065 && pHeader->m_usSize == 0x0000)
+ {
+ m_receivedMessages.bStatusMessage = true;
+ }
+ // Channel message
+ else if (pHeader->m_usMessageID == 0x0089)
+ {
+ m_receivedMessages.bChannelMessage = true;
+ }
+ // Channel status massage
+ else if (pHeader->m_usMessageID == 0x0065 && pHeader->m_usSize == 0x0078)
+ {
+ m_receivedMessages.bChannelStatusMessage = true;
+
+ m_iChannel = *(uint16_t *)((uint8_t *)pHeader + sizeof(MessageHeader));
+ }
+ // Input message
+ else if (pHeader->m_usMessageID == 0x0085)
+ {
+ m_receivedMessages.bInputMessage = true;
+ }
+ // Input status message
+ else if (pHeader->m_usMessageID == 0x0065 && pHeader->m_usSize == 0x0008)
+ {
+ m_receivedMessages.bInputStatusMessage = true;
+
+ m_iInput = *((uint8_t *)pHeader + sizeof(MessageHeader));
+ }
+ // IR message
+ else if (pHeader->m_usMessageID == 0x0087)
+ {
+ m_receivedMessages.bIRMessage = true;
+ }
+
+ // Increase our counter
+ iProcessed += sizeof(MessageHeader) + pHeader->m_usSize;
+ }
+ else
+ {
+ return bMessageReceived;
+ }
+ }
+
+ return bMessageReceived;
+}
+
+// Function used to encode data being send to the Slingbox.
+void CSlingbox::Encode(void * pData, unsigned int iSize)
+{
+ for (unsigned int i = 0; i < iSize; i += 8)
+ {
+ // Prepare variables
+ const uint32_t ulKey[] = {0xBCDEAAAA, 0x87FBBBBA, 0x7CCCCFFA, 0xDDDDAABC};
+ uint32_t ulVar1 = ((uint32_t *)&((uint8_t *)pData)[i])[0];
+ uint32_t ulVar2 = ((uint32_t *)&((uint8_t *)pData)[i])[1];
+ uint32_t ulVar3 = 0;
+
+ // Encode
+ for (unsigned int j = 0; j < 32; j++)
+ {
+ ulVar3 -= 0x61C88647;
+ ulVar1 += ((ulVar2 >> 5) + ulKey[1]) ^ ((ulVar2 << 4) + ulKey[0]) ^ (ulVar3 +
+ ulVar2);
+ ulVar2 += ((ulVar1 >> 5) + ulKey[3]) ^ ((ulVar1 << 4) + ulKey[2]) ^ (ulVar3 +
+ ulVar1);
+ }
+
+ // Finish up
+ ((uint32_t *)&((uint8_t *)pData)[i])[0] = ulVar1;
+ ((uint32_t *)&((uint8_t *)pData)[i])[1] = ulVar2;
+ }
+}
+
+// Function used to decode data being received from the Slingbox.
+void CSlingbox::Decode(void * pData, unsigned int iSize)
+{
+ for (unsigned int i = 0 ; i < iSize; i += 8 )
+ {
+ // Prepare variables
+ const uint32_t ulKey[] = {0xBCDEAAAA, 0x87FBBBBA, 0x7CCCCFFA, 0xDDDDAABC};
+ uint32_t ulVar1 = ((uint32_t *)&((uint8_t *)pData)[i])[0];
+ uint32_t ulVar2 = ((uint32_t *)&((uint8_t *)pData)[i])[1];
+ uint32_t ulVar3 = 0xC6EF3720;
+
+ // Decode
+ for (unsigned int j = 0; j < 32; j++)
+ {
+ ulVar2 -= ((ulVar1 >> 5) + ulKey[3]) ^ ((ulVar1 << 4) + ulKey[2]) ^ (ulVar3 +
+ ulVar1);
+ ulVar1 -= ((ulVar2 >> 5) + ulKey[1]) ^ ((ulVar2 << 4) + ulKey[0]) ^ (ulVar3 +
+ ulVar2);
+ ulVar3 += 0x61C88647;
+ }
+
+ // Finish up
+ ((uint32_t *)&((uint8_t *)pData)[i])[0] = ulVar1;
+ ((uint32_t *)&((uint8_t *)pData)[i])[1] = ulVar2;
+ }
+}
+
+// Function used to open a new socket.
+SOCKET CSlingbox::OpenSocket(const char * szAddress, unsigned int uiPort,
+ bool bUDP /* = false */)
+{
+ // Prepare needed variables
+ SOCKET socSocket = INVALID_SOCKET;
+ struct addrinfo * pAddressInfo;
+ struct addrinfo addressInfoHints;
+ struct addrinfo * pPointer;
+ memset(&addressInfoHints, 0, sizeof(addressInfoHints));
+ addressInfoHints.ai_family = bUDP ? AF_INET : AF_UNSPEC;
+ addressInfoHints.ai_socktype = bUDP ? SOCK_DGRAM : SOCK_STREAM;
+ addressInfoHints.ai_protocol = bUDP ? IPPROTO_UDP : IPPROTO_TCP;
+ addressInfoHints.ai_flags = bUDP ? AI_PASSIVE : 0;
+ char szPort[32];
+ sprintf(szPort, "%u", uiPort);
+
+ // Get address info
+ if (getaddrinfo(szAddress, szPort, &addressInfoHints, &pAddressInfo) != 0)
+ return INVALID_SOCKET;
+
+ // Loop thru all the received address info
+ for (pPointer = pAddressInfo; pPointer != NULL; pPointer = pPointer->ai_next)
+ {
+ // Open a new socket
+ socSocket = socket(pPointer->ai_family, pPointer->ai_socktype,
+ pPointer->ai_protocol);
+ if (socSocket != INVALID_SOCKET)
+ {
+ // Bind if we're using UDP
+ if (bUDP)
+ {
+ if (bind(socSocket, pAddressInfo->ai_addr, pAddressInfo->ai_addrlen) == 0)
+ {
+ break;
+ }
+ else
+ {
+ CloseSocket(socSocket);
+ socSocket = INVALID_SOCKET;
+ }
+ }
+ // Open a new connection if we're using TCP
+ else
+ {
+ if (connect(socSocket, pAddressInfo->ai_addr, pAddressInfo->ai_addrlen) == 0)
+ {
+ break;
+ }
+ else
+ {
+ CloseSocket(socSocket);
+ socSocket = INVALID_SOCKET;
+ }
+ }
+ }
+ }
+
+ // Free variables
+ freeaddrinfo(pAddressInfo);
+
+ return socSocket;
+}
+
+// Function used to broadcast data to the local subnet. Returns the number of bytes
+// actually sent or -1 if an error occured.
+int CSlingbox::Broadcast(SOCKET socSocket, unsigned int uiPort, void * pBuffer,
+ unsigned int uiSize, unsigned int uiTimeout /* = 10 */)
+{
+ // Enable broadcasting
+#if defined _WIN32 || defined _WIN64
+ char vBroadcast = '1';
+#else
+ int vBroadcast = 1;
+#endif
+ if (setsockopt(socSocket, SOL_SOCKET, SO_BROADCAST, &vBroadcast,
+ sizeof(vBroadcast)) != 0)
+ return SOCKET_ERROR;
+
+ // Prepare variable
+ struct sockaddr sSocketAddress;
+ memset(&sSocketAddress, 0, sizeof(sSocketAddress));
+ ((sockaddr_in *)&sSocketAddress)->sin_family = AF_INET;
+#if defined _WIN32 || defined _WIN64
+ ((sockaddr_in *)&sSocketAddress)->sin_addr.S_un.S_addr = htonl(0xFFFFFFFF);
+#else
+ ((sockaddr_in *)&sSocketAddress)->sin_addr.s_addr = htonl(0xFFFFFFFF);
+#endif
+ ((sockaddr_in *)&sSocketAddress)->sin_port = htons(uiPort);
+
+ // Send the data
+ return SendTo(socSocket, pBuffer, uiSize, uiTimeout, &sSocketAddress);
+}
+
+// Function used to send data. Returns the number of bytes actually sent
+// or -1 if an error occured.
+int CSlingbox::Send(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout /* = 10 */)
+{
+ // Prepare variables
+ int iFDS = socSocket + 1;
+ fd_set sendFDS;
+ FD_ZERO(&sendFDS);
+ FD_SET(socSocket, &sendFDS);
+ timeval timeOut;
+ timeOut.tv_sec = uiTimeout;
+ timeOut.tv_usec = 0;
+ int iResult;
+ unsigned int uiBytesSent = 0;
+ unsigned int uiBytesLeft = uiSize;
+
+ // Loop until all data is sent
+ while (uiBytesSent < uiSize)
+ {
+ // Send the data once the socket is ready
+ if (select(iFDS, NULL, &sendFDS, NULL, &timeOut) > 0)
+ iResult = send(socSocket, (const char *)pBuffer + uiBytesSent, uiBytesLeft, 0);
+ else
+ return uiBytesSent;
+
+ // Check for any errors
+ if (iResult == SOCKET_ERROR)
+ return SOCKET_ERROR;
+
+ // Adjust variables
+ uiBytesSent += iResult;
+ uiBytesLeft -= iResult;
+ }
+
+ return uiBytesSent;
+}
+
+// Function used to send data to a specific address. Returns the number of bytes
+// actually sent or -1 if an error occured.
+int CSlingbox::SendTo(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout, struct sockaddr * pSocketAddress)
+{
+ // Prepare variables
+ int iFDS = socSocket + 1;
+ fd_set sendFDS;
+ FD_ZERO(&sendFDS);
+ FD_SET(socSocket, &sendFDS);
+ timeval timeOut;
+ timeOut.tv_sec = uiTimeout;
+ timeOut.tv_usec = 0;
+ int iResult;
+ unsigned int uiBytesSent = 0;
+ unsigned int uiBytesLeft = uiSize;
+
+ // Loop until all data is sent
+ while (uiBytesSent < uiSize)
+ {
+ // Send the data once the socket is ready
+ if (select(iFDS, NULL, &sendFDS, NULL, &timeOut) > 0)
+ iResult = sendto(socSocket, (const char *)pBuffer + uiBytesSent, uiBytesLeft, 0,
+ pSocketAddress, sizeof(*pSocketAddress));
+ else
+ return uiBytesSent;
+
+ // Check for any errors
+ if (iResult == SOCKET_ERROR)
+ return SOCKET_ERROR;
+
+ // Adjust variables
+ uiBytesSent += iResult;
+ uiBytesLeft -= iResult;
+ }
+
+ return uiBytesSent;
+}
+
+// Function used to receive data. Returns the number of bytes actually received
+// or -1 if an error occured.
+int CSlingbox::Receive(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout /* = 10 */)
+{
+ // Prepare needed variables
+ int iFDS = socSocket + 1;
+ fd_set readFDS;
+ FD_ZERO(&readFDS);
+ FD_SET(socSocket, &readFDS);
+ timeval timeValue;
+ timeValue.tv_sec = uiTimeout;
+ timeValue.tv_usec = 0;
+
+ // Do the actual receiving of data after waiting for socket to be readable
+ if (select(iFDS, &readFDS, NULL, NULL, &timeValue) > 0)
+ return recv(socSocket, (char *)pBuffer, uiSize, 0);
+ else
+ return 0;
+}
+
+// Function used to receive data and tell us from where. Returns the number of bytes
+// actually received or -1 if an error occured. If successful, populates the
+// pSocketAddress variable with details of where the data was received from.
+int CSlingbox::ReceiveFrom(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout, struct sockaddr * pSocketAddress)
+{
+ // Prepare needed variables
+ int iFDS = socSocket + 1;
+ fd_set readFDS;
+ FD_ZERO(&readFDS);
+ FD_SET(socSocket, &readFDS);
+ timeval timeValue;
+ timeValue.tv_sec = uiTimeout;
+ timeValue.tv_usec = 0;
+ socklen_t iSizeOfAddress = sizeof(*pSocketAddress);
+
+ // Do the actual receiving of data after waiting for socket to be readable
+ if (select(iFDS, &readFDS, NULL, NULL, &timeValue) > 0)
+ return recvfrom(socSocket, (char *)pBuffer, uiSize, 0, pSocketAddress,
+ &iSizeOfAddress);
+ else
+ return 0;
+}
+
+// Function used to close a socket connection.
+bool CSlingbox::CloseSocket(SOCKET socSocket)
+{
+#if defined _WIN32 || defined _WIN64
+ if (closesocket(socSocket) != 0)
+ return false;
+#else
+ if (close(socSocket) != 0)
+ return false;
+#endif
+
+ return true;
+}
+
+// Function used to wait on the Slingbox for various reasons
+void CSlingbox::Wait(unsigned int uiMilliseconds)
+{
+#if defined _WIN32 || defined _WIN64
+ Sleep(uiMilliseconds);
+#else
+ struct timespec time;
+ time.tv_sec = uiMilliseconds / 1000;
+ time.tv_nsec = (uiMilliseconds % 1000) * 1000000;
+ while (nanosleep(&time, &time) == -1 && errno == EINTR &&
+ (time.tv_sec > 0 || time.tv_nsec > 0));
+#endif
+}
diff --git a/lib/SlingboxLib/SlingboxLib.h b/lib/SlingboxLib/SlingboxLib.h
new file mode 100644
index 0000000000..ad368f00f1
--- /dev/null
+++ b/lib/SlingboxLib/SlingboxLib.h
@@ -0,0 +1,408 @@
+//
+// Copyright (C) 2010-2011 Stonyx
+// http://www.stonyx.com
+//
+// This library is free software. You can redistribute it and/or modify it
+// under the terms of the GNU General Public License Version 2 (or at your
+// option any later version) as published by The Free Software Foundation.
+//
+// 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
+// General Public License for more details.
+//
+// If you did not received a copy of the GNU General Public License along
+// with this library see http://www.gnu.org/copyleft/gpl.html or write to
+// The Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+
+#include <stdint.h>
+#include <string.h>
+
+#if defined _WIN32 || defined _WIN64
+#include <winsock2.h>
+#elif !defined SOCKET
+typedef int SOCKET;
+#endif
+
+class CSlingbox
+{
+public:
+ // Enum that represents all the possible Slingbox resolutions
+ enum Resolution
+ {
+ NOVIDEO = 0x00000000,
+ RESOLUTION128X96 = 0x00000008,
+ RESOLUTION160X120 = 0x00000002,
+ RESOLUTION176X120 = 0x00000004,
+ RESOLUTION224X176 = 0x00000009,
+ RESOLUTION256X192 = 0x0000000B,
+ RESOLUTION320X240 = 0x00000001,
+ RESOLUTION352X240 = 0x00000003,
+ RESOLUTION320X480 = 0x00000007,
+ RESOLUTION640X240 = 0x00000006,
+ RESOLUTION640X480 = 0x00000005
+ };
+
+ // Constructors and destructors
+ CSlingbox();
+ CSlingbox(const char * szAddress, unsigned int uiPort = 5001);
+ ~CSlingbox();
+
+ // Following function can be called instead of the SetAddress function and is used to
+ // find a Slingbox instead of manually setting address and port information
+ bool FindSlingbox(unsigned int uiTimeout = 10);
+
+ // Function used to retrive information about a found Slingbox
+ void GetAddress(char * szAddress, unsigned int uiAddressLength, unsigned int * uiPort);
+
+ // Following public functions are listed in order of suggested call sequence
+ void SetAddress(const char * szAddress, unsigned int uiPort = 5001);
+ bool Connect(bool bLoginAsAdmin, const char * szPassword);
+ bool InitializeStream();
+ bool StreamSettings(Resolution eResolution = RESOLUTION320X240,
+ uint32_t uiVideoBitrate = 704, uint32_t uiFrameRate = 30,
+ uint32_t uiVideoSmoothing = 50, uint32_t uiAudioBitrate = 64,
+ uint32_t uiIFrameInterval = 10);
+ bool StartStream();
+ int ReadStream(void * pBuffer, unsigned int uiSize);
+ bool StopStream();
+ bool Disconnect();
+
+ // Function used to find out if a connecton to the Slingbox is active
+ bool IsConnected();
+
+ // Set channel/input related functions can be called anytime after InitializeStream
+ // has succeeded
+ bool ChannelUp();
+ bool ChannelDown();
+ bool SetChannel(unsigned int uiChannel);
+ bool SetInput(unsigned int uiInput);
+
+ // Get channel function will usually return valid data after InitializeStream
+ // has succeeded
+ int GetChannel();
+
+ // Get input function will usually return valid data only when a stream is active
+ // (ie: after StartStream has succeeded and before StopStream is called)
+ int GetInput();
+
+ // Function used to send an IR command
+ bool SendIRCommand(uint8_t ucCommand);
+
+protected:
+ // Function used to send and receive messages to and from the Slingbox
+ struct MessageHeader;
+ bool SendReceiveMessage(SOCKET socSocket, MessageHeader * pHeader,
+ bool bEncrypt = true, unsigned int uiTimeout = 10);
+ bool SendMessage(SOCKET socSocket, MessageHeader * pHeader,
+ bool bEncrypt = true, unsigned int uiTimeout = 10);
+ bool ReceiveMessage(SOCKET socSocket, bool bUDPMessage = false,
+ unsigned int uiTimeout = 10);
+
+ // Functions used to encode and decode data to and from the Slingbox
+ void Encode(void * pData, unsigned int uiSize);
+ void Decode(void * pData, unsigned int uiSize);
+
+ // Connection related functions
+ SOCKET OpenSocket(const char * szAddress, unsigned int uiPort, bool bUDP = false);
+ int Broadcast(SOCKET socSocket, unsigned int uiPort, void * pBuffer,
+ unsigned int uiSize, unsigned int uiTimeout = 10);
+ int Send(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout = 10);
+ int SendTo(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout, struct sockaddr * pSocketAddress);
+ int Receive(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout = 10);
+ int ReceiveFrom(SOCKET socSocket, void * pBuffer, unsigned int uiSize,
+ unsigned int uiTimeout, struct sockaddr * pSocketAddress);
+ bool CloseSocket(SOCKET socSocket);
+
+ // Function used to wait on the Slingbox for various reasons
+ void Wait(unsigned int uiMilliseconds);
+
+ // Protected member variables
+ SOCKET m_socCommunication;
+ SOCKET m_socStream;
+ char m_szAddress[1024];
+ unsigned int m_uiPort;
+ uint16_t m_usCode;
+ uint16_t m_usSequence;
+ int m_iChannel;
+ int m_iInput;
+
+ // Struct to define which messages were received
+ struct
+ {
+ bool bFindMessage;
+ bool bConnectMessage;
+ bool bInitializationMessage;
+ bool bEncryptionMessage;
+ bool bSettingsMessage;
+ bool bDisconnectMessage;
+ bool bStatusMessage;
+ bool bChannelMessage;
+ bool bInputMessage;
+ bool bChannelStatusMessage;
+ bool bInputStatusMessage;
+ bool bIRMessage;
+ } m_receivedMessages;
+
+ // Struct to define the Slingbox message header
+ struct MessageHeader
+ {
+ uint16_t m_usHeader; // Always 0x0101
+ uint16_t m_usCode; // Grabbed from the first packet from the Slingbox then
+ // always kept the same
+ uint16_t m_usMessageID; // Unique number to identify the message
+ uint16_t m_usVar4; // Always 0
+ uint16_t m_usSequence; // Sequencial number (answer will have the same number)
+ uint16_t m_usDirection; // 0 from Slingbox and 0x8000 from software
+ uint16_t m_usVar7;
+ uint16_t m_usVar8;
+ uint16_t m_usSize; // Size of the buffer (without header)
+ uint16_t m_usEncoded; // 0x2000 if buffer is encoded
+ uint16_t m_usVar11;
+ uint16_t m_usVar12;
+ uint16_t m_usVar13;
+ uint16_t m_usVar14;
+ uint16_t m_usVar15;
+ uint16_t m_usVar16;
+
+ // Struct constructor that sets all variables to default values
+ MessageHeader(uint16_t usMessageID, uint16_t usSize)
+ {
+ memset(this, 0, sizeof(MessageHeader));
+ m_usHeader = 0x0101;
+ m_usMessageID = usMessageID;
+ m_usSize = usSize - sizeof(MessageHeader);
+ }
+ };
+
+ // Struct to define the login message
+ struct ConnectMessage : public MessageHeader
+ {
+ uint32_t m_uiUnknown;
+ uint16_t m_usAccess[16];
+ uint16_t m_usPassword[16];
+ uint16_t m_usID[66];
+
+ // Struct constructor that sets variables to default values and copies
+ // passed values into variables
+ ConnectMessage(bool bLoginAsAdmin, const char * szPassword)
+ :MessageHeader(0x0067, sizeof(ConnectMessage))
+ {
+ m_uiUnknown = 0x00000000;
+ CopyCharToShort(m_usAccess, bLoginAsAdmin ? "admin" : "guest", 16);
+ CopyCharToShort(m_usPassword, szPassword, 16);
+ CopyCharToShort(m_usID, "Slingbox", 66);
+ }
+
+ // Function to copy a char array into a short array
+ void CopyCharToShort(uint16_t * usTarget, const char * szSource,
+ unsigned int uiTargetSize)
+ {
+ memset(usTarget, 0, uiTargetSize * sizeof(uint16_t));
+ for (unsigned int i = 0; i < uiTargetSize && szSource[i] != '\0'; i++)
+ {
+ usTarget[i] = (uint16_t)szSource[i];
+ }
+ }
+ };
+
+ // Struct to define the initialization message
+ struct InitializationMessage : public MessageHeader
+ {
+ uint32_t m_uiVar1;
+ uint32_t m_uiVar2;
+
+ // Struct constructor that sets all variables to default values
+ InitializationMessage()
+ :MessageHeader(0x007E, sizeof(InitializationMessage))
+ {
+ m_uiVar1 = 0x00000001;
+ m_uiVar2 = 0x00000000;
+ }
+ };
+
+ // Struct to define the encryption message
+ struct EncryptionMessage : public MessageHeader
+ {
+ uint32_t m_uiData[24];
+
+ // Struct constructor that sets all variables to default values
+ EncryptionMessage()
+ :MessageHeader(0x00A6, sizeof(EncryptionMessage))
+ {
+ memset(m_uiData, 0, 96);
+ m_uiData[0] = 0x00000100;
+ m_uiData[4] = 0x001D0000;
+ }
+ };
+
+ // Struct to define the settings message
+ struct SettingsMessage : public MessageHeader
+ {
+ uint32_t m_uiData[40];
+
+ // Struct constructor that sets variables to default values and copies
+ // passed values into variables
+ SettingsMessage(Resolution resolution, uint32_t uiVideoBitrate,
+ uint32_t uiFrameRate, uint32_t uiVideoSmoothing, uint32_t uiAudioBitrate,
+ uint32_t uiIFrameInterval)
+ :MessageHeader(0x00B5, sizeof(SettingsMessage))
+ {
+ // Make sure all our values are within limits
+ if (uiVideoBitrate < 50)
+ uiVideoBitrate = 50;
+ if (uiVideoBitrate > 8000)
+ uiVideoBitrate = 8000;
+
+ if (uiFrameRate < 1)
+ uiFrameRate = 1;
+ else if (uiFrameRate < 6)
+ uiFrameRate = 1;
+ else if (uiFrameRate < 10)
+ uiFrameRate = 6;
+ else if (uiFrameRate < 15)
+ uiFrameRate = 10;
+ else if (uiFrameRate < 20)
+ uiFrameRate = 15;
+ else if (uiFrameRate < 30)
+ uiFrameRate = 20;
+ else
+ uiFrameRate = 30;
+
+ if (uiVideoSmoothing > 100)
+ uiVideoSmoothing = 100;
+
+ if (uiAudioBitrate < 16)
+ uiAudioBitrate = 16;
+ else if (uiAudioBitrate < 20)
+ uiAudioBitrate = 16;
+ else if (uiAudioBitrate < 32)
+ uiAudioBitrate = 20;
+ else if (uiAudioBitrate < 40)
+ uiAudioBitrate = 32;
+ else if (uiAudioBitrate < 48)
+ uiAudioBitrate = 40;
+ else if (uiAudioBitrate < 64)
+ uiAudioBitrate = 48;
+ else if (uiAudioBitrate < 96)
+ uiAudioBitrate = 64;
+ else
+ uiAudioBitrate = 96;
+
+ if (uiIFrameInterval > 30)
+ uiIFrameInterval = 30;
+
+ // Set variables to default values and copy passed values into variables
+ m_uiData[0] = 0x000000FF;
+ m_uiData[1] = 0x000000FF;
+ m_uiData[2] = resolution;
+ m_uiData[3] = 0x00000001;
+ m_uiData[4] = uiVideoBitrate + (uiFrameRate << 16) +
+ (uiIFrameInterval << 24);
+ m_uiData[5] = 0x00000001 + (uiVideoSmoothing << 8);
+ m_uiData[6] = 0x00000003;
+ m_uiData[7] = 0x00000001;
+ m_uiData[8] = uiAudioBitrate;
+ m_uiData[9] = 0x00000003;
+ m_uiData[10] = 0x00000001;
+ m_uiData[11] = 0x46D4F252;
+ m_uiData[12] = 0x4C5D03E4;
+ m_uiData[13] = 0x04CA1F8D;
+ m_uiData[14] = 0xF1090089;
+
+ for (int i = 15; i < 40; i++)
+ m_uiData[i] = 0x00000000;
+ }
+ };
+
+ // Struct to define the disconnect message
+ struct DisconnectMessage : public MessageHeader
+ {
+ DisconnectMessage()
+ :MessageHeader(0x0068, sizeof(DisconnectMessage))
+ {
+ }
+ };
+
+ // Struct to define the status message
+ struct StatusMessage : public MessageHeader
+ {
+ StatusMessage()
+ :MessageHeader(0x0065, sizeof(StatusMessage))
+ {
+ }
+ };
+
+ // Struct to define the channel message
+ struct ChannelMessage : public MessageHeader
+ {
+ uint32_t m_uiUpDown; // 0 = up & 1 = down when channel = 0
+ uint32_t m_uiChannel;
+ uint32_t m_uiUnknown1;
+ uint32_t m_uiUnknown2;
+
+ // Struct constructor that sets variables to default values and copies
+ // passed values into variables
+ ChannelMessage(uint32_t uiChannel = 0)
+ :MessageHeader(0x0089, sizeof(ChannelMessage))
+ {
+ m_uiUpDown = 0x00000002;
+ m_uiChannel = uiChannel;
+ m_uiUnknown1 = 0xFF000000;
+ m_uiUnknown2 = 0x00000000;
+ }
+
+ // Function that sets variables to values required to change the channel up
+ void Up()
+ {
+ m_uiUpDown = 0x00000000;
+ m_uiChannel = 0x00000000;
+ m_uiUnknown1 = 0x000000FF;
+ m_uiUnknown2 = 0x00000000;
+ }
+
+ // Function that sets variables to values required to change the channel down
+ void Down()
+ {
+ m_uiUpDown = 0x00000001;
+ m_uiChannel = 0x00000000;
+ m_uiUnknown1 = 0x000000FF;
+ m_uiUnknown2 = 0x00000000;
+ }
+ };
+
+ // Struct to define the input message
+ struct InputMessage : public MessageHeader
+ {
+ uint8_t m_ucData[8];
+
+ // Struct constructor that sets variables to default values and copies
+ // passed values into variables
+ InputMessage(uint8_t ucInput)
+ :MessageHeader(0x0085, sizeof(InputMessage))
+ {
+ memset(m_ucData, 0, sizeof(m_ucData));
+ m_ucData[0] = ucInput;
+ }
+ };
+
+ // Struct to define the IR message
+ struct IRMessage : public MessageHeader
+ {
+ uint8_t m_ucData[480];
+
+ // Struct constructor that sets variables to default values and copies
+ // passed values into variables
+ IRMessage(uint8_t ucCode)
+ :MessageHeader(0x0087, sizeof(IRMessage))
+ {
+ memset(m_ucData, 0, sizeof(m_ucData));
+ m_ucData[0] = ucCode;
+ m_ucData[472] = 0xFF;
+ }
+ };
+};
diff --git a/lib/ffmpeg/libavformat/flvdec.c b/lib/ffmpeg/libavformat/flvdec.c
index e6081d9840..f1c9eda96a 100644
--- a/lib/ffmpeg/libavformat/flvdec.c
+++ b/lib/ffmpeg/libavformat/flvdec.c
@@ -30,6 +30,10 @@
#include "avformat.h"
#include "flv.h"
+#define KEYFRAMES_TAG "keyframes"
+#define KEYFRAMES_TIMESTAMP_TAG "times"
+#define KEYFRAMES_BYTEOFFSET_TAG "filepositions"
+
typedef struct {
int wrong_dts; ///< wrong dts due to negative cts
} FLVContext;
@@ -124,6 +128,66 @@ static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) {
return length;
}
+static int parse_keyframes_index(AVFormatContext *s, ByteIOContext *ioc, AVStream *vstream, int64_t max_pos) {
+ unsigned int timeslen = 0, fileposlen = 0, i;
+ char str_val[256];
+ int64_t *times = NULL;
+ int64_t *filepositions = NULL;
+ int ret = AVERROR(ENOSYS);
+ int64_t initial_pos = url_ftell(ioc);
+
+ while (url_ftell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
+ int64_t** current_array;
+ unsigned int arraylen;
+
+ // Expect array object in context
+ if (get_byte(ioc) != AMF_DATA_TYPE_ARRAY)
+ break;
+
+ arraylen = get_be32(ioc);
+ if(arraylen>>28)
+ break;
+
+ if (!strcmp(KEYFRAMES_TIMESTAMP_TAG , str_val) && !times){
+ current_array= &times;
+ timeslen= arraylen;
+ }else if (!strcmp(KEYFRAMES_BYTEOFFSET_TAG, str_val) && !filepositions){
+ current_array= &filepositions;
+ fileposlen= arraylen;
+ }else // unexpected metatag inside keyframes, will not use such metadata for indexing
+ break;
+
+ if (!(*current_array = av_mallocz(sizeof(**current_array) * arraylen))) {
+ ret = AVERROR(ENOMEM);
+ goto finish;
+ }
+
+ for (i = 0; i < arraylen && url_ftell(ioc) < max_pos - 1; i++) {
+ if (get_byte(ioc) != AMF_DATA_TYPE_NUMBER)
+ goto finish;
+ current_array[0][i] = av_int2dbl(get_be64(ioc));
+ }
+ if (times && filepositions) {
+ // All done, exiting at a position allowing amf_parse_object
+ // to finish parsing the object
+ ret = 0;
+ break;
+ }
+ }
+
+ if (timeslen == fileposlen) {
+ for(i = 0; i < timeslen; i++)
+ av_add_index_entry(vstream, filepositions[i], times[i]*1000, 0, 0, AVINDEX_KEYFRAME);
+ } else
+ av_log(s, AV_LOG_WARNING, "Invalid keyframes object, skipping.\n");
+
+finish:
+ av_freep(&times);
+ av_freep(&filepositions);
+ url_fseek(ioc, initial_pos, SEEK_SET);
+ return ret;
+}
+
static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vstream, const char *key, int64_t max_pos, int depth) {
AVCodecContext *acodec, *vcodec;
ByteIOContext *ioc;
@@ -148,6 +212,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
case AMF_DATA_TYPE_OBJECT: {
unsigned int keylen;
+ if (!url_is_streamed(s->pb) && key && !strcmp(KEYFRAMES_TAG, key) && depth == 1)
+ if (parse_keyframes_index(s, ioc, vstream, max_pos) < 0)
+ av_log(s, AV_LOG_ERROR, "Keyframe index parsing failed\n");
+
while(url_ftell(ioc) < max_pos - 2 && (keylen = get_be16(ioc))) {
url_fskip(ioc, keylen); //skip key string
if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0)
diff --git a/lib/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch b/lib/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch
new file mode 100644
index 0000000000..500aa47c4b
--- /dev/null
+++ b/lib/ffmpeg/patches/0047-Backporting-ffmpeg-feature-to-parse-flv-fileposition.patch
@@ -0,0 +1,105 @@
+From 7f608129d581ce028033e399a412cde7f37bc938 Mon Sep 17 00:00:00 2001
+From: Dani <dani@INCOGNITO.(none)>
+Date: Fri, 3 Jun 2011 00:02:06 -0400
+Subject: [PATCH] Backporting ffmpeg feature to parse flv filepositions so we can seek to certain points in the stream without waiting to buffer, aka pseudostreaming
+
+---
+ lib/ffmpeg/libavformat/flvdec.c | 68 +++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 68 insertions(+), 0 deletions(-)
+
+diff --git a/lib/ffmpeg/libavformat/flvdec.c b/lib/ffmpeg/libavformat/flvdec.c
+index e6081d9..f1c9eda 100644
+--- a/lib/ffmpeg/libavformat/flvdec.c
++++ b/lib/ffmpeg/libavformat/flvdec.c
+@@ -30,6 +30,10 @@
+ #include "avformat.h"
+ #include "flv.h"
+
++#define KEYFRAMES_TAG "keyframes"
++#define KEYFRAMES_TIMESTAMP_TAG "times"
++#define KEYFRAMES_BYTEOFFSET_TAG "filepositions"
++
+ typedef struct {
+ int wrong_dts; ///< wrong dts due to negative cts
+ } FLVContext;
+@@ -124,6 +128,66 @@ static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) {
+ return length;
+ }
+
++static int parse_keyframes_index(AVFormatContext *s, ByteIOContext *ioc, AVStream *vstream, int64_t max_pos) {
++ unsigned int timeslen = 0, fileposlen = 0, i;
++ char str_val[256];
++ int64_t *times = NULL;
++ int64_t *filepositions = NULL;
++ int ret = AVERROR(ENOSYS);
++ int64_t initial_pos = url_ftell(ioc);
++
++ while (url_ftell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
++ int64_t** current_array;
++ unsigned int arraylen;
++
++ // Expect array object in context
++ if (get_byte(ioc) != AMF_DATA_TYPE_ARRAY)
++ break;
++
++ arraylen = get_be32(ioc);
++ if(arraylen>>28)
++ break;
++
++ if (!strcmp(KEYFRAMES_TIMESTAMP_TAG , str_val) && !times){
++ current_array= &times;
++ timeslen= arraylen;
++ }else if (!strcmp(KEYFRAMES_BYTEOFFSET_TAG, str_val) && !filepositions){
++ current_array= &filepositions;
++ fileposlen= arraylen;
++ }else // unexpected metatag inside keyframes, will not use such metadata for indexing
++ break;
++
++ if (!(*current_array = av_mallocz(sizeof(**current_array) * arraylen))) {
++ ret = AVERROR(ENOMEM);
++ goto finish;
++ }
++
++ for (i = 0; i < arraylen && url_ftell(ioc) < max_pos - 1; i++) {
++ if (get_byte(ioc) != AMF_DATA_TYPE_NUMBER)
++ goto finish;
++ current_array[0][i] = av_int2dbl(get_be64(ioc));
++ }
++ if (times && filepositions) {
++ // All done, exiting at a position allowing amf_parse_object
++ // to finish parsing the object
++ ret = 0;
++ break;
++ }
++ }
++
++ if (timeslen == fileposlen) {
++ for(i = 0; i < timeslen; i++)
++ av_add_index_entry(vstream, filepositions[i], times[i]*1000, 0, 0, AVINDEX_KEYFRAME);
++ } else
++ av_log(s, AV_LOG_WARNING, "Invalid keyframes object, skipping.\n");
++
++finish:
++ av_freep(&times);
++ av_freep(&filepositions);
++ url_fseek(ioc, initial_pos, SEEK_SET);
++ return ret;
++}
++
+ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vstream, const char *key, int64_t max_pos, int depth) {
+ AVCodecContext *acodec, *vcodec;
+ ByteIOContext *ioc;
+@@ -148,6 +212,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
+ case AMF_DATA_TYPE_OBJECT: {
+ unsigned int keylen;
+
++ if (!url_is_streamed(s->pb) && key && !strcmp(KEYFRAMES_TAG, key) && depth == 1)
++ if (parse_keyframes_index(s, ioc, vstream, max_pos) < 0)
++ av_log(s, AV_LOG_ERROR, "Keyframe index parsing failed\n");
++
+ while(url_ftell(ioc) < max_pos - 2 && (keylen = get_be16(ioc))) {
+ url_fskip(ioc, keylen); //skip key string
+ if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0)
+--
+1.7.0.4
+
diff --git a/lib/jsoncpp/AUTHORS b/lib/jsoncpp/AUTHORS
deleted file mode 100644
index c0fbbeec11..0000000000
--- a/lib/jsoncpp/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Baptiste Lepilleur <blep@users.sourceforge.net>
diff --git a/lib/jsoncpp/README.txt b/lib/jsoncpp/README.txt
deleted file mode 100644
index dc4e341ec8..0000000000
--- a/lib/jsoncpp/README.txt
+++ /dev/null
@@ -1,132 +0,0 @@
-* Introduction:
- =============
-
-JSON (JavaScript Object Notation) is a lightweight data-interchange format.
-It can represent integer, real number, string, an ordered sequence of
-value, and a collection of name/value pairs.
-
-JsonCpp is a simple API to manipulate JSON value, handle serialization
-and unserialization to string.
-
-It can also preserve existing comment in unserialization/serialization steps,
-making it a convenient format to store user input files.
-
-Unserialization parsing is user friendly and provides precise error reports.
-
-
-* Building/Testing:
- =================
-
-JsonCpp uses Scons (http://www.scons.org) as a build system. Scons requires
-python to be installed (http://www.python.org).
-
-You download scons-local distribution from the following url:
-http://sourceforge.net/project/showfiles.php?group_id=30337&package_id=67375
-
-Unzip it in the directory where you found this README file. scons.py Should be
-at the same level as README.
-
-python scons.py platform=PLTFRM [TARGET]
-where PLTFRM may be one of:
- suncc Sun C++ (Solaris)
- vacpp Visual Age C++ (AIX)
- mingw
- msvc6 Microsoft Visual Studio 6 service pack 5-6
- msvc70 Microsoft Visual Studio 2002
- msvc71 Microsoft Visual Studio 2003
- msvc80 Microsoft Visual Studio 2005
- msvc90 Microsoft Visual Studio 2008
- linux-gcc Gnu C++ (linux, also reported to work for Mac OS X)
-
-Notes: if you are building with Microsoft Visual Studio 2008, you need to
-setup the environment by running vcvars32.bat (e.g. MSVC 2008 command prompt)
-before running scons.
-
-Adding platform is fairly simple. You need to change the Sconstruct file
-to do so.
-
-and TARGET may be:
- check: build library and run unit tests.
-
-
-* Running the test manually:
- ==========================
-
-cd test
-# This will run the Reader/Writer tests
-python runjsontests.py "path to jsontest.exe"
-
-# This will run the Reader/Writer tests, using JSONChecker test suite
-# (http://www.json.org/JSON_checker/).
-# Notes: not all tests pass: JsonCpp is too lenient (for example,
-# it allows an integer to start with '0'). The goal is to improve
-# strict mode parsing to get all tests to pass.
-python runjsontests.py --with-json-checker "path to jsontest.exe"
-
-# This will run the unit tests (mostly Value)
-python rununittests.py "path to test_lib_json.exe"
-
-You can run the tests using valgrind:
-python rununittests.py --valgrind "path to test_lib_json.exe"
-
-
-* Building the documentation:
- ===========================
-
-Run the python script doxybuild.py from the top directory:
-
-python doxybuild.py --open --with-dot
-
-See doxybuild.py --help for options.
-
-Notes that the documentation is also available for download as a tarball.
-The documentation of the latest release is available online at:
-http://jsoncpp.sourceforge.net/
-
-
-* Adding a reader/writer test:
- ============================
-
-To add a test, you need to create two files in test/data:
-- a TESTNAME.json file, that contains the input document in JSON format.
-- a TESTNAME.expected file, that contains a flatened representation of
- the input document.
-
-TESTNAME.expected file format:
-- each line represents a JSON element of the element tree represented
- by the input document.
-- each line has two parts: the path to access the element separated from
- the element value by '='. Array and object values are always empty
- (e.g. represented by either [] or {}).
-- element path: '.' represented the root element, and is used to separate
- object members. [N] is used to specify the value of an array element
- at index N.
-See test_complex_01.json and test_complex_01.expected to better understand
-element path.
-
-
-* Understanding reader/writer test output:
- ========================================
-
-When a test is run, output files are generated aside the input test files.
-Below is a short description of the content of each file:
-
-- test_complex_01.json: input JSON document
-- test_complex_01.expected: flattened JSON element tree used to check if
- parsing was corrected.
-
-- test_complex_01.actual: flattened JSON element tree produced by
- jsontest.exe from reading test_complex_01.json
-- test_complex_01.rewrite: JSON document written by jsontest.exe using the
- Json::Value parsed from test_complex_01.json and serialized using
- Json::StyledWritter.
-- test_complex_01.actual-rewrite: flattened JSON element tree produced by
- jsontest.exe from reading test_complex_01.rewrite.
-test_complex_01.process-output: jsontest.exe output, typically useful to
- understand parsing error.
-
-* License
- =======
-
-See file LICENSE for details. Basically JsonCpp is licensed under
-MIT license, or public domain if desired and recognized in your jurisdiction.
diff --git a/lib/jsoncpp/SConstruct b/lib/jsoncpp/SConstruct
deleted file mode 100644
index 23225cbb75..0000000000
--- a/lib/jsoncpp/SConstruct
+++ /dev/null
@@ -1,248 +0,0 @@
-"""
-Notes:
-- shared library support is buggy: it assumes that a static and dynamic library can be build from the same object files. This is not true on many platforms. For this reason it is only enabled on linux-gcc at the current time.
-
-To add a platform:
-- add its name in options allowed_values below
-- add tool initialization for this platform. Search for "if platform == 'suncc'" as an example.
-"""
-
-import os
-import os.path
-import sys
-
-JSONCPP_VERSION = open(File('#version').abspath,'rt').read().strip()
-DIST_DIR = '#dist'
-
-options = Variables()
-options.Add( EnumVariable('platform',
- 'Platform (compiler/stl) used to build the project',
- 'msvc71',
- allowed_values='suncc vacpp mingw msvc6 msvc7 msvc71 msvc80 msvc90 linux-gcc'.split(),
- ignorecase=2) )
-
-try:
- platform = ARGUMENTS['platform']
- if platform == 'linux-gcc':
- CXX = 'g++' # not quite right, but env is not yet available.
- import commands
- version = commands.getoutput('%s -dumpversion' %CXX)
- platform = 'linux-gcc-%s' %version
- print "Using platform '%s'" %platform
- LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '')
- LD_LIBRARY_PATH = "%s:libs/%s" %(LD_LIBRARY_PATH, platform)
- os.environ['LD_LIBRARY_PATH'] = LD_LIBRARY_PATH
- print "LD_LIBRARY_PATH =", LD_LIBRARY_PATH
-except KeyError:
- print 'You must specify a "platform"'
- sys.exit(2)
-
-print "Building using PLATFORM =", platform
-
-rootbuild_dir = Dir('#buildscons')
-build_dir = os.path.join( '#buildscons', platform )
-bin_dir = os.path.join( '#bin', platform )
-lib_dir = os.path.join( '#libs', platform )
-sconsign_dir_path = Dir(build_dir).abspath
-sconsign_path = os.path.join( sconsign_dir_path, '.sconsign.dbm' )
-
-# Ensure build directory exist (SConsignFile fail otherwise!)
-if not os.path.exists( sconsign_dir_path ):
- os.makedirs( sconsign_dir_path )
-
-# Store all dependencies signature in a database
-SConsignFile( sconsign_path )
-
-def make_environ_vars():
- """Returns a dictionnary with environment variable to use when compiling."""
- # PATH is required to find the compiler
- # TEMP is required for at least mingw
- # LD_LIBRARY_PATH & co is required on some system for the compiler
- vars = {}
- for name in ('PATH', 'TEMP', 'TMP', 'LD_LIBRARY_PATH', 'LIBRARY_PATH'):
- if name in os.environ:
- vars[name] = os.environ[name]
- return vars
-
-
-env = Environment( ENV = make_environ_vars(),
- toolpath = ['scons-tools'],
- tools=[] ) #, tools=['default'] )
-
-if platform == 'suncc':
- env.Tool( 'sunc++' )
- env.Tool( 'sunlink' )
- env.Tool( 'sunar' )
- env.Append( CCFLAGS = ['-mt'] )
-elif platform == 'vacpp':
- env.Tool( 'default' )
- env.Tool( 'aixcc' )
- env['CXX'] = 'xlC_r' #scons does not pick-up the correct one !
- # using xlC_r ensure multi-threading is enabled:
- # http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/compiler/ref/cuselect.htm
- env.Append( CCFLAGS = '-qrtti=all',
- LINKFLAGS='-bh:5' ) # -bh:5 remove duplicate symbol warning
-elif platform == 'msvc6':
- env['MSVS_VERSION']='6.0'
- for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']:
- env.Tool( tool )
- env['CXXFLAGS']='-GR -GX /nologo /MT'
-elif platform == 'msvc70':
- env['MSVS_VERSION']='7.0'
- for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']:
- env.Tool( tool )
- env['CXXFLAGS']='-GR -GX /nologo /MT'
-elif platform == 'msvc71':
- env['MSVS_VERSION']='7.1'
- for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']:
- env.Tool( tool )
- env['CXXFLAGS']='-GR -GX /nologo /MT'
-elif platform == 'msvc80':
- env['MSVS_VERSION']='8.0'
- for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']:
- env.Tool( tool )
- env['CXXFLAGS']='-GR -EHsc /nologo /MT'
-elif platform == 'msvc90':
- env['MSVS_VERSION']='9.0'
- # Scons 1.2 fails to detect the correct location of the platform SDK.
- # So we propagate those from the environment. This requires that the
- # user run vcvars32.bat before compiling.
- if 'INCLUDE' in os.environ:
- env['ENV']['INCLUDE'] = os.environ['INCLUDE']
- if 'LIB' in os.environ:
- env['ENV']['LIB'] = os.environ['LIB']
- for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']:
- env.Tool( tool )
- env['CXXFLAGS']='-GR -EHsc /nologo /MT'
-elif platform == 'mingw':
- env.Tool( 'mingw' )
- env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] )
-elif platform.startswith('linux-gcc'):
- env.Tool( 'default' )
- env.Append( LIBS = ['pthread'], CCFLAGS = "-Wall" )
- env['SHARED_LIB_ENABLED'] = True
-else:
- print "UNSUPPORTED PLATFORM."
- env.Exit(1)
-
-env.Tool('targz')
-env.Tool('srcdist')
-env.Tool('globtool')
-
-env.Append( CPPPATH = ['#include'],
- LIBPATH = lib_dir )
-short_platform = platform
-if short_platform.startswith('msvc'):
- short_platform = short_platform[2:]
-# Notes: on Windows you need to rebuild the source for each variant
-# Build script does not support that yet so we only build static libraries.
-# This also fails on AIX because both dynamic and static library ends with
-# extension .a.
-env['SHARED_LIB_ENABLED'] = env.get('SHARED_LIB_ENABLED', False)
-env['LIB_PLATFORM'] = short_platform
-env['LIB_LINK_TYPE'] = 'lib' # static
-env['LIB_CRUNTIME'] = 'mt'
-env['LIB_NAME_SUFFIX'] = '${LIB_PLATFORM}_${LIB_LINK_TYPE}${LIB_CRUNTIME}' # must match autolink naming convention
-env['JSONCPP_VERSION'] = JSONCPP_VERSION
-env['BUILD_DIR'] = env.Dir(build_dir)
-env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
-env['DIST_DIR'] = DIST_DIR
-if 'TarGz' in env['BUILDERS']:
- class SrcDistAdder:
- def __init__( self, env ):
- self.env = env
- def __call__( self, *args, **kw ):
- apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
- env['SRCDIST_BUILDER'] = env.TarGz
-else: # If tarfile module is missing
- class SrcDistAdder:
- def __init__( self, env ):
- pass
- def __call__( self, *args, **kw ):
- pass
-env['SRCDIST_ADD'] = SrcDistAdder( env )
-env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
-
-env_testing = env.Clone( )
-env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] )
-
-def buildJSONExample( env, target_sources, target_name ):
- env = env.Clone()
- env.Append( CPPPATH = ['#'] )
- exe = env.Program( target=target_name,
- source=target_sources )
- env['SRCDIST_ADD']( source=[target_sources] )
- global bin_dir
- return env.Install( bin_dir, exe )
-
-def buildJSONTests( env, target_sources, target_name ):
- jsontests_node = buildJSONExample( env, target_sources, target_name )
- check_alias_target = env.Alias( 'check', jsontests_node, RunJSONTests( jsontests_node, jsontests_node ) )
- env.AlwaysBuild( check_alias_target )
-
-def buildUnitTests( env, target_sources, target_name ):
- jsontests_node = buildJSONExample( env, target_sources, target_name )
- check_alias_target = env.Alias( 'check', jsontests_node,
- RunUnitTests( jsontests_node, jsontests_node ) )
- env.AlwaysBuild( check_alias_target )
-
-def buildLibrary( env, target_sources, target_name ):
- static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
- source=target_sources )
- global lib_dir
- env.Install( lib_dir, static_lib )
- if env['SHARED_LIB_ENABLED']:
- shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
- source=target_sources )
- env.Install( lib_dir, shared_lib )
- env['SRCDIST_ADD']( source=[target_sources] )
-
-Export( 'env env_testing buildJSONExample buildLibrary buildJSONTests buildUnitTests' )
-
-def buildProjectInDirectory( target_directory ):
- global build_dir
- target_build_dir = os.path.join( build_dir, target_directory )
- target = os.path.join( target_directory, 'sconscript' )
- SConscript( target, build_dir=target_build_dir, duplicate=0 )
- env['SRCDIST_ADD']( source=[target] )
-
-
-def runJSONTests_action( target, source = None, env = None ):
- # Add test scripts to python path
- jsontest_path = Dir( '#test' ).abspath
- sys.path.insert( 0, jsontest_path )
- data_path = os.path.join( jsontest_path, 'data' )
- import runjsontests
- return runjsontests.runAllTests( os.path.abspath(source[0].path), data_path )
-
-def runJSONTests_string( target, source = None, env = None ):
- return 'RunJSONTests("%s")' % source[0]
-
-import SCons.Action
-ActionFactory = SCons.Action.ActionFactory
-RunJSONTests = ActionFactory(runJSONTests_action, runJSONTests_string )
-
-def runUnitTests_action( target, source = None, env = None ):
- # Add test scripts to python path
- jsontest_path = Dir( '#test' ).abspath
- sys.path.insert( 0, jsontest_path )
- import rununittests
- return rununittests.runAllTests( os.path.abspath(source[0].path) )
-
-def runUnitTests_string( target, source = None, env = None ):
- return 'RunUnitTests("%s")' % source[0]
-
-RunUnitTests = ActionFactory(runUnitTests_action, runUnitTests_string )
-
-env.Alias( 'check' )
-
-srcdist_cmd = env['SRCDIST_ADD']( source = """
- AUTHORS README.txt SConstruct
- """.split() )
-env.Alias( 'src-dist', srcdist_cmd )
-
-buildProjectInDirectory( 'src/jsontestrunner' )
-buildProjectInDirectory( 'src/lib_json' )
-buildProjectInDirectory( 'src/test_lib_json' )
-#print env.Dump()
-
diff --git a/lib/jsoncpp/doc/doxyfile.in b/lib/jsoncpp/doc/doxyfile.in
deleted file mode 100644
index 48861d2385..0000000000
--- a/lib/jsoncpp/doc/doxyfile.in
+++ /dev/null
@@ -1,1534 +0,0 @@
-# Doxyfile 1.5.9
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = "JsonCpp"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = %JSONCPP_VERSION%
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = %DOC_TOPDIR%
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH = %TOPDIR%
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH = %TOPDIR%/include
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 3
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES = "testCaseSetup=\link CppUT::TestCase::setUp() setUp()\endlink" \
- "testCaseRun=\link CppUT::TestCase::run() run()\endlink" \
- "testCaseTearDown=\link CppUT::TestCase::tearDown() tearDown()\endlink" \
- "json_ref=<a HREF='http://www.json.org/'>JSON (JavaScript Object Notation)</a>"
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = YES
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = NO
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = YES
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = YES
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = NO
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = NO
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE = %WARNING_LOG_PATH%
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = ../include ../src/lib_json .
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS = *.h \
- *.cpp \
- *.inl \
- *.dox
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = %HTML_OUTPUT%
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER = header.html
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER = footer.html
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = YES
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = %HTML_HELP%
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE = jsoncpp-%JSONCPP_VERSION%.chm
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION = "c:\Program Files\HTML Help Workshop\hhc.exe"
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = YES
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = YES
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE =
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to FRAME, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature. Other possible values
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list;
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
-# disables this behavior completely. For backwards compatibility with previous
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
-# respectively.
-
-GENERATE_TREEVIEW = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH = ../include
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS = *.h
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED = "_MSC_VER=1400" \
- _CPPRTTI \
- _WIN32 \
- JSONCPP_DOC_EXCLUDE_IMPLEMENTATION \
- JSON_VALUE_USE_INTERNAL_MAP
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = NO
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = NO
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = %HAVE_DOT%
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = %UML_LOOK%
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = YES
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH = %DOT_PATH%
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 1000
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = YES
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Options related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/lib/jsoncpp/doc/footer.html b/lib/jsoncpp/doc/footer.html
deleted file mode 100644
index a61d9528a1..0000000000
--- a/lib/jsoncpp/doc/footer.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<hr>
-<table width="100%">
- <tr>
- <td width="10%" align="left" valign="center">
- <a href="http://sourceforge.net">
- <img
- src="http://sourceforge.net/sflogo.php?group_id=144446"
- width="88" height="31" border="0" alt="SourceForge Logo"></a>
- </td>
- <td width="20%" align="left" valign="center">
- hosts this site.
- </td>
- <td>
- </td>
- <td align="right" valign="center">
- Send comments to:<br>
- <a href="mailto:jsoncpp-devel@lists.sourceforge.net">Json-cpp Developers</a>
- </td>
- </tr>
-</table>
-
-</body>
-</html>
diff --git a/lib/jsoncpp/doc/header.html b/lib/jsoncpp/doc/header.html
deleted file mode 100644
index 1a6ad6120a..0000000000
--- a/lib/jsoncpp/doc/header.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<head>
-<title>
-JsonCpp - JSON data format manipulation library
-</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head>
-
-<body bgcolor="#ffffff">
-<table width="100%">
- <tr>
- <td width="40%" align="left" valign="center">
- <a href="http://sourceforge.net/projects/jsoncpp/">
- JsonCpp project page
- </a>
- </td>
- <td width="40%" align="right" valign="center">
- <a href="http://jsoncpp.sourceforge.net">JsonCpp home page</a>
- </td>
- </tr>
-</table>
-
-<hr>
diff --git a/lib/jsoncpp/doc/jsoncpp.dox b/lib/jsoncpp/doc/jsoncpp.dox
deleted file mode 100644
index 4e05a28cd6..0000000000
--- a/lib/jsoncpp/doc/jsoncpp.dox
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
-\mainpage
-\section _intro Introduction
-
-<a HREF="http://www.json.org/">JSON (JavaScript Object Notation)</a>
- is a lightweight data-interchange format.
-It can represent integer, real number, string, an ordered sequence of value, and
-a collection of name/value pairs.
-
-Here is an example of JSON data:
-\verbatim
-// Configuration options
-{
- // Default encoding for text
- "encoding" : "UTF-8",
-
- // Plug-ins loaded at start-up
- "plug-ins" : [
- "python",
- "c++",
- "ruby"
- ],
-
- // Tab indent size
- "indent" : { "length" : 3, "use_space": true }
-}
-\endverbatim
-
-\section _features Features
-- read and write JSON document
-- attach C and C++ style comments to element during parsing
-- rewrite JSON document preserving original comments
-
-Notes: Comments used to be supported in JSON but where removed for
-portability (C like comments are not supported in Python). Since
-comments are useful in configuration/input file, this feature was
-preserved.
-
-\section _example Code example
-
-\code
-Json::Value root; // will contains the root value after parsing.
-Json::Reader reader;
-bool parsingSuccessful = reader.parse( config_doc, root );
-if ( !parsingSuccessful )
-{
- // report to the user the failure and their locations in the document.
- std::cout << "Failed to parse configuration\n"
- << reader.getFormatedErrorMessages();
- return;
-}
-
-// Get the value of the member of root named 'encoding', return 'UTF-8' if there is no
-// such member.
-std::string encoding = root.get("encoding", "UTF-8" ).asString();
-// Get the value of the member of root named 'encoding', return a 'null' value if
-// there is no such member.
-const Json::Value plugins = root["plug-ins"];
-for ( int index = 0; index < plugins.size(); ++index ) // Iterates over the sequence elements.
- loadPlugIn( plugins[index].asString() );
-
-setIndentLength( root["indent"].get("length", 3).asInt() );
-setIndentUseSpace( root["indent"].get("use_space", true).asBool() );
-
-// ...
-// At application shutdown to make the new configuration document:
-// Since Json::Value has implicit constructor for all value types, it is not
-// necessary to explicitly construct the Json::Value object:
-root["encoding"] = getCurrentEncoding();
-root["indent"]["length"] = getCurrentIndentLength();
-root["indent"]["use_space"] = getCurrentIndentUseSpace();
-
-Json::StyledWriter writer;
-// Make a new JSON document for the configuration. Preserve original comments.
-std::string outputConfig = writer.write( root );
-
-// You can also use streams. This will put the contents of any JSON
-// stream at a particular sub-value, if you'd like.
-std::cin >> root["subtree"];
-
-// And you can write to a stream, using the StyledWriter automatically.
-std::cout << root;
-\endcode
-
-\section _pbuild Build instructions
-The build instructions are located in the file
-<a HREF="README.txt">README.txt</a> in the top-directory of the project.
-
-Permanent link to the latest revision of the file in subversion:
-<a HREF="http://svn.sourceforge.net/viewcvs.cgi/jsoncpp/README.txt?view=markup">latest README.txt</a>
-
-\section _pdownload Download
-The sources can be downloaded from
-<a HREF="http://sourceforge.net/projects/jsoncpp/files/">SourceForge download page</a>.
-
-The latest version of the source is available in the project's subversion repository:
-<a HREF="http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/">
-http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/</a>
-
-To checkout the source, see the following
-<a HREF="http://sourceforge.net/scm/?type=svn&group_id=144446">instructions</a>.
-
-\section _news What's New?
-The description of latest changes can be found in
-<a HREF="NEWS.txt">NEWS.txt</a> in the top-directory of the project.
-
-Permanent link to the latest revision of the file in subversion:
-<a HREF="http://svn.sourceforge.net/viewcvs.cgi/jsoncpp/README.txt?view=markup">latest NEWS.txt</a>
-
-\section _plinks Project links
-- <a HREF="http://jsoncpp.sourceforge.net">json-cpp home</a>
-- <a HREF="http://www.sourceforge.net/projects/jsoncpp/">json-cpp sourceforge project</a>
-
-\section _rlinks Related links
-- <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations.
-- <a HREF="http://www.yaml.org/">YAML</a> A data format designed for human readability.
-- <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>.
-
-\section _license License
-See file <a HREF="LICENSE">LICENSE</a> in the top-directory of the project.
-
-Basically JsonCpp is licensed under MIT license, or public domain if desired
-and recognized in your jurisdiction.
-
-\author Baptiste Lepilleur <blep@users.sourceforge.net>
-*/
diff --git a/lib/jsoncpp/doc/readme.txt b/lib/jsoncpp/doc/readme.txt
deleted file mode 100644
index 0e42cdfb4c..0000000000
--- a/lib/jsoncpp/doc/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-The documentation is generated using doxygen (http://www.doxygen.org).
diff --git a/lib/jsoncpp/doc/roadmap.dox b/lib/jsoncpp/doc/roadmap.dox
deleted file mode 100644
index 1ec0ab60f7..0000000000
--- a/lib/jsoncpp/doc/roadmap.dox
+++ /dev/null
@@ -1,45 +0,0 @@
-/*! \page roadmap JsonCpp roadmap
- \section ms_64bits Adds support for 64 bits integer
- There has been many request to add support for 64 bits integer. Use case for this are:
- - time is nowdays commonly represented with a 64 bits integer
- - 64 bits integer are frequently used as primary key id in many systems
-
- Plans to add support is:
- - must be optional, a configuration option since not all platforms provides 64 bits integer types.
- - move definition of Int and UInt from forwards.h to config.h, with the required platform magic.
- - C++ defines no standard to define 64 bits integer. Rely on msvc extension, and long long type that
- is widely supported.
- \section ms_release Makes JsonCpp ready for release
- - Build system clean-up:
- - Fix build on Windows (shared-library build is broken)
- - Add enable/disable flag for static and shared library build
- - Enhance help
- - Platform portability check: (Notes: was ok on last check)
- - linux/gcc,
- - solaris/cc,
- - windows/msvc678,
- - aix/vacpp
- - Add JsonCpp version to header as numeric for use in preprocessor test
- - Remove buggy experimental hash stuff
- \section ms_strict Adds a strict mode to reader/parser
- Strict JSON support as specific in RFC 4627 (http://www.ietf.org/rfc/rfc4627.txt?number=4627).
- - Enforce only object or array as root element
- - Disable comment support
- - Get jsonchecker failing tests to pass in strict mode
- \section ms_writer Writter control
- Provides more control to determine how specific items are serialized when JSON allow choice:
- - Optionally allow escaping of non-ASCII characters using unicode escape sequence "\\u".
- - Optionally allow escaping of "/" using "\/".
- \section ms_separation Expose json reader/writer API that do not impose using Json::Value.
- Some typical use-case involve an application specific structure to/from a JSON document.
- - Event base parser to allow unserializing a Json document directly in datastructure instead of
- using the intermediate Json::Value.
- - "Stream" based parser to serialized a Json document without using Json::Value as input.
- - Performance oriented parser/writer:
- - Provides an event based parser. Should allow pulling & skipping events for ease of use.
- - Provides a JSON document builder: fast only.
- \section ms_perfo Performance tuning
- - Provides support for static property name definition avoiding allocation
- - Static property dictionnary can be provided to JSON reader
- - Performance scenario & benchmarking
-*/
diff --git a/lib/jsoncpp/include/json/autolink.h b/lib/jsoncpp/include/json/autolink.h
deleted file mode 100644
index 02328d1f1a..0000000000
--- a/lib/jsoncpp/include/json/autolink.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_AUTOLINK_H_INCLUDED
-# define JSON_AUTOLINK_H_INCLUDED
-
-# include "config.h"
-
-# ifdef JSON_IN_CPPTL
-# include <cpptl/cpptl_autolink.h>
-# endif
-
-# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL)
-# define CPPTL_AUTOLINK_NAME "json"
-# undef CPPTL_AUTOLINK_DLL
-# ifdef JSON_DLL
-# define CPPTL_AUTOLINK_DLL
-# endif
-# include "autolink.h"
-# endif
-
-#endif // JSON_AUTOLINK_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/config.h b/lib/jsoncpp/include/json/config.h
deleted file mode 100644
index 55f0583e60..0000000000
--- a/lib/jsoncpp/include/json/config.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_CONFIG_H_INCLUDED
-# define JSON_CONFIG_H_INCLUDED
-
-/// If defined, indicates that json library is embedded in CppTL library.
-//# define JSON_IN_CPPTL 1
-
-/// If defined, indicates that json may leverage CppTL library
-//# define JSON_USE_CPPTL 1
-/// If defined, indicates that cpptl vector based map should be used instead of std::map
-/// as Value container.
-//# define JSON_USE_CPPTL_SMALLMAP 1
-/// If defined, indicates that Json specific container should be used
-/// (hash table & simple deque container with customizable allocator).
-/// THIS FEATURE IS STILL EXPERIMENTAL!
-//# define JSON_VALUE_USE_INTERNAL_MAP 1
-/// Force usage of standard new/malloc based allocator instead of memory pool based allocator.
-/// The memory pools allocator used optimization (initializing Value and ValueInternalLink
-/// as if it was a POD) that may cause some validation tool to report errors.
-/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
-//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
-
-/// If defined, indicates that Json use exception to report invalid type manipulation
-/// instead of C assert macro.
-# define JSON_USE_EXCEPTION 1
-
-# ifdef JSON_IN_CPPTL
-# include <cpptl/config.h>
-# ifndef JSON_USE_CPPTL
-# define JSON_USE_CPPTL 1
-# endif
-# endif
-
-# ifdef JSON_IN_CPPTL
-# define JSON_API CPPTL_API
-# elif defined(JSON_DLL_BUILD)
-# define JSON_API __declspec(dllexport)
-# elif defined(JSON_DLL)
-# define JSON_API __declspec(dllimport)
-# else
-# define JSON_API
-# endif
-
-// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer
-// Storages, and 64 bits integer support is disabled.
-// #define JSON_NO_INT64 1
-
-#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6
-// Microsoft Visual Studio 6 only support conversion from __int64 to double
-// (no conversion from unsigned __int64).
-#define JSON_USE_INT64_DOUBLE_CONVERSION 1
-#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6
-
-
-namespace Json {
- typedef int Int;
- typedef unsigned int UInt;
-# if defined(JSON_NO_INT64)
- typedef int LargestInt;
- typedef unsigned int LargestUInt;
-# undef JSON_HAS_INT64
-# else // if defined(JSON_NO_INT64)
- // For Microsoft Visual use specific types as long long is not supported
-# if defined(_MSC_VER) // Microsoft Visual Studio
- typedef __int64 Int64;
- typedef unsigned __int64 UInt64;
-# else // if defined(_MSC_VER) // Other platforms, use long long
- typedef long long int Int64;
- typedef unsigned long long int UInt64;
-# endif // if defined(_MSC_VER)
- typedef Int64 LargestInt;
- typedef UInt64 LargestUInt;
-# define JSON_HAS_INT64
-# endif // if defined(JSON_NO_INT64)
-} // end namespace Json
-
-
-#endif // JSON_CONFIG_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/features.h b/lib/jsoncpp/include/json/features.h
deleted file mode 100644
index fd8e3509a2..0000000000
--- a/lib/jsoncpp/include/json/features.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
-# define CPPTL_JSON_FEATURES_H_INCLUDED
-
-# include "forwards.h"
-
-namespace Json {
-
- /** \brief Configuration passed to reader and writer.
- * This configuration object can be used to force the Reader or Writer
- * to behave in a standard conforming way.
- */
- class JSON_API Features
- {
- public:
- /** \brief A configuration that allows all features and assumes all strings are UTF-8.
- * - C & C++ comments are allowed
- * - Root object can be any JSON value
- * - Assumes Value strings are encoded in UTF-8
- */
- static Features all();
-
- /** \brief A configuration that is strictly compatible with the JSON specification.
- * - Comments are forbidden.
- * - Root object must be either an array or an object value.
- * - Assumes Value strings are encoded in UTF-8
- */
- static Features strictMode();
-
- /** \brief Initialize the configuration like JsonConfig::allFeatures;
- */
- Features();
-
- /// \c true if comments are allowed. Default: \c true.
- bool allowComments_;
-
- /// \c true if root must be either an array or an object value. Default: \c false.
- bool strictRoot_;
- };
-
-} // namespace Json
-
-#endif // CPPTL_JSON_FEATURES_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/forwards.h b/lib/jsoncpp/include/json/forwards.h
deleted file mode 100644
index dd32fa0578..0000000000
--- a/lib/jsoncpp/include/json/forwards.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_FORWARDS_H_INCLUDED
-# define JSON_FORWARDS_H_INCLUDED
-
-# include "config.h"
-
-namespace Json {
-
- // writer.h
- class FastWriter;
- class StyledWriter;
-
- // reader.h
- class Reader;
-
- // features.h
- class Features;
-
- // value.h
- typedef unsigned int ArrayIndex;
- class StaticString;
- class Path;
- class PathArgument;
- class Value;
- class ValueIteratorBase;
- class ValueIterator;
- class ValueConstIterator;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- class ValueMapAllocator;
- class ValueInternalLink;
- class ValueInternalArray;
- class ValueInternalMap;
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
-
-} // namespace Json
-
-
-#endif // JSON_FORWARDS_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/json.h b/lib/jsoncpp/include/json/json.h
deleted file mode 100644
index da5fc967eb..0000000000
--- a/lib/jsoncpp/include/json/json.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_JSON_H_INCLUDED
-# define JSON_JSON_H_INCLUDED
-
-# include "autolink.h"
-# include "value.h"
-# include "reader.h"
-# include "writer.h"
-# include "features.h"
-
-#endif // JSON_JSON_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/reader.h b/lib/jsoncpp/include/json/reader.h
deleted file mode 100644
index 62232ea372..0000000000
--- a/lib/jsoncpp/include/json/reader.h
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_READER_H_INCLUDED
-# define CPPTL_JSON_READER_H_INCLUDED
-
-# include "features.h"
-# include "value.h"
-# include <deque>
-# include <stack>
-# include <string>
-# include <iostream>
-
-namespace Json {
-
- /** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a Value.
- *
- */
- class JSON_API Reader
- {
- public:
- typedef char Char;
- typedef const Char *Location;
-
- /** \brief Constructs a Reader allowing all features
- * for parsing.
- */
- Reader();
-
- /** \brief Constructs a Reader allowing the specified feature set
- * for parsing.
- */
- Reader( const Features &features );
-
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a> document.
- * \param document UTF-8 encoded string containing the document to read.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param collectComments \c true to collect comment and allow writing them back during
- * serialization, \c false to discard comments.
- * This parameter is ignored if Features::allowComments_
- * is \c false.
- * \return \c true if the document was successfully parsed, \c false if an error occurred.
- */
- bool parse( const std::string &document,
- Value &root,
- bool collectComments = true );
-
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a> document.
- * \param document UTF-8 encoded string containing the document to read.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param collectComments \c true to collect comment and allow writing them back during
- * serialization, \c false to discard comments.
- * This parameter is ignored if Features::allowComments_
- * is \c false.
- * \return \c true if the document was successfully parsed, \c false if an error occurred.
- */
- bool parse( const char *beginDoc, const char *endDoc,
- Value &root,
- bool collectComments = true );
-
- /// \brief Parse from input stream.
- /// \see Json::operator>>(std::istream&, Json::Value&).
- bool parse( std::istream &is,
- Value &root,
- bool collectComments = true );
-
- /** \brief Returns a user friendly string that list errors in the parsed document.
- * \return Formatted error message with the list of errors with their location in
- * the parsed document. An empty string is returned if no error occurred
- * during parsing.
- */
- std::string getFormatedErrorMessages() const;
-
- private:
- enum TokenType
- {
- tokenEndOfStream = 0,
- tokenObjectBegin,
- tokenObjectEnd,
- tokenArrayBegin,
- tokenArrayEnd,
- tokenString,
- tokenNumber,
- tokenTrue,
- tokenFalse,
- tokenNull,
- tokenArraySeparator,
- tokenMemberSeparator,
- tokenComment,
- tokenError
- };
-
- class Token
- {
- public:
- TokenType type_;
- Location start_;
- Location end_;
- };
-
- class ErrorInfo
- {
- public:
- Token token_;
- std::string message_;
- Location extra_;
- };
-
- typedef std::deque<ErrorInfo> Errors;
-
- bool expectToken( TokenType type, Token &token, const char *message );
- bool readToken( Token &token );
- void skipSpaces();
- bool match( Location pattern,
- int patternLength );
- bool readComment();
- bool readCStyleComment();
- bool readCppStyleComment();
- bool readString();
- void readNumber();
- bool readValue();
- bool readObject( Token &token );
- bool readArray( Token &token );
- bool decodeNumber( Token &token );
- bool decodeString( Token &token );
- bool decodeString( Token &token, std::string &decoded );
- bool decodeDouble( Token &token );
- bool decodeUnicodeCodePoint( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode );
- bool decodeUnicodeEscapeSequence( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode );
- bool addError( const std::string &message,
- Token &token,
- Location extra = 0 );
- bool recoverFromError( TokenType skipUntilToken );
- bool addErrorAndRecover( const std::string &message,
- Token &token,
- TokenType skipUntilToken );
- void skipUntilSpace();
- Value &currentValue();
- Char getNextChar();
- void getLocationLineAndColumn( Location location,
- int &line,
- int &column ) const;
- std::string getLocationLineAndColumn( Location location ) const;
- void addComment( Location begin,
- Location end,
- CommentPlacement placement );
- void skipCommentTokens( Token &token );
-
- typedef std::stack<Value *> Nodes;
- Nodes nodes_;
- Errors errors_;
- std::string document_;
- Location begin_;
- Location end_;
- Location current_;
- Location lastValueEnd_;
- Value *lastValue_;
- std::string commentsBefore_;
- Features features_;
- bool collectComments_;
- };
-
- /** \brief Read from 'sin' into 'root'.
-
- Always keep comments from the input JSON.
-
- This can be used to read a file into a particular sub-object.
- For example:
- \code
- Json::Value root;
- cin >> root["dir"]["file"];
- cout << root;
- \endcode
- Result:
- \verbatim
- {
- "dir": {
- "file": {
- // The input stream JSON would be nested here.
- }
- }
- }
- \endverbatim
- \throw std::exception on parse error.
- \see Json::operator<<()
- */
- std::istream& operator>>( std::istream&, Value& );
-
-} // namespace Json
-
-#endif // CPPTL_JSON_READER_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/value.h b/lib/jsoncpp/include/json/value.h
deleted file mode 100644
index 14464e4991..0000000000
--- a/lib/jsoncpp/include/json/value.h
+++ /dev/null
@@ -1,1101 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_H_INCLUDED
-# define CPPTL_JSON_H_INCLUDED
-
-# include "forwards.h"
-# include <string>
-# include <vector>
-
-# ifndef JSON_USE_CPPTL_SMALLMAP
-# include <map>
-# else
-# include <cpptl/smallmap.h>
-# endif
-# ifdef JSON_USE_CPPTL
-# include <cpptl/forwards.h>
-# endif
-
-/** \brief JSON (JavaScript Object Notation).
- */
-namespace Json {
-
- /** \brief Type of the value held by a Value object.
- */
- enum ValueType
- {
- nullValue = 0, ///< 'null' value
- intValue, ///< signed integer value
- uintValue, ///< unsigned integer value
- realValue, ///< double value
- stringValue, ///< UTF-8 string value
- booleanValue, ///< bool value
- arrayValue, ///< array value (ordered list)
- objectValue ///< object value (collection of name/value pairs).
- };
-
- enum CommentPlacement
- {
- commentBefore = 0, ///< a comment placed on the line before a value
- commentAfterOnSameLine, ///< a comment just after a value on the same line
- commentAfter, ///< a comment on the line after a value (only make sense for root value)
- numberOfCommentPlacement
- };
-
-//# ifdef JSON_USE_CPPTL
-// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
-// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
-//# endif
-
- /** \brief Lightweight wrapper to tag static string.
- *
- * Value constructor and objectValue member assignement takes advantage of the
- * StaticString and avoid the cost of string duplication when storing the
- * string or the member name.
- *
- * Example of usage:
- * \code
- * Json::Value aValue( StaticString("some text") );
- * Json::Value object;
- * static const StaticString code("code");
- * object[code] = 1234;
- * \endcode
- */
- class JSON_API StaticString
- {
- public:
- explicit StaticString( const char *czstring )
- : str_( czstring )
- {
- }
-
- operator const char *() const
- {
- return str_;
- }
-
- const char *c_str() const
- {
- return str_;
- }
-
- private:
- const char *str_;
- };
-
- /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
- *
- * This class is a discriminated union wrapper that can represents a:
- * - signed integer [range: Value::minInt - Value::maxInt]
- * - unsigned integer (range: 0 - Value::maxUInt)
- * - double
- * - UTF-8 string
- * - boolean
- * - 'null'
- * - an ordered list of Value
- * - collection of name/value pairs (javascript object)
- *
- * The type of the held value is represented by a #ValueType and
- * can be obtained using type().
- *
- * values of an #objectValue or #arrayValue can be accessed using operator[]() methods.
- * Non const methods will automatically create the a #nullValue element
- * if it does not exist.
- * The sequence of an #arrayValue will be automatically resize and initialized
- * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
- *
- * The get() methods can be used to obtanis default value in the case the required element
- * does not exist.
- *
- * It is possible to iterate over the list of a #objectValue values using
- * the getMemberNames() method.
- */
- class JSON_API Value
- {
- friend class ValueIteratorBase;
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- friend class ValueInternalLink;
- friend class ValueInternalMap;
-# endif
- public:
- typedef std::vector<std::string> Members;
- typedef ValueIterator iterator;
- typedef ValueConstIterator const_iterator;
- typedef Json::UInt UInt;
- typedef Json::Int Int;
-# if defined(JSON_HAS_INT64)
- typedef Json::UInt64 UInt64;
- typedef Json::Int64 Int64;
-#endif // defined(JSON_HAS_INT64)
- typedef Json::LargestInt LargestInt;
- typedef Json::LargestUInt LargestUInt;
- typedef Json::ArrayIndex ArrayIndex;
-
- static const Value null;
- /// Minimum signed integer value that can be stored in a Json::Value.
- static const LargestInt minLargestInt;
- /// Maximum signed integer value that can be stored in a Json::Value.
- static const LargestInt maxLargestInt;
- /// Maximum unsigned integer value that can be stored in a Json::Value.
- static const LargestUInt maxLargestUInt;
-
- /// Minimum signed int value that can be stored in a Json::Value.
- static const Int minInt;
- /// Maximum signed int value that can be stored in a Json::Value.
- static const Int maxInt;
- /// Maximum unsigned int value that can be stored in a Json::Value.
- static const UInt maxUInt;
-
- /// Minimum signed 64 bits int value that can be stored in a Json::Value.
- static const Int64 minInt64;
- /// Maximum signed 64 bits int value that can be stored in a Json::Value.
- static const Int64 maxInt64;
- /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.
- static const UInt64 maxUInt64;
-
- private:
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-# ifndef JSON_VALUE_USE_INTERNAL_MAP
- class CZString
- {
- public:
- enum DuplicationPolicy
- {
- noDuplication = 0,
- duplicate,
- duplicateOnCopy
- };
- CZString( ArrayIndex index );
- CZString( const char *cstr, DuplicationPolicy allocate );
- CZString( const CZString &other );
- ~CZString();
- CZString &operator =( const CZString &other );
- bool operator<( const CZString &other ) const;
- bool operator==( const CZString &other ) const;
- ArrayIndex index() const;
- const char *c_str() const;
- bool isStaticString() const;
- private:
- void swap( CZString &other );
- const char *cstr_;
- ArrayIndex index_;
- };
-
- public:
-# ifndef JSON_USE_CPPTL_SMALLMAP
- typedef std::map<CZString, Value> ObjectValues;
-# else
- typedef CppTL::SmallMap<CZString, Value> ObjectValues;
-# endif // ifndef JSON_USE_CPPTL_SMALLMAP
-# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- public:
- /** \brief Create a default Value of the given type.
-
- This is a very useful constructor.
- To create an empty array, pass arrayValue.
- To create an empty object, pass objectValue.
- Another Value can then be set to this one by assignment.
- This is useful since clear() and resize() will not alter types.
-
- Examples:
- \code
- Json::Value null_value; // null
- Json::Value arr_value(Json::arrayValue); // []
- Json::Value obj_value(Json::objectValue); // {}
- \endcode
- */
- Value( ValueType type = nullValue );
- Value( Int value );
- Value( UInt value );
-#if defined(JSON_HAS_INT64)
- Value( Int64 value );
- Value( UInt64 value );
-#endif // if defined(JSON_HAS_INT64)
- Value( double value );
- Value( const char *value );
- Value( const char *beginValue, const char *endValue );
- /** \brief Constructs a value from a static string.
-
- * Like other value string constructor but do not duplicate the string for
- * internal storage. The given string must remain alive after the call to this
- * constructor.
- * Example of usage:
- * \code
- * Json::Value aValue( StaticString("some text") );
- * \endcode
- */
- Value( const StaticString &value );
- Value( const std::string &value );
-# ifdef JSON_USE_CPPTL
- Value( const CppTL::ConstString &value );
-# endif
- Value( bool value );
- Value( const Value &other );
- ~Value();
-
- Value &operator=( const Value &other );
- /// Swap values.
- /// \note Currently, comments are intentionally not swapped, for
- /// both logic and efficiency.
- void swap( Value &other );
-
- ValueType type() const;
-
- bool operator <( const Value &other ) const;
- bool operator <=( const Value &other ) const;
- bool operator >=( const Value &other ) const;
- bool operator >( const Value &other ) const;
-
- bool operator ==( const Value &other ) const;
- bool operator !=( const Value &other ) const;
-
- int compare( const Value &other );
-
- const char *asCString() const;
- std::string asString() const;
-# ifdef JSON_USE_CPPTL
- CppTL::ConstString asConstString() const;
-# endif
- Int asInt() const;
- UInt asUInt() const;
- Int64 asInt64() const;
- UInt64 asUInt64() const;
- LargestInt asLargestInt() const;
- LargestUInt asLargestUInt() const;
- float asFloat() const;
- double asDouble() const;
- bool asBool() const;
-
- bool isNull() const;
- bool isBool() const;
- bool isInt() const;
- bool isUInt() const;
- bool isIntegral() const;
- bool isDouble() const;
- bool isNumeric() const;
- bool isString() const;
- bool isArray() const;
- bool isObject() const;
-
- bool isConvertibleTo( ValueType other ) const;
-
- /// Number of values in array or object
- ArrayIndex size() const;
-
- /// \brief Return true if empty array, empty object, or null;
- /// otherwise, false.
- bool empty() const;
-
- /// Return isNull()
- bool operator!() const;
-
- /// Remove all object members and array elements.
- /// \pre type() is arrayValue, objectValue, or nullValue
- /// \post type() is unchanged
- void clear();
-
- /// Resize the array to size elements.
- /// New elements are initialized to null.
- /// May only be called on nullValue or arrayValue.
- /// \pre type() is arrayValue or nullValue
- /// \post type() is arrayValue
- void resize( ArrayIndex size );
-
- /// Access an array element (zero based index ).
- /// If the array contains less than index element, then null value are inserted
- /// in the array so that its size is index+1.
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- Value &operator[]( ArrayIndex index );
-
- /// Access an array element (zero based index ).
- /// If the array contains less than index element, then null value are inserted
- /// in the array so that its size is index+1.
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- Value &operator[]( int index );
-
- /// Access an array element (zero based index )
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- const Value &operator[]( ArrayIndex index ) const;
-
- /// Access an array element (zero based index )
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- const Value &operator[]( int index ) const;
-
- /// If the array contains at least index+1 elements, returns the element value,
- /// otherwise returns defaultValue.
- Value get( ArrayIndex index,
- const Value &defaultValue ) const;
- /// Return true if index < size().
- bool isValidIndex( ArrayIndex index ) const;
- /// \brief Append value to array at the end.
- ///
- /// Equivalent to jsonvalue[jsonvalue.size()] = value;
- Value &append( const Value &value );
-
- /// Access an object value by name, create a null member if it does not exist.
- Value &operator[]( const char *key );
- /// Access an object value by name, returns null if there is no member with that name.
- const Value &operator[]( const char *key ) const;
- /// Access an object value by name, create a null member if it does not exist.
- Value &operator[]( const std::string &key );
- /// Access an object value by name, returns null if there is no member with that name.
- const Value &operator[]( const std::string &key ) const;
- /** \brief Access an object value by name, create a null member if it does not exist.
-
- * If the object as no entry for that name, then the member name used to store
- * the new entry is not duplicated.
- * Example of use:
- * \code
- * Json::Value object;
- * static const StaticString code("code");
- * object[code] = 1234;
- * \endcode
- */
- Value &operator[]( const StaticString &key );
-# ifdef JSON_USE_CPPTL
- /// Access an object value by name, create a null member if it does not exist.
- Value &operator[]( const CppTL::ConstString &key );
- /// Access an object value by name, returns null if there is no member with that name.
- const Value &operator[]( const CppTL::ConstString &key ) const;
-# endif
- /// Return the member named key if it exist, defaultValue otherwise.
- Value get( const char *key,
- const Value &defaultValue ) const;
- /// Return the member named key if it exist, defaultValue otherwise.
- Value get( const std::string &key,
- const Value &defaultValue ) const;
-# ifdef JSON_USE_CPPTL
- /// Return the member named key if it exist, defaultValue otherwise.
- Value get( const CppTL::ConstString &key,
- const Value &defaultValue ) const;
-# endif
- /// \brief Remove and return the named member.
- ///
- /// Do nothing if it did not exist.
- /// \return the removed Value, or null.
- /// \pre type() is objectValue or nullValue
- /// \post type() is unchanged
- Value removeMember( const char* key );
- /// Same as removeMember(const char*)
- Value removeMember( const std::string &key );
-
- /// Return true if the object has a member named key.
- bool isMember( const char *key ) const;
- /// Return true if the object has a member named key.
- bool isMember( const std::string &key ) const;
-# ifdef JSON_USE_CPPTL
- /// Return true if the object has a member named key.
- bool isMember( const CppTL::ConstString &key ) const;
-# endif
-
- /// \brief Return a list of the member names.
- ///
- /// If null, return an empty list.
- /// \pre type() is objectValue or nullValue
- /// \post if type() was nullValue, it remains nullValue
- Members getMemberNames() const;
-
-//# ifdef JSON_USE_CPPTL
-// EnumMemberNames enumMemberNames() const;
-// EnumValues enumValues() const;
-//# endif
-
- /// Comments must be //... or /* ... */
- void setComment( const char *comment,
- CommentPlacement placement );
- /// Comments must be //... or /* ... */
- void setComment( const std::string &comment,
- CommentPlacement placement );
- bool hasComment( CommentPlacement placement ) const;
- /// Include delimiters and embedded newlines.
- std::string getComment( CommentPlacement placement ) const;
-
- std::string toStyledString() const;
-
- const_iterator begin() const;
- const_iterator end() const;
-
- iterator begin();
- iterator end();
-
- private:
- Value &resolveReference( const char *key,
- bool isStatic );
-
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- inline bool isItemAvailable() const
- {
- return itemIsUsed_ == 0;
- }
-
- inline void setItemUsed( bool isUsed = true )
- {
- itemIsUsed_ = isUsed ? 1 : 0;
- }
-
- inline bool isMemberNameStatic() const
- {
- return memberNameIsStatic_ == 0;
- }
-
- inline void setMemberNameIsStatic( bool isStatic )
- {
- memberNameIsStatic_ = isStatic ? 1 : 0;
- }
-# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP
-
- private:
- struct CommentInfo
- {
- CommentInfo();
- ~CommentInfo();
-
- void setComment( const char *text );
-
- char *comment_;
- };
-
- //struct MemberNamesTransform
- //{
- // typedef const char *result_type;
- // const char *operator()( const CZString &name ) const
- // {
- // return name.c_str();
- // }
- //};
-
- union ValueHolder
- {
- LargestInt int_;
- LargestUInt uint_;
- double real_;
- bool bool_;
- char *string_;
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- ValueInternalArray *array_;
- ValueInternalMap *map_;
-#else
- ObjectValues *map_;
-# endif
- } value_;
- ValueType type_ : 8;
- int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
- int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
-# endif
- CommentInfo *comments_;
- };
-
-
- /** \brief Experimental and untested: represents an element of the "path" to access a node.
- */
- class PathArgument
- {
- public:
- friend class Path;
-
- PathArgument();
- PathArgument( ArrayIndex index );
- PathArgument( const char *key );
- PathArgument( const std::string &key );
-
- private:
- enum Kind
- {
- kindNone = 0,
- kindIndex,
- kindKey
- };
- std::string key_;
- ArrayIndex index_;
- Kind kind_;
- };
-
- /** \brief Experimental and untested: represents a "path" to access a node.
- *
- * Syntax:
- * - "." => root node
- * - ".[n]" => elements at index 'n' of root node (an array value)
- * - ".name" => member named 'name' of root node (an object value)
- * - ".name1.name2.name3"
- * - ".[0][1][2].name1[3]"
- * - ".%" => member name is provided as parameter
- * - ".[%]" => index is provied as parameter
- */
- class Path
- {
- public:
- Path( const std::string &path,
- const PathArgument &a1 = PathArgument(),
- const PathArgument &a2 = PathArgument(),
- const PathArgument &a3 = PathArgument(),
- const PathArgument &a4 = PathArgument(),
- const PathArgument &a5 = PathArgument() );
-
- const Value &resolve( const Value &root ) const;
- Value resolve( const Value &root,
- const Value &defaultValue ) const;
- /// Creates the "path" to access the specified node and returns a reference on the node.
- Value &make( Value &root ) const;
-
- private:
- typedef std::vector<const PathArgument *> InArgs;
- typedef std::vector<PathArgument> Args;
-
- void makePath( const std::string &path,
- const InArgs &in );
- void addPathInArg( const std::string &path,
- const InArgs &in,
- InArgs::const_iterator &itInArg,
- PathArgument::Kind kind );
- void invalidPath( const std::string &path,
- int location );
-
- Args args_;
- };
-
-
-
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- /** \brief Allocator to customize Value internal map.
- * Below is an example of a simple implementation (default implementation actually
- * use memory pool for speed).
- * \code
- class DefaultValueMapAllocator : public ValueMapAllocator
- {
- public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- return new ValueInternalMap();
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- return new ValueInternalMap( other );
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- delete map;
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- delete link;
- }
- };
- * \endcode
- */
- class JSON_API ValueMapAllocator
- {
- public:
- virtual ~ValueMapAllocator();
- virtual ValueInternalMap *newMap() = 0;
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0;
- virtual void destructMap( ValueInternalMap *map ) = 0;
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0;
- virtual void releaseMapBuckets( ValueInternalLink *links ) = 0;
- virtual ValueInternalLink *allocateMapLink() = 0;
- virtual void releaseMapLink( ValueInternalLink *link ) = 0;
- };
-
- /** \brief ValueInternalMap hash-map bucket chain link (for internal use only).
- * \internal previous_ & next_ allows for bidirectional traversal.
- */
- class JSON_API ValueInternalLink
- {
- public:
- enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture.
- enum InternalFlags {
- flagAvailable = 0,
- flagUsed = 1
- };
-
- ValueInternalLink();
-
- ~ValueInternalLink();
-
- Value items_[itemPerLink];
- char *keys_[itemPerLink];
- ValueInternalLink *previous_;
- ValueInternalLink *next_;
- };
-
-
- /** \brief A linked page based hash-table implementation used internally by Value.
- * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked
- * list in each bucket to handle collision. There is an addional twist in that
- * each node of the collision linked list is a page containing a fixed amount of
- * value. This provides a better compromise between memory usage and speed.
- *
- * Each bucket is made up of a chained list of ValueInternalLink. The last
- * link of a given bucket can be found in the 'previous_' field of the following bucket.
- * The last link of the last bucket is stored in tailLink_ as it has no following bucket.
- * Only the last link of a bucket may contains 'available' item. The last link always
- * contains at least one element unless is it the bucket one very first link.
- */
- class JSON_API ValueInternalMap
- {
- friend class ValueIteratorBase;
- friend class Value;
- public:
- typedef unsigned int HashKey;
- typedef unsigned int BucketIndex;
-
-# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState
- {
- IteratorState()
- : map_(0)
- , link_(0)
- , itemIndex_(0)
- , bucketIndex_(0)
- {
- }
- ValueInternalMap *map_;
- ValueInternalLink *link_;
- BucketIndex itemIndex_;
- BucketIndex bucketIndex_;
- };
-# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalMap();
- ValueInternalMap( const ValueInternalMap &other );
- ValueInternalMap &operator =( const ValueInternalMap &other );
- ~ValueInternalMap();
-
- void swap( ValueInternalMap &other );
-
- BucketIndex size() const;
-
- void clear();
-
- bool reserveDelta( BucketIndex growth );
-
- bool reserve( BucketIndex newItemCount );
-
- const Value *find( const char *key ) const;
-
- Value *find( const char *key );
-
- Value &resolveReference( const char *key,
- bool isStatic );
-
- void remove( const char *key );
-
- void doActualRemove( ValueInternalLink *link,
- BucketIndex index,
- BucketIndex bucketIndex );
-
- ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex );
-
- Value &setNewItem( const char *key,
- bool isStatic,
- ValueInternalLink *link,
- BucketIndex index );
-
- Value &unsafeAdd( const char *key,
- bool isStatic,
- HashKey hashedKey );
-
- HashKey hash( const char *key ) const;
-
- int compare( const ValueInternalMap &other ) const;
-
- private:
- void makeBeginIterator( IteratorState &it ) const;
- void makeEndIterator( IteratorState &it ) const;
- static bool equals( const IteratorState &x, const IteratorState &other );
- static void increment( IteratorState &iterator );
- static void incrementBucket( IteratorState &iterator );
- static void decrement( IteratorState &iterator );
- static const char *key( const IteratorState &iterator );
- static const char *key( const IteratorState &iterator, bool &isStatic );
- static Value &value( const IteratorState &iterator );
- static int distance( const IteratorState &x, const IteratorState &y );
-
- private:
- ValueInternalLink *buckets_;
- ValueInternalLink *tailLink_;
- BucketIndex bucketsSize_;
- BucketIndex itemCount_;
- };
-
- /** \brief A simplified deque implementation used internally by Value.
- * \internal
- * It is based on a list of fixed "page", each page contains a fixed number of items.
- * Instead of using a linked-list, a array of pointer is used for fast item look-up.
- * Look-up for an element is as follow:
- * - compute page index: pageIndex = itemIndex / itemsPerPage
- * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage]
- *
- * Insertion is amortized constant time (only the array containing the index of pointers
- * need to be reallocated when items are appended).
- */
- class JSON_API ValueInternalArray
- {
- friend class Value;
- friend class ValueIteratorBase;
- public:
- enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo.
- typedef Value::ArrayIndex ArrayIndex;
- typedef unsigned int PageIndex;
-
-# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState // Must be a POD
- {
- IteratorState()
- : array_(0)
- , currentPageIndex_(0)
- , currentItemIndex_(0)
- {
- }
- ValueInternalArray *array_;
- Value **currentPageIndex_;
- unsigned int currentItemIndex_;
- };
-# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalArray();
- ValueInternalArray( const ValueInternalArray &other );
- ValueInternalArray &operator =( const ValueInternalArray &other );
- ~ValueInternalArray();
- void swap( ValueInternalArray &other );
-
- void clear();
- void resize( ArrayIndex newSize );
-
- Value &resolveReference( ArrayIndex index );
-
- Value *find( ArrayIndex index ) const;
-
- ArrayIndex size() const;
-
- int compare( const ValueInternalArray &other ) const;
-
- private:
- static bool equals( const IteratorState &x, const IteratorState &other );
- static void increment( IteratorState &iterator );
- static void decrement( IteratorState &iterator );
- static Value &dereference( const IteratorState &iterator );
- static Value &unsafeDereference( const IteratorState &iterator );
- static int distance( const IteratorState &x, const IteratorState &y );
- static ArrayIndex indexOf( const IteratorState &iterator );
- void makeBeginIterator( IteratorState &it ) const;
- void makeEndIterator( IteratorState &it ) const;
- void makeIterator( IteratorState &it, ArrayIndex index ) const;
-
- void makeIndexValid( ArrayIndex index );
-
- Value **pages_;
- ArrayIndex size_;
- PageIndex pageCount_;
- };
-
- /** \brief Experimental: do not use. Allocator to customize Value internal array.
- * Below is an example of a simple implementation (actual implementation use
- * memory pool).
- \code
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator()
- {
- }
-
- virtual ValueInternalArray *newArray()
- {
- return new ValueInternalArray();
- }
-
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
- {
- return new ValueInternalArray( other );
- }
-
- virtual void destruct( ValueInternalArray *array )
- {
- delete array;
- }
-
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount )
- {
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
- }
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
- {
- if ( indexes )
- free( indexes );
- }
-
- virtual Value *allocateArrayPage()
- {
- return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) );
- }
-
- virtual void releaseArrayPage( Value *value )
- {
- if ( value )
- free( value );
- }
-};
- \endcode
- */
- class JSON_API ValueArrayAllocator
- {
- public:
- virtual ~ValueArrayAllocator();
- virtual ValueInternalArray *newArray() = 0;
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0;
- virtual void destructArray( ValueInternalArray *array ) = 0;
- /** \brief Reallocate array page index.
- * Reallocates an array of pointer on each page.
- * \param indexes [input] pointer on the current index. May be \c NULL.
- * [output] pointer on the new index of at least
- * \a minNewIndexCount pages.
- * \param indexCount [input] current number of pages in the index.
- * [output] number of page the reallocated index can handle.
- * \b MUST be >= \a minNewIndexCount.
- * \param minNewIndexCount Minimum number of page the new index must be able to
- * handle.
- */
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount ) = 0;
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount ) = 0;
- virtual Value *allocateArrayPage() = 0;
- virtual void releaseArrayPage( Value *value ) = 0;
- };
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
-
-
- /** \brief base class for Value iterators.
- *
- */
- class ValueIteratorBase
- {
- public:
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef ValueIteratorBase SelfType;
-
- ValueIteratorBase();
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueIteratorBase( const Value::ObjectValues::iterator &current );
-#else
- ValueIteratorBase( const ValueInternalArray::IteratorState &state );
- ValueIteratorBase( const ValueInternalMap::IteratorState &state );
-#endif
-
- bool operator ==( const SelfType &other ) const
- {
- return isEqual( other );
- }
-
- bool operator !=( const SelfType &other ) const
- {
- return !isEqual( other );
- }
-
- difference_type operator -( const SelfType &other ) const
- {
- return computeDistance( other );
- }
-
- /// Return either the index or the member name of the referenced value as a Value.
- Value key() const;
-
- /// Return the index of the referenced Value. -1 if it is not an arrayValue.
- UInt index() const;
-
- /// Return the member name of the referenced Value. "" if it is not an objectValue.
- const char *memberName() const;
-
- protected:
- Value &deref() const;
-
- void increment();
-
- void decrement();
-
- difference_type computeDistance( const SelfType &other ) const;
-
- bool isEqual( const SelfType &other ) const;
-
- void copy( const SelfType &other );
-
- private:
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- Value::ObjectValues::iterator current_;
- // Indicates that iterator is for a null value.
- bool isNull_;
-#else
- union
- {
- ValueInternalArray::IteratorState array_;
- ValueInternalMap::IteratorState map_;
- } iterator_;
- bool isArray_;
-#endif
- };
-
- /** \brief const iterator for object and array value.
- *
- */
- class ValueConstIterator : public ValueIteratorBase
- {
- friend class Value;
- public:
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef const Value &reference;
- typedef const Value *pointer;
- typedef ValueConstIterator SelfType;
-
- ValueConstIterator();
- private:
- /*! \internal Use by Value to create an iterator.
- */
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueConstIterator( const Value::ObjectValues::iterator &current );
-#else
- ValueConstIterator( const ValueInternalArray::IteratorState &state );
- ValueConstIterator( const ValueInternalMap::IteratorState &state );
-#endif
- public:
- SelfType &operator =( const ValueIteratorBase &other );
-
- SelfType operator++( int )
- {
- SelfType temp( *this );
- ++*this;
- return temp;
- }
-
- SelfType operator--( int )
- {
- SelfType temp( *this );
- --*this;
- return temp;
- }
-
- SelfType &operator--()
- {
- decrement();
- return *this;
- }
-
- SelfType &operator++()
- {
- increment();
- return *this;
- }
-
- reference operator *() const
- {
- return deref();
- }
- };
-
-
- /** \brief Iterator for object and array value.
- */
- class ValueIterator : public ValueIteratorBase
- {
- friend class Value;
- public:
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef Value &reference;
- typedef Value *pointer;
- typedef ValueIterator SelfType;
-
- ValueIterator();
- ValueIterator( const ValueConstIterator &other );
- ValueIterator( const ValueIterator &other );
- private:
- /*! \internal Use by Value to create an iterator.
- */
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueIterator( const Value::ObjectValues::iterator &current );
-#else
- ValueIterator( const ValueInternalArray::IteratorState &state );
- ValueIterator( const ValueInternalMap::IteratorState &state );
-#endif
- public:
-
- SelfType &operator =( const SelfType &other );
-
- SelfType operator++( int )
- {
- SelfType temp( *this );
- ++*this;
- return temp;
- }
-
- SelfType operator--( int )
- {
- SelfType temp( *this );
- --*this;
- return temp;
- }
-
- SelfType &operator--()
- {
- decrement();
- return *this;
- }
-
- SelfType &operator++()
- {
- increment();
- return *this;
- }
-
- reference operator *() const
- {
- return deref();
- }
- };
-
-
-} // namespace Json
-
-
-#endif // CPPTL_JSON_H_INCLUDED
diff --git a/lib/jsoncpp/include/json/writer.h b/lib/jsoncpp/include/json/writer.h
deleted file mode 100644
index 2ee13ded93..0000000000
--- a/lib/jsoncpp/include/json/writer.h
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_WRITER_H_INCLUDED
-# define JSON_WRITER_H_INCLUDED
-
-# include "value.h"
-# include <vector>
-# include <string>
-# include <iostream>
-
-namespace Json {
-
- class Value;
-
- /** \brief Abstract class for writers.
- */
- class JSON_API Writer
- {
- public:
- virtual ~Writer();
-
- virtual std::string write( const Value &root ) = 0;
- };
-
- /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format without formatting (not human friendly).
- *
- * The JSON document is written in a single line. It is not intended for 'human' consumption,
- * but may be usefull to support feature such as RPC where bandwith is limited.
- * \sa Reader, Value
- */
- class JSON_API FastWriter : public Writer
- {
- public:
- FastWriter();
- virtual ~FastWriter(){}
-
- void enableYAMLCompatibility();
-
- public: // overridden from Writer
- virtual std::string write( const Value &root );
-
- private:
- void writeValue( const Value &value );
-
- std::string document_;
- bool yamlCompatiblityEnabled_;
- };
-
- /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way.
- *
- * The rules for line break and indent are as follow:
- * - Object value:
- * - if empty then print {} without indent and line break
- * - if not empty the print '{', line break & indent, print one value per line
- * and then unindent and line break and print '}'.
- * - Array value:
- * - if empty then print [] without indent and line break
- * - if the array contains no object value, empty array or some other value types,
- * and all the values fit on one lines, then print the array on a single line.
- * - otherwise, it the values do not fit on one line, or the array contains
- * object or non empty array, then print one value per line.
- *
- * If the Value have comments then they are outputed according to their #CommentPlacement.
- *
- * \sa Reader, Value, Value::setComment()
- */
- class JSON_API StyledWriter: public Writer
- {
- public:
- StyledWriter();
- virtual ~StyledWriter(){}
-
- public: // overridden from Writer
- /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
- * \param root Value to serialize.
- * \return String containing the JSON document that represents the root value.
- */
- virtual std::string write( const Value &root );
-
- private:
- void writeValue( const Value &value );
- void writeArrayValue( const Value &value );
- bool isMultineArray( const Value &value );
- void pushValue( const std::string &value );
- void writeIndent();
- void writeWithIndent( const std::string &value );
- void indent();
- void unindent();
- void writeCommentBeforeValue( const Value &root );
- void writeCommentAfterValueOnSameLine( const Value &root );
- bool hasCommentForValue( const Value &value );
- static std::string normalizeEOL( const std::string &text );
-
- typedef std::vector<std::string> ChildValues;
-
- ChildValues childValues_;
- std::string document_;
- std::string indentString_;
- int rightMargin_;
- int indentSize_;
- bool addChildValues_;
- };
-
- /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a human friendly way,
- to a stream rather than to a string.
- *
- * The rules for line break and indent are as follow:
- * - Object value:
- * - if empty then print {} without indent and line break
- * - if not empty the print '{', line break & indent, print one value per line
- * and then unindent and line break and print '}'.
- * - Array value:
- * - if empty then print [] without indent and line break
- * - if the array contains no object value, empty array or some other value types,
- * and all the values fit on one lines, then print the array on a single line.
- * - otherwise, it the values do not fit on one line, or the array contains
- * object or non empty array, then print one value per line.
- *
- * If the Value have comments then they are outputed according to their #CommentPlacement.
- *
- * \param indentation Each level will be indented by this amount extra.
- * \sa Reader, Value, Value::setComment()
- */
- class JSON_API StyledStreamWriter
- {
- public:
- StyledStreamWriter( std::string indentation="\t" );
- ~StyledStreamWriter(){}
-
- public:
- /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
- * \param out Stream to write to. (Can be ostringstream, e.g.)
- * \param root Value to serialize.
- * \note There is no point in deriving from Writer, since write() should not return a value.
- */
- void write( std::ostream &out, const Value &root );
-
- private:
- void writeValue( const Value &value );
- void writeArrayValue( const Value &value );
- bool isMultineArray( const Value &value );
- void pushValue( const std::string &value );
- void writeIndent();
- void writeWithIndent( const std::string &value );
- void indent();
- void unindent();
- void writeCommentBeforeValue( const Value &root );
- void writeCommentAfterValueOnSameLine( const Value &root );
- bool hasCommentForValue( const Value &value );
- static std::string normalizeEOL( const std::string &text );
-
- typedef std::vector<std::string> ChildValues;
-
- ChildValues childValues_;
- std::ostream* document_;
- std::string indentString_;
- int rightMargin_;
- std::string indentation_;
- bool addChildValues_;
- };
-
-# if defined(JSON_HAS_INT64)
- std::string JSON_API valueToString( Int value );
- std::string JSON_API valueToString( UInt value );
-# endif // if defined(JSON_HAS_INT64)
- std::string JSON_API valueToString( LargestInt value );
- std::string JSON_API valueToString( LargestUInt value );
- std::string JSON_API valueToString( double value );
- std::string JSON_API valueToString( bool value );
- std::string JSON_API valueToQuotedString( const char *value );
-
- /// \brief Output using the StyledStreamWriter.
- /// \see Json::operator>>()
- std::ostream& operator<<( std::ostream&, const Value &root );
-
-} // namespace Json
-
-
-
-#endif // JSON_WRITER_H_INCLUDED
diff --git a/lib/jsoncpp/makefiles/vs71/jsoncpp.sln b/lib/jsoncpp/makefiles/vs71/jsoncpp.sln
deleted file mode 100644
index dd2f91b442..0000000000
--- a/lib/jsoncpp/makefiles/vs71/jsoncpp.sln
+++ /dev/null
@@ -1,46 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_json", "lib_json.vcproj", "{B84F7231-16CE-41D8-8C08-7B523FF4225B}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jsontest", "jsontest.vcproj", "{25AF2DD2-D396-4668-B188-488C33B8E620}"
- ProjectSection(ProjectDependencies) = postProject
- {B84F7231-16CE-41D8-8C08-7B523FF4225B} = {B84F7231-16CE-41D8-8C08-7B523FF4225B}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_lib_json", "test_lib_json.vcproj", "{B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}"
- ProjectSection(ProjectDependencies) = postProject
- {B84F7231-16CE-41D8-8C08-7B523FF4225B} = {B84F7231-16CE-41D8-8C08-7B523FF4225B}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- dummy = dummy
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {B84F7231-16CE-41D8-8C08-7B523FF4225B}.Debug.ActiveCfg = Debug|Win32
- {B84F7231-16CE-41D8-8C08-7B523FF4225B}.Debug.Build.0 = Debug|Win32
- {B84F7231-16CE-41D8-8C08-7B523FF4225B}.dummy.ActiveCfg = dummy|Win32
- {B84F7231-16CE-41D8-8C08-7B523FF4225B}.dummy.Build.0 = dummy|Win32
- {B84F7231-16CE-41D8-8C08-7B523FF4225B}.Release.ActiveCfg = Release|Win32
- {B84F7231-16CE-41D8-8C08-7B523FF4225B}.Release.Build.0 = Release|Win32
- {25AF2DD2-D396-4668-B188-488C33B8E620}.Debug.ActiveCfg = Debug|Win32
- {25AF2DD2-D396-4668-B188-488C33B8E620}.Debug.Build.0 = Debug|Win32
- {25AF2DD2-D396-4668-B188-488C33B8E620}.dummy.ActiveCfg = Debug|Win32
- {25AF2DD2-D396-4668-B188-488C33B8E620}.dummy.Build.0 = Debug|Win32
- {25AF2DD2-D396-4668-B188-488C33B8E620}.Release.ActiveCfg = Release|Win32
- {25AF2DD2-D396-4668-B188-488C33B8E620}.Release.Build.0 = Release|Win32
- {B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}.Debug.ActiveCfg = Debug|Win32
- {B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}.Debug.Build.0 = Debug|Win32
- {B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}.dummy.ActiveCfg = Debug|Win32
- {B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}.dummy.Build.0 = Debug|Win32
- {B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}.Release.ActiveCfg = Release|Win32
- {B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/lib/jsoncpp/makefiles/vs71/jsontest.vcproj b/lib/jsoncpp/makefiles/vs71/jsontest.vcproj
deleted file mode 100644
index 562c71f61a..0000000000
--- a/lib/jsoncpp/makefiles/vs71/jsontest.vcproj
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="jsontest"
- ProjectGUID="{25AF2DD2-D396-4668-B188-488C33B8E620}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../build/vs71/debug/jsontest"
- IntermediateDirectory="../../build/vs71/debug/jsontest"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/jsontest.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/jsontest.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../build/vs71/release/jsontest"
- IntermediateDirectory="../../build/vs71/release/jsontest"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/jsontest.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="..\..\src\jsontestrunner\main.cpp">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/lib/jsoncpp/makefiles/vs71/lib_json.vcproj b/lib/jsoncpp/makefiles/vs71/lib_json.vcproj
deleted file mode 100644
index 1aa5978a1f..0000000000
--- a/lib/jsoncpp/makefiles/vs71/lib_json.vcproj
+++ /dev/null
@@ -1,214 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="lib_json"
- ProjectGUID="{B84F7231-16CE-41D8-8C08-7B523FF4225B}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../build/vs71/debug/lib_json"
- IntermediateDirectory="../../build/vs71/debug/lib_json"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- StringPooling="TRUE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- EnableFunctionLevelLinking="TRUE"
- DisableLanguageExtensions="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/json_vc71_libmtd.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../build/vs71/release/lib_json"
- IntermediateDirectory="../../build/vs71/release/lib_json"
- ConfigurationType="4"
- CharacterSet="2"
- WholeProgramOptimization="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- GlobalOptimizations="TRUE"
- EnableIntrinsicFunctions="TRUE"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="TRUE"
- DisableLanguageExtensions="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- AssemblerOutput="4"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/json_vc71_libmt.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="dummy|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="2"
- WholeProgramOptimization="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- GlobalOptimizations="TRUE"
- EnableIntrinsicFunctions="TRUE"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- StringPooling="TRUE"
- RuntimeLibrary="4"
- EnableFunctionLevelLinking="TRUE"
- DisableLanguageExtensions="TRUE"
- ForceConformanceInForLoopScope="FALSE"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="0"
- AssemblerOutput="4"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- GenerateDebugInformation="TRUE"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="..\..\include\json\autolink.h">
- </File>
- <File
- RelativePath="..\..\include\json\config.h">
- </File>
- <File
- RelativePath="..\..\include\json\features.h">
- </File>
- <File
- RelativePath="..\..\include\json\forwards.h">
- </File>
- <File
- RelativePath="..\..\include\json\json.h">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_batchallocator.h">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_internalarray.inl">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_internalmap.inl">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_reader.cpp">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_value.cpp">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_valueiterator.inl">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_writer.cpp">
- </File>
- <File
- RelativePath="..\..\include\json\reader.h">
- </File>
- <File
- RelativePath="..\..\include\json\value.h">
- </File>
- <File
- RelativePath="..\..\include\json\writer.h">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/lib/jsoncpp/makefiles/vs71/test_lib_json.vcproj b/lib/jsoncpp/makefiles/vs71/test_lib_json.vcproj
deleted file mode 100644
index 9ebb986a66..0000000000
--- a/lib/jsoncpp/makefiles/vs71/test_lib_json.vcproj
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="test_lib_json"
- ProjectGUID="{B7A96B78-2782-40D2-8F37-A2DEF2B9C26D}"
- RootNamespace="test_lib_json"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="../../build/vs71/debug/test_lib_json"
- IntermediateDirectory="../../build/vs71/debug/test_lib_json"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/test_lib_json.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/test_lib_json.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- Description="Running all unit tests"
- CommandLine="$(TargetPath)"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="../../build/vs71/release/test_lib_json"
- IntermediateDirectory="../../build/vs71/release/test_lib_json"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/test_lib_json.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- Description="Running all unit tests"
- CommandLine="$(TargetPath)"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="..\..\src\test_lib_json\jsontest.cpp">
- </File>
- <File
- RelativePath="..\..\src\test_lib_json\jsontest.h">
- </File>
- <File
- RelativePath="..\..\src\test_lib_json\main.cpp">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/lib/jsoncpp/scons-tools/globtool.py b/lib/jsoncpp/scons-tools/globtool.py
deleted file mode 100644
index 811140e8aa..0000000000
--- a/lib/jsoncpp/scons-tools/globtool.py
+++ /dev/null
@@ -1,53 +0,0 @@
-import fnmatch
-import os
-
-def generate( env ):
- def Glob( env, includes = None, excludes = None, dir = '.' ):
- """Adds Glob( includes = Split( '*' ), excludes = None, dir = '.')
- helper function to environment.
-
- Glob both the file-system files.
-
- includes: list of file name pattern included in the return list when matched.
- excludes: list of file name pattern exluced from the return list.
-
- Example:
- sources = env.Glob( ("*.cpp", '*.h'), "~*.cpp", "#src" )
- """
- def filterFilename(path):
- abs_path = os.path.join( dir, path )
- if not os.path.isfile(abs_path):
- return 0
- fn = os.path.basename(path)
- match = 0
- for include in includes:
- if fnmatch.fnmatchcase( fn, include ):
- match = 1
- break
- if match == 1 and not excludes is None:
- for exclude in excludes:
- if fnmatch.fnmatchcase( fn, exclude ):
- match = 0
- break
- return match
- if includes is None:
- includes = ('*',)
- elif type(includes) in ( type(''), type(u'') ):
- includes = (includes,)
- if type(excludes) in ( type(''), type(u'') ):
- excludes = (excludes,)
- dir = env.Dir(dir).abspath
- paths = os.listdir( dir )
- def makeAbsFileNode( path ):
- return env.File( os.path.join( dir, path ) )
- nodes = filter( filterFilename, paths )
- return map( makeAbsFileNode, nodes )
-
- from SCons.Script import Environment
- Environment.Glob = Glob
-
-def exists(env):
- """
- Tool always exists.
- """
- return True
diff --git a/lib/jsoncpp/scons-tools/srcdist.py b/lib/jsoncpp/scons-tools/srcdist.py
deleted file mode 100644
index 864ff40815..0000000000
--- a/lib/jsoncpp/scons-tools/srcdist.py
+++ /dev/null
@@ -1,179 +0,0 @@
-import os
-import os.path
-from fnmatch import fnmatch
-import targz
-
-##def DoxyfileParse(file_contents):
-## """
-## Parse a Doxygen source file and return a dictionary of all the values.
-## Values will be strings and lists of strings.
-## """
-## data = {}
-##
-## import shlex
-## lex = shlex.shlex(instream = file_contents, posix = True)
-## lex.wordchars += "*+./-:"
-## lex.whitespace = lex.whitespace.replace("\n", "")
-## lex.escape = ""
-##
-## lineno = lex.lineno
-## last_backslash_lineno = lineno
-## token = lex.get_token()
-## key = token # the first token should be a key
-## last_token = ""
-## key_token = False
-## next_key = False
-## new_data = True
-##
-## def append_data(data, key, new_data, token):
-## if new_data or len(data[key]) == 0:
-## data[key].append(token)
-## else:
-## data[key][-1] += token
-##
-## while token:
-## if token in ['\n']:
-## if last_token not in ['\\']:
-## key_token = True
-## elif token in ['\\']:
-## pass
-## elif key_token:
-## key = token
-## key_token = False
-## else:
-## if token == "+=":
-## if not data.has_key(key):
-## data[key] = list()
-## elif token == "=":
-## data[key] = list()
-## else:
-## append_data( data, key, new_data, token )
-## new_data = True
-##
-## last_token = token
-## token = lex.get_token()
-##
-## if last_token == '\\' and token != '\n':
-## new_data = False
-## append_data( data, key, new_data, '\\' )
-##
-## # compress lists of len 1 into single strings
-## for (k, v) in data.items():
-## if len(v) == 0:
-## data.pop(k)
-##
-## # items in the following list will be kept as lists and not converted to strings
-## if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]:
-## continue
-##
-## if len(v) == 1:
-## data[k] = v[0]
-##
-## return data
-##
-##def DoxySourceScan(node, env, path):
-## """
-## Doxygen Doxyfile source scanner. This should scan the Doxygen file and add
-## any files used to generate docs to the list of source files.
-## """
-## default_file_patterns = [
-## '*.c', '*.cc', '*.cxx', '*.cpp', '*.c++', '*.java', '*.ii', '*.ixx',
-## '*.ipp', '*.i++', '*.inl', '*.h', '*.hh ', '*.hxx', '*.hpp', '*.h++',
-## '*.idl', '*.odl', '*.cs', '*.php', '*.php3', '*.inc', '*.m', '*.mm',
-## '*.py',
-## ]
-##
-## default_exclude_patterns = [
-## '*~',
-## ]
-##
-## sources = []
-##
-## data = DoxyfileParse(node.get_contents())
-##
-## if data.get("RECURSIVE", "NO") == "YES":
-## recursive = True
-## else:
-## recursive = False
-##
-## file_patterns = data.get("FILE_PATTERNS", default_file_patterns)
-## exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns)
-##
-## for node in data.get("INPUT", []):
-## if os.path.isfile(node):
-## sources.add(node)
-## elif os.path.isdir(node):
-## if recursive:
-## for root, dirs, files in os.walk(node):
-## for f in files:
-## filename = os.path.join(root, f)
-##
-## pattern_check = reduce(lambda x, y: x or bool(fnmatch(filename, y)), file_patterns, False)
-## exclude_check = reduce(lambda x, y: x and fnmatch(filename, y), exclude_patterns, True)
-##
-## if pattern_check and not exclude_check:
-## sources.append(filename)
-## else:
-## for pattern in file_patterns:
-## sources.extend(glob.glob("/".join([node, pattern])))
-## sources = map( lambda path: env.File(path), sources )
-## return sources
-##
-##
-##def DoxySourceScanCheck(node, env):
-## """Check if we should scan this file"""
-## return os.path.isfile(node.path)
-
-def srcDistEmitter(source, target, env):
-## """Doxygen Doxyfile emitter"""
-## # possible output formats and their default values and output locations
-## output_formats = {
-## "HTML": ("YES", "html"),
-## "LATEX": ("YES", "latex"),
-## "RTF": ("NO", "rtf"),
-## "MAN": ("YES", "man"),
-## "XML": ("NO", "xml"),
-## }
-##
-## data = DoxyfileParse(source[0].get_contents())
-##
-## targets = []
-## out_dir = data.get("OUTPUT_DIRECTORY", ".")
-##
-## # add our output locations
-## for (k, v) in output_formats.items():
-## if data.get("GENERATE_" + k, v[0]) == "YES":
-## targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) )
-##
-## # don't clobber targets
-## for node in targets:
-## env.Precious(node)
-##
-## # set up cleaning stuff
-## for node in targets:
-## env.Clean(node, node)
-##
-## return (targets, source)
- return (target,source)
-
-def generate(env):
- """
- Add builders and construction variables for the
- SrcDist tool.
- """
-## doxyfile_scanner = env.Scanner(
-## DoxySourceScan,
-## "DoxySourceScan",
-## scan_check = DoxySourceScanCheck,
-## )
-
- if targz.exists(env):
- srcdist_builder = targz.makeBuilder( srcDistEmitter )
-
- env['BUILDERS']['SrcDist'] = srcdist_builder
-
-def exists(env):
- """
- Make sure srcdist exists.
- """
- return targz.exists(env)
diff --git a/lib/jsoncpp/scons-tools/substinfile.py b/lib/jsoncpp/scons-tools/substinfile.py
deleted file mode 100644
index 4d305851bb..0000000000
--- a/lib/jsoncpp/scons-tools/substinfile.py
+++ /dev/null
@@ -1,79 +0,0 @@
-import re
-from SCons.Script import * # the usual scons stuff you get in a SConscript
-
-def generate(env):
- """
- Add builders and construction variables for the
- SubstInFile tool.
-
- Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
- from the source to the target.
- The values of SUBST_DICT first have any construction variables expanded
- (its keys are not expanded).
- If a value of SUBST_DICT is a python callable function, it is called and
- the result is expanded as the value.
- If there's more than one source and more than one target, each target gets
- substituted from the corresponding source.
- """
- def do_subst_in_file(targetfile, sourcefile, dict):
- """Replace all instances of the keys of dict with their values.
- For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
- then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
- """
- try:
- f = open(sourcefile, 'rb')
- contents = f.read()
- f.close()
- except:
- raise SCons.Errors.UserError, "Can't read source file %s"%sourcefile
- for (k,v) in dict.items():
- contents = re.sub(k, v, contents)
- try:
- f = open(targetfile, 'wb')
- f.write(contents)
- f.close()
- except:
- raise SCons.Errors.UserError, "Can't write target file %s"%targetfile
- return 0 # success
-
- def subst_in_file(target, source, env):
- if not env.has_key('SUBST_DICT'):
- raise SCons.Errors.UserError, "SubstInFile requires SUBST_DICT to be set."
- d = dict(env['SUBST_DICT']) # copy it
- for (k,v) in d.items():
- if callable(v):
- d[k] = env.subst(v()).replace('\\','\\\\')
- elif SCons.Util.is_String(v):
- d[k] = env.subst(v).replace('\\','\\\\')
- else:
- raise SCons.Errors.UserError, "SubstInFile: key %s: %s must be a string or callable"%(k, repr(v))
- for (t,s) in zip(target, source):
- return do_subst_in_file(str(t), str(s), d)
-
- def subst_in_file_string(target, source, env):
- """This is what gets printed on the console."""
- return '\n'.join(['Substituting vars from %s into %s'%(str(s), str(t))
- for (t,s) in zip(target, source)])
-
- def subst_emitter(target, source, env):
- """Add dependency from substituted SUBST_DICT to target.
- Returns original target, source tuple unchanged.
- """
- d = env['SUBST_DICT'].copy() # copy it
- for (k,v) in d.items():
- if callable(v):
- d[k] = env.subst(v())
- elif SCons.Util.is_String(v):
- d[k]=env.subst(v)
- Depends(target, SCons.Node.Python.Value(d))
- return target, source
-
-## env.Append(TOOLS = 'substinfile') # this should be automaticaly done by Scons ?!?
- subst_action = SCons.Action.Action( subst_in_file, subst_in_file_string )
- env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
-
-def exists(env):
- """
- Make sure tool exists.
- """
- return True
diff --git a/lib/jsoncpp/scons-tools/targz.py b/lib/jsoncpp/scons-tools/targz.py
deleted file mode 100644
index f5432003df..0000000000
--- a/lib/jsoncpp/scons-tools/targz.py
+++ /dev/null
@@ -1,82 +0,0 @@
-"""tarball
-
-Tool-specific initialization for tarball.
-
-"""
-
-## Commands to tackle a command based implementation:
-##to unpack on the fly...
-##gunzip < FILE.tar.gz | tar xvf -
-##to pack on the fly...
-##tar cvf - FILE-LIST | gzip -c > FILE.tar.gz
-
-import os.path
-
-import SCons.Builder
-import SCons.Node.FS
-import SCons.Util
-
-try:
- import gzip
- import tarfile
- internal_targz = 1
-except ImportError:
- internal_targz = 0
-
-TARGZ_DEFAULT_COMPRESSION_LEVEL = 9
-
-if internal_targz:
- def targz(target, source, env):
- def archive_name( path ):
- path = os.path.normpath( os.path.abspath( path ) )
- common_path = os.path.commonprefix( (base_dir, path) )
- archive_name = path[len(common_path):]
- return archive_name
-
- def visit(tar, dirname, names):
- for name in names:
- path = os.path.join(dirname, name)
- if os.path.isfile(path):
- tar.add(path, archive_name(path) )
- compression = env.get('TARGZ_COMPRESSION_LEVEL',TARGZ_DEFAULT_COMPRESSION_LEVEL)
- base_dir = os.path.normpath( env.get('TARGZ_BASEDIR', env.Dir('.')).abspath )
- target_path = str(target[0])
- fileobj = gzip.GzipFile( target_path, 'wb', compression )
- tar = tarfile.TarFile(os.path.splitext(target_path)[0], 'w', fileobj)
- for source in source:
- source_path = str(source)
- if source.isdir():
- os.path.walk(source_path, visit, tar)
- else:
- tar.add(source_path, archive_name(source_path) ) # filename, arcname
- tar.close()
-
- targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR'])
-
- def makeBuilder( emitter = None ):
- return SCons.Builder.Builder(action = SCons.Action.Action('$TARGZ_COM', '$TARGZ_COMSTR'),
- source_factory = SCons.Node.FS.Entry,
- source_scanner = SCons.Defaults.DirScanner,
- suffix = '$TARGZ_SUFFIX',
- multi = 1)
- TarGzBuilder = makeBuilder()
-
- def generate(env):
- """Add Builders and construction variables for zip to an Environment.
- The following environnement variables may be set:
- TARGZ_COMPRESSION_LEVEL: integer, [0-9]. 0: no compression, 9: best compression (same as gzip compression level).
- TARGZ_BASEDIR: base-directory used to determine archive name (this allow archive name to be relative
- to something other than top-dir).
- """
- env['BUILDERS']['TarGz'] = TarGzBuilder
- env['TARGZ_COM'] = targzAction
- env['TARGZ_COMPRESSION_LEVEL'] = TARGZ_DEFAULT_COMPRESSION_LEVEL # range 0-9
- env['TARGZ_SUFFIX'] = '.tar.gz'
- env['TARGZ_BASEDIR'] = env.Dir('.') # Sources archive name are made relative to that directory.
-else:
- def generate(env):
- pass
-
-
-def exists(env):
- return internal_targz
diff --git a/lib/jsoncpp/src/jsontestrunner/main.cpp b/lib/jsoncpp/src/jsontestrunner/main.cpp
deleted file mode 100644
index 2da3ede9ea..0000000000
--- a/lib/jsoncpp/src/jsontestrunner/main.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-/* This executable is used for testing parser/writer using real JSON files.
- */
-
-
-#include <json/json.h>
-#include <algorithm> // sort
-#include <stdio.h>
-
-#if defined(_MSC_VER) && _MSC_VER >= 1310
-# pragma warning( disable: 4996 ) // disable fopen deprecation warning
-#endif
-
-static std::string
-readInputTestFile( const char *path )
-{
- FILE *file = fopen( path, "rb" );
- if ( !file )
- return std::string("");
- fseek( file, 0, SEEK_END );
- long size = ftell( file );
- fseek( file, 0, SEEK_SET );
- std::string text;
- char *buffer = new char[size+1];
- buffer[size] = 0;
- if ( fread( buffer, 1, size, file ) == (unsigned long)size )
- text = buffer;
- fclose( file );
- delete[] buffer;
- return text;
-}
-
-
-static void
-printValueTree( FILE *fout, Json::Value &value, const std::string &path = "." )
-{
- switch ( value.type() )
- {
- case Json::nullValue:
- fprintf( fout, "%s=null\n", path.c_str() );
- break;
- case Json::intValue:
- fprintf( fout, "%s=%s\n", path.c_str(), Json::valueToString( value.asLargestInt() ).c_str() );
- break;
- case Json::uintValue:
- fprintf( fout, "%s=%s\n", path.c_str(), Json::valueToString( value.asLargestUInt() ).c_str() );
- break;
- case Json::realValue:
- fprintf( fout, "%s=%.16g\n", path.c_str(), value.asDouble() );
- break;
- case Json::stringValue:
- fprintf( fout, "%s=\"%s\"\n", path.c_str(), value.asString().c_str() );
- break;
- case Json::booleanValue:
- fprintf( fout, "%s=%s\n", path.c_str(), value.asBool() ? "true" : "false" );
- break;
- case Json::arrayValue:
- {
- fprintf( fout, "%s=[]\n", path.c_str() );
- int size = value.size();
- for ( int index =0; index < size; ++index )
- {
- static char buffer[16];
- sprintf( buffer, "[%d]", index );
- printValueTree( fout, value[index], path + buffer );
- }
- }
- break;
- case Json::objectValue:
- {
- fprintf( fout, "%s={}\n", path.c_str() );
- Json::Value::Members members( value.getMemberNames() );
- std::sort( members.begin(), members.end() );
- std::string suffix = *(path.end()-1) == '.' ? "" : ".";
- for ( Json::Value::Members::iterator it = members.begin();
- it != members.end();
- ++it )
- {
- const std::string &name = *it;
- printValueTree( fout, value[name], path + suffix + name );
- }
- }
- break;
- default:
- break;
- }
-}
-
-
-static int
-parseAndSaveValueTree( const std::string &input,
- const std::string &actual,
- const std::string &kind,
- Json::Value &root,
- const Json::Features &features,
- bool parseOnly )
-{
- Json::Reader reader( features );
- bool parsingSuccessful = reader.parse( input, root );
- if ( !parsingSuccessful )
- {
- printf( "Failed to parse %s file: \n%s\n",
- kind.c_str(),
- reader.getFormatedErrorMessages().c_str() );
- return 1;
- }
-
- if ( !parseOnly )
- {
- FILE *factual = fopen( actual.c_str(), "wt" );
- if ( !factual )
- {
- printf( "Failed to create %s actual file.\n", kind.c_str() );
- return 2;
- }
- printValueTree( factual, root );
- fclose( factual );
- }
- return 0;
-}
-
-
-static int
-rewriteValueTree( const std::string &rewritePath,
- const Json::Value &root,
- std::string &rewrite )
-{
- //Json::FastWriter writer;
- //writer.enableYAMLCompatibility();
- Json::StyledWriter writer;
- rewrite = writer.write( root );
- FILE *fout = fopen( rewritePath.c_str(), "wt" );
- if ( !fout )
- {
- printf( "Failed to create rewrite file: %s\n", rewritePath.c_str() );
- return 2;
- }
- fprintf( fout, "%s\n", rewrite.c_str() );
- fclose( fout );
- return 0;
-}
-
-
-static std::string
-removeSuffix( const std::string &path,
- const std::string &extension )
-{
- if ( extension.length() >= path.length() )
- return std::string("");
- std::string suffix = path.substr( path.length() - extension.length() );
- if ( suffix != extension )
- return std::string("");
- return path.substr( 0, path.length() - extension.length() );
-}
-
-
-static void
-printConfig()
-{
- // Print the configuration used to compile JsonCpp
-#if defined(JSON_NO_INT64)
- printf( "JSON_NO_INT64=1\n" );
-#else
- printf( "JSON_NO_INT64=0\n" );
-#endif
-}
-
-
-static int
-printUsage( const char *argv[] )
-{
- printf( "Usage: %s [--strict] input-json-file", argv[0] );
- return 3;
-}
-
-
-int
-parseCommandLine( int argc, const char *argv[],
- Json::Features &features, std::string &path,
- bool &parseOnly )
-{
- parseOnly = false;
- if ( argc < 2 )
- {
- return printUsage( argv );
- }
-
- int index = 1;
- if ( std::string(argv[1]) == "--json-checker" )
- {
- features = Json::Features::strictMode();
- parseOnly = true;
- ++index;
- }
-
- if ( std::string(argv[1]) == "--json-config" )
- {
- printConfig();
- return 3;
- }
-
- if ( index == argc || index + 1 < argc )
- {
- return printUsage( argv );
- }
-
- path = argv[index];
- return 0;
-}
-
-
-int main( int argc, const char *argv[] )
-{
- std::string path;
- Json::Features features;
- bool parseOnly;
- int exitCode = parseCommandLine( argc, argv, features, path, parseOnly );
- if ( exitCode != 0 )
- {
- return exitCode;
- }
-
- try
- {
- std::string input = readInputTestFile( path.c_str() );
- if ( input.empty() )
- {
- printf( "Failed to read input or empty input: %s\n", path.c_str() );
- return 3;
- }
-
- std::string basePath = removeSuffix( argv[1], ".json" );
- if ( !parseOnly && basePath.empty() )
- {
- printf( "Bad input path. Path does not end with '.expected':\n%s\n", path.c_str() );
- return 3;
- }
-
- std::string actualPath = basePath + ".actual";
- std::string rewritePath = basePath + ".rewrite";
- std::string rewriteActualPath = basePath + ".actual-rewrite";
-
- Json::Value root;
- exitCode = parseAndSaveValueTree( input, actualPath, "input", root, features, parseOnly );
- if ( exitCode == 0 && !parseOnly )
- {
- std::string rewrite;
- exitCode = rewriteValueTree( rewritePath, root, rewrite );
- if ( exitCode == 0 )
- {
- Json::Value rewriteRoot;
- exitCode = parseAndSaveValueTree( rewrite, rewriteActualPath,
- "rewrite", rewriteRoot, features, parseOnly );
- }
- }
- }
- catch ( const std::exception &e )
- {
- printf( "Unhandled exception:\n%s\n", e.what() );
- exitCode = 1;
- }
-
- return exitCode;
-}
-
diff --git a/lib/jsoncpp/src/jsontestrunner/sconscript b/lib/jsoncpp/src/jsontestrunner/sconscript
deleted file mode 100644
index 6e68e31533..0000000000
--- a/lib/jsoncpp/src/jsontestrunner/sconscript
+++ /dev/null
@@ -1,9 +0,0 @@
-Import( 'env_testing buildJSONTests' )
-
-buildJSONTests( env_testing, Split( """
- main.cpp
- """ ),
- 'jsontestrunner' )
-
-# For 'check' to work, 'libs' must be built first.
-env_testing.Depends('jsontestrunner', '#libs')
diff --git a/lib/jsoncpp/src/lib_json/Makefile.in b/lib/jsoncpp/src/lib_json/Makefile.in
deleted file mode 100644
index 4746eb2a05..0000000000
--- a/lib/jsoncpp/src/lib_json/Makefile.in
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDES=-I../../include
-
-SRCS=json_reader.cpp \
- json_value.cpp \
- json_writer.cpp \
-
-LIB= libjsoncpp.a
-
-include ../../../../Makefile.include
diff --git a/lib/jsoncpp/src/lib_json/json_batchallocator.h b/lib/jsoncpp/src/lib_json/json_batchallocator.h
deleted file mode 100644
index 173e2ed257..0000000000
--- a/lib/jsoncpp/src/lib_json/json_batchallocator.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
-# define JSONCPP_BATCHALLOCATOR_H_INCLUDED
-
-# include <stdlib.h>
-# include <assert.h>
-
-# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
-namespace Json {
-
-/* Fast memory allocator.
- *
- * This memory allocator allocates memory for a batch of object (specified by
- * the page size, the number of object in each page).
- *
- * It does not allow the destruction of a single object. All the allocated objects
- * can be destroyed at once. The memory can be either released or reused for future
- * allocation.
- *
- * The in-place new operator must be used to construct the object using the pointer
- * returned by allocate.
- */
-template<typename AllocatedType
- ,const unsigned int objectPerAllocation>
-class BatchAllocator
-{
-public:
- typedef AllocatedType Type;
-
- BatchAllocator( unsigned int objectsPerPage = 255 )
- : freeHead_( 0 )
- , objectsPerPage_( objectsPerPage )
- {
-// printf( "Size: %d => %s\n", sizeof(AllocatedType), typeid(AllocatedType).name() );
- assert( sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *) ); // We must be able to store a slist in the object free space.
- assert( objectsPerPage >= 16 );
- batches_ = allocateBatch( 0 ); // allocated a dummy page
- currentBatch_ = batches_;
- }
-
- ~BatchAllocator()
- {
- for ( BatchInfo *batch = batches_; batch; )
- {
- BatchInfo *nextBatch = batch->next_;
- free( batch );
- batch = nextBatch;
- }
- }
-
- /// allocate space for an array of objectPerAllocation object.
- /// @warning it is the responsability of the caller to call objects constructors.
- AllocatedType *allocate()
- {
- if ( freeHead_ ) // returns node from free list.
- {
- AllocatedType *object = freeHead_;
- freeHead_ = *(AllocatedType **)object;
- return object;
- }
- if ( currentBatch_->used_ == currentBatch_->end_ )
- {
- currentBatch_ = currentBatch_->next_;
- while ( currentBatch_ && currentBatch_->used_ == currentBatch_->end_ )
- currentBatch_ = currentBatch_->next_;
-
- if ( !currentBatch_ ) // no free batch found, allocate a new one
- {
- currentBatch_ = allocateBatch( objectsPerPage_ );
- currentBatch_->next_ = batches_; // insert at the head of the list
- batches_ = currentBatch_;
- }
- }
- AllocatedType *allocated = currentBatch_->used_;
- currentBatch_->used_ += objectPerAllocation;
- return allocated;
- }
-
- /// Release the object.
- /// @warning it is the responsability of the caller to actually destruct the object.
- void release( AllocatedType *object )
- {
- assert( object != 0 );
- *(AllocatedType **)object = freeHead_;
- freeHead_ = object;
- }
-
-private:
- struct BatchInfo
- {
- BatchInfo *next_;
- AllocatedType *used_;
- AllocatedType *end_;
- AllocatedType buffer_[objectPerAllocation];
- };
-
- // disabled copy constructor and assignement operator.
- BatchAllocator( const BatchAllocator & );
- void operator =( const BatchAllocator &);
-
- static BatchInfo *allocateBatch( unsigned int objectsPerPage )
- {
- const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType)* objectPerAllocation
- + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage;
- BatchInfo *batch = static_cast<BatchInfo*>( malloc( mallocSize ) );
- batch->next_ = 0;
- batch->used_ = batch->buffer_;
- batch->end_ = batch->buffer_ + objectsPerPage;
- return batch;
- }
-
- BatchInfo *batches_;
- BatchInfo *currentBatch_;
- /// Head of a single linked list within the allocated space of freeed object
- AllocatedType *freeHead_;
- unsigned int objectsPerPage_;
-};
-
-
-} // namespace Json
-
-# endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION
-
-#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED
-
diff --git a/lib/jsoncpp/src/lib_json/json_internalarray.inl b/lib/jsoncpp/src/lib_json/json_internalarray.inl
deleted file mode 100644
index 66d838ec0b..0000000000
--- a/lib/jsoncpp/src/lib_json/json_internalarray.inl
+++ /dev/null
@@ -1,453 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-// everything is within Json namespace
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueArrayAllocator::~ValueArrayAllocator()
-{
-}
-
-// //////////////////////////////////////////////////////////////////
-// class DefaultValueArrayAllocator
-// //////////////////////////////////////////////////////////////////
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator()
- {
- }
-
- virtual ValueInternalArray *newArray()
- {
- return new ValueInternalArray();
- }
-
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
- {
- return new ValueInternalArray( other );
- }
-
- virtual void destructArray( ValueInternalArray *array )
- {
- delete array;
- }
-
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount )
- {
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
- }
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
- {
- if ( indexes )
- free( indexes );
- }
-
- virtual Value *allocateArrayPage()
- {
- return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) );
- }
-
- virtual void releaseArrayPage( Value *value )
- {
- if ( value )
- free( value );
- }
-};
-
-#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator()
- {
- }
-
- virtual ValueInternalArray *newArray()
- {
- ValueInternalArray *array = arraysAllocator_.allocate();
- new (array) ValueInternalArray(); // placement new
- return array;
- }
-
- virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
- {
- ValueInternalArray *array = arraysAllocator_.allocate();
- new (array) ValueInternalArray( other ); // placement new
- return array;
- }
-
- virtual void destructArray( ValueInternalArray *array )
- {
- if ( array )
- {
- array->~ValueInternalArray();
- arraysAllocator_.release( array );
- }
- }
-
- virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex &indexCount,
- ValueInternalArray::PageIndex minNewIndexCount )
- {
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
- }
- virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
- {
- if ( indexes )
- free( indexes );
- }
-
- virtual Value *allocateArrayPage()
- {
- return static_cast<Value *>( pagesAllocator_.allocate() );
- }
-
- virtual void releaseArrayPage( Value *value )
- {
- if ( value )
- pagesAllocator_.release( value );
- }
-private:
- BatchAllocator<ValueInternalArray,1> arraysAllocator_;
- BatchAllocator<Value,ValueInternalArray::itemsPerPage> pagesAllocator_;
-};
-#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-
-static ValueArrayAllocator *&arrayAllocator()
-{
- static DefaultValueArrayAllocator defaultAllocator;
- static ValueArrayAllocator *arrayAllocator = &defaultAllocator;
- return arrayAllocator;
-}
-
-static struct DummyArrayAllocatorInitializer {
- DummyArrayAllocatorInitializer()
- {
- arrayAllocator(); // ensure arrayAllocator() statics are initialized before main().
- }
-} dummyArrayAllocatorInitializer;
-
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-bool
-ValueInternalArray::equals( const IteratorState &x,
- const IteratorState &other )
-{
- return x.array_ == other.array_
- && x.currentItemIndex_ == other.currentItemIndex_
- && x.currentPageIndex_ == other.currentPageIndex_;
-}
-
-
-void
-ValueInternalArray::increment( IteratorState &it )
-{
- JSON_ASSERT_MESSAGE( it.array_ &&
- (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_
- != it.array_->size_,
- "ValueInternalArray::increment(): moving iterator beyond end" );
- ++(it.currentItemIndex_);
- if ( it.currentItemIndex_ == itemsPerPage )
- {
- it.currentItemIndex_ = 0;
- ++(it.currentPageIndex_);
- }
-}
-
-
-void
-ValueInternalArray::decrement( IteratorState &it )
-{
- JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_
- && it.currentItemIndex_ == 0,
- "ValueInternalArray::decrement(): moving iterator beyond end" );
- if ( it.currentItemIndex_ == 0 )
- {
- it.currentItemIndex_ = itemsPerPage-1;
- --(it.currentPageIndex_);
- }
- else
- {
- --(it.currentItemIndex_);
- }
-}
-
-
-Value &
-ValueInternalArray::unsafeDereference( const IteratorState &it )
-{
- return (*(it.currentPageIndex_))[it.currentItemIndex_];
-}
-
-
-Value &
-ValueInternalArray::dereference( const IteratorState &it )
-{
- JSON_ASSERT_MESSAGE( it.array_ &&
- (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_
- < it.array_->size_,
- "ValueInternalArray::dereference(): dereferencing invalid iterator" );
- return unsafeDereference( it );
-}
-
-void
-ValueInternalArray::makeBeginIterator( IteratorState &it ) const
-{
- it.array_ = const_cast<ValueInternalArray *>( this );
- it.currentItemIndex_ = 0;
- it.currentPageIndex_ = pages_;
-}
-
-
-void
-ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const
-{
- it.array_ = const_cast<ValueInternalArray *>( this );
- it.currentItemIndex_ = index % itemsPerPage;
- it.currentPageIndex_ = pages_ + index / itemsPerPage;
-}
-
-
-void
-ValueInternalArray::makeEndIterator( IteratorState &it ) const
-{
- makeIterator( it, size_ );
-}
-
-
-ValueInternalArray::ValueInternalArray()
- : pages_( 0 )
- , size_( 0 )
- , pageCount_( 0 )
-{
-}
-
-
-ValueInternalArray::ValueInternalArray( const ValueInternalArray &other )
- : pages_( 0 )
- , pageCount_( 0 )
- , size_( other.size_ )
-{
- PageIndex minNewPages = other.size_ / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages );
- JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages,
- "ValueInternalArray::reserve(): bad reallocation" );
- IteratorState itOther;
- other.makeBeginIterator( itOther );
- Value *value;
- for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) )
- {
- if ( index % itemsPerPage == 0 )
- {
- PageIndex pageIndex = index / itemsPerPage;
- value = arrayAllocator()->allocateArrayPage();
- pages_[pageIndex] = value;
- }
- new (value) Value( dereference( itOther ) );
- }
-}
-
-
-ValueInternalArray &
-ValueInternalArray::operator =( const ValueInternalArray &other )
-{
- ValueInternalArray temp( other );
- swap( temp );
- return *this;
-}
-
-
-ValueInternalArray::~ValueInternalArray()
-{
- // destroy all constructed items
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator( it);
- makeEndIterator( itEnd );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- Value *value = &dereference(it);
- value->~Value();
- }
- // release all pages
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex )
- arrayAllocator()->releaseArrayPage( pages_[pageIndex] );
- // release pages index
- arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ );
-}
-
-
-void
-ValueInternalArray::swap( ValueInternalArray &other )
-{
- Value **tempPages = pages_;
- pages_ = other.pages_;
- other.pages_ = tempPages;
- ArrayIndex tempSize = size_;
- size_ = other.size_;
- other.size_ = tempSize;
- PageIndex tempPageCount = pageCount_;
- pageCount_ = other.pageCount_;
- other.pageCount_ = tempPageCount;
-}
-
-void
-ValueInternalArray::clear()
-{
- ValueInternalArray dummy;
- swap( dummy );
-}
-
-
-void
-ValueInternalArray::resize( ArrayIndex newSize )
-{
- if ( newSize == 0 )
- clear();
- else if ( newSize < size_ )
- {
- IteratorState it;
- IteratorState itEnd;
- makeIterator( it, newSize );
- makeIterator( itEnd, size_ );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- Value *value = &dereference(it);
- value->~Value();
- }
- PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage;
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for ( ; pageIndex < lastPageIndex; ++pageIndex )
- arrayAllocator()->releaseArrayPage( pages_[pageIndex] );
- size_ = newSize;
- }
- else if ( newSize > size_ )
- resolveReference( newSize );
-}
-
-
-void
-ValueInternalArray::makeIndexValid( ArrayIndex index )
-{
- // Need to enlarge page index ?
- if ( index >= pageCount_ * itemsPerPage )
- {
- PageIndex minNewPages = (index + 1) / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages );
- JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" );
- }
-
- // Need to allocate new pages ?
- ArrayIndex nextPageIndex =
- (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage
- : size_;
- if ( nextPageIndex <= index )
- {
- PageIndex pageIndex = nextPageIndex / itemsPerPage;
- PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1;
- for ( ; pageToAllocate-- > 0; ++pageIndex )
- pages_[pageIndex] = arrayAllocator()->allocateArrayPage();
- }
-
- // Initialize all new entries
- IteratorState it;
- IteratorState itEnd;
- makeIterator( it, size_ );
- size_ = index + 1;
- makeIterator( itEnd, size_ );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- Value *value = &dereference(it);
- new (value) Value(); // Construct a default value using placement new
- }
-}
-
-Value &
-ValueInternalArray::resolveReference( ArrayIndex index )
-{
- if ( index >= size_ )
- makeIndexValid( index );
- return pages_[index/itemsPerPage][index%itemsPerPage];
-}
-
-Value *
-ValueInternalArray::find( ArrayIndex index ) const
-{
- if ( index >= size_ )
- return 0;
- return &(pages_[index/itemsPerPage][index%itemsPerPage]);
-}
-
-ValueInternalArray::ArrayIndex
-ValueInternalArray::size() const
-{
- return size_;
-}
-
-int
-ValueInternalArray::distance( const IteratorState &x, const IteratorState &y )
-{
- return indexOf(y) - indexOf(x);
-}
-
-
-ValueInternalArray::ArrayIndex
-ValueInternalArray::indexOf( const IteratorState &iterator )
-{
- if ( !iterator.array_ )
- return ArrayIndex(-1);
- return ArrayIndex(
- (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage
- + iterator.currentItemIndex_ );
-}
-
-
-int
-ValueInternalArray::compare( const ValueInternalArray &other ) const
-{
- int sizeDiff( size_ - other.size_ );
- if ( sizeDiff != 0 )
- return sizeDiff;
-
- for ( ArrayIndex index =0; index < size_; ++index )
- {
- int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare(
- other.pages_[index/itemsPerPage][index%itemsPerPage] );
- if ( diff != 0 )
- return diff;
- }
- return 0;
-}
diff --git a/lib/jsoncpp/src/lib_json/json_internalmap.inl b/lib/jsoncpp/src/lib_json/json_internalmap.inl
deleted file mode 100644
index d0dd62adae..0000000000
--- a/lib/jsoncpp/src/lib_json/json_internalmap.inl
+++ /dev/null
@@ -1,612 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-// everything is within Json namespace
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalMap
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) );
- * This optimization is used by the fast allocator.
- */
-ValueInternalLink::ValueInternalLink()
- : previous_( 0 )
- , next_( 0 )
-{
-}
-
-ValueInternalLink::~ValueInternalLink()
-{
- for ( int index =0; index < itemPerLink; ++index )
- {
- if ( !items_[index].isItemAvailable() )
- {
- if ( !items_[index].isMemberNameStatic() )
- free( keys_[index] );
- }
- else
- break;
- }
-}
-
-
-
-ValueMapAllocator::~ValueMapAllocator()
-{
-}
-
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueMapAllocator : public ValueMapAllocator
-{
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- return new ValueInternalMap();
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- return new ValueInternalMap( other );
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- delete map;
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- delete link;
- }
-};
-#else
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueMapAllocator : public ValueMapAllocator
-{
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- ValueInternalMap *map = mapsAllocator_.allocate();
- new (map) ValueInternalMap(); // placement new
- return map;
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- ValueInternalMap *map = mapsAllocator_.allocate();
- new (map) ValueInternalMap( other ); // placement new
- return map;
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- if ( map )
- {
- map->~ValueInternalMap();
- mapsAllocator_.release( map );
- }
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- ValueInternalLink *link = linksAllocator_.allocate();
- memset( link, 0, sizeof(ValueInternalLink) );
- return link;
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- link->~ValueInternalLink();
- linksAllocator_.release( link );
- }
-private:
- BatchAllocator<ValueInternalMap,1> mapsAllocator_;
- BatchAllocator<ValueInternalLink,1> linksAllocator_;
-};
-#endif
-
-static ValueMapAllocator *&mapAllocator()
-{
- static DefaultValueMapAllocator defaultAllocator;
- static ValueMapAllocator *mapAllocator = &defaultAllocator;
- return mapAllocator;
-}
-
-static struct DummyMapAllocatorInitializer {
- DummyMapAllocatorInitializer()
- {
- mapAllocator(); // ensure mapAllocator() statics are initialized before main().
- }
-} dummyMapAllocatorInitializer;
-
-
-
-// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32.
-
-/*
-use linked list hash map.
-buckets array is a container.
-linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124)
-value have extra state: valid, available, deleted
-*/
-
-
-ValueInternalMap::ValueInternalMap()
- : buckets_( 0 )
- , tailLink_( 0 )
- , bucketsSize_( 0 )
- , itemCount_( 0 )
-{
-}
-
-
-ValueInternalMap::ValueInternalMap( const ValueInternalMap &other )
- : buckets_( 0 )
- , tailLink_( 0 )
- , bucketsSize_( 0 )
- , itemCount_( 0 )
-{
- reserve( other.itemCount_ );
- IteratorState it;
- IteratorState itEnd;
- other.makeBeginIterator( it );
- other.makeEndIterator( itEnd );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- bool isStatic;
- const char *memberName = key( it, isStatic );
- const Value &aValue = value( it );
- resolveReference(memberName, isStatic) = aValue;
- }
-}
-
-
-ValueInternalMap &
-ValueInternalMap::operator =( const ValueInternalMap &other )
-{
- ValueInternalMap dummy( other );
- swap( dummy );
- return *this;
-}
-
-
-ValueInternalMap::~ValueInternalMap()
-{
- if ( buckets_ )
- {
- for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex )
- {
- ValueInternalLink *link = buckets_[bucketIndex].next_;
- while ( link )
- {
- ValueInternalLink *linkToRelease = link;
- link = link->next_;
- mapAllocator()->releaseMapLink( linkToRelease );
- }
- }
- mapAllocator()->releaseMapBuckets( buckets_ );
- }
-}
-
-
-void
-ValueInternalMap::swap( ValueInternalMap &other )
-{
- ValueInternalLink *tempBuckets = buckets_;
- buckets_ = other.buckets_;
- other.buckets_ = tempBuckets;
- ValueInternalLink *tempTailLink = tailLink_;
- tailLink_ = other.tailLink_;
- other.tailLink_ = tempTailLink;
- BucketIndex tempBucketsSize = bucketsSize_;
- bucketsSize_ = other.bucketsSize_;
- other.bucketsSize_ = tempBucketsSize;
- BucketIndex tempItemCount = itemCount_;
- itemCount_ = other.itemCount_;
- other.itemCount_ = tempItemCount;
-}
-
-
-void
-ValueInternalMap::clear()
-{
- ValueInternalMap dummy;
- swap( dummy );
-}
-
-
-ValueInternalMap::BucketIndex
-ValueInternalMap::size() const
-{
- return itemCount_;
-}
-
-bool
-ValueInternalMap::reserveDelta( BucketIndex growth )
-{
- return reserve( itemCount_ + growth );
-}
-
-bool
-ValueInternalMap::reserve( BucketIndex newItemCount )
-{
- if ( !buckets_ && newItemCount > 0 )
- {
- buckets_ = mapAllocator()->allocateMapBuckets( 1 );
- bucketsSize_ = 1;
- tailLink_ = &buckets_[0];
- }
-// BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink;
- return true;
-}
-
-
-const Value *
-ValueInternalMap::find( const char *key ) const
-{
- if ( !bucketsSize_ )
- return 0;
- HashKey hashedKey = hash( key );
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for ( const ValueInternalLink *current = &buckets_[bucketIndex];
- current != 0;
- current = current->next_ )
- {
- for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( current->items_[index].isItemAvailable() )
- return 0;
- if ( strcmp( key, current->keys_[index] ) == 0 )
- return &current->items_[index];
- }
- }
- return 0;
-}
-
-
-Value *
-ValueInternalMap::find( const char *key )
-{
- const ValueInternalMap *constThis = this;
- return const_cast<Value *>( constThis->find( key ) );
-}
-
-
-Value &
-ValueInternalMap::resolveReference( const char *key,
- bool isStatic )
-{
- HashKey hashedKey = hash( key );
- if ( bucketsSize_ )
- {
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink **previous = 0;
- BucketIndex index;
- for ( ValueInternalLink *current = &buckets_[bucketIndex];
- current != 0;
- previous = &current->next_, current = current->next_ )
- {
- for ( index=0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( current->items_[index].isItemAvailable() )
- return setNewItem( key, isStatic, current, index );
- if ( strcmp( key, current->keys_[index] ) == 0 )
- return current->items_[index];
- }
- }
- }
-
- reserveDelta( 1 );
- return unsafeAdd( key, isStatic, hashedKey );
-}
-
-
-void
-ValueInternalMap::remove( const char *key )
-{
- HashKey hashedKey = hash( key );
- if ( !bucketsSize_ )
- return;
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for ( ValueInternalLink *link = &buckets_[bucketIndex];
- link != 0;
- link = link->next_ )
- {
- BucketIndex index;
- for ( index =0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( link->items_[index].isItemAvailable() )
- return;
- if ( strcmp( key, link->keys_[index] ) == 0 )
- {
- doActualRemove( link, index, bucketIndex );
- return;
- }
- }
- }
-}
-
-void
-ValueInternalMap::doActualRemove( ValueInternalLink *link,
- BucketIndex index,
- BucketIndex bucketIndex )
-{
- // find last item of the bucket and swap it with the 'removed' one.
- // set removed items flags to 'available'.
- // if last page only contains 'available' items, then desallocate it (it's empty)
- ValueInternalLink *&lastLink = getLastLinkInBucket( index );
- BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1
- for ( ;
- lastItemIndex < ValueInternalLink::itemPerLink;
- ++lastItemIndex ) // may be optimized with dicotomic search
- {
- if ( lastLink->items_[lastItemIndex].isItemAvailable() )
- break;
- }
-
- BucketIndex lastUsedIndex = lastItemIndex - 1;
- Value *valueToDelete = &link->items_[index];
- Value *valueToPreserve = &lastLink->items_[lastUsedIndex];
- if ( valueToDelete != valueToPreserve )
- valueToDelete->swap( *valueToPreserve );
- if ( lastUsedIndex == 0 ) // page is now empty
- { // remove it from bucket linked list and delete it.
- ValueInternalLink *linkPreviousToLast = lastLink->previous_;
- if ( linkPreviousToLast != 0 ) // can not deleted bucket link.
- {
- mapAllocator()->releaseMapLink( lastLink );
- linkPreviousToLast->next_ = 0;
- lastLink = linkPreviousToLast;
- }
- }
- else
- {
- Value dummy;
- valueToPreserve->swap( dummy ); // restore deleted to default Value.
- valueToPreserve->setItemUsed( false );
- }
- --itemCount_;
-}
-
-
-ValueInternalLink *&
-ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex )
-{
- if ( bucketIndex == bucketsSize_ - 1 )
- return tailLink_;
- ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_;
- if ( !previous )
- previous = &buckets_[bucketIndex];
- return previous;
-}
-
-
-Value &
-ValueInternalMap::setNewItem( const char *key,
- bool isStatic,
- ValueInternalLink *link,
- BucketIndex index )
-{
- char *duplicatedKey = makeMemberName( key );
- ++itemCount_;
- link->keys_[index] = duplicatedKey;
- link->items_[index].setItemUsed();
- link->items_[index].setMemberNameIsStatic( isStatic );
- return link->items_[index]; // items already default constructed.
-}
-
-
-Value &
-ValueInternalMap::unsafeAdd( const char *key,
- bool isStatic,
- HashKey hashedKey )
-{
- JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." );
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex );
- ValueInternalLink *link = previousLink;
- BucketIndex index;
- for ( index =0; index < ValueInternalLink::itemPerLink; ++index )
- {
- if ( link->items_[index].isItemAvailable() )
- break;
- }
- if ( index == ValueInternalLink::itemPerLink ) // need to add a new page
- {
- ValueInternalLink *newLink = mapAllocator()->allocateMapLink();
- index = 0;
- link->next_ = newLink;
- previousLink = newLink;
- link = newLink;
- }
- return setNewItem( key, isStatic, link, index );
-}
-
-
-ValueInternalMap::HashKey
-ValueInternalMap::hash( const char *key ) const
-{
- HashKey hash = 0;
- while ( *key )
- hash += *key++ * 37;
- return hash;
-}
-
-
-int
-ValueInternalMap::compare( const ValueInternalMap &other ) const
-{
- int sizeDiff( itemCount_ - other.itemCount_ );
- if ( sizeDiff != 0 )
- return sizeDiff;
- // Strict order guaranty is required. Compare all keys FIRST, then compare values.
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator( it );
- makeEndIterator( itEnd );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- if ( !other.find( key( it ) ) )
- return 1;
- }
-
- // All keys are equals, let's compare values
- makeBeginIterator( it );
- for ( ; !equals(it,itEnd); increment(it) )
- {
- const Value *otherValue = other.find( key( it ) );
- int valueDiff = value(it).compare( *otherValue );
- if ( valueDiff != 0 )
- return valueDiff;
- }
- return 0;
-}
-
-
-void
-ValueInternalMap::makeBeginIterator( IteratorState &it ) const
-{
- it.map_ = const_cast<ValueInternalMap *>( this );
- it.bucketIndex_ = 0;
- it.itemIndex_ = 0;
- it.link_ = buckets_;
-}
-
-
-void
-ValueInternalMap::makeEndIterator( IteratorState &it ) const
-{
- it.map_ = const_cast<ValueInternalMap *>( this );
- it.bucketIndex_ = bucketsSize_;
- it.itemIndex_ = 0;
- it.link_ = 0;
-}
-
-
-bool
-ValueInternalMap::equals( const IteratorState &x, const IteratorState &other )
-{
- return x.map_ == other.map_
- && x.bucketIndex_ == other.bucketIndex_
- && x.link_ == other.link_
- && x.itemIndex_ == other.itemIndex_;
-}
-
-
-void
-ValueInternalMap::incrementBucket( IteratorState &iterator )
-{
- ++iterator.bucketIndex_;
- JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_,
- "ValueInternalMap::increment(): attempting to iterate beyond end." );
- if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ )
- iterator.link_ = 0;
- else
- iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]);
- iterator.itemIndex_ = 0;
-}
-
-
-void
-ValueInternalMap::increment( IteratorState &iterator )
-{
- JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." );
- ++iterator.itemIndex_;
- if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink )
- {
- JSON_ASSERT_MESSAGE( iterator.link_ != 0,
- "ValueInternalMap::increment(): attempting to iterate beyond end." );
- iterator.link_ = iterator.link_->next_;
- if ( iterator.link_ == 0 )
- incrementBucket( iterator );
- }
- else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() )
- {
- incrementBucket( iterator );
- }
-}
-
-
-void
-ValueInternalMap::decrement( IteratorState &iterator )
-{
- if ( iterator.itemIndex_ == 0 )
- {
- JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." );
- if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] )
- {
- JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." );
- --(iterator.bucketIndex_);
- }
- iterator.link_ = iterator.link_->previous_;
- iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1;
- }
-}
-
-
-const char *
-ValueInternalMap::key( const IteratorState &iterator )
-{
- JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-const char *
-ValueInternalMap::key( const IteratorState &iterator, bool &isStatic )
-{
- JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
- isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic();
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-
-Value &
-ValueInternalMap::value( const IteratorState &iterator )
-{
- JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." );
- return iterator.link_->items_[iterator.itemIndex_];
-}
-
-
-int
-ValueInternalMap::distance( const IteratorState &x, const IteratorState &y )
-{
- int offset = 0;
- IteratorState it = x;
- while ( !equals( it, y ) )
- increment( it );
- return offset;
-}
diff --git a/lib/jsoncpp/src/lib_json/json_reader.cpp b/lib/jsoncpp/src/lib_json/json_reader.cpp
deleted file mode 100644
index 60dc4c9199..0000000000
--- a/lib/jsoncpp/src/lib_json/json_reader.cpp
+++ /dev/null
@@ -1,870 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#include <json/reader.h>
-#include <json/value.h>
-#include "json_tool.h"
-#include <utility>
-#include <cstdio>
-#include <cassert>
-#include <cstring>
-#include <iostream>
-#include <stdexcept>
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
-#endif
-
-namespace Json {
-
-// Implementation of class Features
-// ////////////////////////////////
-
-Features::Features()
- : allowComments_( true )
- , strictRoot_( false )
-{
-}
-
-
-Features
-Features::all()
-{
- return Features();
-}
-
-
-Features
-Features::strictMode()
-{
- Features features;
- features.allowComments_ = false;
- features.strictRoot_ = true;
- return features;
-}
-
-// Implementation of class Reader
-// ////////////////////////////////
-
-
-static inline bool
-in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4 )
-{
- return c == c1 || c == c2 || c == c3 || c == c4;
-}
-
-static inline bool
-in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4, Reader::Char c5 )
-{
- return c == c1 || c == c2 || c == c3 || c == c4 || c == c5;
-}
-
-
-static bool
-containsNewLine( Reader::Location begin,
- Reader::Location end )
-{
- for ( ;begin < end; ++begin )
- if ( *begin == '\n' || *begin == '\r' )
- return true;
- return false;
-}
-
-
-// Class Reader
-// //////////////////////////////////////////////////////////////////
-
-Reader::Reader()
- : features_( Features::all() )
-{
-}
-
-
-Reader::Reader( const Features &features )
- : features_( features )
-{
-}
-
-
-bool
-Reader::parse( const std::string &document,
- Value &root,
- bool collectComments )
-{
- document_ = document;
- const char *begin = document_.c_str();
- const char *end = begin + document_.length();
- return parse( begin, end, root, collectComments );
-}
-
-
-bool
-Reader::parse( std::istream& sin,
- Value &root,
- bool collectComments )
-{
- //std::istream_iterator<char> begin(sin);
- //std::istream_iterator<char> end;
- // Those would allow streamed input from a file, if parse() were a
- // template function.
-
- // Since std::string is reference-counted, this at least does not
- // create an extra copy.
- std::string doc;
- std::getline(sin, doc, (char)EOF);
- return parse( doc, root, collectComments );
-}
-
-bool
-Reader::parse( const char *beginDoc, const char *endDoc,
- Value &root,
- bool collectComments )
-{
- if ( !features_.allowComments_ )
- {
- collectComments = false;
- }
-
- begin_ = beginDoc;
- end_ = endDoc;
- collectComments_ = collectComments;
- current_ = begin_;
- lastValueEnd_ = 0;
- lastValue_ = 0;
- commentsBefore_ = "";
- errors_.clear();
- while ( !nodes_.empty() )
- nodes_.pop();
- nodes_.push( &root );
-
- bool successful = readValue();
- Token token;
- skipCommentTokens( token );
- if ( collectComments_ && !commentsBefore_.empty() )
- root.setComment( commentsBefore_, commentAfter );
- if ( features_.strictRoot_ )
- {
- if ( !root.isArray() && !root.isObject() )
- {
- // Set error location to start of doc, ideally should be first token found in doc
- token.type_ = tokenError;
- token.start_ = beginDoc;
- token.end_ = endDoc;
- addError( "A valid JSON document must be either an array or an object value.",
- token );
- return false;
- }
- }
- return successful;
-}
-
-
-bool
-Reader::readValue()
-{
- Token token;
- skipCommentTokens( token );
- bool successful = true;
-
- if ( collectComments_ && !commentsBefore_.empty() )
- {
- currentValue().setComment( commentsBefore_, commentBefore );
- commentsBefore_ = "";
- }
-
-
- switch ( token.type_ )
- {
- case tokenObjectBegin:
- successful = readObject( token );
- break;
- case tokenArrayBegin:
- successful = readArray( token );
- break;
- case tokenNumber:
- successful = decodeNumber( token );
- break;
- case tokenString:
- successful = decodeString( token );
- break;
- case tokenTrue:
- currentValue() = true;
- break;
- case tokenFalse:
- currentValue() = false;
- break;
- case tokenNull:
- currentValue() = Value();
- break;
- default:
- return addError( "Syntax error: value, object or array expected.", token );
- }
-
- if ( collectComments_ )
- {
- lastValueEnd_ = current_;
- lastValue_ = &currentValue();
- }
-
- return successful;
-}
-
-
-void
-Reader::skipCommentTokens( Token &token )
-{
- if ( features_.allowComments_ )
- {
- do
- {
- readToken( token );
- }
- while ( token.type_ == tokenComment );
- }
- else
- {
- readToken( token );
- }
-}
-
-
-bool
-Reader::expectToken( TokenType type, Token &token, const char *message )
-{
- readToken( token );
- if ( token.type_ != type )
- return addError( message, token );
- return true;
-}
-
-
-bool
-Reader::readToken( Token &token )
-{
- skipSpaces();
- token.start_ = current_;
- Char c = getNextChar();
- bool ok = true;
- switch ( c )
- {
- case '{':
- token.type_ = tokenObjectBegin;
- break;
- case '}':
- token.type_ = tokenObjectEnd;
- break;
- case '[':
- token.type_ = tokenArrayBegin;
- break;
- case ']':
- token.type_ = tokenArrayEnd;
- break;
- case '"':
- token.type_ = tokenString;
- ok = readString();
- break;
- case '/':
- token.type_ = tokenComment;
- ok = readComment();
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case '-':
- token.type_ = tokenNumber;
- readNumber();
- break;
- case 't':
- token.type_ = tokenTrue;
- ok = match( "rue", 3 );
- break;
- case 'f':
- token.type_ = tokenFalse;
- ok = match( "alse", 4 );
- break;
- case 'n':
- token.type_ = tokenNull;
- ok = match( "ull", 3 );
- break;
- case ',':
- token.type_ = tokenArraySeparator;
- break;
- case ':':
- token.type_ = tokenMemberSeparator;
- break;
- case 0:
- token.type_ = tokenEndOfStream;
- break;
- default:
- ok = false;
- break;
- }
- if ( !ok )
- token.type_ = tokenError;
- token.end_ = current_;
- return true;
-}
-
-
-void
-Reader::skipSpaces()
-{
- while ( current_ != end_ )
- {
- Char c = *current_;
- if ( c == ' ' || c == '\t' || c == '\r' || c == '\n' )
- ++current_;
- else
- break;
- }
-}
-
-
-bool
-Reader::match( Location pattern,
- int patternLength )
-{
- if ( end_ - current_ < patternLength )
- return false;
- int index = patternLength;
- while ( index-- )
- if ( current_[index] != pattern[index] )
- return false;
- current_ += patternLength;
- return true;
-}
-
-
-bool
-Reader::readComment()
-{
- Location commentBegin = current_ - 1;
- Char c = getNextChar();
- bool successful = false;
- if ( c == '*' )
- successful = readCStyleComment();
- else if ( c == '/' )
- successful = readCppStyleComment();
- if ( !successful )
- return false;
-
- if ( collectComments_ )
- {
- CommentPlacement placement = commentBefore;
- if ( lastValueEnd_ && !containsNewLine( lastValueEnd_, commentBegin ) )
- {
- if ( c != '*' || !containsNewLine( commentBegin, current_ ) )
- placement = commentAfterOnSameLine;
- }
-
- addComment( commentBegin, current_, placement );
- }
- return true;
-}
-
-
-void
-Reader::addComment( Location begin,
- Location end,
- CommentPlacement placement )
-{
- assert( collectComments_ );
- if ( placement == commentAfterOnSameLine )
- {
- assert( lastValue_ != 0 );
- lastValue_->setComment( std::string( begin, end ), placement );
- }
- else
- {
- if ( !commentsBefore_.empty() )
- commentsBefore_ += "\n";
- commentsBefore_ += std::string( begin, end );
- }
-}
-
-
-bool
-Reader::readCStyleComment()
-{
- while ( current_ != end_ )
- {
- Char c = getNextChar();
- if ( c == '*' && *current_ == '/' )
- break;
- }
- return getNextChar() == '/';
-}
-
-
-bool
-Reader::readCppStyleComment()
-{
- while ( current_ != end_ )
- {
- Char c = getNextChar();
- if ( c == '\r' || c == '\n' )
- break;
- }
- return true;
-}
-
-
-void
-Reader::readNumber()
-{
- while ( current_ != end_ )
- {
- if ( !(*current_ >= '0' && *current_ <= '9') &&
- !in( *current_, '.', 'e', 'E', '+', '-' ) )
- break;
- ++current_;
- }
-}
-
-bool
-Reader::readString()
-{
- Char c = 0;
- while ( current_ != end_ )
- {
- c = getNextChar();
- if ( c == '\\' )
- getNextChar();
- else if ( c == '"' )
- break;
- }
- return c == '"';
-}
-
-
-bool
-Reader::readObject( Token &tokenStart )
-{
- Token tokenName;
- std::string name;
- currentValue() = Value( objectValue );
- while ( readToken( tokenName ) )
- {
- bool initialTokenOk = true;
- while ( tokenName.type_ == tokenComment && initialTokenOk )
- initialTokenOk = readToken( tokenName );
- if ( !initialTokenOk )
- break;
- if ( tokenName.type_ == tokenObjectEnd && name.empty() ) // empty object
- return true;
- if ( tokenName.type_ != tokenString )
- break;
-
- name = "";
- if ( !decodeString( tokenName, name ) )
- return recoverFromError( tokenObjectEnd );
-
- Token colon;
- if ( !readToken( colon ) || colon.type_ != tokenMemberSeparator )
- {
- return addErrorAndRecover( "Missing ':' after object member name",
- colon,
- tokenObjectEnd );
- }
- Value &value = currentValue()[ name ];
- nodes_.push( &value );
- bool ok = readValue();
- nodes_.pop();
- if ( !ok ) // error already set
- return recoverFromError( tokenObjectEnd );
-
- Token comma;
- if ( !readToken( comma )
- || ( comma.type_ != tokenObjectEnd &&
- comma.type_ != tokenArraySeparator &&
- comma.type_ != tokenComment ) )
- {
- return addErrorAndRecover( "Missing ',' or '}' in object declaration",
- comma,
- tokenObjectEnd );
- }
- bool finalizeTokenOk = true;
- while ( comma.type_ == tokenComment &&
- finalizeTokenOk )
- finalizeTokenOk = readToken( comma );
- if ( comma.type_ == tokenObjectEnd )
- return true;
- }
- return addErrorAndRecover( "Missing '}' or object member name",
- tokenName,
- tokenObjectEnd );
-}
-
-
-bool
-Reader::readArray( Token &tokenStart )
-{
- currentValue() = Value( arrayValue );
- skipSpaces();
- if ( *current_ == ']' ) // empty array
- {
- Token endArray;
- readToken( endArray );
- return true;
- }
- int index = 0;
- while ( true )
- {
- Value &value = currentValue()[ index++ ];
- nodes_.push( &value );
- bool ok = readValue();
- nodes_.pop();
- if ( !ok ) // error already set
- return recoverFromError( tokenArrayEnd );
-
- Token token;
- // Accept Comment after last item in the array.
- ok = readToken( token );
- while ( token.type_ == tokenComment && ok )
- {
- ok = readToken( token );
- }
- bool badTokenType = ( token.type_ == tokenArraySeparator &&
- token.type_ == tokenArrayEnd );
- if ( !ok || badTokenType )
- {
- return addErrorAndRecover( "Missing ',' or ']' in array declaration",
- token,
- tokenArrayEnd );
- }
- if ( token.type_ == tokenArrayEnd )
- break;
- }
- return true;
-}
-
-
-bool
-Reader::decodeNumber( Token &token )
-{
- bool isDouble = false;
- for ( Location inspect = token.start_; inspect != token.end_; ++inspect )
- {
- isDouble = isDouble
- || in( *inspect, '.', 'e', 'E', '+' )
- || ( *inspect == '-' && inspect != token.start_ );
- }
- if ( isDouble )
- return decodeDouble( token );
- // Attempts to parse the number as an integer. If the number is
- // larger than the maximum supported value of an integer then
- // we decode the number as a double.
- Location current = token.start_;
- bool isNegative = *current == '-';
- if ( isNegative )
- ++current;
- Value::LargestUInt maxIntegerValue = isNegative ? Value::LargestUInt(-Value::minLargestInt)
- : Value::maxLargestUInt;
- Value::LargestUInt threshold = maxIntegerValue / 10;
- Value::UInt lastDigitThreshold = Value::UInt( maxIntegerValue % 10 );
- assert( lastDigitThreshold >=0 && lastDigitThreshold <= 9 );
- Value::LargestUInt value = 0;
- while ( current < token.end_ )
- {
- Char c = *current++;
- if ( c < '0' || c > '9' )
- return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
- Value::UInt digit(c - '0');
- if ( value >= threshold )
- {
- // If the current digit is not the last one, or if it is
- // greater than the last digit of the maximum integer value,
- // the parse the number as a double.
- if ( current != token.end_ || digit > lastDigitThreshold )
- {
- return decodeDouble( token );
- }
- }
- value = value * 10 + digit;
- }
- if ( isNegative )
- currentValue() = -Value::LargestInt( value );
- else if ( value <= Value::LargestUInt(Value::maxInt) )
- currentValue() = Value::LargestInt( value );
- else
- currentValue() = value;
- return true;
-}
-
-
-bool
-Reader::decodeDouble( Token &token )
-{
- double value = 0;
- const int bufferSize = 32;
- int count;
- int length = int(token.end_ - token.start_);
- if ( length <= bufferSize )
- {
- Char buffer[bufferSize];
- memcpy( buffer, token.start_, length );
- buffer[length] = 0;
- count = sscanf( buffer, "%lf", &value );
- }
- else
- {
- std::string buffer( token.start_, token.end_ );
- count = sscanf( buffer.c_str(), "%lf", &value );
- }
-
- if ( count != 1 )
- return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
- currentValue() = value;
- return true;
-}
-
-
-bool
-Reader::decodeString( Token &token )
-{
- std::string decoded;
- if ( !decodeString( token, decoded ) )
- return false;
- currentValue() = decoded;
- return true;
-}
-
-
-bool
-Reader::decodeString( Token &token, std::string &decoded )
-{
- decoded.reserve( token.end_ - token.start_ - 2 );
- Location current = token.start_ + 1; // skip '"'
- Location end = token.end_ - 1; // do not include '"'
- while ( current != end )
- {
- Char c = *current++;
- if ( c == '"' )
- break;
- else if ( c == '\\' )
- {
- if ( current == end )
- return addError( "Empty escape sequence in string", token, current );
- Char escape = *current++;
- switch ( escape )
- {
- case '"': decoded += '"'; break;
- case '/': decoded += '/'; break;
- case '\\': decoded += '\\'; break;
- case 'b': decoded += '\b'; break;
- case 'f': decoded += '\f'; break;
- case 'n': decoded += '\n'; break;
- case 'r': decoded += '\r'; break;
- case 't': decoded += '\t'; break;
- case 'u':
- {
- unsigned int unicode;
- if ( !decodeUnicodeCodePoint( token, current, end, unicode ) )
- return false;
- decoded += codePointToUTF8(unicode);
- }
- break;
- default:
- return addError( "Bad escape sequence in string", token, current );
- }
- }
- else
- {
- decoded += c;
- }
- }
- return true;
-}
-
-bool
-Reader::decodeUnicodeCodePoint( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode )
-{
-
- if ( !decodeUnicodeEscapeSequence( token, current, end, unicode ) )
- return false;
- if (unicode >= 0xD800 && unicode <= 0xDBFF)
- {
- // surrogate pairs
- if (end - current < 6)
- return addError( "additional six characters expected to parse unicode surrogate pair.", token, current );
- unsigned int surrogatePair;
- if (*(current++) == '\\' && *(current++)== 'u')
- {
- if (decodeUnicodeEscapeSequence( token, current, end, surrogatePair ))
- {
- unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
- }
- else
- return false;
- }
- else
- return addError( "expecting another \\u token to begin the second half of a unicode surrogate pair", token, current );
- }
- return true;
-}
-
-bool
-Reader::decodeUnicodeEscapeSequence( Token &token,
- Location &current,
- Location end,
- unsigned int &unicode )
-{
- if ( end - current < 4 )
- return addError( "Bad unicode escape sequence in string: four digits expected.", token, current );
- unicode = 0;
- for ( int index =0; index < 4; ++index )
- {
- Char c = *current++;
- unicode *= 16;
- if ( c >= '0' && c <= '9' )
- unicode += c - '0';
- else if ( c >= 'a' && c <= 'f' )
- unicode += c - 'a' + 10;
- else if ( c >= 'A' && c <= 'F' )
- unicode += c - 'A' + 10;
- else
- return addError( "Bad unicode escape sequence in string: hexadecimal digit expected.", token, current );
- }
- return true;
-}
-
-
-bool
-Reader::addError( const std::string &message,
- Token &token,
- Location extra )
-{
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = extra;
- errors_.push_back( info );
- return false;
-}
-
-
-bool
-Reader::recoverFromError( TokenType skipUntilToken )
-{
- int errorCount = int(errors_.size());
- Token skip;
- while ( true )
- {
- if ( !readToken(skip) )
- errors_.resize( errorCount ); // discard errors caused by recovery
- if ( skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream )
- break;
- }
- errors_.resize( errorCount );
- return false;
-}
-
-
-bool
-Reader::addErrorAndRecover( const std::string &message,
- Token &token,
- TokenType skipUntilToken )
-{
- addError( message, token );
- return recoverFromError( skipUntilToken );
-}
-
-
-Value &
-Reader::currentValue()
-{
- return *(nodes_.top());
-}
-
-
-Reader::Char
-Reader::getNextChar()
-{
- if ( current_ == end_ )
- return 0;
- return *current_++;
-}
-
-
-void
-Reader::getLocationLineAndColumn( Location location,
- int &line,
- int &column ) const
-{
- Location current = begin_;
- Location lastLineStart = current;
- line = 0;
- while ( current < location && current != end_ )
- {
- Char c = *current++;
- if ( c == '\r' )
- {
- if ( *current == '\n' )
- ++current;
- lastLineStart = current;
- ++line;
- }
- else if ( c == '\n' )
- {
- lastLineStart = current;
- ++line;
- }
- }
- // column & line start at 1
- column = int(location - lastLineStart) + 1;
- ++line;
-}
-
-
-std::string
-Reader::getLocationLineAndColumn( Location location ) const
-{
- int line, column;
- getLocationLineAndColumn( location, line, column );
- char buffer[18+16+16+1];
- sprintf( buffer, "Line %d, Column %d", line, column );
- return buffer;
-}
-
-
-std::string
-Reader::getFormatedErrorMessages() const
-{
- std::string formattedMessage;
- for ( Errors::const_iterator itError = errors_.begin();
- itError != errors_.end();
- ++itError )
- {
- const ErrorInfo &error = *itError;
- formattedMessage += "* " + getLocationLineAndColumn( error.token_.start_ ) + "\n";
- formattedMessage += " " + error.message_ + "\n";
- if ( error.extra_ )
- formattedMessage += "See " + getLocationLineAndColumn( error.extra_ ) + " for detail.\n";
- }
- return formattedMessage;
-}
-
-
-std::istream& operator>>( std::istream &sin, Value &root )
-{
- Json::Reader reader;
- bool ok = reader.parse(sin, root, true);
- //JSON_ASSERT( ok );
- if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages());
- return sin;
-}
-
-
-} // namespace Json
diff --git a/lib/jsoncpp/src/lib_json/json_tool.h b/lib/jsoncpp/src/lib_json/json_tool.h
deleted file mode 100644
index 658031bbba..0000000000
--- a/lib/jsoncpp/src/lib_json/json_tool.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED
-# define LIB_JSONCPP_JSON_TOOL_H_INCLUDED
-
-/* This header provides common string manipulation support, such as UTF-8,
- * portable conversion from/to string...
- *
- * It is an internal header that must not be exposed.
- */
-
-namespace Json {
-
-/// Converts a unicode code-point to UTF-8.
-static inline std::string
-codePointToUTF8(unsigned int cp)
-{
- std::string result;
-
- // based on description from http://en.wikipedia.org/wiki/UTF-8
-
- if (cp <= 0x7f)
- {
- result.resize(1);
- result[0] = static_cast<char>(cp);
- }
- else if (cp <= 0x7FF)
- {
- result.resize(2);
- result[1] = static_cast<char>(0x80 | (0x3f & cp));
- result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
- }
- else if (cp <= 0xFFFF)
- {
- result.resize(3);
- result[2] = static_cast<char>(0x80 | (0x3f & cp));
- result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6)));
- result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12)));
- }
- else if (cp <= 0x10FFFF)
- {
- result.resize(4);
- result[3] = static_cast<char>(0x80 | (0x3f & cp));
- result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
- result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));
- result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
- }
-
- return result;
-}
-
-
-/// Returns true if ch is a control character (in range [0,32[).
-static inline bool
-isControlCharacter(char ch)
-{
- return ch > 0 && ch <= 0x1F;
-}
-
-
-enum {
- /// Constant that specify the size of the buffer that must be passed to uintToString.
- uintToStringBufferSize = 3*sizeof(LargestUInt)+1
-};
-
-// Defines a char buffer for use with uintToString().
-typedef char UIntToStringBuffer[uintToStringBufferSize];
-
-
-/** Converts an unsigned integer to string.
- * @param value Unsigned interger to convert to string
- * @param current Input/Output string buffer.
- * Must have at least uintToStringBufferSize chars free.
- */
-static inline void
-uintToString( LargestUInt value,
- char *&current )
-{
- *--current = 0;
- do
- {
- *--current = char(value % 10) + '0';
- value /= 10;
- }
- while ( value != 0 );
-}
-
-} // namespace Json {
-
-#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
diff --git a/lib/jsoncpp/src/lib_json/json_value.cpp b/lib/jsoncpp/src/lib_json/json_value.cpp
deleted file mode 100644
index 218c127553..0000000000
--- a/lib/jsoncpp/src/lib_json/json_value.cpp
+++ /dev/null
@@ -1,1840 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#include <iostream>
-#include <json/value.h>
-#include <json/writer.h>
-#include <utility>
-#include <stdexcept>
-#include <cstring>
-#include <cassert>
-#ifdef JSON_USE_CPPTL
-# include <cpptl/conststring.h>
-#endif
-#include <cstddef> // size_t
-#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-# include "json_batchallocator.h"
-#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-
-#define JSON_ASSERT_UNREACHABLE assert( false )
-#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
-#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
-
-namespace Json {
-
-const Value Value::null;
-const Int Value::minInt = Int( ~(UInt(-1)/2) );
-const Int Value::maxInt = Int( UInt(-1)/2 );
-const UInt Value::maxUInt = UInt(-1);
-const Int64 Value::minInt64 = Int64( ~(UInt64(-1)/2) );
-const Int64 Value::maxInt64 = Int64( UInt64(-1)/2 );
-const UInt64 Value::maxUInt64 = UInt64(-1);
-const LargestInt Value::minLargestInt = LargestInt( ~(LargestUInt(-1)/2) );
-const LargestInt Value::maxLargestInt = LargestInt( LargestUInt(-1)/2 );
-const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
-
-
-/// Unknown size marker
-enum { unknown = (unsigned)-1 };
-
-
-/** Duplicates the specified string value.
- * @param value Pointer to the string to duplicate. Must be zero-terminated if
- * length is "unknown".
- * @param length Length of the value. if equals to unknown, then it will be
- * computed using strlen(value).
- * @return Pointer on the duplicate instance of string.
- */
-static inline char *
-duplicateStringValue( const char *value,
- unsigned int length = unknown )
-{
- if ( length == unknown )
- length = (unsigned int)strlen(value);
- char *newString = static_cast<char *>( malloc( length + 1 ) );
- memcpy( newString, value, length );
- newString[length] = 0;
- return newString;
-}
-
-
-/** Free the string duplicated by duplicateStringValue().
- */
-static inline void
-releaseStringValue( char *value )
-{
- if ( value )
- free( value );
-}
-
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// ValueInternals...
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-# include "json_internalarray.inl"
-# include "json_internalmap.inl"
-#endif // JSON_VALUE_USE_INTERNAL_MAP
-
-# include "json_valueiterator.inl"
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::CommentInfo
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-
-Value::CommentInfo::CommentInfo()
- : comment_( 0 )
-{
-}
-
-Value::CommentInfo::~CommentInfo()
-{
- if ( comment_ )
- releaseStringValue( comment_ );
-}
-
-
-void
-Value::CommentInfo::setComment( const char *text )
-{
- if ( comment_ )
- releaseStringValue( comment_ );
- JSON_ASSERT( text );
- JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /");
- // It seems that /**/ style comments are acceptable as well.
- comment_ = duplicateStringValue( text );
-}
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::CZString
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-# ifndef JSON_VALUE_USE_INTERNAL_MAP
-
-// Notes: index_ indicates if the string was allocated when
-// a string is stored.
-
-Value::CZString::CZString( ArrayIndex index )
- : cstr_( 0 )
- , index_( index )
-{
-}
-
-Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate )
- : cstr_( allocate == duplicate ? duplicateStringValue(cstr)
- : cstr )
- , index_( allocate )
-{
-}
-
-Value::CZString::CZString( const CZString &other )
-: cstr_( other.index_ != noDuplication && other.cstr_ != 0
- ? duplicateStringValue( other.cstr_ )
- : other.cstr_ )
- , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate)
- : other.index_ )
-{
-}
-
-Value::CZString::~CZString()
-{
- if ( cstr_ && index_ == duplicate )
- releaseStringValue( const_cast<char *>( cstr_ ) );
-}
-
-void
-Value::CZString::swap( CZString &other )
-{
- std::swap( cstr_, other.cstr_ );
- std::swap( index_, other.index_ );
-}
-
-Value::CZString &
-Value::CZString::operator =( const CZString &other )
-{
- CZString temp( other );
- swap( temp );
- return *this;
-}
-
-bool
-Value::CZString::operator<( const CZString &other ) const
-{
- if ( cstr_ )
- return strcmp( cstr_, other.cstr_ ) < 0;
- return index_ < other.index_;
-}
-
-bool
-Value::CZString::operator==( const CZString &other ) const
-{
- if ( cstr_ )
- return strcmp( cstr_, other.cstr_ ) == 0;
- return index_ == other.index_;
-}
-
-
-ArrayIndex
-Value::CZString::index() const
-{
- return index_;
-}
-
-
-const char *
-Value::CZString::c_str() const
-{
- return cstr_;
-}
-
-bool
-Value::CZString::isStaticString() const
-{
- return index_ == noDuplication;
-}
-
-#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::Value
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/*! \internal Default constructor initialization must be equivalent to:
- * memset( this, 0, sizeof(Value) )
- * This optimization is used in ValueInternalMap fast allocator.
- */
-Value::Value( ValueType type )
- : type_( type )
- , allocated_( 0 )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- switch ( type )
- {
- case nullValue:
- break;
- case intValue:
- case uintValue:
- value_.int_ = 0;
- break;
- case realValue:
- value_.real_ = 0.0;
- break;
- case stringValue:
- value_.string_ = 0;
- break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_ = new ObjectValues();
- break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArray();
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMap();
- break;
-#endif
- case booleanValue:
- value_.bool_ = false;
- break;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
-}
-
-
-#if defined(JSON_HAS_INT64)
-Value::Value( UInt value )
- : type_( uintValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.uint_ = value;
-}
-
-Value::Value( Int value )
- : type_( intValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.int_ = value;
-}
-
-#endif // if defined(JSON_HAS_INT64)
-
-
-Value::Value( Int64 value )
- : type_( intValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.int_ = value;
-}
-
-
-Value::Value( UInt64 value )
- : type_( uintValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.uint_ = value;
-}
-
-Value::Value( double value )
- : type_( realValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.real_ = value;
-}
-
-Value::Value( const char *value )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = duplicateStringValue( value );
-}
-
-
-Value::Value( const char *beginValue,
- const char *endValue )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = duplicateStringValue( beginValue,
- (unsigned int)(endValue - beginValue) );
-}
-
-
-Value::Value( const std::string &value )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = duplicateStringValue( value.c_str(),
- (unsigned int)value.length() );
-
-}
-
-Value::Value( const StaticString &value )
- : type_( stringValue )
- , allocated_( false )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = const_cast<char *>( value.c_str() );
-}
-
-
-# ifdef JSON_USE_CPPTL
-Value::Value( const CppTL::ConstString &value )
- : type_( stringValue )
- , allocated_( true )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.string_ = duplicateStringValue( value, value.length() );
-}
-# endif
-
-Value::Value( bool value )
- : type_( booleanValue )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- value_.bool_ = value;
-}
-
-
-Value::Value( const Value &other )
- : type_( other.type_ )
- , comments_( 0 )
-# ifdef JSON_VALUE_USE_INTERNAL_MAP
- , itemIsUsed_( 0 )
-#endif
-{
- switch ( type_ )
- {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- value_ = other.value_;
- break;
- case stringValue:
- if ( other.value_.string_ )
- {
- value_.string_ = duplicateStringValue( other.value_.string_ );
- allocated_ = true;
- }
- else
- value_.string_ = 0;
- break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_ = new ObjectValues( *other.value_.map_ );
- break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ );
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ );
- break;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- if ( other.comments_ )
- {
- comments_ = new CommentInfo[numberOfCommentPlacement];
- for ( int comment =0; comment < numberOfCommentPlacement; ++comment )
- {
- const CommentInfo &otherComment = other.comments_[comment];
- if ( otherComment.comment_ )
- comments_[comment].setComment( otherComment.comment_ );
- }
- }
-}
-
-
-Value::~Value()
-{
- switch ( type_ )
- {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- break;
- case stringValue:
- if ( allocated_ )
- releaseStringValue( value_.string_ );
- break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- delete value_.map_;
- break;
-#else
- case arrayValue:
- arrayAllocator()->destructArray( value_.array_ );
- break;
- case objectValue:
- mapAllocator()->destructMap( value_.map_ );
- break;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
-
- if ( comments_ )
- delete[] comments_;
-}
-
-Value &
-Value::operator=( const Value &other )
-{
- Value temp( other );
- swap( temp );
- return *this;
-}
-
-void
-Value::swap( Value &other )
-{
- ValueType temp = type_;
- type_ = other.type_;
- other.type_ = temp;
- std::swap( value_, other.value_ );
- int temp2 = allocated_;
- allocated_ = other.allocated_;
- other.allocated_ = temp2;
-}
-
-ValueType
-Value::type() const
-{
- return type_;
-}
-
-
-int
-Value::compare( const Value &other )
-{
- /*
- int typeDelta = other.type_ - type_;
- switch ( type_ )
- {
- case nullValue:
-
- return other.type_ == type_;
- case intValue:
- if ( other.type_.isNumeric()
- case uintValue:
- case realValue:
- case booleanValue:
- break;
- case stringValue,
- break;
- case arrayValue:
- delete value_.array_;
- break;
- case objectValue:
- delete value_.map_;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- */
- return 0; // unreachable
-}
-
-bool
-Value::operator <( const Value &other ) const
-{
- int typeDelta = type_ - other.type_;
- if ( typeDelta )
- return typeDelta < 0 ? true : false;
- switch ( type_ )
- {
- case nullValue:
- return false;
- case intValue:
- return value_.int_ < other.value_.int_;
- case uintValue:
- return value_.uint_ < other.value_.uint_;
- case realValue:
- return value_.real_ < other.value_.real_;
- case booleanValue:
- return value_.bool_ < other.value_.bool_;
- case stringValue:
- return ( value_.string_ == 0 && other.value_.string_ )
- || ( other.value_.string_
- && value_.string_
- && strcmp( value_.string_, other.value_.string_ ) < 0 );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- {
- int delta = int( value_.map_->size() - other.value_.map_->size() );
- if ( delta )
- return delta < 0;
- return (*value_.map_) < (*other.value_.map_);
- }
-#else
- case arrayValue:
- return value_.array_->compare( *(other.value_.array_) ) < 0;
- case objectValue:
- return value_.map_->compare( *(other.value_.map_) ) < 0;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable
-}
-
-bool
-Value::operator <=( const Value &other ) const
-{
- return !(other > *this);
-}
-
-bool
-Value::operator >=( const Value &other ) const
-{
- return !(*this < other);
-}
-
-bool
-Value::operator >( const Value &other ) const
-{
- return other < *this;
-}
-
-bool
-Value::operator ==( const Value &other ) const
-{
- //if ( type_ != other.type_ )
- // GCC 2.95.3 says:
- // attempt to take address of bit-field structure member `Json::Value::type_'
- // Beats me, but a temp solves the problem.
- int temp = other.type_;
- if ( type_ != temp )
- return false;
- switch ( type_ )
- {
- case nullValue:
- return true;
- case intValue:
- return value_.int_ == other.value_.int_;
- case uintValue:
- return value_.uint_ == other.value_.uint_;
- case realValue:
- return value_.real_ == other.value_.real_;
- case booleanValue:
- return value_.bool_ == other.value_.bool_;
- case stringValue:
- return ( value_.string_ == other.value_.string_ )
- || ( other.value_.string_
- && value_.string_
- && strcmp( value_.string_, other.value_.string_ ) == 0 );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- return value_.map_->size() == other.value_.map_->size()
- && (*value_.map_) == (*other.value_.map_);
-#else
- case arrayValue:
- return value_.array_->compare( *(other.value_.array_) ) == 0;
- case objectValue:
- return value_.map_->compare( *(other.value_.map_) ) == 0;
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable
-}
-
-bool
-Value::operator !=( const Value &other ) const
-{
- return !( *this == other );
-}
-
-const char *
-Value::asCString() const
-{
- JSON_ASSERT( type_ == stringValue );
- return value_.string_;
-}
-
-
-std::string
-Value::asString() const
-{
- switch ( type_ )
- {
- case nullValue:
- return "";
- case stringValue:
- return value_.string_ ? value_.string_ : "";
- case booleanValue:
- return value_.bool_ ? "true" : "false";
- case intValue:
- case uintValue:
- case realValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to string" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return ""; // unreachable
-}
-
-# ifdef JSON_USE_CPPTL
-CppTL::ConstString
-Value::asConstString() const
-{
- return CppTL::ConstString( asString().c_str() );
-}
-# endif
-
-
-Value::Int
-Value::asInt() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0;
- case intValue:
- JSON_ASSERT_MESSAGE( value_.int_ >= minInt && value_.int_ <= maxInt, "unsigned integer out of signed int range" );
- return Int(value_.int_);
- case uintValue:
- JSON_ASSERT_MESSAGE( value_.uint_ <= UInt(maxInt), "unsigned integer out of signed int range" );
- return Int(value_.uint_);
- case realValue:
- JSON_ASSERT_MESSAGE( value_.real_ >= minInt && value_.real_ <= maxInt, "Real out of signed integer range" );
- return Int( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- case stringValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to int" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-
-Value::UInt
-Value::asUInt() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0;
- case intValue:
- JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to unsigned integer" );
- JSON_ASSERT_MESSAGE( value_.int_ <= maxUInt, "signed integer out of UInt range" );
- return UInt(value_.int_);
- case uintValue:
- JSON_ASSERT_MESSAGE( value_.uint_ <= maxUInt, "unsigned integer out of UInt range" );
- return UInt(value_.uint_);
- case realValue:
- JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt, "Real out of unsigned integer range" );
- return UInt( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- case stringValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to uint" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-
-# if defined(JSON_HAS_INT64)
-
-Value::Int64
-Value::asInt64() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0;
- case intValue:
- return value_.int_;
- case uintValue:
- JSON_ASSERT_MESSAGE( value_.uint_ <= UInt64(maxInt64), "unsigned integer out of Int64 range" );
- return value_.uint_;
- case realValue:
- JSON_ASSERT_MESSAGE( value_.real_ >= minInt64 && value_.real_ <= maxInt64, "Real out of Int64 range" );
- return Int( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- case stringValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to Int64" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-
-Value::UInt64
-Value::asUInt64() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0;
- case intValue:
- JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to UInt64" );
- return value_.int_;
- case uintValue:
- return value_.uint_;
- case realValue:
- JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt64, "Real out of UInt64 range" );
- return UInt( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- case stringValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to UInt64" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-# endif // if defined(JSON_HAS_INT64)
-
-
-LargestInt
-Value::asLargestInt() const
-{
-#if defined(JSON_NO_INT64)
- return asInt();
-#else
- return asInt64();
-#endif
-}
-
-
-LargestUInt
-Value::asLargestUInt() const
-{
-#if defined(JSON_NO_INT64)
- return asUInt();
-#else
- return asUInt64();
-#endif
-}
-
-
-double
-Value::asDouble() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0.0;
- case intValue:
- return static_cast<double>( value_.int_ );
- case uintValue:
-#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return static_cast<double>( value_.uint_ );
-#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return static_cast<double>( Int(value_.uint_/2) ) * 2 + Int(value_.uint_ & 1);
-#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- case realValue:
- return value_.real_;
- case booleanValue:
- return value_.bool_ ? 1.0 : 0.0;
- case stringValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to double" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-float
-Value::asFloat() const
-{
- switch ( type_ )
- {
- case nullValue:
- return 0.0f;
- case intValue:
- return static_cast<float>( value_.int_ );
- case uintValue:
-#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return static_cast<float>( value_.uint_ );
-#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return static_cast<float>( Int(value_.uint_/2) ) * 2 + Int(value_.uint_ & 1);
-#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- case realValue:
- return static_cast<float>( value_.real_ );
- case booleanValue:
- return value_.bool_ ? 1.0f : 0.0f;
- case stringValue:
- case arrayValue:
- case objectValue:
- JSON_ASSERT_MESSAGE( false, "Type is not convertible to float" );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0.0f; // unreachable;
-}
-
-bool
-Value::asBool() const
-{
- switch ( type_ )
- {
- case nullValue:
- return false;
- case intValue:
- case uintValue:
- return value_.int_ != 0;
- case realValue:
- return value_.real_ != 0.0;
- case booleanValue:
- return value_.bool_;
- case stringValue:
- return value_.string_ && value_.string_[0] != 0;
- case arrayValue:
- case objectValue:
- return value_.map_->size() != 0;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return false; // unreachable;
-}
-
-
-bool
-Value::isConvertibleTo( ValueType other ) const
-{
- switch ( type_ )
- {
- case nullValue:
- return true;
- case intValue:
- return ( other == nullValue && value_.int_ == 0 )
- || other == intValue
- || ( other == uintValue && value_.int_ >= 0 )
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case uintValue:
- return ( other == nullValue && value_.uint_ == 0 )
- || ( other == intValue && value_.uint_ <= (unsigned)maxInt )
- || other == uintValue
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case realValue:
- return ( other == nullValue && value_.real_ == 0.0 )
- || ( other == intValue && value_.real_ >= minInt && value_.real_ <= maxInt )
- || ( other == uintValue && value_.real_ >= 0 && value_.real_ <= maxUInt )
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case booleanValue:
- return ( other == nullValue && value_.bool_ == false )
- || other == intValue
- || other == uintValue
- || other == realValue
- || other == stringValue
- || other == booleanValue;
- case stringValue:
- return other == stringValue
- || ( other == nullValue && (!value_.string_ || value_.string_[0] == 0) );
- case arrayValue:
- return other == arrayValue
- || ( other == nullValue && value_.map_->size() == 0 );
- case objectValue:
- return other == objectValue
- || ( other == nullValue && value_.map_->size() == 0 );
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return false; // unreachable;
-}
-
-
-/// Number of values in array or object
-ArrayIndex
-Value::size() const
-{
- switch ( type_ )
- {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- case stringValue:
- return 0;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue: // size of the array is highest index + 1
- if ( !value_.map_->empty() )
- {
- ObjectValues::const_iterator itLast = value_.map_->end();
- --itLast;
- return (*itLast).first.index()+1;
- }
- return 0;
- case objectValue:
- return ArrayIndex( value_.map_->size() );
-#else
- case arrayValue:
- return Int( value_.array_->size() );
- case objectValue:
- return Int( value_.map_->size() );
-#endif
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return 0; // unreachable;
-}
-
-
-bool
-Value::empty() const
-{
- if ( isNull() || isArray() || isObject() )
- return size() == 0u;
- else
- return false;
-}
-
-
-bool
-Value::operator!() const
-{
- return isNull();
-}
-
-
-void
-Value::clear()
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue || type_ == objectValue );
-
- switch ( type_ )
- {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_->clear();
- break;
-#else
- case arrayValue:
- value_.array_->clear();
- break;
- case objectValue:
- value_.map_->clear();
- break;
-#endif
- default:
- break;
- }
-}
-
-void
-Value::resize( ArrayIndex newSize )
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
- if ( type_ == nullValue )
- *this = Value( arrayValue );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- ArrayIndex oldSize = size();
- if ( newSize == 0 )
- clear();
- else if ( newSize > oldSize )
- (*this)[ newSize - 1 ];
- else
- {
- for ( ArrayIndex index = newSize; index < oldSize; ++index )
- {
- value_.map_->erase( index );
- }
- assert( size() == newSize );
- }
-#else
- value_.array_->resize( newSize );
-#endif
-}
-
-
-Value &
-Value::operator[]( ArrayIndex index )
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
- if ( type_ == nullValue )
- *this = Value( arrayValue );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString key( index );
- ObjectValues::iterator it = value_.map_->lower_bound( key );
- if ( it != value_.map_->end() && (*it).first == key )
- return (*it).second;
-
- ObjectValues::value_type defaultValue( key, null );
- it = value_.map_->insert( it, defaultValue );
- return (*it).second;
-#else
- return value_.array_->resolveReference( index );
-#endif
-}
-
-
-Value &
-Value::operator[]( int index )
-{
- JSON_ASSERT( index >= 0 );
- return (*this)[ ArrayIndex(index) ];
-}
-
-
-const Value &
-Value::operator[]( ArrayIndex index ) const
-{
- JSON_ASSERT( type_ == nullValue || type_ == arrayValue );
- if ( type_ == nullValue )
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString key( index );
- ObjectValues::const_iterator it = value_.map_->find( key );
- if ( it == value_.map_->end() )
- return null;
- return (*it).second;
-#else
- Value *value = value_.array_->find( index );
- return value ? *value : null;
-#endif
-}
-
-
-const Value &
-Value::operator[]( int index ) const
-{
- JSON_ASSERT( index >= 0 );
- return (*this)[ ArrayIndex(index) ];
-}
-
-
-Value &
-Value::operator[]( const char *key )
-{
- return resolveReference( key, false );
-}
-
-
-Value &
-Value::resolveReference( const char *key,
- bool isStatic )
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- *this = Value( objectValue );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey( key, isStatic ? CZString::noDuplication
- : CZString::duplicateOnCopy );
- ObjectValues::iterator it = value_.map_->lower_bound( actualKey );
- if ( it != value_.map_->end() && (*it).first == actualKey )
- return (*it).second;
-
- ObjectValues::value_type defaultValue( actualKey, null );
- it = value_.map_->insert( it, defaultValue );
- Value &value = (*it).second;
- return value;
-#else
- return value_.map_->resolveReference( key, isStatic );
-#endif
-}
-
-
-Value
-Value::get( ArrayIndex index,
- const Value &defaultValue ) const
-{
- const Value *value = &((*this)[index]);
- return value == &null ? defaultValue : *value;
-}
-
-
-bool
-Value::isValidIndex( ArrayIndex index ) const
-{
- return index < size();
-}
-
-
-
-const Value &
-Value::operator[]( const char *key ) const
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey( key, CZString::noDuplication );
- ObjectValues::const_iterator it = value_.map_->find( actualKey );
- if ( it == value_.map_->end() )
- return null;
- return (*it).second;
-#else
- const Value *value = value_.map_->find( key );
- return value ? *value : null;
-#endif
-}
-
-
-Value &
-Value::operator[]( const std::string &key )
-{
- return (*this)[ key.c_str() ];
-}
-
-
-const Value &
-Value::operator[]( const std::string &key ) const
-{
- return (*this)[ key.c_str() ];
-}
-
-Value &
-Value::operator[]( const StaticString &key )
-{
- return resolveReference( key, true );
-}
-
-
-# ifdef JSON_USE_CPPTL
-Value &
-Value::operator[]( const CppTL::ConstString &key )
-{
- return (*this)[ key.c_str() ];
-}
-
-
-const Value &
-Value::operator[]( const CppTL::ConstString &key ) const
-{
- return (*this)[ key.c_str() ];
-}
-# endif
-
-
-Value &
-Value::append( const Value &value )
-{
- return (*this)[size()] = value;
-}
-
-
-Value
-Value::get( const char *key,
- const Value &defaultValue ) const
-{
- const Value *value = &((*this)[key]);
- return value == &null ? defaultValue : *value;
-}
-
-
-Value
-Value::get( const std::string &key,
- const Value &defaultValue ) const
-{
- return get( key.c_str(), defaultValue );
-}
-
-Value
-Value::removeMember( const char* key )
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey( key, CZString::noDuplication );
- ObjectValues::iterator it = value_.map_->find( actualKey );
- if ( it == value_.map_->end() )
- return null;
- Value old(it->second);
- value_.map_->erase(it);
- return old;
-#else
- Value *value = value_.map_->find( key );
- if (value){
- Value old(*value);
- value_.map_.remove( key );
- return old;
- } else {
- return null;
- }
-#endif
-}
-
-Value
-Value::removeMember( const std::string &key )
-{
- return removeMember( key.c_str() );
-}
-
-# ifdef JSON_USE_CPPTL
-Value
-Value::get( const CppTL::ConstString &key,
- const Value &defaultValue ) const
-{
- return get( key.c_str(), defaultValue );
-}
-# endif
-
-bool
-Value::isMember( const char *key ) const
-{
- const Value *value = &((*this)[key]);
- return value != &null;
-}
-
-
-bool
-Value::isMember( const std::string &key ) const
-{
- return isMember( key.c_str() );
-}
-
-
-# ifdef JSON_USE_CPPTL
-bool
-Value::isMember( const CppTL::ConstString &key ) const
-{
- return isMember( key.c_str() );
-}
-#endif
-
-Value::Members
-Value::getMemberNames() const
-{
- JSON_ASSERT( type_ == nullValue || type_ == objectValue );
- if ( type_ == nullValue )
- return Value::Members();
- Members members;
- members.reserve( value_.map_->size() );
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- ObjectValues::const_iterator it = value_.map_->begin();
- ObjectValues::const_iterator itEnd = value_.map_->end();
- for ( ; it != itEnd; ++it )
- members.push_back( std::string( (*it).first.c_str() ) );
-#else
- ValueInternalMap::IteratorState it;
- ValueInternalMap::IteratorState itEnd;
- value_.map_->makeBeginIterator( it );
- value_.map_->makeEndIterator( itEnd );
- for ( ; !ValueInternalMap::equals( it, itEnd ); ValueInternalMap::increment(it) )
- members.push_back( std::string( ValueInternalMap::key( it ) ) );
-#endif
- return members;
-}
-//
-//# ifdef JSON_USE_CPPTL
-//EnumMemberNames
-//Value::enumMemberNames() const
-//{
-// if ( type_ == objectValue )
-// {
-// return CppTL::Enum::any( CppTL::Enum::transform(
-// CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),
-// MemberNamesTransform() ) );
-// }
-// return EnumMemberNames();
-//}
-//
-//
-//EnumValues
-//Value::enumValues() const
-//{
-// if ( type_ == objectValue || type_ == arrayValue )
-// return CppTL::Enum::anyValues( *(value_.map_),
-// CppTL::Type<const Value &>() );
-// return EnumValues();
-//}
-//
-//# endif
-
-
-bool
-Value::isNull() const
-{
- return type_ == nullValue;
-}
-
-
-bool
-Value::isBool() const
-{
- return type_ == booleanValue;
-}
-
-
-bool
-Value::isInt() const
-{
- return type_ == intValue;
-}
-
-
-bool
-Value::isUInt() const
-{
- return type_ == uintValue;
-}
-
-
-bool
-Value::isIntegral() const
-{
- return type_ == intValue
- || type_ == uintValue
- || type_ == booleanValue;
-}
-
-
-bool
-Value::isDouble() const
-{
- return type_ == realValue;
-}
-
-
-bool
-Value::isNumeric() const
-{
- return isIntegral() || isDouble();
-}
-
-
-bool
-Value::isString() const
-{
- return type_ == stringValue;
-}
-
-
-bool
-Value::isArray() const
-{
- return type_ == nullValue || type_ == arrayValue;
-}
-
-
-bool
-Value::isObject() const
-{
- return type_ == nullValue || type_ == objectValue;
-}
-
-
-void
-Value::setComment( const char *comment,
- CommentPlacement placement )
-{
- if ( !comments_ )
- comments_ = new CommentInfo[numberOfCommentPlacement];
- comments_[placement].setComment( comment );
-}
-
-
-void
-Value::setComment( const std::string &comment,
- CommentPlacement placement )
-{
- setComment( comment.c_str(), placement );
-}
-
-
-bool
-Value::hasComment( CommentPlacement placement ) const
-{
- return comments_ != 0 && comments_[placement].comment_ != 0;
-}
-
-std::string
-Value::getComment( CommentPlacement placement ) const
-{
- if ( hasComment(placement) )
- return comments_[placement].comment_;
- return "";
-}
-
-
-std::string
-Value::toStyledString() const
-{
- StyledWriter writer;
- return writer.write( *this );
-}
-
-
-Value::const_iterator
-Value::begin() const
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator( it );
- return const_iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator( it );
- return const_iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return const_iterator( value_.map_->begin() );
- break;
-#endif
- default:
- break;
- }
- return const_iterator();
-}
-
-Value::const_iterator
-Value::end() const
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator( it );
- return const_iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator( it );
- return const_iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return const_iterator( value_.map_->end() );
- break;
-#endif
- default:
- break;
- }
- return const_iterator();
-}
-
-
-Value::iterator
-Value::begin()
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator( it );
- return iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator( it );
- return iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return iterator( value_.map_->begin() );
- break;
-#endif
- default:
- break;
- }
- return iterator();
-}
-
-Value::iterator
-Value::end()
-{
- switch ( type_ )
- {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if ( value_.array_ )
- {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator( it );
- return iterator( it );
- }
- break;
- case objectValue:
- if ( value_.map_ )
- {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator( it );
- return iterator( it );
- }
- break;
-#else
- case arrayValue:
- case objectValue:
- if ( value_.map_ )
- return iterator( value_.map_->end() );
- break;
-#endif
- default:
- break;
- }
- return iterator();
-}
-
-
-// class PathArgument
-// //////////////////////////////////////////////////////////////////
-
-PathArgument::PathArgument()
- : kind_( kindNone )
-{
-}
-
-
-PathArgument::PathArgument( ArrayIndex index )
- : index_( index )
- , kind_( kindIndex )
-{
-}
-
-
-PathArgument::PathArgument( const char *key )
- : key_( key )
- , kind_( kindKey )
-{
-}
-
-
-PathArgument::PathArgument( const std::string &key )
- : key_( key.c_str() )
- , kind_( kindKey )
-{
-}
-
-// class Path
-// //////////////////////////////////////////////////////////////////
-
-Path::Path( const std::string &path,
- const PathArgument &a1,
- const PathArgument &a2,
- const PathArgument &a3,
- const PathArgument &a4,
- const PathArgument &a5 )
-{
- InArgs in;
- in.push_back( &a1 );
- in.push_back( &a2 );
- in.push_back( &a3 );
- in.push_back( &a4 );
- in.push_back( &a5 );
- makePath( path, in );
-}
-
-
-void
-Path::makePath( const std::string &path,
- const InArgs &in )
-{
- const char *current = path.c_str();
- const char *end = current + path.length();
- InArgs::const_iterator itInArg = in.begin();
- while ( current != end )
- {
- if ( *current == '[' )
- {
- ++current;
- if ( *current == '%' )
- addPathInArg( path, in, itInArg, PathArgument::kindIndex );
- else
- {
- ArrayIndex index = 0;
- for ( ; current != end && *current >= '0' && *current <= '9'; ++current )
- index = index * 10 + ArrayIndex(*current - '0');
- args_.push_back( index );
- }
- if ( current == end || *current++ != ']' )
- invalidPath( path, int(current - path.c_str()) );
- }
- else if ( *current == '%' )
- {
- addPathInArg( path, in, itInArg, PathArgument::kindKey );
- ++current;
- }
- else if ( *current == '.' )
- {
- ++current;
- }
- else
- {
- const char *beginName = current;
- while ( current != end && !strchr( "[.", *current ) )
- ++current;
- args_.push_back( std::string( beginName, current ) );
- }
- }
-}
-
-
-void
-Path::addPathInArg( const std::string &path,
- const InArgs &in,
- InArgs::const_iterator &itInArg,
- PathArgument::Kind kind )
-{
- if ( itInArg == in.end() )
- {
- // Error: missing argument %d
- }
- else if ( (*itInArg)->kind_ != kind )
- {
- // Error: bad argument type
- }
- else
- {
- args_.push_back( **itInArg );
- }
-}
-
-
-void
-Path::invalidPath( const std::string &path,
- int location )
-{
- // Error: invalid path.
-}
-
-
-const Value &
-Path::resolve( const Value &root ) const
-{
- const Value *node = &root;
- for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )
- {
- const PathArgument &arg = *it;
- if ( arg.kind_ == PathArgument::kindIndex )
- {
- if ( !node->isArray() || node->isValidIndex( arg.index_ ) )
- {
- // Error: unable to resolve path (array value expected at position...
- }
- node = &((*node)[arg.index_]);
- }
- else if ( arg.kind_ == PathArgument::kindKey )
- {
- if ( !node->isObject() )
- {
- // Error: unable to resolve path (object value expected at position...)
- }
- node = &((*node)[arg.key_]);
- if ( node == &Value::null )
- {
- // Error: unable to resolve path (object has no member named '' at position...)
- }
- }
- }
- return *node;
-}
-
-
-Value
-Path::resolve( const Value &root,
- const Value &defaultValue ) const
-{
- const Value *node = &root;
- for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )
- {
- const PathArgument &arg = *it;
- if ( arg.kind_ == PathArgument::kindIndex )
- {
- if ( !node->isArray() || node->isValidIndex( arg.index_ ) )
- return defaultValue;
- node = &((*node)[arg.index_]);
- }
- else if ( arg.kind_ == PathArgument::kindKey )
- {
- if ( !node->isObject() )
- return defaultValue;
- node = &((*node)[arg.key_]);
- if ( node == &Value::null )
- return defaultValue;
- }
- }
- return *node;
-}
-
-
-Value &
-Path::make( Value &root ) const
-{
- Value *node = &root;
- for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )
- {
- const PathArgument &arg = *it;
- if ( arg.kind_ == PathArgument::kindIndex )
- {
- if ( !node->isArray() )
- {
- // Error: node is not an array at position ...
- }
- node = &((*node)[arg.index_]);
- }
- else if ( arg.kind_ == PathArgument::kindKey )
- {
- if ( !node->isObject() )
- {
- // Error: node is not an object at position...
- }
- node = &((*node)[arg.key_]);
- }
- }
- return *node;
-}
-
-
-} // namespace Json
diff --git a/lib/jsoncpp/src/lib_json/json_valueiterator.inl b/lib/jsoncpp/src/lib_json/json_valueiterator.inl
deleted file mode 100644
index bd7c8d2079..0000000000
--- a/lib/jsoncpp/src/lib_json/json_valueiterator.inl
+++ /dev/null
@@ -1,297 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-// everything is within Json namespace
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueIteratorBase
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueIteratorBase::ValueIteratorBase()
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- : current_()
- , isNull_( true )
-{
-}
-#else
- : isArray_( true )
- , isNull_( true )
-{
- iterator_.array_ = ValueInternalArray::IteratorState();
-}
-#endif
-
-
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator &current )
- : current_( current )
- , isNull_( false )
-{
-}
-#else
-ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state )
- : isArray_( true )
-{
- iterator_.array_ = state;
-}
-
-
-ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state )
- : isArray_( false )
-{
- iterator_.map_ = state;
-}
-#endif
-
-Value &
-ValueIteratorBase::deref() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- return current_->second;
-#else
- if ( isArray_ )
- return ValueInternalArray::dereference( iterator_.array_ );
- return ValueInternalMap::value( iterator_.map_ );
-#endif
-}
-
-
-void
-ValueIteratorBase::increment()
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- ++current_;
-#else
- if ( isArray_ )
- ValueInternalArray::increment( iterator_.array_ );
- ValueInternalMap::increment( iterator_.map_ );
-#endif
-}
-
-
-void
-ValueIteratorBase::decrement()
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- --current_;
-#else
- if ( isArray_ )
- ValueInternalArray::decrement( iterator_.array_ );
- ValueInternalMap::decrement( iterator_.map_ );
-#endif
-}
-
-
-ValueIteratorBase::difference_type
-ValueIteratorBase::computeDistance( const SelfType &other ) const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-# ifdef JSON_USE_CPPTL_SMALLMAP
- return current_ - other.current_;
-# else
- // Iterator for null value are initialized using the default
- // constructor, which initialize current_ to the default
- // std::map::iterator. As begin() and end() are two instance
- // of the default std::map::iterator, they can not be compared.
- // To allow this, we handle this comparison specifically.
- if ( isNull_ && other.isNull_ )
- {
- return 0;
- }
-
-
- // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL,
- // which is the one used by default).
- // Using a portable hand-made version for non random iterator instead:
- // return difference_type( std::distance( current_, other.current_ ) );
- difference_type myDistance = 0;
- for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it )
- {
- ++myDistance;
- }
- return myDistance;
-# endif
-#else
- if ( isArray_ )
- return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ );
- return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ );
-#endif
-}
-
-
-bool
-ValueIteratorBase::isEqual( const SelfType &other ) const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- if ( isNull_ )
- {
- return other.isNull_;
- }
- return current_ == other.current_;
-#else
- if ( isArray_ )
- return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ );
- return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ );
-#endif
-}
-
-
-void
-ValueIteratorBase::copy( const SelfType &other )
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- current_ = other.current_;
-#else
- if ( isArray_ )
- iterator_.array_ = other.iterator_.array_;
- iterator_.map_ = other.iterator_.map_;
-#endif
-}
-
-
-Value
-ValueIteratorBase::key() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const Value::CZString czstring = (*current_).first;
- if ( czstring.c_str() )
- {
- if ( czstring.isStaticString() )
- return Value( StaticString( czstring.c_str() ) );
- return Value( czstring.c_str() );
- }
- return Value( czstring.index() );
-#else
- if ( isArray_ )
- return Value( ValueInternalArray::indexOf( iterator_.array_ ) );
- bool isStatic;
- const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic );
- if ( isStatic )
- return Value( StaticString( memberName ) );
- return Value( memberName );
-#endif
-}
-
-
-UInt
-ValueIteratorBase::index() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const Value::CZString czstring = (*current_).first;
- if ( !czstring.c_str() )
- return czstring.index();
- return Value::UInt( -1 );
-#else
- if ( isArray_ )
- return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) );
- return Value::UInt( -1 );
-#endif
-}
-
-
-const char *
-ValueIteratorBase::memberName() const
-{
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const char *name = (*current_).first.c_str();
- return name ? name : "";
-#else
- if ( !isArray_ )
- return ValueInternalMap::key( iterator_.map_ );
- return "";
-#endif
-}
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueConstIterator
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueConstIterator::ValueConstIterator()
-{
-}
-
-
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator &current )
- : ValueIteratorBase( current )
-{
-}
-#else
-ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-
-ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-#endif
-
-ValueConstIterator &
-ValueConstIterator::operator =( const ValueIteratorBase &other )
-{
- copy( other );
- return *this;
-}
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueIterator
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueIterator::ValueIterator()
-{
-}
-
-
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-ValueIterator::ValueIterator( const Value::ObjectValues::iterator &current )
- : ValueIteratorBase( current )
-{
-}
-#else
-ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-
-ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state )
- : ValueIteratorBase( state )
-{
-}
-#endif
-
-ValueIterator::ValueIterator( const ValueConstIterator &other )
- : ValueIteratorBase( other )
-{
-}
-
-ValueIterator::ValueIterator( const ValueIterator &other )
- : ValueIteratorBase( other )
-{
-}
-
-ValueIterator &
-ValueIterator::operator =( const SelfType &other )
-{
- copy( other );
- return *this;
-}
diff --git a/lib/jsoncpp/src/lib_json/json_writer.cpp b/lib/jsoncpp/src/lib_json/json_writer.cpp
deleted file mode 100644
index f101cbcfb5..0000000000
--- a/lib/jsoncpp/src/lib_json/json_writer.cpp
+++ /dev/null
@@ -1,836 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#include <json/writer.h>
-#include "json_tool.h"
-#include <utility>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-
-#if _MSC_VER >= 1400 // VC++ 8.0
-#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
-#endif
-
-namespace Json {
-
-static bool containsControlCharacter( const char* str )
-{
- while ( *str )
- {
- if ( isControlCharacter( *(str++) ) )
- return true;
- }
- return false;
-}
-
-
-std::string valueToString( LargestInt value )
-{
- UIntToStringBuffer buffer;
- char *current = buffer + sizeof(buffer);
- bool isNegative = value < 0;
- if ( isNegative )
- value = -value;
- uintToString( LargestUInt(value), current );
- if ( isNegative )
- *--current = '-';
- assert( current >= buffer );
- return current;
-}
-
-
-std::string valueToString( LargestUInt value )
-{
- UIntToStringBuffer buffer;
- char *current = buffer + sizeof(buffer);
- uintToString( value, current );
- assert( current >= buffer );
- return current;
-}
-
-#if defined(JSON_HAS_INT64)
-
-std::string valueToString( Int value )
-{
- return valueToString( LargestInt(value) );
-}
-
-
-std::string valueToString( UInt value )
-{
- return valueToString( LargestUInt(value) );
-}
-
-#endif // # if defined(JSON_HAS_INT64)
-
-
-std::string valueToString( double value )
-{
- char buffer[32];
-#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning.
- sprintf_s(buffer, sizeof(buffer), "%#.16g", value);
-#else
- sprintf(buffer, "%#.16g", value);
-#endif
- char* ch = buffer + strlen(buffer) - 1;
- if (*ch != '0') return buffer; // nothing to truncate, so save time
- while(ch > buffer && *ch == '0'){
- --ch;
- }
- char* last_nonzero = ch;
- while(ch >= buffer){
- switch(*ch){
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- --ch;
- continue;
- case '.':
- // Truncate zeroes to save bytes in output, but keep one.
- *(last_nonzero+2) = '\0';
- return buffer;
- default:
- return buffer;
- }
- }
- return buffer;
-}
-
-
-std::string valueToString( bool value )
-{
- return value ? "true" : "false";
-}
-
-std::string valueToQuotedString( const char *value )
-{
- // Not sure how to handle unicode...
- if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && !containsControlCharacter( value ))
- return std::string("\"") + value + "\"";
- // We have to walk value and escape any special characters.
- // Appending to std::string is not efficient, but this should be rare.
- // (Note: forward slashes are *not* rare, but I am not escaping them.)
- std::string::size_type maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL
- std::string result;
- result.reserve(maxsize); // to avoid lots of mallocs
- result += "\"";
- for (const char* c=value; *c != 0; ++c)
- {
- switch(*c)
- {
- case '\"':
- result += "\\\"";
- break;
- case '\\':
- result += "\\\\";
- break;
- case '\b':
- result += "\\b";
- break;
- case '\f':
- result += "\\f";
- break;
- case '\n':
- result += "\\n";
- break;
- case '\r':
- result += "\\r";
- break;
- case '\t':
- result += "\\t";
- break;
- //case '/':
- // Even though \/ is considered a legal escape in JSON, a bare
- // slash is also legal, so I see no reason to escape it.
- // (I hope I am not misunderstanding something.
- // blep notes: actually escaping \/ may be useful in javascript to avoid </
- // sequence.
- // Should add a flag to allow this compatibility mode and prevent this
- // sequence from occurring.
- default:
- if ( isControlCharacter( *c ) )
- {
- std::ostringstream oss;
- oss << "\\u" << std::hex << std::uppercase << std::setfill('0') << std::setw(4) << static_cast<int>(*c);
- result += oss.str();
- }
- else
- {
- result += *c;
- }
- break;
- }
- }
- result += "\"";
- return result;
-}
-
-// Class Writer
-// //////////////////////////////////////////////////////////////////
-Writer::~Writer()
-{
-}
-
-
-// Class FastWriter
-// //////////////////////////////////////////////////////////////////
-
-FastWriter::FastWriter()
- : yamlCompatiblityEnabled_( false )
-{
-}
-
-
-void
-FastWriter::enableYAMLCompatibility()
-{
- yamlCompatiblityEnabled_ = true;
-}
-
-
-std::string
-FastWriter::write( const Value &root )
-{
- document_ = "";
- writeValue( root );
- document_ += "\n";
- return document_;
-}
-
-
-void
-FastWriter::writeValue( const Value &value )
-{
- switch ( value.type() )
- {
- case nullValue:
- document_ += "null";
- break;
- case intValue:
- document_ += valueToString( value.asLargestInt() );
- break;
- case uintValue:
- document_ += valueToString( value.asLargestUInt() );
- break;
- case realValue:
- document_ += valueToString( value.asDouble() );
- break;
- case stringValue:
- document_ += valueToQuotedString( value.asCString() );
- break;
- case booleanValue:
- document_ += valueToString( value.asBool() );
- break;
- case arrayValue:
- {
- document_ += "[";
- int size = value.size();
- for ( int index =0; index < size; ++index )
- {
- if ( index > 0 )
- document_ += ",";
- writeValue( value[index] );
- }
- document_ += "]";
- }
- break;
- case objectValue:
- {
- Value::Members members( value.getMemberNames() );
- document_ += "{";
- for ( Value::Members::iterator it = members.begin();
- it != members.end();
- ++it )
- {
- const std::string &name = *it;
- if ( it != members.begin() )
- document_ += ",";
- document_ += valueToQuotedString( name.c_str() );
- document_ += yamlCompatiblityEnabled_ ? ": "
- : ":";
- writeValue( value[name] );
- }
- document_ += "}";
- }
- break;
- }
-}
-
-
-// Class StyledWriter
-// //////////////////////////////////////////////////////////////////
-
-StyledWriter::StyledWriter()
- : rightMargin_( 74 )
- , indentSize_( 3 )
-{
-}
-
-
-std::string
-StyledWriter::write( const Value &root )
-{
- document_ = "";
- addChildValues_ = false;
- indentString_ = "";
- writeCommentBeforeValue( root );
- writeValue( root );
- writeCommentAfterValueOnSameLine( root );
- document_ += "\n";
- return document_;
-}
-
-
-void
-StyledWriter::writeValue( const Value &value )
-{
- switch ( value.type() )
- {
- case nullValue:
- pushValue( "null" );
- break;
- case intValue:
- pushValue( valueToString( value.asLargestInt() ) );
- break;
- case uintValue:
- pushValue( valueToString( value.asLargestUInt() ) );
- break;
- case realValue:
- pushValue( valueToString( value.asDouble() ) );
- break;
- case stringValue:
- pushValue( valueToQuotedString( value.asCString() ) );
- break;
- case booleanValue:
- pushValue( valueToString( value.asBool() ) );
- break;
- case arrayValue:
- writeArrayValue( value);
- break;
- case objectValue:
- {
- Value::Members members( value.getMemberNames() );
- if ( members.empty() )
- pushValue( "{}" );
- else
- {
- writeWithIndent( "{" );
- indent();
- Value::Members::iterator it = members.begin();
- while ( true )
- {
- const std::string &name = *it;
- const Value &childValue = value[name];
- writeCommentBeforeValue( childValue );
- writeWithIndent( valueToQuotedString( name.c_str() ) );
- document_ += " : ";
- writeValue( childValue );
- if ( ++it == members.end() )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- document_ += ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "}" );
- }
- }
- break;
- }
-}
-
-
-void
-StyledWriter::writeArrayValue( const Value &value )
-{
- unsigned size = value.size();
- if ( size == 0 )
- pushValue( "[]" );
- else
- {
- bool isArrayMultiLine = isMultineArray( value );
- if ( isArrayMultiLine )
- {
- writeWithIndent( "[" );
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index =0;
- while ( true )
- {
- const Value &childValue = value[index];
- writeCommentBeforeValue( childValue );
- if ( hasChildValue )
- writeWithIndent( childValues_[index] );
- else
- {
- writeIndent();
- writeValue( childValue );
- }
- if ( ++index == size )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- document_ += ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "]" );
- }
- else // output on a single line
- {
- assert( childValues_.size() == size );
- document_ += "[ ";
- for ( unsigned index =0; index < size; ++index )
- {
- if ( index > 0 )
- document_ += ", ";
- document_ += childValues_[index];
- }
- document_ += " ]";
- }
- }
-}
-
-
-bool
-StyledWriter::isMultineArray( const Value &value )
-{
- int size = value.size();
- bool isMultiLine = size*3 >= rightMargin_ ;
- childValues_.clear();
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- const Value &childValue = value[index];
- isMultiLine = isMultiLine ||
- ( (childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0 );
- }
- if ( !isMultiLine ) // check if line length > max line length
- {
- childValues_.reserve( size );
- addChildValues_ = true;
- int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]'
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- writeValue( value[index] );
- lineLength += int( childValues_[index].length() );
- isMultiLine = isMultiLine && hasCommentForValue( value[index] );
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-
-void
-StyledWriter::pushValue( const std::string &value )
-{
- if ( addChildValues_ )
- childValues_.push_back( value );
- else
- document_ += value;
-}
-
-
-void
-StyledWriter::writeIndent()
-{
- if ( !document_.empty() )
- {
- char last = document_[document_.length()-1];
- if ( last == ' ' ) // already indented
- return;
- if ( last != '\n' ) // Comments may add new-line
- document_ += '\n';
- }
- document_ += indentString_;
-}
-
-
-void
-StyledWriter::writeWithIndent( const std::string &value )
-{
- writeIndent();
- document_ += value;
-}
-
-
-void
-StyledWriter::indent()
-{
- indentString_ += std::string( indentSize_, ' ' );
-}
-
-
-void
-StyledWriter::unindent()
-{
- assert( int(indentString_.size()) >= indentSize_ );
- indentString_.resize( indentString_.size() - indentSize_ );
-}
-
-
-void
-StyledWriter::writeCommentBeforeValue( const Value &root )
-{
- if ( !root.hasComment( commentBefore ) )
- return;
- document_ += normalizeEOL( root.getComment( commentBefore ) );
- document_ += "\n";
-}
-
-
-void
-StyledWriter::writeCommentAfterValueOnSameLine( const Value &root )
-{
- if ( root.hasComment( commentAfterOnSameLine ) )
- document_ += " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) );
-
- if ( root.hasComment( commentAfter ) )
- {
- document_ += "\n";
- document_ += normalizeEOL( root.getComment( commentAfter ) );
- document_ += "\n";
- }
-}
-
-
-bool
-StyledWriter::hasCommentForValue( const Value &value )
-{
- return value.hasComment( commentBefore )
- || value.hasComment( commentAfterOnSameLine )
- || value.hasComment( commentAfter );
-}
-
-
-std::string
-StyledWriter::normalizeEOL( const std::string &text )
-{
- std::string normalized;
- normalized.reserve( text.length() );
- const char *begin = text.c_str();
- const char *end = begin + text.length();
- const char *current = begin;
- while ( current != end )
- {
- char c = *current++;
- if ( c == '\r' ) // mac or dos EOL
- {
- if ( *current == '\n' ) // convert dos EOL
- ++current;
- normalized += '\n';
- }
- else // handle unix EOL & other char
- normalized += c;
- }
- return normalized;
-}
-
-
-// Class StyledStreamWriter
-// //////////////////////////////////////////////////////////////////
-
-StyledStreamWriter::StyledStreamWriter( std::string indentation )
- : document_(NULL)
- , rightMargin_( 74 )
- , indentation_( indentation )
-{
-}
-
-
-void
-StyledStreamWriter::write( std::ostream &out, const Value &root )
-{
- document_ = &out;
- addChildValues_ = false;
- indentString_ = "";
- writeCommentBeforeValue( root );
- writeValue( root );
- writeCommentAfterValueOnSameLine( root );
- *document_ << "\n";
- document_ = NULL; // Forget the stream, for safety.
-}
-
-
-void
-StyledStreamWriter::writeValue( const Value &value )
-{
- switch ( value.type() )
- {
- case nullValue:
- pushValue( "null" );
- break;
- case intValue:
- pushValue( valueToString( value.asLargestInt() ) );
- break;
- case uintValue:
- pushValue( valueToString( value.asLargestUInt() ) );
- break;
- case realValue:
- pushValue( valueToString( value.asDouble() ) );
- break;
- case stringValue:
- pushValue( valueToQuotedString( value.asCString() ) );
- break;
- case booleanValue:
- pushValue( valueToString( value.asBool() ) );
- break;
- case arrayValue:
- writeArrayValue( value);
- break;
- case objectValue:
- {
- Value::Members members( value.getMemberNames() );
- if ( members.empty() )
- pushValue( "{}" );
- else
- {
- writeWithIndent( "{" );
- indent();
- Value::Members::iterator it = members.begin();
- while ( true )
- {
- const std::string &name = *it;
- const Value &childValue = value[name];
- writeCommentBeforeValue( childValue );
- writeWithIndent( valueToQuotedString( name.c_str() ) );
- *document_ << " : ";
- writeValue( childValue );
- if ( ++it == members.end() )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- *document_ << ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "}" );
- }
- }
- break;
- }
-}
-
-
-void
-StyledStreamWriter::writeArrayValue( const Value &value )
-{
- unsigned size = value.size();
- if ( size == 0 )
- pushValue( "[]" );
- else
- {
- bool isArrayMultiLine = isMultineArray( value );
- if ( isArrayMultiLine )
- {
- writeWithIndent( "[" );
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index =0;
- while ( true )
- {
- const Value &childValue = value[index];
- writeCommentBeforeValue( childValue );
- if ( hasChildValue )
- writeWithIndent( childValues_[index] );
- else
- {
- writeIndent();
- writeValue( childValue );
- }
- if ( ++index == size )
- {
- writeCommentAfterValueOnSameLine( childValue );
- break;
- }
- *document_ << ",";
- writeCommentAfterValueOnSameLine( childValue );
- }
- unindent();
- writeWithIndent( "]" );
- }
- else // output on a single line
- {
- assert( childValues_.size() == size );
- *document_ << "[ ";
- for ( unsigned index =0; index < size; ++index )
- {
- if ( index > 0 )
- *document_ << ", ";
- *document_ << childValues_[index];
- }
- *document_ << " ]";
- }
- }
-}
-
-
-bool
-StyledStreamWriter::isMultineArray( const Value &value )
-{
- int size = value.size();
- bool isMultiLine = size*3 >= rightMargin_ ;
- childValues_.clear();
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- const Value &childValue = value[index];
- isMultiLine = isMultiLine ||
- ( (childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0 );
- }
- if ( !isMultiLine ) // check if line length > max line length
- {
- childValues_.reserve( size );
- addChildValues_ = true;
- int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]'
- for ( int index =0; index < size && !isMultiLine; ++index )
- {
- writeValue( value[index] );
- lineLength += int( childValues_[index].length() );
- isMultiLine = isMultiLine && hasCommentForValue( value[index] );
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-
-void
-StyledStreamWriter::pushValue( const std::string &value )
-{
- if ( addChildValues_ )
- childValues_.push_back( value );
- else
- *document_ << value;
-}
-
-
-void
-StyledStreamWriter::writeIndent()
-{
- /*
- Some comments in this method would have been nice. ;-)
-
- if ( !document_.empty() )
- {
- char last = document_[document_.length()-1];
- if ( last == ' ' ) // already indented
- return;
- if ( last != '\n' ) // Comments may add new-line
- *document_ << '\n';
- }
- */
- *document_ << '\n' << indentString_;
-}
-
-
-void
-StyledStreamWriter::writeWithIndent( const std::string &value )
-{
- writeIndent();
- *document_ << value;
-}
-
-
-void
-StyledStreamWriter::indent()
-{
- indentString_ += indentation_;
-}
-
-
-void
-StyledStreamWriter::unindent()
-{
- assert( indentString_.size() >= indentation_.size() );
- indentString_.resize( indentString_.size() - indentation_.size() );
-}
-
-
-void
-StyledStreamWriter::writeCommentBeforeValue( const Value &root )
-{
- if ( !root.hasComment( commentBefore ) )
- return;
- *document_ << normalizeEOL( root.getComment( commentBefore ) );
- *document_ << "\n";
-}
-
-
-void
-StyledStreamWriter::writeCommentAfterValueOnSameLine( const Value &root )
-{
- if ( root.hasComment( commentAfterOnSameLine ) )
- *document_ << " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) );
-
- if ( root.hasComment( commentAfter ) )
- {
- *document_ << "\n";
- *document_ << normalizeEOL( root.getComment( commentAfter ) );
- *document_ << "\n";
- }
-}
-
-
-bool
-StyledStreamWriter::hasCommentForValue( const Value &value )
-{
- return value.hasComment( commentBefore )
- || value.hasComment( commentAfterOnSameLine )
- || value.hasComment( commentAfter );
-}
-
-
-std::string
-StyledStreamWriter::normalizeEOL( const std::string &text )
-{
- std::string normalized;
- normalized.reserve( text.length() );
- const char *begin = text.c_str();
- const char *end = begin + text.length();
- const char *current = begin;
- while ( current != end )
- {
- char c = *current++;
- if ( c == '\r' ) // mac or dos EOL
- {
- if ( *current == '\n' ) // convert dos EOL
- ++current;
- normalized += '\n';
- }
- else // handle unix EOL & other char
- normalized += c;
- }
- return normalized;
-}
-
-
-std::ostream& operator<<( std::ostream &sout, const Value &root )
-{
- Json::StyledStreamWriter writer;
- writer.write(sout, root);
- return sout;
-}
-
-
-} // namespace Json
diff --git a/lib/jsoncpp/src/lib_json/sconscript b/lib/jsoncpp/src/lib_json/sconscript
deleted file mode 100644
index 6e7c6c8a07..0000000000
--- a/lib/jsoncpp/src/lib_json/sconscript
+++ /dev/null
@@ -1,8 +0,0 @@
-Import( 'env buildLibrary' )
-
-buildLibrary( env, Split( """
- json_reader.cpp
- json_value.cpp
- json_writer.cpp
- """ ),
- 'json' )
diff --git a/lib/jsoncpp/src/test_lib_json/jsontest.cpp b/lib/jsoncpp/src/test_lib_json/jsontest.cpp
deleted file mode 100644
index 02e7b21699..0000000000
--- a/lib/jsoncpp/src/test_lib_json/jsontest.cpp
+++ /dev/null
@@ -1,608 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#define _CRT_SECURE_NO_WARNINGS 1 // Prevents deprecation warning with MSVC
-#include "jsontest.h"
-#include <stdio.h>
-#include <string>
-
-#if defined(_MSC_VER)
-// Used to install a report hook that prevent dialog on assertion and error.
-# include <crtdbg.h>
-#endif // if defined(_MSC_VER)
-
-#if defined(_WIN32)
-// Used to prevent dialog on memory fault.
-// Limits headers included by Windows.h
-# define WIN32_LEAN_AND_MEAN
-# define NOSERVICE
-# define NOMCX
-# define NOIME
-# define NOSOUND
-# define NOCOMM
-# define NORPC
-# define NOGDI
-# define NOUSER
-# define NODRIVERS
-# define NOLOGERROR
-# define NOPROFILER
-# define NOMEMMGR
-# define NOLFILEIO
-# define NOOPENFILE
-# define NORESOURCE
-# define NOATOM
-# define NOLANGUAGE
-# define NOLSTRING
-# define NODBCS
-# define NOKEYBOARDINFO
-# define NOGDICAPMASKS
-# define NOCOLOR
-# define NOGDIOBJ
-# define NODRAWTEXT
-# define NOTEXTMETRIC
-# define NOSCALABLEFONT
-# define NOBITMAP
-# define NORASTEROPS
-# define NOMETAFILE
-# define NOSYSMETRICS
-# define NOSYSTEMPARAMSINFO
-# define NOMSG
-# define NOWINSTYLES
-# define NOWINOFFSETS
-# define NOSHOWWINDOW
-# define NODEFERWINDOWPOS
-# define NOVIRTUALKEYCODES
-# define NOKEYSTATES
-# define NOWH
-# define NOMENUS
-# define NOSCROLL
-# define NOCLIPBOARD
-# define NOICONS
-# define NOMB
-# define NOSYSCOMMANDS
-# define NOMDI
-# define NOCTLMGR
-# define NOWINMESSAGES
-# include <windows.h>
-#endif // if defined(_WIN32)
-
-namespace JsonTest {
-
-
-// class TestResult
-// //////////////////////////////////////////////////////////////////
-
-TestResult::TestResult()
- : predicateId_( 1 )
- , lastUsedPredicateId_( 0 )
- , messageTarget_( 0 )
-{
- // The root predicate has id 0
- rootPredicateNode_.id_ = 0;
- rootPredicateNode_.next_ = 0;
- predicateStackTail_ = &rootPredicateNode_;
-}
-
-
-void
-TestResult::setTestName( const std::string &name )
-{
- name_ = name;
-}
-
-TestResult &
-TestResult::addFailure( const char *file, unsigned int line,
- const char *expr )
-{
- /// Walks the PredicateContext stack adding them to failures_ if not already added.
- unsigned int nestingLevel = 0;
- PredicateContext *lastNode = rootPredicateNode_.next_;
- for ( ; lastNode != 0; lastNode = lastNode->next_ )
- {
- if ( lastNode->id_ > lastUsedPredicateId_ ) // new PredicateContext
- {
- lastUsedPredicateId_ = lastNode->id_;
- addFailureInfo( lastNode->file_, lastNode->line_, lastNode->expr_,
- nestingLevel );
- // Link the PredicateContext to the failure for message target when
- // popping the PredicateContext.
- lastNode->failure_ = &( failures_.back() );
- }
- ++nestingLevel;
- }
-
- // Adds the failed assertion
- addFailureInfo( file, line, expr, nestingLevel );
- messageTarget_ = &( failures_.back() );
- return *this;
-}
-
-
-void
-TestResult::addFailureInfo( const char *file, unsigned int line,
- const char *expr, unsigned int nestingLevel )
-{
- Failure failure;
- failure.file_ = file;
- failure.line_ = line;
- if ( expr )
- {
- failure.expr_ = expr;
- }
- failure.nestingLevel_ = nestingLevel;
- failures_.push_back( failure );
-}
-
-
-TestResult &
-TestResult::popPredicateContext()
-{
- PredicateContext *lastNode = &rootPredicateNode_;
- while ( lastNode->next_ != 0 && lastNode->next_->next_ != 0 )
- {
- lastNode = lastNode->next_;
- }
- // Set message target to popped failure
- PredicateContext *tail = lastNode->next_;
- if ( tail != 0 && tail->failure_ != 0 )
- {
- messageTarget_ = tail->failure_;
- }
- // Remove tail from list
- predicateStackTail_ = lastNode;
- lastNode->next_ = 0;
- return *this;
-}
-
-
-bool
-TestResult::failed() const
-{
- return !failures_.empty();
-}
-
-
-unsigned int
-TestResult::getAssertionNestingLevel() const
-{
- unsigned int level = 0;
- const PredicateContext *lastNode = &rootPredicateNode_;
- while ( lastNode->next_ != 0 )
- {
- lastNode = lastNode->next_;
- ++level;
- }
- return level;
-}
-
-
-void
-TestResult::printFailure( bool printTestName ) const
-{
- if ( failures_.empty() )
- {
- return;
- }
-
- if ( printTestName )
- {
- printf( "* Detail of %s test failure:\n", name_.c_str() );
- }
-
- // Print in reverse to display the callstack in the right order
- Failures::const_iterator itEnd = failures_.end();
- for ( Failures::const_iterator it = failures_.begin(); it != itEnd; ++it )
- {
- const Failure &failure = *it;
- std::string indent( failure.nestingLevel_ * 2, ' ' );
- if ( failure.file_ )
- {
- printf( "%s%s(%d): ", indent.c_str(), failure.file_, failure.line_ );
- }
- if ( !failure.expr_.empty() )
- {
- printf( "%s\n", failure.expr_.c_str() );
- }
- else if ( failure.file_ )
- {
- printf( "\n" );
- }
- if ( !failure.message_.empty() )
- {
- std::string reindented = indentText( failure.message_, indent + " " );
- printf( "%s\n", reindented.c_str() );
- }
- }
-}
-
-
-std::string
-TestResult::indentText( const std::string &text,
- const std::string &indent )
-{
- std::string reindented;
- std::string::size_type lastIndex = 0;
- while ( lastIndex < text.size() )
- {
- std::string::size_type nextIndex = text.find( '\n', lastIndex );
- if ( nextIndex == std::string::npos )
- {
- nextIndex = text.size() - 1;
- }
- reindented += indent;
- reindented += text.substr( lastIndex, nextIndex - lastIndex + 1 );
- lastIndex = nextIndex + 1;
- }
- return reindented;
-}
-
-
-TestResult &
-TestResult::addToLastFailure( const std::string &message )
-{
- if ( messageTarget_ != 0 )
- {
- messageTarget_->message_ += message;
- }
- return *this;
-}
-
-
-TestResult &
-TestResult::operator << ( bool value )
-{
- return addToLastFailure( value ? "true" : "false" );
-}
-
-
-TestResult &
-TestResult::operator << ( int value )
-{
- char buffer[32];
- sprintf( buffer, "%d", value );
- return addToLastFailure( buffer );
-}
-
-
-TestResult &
-TestResult::operator << ( unsigned int value )
-{
- char buffer[32];
- sprintf( buffer, "%u", value );
- return addToLastFailure( buffer );
-}
-
-
-TestResult &
-TestResult::operator << ( double value )
-{
- char buffer[32];
- sprintf( buffer, "%16g", value );
- return addToLastFailure( buffer );
-}
-
-
-TestResult &
-TestResult::operator << ( const char *value )
-{
- return addToLastFailure( value ? value
- : "<NULL>" );
-}
-
-
-TestResult &
-TestResult::operator << ( const std::string &value )
-{
- return addToLastFailure( value );
-}
-
-
-
-// class TestCase
-// //////////////////////////////////////////////////////////////////
-
-TestCase::TestCase()
- : result_( 0 )
-{
-}
-
-
-TestCase::~TestCase()
-{
-}
-
-
-void
-TestCase::run( TestResult &result )
-{
- result_ = &result;
- runTestCase();
-}
-
-
-
-// class Runner
-// //////////////////////////////////////////////////////////////////
-
-Runner::Runner()
-{
-}
-
-
-Runner &
-Runner::add( TestCaseFactory factory )
-{
- tests_.push_back( factory );
- return *this;
-}
-
-
-unsigned int
-Runner::testCount() const
-{
- return static_cast<unsigned int>( tests_.size() );
-}
-
-
-std::string
-Runner::testNameAt( unsigned int index ) const
-{
- TestCase *test = tests_[index]();
- std::string name = test->testName();
- delete test;
- return name;
-}
-
-
-void
-Runner::runTestAt( unsigned int index, TestResult &result ) const
-{
- TestCase *test = tests_[index]();
- result.setTestName( test->testName() );
- printf( "Testing %s: ", test->testName() );
- fflush( stdout );
-#if JSON_USE_EXCEPTION
- try
- {
-#endif // if JSON_USE_EXCEPTION
- test->run( result );
-#if JSON_USE_EXCEPTION
- }
- catch ( const std::exception &e )
- {
- result.addFailure( __FILE__, __LINE__,
- "Unexpected exception caugth:" ) << e.what();
- }
-#endif // if JSON_USE_EXCEPTION
- delete test;
- const char *status = result.failed() ? "FAILED"
- : "OK";
- printf( "%s\n", status );
- fflush( stdout );
-}
-
-
-bool
-Runner::runAllTest( bool printSummary ) const
-{
- unsigned int count = testCount();
- std::deque<TestResult> failures;
- for ( unsigned int index = 0; index < count; ++index )
- {
- TestResult result;
- runTestAt( index, result );
- if ( result.failed() )
- {
- failures.push_back( result );
- }
- }
-
- if ( failures.empty() )
- {
- if ( printSummary )
- {
- printf( "All %d tests passed\n", count );
- }
- return true;
- }
- else
- {
- for ( unsigned int index = 0; index < failures.size(); ++index )
- {
- TestResult &result = failures[index];
- result.printFailure( count > 1 );
- }
-
- if ( printSummary )
- {
- unsigned int failedCount = static_cast<unsigned int>( failures.size() );
- unsigned int passedCount = count - failedCount;
- printf( "%d/%d tests passed (%d failure(s))\n", passedCount, count, failedCount );
- }
- return false;
- }
-}
-
-
-bool
-Runner::testIndex( const std::string &testName,
- unsigned int &indexOut ) const
-{
- unsigned int count = testCount();
- for ( unsigned int index = 0; index < count; ++index )
- {
- if ( testNameAt(index) == testName )
- {
- indexOut = index;
- return true;
- }
- }
- return false;
-}
-
-
-void
-Runner::listTests() const
-{
- unsigned int count = testCount();
- for ( unsigned int index = 0; index < count; ++index )
- {
- printf( "%s\n", testNameAt( index ).c_str() );
- }
-}
-
-
-int
-Runner::runCommandLine( int argc, const char *argv[] ) const
-{
- typedef std::deque<std::string> TestNames;
- Runner subrunner;
- for ( int index = 1; index < argc; ++index )
- {
- std::string opt = argv[index];
- if ( opt == "--list-tests" )
- {
- listTests();
- return 0;
- }
- else if ( opt == "--test-auto" )
- {
- preventDialogOnCrash();
- }
- else if ( opt == "--test" )
- {
- ++index;
- if ( index < argc )
- {
- unsigned int testNameIndex;
- if ( testIndex( argv[index], testNameIndex ) )
- {
- subrunner.add( tests_[testNameIndex] );
- }
- else
- {
- fprintf( stderr, "Test '%s' does not exist!\n", argv[index] );
- return 2;
- }
- }
- else
- {
- printUsage( argv[0] );
- return 2;
- }
- }
- else
- {
- printUsage( argv[0] );
- return 2;
- }
- }
- bool succeeded;
- if ( subrunner.testCount() > 0 )
- {
- succeeded = subrunner.runAllTest( subrunner.testCount() > 1 );
- }
- else
- {
- succeeded = runAllTest( true );
- }
- return succeeded ? 0
- : 1;
-}
-
-
-#if defined(_MSC_VER)
-// Hook MSVCRT assertions to prevent dialog from appearing
-static int
-msvcrtSilentReportHook( int reportType, char *message, int *returnValue )
-{
- // The default CRT handling of error and assertion is to display
- // an error dialog to the user.
- // Instead, when an error or an assertion occurs, we force the
- // application to terminate using abort() after display
- // the message on stderr.
- if ( reportType == _CRT_ERROR ||
- reportType == _CRT_ASSERT )
- {
- // calling abort() cause the ReportHook to be called
- // The following is used to detect this case and let's the
- // error handler fallback on its default behaviour (
- // display a warning message)
- static volatile bool isAborting = false;
- if ( isAborting )
- {
- return TRUE;
- }
- isAborting = true;
-
- fprintf( stderr, "CRT Error/Assert:\n%s\n", message );
- fflush( stderr );
- abort();
- }
- // Let's other reportType (_CRT_WARNING) be handled as they would by default
- return FALSE;
-}
-#endif // if defined(_MSC_VER)
-
-
-void
-Runner::preventDialogOnCrash()
-{
-#if defined(_MSC_VER)
- // Install a hook to prevent MSVCRT error and assertion from
- // popping a dialog.
- _CrtSetReportHook( &msvcrtSilentReportHook );
-#endif // if defined(_MSC_VER)
-
- // @todo investiguate this handler (for buffer overflow)
- // _set_security_error_handler
-
-#if defined(_WIN32)
- // Prevents the system from popping a dialog for debugging if the
- // application fails due to invalid memory access.
- SetErrorMode( SEM_FAILCRITICALERRORS
- | SEM_NOGPFAULTERRORBOX
- | SEM_NOOPENFILEERRORBOX );
-#endif // if defined(_WIN32)
-}
-
-void
-Runner::printUsage( const char *appName )
-{
- printf(
- "Usage: %s [options]\n"
- "\n"
- "If --test is not specified, then all the test cases be run.\n"
- "\n"
- "Valid options:\n"
- "--list-tests: print the name of all test cases on the standard\n"
- " output and exit.\n"
- "--test TESTNAME: executes the test case with the specified name.\n"
- " May be repeated.\n"
- "--test-auto: prevent dialog prompting for debugging on crash.\n"
- , appName );
-}
-
-
-
-// Assertion functions
-// //////////////////////////////////////////////////////////////////
-
-TestResult &
-checkStringEqual( TestResult &result,
- const std::string &expected, const std::string &actual,
- const char *file, unsigned int line, const char *expr )
-{
- if ( expected != actual )
- {
- result.addFailure( file, line, expr );
- result << "Expected: '" << expected << "'\n";
- result << "Actual : '" << actual << "'";
- }
- return result;
-}
-
-
-} // namespace JsonTest
diff --git a/lib/jsoncpp/src/test_lib_json/jsontest.h b/lib/jsoncpp/src/test_lib_json/jsontest.h
deleted file mode 100644
index 0d072382e1..0000000000
--- a/lib/jsoncpp/src/test_lib_json/jsontest.h
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSONTEST_H_INCLUDED
-# define JSONTEST_H_INCLUDED
-
-# include <json/config.h>
-# include <stdio.h>
-# include <deque>
-# include <string>
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// Mini Unit Testing framework
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-
-
-/** \brief Unit testing framework.
- * \warning: all assertions are non-aborting, test case execution will continue
- * even if an assertion namespace.
- * This constraint is for portability: the framework needs to compile
- * on Visual Studio 6 and must not require exception usage.
- */
-namespace JsonTest {
-
-
- class Failure
- {
- public:
- const char *file_;
- unsigned int line_;
- std::string expr_;
- std::string message_;
- unsigned int nestingLevel_;
- };
-
-
- /// Context used to create the assertion callstack on failure.
- /// Must be a POD to allow inline initialisation without stepping
- /// into the debugger.
- struct PredicateContext
- {
- typedef unsigned int Id;
- Id id_;
- const char *file_;
- unsigned int line_;
- const char *expr_;
- PredicateContext *next_;
- /// Related Failure, set when the PredicateContext is converted
- /// into a Failure.
- Failure *failure_;
- };
-
- class TestResult
- {
- public:
- TestResult();
-
- /// \internal Implementation detail for assertion macros
- /// Not encapsulated to prevent step into when debugging failed assertions
- /// Incremented by one on assertion predicate entry, decreased by one
- /// by addPredicateContext().
- PredicateContext::Id predicateId_;
-
- /// \internal Implementation detail for predicate macros
- PredicateContext *predicateStackTail_;
-
- void setTestName( const std::string &name );
-
- /// Adds an assertion failure.
- TestResult &addFailure( const char *file, unsigned int line,
- const char *expr = 0 );
-
- /// Removes the last PredicateContext added to the predicate stack
- /// chained list.
- /// Next messages will be targed at the PredicateContext that was removed.
- TestResult &popPredicateContext();
-
- bool failed() const;
-
- void printFailure( bool printTestName ) const;
-
- TestResult &operator << ( bool value );
- TestResult &operator << ( int value );
- TestResult &operator << ( unsigned int value );
- TestResult &operator << ( double value );
- TestResult &operator << ( const char *value );
- TestResult &operator << ( const std::string &value );
-
- private:
- TestResult &addToLastFailure( const std::string &message );
- unsigned int getAssertionNestingLevel() const;
- /// Adds a failure or a predicate context
- void addFailureInfo( const char *file, unsigned int line,
- const char *expr, unsigned int nestingLevel );
- static std::string indentText( const std::string &text,
- const std::string &indent );
-
- typedef std::deque<Failure> Failures;
- Failures failures_;
- std::string name_;
- PredicateContext rootPredicateNode_;
- PredicateContext::Id lastUsedPredicateId_;
- /// Failure which is the target of the messages added using operator <<
- Failure *messageTarget_;
- };
-
-
- class TestCase
- {
- public:
- TestCase();
-
- virtual ~TestCase();
-
- void run( TestResult &result );
-
- virtual const char *testName() const = 0;
-
- protected:
- TestResult *result_;
-
- private:
- virtual void runTestCase() = 0;
- };
-
- /// Function pointer type for TestCase factory
- typedef TestCase *(*TestCaseFactory)();
-
- class Runner
- {
- public:
- Runner();
-
- /// Adds a test to the suite
- Runner &add( TestCaseFactory factory );
-
- /// Runs test as specified on the command-line
- /// If no command-line arguments are provided, run all tests.
- /// If --list-tests is provided, then print the list of all test cases
- /// If --test <testname> is provided, then run test testname.
- int runCommandLine( int argc, const char *argv[] ) const;
-
- /// Runs all the test cases
- bool runAllTest( bool printSummary ) const;
-
- /// Returns the number of test case in the suite
- unsigned int testCount() const;
-
- /// Returns the name of the test case at the specified index
- std::string testNameAt( unsigned int index ) const;
-
- /// Runs the test case at the specified index using the specified TestResult
- void runTestAt( unsigned int index, TestResult &result ) const;
-
- static void printUsage( const char *appName );
-
- private: // prevents copy construction and assignment
- Runner( const Runner &other );
- Runner &operator =( const Runner &other );
-
- private:
- void listTests() const;
- bool testIndex( const std::string &testName, unsigned int &index ) const;
- static void preventDialogOnCrash();
-
- private:
- typedef std::deque<TestCaseFactory> Factories;
- Factories tests_;
- };
-
- template<typename T>
- TestResult &
- checkEqual( TestResult &result, const T &expected, const T &actual,
- const char *file, unsigned int line, const char *expr )
- {
- if ( expected != actual )
- {
- result.addFailure( file, line, expr );
- result << "Expected: " << expected << "\n";
- result << "Actual : " << actual;
- }
- return result;
- }
-
- TestResult &
- checkStringEqual( TestResult &result,
- const std::string &expected, const std::string &actual,
- const char *file, unsigned int line, const char *expr );
-
-} // namespace JsonTest
-
-
-/// \brief Asserts that the given expression is true.
-/// JSONTEST_ASSERT( x == y ) << "x=" << x << ", y=" << y;
-/// JSONTEST_ASSERT( x == y );
-#define JSONTEST_ASSERT( expr ) \
- if ( expr ) \
- { \
- } \
- else \
- result_->addFailure( __FILE__, __LINE__, #expr )
-
-/// \brief Asserts that the given predicate is true.
-/// The predicate may do other assertions and be a member function of the fixture.
-#define JSONTEST_ASSERT_PRED( expr ) \
- { \
- JsonTest::PredicateContext _minitest_Context = { \
- result_->predicateId_, __FILE__, __LINE__, #expr }; \
- result_->predicateStackTail_->next_ = &_minitest_Context; \
- result_->predicateId_ += 1; \
- result_->predicateStackTail_ = &_minitest_Context; \
- (expr); \
- result_->popPredicateContext(); \
- } \
- *result_
-
-/// \brief Asserts that two values are equals.
-#define JSONTEST_ASSERT_EQUAL( expected, actual ) \
- JsonTest::checkEqual( *result_, expected, actual, \
- __FILE__, __LINE__, \
- #expected " == " #actual )
-
-/// \brief Asserts that two values are equals.
-#define JSONTEST_ASSERT_STRING_EQUAL( expected, actual ) \
- JsonTest::checkStringEqual( *result_, \
- std::string(expected), std::string(actual), \
- #expected " == " #actual )
-
-/// \brief Begin a fixture test case.
-#define JSONTEST_FIXTURE( FixtureType, name ) \
- class Test##FixtureType##name : public FixtureType \
- { \
- public: \
- static JsonTest::TestCase *factory() \
- { \
- return new Test##FixtureType##name(); \
- } \
- public: /* overidden from TestCase */ \
- virtual const char *testName() const \
- { \
- return #FixtureType "/" #name; \
- } \
- virtual void runTestCase(); \
- }; \
- \
- void Test##FixtureType##name::runTestCase()
-
-#define JSONTEST_FIXTURE_FACTORY( FixtureType, name ) \
- &Test##FixtureType##name::factory
-
-#define JSONTEST_REGISTER_FIXTURE( runner, FixtureType, name ) \
- (runner).add( JSONTEST_FIXTURE_FACTORY( FixtureType, name ) )
-
-#endif // ifndef JSONTEST_H_INCLUDED
diff --git a/lib/jsoncpp/src/test_lib_json/main.cpp b/lib/jsoncpp/src/test_lib_json/main.cpp
deleted file mode 100644
index de64200ce7..0000000000
--- a/lib/jsoncpp/src/test_lib_json/main.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#include <json/json.h>
-#include "jsontest.h"
-
-
-// TODO:
-// - boolean value returns that they are integral. Should not be.
-// - unsigned integer in integer range are not considered to be valid integer. Should check range.
-
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// Json Library test cases
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-
-struct ValueTest : JsonTest::TestCase
-{
- Json::Value null_;
- Json::Value emptyArray_;
- Json::Value emptyObject_;
- Json::Value integer_;
- Json::Value unsignedInteger_;
- Json::Value smallUnsignedInteger_;
- Json::Value real_;
- Json::Value float_;
- Json::Value array1_;
- Json::Value object1_;
- Json::Value emptyString_;
- Json::Value string1_;
- Json::Value string_;
- Json::Value true_;
- Json::Value false_;
-
- ValueTest()
- : emptyArray_( Json::arrayValue )
- , emptyObject_( Json::objectValue )
- , integer_( 123456789 )
- , smallUnsignedInteger_( Json::Value::UInt( Json::Value::maxInt ) )
- , unsignedInteger_( 34567890u )
- , real_( 1234.56789 )
- , float_( 0.00390625f )
- , emptyString_( "" )
- , string1_( "a" )
- , string_( "sometext with space" )
- , true_( true )
- , false_( false )
- {
- array1_.append( 1234 );
- object1_["id"] = 1234;
- }
-
- struct IsCheck
- {
- /// Initialize all checks to \c false by default.
- IsCheck();
-
- bool isObject_;
- bool isArray_;
- bool isBool_;
- bool isDouble_;
- bool isInt_;
- bool isUInt_;
- bool isIntegral_;
- bool isNumeric_;
- bool isString_;
- bool isNull_;
- };
-
- void checkConstMemberCount( const Json::Value &value, unsigned int expectedCount );
-
- void checkMemberCount( Json::Value &value, unsigned int expectedCount );
-
- void checkIs( const Json::Value &value, const IsCheck &check );
-};
-
-
-JSONTEST_FIXTURE( ValueTest, size )
-{
- JSONTEST_ASSERT_PRED( checkMemberCount(emptyArray_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(emptyObject_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(array1_, 1) );
- JSONTEST_ASSERT_PRED( checkMemberCount(object1_, 1) );
- JSONTEST_ASSERT_PRED( checkMemberCount(null_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(integer_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(real_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(emptyString_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(string_, 0) );
- JSONTEST_ASSERT_PRED( checkMemberCount(true_, 0) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isObject )
-{
- IsCheck checks;
- checks.isObject_ = true;
- JSONTEST_ASSERT_PRED( checkIs( emptyObject_, checks ) );
- JSONTEST_ASSERT_PRED( checkIs( object1_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isArray )
-{
- IsCheck checks;
- checks.isArray_ = true;
- JSONTEST_ASSERT_PRED( checkIs( emptyArray_, checks ) );
- JSONTEST_ASSERT_PRED( checkIs( array1_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isNull )
-{
- IsCheck checks;
- checks.isNull_ = true;
- checks.isObject_ = true;
- checks.isArray_ = true;
- JSONTEST_ASSERT_PRED( checkIs( null_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isString )
-{
- IsCheck checks;
- checks.isString_ = true;
- JSONTEST_ASSERT_PRED( checkIs( emptyString_, checks ) );
- JSONTEST_ASSERT_PRED( checkIs( string_, checks ) );
- JSONTEST_ASSERT_PRED( checkIs( string1_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isBool )
-{
- IsCheck checks;
- checks.isBool_ = true;
- checks.isIntegral_ = true;
- checks.isNumeric_ = true;
- JSONTEST_ASSERT_PRED( checkIs( false_, checks ) );
- JSONTEST_ASSERT_PRED( checkIs( true_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isDouble )
-{
- IsCheck checks;
- checks.isDouble_ = true;
- checks.isNumeric_ = true;
- JSONTEST_ASSERT_PRED( checkIs( real_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isInt )
-{
- IsCheck checks;
- checks.isInt_ = true;
- checks.isNumeric_ = true;
- checks.isIntegral_ = true;
- JSONTEST_ASSERT_PRED( checkIs( integer_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, isUInt )
-{
- IsCheck checks;
- checks.isUInt_ = true;
- checks.isNumeric_ = true;
- checks.isIntegral_ = true;
- JSONTEST_ASSERT_PRED( checkIs( unsignedInteger_, checks ) );
- JSONTEST_ASSERT_PRED( checkIs( smallUnsignedInteger_, checks ) );
-}
-
-
-JSONTEST_FIXTURE( ValueTest, accessArray )
-{
- const unsigned int index0 = 0;
- JSONTEST_ASSERT( Json::Value(1234) == array1_[index0] ) << "Json::Value::operator[ArrayIndex]";
- JSONTEST_ASSERT( Json::Value(1234) == array1_[0] ) << "Json::Value::operator[int]";
-
- const Json::Value &constArray = array1_;
- JSONTEST_ASSERT( Json::Value(1234) == constArray[index0] ) << "Json::Value::operator[ArrayIndex] const";
- JSONTEST_ASSERT( Json::Value(1234) == constArray[0] ) << "Json::Value::operator[int] const";
-}
-
-
-JSONTEST_FIXTURE( ValueTest, asFloat )
-{
- JSONTEST_ASSERT_EQUAL( 0.00390625f, float_.asFloat() ) << "Json::Value::asFloat()";
-}
-
-void
-ValueTest::checkConstMemberCount( const Json::Value &value, unsigned int expectedCount )
-{
- unsigned int count = 0;
- Json::Value::const_iterator itEnd = value.end();
- for ( Json::Value::const_iterator it = value.begin(); it != itEnd; ++it )
- {
- ++count;
- }
- JSONTEST_ASSERT_EQUAL( expectedCount, count ) << "Json::Value::const_iterator";
-}
-
-void
-ValueTest::checkMemberCount( Json::Value &value, unsigned int expectedCount )
-{
- JSONTEST_ASSERT_EQUAL( expectedCount, value.size() );
-
- unsigned int count = 0;
- Json::Value::iterator itEnd = value.end();
- for ( Json::Value::iterator it = value.begin(); it != itEnd; ++it )
- {
- ++count;
- }
- JSONTEST_ASSERT_EQUAL( expectedCount, count ) << "Json::Value::iterator";
-
- JSONTEST_ASSERT_PRED( checkConstMemberCount(value, expectedCount) );
-}
-
-
-ValueTest::IsCheck::IsCheck()
- : isObject_( false )
- , isArray_( false )
- , isBool_( false )
- , isDouble_( false )
- , isInt_( false )
- , isUInt_( false )
- , isIntegral_( false )
- , isNumeric_( false )
- , isString_( false )
- , isNull_( false )
-{
-}
-
-
-void
-ValueTest::checkIs( const Json::Value &value, const IsCheck &check )
-{
- JSONTEST_ASSERT_EQUAL( check.isObject_, value.isObject() );
- JSONTEST_ASSERT_EQUAL( check.isArray_, value.isArray() );
- JSONTEST_ASSERT_EQUAL( check.isBool_, value.isBool() );
- JSONTEST_ASSERT_EQUAL( check.isDouble_, value.isDouble() );
- JSONTEST_ASSERT_EQUAL( check.isInt_, value.isInt() );
- JSONTEST_ASSERT_EQUAL( check.isUInt_, value.isUInt() );
- JSONTEST_ASSERT_EQUAL( check.isIntegral_, value.isIntegral() );
- JSONTEST_ASSERT_EQUAL( check.isNumeric_, value.isNumeric() );
- JSONTEST_ASSERT_EQUAL( check.isString_, value.isString() );
- JSONTEST_ASSERT_EQUAL( check.isNull_, value.isNull() );
-}
-
-
-
-int main( int argc, const char *argv[] )
-{
- JsonTest::Runner runner;
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, size );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isObject );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isArray );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isBool );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isInt );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isUInt );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isDouble );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isString );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isNull );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isNull );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, accessArray );
- JSONTEST_REGISTER_FIXTURE( runner, ValueTest, asFloat );
- return runner.runCommandLine( argc, argv );
-}
diff --git a/lib/jsoncpp/src/test_lib_json/sconscript b/lib/jsoncpp/src/test_lib_json/sconscript
deleted file mode 100644
index 915fd01c0a..0000000000
--- a/lib/jsoncpp/src/test_lib_json/sconscript
+++ /dev/null
@@ -1,10 +0,0 @@
-Import( 'env_testing buildUnitTests' )
-
-buildUnitTests( env_testing, Split( """
- main.cpp
- jsontest.cpp
- """ ),
- 'test_lib_json' )
-
-# For 'check' to work, 'libs' must be built first.
-env_testing.Depends('test_lib_json', '#libs')
diff --git a/lib/jsoncpp/test/cleantests.py b/lib/jsoncpp/test/cleantests.py
deleted file mode 100644
index c38fd8ffdd..0000000000
--- a/lib/jsoncpp/test/cleantests.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# removes all files created during testing
-import glob
-import os
-
-paths = []
-for pattern in [ '*.actual', '*.actual-rewrite', '*.rewrite', '*.process-output' ]:
- paths += glob.glob( 'data/' + pattern )
-
-for path in paths:
- os.unlink( path )
diff --git a/lib/jsoncpp/test/data/test_array_01.expected b/lib/jsoncpp/test/data/test_array_01.expected
deleted file mode 100644
index a341ff753c..0000000000
--- a/lib/jsoncpp/test/data/test_array_01.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=[]
diff --git a/lib/jsoncpp/test/data/test_array_01.json b/lib/jsoncpp/test/data/test_array_01.json
deleted file mode 100644
index fe51488c70..0000000000
--- a/lib/jsoncpp/test/data/test_array_01.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
diff --git a/lib/jsoncpp/test/data/test_array_02.expected b/lib/jsoncpp/test/data/test_array_02.expected
deleted file mode 100644
index ef1f2623de..0000000000
--- a/lib/jsoncpp/test/data/test_array_02.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=[]
-.[0]=1
diff --git a/lib/jsoncpp/test/data/test_array_02.json b/lib/jsoncpp/test/data/test_array_02.json
deleted file mode 100644
index 7660873d10..0000000000
--- a/lib/jsoncpp/test/data/test_array_02.json
+++ /dev/null
@@ -1 +0,0 @@
-[1]
diff --git a/lib/jsoncpp/test/data/test_array_03.expected b/lib/jsoncpp/test/data/test_array_03.expected
deleted file mode 100644
index 3d8dc18eb1..0000000000
--- a/lib/jsoncpp/test/data/test_array_03.expected
+++ /dev/null
@@ -1,6 +0,0 @@
-.=[]
-.[0]=1
-.[1]=2
-.[2]=3
-.[3]=4
-.[4]=5
diff --git a/lib/jsoncpp/test/data/test_array_03.json b/lib/jsoncpp/test/data/test_array_03.json
deleted file mode 100644
index 9b3f924755..0000000000
--- a/lib/jsoncpp/test/data/test_array_03.json
+++ /dev/null
@@ -1 +0,0 @@
-[ 1, 2 , 3,4,5]
diff --git a/lib/jsoncpp/test/data/test_array_04.expected b/lib/jsoncpp/test/data/test_array_04.expected
deleted file mode 100644
index ad4add9794..0000000000
--- a/lib/jsoncpp/test/data/test_array_04.expected
+++ /dev/null
@@ -1,5 +0,0 @@
-.=[]
-.[0]=1
-.[1]="abc"
-.[2]=12.3
-.[3]=-4
diff --git a/lib/jsoncpp/test/data/test_array_04.json b/lib/jsoncpp/test/data/test_array_04.json
deleted file mode 100644
index ecca546b2c..0000000000
--- a/lib/jsoncpp/test/data/test_array_04.json
+++ /dev/null
@@ -1 +0,0 @@
-[1, "abc" , 12.3, -4]
diff --git a/lib/jsoncpp/test/data/test_array_05.expected b/lib/jsoncpp/test/data/test_array_05.expected
deleted file mode 100644
index 76cff87c2a..0000000000
--- a/lib/jsoncpp/test/data/test_array_05.expected
+++ /dev/null
@@ -1,100 +0,0 @@
-.=[]
-.[0]=1
-.[1]=2
-.[2]=3
-.[3]=4
-.[4]=5
-.[5]=6
-.[6]=7
-.[7]=8
-.[8]=9
-.[9]=10
-.[10]=11
-.[11]=12
-.[12]=13
-.[13]=14
-.[14]=15
-.[15]=16
-.[16]=17
-.[17]=18
-.[18]=19
-.[19]=20
-.[20]=21
-.[21]=22
-.[22]=23
-.[23]=24
-.[24]=25
-.[25]=26
-.[26]=27
-.[27]=28
-.[28]=29
-.[29]=30
-.[30]=31
-.[31]=32
-.[32]=33
-.[33]=34
-.[34]=35
-.[35]=36
-.[36]=37
-.[37]=38
-.[38]=39
-.[39]=40
-.[40]=41
-.[41]=42
-.[42]=43
-.[43]=44
-.[44]=45
-.[45]=46
-.[46]=47
-.[47]=48
-.[48]=49
-.[49]=50
-.[50]=51
-.[51]=52
-.[52]=53
-.[53]=54
-.[54]=55
-.[55]=56
-.[56]=57
-.[57]=58
-.[58]=59
-.[59]=60
-.[60]=61
-.[61]=62
-.[62]=63
-.[63]=64
-.[64]=65
-.[65]=66
-.[66]=67
-.[67]=68
-.[68]=69
-.[69]=70
-.[70]=71
-.[71]=72
-.[72]=73
-.[73]=74
-.[74]=75
-.[75]=76
-.[76]=77
-.[77]=78
-.[78]=79
-.[79]=80
-.[80]=81
-.[81]=82
-.[82]=83
-.[83]=84
-.[84]=85
-.[85]=86
-.[86]=87
-.[87]=88
-.[88]=89
-.[89]=90
-.[90]=91
-.[91]=92
-.[92]=93
-.[93]=94
-.[94]=95
-.[95]=96
-.[96]=97
-.[97]=98
-.[98]=99
diff --git a/lib/jsoncpp/test/data/test_array_05.json b/lib/jsoncpp/test/data/test_array_05.json
deleted file mode 100644
index 7809d6c9a1..0000000000
--- a/lib/jsoncpp/test/data/test_array_05.json
+++ /dev/null
@@ -1 +0,0 @@
-[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_array_06.expected b/lib/jsoncpp/test/data/test_array_06.expected
deleted file mode 100644
index 5c9f48eaac..0000000000
--- a/lib/jsoncpp/test/data/test_array_06.expected
+++ /dev/null
@@ -1,5 +0,0 @@
-.=[]
-.[0]="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-.[1]="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
-.[2]="ccccccccccccccccccccccc"
-.[3]="dddddddddddddddddddddddddddddddddddddddddddddddddddd"
diff --git a/lib/jsoncpp/test/data/test_array_06.json b/lib/jsoncpp/test/data/test_array_06.json
deleted file mode 100644
index 7f6c516afd..0000000000
--- a/lib/jsoncpp/test/data/test_array_06.json
+++ /dev/null
@@ -1,4 +0,0 @@
-[ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
- "ccccccccccccccccccccccc",
- "dddddddddddddddddddddddddddddddddddddddddddddddddddd" ] \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_basic_01.expected b/lib/jsoncpp/test/data/test_basic_01.expected
deleted file mode 100644
index d761fce1cc..0000000000
--- a/lib/jsoncpp/test/data/test_basic_01.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=123456789
diff --git a/lib/jsoncpp/test/data/test_basic_01.json b/lib/jsoncpp/test/data/test_basic_01.json
deleted file mode 100644
index 11f11f9be3..0000000000
--- a/lib/jsoncpp/test/data/test_basic_01.json
+++ /dev/null
@@ -1 +0,0 @@
-0123456789
diff --git a/lib/jsoncpp/test/data/test_basic_02.expected b/lib/jsoncpp/test/data/test_basic_02.expected
deleted file mode 100644
index 650e37cbaa..0000000000
--- a/lib/jsoncpp/test/data/test_basic_02.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=-123456789
diff --git a/lib/jsoncpp/test/data/test_basic_02.json b/lib/jsoncpp/test/data/test_basic_02.json
deleted file mode 100644
index bf11bceac7..0000000000
--- a/lib/jsoncpp/test/data/test_basic_02.json
+++ /dev/null
@@ -1 +0,0 @@
--0123456789
diff --git a/lib/jsoncpp/test/data/test_basic_03.expected b/lib/jsoncpp/test/data/test_basic_03.expected
deleted file mode 100644
index 1da2d395b8..0000000000
--- a/lib/jsoncpp/test/data/test_basic_03.expected
+++ /dev/null
@@ -1,3 +0,0 @@
-.=1.2345678
-
-
diff --git a/lib/jsoncpp/test/data/test_basic_03.json b/lib/jsoncpp/test/data/test_basic_03.json
deleted file mode 100644
index a92b6bd28b..0000000000
--- a/lib/jsoncpp/test/data/test_basic_03.json
+++ /dev/null
@@ -1,3 +0,0 @@
-1.2345678
-
-
diff --git a/lib/jsoncpp/test/data/test_basic_04.expected b/lib/jsoncpp/test/data/test_basic_04.expected
deleted file mode 100644
index 013f424f93..0000000000
--- a/lib/jsoncpp/test/data/test_basic_04.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.="abcdef"
-
diff --git a/lib/jsoncpp/test/data/test_basic_04.json b/lib/jsoncpp/test/data/test_basic_04.json
deleted file mode 100644
index 17eeb99e0b..0000000000
--- a/lib/jsoncpp/test/data/test_basic_04.json
+++ /dev/null
@@ -1,2 +0,0 @@
-"abcdef"
-
diff --git a/lib/jsoncpp/test/data/test_basic_05.expected b/lib/jsoncpp/test/data/test_basic_05.expected
deleted file mode 100644
index c8db822e58..0000000000
--- a/lib/jsoncpp/test/data/test_basic_05.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=null
-
diff --git a/lib/jsoncpp/test/data/test_basic_05.json b/lib/jsoncpp/test/data/test_basic_05.json
deleted file mode 100644
index d0aaea2126..0000000000
--- a/lib/jsoncpp/test/data/test_basic_05.json
+++ /dev/null
@@ -1,2 +0,0 @@
-null
-
diff --git a/lib/jsoncpp/test/data/test_basic_06.expected b/lib/jsoncpp/test/data/test_basic_06.expected
deleted file mode 100644
index 49be55a965..0000000000
--- a/lib/jsoncpp/test/data/test_basic_06.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=true
-
diff --git a/lib/jsoncpp/test/data/test_basic_06.json b/lib/jsoncpp/test/data/test_basic_06.json
deleted file mode 100644
index 7eead1ee75..0000000000
--- a/lib/jsoncpp/test/data/test_basic_06.json
+++ /dev/null
@@ -1,2 +0,0 @@
-true
-
diff --git a/lib/jsoncpp/test/data/test_basic_07.expected b/lib/jsoncpp/test/data/test_basic_07.expected
deleted file mode 100644
index fe55a6a854..0000000000
--- a/lib/jsoncpp/test/data/test_basic_07.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=false
-
diff --git a/lib/jsoncpp/test/data/test_basic_07.json b/lib/jsoncpp/test/data/test_basic_07.json
deleted file mode 100644
index a864bc487d..0000000000
--- a/lib/jsoncpp/test/data/test_basic_07.json
+++ /dev/null
@@ -1,2 +0,0 @@
-false
-
diff --git a/lib/jsoncpp/test/data/test_basic_08.expected b/lib/jsoncpp/test/data/test_basic_08.expected
deleted file mode 100644
index c8db822e58..0000000000
--- a/lib/jsoncpp/test/data/test_basic_08.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=null
-
diff --git a/lib/jsoncpp/test/data/test_basic_08.json b/lib/jsoncpp/test/data/test_basic_08.json
deleted file mode 100644
index fd78837c0c..0000000000
--- a/lib/jsoncpp/test/data/test_basic_08.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// C++ style comment
-null
-
diff --git a/lib/jsoncpp/test/data/test_basic_09.expected b/lib/jsoncpp/test/data/test_basic_09.expected
deleted file mode 100644
index c8db822e58..0000000000
--- a/lib/jsoncpp/test/data/test_basic_09.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=null
-
diff --git a/lib/jsoncpp/test/data/test_basic_09.json b/lib/jsoncpp/test/data/test_basic_09.json
deleted file mode 100644
index fc95f0f514..0000000000
--- a/lib/jsoncpp/test/data/test_basic_09.json
+++ /dev/null
@@ -1,4 +0,0 @@
-/* C style comment
- */
-null
-
diff --git a/lib/jsoncpp/test/data/test_comment_01.expected b/lib/jsoncpp/test/data/test_comment_01.expected
deleted file mode 100644
index 2a7f00c450..0000000000
--- a/lib/jsoncpp/test/data/test_comment_01.expected
+++ /dev/null
@@ -1,8 +0,0 @@
-.={}
-.test=[]
-.test[0]={}
-.test[0].a="aaa"
-.test[1]={}
-.test[1].b="bbb"
-.test[2]={}
-.test[2].c="ccc"
diff --git a/lib/jsoncpp/test/data/test_comment_01.json b/lib/jsoncpp/test/data/test_comment_01.json
deleted file mode 100644
index 7363490a91..0000000000
--- a/lib/jsoncpp/test/data/test_comment_01.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "test":
- [
- { "a" : "aaa" }, // Comment for a
- { "b" : "bbb" }, // Comment for b
- { "c" : "ccc" } // Comment for c
- ]
-}
diff --git a/lib/jsoncpp/test/data/test_complex_01.expected b/lib/jsoncpp/test/data/test_complex_01.expected
deleted file mode 100644
index 7573c8812d..0000000000
--- a/lib/jsoncpp/test/data/test_complex_01.expected
+++ /dev/null
@@ -1,20 +0,0 @@
-.={}
-.attribute=[]
-.attribute[0]="random"
-.attribute[1]="short"
-.attribute[2]="bold"
-.attribute[3]=12
-.attribute[4]={}
-.attribute[4].height=7
-.attribute[4].width=64
-.count=1234
-.name={}
-.name.aka="T.E.S.T."
-.name.id=123987
-.test={}
-.test.1={}
-.test.1.2={}
-.test.1.2.3={}
-.test.1.2.3.coord=[]
-.test.1.2.3.coord[0]=1
-.test.1.2.3.coord[1]=2
diff --git a/lib/jsoncpp/test/data/test_complex_01.json b/lib/jsoncpp/test/data/test_complex_01.json
deleted file mode 100644
index cc0f30f5c3..0000000000
--- a/lib/jsoncpp/test/data/test_complex_01.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "count" : 1234,
- "name" : { "aka" : "T.E.S.T.", "id" : 123987 },
- "attribute" : [
- "random",
- "short",
- "bold",
- 12,
- { "height" : 7, "width" : 64 }
- ],
- "test": { "1" :
- { "2" :
- { "3" : { "coord" : [ 1,2] }
- }
- }
- }
-}
diff --git a/lib/jsoncpp/test/data/test_integer_01.expected b/lib/jsoncpp/test/data/test_integer_01.expected
deleted file mode 100644
index 593f1db32b..0000000000
--- a/lib/jsoncpp/test/data/test_integer_01.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=2147483647
diff --git a/lib/jsoncpp/test/data/test_integer_01.json b/lib/jsoncpp/test/data/test_integer_01.json
deleted file mode 100644
index 5ab12ffee4..0000000000
--- a/lib/jsoncpp/test/data/test_integer_01.json
+++ /dev/null
@@ -1,2 +0,0 @@
-// Max signed integer
-2147483647
diff --git a/lib/jsoncpp/test/data/test_integer_02.expected b/lib/jsoncpp/test/data/test_integer_02.expected
deleted file mode 100644
index 4b83bd7cae..0000000000
--- a/lib/jsoncpp/test/data/test_integer_02.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=-2147483648
diff --git a/lib/jsoncpp/test/data/test_integer_02.json b/lib/jsoncpp/test/data/test_integer_02.json
deleted file mode 100644
index 056c850065..0000000000
--- a/lib/jsoncpp/test/data/test_integer_02.json
+++ /dev/null
@@ -1,2 +0,0 @@
-// Min signed integer
--2147483648
diff --git a/lib/jsoncpp/test/data/test_integer_03.expected b/lib/jsoncpp/test/data/test_integer_03.expected
deleted file mode 100644
index 37c1cb146b..0000000000
--- a/lib/jsoncpp/test/data/test_integer_03.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=4294967295
diff --git a/lib/jsoncpp/test/data/test_integer_03.json b/lib/jsoncpp/test/data/test_integer_03.json
deleted file mode 100644
index 12ef3fbb89..0000000000
--- a/lib/jsoncpp/test/data/test_integer_03.json
+++ /dev/null
@@ -1,2 +0,0 @@
-// Max unsigned integer
-4294967295
diff --git a/lib/jsoncpp/test/data/test_integer_04.expected b/lib/jsoncpp/test/data/test_integer_04.expected
deleted file mode 100644
index b7b548e3d3..0000000000
--- a/lib/jsoncpp/test/data/test_integer_04.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=0
-
diff --git a/lib/jsoncpp/test/data/test_integer_04.json b/lib/jsoncpp/test/data/test_integer_04.json
deleted file mode 100644
index bf81499453..0000000000
--- a/lib/jsoncpp/test/data/test_integer_04.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// Min unsigned integer
-0
-
diff --git a/lib/jsoncpp/test/data/test_integer_05.expected b/lib/jsoncpp/test/data/test_integer_05.expected
deleted file mode 100644
index 0caea9d3fd..0000000000
--- a/lib/jsoncpp/test/data/test_integer_05.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=1
-
diff --git a/lib/jsoncpp/test/data/test_integer_05.json b/lib/jsoncpp/test/data/test_integer_05.json
deleted file mode 100644
index d474e1b4d6..0000000000
--- a/lib/jsoncpp/test/data/test_integer_05.json
+++ /dev/null
@@ -1,2 +0,0 @@
-1
-
diff --git a/lib/jsoncpp/test/data/test_integer_06_64bits.expected b/lib/jsoncpp/test/data/test_integer_06_64bits.expected
deleted file mode 100644
index 131b085ff5..0000000000
--- a/lib/jsoncpp/test/data/test_integer_06_64bits.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=9223372036854775808
diff --git a/lib/jsoncpp/test/data/test_integer_06_64bits.json b/lib/jsoncpp/test/data/test_integer_06_64bits.json
deleted file mode 100644
index cfedfe5e80..0000000000
--- a/lib/jsoncpp/test/data/test_integer_06_64bits.json
+++ /dev/null
@@ -1,2 +0,0 @@
-9223372036854775808
-
diff --git a/lib/jsoncpp/test/data/test_integer_07_64bits.expected b/lib/jsoncpp/test/data/test_integer_07_64bits.expected
deleted file mode 100644
index c8524a32c7..0000000000
--- a/lib/jsoncpp/test/data/test_integer_07_64bits.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=-9223372036854775808
diff --git a/lib/jsoncpp/test/data/test_integer_07_64bits.json b/lib/jsoncpp/test/data/test_integer_07_64bits.json
deleted file mode 100644
index a964ad2ed2..0000000000
--- a/lib/jsoncpp/test/data/test_integer_07_64bits.json
+++ /dev/null
@@ -1,2 +0,0 @@
--9223372036854775808
-
diff --git a/lib/jsoncpp/test/data/test_integer_08_64bits.expected b/lib/jsoncpp/test/data/test_integer_08_64bits.expected
deleted file mode 100644
index 321bba5a73..0000000000
--- a/lib/jsoncpp/test/data/test_integer_08_64bits.expected
+++ /dev/null
@@ -1 +0,0 @@
-.=18446744073709551615
diff --git a/lib/jsoncpp/test/data/test_integer_08_64bits.json b/lib/jsoncpp/test/data/test_integer_08_64bits.json
deleted file mode 100644
index 4c15a01b4a..0000000000
--- a/lib/jsoncpp/test/data/test_integer_08_64bits.json
+++ /dev/null
@@ -1,2 +0,0 @@
-18446744073709551615
-
diff --git a/lib/jsoncpp/test/data/test_large_01.expected b/lib/jsoncpp/test/data/test_large_01.expected
deleted file mode 100644
index ee2fafc010..0000000000
--- a/lib/jsoncpp/test/data/test_large_01.expected
+++ /dev/null
@@ -1,2122 +0,0 @@
-.=[]
-.[0]=[]
-.[0][0]="A"
-.[0][1]=0
-.[0][2]=1
-.[0][3]=2
-.[0][4]=3
-.[0][5]=4
-.[0][6]=5
-.[0][7]=6
-.[0][8]=7
-.[0][9]=8
-.[0][10]=9
-.[0][11]=10
-.[0][12]=11
-.[0][13]=12
-.[0][14]=13
-.[0][15]=14
-.[0][16]=15
-.[0][17]=16
-.[0][18]=17
-.[0][19]=18
-.[0][20]=19
-.[0][21]=20
-.[0][22]=21
-.[0][23]=22
-.[0][24]=23
-.[0][25]=24
-.[0][26]=25
-.[0][27]=26
-.[0][28]=27
-.[0][29]=28
-.[0][30]=29
-.[0][31]=30
-.[0][32]=31
-.[0][33]=32
-.[0][34]=33
-.[0][35]=34
-.[0][36]=35
-.[0][37]=36
-.[0][38]=37
-.[0][39]=38
-.[0][40]=39
-.[0][41]=40
-.[0][42]=41
-.[0][43]=42
-.[0][44]=43
-.[0][45]=44
-.[0][46]=45
-.[0][47]=46
-.[0][48]=47
-.[0][49]=48
-.[0][50]=49
-.[0][51]=50
-.[0][52]=51
-.[0][53]=52
-.[0][54]=53
-.[0][55]=54
-.[0][56]=55
-.[0][57]=56
-.[0][58]=57
-.[0][59]=58
-.[0][60]=59
-.[0][61]=60
-.[0][62]=61
-.[0][63]=62
-.[0][64]=63
-.[0][65]=64
-.[0][66]=65
-.[0][67]=66
-.[0][68]=67
-.[0][69]=68
-.[0][70]=69
-.[0][71]=70
-.[0][72]=71
-.[0][73]=72
-.[0][74]=73
-.[0][75]=74
-.[0][76]=75
-.[0][77]=76
-.[0][78]=77
-.[0][79]=78
-.[0][80]=79
-.[0][81]=80
-.[0][82]=81
-.[0][83]=82
-.[0][84]=83
-.[0][85]=84
-.[0][86]=85
-.[0][87]=86
-.[0][88]=87
-.[0][89]=88
-.[0][90]=89
-.[0][91]=90
-.[0][92]=91
-.[0][93]=92
-.[0][94]=93
-.[0][95]=94
-.[0][96]=95
-.[0][97]=96
-.[0][98]=97
-.[0][99]=98
-.[0][100]=99
-.[0][101]=100
-.[0][102]=101
-.[0][103]=102
-.[0][104]=103
-.[0][105]=104
-.[0][106]=105
-.[0][107]=106
-.[0][108]=107
-.[0][109]=108
-.[0][110]=109
-.[0][111]=110
-.[0][112]=111
-.[0][113]=112
-.[0][114]=113
-.[0][115]=114
-.[0][116]=115
-.[0][117]=116
-.[0][118]=117
-.[0][119]=118
-.[0][120]=119
-.[0][121]=120
-.[0][122]=121
-.[0][123]=122
-.[0][124]=123
-.[0][125]=124
-.[0][126]=125
-.[0][127]=126
-.[0][128]=127
-.[0][129]=128
-.[0][130]=129
-.[0][131]=130
-.[0][132]=131
-.[0][133]=132
-.[0][134]=133
-.[0][135]=134
-.[0][136]=135
-.[0][137]=136
-.[0][138]=137
-.[0][139]=138
-.[0][140]=139
-.[0][141]=140
-.[0][142]=141
-.[0][143]=142
-.[0][144]=143
-.[0][145]=144
-.[0][146]=145
-.[0][147]=146
-.[0][148]=147
-.[0][149]=148
-.[0][150]=149
-.[0][151]=150
-.[0][152]=151
-.[0][153]=152
-.[0][154]=153
-.[0][155]=154
-.[0][156]=155
-.[0][157]=156
-.[0][158]=157
-.[0][159]=158
-.[0][160]=159
-.[0][161]=160
-.[0][162]=161
-.[0][163]=162
-.[0][164]=163
-.[0][165]=164
-.[0][166]=165
-.[0][167]=166
-.[0][168]=167
-.[0][169]=168
-.[0][170]=169
-.[0][171]=170
-.[0][172]=171
-.[0][173]=172
-.[0][174]=173
-.[0][175]=174
-.[0][176]=175
-.[0][177]=176
-.[0][178]=177
-.[0][179]=178
-.[0][180]=179
-.[0][181]=180
-.[0][182]=181
-.[0][183]=182
-.[0][184]=183
-.[0][185]=184
-.[0][186]=185
-.[0][187]=186
-.[0][188]=187
-.[0][189]=188
-.[0][190]=189
-.[0][191]=190
-.[0][192]=191
-.[0][193]=192
-.[0][194]=193
-.[0][195]=194
-.[0][196]=195
-.[0][197]=196
-.[0][198]=197
-.[0][199]=198
-.[0][200]=199
-.[0][201]=200
-.[0][202]=201
-.[0][203]=202
-.[0][204]=203
-.[0][205]=204
-.[0][206]=205
-.[0][207]=206
-.[0][208]=207
-.[0][209]=208
-.[0][210]=209
-.[0][211]=210
-.[0][212]=211
-.[0][213]=212
-.[0][214]=213
-.[0][215]=214
-.[0][216]=215
-.[0][217]=216
-.[0][218]=217
-.[0][219]=218
-.[0][220]=219
-.[0][221]=220
-.[0][222]=221
-.[0][223]=222
-.[0][224]=223
-.[0][225]=224
-.[0][226]=225
-.[0][227]=226
-.[0][228]=227
-.[0][229]=228
-.[0][230]=229
-.[0][231]=230
-.[0][232]=231
-.[0][233]=232
-.[0][234]=233
-.[0][235]=234
-.[0][236]=235
-.[0][237]=236
-.[0][238]=237
-.[0][239]=238
-.[0][240]=239
-.[0][241]=240
-.[0][242]=241
-.[0][243]=242
-.[0][244]=243
-.[0][245]=244
-.[0][246]=245
-.[0][247]=246
-.[0][248]=247
-.[0][249]=248
-.[0][250]=249
-.[0][251]=250
-.[0][252]=251
-.[0][253]=252
-.[0][254]=253
-.[0][255]=254
-.[0][256]=255
-.[0][257]=256
-.[0][258]=257
-.[0][259]=258
-.[0][260]=259
-.[0][261]=260
-.[0][262]=261
-.[0][263]=262
-.[0][264]=263
-.[0][265]=264
-.[0][266]=265
-.[0][267]=266
-.[0][268]=267
-.[0][269]=268
-.[0][270]=269
-.[0][271]=270
-.[0][272]=271
-.[0][273]=272
-.[0][274]=273
-.[0][275]=274
-.[0][276]=275
-.[0][277]=276
-.[0][278]=277
-.[0][279]=278
-.[0][280]=279
-.[0][281]=280
-.[0][282]=281
-.[0][283]=282
-.[0][284]=283
-.[0][285]=284
-.[0][286]=285
-.[0][287]=286
-.[0][288]=287
-.[0][289]=288
-.[0][290]=289
-.[0][291]=290
-.[0][292]=291
-.[0][293]=292
-.[0][294]=293
-.[0][295]=294
-.[0][296]=295
-.[0][297]=296
-.[0][298]=297
-.[0][299]=298
-.[0][300]=299
-.[0][301]=300
-.[0][302]=301
-.[0][303]=302
-.[0][304]=303
-.[0][305]=304
-.[0][306]=305
-.[0][307]=306
-.[0][308]=307
-.[0][309]=308
-.[0][310]=309
-.[0][311]=310
-.[0][312]=311
-.[0][313]=312
-.[0][314]=313
-.[0][315]=314
-.[0][316]=315
-.[0][317]=316
-.[0][318]=317
-.[0][319]=318
-.[0][320]=319
-.[0][321]=320
-.[0][322]=321
-.[0][323]=322
-.[0][324]=323
-.[0][325]=324
-.[0][326]=325
-.[0][327]=326
-.[0][328]=327
-.[0][329]=328
-.[0][330]=329
-.[0][331]=330
-.[0][332]=331
-.[0][333]=332
-.[0][334]=333
-.[0][335]=334
-.[0][336]=335
-.[0][337]=336
-.[0][338]=337
-.[0][339]=338
-.[0][340]=339
-.[0][341]=340
-.[0][342]=341
-.[0][343]=342
-.[0][344]=343
-.[0][345]=344
-.[0][346]=345
-.[0][347]=346
-.[0][348]=347
-.[0][349]=348
-.[0][350]=349
-.[0][351]=350
-.[0][352]=351
-.[0][353]=352
-.[0][354]=353
-.[0][355]=354
-.[0][356]=355
-.[0][357]=356
-.[0][358]=357
-.[0][359]=358
-.[0][360]=359
-.[0][361]=360
-.[0][362]=361
-.[0][363]=362
-.[0][364]=363
-.[0][365]=364
-.[0][366]=365
-.[0][367]=366
-.[0][368]=367
-.[0][369]=368
-.[0][370]=369
-.[0][371]=370
-.[0][372]=371
-.[0][373]=372
-.[0][374]=373
-.[0][375]=374
-.[0][376]=375
-.[0][377]=376
-.[0][378]=377
-.[0][379]=378
-.[0][380]=379
-.[0][381]=380
-.[0][382]=381
-.[0][383]=382
-.[0][384]=383
-.[0][385]=384
-.[0][386]=385
-.[0][387]=386
-.[0][388]=387
-.[0][389]=388
-.[0][390]=389
-.[0][391]=390
-.[0][392]=391
-.[0][393]=392
-.[0][394]=393
-.[0][395]=394
-.[0][396]=395
-.[0][397]=396
-.[0][398]=397
-.[0][399]=398
-.[0][400]=399
-.[0][401]=400
-.[0][402]=401
-.[0][403]=402
-.[0][404]=403
-.[0][405]=404
-.[0][406]=405
-.[0][407]=406
-.[0][408]=407
-.[0][409]=408
-.[0][410]=409
-.[0][411]=410
-.[0][412]=411
-.[0][413]=412
-.[0][414]=413
-.[0][415]=414
-.[0][416]=415
-.[0][417]=416
-.[0][418]=417
-.[0][419]=418
-.[0][420]=419
-.[0][421]=420
-.[0][422]=421
-.[0][423]=422
-.[0][424]=423
-.[0][425]=424
-.[0][426]=425
-.[0][427]=426
-.[0][428]=427
-.[0][429]=428
-.[0][430]=429
-.[0][431]=430
-.[0][432]=431
-.[0][433]=432
-.[0][434]=433
-.[0][435]=434
-.[0][436]=435
-.[0][437]=436
-.[0][438]=437
-.[0][439]=438
-.[0][440]=439
-.[0][441]=440
-.[0][442]=441
-.[0][443]=442
-.[0][444]=443
-.[0][445]=444
-.[0][446]=445
-.[0][447]=446
-.[0][448]=447
-.[0][449]=448
-.[0][450]=449
-.[0][451]=450
-.[0][452]=451
-.[0][453]=452
-.[0][454]=453
-.[0][455]=454
-.[0][456]=455
-.[0][457]=456
-.[0][458]=457
-.[0][459]=458
-.[0][460]=459
-.[0][461]=460
-.[0][462]=461
-.[0][463]=462
-.[0][464]=463
-.[0][465]=464
-.[0][466]=465
-.[0][467]=466
-.[0][468]=467
-.[0][469]=468
-.[0][470]=469
-.[0][471]=470
-.[0][472]=471
-.[0][473]=472
-.[0][474]=473
-.[0][475]=474
-.[0][476]=475
-.[0][477]=476
-.[0][478]=477
-.[0][479]=478
-.[0][480]=479
-.[0][481]=480
-.[0][482]=481
-.[0][483]=482
-.[0][484]=483
-.[0][485]=484
-.[0][486]=485
-.[0][487]=486
-.[0][488]=487
-.[0][489]=488
-.[0][490]=489
-.[0][491]=490
-.[0][492]=491
-.[0][493]=492
-.[0][494]=493
-.[0][495]=494
-.[0][496]=495
-.[0][497]=496
-.[0][498]=497
-.[0][499]=498
-.[0][500]=499
-.[0][501]=500
-.[0][502]=501
-.[0][503]=502
-.[0][504]=503
-.[0][505]=504
-.[0][506]=505
-.[0][507]=506
-.[0][508]=507
-.[0][509]=508
-.[0][510]=509
-.[0][511]=510
-.[0][512]=511
-.[0][513]=512
-.[0][514]=513
-.[0][515]=514
-.[0][516]=515
-.[0][517]=516
-.[0][518]=517
-.[0][519]=518
-.[0][520]=519
-.[0][521]=520
-.[0][522]=521
-.[0][523]=522
-.[0][524]=523
-.[0][525]=524
-.[0][526]=525
-.[0][527]=526
-.[0][528]=527
-.[0][529]=528
-.[0][530]=529
-.[0][531]=530
-.[0][532]=531
-.[0][533]=532
-.[0][534]=533
-.[0][535]=534
-.[0][536]=535
-.[0][537]=536
-.[0][538]=537
-.[0][539]=538
-.[0][540]=539
-.[0][541]=540
-.[0][542]=541
-.[0][543]=542
-.[0][544]=543
-.[0][545]=544
-.[0][546]=545
-.[0][547]=546
-.[0][548]=547
-.[0][549]=548
-.[0][550]=549
-.[0][551]=550
-.[0][552]=551
-.[0][553]=552
-.[0][554]=553
-.[0][555]=554
-.[0][556]=555
-.[0][557]=556
-.[0][558]=557
-.[0][559]=558
-.[0][560]=559
-.[0][561]=560
-.[0][562]=561
-.[0][563]=562
-.[0][564]=563
-.[0][565]=564
-.[0][566]=565
-.[0][567]=566
-.[0][568]=567
-.[0][569]=568
-.[0][570]=569
-.[0][571]=570
-.[0][572]=571
-.[0][573]=572
-.[0][574]=573
-.[0][575]=574
-.[0][576]=575
-.[0][577]=576
-.[0][578]=577
-.[0][579]=578
-.[0][580]=579
-.[0][581]=580
-.[0][582]=581
-.[0][583]=582
-.[0][584]=583
-.[0][585]=584
-.[0][586]=585
-.[0][587]=586
-.[0][588]=587
-.[0][589]=588
-.[0][590]=589
-.[0][591]=590
-.[0][592]=591
-.[0][593]=592
-.[0][594]=593
-.[0][595]=594
-.[0][596]=595
-.[0][597]=596
-.[0][598]=597
-.[0][599]=598
-.[0][600]=599
-.[0][601]=600
-.[0][602]=601
-.[0][603]=602
-.[0][604]=603
-.[0][605]=604
-.[0][606]=605
-.[0][607]=606
-.[0][608]=607
-.[0][609]=608
-.[0][610]=609
-.[0][611]=610
-.[0][612]=611
-.[0][613]=612
-.[0][614]=613
-.[0][615]=614
-.[0][616]=615
-.[0][617]=616
-.[0][618]=617
-.[0][619]=618
-.[0][620]=619
-.[0][621]=620
-.[0][622]=621
-.[0][623]=622
-.[0][624]=623
-.[0][625]=624
-.[0][626]=625
-.[0][627]=626
-.[0][628]=627
-.[0][629]=628
-.[0][630]=629
-.[0][631]=630
-.[0][632]=631
-.[0][633]=632
-.[0][634]=633
-.[0][635]=634
-.[0][636]=635
-.[0][637]=636
-.[0][638]=637
-.[0][639]=638
-.[0][640]=639
-.[0][641]=640
-.[0][642]=641
-.[0][643]=642
-.[0][644]=643
-.[0][645]=644
-.[0][646]=645
-.[0][647]=646
-.[0][648]=647
-.[0][649]=648
-.[0][650]=649
-.[0][651]=650
-.[0][652]=651
-.[0][653]=652
-.[0][654]=653
-.[0][655]=654
-.[0][656]=655
-.[0][657]=656
-.[0][658]=657
-.[0][659]=658
-.[0][660]=659
-.[0][661]=660
-.[0][662]=661
-.[0][663]=662
-.[0][664]=663
-.[0][665]=664
-.[0][666]=665
-.[0][667]=666
-.[0][668]=667
-.[0][669]=668
-.[0][670]=669
-.[0][671]=670
-.[0][672]=671
-.[0][673]=672
-.[0][674]=673
-.[0][675]=674
-.[0][676]=675
-.[0][677]=676
-.[0][678]=677
-.[0][679]=678
-.[0][680]=679
-.[0][681]=680
-.[0][682]=681
-.[0][683]=682
-.[0][684]=683
-.[0][685]=684
-.[0][686]=685
-.[0][687]=686
-.[0][688]=687
-.[0][689]=688
-.[0][690]=689
-.[0][691]=690
-.[0][692]=691
-.[0][693]=692
-.[0][694]=693
-.[0][695]=694
-.[0][696]=695
-.[0][697]=696
-.[0][698]=697
-.[0][699]=698
-.[0][700]=699
-.[0][701]=700
-.[0][702]=701
-.[0][703]=702
-.[0][704]=703
-.[0][705]=704
-.[0][706]=705
-.[0][707]=706
-.[0][708]=707
-.[0][709]=708
-.[0][710]=709
-.[0][711]=710
-.[0][712]=711
-.[0][713]=712
-.[0][714]=713
-.[0][715]=714
-.[0][716]=715
-.[0][717]=716
-.[0][718]=717
-.[0][719]=718
-.[0][720]=719
-.[0][721]=720
-.[0][722]=721
-.[0][723]=722
-.[0][724]=723
-.[0][725]=724
-.[0][726]=725
-.[0][727]=726
-.[0][728]=727
-.[0][729]=728
-.[0][730]=729
-.[0][731]=730
-.[0][732]=731
-.[0][733]=732
-.[0][734]=733
-.[0][735]=734
-.[0][736]=735
-.[0][737]=736
-.[0][738]=737
-.[0][739]=738
-.[0][740]=739
-.[0][741]=740
-.[0][742]=741
-.[0][743]=742
-.[0][744]=743
-.[0][745]=744
-.[0][746]=745
-.[0][747]=746
-.[0][748]=747
-.[0][749]=748
-.[0][750]=749
-.[0][751]=750
-.[0][752]=751
-.[0][753]=752
-.[0][754]=753
-.[0][755]=754
-.[0][756]=755
-.[0][757]=756
-.[0][758]=757
-.[0][759]=758
-.[0][760]=759
-.[0][761]=760
-.[0][762]=761
-.[0][763]=762
-.[0][764]=763
-.[0][765]=764
-.[0][766]=765
-.[0][767]=766
-.[0][768]=767
-.[0][769]=768
-.[0][770]=769
-.[0][771]=770
-.[0][772]=771
-.[0][773]=772
-.[0][774]=773
-.[0][775]=774
-.[0][776]=775
-.[0][777]=776
-.[0][778]=777
-.[0][779]=778
-.[0][780]=779
-.[0][781]=780
-.[0][782]=781
-.[0][783]=782
-.[0][784]=783
-.[0][785]=784
-.[0][786]=785
-.[0][787]=786
-.[0][788]=787
-.[0][789]=788
-.[0][790]=789
-.[0][791]=790
-.[0][792]=791
-.[0][793]=792
-.[0][794]=793
-.[0][795]=794
-.[0][796]=795
-.[0][797]=796
-.[0][798]=797
-.[0][799]=798
-.[0][800]=799
-.[0][801]=800
-.[0][802]=801
-.[0][803]=802
-.[0][804]=803
-.[0][805]=804
-.[0][806]=805
-.[0][807]=806
-.[0][808]=807
-.[0][809]=808
-.[0][810]=809
-.[0][811]=810
-.[0][812]=811
-.[0][813]=812
-.[0][814]=813
-.[0][815]=814
-.[0][816]=815
-.[0][817]=816
-.[0][818]=817
-.[0][819]=818
-.[0][820]=819
-.[0][821]=820
-.[0][822]=821
-.[0][823]=822
-.[0][824]=823
-.[0][825]=824
-.[0][826]=825
-.[0][827]=826
-.[0][828]=827
-.[0][829]=828
-.[0][830]=829
-.[0][831]=830
-.[0][832]=831
-.[0][833]=832
-.[0][834]=833
-.[0][835]=834
-.[0][836]=835
-.[0][837]=836
-.[0][838]=837
-.[0][839]=838
-.[0][840]=839
-.[0][841]=840
-.[0][842]=841
-.[0][843]=842
-.[0][844]=843
-.[0][845]=844
-.[0][846]=845
-.[0][847]=846
-.[0][848]=847
-.[0][849]=848
-.[0][850]=849
-.[0][851]=850
-.[0][852]=851
-.[0][853]=852
-.[0][854]=853
-.[0][855]=854
-.[0][856]=855
-.[0][857]=856
-.[0][858]=857
-.[0][859]=858
-.[0][860]=859
-.[0][861]=860
-.[0][862]=861
-.[0][863]=862
-.[0][864]=863
-.[0][865]=864
-.[0][866]=865
-.[0][867]=866
-.[0][868]=867
-.[0][869]=868
-.[0][870]=869
-.[0][871]=870
-.[0][872]=871
-.[0][873]=872
-.[0][874]=873
-.[0][875]=874
-.[0][876]=875
-.[0][877]=876
-.[0][878]=877
-.[0][879]=878
-.[0][880]=879
-.[0][881]=880
-.[0][882]=881
-.[0][883]=882
-.[0][884]=883
-.[0][885]=884
-.[0][886]=885
-.[0][887]=886
-.[0][888]=887
-.[0][889]=888
-.[0][890]=889
-.[0][891]=890
-.[0][892]=891
-.[0][893]=892
-.[0][894]=893
-.[0][895]=894
-.[0][896]=895
-.[0][897]=896
-.[0][898]=897
-.[0][899]=898
-.[0][900]=899
-.[0][901]=900
-.[0][902]=901
-.[0][903]=902
-.[0][904]=903
-.[0][905]=904
-.[0][906]=905
-.[0][907]=906
-.[0][908]=907
-.[0][909]=908
-.[0][910]=909
-.[0][911]=910
-.[0][912]=911
-.[0][913]=912
-.[0][914]=913
-.[0][915]=914
-.[0][916]=915
-.[0][917]=916
-.[0][918]=917
-.[0][919]=918
-.[0][920]=919
-.[0][921]=920
-.[0][922]=921
-.[0][923]=922
-.[0][924]=923
-.[0][925]=924
-.[0][926]=925
-.[0][927]=926
-.[0][928]=927
-.[0][929]=928
-.[0][930]=929
-.[0][931]=930
-.[0][932]=931
-.[0][933]=932
-.[0][934]=933
-.[0][935]=934
-.[0][936]=935
-.[0][937]=936
-.[0][938]=937
-.[0][939]=938
-.[0][940]=939
-.[0][941]=940
-.[0][942]=941
-.[0][943]=942
-.[0][944]=943
-.[0][945]=944
-.[0][946]=945
-.[0][947]=946
-.[0][948]=947
-.[0][949]=948
-.[0][950]=949
-.[0][951]=950
-.[0][952]=951
-.[0][953]=952
-.[0][954]=953
-.[0][955]=954
-.[0][956]=955
-.[0][957]=956
-.[0][958]=957
-.[0][959]=958
-.[0][960]=959
-.[0][961]=960
-.[0][962]=961
-.[0][963]=962
-.[0][964]=963
-.[0][965]=964
-.[0][966]=965
-.[0][967]=966
-.[0][968]=967
-.[0][969]=968
-.[0][970]=969
-.[0][971]=970
-.[0][972]=971
-.[0][973]=972
-.[0][974]=973
-.[0][975]=974
-.[0][976]=975
-.[0][977]=976
-.[0][978]=977
-.[0][979]=978
-.[0][980]=979
-.[0][981]=980
-.[0][982]=981
-.[0][983]=982
-.[0][984]=983
-.[0][985]=984
-.[0][986]=985
-.[0][987]=986
-.[0][988]=987
-.[0][989]=988
-.[0][990]=989
-.[0][991]=990
-.[0][992]=991
-.[0][993]=992
-.[0][994]=993
-.[0][995]=994
-.[0][996]=995
-.[0][997]=996
-.[0][998]=997
-.[0][999]=998
-.[0][1000]=999
-.[0][1001]=1000
-.[0][1002]=1001
-.[0][1003]=1002
-.[0][1004]=1003
-.[0][1005]=1004
-.[0][1006]=1005
-.[0][1007]=1006
-.[0][1008]=1007
-.[0][1009]=1008
-.[0][1010]=1009
-.[0][1011]=1010
-.[0][1012]=1011
-.[0][1013]=1012
-.[0][1014]=1013
-.[0][1015]=1014
-.[0][1016]=1015
-.[0][1017]=1016
-.[0][1018]=1017
-.[0][1019]=1018
-.[0][1020]=1019
-.[0][1021]=1020
-.[0][1022]=1021
-.[0][1023]=1022
-.[0][1024]=1023
-.[0][1025]=1024
-.[0][1026]=1025
-.[0][1027]=1026
-.[0][1028]=1027
-.[0][1029]=1028
-.[0][1030]=1029
-.[0][1031]=1030
-.[0][1032]=1031
-.[0][1033]=1032
-.[0][1034]=1033
-.[0][1035]=1034
-.[0][1036]=1035
-.[0][1037]=1036
-.[0][1038]=1037
-.[0][1039]=1038
-.[0][1040]=1039
-.[0][1041]=1040
-.[0][1042]=1041
-.[0][1043]=1042
-.[0][1044]=1043
-.[0][1045]=1044
-.[0][1046]=1045
-.[0][1047]=1046
-.[0][1048]=1047
-.[0][1049]=1048
-.[0][1050]=1049
-.[0][1051]=1050
-.[0][1052]=1051
-.[0][1053]=1052
-.[0][1054]=1053
-.[0][1055]=1054
-.[0][1056]=1055
-.[0][1057]=1056
-.[0][1058]=1057
-.[0][1059]=1058
-.[0][1060]=1059
-.[0][1061]=1060
-.[0][1062]=1061
-.[0][1063]=1062
-.[0][1064]=1063
-.[0][1065]=1064
-.[0][1066]=1065
-.[0][1067]=1066
-.[0][1068]=1067
-.[0][1069]=1068
-.[0][1070]=1069
-.[0][1071]=1070
-.[0][1072]=1071
-.[0][1073]=1072
-.[0][1074]=1073
-.[0][1075]=1074
-.[0][1076]=1075
-.[0][1077]=1076
-.[0][1078]=1077
-.[0][1079]=1078
-.[0][1080]=1079
-.[0][1081]=1080
-.[0][1082]=1081
-.[0][1083]=1082
-.[0][1084]=1083
-.[0][1085]=1084
-.[0][1086]=1085
-.[0][1087]=1086
-.[0][1088]=1087
-.[0][1089]=1088
-.[0][1090]=1089
-.[0][1091]=1090
-.[0][1092]=1091
-.[0][1093]=1092
-.[0][1094]=1093
-.[0][1095]=1094
-.[0][1096]=1095
-.[0][1097]=1096
-.[0][1098]=1097
-.[0][1099]=1098
-.[0][1100]=1099
-.[0][1101]=1100
-.[0][1102]=1101
-.[0][1103]=1102
-.[0][1104]=1103
-.[0][1105]=1104
-.[0][1106]=1105
-.[0][1107]=1106
-.[0][1108]=1107
-.[0][1109]=1108
-.[0][1110]=1109
-.[0][1111]=1110
-.[0][1112]=1111
-.[0][1113]=1112
-.[0][1114]=1113
-.[0][1115]=1114
-.[0][1116]=1115
-.[0][1117]=1116
-.[0][1118]=1117
-.[0][1119]=1118
-.[0][1120]=1119
-.[0][1121]=1120
-.[0][1122]=1121
-.[0][1123]=1122
-.[0][1124]=1123
-.[0][1125]=1124
-.[0][1126]=1125
-.[0][1127]=1126
-.[0][1128]=1127
-.[0][1129]=1128
-.[0][1130]=1129
-.[0][1131]=1130
-.[0][1132]=1131
-.[0][1133]=1132
-.[0][1134]=1133
-.[0][1135]=1134
-.[0][1136]=1135
-.[0][1137]=1136
-.[0][1138]=1137
-.[0][1139]=1138
-.[0][1140]=1139
-.[0][1141]=1140
-.[0][1142]=1141
-.[0][1143]=1142
-.[0][1144]=1143
-.[0][1145]=1144
-.[0][1146]=1145
-.[0][1147]=1146
-.[0][1148]=1147
-.[0][1149]=1148
-.[0][1150]=1149
-.[0][1151]=1150
-.[0][1152]=1151
-.[0][1153]=1152
-.[0][1154]=1153
-.[0][1155]=1154
-.[0][1156]=1155
-.[0][1157]=1156
-.[0][1158]=1157
-.[0][1159]=1158
-.[0][1160]=1159
-.[0][1161]=1160
-.[0][1162]=1161
-.[0][1163]=1162
-.[0][1164]=1163
-.[0][1165]=1164
-.[0][1166]=1165
-.[0][1167]=1166
-.[0][1168]=1167
-.[0][1169]=1168
-.[0][1170]=1169
-.[0][1171]=1170
-.[0][1172]=1171
-.[0][1173]=1172
-.[0][1174]=1173
-.[0][1175]=1174
-.[0][1176]=1175
-.[0][1177]=1176
-.[0][1178]=1177
-.[0][1179]=1178
-.[0][1180]=1179
-.[0][1181]=1180
-.[0][1182]=1181
-.[0][1183]=1182
-.[0][1184]=1183
-.[0][1185]=1184
-.[0][1186]=1185
-.[0][1187]=1186
-.[0][1188]=1187
-.[0][1189]=1188
-.[0][1190]=1189
-.[0][1191]=1190
-.[0][1192]=1191
-.[0][1193]=1192
-.[0][1194]=1193
-.[0][1195]=1194
-.[0][1196]=1195
-.[0][1197]=1196
-.[0][1198]=1197
-.[0][1199]=1198
-.[0][1200]=1199
-.[0][1201]=1200
-.[0][1202]=1201
-.[0][1203]=1202
-.[0][1204]=1203
-.[0][1205]=1204
-.[0][1206]=1205
-.[0][1207]=1206
-.[0][1208]=1207
-.[0][1209]=1208
-.[0][1210]=1209
-.[0][1211]=1210
-.[0][1212]=1211
-.[0][1213]=1212
-.[0][1214]=1213
-.[0][1215]=1214
-.[0][1216]=1215
-.[0][1217]=1216
-.[0][1218]=1217
-.[0][1219]=1218
-.[0][1220]=1219
-.[0][1221]=1220
-.[0][1222]=1221
-.[0][1223]=1222
-.[0][1224]=1223
-.[0][1225]=1224
-.[0][1226]=1225
-.[0][1227]=1226
-.[0][1228]=1227
-.[0][1229]=1228
-.[0][1230]=1229
-.[0][1231]=1230
-.[0][1232]=1231
-.[0][1233]=1232
-.[0][1234]=1233
-.[0][1235]=1234
-.[0][1236]=1235
-.[0][1237]=1236
-.[0][1238]=1237
-.[0][1239]=1238
-.[0][1240]=1239
-.[0][1241]=1240
-.[0][1242]=1241
-.[0][1243]=1242
-.[0][1244]=1243
-.[0][1245]=1244
-.[0][1246]=1245
-.[0][1247]=1246
-.[0][1248]=1247
-.[0][1249]=1248
-.[0][1250]=1249
-.[0][1251]=1250
-.[0][1252]=1251
-.[0][1253]=1252
-.[0][1254]=1253
-.[0][1255]=1254
-.[0][1256]=1255
-.[0][1257]=1256
-.[0][1258]=1257
-.[0][1259]=1258
-.[0][1260]=1259
-.[0][1261]=1260
-.[0][1262]=1261
-.[0][1263]=1262
-.[0][1264]=1263
-.[0][1265]=1264
-.[0][1266]=1265
-.[0][1267]=1266
-.[0][1268]=1267
-.[0][1269]=1268
-.[0][1270]=1269
-.[0][1271]=1270
-.[0][1272]=1271
-.[0][1273]=1272
-.[0][1274]=1273
-.[0][1275]=1274
-.[0][1276]=1275
-.[0][1277]=1276
-.[0][1278]=1277
-.[0][1279]=1278
-.[0][1280]=1279
-.[0][1281]=1280
-.[0][1282]=1281
-.[0][1283]=1282
-.[0][1284]=1283
-.[0][1285]=1284
-.[0][1286]=1285
-.[0][1287]=1286
-.[0][1288]=1287
-.[0][1289]=1288
-.[0][1290]=1289
-.[0][1291]=1290
-.[0][1292]=1291
-.[0][1293]=1292
-.[0][1294]=1293
-.[0][1295]=1294
-.[0][1296]=1295
-.[0][1297]=1296
-.[0][1298]=1297
-.[0][1299]=1298
-.[0][1300]=1299
-.[0][1301]=1300
-.[0][1302]=1301
-.[0][1303]=1302
-.[0][1304]=1303
-.[0][1305]=1304
-.[0][1306]=1305
-.[0][1307]=1306
-.[0][1308]=1307
-.[0][1309]=1308
-.[0][1310]=1309
-.[0][1311]=1310
-.[0][1312]=1311
-.[0][1313]=1312
-.[0][1314]=1313
-.[0][1315]=1314
-.[0][1316]=1315
-.[0][1317]=1316
-.[0][1318]=1317
-.[0][1319]=1318
-.[0][1320]=1319
-.[0][1321]=1320
-.[0][1322]=1321
-.[0][1323]=1322
-.[0][1324]=1323
-.[0][1325]=1324
-.[0][1326]=1325
-.[0][1327]=1326
-.[0][1328]=1327
-.[0][1329]=1328
-.[0][1330]=1329
-.[0][1331]=1330
-.[0][1332]=1331
-.[0][1333]=1332
-.[0][1334]=1333
-.[0][1335]=1334
-.[0][1336]=1335
-.[0][1337]=1336
-.[0][1338]=1337
-.[0][1339]=1338
-.[0][1340]=1339
-.[0][1341]=1340
-.[0][1342]=1341
-.[0][1343]=1342
-.[0][1344]=1343
-.[0][1345]=1344
-.[0][1346]=1345
-.[0][1347]=1346
-.[0][1348]=1347
-.[0][1349]=1348
-.[0][1350]=1349
-.[0][1351]=1350
-.[0][1352]=1351
-.[0][1353]=1352
-.[0][1354]=1353
-.[0][1355]=1354
-.[0][1356]=1355
-.[0][1357]=1356
-.[0][1358]=1357
-.[0][1359]=1358
-.[0][1360]=1359
-.[0][1361]=1360
-.[0][1362]=1361
-.[0][1363]=1362
-.[0][1364]=1363
-.[0][1365]=1364
-.[0][1366]=1365
-.[0][1367]=1366
-.[0][1368]=1367
-.[0][1369]=1368
-.[0][1370]=1369
-.[0][1371]=1370
-.[0][1372]=1371
-.[0][1373]=1372
-.[0][1374]=1373
-.[0][1375]=1374
-.[0][1376]=1375
-.[0][1377]=1376
-.[0][1378]=1377
-.[0][1379]=1378
-.[0][1380]=1379
-.[0][1381]=1380
-.[0][1382]=1381
-.[0][1383]=1382
-.[0][1384]=1383
-.[0][1385]=1384
-.[0][1386]=1385
-.[0][1387]=1386
-.[0][1388]=1387
-.[0][1389]=1388
-.[0][1390]=1389
-.[0][1391]=1390
-.[0][1392]=1391
-.[0][1393]=1392
-.[0][1394]=1393
-.[0][1395]=1394
-.[0][1396]=1395
-.[0][1397]=1396
-.[0][1398]=1397
-.[0][1399]=1398
-.[0][1400]=1399
-.[0][1401]=1400
-.[0][1402]=1401
-.[0][1403]=1402
-.[0][1404]=1403
-.[0][1405]=1404
-.[0][1406]=1405
-.[0][1407]=1406
-.[0][1408]=1407
-.[0][1409]=1408
-.[0][1410]=1409
-.[0][1411]=1410
-.[0][1412]=1411
-.[0][1413]=1412
-.[0][1414]=1413
-.[0][1415]=1414
-.[0][1416]=1415
-.[0][1417]=1416
-.[0][1418]=1417
-.[0][1419]=1418
-.[0][1420]=1419
-.[0][1421]=1420
-.[0][1422]=1421
-.[0][1423]=1422
-.[0][1424]=1423
-.[0][1425]=1424
-.[0][1426]=1425
-.[0][1427]=1426
-.[0][1428]=1427
-.[0][1429]=1428
-.[0][1430]=1429
-.[0][1431]=1430
-.[0][1432]=1431
-.[0][1433]=1432
-.[0][1434]=1433
-.[0][1435]=1434
-.[0][1436]=1435
-.[0][1437]=1436
-.[0][1438]=1437
-.[0][1439]=1438
-.[0][1440]=1439
-.[0][1441]=1440
-.[0][1442]=1441
-.[0][1443]=1442
-.[0][1444]=1443
-.[0][1445]=1444
-.[0][1446]=1445
-.[0][1447]=1446
-.[0][1448]=1447
-.[0][1449]=1448
-.[0][1450]=1449
-.[0][1451]=1450
-.[0][1452]=1451
-.[0][1453]=1452
-.[0][1454]=1453
-.[0][1455]=1454
-.[0][1456]=1455
-.[0][1457]=1456
-.[0][1458]=1457
-.[0][1459]=1458
-.[0][1460]=1459
-.[0][1461]=1460
-.[0][1462]=1461
-.[0][1463]=1462
-.[0][1464]=1463
-.[0][1465]=1464
-.[0][1466]=1465
-.[0][1467]=1466
-.[0][1468]=1467
-.[0][1469]=1468
-.[0][1470]=1469
-.[0][1471]=1470
-.[0][1472]=1471
-.[0][1473]=1472
-.[0][1474]=1473
-.[0][1475]=1474
-.[0][1476]=1475
-.[0][1477]=1476
-.[0][1478]=1477
-.[0][1479]=1478
-.[0][1480]=1479
-.[0][1481]=1480
-.[0][1482]=1481
-.[0][1483]=1482
-.[0][1484]=1483
-.[0][1485]=1484
-.[0][1486]=1485
-.[0][1487]=1486
-.[0][1488]=1487
-.[0][1489]=1488
-.[0][1490]=1489
-.[0][1491]=1490
-.[0][1492]=1491
-.[0][1493]=1492
-.[0][1494]=1493
-.[0][1495]=1494
-.[0][1496]=1495
-.[0][1497]=1496
-.[0][1498]=1497
-.[0][1499]=1498
-.[0][1500]=1499
-.[0][1501]=1500
-.[0][1502]=1501
-.[0][1503]=1502
-.[0][1504]=1503
-.[0][1505]=1504
-.[0][1506]=1505
-.[0][1507]=1506
-.[0][1508]=1507
-.[0][1509]=1508
-.[0][1510]=1509
-.[0][1511]=1510
-.[0][1512]=1511
-.[0][1513]=1512
-.[0][1514]=1513
-.[0][1515]=1514
-.[0][1516]=1515
-.[0][1517]=1516
-.[0][1518]=1517
-.[0][1519]=1518
-.[0][1520]=1519
-.[0][1521]=1520
-.[0][1522]=1521
-.[0][1523]=1522
-.[0][1524]=1523
-.[0][1525]=1524
-.[0][1526]=1525
-.[0][1527]=1526
-.[0][1528]=1527
-.[0][1529]=1528
-.[0][1530]=1529
-.[0][1531]=1530
-.[0][1532]=1531
-.[0][1533]=1532
-.[0][1534]=1533
-.[0][1535]=1534
-.[0][1536]=1535
-.[0][1537]=1536
-.[0][1538]=1537
-.[0][1539]=1538
-.[0][1540]=1539
-.[0][1541]=1540
-.[0][1542]=1541
-.[0][1543]=1542
-.[0][1544]=1543
-.[0][1545]=1544
-.[0][1546]=1545
-.[0][1547]=1546
-.[0][1548]=1547
-.[0][1549]=1548
-.[0][1550]=1549
-.[0][1551]=1550
-.[0][1552]=1551
-.[0][1553]=1552
-.[0][1554]=1553
-.[0][1555]=1554
-.[0][1556]=1555
-.[0][1557]=1556
-.[0][1558]=1557
-.[0][1559]=1558
-.[0][1560]=1559
-.[0][1561]=1560
-.[0][1562]=1561
-.[0][1563]=1562
-.[0][1564]=1563
-.[0][1565]=1564
-.[0][1566]=1565
-.[0][1567]=1566
-.[0][1568]=1567
-.[0][1569]=1568
-.[0][1570]=1569
-.[0][1571]=1570
-.[0][1572]=1571
-.[0][1573]=1572
-.[0][1574]=1573
-.[0][1575]=1574
-.[0][1576]=1575
-.[0][1577]=1576
-.[0][1578]=1577
-.[0][1579]=1578
-.[0][1580]=1579
-.[0][1581]=1580
-.[0][1582]=1581
-.[0][1583]=1582
-.[0][1584]=1583
-.[0][1585]=1584
-.[0][1586]=1585
-.[0][1587]=1586
-.[0][1588]=1587
-.[0][1589]=1588
-.[0][1590]=1589
-.[0][1591]=1590
-.[0][1592]=1591
-.[0][1593]=1592
-.[0][1594]=1593
-.[0][1595]=1594
-.[0][1596]=1595
-.[0][1597]=1596
-.[0][1598]=1597
-.[0][1599]=1598
-.[0][1600]=1599
-.[0][1601]=1600
-.[0][1602]=1601
-.[0][1603]=1602
-.[0][1604]=1603
-.[0][1605]=1604
-.[0][1606]=1605
-.[0][1607]=1606
-.[0][1608]=1607
-.[0][1609]=1608
-.[0][1610]=1609
-.[0][1611]=1610
-.[0][1612]=1611
-.[0][1613]=1612
-.[0][1614]=1613
-.[0][1615]=1614
-.[0][1616]=1615
-.[0][1617]=1616
-.[0][1618]=1617
-.[0][1619]=1618
-.[0][1620]=1619
-.[0][1621]=1620
-.[0][1622]=1621
-.[0][1623]=1622
-.[0][1624]=1623
-.[0][1625]=1624
-.[0][1626]=1625
-.[0][1627]=1626
-.[0][1628]=1627
-.[0][1629]=1628
-.[0][1630]=1629
-.[0][1631]=1630
-.[0][1632]=1631
-.[0][1633]=1632
-.[0][1634]=1633
-.[0][1635]=1634
-.[0][1636]=1635
-.[0][1637]=1636
-.[0][1638]=1637
-.[0][1639]=1638
-.[0][1640]=1639
-.[0][1641]=1640
-.[0][1642]=1641
-.[0][1643]=1642
-.[0][1644]=1643
-.[0][1645]=1644
-.[0][1646]=1645
-.[0][1647]=1646
-.[0][1648]=1647
-.[0][1649]=1648
-.[0][1650]=1649
-.[0][1651]=1650
-.[0][1652]=1651
-.[0][1653]=1652
-.[0][1654]=1653
-.[0][1655]=1654
-.[0][1656]=1655
-.[0][1657]=1656
-.[0][1658]=1657
-.[0][1659]=1658
-.[0][1660]=1659
-.[0][1661]=1660
-.[0][1662]=1661
-.[0][1663]=1662
-.[0][1664]=1663
-.[0][1665]=1664
-.[0][1666]=1665
-.[0][1667]=1666
-.[0][1668]=1667
-.[0][1669]=1668
-.[0][1670]=1669
-.[0][1671]=1670
-.[0][1672]=1671
-.[0][1673]=1672
-.[0][1674]=1673
-.[0][1675]=1674
-.[0][1676]=1675
-.[0][1677]=1676
-.[0][1678]=1677
-.[0][1679]=1678
-.[0][1680]=1679
-.[0][1681]=1680
-.[0][1682]=1681
-.[0][1683]=1682
-.[0][1684]=1683
-.[0][1685]=1684
-.[0][1686]=1685
-.[0][1687]=1686
-.[0][1688]=1687
-.[0][1689]=1688
-.[0][1690]=1689
-.[0][1691]=1690
-.[0][1692]=1691
-.[0][1693]=1692
-.[0][1694]=1693
-.[0][1695]=1694
-.[0][1696]=1695
-.[0][1697]=1696
-.[0][1698]=1697
-.[0][1699]=1698
-.[0][1700]=1699
-.[0][1701]=1700
-.[0][1702]=1701
-.[0][1703]=1702
-.[0][1704]=1703
-.[0][1705]=1704
-.[0][1706]=1705
-.[0][1707]=1706
-.[0][1708]=1707
-.[0][1709]=1708
-.[0][1710]=1709
-.[0][1711]=1710
-.[0][1712]=1711
-.[0][1713]=1712
-.[0][1714]=1713
-.[0][1715]=1714
-.[0][1716]=1715
-.[0][1717]=1716
-.[0][1718]=1717
-.[0][1719]=1718
-.[0][1720]=1719
-.[0][1721]=1720
-.[0][1722]=1721
-.[0][1723]=1722
-.[0][1724]=1723
-.[0][1725]=1724
-.[0][1726]=1725
-.[0][1727]=1726
-.[0][1728]=1727
-.[0][1729]=1728
-.[0][1730]=1729
-.[0][1731]=1730
-.[0][1732]=1731
-.[0][1733]=1732
-.[0][1734]=1733
-.[0][1735]=1734
-.[0][1736]=1735
-.[0][1737]=1736
-.[0][1738]=1737
-.[0][1739]=1738
-.[0][1740]=1739
-.[0][1741]=1740
-.[0][1742]=1741
-.[0][1743]=1742
-.[0][1744]=1743
-.[0][1745]=1744
-.[0][1746]=1745
-.[0][1747]=1746
-.[0][1748]=1747
-.[0][1749]=1748
-.[0][1750]=1749
-.[0][1751]=1750
-.[0][1752]=1751
-.[0][1753]=1752
-.[0][1754]=1753
-.[0][1755]=1754
-.[0][1756]=1755
-.[0][1757]=1756
-.[0][1758]=1757
-.[0][1759]=1758
-.[0][1760]=1759
-.[0][1761]=1760
-.[0][1762]=1761
-.[0][1763]=1762
-.[0][1764]=1763
-.[0][1765]=1764
-.[0][1766]=1765
-.[0][1767]=1766
-.[0][1768]=1767
-.[0][1769]=1768
-.[0][1770]=1769
-.[0][1771]=1770
-.[0][1772]=1771
-.[0][1773]=1772
-.[0][1774]=1773
-.[0][1775]=1774
-.[0][1776]=1775
-.[0][1777]=1776
-.[0][1778]=1777
-.[0][1779]=1778
-.[0][1780]=1779
-.[0][1781]=1780
-.[0][1782]=1781
-.[0][1783]=1782
-.[0][1784]=1783
-.[0][1785]=1784
-.[0][1786]=1785
-.[0][1787]=1786
-.[0][1788]=1787
-.[0][1789]=1788
-.[0][1790]=1789
-.[0][1791]=1790
-.[0][1792]=1791
-.[0][1793]=1792
-.[0][1794]=1793
-.[0][1795]=1794
-.[0][1796]=1795
-.[0][1797]=1796
-.[0][1798]=1797
-.[0][1799]=1798
-.[0][1800]=1799
-.[0][1801]=1800
-.[0][1802]=1801
-.[0][1803]=1802
-.[0][1804]=1803
-.[0][1805]=1804
-.[0][1806]=1805
-.[0][1807]=1806
-.[0][1808]=1807
-.[0][1809]=1808
-.[0][1810]=1809
-.[0][1811]=1810
-.[0][1812]=1811
-.[0][1813]=1812
-.[0][1814]=1813
-.[0][1815]=1814
-.[0][1816]=1815
-.[0][1817]=1816
-.[0][1818]=1817
-.[0][1819]=1818
-.[0][1820]=1819
-.[0][1821]=1820
-.[0][1822]=1821
-.[0][1823]=1822
-.[0][1824]=1823
-.[0][1825]=1824
-.[0][1826]=1825
-.[0][1827]=1826
-.[0][1828]=1827
-.[0][1829]=1828
-.[0][1830]=1829
-.[0][1831]=1830
-.[0][1832]=1831
-.[0][1833]=1832
-.[0][1834]=1833
-.[0][1835]=1834
-.[0][1836]=1835
-.[0][1837]=1836
-.[0][1838]=1837
-.[0][1839]=1838
-.[0][1840]=1839
-.[0][1841]=1840
-.[0][1842]=1841
-.[0][1843]=1842
-.[0][1844]=1843
-.[0][1845]=1844
-.[0][1846]=1845
-.[0][1847]=1846
-.[0][1848]=1847
-.[0][1849]=1848
-.[0][1850]=1849
-.[0][1851]=1850
-.[0][1852]=1851
-.[0][1853]=1852
-.[0][1854]=1853
-.[0][1855]=1854
-.[0][1856]=1855
-.[0][1857]=1856
-.[0][1858]=1857
-.[0][1859]=1858
-.[0][1860]=1859
-.[0][1861]=1860
-.[0][1862]=1861
-.[0][1863]=1862
-.[0][1864]=1863
-.[0][1865]=1864
-.[0][1866]=1865
-.[0][1867]=1866
-.[0][1868]=1867
-.[0][1869]=1868
-.[0][1870]=1869
-.[0][1871]=1870
-.[0][1872]=1871
-.[0][1873]=1872
-.[0][1874]=1873
-.[0][1875]=1874
-.[0][1876]=1875
-.[0][1877]=1876
-.[0][1878]=1877
-.[0][1879]=1878
-.[0][1880]=1879
-.[0][1881]=1880
-.[0][1882]=1881
-.[0][1883]=1882
-.[0][1884]=1883
-.[0][1885]=1884
-.[0][1886]=1885
-.[0][1887]=1886
-.[0][1888]=1887
-.[0][1889]=1888
-.[0][1890]=1889
-.[0][1891]=1890
-.[0][1892]=1891
-.[0][1893]=1892
-.[0][1894]=1893
-.[0][1895]=1894
-.[0][1896]=1895
-.[0][1897]=1896
-.[0][1898]=1897
-.[0][1899]=1898
-.[0][1900]=1899
-.[0][1901]=1900
-.[0][1902]=1901
-.[0][1903]=1902
-.[0][1904]=1903
-.[0][1905]=1904
-.[0][1906]=1905
-.[0][1907]=1906
-.[0][1908]=1907
-.[0][1909]=1908
-.[0][1910]=1909
-.[0][1911]=1910
-.[0][1912]=1911
-.[0][1913]=1912
-.[0][1914]=1913
-.[0][1915]=1914
-.[0][1916]=1915
-.[0][1917]=1916
-.[0][1918]=1917
-.[0][1919]=1918
-.[0][1920]=1919
-.[0][1921]=1920
-.[0][1922]=1921
-.[0][1923]=1922
-.[0][1924]=1923
-.[0][1925]=1924
-.[0][1926]=1925
-.[0][1927]=1926
-.[0][1928]=1927
-.[0][1929]=1928
-.[0][1930]=1929
-.[0][1931]=1930
-.[0][1932]=1931
-.[0][1933]=1932
-.[0][1934]=1933
-.[0][1935]=1934
-.[0][1936]=1935
-.[0][1937]=1936
-.[0][1938]=1937
-.[0][1939]=1938
-.[0][1940]=1939
-.[0][1941]=1940
-.[0][1942]=1941
-.[0][1943]=1942
-.[0][1944]=1943
-.[0][1945]=1944
-.[0][1946]=1945
-.[0][1947]=1946
-.[0][1948]=1947
-.[0][1949]=1948
-.[0][1950]=1949
-.[0][1951]=1950
-.[0][1952]=1951
-.[0][1953]=1952
-.[0][1954]=1953
-.[0][1955]=1954
-.[0][1956]=1955
-.[0][1957]=1956
-.[0][1958]=1957
-.[0][1959]=1958
-.[0][1960]=1959
-.[0][1961]=1960
-.[0][1962]=1961
-.[0][1963]=1962
-.[0][1964]=1963
-.[0][1965]=1964
-.[0][1966]=1965
-.[0][1967]=1966
-.[0][1968]=1967
-.[0][1969]=1968
-.[0][1970]=1969
-.[0][1971]=1970
-.[0][1972]=1971
-.[0][1973]=1972
-.[0][1974]=1973
-.[0][1975]=1974
-.[0][1976]=1975
-.[0][1977]=1976
-.[0][1978]=1977
-.[0][1979]=1978
-.[0][1980]=1979
-.[0][1981]=1980
-.[0][1982]=1981
-.[0][1983]=1982
-.[0][1984]=1983
-.[0][1985]=1984
-.[0][1986]=1985
-.[0][1987]=1986
-.[0][1988]=1987
-.[0][1989]=1988
-.[0][1990]=1989
-.[0][1991]=1990
-.[0][1992]=1991
-.[0][1993]=1992
-.[0][1994]=1993
-.[0][1995]=1994
-.[0][1996]=1995
-.[0][1997]=1996
-.[0][1998]=1997
-.[0][1999]=1998
-.[0][2000]=1999
-.[0][2001]=2000
-.[0][2002]=2001
-.[0][2003]=2002
-.[0][2004]=2003
-.[0][2005]=2004
-.[0][2006]=2005
-.[0][2007]=2006
-.[0][2008]=2007
-.[0][2009]=2008
-.[0][2010]=2009
-.[0][2011]=2010
-.[0][2012]=2011
-.[0][2013]=2012
-.[0][2014]=2013
-.[0][2015]=2014
-.[0][2016]=2015
-.[0][2017]=2016
-.[0][2018]=2017
-.[0][2019]=2018
-.[0][2020]=2019
-.[0][2021]=2020
-.[0][2022]=2021
-.[0][2023]=2022
-.[0][2024]=2023
-.[0][2025]=2024
-.[0][2026]=2025
-.[0][2027]=2026
-.[0][2028]=2027
-.[0][2029]=2028
-.[0][2030]=2029
-.[0][2031]=2030
-.[0][2032]=2031
-.[0][2033]=2032
-.[0][2034]=2033
-.[0][2035]=2034
-.[0][2036]=2035
-.[0][2037]=2036
-.[0][2038]=2037
-.[0][2039]=2038
-.[0][2040]=2039
-.[0][2041]=2040
-.[0][2042]=2041
-.[0][2043]=2042
-.[0][2044]=2043
-.[0][2045]=2044
-.[0][2046]=2045
-.[0][2047]=2046
-.[0][2048]=2047
-.[0][2049]=2048
-.[0][2050]=2049
-.[0][2051]=2050
-.[0][2052]=2051
-.[0][2053]=2052
-.[0][2054]=2053
-.[0][2055]=2054
-.[0][2056]=2055
-.[0][2057]=2056
-.[0][2058]=2057
-.[0][2059]=2058
-.[0][2060]=2059
-.[0][2061]=2060
-.[0][2062]=2061
-.[0][2063]=2062
-.[0][2064]=2063
-.[0][2065]=2064
-.[0][2066]=2065
-.[0][2067]=2066
-.[0][2068]=2067
-.[0][2069]=2068
-.[0][2070]=2069
-.[0][2071]=2070
-.[0][2072]=2071
-.[0][2073]=2072
-.[0][2074]=2073
-.[0][2075]=2074
-.[0][2076]=2075
-.[0][2077]=2076
-.[0][2078]=2077
-.[0][2079]=2078
-.[0][2080]=2079
-.[0][2081]=2080
-.[0][2082]=2081
-.[0][2083]=2082
-.[0][2084]=2083
-.[0][2085]=2084
-.[0][2086]=2085
-.[0][2087]=2086
-.[0][2088]=2087
-.[0][2089]=2088
-.[0][2090]=2089
-.[0][2091]=2090
-.[0][2092]=2091
-.[0][2093]=2092
-.[0][2094]=2093
-.[0][2095]=2094
-.[0][2096]=2095
-.[0][2097]=2096
-.[0][2098]=2097
-.[0][2099]=2098
-.[0][2100]=2099
-.[0][2101]=2100
-.[0][2102]=2101
-.[0][2103]=2102
-.[0][2104]=2103
-.[0][2105]=2104
-.[0][2106]=2105
-.[0][2107]=2106
-.[0][2108]=2107
-.[0][2109]=2108
-.[0][2110]=2109
-.[0][2111]=2110
-.[0][2112]=2111
-.[0][2113]=2112
-.[0][2114]=2113
-.[0][2115]=2114
-.[0][2116]=2115
-.[0][2117]=2116
-.[0][2118]=2117
-.[0][2119]=2118
diff --git a/lib/jsoncpp/test/data/test_large_01.json b/lib/jsoncpp/test/data/test_large_01.json
deleted file mode 100644
index e4ab4cd433..0000000000
--- a/lib/jsoncpp/test/data/test_large_01.json
+++ /dev/null
@@ -1,2 +0,0 @@
-[["A",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118]
-] \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_object_01.expected b/lib/jsoncpp/test/data/test_object_01.expected
deleted file mode 100644
index 67444e5794..0000000000
--- a/lib/jsoncpp/test/data/test_object_01.expected
+++ /dev/null
@@ -1 +0,0 @@
-.={}
diff --git a/lib/jsoncpp/test/data/test_object_01.json b/lib/jsoncpp/test/data/test_object_01.json
deleted file mode 100644
index 0967ef424b..0000000000
--- a/lib/jsoncpp/test/data/test_object_01.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/lib/jsoncpp/test/data/test_object_02.expected b/lib/jsoncpp/test/data/test_object_02.expected
deleted file mode 100644
index 79391c2a6c..0000000000
--- a/lib/jsoncpp/test/data/test_object_02.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.={}
-.count=1234
diff --git a/lib/jsoncpp/test/data/test_object_02.json b/lib/jsoncpp/test/data/test_object_02.json
deleted file mode 100644
index d0f2facac3..0000000000
--- a/lib/jsoncpp/test/data/test_object_02.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "count" : 1234 }
diff --git a/lib/jsoncpp/test/data/test_object_03.expected b/lib/jsoncpp/test/data/test_object_03.expected
deleted file mode 100644
index 5e96113792..0000000000
--- a/lib/jsoncpp/test/data/test_object_03.expected
+++ /dev/null
@@ -1,4 +0,0 @@
-.={}
-.attribute="random"
-.count=1234
-.name="test"
diff --git a/lib/jsoncpp/test/data/test_object_03.json b/lib/jsoncpp/test/data/test_object_03.json
deleted file mode 100644
index 4fcd4d821d..0000000000
--- a/lib/jsoncpp/test/data/test_object_03.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "count" : 1234,
- "name" : "test",
- "attribute" : "random"
-}
diff --git a/lib/jsoncpp/test/data/test_object_04.expected b/lib/jsoncpp/test/data/test_object_04.expected
deleted file mode 100644
index 812965b0ca..0000000000
--- a/lib/jsoncpp/test/data/test_object_04.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.={}
-.=1234
diff --git a/lib/jsoncpp/test/data/test_object_04.json b/lib/jsoncpp/test/data/test_object_04.json
deleted file mode 100644
index 450762d71e..0000000000
--- a/lib/jsoncpp/test/data/test_object_04.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "" : 1234
-}
diff --git a/lib/jsoncpp/test/data/test_preserve_comment_01.expected b/lib/jsoncpp/test/data/test_preserve_comment_01.expected
deleted file mode 100644
index 8d88041086..0000000000
--- a/lib/jsoncpp/test/data/test_preserve_comment_01.expected
+++ /dev/null
@@ -1,3 +0,0 @@
-.={}
-.first=1
-.second=2
diff --git a/lib/jsoncpp/test/data/test_preserve_comment_01.json b/lib/jsoncpp/test/data/test_preserve_comment_01.json
deleted file mode 100644
index fabd55dd96..0000000000
--- a/lib/jsoncpp/test/data/test_preserve_comment_01.json
+++ /dev/null
@@ -1,14 +0,0 @@
-/* A comment
- at the beginning of the file.
- */
-{
- "first" : 1, // comment after 'first' on the same line
-
-/* Comment before 'second'
- */
- "second" : 2
-}
-
-/* A comment at
- the end of the file.
- */
diff --git a/lib/jsoncpp/test/data/test_real_01.expected b/lib/jsoncpp/test/data/test_real_01.expected
deleted file mode 100644
index ae2357231e..0000000000
--- a/lib/jsoncpp/test/data/test_real_01.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=8589934592
-
diff --git a/lib/jsoncpp/test/data/test_real_01.json b/lib/jsoncpp/test/data/test_real_01.json
deleted file mode 100644
index 358452d387..0000000000
--- a/lib/jsoncpp/test/data/test_real_01.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// 2^33 => out of integer range, switch to double
-8589934592
-
diff --git a/lib/jsoncpp/test/data/test_real_02.expected b/lib/jsoncpp/test/data/test_real_02.expected
deleted file mode 100644
index df8de42109..0000000000
--- a/lib/jsoncpp/test/data/test_real_02.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=-4294967295
-
diff --git a/lib/jsoncpp/test/data/test_real_02.json b/lib/jsoncpp/test/data/test_real_02.json
deleted file mode 100644
index 936c706b68..0000000000
--- a/lib/jsoncpp/test/data/test_real_02.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// -2^32 => out of signed integer range, switch to double
--4294967295
-
diff --git a/lib/jsoncpp/test/data/test_real_03.expected b/lib/jsoncpp/test/data/test_real_03.expected
deleted file mode 100644
index df8de42109..0000000000
--- a/lib/jsoncpp/test/data/test_real_03.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=-4294967295
-
diff --git a/lib/jsoncpp/test/data/test_real_03.json b/lib/jsoncpp/test/data/test_real_03.json
deleted file mode 100644
index 936c706b68..0000000000
--- a/lib/jsoncpp/test/data/test_real_03.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// -2^32 => out of signed integer range, switch to double
--4294967295
-
diff --git a/lib/jsoncpp/test/data/test_real_04.expected b/lib/jsoncpp/test/data/test_real_04.expected
deleted file mode 100644
index d726abe40b..0000000000
--- a/lib/jsoncpp/test/data/test_real_04.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.=1.2345678
-
diff --git a/lib/jsoncpp/test/data/test_real_04.json b/lib/jsoncpp/test/data/test_real_04.json
deleted file mode 100644
index a8eb6d0c92..0000000000
--- a/lib/jsoncpp/test/data/test_real_04.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// 1.2345678
-12345678e-7
-
diff --git a/lib/jsoncpp/test/data/test_real_05.expected b/lib/jsoncpp/test/data/test_real_05.expected
deleted file mode 100644
index 949fd8f55d..0000000000
--- a/lib/jsoncpp/test/data/test_real_05.expected
+++ /dev/null
@@ -1,3 +0,0 @@
-.=1234567.8
-
-
diff --git a/lib/jsoncpp/test/data/test_real_05.json b/lib/jsoncpp/test/data/test_real_05.json
deleted file mode 100644
index f7923bab89..0000000000
--- a/lib/jsoncpp/test/data/test_real_05.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// 1234567.8
-0.12345678e7
-
diff --git a/lib/jsoncpp/test/data/test_real_06.expected b/lib/jsoncpp/test/data/test_real_06.expected
deleted file mode 100644
index 03b7d7f987..0000000000
--- a/lib/jsoncpp/test/data/test_real_06.expected
+++ /dev/null
@@ -1,3 +0,0 @@
-.=-1.2345678
-
-
diff --git a/lib/jsoncpp/test/data/test_real_06.json b/lib/jsoncpp/test/data/test_real_06.json
deleted file mode 100644
index 485419a276..0000000000
--- a/lib/jsoncpp/test/data/test_real_06.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// -1.2345678
--12345678e-7
-
diff --git a/lib/jsoncpp/test/data/test_real_07.expected b/lib/jsoncpp/test/data/test_real_07.expected
deleted file mode 100644
index 12025a404b..0000000000
--- a/lib/jsoncpp/test/data/test_real_07.expected
+++ /dev/null
@@ -1,3 +0,0 @@
-.=-1234567.8
-
-
diff --git a/lib/jsoncpp/test/data/test_real_07.json b/lib/jsoncpp/test/data/test_real_07.json
deleted file mode 100644
index 8013eb5c9a..0000000000
--- a/lib/jsoncpp/test/data/test_real_07.json
+++ /dev/null
@@ -1,3 +0,0 @@
-// -1234567.8
--0.12345678e7
-
diff --git a/lib/jsoncpp/test/data/test_string_01.expected b/lib/jsoncpp/test/data/test_string_01.expected
deleted file mode 100644
index 8fd37b1e0e..0000000000
--- a/lib/jsoncpp/test/data/test_string_01.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_01.json b/lib/jsoncpp/test/data/test_string_01.json
deleted file mode 100644
index 6cd0db44df..0000000000
--- a/lib/jsoncpp/test/data/test_string_01.json
+++ /dev/null
@@ -1 +0,0 @@
-"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
diff --git a/lib/jsoncpp/test/data/test_string_02.expected b/lib/jsoncpp/test/data/test_string_02.expected
deleted file mode 100644
index 0443bc3649..0000000000
--- a/lib/jsoncpp/test/data/test_string_02.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_02.json b/lib/jsoncpp/test/data/test_string_02.json
deleted file mode 100644
index 9a7e5dcad4..0000000000
--- a/lib/jsoncpp/test/data/test_string_02.json
+++ /dev/null
@@ -1 +0,0 @@
-"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
diff --git a/lib/jsoncpp/test/data/test_string_03.expected b/lib/jsoncpp/test/data/test_string_03.expected
deleted file mode 100644
index 6ed627a850..0000000000
--- a/lib/jsoncpp/test/data/test_string_03.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="http://jsoncpp.sourceforge.net/" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_03.json b/lib/jsoncpp/test/data/test_string_03.json
deleted file mode 100644
index 2d38180aea..0000000000
--- a/lib/jsoncpp/test/data/test_string_03.json
+++ /dev/null
@@ -1 +0,0 @@
-"http:\/\/jsoncpp.sourceforge.net\/"
diff --git a/lib/jsoncpp/test/data/test_string_unicode_01.expected b/lib/jsoncpp/test/data/test_string_unicode_01.expected
deleted file mode 100644
index 1f3be7fb68..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_01.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="a"
diff --git a/lib/jsoncpp/test/data/test_string_unicode_01.json b/lib/jsoncpp/test/data/test_string_unicode_01.json
deleted file mode 100644
index 024114bc09..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_01.json
+++ /dev/null
@@ -1 +0,0 @@
-"\u0061" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_unicode_02.expected b/lib/jsoncpp/test/data/test_string_unicode_02.expected
deleted file mode 100644
index 1388f53943..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_02.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="¢"
diff --git a/lib/jsoncpp/test/data/test_string_unicode_02.json b/lib/jsoncpp/test/data/test_string_unicode_02.json
deleted file mode 100644
index 4961024fab..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_02.json
+++ /dev/null
@@ -1 +0,0 @@
-"\u00A2" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_unicode_03.expected b/lib/jsoncpp/test/data/test_string_unicode_03.expected
deleted file mode 100644
index 9b80b2719f..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_03.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="€"
diff --git a/lib/jsoncpp/test/data/test_string_unicode_03.json b/lib/jsoncpp/test/data/test_string_unicode_03.json
deleted file mode 100644
index e7e1a9e138..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_03.json
+++ /dev/null
@@ -1 +0,0 @@
-"\u20AC" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_unicode_04.expected b/lib/jsoncpp/test/data/test_string_unicode_04.expected
deleted file mode 100644
index b9e7fe3b7d..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_04.expected
+++ /dev/null
@@ -1 +0,0 @@
-.="ð„ž"
diff --git a/lib/jsoncpp/test/data/test_string_unicode_04.json b/lib/jsoncpp/test/data/test_string_unicode_04.json
deleted file mode 100644
index dae65c5155..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_04.json
+++ /dev/null
@@ -1 +0,0 @@
-"\uD834\uDD1E" \ No newline at end of file
diff --git a/lib/jsoncpp/test/data/test_string_unicode_05.expected b/lib/jsoncpp/test/data/test_string_unicode_05.expected
deleted file mode 100644
index c2e67f9981..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_05.expected
+++ /dev/null
@@ -1,2 +0,0 @@
-.="Zażółć gęślą jaźń"
-
diff --git a/lib/jsoncpp/test/data/test_string_unicode_05.json b/lib/jsoncpp/test/data/test_string_unicode_05.json
deleted file mode 100644
index 8770410946..0000000000
--- a/lib/jsoncpp/test/data/test_string_unicode_05.json
+++ /dev/null
@@ -1 +0,0 @@
-"Zażółć gęślą jaźń" \ No newline at end of file
diff --git a/lib/jsoncpp/test/generate_expected.py b/lib/jsoncpp/test/generate_expected.py
deleted file mode 100644
index 5b215c4670..0000000000
--- a/lib/jsoncpp/test/generate_expected.py
+++ /dev/null
@@ -1,11 +0,0 @@
-import glob
-import os.path
-for path in glob.glob( '*.json' ):
- text = file(path,'rt').read()
- target = os.path.splitext(path)[0] + '.expected'
- if os.path.exists( target ):
- print 'skipping:', target
- else:
- print 'creating:', target
- file(target,'wt').write(text)
-
diff --git a/lib/jsoncpp/test/jsonchecker/fail1.json b/lib/jsoncpp/test/jsonchecker/fail1.json
deleted file mode 100644
index 6216b865f1..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail1.json
+++ /dev/null
@@ -1 +0,0 @@
-"A JSON payload should be an object or array, not a string." \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail10.json b/lib/jsoncpp/test/jsonchecker/fail10.json
deleted file mode 100644
index 5d8c0047bd..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail10.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Extra value after close": true} "misplaced quoted value" \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail11.json b/lib/jsoncpp/test/jsonchecker/fail11.json
deleted file mode 100644
index 76eb95b458..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail11.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Illegal expression": 1 + 2} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail12.json b/lib/jsoncpp/test/jsonchecker/fail12.json
deleted file mode 100644
index 77580a4522..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail12.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Illegal invocation": alert()} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail13.json b/lib/jsoncpp/test/jsonchecker/fail13.json
deleted file mode 100644
index 379406b59b..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail13.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Numbers cannot have leading zeroes": 013} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail14.json b/lib/jsoncpp/test/jsonchecker/fail14.json
deleted file mode 100644
index 0ed366b38a..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail14.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Numbers cannot be hex": 0x14} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail15.json b/lib/jsoncpp/test/jsonchecker/fail15.json
deleted file mode 100644
index fc8376b605..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail15.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \x15"] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail16.json b/lib/jsoncpp/test/jsonchecker/fail16.json
deleted file mode 100644
index 3fe21d4b53..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail16.json
+++ /dev/null
@@ -1 +0,0 @@
-[\naked] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail17.json b/lib/jsoncpp/test/jsonchecker/fail17.json
deleted file mode 100644
index 62b9214aed..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail17.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \017"] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail18.json b/lib/jsoncpp/test/jsonchecker/fail18.json
deleted file mode 100644
index edac92716f..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail18.json
+++ /dev/null
@@ -1 +0,0 @@
-[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail19.json b/lib/jsoncpp/test/jsonchecker/fail19.json
deleted file mode 100644
index 3b9c46fa9a..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail19.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Missing colon" null} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail2.json b/lib/jsoncpp/test/jsonchecker/fail2.json
deleted file mode 100644
index 6b7c11e5a5..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail2.json
+++ /dev/null
@@ -1 +0,0 @@
-["Unclosed array" \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail20.json b/lib/jsoncpp/test/jsonchecker/fail20.json
deleted file mode 100644
index 27c1af3e72..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail20.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Double colon":: null} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail21.json b/lib/jsoncpp/test/jsonchecker/fail21.json
deleted file mode 100644
index 62474573b2..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail21.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Comma instead of colon", null} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail22.json b/lib/jsoncpp/test/jsonchecker/fail22.json
deleted file mode 100644
index a7752581bc..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail22.json
+++ /dev/null
@@ -1 +0,0 @@
-["Colon instead of comma": false] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail23.json b/lib/jsoncpp/test/jsonchecker/fail23.json
deleted file mode 100644
index 494add1ca1..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail23.json
+++ /dev/null
@@ -1 +0,0 @@
-["Bad value", truth] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail24.json b/lib/jsoncpp/test/jsonchecker/fail24.json
deleted file mode 100644
index caff239bfc..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail24.json
+++ /dev/null
@@ -1 +0,0 @@
-['single quote'] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail25.json b/lib/jsoncpp/test/jsonchecker/fail25.json
deleted file mode 100644
index 8b7ad23e01..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail25.json
+++ /dev/null
@@ -1 +0,0 @@
-[" tab character in string "] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail26.json b/lib/jsoncpp/test/jsonchecker/fail26.json
deleted file mode 100644
index 845d26a6a5..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail26.json
+++ /dev/null
@@ -1 +0,0 @@
-["tab\ character\ in\ string\ "] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail27.json b/lib/jsoncpp/test/jsonchecker/fail27.json
deleted file mode 100644
index 6b01a2ca4a..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail27.json
+++ /dev/null
@@ -1,2 +0,0 @@
-["line
-break"] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail28.json b/lib/jsoncpp/test/jsonchecker/fail28.json
deleted file mode 100644
index 621a0101c6..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail28.json
+++ /dev/null
@@ -1,2 +0,0 @@
-["line\
-break"] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail29.json b/lib/jsoncpp/test/jsonchecker/fail29.json
deleted file mode 100644
index 47ec421bb6..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail29.json
+++ /dev/null
@@ -1 +0,0 @@
-[0e] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail3.json b/lib/jsoncpp/test/jsonchecker/fail3.json
deleted file mode 100644
index 168c81eb78..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail3.json
+++ /dev/null
@@ -1 +0,0 @@
-{unquoted_key: "keys must be quoted"} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail30.json b/lib/jsoncpp/test/jsonchecker/fail30.json
deleted file mode 100644
index 8ab0bc4b8b..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail30.json
+++ /dev/null
@@ -1 +0,0 @@
-[0e+] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail31.json b/lib/jsoncpp/test/jsonchecker/fail31.json
deleted file mode 100644
index 1cce602b51..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail31.json
+++ /dev/null
@@ -1 +0,0 @@
-[0e+-1] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail32.json b/lib/jsoncpp/test/jsonchecker/fail32.json
deleted file mode 100644
index 45cba7396f..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail32.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Comma instead if closing brace": true, \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail33.json b/lib/jsoncpp/test/jsonchecker/fail33.json
deleted file mode 100644
index ca5eb19dc9..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail33.json
+++ /dev/null
@@ -1 +0,0 @@
-["mismatch"} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail4.json b/lib/jsoncpp/test/jsonchecker/fail4.json
deleted file mode 100644
index 9de168bf34..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail4.json
+++ /dev/null
@@ -1 +0,0 @@
-["extra comma",] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail5.json b/lib/jsoncpp/test/jsonchecker/fail5.json
deleted file mode 100644
index ddf3ce3d24..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail5.json
+++ /dev/null
@@ -1 +0,0 @@
-["double extra comma",,] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail6.json b/lib/jsoncpp/test/jsonchecker/fail6.json
deleted file mode 100644
index ed91580e1b..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail6.json
+++ /dev/null
@@ -1 +0,0 @@
-[ , "<-- missing value"] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail7.json b/lib/jsoncpp/test/jsonchecker/fail7.json
deleted file mode 100644
index 8a96af3e4e..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail7.json
+++ /dev/null
@@ -1 +0,0 @@
-["Comma after the close"], \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail8.json b/lib/jsoncpp/test/jsonchecker/fail8.json
deleted file mode 100644
index b28479c6ec..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail8.json
+++ /dev/null
@@ -1 +0,0 @@
-["Extra close"]] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/fail9.json b/lib/jsoncpp/test/jsonchecker/fail9.json
deleted file mode 100644
index 5815574f36..0000000000
--- a/lib/jsoncpp/test/jsonchecker/fail9.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Extra comma": true,} \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/pass1.json b/lib/jsoncpp/test/jsonchecker/pass1.json
deleted file mode 100644
index 70e2685436..0000000000
--- a/lib/jsoncpp/test/jsonchecker/pass1.json
+++ /dev/null
@@ -1,58 +0,0 @@
-[
- "JSON Test Pattern pass1",
- {"object with 1 member":["array with 1 element"]},
- {},
- [],
- -42,
- true,
- false,
- null,
- {
- "integer": 1234567890,
- "real": -9876.543210,
- "e": 0.123456789e-12,
- "E": 1.234567890E+34,
- "": 23456789012E66,
- "zero": 0,
- "one": 1,
- "space": " ",
- "quote": "\"",
- "backslash": "\\",
- "controls": "\b\f\n\r\t",
- "slash": "/ & \/",
- "alpha": "abcdefghijklmnopqrstuvwyz",
- "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
- "digit": "0123456789",
- "0123456789": "digit",
- "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
- "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
- "true": true,
- "false": false,
- "null": null,
- "array":[ ],
- "object":{ },
- "address": "50 St. James Street",
- "url": "http://www.JSON.org/",
- "comment": "// /* <!-- --",
- "# -- --> */": " ",
- " s p a c e d " :[1,2 , 3
-
-,
-
-4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
- "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
- "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
- "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
-: "A key can be any string"
- },
- 0.5 ,98.6
-,
-99.44
-,
-
-1066,
-1e1,
-0.1e1,
-1e-1,
-1e00,2e+00,2e-00
-,"rosebud"] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/pass2.json b/lib/jsoncpp/test/jsonchecker/pass2.json
deleted file mode 100644
index d3c63c7ad8..0000000000
--- a/lib/jsoncpp/test/jsonchecker/pass2.json
+++ /dev/null
@@ -1 +0,0 @@
-[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/lib/jsoncpp/test/jsonchecker/pass3.json b/lib/jsoncpp/test/jsonchecker/pass3.json
deleted file mode 100644
index 4528d51f1a..0000000000
--- a/lib/jsoncpp/test/jsonchecker/pass3.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "JSON Test Pattern pass3": {
- "The outermost value": "must be an object or array.",
- "In this test": "It is an object."
- }
-}
diff --git a/lib/jsoncpp/test/jsonchecker/readme.txt b/lib/jsoncpp/test/jsonchecker/readme.txt
deleted file mode 100644
index 321d89d998..0000000000
--- a/lib/jsoncpp/test/jsonchecker/readme.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Test suite from http://json.org/JSON_checker/.
-
-If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files.
diff --git a/lib/jsoncpp/test/pyjsontestrunner.py b/lib/jsoncpp/test/pyjsontestrunner.py
deleted file mode 100644
index 504f3db2e7..0000000000
--- a/lib/jsoncpp/test/pyjsontestrunner.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Simple implementation of a json test runner to run the test against json-py.
-
-import sys
-import os.path
-import json
-import types
-
-if len(sys.argv) != 2:
- print "Usage: %s input-json-file", sys.argv[0]
- sys.exit(3)
-
-input_path = sys.argv[1]
-base_path = os.path.splitext(input_path)[0]
-actual_path = base_path + '.actual'
-rewrite_path = base_path + '.rewrite'
-rewrite_actual_path = base_path + '.actual-rewrite'
-
-def valueTreeToString( fout, value, path = '.' ):
- ty = type(value)
- if ty is types.DictType:
- fout.write( '%s={}\n' % path )
- suffix = path[-1] != '.' and '.' or ''
- names = value.keys()
- names.sort()
- for name in names:
- valueTreeToString( fout, value[name], path + suffix + name )
- elif ty is types.ListType:
- fout.write( '%s=[]\n' % path )
- for index, childValue in zip( xrange(0,len(value)), value ):
- valueTreeToString( fout, childValue, path + '[%d]' % index )
- elif ty is types.StringType:
- fout.write( '%s="%s"\n' % (path,value) )
- elif ty is types.IntType:
- fout.write( '%s=%d\n' % (path,value) )
- elif ty is types.FloatType:
- fout.write( '%s=%.16g\n' % (path,value) )
- elif value is True:
- fout.write( '%s=true\n' % path )
- elif value is False:
- fout.write( '%s=false\n' % path )
- elif value is None:
- fout.write( '%s=null\n' % path )
- else:
- assert False and "Unexpected value type"
-
-def parseAndSaveValueTree( input, actual_path ):
- root = json.loads( input )
- fout = file( actual_path, 'wt' )
- valueTreeToString( fout, root )
- fout.close()
- return root
-
-def rewriteValueTree( value, rewrite_path ):
- rewrite = json.dumps( value )
- #rewrite = rewrite[1:-1] # Somehow the string is quoted ! jsonpy bug ?
- file( rewrite_path, 'wt').write( rewrite + '\n' )
- return rewrite
-
-input = file( input_path, 'rt' ).read()
-root = parseAndSaveValueTree( input, actual_path )
-rewrite = rewriteValueTree( json.write( root ), rewrite_path )
-rewrite_root = parseAndSaveValueTree( rewrite, rewrite_actual_path )
-
-sys.exit( 0 )
diff --git a/lib/jsoncpp/test/runjsontests.py b/lib/jsoncpp/test/runjsontests.py
deleted file mode 100644
index 800337d4c3..0000000000
--- a/lib/jsoncpp/test/runjsontests.py
+++ /dev/null
@@ -1,134 +0,0 @@
-import sys
-import os
-import os.path
-from glob import glob
-import optparse
-
-VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes '
-
-def compareOutputs( expected, actual, message ):
- expected = expected.strip().replace('\r','').split('\n')
- actual = actual.strip().replace('\r','').split('\n')
- diff_line = 0
- max_line_to_compare = min( len(expected), len(actual) )
- for index in xrange(0,max_line_to_compare):
- if expected[index].strip() != actual[index].strip():
- diff_line = index + 1
- break
- if diff_line == 0 and len(expected) != len(actual):
- diff_line = max_line_to_compare+1
- if diff_line == 0:
- return None
- def safeGetLine( lines, index ):
- index += -1
- if index >= len(lines):
- return ''
- return lines[index].strip()
- return """ Difference in %s at line %d:
- Expected: '%s'
- Actual: '%s'
-""" % (message, diff_line,
- safeGetLine(expected,diff_line),
- safeGetLine(actual,diff_line) )
-
-def safeReadFile( path ):
- try:
- return file( path, 'rt' ).read()
- except IOError, e:
- return '<File "%s" is missing: %s>' % (path,e)
-
-def runAllTests( jsontest_executable_path, input_dir = None,
- use_valgrind=False, with_json_checker=False ):
- if not input_dir:
- input_dir = os.path.join( os.getcwd(), 'data' )
- tests = glob( os.path.join( input_dir, '*.json' ) )
- if with_json_checker:
- test_jsonchecker = glob( os.path.join( input_dir, '../jsonchecker', '*.json' ) )
- else:
- test_jsonchecker = []
- failed_tests = []
- valgrind_path = use_valgrind and VALGRIND_CMD or ''
- for input_path in tests + test_jsonchecker:
- is_json_checker_test = input_path in test_jsonchecker
- print 'TESTING:', input_path,
- options = is_json_checker_test and '--json-checker' or ''
- pipe = os.popen( "%s%s %s %s" % (
- valgrind_path, jsontest_executable_path, options,
- input_path) )
- process_output = pipe.read()
- status = pipe.close()
- if is_json_checker_test:
- expect_failure = os.path.basename( input_path ).startswith( 'fail' )
- if expect_failure:
- if status is None:
- print 'FAILED'
- failed_tests.append( (input_path, 'Parsing should have failed:\n%s' %
- safeReadFile(input_path)) )
- else:
- print 'OK'
- else:
- if status is not None:
- print 'FAILED'
- failed_tests.append( (input_path, 'Parsing failed:\n' + process_output) )
- else:
- print 'OK'
- else:
- base_path = os.path.splitext(input_path)[0]
- actual_output = safeReadFile( base_path + '.actual' )
- actual_rewrite_output = safeReadFile( base_path + '.actual-rewrite' )
- file(base_path + '.process-output','wt').write( process_output )
- if status:
- print 'parsing failed'
- failed_tests.append( (input_path, 'Parsing failed:\n' + process_output) )
- else:
- expected_output_path = os.path.splitext(input_path)[0] + '.expected'
- expected_output = file( expected_output_path, 'rt' ).read()
- detail = ( compareOutputs( expected_output, actual_output, 'input' )
- or compareOutputs( expected_output, actual_rewrite_output, 'rewrite' ) )
- if detail:
- print 'FAILED'
- failed_tests.append( (input_path, detail) )
- else:
- print 'OK'
-
- if failed_tests:
- print
- print 'Failure details:'
- for failed_test in failed_tests:
- print '* Test', failed_test[0]
- print failed_test[1]
- print
- print 'Test results: %d passed, %d failed.' % (len(tests)-len(failed_tests),
- len(failed_tests) )
- return 1
- else:
- print 'All %d tests passed.' % len(tests)
- return 0
-
-def main():
- from optparse import OptionParser
- parser = OptionParser( usage="%prog [options] <path to jsontestrunner.exe> [test case directory]" )
- parser.add_option("--valgrind",
- action="store_true", dest="valgrind", default=False,
- help="run all the tests using valgrind to detect memory leaks")
- parser.add_option("-c", "--with-json-checker",
- action="store_true", dest="with_json_checker", default=False,
- help="run all the tests from the official JSONChecker test suite of json.org")
- parser.enable_interspersed_args()
- options, args = parser.parse_args()
-
- if len(args) < 1 or len(args) > 2:
- parser.error( 'Must provides at least path to jsontestrunner executable.' )
- sys.exit( 1 )
-
- jsontest_executable_path = os.path.normpath( os.path.abspath( args[0] ) )
- if len(args) > 1:
- input_path = os.path.normpath( os.path.abspath( args[1] ) )
- else:
- input_path = None
- status = runAllTests( jsontest_executable_path, input_path,
- use_valgrind=options.valgrind, with_json_checker=options.with_json_checker )
- sys.exit( status )
-
-if __name__ == '__main__':
- main()
diff --git a/lib/jsoncpp/test/rununittests.py b/lib/jsoncpp/test/rununittests.py
deleted file mode 100644
index 366184cfb5..0000000000
--- a/lib/jsoncpp/test/rununittests.py
+++ /dev/null
@@ -1,73 +0,0 @@
-import sys
-import os
-import os.path
-import subprocess
-from glob import glob
-import optparse
-
-VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes'
-
-class TestProxy(object):
- def __init__( self, test_exe_path, use_valgrind=False ):
- self.test_exe_path = os.path.normpath( os.path.abspath( test_exe_path ) )
- self.use_valgrind = use_valgrind
-
- def run( self, options ):
- if self.use_valgrind:
- cmd = VALGRIND_CMD.split()
- else:
- cmd = []
- cmd.extend( [self.test_exe_path, '--test-auto'] + options )
- process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
- stdout = process.communicate()[0]
- if process.returncode:
- return False, stdout
- return True, stdout
-
-def runAllTests( exe_path, use_valgrind=False ):
- test_proxy = TestProxy( exe_path, use_valgrind=use_valgrind )
- status, test_names = test_proxy.run( ['--list-tests'] )
- if not status:
- print >> sys.stderr, "Failed to obtain unit tests list:\n" + test_names
- return 1
- test_names = [name.strip() for name in test_names.strip().split('\n')]
- failures = []
- for name in test_names:
- print 'TESTING %s:' % name,
- succeed, result = test_proxy.run( ['--test', name] )
- if succeed:
- print 'OK'
- else:
- failures.append( (name, result) )
- print 'FAILED'
- failed_count = len(failures)
- pass_count = len(test_names) - failed_count
- if failed_count:
- print
- for name, result in failures:
- print result
- print '%d/%d tests passed (%d failure(s))' % (
- pass_count, len(test_names), failed_count)
- return 1
- else:
- print 'All %d tests passed' % len(test_names)
- return 0
-
-def main():
- from optparse import OptionParser
- parser = OptionParser( usage="%prog [options] <path to test_lib_json.exe>" )
- parser.add_option("--valgrind",
- action="store_true", dest="valgrind", default=False,
- help="run all the tests using valgrind to detect memory leaks")
- parser.enable_interspersed_args()
- options, args = parser.parse_args()
-
- if len(args) != 1:
- parser.error( 'Must provides at least path to test_lib_json executable.' )
- sys.exit( 1 )
-
- exit_code = runAllTests( args[0], use_valgrind=options.valgrind )
- sys.exit( exit_code )
-
-if __name__ == '__main__':
- main()
diff --git a/lib/win32/libwavpack/Makefile.in b/lib/win32/libwavpack/Makefile.in
deleted file mode 100644
index cd2c4c4bca..0000000000
--- a/lib/win32/libwavpack/Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
-ARCH=@ARCH@
-
-CFLAGS +=-D_LINUX -fPIC -DPACK -DUNPACK -DSEEKING -DTAGS -DVER3 -DUSE_FSTREAMS
-OBJS=bits.o extra1.o extra2.o float.o md5.o metadata.o pack.o unpack.o unpack3.o utils.o words.o wputils.o
-
-SLIB=../../../../system/players/paplayer/wavpack-@ARCH@.so
-
-$(SLIB): $(OBJS)
-else
- $(CC) $(CFLAGS) -shared -o $@ $(OBJS) `cat ../../DllLoader/exports/wrapper.def` ../../DllLoader/exports/wrapper.o
-
-include ../../../../Makefile.include
-
diff --git a/lib/win32/libwavpack/bits.c b/lib/win32/libwavpack/bits.c
deleted file mode 100644
index d062d7cf1b..0000000000
--- a/lib/win32/libwavpack/bits.c
+++ /dev/null
@@ -1,259 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// bits.c
-
-// This module provides utilities to support the BitStream structure which is
-// used to read and write all WavPack audio data streams. It also contains a
-// wrapper for the stream I/O functions and a set of functions dealing with
-// endian-ness, both for enhancing portability. Finally, a debug wrapper for
-// the malloc() system is provided.
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(WIN32)
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-////////////////////////// Bitstream functions ////////////////////////////////
-
-#if defined(UNPACK) || defined(INFO_ONLY)
-
-// Open the specified BitStream and associate with the specified buffer.
-
-static void bs_read (Bitstream *bs);
-
-void bs_open_read (Bitstream *bs, uchar *buffer_start, uchar *buffer_end)
-{
- bs->error = bs->sr = bs->bc = 0;
- bs->ptr = (bs->buf = buffer_start) - 1;
- bs->end = buffer_end;
- bs->wrap = bs_read;
-}
-
-// This function is only called from the getbit() and getbits() macros when
-// the BitStream has been exhausted and more data is required. Sinve these
-// bistreams no longer access files, this function simple sets an error and
-// resets the buffer.
-
-static void bs_read (Bitstream *bs)
-{
- bs->ptr = bs->buf - 1;
- bs->error = 1;
-}
-
-// This function is called to close the bitstream. It returns the number of
-// full bytes actually read as bits.
-
-uint32_t bs_close_read (Bitstream *bs)
-{
- uint32_t bytes_read;
-
- if (bs->bc < 8)
- bs->ptr++;
-
- if ((bs->buf - bs->ptr) & 1)
- bs->ptr++;
-
- bytes_read = bs->ptr - bs->buf;
- CLEAR (*bs);
- return bytes_read;
-}
-
-#endif
-
-#ifdef PACK
-
-// Open the specified BitStream using the specified buffer pointers. It is
-// assumed that enough buffer space has been allocated for all data that will
-// be written, otherwise an error will be generated.
-
-static void bs_write (Bitstream *bs);
-
-void bs_open_write (Bitstream *bs, uchar *buffer_start, uchar *buffer_end)
-{
- bs->error = bs->sr = bs->bc = 0;
- bs->ptr = bs->buf = buffer_start;
- bs->end = buffer_end;
- bs->wrap = bs_write;
-}
-
-// This function is only called from the putbit() and putbits() macros when
-// the buffer is full, which is now flagged as an error.
-
-static void bs_write (Bitstream *bs)
-{
- bs->ptr = bs->buf;
- bs->error = 1;
-}
-
-// This function forces a flushing write of the specified BitStream, and
-// returns the total number of bytes written into the buffer.
-
-uint32_t bs_close_write (Bitstream *bs)
-{
- uint32_t bytes_written;
-
- if (bs->error)
- return (uint32_t) -1;
-
- while (bs->bc || ((bs->ptr - bs->buf) & 1)) putbit_1 (bs);
- bytes_written = bs->ptr - bs->buf;
- CLEAR (*bs);
- return bytes_written;
-}
-
-#endif
-
-/////////////////////// Endian Correction Routines ////////////////////////////
-
-void little_endian_to_native (void *data, char *format)
-{
- uchar *cp = (uchar *) data;
- int32_t temp;
-
- while (*format) {
- switch (*format) {
- case 'L':
- temp = cp [0] + ((int32_t) cp [1] << 8) + ((int32_t) cp [2] << 16) + ((int32_t) cp [3] << 24);
- * (int32_t *) cp = temp;
- cp += 4;
- break;
-
- case 'S':
- temp = cp [0] + (cp [1] << 8);
- * (short *) cp = (short) temp;
- cp += 2;
- break;
-
- default:
- if (isdigit (*format))
- cp += *format - '0';
-
- break;
- }
-
- format++;
- }
-}
-
-void native_to_little_endian (void *data, char *format)
-{
- uchar *cp = (uchar *) data;
- int32_t temp;
-
- while (*format) {
- switch (*format) {
- case 'L':
- temp = * (int32_t *) cp;
- *cp++ = (uchar) temp;
- *cp++ = (uchar) (temp >> 8);
- *cp++ = (uchar) (temp >> 16);
- *cp++ = (uchar) (temp >> 24);
- break;
-
- case 'S':
- temp = * (short *) cp;
- *cp++ = (uchar) temp;
- *cp++ = (uchar) (temp >> 8);
- break;
-
- default:
- if (isdigit (*format))
- cp += *format - '0';
-
- break;
- }
-
- format++;
- }
-}
-
-////////////////////////// Debug Wrapper for Malloc ///////////////////////////
-
-#ifdef DEBUG_ALLOC
-
-void *vptrs [512];
-
-static void *add_ptr (void *ptr)
-{
- int i;
-
- for (i = 0; i < 512; ++i)
- if (!vptrs [i]) {
- vptrs [i] = ptr;
- break;
- }
-
- if (i == 512)
- error_line ("too many mallocs!");
-
- return ptr;
-}
-
-static void *del_ptr (void *ptr)
-{
- int i;
-
- for (i = 0; i < 512; ++i)
- if (vptrs [i] == ptr) {
- vptrs [i] = NULL;
- break;
- }
-
- if (i == 512)
- error_line ("free invalid ptr!");
-
- return ptr;
-}
-
-void *malloc_db (uint32_t size)
-{
- if (size)
- return add_ptr (malloc (size));
- else
- return NULL;
-}
-
-void free_db (void *ptr)
-{
- if (ptr)
- free (del_ptr (ptr));
-}
-
-void *realloc_db (void *ptr, uint32_t size)
-{
- if (ptr && size)
- return add_ptr (realloc (del_ptr (ptr), size));
- else if (size)
- return malloc_db (size);
- else
- free_db (ptr);
-
- return NULL;
-}
-
-int32_t dump_alloc (void)
-{
- int i, j;
-
- for (j = i = 0; i < 512; ++i)
- if (vptrs [i])
- j++;
-
- return j;
-}
-
-#endif
diff --git a/lib/win32/libwavpack/changelog.txt b/lib/win32/libwavpack/changelog.txt
deleted file mode 100644
index 4daae17d1e..0000000000
--- a/lib/win32/libwavpack/changelog.txt
+++ /dev/null
@@ -1,106 +0,0 @@
- ---------------------------
- Release 4.2 - April 2, 2005
- ---------------------------
-
- wavpack.exe (command-line encoder) - 4.2
- ----------------------------------------
- fixed: handling of wav files larger than 2 gig
- improved: stereo lossless encoding speed (including "extra" mode)
- added: -i option to ignore length specified in wav header
- added: -w option to write APEv2 tags directly from command line
-
- wvunpack.exe (command-line decoder) - 4.2
- -----------------------------------------
- improved: decoding speed
-
- in_wv.dll (winamp plugin) - 2.2
- -------------------------------
- added: winamp media library support
- improved: decoding speed
-
- foo_wavpack.dll (foobar plugin) - 2.2
- -------------------------------------
- improved: decoding speed
-
- nxWavPack.dll (Nero plugin) - 1.1
- Cool_wv4.flt (CoolEdit / Audition filter) - 2.4
- -----------------------------------------------
- fixed: handling of wav files larger than 2 gig
- improved: encoding and decoding speed
-
- WavPack Library Source Code - 4.2
- ---------------------------------
- improved: encoding and decoding speed
- fixed: works correctly with 64-bit compilers
- added: mode bit to open files in "streaming" mode
-
-
- --------------------------
- Update - December 12, 2004
- --------------------------
-
- WavPack_Apollo.dll (Apollo plugin) - 1.2
- ----------------------------------------
- fixed: crash when Apollo opened and WavPack plugin can't find config file
-
-
- --------------------------------
- Release 4.1 - September 14, 2004
- --------------------------------
-
- wavpack.exe (command-line encoder) - 4.1
- ----------------------------------------
- fixed: hybrid mode + "extra" mode + very low bitrates making corrupt files
- fixed: mono or multichannel files causing crash (no corruption possible)
- added: third name specification for "correction" file (EAC specific)
- added: -t option to preserve timestamps
- added: error summary for batch mode
-
- wvunpack.exe (command-line decoder) - 4.1
- -----------------------------------------
- fixed: hybrid mode decoding bugs (very obscure situations)
- added: -s option to dump file summary to stdout
- added: -t option to preserve timestamps
- added: error summary for batch mode
-
- wvselfx.exe (self-extraction stub) - 4.1
- ----------------------------------------
- fixed: hybrid mode decoding bugs (very obscure situations)
-
- in_wv.dll (winamp plugin) - 2.1
- -------------------------------
- fixed: international characters in tags display properly (UTF-8 to Ansi)
- added: maximum tag data field width changed from 64 chars to 128 chars
- added: new infobox items including encoder version & modes, track #, md5
-
- foo_wavpack.dll (foobar plugin) - 2.1
- -------------------------------------
- added: new database items including encoder version & modes and md5
-
- WavPack_Apollo.dll (Apollo plugin) - 1.1
- ----------------------------------------
- fixed: international characters in tags display properly (UTF-8 to Ansi)
-
- Cool_wv4.flt (CoolEdit / Audition filter) - 2.2
- -----------------------------------------------
- fixed: hybrid mode + "extra" mode + very low bitrates making corrupt files
- fixed: saving mono file causing crash (no corruption possible)
- fixed: hybrid mode decoding bugs (very obscure situations)
- fixed: partial saves (with "Cancel") have incorrect RIFF header if unpacked
-
- nxWavPack.dll (Nero plugin) - 1.0
- ---------------------------------
- new
-
- WavPack Library Source Code - 4.1
- ---------------------------------
- fixed: hybrid mode + "extra" mode + very low bitrates making corrupt files
- fixed: mono or multichannel files causing crash (no corruption possible)
- fixed: hybrid mode decoding bugs (very obscure situations)
- added: mode bits for determining additional encode info (extra, sfx)
- added: function to return total compressed file length (including wvc)
- added: function to return encoder version (1, 2, 3, or 4)
- added: ability to obtain MD5 sum before decoding file (requires seek to end)
- added: mode bit for determining tag type (for proper character translation)
- added: ability to encode WavPack files without knowing length in advance
- added: option for small "information only" version of library
diff --git a/lib/win32/libwavpack/extra1.c b/lib/win32/libwavpack/extra1.c
deleted file mode 100644
index 9c70640692..0000000000
--- a/lib/win32/libwavpack/extra1.c
+++ /dev/null
@@ -1,563 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// extra1.c
-
-// This module handles the "extra" mode for mono files.
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-// #define EXTRA_DUMP
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-//////////////////////////////// local tables ///////////////////////////////
-
-extern const char default_terms [], high_terms [], fast_terms [];
-
-// #define MINMAX_WEIGHTS
-
-#ifdef MINMAX_WEIGHTS
-static int32_t min_weight, max_weight;
-static int min_term, max_term;
-#endif
-
-static void decorr_mono_pass (int32_t *in_samples, int32_t *out_samples, uint32_t num_samples, struct decorr_pass *dpp, int dir)
-{
- int m = 0;
-
- dpp->sum_A = 0;
-
-#ifdef MINMAX_WEIGHTS
- dpp->min = dpp->max = 0;
-#endif
-
- if (dir < 0) {
- out_samples += (num_samples - 1);
- in_samples += (num_samples - 1);
- dir = -1;
- }
- else
- dir = 1;
-
- if (dpp->term > MAX_TERM) {
- while (num_samples--) {
- int32_t left, sam_A;
-
- if (dpp->term & 1)
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = left = in_samples [0];
-
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- dpp->sum_A += dpp->weight_A;
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
-#endif
- out_samples [0] = left;
- in_samples += dir;
- out_samples += dir;
- }
- }
- else if (dpp->term > 0) {
- while (num_samples--) {
- int k = (m + dpp->term) & (MAX_TERM - 1);
- int32_t left, sam_A;
-
- sam_A = dpp->samples_A [m];
- dpp->samples_A [k] = left = in_samples [0];
- m = (m + 1) & (MAX_TERM - 1);
-
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- dpp->sum_A += dpp->weight_A;
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
-#endif
- out_samples [0] = left;
- in_samples += dir;
- out_samples += dir;
- }
- }
-
-#ifdef MINMAX_WEIGHTS
- if (dpp->term != 0) {
- if (dpp->max > max_weight) { max_weight = dpp->max; max_term = dpp->term; }
- if (dpp->min < min_weight) { min_weight = dpp->min; min_term = dpp->term; }
- }
-#endif
-
- if (m && dpp->term > 0 && dpp->term <= MAX_TERM) {
- int32_t temp_A [MAX_TERM];
- int k;
-
- memcpy (temp_A, dpp->samples_A, sizeof (dpp->samples_A));
-
- for (k = 0; k < MAX_TERM; k++) {
- dpp->samples_A [k] = temp_A [m];
- m = (m + 1) & (MAX_TERM - 1);
- }
- }
-}
-
-static void reverse_mono_decorr (struct decorr_pass *dpp)
-{
- if (dpp->term > MAX_TERM) {
- int32_t sam_A;
-
- if (dpp->term & 1)
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = sam_A;
-
- if (dpp->term & 1)
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- dpp->samples_A [1] = sam_A;
- }
- else if (dpp->term > 1) {
- int i = 0, j = dpp->term - 1, cnt = dpp->term / 2;
-
- while (cnt--) {
- i &= (MAX_TERM - 1);
- j &= (MAX_TERM - 1);
- dpp->samples_A [i] ^= dpp->samples_A [j];
- dpp->samples_A [j] ^= dpp->samples_A [i];
- dpp->samples_A [i++] ^= dpp->samples_A [j--];
- }
-
- CLEAR (dpp->samples_A);
- }
-}
-
-static void decorr_mono_buffer (int32_t *samples, int32_t *outsamples, uint32_t num_samples, struct decorr_pass *dpp)
-{
- int delta = dpp->delta, pre_delta, term = dpp->term;
- struct decorr_pass dp;
-
- if (delta == 7)
- pre_delta = 7;
- else if (delta < 2)
- pre_delta = 3;
- else
- pre_delta = delta + 1;
-
- CLEAR (dp);
- dp.term = term;
- dp.delta = pre_delta;
- decorr_mono_pass (samples, outsamples, num_samples > 2048 ? 2048 : num_samples, &dp, -1);
- dp.delta = delta;
- reverse_mono_decorr (&dp);
- memcpy (dpp->samples_A, dp.samples_A, sizeof (dp.samples_A));
- dpp->weight_A = dp.weight_A;
-
- if (delta == 0) {
- dp.delta = 1;
- decorr_mono_pass (samples, outsamples, num_samples, &dp, 1);
- dp.delta = 0;
- memcpy (dp.samples_A, dpp->samples_A, sizeof (dp.samples_A));
- dpp->weight_A = dp.weight_A = dp.sum_A / num_samples;
- }
-
-// if (memcmp (dpp, &dp, sizeof (dp)))
-// error_line ("decorr_passes don't match, delta = %d", delta);
-
- decorr_mono_pass (samples, outsamples, num_samples, &dp, 1);
-}
-
-static void recurse_mono (WavpackContext *wpc, int32_t *sampleptrs[], struct decorr_pass dps[],
- int depth, int nterms, int delta, uint32_t input_bits, uint32_t *best_bits)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int term, branches = ((wpc->config.extra_flags & EXTRA_BRANCHES) >> 6) - depth;
- int32_t *samples, *outsamples;
- uint32_t term_bits [22], bits;
-
- if (branches < 1 || depth + 1 == nterms)
- branches = 1;
-
- CLEAR (term_bits);
- samples = sampleptrs [depth];
- outsamples = sampleptrs [depth + 1];
-
- for (term = 1; term <= 18; ++term) {
- if (term == 17 && branches == 1 && depth + 1 < nterms)
- continue;
-
- if (term >= 9 && term <= 16)
- if (term > MAX_TERM || !(wpc->config.flags & CONFIG_HIGH_FLAG) || (wpc->config.extra_flags & EXTRA_SKIP_8TO16))
- continue;
-
- if ((wpc->config.flags & CONFIG_FAST_FLAG) && (term >= 5 && term <= 16))
- continue;
-
- dps [depth].term = term;
- dps [depth].delta = delta;
- decorr_mono_buffer (samples, outsamples, wps->wphdr.block_samples, &dps [depth]);
- bits = log2buffer (outsamples, wps->wphdr.block_samples);
-
- if (bits < *best_bits) {
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * (depth + 1));
- memcpy (sampleptrs [nterms + 1], sampleptrs [depth + 1], wps->wphdr.block_samples * 4);
- }
-
- term_bits [term + 3] = bits;
- }
-
- while (depth + 1 < nterms && branches--) {
- uint32_t local_best_bits = input_bits;
- int best_term = 0, i;
-
- for (i = 0; i < 22; ++i)
- if (term_bits [i] && term_bits [i] < local_best_bits) {
- local_best_bits = term_bits [i];
- term_bits [i] = 0;
- best_term = i - 3;
- }
-
- if (!best_term)
- break;
-
- dps [depth].term = best_term;
- dps [depth].delta = delta;
- decorr_mono_buffer (samples, outsamples, wps->wphdr.block_samples, &dps [depth]);
-
-// if (log2buffer (outsamples, wps->wphdr.block_samples * 2) != local_best_bits)
-// error_line ("data doesn't match!");
-
- recurse_mono (wpc, sampleptrs, dps, depth + 1, nterms, delta, local_best_bits, best_bits);
- }
-}
-
-static void delta_mono (WavpackContext *wpc, int32_t *sampleptrs[], struct decorr_pass dps[],
- int nterms, uint32_t *best_bits)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int lower = FALSE, delta, d;
- uint32_t bits;
-
- if (wps->decorr_passes [0].term)
- delta = wps->decorr_passes [0].delta;
- else
- return;
-
- for (d = delta - 1; d >= 0; --d) {
- int i;
-
- if (!d && (wps->wphdr.flags & HYBRID_FLAG))
- break;
-
- for (i = 0; i < nterms && wps->decorr_passes [i].term; ++i) {
- dps [i].term = wps->decorr_passes [i].term;
- dps [i].delta = d;
- decorr_mono_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- }
-
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-
- if (bits < *best_bits) {
- lower = TRUE;
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 4);
- }
- else
- break;
- }
-
- for (d = delta + 1; !lower && d <= 7; ++d) {
- int i;
-
- for (i = 0; i < nterms && wps->decorr_passes [i].term; ++i) {
- dps [i].term = wps->decorr_passes [i].term;
- dps [i].delta = d;
- decorr_mono_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- }
-
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-
- if (bits < *best_bits) {
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 4);
- }
- else
- break;
- }
-}
-
-static void sort_mono (WavpackContext *wpc, int32_t *sampleptrs[], struct decorr_pass dps[],
- int nterms, uint32_t *best_bits)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int reversed = TRUE;
- uint32_t bits;
-
- while (reversed) {
- int ri, i;
-
- memcpy (dps, wps->decorr_passes, sizeof (wps->decorr_passes));
- reversed = FALSE;
-
- for (ri = 0; ri < nterms && wps->decorr_passes [ri].term; ++ri) {
-
- if (ri + 1 >= nterms || !wps->decorr_passes [ri+1].term)
- break;
-
- if (wps->decorr_passes [ri].term == wps->decorr_passes [ri+1].term) {
- decorr_mono_buffer (sampleptrs [ri], sampleptrs [ri+1], wps->wphdr.block_samples, &dps [ri]);
- continue;
- }
-
- dps [ri] = wps->decorr_passes [ri+1];
- dps [ri+1] = wps->decorr_passes [ri];
-
- for (i = ri; i < nterms && wps->decorr_passes [i].term; ++i)
- decorr_mono_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
-
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-
- if (bits < *best_bits) {
- reversed = TRUE;
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 4);
- }
- else {
- dps [ri] = wps->decorr_passes [ri];
- dps [ri+1] = wps->decorr_passes [ri+1];
- decorr_mono_buffer (sampleptrs [ri], sampleptrs [ri+1], wps->wphdr.block_samples, &dps [ri]);
- }
- }
- }
-}
-
-#define EXTRA_ADVANCED (EXTRA_BRANCHES | EXTRA_SORT_FIRST | EXTRA_SORT_LAST | EXTRA_TRY_DELTAS)
-
-void analyze_mono (WavpackContext *wpc, int32_t *samples)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
-#ifdef EXTRA_DUMP
- uint32_t bits, best_bits, default_bits, cnt;
-#else
- uint32_t bits, best_bits, cnt;
-#endif
- const char *decorr_terms = default_terms, *tp;
- int32_t *sampleptrs [MAX_NTERMS+2], *lptr;
- struct decorr_pass dps [MAX_NTERMS];
- int nterms, i;
-
- CLEAR (wps->decorr_passes);
- cnt = wps->wphdr.block_samples;
- lptr = samples;
-
- while (cnt--)
- if (*lptr++)
- break;
-
- if (cnt == (uint32_t) -1) {
- scan_word (wps, samples, wps->wphdr.block_samples, -1);
- wps->num_terms = 0;
- return;
- }
-
- if (wpc->config.flags & CONFIG_HIGH_FLAG)
- decorr_terms = high_terms;
- else if (wpc->config.flags & CONFIG_FAST_FLAG)
- decorr_terms = fast_terms;
-
- for (nterms = 0, tp = decorr_terms; *tp; tp++)
- if (*tp > 0)
- ++nterms;
-
- if (wpc->config.extra_flags & EXTRA_TERMS)
- if ((nterms += (wpc->config.extra_flags & EXTRA_TERMS) >> 10) > MAX_NTERMS)
- nterms = MAX_NTERMS;
-
- for (i = 0; i < nterms + 2; ++i)
- sampleptrs [i] = malloc (wps->wphdr.block_samples * 4);
-
- memcpy (sampleptrs [nterms + 1], samples, wps->wphdr.block_samples * 4);
- best_bits = log2buffer (sampleptrs [nterms + 1], wps->wphdr.block_samples);
- memcpy (sampleptrs [0], samples, wps->wphdr.block_samples * 4);
- CLEAR (dps);
-
- for (tp = decorr_terms, i = 0; *tp; tp++)
- if (*tp > 0) {
- dps [i].term = *tp;
- dps [i].delta = 2;
- decorr_mono_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- ++i;
- }
-
-#ifdef EXTRA_DUMP
- default_bits = bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-#else
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-#endif
-
- if (bits < best_bits) {
- best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 4);
- }
-
- if ((wps->wphdr.flags & HYBRID_FLAG) && (wpc->config.extra_flags & EXTRA_ADVANCED)) {
- int shaping_weight, new = wps->wphdr.flags & NEW_SHAPING;
- int32_t *rptr = sampleptrs [nterms + 1], error = 0, temp;
-
- scan_word (wps, rptr, wps->wphdr.block_samples, -1);
- cnt = wps->wphdr.block_samples;
- lptr = sampleptrs [0];
-
- if (wps->wphdr.flags & HYBRID_SHAPE) {
- while (cnt--) {
- shaping_weight = (wps->dc.shaping_acc [0] += wps->dc.shaping_delta [0]) >> 16;
- temp = -apply_weight (shaping_weight, error);
-
- if (new && shaping_weight < 0 && temp) {
- if (temp == error)
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- lptr [0] += (error = nosend_word (wps, rptr [0], 0) - rptr [0] + temp);
- }
- else
- lptr [0] += (error = nosend_word (wps, rptr [0], 0) - rptr [0]) + temp;
-
- lptr++;
- rptr++;
- }
-
- wps->dc.shaping_acc [0] -= wps->dc.shaping_delta [0] * wps->wphdr.block_samples;
- }
- else
- while (cnt--) {
- lptr [0] += nosend_word (wps, rptr [0], 0) - rptr [0];
- lptr++;
- rptr++;
- }
-
- memcpy (dps, wps->decorr_passes, sizeof (dps));
-
- for (i = 0; i < nterms && dps [i].term; ++i)
- decorr_mono_buffer (sampleptrs [i], sampleptrs [i + 1], wps->wphdr.block_samples, dps + i);
-
-#ifdef EXTRA_DUMP
- best_bits = default_bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-#else
- best_bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples);
-#endif
-
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 4);
- }
-
- if (wpc->config.extra_flags & EXTRA_BRANCHES)
- recurse_mono (wpc, sampleptrs, dps, 0, nterms, (int) floor (wps->delta_decay + 0.5),
- log2buffer (sampleptrs [0], wps->wphdr.block_samples), &best_bits);
-
- if (wpc->config.extra_flags & EXTRA_SORT_FIRST)
- sort_mono (wpc, sampleptrs, dps, nterms, &best_bits);
-
- if (wpc->config.extra_flags & EXTRA_TRY_DELTAS) {
- delta_mono (wpc, sampleptrs, dps, nterms, &best_bits);
-
- if ((wpc->config.extra_flags & EXTRA_ADJUST_DELTAS) && wps->decorr_passes [0].term)
- wps->delta_decay = (wps->delta_decay * 2.0 + wps->decorr_passes [0].delta) / 3.0;
- else
- wps->delta_decay = 2.0;
- }
-
- if (wpc->config.extra_flags & EXTRA_SORT_LAST)
- sort_mono (wpc, sampleptrs, dps, nterms, &best_bits);
-
-#if 0
- memcpy (dps, wps->decorr_passes, sizeof (dps));
-
- for (i = 0; i < nterms && dps [i].term; ++i)
- decorr_mono_pass (sampleptrs [i], sampleptrs [i + 1], wps->wphdr.block_samples, dps + i, 1);
-
- if (log2buffer (sampleptrs [i], wps->wphdr.block_samples) != best_bits)
- error_line ("(1) samples do not match!");
-
- if (log2buffer (sampleptrs [nterms + 1], wps->wphdr.block_samples) != best_bits)
- error_line ("(2) samples do not match!");
-#endif
-
- scan_word (wps, sampleptrs [nterms + 1], wps->wphdr.block_samples, -1);
-
-#ifdef EXTRA_DUMP
- if (wpc->config.extra_flags & EXTRA_DUMP_TERMS) {
- char string [256], substring [20];
- int i;
-
- sprintf (string, "M: delta = %.4f%%, terms =",
- ((double) best_bits - default_bits) / 256.0 / wps->wphdr.block_samples / 32.0 * 100.0);
-
- for (i = 0; i < nterms; ++i) {
- if (wps->decorr_passes [i].term) {
- if (i && wps->decorr_passes [i-1].delta == wps->decorr_passes [i].delta)
- sprintf (substring, " %d", wps->decorr_passes [i].term);
- else
- sprintf (substring, " %d->%d", wps->decorr_passes [i].term,
- wps->decorr_passes [i].delta);
- }
- else
- sprintf (substring, " *");
-
- strcat (string, substring);
- }
-
- error_line (string);
- }
-#endif
-
- for (i = 0; i < nterms; ++i)
- if (!wps->decorr_passes [i].term)
- break;
-
- wps->num_terms = i;
-
- for (i = 0; i < nterms + 2; ++i)
- free (sampleptrs [i]);
-
-#ifdef MINMAX_WEIGHTS
- error_line ("weight range = %ld (%d) to %ld (%d)", min_weight, min_term, max_weight, max_term);
-#endif
-}
diff --git a/lib/win32/libwavpack/extra2.c b/lib/win32/libwavpack/extra2.c
deleted file mode 100644
index 777abe3bec..0000000000
--- a/lib/win32/libwavpack/extra2.c
+++ /dev/null
@@ -1,792 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// extra2.c
-
-// This module handles the "extra" mode for stereo files.
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-// #define EXTRA_DUMP
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-extern const char default_terms [], high_terms [], fast_terms [];
-
-// #define MINMAX_WEIGHTS
-
-#ifdef MINMAX_WEIGHTS
-static int32_t min_weight, max_weight;
-static int min_term, max_term;
-#endif
-
-static void decorr_stereo_pass (int32_t *in_samples, int32_t *out_samples, int32_t num_samples, struct decorr_pass *dpp, int dir)
-{
- int m = 0;
-
- dpp->sum_A = dpp->sum_B = 0;
-
-#ifdef MINMAX_WEIGHTS
- dpp->min = dpp->max = 0;
-#endif
-
- if (dir < 0) {
- out_samples += (num_samples - 1) * 2;
- in_samples += (num_samples - 1) * 2;
- dir = -2;
- }
- else
- dir = 2;
-
- if (dpp->term == 17) {
- while (num_samples--) {
- int32_t left, right;
- int32_t sam_A, sam_B;
-
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = left = in_samples [0];
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- dpp->sum_A += dpp->weight_A;
- out_samples [0] = left;
-
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = right = in_samples [1];
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, right);
- dpp->sum_B += dpp->weight_B;
- out_samples [1] = right;
-
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_B > dpp->max) dpp->max = dpp->weight_B;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
- if (dpp->weight_B < dpp->min) dpp->min = dpp->weight_B;
-#endif
- in_samples += dir;
- out_samples += dir;
- }
- }
- else if (dpp->term == 18) {
- while (num_samples--) {
- int32_t left, right;
- int32_t sam_A, sam_B;
-
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = left = in_samples [0];
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- dpp->sum_A += dpp->weight_A;
- out_samples [0] = left;
-
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = right = in_samples [1];
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, right);
- dpp->sum_B += dpp->weight_B;
- out_samples [1] = right;
-
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_B > dpp->max) dpp->max = dpp->weight_B;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
- if (dpp->weight_B < dpp->min) dpp->min = dpp->weight_B;
-#endif
- in_samples += dir;
- out_samples += dir;
- }
- }
- else if (dpp->term > 0) {
- while (num_samples--) {
- int k = (m + dpp->term) & (MAX_TERM - 1);
- int32_t left, right;
- int32_t sam_A, sam_B;
-
- sam_A = dpp->samples_A [m];
- dpp->samples_A [k] = left = in_samples [0];
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- dpp->sum_A += dpp->weight_A;
- out_samples [0] = left;
-
- sam_B = dpp->samples_B [m];
- dpp->samples_B [k] = right = in_samples [1];
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, right);
- dpp->sum_B += dpp->weight_B;
- out_samples [1] = right;
-
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_B > dpp->max) dpp->max = dpp->weight_B;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
- if (dpp->weight_B < dpp->min) dpp->min = dpp->weight_B;
-#endif
- in_samples += dir;
- out_samples += dir;
- m = (m + 1) & (MAX_TERM - 1);
- }
- }
- else if (dpp->term == -1) {
- while (num_samples--) {
- int32_t left = in_samples [0];
- int32_t right = in_samples [1];
- int32_t sam_A = dpp->samples_A [0], sam_B = left;
-
- dpp->samples_A [0] = right;
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, right);
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, left);
- dpp->sum_A += dpp->weight_A;
- dpp->sum_B += dpp->weight_B;
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_B > dpp->max) dpp->max = dpp->weight_B;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
- if (dpp->weight_B < dpp->min) dpp->min = dpp->weight_B;
-#endif
- out_samples [0] = left;
- out_samples [1] = right;
- in_samples += dir;
- out_samples += dir;
- }
- }
- else if (dpp->term == -2) {
- while (num_samples--) {
- int32_t left = in_samples [0];
- int32_t right = in_samples [1];
- int32_t sam_B = dpp->samples_B [0], sam_A = right;
-
- dpp->samples_B [0] = left;
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, left);
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, right);
- dpp->sum_A += dpp->weight_A;
- dpp->sum_B += dpp->weight_B;
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_B > dpp->max) dpp->max = dpp->weight_B;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
- if (dpp->weight_B < dpp->min) dpp->min = dpp->weight_B;
-#endif
- out_samples [0] = left;
- out_samples [1] = right;
- in_samples += dir;
- out_samples += dir;
- }
- }
- else if (dpp->term == -3) {
- while (num_samples--) {
- int32_t left = in_samples [0];
- int32_t right = in_samples [1];
- int32_t sam_A = dpp->samples_A [0], sam_B = dpp->samples_B [0];
-
- dpp->samples_A [0] = right;
- dpp->samples_B [0] = left;
- left -= apply_weight (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, left);
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, right);
- dpp->sum_A += dpp->weight_A;
- dpp->sum_B += dpp->weight_B;
-#ifdef MINMAX_WEIGHTS
- if (dpp->weight_A > dpp->max) dpp->max = dpp->weight_A;
- if (dpp->weight_B > dpp->max) dpp->max = dpp->weight_B;
- if (dpp->weight_A < dpp->min) dpp->min = dpp->weight_A;
- if (dpp->weight_B < dpp->min) dpp->min = dpp->weight_B;
-#endif
- out_samples [0] = left;
- out_samples [1] = right;
- in_samples += dir;
- out_samples += dir;
- }
- }
-
-#ifdef MINMAX_WEIGHTS
- if (dpp->term != 0) {
- if (dpp->max > max_weight) { max_weight = dpp->max; max_term = dpp->term; }
- if (dpp->min < min_weight) { min_weight = dpp->min; min_term = dpp->term; }
- }
-#endif
-
- if (m && dpp->term > 0 && dpp->term <= MAX_TERM) {
- int32_t temp_A [MAX_TERM], temp_B [MAX_TERM];
- int k;
-
- memcpy (temp_A, dpp->samples_A, sizeof (dpp->samples_A));
- memcpy (temp_B, dpp->samples_B, sizeof (dpp->samples_B));
-
- for (k = 0; k < MAX_TERM; k++) {
- dpp->samples_A [k] = temp_A [m];
- dpp->samples_B [k] = temp_B [m];
- m = (m + 1) & (MAX_TERM - 1);
- }
- }
-}
-
-static void reverse_decorr (struct decorr_pass *dpp)
-{
- if (dpp->term > MAX_TERM) {
- int32_t sam_A, sam_B;
-
- if (dpp->term & 1) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- }
- else {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- }
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_A [0] = sam_A;
- dpp->samples_B [0] = sam_B;
-
- if (dpp->term & 1) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- }
- else {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- }
-
- dpp->samples_A [1] = sam_A;
- dpp->samples_B [1] = sam_B;
- }
- else if (dpp->term > 1) {
- int i = 0, j = dpp->term - 1, cnt = dpp->term / 2;
-
- while (cnt--) {
- i &= (MAX_TERM - 1);
- j &= (MAX_TERM - 1);
- dpp->samples_A [i] ^= dpp->samples_A [j];
- dpp->samples_A [j] ^= dpp->samples_A [i];
- dpp->samples_A [i] ^= dpp->samples_A [j];
- dpp->samples_B [i] ^= dpp->samples_B [j];
- dpp->samples_B [j] ^= dpp->samples_B [i];
- dpp->samples_B [i++] ^= dpp->samples_B [j--];
- }
-
-// CLEAR (dpp->samples_A);
-// CLEAR (dpp->samples_B);
- }
- else if (dpp->term == -1) {
- }
- else if (dpp->term == -2) {
- }
- else if (dpp->term == -3) {
- }
-}
-
-static void decorr_stereo_buffer (int32_t *samples, int32_t *outsamples, int32_t num_samples, struct decorr_pass *dpp)
-{
- int delta = dpp->delta, pre_delta;
- int term = dpp->term;
- struct decorr_pass dp;
-
- if (delta == 7)
- pre_delta = 7;
- else if (delta < 2)
- pre_delta = 3;
- else
- pre_delta = delta + 1;
-
- CLEAR (dp);
- dp.term = term;
- dp.delta = pre_delta;
- decorr_stereo_pass (samples, outsamples, num_samples > 2048 ? 2048 : num_samples, &dp, -1);
- dp.delta = delta;
- reverse_decorr (&dp);
- memcpy (dpp->samples_A, dp.samples_A, sizeof (dp.samples_A));
- memcpy (dpp->samples_B, dp.samples_B, sizeof (dp.samples_B));
- dpp->weight_A = dp.weight_A;
- dpp->weight_B = dp.weight_B;
-
- if (delta == 0) {
- dp.delta = 1;
- decorr_stereo_pass (samples, outsamples, num_samples, &dp, 1);
- dp.delta = 0;
- memcpy (dp.samples_A, dpp->samples_A, sizeof (dp.samples_A));
- memcpy (dp.samples_B, dpp->samples_B, sizeof (dp.samples_B));
- dpp->weight_A = dp.weight_A = dp.sum_A / num_samples;
- dpp->weight_B = dp.weight_B = dp.sum_B / num_samples;
- }
-
-// if (memcmp (dpp, &dp, sizeof (dp)))
-// error_line ("decorr_passes don't match, delta = %d", delta);
-
- decorr_stereo_pass (samples, outsamples, num_samples, &dp, 1);
-}
-
-static void recurse_stereo (WavpackContext *wpc, int32_t *sampleptrs[], struct decorr_pass dps[],
- int depth, int nterms, int delta, uint32_t input_bits, uint32_t *best_bits)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int term, branches = ((wpc->config.extra_flags & EXTRA_BRANCHES) >> 6) - depth;
- int32_t *samples, *outsamples;
- uint32_t term_bits [22], bits;
-
- if (branches < 1 || depth + 1 == nterms)
- branches = 1;
-
- CLEAR (term_bits);
- samples = sampleptrs [depth];
- outsamples = sampleptrs [depth + 1];
-
- for (term = -3; term <= 18; ++term) {
- if (!term)
- continue;
-
- if (term == 17 && branches == 1 && depth + 1 < nterms)
- continue;
-
- if (term == -1 || term == -2)
- if (!(wps->wphdr.flags & CROSS_DECORR))
- continue;
-
- if (term >= 9 && term <= 16)
- if (term > MAX_TERM || !(wpc->config.flags & CONFIG_HIGH_FLAG) || (wpc->config.extra_flags & EXTRA_SKIP_8TO16))
- continue;
-
- if ((wpc->config.flags & CONFIG_FAST_FLAG) && (term >= 5 && term <= 16))
- continue;
-
- dps [depth].term = term;
- dps [depth].delta = delta;
- decorr_stereo_buffer (samples, outsamples, wps->wphdr.block_samples, &dps [depth]);
- bits = log2buffer (outsamples, wps->wphdr.block_samples * 2);
-
- if (bits < *best_bits) {
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * (depth + 1));
- memcpy (sampleptrs [nterms + 1], sampleptrs [depth + 1], wps->wphdr.block_samples * 8);
- }
-
- term_bits [term + 3] = bits;
- }
-
- while (depth + 1 < nterms && branches--) {
- uint32_t local_best_bits = input_bits;
- int best_term = 0, i;
-
- for (i = 0; i < 22; ++i)
- if (term_bits [i] && term_bits [i] < local_best_bits) {
- local_best_bits = term_bits [i];
- term_bits [i] = 0;
- best_term = i - 3;
- }
-
- if (!best_term)
- break;
-
- dps [depth].term = best_term;
- dps [depth].delta = delta;
- decorr_stereo_buffer (samples, outsamples, wps->wphdr.block_samples, &dps [depth]);
-
-// if (log2buffer (outsamples, wps->wphdr.block_samples * 2) != local_best_bits)
-// error_line ("data doesn't match!");
-
- recurse_stereo (wpc, sampleptrs, dps, depth + 1, nterms, delta, local_best_bits, best_bits);
- }
-}
-
-static void delta_stereo (WavpackContext *wpc, int32_t *sampleptrs[], struct decorr_pass dps[],
- int nterms, uint32_t *best_bits)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int lower = FALSE;
- int delta, d;
- uint32_t bits;
-
- if (wps->decorr_passes [0].term)
- delta = wps->decorr_passes [0].delta;
- else
- return;
-
- for (d = delta - 1; d >= 0; --d) {
- int i;
-
- if (!d && (wps->wphdr.flags & HYBRID_FLAG))
- break;
-
- for (i = 0; i < nterms && wps->decorr_passes [i].term; ++i) {
- dps [i].term = wps->decorr_passes [i].term;
- dps [i].delta = d;
- decorr_stereo_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- }
-
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-
- if (bits < *best_bits) {
- lower = TRUE;
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 8);
- }
- else
- break;
- }
-
- for (d = delta + 1; !lower && d <= 7; ++d) {
- int i;
-
- for (i = 0; i < nterms && wps->decorr_passes [i].term; ++i) {
- dps [i].term = wps->decorr_passes [i].term;
- dps [i].delta = d;
- decorr_stereo_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- }
-
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-
- if (bits < *best_bits) {
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 8);
- }
- else
- break;
- }
-}
-
-static void sort_stereo (WavpackContext *wpc, int32_t *sampleptrs[], struct decorr_pass dps[],
- int nterms, uint32_t *best_bits)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int reversed = TRUE;
- uint32_t bits;
-
- while (reversed) {
- int ri, i;
-
- memcpy (dps, wps->decorr_passes, sizeof (wps->decorr_passes));
- reversed = FALSE;
-
- for (ri = 0; ri < nterms && wps->decorr_passes [ri].term; ++ri) {
-
- if (ri + 1 >= nterms || !wps->decorr_passes [ri+1].term)
- break;
-
- if (wps->decorr_passes [ri].term == wps->decorr_passes [ri+1].term) {
- decorr_stereo_buffer (sampleptrs [ri], sampleptrs [ri+1], wps->wphdr.block_samples, &dps [ri]);
- continue;
- }
-
- dps [ri] = wps->decorr_passes [ri+1];
- dps [ri+1] = wps->decorr_passes [ri];
-
- for (i = ri; i < nterms && wps->decorr_passes [i].term; ++i)
- decorr_stereo_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
-
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-
- if (bits < *best_bits) {
- reversed = TRUE;
- *best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 8);
- }
- else {
- dps [ri] = wps->decorr_passes [ri];
- dps [ri+1] = wps->decorr_passes [ri+1];
- decorr_stereo_buffer (sampleptrs [ri], sampleptrs [ri+1], wps->wphdr.block_samples, &dps [ri]);
- }
- }
- }
-}
-
-#define EXTRA_ADVANCED (EXTRA_BRANCHES | EXTRA_SORT_FIRST | EXTRA_SORT_LAST | EXTRA_TRY_DELTAS)
-
-void analyze_stereo (WavpackContext *wpc, int32_t *samples)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
-#ifdef EXTRA_DUMP
- uint32_t bits, best_bits, default_bits, cnt;
-#else
- uint32_t bits, best_bits, cnt;
-#endif
- const char *decorr_terms = default_terms, *tp;
- int32_t *sampleptrs [MAX_NTERMS+2], *lptr;
- struct decorr_pass dps [MAX_NTERMS];
- int nterms, i;
-
-
- CLEAR (wps->decorr_passes);
- cnt = wps->wphdr.block_samples * 2;
- lptr = samples;
-
- while (cnt--)
- if (*lptr++)
- break;
-
- if (cnt == (uint32_t) -1) {
- scan_word (wps, samples, wps->wphdr.block_samples, -1);
- wps->num_terms = 0;
- return;
- }
-
- if (wpc->config.flags & CONFIG_HIGH_FLAG)
- decorr_terms = high_terms;
- else if (wpc->config.flags & CONFIG_FAST_FLAG)
- decorr_terms = fast_terms;
-
- nterms = strlen (decorr_terms);
-
- if (wpc->config.extra_flags & EXTRA_TERMS)
- if ((nterms += (wpc->config.extra_flags & EXTRA_TERMS) >> 10) > MAX_NTERMS)
- nterms = MAX_NTERMS;
-
- for (i = 0; i < nterms + 2; ++i)
- sampleptrs [i] = malloc (wps->wphdr.block_samples * 8);
-
- memcpy (sampleptrs [nterms + 1], samples, wps->wphdr.block_samples * 8);
- best_bits = log2buffer (sampleptrs [nterms + 1], wps->wphdr.block_samples * 2);
-
- if ((wpc->config.extra_flags & EXTRA_STEREO_MODES) || !(wps->wphdr.flags & JOINT_STEREO)) {
- memcpy (sampleptrs [0], samples, wps->wphdr.block_samples * 8);
-
- CLEAR (dps);
-
- for (tp = decorr_terms, i = 0; *tp;) {
- if (*tp > 0 || (wps->wphdr.flags & CROSS_DECORR))
- dps [i].term = *tp++;
- else {
- dps [i].term = -3;
- tp++;
- }
-
- dps [i].delta = 2;
- decorr_stereo_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- ++i;
- }
-
-#ifdef EXTRA_DUMP
- default_bits = bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-#else
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-#endif
-
- wps->wphdr.flags &= ~JOINT_STEREO;
-
- if (bits < best_bits) {
- best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 8);
- }
- }
-
- if ((wpc->config.extra_flags & EXTRA_STEREO_MODES) || (wps->wphdr.flags & JOINT_STEREO)) {
- memcpy (sampleptrs [0], samples, wps->wphdr.block_samples * 8);
- cnt = wps->wphdr.block_samples;
- lptr = sampleptrs [0];
-
- while (cnt--) {
- lptr [1] += ((lptr [0] -= lptr [1]) >> 1);
- lptr += 2;
- }
-
- CLEAR (dps);
-
- for (tp = decorr_terms, i = 0; *tp;) {
- if (*tp > 0 || (wps->wphdr.flags & CROSS_DECORR))
- dps [i].term = *tp++;
- else {
- dps [i].term = -3;
- tp++;
- }
-
- dps [i].delta = 2;
- decorr_stereo_buffer (sampleptrs [i], sampleptrs [i+1], wps->wphdr.block_samples, &dps [i]);
- ++i;
- }
-
-#ifdef EXTRA_DUMP
- default_bits = bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-#else
- bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-#endif
-
- wps->wphdr.flags |= JOINT_STEREO;
-
- if (bits < best_bits) {
- best_bits = bits;
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 8);
- }
- else {
- memcpy (sampleptrs [0], samples, wps->wphdr.block_samples * 8);
- wps->wphdr.flags &= ~JOINT_STEREO;
- }
- }
-
- if ((wps->wphdr.flags & HYBRID_FLAG) && (wpc->config.extra_flags & EXTRA_ADVANCED)) {
- int shaping_weight, new = wps->wphdr.flags & NEW_SHAPING;
- int32_t *rptr = sampleptrs [nterms + 1], error [2], temp;
-
- scan_word (wps, rptr, wps->wphdr.block_samples, -1);
- cnt = wps->wphdr.block_samples;
- lptr = sampleptrs [0];
- CLEAR (error);
-
- if (wps->wphdr.flags & HYBRID_SHAPE) {
- while (cnt--) {
- shaping_weight = (wps->dc.shaping_acc [0] += wps->dc.shaping_delta [0]) >> 16;
- temp = -apply_weight (shaping_weight, error [0]);
-
- if (new && shaping_weight < 0 && temp) {
- if (temp == error [0])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- lptr [0] += (error [0] = nosend_word (wps, rptr [0], 0) - rptr [0] + temp);
- }
- else
- lptr [0] += (error [0] = nosend_word (wps, rptr [0], 0) - rptr [0]) + temp;
-
- shaping_weight = (wps->dc.shaping_acc [1] += wps->dc.shaping_delta [1]) >> 16;
- temp = -apply_weight (shaping_weight, error [1]);
-
- if (new && shaping_weight < 0 && temp) {
- if (temp == error [1])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- lptr [1] += (error [1] = nosend_word (wps, rptr [1], 1) - rptr [1] + temp);
- }
- else
- lptr [1] += (error [1] = nosend_word (wps, rptr [1], 1) - rptr [1]) + temp;
-
- lptr += 2;
- rptr += 2;
- }
-
- wps->dc.shaping_acc [0] -= wps->dc.shaping_delta [0] * wps->wphdr.block_samples;
- wps->dc.shaping_acc [1] -= wps->dc.shaping_delta [1] * wps->wphdr.block_samples;
- }
- else
- while (cnt--) {
- lptr [0] += nosend_word (wps, rptr [0], 0) - rptr [0];
- lptr [1] += nosend_word (wps, rptr [1], 1) - rptr [1];
- lptr += 2;
- rptr += 2;
- }
-
- memcpy (dps, wps->decorr_passes, sizeof (dps));
-
- for (i = 0; i < nterms && dps [i].term; ++i)
- decorr_stereo_buffer (sampleptrs [i], sampleptrs [i + 1], wps->wphdr.block_samples, dps + i);
-
-#ifdef EXTRA_DUMP
- best_bits = default_bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-#else
- best_bits = log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2);
-#endif
-
- CLEAR (wps->decorr_passes);
- memcpy (wps->decorr_passes, dps, sizeof (dps [0]) * i);
- memcpy (sampleptrs [nterms + 1], sampleptrs [i], wps->wphdr.block_samples * 8);
- }
-
- if (wpc->config.extra_flags & EXTRA_BRANCHES)
- recurse_stereo (wpc, sampleptrs, dps, 0, nterms, (int) floor (wps->delta_decay + 0.5),
- log2buffer (sampleptrs [0], wps->wphdr.block_samples * 2), &best_bits);
-
- if (wpc->config.extra_flags & EXTRA_SORT_FIRST)
- sort_stereo (wpc, sampleptrs, dps, nterms, &best_bits);
-
- if (wpc->config.extra_flags & EXTRA_TRY_DELTAS) {
- delta_stereo (wpc, sampleptrs, dps, nterms, &best_bits);
-
- if ((wpc->config.extra_flags & EXTRA_ADJUST_DELTAS) && wps->decorr_passes [0].term)
- wps->delta_decay = (wps->delta_decay * 2.0 + wps->decorr_passes [0].delta) / 3.0;
- else
- wps->delta_decay = 2.0;
- }
-
- if (wpc->config.extra_flags & EXTRA_SORT_LAST)
- sort_stereo (wpc, sampleptrs, dps, nterms, &best_bits);
-
-#if 0
- memcpy (dps, wps->decorr_passes, sizeof (dps));
-
- for (i = 0; i < nterms && dps [i].term; ++i)
- decorr_stereo_pass (sampleptrs [i], sampleptrs [i + 1], wps->wphdr.block_samples, dps + i, 1);
-
- if (log2buffer (sampleptrs [i], wps->wphdr.block_samples * 2) != best_bits)
- error_line ("(1) samples do not match!");
-
- if (log2buffer (sampleptrs [nterms + 1], wps->wphdr.block_samples * 2) != best_bits)
- error_line ("(2) samples do not match!");
-#endif
-
- scan_word (wps, sampleptrs [nterms + 1], wps->wphdr.block_samples, -1);
-
-#ifdef EXTRA_DUMP
- if (1) {
- char string [256], substring [20];
- int i;
-
- sprintf (string, "%s: delta = %.4f%%, terms =",
- (wps->wphdr.flags & JOINT_STEREO) ? "JS" : "TS",
- ((double) best_bits - default_bits) / 256.0 / wps->wphdr.block_samples / 32.0 * 100.0);
-
- for (i = 0; i < nterms; ++i) {
- if (wps->decorr_passes [i].term) {
- if (i && wps->decorr_passes [i-1].delta == wps->decorr_passes [i].delta)
- sprintf (substring, " %d", wps->decorr_passes [i].term);
- else
- sprintf (substring, " %d->%d", wps->decorr_passes [i].term,
- wps->decorr_passes [i].delta);
- }
- else
- sprintf (substring, " *");
-
- strcat (string, substring);
- }
-
- error_line (string);
- }
-#endif
-
- for (i = 0; i < nterms; ++i)
- if (!wps->decorr_passes [i].term)
- break;
-
- wps->num_terms = i;
-
- for (i = 0; i < nterms + 2; ++i)
- free (sampleptrs [i]);
-
-#ifdef MINMAX_WEIGHTS
- error_line ("weight range = %ld (%d) to %ld (%d)", min_weight, min_term, max_weight, max_term);
-#endif
-}
diff --git a/lib/win32/libwavpack/filters.h b/lib/win32/libwavpack/filters.h
deleted file mode 100644
index 6b560939b2..0000000000
--- a/lib/win32/libwavpack/filters.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//////////////////////////////////////////////////////
-// GENERAL PURPOSE DEFS FOR CREATING CUSTOM FILTERS //
-//////////////////////////////////////////////////////
-
-
-typedef struct riffspecialdata_t
-{ HANDLE hSpecialData;
- HANDLE hData; // Actual data handle
- DWORD dwSize; // size of data in handle
- DWORD dwExtra; // optional extra data (usually a count)
- char szListType[8]; // Parent list type (usually "WAVE" or "INFO", or "adtl")
- char szType[8]; // Usually a four character code for data, but can be up to 7 chars
-} SPECIALDATA;
-
-// "CUE " dwExtra=number of cues, each cue is 8 bytes ([4] name [4] sample offset)
-// "LTXT" dwExtra=number of items, each one is 8 bytes ([4] ltxt len [4] name [4] cue length [4] purpose [n] data)
-// "NOTE" dwExtra=number of strings, each one is n bytes ([4] name [n-4] length zero term)
-// "LABL" dwExtra=number of strings, each one is n bytes ([4] name [n-4] length zero term)
-// "PLST" dwExtra=number if items, each one is 16 bytes ([4] name [4] dwLen [4] dwLoops [4] dwMode)
-
-
-// For special data, .FLT must implement FilterGetFirstSpecialData and FilterGetNextSpecialData
-
-
-typedef DWORD FOURCC; // a four character code
-
-struct cue_type { DWORD dwName;
- DWORD dwPosition;
- FOURCC fccChunk;
- DWORD dwChunkStart;
- DWORD dwBlockStart;
- DWORD dwSampleOffset;
- };
-
-struct play_type {DWORD dwName;
- DWORD dwLength;
- DWORD dwLoops;
- };
-
-
-typedef struct coolquery_tag
- {char szName[24];
- char szCopyright[80];
-
- // rate table, bits are set for modes that can be handled
- WORD Quad32; // Quads are 3-D encoded
- WORD Quad16;
- WORD Quad8;
- WORD Stereo8; // rates are from lowest bit:
- WORD Stereo12; // bit 0 set: 5500 (5512.5)
- WORD Stereo16; // bit 1 set: 11025 (11K)
- WORD Stereo24; // bit 2 set: 22050 (22K)
- WORD Stereo32; // bit 3 set: 32075 (32K, or 32000)
- WORD Mono8; // bit 4 set: 44100 (44K)
- WORD Mono12; // bit 5 set: 48000 (48K)
- WORD Mono16; // bit 6 set: 88200 (88K) (future ultra-sonic rates?)
- WORD Mono24; // bit 7 set: 96000 (96K)
- WORD Mono32; // bit 8 set: 132300 (132K)
- // bit 9 set: 176400 (176K)
- DWORD dwFlags;
- char szExt[4];
- long lChunkSize;
- char szExt2[4];
- char szExt3[4];
- char szExt4[4];
- } COOLQUERY;
-
-#define R_5500 1
-#define R_11025 2
-#define R_22050 4
-#define R_32075 8
-#define R_44100 16
-#define R_48000 32
-#define R_88200 64
-#define R_96000 128
-#define R_132300 256
-#define R_176400 512
-
-#define C_VALIDLIBRARY 1154
-
-#define QF_RATEADJUSTABLE 0x001 // if can handle non-standard sample rates
- // if not, only rates in bit rate table understood
-#define QF_CANSAVE 0x002
-#define QF_CANLOAD 0x004
-#define QF_UNDERSTANDSALL 0x008 // will read ANYTHING, so it is the last resort if no other
- // formats match
-#define QF_READSPECIALFIRST 0x010 // read special info before trying to read data
-#define QF_READSPECIALLAST 0x020 // read special info after reading data
-#define QF_WRITESPECIALFIRST 0x040 // when writing a file, special info is sent to DLL before data
-#define QF_WRITESPECIALLAST 0x080 // when writing, special info is sent to DLL after data
-#define QF_HASOPTIONSBOX 0x100 // set if options box implemented
-#define QF_NOASKFORCONVERT 0x200 // set to bypass asking for conversion if original in different rate, auto convert
-#define QF_NOHEADER 0x400 // set if this is a raw data format with no header
-#define QF_CANDO32BITFLOATS 0x800 // set if file format can handle 32-bit sample data for input
-#define QF_CANOPENVIRTUAL 0x1000 // Set if data is in Intel 8-bit or 16-bit sample format, or floats
- // and the GetDataOffset() function is implemented
-
-// special types are read from and written to DLL in the order below
-/*
-// special types (particular to Windows waveforms)
-#define SP_IART 20
-#define SP_ICMT 21
-#define SP_ICOP 22
-#define SP_ICRD 23
-#define SP_IENG 24
-#define SP_IGNR 25
-#define SP_IKEY 26
-#define SP_IMED 27
-#define SP_INAM 28
-#define SP_ISFT 29
-#define SP_ISRC 30
-#define SP_ITCH 31
-#define SP_ISBJ 32
-#define SP_ISRF 33
-#define SP_DISP 34
-#define SP_CUE 40 // returns number of cues of size cue_type
-#define SP_LTXT 41 // returns number of adtl texts of size 8 (4,id and 4,len)
-#define SP_NOTE 42 // returns LO=size, HI=number of strings (sz sz sz...)
-#define SP_LABL 43 // returns LO=size, HI=number of strings (sz sz sz...)
-#define SP_PLST 44 // returns number of playlist entries size play_type
-*/ \ No newline at end of file
diff --git a/lib/win32/libwavpack/float.c b/lib/win32/libwavpack/float.c
deleted file mode 100644
index 19fb3a4600..0000000000
--- a/lib/win32/libwavpack/float.c
+++ /dev/null
@@ -1,371 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// float.c
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-#ifdef PACK
-
-void write_float_info (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- char *byteptr;
-
- byteptr = wpmd->data = malloc (4);
- wpmd->id = ID_FLOAT_INFO;
- *byteptr++ = wps->float_flags;
- *byteptr++ = wps->float_shift;
- *byteptr++ = wps->float_max_exp;
- *byteptr++ = wps->float_norm_exp;
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-int scan_float_data (WavpackStream *wps, f32 *values, int32_t num_values)
-{
- int32_t shifted_ones = 0, shifted_zeros = 0, shifted_both = 0;
- int32_t false_zeros = 0, neg_zeros = 0;
- uint32_t ordata = 0, crc = 0xffffffff;
- int max_exp = 0, shift_count;
- int32_t count, value;
- f32 *dp;
-
- wps->float_shift = wps->float_flags = 0;
-
- for (dp = values, count = num_values; count--; dp++) {
- crc = crc * 27 + dp->mantissa * 9 + dp->exponent * 3 + dp->sign;
-
- if (dp->exponent > max_exp && dp->exponent < 255)
- max_exp = dp->exponent;
- }
-
- wps->crc_x = crc;
-
- for (dp = values, count = num_values; count--; dp++) {
- if (dp->exponent == 255) {
- wps->float_flags |= FLOAT_EXCEPTIONS;
- value = 0x1000000;
- shift_count = 0;
- }
- else if (dp->exponent) {
- shift_count = max_exp - dp->exponent;
- value = 0x800000 + dp->mantissa;
- }
- else {
- shift_count = max_exp ? max_exp - 1 : 0;
- value = dp->mantissa;
-
-// if (dp->mantissa)
-// denormals++;
- }
-
- if (shift_count < 25)
- value >>= shift_count;
- else
- value = 0;
-
- if (!value) {
- if (dp->exponent || dp->mantissa)
- ++false_zeros;
- else if (dp->sign)
- ++neg_zeros;
- }
- else if (shift_count) {
- int32_t mask = (1 << shift_count) - 1;
-
- if (!(dp->mantissa & mask))
- shifted_zeros++;
- else if ((dp->mantissa & mask) == mask)
- shifted_ones++;
- else
- shifted_both++;
- }
-
- ordata |= value;
- * (int32_t *) dp = (dp->sign) ? -value : value;
- }
-
- wps->float_max_exp = max_exp;
-
- if (shifted_both)
- wps->float_flags |= FLOAT_SHIFT_SENT;
- else if (shifted_ones && !shifted_zeros)
- wps->float_flags |= FLOAT_SHIFT_ONES;
- else if (shifted_ones && shifted_zeros)
- wps->float_flags |= FLOAT_SHIFT_SAME;
- else if (ordata && !(ordata & 1)) {
- while (!(ordata & 1)) {
- wps->float_shift++;
- ordata >>= 1;
- }
-
- for (dp = values, count = num_values; count--; dp++)
- * (int32_t *) dp >>= wps->float_shift;
- }
-
- wps->wphdr.flags &= ~MAG_MASK;
-
- while (ordata) {
- wps->wphdr.flags += 1 << MAG_LSB;
- ordata >>= 1;
- }
-
- if (false_zeros || neg_zeros)
- wps->float_flags |= FLOAT_ZEROS_SENT;
-
- if (neg_zeros)
- wps->float_flags |= FLOAT_NEG_ZEROS;
-
-// error_line ("samples = %d, max exp = %d, pre-shift = %d, denormals = %d",
-// num_values, max_exp, wps->float_shift, denormals);
-// if (wps->float_flags & FLOAT_EXCEPTIONS)
-// error_line ("exceptions!");
-// error_line ("shifted ones/zeros/both = %d/%d/%d, true/neg/false zeros = %d/%d/%d",
-// shifted_ones, shifted_zeros, shifted_both, true_zeros, neg_zeros, false_zeros);
-
- return wps->float_flags & (FLOAT_EXCEPTIONS | FLOAT_ZEROS_SENT | FLOAT_SHIFT_SENT | FLOAT_SHIFT_SAME);
-}
-
-void send_float_data (WavpackStream *wps, f32 *values, int32_t num_values)
-{
- int max_exp = wps->float_max_exp;
- int32_t count, value, shift_count;
- f32 *dp;
-
- for (dp = values, count = num_values; count--; dp++) {
- if (dp->exponent == 255) {
- if (dp->mantissa) {
- putbit_1 (&wps->wvxbits);
- putbits (dp->mantissa, 23, &wps->wvxbits);
- }
- else {
- putbit_0 (&wps->wvxbits);
- }
-
- value = 0x1000000;
- shift_count = 0;
- }
- else if (dp->exponent) {
- shift_count = max_exp - dp->exponent;
- value = 0x800000 + dp->mantissa;
- }
- else {
- shift_count = max_exp ? max_exp - 1 : 0;
- value = dp->mantissa;
- }
-
- if (shift_count < 25)
- value >>= shift_count;
- else
- value = 0;
-
- if (!value) {
- if (wps->float_flags & FLOAT_ZEROS_SENT) {
- if (dp->exponent || dp->mantissa) {
- putbit_1 (&wps->wvxbits);
- putbits (dp->mantissa, 23, &wps->wvxbits);
-
- if (max_exp >= 25) {
- putbits (dp->exponent, 8, &wps->wvxbits);
- }
-
- putbit (dp->sign, &wps->wvxbits);
- }
- else {
- putbit_0 (&wps->wvxbits);
-
- if (wps->float_flags & FLOAT_NEG_ZEROS)
- putbit (dp->sign, &wps->wvxbits);
- }
- }
- }
- else if (shift_count) {
- if (wps->float_flags & FLOAT_SHIFT_SENT) {
- int32_t data = dp->mantissa & ((1 << shift_count) - 1);
- putbits (data, shift_count, &wps->wvxbits);
- }
- else if (wps->float_flags & FLOAT_SHIFT_SAME) {
- putbit (dp->mantissa & 1, &wps->wvxbits);
- }
- }
- }
-}
-
-#endif
-
-#if defined(UNPACK) || defined(INFO_ONLY)
-
-int read_float_info (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int bytecnt = wpmd->byte_length;
- char *byteptr = wpmd->data;
-
- if (bytecnt != 4)
- return FALSE;
-
- wps->float_flags = *byteptr++;
- wps->float_shift = *byteptr++;
- wps->float_max_exp = *byteptr++;
- wps->float_norm_exp = *byteptr;
- return TRUE;
-}
-
-#endif
-
-#ifdef UNPACK
-
-static void float_values_nowvx (WavpackStream *wps, int32_t *values, int32_t num_values);
-
-void float_values (WavpackStream *wps, int32_t *values, int32_t num_values)
-{
- uint32_t crc = wps->crc_x;
-
- if (!bs_is_open (&wps->wvxbits)) {
- float_values_nowvx (wps, values, num_values);
- return;
- }
-
- while (num_values--) {
- int shift_count = 0, exp = wps->float_max_exp;
- f32 outval = { 0, 0, 0 };
- uint32_t temp;
-
- if (*values == 0) {
- if (wps->float_flags & FLOAT_ZEROS_SENT) {
- if (getbit (&wps->wvxbits)) {
- getbits (&temp, 23, &wps->wvxbits);
- outval.mantissa = temp;
-
- if (exp >= 25) {
- getbits (&temp, 8, &wps->wvxbits);
- outval.exponent = temp;
- }
-
- outval.sign = getbit (&wps->wvxbits);
- }
- else if (wps->float_flags & FLOAT_NEG_ZEROS)
- outval.sign = getbit (&wps->wvxbits);
- }
- }
- else {
- *values <<= wps->float_shift;
-
- if (*values < 0) {
- *values = -*values;
- outval.sign = 1;
- }
-
- if (*values == 0x1000000) {
- if (getbit (&wps->wvxbits)) {
- getbits (&temp, 23, &wps->wvxbits);
- outval.mantissa = temp;
- }
-
- outval.exponent = 255;
- }
- else {
- if (exp)
- while (!(*values & 0x800000) && --exp) {
- shift_count++;
- *values <<= 1;
- }
-
- if (shift_count) {
- if ((wps->float_flags & FLOAT_SHIFT_ONES) ||
- ((wps->float_flags & FLOAT_SHIFT_SAME) && getbit (&wps->wvxbits)))
- *values |= ((1 << shift_count) - 1);
- else if (wps->float_flags & FLOAT_SHIFT_SENT) {
- getbits (&temp, shift_count, &wps->wvxbits);
- *values |= temp & ((1 << shift_count) - 1);
- }
- }
-
- outval.mantissa = *values;
- outval.exponent = exp;
- }
- }
-
- crc = crc * 27 + outval.mantissa * 9 + outval.exponent * 3 + outval.sign;
- * (f32 *) values++ = outval;
- }
-
- wps->crc_x = crc;
-}
-
-static void float_values_nowvx (WavpackStream *wps, int32_t *values, int32_t num_values)
-{
- while (num_values--) {
- int shift_count = 0, exp = wps->float_max_exp;
- f32 outval = { 0, 0, 0 };
-
- if (*values) {
- *values <<= wps->float_shift;
-
- if (*values < 0) {
- *values = -*values;
- outval.sign = 1;
- }
-
- if (*values >= 0x1000000) {
- while (*values & 0xf000000) {
- *values >>= 1;
- ++exp;
- }
- }
- else if (exp) {
- while (!(*values & 0x800000) && --exp) {
- shift_count++;
- *values <<= 1;
- }
-
- if (shift_count && (wps->float_flags & FLOAT_SHIFT_ONES))
- *values |= ((1 << shift_count) - 1);
- }
-
- outval.mantissa = *values;
- outval.exponent = exp;
- }
-
- * (f32 *) values++ = outval;
- }
-}
-
-void float_normalize (int32_t *values, int32_t num_values, int delta_exp)
-{
- f32 *fvalues = (f32 *) values, fzero = { 0, 0, 0 };
- int exp;
-
- if (!delta_exp)
- return;
-
- while (num_values--) {
- if ((exp = fvalues->exponent) == 0 || exp + delta_exp <= 0)
- *fvalues = fzero;
- else if (exp == 255 || (exp += delta_exp) >= 255) {
- fvalues->exponent = 255;
- fvalues->mantissa = 0;
- }
- else
- fvalues->exponent = exp;
-
- fvalues++;
- }
-}
-
-#endif
diff --git a/lib/win32/libwavpack/license.txt b/lib/win32/libwavpack/license.txt
deleted file mode 100644
index c21b40fbb6..0000000000
--- a/lib/win32/libwavpack/license.txt
+++ /dev/null
@@ -1,25 +0,0 @@
- Copyright (c) 1998 - 2005 Conifer Software
- All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Conifer Software nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/lib/win32/libwavpack/md5.c b/lib/win32/libwavpack/md5.c
deleted file mode 100644
index fe27c4539a..0000000000
--- a/lib/win32/libwavpack/md5.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-
-/* Brutally hacked by John Walker back from ANSI C to K&R (no
- prototypes) to maintain the tradition that Netfone will compile
- with Sun's original "cc". */
-
-#include <memory.h> /* for memcpy() */
-#include "md5.h"
-
-#ifdef sgi
-#define HIGHFIRST
-#endif
-
-#ifdef sun
-#define HIGHFIRST
-#endif
-
-#ifndef HIGHFIRST
-#define byteReverse(buf, len) /* Nothing */
-#else
-/*
- * Note: this code is harmless on little-endian machines.
- */
-void byteReverse(buf, longs)
- unsigned char *buf; unsigned longs;
-{
- uint32 t;
- do {
- t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
- ((unsigned) buf[1] << 8 | buf[0]);
- *(uint32 *) buf = t;
- buf += 4;
- } while (--longs);
-}
-#endif
-
-/*
- * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
- * initialization constants.
- */
-void MD5Init(ctx)
- struct MD5Context *ctx;
-{
- ctx->buf[0] = 0x67452301;
- ctx->buf[1] = 0xefcdab89;
- ctx->buf[2] = 0x98badcfe;
- ctx->buf[3] = 0x10325476;
-
- ctx->bits[0] = 0;
- ctx->bits[1] = 0;
-}
-
-/*
- * Update context to reflect the concatenation of another buffer full
- * of bytes.
- */
-void MD5Update(ctx, buf, len)
- struct MD5Context *ctx; unsigned char *buf; unsigned len;
-{
- uint32 t;
-
- /* Update bitcount */
-
- t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
- ctx->bits[1]++; /* Carry from low to high */
- ctx->bits[1] += len >> 29;
-
- t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
-
- /* Handle any leading odd-sized chunks */
-
- if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
-
- t = 64 - t;
- if (len < t) {
- memcpy(p, buf, len);
- return;
- }
- memcpy(p, buf, t);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
- buf += t;
- len -= t;
- }
- /* Process data in 64-byte chunks */
-
- while (len >= 64) {
- memcpy(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
- buf += 64;
- len -= 64;
- }
-
- /* Handle any remaining bytes of data. */
-
- memcpy(ctx->in, buf, len);
-}
-
-/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
- * 1 0* (64-bit count of bits processed, MSB-first)
- */
-void MD5Final(digest, ctx)
- unsigned char digest[16]; struct MD5Context *ctx;
-{
- unsigned count;
- unsigned char *p;
-
- /* Compute number of bytes mod 64 */
- count = (ctx->bits[0] >> 3) & 0x3F;
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- p = ctx->in + count;
- *p++ = 0x80;
-
- /* Bytes of padding needed to make 64 bytes */
- count = 64 - 1 - count;
-
- /* Pad out to 56 mod 64 */
- if (count < 8) {
- /* Two lots of padding: Pad the first block to 64 bytes */
- memset(p, 0, count);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
-
- /* Now fill the next block with 56 bytes */
- memset(ctx->in, 0, 56);
- } else {
- /* Pad block to 56 bytes */
- memset(p, 0, count - 8);
- }
- byteReverse(ctx->in, 14);
-
- /* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
-
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
- byteReverse((unsigned char *) ctx->buf, 4);
- memcpy(digest, ctx->buf, 16);
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
-}
-
-
-/* The four core functions - F1 is optimized somewhat */
-
-/* #define F1(x, y, z) (x & y | ~x & z) */
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-/* This is the central step in the MD5 algorithm. */
-#define MD5STEP(f, w, x, y, z, data, s) \
- ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
-
-/*
- * The core of the MD5 algorithm, this alters an existing MD5 hash to
- * reflect the addition of 16 longwords of new data. MD5Update blocks
- * the data and converts bytes into longwords for this routine.
- */
-void MD5Transform(buf, in)
- uint32 buf[4]; uint32 in[16];
-{
- register uint32 a, b, c, d;
-
- a = buf[0];
- b = buf[1];
- c = buf[2];
- d = buf[3];
-
- MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
- MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
- MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
- MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
- MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
- MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
- MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
- MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
- MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
- MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
- MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
- MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
- MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
- MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
- MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
- MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
- MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
- MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
- MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
- MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
- MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
- MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
- MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
- MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
- MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
- MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
- MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
- MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
- MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
- MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
- MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
- MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
- MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
- MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
- MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
- MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
- MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
- MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
- MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
- MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
- MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
- MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
- MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
- MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
- MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
- MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
- MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
- MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
-
- MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
- MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
- MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
- MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
- MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
- MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
- MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
- MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
- MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
- MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
- MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
- MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
- MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
- MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
- MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
- MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
-
- buf[0] += a;
- buf[1] += b;
- buf[2] += c;
- buf[3] += d;
-}
diff --git a/lib/win32/libwavpack/md5.h b/lib/win32/libwavpack/md5.h
deleted file mode 100644
index 5aa29d2015..0000000000
--- a/lib/win32/libwavpack/md5.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef MD5_H
-#define MD5_H
-
-#if defined (__alpha__) || defined (__x86_64__)
-typedef unsigned int uint32;
-#else
-typedef unsigned long uint32;
-#endif
-
-struct MD5Context {
- uint32 buf[4];
- uint32 bits[2];
- unsigned char in[64];
-};
-
-extern void MD5Init();
-extern void MD5Update();
-extern void MD5Final();
-extern void MD5Transform();
-
-/*
- * This is needed to make RSAREF happy on some MS-DOS compilers.
- */
-typedef struct MD5Context MD5_CTX;
-
-#endif /* !MD5_H */
diff --git a/lib/win32/libwavpack/metadata.c b/lib/win32/libwavpack/metadata.c
deleted file mode 100644
index 922c166941..0000000000
--- a/lib/win32/libwavpack/metadata.c
+++ /dev/null
@@ -1,310 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// metadata.c
-
-// This module handles the metadata structure introduced in WavPack 4.0
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-#if defined(UNPACK) || defined(INFO_ONLY)
-
-int read_metadata_buff (WavpackMetadata *wpmd, uchar *blockbuff, uchar **buffptr)
-{
- WavpackHeader *wphdr = (WavpackHeader *) blockbuff;
- uchar *buffend = blockbuff + wphdr->ckSize + 8;
-
- if (buffend - *buffptr < 2)
- return FALSE;
-
- wpmd->id = *(*buffptr)++;
- wpmd->byte_length = *(*buffptr)++ << 1;
-
- if (wpmd->id & ID_LARGE) {
- wpmd->id &= ~ID_LARGE;
-
- if (buffend - *buffptr < 2)
- return FALSE;
-
- wpmd->byte_length += *(*buffptr)++ << 9;
- wpmd->byte_length += *(*buffptr)++ << 17;
- }
-
- if (wpmd->id & ID_ODD_SIZE) {
- wpmd->id &= ~ID_ODD_SIZE;
- wpmd->byte_length--;
- }
-
- if (wpmd->byte_length) {
- if (buffend - *buffptr < wpmd->byte_length + (wpmd->byte_length & 1)) {
- wpmd->data = NULL;
- return FALSE;
- }
-
- wpmd->data = *buffptr;
- (*buffptr) += wpmd->byte_length + (wpmd->byte_length & 1);
- }
- else
- wpmd->data = NULL;
-
- return TRUE;
-}
-
-int process_metadata (WavpackContext *wpc, WavpackMetadata *wpmd)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
-
- switch (wpmd->id) {
- case ID_DUMMY:
- return TRUE;
-
- case ID_DECORR_TERMS:
- return read_decorr_terms (wps, wpmd);
-
- case ID_DECORR_WEIGHTS:
- return read_decorr_weights (wps, wpmd);
-
- case ID_DECORR_SAMPLES:
- return read_decorr_samples (wps, wpmd);
-
- case ID_ENTROPY_VARS:
- return read_entropy_vars (wps, wpmd);
-
- case ID_HYBRID_PROFILE:
- return read_hybrid_profile (wps, wpmd);
-
- case ID_SHAPING_WEIGHTS:
- return read_shaping_info (wps, wpmd);
-
- case ID_FLOAT_INFO:
- return read_float_info (wps, wpmd);
-
- case ID_INT32_INFO:
- return read_int32_info (wps, wpmd);
-
- case ID_CHANNEL_INFO:
- return read_channel_info (wpc, wpmd);
-
- case ID_CONFIG_BLOCK:
- return read_config_info (wpc, wpmd);
-
- case ID_WV_BITSTREAM:
- return init_wv_bitstream (wps, wpmd);
-
- case ID_WVC_BITSTREAM:
- return init_wvc_bitstream (wps, wpmd);
-
- case ID_WVX_BITSTREAM:
- return init_wvx_bitstream (wps, wpmd);
-
- case ID_RIFF_HEADER: case ID_RIFF_TRAILER:
- return read_wrapper_data (wpc, wpmd);
-
- case ID_MD5_CHECKSUM:
- if (wpmd->byte_length == 16) {
- memcpy (wpc->config.md5_checksum, wpmd->data, 16);
- wpc->config.flags |= CONFIG_MD5_CHECKSUM;
- wpc->config.md5_read = 1;
- }
-
- return TRUE;
-
- default:
- return (wpmd->id & ID_OPTIONAL_DATA) ? TRUE : FALSE;
- }
-}
-
-#endif
-
-#ifdef PACK
-
-int copy_metadata (WavpackMetadata *wpmd, uchar *buffer_start, uchar *buffer_end)
-{
- uint32_t mdsize = wpmd->byte_length + (wpmd->byte_length & 1);
- WavpackHeader *wphdr = (WavpackHeader *) buffer_start;
-
- if (wpmd->byte_length & 1)
- ((char *) wpmd->data) [wpmd->byte_length] = 0;
-
- mdsize += (wpmd->byte_length > 510) ? 4 : 2;
- buffer_start += wphdr->ckSize + 8;
-
- if (buffer_start + mdsize >= buffer_end)
- return FALSE;
-
- buffer_start [0] = wpmd->id | (wpmd->byte_length & 1 ? ID_ODD_SIZE : 0);
- buffer_start [1] = (wpmd->byte_length + 1) >> 1;
-
- if (wpmd->byte_length > 510) {
- buffer_start [0] |= ID_LARGE;
- buffer_start [2] = (wpmd->byte_length + 1) >> 9;
- buffer_start [3] = (wpmd->byte_length + 1) >> 17;
- }
-
- if (wpmd->data && wpmd->byte_length) {
- if (wpmd->byte_length > 510) {
- buffer_start [0] |= ID_LARGE;
- buffer_start [2] = (wpmd->byte_length + 1) >> 9;
- buffer_start [3] = (wpmd->byte_length + 1) >> 17;
- memcpy (buffer_start + 4, wpmd->data, mdsize - 4);
- }
- else
- memcpy (buffer_start + 2, wpmd->data, mdsize - 2);
- }
-
- wphdr->ckSize += mdsize;
- return TRUE;
-}
-
-int add_to_metadata (WavpackContext *wpc, void *data, uint32_t bcount, uchar id)
-{
- WavpackMetadata *mdp;
- uchar *src = data;
-
- while (bcount) {
- if (wpc->metacount) {
- uint32_t bc = bcount;
-
- mdp = wpc->metadata + wpc->metacount - 1;
-
- if (mdp->id == id) {
- if (wpc->metabytes + bcount > 1000000)
- bc = 1000000 - wpc->metabytes;
-
- mdp->data = realloc (mdp->data, mdp->byte_length + bc);
- memcpy ((char *) mdp->data + mdp->byte_length, src, bc);
- mdp->byte_length += bc;
- wpc->metabytes += bc;
- bcount -= bc;
- src += bc;
-
- if (wpc->metabytes >= 1000000 && !write_metadata_block (wpc))
- return FALSE;
- }
- }
-
- if (bcount) {
- wpc->metadata = realloc (wpc->metadata, (wpc->metacount + 1) * sizeof (WavpackMetadata));
- mdp = wpc->metadata + wpc->metacount++;
- mdp->byte_length = 0;
- mdp->data = NULL;
- mdp->id = id;
- }
- }
-
- return TRUE;
-}
-
-static char *write_metadata (WavpackMetadata *wpmd, char *outdata)
-{
- uchar id = wpmd->id, wordlen [3];
-
- wordlen [0] = (wpmd->byte_length + 1) >> 1;
- wordlen [1] = (wpmd->byte_length + 1) >> 9;
- wordlen [2] = (wpmd->byte_length + 1) >> 17;
-
- if (wpmd->byte_length & 1) {
-// ((char *) wpmd->data) [wpmd->byte_length] = 0;
- id |= ID_ODD_SIZE;
- }
-
- if (wordlen [1] || wordlen [2])
- id |= ID_LARGE;
-
- *outdata++ = id;
- *outdata++ = wordlen [0];
-
- if (id & ID_LARGE) {
- *outdata++ = wordlen [1];
- *outdata++ = wordlen [2];
- }
-
- if (wpmd->data && wpmd->byte_length) {
- memcpy (outdata, wpmd->data, wpmd->byte_length);
- outdata += wpmd->byte_length;
-
- if (wpmd->byte_length & 1)
- *outdata++ = 0;
- }
-
- return outdata;
-}
-
-int write_metadata_block (WavpackContext *wpc)
-{
- char *block_buff, *block_ptr;
- WavpackHeader *wphdr;
-
- if (wpc->metacount) {
- int metacount = wpc->metacount, block_size = sizeof (WavpackHeader);
- WavpackMetadata *wpmdp = wpc->metadata;
-
- while (metacount--) {
- block_size += wpmdp->byte_length + (wpmdp->byte_length & 1);
- block_size += (wpmdp->byte_length > 510) ? 4 : 2;
- wpmdp++;
- }
-
- wphdr = (WavpackHeader *) (block_buff = malloc (block_size));
-
- CLEAR (*wphdr);
- memcpy (wphdr->ckID, "wvpk", 4);
- wphdr->total_samples = wpc->total_samples;
- wphdr->version = 0x403;
- wphdr->ckSize = block_size - 8;
- wphdr->block_samples = 0;
-
- block_ptr = (char *)(wphdr + 1);
-
- wpmdp = wpc->metadata;
-
- while (wpc->metacount) {
- block_ptr = write_metadata (wpmdp, block_ptr);
- wpc->metabytes -= wpmdp->byte_length;
- free_metadata (wpmdp++);
- wpc->metacount--;
- }
-
- free (wpc->metadata);
- wpc->metadata = NULL;
- native_to_little_endian ((WavpackHeader *) block_buff, WavpackHeaderFormat);
-
- if (!wpc->blockout (wpc->wv_out, block_buff, block_size)) {
- free (block_buff);
- strcpy (wpc->error_message, "can't write WavPack data, disk probably full!");
- return FALSE;
- }
-
- free (block_buff);
- }
-
- return TRUE;
-}
-
-#endif
-
-void free_metadata (WavpackMetadata *wpmd)
-{
- if (wpmd->data) {
- free (wpmd->data);
- wpmd->data = NULL;
- }
-}
diff --git a/lib/win32/libwavpack/pack.c b/lib/win32/libwavpack/pack.c
deleted file mode 100644
index 46871041d1..0000000000
--- a/lib/win32/libwavpack/pack.c
+++ /dev/null
@@ -1,1413 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// pack.c
-
-// This module actually handles the compression of the audio data, except for
-// the entropy coding which is handled by the words? modules. For efficiency,
-// the conversion is isolated to tight loops that handle an entire buffer.
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-// This flag provides faster encoding speed at the expense of more code. The
-// improvement applies to 16-bit stereo lossless only.
-
-#define FAST_ENCODE
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-//////////////////////////////// local tables ///////////////////////////////
-
-// These two tables specify the characteristics of the decorrelation filters.
-// Each term represents one layer of the sequential filter, where positive
-// values indicate the relative sample involved from the same channel (1=prev),
-// 17 & 18 are special functions using the previous 2 samples, and negative
-// values indicate cross channel decorrelation (in stereo only).
-
-const char default_terms [] = { 18,18,2,3,-2,0 };
-const char high_terms [] = { 18,18,2,3,-2,18,2,4,7,5,3,6,8,-1,18,2,0 };
-const char fast_terms [] = { 17,17,0 };
-
-///////////////////////////// executable code ////////////////////////////////
-
-// This function initializes everything required to pack WavPack bitstreams
-// and must be called BEFORE any other function in this module.
-
-void pack_init (WavpackContext *wpc)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t flags = wps->wphdr.flags;
- struct decorr_pass *dpp;
- const char *term_string;
- int ti;
-
- wps->sample_index = 0;
- wps->delta_decay = 2.0;
- CLEAR (wps->decorr_passes);
- CLEAR (wps->dc);
-
- if (wpc->config.flags & CONFIG_AUTO_SHAPING)
- wps->dc.shaping_acc [0] = wps->dc.shaping_acc [1] =
- (wpc->config.sample_rate < 64000 || (wps->wphdr.flags & CROSS_DECORR)) ? -512L << 16 : 1024L << 16;
- else {
- int32_t weight = (int32_t) floor (wpc->config.shaping_weight * 1024.0 + 0.5);
-
- if (weight <= -1000)
- weight = -1000;
-
- wps->dc.shaping_acc [0] = wps->dc.shaping_acc [1] = weight << 16;
- }
-
- if (wpc->config.flags & CONFIG_HIGH_FLAG)
- term_string = high_terms;
- else if (wpc->config.flags & CONFIG_FAST_FLAG)
- term_string = fast_terms;
- else
- term_string = default_terms;
-
- for (dpp = wps->decorr_passes, ti = 0; ti < strlen (term_string); ti++)
- if (term_string [ti] >= 0 || (flags & CROSS_DECORR)) {
- dpp->term = term_string [ti];
- dpp++->delta = 2;
- }
- else if (!(flags & MONO_FLAG)) {
- dpp->term = -3;
- dpp++->delta = 2;
- }
-
- wps->num_terms = dpp - wps->decorr_passes;
- init_words (wps);
-}
-
-// Allocate room for and copy the decorrelation terms from the decorr_passes
-// array into the specified metadata structure. Both the actual term id and
-// the delta are packed into single characters.
-
-void write_decorr_terms (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int tcount = wps->num_terms;
- struct decorr_pass *dpp;
- char *byteptr;
-
- byteptr = wpmd->data = malloc (tcount + 1);
- wpmd->id = ID_DECORR_TERMS;
-
- for (dpp = wps->decorr_passes; tcount--; ++dpp)
- *byteptr++ = ((dpp->term + 5) & 0x1f) | ((dpp->delta << 5) & 0xe0);
-
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-// Allocate room for and copy the decorrelation term weights from the
-// decorr_passes array into the specified metadata structure. The weights
-// range +/-1024, but are rounded and truncated to fit in signed chars for
-// metadata storage. Weights are separate for the two channels
-
-void write_decorr_weights (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int tcount = wps->num_terms;
- struct decorr_pass *dpp;
- char *byteptr;
-
- byteptr = wpmd->data = malloc ((tcount * 2) + 1);
- wpmd->id = ID_DECORR_WEIGHTS;
-
- for (dpp = wps->decorr_passes; tcount--; ++dpp) {
- dpp->weight_A = restore_weight (*byteptr++ = store_weight (dpp->weight_A));
-
- if (!(wps->wphdr.flags & MONO_FLAG))
- dpp->weight_B = restore_weight (*byteptr++ = store_weight (dpp->weight_B));
- }
-
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-// Allocate room for and copy the decorrelation samples from the decorr_passes
-// array into the specified metadata structure. The samples are signed 32-bit
-// values, but are converted to signed log2 values for storage in metadata.
-// Values are stored for both channels and are specified from the first term
-// with unspecified samples set to zero. The number of samples stored varies
-// with the actual term value, so those must obviously be specified before
-// these in the metadata list. Any number of terms can have their samples
-// specified from no terms to all the terms, however I have found that
-// sending more than the first term's samples is a waste. The "wcount"
-// variable can be set to the number of terms to have their samples stored.
-
-void write_decorr_samples (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int tcount = wps->num_terms, wcount = 1, temp;
- struct decorr_pass *dpp;
- uchar *byteptr;
-
- byteptr = wpmd->data = malloc (256);
- wpmd->id = ID_DECORR_SAMPLES;
-
- for (dpp = wps->decorr_passes; tcount--; ++dpp)
- if (wcount) {
- if (dpp->term > MAX_TERM) {
- dpp->samples_A [0] = exp2s (temp = log2s (dpp->samples_A [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- dpp->samples_A [1] = exp2s (temp = log2s (dpp->samples_A [1]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- dpp->samples_B [0] = exp2s (temp = log2s (dpp->samples_B [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- dpp->samples_B [1] = exp2s (temp = log2s (dpp->samples_B [1]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- }
- }
- else if (dpp->term < 0) {
- dpp->samples_A [0] = exp2s (temp = log2s (dpp->samples_A [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- dpp->samples_B [0] = exp2s (temp = log2s (dpp->samples_B [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- }
- else {
- int m = 0, cnt = dpp->term;
-
- while (cnt--) {
- dpp->samples_A [m] = exp2s (temp = log2s (dpp->samples_A [m]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- dpp->samples_B [m] = exp2s (temp = log2s (dpp->samples_B [m]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- }
-
- m++;
- }
- }
-
- wcount--;
- }
- else {
- CLEAR (dpp->samples_A);
- CLEAR (dpp->samples_B);
- }
-
- wpmd->byte_length = byteptr - (uchar *) wpmd->data;
-}
-
-// Allocate room for and copy the noise shaping info into the specified
-// metadata structure. These would normally be written to the
-// "correction" file and are used for lossless reconstruction of
-// hybrid data. The "delta" parameter is not yet used in encoding as it
-// will be part of the "quality" mode.
-
-void write_shaping_info (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- char *byteptr;
- int temp;
-
-#if 0
- if (wps->wphdr.block_samples) {
- wps->dc.shaping_delta [0] = (-wps->dc.shaping_acc [0] - wps->dc.shaping_acc [0]) / (int32_t) wps->wphdr.block_samples;
- wps->dc.shaping_delta [1] = (-wps->dc.shaping_acc [1] - wps->dc.shaping_acc [1]) / (int32_t) wps->wphdr.block_samples;
- }
-#endif
-
- byteptr = wpmd->data = malloc (12);
- wpmd->id = ID_SHAPING_WEIGHTS;
-
- wps->dc.error [0] = exp2s (temp = log2s (wps->dc.error [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- wps->dc.shaping_acc [0] = exp2s (temp = log2s (wps->dc.shaping_acc [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->dc.error [1] = exp2s (temp = log2s (wps->dc.error [1]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- wps->dc.shaping_acc [1] = exp2s (temp = log2s (wps->dc.shaping_acc [1]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- }
-
- if (wps->dc.shaping_delta [0] | wps->dc.shaping_delta [1]) {
- wps->dc.shaping_delta [0] = exp2s (temp = log2s (wps->dc.shaping_delta [0]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->dc.shaping_delta [1] = exp2s (temp = log2s (wps->dc.shaping_delta [1]));
- *byteptr++ = temp;
- *byteptr++ = temp >> 8;
- }
- }
-
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-// Allocate room for and copy the int32 data values into the specified
-// metadata structure. This data is used for integer data that has more
-// than 24 bits of magnitude or, in some cases, it's used to eliminate
-// redundant bits from any audio stream.
-
-void write_int32_info (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- char *byteptr;
-
- byteptr = wpmd->data = malloc (4);
- wpmd->id = ID_INT32_INFO;
- *byteptr++ = wps->int32_sent_bits;
- *byteptr++ = wps->int32_zeros;
- *byteptr++ = wps->int32_ones;
- *byteptr++ = wps->int32_dups;
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-// Allocate room for and copy the multichannel information into the specified
-// metadata structure. The first byte is the total number of channels and the
-// following bytes represent the channel_mask as described for Microsoft
-// WAVEFORMATEX.
-
-void write_channel_info (WavpackContext *wpc, WavpackMetadata *wpmd)
-{
- uint32_t mask = wpc->config.channel_mask;
- char *byteptr;
-
- byteptr = wpmd->data = malloc (4);
- wpmd->id = ID_CHANNEL_INFO;
- *byteptr++ = wpc->config.num_channels;
-
- while (mask) {
- *byteptr++ = mask;
- mask >>= 8;
- }
-
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-// Allocate room for and copy the configuration information into the specified
-// metadata structure. Currently, we just store the upper 3 bytes of
-// config.flags and only in the first block of audio data. Note that this is
-// for informational purposes not required for playback or decoding (like
-// whether high or fast mode was specified).
-
-void write_config_info (WavpackContext *wpc, WavpackMetadata *wpmd)
-{
- char *byteptr;
-
- byteptr = wpmd->data = malloc (4);
- wpmd->id = ID_CONFIG_BLOCK;
- *byteptr++ = (char) (wpc->config.flags >> 8);
- *byteptr++ = (char) (wpc->config.flags >> 16);
- *byteptr++ = (char) (wpc->config.flags >> 24);
- wpmd->byte_length = byteptr - (char *) wpmd->data;
-}
-
-// Pack an entire block of samples (either mono or stereo) into a completed
-// WavPack block. This function is actually a shell for pack_samples() and
-// performs tasks like handling any shift required by the format, preprocessing
-// of floating point data or integer data over 24 bits wide, and implementing
-// the "extra" mode (via the extra?.c modules). It is assumed that there is
-// sufficient space for the completed block at "wps->blockbuff" and that
-// "wps->blockend" points to the end of the available space. A return value of
-// FALSE indicates an error.
-
-static int scan_int32_data (WavpackStream *wps, int32_t *values, int32_t num_values);
-static void send_int32_data (WavpackStream *wps, int32_t *values, int32_t num_values);
-static int pack_samples (WavpackContext *wpc, int32_t *buffer);
-
-int pack_block (WavpackContext *wpc, int32_t *buffer)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t flags = wps->wphdr.flags, sflags = wps->wphdr.flags;
- uint32_t sample_count = wps->wphdr.block_samples;
- int32_t *orig_data = NULL;
-
- if (flags & SHIFT_MASK) {
- int shift = (flags & SHIFT_MASK) >> SHIFT_LSB;
- int mag = (flags & MAG_MASK) >> MAG_LSB;
- uint32_t cnt = sample_count;
- int32_t *ptr = buffer;
-
- if (flags & MONO_FLAG)
- while (cnt--)
- *ptr++ >>= shift;
- else
- while (cnt--) {
- *ptr++ >>= shift;
- *ptr++ >>= shift;
- }
-
- if ((mag -= shift) < 0)
- flags &= ~MAG_MASK;
- else
- flags -= (1 << MAG_LSB) * shift;
-
- wps->wphdr.flags = flags;
- }
-
- if ((flags & FLOAT_DATA) || (flags & MAG_MASK) >> MAG_LSB >= 24) {
- if ((!(flags & HYBRID_FLAG) || wpc->wvc_flag) && !(wpc->config.flags & CONFIG_SKIP_WVX)) {
- orig_data = malloc (sizeof (f32) * ((flags & MONO_FLAG) ? sample_count : sample_count * 2));
- memcpy (orig_data, buffer, sizeof (f32) * ((flags & MONO_FLAG) ? sample_count : sample_count * 2));
-
- if (flags & FLOAT_DATA) {
- wps->float_norm_exp = wpc->config.float_norm_exp;
-
- if (!scan_float_data (wps, (f32 *) buffer, (flags & MONO_FLAG) ? sample_count : sample_count * 2)) {
- free (orig_data);
- orig_data = NULL;
- }
- }
- else {
- if (!scan_int32_data (wps, buffer, (flags & MONO_FLAG) ? sample_count : sample_count * 2)) {
- free (orig_data);
- orig_data = NULL;
- }
- }
- }
- else {
- if (flags & FLOAT_DATA) {
- wps->float_norm_exp = wpc->config.float_norm_exp;
-
- if (scan_float_data (wps, (f32 *) buffer, (flags & MONO_FLAG) ? sample_count : sample_count * 2))
- wpc->lossy_blocks = TRUE;
- }
- else if (scan_int32_data (wps, buffer, (flags & MONO_FLAG) ? sample_count : sample_count * 2))
- wpc->lossy_blocks = TRUE;
- }
-
- wpc->config.extra_flags |= EXTRA_SCAN_ONLY;
- }
- else if (wpc->config.extra_flags)
- scan_int32_data (wps, buffer, (flags & MONO_FLAG) ? sample_count : sample_count * 2);
-
- if (wpc->config.extra_flags) {
- if (flags & MONO_FLAG)
- analyze_mono (wpc, buffer);
- else
- analyze_stereo (wpc, buffer);
- }
- else if (!wps->sample_index || !wps->num_terms) {
- wpc->config.extra_flags = EXTRA_SCAN_ONLY;
-
- if (flags & MONO_FLAG)
- analyze_mono (wpc, buffer);
- else
- analyze_stereo (wpc, buffer);
-
- wpc->config.extra_flags = 0;
- }
-
- if (!pack_samples (wpc, buffer)) {
- wps->wphdr.flags = sflags;
-
- if (orig_data)
- free (orig_data);
-
- return FALSE;
- }
- else
- wps->wphdr.flags = sflags;
-
- if (orig_data) {
- uint32_t data_count;
- uchar *cptr;
-
- if (wpc->wvc_flag)
- cptr = wps->block2buff + ((WavpackHeader *) wps->block2buff)->ckSize + 8;
- else
- cptr = wps->blockbuff + ((WavpackHeader *) wps->blockbuff)->ckSize + 8;
-
- bs_open_write (&wps->wvxbits, cptr + 8, wpc->wvc_flag ? wps->block2end : wps->blockend);
-
- if (flags & FLOAT_DATA)
- send_float_data (wps, (f32*) orig_data, (flags & MONO_FLAG) ? sample_count : sample_count * 2);
- else
- send_int32_data (wps, orig_data, (flags & MONO_FLAG) ? sample_count : sample_count * 2);
-
- data_count = bs_close_write (&wps->wvxbits);
- free (orig_data);
-
- if (data_count) {
- if (data_count != (uint32_t) -1) {
- *cptr++ = ID_WVX_BITSTREAM | ID_LARGE;
- *cptr++ = (data_count += 4) >> 1;
- *cptr++ = data_count >> 9;
- *cptr++ = data_count >> 17;
- *cptr++ = wps->crc_x;
- *cptr++ = wps->crc_x >> 8;
- *cptr++ = wps->crc_x >> 16;
- *cptr = wps->crc_x >> 24;
-
- if (wpc->wvc_flag)
- ((WavpackHeader *) wps->block2buff)->ckSize += data_count + 4;
- else
- ((WavpackHeader *) wps->blockbuff)->ckSize += data_count + 4;
- }
- else
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-// Scan a buffer of long integer data and determine whether any redundancy in
-// the LSBs can be used to reduce the data's magnitude. If yes, then the
-// INT32_DATA flag is set and the int32 parameters are set. If bits must still
-// be transmitted literally to get down to 24 bits (which is all the integer
-// compression code can handle) then we return TRUE to indicate that a wvx
-// stream must be created in either lossless mode.
-
-static int scan_int32_data (WavpackStream *wps, int32_t *values, int32_t num_values)
-{
- uint32_t magdata = 0, ordata = 0, xordata = 0, anddata = ~0;
- uint32_t crc = 0xffffffff;
- int total_shift = 0;
- int32_t *dp, count;
-
- wps->int32_sent_bits = wps->int32_zeros = wps->int32_ones = wps->int32_dups = 0;
-
- for (dp = values, count = num_values; count--; dp++) {
- crc = crc * 9 + (*dp & 0xffff) * 3 + ((*dp >> 16) & 0xffff);
- magdata |= (*dp < 0) ? ~*dp : *dp;
- xordata |= *dp ^ -(*dp & 1);
- anddata &= *dp;
- ordata |= *dp;
- }
-
- wps->crc_x = crc;
- wps->wphdr.flags &= ~MAG_MASK;
-
- while (magdata) {
- wps->wphdr.flags += 1 << MAG_LSB;
- magdata >>= 1;
- }
-
- if (!((wps->wphdr.flags & MAG_MASK) >> MAG_LSB)) {
- wps->wphdr.flags &= ~INT32_DATA;
- return FALSE;
- }
-
- if (!(ordata & 1))
- while (!(ordata & 1)) {
- wps->wphdr.flags -= 1 << MAG_LSB;
- wps->int32_zeros++;
- total_shift++;
- ordata >>= 1;
- }
- else if (anddata & 1)
- while (anddata & 1) {
- wps->wphdr.flags -= 1 << MAG_LSB;
- wps->int32_ones++;
- total_shift++;
- anddata >>= 1;
- }
- else if (!(xordata & 2))
- while (!(xordata & 2)) {
- wps->wphdr.flags -= 1 << MAG_LSB;
- wps->int32_dups++;
- total_shift++;
- xordata >>= 1;
- }
-
- if (((wps->wphdr.flags & MAG_MASK) >> MAG_LSB) > 23) {
- wps->int32_sent_bits = ((wps->wphdr.flags & MAG_MASK) >> MAG_LSB) - 23;
- total_shift += wps->int32_sent_bits;
- wps->wphdr.flags &= ~MAG_MASK;
- wps->wphdr.flags += 23 << MAG_LSB;
- }
-
- if (total_shift) {
- wps->wphdr.flags |= INT32_DATA;
-
- for (dp = values, count = num_values; count--; dp++)
- *dp >>= total_shift;
- }
-
-#if 0
- if (wps->int32_sent_bits + wps->int32_zeros + wps->int32_ones + wps->int32_dups)
- error_line ("sent bits = %d, zeros/ones/dups = %d/%d/%d", wps->int32_sent_bits,
- wps->int32_zeros, wps->int32_ones, wps->int32_dups);
-#endif
-
- return wps->int32_sent_bits;
-}
-
-// For the specified buffer values and the int32 parameters stored in "wps",
-// send the literal bits required to the "wvxbits" bitstream.
-
-static void send_int32_data (WavpackStream *wps, int32_t *values, int32_t num_values)
-{
- int sent_bits = wps->int32_sent_bits, pre_shift;
- int32_t mask = (1 << sent_bits) - 1;
- int32_t count, value, *dp;
-
- pre_shift = wps->int32_zeros + wps->int32_ones + wps->int32_dups;
-
- if (sent_bits)
- for (dp = values, count = num_values; count--; dp++) {
- value = (*dp >> pre_shift) & mask;
- putbits (value, sent_bits, &wps->wvxbits);
- }
-}
-
-// Pack an entire block of samples (either mono or stereo) into a completed
-// WavPack block. It is assumed that there is sufficient space for the
-// completed block at "wps->blockbuff" and that "wps->blockend" points to the
-// end of the available space. A return value of FALSE indicates an error.
-// Any unsent metadata is transmitted first, then required metadata for this
-// block is sent, and finally the compressed integer data is sent. If a "wpx"
-// stream is required for floating point data or large integer data, then this
-// must be handled outside this function. To find out how much data was written
-// the caller must look at the ckSize field of the written WavpackHeader, NOT
-// the one in the WavpackStream.
-
-static void decorr_stereo_pass (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-static void decorr_stereo_pass_i (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-static void decorr_stereo_pass_id2 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-
-static int pack_samples (WavpackContext *wpc, int32_t *buffer)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t sample_count = wps->wphdr.block_samples;
- uint32_t flags = wps->wphdr.flags, data_count;
- int mag16 = ((flags & MAG_MASK) >> MAG_LSB) >= 16;
- int tcount, lossy = FALSE, m = 0;
- double noise_acc = 0.0, noise;
- struct decorr_pass *dpp;
- WavpackMetadata wpmd;
- uint32_t crc, crc2, i;
- int32_t *bptr;
-
- crc = crc2 = 0xffffffff;
-
- wps->wphdr.ckSize = sizeof (WavpackHeader) - 8;
- memcpy (wps->blockbuff, &wps->wphdr, sizeof (WavpackHeader));
-
- if (wpc->metacount) {
- WavpackMetadata *wpmdp = wpc->metadata;
-
- while (wpc->metacount) {
- copy_metadata (wpmdp, wps->blockbuff, wps->blockend);
- wpc->metabytes -= wpmdp->byte_length;
- free_metadata (wpmdp++);
- wpc->metacount--;
- }
-
- free (wpc->metadata);
- wpc->metadata = NULL;
- }
-
- if (!sample_count)
- return TRUE;
-
- write_decorr_terms (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
-
- write_decorr_weights (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
-
- write_decorr_samples (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
-
- write_entropy_vars (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
-
- if (flags & HYBRID_FLAG) {
- write_hybrid_profile (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
- }
-
- if (flags & FLOAT_DATA) {
- write_float_info (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
- }
-
- if (flags & INT32_DATA) {
- write_int32_info (wps, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
- }
-
- if ((flags & INITIAL_BLOCK) &&
- (wpc->config.num_channels > 2 ||
- wpc->config.channel_mask != 0x5 - wpc->config.num_channels)) {
- write_channel_info (wpc, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
- }
-
- if ((flags & INITIAL_BLOCK) && !wps->sample_index) {
- write_config_info (wpc, &wpmd);
- copy_metadata (&wpmd, wps->blockbuff, wps->blockend);
- free_metadata (&wpmd);
- }
-
- bs_open_write (&wps->wvbits, wps->blockbuff + ((WavpackHeader *) wps->blockbuff)->ckSize + 12, wps->blockend);
-
- if (wpc->wvc_flag) {
- wps->wphdr.ckSize = sizeof (WavpackHeader) - 8;
- memcpy (wps->block2buff, &wps->wphdr, sizeof (WavpackHeader));
-
- if (flags & HYBRID_SHAPE) {
- write_shaping_info (wps, &wpmd);
- copy_metadata (&wpmd, wps->block2buff, wps->block2end);
- free_metadata (&wpmd);
- }
-
- bs_open_write (&wps->wvcbits, wps->block2buff + ((WavpackHeader *) wps->block2buff)->ckSize + 12, wps->block2end);
- }
-
- /////////////////////// handle lossless mono mode /////////////////////////
-
- if (!(flags & HYBRID_FLAG) && (flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t code;
-
- crc = crc * 3 + (code = *bptr++);
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam;
-
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1)
- sam = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- sam = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = code;
- }
- else {
- sam = dpp->samples_A [m];
- dpp->samples_A [(m + dpp->term) & (MAX_TERM - 1)] = code;
- }
-
- code -= apply_weight (dpp->weight_A, sam);
- update_weight (dpp->weight_A, dpp->delta, sam, code);
- }
-
- m = (m + 1) & (MAX_TERM - 1);
- send_word_lossless (wps, code, 0);
- }
-
- //////////////////// handle the lossless stereo mode //////////////////////
-
-#ifdef FAST_ENCODE
- else if (!(flags & HYBRID_FLAG) && !(flags & MONO_FLAG)) {
- int32_t *eptr = buffer + (sample_count * 2), sam_A, sam_B;
-
- if (flags & JOINT_STEREO)
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- crc = crc * 9 + bptr [0] * 3 + bptr [1];
- bptr [1] += ((bptr [0] -= bptr [1]) >> 1);
- }
- else
- for (bptr = buffer; bptr < eptr; bptr += 2)
- crc = crc * 9 + bptr [0] * 3 + bptr [1];
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount-- ; dpp++)
- if (((flags & MAG_MASK) >> MAG_LSB) >= 16)
- decorr_stereo_pass (dpp, buffer, sample_count);
- else if (dpp->delta != 2)
- decorr_stereo_pass_i (dpp, buffer, sample_count);
- else
- decorr_stereo_pass_id2 (dpp, buffer, sample_count);
-
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- send_word_lossless (wps, bptr [0], 0);
- send_word_lossless (wps, bptr [1], 1);
- }
-
- m = sample_count & (MAX_TERM - 1);
- }
-#else
- else if (!(flags & HYBRID_FLAG) && !(flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i, bptr += 2) {
- int32_t left, right, sam_A, sam_B;
-
- crc = crc * 3 + (left = bptr [0]);
- crc = crc * 3 + (right = bptr [1]);
-
- if (flags & JOINT_STEREO)
- right += ((left -= right) >> 1);
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount-- ; dpp++) {
- if (dpp->term > 0) {
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- }
- else {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- }
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_A [0] = left;
- dpp->samples_B [0] = right;
- }
- else {
- int k = (m + dpp->term) & (MAX_TERM - 1);
-
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
- dpp->samples_A [k] = left;
- dpp->samples_B [k] = right;
- }
-
- left -= apply_weight (dpp->weight_A, sam_A);
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- update_weight (dpp->weight_B, dpp->delta, sam_B, right);
- }
- else {
- sam_A = (dpp->term == -2) ? right : dpp->samples_A [0];
- sam_B = (dpp->term == -1) ? left : dpp->samples_B [0];
- dpp->samples_A [0] = right;
- dpp->samples_B [0] = left;
- left -= apply_weight (dpp->weight_A, sam_A);
- right -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, left);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, right);
- }
- }
-
- m = (m + 1) & (MAX_TERM - 1);
- send_word_lossless (wps, left, 0);
- send_word_lossless (wps, right, 1);
- }
-#endif
-
- /////////////////// handle the lossy/hybrid mono mode /////////////////////
-
- else if ((flags & HYBRID_FLAG) && (flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t code, temp;
-
- crc2 = crc2 * 3 + (code = *bptr++);
-
- if (flags & HYBRID_SHAPE) {
- int shaping_weight = (wps->dc.shaping_acc [0] += wps->dc.shaping_delta [0]) >> 16;
- temp = -apply_weight (shaping_weight, wps->dc.error [0]);
-
- if ((flags & NEW_SHAPING) && shaping_weight < 0 && temp) {
- if (temp == wps->dc.error [0])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- wps->dc.error [0] = -code;
- code += temp;
- }
- else
- wps->dc.error [0] = -(code += temp);
- }
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount-- ; dpp++)
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1)
- dpp->samples_A [2] = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- dpp->samples_A [2] = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- code -= (dpp->aweight_A = apply_weight (dpp->weight_A, dpp->samples_A [2]));
- }
- else
- code -= (dpp->aweight_A = apply_weight (dpp->weight_A, dpp->samples_A [m]));
-
- code = send_word (wps, code, 0);
-
- while (--dpp >= wps->decorr_passes) {
- if (dpp->term > MAX_TERM) {
- update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [2], code);
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = (code += dpp->aweight_A);
- }
- else {
- int32_t sam = dpp->samples_A [m];
-
- update_weight (dpp->weight_A, dpp->delta, sam, code);
- dpp->samples_A [(m + dpp->term) & (MAX_TERM - 1)] = (code += dpp->aweight_A);
- }
- }
-
- wps->dc.error [0] += code;
- m = (m + 1) & (MAX_TERM - 1);
-
- if ((crc = crc * 3 + code) != crc2)
- lossy = TRUE;
-
- if (wpc->config.flags & CONFIG_CALC_NOISE) {
- noise = code - bptr [-1];
-
- noise_acc += noise *= noise;
- wps->dc.noise_ave = (wps->dc.noise_ave * 0.99) + (noise * 0.01);
-
- if (wps->dc.noise_ave > wps->dc.noise_max)
- wps->dc.noise_max = wps->dc.noise_ave;
- }
- }
-
- /////////////////// handle the lossy/hybrid stereo mode ///////////////////
-
- else if ((flags & HYBRID_FLAG) && !(flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t left, right, temp;
- int shaping_weight;
-
- left = *bptr++;
- crc2 = (crc2 * 3 + left) * 3 + (right = *bptr++);
-
- if (flags & HYBRID_SHAPE) {
- shaping_weight = (wps->dc.shaping_acc [0] += wps->dc.shaping_delta [0]) >> 16;
- temp = -apply_weight (shaping_weight, wps->dc.error [0]);
-
- if ((flags & NEW_SHAPING) && shaping_weight < 0 && temp) {
- if (temp == wps->dc.error [0])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- wps->dc.error [0] = -left;
- left += temp;
- }
- else
- wps->dc.error [0] = -(left += temp);
-
- shaping_weight = (wps->dc.shaping_acc [1] += wps->dc.shaping_delta [1]) >> 16;
- temp = -apply_weight (shaping_weight, wps->dc.error [1]);
-
- if ((flags & NEW_SHAPING) && shaping_weight < 0 && temp) {
- if (temp == wps->dc.error [1])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- wps->dc.error [1] = -right;
- right += temp;
- }
- else
- wps->dc.error [1] = -(right += temp);
- }
-
- if (flags & JOINT_STEREO)
- right += ((left -= right) >> 1);
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount-- ; dpp++)
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1) {
- dpp->samples_A [2] = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- dpp->samples_B [2] = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- }
- else {
- dpp->samples_A [2] = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- dpp->samples_B [2] = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- }
-
- left -= (dpp->aweight_A = apply_weight (dpp->weight_A, dpp->samples_A [2]));
- right -= (dpp->aweight_B = apply_weight (dpp->weight_B, dpp->samples_B [2]));
- }
- else if (dpp->term > 0) {
- left -= (dpp->aweight_A = apply_weight (dpp->weight_A, dpp->samples_A [m]));
- right -= (dpp->aweight_B = apply_weight (dpp->weight_B, dpp->samples_B [m]));
- }
- else {
- if (dpp->term == -1)
- dpp->samples_B [0] = left;
- else if (dpp->term == -2)
- dpp->samples_A [0] = right;
-
- left -= (dpp->aweight_A = apply_weight (dpp->weight_A, dpp->samples_A [0]));
- right -= (dpp->aweight_B = apply_weight (dpp->weight_B, dpp->samples_B [0]));
- }
-#if 0
-if (labs (left) > 60000000 || labs (right) > 60000000)
- error_line ("sending %d, %d; samples = %d, %d", left, right, bptr [-2], bptr [-1]);
-#endif
- left = send_word (wps, left, 0);
- right = send_word (wps, right, 1);
-
- while (--dpp >= wps->decorr_passes)
- if (dpp->term > MAX_TERM) {
- update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [2], left);
- update_weight (dpp->weight_B, dpp->delta, dpp->samples_B [2], right);
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = (left += dpp->aweight_A);
- dpp->samples_B [0] = (right += dpp->aweight_B);
- }
- else if (dpp->term > 0) {
- int k = (m + dpp->term) & (MAX_TERM - 1);
-
- update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [m], left);
- dpp->samples_A [k] = (left += dpp->aweight_A);
-
- update_weight (dpp->weight_B, dpp->delta, dpp->samples_B [m], right);
- dpp->samples_B [k] = (right += dpp->aweight_B);
- }
- else {
- if (dpp->term == -1) {
- dpp->samples_B [0] = left + dpp->aweight_A;
- dpp->aweight_B = apply_weight (dpp->weight_B, dpp->samples_B [0]);
- }
- else if (dpp->term == -2) {
- dpp->samples_A [0] = right + dpp->aweight_B;
- dpp->aweight_A = apply_weight (dpp->weight_A, dpp->samples_A [0]);
- }
-
- update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], left);
- update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], right);
- dpp->samples_B [0] = (left += dpp->aweight_A);
- dpp->samples_A [0] = (right += dpp->aweight_B);
- }
-
- if (flags & JOINT_STEREO)
- left += (right -= (left >> 1));
-
- wps->dc.error [0] += left;
- wps->dc.error [1] += right;
- m = (m + 1) & (MAX_TERM - 1);
-
- if ((crc = (crc * 3 + left) * 3 + right) != crc2)
- lossy = TRUE;
-
- if (wpc->config.flags & CONFIG_CALC_NOISE) {
- noise = (double)(left - bptr [-2]) * (left - bptr [-2]);
- noise += (double)(right - bptr [-1]) * (right - bptr [-1]);
-
- noise_acc += noise /= 2.0;
- wps->dc.noise_ave = (wps->dc.noise_ave * 0.99) + (noise * 0.01);
-
- if (wps->dc.noise_ave > wps->dc.noise_max)
- wps->dc.noise_max = wps->dc.noise_ave;
- }
- }
-
- if (m)
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0 && dpp->term <= MAX_TERM) {
- int32_t temp_A [MAX_TERM], temp_B [MAX_TERM];
- int k;
-
- memcpy (temp_A, dpp->samples_A, sizeof (dpp->samples_A));
- memcpy (temp_B, dpp->samples_B, sizeof (dpp->samples_B));
-
- for (k = 0; k < MAX_TERM; k++) {
- dpp->samples_A [k] = temp_A [m];
- dpp->samples_B [k] = temp_B [m];
- m = (m + 1) & (MAX_TERM - 1);
- }
- }
-
- if (wpc->config.flags & CONFIG_CALC_NOISE)
- wps->dc.noise_sum += noise_acc;
-
- flush_word (wps);
- data_count = bs_close_write (&wps->wvbits);
-
- if (data_count) {
- if (data_count != (uint32_t) -1) {
- uchar *cptr = wps->blockbuff + ((WavpackHeader *) wps->blockbuff)->ckSize + 8;
-
- *cptr++ = ID_WV_BITSTREAM | ID_LARGE;
- *cptr++ = data_count >> 1;
- *cptr++ = data_count >> 9;
- *cptr++ = data_count >> 17;
- ((WavpackHeader *) wps->blockbuff)->ckSize += data_count + 4;
- }
- else
- return FALSE;
- }
-
- ((WavpackHeader *) wps->blockbuff)->crc = crc;
-
- if (wpc->wvc_flag) {
- data_count = bs_close_write (&wps->wvcbits);
-
- if (data_count && lossy) {
- if (data_count != (uint32_t) -1) {
- uchar *cptr = wps->block2buff + ((WavpackHeader *) wps->block2buff)->ckSize + 8;
-
- *cptr++ = ID_WVC_BITSTREAM | ID_LARGE;
- *cptr++ = data_count >> 1;
- *cptr++ = data_count >> 9;
- *cptr++ = data_count >> 17;
- ((WavpackHeader *) wps->block2buff)->ckSize += data_count + 4;
- }
- else
- return FALSE;
- }
-
- ((WavpackHeader *) wps->block2buff)->crc = crc2;
- }
- else if (lossy)
- wpc->lossy_blocks = TRUE;
-
- wps->sample_index += sample_count;
- return TRUE;
-}
-
-#ifdef FAST_ENCODE
-
-static void decorr_stereo_pass_id2 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case 8:
- for (m = 0, bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- dpp->samples_A [m] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = dpp->samples_B [m];
- dpp->samples_B [m] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- m = (m + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- dpp->samples_A [k] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, dpp->samples_A [m]);
- update_weight_d2 (dpp->weight_A, dpp->delta, dpp->samples_A [m], bptr [0]);
-
- dpp->samples_B [k] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, dpp->samples_B [m]);
- update_weight_d2 (dpp->weight_B, dpp->delta, dpp->samples_B [m], bptr [1]);
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [0];
- sam_B = bptr [0];
- dpp->samples_A [0] = bptr [1];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_clip_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_clip_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [1];
- sam_B = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_clip_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_clip_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [0];
- sam_B = dpp->samples_B [0];
- dpp->samples_A [0] = bptr [1];
- dpp->samples_B [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_clip_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_clip_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
- }
-}
-
-static void decorr_stereo_pass_i (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- dpp->samples_A [k] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = dpp->samples_B [m];
- dpp->samples_B [k] = bptr [1];
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [0];
- sam_B = bptr [0];
- dpp->samples_A [0] = bptr [1];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [1];
- sam_B = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [0];
- sam_B = dpp->samples_B [0];
- dpp->samples_A [0] = bptr [1];
- dpp->samples_B [0] = bptr [0];
- bptr [0] -= apply_weight_i (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight_i (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
- }
-}
-
-static void decorr_stereo_pass (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = bptr [0];
- bptr [0] -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [1];
- bptr [1] -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_A [0] = bptr [0];
- bptr [0] -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- dpp->samples_B [1] = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [1];
- bptr [1] -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- dpp->samples_A [k] = bptr [0];
- bptr [0] -= apply_weight (dpp->weight_A, sam_A);
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
-
- sam_B = dpp->samples_B [m];
- dpp->samples_B [k] = bptr [1];
- bptr [1] -= apply_weight (dpp->weight_B, sam_B);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [0];
- sam_B = bptr [0];
- dpp->samples_A [0] = bptr [1];
- bptr [0] -= apply_weight (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [1];
- sam_B = dpp->samples_B [0];
- dpp->samples_B [0] = bptr [0];
- bptr [0] -= apply_weight (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [0];
- sam_B = dpp->samples_B [0];
- dpp->samples_A [0] = bptr [1];
- dpp->samples_B [0] = bptr [0];
- bptr [0] -= apply_weight (dpp->weight_A, sam_A);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- bptr [1] -= apply_weight (dpp->weight_B, sam_B);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
- }
-
- break;
- }
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// This function returns the accumulated RMS noise as a double if the //
-// CALC_NOISE bit was set in the WavPack header. The peak noise can also be //
-// returned if desired. See wavpack.c for the calculations required to //
-// convert this into decibels of noise below full scale. //
-//////////////////////////////////////////////////////////////////////////////
-
-double pack_noise (WavpackContext *wpc, double *peak)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
-
- if (peak)
- *peak = wps->dc.noise_max;
-
- return wps->dc.noise_sum;
-}
diff --git a/lib/win32/libwavpack/unpack.c b/lib/win32/libwavpack/unpack.c
deleted file mode 100644
index 2e1f0e6532..0000000000
--- a/lib/win32/libwavpack/unpack.c
+++ /dev/null
@@ -1,1453 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// unpack.c
-
-// This module actually handles the decompression of the audio data, except
-// for the entropy decoding which is handled by the words? modules. For
-// maximum efficiency, the conversion is isolated to tight loops that handle
-// an entire buffer.
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-// This flag provides faster decoding speed at the expense of more code. The
-// improvement applies to 16-bit stereo lossless only.
-
-#define FAST_DECODE
-
-#define LOSSY_MUTE
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-///////////////////////////// executable code ////////////////////////////////
-
-// This function initializes everything required to unpack a WavPack block
-// and must be called before unpack_samples() is called to obtain audio data.
-// It is assumed that the WavpackHeader has been read into the wps->wphdr
-// (in the current WavpackStream) and that the entire block has been read at
-// wps->blockbuff. If a correction file is available (wpc->wvc_flag = TRUE)
-// then the corresponding correction block must be read into wps->block2buff
-// and its WavpackHeader has overwritten the header at wps->wphdr. This is
-// where all the metadata blocks are scanned including those that contain
-// bitstream data.
-
-int unpack_init (WavpackContext *wpc)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uchar *blockptr, *block2ptr;
- WavpackMetadata wpmd;
-
- if (wps->wphdr.block_samples && wps->wphdr.block_index != (uint32_t) -1)
- wps->sample_index = wps->wphdr.block_index;
-
- wps->mute_error = FALSE;
- wps->crc = wps->crc_x = 0xffffffff;
- CLEAR (wps->wvbits);
- CLEAR (wps->wvcbits);
- CLEAR (wps->wvxbits);
- CLEAR (wps->decorr_passes);
- CLEAR (wps->dc);
- CLEAR (wps->w);
-
- blockptr = wps->blockbuff + sizeof (WavpackHeader);
-
- while (read_metadata_buff (&wpmd, wps->blockbuff, &blockptr))
- if (!process_metadata (wpc, &wpmd)) {
- sprintf (wpc->error_message, "invalid metadata %2x!", wpmd.id);
- return FALSE;
- }
-
- block2ptr = wps->block2buff + sizeof (WavpackHeader);
-
- while (wpc->wvc_flag && wps->wphdr.block_samples && read_metadata_buff (&wpmd, wps->block2buff, &block2ptr))
- if (!process_metadata (wpc, &wpmd)) {
- sprintf (wpc->error_message, "invalid metadata %2x in wvc file!", wpmd.id);
- return FALSE;
- }
-
- if (wps->wphdr.block_samples && !bs_is_open (&wps->wvbits)) {
- if (bs_is_open (&wps->wvcbits))
- strcpy (wpc->error_message, "can't unpack correction files alone!");
-
- return FALSE;
- }
-
- if (wps->wphdr.block_samples && !bs_is_open (&wps->wvxbits)) {
- if ((wps->wphdr.flags & INT32_DATA) && wps->int32_sent_bits)
- wpc->lossy_blocks = TRUE;
-
- if ((wps->wphdr.flags & FLOAT_DATA) &&
- wps->float_flags & (FLOAT_EXCEPTIONS | FLOAT_ZEROS_SENT | FLOAT_SHIFT_SENT | FLOAT_SHIFT_SAME))
- wpc->lossy_blocks = TRUE;
- }
-
- return TRUE;
-}
-
-// This function initialzes the main bitstream for audio samples, which must
-// be in the "wv" file.
-
-int init_wv_bitstream (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- bs_open_read (&wps->wvbits, wpmd->data, (char *) wpmd->data + wpmd->byte_length);
- return TRUE;
-}
-
-// This function initialzes the "correction" bitstream for audio samples,
-// which currently must be in the "wvc" file.
-
-int init_wvc_bitstream (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- bs_open_read (&wps->wvcbits, wpmd->data, (char *) wpmd->data + wpmd->byte_length);
- return TRUE;
-}
-
-// This function initialzes the "extra" bitstream for audio samples which
-// contains the information required to losslessly decompress 32-bit float data
-// or integer data that exceeds 24 bits. This bitstream is in the "wv" file
-// for pure lossless data or the "wvc" file for hybrid lossless. This data
-// would not be used for hybrid lossy mode. There is also a 32-bit CRC stored
-// in the first 4 bytes of these blocks.
-
-int init_wvx_bitstream (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- uchar *cp = wpmd->data;
-
- wps->crc_wvx = *cp++;
- wps->crc_wvx |= (int32_t) *cp++ << 8;
- wps->crc_wvx |= (int32_t) *cp++ << 16;
- wps->crc_wvx |= (int32_t) *cp++ << 24;
-
- bs_open_read (&wps->wvxbits, cp, (char *) wpmd->data + wpmd->byte_length);
- return TRUE;
-}
-
-// Read decorrelation terms from specified metadata block into the
-// decorr_passes array. The terms range from -3 to 8, plus 17 & 18;
-// other values are reserved and generate errors for now. The delta
-// ranges from 0 to 7 with all values valid. Note that the terms are
-// stored in the opposite order in the decorr_passes array compared
-// to packing.
-
-int read_decorr_terms (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int termcnt = wpmd->byte_length;
- uchar *byteptr = wpmd->data;
- struct decorr_pass *dpp;
-
- if (termcnt > MAX_NTERMS)
- return FALSE;
-
- wps->num_terms = termcnt;
-
- for (dpp = wps->decorr_passes + termcnt - 1; termcnt--; dpp--) {
- dpp->term = (int)(*byteptr & 0x1f) - 5;
- dpp->delta = (*byteptr++ >> 5) & 0x7;
-
- if (!dpp->term || dpp->term < -3 || (dpp->term > MAX_TERM && dpp->term < 17) || dpp->term > 18)
- return FALSE;
- }
-
- return TRUE;
-}
-
-// Read decorrelation weights from specified metadata block into the
-// decorr_passes array. The weights range +/-1024, but are rounded and
-// truncated to fit in signed chars for metadata storage. Weights are
-// separate for the two channels and are specified from the "last" term
-// (first during encode). Unspecified weights are set to zero.
-
-int read_decorr_weights (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int termcnt = wpmd->byte_length, tcount;
- char *byteptr = wpmd->data;
- struct decorr_pass *dpp;
-
- if (!(wps->wphdr.flags & MONO_FLAG))
- termcnt /= 2;
-
- if (termcnt > wps->num_terms)
- return FALSE;
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- dpp->weight_A = dpp->weight_B = 0;
-
- while (--dpp >= wps->decorr_passes && termcnt--) {
- dpp->weight_A = restore_weight (*byteptr++);
-
- if (!(wps->wphdr.flags & MONO_FLAG))
- dpp->weight_B = restore_weight (*byteptr++);
- }
-
- return TRUE;
-}
-
-// Read decorrelation samples from specified metadata block into the
-// decorr_passes array. The samples are signed 32-bit values, but are
-// converted to signed log2 values for storage in metadata. Values are
-// stored for both channels and are specified from the "last" term
-// (first during encode) with unspecified samples set to zero. The
-// number of samples stored varies with the actual term value, so
-// those must obviously come first in the metadata.
-
-int read_decorr_samples (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- uchar *byteptr = wpmd->data;
- uchar *endptr = byteptr + wpmd->byte_length;
- struct decorr_pass *dpp;
- int tcount;
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- CLEAR (dpp->samples_A);
- CLEAR (dpp->samples_B);
- }
-
- if (wps->wphdr.version == 0x402 && (wps->wphdr.flags & HYBRID_FLAG)) {
- wps->dc.error [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- byteptr += 2;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->dc.error [1] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- byteptr += 2;
- }
- }
-
- while (dpp-- > wps->decorr_passes && byteptr < endptr)
- if (dpp->term > MAX_TERM) {
- dpp->samples_A [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- dpp->samples_A [1] = exp2s ((short)(byteptr [2] + (byteptr [3] << 8)));
- byteptr += 4;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- dpp->samples_B [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- dpp->samples_B [1] = exp2s ((short)(byteptr [2] + (byteptr [3] << 8)));
- byteptr += 4;
- }
- }
- else if (dpp->term < 0) {
- dpp->samples_A [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- dpp->samples_B [0] = exp2s ((short)(byteptr [2] + (byteptr [3] << 8)));
- byteptr += 4;
- }
- else {
- int m = 0, cnt = dpp->term;
-
- while (cnt--) {
- dpp->samples_A [m] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- byteptr += 2;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- dpp->samples_B [m] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- byteptr += 2;
- }
-
- m++;
- }
- }
-
- return byteptr == endptr;
-}
-
-// Read the shaping weights from specified metadata block into the
-// WavpackStream structure. Note that there must be two values (even
-// for mono streams) and that the values are stored in the same
-// manner as decorrelation weights. These would normally be read from
-// the "correction" file and are used for lossless reconstruction of
-// hybrid data.
-
-int read_shaping_info (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- if (wpmd->byte_length == 2) {
- char *byteptr = wpmd->data;
-
- wps->dc.shaping_acc [0] = (int32_t) restore_weight (*byteptr++) << 16;
- wps->dc.shaping_acc [1] = (int32_t) restore_weight (*byteptr++) << 16;
- return TRUE;
- }
- else if (wpmd->byte_length >= (wps->wphdr.flags & MONO_FLAG ? 4 : 8)) {
- uchar *byteptr = wpmd->data;
-
- wps->dc.error [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- wps->dc.shaping_acc [0] = exp2s ((short)(byteptr [2] + (byteptr [3] << 8)));
- byteptr += 4;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->dc.error [1] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- wps->dc.shaping_acc [1] = exp2s ((short)(byteptr [2] + (byteptr [3] << 8)));
- byteptr += 4;
- }
-
- if (wpmd->byte_length == (wps->wphdr.flags & MONO_FLAG ? 6 : 12)) {
- wps->dc.shaping_delta [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
-
- if (!(wps->wphdr.flags & MONO_FLAG))
- wps->dc.shaping_delta [1] = exp2s ((short)(byteptr [2] + (byteptr [3] << 8)));
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-// Read the int32 data from the specified metadata into the specified stream.
-// This data is used for integer data that has more than 24 bits of magnitude
-// or, in some cases, used to eliminate redundant bits from any audio stream.
-
-int read_int32_info (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- int bytecnt = wpmd->byte_length;
- char *byteptr = wpmd->data;
-
- if (bytecnt != 4)
- return FALSE;
-
- wps->int32_sent_bits = *byteptr++;
- wps->int32_zeros = *byteptr++;
- wps->int32_ones = *byteptr++;
- wps->int32_dups = *byteptr;
-
- return TRUE;
-}
-
-// Read multichannel information from metadata. The first byte is the total
-// number of channels and the following bytes represent the channel_mask
-// as described for Microsoft WAVEFORMATEX.
-
-int read_channel_info (WavpackContext *wpc, WavpackMetadata *wpmd)
-{
- int bytecnt = wpmd->byte_length, shift = 0;
- char *byteptr = wpmd->data;
- uint32_t mask = 0;
-
- if (!bytecnt || bytecnt > 5)
- return FALSE;
-
- wpc->config.num_channels = *byteptr++;
-
- while (--bytecnt) {
- mask |= (uint32_t) *byteptr++ << shift;
- shift += 8;
- }
-
- wpc->config.channel_mask = mask;
- return TRUE;
-}
-
-// Read configuration information from metadata.
-
-int read_config_info (WavpackContext *wpc, WavpackMetadata *wpmd)
-{
- int bytecnt = wpmd->byte_length;
- uchar *byteptr = wpmd->data;
-
- if (bytecnt >= 3) {
- wpc->config.flags &= 0xff;
- wpc->config.flags |= (int32_t) *byteptr++ << 8;
- wpc->config.flags |= (int32_t) *byteptr++ << 16;
- wpc->config.flags |= (int32_t) *byteptr << 24;
- }
-
- return TRUE;
-}
-
-// Read wrapper data from metadata. Currently, this consists of the RIFF
-// header and trailer that wav files contain around the audio data but could
-// be used for other formats as well. Because WavPack files contain all the
-// information required for decoding and playback, this data can probably
-// be ignored except when an exact wavefile restoration is needed.
-
-int read_wrapper_data (WavpackContext *wpc, WavpackMetadata *wpmd)
-{
- if (wpc->open_flags & OPEN_WRAPPER) {
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + wpmd->byte_length);
- memcpy (wpc->wrapper_data + wpc->wrapper_bytes, wpmd->data, wpmd->byte_length);
- wpc->wrapper_bytes += wpmd->byte_length;
- }
-
- return TRUE;
-}
-
-#ifdef UNPACK
-
-// This monster actually unpacks the WavPack bitstream(s) into the specified
-// buffer as 32-bit integers or floats (depending on orignal data). Lossy
-// samples will be clipped to their original limits (i.e. 8-bit samples are
-// clipped to -128/+127) but are still returned in longs. It is up to the
-// caller to potentially reformat this for the final output including any
-// multichannel distribution, block alignment or endian compensation. The
-// function unpack_init() must have been called and the entire WavPack block
-// must still be visible (although wps->blockbuff will not be accessed again).
-// For maximum clarity, the function is broken up into segments that handle
-// various modes. This makes for a few extra infrequent flag checks, but
-// makes the code easier to follow because the nesting does not become so
-// deep. For maximum efficiency, the conversion is isolated to tight loops
-// that handle an entire buffer. The function returns the total number of
-// samples unpacked, which can be less than the number requested if an error
-// occurs or the end of the block is reached.
-
-static void decorr_stereo_pass (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-static void decorr_stereo_pass_i (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-static void decorr_stereo_pass_id0 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-static void decorr_stereo_pass_id1 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-static void decorr_stereo_pass_id2 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count);
-
-static void fixup_samples (WavpackContext *wpc, int32_t *buffer, uint32_t sample_count);
-
-int32_t unpack_samples (WavpackContext *wpc, int32_t *buffer, uint32_t sample_count)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t flags = wps->wphdr.flags, crc = wps->crc, i;
- int32_t mute_limit = (1L << ((flags & MAG_MASK) >> MAG_LSB)) + 2;
- int32_t correction [2], read_word, *bptr;
- struct decorr_pass *dpp;
- int tcount, m = 0;
-
- if (wps->sample_index + sample_count > wps->wphdr.block_index + wps->wphdr.block_samples)
- sample_count = wps->wphdr.block_index + wps->wphdr.block_samples - wps->sample_index;
-
- if (wps->mute_error) {
- memset (buffer, 0, sample_count * (flags & MONO_FLAG ? 4 : 8));
- wps->sample_index += sample_count;
- return sample_count;
- }
-
- if ((flags & HYBRID_FLAG) && !wpc->wvc_flag)
- mute_limit *= 2;
-
- ///////////////// handle version 4 lossless mono data /////////////////////
-
- if (!(flags & HYBRID_FLAG) && (flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- if ((read_word = get_word_lossless (wps, 0)) == WORD_EOF)
- break;
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam, temp;
- int k;
-
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1)
- sam = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- sam = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- k = 0;
- }
- else {
- sam = dpp->samples_A [m];
- k = (m + dpp->term) & (MAX_TERM - 1);
- }
-
- temp = apply_weight (dpp->weight_A, sam) + read_word;
- update_weight (dpp->weight_A, dpp->delta, sam, read_word);
- dpp->samples_A [k] = read_word = temp;
- }
-
- if (labs (read_word) > mute_limit)
- break;
-
- m = (m + 1) & (MAX_TERM - 1);
- crc = crc * 3 + read_word;
- *bptr++ = read_word;
- }
-
- //////////////// handle version 4 lossless stereo data ////////////////////
-
- else if (!wpc->wvc_flag && !(flags & MONO_FLAG)) {
- int32_t *eptr = buffer + (sample_count * 2);
-
- i = sample_count;
-
- if (flags & HYBRID_FLAG) {
- for (bptr = buffer; bptr < eptr; bptr += 2)
- if ((bptr [0] = get_word (wps, 0, NULL)) == WORD_EOF ||
- (bptr [1] = get_word (wps, 1, NULL)) == WORD_EOF) {
- i = (bptr - buffer) / 2;
- break;
- }
- }
- else
- for (bptr = buffer; bptr < eptr; bptr += 2)
- if ((bptr [0] = get_word_lossless (wps, 0)) == WORD_EOF ||
- (bptr [1] = get_word_lossless (wps, 1)) == WORD_EOF) {
- i = (bptr - buffer) / 2;
- break;
- }
-
-#ifdef FAST_DECODE
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (((flags & MAG_MASK) >> MAG_LSB) >= 16)
- decorr_stereo_pass (dpp, buffer, sample_count);
- else if (dpp->delta > 2)
- decorr_stereo_pass_i (dpp, buffer, sample_count);
- else if (dpp->delta == 2)
- decorr_stereo_pass_id2 (dpp, buffer, sample_count);
- else if (dpp->delta == 1)
- decorr_stereo_pass_id1 (dpp, buffer, sample_count);
- else
- decorr_stereo_pass_id0 (dpp, buffer, sample_count);
-#else
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- decorr_stereo_pass (dpp, buffer, sample_count);
-#endif
-
- if (flags & JOINT_STEREO)
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- bptr [0] += (bptr [1] -= (bptr [0] >> 1));
-
- if (labs (bptr [0]) > mute_limit || labs (bptr [1]) > mute_limit) {
- i = (bptr - buffer) / 2;
- break;
- }
-
- crc = (crc * 3 + bptr [0]) * 3 + bptr [1];
- }
- else
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- if (labs (bptr [0]) > mute_limit || labs (bptr [1]) > mute_limit) {
- i = (bptr - buffer) / 2;
- break;
- }
-
- crc = (crc * 3 + bptr [0]) * 3 + bptr [1];
- }
-
- m = sample_count & (MAX_TERM - 1);
- }
-
- //////////////// handle version 4 lossy/hybrid mono data //////////////////
-
- else if ((flags & HYBRID_FLAG) && (flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
-
- if ((read_word = get_word (wps, 0, correction)) == WORD_EOF)
- break;
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam, temp;
- int k;
-
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1)
- sam = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- else
- sam = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- k = 0;
- }
- else {
- sam = dpp->samples_A [m];
- k = (m + dpp->term) & (MAX_TERM - 1);
- }
-
- temp = apply_weight (dpp->weight_A, sam) + read_word;
- update_weight (dpp->weight_A, dpp->delta, sam, read_word);
- dpp->samples_A [k] = read_word = temp;
- }
-
- m = (m + 1) & (MAX_TERM - 1);
-
- if (wpc->wvc_flag) {
- if (flags & HYBRID_SHAPE) {
- int shaping_weight = (wps->dc.shaping_acc [0] += wps->dc.shaping_delta [0]) >> 16;
- int32_t temp = -apply_weight (shaping_weight, wps->dc.error [0]);
-
- if ((flags & NEW_SHAPING) && shaping_weight < 0 && temp) {
- if (temp == wps->dc.error [0])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- wps->dc.error [0] = temp - correction [0];
- }
- else
- wps->dc.error [0] = -correction [0];
-
- read_word += correction [0] - temp;
- }
- else
- read_word += correction [0];
- }
-
- crc = crc * 3 + read_word;
-
-#ifdef LOSSY_MUTE
- if (labs (read_word) > mute_limit)
- break;
-#endif
- *bptr++ = read_word;
- }
-
- //////////////// handle version 4 lossy/hybrid stereo data ////////////////
-
- else if (wpc->wvc_flag && !(flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t left, right, left_c, right_c, left2, right2;
-
- if ((left = get_word (wps, 0, correction)) == WORD_EOF ||
- (right = get_word (wps, 1, correction + 1)) == WORD_EOF)
- break;
-
- if (flags & CROSS_DECORR) {
- left_c = left + correction [0];
- right_c = right + correction [1];
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam_A, sam_B;
-
- if (dpp->term > 0) {
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- }
- else {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- }
- }
- else {
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
- }
-
- left_c += apply_weight (dpp->weight_A, sam_A);
- right_c += apply_weight (dpp->weight_B, sam_B);
- }
- else if (dpp->term == -1) {
- left_c += apply_weight (dpp->weight_A, dpp->samples_A [0]);
- right_c += apply_weight (dpp->weight_B, left_c);
- }
- else {
- right_c += apply_weight (dpp->weight_B, dpp->samples_B [0]);
-
- if (dpp->term == -3)
- left_c += apply_weight (dpp->weight_A, dpp->samples_A [0]);
- else
- left_c += apply_weight (dpp->weight_A, right_c);
- }
- }
-
- if (flags & JOINT_STEREO)
- left_c += (right_c -= (left_c >> 1));
- }
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam_A, sam_B;
-
- if (dpp->term > 0) {
- int k;
-
- if (dpp->term > MAX_TERM) {
- if (dpp->term & 1) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
- }
- else {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
- }
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
- k = 0;
- }
- else {
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
- k = (m + dpp->term) & (MAX_TERM - 1);
- }
-
- left2 = apply_weight (dpp->weight_A, sam_A) + left;
- right2 = apply_weight (dpp->weight_B, sam_B) + right;
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, left);
- update_weight (dpp->weight_B, dpp->delta, sam_B, right);
-
- dpp->samples_A [k] = left = left2;
- dpp->samples_B [k] = right = right2;
- }
- else if (dpp->term == -1) {
- left2 = left + apply_weight (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], left);
- left = left2;
- right2 = right + apply_weight (dpp->weight_B, left2);
- update_weight_clip (dpp->weight_B, dpp->delta, left2, right);
- dpp->samples_A [0] = right = right2;
- }
- else {
- right2 = right + apply_weight (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], right);
- right = right2;
-
- if (dpp->term == -3) {
- right2 = dpp->samples_A [0];
- dpp->samples_A [0] = right;
- }
-
- left2 = left + apply_weight (dpp->weight_A, right2);
- update_weight_clip (dpp->weight_A, dpp->delta, right2, left);
- dpp->samples_B [0] = left = left2;
- }
- }
-
- m = (m + 1) & (MAX_TERM - 1);
-
- if (!(flags & CROSS_DECORR)) {
- left_c = left + correction [0];
- right_c = right + correction [1];
-
- if (flags & JOINT_STEREO)
- left_c += (right_c -= (left_c >> 1));
- }
-
- if (flags & JOINT_STEREO)
- left += (right -= (left >> 1));
-
- if (flags & HYBRID_SHAPE) {
- int shaping_weight;
- int32_t temp;
-
- correction [0] = left_c - left;
- shaping_weight = (wps->dc.shaping_acc [0] += wps->dc.shaping_delta [0]) >> 16;
- temp = -apply_weight (shaping_weight, wps->dc.error [0]);
-
- if ((flags & NEW_SHAPING) && shaping_weight < 0 && temp) {
- if (temp == wps->dc.error [0])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- wps->dc.error [0] = temp - correction [0];
- }
- else
- wps->dc.error [0] = -correction [0];
-
- left = left_c - temp;
- correction [1] = right_c - right;
- shaping_weight = (wps->dc.shaping_acc [1] += wps->dc.shaping_delta [1]) >> 16;
- temp = -apply_weight (shaping_weight, wps->dc.error [1]);
-
- if ((flags & NEW_SHAPING) && shaping_weight < 0 && temp) {
- if (temp == wps->dc.error [1])
- temp = (temp < 0) ? temp + 1 : temp - 1;
-
- wps->dc.error [1] = temp - correction [1];
- }
- else
- wps->dc.error [1] = -correction [1];
-
- right = right_c - temp;
- }
- else {
- left = left_c;
- right = right_c;
- }
-
-#ifdef LOSSY_MUTE
- if (labs (left) > mute_limit || labs (right) > mute_limit)
- break;
-#endif
- crc = (crc * 3 + left) * 3 + right;
- *bptr++ = left;
- *bptr++ = right;
- }
-
- if (i != sample_count) {
- memset (buffer, 0, sample_count * (flags & MONO_FLAG ? 4 : 8));
- wps->mute_error = TRUE;
- i = sample_count;
-
- if (bs_is_open (&wps->wvxbits))
- bs_close_read (&wps->wvxbits);
- }
-
- if (m)
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0 && dpp->term <= MAX_TERM) {
- int32_t temp_A [MAX_TERM], temp_B [MAX_TERM];
- int k;
-
- memcpy (temp_A, dpp->samples_A, sizeof (dpp->samples_A));
- memcpy (temp_B, dpp->samples_B, sizeof (dpp->samples_B));
-
- for (k = 0; k < MAX_TERM; k++) {
- dpp->samples_A [k] = temp_A [m];
- dpp->samples_B [k] = temp_B [m];
- m = (m + 1) & (MAX_TERM - 1);
- }
- }
-
- fixup_samples (wpc, buffer, i);
-
- if ((flags & FLOAT_DATA) && (wpc->open_flags & OPEN_NORMALIZE))
- float_normalize (buffer, (flags & MONO_FLAG) ? i : i * 2,
- 127 - wps->float_norm_exp + wpc->norm_offset);
-
- wps->sample_index += i;
- wps->crc = crc;
-
- return i;
-}
-
-static void decorr_stereo_pass (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
-
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
-
- dpp->samples_A [k] = apply_weight (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [k] = apply_weight (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [k];
- bptr [1] = dpp->samples_B [k];
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- bptr [0] = sam_A;
- dpp->samples_A [0] = bptr [1] + apply_weight (dpp->weight_B, sam_A);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_A, bptr [1]);
- bptr [1] = dpp->samples_A [0];
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_B = bptr [1] + apply_weight (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [1] = sam_B;
- dpp->samples_B [0] = bptr [0] + apply_weight (dpp->weight_A, sam_B);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_B, bptr [0]);
- bptr [0] = dpp->samples_B [0];
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- sam_B = bptr [1] + apply_weight (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [0] = dpp->samples_B [0] = sam_A;
- bptr [1] = dpp->samples_A [0] = sam_B;
- }
-
- break;
- }
-}
-
-#ifdef FAST_DECODE
-
-static void decorr_stereo_pass_i (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
-
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
-
- dpp->samples_A [k] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [k] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [k];
- bptr [1] = dpp->samples_B [k];
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- bptr [0] = sam_A;
- dpp->samples_A [0] = bptr [1] + apply_weight_i (dpp->weight_B, sam_A);
- update_weight_clip (dpp->weight_B, dpp->delta, sam_A, bptr [1]);
- bptr [1] = dpp->samples_A [0];
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_B = bptr [1] + apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [1] = sam_B;
- dpp->samples_B [0] = bptr [0] + apply_weight_i (dpp->weight_A, sam_B);
- update_weight_clip (dpp->weight_A, dpp->delta, sam_B, bptr [0]);
- bptr [0] = dpp->samples_B [0];
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- sam_B = bptr [1] + apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [0] = dpp->samples_B [0] = sam_A;
- bptr [1] = dpp->samples_A [0] = sam_B;
- }
-
- break;
- }
-}
-
-static void decorr_stereo_pass_id2 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
-
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
-
- dpp->samples_A [k] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [k] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight_d2 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight_d2 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [k];
- bptr [1] = dpp->samples_B [k];
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip_d2 (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- bptr [0] = sam_A;
- dpp->samples_A [0] = bptr [1] + apply_weight_i (dpp->weight_B, sam_A);
- update_weight_clip_d2 (dpp->weight_B, dpp->delta, sam_A, bptr [1]);
- bptr [1] = dpp->samples_A [0];
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_B = bptr [1] + apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip_d2 (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [1] = sam_B;
- dpp->samples_B [0] = bptr [0] + apply_weight_i (dpp->weight_A, sam_B);
- update_weight_clip_d2 (dpp->weight_A, dpp->delta, sam_B, bptr [0]);
- bptr [0] = dpp->samples_B [0];
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip_d2 (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- sam_B = bptr [1] + apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip_d2 (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [0] = dpp->samples_B [0] = sam_A;
- bptr [1] = dpp->samples_A [0] = sam_B;
- }
-
- break;
- }
-}
-
-static void decorr_stereo_pass_id1 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
-
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight_d1 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight_d1 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [0] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight_d1 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight_d1 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [0];
- bptr [1] = dpp->samples_B [0];
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = dpp->samples_A [m];
- sam_B = dpp->samples_B [m];
-
- dpp->samples_A [k] = apply_weight_i (dpp->weight_A, sam_A) + bptr [0];
- dpp->samples_B [k] = apply_weight_i (dpp->weight_B, sam_B) + bptr [1];
-
- update_weight_d1 (dpp->weight_A, dpp->delta, sam_A, bptr [0]);
- update_weight_d1 (dpp->weight_B, dpp->delta, sam_B, bptr [1]);
-
- bptr [0] = dpp->samples_A [k];
- bptr [1] = dpp->samples_B [k];
-
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip_d1 (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- bptr [0] = sam_A;
- dpp->samples_A [0] = bptr [1] + apply_weight_i (dpp->weight_B, sam_A);
- update_weight_clip_d1 (dpp->weight_B, dpp->delta, sam_A, bptr [1]);
- bptr [1] = dpp->samples_A [0];
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_B = bptr [1] + apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip_d1 (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [1] = sam_B;
- dpp->samples_B [0] = bptr [0] + apply_weight_i (dpp->weight_A, sam_B);
- update_weight_clip_d1 (dpp->weight_A, dpp->delta, sam_B, bptr [0]);
- bptr [0] = dpp->samples_B [0];
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = bptr [0] + apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- update_weight_clip_d1 (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
- sam_B = bptr [1] + apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- update_weight_clip_d1 (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
- bptr [0] = dpp->samples_B [0] = sam_A;
- bptr [1] = dpp->samples_A [0] = sam_B;
- }
-
- break;
- }
-}
-
-static void decorr_stereo_pass_id0 (struct decorr_pass *dpp, int32_t *buffer, int32_t sample_count)
-{
- int32_t *bptr, *eptr = buffer + (sample_count * 2), sam_A, sam_B;
- int m, k;
-
- switch (dpp->term) {
-
- case 17:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = 2 * dpp->samples_A [0] - dpp->samples_A [1];
- sam_B = 2 * dpp->samples_B [0] - dpp->samples_B [1];
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = bptr [0] += apply_weight_i (dpp->weight_A, sam_A);
- dpp->samples_B [0] = bptr [1] += apply_weight_i (dpp->weight_B, sam_B);
- }
-
- break;
-
- case 18:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- sam_A = (3 * dpp->samples_A [0] - dpp->samples_A [1]) >> 1;
- sam_B = (3 * dpp->samples_B [0] - dpp->samples_B [1]) >> 1;
-
- dpp->samples_A [1] = dpp->samples_A [0];
- dpp->samples_B [1] = dpp->samples_B [0];
-
- dpp->samples_A [0] = bptr [0] += apply_weight_i (dpp->weight_A, sam_A);
- dpp->samples_B [0] = bptr [1] += apply_weight_i (dpp->weight_B, sam_B);
- }
-
- break;
-
- default:
- for (m = 0, k = dpp->term & (MAX_TERM - 1), bptr = buffer; bptr < eptr; bptr += 2) {
- dpp->samples_A [k] = bptr [0] += apply_weight_i (dpp->weight_A, dpp->samples_A [m]);
- dpp->samples_B [k] = bptr [1] += apply_weight_i (dpp->weight_B, dpp->samples_B [m]);
- m = (m + 1) & (MAX_TERM - 1);
- k = (k + 1) & (MAX_TERM - 1);
- }
-
- break;
-
- case -1:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- bptr [0] += apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- dpp->samples_A [0] = bptr [1] += apply_weight_i (dpp->weight_B, bptr [0]);
- }
-
- break;
-
- case -2:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- bptr [1] += apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- dpp->samples_B [0] = bptr [0] += apply_weight_i (dpp->weight_A, bptr [1]);
- }
-
- break;
-
- case -3:
- for (bptr = buffer; bptr < eptr; bptr += 2) {
- bptr [0] += apply_weight_i (dpp->weight_A, dpp->samples_A [0]);
- dpp->samples_A [0] = bptr [1] += apply_weight_i (dpp->weight_B, dpp->samples_B [0]);
- dpp->samples_B [0] = bptr [0];
- }
-
- break;
- }
-}
-
-#endif
-
-// This is a helper function for unpack_samples() that applies several final
-// operations. First, if the data is 32-bit float data, then that conversion
-// is done in the float.c module (whether lossy or lossless) and we return.
-// Otherwise, if the extended integer data applies, then that operation is
-// executed first. If the unpacked data is lossy (and not corrected) then
-// it is clipped and shifted in a single operation. Otherwise, if it's
-// lossless then the last step is to apply the final shift (if any).
-
-static void fixup_samples (WavpackContext *wpc, int32_t *buffer, uint32_t sample_count)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t flags = wps->wphdr.flags;
- int lossy_flag = (flags & HYBRID_FLAG) && !wpc->wvc_flag;
- int shift = (flags & SHIFT_MASK) >> SHIFT_LSB;
-
- if (flags & FLOAT_DATA) {
- float_values (wps, buffer, (flags & MONO_FLAG) ? sample_count : sample_count * 2);
- return;
- }
-
- if (flags & INT32_DATA) {
- uint32_t count = (flags & MONO_FLAG) ? sample_count : sample_count * 2;
- int sent_bits = wps->int32_sent_bits, zeros = wps->int32_zeros;
- int ones = wps->int32_ones, dups = wps->int32_dups;
- uint32_t data, mask = (1 << sent_bits) - 1;
- int32_t *dptr = buffer;
-
- if (bs_is_open (&wps->wvxbits)) {
- uint32_t crc = wps->crc_x;
-
- while (count--) {
-// if (sent_bits) {
- getbits (&data, sent_bits, &wps->wvxbits);
- *dptr = (*dptr << sent_bits) | (data & mask);
-// }
-
- if (zeros)
- *dptr <<= zeros;
- else if (ones)
- *dptr = ((*dptr + 1) << ones) - 1;
- else if (dups)
- *dptr = ((*dptr + (*dptr & 1)) << dups) - (*dptr & 1);
-
- crc = crc * 9 + (*dptr & 0xffff) * 3 + ((*dptr >> 16) & 0xffff);
- dptr++;
- }
-
- wps->crc_x = crc;
- }
- else if (!sent_bits && (zeros + ones + dups)) {
- while (lossy_flag && (flags & BYTES_STORED) == 3 && shift < 8) {
- if (zeros)
- zeros--;
- else if (ones)
- ones--;
- else if (dups)
- dups--;
- else
- break;
-
- shift++;
- }
-
- while (count--) {
- if (zeros)
- *dptr <<= zeros;
- else if (ones)
- *dptr = ((*dptr + 1) << ones) - 1;
- else if (dups)
- *dptr = ((*dptr + (*dptr & 1)) << dups) - (*dptr & 1);
-
- dptr++;
- }
- }
- else
- shift += zeros + sent_bits + ones + dups;
- }
-
- if (lossy_flag) {
- int32_t min_value, max_value, min_shifted, max_shifted;
-
- switch (flags & BYTES_STORED) {
- case 0:
- min_shifted = (min_value = -128 >> shift) << shift;
- max_shifted = (max_value = 127 >> shift) << shift;
- break;
-
- case 1:
- min_shifted = (min_value = -32768 >> shift) << shift;
- max_shifted = (max_value = 32767 >> shift) << shift;
- break;
-
- case 2:
- min_shifted = (min_value = -8388608 >> shift) << shift;
- max_shifted = (max_value = 8388607 >> shift) << shift;
- break;
-
- case 3:
- min_shifted = (min_value = (int32_t) 0x80000000 >> shift) << shift;
- max_shifted = (max_value = (int32_t) 0x7fffffff >> shift) << shift;
- break;
- }
-
- if (!(flags & MONO_FLAG))
- sample_count *= 2;
-
- while (sample_count--) {
- if (*buffer < min_value)
- *buffer++ = min_shifted;
- else if (*buffer > max_value)
- *buffer++ = max_shifted;
- else
- *buffer++ <<= shift;
- }
- }
- else if (shift) {
- if (!(flags & MONO_FLAG))
- sample_count *= 2;
-
- while (sample_count--)
- *buffer++ <<= shift;
- }
-}
-
-// This function checks the crc value(s) for an unpacked block, returning the
-// number of actual crc errors detected for the block. The block must be
-// completely unpacked before this test is valid. For losslessly unpacked
-// blocks of float or extended integer data the extended crc is also checked.
-// Note that WavPack's crc is not a CCITT approved polynomial algorithm, but
-// is a much simpler method that is virtually as robust for real world data.
-
-int check_crc_error (WavpackContext *wpc)
-{
- int result = 0, stream;
-
- for (stream = 0; stream < wpc->num_streams; stream++) {
- WavpackStream *wps = wpc->streams [stream];
-
- if (wps->crc != wps->wphdr.crc)
- ++result;
- else if (bs_is_open (&wps->wvxbits) && wps->crc_x != wps->crc_wvx)
- ++result;
- }
-
- return result;
-}
-
-#endif
diff --git a/lib/win32/libwavpack/unpack3.c b/lib/win32/libwavpack/unpack3.c
deleted file mode 100644
index 8f8e0c5d07..0000000000
--- a/lib/win32/libwavpack/unpack3.c
+++ /dev/null
@@ -1,2010 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// unpack3.c
-
-// This module provides unpacking for WavPack files prior to version 4.0,
-// not including "raw" files. As these modes are all obsolete and are no
-// longer written, this code will not be fully documented other than the
-// global functions. However, full documenation is provided in the version
-// 3.97 source code.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include "wavpack.h"
-#include "unpack3.h"
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-static void unpack_init3 (WavpackStream3 *wps);
-static int bs_open_read3 (Bitstream3 *bs, stream_reader *reader, void *id);
-static void bs_close_read3 (Bitstream3 *bs);
-#ifdef SEEKING
-static void bs_restore3 (Bitstream3 *bs);
-#endif
-
-// This provides an extension to the WavpackOpenFileRead () function contained
-// in the wputils.c module. It is assumed that an 'R' had been read as the
-// first character of the file/stream (indicating a non-raw pre version 4.0
-// WavPack file) and had been pushed back onto the stream (or simply seeked
-// back to).
-
-WavpackContext *open_file3 (WavpackContext *wpc, char *error)
-{
- RiffChunkHeader RiffChunkHeader;
- ChunkHeader ChunkHeader;
- WavpackHeader3 wphdr;
- WavpackStream3 *wps;
- WaveHeader3 wavhdr;
-
- wpc->stream3 = wps = (WavpackStream3 *) malloc (sizeof (WavpackStream3));
- CLEAR (*wps);
-
- if (wpc->reader->read_bytes (wpc->wv_in, &RiffChunkHeader, sizeof (RiffChunkHeader)) !=
- sizeof (RiffChunkHeader)) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- if (!strncmp (RiffChunkHeader.ckID, "RIFF", 4) && !strncmp (RiffChunkHeader.formType, "WAVE", 4)) {
-
- if (wpc->open_flags & OPEN_WRAPPER) {
- wpc->wrapper_data = malloc (wpc->wrapper_bytes = sizeof (RiffChunkHeader));
- memcpy (wpc->wrapper_data, &RiffChunkHeader, sizeof (RiffChunkHeader));
- }
-
- // If the first chunk is a wave RIFF header, then read the various chunks
- // until we get to the "data" chunk (and WavPack header should follow). If
- // the first chunk is not a RIFF, then we assume a "raw" WavPack file and
- // the WavPack header must be first.
-
- while (1) {
-
- if (wpc->reader->read_bytes (wpc->wv_in, &ChunkHeader, sizeof (ChunkHeader)) !=
- sizeof (ChunkHeader)) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
- else {
- if (wpc->open_flags & OPEN_WRAPPER) {
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + sizeof (ChunkHeader));
- memcpy (wpc->wrapper_data + wpc->wrapper_bytes, &ChunkHeader, sizeof (ChunkHeader));
- wpc->wrapper_bytes += sizeof (ChunkHeader);
- }
-
- little_endian_to_native (&ChunkHeader, ChunkHeaderFormat);
-
- if (!strncmp (ChunkHeader.ckID, "fmt ", 4)) {
-
- if (ChunkHeader.ckSize < sizeof (wavhdr) ||
- wpc->reader->read_bytes (wpc->wv_in, &wavhdr, sizeof (wavhdr)) != sizeof (wavhdr)) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
- else if (wpc->open_flags & OPEN_WRAPPER) {
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + sizeof (wavhdr));
- memcpy (wpc->wrapper_data + wpc->wrapper_bytes, &wavhdr, sizeof (wavhdr));
- wpc->wrapper_bytes += sizeof (wavhdr);
- }
-
- little_endian_to_native (&wavhdr, WaveHeader3Format);
-
- if (ChunkHeader.ckSize > sizeof (wavhdr)) {
- uint32_t bytes_to_skip = (ChunkHeader.ckSize + 1 - sizeof (wavhdr)) & ~1L;
-
- if (wpc->open_flags & OPEN_WRAPPER) {
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + bytes_to_skip);
- wpc->reader->read_bytes (wpc->wv_in, wpc->wrapper_data + wpc->wrapper_bytes, bytes_to_skip);
- wpc->wrapper_bytes += bytes_to_skip;
- }
- else {
- uchar *temp = malloc (bytes_to_skip);
- wpc->reader->read_bytes (wpc->wv_in, temp, bytes_to_skip);
- free (temp);
- }
- }
- }
- else if (!strncmp (ChunkHeader.ckID, "data", 4)) {
- wpc->total_samples = ChunkHeader.ckSize / wavhdr.NumChannels /
- ((wavhdr.BitsPerSample > 16) ? 3 : 2);
-
- break;
- }
- else if ((ChunkHeader.ckSize + 1) & ~1L) {
- uint32_t bytes_to_skip = (ChunkHeader.ckSize + 1) & ~1L;
-
- if (wpc->open_flags & OPEN_WRAPPER) {
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + bytes_to_skip);
- wpc->reader->read_bytes (wpc->wv_in, wpc->wrapper_data + wpc->wrapper_bytes, bytes_to_skip);
- wpc->wrapper_bytes += bytes_to_skip;
- }
- else {
- uchar *temp = malloc (bytes_to_skip);
- wpc->reader->read_bytes (wpc->wv_in, temp, bytes_to_skip);
- free (temp);
- }
- }
- }
- }
- }
- else {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- if (wpc->reader->read_bytes (wpc->wv_in, &wphdr, 10) != 10) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- if (((char *) &wphdr) [8] == 2 && (wpc->reader->read_bytes (wpc->wv_in, ((char *) &wphdr) + 10, 2) != 2)) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
- else if (((char *) &wphdr) [8] == 3 && (wpc->reader->read_bytes (wpc->wv_in, ((char *) &wphdr) + 10,
- sizeof (wphdr) - 10) != sizeof (wphdr) - 10)) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- little_endian_to_native (&wphdr, WavpackHeader3Format);
-
- // make sure this is a version we know about
-
- if (strncmp (wphdr.ckID, "wvpk", 4) || wphdr.version < 1 || wphdr.version > 3) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- // Because I ran out of flag bits in the WavPack header, an amazingly ugly
- // kludge was forced upon me! This code takes care of preparing the flags
- // field for internal use and checking for unknown formats we can't decode
-
- if (wphdr.version == 3) {
-
- if (wphdr.flags & EXTREME_DECORR) {
-
- if ((wphdr.flags & NOT_STORED_FLAGS) ||
- ((wphdr.bits) &&
- (((wphdr.flags & NEW_HIGH_FLAG) &&
- (wphdr.flags & (FAST_FLAG | HIGH_FLAG))) ||
- (wphdr.flags & CROSS_DECORR)))) {
- strcpy (error, "not a valid WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- if (wphdr.flags & CANCEL_EXTREME)
- wphdr.flags &= ~(EXTREME_DECORR | CANCEL_EXTREME);
- }
- else
- wphdr.flags &= ~CROSS_DECORR;
- }
-
- // check to see if we should look for a "correction" file, and if so try
- // to open it for reading, then set WVC_FLAG accordingly
-
- if (wpc->wvc_in && wphdr.version == 3 && wphdr.bits && (wphdr.flags & NEW_HIGH_FLAG)) {
- wpc->file2len = wpc->reader->get_length (wpc->wvc_in);
- wphdr.flags |= WVC_FLAG;
- wpc->wvc_flag = TRUE;
- }
- else
- wphdr.flags &= ~WVC_FLAG;
-
- // check WavPack version to handle special requirements of versions
- // before 3.0 that had smaller headers
-
- if (wphdr.version < 3) {
- wphdr.total_samples = wpc->total_samples;
- wphdr.flags = wavhdr.NumChannels == 1 ? MONO_FLAG : 0;
- wphdr.shift = 16 - wavhdr.BitsPerSample;
-
- if (wphdr.version == 1)
- wphdr.bits = 0;
- }
-
- wpc->config.sample_rate = wavhdr.SampleRate;
- wpc->config.num_channels = wavhdr.NumChannels;
-
- if (wphdr.flags & MONO_FLAG)
- wpc->config.flags |= CONFIG_MONO_FLAG;
-
- if (wphdr.flags & EXTREME_DECORR)
- wpc->config.flags |= CONFIG_HIGH_FLAG;
-
- if (wphdr.bits) {
- if (wphdr.flags & NEW_HIGH_FLAG)
- wpc->config.flags |= CONFIG_HYBRID_FLAG;
- else
- wpc->config.flags |= CONFIG_LOSSY_MODE;
- }
- else if (!(wphdr.flags & HIGH_FLAG))
- wpc->config.flags |= CONFIG_FAST_FLAG;
-
- wpc->config.bytes_per_sample = (wphdr.flags & BYTES_3) ? 3 : 2;
- wpc->config.bits_per_sample = wavhdr.BitsPerSample;
-
- memcpy (&wps->wphdr, &wphdr, sizeof (wphdr));
- wps->wvbits.bufsiz = wps->wvcbits.bufsiz = 1024 * 1024;
- return wpc;
-}
-
-// return currently decoded sample index
-
-uint32_t get_sample_index3 (WavpackContext *wpc)
-{
- WavpackStream3 *wps = (WavpackStream3 *) wpc->stream3;
-
- return (wps) ? wps->sample_index : (uint32_t) -1;
-}
-
-int get_version3 (WavpackContext *wpc)
-{
- WavpackStream3 *wps = (WavpackStream3 *) wpc->stream3;
-
- return (wps) ? wps->wphdr.version : 0;
-}
-
-void free_stream3 (WavpackContext *wpc)
-{
- WavpackStream3 *wps = (WavpackStream3 *) wpc->stream3;
-
- if (wps) {
-#ifdef SEEKING
- if (wps->unpack_data)
- free (wps->unpack_data);
-#endif
- if (wps->wphdr.flags & WVC_FLAG)
- bs_close_read3 (&wps->wvcbits);
-
- bs_close_read3 (&wps->wvbits);
-
- free (wps);
- }
-}
-
-static void bs_read3 (Bitstream3 *bs)
-{
- uint32_t bytes_read;
-
- bytes_read = bs->reader->read_bytes (bs->id, bs->buf, bs->bufsiz);
- bs->end = bs->buf + bytes_read;
- bs->fpos += bytes_read;
-
- if (bs->end == bs->buf) {
- memset (bs->buf, -1, bs->bufsiz);
- bs->end += bs->bufsiz;
- }
-
- bs->ptr = bs->buf;
-}
-
-// Open the specified BitStream and associate with the specified file. The
-// "bufsiz" field of the structure must be preset with the desired buffer
-// size and the file's read pointer must be set to where the desired bit
-// data is located. A return value of TRUE indicates an error in
-// allocating buffer space.
-
-static int bs_open_read3 (Bitstream3 *bs, stream_reader *reader, void *id)
-{
- bs->fpos = (bs->reader = reader)->get_pos (bs->id = id);
-
- if (!bs->buf)
- bs->buf = (uchar *) malloc (bs->bufsiz);
-
- bs->end = bs->buf + bs->bufsiz;
- bs->ptr = bs->end - 1;
- bs->sr = bs->bc = 0;
- bs->error = bs->buf ? 0 : 1;
- bs->wrap = bs_read3;
- return bs->error;
-}
-
-#ifdef SEEKING
-
-// This function is called after a call to unpack_restore() has restored
-// the BitStream structure to a previous state and causes any required data
-// to be read from the file. This function is NOT supported for overlapped
-// operation.
-
-void bs_restore3 (Bitstream3 *bs)
-{
- uint32_t bytes_to_read = bs->end - bs->ptr - 1, bytes_read;
-
- bs->reader->set_pos_abs (bs->id, bs->fpos - bytes_to_read);
-
- if (bytes_to_read > 0) {
-
- bytes_read = bs->reader->read_bytes (bs->id, bs->ptr + 1, bytes_to_read);
-
- if (bytes_to_read != bytes_read)
- bs->end = bs->ptr + 1 + bytes_read;
- }
-}
-
-#endif
-
-// This function is called to release any resources used by the BitStream
-// and position the file pointer to the first byte past the read bits.
-
-static void bs_close_read3 (Bitstream3 *bs)
-{
- if (bs->buf) {
- free (bs->buf);
- CLEAR (*bs);
- }
-}
-
-static uint32_t bs_unused_bytes (Bitstream3 *bs)
-{
- if (bs->bc < 8) {
- bs->bc += 8;
- bs->ptr++;
- }
-
- return bs->end - bs->ptr;
-}
-
-static uchar *bs_unused_data (Bitstream3 *bs)
-{
- if (bs->bc < 8) {
- bs->bc += 8;
- bs->ptr++;
- }
-
- return bs->ptr;
-}
-
-#ifdef UNPACK
-
-//////////////////////////////// local macros /////////////////////////////////
-
-#define apply_weight_n(bits, weight, sample) ((weight * sample + (1 << (bits - 1))) >> bits)
-
-#define update_weight_n(bits, weight, source, result) \
- if (source && result) { \
- if ((source ^ result) >= 0) { if (weight++ == (1 << bits)) weight--; } \
- else if (weight-- == min_weight) weight++; \
- }
-
-#define apply_weight24(weight, sample) (((((sample & 0xffff) * weight) >> 7) + \
- (((sample & ~0xffff) >> 7) * weight) + 1) >> 1)
-
-#define update_weight2(weight, source, result) \
- if (source && result) { \
- if ((source ^ result) >= 0) { if (weight++ == 256) weight--; } \
- else if (weight-- == min_weight) weight++; \
- }
-
-//////////////////////////////// local tables ///////////////////////////////
-
-// These three tables specify the characteristics of the decorrelation filters.
-// Each term represents one layer of the sequential filter, where positive
-// values indicate the relative sample involved from the same channel (1=prev)
-// while -1 and -2 indicate cross channel decorrelation (in stereo only). The
-// "simple_terms" table is no longer used for writing, but is kept for older
-// file decoding.
-
-static const char extreme_terms [] = { 1,1,1,2,4,-1,1,2,3,6,-2,8,5,7,4,1,2,3 };
-static const char default_terms [] = { 1,1,1,-1,2,1,-2 };
-static const char simple_terms [] = { 1,1,1,1 };
-
-// This function initializes everything required to unpack WavPack
-// bitstreams and must be called before any unpacking is performed. Note
-// that the (WavpackHeader3 *) in the WavpackStream3 struct must be valid.
-
-static void init_words3 (WavpackStream3 *wps);
-
-static void unpack_init3 (WavpackStream3 *wps)
-{
- int flags = wps->wphdr.flags;
- struct decorr_pass *dpp;
- int ti;
-
- CLEAR (wps->decorr_passes);
- CLEAR (wps->dc);
-
- if (flags & EXTREME_DECORR) {
- for (dpp = wps->decorr_passes, ti = 0; ti < sizeof (extreme_terms); ti++)
- if (extreme_terms [sizeof (extreme_terms) - ti - 1] > 0 || (flags & CROSS_DECORR))
- dpp++->term = extreme_terms [sizeof (extreme_terms) - ti - 1];
- }
- else if (flags & NEW_DECORR_FLAG) {
- for (dpp = wps->decorr_passes, ti = 0; ti < sizeof (default_terms); ti++)
- if (default_terms [sizeof (default_terms) - ti - 1] > 0 || (flags & CROSS_DECORR))
- dpp++->term = default_terms [sizeof (default_terms) - ti - 1];
- }
- else
- for (dpp = wps->decorr_passes, ti = 0; ti < sizeof (simple_terms); ti++)
- dpp++->term = simple_terms [sizeof (simple_terms) - ti - 1];
-
- wps->num_terms = dpp - wps->decorr_passes;
- init_words3 (wps);
-}
-
-#ifdef SEEKING
-
-#define SAVE(destin, item) { memcpy (destin, &item, sizeof (item)); destin = (char *) destin + sizeof (item); }
-#define RESTORE(item, source) { memcpy (&item, source, sizeof (item)); source = (char *) source + sizeof (item); }
-
-// This function returns the size (in bytes) required to save the unpacking
-// context. Note that the (WavpackHeader3 *) in the WavpackStream3 struct
-// must be valid.
-
-static int unpack_size (WavpackStream3 *wps)
-{
- int flags = wps->wphdr.flags, byte_sum = 0, tcount;
- struct decorr_pass *dpp;
-
- byte_sum += sizeof (wps->wvbits);
-
- if (flags & WVC_FLAG)
- byte_sum += sizeof (wps->wvcbits);
-
- if (wps->wphdr.version == 3) {
- if (wps->wphdr.bits)
- byte_sum += sizeof (wps->w4);
- else
- byte_sum += sizeof (wps->w1);
-
- byte_sum += sizeof (wps->w3) + sizeof (wps->dc.crc);
- }
- else
- byte_sum += sizeof (wps->w2);
-
- if (wps->wphdr.bits)
- byte_sum += sizeof (wps->dc.error);
- else
- byte_sum += sizeof (wps->dc.sum_level) + sizeof (wps->dc.left_level) +
- sizeof (wps->dc.right_level) + sizeof (wps->dc.diff_level);
-
- if (flags & OVER_20)
- byte_sum += sizeof (wps->dc.last_extra_bits) + sizeof (wps->dc.extra_bits_count);
-
- if (!(flags & EXTREME_DECORR)) {
- byte_sum += sizeof (wps->dc.sample);
- byte_sum += sizeof (wps->dc.weight);
- }
-
- if (flags & (HIGH_FLAG | NEW_HIGH_FLAG))
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0) {
- byte_sum += sizeof (dpp->samples_A [0]) * dpp->term;
- byte_sum += sizeof (dpp->weight_A);
-
- if (!(flags & MONO_FLAG)) {
- byte_sum += sizeof (dpp->samples_B [0]) * dpp->term;
- byte_sum += sizeof (dpp->weight_B);
- }
- }
- else {
- byte_sum += sizeof (dpp->samples_A [0]) + sizeof (dpp->samples_B [0]);
- byte_sum += sizeof (dpp->weight_A) + sizeof (dpp->weight_B);
- }
-
- return byte_sum;
-}
-
-// This function saves the unpacking context at the specified pointer and
-// returns the updated pointer. The actual amount of data required can be
-// determined beforehand by calling unpack_size() but must be allocated by
-// the caller.
-
-static void *unpack_save (WavpackStream3 *wps, void *destin)
-{
- int flags = wps->wphdr.flags, tcount;
- struct decorr_pass *dpp;
-
- SAVE (destin, wps->wvbits);
-
- if (flags & WVC_FLAG)
- SAVE (destin, wps->wvcbits);
-
- if (wps->wphdr.version == 3) {
- if (wps->wphdr.bits) {
- SAVE (destin, wps->w4);
- }
- else {
- SAVE (destin, wps->w1);
- }
-
- SAVE (destin, wps->w3);
- SAVE (destin, wps->dc.crc);
- }
- else
- SAVE (destin, wps->w2);
-
- if (wps->wphdr.bits) {
- SAVE (destin, wps->dc.error);
- }
- else {
- SAVE (destin, wps->dc.sum_level);
- SAVE (destin, wps->dc.left_level);
- SAVE (destin, wps->dc.right_level);
- SAVE (destin, wps->dc.diff_level);
- }
-
- if (flags & OVER_20) {
- SAVE (destin, wps->dc.last_extra_bits);
- SAVE (destin, wps->dc.extra_bits_count);
- }
-
- if (!(flags & EXTREME_DECORR)) {
- SAVE (destin, wps->dc.sample);
- SAVE (destin, wps->dc.weight);
- }
-
- if (flags & (HIGH_FLAG | NEW_HIGH_FLAG))
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0) {
- int count = dpp->term;
- int index = wps->dc.m;
-
- SAVE (destin, dpp->weight_A);
-
- while (count--) {
- SAVE (destin, dpp->samples_A [index]);
- index = (index + 1) & (MAX_TERM - 1);
- }
-
- if (!(flags & MONO_FLAG)) {
- count = dpp->term;
- index = wps->dc.m;
-
- SAVE (destin, dpp->weight_B);
-
- while (count--) {
- SAVE (destin, dpp->samples_B [index]);
- index = (index + 1) & (MAX_TERM - 1);
- }
- }
- }
- else {
- SAVE (destin, dpp->weight_A);
- SAVE (destin, dpp->weight_B);
- SAVE (destin, dpp->samples_A [0]);
- SAVE (destin, dpp->samples_B [0]);
- }
-
- return destin;
-}
-
-// This function restores the unpacking context from the specified pointer
-// and returns the updated pointer. After this call, unpack_samples() will
-// continue where it left off immediately before unpack_save() was called.
-// If the WavPack files and bitstreams might have been closed and reopened,
-// then the "keep_resources" flag should be set to avoid using the "old"
-// resources that were originally saved (and are probably now invalid).
-
-static void *unpack_restore (WavpackStream3 *wps, void *source, int keep_resources)
-{
- int flags = wps->wphdr.flags, tcount;
- struct decorr_pass *dpp;
- FILE *temp_file;
- uchar *temp_buf;
-
- unpack_init3 (wps);
- temp_file = wps->wvbits.id;
- temp_buf = wps->wvbits.buf;
- RESTORE (wps->wvbits, source);
-
- if (keep_resources) {
- wps->wvbits.id = temp_file;
- wps->wvbits.ptr += temp_buf - wps->wvbits.buf;
- wps->wvbits.end += temp_buf - wps->wvbits.buf;
- wps->wvbits.buf = temp_buf;
- }
-
- bs_restore3 (&wps->wvbits);
-
- if (flags & WVC_FLAG) {
- temp_file = wps->wvcbits.id;
- temp_buf = wps->wvcbits.buf;
- RESTORE (wps->wvcbits, source);
-
- if (keep_resources) {
- wps->wvcbits.id = temp_file;
- wps->wvcbits.ptr += temp_buf - wps->wvcbits.buf;
- wps->wvcbits.end += temp_buf - wps->wvcbits.buf;
- wps->wvcbits.buf = temp_buf;
- }
-
- bs_restore3 (&wps->wvcbits);
- }
-
- if (wps->wphdr.version == 3) {
- if (wps->wphdr.bits) {
- RESTORE (wps->w4, source);
- }
- else {
- RESTORE (wps->w1, source);
- }
-
- RESTORE (wps->w3, source);
- RESTORE (wps->dc.crc, source);
- }
- else
- RESTORE (wps->w2, source);
-
- if (wps->wphdr.bits) {
- RESTORE (wps->dc.error, source);
- }
- else {
- RESTORE (wps->dc.sum_level, source);
- RESTORE (wps->dc.left_level, source);
- RESTORE (wps->dc.right_level, source);
- RESTORE (wps->dc.diff_level, source);
- }
-
- if (flags & OVER_20) {
- RESTORE (wps->dc.last_extra_bits, source);
- RESTORE (wps->dc.extra_bits_count, source);
- }
-
- if (!(flags & EXTREME_DECORR)) {
- RESTORE (wps->dc.sample, source);
- RESTORE (wps->dc.weight, source);
- }
-
- if (flags & (HIGH_FLAG | NEW_HIGH_FLAG))
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0) {
- int count = dpp->term;
- int index = wps->dc.m;
-
- RESTORE (dpp->weight_A, source);
-
- while (count--) {
- RESTORE (dpp->samples_A [index], source);
- index = (index + 1) & (MAX_TERM - 1);
- }
-
- if (!(flags & MONO_FLAG)) {
- count = dpp->term;
- index = wps->dc.m;
-
- RESTORE (dpp->weight_B, source);
-
- while (count--) {
- RESTORE (dpp->samples_B [index], source);
- index = (index + 1) & (MAX_TERM - 1);
- }
- }
- }
- else {
- RESTORE (dpp->weight_A, source);
- RESTORE (dpp->weight_B, source);
- RESTORE (dpp->samples_A [0], source);
- RESTORE (dpp->samples_B [0], source);
- }
-
- return source;
-}
-
-// This is an extension for WavpackSeekSample (). Note that because WavPack
-// files created prior to version 4.0 are not inherently seekable, this
-// function could take a long time if a forward seek is requested to an
-// area that has not been played (or seeked through) yet.
-
-
-int seek_sample3 (WavpackContext *wpc, uint32_t desired_index)
-{
- int points_index = desired_index / ((wpc->total_samples >> 8) + 1);
- WavpackStream3 *wps = (WavpackStream3 *) wpc->stream3;
-
- if (desired_index >= wpc->total_samples)
- return FALSE;
-
- while (points_index)
- if (wps->index_points [points_index].saved &&
- wps->index_points [points_index].sample_index <= desired_index)
- break;
- else
- points_index--;
-
- if (wps->index_points [points_index].saved)
- if (wps->index_points [points_index].sample_index > wps->sample_index ||
- wps->sample_index > desired_index) {
- wps->sample_index = wps->index_points [points_index].sample_index;
- unpack_restore (wps, wps->unpack_data + points_index * wps->unpack_size, TRUE);
- }
-
- if (desired_index > wps->sample_index) {
- int32_t *buffer = (int32_t *) malloc (1024 * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
- uint32_t samples_to_skip = desired_index - wps->sample_index;
-
- while (1) {
- if (samples_to_skip > 1024) {
- if (unpack_samples3 (wpc, buffer, 1024) == 1024)
- samples_to_skip -= 1024;
- else
- break;
- }
- else {
- samples_to_skip -= unpack_samples3 (wpc, buffer, samples_to_skip);
- break;
- }
- }
-
- free (buffer);
-
- if (samples_to_skip)
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-#endif
-
-// This monster actually unpacks the WavPack bitstream(s) into the specified
-// buffer as longs, and serves as an extension to WavpackUnpackSamples().
-// Note that WavPack files created prior to version 4.0 could only contain 16
-// or 24 bit values, and these values are right-justified in the 32-bit values.
-// So, if the original file contained 16-bit values, then the range of the
-// returned longs would be +/- 32K. For maximum clarity, the function is
-// broken up into segments that handle various modes. This makes for a few
-// extra infrequent flag checks, but makes the code easier to follow because
-// the nesting does not become so deep. For maximum efficiency, the conversion
-// is isolated to tight loops that handle an entire buffer.
-
-static int32_t FASTCALL get_word1 (WavpackStream3 *wps, int chan);
-static int32_t FASTCALL get_old_word1 (WavpackStream3 *wps, int chan);
-static int32_t FASTCALL get_word2 (WavpackStream3 *wps, int chan);
-static int32_t FASTCALL get_word3 (WavpackStream3 *wps, int chan);
-static int32_t FASTCALL get_word4 (WavpackStream3 *wps, int chan, int32_t *correction);
-
-int32_t unpack_samples3 (WavpackContext *wpc, int32_t *buffer, uint32_t sample_count)
-{
- WavpackStream3 *wps = (WavpackStream3 *) wpc->stream3;
- int shift = wps->wphdr.shift, flags = wps->wphdr.flags, min_weight = 0, m = wps->dc.m, tcount;
-#ifdef SEEKING
- int points_index = wps->sample_index / ((wpc->total_samples >> 8) + 1);
-#endif
- int32_t min_value, max_value, min_shifted, max_shifted;
- int32_t correction [2], crc = wps->dc.crc;
- struct decorr_pass *dpp;
- int32_t read_word, *bptr;
- int32_t sample [2] [2];
- int weight [2] [1];
- uint i;
-
- if (wps->sample_index + sample_count > wpc->total_samples)
- sample_count = wpc->total_samples - wps->sample_index;
-
- if (!sample_count)
- return 0;
-
- if (!wps->sample_index) {
- unpack_init3 (wps);
-
- bs_open_read3 (&wps->wvbits, wpc->reader, wpc->wv_in);
-
- if (wpc->wvc_flag)
- bs_open_read3 (&wps->wvcbits, wpc->reader, wpc->wvc_in);
- }
-
-#ifdef SEEKING
- if (!wps->index_points [points_index].saved) {
-
- if (!wps->unpack_data)
- wps->unpack_data = (uchar *) malloc (256 * (wps->unpack_size = unpack_size (wps)));
-
- wps->index_points [points_index].sample_index = wps->sample_index;
- unpack_save (wps, wps->unpack_data + points_index * wps->unpack_size);
- wps->index_points [points_index].saved = TRUE;
- }
-#endif
-
- memcpy (sample, wps->dc.sample, sizeof (sample));
- memcpy (weight, wps->dc.weight, sizeof (weight));
-
- if (wps->wphdr.bits) {
- if (flags & (NEW_DECORR_FLAG | EXTREME_DECORR))
- min_weight = -256;
- }
- else
- if (flags & NEW_DECORR_FLAG)
- min_weight = (flags & EXTREME_DECORR) ? -512 : -256;
-
- if (flags & BYTES_3) {
- min_shifted = (min_value = -8388608 >> shift) << shift;
- max_shifted = (max_value = 8388607 >> shift) << shift;
- }
- else {
- min_shifted = (min_value = -32768 >> shift) << shift;
- max_shifted = (max_value = 32767 >> shift) << shift;
- }
-
- ///////////////// handle version 3 lossless mono data /////////////////////
-
- if (wps->wphdr.version == 3 && !wps->wphdr.bits && (flags & MONO_FLAG)) {
- if (flags & FAST_FLAG) {
- if (flags & OVER_20)
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t temp;
-
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- sample [0] [0] += sample [0] [1] += read_word;
- getbits (&temp, 4, &wps->wvbits);
- crc = crc * 3 + (temp = (temp & 0xf) + (sample [0] [0] << 4));
- *bptr++ = temp;
- }
- else
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- crc = crc * 3 + (sample [0] [0] += sample [0] [1] += read_word);
- *bptr++ = sample [0] [0] << shift;
- }
- }
- else if (flags & HIGH_FLAG)
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t temp;
-
- if (flags & NEW_HIGH_FLAG) {
- if ((read_word = get_word1 (wps, 0)) == WORD_EOF)
- break;
- }
- else {
- if ((read_word = get_old_word1 (wps, 0)) == WORD_EOF)
- break;
- }
-
- if (flags & EXTREME_DECORR)
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam = dpp->samples_A [m];
-
- temp = apply_weight_n (9, dpp->weight_A, sam) + read_word;
- update_weight_n (9, dpp->weight_A, sam, read_word);
- dpp->samples_A [(m + dpp->term) & (MAX_TERM - 1)] = read_word = temp;
- }
- else
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam = dpp->samples_A [m];
-
- temp = apply_weight_n (8, dpp->weight_A, sam) + read_word;
- update_weight_n (8, dpp->weight_A, sam, read_word);
- dpp->samples_A [(m + dpp->term) & (MAX_TERM - 1)] = read_word = temp;
- }
-
- m = (m + 1) & (MAX_TERM - 1);
-
- if (flags & OVER_20) {
- if (wps->dc.extra_bits_count < 8 || !getbit (&wps->wvbits)) {
- getbits (&temp, 4, &wps->wvbits);
-
- if ((temp &= 0xf) != wps->dc.last_extra_bits) {
- wps->dc.last_extra_bits = temp;
- wps->dc.extra_bits_count = 0;
- }
- else
- ++wps->dc.extra_bits_count;
- }
-
- crc = crc * 3 + (temp = wps->dc.last_extra_bits + (read_word << 4));
- *bptr++ = temp;
- }
- else {
- crc = crc * 3 + read_word;
- *bptr++ = read_word << shift;
- }
- }
- else
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
-
- int32_t temp;
-
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- temp = sample [0] [0] + ((sample [0] [1] * weight [0] [0] + 128) >> 8) + read_word;
-
- if ((sample [0] [1] >= 0) == (read_word > 0)) {
- if (weight [0] [0]++ == 256)
- weight [0] [0]--;
- }
- else if (weight [0] [0]-- == 0)
- weight [0] [0]++;
-
- sample [0] [0] += (sample [0] [1] = temp - sample [0] [0]);
-
- if (flags & OVER_20) {
- if (wps->dc.extra_bits_count < 8 || !getbit (&wps->wvbits)) {
- getbits (&temp, 4, &wps->wvbits);
-
- if ((temp &= 0xf) != wps->dc.last_extra_bits) {
- wps->dc.last_extra_bits = temp;
- wps->dc.extra_bits_count = 0;
- }
- else
- ++wps->dc.extra_bits_count;
- }
-
- crc = crc * 3 + (*bptr++ = temp = wps->dc.last_extra_bits + (sample [0] [0] << 4));
- }
- else {
- crc = crc * 3 + sample [0] [0];
- *bptr++ = sample [0] [0] << shift;
- }
- }
- }
-
- //////////////// handle version 3 lossless stereo data ////////////////////
-
- else if (wps->wphdr.version == 3 && !wps->wphdr.bits && !(flags & MONO_FLAG)) {
- int32_t left_level = wps->dc.left_level, right_level = wps->dc.right_level;
- int32_t sum_level = wps->dc.sum_level, diff_level = wps->dc.diff_level;
-
- if (flags & FAST_FLAG) {
- if (flags & OVER_20)
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t sum, diff, temp;
-
- read_word = get_word3 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- sum = (read_word << 1) | ((diff = get_word3 (wps, 1)) & 1);
- sample [0] [0] += sample [0] [1] += ((sum + diff) >> 1);
- sample [1] [0] += sample [1] [1] += ((sum - diff) >> 1);
- getbits (&temp, 8, &wps->wvbits);
- crc = crc * 3 + (*bptr++ = (sample [0] [0] << 4) + ((temp >> 4) & 0xf));
- crc = crc * 3 + (*bptr++ = (sample [1] [0] << 4) + (temp & 0xf));
- }
- else
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t sum, diff;
-
- read_word = get_word3 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- sum = (read_word << 1) | ((diff = get_word3 (wps, 1)) & 1);
- sample [0] [1] += ((sum + diff) >> 1);
- sample [1] [1] += ((sum - diff) >> 1);
- crc = crc * 3 + (sample [0] [0] += sample [0] [1]);
- crc = crc * 3 + (sample [1] [0] += sample [1] [1]);
- *bptr++ = sample [0] [0] << shift;
- *bptr++ = sample [1] [0] << shift;
- }
- }
- else if (flags & HIGH_FLAG) {
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t sum, left, right, diff, left2, right2, extra_bits, next_word;
-
- if (flags & CROSS_DECORR) {
- left = get_word1 (wps, 0);
-
- if (left == WORD_EOF)
- break;
-
- right = get_word1 (wps, 1);
- }
- else {
- if (flags & NEW_HIGH_FLAG) {
- read_word = get_word1 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- next_word = get_word1 (wps, 1);
-
- if (right_level > left_level) {
- if (left_level + right_level < sum_level + diff_level && right_level < diff_level) {
- sum = (right = read_word) + (left = next_word);
- diff = left - right;
- }
- else {
- diff = read_word;
-
- if (sum_level < left_level) {
- sum = (next_word << 1) | (diff & 1);
- left = (sum + diff) >> 1;
- right = (sum - diff) >> 1;
- }
- else
- sum = left + (right = (left = next_word) - diff);
- }
- }
- else {
- if (left_level + right_level < sum_level + diff_level && left_level < diff_level) {
- sum = (left = read_word) + (right = next_word);
- diff = left - right;
- }
- else {
- diff = read_word;
-
- if (sum_level < right_level) {
- sum = (next_word << 1) | (diff & 1);
- left = (sum + diff) >> 1;
- right = (sum - diff) >> 1;
- }
- else
- sum = (left = diff + (right = next_word)) + right;
- }
- }
- }
- else {
- read_word = get_old_word1 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- next_word = get_old_word1 (wps, 1);
-
- if (sum_level <= right_level && sum_level <= left_level) {
- sum = (next_word << 1) | (read_word & 1);
- left = (sum + read_word) >> 1;
- right = (sum - read_word) >> 1;
- }
- else if (left_level <= right_level)
- sum = left + (right = (left = next_word) - read_word);
- else
- sum = right + (left = read_word + (right = next_word));
-
- diff = left - right;
- }
-
- sum_level = sum_level - (sum_level >> 8) + labs (sum >> 1);
- left_level = left_level - (left_level >> 8) + labs (left);
- right_level = right_level - (right_level >> 8) + labs (right);
- diff_level = diff_level - (diff_level >> 8) + labs (diff);
-
- if (flags & JOINT_STEREO) {
- left = diff;
- right = sum >> 1;
- }
- }
-
- if (flags & EXTREME_DECORR) {
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0) {
- int32_t sam_A = dpp->samples_A [m], sam_B = dpp->samples_B [m];
- int k = (m + dpp->term) & (MAX_TERM - 1);
-
- left2 = apply_weight_n (9, dpp->weight_A, sam_A) + left;
- right2 = apply_weight_n (9, dpp->weight_B, sam_B) + right;
-
- update_weight_n (9, dpp->weight_A, sam_A, left);
- update_weight_n (9, dpp->weight_B, sam_B, right);
-
- dpp->samples_A [k] = left = left2;
- dpp->samples_B [k] = right = right2;
- }
- else if (dpp->term == -1) {
- left2 = left + apply_weight_n (9, dpp->weight_A, dpp->samples_A [0]);
- update_weight_n (9, dpp->weight_A, dpp->samples_A [0], left);
- left = left2;
- right2 = right + apply_weight_n (9, dpp->weight_B, left);
- update_weight_n (9, dpp->weight_B, left, right);
- dpp->samples_A [0] = right = right2;
- }
- else {
- right2 = right + apply_weight_n (9, dpp->weight_A, dpp->samples_A [0]);
- update_weight_n (9, dpp->weight_A, dpp->samples_A [0], right);
- right = right2;
- left2 = left + apply_weight_n (9, dpp->weight_B, right);
- update_weight_n (9, dpp->weight_B, right, left);
- dpp->samples_A [0] = left = left2;
- }
- }
- else {
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++)
- if (dpp->term > 0) {
- int32_t sam_A = dpp->samples_A [m], sam_B = dpp->samples_B [m];
- int k = (m + dpp->term) & (MAX_TERM - 1);
-
- left2 = apply_weight_n (8, dpp->weight_A, sam_A) + left;
- right2 = apply_weight_n (8, dpp->weight_B, sam_B) + right;
-
- update_weight_n (8, dpp->weight_A, sam_A, left);
- update_weight_n (8, dpp->weight_B, sam_B, right);
-
- dpp->samples_A [k] = left = left2;
- dpp->samples_B [k] = right = right2;
- }
- else if (dpp->term == -1) {
- left2 = left + apply_weight_n (8, dpp->weight_A, dpp->samples_A [0]);
- update_weight_n (8, dpp->weight_A, dpp->samples_A [0], left);
- left = left2;
- right2 = right + apply_weight_n (8, dpp->weight_B, left);
- update_weight_n (8, dpp->weight_B, left, right);
- dpp->samples_A [0] = right = right2;
- }
- else {
- right2 = right + apply_weight_n (8, dpp->weight_A, dpp->samples_A [0]);
- update_weight_n (8, dpp->weight_A, dpp->samples_A [0], right);
- right = right2;
- left2 = left + apply_weight_n (8, dpp->weight_B, right);
- update_weight_n (8, dpp->weight_B, right, left);
- dpp->samples_A [0] = left = left2;
- }
- }
-
- m = (m + 1) & (MAX_TERM - 1);
-
- if (flags & JOINT_STEREO) {
- sum = (right << 1) | ((diff = left) & 1);
- right = (sum - diff) >> 1;
- left = (sum + diff) >> 1;
- }
-
- if (flags & OVER_20) {
- if (wps->dc.extra_bits_count < 8 || !getbit (&wps->wvbits)) {
- getbits (&extra_bits, 8, &wps->wvbits);
-
- if ((extra_bits &= 0xff) != wps->dc.last_extra_bits) {
- wps->dc.last_extra_bits = extra_bits;
- wps->dc.extra_bits_count = 0;
- }
- else
- ++wps->dc.extra_bits_count;
- }
-
- crc = crc * 3 + (*bptr++ = left = (left << 4) + (wps->dc.last_extra_bits >> 4));
- crc = crc * 3 + (*bptr++ = right = (right << 4) + (wps->dc.last_extra_bits & 0xf));
- }
- else {
- crc = crc * 9 + left * 3 + right;
- *bptr++ = left << shift;
- *bptr++ = right << shift;
- }
- }
- }
- else
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t sum, left, right, left2, right2, extra_bits;
-
- read_word = get_word3 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- if (sum_level <= right_level && sum_level <= left_level) {
- sum = (get_word3 (wps, 1) << 1) | (read_word & 1);
- left = (sum + read_word) >> 1;
- right = (sum - read_word) >> 1;
- }
- else if (left_level <= right_level)
- sum = left + (right = (left = get_word3 (wps, 1)) - read_word);
- else
- sum = right + (left = read_word + (right = get_word3 (wps, 1)));
-
- sum_level = sum_level - (sum_level >> 8) + labs (sum >> 1);
- left_level = left_level - (left_level >> 8) + labs (left);
- right_level = right_level - (right_level >> 8) + labs (right);
-
- left2 = sample [0] [0] + ((sample [0] [1] * weight [0] [0] + 128) >> 8) + left;
- right2 = sample [1] [0] + ((sample [1] [1] * weight [1] [0] + 128) >> 8) + right;
-
- if ((sample [0] [1] >= 0) == (left > 0)) {
- if (weight [0] [0]++ == 256)
- weight [0] [0]--;
- }
- else if (weight [0] [0]-- == 0)
- weight [0] [0]++;
-
- if ((sample [1] [1] >= 0) == (right > 0)) {
- if (weight [1] [0]++ == 256)
- weight [1] [0]--;
- }
- else if (weight [1] [0]-- == 0)
- weight [1] [0]++;
-
- sample [0] [0] += (sample [0] [1] = left2 - sample [0] [0]);
- sample [1] [0] += (sample [1] [1] = right2 - sample [1] [0]);
-
- if (flags & OVER_20) {
- if (wps->dc.extra_bits_count < 8 || !getbit (&wps->wvbits)) {
- getbits (&extra_bits, 8, &wps->wvbits);
-
- if ((extra_bits &= 0xff) != wps->dc.last_extra_bits) {
- wps->dc.last_extra_bits = extra_bits;
- wps->dc.extra_bits_count = 0;
- }
- else
- ++wps->dc.extra_bits_count;
- }
-
- crc = crc * 3 + (*bptr++ = left2 = (sample [0] [0] << 4) + (wps->dc.last_extra_bits >> 4));
- crc = crc * 3 + (*bptr++ = right2 = (sample [1] [0] << 4) + (wps->dc.last_extra_bits & 0xf));
- }
- else {
- crc = crc * 9 + sample [0] [0] * 3 + sample [1] [0];
- *bptr++ = sample [0] [0] << shift;
- *bptr++ = sample [1] [0] << shift;
- }
- }
-
- wps->dc.left_level = left_level;
- wps->dc.right_level = right_level;
- wps->dc.sum_level = sum_level;
- wps->dc.diff_level = diff_level;
- }
-
- //////////////// handle version 3 lossy/hybrid mono data //////////////////
-
- else if (wps->wphdr.version == 3 && wps->wphdr.bits && (flags & MONO_FLAG)) {
- if (flags & FAST_FLAG)
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
-
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- crc = crc * 3 + (sample [0] [0] += sample [0] [1] += read_word);
-
- if (sample [0] [0] < min_value)
- *bptr++ = min_shifted;
- else if (sample [0] [0] > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = sample [0] [0] << shift;
- }
- else if (flags & (HIGH_FLAG | NEW_HIGH_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t temp;
-
- read_word = (flags & NEW_HIGH_FLAG) ?
- get_word4 (wps, 0, correction) : get_word3 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam = dpp->samples_A [m];
-
- temp = apply_weight24 (dpp->weight_A, sam) + read_word;
- update_weight2 (dpp->weight_A, sam, read_word);
- dpp->samples_A [(m + dpp->term) & (MAX_TERM - 1)] = read_word = temp;
- }
-
- m = (m + 1) & (MAX_TERM - 1);
-
- if (flags & WVC_FLAG) {
- if (flags & LOSSY_SHAPE) {
- crc = crc * 3 + (read_word += correction [0] + wps->dc.error [0]);
- wps->dc.error [0] = -correction [0];
- }
- else
- crc = crc * 3 + (read_word += correction [0]);
-
- *bptr++ = read_word << shift;
- }
- else {
- crc = crc * 3 + read_word;
-
- if (read_word < min_value)
- *bptr++ = min_shifted;
- else if (read_word > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = read_word << shift;
- }
- }
- else
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t new_sample;
-
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- new_sample = sample [0] [0] + ((sample [0] [1] * weight [0] [0] + 128) >> 8) + read_word;
-
- if ((sample [0] [1] >= 0) == (read_word > 0)) {
- if (weight [0] [0]++ == 256)
- weight [0] [0]--;
- }
- else if (weight [0] [0]-- == 0)
- weight [0] [0]++;
-
- sample [0] [1] = new_sample - sample [0] [0];
- crc = crc * 3 + (sample [0] [0] = new_sample);
-
- if (sample [0] [0] < min_value)
- *bptr++ = min_shifted;
- else if (sample [0] [0] > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = sample [0] [0] << shift;
- }
- }
-
- //////////////// handle version 3 lossy/hybrid stereo data ////////////////
-
- else if (wps->wphdr.version == 3 && wps->wphdr.bits && !(flags & MONO_FLAG)) {
- if (flags & FAST_FLAG)
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
-
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- crc = crc * 3 + (sample [0] [0] += sample [0] [1] += read_word);
-
- if (sample [0] [0] < min_value)
- *bptr++ = min_shifted;
- else if (sample [0] [0] > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = sample [0] [0] << shift;
-
- crc = crc * 3 + (sample [1] [0] += sample [1] [1] += get_word3 (wps, 1));
-
- if (sample [1] [0] < min_value)
- *bptr++ = min_shifted;
- else if (sample [1] [0] > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = sample [1] [0] << shift;
- }
- else if (flags & (HIGH_FLAG | NEW_HIGH_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t left, right, left2, right2, sum, diff;
-
- if (flags & NEW_HIGH_FLAG) {
- left = get_word4 (wps, 0, correction);
- right = get_word4 (wps, 1, correction + 1);
- }
- else {
- left = get_word3 (wps, 0);
- right = get_word3 (wps, 1);
- }
-
- if (left == WORD_EOF)
- break;
-
- for (tcount = wps->num_terms, dpp = wps->decorr_passes; tcount--; dpp++) {
- int32_t sam_A = dpp->samples_A [m], sam_B = dpp->samples_B [m];
- int k = (m + dpp->term) & (MAX_TERM - 1);
-
- left2 = apply_weight24 (dpp->weight_A, sam_A) + left;
- update_weight2 (dpp->weight_A, sam_A, left);
- dpp->samples_A [k] = left = left2;
-
- right2 = apply_weight24 (dpp->weight_B, sam_B) + right;
- update_weight2 (dpp->weight_B, sam_B, right);
- dpp->samples_B [k] = right = right2;
- }
-
- m = (m + 1) & (MAX_TERM - 1);
-
- if (flags & WVC_FLAG) {
- if (flags & LOSSY_SHAPE) {
- left += correction [0] + wps->dc.error [0];
- right += correction [1] + wps->dc.error [1];
- wps->dc.error [0] = -correction [0];
- wps->dc.error [1] = -correction [1];
- }
- else {
- left += correction [0];
- right += correction [1];
- }
- }
-
- if (flags & JOINT_STEREO) {
- right = ((sum = (right << 1) | (left & 1)) - (diff = left)) >> 1;
- left = (sum + diff) >> 1;
- }
-
- crc = crc * 9 + left * 3 + right;
-
- if (flags & WVC_FLAG) {
- *bptr++ = left << shift;
- *bptr++ = right << shift;
- }
- else {
- if (left < min_value)
- *bptr++ = min_shifted;
- else if (left > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = left << shift;
-
- if (right < min_value)
- *bptr++ = min_shifted;
- else if (right > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = right << shift;
- }
- }
- else
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t new_sample;
-
- if ((read_word = get_word3 (wps, 0)) == WORD_EOF)
- break;
-
- new_sample = sample [0] [0] + ((sample [0] [1] * weight [0] [0] + 128) >> 8) + read_word;
-
- if ((sample [0] [1] >= 0) == (read_word > 0)) {
- if (weight [0] [0]++ == 256)
- weight [0] [0]--;
- }
- else if (weight [0] [0]-- == 0)
- weight [0] [0]++;
-
- sample [0] [1] = new_sample - sample [0] [0];
- crc = crc * 3 + (sample [0] [0] = new_sample);
-
- read_word = get_word3 (wps, 1);
- new_sample = sample [1] [0] + ((sample [1] [1] * weight [1] [0] + 128) >> 8) + read_word;
-
- if ((sample [1] [1] >= 0) == (read_word > 0)) {
- if (weight [1] [0]++ == 256)
- weight [1] [0]--;
- }
- else if (weight [1] [0]-- == 0)
- weight [1] [0]++;
-
- sample [1] [1] = new_sample - sample [1] [0];
- crc = crc * 3 + (sample [1] [0] = new_sample);
-
- if (sample [0] [0] < min_value)
- *bptr++ = min_shifted;
- else if (sample [0] [0] > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = sample [0] [0] << shift;
-
- if (sample [1] [0] < min_value)
- *bptr++ = min_shifted;
- else if (sample [1] [0] > max_value)
- *bptr++ = max_shifted;
- else
- *bptr++ = sample [1] [0] << shift;
- }
- }
-
- //////////////////// finally, handle version 2 data ///////////////////////
-
- else if (wps->wphdr.version == 2 && (flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- if ((read_word = get_word2 (wps, 0)) == WORD_EOF)
- break;
-
- sample [0] [0] += sample [0] [1] += read_word;
-
- if (wps->wphdr.bits) {
- if (sample [0] [0] < min_value)
- sample [0] [0] = min_value;
- else if (sample [0] [0] > max_value)
- sample [0] [0] = max_value;
- }
-
- *bptr++ = sample [0] [0] << shift;
- }
- else if (wps->wphdr.version < 3 && !(flags & MONO_FLAG))
- for (bptr = buffer, i = 0; i < sample_count; ++i) {
- int32_t sum, diff;
-
- read_word = get_word2 (wps, 0);
-
- if (read_word == WORD_EOF)
- break;
-
- sum = (read_word << 1) | ((diff = get_word2 (wps, 1)) & 1);
- sample [0] [0] += sample [0] [1] += ((sum + diff) >> 1);
- sample [1] [0] += sample [1] [1] += ((sum - diff) >> 1);
-
- if (wps->wphdr.bits) {
- if (sample [0] [0] < min_value)
- sample [0] [0] = min_value;
- else if (sample [0] [0] > max_value)
- sample [0] [0] = max_value;
-
- if (sample [1] [0] < min_value)
- sample [1] [0] = min_value;
- else if (sample [1] [0] > max_value)
- sample [1] [0] = max_value;
- }
-
- *bptr++ = sample [0] [0] << shift;
- *bptr++ = sample [1] [0] << shift;
- }
-
- if (i && (wps->sample_index += i) == wpc->total_samples) {
-
- if (wps->wphdr.version == 3 && crc != (wpc->wvc_flag ? wps->wphdr.crc2 : wps->wphdr.crc))
- wpc->crc_errors++;
-
- if (wpc->open_flags & OPEN_WRAPPER) {
- uchar *temp = malloc (1024);
- uint32_t bcount;
-
- if (bs_unused_bytes (&wps->wvbits)) {
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + bs_unused_bytes (&wps->wvbits));
- memcpy (wpc->wrapper_data + wpc->wrapper_bytes, bs_unused_data (&wps->wvbits), bs_unused_bytes (&wps->wvbits));
- wpc->wrapper_bytes += bs_unused_bytes (&wps->wvbits);
- }
-
- while (1) {
- bcount = wpc->reader->read_bytes (wpc->wv_in, temp, sizeof (temp));
-
- if (!bcount)
- break;
-
- wpc->wrapper_data = realloc (wpc->wrapper_data, wpc->wrapper_bytes + bcount);
- memcpy (wpc->wrapper_data + wpc->wrapper_bytes, temp, bcount);
- wpc->wrapper_bytes += bcount;
- }
-
- free (temp);
-
- if (wpc->wrapper_bytes > 16) {
- int c;
-
- for (c = 0; c < 16 && wpc->wrapper_data [c] == 0xff; ++c);
-
- if (c == 16) {
- memcpy (wpc->wrapper_data, wpc->wrapper_data + 16, wpc->wrapper_bytes - 16);
- wpc->wrapper_bytes -= 16;
- }
- else {
- free (wpc->wrapper_data);
- wpc->wrapper_data = NULL;
- wpc->wrapper_bytes = 0;
- }
- }
- }
- }
-
- memcpy (wps->dc.sample, sample, sizeof (sample));
- memcpy (wps->dc.weight, weight, sizeof (weight));
- wps->dc.crc = crc;
- wps->dc.m = m;
-
- return i;
-}
-
-///////////////////////////// local table storage ////////////////////////////
-
-extern const uint32_t bitset [];
-extern const uint32_t bitmask [];
-extern const char nbits_table [];
-
-// This function initializes everything required to receive words with this
-// module and must be called BEFORE any other function in this module.
-
-static void init_words3 (WavpackStream3 *wps)
-{
- CLEAR (wps->w1);
- CLEAR (wps->w2);
- CLEAR (wps->w3);
- CLEAR (wps->w4);
-
- if (wps->wphdr.flags & MONO_FLAG)
- wps->w4.bitrate = wps->wphdr.bits - 768;
- else
- wps->w4.bitrate = (wps->wphdr.bits / 2) - 768;
-}
-
-// This macro counts the number of bits that are required to specify the
-// unsigned 32-bit value, counting from the LSB to the most significant bit
-// that is set. Return range is 0 - 32.
-
-#define count_bits(av) ( \
- (av) < (1 << 8) ? nbits_table [av] : \
- ( \
- (av) < (1L << 16) ? nbits_table [(av) >> 8] + 8 : \
- ((av) < (1L << 24) ? nbits_table [(av) >> 16] + 16 : nbits_table [(av) >> 24] + 24) \
- ) \
-)
-
-static int32_t FASTCALL get_word1 (WavpackStream3 *wps, int chan)
-{
- uint32_t tmp1, tmp2, avalue;
- uint ones_count;
- int k;
-
- if ((wps->wphdr.flags & EXTREME_DECORR) && !(wps->wphdr.flags & OVER_20)) {
- if (wps->w1.zeros_acc) {
- if (--wps->w1.zeros_acc)
- return 0;
- }
- else if (wps->w1.ave_level [0] [0] < 0x20 && wps->w1.ave_level [0] [1] < 0x20) {
- int32_t mask;
- int cbits;
-
- for (cbits = 0; cbits < 33 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 33)
- return WORD_EOF;
-
- if (cbits < 2)
- wps->w1.zeros_acc = cbits;
- else {
- for (mask = 1, wps->w1.zeros_acc = 0; --cbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- wps->w1.zeros_acc |= mask;
-
- wps->w1.zeros_acc |= mask;
- }
-
- if (wps->w1.zeros_acc)
- return 0;
- }
- }
-
- // count consecutive ones in bitstream, > 25 indicates error (or EOF)
-
- for (ones_count = 0; ones_count < 25 && getbit (&wps->wvbits); ++ones_count);
-
- if (ones_count == 25)
- return WORD_EOF;
-
- k = (wps->w1.ave_level [0] [chan] + (wps->w1.ave_level [0] [chan] >> 3) + 0x40) >> 7;
- k = count_bits (k);
-
- if (ones_count == 0) {
- getbits (&avalue, k, &wps->wvbits);
- avalue &= bitmask [k];
- }
- else {
- tmp1 = bitset [k];
- k = (wps->w1.ave_level [1] [chan] + (wps->w1.ave_level [1] [chan] >> 4) + 0x20) >> 6;
- k = count_bits (k);
-
- if (ones_count == 1) {
- getbits (&avalue, k, &wps->wvbits);
- avalue &= bitmask [k];
- }
- else {
- tmp2 = bitset [k];
-
- // If the ones count is exactly 24, then next 24 bits are literal
-
- if (ones_count == 24) {
- getbits (&avalue, 24, &wps->wvbits);
- avalue &= 0xffffff;
- }
- else {
- k = (wps->w1.ave_level [2] [chan] + 0x10) >> 5;
- k = count_bits (k);
- getbits (&avalue, k, &wps->wvbits);
- avalue = (avalue & bitmask [k]) + (bitset [k] * (ones_count - 2));
- }
-
- wps->w1.ave_level [2] [chan] -= ((wps->w1.ave_level [2] [chan] + 0x8) >> 4);
- wps->w1.ave_level [2] [chan] += avalue;
- avalue += tmp2;
- }
-
- wps->w1.ave_level [1] [chan] -= ((wps->w1.ave_level [1] [chan] + 0x10) >> 5);
- wps->w1.ave_level [1] [chan] += avalue;
- avalue += tmp1;
- }
-
- wps->w1.ave_level [0] [chan] -= ((wps->w1.ave_level [0] [chan] + 0x20) >> 6);
- wps->w1.ave_level [0] [chan] += avalue;
-
- return (avalue && getbit (&wps->wvbits)) ? -(int32_t)avalue : avalue;
-}
-
-#define NUM_SAMPLES 128
-
-static int32_t FASTCALL get_old_word1 (WavpackStream3 *wps, int chan)
-{
- uint32_t avalue;
- uint bc;
- int k;
-
- if (!wps->w1.index [chan]) {
-
- int guess_k = (wps->w1.ave_k [chan] + 128) >> 8, ones;
-
- for (ones = 0; ones < 72 && getbit (&wps->wvbits); ++ones);
-
- if (ones == 72)
- return WORD_EOF;
-
- if (ones % 3 == 1)
- wps->w1.k_value [chan] = guess_k - (ones / 3) - 1;
- else
- wps->w1.k_value [chan] = guess_k + ones - ((ones + 1) / 3);
-
- wps->w1.ave_k [chan] -= (wps->w1.ave_k [chan] + 0x10) >> 5;
- wps->w1.ave_k [chan] += wps->w1.k_value [chan] << 3;
- }
-
- if (++wps->w1.index [chan] == NUM_SAMPLES)
- wps->w1.index [chan] = 0;
-
- k = wps->w1.k_value [chan];
- getbits (&avalue, k, &wps->wvbits);
-
- for (bc = 0; bc < 32 && getbit (&wps->wvbits); ++bc);
-
- if (bc == 32)
- return WORD_EOF;
-
- avalue = (avalue & bitmask [k]) + bitset [k] * bc;
- return (avalue && getbit (&wps->wvbits)) ? -(int32_t)avalue : avalue;
-}
-
-static int32_t FASTCALL get_word2 (WavpackStream3 *wps, int chan)
-{
- int cbits, delta_dbits, dbits;
- int32_t value, mask = 1;
-
- cbits = 0;
-
- while (getbit (&wps->wvbits))
- if ((cbits += 2) == 50)
- return WORD_EOF;
-
- if (getbit (&wps->wvbits))
- cbits++;
-
- if (cbits == 0)
- delta_dbits = 0;
- else if (cbits & 1) {
- delta_dbits = (cbits + 1) / 2;
-
- if (wps->w2.last_delta_sign [chan] > 0)
- delta_dbits *= -1;
-
- wps->w2.last_delta_sign [chan] = delta_dbits;
- }
- else {
- delta_dbits = cbits / 2;
-
- if (wps->w2.last_delta_sign [chan] <= 0)
- delta_dbits *= -1;
- }
-
- dbits = (wps->w2.last_dbits [chan] += delta_dbits);
-
- if (dbits < 0 || dbits > 20)
- return WORD_EOF;
-
- if (!dbits)
- return 0L;
-
- if (wps->wphdr.bits) {
- for (value = 1L << (dbits - 1); --dbits; mask <<= 1)
- if (dbits < wps->wphdr.bits && getbit (&wps->wvbits))
- value |= mask;
- }
- else
- for (value = 1L << (dbits - 1); --dbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- value |= mask;
-
- return getbit (&wps->wvbits) ? -(int32_t)value : value;
-}
-
-static int32_t FASTCALL get_word3 (WavpackStream3 *wps, int chan)
-{
- int cbits, delta_dbits, dbits;
- int32_t value;
-
- for (cbits = 0; cbits < 72 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 72)
- return WORD_EOF;
-
- if (cbits || getbit (&wps->wvbits))
- ++cbits;
-
- if (!((cbits + 1) % 3))
- delta_dbits = (cbits + 1) / 3;
- else
- delta_dbits = -(cbits - cbits / 3);
-
- if (chan) {
- dbits = (wps->w3.ave_dbits [1] >> 8) + 1 + delta_dbits;
- wps->w3.ave_dbits [1] -= (wps->w3.ave_dbits [1] + 0x10) >> 5;
- wps->w3.ave_dbits [1] += dbits << 3;
- }
- else {
- dbits = (wps->w3.ave_dbits [0] >> 8) + 1 + delta_dbits;
- wps->w3.ave_dbits [0] -= (wps->w3.ave_dbits [0] + 0x10) >> 5;
- wps->w3.ave_dbits [0] += dbits << 3;
- }
-
- if (dbits < 0 || dbits > 24)
- return WORD_EOF;
-
- if (!dbits)
- return 0L;
-
- if (wps->wphdr.bits && dbits > wps->wphdr.bits) {
- getbits (&value, wps->wphdr.bits, &wps->wvbits);
-
- if (value & bitset [wps->wphdr.bits - 1])
- return -(int32_t)(value & bitmask [wps->wphdr.bits]) << (dbits - wps->wphdr.bits);
- else
- return ((value & bitmask [wps->wphdr.bits - 1]) | bitset [wps->wphdr.bits - 1]) << (dbits - wps->wphdr.bits);
- }
- else {
- getbits (&value, dbits, &wps->wvbits);
-
- if (value & bitset [dbits - 1])
- return -(int32_t)(value & bitmask [dbits]);
- else
- return (value & bitmask [dbits - 1]) | bitset [dbits - 1];
- }
-}
-
-static int FASTCALL _log2 (uint32_t avalue);
-
-static int32_t FASTCALL get_word4 (WavpackStream3 *wps, int chan, int32_t *correction)
-{
- uint32_t base, ones_count, avalue;
- int32_t value, low, mid, high;
- int bitcount;
-
- // count consecutive ones in bitstream, > 25 indicates error (or EOF)
-
- for (ones_count = 0; ones_count < 25 && getbit (&wps->wvbits); ++ones_count);
-
- if (ones_count == 25)
- return WORD_EOF;
-
- // if the ones count is exactly 24, then we switch to non-unary method
-
- if (ones_count == 24) {
- int32_t mask;
- int cbits;
-
- for (cbits = 0; cbits < 33 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 33)
- return WORD_EOF;
-
- if (cbits < 2)
- ones_count = cbits;
- else {
- for (mask = 1, ones_count = 0; --cbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- ones_count |= mask;
-
- ones_count |= mask;
- }
-
- ones_count += 24;
- }
-
- if (!chan) {
- int slow_log_0, slow_log_1, balance;
-
- if (wps->wphdr.flags & MONO_FLAG) {
- wps->w4.bits_acc [0] += wps->w4.bitrate + _log2 (wps->w4.fast_level [0]) - _log2 (wps->w4.slow_level [0]) + (3 << 8);
-
- if (wps->w4.bits_acc [0] < 0)
- wps->w4.bits_acc [0] = 0;
- }
- else {
- slow_log_0 = _log2 (wps->w4.slow_level [0]);
- slow_log_1 = _log2 (wps->w4.slow_level [1]);
-
- if (wps->wphdr.flags & JOINT_STEREO)
- balance = (slow_log_1 - slow_log_0 + 257) >> 1;
- else
- balance = (slow_log_1 - slow_log_0 + 1) >> 1;
-
- wps->w4.bits_acc [0] += wps->w4.bitrate - balance + _log2 (wps->w4.fast_level [0]) - slow_log_0 + (3 << 8);
- wps->w4.bits_acc [1] += wps->w4.bitrate + balance + _log2 (wps->w4.fast_level [1]) - slow_log_1 + (3 << 8);
-
- if (wps->w4.bits_acc [0] + wps->w4.bits_acc [1] < 0)
- wps->w4.bits_acc [0] = wps->w4.bits_acc [1] = 0;
- else if (wps->w4.bits_acc [0] < 0) {
- wps->w4.bits_acc [1] += wps->w4.bits_acc [0];
- wps->w4.bits_acc [0] = 0;
- }
- else if (wps->w4.bits_acc [1] < 0) {
- wps->w4.bits_acc [0] += wps->w4.bits_acc [1];
- wps->w4.bits_acc [1] = 0;
- }
- }
- }
-
- base = (wps->w4.fast_level [chan] + 48) / 96;
- bitcount = wps->w4.bits_acc [chan] >> 8;
- wps->w4.bits_acc [chan] &= 0xff;
-
- if (!base) {
- if (ones_count)
- high = low = mid = (getbit (&wps->wvbits)) ? -(int32_t)ones_count : ones_count;
- else
- high = low = mid = 0;
- }
- else {
- mid = (ones_count * 2 + 1) * base;
- if (getbit (&wps->wvbits)) mid = -mid;
- low = mid - base;
- high = mid + base - 1;
-
- while (bitcount--) {
- if (getbit (&wps->wvbits))
- mid = (high + (low = mid) + 1) >> 1;
- else
- mid = ((high = mid - 1) + low + 1) >> 1;
-
- if (high == low)
- break;
- }
- }
-
- wps->w4.fast_level [chan] -= ((wps->w4.fast_level [chan] + 0x10) >> 5);
- wps->w4.fast_level [chan] += (avalue = labs (mid));
- wps->w4.slow_level [chan] -= ((wps->w4.slow_level [chan] + 0x80) >> 8);
- wps->w4.slow_level [chan] += avalue;
-
- if (bs_is_open (&wps->wvcbits)) {
-
- if (high != low) {
- uint32_t maxcode = high - low;
- int bitcount = count_bits (maxcode);
- uint32_t extras = (1L << bitcount) - maxcode - 1;
-
- getbits (&avalue, bitcount - 1, &wps->wvcbits);
- avalue &= bitmask [bitcount - 1];
-
- if (avalue >= extras) {
- avalue = (avalue << 1) - extras;
-
- if (getbit (&wps->wvcbits))
- ++avalue;
- }
-
- value = (mid < 0) ? high - avalue : avalue + low;
-
- if (correction)
- *correction = value - mid;
- }
- else if (correction)
- *correction = 0;
- }
-
- return mid;
-}
-
-// This function calculates an approximate base-2 logarithm (with 8 bits of
-// fraction) from the supplied value. Using logarithms makes comparing
-// signal level values and calculating fractional bitrates much easier.
-
-static int FASTCALL _log2 (uint32_t avalue)
-{
- int dbits;
-
- if ((avalue += avalue >> 9) < (1 << 8)) {
- dbits = nbits_table [avalue];
- return (dbits << 8) + ((avalue << (9 - dbits)) & 0xff);
- }
- else {
- if (avalue < (1L << 16))
- dbits = nbits_table [avalue >> 8] + 8;
- else if (avalue < (1L << 24))
- dbits = nbits_table [avalue >> 16] + 16;
- else
- dbits = nbits_table [avalue >> 24] + 24;
-
- return (dbits << 8) + ((avalue >> (dbits - 9)) & 0xff);
- }
-}
-
-#endif
diff --git a/lib/win32/libwavpack/unpack3.h b/lib/win32/libwavpack/unpack3.h
deleted file mode 100644
index d958141b41..0000000000
--- a/lib/win32/libwavpack/unpack3.h
+++ /dev/null
@@ -1,113 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// wavpack3.h
-
-// This header file contains all the additional definitions required for
-// decoding old (versions 1, 2 & 3) WavPack files.
-
-typedef struct {
- ushort FormatTag, NumChannels;
- uint32_t SampleRate, BytesPerSecond;
- ushort BlockAlign, BitsPerSample;
-} WaveHeader3;
-
-#define WaveHeader3Format "SSLLSS"
-
-typedef struct {
- char ckID [4];
- int32_t ckSize;
- short version;
- short bits; // added for version 2.00
- short flags, shift; // added for version 3.00
- int32_t total_samples, crc, crc2;
- char extension [4], extra_bc, extras [3];
-} WavpackHeader3;
-
-#define WavpackHeader3Format "4LSSSSLLL4L"
-
-// these flags added for version 3
-
-#undef MONO_FLAG // these definitions changed for WavPack 4.0
-#undef CROSS_DECORR
-#undef JOINT_STEREO
-
-#define MONO_FLAG 1 // not stereo
-#define FAST_FLAG 2 // non-adaptive predictor and stereo mode
-#define RAW_FLAG 4 // raw mode (no .wav header)
-#define CALC_NOISE 8 // calc noise in lossy mode (no longer stored)
-#define HIGH_FLAG 0x10 // high quality mode (all modes)
-#define BYTES_3 0x20 // files have 3-byte samples
-#define OVER_20 0x40 // samples are over 20 bits
-#define WVC_FLAG 0x80 // create/use .wvc (no longer stored)
-#define LOSSY_SHAPE 0x100 // noise shape (lossy mode only)
-#define VERY_FAST_FLAG 0x200 // double fast (no longer stored)
-#define NEW_HIGH_FLAG 0x400 // new high quality mode (lossless only)
-#define CANCEL_EXTREME 0x800 // cancel EXTREME_DECORR
-#define CROSS_DECORR 0x1000 // decorrelate chans (with EXTREME_DECORR flag)
-#define NEW_DECORR_FLAG 0x2000 // new high-mode decorrelator
-#define JOINT_STEREO 0x4000 // joint stereo (lossy and high lossless)
-#define EXTREME_DECORR 0x8000 // extra decorrelation (+ enables other flags)
-
-#define STORED_FLAGS 0xfd77 // these are only flags that affect unpacking
-#define NOT_STORED_FLAGS (~STORED_FLAGS & 0xffff)
-
-// BitStream stuff (bits.c)
-
-typedef struct bs3 {
- void (*wrap)(struct bs3 *bs);
- uchar *buf, *end, *ptr;
- uint32_t bufsiz, fpos, sr;
- stream_reader *reader;
- int error, bc;
- void *id;
-} Bitstream3;
-
-#define K_DEPTH 3
-#define MAX_NTERMS3 18
-
-typedef struct {
- WavpackHeader3 wphdr;
- Bitstream3 wvbits, wvcbits;
- uint32_t sample_index;
- int num_terms;
-
-#ifdef SEEKING
- struct index_point {
- char saved;
- uint32_t sample_index;
- } index_points [256];
-
- uchar *unpack_data;
- uint32_t unpack_size;
-#endif
-
- struct {
- int32_t sum_level, left_level, right_level, diff_level;
- int last_extra_bits, extra_bits_count, m;
- int32_t error [2], crc;
- int32_t sample [2] [2];
- int weight [2] [1];
- } dc;
-
- struct decorr_pass decorr_passes [MAX_NTERMS3];
-
- struct {
- uint index [2], k_value [2], ave_k [2];
- uint32_t zeros_acc, ave_level [K_DEPTH] [2];
- } w1;
-
- struct { int last_dbits [2], last_delta_sign [2], bit_limit; } w2;
-
- struct { int ave_dbits [2], bit_limit; } w3;
-
- struct {
- uint32_t fast_level [2], slow_level [2];
- int bits_acc [2], bitrate;
- } w4;
-} WavpackStream3;
diff --git a/lib/win32/libwavpack/utils.c b/lib/win32/libwavpack/utils.c
deleted file mode 100644
index 36d25e6128..0000000000
--- a/lib/win32/libwavpack/utils.c
+++ /dev/null
@@ -1,640 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// utils.c
-
-// This module provides general purpose utilities for the WavPack command-line
-// utilities and the self-extraction module.
-
-#if defined(WIN32)
-#include <windows.h>
-#include <io.h>
-#include <conio.h>
-#elif defined(__GNUC__)
-#include <glob.h>
-#endif
-
-#ifndef WIN32
-#include <locale.h>
-#include <iconv.h>
-#endif
-
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "wavpack.h"
-
-
-#ifdef WIN32
-
-int copy_timestamp (const char *src_filename, const char *dst_filename)
-{
- FILETIME last_modified;
- HANDLE src, dst;
- int res = TRUE;
-
- if (*src_filename == '-' || *dst_filename == '-')
- return res;
-
- src = CreateFile (src_filename, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
-
- dst = CreateFile (dst_filename, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
- OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
-
- if (src == INVALID_HANDLE_VALUE || dst == INVALID_HANDLE_VALUE ||
- !GetFileTime (src, NULL, NULL, &last_modified) ||
- !SetFileTime (dst, NULL, NULL, &last_modified))
- res = FALSE;
-
- if (src != INVALID_HANDLE_VALUE)
- CloseHandle (src);
-
- if (dst != INVALID_HANDLE_VALUE)
- CloseHandle (dst);
-
- return res;
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// This function parses a filename (with or without full path) and returns //
-// a pointer to the extension (including the "."). If no extension is found //
-// then NULL is returned. Extensions with more than 3 letters don't count. //
-//////////////////////////////////////////////////////////////////////////////
-
-#if defined(WIN32)
-
-static int is_second_byte (char *filespec, char *pos);
-
-char *filespec_ext (char *filespec)
-{
- char *cp = filespec + strlen (filespec);
- LANGID langid = GetSystemDefaultLangID ();
-
- while (--cp >= filespec) {
-
- if (langid == 0x411 && is_second_byte (filespec, cp))
- --cp;
-
- if (*cp == '\\' || *cp == ':')
- return NULL;
-
- if (*cp == '.') {
- if (strlen (cp) > 1 && strlen (cp) <= 4)
- return cp;
- else
- return NULL;
- }
- }
-
- return NULL;
-}
-
-#else
-
-char *filespec_ext (char *filespec)
-{
- char *cp = filespec + strlen (filespec);
-
- while (--cp >= filespec) {
-
- if (*cp == '\\' || *cp == ':')
- return NULL;
-
- if (*cp == '.') {
- if (strlen (cp) > 1 && strlen (cp) <= 4)
- return cp;
- else
- return NULL;
- }
- }
-
- return NULL;
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// This function determines if the specified filespec is a valid pathname. //
-// If not, NULL is returned. If it is in the format of a pathname, then the //
-// original pointer is returned. If the format is ambiguous, then a lookup //
-// is performed to determine if it is in fact a valid path, and if so a "\" //
-// is appended so that the pathname can be used and the original pointer is //
-// returned. //
-//////////////////////////////////////////////////////////////////////////////
-
-#if defined(__GNUC__) && !defined(WIN32)
-
-char *filespec_path (char *filespec)
-{
- char *cp = filespec + strlen (filespec);
- glob_t globs;
- struct stat fstats;
-
- if (cp == filespec || filespec_wild (filespec))
- return NULL;
-
- if (*--cp == '\\' || *cp == ':')
- return filespec;
-
- if (*cp == '.' && cp == filespec)
- return strcat (filespec, "\\");
-
- if (glob (filespec, GLOB_MARK|GLOB_NOSORT, NULL, &globs) == 0 &&
- globs.gl_pathc > 0)
- {
- /* test if the file is a directory */
- if (stat(globs.gl_pathv[0], &fstats) == 0 && (fstats.st_mode & S_IFDIR)) {
- globfree(&globs);
- filespec[0] = '\0';
- return strcat (filespec, globs.gl_pathv[0]);
- }
- }
- globfree(&globs);
-
- return NULL;
-}
-
-#else
-
-char *filespec_path (char *filespec)
-{
- char *cp = filespec + strlen (filespec);
- LANGID langid = GetSystemDefaultLangID ();
- struct _finddata_t finddata;
- int32_t file;
-
- if (cp == filespec || filespec_wild (filespec))
- return NULL;
-
- --cp;
-
- if (langid == 0x411 && is_second_byte (filespec, cp))
- --cp;
-
- if (*cp == '\\' || *cp == ':')
- return filespec;
-
- if (*cp == '.' && cp == filespec)
- return strcat (filespec, "\\");
-
- if ((file = _findfirst (filespec, &finddata)) != -1L &&
- (finddata.attrib & _A_SUBDIR)) {
- _findclose (file);
- return strcat (filespec, "\\");
- }
- if (file != -1L)
- _findclose(file);
-
- return NULL;
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// This function returns non-NULL if the specified filename spec has any //
-// wildcard characters. //
-//////////////////////////////////////////////////////////////////////////////
-
-char *filespec_wild (char *filespec)
-{
- return strpbrk (filespec, "*?");
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// This function parses a filename (with or without full path) and returns //
-// a pointer to the actual filename, or NULL if no filename can be found. //
-//////////////////////////////////////////////////////////////////////////////
-
-#if defined(WIN32)
-
-char *filespec_name (char *filespec)
-{
- char *cp = filespec + strlen (filespec);
- LANGID langid = GetSystemDefaultLangID ();
-
- while (--cp >= filespec) {
- if (langid == 0x411 && is_second_byte (filespec, cp))
- --cp;
-
- if (*cp == '\\' || *cp == ':')
- break;
- }
-
- if (strlen (cp + 1))
- return cp + 1;
- else
- return NULL;
-}
-
-#else
-
-char *filespec_name (char *filespec)
-{
- char *cp = filespec + strlen (filespec);
-
- while (--cp >= filespec)
- if (*cp == '\\' || *cp == ':')
- break;
-
- if (strlen (cp + 1))
- return cp + 1;
- else
- return NULL;
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// This function returns TRUE if "pos" is pointing to the second byte of a //
-// double-byte character in the string "filespec" which is assumed to be //
-// shift-JIS. //
-//////////////////////////////////////////////////////////////////////////////
-
-#if defined(WIN32)
-
-static int is_second_byte (char *filespec, char *pos)
-{
- uchar *cp = pos;
-
- while (cp > filespec && ((cp [-1] >= 0x81 && cp [-1] <= 0x9f) ||
- (cp [-1] >= 0xe0 && cp [-1] <= 0xfc)))
- cp--;
-
- return ((int) pos - (int) cp) & 1;
-}
-
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// This function allows the user to type 'y', 'n', or 'a' (with Enter) in //
-// response to a system query. The return value is the key typed as //
-// lowercase (regardless of the typed case). //
-//////////////////////////////////////////////////////////////////////////////
-
-static int waiting_input;
-
-char yna (void)
-{
- char choice = 0;
- int key;
-
- waiting_input = 1;
-
- while (1) {
-#if defined(WIN32)
- key = getch ();
-#else
- key = fgetc(stdin);
-#endif
- if (key == 3) {
- fprintf (stderr, "^C\n");
- exit (1);
- }
- else if (key == '\r' || key == '\n') {
- if (choice) {
- fprintf (stderr, "\r\n");
- break;
- }
- else
- fprintf (stderr, "%c", 7);
- }
- else if (key == 'Y' || key == 'y') {
- fprintf (stderr, "%c\b", key);
- choice = 'y';
- }
- else if (key == 'N' || key == 'n') {
- fprintf (stderr, "%c\b", key);
- choice = 'n';
- }
- else if (key == 'A' || key == 'a') {
- fprintf (stderr, "%c\b", key);
- choice = 'a';
- }
- else
- fprintf (stderr, "%c", 7);
- }
-
- waiting_input = 0;
-
- return choice;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Display the specified message on the console through stderr. Note that //
-// the cursor may start anywhere in the line and all text already on the //
-// line is erased. A terminating newline is not needed and function works //
-// with printf strings and args. //
-//////////////////////////////////////////////////////////////////////////////
-
-void error_line (char *error, ...)
-{
- char error_msg [512];
- va_list argptr;
-
- error_msg [0] = '\r';
- va_start (argptr, error);
- vsprintf (error_msg + 1, error, argptr);
- va_end (argptr);
- fputs (error_msg, stderr);
- finish_line ();
-#if 0
- {
- FILE *error_log = fopen ("c:\\wavpack.log", "a+");
-
- if (error_log) {
- fputs (error_msg + 1, error_log);
- fputc ('\n', error_log);
- fclose (error_log);
- }
- }
-#endif
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Function to intercept ^C or ^Break typed at the console. //
-//////////////////////////////////////////////////////////////////////////////
-#if defined(WIN32)
-static int break_flag;
-
-BOOL WINAPI ctrl_handler (DWORD ctrl)
-{
- if (ctrl == CTRL_C_EVENT) {
- break_flag = TRUE;
- return TRUE;
- }
-
- if (ctrl == CTRL_BREAK_EVENT) {
-
- if (waiting_input) {
-#ifdef __BORLANDC__
- fprintf (stderr, "^C\n");
-#endif
- return FALSE;
- }
- else {
- break_flag = TRUE;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Function to initialize console for intercepting ^C and ^Break. //
-//////////////////////////////////////////////////////////////////////////////
-
-void setup_break (void)
-{
- HANDLE hConIn = GetStdHandle (STD_INPUT_HANDLE);
-
- SetConsoleMode (hConIn, ENABLE_PROCESSED_INPUT);
- FlushConsoleInputBuffer (hConIn);
- SetConsoleCtrlHandler (ctrl_handler, TRUE);
- break_flag = 0;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Function to determine whether ^C or ^Break has been issued by user. //
-//////////////////////////////////////////////////////////////////////////////
-
-int check_break (void)
-{
- return break_flag;
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Function to clear the stderr console to the end of the current line (and //
-// go to the beginning next line). //
-//////////////////////////////////////////////////////////////////////////////
-
-void finish_line (void)
-{
- HANDLE hConIn = GetStdHandle (STD_ERROR_HANDLE);
- CONSOLE_SCREEN_BUFFER_INFO coninfo;
-
- if (hConIn && GetConsoleScreenBufferInfo (hConIn, &coninfo)) {
- char spaces = coninfo.dwSize.X - coninfo.dwCursorPosition.X;
-
- while (spaces--)
- fputc (' ', stderr);
- }
- else
- fputc ('\n', stderr);
-}
-#else
-//////////////////////////////////////////////////////////////////////////////
-// Function to clear the stderr console to the end of the current line (and //
-// go to the beginning next line). //
-//////////////////////////////////////////////////////////////////////////////
-
-void finish_line (void)
-{
-/* char spaces = 1;
-
- while (spaces--)
- putc (' ', stderr);
- else*/
- fputc ('\n', stderr);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Function to initialize console for intercepting ^C and ^Break. //
-//////////////////////////////////////////////////////////////////////////////
-
-void setup_break (void)
-{
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Function to determine whether ^C or ^Break has been issued by user. //
-//////////////////////////////////////////////////////////////////////////////
-
-int check_break (void)
-{
- return 0;
-}
-
-#endif
-
-//////////////////////////// File I/O Wrapper ////////////////////////////////
-
-int DoReadFile (FILE *hFile, void *lpBuffer, uint32_t nNumberOfBytesToRead, uint32_t *lpNumberOfBytesRead)
-{
- uint32_t bcount;
-
- *lpNumberOfBytesRead = 0;
-
- while (nNumberOfBytesToRead) {
- bcount = fread ((uchar *) lpBuffer + *lpNumberOfBytesRead, 1, nNumberOfBytesToRead, hFile);
-
- if (bcount) {
- *lpNumberOfBytesRead += bcount;
- nNumberOfBytesToRead -= bcount;
- }
- else
- break;
- }
-
- return !ferror (hFile);
-}
-
-int DoWriteFile (FILE *hFile, void *lpBuffer, uint32_t nNumberOfBytesToWrite, uint32_t *lpNumberOfBytesWritten)
-{
- uint32_t bcount;
-
- *lpNumberOfBytesWritten = 0;
-
- while (nNumberOfBytesToWrite) {
- bcount = fwrite ((uchar *) lpBuffer + *lpNumberOfBytesWritten, 1, nNumberOfBytesToWrite, hFile);
-
- if (bcount) {
- *lpNumberOfBytesWritten += bcount;
- nNumberOfBytesToWrite -= bcount;
- }
- else
- break;
- }
-
- return !ferror (hFile);
-}
-
-uint32_t DoGetFileSize (FILE *hFile)
-{
- struct stat statbuf;
-
- if (!hFile || fstat (fileno (hFile), &statbuf) || !(statbuf.st_mode & S_IFREG))
- return 0;
-
- return statbuf.st_size;
-}
-
-uint32_t DoGetFilePosition (FILE *hFile)
-{
- return ftell (hFile);
-}
-
-int DoSetFilePositionAbsolute (FILE *hFile, uint32_t pos)
-{
- return fseek (hFile, pos, SEEK_SET);
-}
-
-int DoSetFilePositionRelative (FILE *hFile, int32_t pos, int mode)
-{
- return fseek (hFile, pos, mode);
-}
-
-// if ungetc() is not available, a seek of -1 is fine also because we do not
-// change the byte read.
-
-int DoUngetc (int c, FILE *hFile)
-{
- return ungetc (c, hFile);
-}
-
-int DoCloseHandle (FILE *hFile)
-{
- return hFile ? !fclose (hFile) : 0;
-}
-
-int DoTruncateFile (FILE *hFile)
-{
- if (hFile) {
- fflush (hFile);
-#if defined(WIN32)
- return !chsize (fileno (hFile), 0);
-#else
- return !ftruncate(fileno (hFile), 0);
-#endif
- }
-
- return 0;
-}
-
-int DoDeleteFile (char *filename)
-{
- return !remove (filename);
-}
-
-// Convert the Unicode wide-format string into a UTF-8 string using no more
-// than the specified buffer length. The wide-format string must be NULL
-// terminated and the resulting string will be NULL terminated. The actual
-// number of characters converted (not counting terminator) is returned, which
-// may be less than the number of characters in the wide string if the buffer
-// length is exceeded.
-
-static int WideCharToUTF8 (const ushort *Wide, uchar *pUTF8, int len)
-{
- const ushort *pWide = Wide;
- int outndx = 0;
-
- while (*pWide) {
- if (*pWide < 0x80 && outndx + 1 < len)
- pUTF8 [outndx++] = (uchar) *pWide++;
- else if (*pWide < 0x800 && outndx + 2 < len) {
- pUTF8 [outndx++] = (uchar) (0xc0 | ((*pWide >> 6) & 0x1f));
- pUTF8 [outndx++] = (uchar) (0x80 | (*pWide++ & 0x3f));
- }
- else if (outndx + 3 < len) {
- pUTF8 [outndx++] = (uchar) (0xe0 | ((*pWide >> 12) & 0xf));
- pUTF8 [outndx++] = (uchar) (0x80 | ((*pWide >> 6) & 0x3f));
- pUTF8 [outndx++] = (uchar) (0x80 | (*pWide++ & 0x3f));
- }
- else
- break;
- }
-
- pUTF8 [outndx] = 0;
- return pWide - Wide;
-}
-
-// Convert a Ansi string into its Unicode UTF-8 format equivalent. The
-// conversion is done in-place so the maximum length of the string buffer must
-// be specified because the string may become longer or shorter. If the
-// resulting string will not fit in the specified buffer size then it is
-// truncated.
-
-void AnsiToUTF8 (char *string, int len)
-{
- int max_chars = strlen (string);
-#if defined(WIN32)
- ushort *temp = (ushort *) malloc ((max_chars + 1) * 2);
-
- MultiByteToWideChar (CP_ACP, 0, string, -1, temp, max_chars + 1);
- WideCharToUTF8 (temp, (uchar *) string, len);
-#else
- char *temp = malloc (len);
-// memset(temp, 0, len);
- char *outp = temp;
- const char *inp = string;
- size_t insize = max_chars;
- size_t outsize = len - 1;
- int err = 0;
- char *old_locale;
-
- memset(temp, 0, len);
- old_locale = setlocale (LC_CTYPE, "");
- iconv_t converter = iconv_open ("UTF-8", "");
- err = iconv (converter, &inp, &insize, &outp, &outsize);
- iconv_close (converter);
- setlocale (LC_CTYPE, old_locale);
-
- if (err == -1) {
- free(temp);
- return;
- }
-
- memmove (string, temp, len);
-#endif
- free (temp);
-}
diff --git a/lib/win32/libwavpack/wavpack.h b/lib/win32/libwavpack/wavpack.h
deleted file mode 100644
index dad8ab216b..0000000000
--- a/lib/win32/libwavpack/wavpack.h
+++ /dev/null
@@ -1,658 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// wavpack.h
-
-#ifndef WAVPACK_H
-#define WAVPACK_H
-
-#if defined(WIN32)
-#define FASTCALL __fastcall
-#else
-#define FASTCALL
-#define SetConsoleTitle(x)
-#endif
-
-#if defined(WIN32)
-#ifdef WAVPACKDLL_EXPORTS
-#define WAVPACKAPI __declspec(dllexport)
-#else
-#define WAVPACKAPI
-#endif
-#else
-#define WAVPACKAPI
-#endif
-
-#include <sys/types.h>
-
-// This header file contains all the definitions required by WavPack.
-
-#if defined(_WIN32) && !defined(__MINGW32__)
-#include <stdlib.h>
-#include <stdint.h>
-#else
-#include <inttypes.h>
-#endif
-
-typedef unsigned char uchar;
-
-#if !defined(__GNUC__) || defined(WIN32)
-typedef unsigned short ushort;
-typedef unsigned int uint;
-#endif
-
-#ifndef PATH_MAX
-#ifdef MAX_PATH
-#define PATH_MAX MAX_PATH
-#elif defined (MAXPATHLEN)
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
-// This structure is used to access the individual fields of 32-bit ieee
-// floating point numbers. This will not be compatible with compilers that
-// allocate bit fields from the most significant bits, although I'm not sure
-// how common that is.
-
-typedef struct {
- unsigned mantissa : 23;
- unsigned exponent : 8;
- unsigned sign : 1;
-} f32;
-
-#include <stdio.h>
-
-#define FALSE 0
-#define TRUE 1
-
-#if defined(WIN32)
-#undef VERSION_OS
-#define VERSION_OS "Win32"
-#endif
-#define VERSION_STR "4.2 "
-#define DATE_STR "2005-04-02"
-
-// ID3v1 and APEv2 TAG formats (may occur at the end of WavPack files)
-
-typedef struct {
- uchar tag_id [3], title [30], artist [30], album [30];
- uchar year [4], comment [30], genre;
-} ID3_Tag;
-
-typedef struct {
- char ID [8];
- int32_t version, length, item_count, flags;
- char res [8];
-} APE_Tag_Hdr;
-
-#define APE_Tag_Hdr_Format "8LLLL"
-
-typedef struct {
- ID3_Tag id3_tag;
- APE_Tag_Hdr ape_tag_hdr;
- char *ape_tag_data;
-} M_Tag;
-
-// RIFF / wav header formats (these occur at the beginning of both wav files
-// and pre-4.0 WavPack files that are not in the "raw" mode)
-
-typedef struct {
- char ckID [4];
- uint32_t ckSize;
- char formType [4];
-} RiffChunkHeader;
-
-typedef struct {
- char ckID [4];
- uint32_t ckSize;
-} ChunkHeader;
-
-#define ChunkHeaderFormat "4L"
-
-typedef struct {
- ushort FormatTag, NumChannels;
- uint32_t SampleRate, BytesPerSecond;
- ushort BlockAlign, BitsPerSample;
- ushort cbSize, ValidBitsPerSample;
- int32_t ChannelMask;
- ushort SubFormat;
- char GUID [14];
-} WaveHeader;
-
-#define WaveHeaderFormat "SSLLSSSSLS"
-
-////////////////////////////// WavPack Header /////////////////////////////////
-
-// Note that this is the ONLY structure that is written to (or read from)
-// WavPack 4.0 files, and is the preamble to every block in both the .wv
-// and .wvc files.
-
-typedef struct {
- char ckID [4];
- uint32_t ckSize;
- short version;
- uchar track_no, index_no;
- uint32_t total_samples, block_index, block_samples, flags, crc;
-} WavpackHeader;
-
-#define WavpackHeaderFormat "4LS2LLLLL"
-
-// or-values for "flags"
-
-#define BYTES_STORED 3 // 1-4 bytes/sample
-#define MONO_FLAG 4 // not stereo
-#define HYBRID_FLAG 8 // hybrid mode
-#define JOINT_STEREO 0x10 // joint stereo
-#define CROSS_DECORR 0x20 // no-delay cross decorrelation
-#define HYBRID_SHAPE 0x40 // noise shape (hybrid mode only)
-#define FLOAT_DATA 0x80 // ieee 32-bit floating point data
-
-#define INT32_DATA 0x100 // special extended int handling
-#define HYBRID_BITRATE 0x200 // bitrate noise (hybrid mode only)
-#define HYBRID_BALANCE 0x400 // balance noise (hybrid stereo mode only)
-
-#define INITIAL_BLOCK 0x800 // initial block of multichannel segment
-#define FINAL_BLOCK 0x1000 // final block of multichannel segment
-
-#define SHIFT_LSB 13
-#define SHIFT_MASK (0x1fL << SHIFT_LSB)
-
-#define MAG_LSB 18
-#define MAG_MASK (0x1fL << MAG_LSB)
-
-#define SRATE_LSB 23
-#define SRATE_MASK (0xfL << SRATE_LSB)
-
-#define IGNORED_FLAGS 0x18000000 // reserved, but ignore if encountered
-#define NEW_SHAPING 0x20000000 // use IIR filter for negative shaping
-#define UNKNOWN_FLAGS 0xC0000000 // also reserved, but refuse decode if
- // encountered
-
-//////////////////////////// WavPack Metadata /////////////////////////////////
-
-// This is an internal representation of metadata.
-
-typedef struct {
- int32_t byte_length;
- void *data;
- uchar id;
-} WavpackMetadata;
-
-#define ID_OPTIONAL_DATA 0x20
-#define ID_ODD_SIZE 0x40
-#define ID_LARGE 0x80
-
-#define ID_DUMMY 0x0
-#define ID_ENCODER_INFO 0x1
-#define ID_DECORR_TERMS 0x2
-#define ID_DECORR_WEIGHTS 0x3
-#define ID_DECORR_SAMPLES 0x4
-#define ID_ENTROPY_VARS 0x5
-#define ID_HYBRID_PROFILE 0x6
-#define ID_SHAPING_WEIGHTS 0x7
-#define ID_FLOAT_INFO 0x8
-#define ID_INT32_INFO 0x9
-#define ID_WV_BITSTREAM 0xa
-#define ID_WVC_BITSTREAM 0xb
-#define ID_WVX_BITSTREAM 0xc
-#define ID_CHANNEL_INFO 0xd
-
-#define ID_RIFF_HEADER (ID_OPTIONAL_DATA | 0x1)
-#define ID_RIFF_TRAILER (ID_OPTIONAL_DATA | 0x2)
-#define ID_REPLAY_GAIN (ID_OPTIONAL_DATA | 0x3)
-#define ID_CUESHEET (ID_OPTIONAL_DATA | 0x4)
-#define ID_CONFIG_BLOCK (ID_OPTIONAL_DATA | 0x5)
-#define ID_MD5_CHECKSUM (ID_OPTIONAL_DATA | 0x6)
-
-///////////////////////// WavPack Configuration ///////////////////////////////
-
-// This internal structure is used during encode to provide configuration to
-// the encoding engine and during decoding to provide fle information back to
-// the higher level functions. Not all fields are used in both modes.
-
-typedef struct {
- float bitrate, shaping_weight;
- int bits_per_sample, bytes_per_sample;
- int qmode, flags, xmode, num_channels, float_norm_exp;
- int32_t block_samples, extra_flags, sample_rate, channel_mask;
- uchar md5_checksum [16], md5_read;
- int num_tag_strings;
- char **tag_strings;
-} WavpackConfig;
-
-#define CONFIG_BYTES_STORED 3 // 1-4 bytes/sample
-#define CONFIG_MONO_FLAG 4 // not stereo
-#define CONFIG_HYBRID_FLAG 8 // hybrid mode
-#define CONFIG_JOINT_STEREO 0x10 // joint stereo
-#define CONFIG_CROSS_DECORR 0x20 // no-delay cross decorrelation
-#define CONFIG_HYBRID_SHAPE 0x40 // noise shape (hybrid mode only)
-#define CONFIG_FLOAT_DATA 0x80 // ieee 32-bit floating point data
-
-#define CONFIG_ADOBE_MODE 0x100 // "adobe" mode for 32-bit floats
-#define CONFIG_FAST_FLAG 0x200 // fast mode
-#define CONFIG_VERY_FAST_FLAG 0x400 // double fast
-#define CONFIG_HIGH_FLAG 0x800 // high quality mode
-#define CONFIG_VERY_HIGH_FLAG 0x1000 // double high (not used yet)
-#define CONFIG_BITRATE_KBPS 0x2000 // bitrate is kbps, not bits / sample
-#define CONFIG_AUTO_SHAPING 0x4000 // automatic noise shaping
-#define CONFIG_SHAPE_OVERRIDE 0x8000 // shaping mode specified
-#define CONFIG_JOINT_OVERRIDE 0x10000 // joint-stereo mode specified
-#define CONFIG_COPY_TIME 0x20000 // copy file-time from source
-#define CONFIG_CREATE_EXE 0x40000 // create executable
-#define CONFIG_CREATE_WVC 0x80000 // create correction file
-#define CONFIG_OPTIMIZE_WVC 0x100000 // maximize bybrid compression
-#define CONFIG_QUALITY_MODE 0x200000 // psychoacoustic quality mode
-#define CONFIG_RAW_FLAG 0x400000 // raw mode (not implemented yet)
-#define CONFIG_CALC_NOISE 0x800000 // calc noise in hybrid mode
-#define CONFIG_LOSSY_MODE 0x1000000 // obsolete (for information)
-#define CONFIG_EXTRA_MODE 0x2000000 // extra processing mode
-#define CONFIG_SKIP_WVX 0x4000000 // no wvx stream w/ floats & big ints
-#define CONFIG_MD5_CHECKSUM 0x8000000 // compute & store MD5 signature
-#define CONFIG_QUIET_MODE 0x10000000 // don't report progress %
-#define CONFIG_IGNORE_LENGTH 0x20000000 // ignore length in wav header
-
-#define EXTRA_SCAN_ONLY 1
-#define EXTRA_STEREO_MODES 2
-//#define EXTRA_CHECK_TERMS 4
-#define EXTRA_TRY_DELTAS 8
-#define EXTRA_ADJUST_DELTAS 16
-#define EXTRA_SORT_FIRST 32
-#define EXTRA_BRANCHES 0x1c0
-#define EXTRA_SKIP_8TO16 512
-#define EXTRA_TERMS 0x3c00
-#define EXTRA_DUMP_TERMS 16384
-#define EXTRA_SORT_LAST 32768
-
-//////////////////////////////// WavPack Stream ///////////////////////////////
-
-// This internal structure contains everything required to handle a WavPack
-// "stream", which is defined as a stereo or mono stream of audio samples. For
-// multichannel audio several of these would be required. Each stream contains
-// pointers to hold a complete allocated block of WavPack data, although it's
-// possible to decode WavPack blocks without buffering an entire block.
-
-typedef struct bs {
- uchar *buf, *end, *ptr;
- void (*wrap)(struct bs *bs);
- int error, bc;
- uint32_t sr;
-} Bitstream;
-
-#define MAX_STREAMS 8
-#define MAX_NTERMS 16
-#define MAX_TERM 8
-
-struct decorr_pass {
- int term, delta, weight_A, weight_B;
- int32_t samples_A [MAX_TERM], samples_B [MAX_TERM];
- int32_t aweight_A, aweight_B;
-#ifdef PACK
- int32_t sum_A, sum_B, min, max;
-#endif
-};
-
-typedef struct {
- WavpackHeader wphdr;
-
- uchar *blockbuff, *blockend;
- uchar *block2buff, *block2end;
- int32_t *sample_buffer;
-
- uint32_t sample_index, crc, crc_x, crc_wvx;
- Bitstream wvbits, wvcbits, wvxbits;
- int bits, num_terms, mute_error;
- float delta_decay;
-
- uchar int32_sent_bits, int32_zeros, int32_ones, int32_dups;
- uchar float_flags, float_shift, float_max_exp, float_norm_exp;
-
- struct {
- int32_t shaping_acc [2], shaping_delta [2], error [2];
- double noise_sum, noise_ave, noise_max;
- } dc;
-
- struct decorr_pass decorr_passes [MAX_NTERMS];
-
- struct {
- uint32_t bitrate_delta [2], bitrate_acc [2];
- uint32_t median [3] [2], slow_level [2], error_limit [2];
- uint32_t pend_data, holding_one, zeros_acc;
- int holding_zero, pend_count;
- } w;
-} WavpackStream;
-
-// flags for float_flags:
-
-#define FLOAT_SHIFT_ONES 1 // bits left-shifted into float = '1'
-#define FLOAT_SHIFT_SAME 2 // bits left-shifted into float are the same
-#define FLOAT_SHIFT_SENT 4 // bits shifted into float are sent literally
-#define FLOAT_ZEROS_SENT 8 // "zeros" are not all real zeros
-#define FLOAT_NEG_ZEROS 0x10 // contains negative zeros
-#define FLOAT_EXCEPTIONS 0x20 // contains exceptions (inf, nan, etc.)
-
-/////////////////////////////// WavPack Context ///////////////////////////////
-
-// This internal structure holds everything required to encode or decode WavPack
-// files. It is recommended that direct access to this structure be minimized
-// and the provided utilities used instead.
-
-typedef struct {
- int32_t (*read_bytes)(void *id, void *data, int32_t bcount);
- uint32_t (*get_pos)(void *id);
- int (*set_pos_abs)(void *id, uint32_t pos);
- int (*set_pos_rel)(void *id, int32_t delta, int mode);
- int (*push_back_byte)(void *id, int c);
- uint32_t (*get_length)(void *id);
- int (*can_seek)(void *id);
-} stream_reader;
-
-typedef int (*blockout_f)(void *id, void *data, int32_t bcount);
-
-typedef struct {
- WavpackConfig config;
-
- WavpackMetadata *metadata;
- uint32_t metabytes;
- int metacount;
-
- uchar *wrapper_data;
- uint32_t wrapper_bytes;
-
- blockout_f blockout;
- void *wv_out, *wvc_out;
-
- stream_reader *reader;
- void *wv_in, *wvc_in;
-
- uint32_t filelen, file2len, filepos, file2pos, total_samples, crc_errors, first_flags;
- int wvc_flag, open_flags, norm_offset, reduced_channels, lossy_blocks, close_files;
- int block_samples, max_samples, acc_samples;
- M_Tag m_tag;
-
- int current_stream, num_streams;
- WavpackStream *streams [8];
- void *stream3;
-
- char error_message [80];
-} WavpackContext;
-
-//////////////////////// function prototypes and macros //////////////////////
-
-#define CLEAR(destin) memset (&destin, 0, sizeof (destin));
-
-// these macros implement the weight application and update operations
-// that are at the heart of the decorrelation loops
-
-#define apply_weight_i(weight, sample) ((weight * sample + 512) >> 10)
-
-#define apply_weight_f(weight, sample) (((((sample & 0xffff) * weight) >> 9) + \
- (((sample & ~0xffff) >> 9) * weight) + 1) >> 1)
-
-#if 1 // PERFCOND
-#define apply_weight(weight, sample) (sample != (short) sample ? \
- apply_weight_f (weight, sample) : apply_weight_i (weight, sample))
-#else
-#define apply_weight(weight, sample) ((int32_t)((weight * (int64_t) sample + 512) >> 10))
-#endif
-
-#if 1 // PERFCOND
-#define update_weight(weight, delta, source, result) \
- if (source && result) weight -= ((((source ^ result) >> 30) & 2) - 1) * delta;
-#else
-#define update_weight(weight, delta, source, result) \
- if (source && result) (source ^ result) < 0 ? (weight -= delta) : (weight += delta);
-#endif
-
-#define update_weight_d1(weight, delta, source, result) \
- if (source && result) weight -= (((source ^ result) >> 30) & 2) - 1;
-
-#define update_weight_d2(weight, delta, source, result) \
- if (source && result) weight -= (((source ^ result) >> 29) & 4) - 2;
-
-#define update_weight_clip(weight, delta, source, result) \
- if (source && result && ((source ^ result) < 0 ? (weight -= delta) < -1024 : (weight += delta) > 1024)) \
- weight = weight < 0 ? -1024 : 1024;
-
-#define update_weight_clip_d1(weight, delta, source, result) \
- if (source && result && abs (weight -= (((source ^ result) >> 30) & 2) - 1) > 1024) \
- weight = weight < 0 ? -1024 : 1024;
-
-#define update_weight_clip_d2(weight, delta, source, result) \
- if (source && result && abs (weight -= (((source ^ result) >> 29) & 4) - 2) > 1024) \
- weight = weight < 0 ? -1024 : 1024;
-
-// bits.c
-
-void bs_open_read (Bitstream *bs, uchar *buffer_start, uchar *buffer_end);
-void bs_open_write (Bitstream *bs, uchar *buffer_start, uchar *buffer_end);
-uint32_t bs_close_read (Bitstream *bs);
-uint32_t bs_close_write (Bitstream *bs);
-
-int DoReadFile (FILE *hFile, void *lpBuffer, uint32_t nNumberOfBytesToRead, uint32_t *lpNumberOfBytesRead);
-int DoWriteFile (FILE *hFile, void *lpBuffer, uint32_t nNumberOfBytesToWrite, uint32_t *lpNumberOfBytesWritten);
-uint32_t DoGetFileSize (FILE *hFile), DoGetFilePosition (FILE *hFile);
-int DoSetFilePositionRelative (FILE *hFile, int32_t pos, int mode);
-int DoSetFilePositionAbsolute (FILE *hFile, uint32_t pos);
-int DoUngetc (int c, FILE *hFile), DoDeleteFile (char *filename);
-int DoCloseHandle (FILE *hFile), DoTruncateFile (FILE *hFile);
-
-#define bs_is_open(bs) ((bs)->ptr != NULL)
-
-#define getbit(bs) ( \
- (((bs)->bc) ? \
- ((bs)->bc--, (bs)->sr & 1) : \
- (((++((bs)->ptr) != (bs)->end) ? (void) 0 : (bs)->wrap (bs)), (bs)->bc = 7, ((bs)->sr = *((bs)->ptr)) & 1) \
- ) ? \
- ((bs)->sr >>= 1, 1) : \
- ((bs)->sr >>= 1, 0) \
-)
-
-#define getbits(value, nbits, bs) { \
- while ((nbits) > (bs)->bc) { \
- if (++((bs)->ptr) == (bs)->end) (bs)->wrap (bs); \
- (bs)->sr |= (int32_t)*((bs)->ptr) << (bs)->bc; \
- (bs)->bc += 8; \
- } \
- *(value) = (bs)->sr; \
- (bs)->sr >>= (nbits); \
- (bs)->bc -= (nbits); \
-}
-
-#define putbit(bit, bs) { if (bit) (bs)->sr |= (1 << (bs)->bc); \
- if (++((bs)->bc) == 8) { \
- *((bs)->ptr) = (bs)->sr; \
- (bs)->sr = (bs)->bc = 0; \
- if (++((bs)->ptr) == (bs)->end) (bs)->wrap (bs); \
- }}
-
-#define putbit_0(bs) { \
- if (++((bs)->bc) == 8) { \
- *((bs)->ptr) = (bs)->sr; \
- (bs)->sr = (bs)->bc = 0; \
- if (++((bs)->ptr) == (bs)->end) (bs)->wrap (bs); \
- }}
-
-#define putbit_1(bs) { (bs)->sr |= (1 << (bs)->bc); \
- if (++((bs)->bc) == 8) { \
- *((bs)->ptr) = (bs)->sr; \
- (bs)->sr = (bs)->bc = 0; \
- if (++((bs)->ptr) == (bs)->end) (bs)->wrap (bs); \
- }}
-
-#define putbits(value, nbits, bs) { \
- (bs)->sr |= (int32_t)(value) << (bs)->bc; \
- if (((bs)->bc += (nbits)) >= 8) \
- do { \
- *((bs)->ptr) = (bs)->sr; \
- (bs)->sr >>= 8; \
- if (++((bs)->ptr) == (bs)->end) (bs)->wrap (bs); \
- } while (((bs)->bc -= 8) >= 8); \
-}
-
-void little_endian_to_native (void *data, char *format);
-void native_to_little_endian (void *data, char *format);
-
-// pack.c
-
-void pack_init (WavpackContext *wpc);
-int pack_block (WavpackContext *wpc, int32_t *buffer);
-double pack_noise (WavpackContext *wpc, double *peak);
-
-// unpack.c
-
-int unpack_init (WavpackContext *wpc);
-int init_wv_bitstream (WavpackStream *wps, WavpackMetadata *wpmd);
-int init_wvc_bitstream (WavpackStream *wps, WavpackMetadata *wpmd);
-int init_wvx_bitstream (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_decorr_terms (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_decorr_weights (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_decorr_samples (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_shaping_info (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_float_info (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_int32_info (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_channel_info (WavpackContext *wpc, WavpackMetadata *wpmd);
-int read_config_info (WavpackContext *wpc, WavpackMetadata *wpmd);
-int read_wrapper_data (WavpackContext *wpc, WavpackMetadata *wpmd);
-int32_t unpack_samples (WavpackContext *wpc, int32_t *buffer, uint32_t sample_count);
-int check_crc_error (WavpackContext *wpc);
-
-// unpack3.c
-
-WavpackContext *open_file3 (WavpackContext *wpc, char *error);
-int32_t unpack_samples3 (WavpackContext *wpc, int32_t *buffer, uint32_t sample_count);
-int seek_sample3 (WavpackContext *wpc, uint32_t desired_index);
-uint32_t get_sample_index3 (WavpackContext *wpc);
-void free_stream3 (WavpackContext *wpc);
-int get_version3 (WavpackContext *wpc);
-
-// utils.c
-
-int copy_timestamp (const char *src_filename, const char *dst_filename);
-char *filespec_ext (char *filespec), *filespec_path (char *filespec);
-char *filespec_name (char *filespec), *filespec_wild (char *filespec);
-void error_line (char *error, ...), finish_line (void);
-void setup_break (void);
-int check_break (void);
-char yna (void);
-void AnsiToUTF8 (char *string, int len);
-
-#define FN_FIT(fn) ((strlen (fn) > 30) ? filespec_name (fn) : fn)
-
-// metadata.c stuff
-
-int read_metadata_buff (WavpackMetadata *wpmd, uchar *blockbuff, uchar **buffptr);
-int write_metadata_block (WavpackContext *wpc);
-int copy_metadata (WavpackMetadata *wpmd, uchar *buffer_start, uchar *buffer_end);
-int add_to_metadata (WavpackContext *wpc, void *data, uint32_t bcount, uchar id);
-int process_metadata (WavpackContext *wpc, WavpackMetadata *wpmd);
-void free_metadata (WavpackMetadata *wpmd);
-
-// words.c stuff
-
-void init_words (WavpackStream *wps);
-void word_set_bitrate (WavpackStream *wps);
-void write_entropy_vars (WavpackStream *wps, WavpackMetadata *wpmd);
-void write_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_entropy_vars (WavpackStream *wps, WavpackMetadata *wpmd);
-int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd);
-int32_t FASTCALL send_word (WavpackStream *wps, int32_t value, int chan);
-void FASTCALL send_word_lossless (WavpackStream *wps, int32_t value, int chan);
-int32_t FASTCALL get_word (WavpackStream *wps, int chan, int32_t *correction);
-int32_t FASTCALL get_word_lossless (WavpackStream *wps, int chan);
-void flush_word (WavpackStream *wps);
-int32_t nosend_word (WavpackStream *wps, int32_t value, int chan);
-void scan_word (WavpackStream *wps, int32_t *samples, uint32_t num_samples, int dir);
-
-int log2s (int32_t value);
-int32_t exp2s (int log);
-uint32_t log2buffer (int32_t *samples, uint32_t num_samples);
-
-char store_weight (int weight);
-int restore_weight (char weight);
-
-#define WORD_EOF (1L << 31)
-
-// float.c
-
-void write_float_info (WavpackStream *wps, WavpackMetadata *wpmd);
-int scan_float_data (WavpackStream *wps, f32 *values, int32_t num_values);
-void send_float_data (WavpackStream *wps, f32 *values, int32_t num_values);
-int read_float_info (WavpackStream *wps, WavpackMetadata *wpmd);
-void float_values (WavpackStream *wps, int32_t *values, int32_t num_values);
-void float_normalize (int32_t *values, int32_t num_values, int delta_exp);
-
-// analyze?.c
-
-void analyze_stereo (WavpackContext *wpc, int32_t *samples);
-void analyze_mono (WavpackContext *wpc, int32_t *samples);
-
-// wputils.c
-
-WAVPACKAPI WavpackContext *WavpackOpenFileInputEx (stream_reader *reader, void *wv_id, void *wvc_id, char *error, int flags, int norm_offset);
-WAVPACKAPI WavpackContext *WavpackOpenFileInput (const char *infilename, char *error, int flags, int norm_offset);
-
-#define OPEN_WVC 0x1 // open/read "correction" file
-#define OPEN_TAGS 0x2 // read ID3v1 / APEv2 tags (seekable file)
-#define OPEN_WRAPPER 0x4 // make audio wrapper available (i.e. RIFF)
-#define OPEN_2CH_MAX 0x8 // open multichannel as stereo (no downmix)
-#define OPEN_NORMALIZE 0x10 // normalize floating point data to +/- 1.0
-#define OPEN_STREAMING 0x20 // "streaming" mode blindly unpacks blocks
- // w/o regard to header file position info
-
-int WavpackGetMode (WavpackContext *wpc);
-
-#define MODE_WVC 0x1
-#define MODE_LOSSLESS 0x2
-#define MODE_HYBRID 0x4
-#define MODE_FLOAT 0x8
-#define MODE_VALID_TAG 0x10
-#define MODE_HIGH 0x20
-#define MODE_FAST 0x40
-#define MODE_EXTRA 0x80
-#define MODE_APETAG 0x100
-#define MODE_SFX 0x200
-
-WAVPACKAPI int WavpackGetVersion (WavpackContext *wpc);
-WAVPACKAPI uint32_t WavpackUnpackSamples (WavpackContext *wpc, int32_t *buffer, uint32_t samples);
-WAVPACKAPI uint32_t WavpackGetNumSamples (WavpackContext *wpc);
-WAVPACKAPI uint32_t WavpackGetSampleIndex (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetNumErrors (WavpackContext *wpc);
-WAVPACKAPI int WavpackLossyBlocks (WavpackContext *wpc);
-WAVPACKAPI int WavpackSeekSample (WavpackContext *wpc, uint32_t sample);
-WAVPACKAPI WavpackContext *WavpackCloseFile (WavpackContext *wpc);
-WAVPACKAPI uint32_t WavpackGetSampleRate (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetBitsPerSample (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetBytesPerSample (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetNumChannels (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetReducedChannels (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetMD5Sum (WavpackContext *wpc, uchar data [16]);
-WAVPACKAPI uint32_t WavpackGetWrapperBytes (WavpackContext *wpc);
-WAVPACKAPI uchar *WavpackGetWrapperData (WavpackContext *wpc);
-WAVPACKAPI void WavpackFreeWrapper (WavpackContext *wpc);
-WAVPACKAPI double WavpackGetProgress (WavpackContext *wpc);
-WAVPACKAPI uint32_t WavpackGetFileSize (WavpackContext *wpc);
-WAVPACKAPI double WavpackGetRatio (WavpackContext *wpc);
-WAVPACKAPI double WavpackGetAverageBitrate (WavpackContext *wpc, int count_wvc);
-WAVPACKAPI double WavpackGetInstantBitrate (WavpackContext *wpc);
-WAVPACKAPI int WavpackGetTagItem (WavpackContext *wpc, const char *item, char *value, int size);
-WAVPACKAPI int WavpackAppendTagItem (WavpackContext *wpc, const char *item, const char *value);
-WAVPACKAPI int WavpackWriteTag (WavpackContext *wpc);
-
-WAVPACKAPI WavpackContext *WavpackOpenFileOutput (blockout_f blockout, void *wv_id, void *wvc_id);
-WAVPACKAPI int WavpackSetConfiguration (WavpackContext *wpc, WavpackConfig *config, uint32_t total_samples);
-WAVPACKAPI int WavpackAddWrapper (WavpackContext *wpc, void *data, uint32_t bcount);
-WAVPACKAPI int WavpackStoreMD5Sum (WavpackContext *wpc, uchar data [16]);
-WAVPACKAPI int WavpackPackInit (WavpackContext *wpc);
-WAVPACKAPI int WavpackPackSamples (WavpackContext *wpc, int32_t *sample_buffer, uint32_t sample_count);
-WAVPACKAPI int WavpackFlushSamples (WavpackContext *wpc);
-WAVPACKAPI void WavpackUpdateNumSamples (WavpackContext *wpc, void *first_block);
-WAVPACKAPI void *WavpackGetWrapperLocation (void *first_block);
-
-#endif
diff --git a/lib/win32/libwavpack/wavpackdll.vcproj b/lib/win32/libwavpack/wavpackdll.vcproj
deleted file mode 100644
index ebbe13013e..0000000000
--- a/lib/win32/libwavpack/wavpackdll.vcproj
+++ /dev/null
@@ -1,258 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="libwavpack_dll"
- ProjectGUID="{CDC43FFE-1BED-44C6-BAB9-5A7E84D6D9FE}"
- RootNamespace="libwavpack_dll"
- Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)libs\$(ProjectName)\$(ConfigurationName)\"
- IntermediateDirectory="$(SolutionDir)objs\$(ProjectName)\$(ConfigurationName)\"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WAVPACKDLL_EXPORTS;PACK;UNPACK;SEEKING;TAGS;VER3;USE_FSTREAMS;STRICT;_XBOX; _CRT_SECURE_NO_WARNINGS;"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- DisableSpecificWarnings="4996"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="..\..\..\..\system\players\paplayer\wavpack.dll"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/wavpackdll.pdb"
- SubSystem="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary="$(OutDir)/wavpackdll.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)libs\$(ProjectName)\$(ConfigurationName)\"
- IntermediateDirectory="$(SolutionDir)objs\$(ProjectName)\$(ConfigurationName)\"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\..\..;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;WAVPACKDLL_EXPORTS;PACK;UNPACK;SEEKING;TAGS;VER3;USE_FSTREAMS;STRICT;_XBOX; _CRT_SECURE_NO_WARNINGS;"
- RuntimeLibrary="2"
- BufferSecurityCheck="false"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="0"
- DisableSpecificWarnings="4996"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="..\..\..\..\system\players\paplayer\wavpack.dll"
- GenerateDebugInformation="false"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary="$(OutDir)/wavpackdll.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\bits.c"
- >
- </File>
- <File
- RelativePath=".\extra1.c"
- >
- </File>
- <File
- RelativePath=".\extra2.c"
- >
- </File>
- <File
- RelativePath=".\float.c"
- >
- </File>
- <File
- RelativePath=".\md5.c"
- >
- </File>
- <File
- RelativePath=".\metadata.c"
- >
- </File>
- <File
- RelativePath=".\pack.c"
- >
- </File>
- <File
- RelativePath=".\unpack.c"
- >
- </File>
- <File
- RelativePath=".\unpack3.c"
- >
- </File>
- <File
- RelativePath=".\utils.c"
- >
- </File>
- <File
- RelativePath=".\words.c"
- >
- </File>
- <File
- RelativePath=".\wputils.c"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\md5.h"
- >
- </File>
- <File
- RelativePath=".\unpack3.h"
- >
- </File>
- <File
- RelativePath=".\wavpack.h"
- >
- </File>
- <File
- RelativePath=".\wputils.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/lib/win32/libwavpack/wavpackdll.vcxproj b/lib/win32/libwavpack/wavpackdll.vcxproj
deleted file mode 100644
index 1ca15e14d0..0000000000
--- a/lib/win32/libwavpack/wavpackdll.vcxproj
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>libwavpack_dll</ProjectName>
- <ProjectGuid>{CDC43FFE-1BED-44C6-BAB9-5A7E84D6D9FE}</ProjectGuid>
- <RootNamespace>libwavpack_dll</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
- <Import Project="..\..\..\project\VS2010Express\XBMC for Windows.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
- <Import Project="..\..\..\project\VS2010Express\XBMC for Windows.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir>
- <CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Build</CustomBuildAfterTargets>
- <CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Build</CustomBuildAfterTargets>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">wavpack</TargetName>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">wavpack</TargetName>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\..\xbmc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;WAVPACKDLL_EXPORTS;PACK;UNPACK;SEEKING;TAGS;VER3;USE_FSTREAMS;STRICT;_XBOX; _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- </ClCompile>
- <Link>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)wavpackdll.pdb</ProgramDatabaseFile>
- <SubSystem>Windows</SubSystem>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>$(OutDir)wavpackdll.lib</ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- <PostBuildEvent>
- <Command>
- </Command>
- </PostBuildEvent>
- <CustomBuildStep>
- <Command>copy /B /Y "$(TargetPath)" "$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)"</Command>
- </CustomBuildStep>
- <CustomBuildStep>
- <Message>Copy output</Message>
- </CustomBuildStep>
- <CustomBuildStep>
- <Outputs>$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)</Outputs>
- <Inputs>$(TargetPath)</Inputs>
- </CustomBuildStep>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\..\xbmc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;WAVPACKDLL_EXPORTS;PACK;UNPACK;SEEKING;TAGS;VER3;USE_FSTREAMS;STRICT;_XBOX; _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <BufferSecurityCheck>false</BufferSecurityCheck>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>
- </DebugInformationFormat>
- <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
- </ClCompile>
- <Link>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <SubSystem>Windows</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>$(OutDir)wavpackdll.lib</ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- <PostBuildEvent>
- <Command>
- </Command>
- </PostBuildEvent>
- <CustomBuildStep>
- <Command>copy /B /Y "$(TargetPath)" "$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)"</Command>
- </CustomBuildStep>
- <CustomBuildStep>
- <Message>Copy output</Message>
- </CustomBuildStep>
- <CustomBuildStep>
- <Outputs>$(SolutionDir)..\..\system\players\paplayer\$(TargetFileName)</Outputs>
- <Inputs>$(TargetPath)</Inputs>
- </CustomBuildStep>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="bits.c" />
- <ClCompile Include="extra1.c" />
- <ClCompile Include="extra2.c" />
- <ClCompile Include="float.c" />
- <ClCompile Include="md5.c" />
- <ClCompile Include="metadata.c" />
- <ClCompile Include="pack.c" />
- <ClCompile Include="unpack.c" />
- <ClCompile Include="unpack3.c" />
- <ClCompile Include="utils.c" />
- <ClCompile Include="words.c" />
- <ClCompile Include="wputils.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="md5.h" />
- <ClInclude Include="unpack3.h" />
- <ClInclude Include="wavpack.h" />
- <ClInclude Include="wputils.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/lib/win32/libwavpack/wavpackdll.vcxproj.filters b/lib/win32/libwavpack/wavpackdll.vcxproj.filters
deleted file mode 100644
index 55fe5ae3bc..0000000000
--- a/lib/win32/libwavpack/wavpackdll.vcxproj.filters
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="bits.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="extra1.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="extra2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="float.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="md5.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="metadata.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="pack.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="unpack.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="unpack3.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="utils.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="words.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="wputils.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="md5.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="unpack3.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="wavpack.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="wputils.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/lib/win32/libwavpack/words.c b/lib/win32/libwavpack/words.c
deleted file mode 100644
index 4b8fde6c30..0000000000
--- a/lib/win32/libwavpack/words.c
+++ /dev/null
@@ -1,1437 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-////////////////////////////////////////////////////////////////////////////
-
-// words.c
-
-// This module provides entropy word encoding and decoding functions using
-// a variation on the Rice method. This was introduced in version 3.93
-// because it allows splitting the data into a "lossy" stream and a
-// "correction" stream in a very efficient manner and is therefore ideal
-// for the "hybrid" mode. For 4.0, the efficiency of this method was
-// significantly improved by moving away from the normal Rice restriction of
-// using powers of two for the modulus divisions and now the method can be
-// used for both hybrid and pure lossless encoding.
-
-// Samples are divided by median probabilities at 5/7 (71.43%), 10/49 (20.41%),
-// and 20/343 (5.83%). Each zone has 3.5 times fewer samples than the
-// previous. Using standard Rice coding on this data would result in 1.4
-// bits per sample average (not counting sign bit). However, there is a
-// very simple encoding that is over 99% efficient with this data and
-// results in about 1.22 bits per sample.
-
-#include "wavpack.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-// #define DEBUG_WORDS // debug module by sending all 32 bits literally
-
-//////////////////////////////// local macros /////////////////////////////////
-
-#define LIMIT_ONES 16 // maximum consecutive 1s sent for "div" data
-
-// these control the time constant "slow_level" which is used for hybrid mode
-// that controls bitrate as a function of residual level (HYBRID_BITRATE).
-#define SLS 8
-#define SLO ((1 << (SLS - 1)))
-
-// these control the time constant of the 3 median level breakpoints
-#define DIV0 128 // 5/7 of samples
-#define DIV1 64 // 10/49 of samples
-#define DIV2 32 // 20/343 of samples
-
-// this macro retrieves the specified median breakpoint (without frac; min = 1)
-#define GET_MED(med) (((wps->w.median [med] [chan]) >> 4) + 1)
-
-// These macros update the specified median breakpoints. Note that the median
-// is incremented when the sample is higher than the median, else decremented.
-// They are designed so that the median will never drop below 1 and the value
-// is essentially stationary if there are 2 increments for every 5 decrements.
-
-#define INC_MED0() (wps->w.median [0] [chan] += ((wps->w.median [0] [chan] + DIV0) / DIV0) * 5)
-#define DEC_MED0() (wps->w.median [0] [chan] -= ((wps->w.median [0] [chan] + (DIV0-2)) / DIV0) * 2)
-#define INC_MED1() (wps->w.median [1] [chan] += ((wps->w.median [1] [chan] + DIV1) / DIV1) * 5)
-#define DEC_MED1() (wps->w.median [1] [chan] -= ((wps->w.median [1] [chan] + (DIV1-2)) / DIV1) * 2)
-#define INC_MED2() (wps->w.median [2] [chan] += ((wps->w.median [2] [chan] + DIV2) / DIV2) * 5)
-#define DEC_MED2() (wps->w.median [2] [chan] -= ((wps->w.median [2] [chan] + (DIV2-2)) / DIV2) * 2)
-
-#define count_bits(av) ( \
- (av) < (1 << 8) ? nbits_table [av] : \
- ( \
- (av) < (1L << 16) ? nbits_table [(av) >> 8] + 8 : \
- ((av) < (1L << 24) ? nbits_table [(av) >> 16] + 16 : nbits_table [(av) >> 24] + 24) \
- ) \
-)
-
-///////////////////////////// local table storage ////////////////////////////
-
-const uint32_t bitset [] = {
- 1L << 0, 1L << 1, 1L << 2, 1L << 3,
- 1L << 4, 1L << 5, 1L << 6, 1L << 7,
- 1L << 8, 1L << 9, 1L << 10, 1L << 11,
- 1L << 12, 1L << 13, 1L << 14, 1L << 15,
- 1L << 16, 1L << 17, 1L << 18, 1L << 19,
- 1L << 20, 1L << 21, 1L << 22, 1L << 23,
- 1L << 24, 1L << 25, 1L << 26, 1L << 27,
- 1L << 28, 1L << 29, 1L << 30, 1L << 31
-};
-
-const uint32_t bitmask [] = {
- (1L << 0) - 1, (1L << 1) - 1, (1L << 2) - 1, (1L << 3) - 1,
- (1L << 4) - 1, (1L << 5) - 1, (1L << 6) - 1, (1L << 7) - 1,
- (1L << 8) - 1, (1L << 9) - 1, (1L << 10) - 1, (1L << 11) - 1,
- (1L << 12) - 1, (1L << 13) - 1, (1L << 14) - 1, (1L << 15) - 1,
- (1L << 16) - 1, (1L << 17) - 1, (1L << 18) - 1, (1L << 19) - 1,
- (1L << 20) - 1, (1L << 21) - 1, (1L << 22) - 1, (1L << 23) - 1,
- (1L << 24) - 1, (1L << 25) - 1, (1L << 26) - 1, (1L << 27) - 1,
- (1L << 28) - 1, (1L << 29) - 1, (1L << 30) - 1, 0x7fffffff
-};
-
-const char nbits_table [] = {
- 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, // 0 - 15
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 16 - 31
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 32 - 47
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 48 - 63
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 64 - 79
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 80 - 95
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 96 - 111
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 112 - 127
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 128 - 143
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 144 - 159
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 160 - 175
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 176 - 191
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 192 - 207
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 208 - 223
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 224 - 239
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 // 240 - 255
-};
-
-static const uchar log2_table [] = {
- 0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x10, 0x11, 0x12, 0x14, 0x15,
- 0x16, 0x18, 0x19, 0x1a, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2a,
- 0x2c, 0x2d, 0x2e, 0x2f, 0x31, 0x32, 0x33, 0x34, 0x36, 0x37, 0x38, 0x39, 0x3b, 0x3c, 0x3d, 0x3e,
- 0x3f, 0x41, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
- 0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63,
- 0x64, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75,
- 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85,
- 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95,
- 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,
- 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb2,
- 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc0,
- 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xce,
- 0xcf, 0xd0, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd8, 0xd9, 0xda, 0xdb,
- 0xdc, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe4, 0xe5, 0xe6, 0xe7, 0xe7,
- 0xe8, 0xe9, 0xea, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xee, 0xef, 0xf0, 0xf1, 0xf1, 0xf2, 0xf3, 0xf4,
- 0xf4, 0xf5, 0xf6, 0xf7, 0xf7, 0xf8, 0xf9, 0xf9, 0xfa, 0xfb, 0xfc, 0xfc, 0xfd, 0xfe, 0xff, 0xff
-};
-
-static const uchar exp2_table [] = {
- 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0a, 0x0b,
- 0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x12, 0x13, 0x13, 0x14, 0x15, 0x16, 0x16,
- 0x17, 0x18, 0x19, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1d, 0x1e, 0x1f, 0x20, 0x20, 0x21, 0x22, 0x23,
- 0x24, 0x24, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3a, 0x3b, 0x3c, 0x3d,
- 0x3e, 0x3f, 0x40, 0x41, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4a, 0x4b,
- 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
- 0x5b, 0x5c, 0x5d, 0x5e, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
- 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
- 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a,
- 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
- 0x9c, 0x9d, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad,
- 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0,
- 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc8, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, 0xd3, 0xd4,
- 0xd6, 0xd7, 0xd8, 0xd9, 0xdb, 0xdc, 0xdd, 0xde, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe8, 0xe9,
- 0xea, 0xec, 0xed, 0xee, 0xf0, 0xf1, 0xf2, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xff
-};
-
-static const char ones_count_table [] = {
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
- 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,8
-};
-
-///////////////////////////// executable code ////////////////////////////////
-
-static int FASTCALL mylog2 (uint32_t avalue);
-
-// Initialize entropy encoder for the specified stream. In lossless mode there
-// are no parameters to select; in hybrid mode the bitrate mode and value need
-// be initialized.
-
-#ifdef PACK
-
-void init_words (WavpackStream *wps)
-{
- CLEAR (wps->w);
-
- if (wps->wphdr.flags & HYBRID_FLAG)
- word_set_bitrate (wps);
-}
-
-// Set up parameters for hybrid mode based on header flags and "bits" field.
-// This is currently only set up for the HYBRID_BITRATE mode in which the
-// allowed error varies with the residual level (from "slow_level"). The
-// simpler mode (which is not used yet) has the error level directly
-// controlled from the metadata.
-
-void word_set_bitrate (WavpackStream *wps)
-{
- int bitrate_0, bitrate_1;
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- bitrate_0 = wps->bits < 568 ? 0 : wps->bits - 568;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
-
- if (wps->wphdr.flags & HYBRID_BALANCE)
- bitrate_1 = (wps->wphdr.flags & JOINT_STEREO) ? 256 : 0;
- else {
- bitrate_1 = bitrate_0;
-
- if (wps->wphdr.flags & JOINT_STEREO) {
- if (bitrate_0 < 128) {
- bitrate_1 += bitrate_0;
- bitrate_0 = 0;
- }
- else {
- bitrate_0 -= 128;
- bitrate_1 += 128;
- }
- }
- }
- }
- }
- else
- bitrate_0 = bitrate_1 = 0;
-
- wps->w.bitrate_acc [0] = (int32_t) bitrate_0 << 16;
- wps->w.bitrate_acc [1] = (int32_t) bitrate_1 << 16;
-}
-
-// Allocates the correct space in the metadata structure and writes the
-// current median values to it. Values are converted from 32-bit unsigned
-// to our internal 16-bit mylog2 values, and read_entropy_vars () is called
-// to read the values back because we must compensate for the loss through
-// the log function.
-
-void write_entropy_vars (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- uchar *byteptr;
- int temp;
-
- byteptr = wpmd->data = malloc (12);
- wpmd->id = ID_ENTROPY_VARS;
-
- *byteptr++ = temp = mylog2 (wps->w.median [0] [0]);
- *byteptr++ = temp >> 8;
- *byteptr++ = temp = mylog2 (wps->w.median [1] [0]);
- *byteptr++ = temp >> 8;
- *byteptr++ = temp = mylog2 (wps->w.median [2] [0]);
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- *byteptr++ = temp = mylog2 (wps->w.median [0] [1]);
- *byteptr++ = temp >> 8;
- *byteptr++ = temp = mylog2 (wps->w.median [1] [1]);
- *byteptr++ = temp >> 8;
- *byteptr++ = temp = mylog2 (wps->w.median [2] [1]);
- *byteptr++ = temp >> 8;
- }
-
- wpmd->byte_length = byteptr - (uchar *) wpmd->data;
- read_entropy_vars (wps, wpmd);
-}
-
-// Allocates enough space in the metadata structure and writes the current
-// high word of the bitrate accumulator and the slow_level values to it. The
-// slow_level values are converted from 32-bit unsigned to our internal 16-bit
-// mylog2 values. Afterward, read_entropy_vars () is called to read the values
-// back because we must compensate for the loss through the log function and
-// the truncation of the bitrate.
-
-void write_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- uchar *byteptr;
- int temp;
-
- word_set_bitrate (wps);
- byteptr = wpmd->data = malloc (512);
- wpmd->id = ID_HYBRID_PROFILE;
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- *byteptr++ = temp = log2s (wps->w.slow_level [0]);
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- *byteptr++ = temp = log2s (wps->w.slow_level [1]);
- *byteptr++ = temp >> 8;
- }
- }
-
- *byteptr++ = temp = wps->w.bitrate_acc [0] >> 16;
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- *byteptr++ = temp = wps->w.bitrate_acc [1] >> 16;
- *byteptr++ = temp >> 8;
- }
-
- if (wps->w.bitrate_delta [0] | wps->w.bitrate_delta [1]) {
- *byteptr++ = temp = log2s (wps->w.bitrate_delta [0]);
- *byteptr++ = temp >> 8;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- *byteptr++ = temp = log2s (wps->w.bitrate_delta [1]);
- *byteptr++ = temp >> 8;
- }
- }
-
- wpmd->byte_length = byteptr - (uchar *) wpmd->data;
- read_hybrid_profile (wps, wpmd);
-}
-
-#endif
-
-// Read the median log2 values from the specifed metadata structure, convert
-// them back to 32-bit unsigned values and store them. If length is not
-// exactly correct then we flag and return an error.
-
-int read_entropy_vars (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- uchar *byteptr = wpmd->data;
-
- if (wpmd->byte_length != ((wps->wphdr.flags & MONO_FLAG) ? 6 : 12))
- return FALSE;
-
- wps->w.median [0] [0] = exp2s (byteptr [0] + (byteptr [1] << 8));
- wps->w.median [1] [0] = exp2s (byteptr [2] + (byteptr [3] << 8));
- wps->w.median [2] [0] = exp2s (byteptr [4] + (byteptr [5] << 8));
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->w.median [0] [1] = exp2s (byteptr [6] + (byteptr [7] << 8));
- wps->w.median [1] [1] = exp2s (byteptr [8] + (byteptr [9] << 8));
- wps->w.median [2] [1] = exp2s (byteptr [10] + (byteptr [11] << 8));
- }
-
- return TRUE;
-}
-
-// Read the hybrid related values from the specifed metadata structure, convert
-// them back to their internal formats and store them. The extended profile
-// stuff is not implemented yet, so return an error if we get more data than
-// we know what to do with.
-
-int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd)
-{
- uchar *byteptr = wpmd->data;
- uchar *endptr = byteptr + wpmd->byte_length;
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- wps->w.slow_level [0] = exp2s (byteptr [0] + (byteptr [1] << 8));
- byteptr += 2;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->w.slow_level [1] = exp2s (byteptr [0] + (byteptr [1] << 8));
- byteptr += 2;
- }
- }
-
- wps->w.bitrate_acc [0] = (int32_t)(byteptr [0] + (byteptr [1] << 8)) << 16;
- byteptr += 2;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->w.bitrate_acc [1] = (int32_t)(byteptr [0] + (byteptr [1] << 8)) << 16;
- byteptr += 2;
- }
-
- if (byteptr < endptr) {
- wps->w.bitrate_delta [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- byteptr += 2;
-
- if (!(wps->wphdr.flags & MONO_FLAG)) {
- wps->w.bitrate_delta [1] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8)));
- byteptr += 2;
- }
-
- if (byteptr < endptr)
- return FALSE;
- }
- else
- wps->w.bitrate_delta [0] = wps->w.bitrate_delta [1] = 0;
-
- return TRUE;
-}
-
-// This function is called during both encoding and decoding of hybrid data to
-// update the "error_limit" variable which determines the maximum sample error
-// allowed in the main bitstream. In the HYBRID_BITRATE mode (which is the only
-// currently implemented) this is calculated from the slow_level values and the
-// bitrate accumulators. Note that the bitrate accumulators can be changing.
-
-static void update_error_limit (WavpackStream *wps)
-{
- int bitrate_0 = (wps->w.bitrate_acc [0] += wps->w.bitrate_delta [0]) >> 16;
-
- if (wps->wphdr.flags & MONO_FLAG) {
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- int slow_log_0 = (wps->w.slow_level [0] + SLO) >> SLS;
-
- if (slow_log_0 - bitrate_0 > -0x100)
- wps->w.error_limit [0] = exp2s (slow_log_0 - bitrate_0 + 0x100);
- else
- wps->w.error_limit [0] = 0;
- }
- else
- wps->w.error_limit [0] = exp2s (bitrate_0);
- }
- else {
- int bitrate_1 = (wps->w.bitrate_acc [1] += wps->w.bitrate_delta [1]) >> 16;
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- int slow_log_0 = (wps->w.slow_level [0] + SLO) >> SLS;
- int slow_log_1 = (wps->w.slow_level [1] + SLO) >> SLS;
-
- if (wps->wphdr.flags & HYBRID_BALANCE) {
- int balance = (slow_log_1 - slow_log_0 + bitrate_1 + 1) >> 1;
-
- if (balance > bitrate_0) {
- bitrate_1 = bitrate_0 * 2;
- bitrate_0 = 0;
- }
- else if (-balance > bitrate_0) {
- bitrate_0 = bitrate_0 * 2;
- bitrate_1 = 0;
- }
- else {
- bitrate_1 = bitrate_0 + balance;
- bitrate_0 = bitrate_0 - balance;
- }
- }
-
- if (slow_log_0 - bitrate_0 > -0x100)
- wps->w.error_limit [0] = exp2s (slow_log_0 - bitrate_0 + 0x100);
- else
- wps->w.error_limit [0] = 0;
-
- if (slow_log_1 - bitrate_1 > -0x100)
- wps->w.error_limit [1] = exp2s (slow_log_1 - bitrate_1 + 0x100);
- else
- wps->w.error_limit [1] = 0;
- }
- else {
- wps->w.error_limit [0] = exp2s (bitrate_0);
- wps->w.error_limit [1] = exp2s (bitrate_1);
- }
- }
-}
-
-#ifdef PACK
-
-// This function writes the specified word to the open bitstream "wvbits" and,
-// if the bitstream "wvcbits" is open, writes any correction data there. This
-// function will work for either lossless or hybrid but because a version
-// optimized for lossless exits below, it would normally be used for the hybrid
-// mode only. The return value is the actual value stored to the stream (even
-// if a correction file is being created) and is used as feedback to the
-// predictor.
-
-int32_t FASTCALL send_word (WavpackStream *wps, int32_t value, int chan)
-{
- uint32_t ones_count, low, mid, high;
- int sign = (value < 0) ? 1 : 0;
-
-#ifdef DEBUG_WORDS
- mid = value;
- ones_count = 32;
- while (ones_count--) {
- putbit (value & 1, &wps->wvbits);
- value >>= 1;
- }
- return mid;
-#endif
-
- if (!(wps->w.median [0] [0] & ~1) && !wps->w.holding_zero && !(wps->w.median [0] [1] & ~1)) {
- if (wps->w.zeros_acc) {
- if (value)
- flush_word (wps);
- else {
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- wps->w.zeros_acc++;
- return 0;
- }
- }
- else if (value) {
- putbit_0 (&wps->wvbits);
- }
- else {
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- CLEAR (wps->w.median);
- wps->w.zeros_acc = 1;
- return 0;
- }
- }
-
- if (sign)
- value = ~value;
-
- if ((wps->wphdr.flags & HYBRID_FLAG) && !chan)
- update_error_limit (wps);
-
- if (value < GET_MED (0)) {
- ones_count = low = 0;
- high = GET_MED (0) - 1;
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (value - low < GET_MED (1)) {
- ones_count = 1;
- high = low + GET_MED (1) - 1;
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (value - low < GET_MED (2)) {
- ones_count = 2;
- high = low + GET_MED (2) - 1;
- DEC_MED2 ();
- }
- else {
- ones_count = 2 + (value - low) / GET_MED (2);
- low += (ones_count - 2) * GET_MED (2);
- high = low + GET_MED (2) - 1;
- INC_MED2 ();
- }
- }
- }
-
- mid = (high + low + 1) >> 1;
-
- if (wps->w.holding_zero) {
- if (ones_count)
- wps->w.holding_one++;
-
- flush_word (wps);
-
- if (ones_count) {
- wps->w.holding_zero = 1;
- ones_count--;
- }
- else
- wps->w.holding_zero = 0;
- }
- else
- wps->w.holding_zero = 1;
-
- wps->w.holding_one = ones_count * 2;
-
- if (!wps->w.error_limit [chan]) {
- if (high != low) {
- uint32_t maxcode = high - low, code = value - low;
- int bitcount = count_bits (maxcode);
- uint32_t extras = bitset [bitcount] - maxcode - 1;
-
- if (code < extras) {
- wps->w.pend_data |= code << wps->w.pend_count;
- wps->w.pend_count += bitcount - 1;
- }
- else {
- wps->w.pend_data |= ((code + extras) >> 1) << wps->w.pend_count;
- wps->w.pend_count += bitcount - 1;
- wps->w.pend_data |= ((code + extras) & 1) << wps->w.pend_count++;
- }
- }
-
- mid = value;
- }
- else
- while (high - low > wps->w.error_limit [chan])
- if (value < mid) {
- mid = ((high = mid - 1) + low + 1) >> 1;
- wps->w.pend_count++;
- }
- else {
- mid = (high + (low = mid) + 1) >> 1;
- wps->w.pend_data |= bitset [wps->w.pend_count++];
- }
-
- wps->w.pend_data |= ((int32_t) sign << wps->w.pend_count++);
-
- if (!wps->w.holding_zero)
- flush_word (wps);
-
- if (bs_is_open (&wps->wvcbits) && wps->w.error_limit [chan]) {
- uint32_t code = value - low, maxcode = high - low;
- int bitcount = count_bits (maxcode);
- uint32_t extras = bitset [bitcount] - maxcode - 1;
-
- if (bitcount) {
- if (code < extras) {
- putbits (code, bitcount - 1, &wps->wvcbits);
- }
- else {
- putbits ((code + extras) >> 1, bitcount - 1, &wps->wvcbits);
- putbit ((code + extras) & 1, &wps->wvcbits);
- }
- }
- }
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- wps->w.slow_level [chan] += mylog2 (mid);
- }
-
- return sign ? ~mid : mid;
-}
-
-// This function is an optimized version of send_word() that only handles
-// lossless (error_limit == 0). It does not return a value because it always
-// encodes the exact value passed.
-
-void FASTCALL send_word_lossless (WavpackStream *wps, int32_t value, int chan)
-{
- int sign = (value < 0) ? 1 : 0;
- uint32_t ones_count, low, high;
-
-#ifdef DEBUG_WORDS
- ones_count = 32;
- while (ones_count--) {
- putbit (value & 1, &wps->wvbits);
- value >>= 1;
- }
- return;
-#endif
-
- if (!(wps->w.median [0] [0] & ~1) && !wps->w.holding_zero && !(wps->w.median [0] [1] & ~1)) {
- if (wps->w.zeros_acc) {
- if (value)
- flush_word (wps);
- else {
- wps->w.zeros_acc++;
- return;
- }
- }
- else if (value) {
- putbit_0 (&wps->wvbits);
- }
- else {
- CLEAR (wps->w.median);
- wps->w.zeros_acc = 1;
- return;
- }
- }
-
- if (sign)
- value = ~value;
-
- if (value < GET_MED (0)) {
- ones_count = low = 0;
- high = GET_MED (0) - 1;
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (value - low < GET_MED (1)) {
- ones_count = 1;
- high = low + GET_MED (1) - 1;
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (value - low < GET_MED (2)) {
- ones_count = 2;
- high = low + GET_MED (2) - 1;
- DEC_MED2 ();
- }
- else {
- ones_count = 2 + (value - low) / GET_MED (2);
- low += (ones_count - 2) * GET_MED (2);
- high = low + GET_MED (2) - 1;
- INC_MED2 ();
- }
- }
- }
-
- if (wps->w.holding_zero) {
- if (ones_count)
- wps->w.holding_one++;
-
- flush_word (wps);
-
- if (ones_count) {
- wps->w.holding_zero = 1;
- ones_count--;
- }
- else
- wps->w.holding_zero = 0;
- }
- else
- wps->w.holding_zero = 1;
-
- wps->w.holding_one = ones_count * 2;
-
- if (high != low) {
- uint32_t maxcode = high - low, code = value - low;
- int bitcount = count_bits (maxcode);
- uint32_t extras = bitset [bitcount] - maxcode - 1;
-
- if (code < extras) {
- wps->w.pend_data |= code << wps->w.pend_count;
- wps->w.pend_count += bitcount - 1;
- }
- else {
- wps->w.pend_data |= ((code + extras) >> 1) << wps->w.pend_count;
- wps->w.pend_count += bitcount - 1;
- wps->w.pend_data |= ((code + extras) & 1) << wps->w.pend_count++;
- }
- }
-
- wps->w.pend_data |= ((int32_t) sign << wps->w.pend_count++);
-
- if (!wps->w.holding_zero)
- flush_word (wps);
-}
-
-// Used by send_word() and send_word_lossless() to actually send most the
-// accumulated data onto the bitstream. This is also called directly from
-// clients when all words have been sent.
-
-void flush_word (WavpackStream *wps)
-{
- if (wps->w.zeros_acc) {
- int cbits = count_bits (wps->w.zeros_acc);
-
- while (cbits--) {
- putbit_1 (&wps->wvbits);
- }
-
- putbit_0 (&wps->wvbits);
-
- while (wps->w.zeros_acc > 1) {
- putbit (wps->w.zeros_acc & 1, &wps->wvbits);
- wps->w.zeros_acc >>= 1;
- }
-
- wps->w.zeros_acc = 0;
- }
-
- if (wps->w.holding_one) {
-#ifdef LIMIT_ONES
- if (wps->w.holding_one >= LIMIT_ONES) {
- int cbits;
-
- putbits ((1L << LIMIT_ONES) - 1, LIMIT_ONES + 1, &wps->wvbits);
- wps->w.holding_one -= LIMIT_ONES;
- cbits = count_bits (wps->w.holding_one);
-
- while (cbits--) {
- putbit_1 (&wps->wvbits);
- }
-
- putbit_0 (&wps->wvbits);
-
- while (wps->w.holding_one > 1) {
- putbit (wps->w.holding_one & 1, &wps->wvbits);
- wps->w.holding_one >>= 1;
- }
-
- wps->w.holding_zero = 0;
- }
- else
- putbits (bitmask [wps->w.holding_one], wps->w.holding_one, &wps->wvbits);
-
- wps->w.holding_one = 0;
-#else
- do {
- putbit_1 (&wps->wvbits);
- } while (--wps->w.holding_one);
-#endif
- }
-
- if (wps->w.holding_zero) {
- putbit_0 (&wps->wvbits);
- wps->w.holding_zero = 0;
- }
-
- if (wps->w.pend_count) {
-
- while (wps->w.pend_count > 24) {
- putbit (wps->w.pend_data & 1, &wps->wvbits);
- wps->w.pend_data >>= 1;
- wps->w.pend_count--;
- }
-
- putbits (wps->w.pend_data, wps->w.pend_count, &wps->wvbits);
- wps->w.pend_data = wps->w.pend_count = 0;
- }
-}
-
-// This function is similar to send_word() except that no data is actually
-// written to any stream, but it does return the value that would have been
-// sent to a hybrid stream. It is used to determine beforehand how much noise
-// will be added to samples.
-
-int32_t nosend_word (WavpackStream *wps, int32_t value, int chan)
-{
- uint32_t ones_count, low, mid, high;
- int sign = (value < 0) ? 1 : 0;
-
- if (sign)
- value = ~value;
-
- if ((wps->wphdr.flags & HYBRID_FLAG) && !chan)
- update_error_limit (wps);
-
- if (value < GET_MED (0)) {
- low = 0;
- high = GET_MED (0) - 1;
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (value - low < GET_MED (1)) {
- high = low + GET_MED (1) - 1;
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (value - low < GET_MED (2)) {
- high = low + GET_MED (2) - 1;
- DEC_MED2 ();
- }
- else {
- ones_count = 2 + (value - low) / GET_MED (2);
- low += (ones_count - 2) * GET_MED (2);
- high = low + GET_MED (2) - 1;
- INC_MED2 ();
- }
- }
- }
-
- mid = (high + low + 1) >> 1;
-
- if (!wps->w.error_limit [chan])
- mid = value;
- else
- while (high - low > wps->w.error_limit [chan])
- if (value < mid)
- mid = ((high = mid - 1) + low + 1) >> 1;
- else
- mid = (high + (low = mid) + 1) >> 1;
-
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- wps->w.slow_level [chan] += mylog2 (mid);
-
- return sign ? ~mid : mid;
-}
-
-// This function is used to scan some number of samples to set the variables
-// "slow_level" and the "median" array. In pure symetrical encoding mode this
-// would not be needed because these values would simply be continued from the
-// previous block. However, in the -X modes and the 32-bit modes we cannot do
-// this because parameters may change between blocks and the variables might
-// not apply. This function can work in mono or stereo and can scan a block
-// in either direction.
-
-void scan_word (WavpackStream *wps, int32_t *samples, uint32_t num_samples, int dir)
-{
- uint32_t flags = wps->wphdr.flags, value, low;
- int chan;
-
- CLEAR (wps->w.slow_level);
- CLEAR (wps->w.median);
-
- if (flags & MONO_FLAG) {
- if (dir < 0) {
- samples += (num_samples - 1);
- dir = -1;
- }
- else
- dir = 1;
- }
- else {
- if (dir < 0) {
- samples += (num_samples - 1) * 2;
- dir = -2;
- }
- else
- dir = 2;
- }
-
- while (num_samples--) {
-
- value = labs (samples [chan = 0]);
-
- if (flags & HYBRID_BITRATE) {
- wps->w.slow_level [0] -= (wps->w.slow_level [0] + SLO) >> SLS;
- wps->w.slow_level [0] += mylog2 (value);
- }
-
- if (value < GET_MED (0)) {
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (value - low < GET_MED (1)) {
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (value - low < GET_MED (2)) {
- DEC_MED2 ();
- }
- else {
- INC_MED2 ();
- }
- }
- }
-
- if (!(flags & MONO_FLAG)) {
- value = labs (samples [chan = 1]);
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- wps->w.slow_level [1] -= (wps->w.slow_level [1] + SLO) >> SLS;
- wps->w.slow_level [1] += mylog2 (value);
- }
-
- if (value < GET_MED (0)) {
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (value - low < GET_MED (1)) {
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (value - low < GET_MED (2)) {
- DEC_MED2 ();
- }
- else {
- INC_MED2 ();
- }
- }
- }
- }
-
- samples += dir;
- }
-}
-
-#endif
-
-#ifdef UNPACK
-
-static uint32_t FASTCALL read_code (Bitstream *bs, uint32_t maxcode);
-
-// Read the next word from the bitstream "wvbits" and return the value. This
-// function can be used for hybrid or lossless streams, but since an
-// optimized version is available for lossless this function would normally
-// be used for hybrid only. If a hybrid lossless stream is being read then
-// the "correction" offset is written at the specified pointer. A return value
-// of WORD_EOF indicates that the end of the bitstream was reached (all 1s) or
-// some other error occurred.
-
-int32_t FASTCALL get_word (WavpackStream *wps, int chan, int32_t *correction)
-{
- uint32_t ones_count, low, mid, high;
- int next8, sign;
- int32_t value;
-
- if (correction)
- *correction = 0;
-
-#ifdef DEBUG_WORDS
- ones_count = 32;
- while (ones_count--)
- value = getbit (&wps->wvbits) ? (value >> 1) | 0x80000000 : (value >> 1) & 0x7fffffff;
- return value;
-#endif
-
- if (!(wps->w.median [0] [0] & ~1) && !wps->w.holding_zero && !wps->w.holding_one && !(wps->w.median [0] [1] & ~1)) {
- uint32_t mask;
- int cbits;
-
- if (wps->w.zeros_acc) {
- if (--wps->w.zeros_acc) {
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- return 0;
- }
- }
- else {
- for (cbits = 0; cbits < 33 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 33)
- return WORD_EOF;
-
- if (cbits < 2)
- wps->w.zeros_acc = cbits;
- else {
- for (mask = 1, wps->w.zeros_acc = 0; --cbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- wps->w.zeros_acc |= mask;
-
- wps->w.zeros_acc |= mask;
- }
-
- if (wps->w.zeros_acc) {
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- CLEAR (wps->w.median);
- return 0;
- }
- }
- }
-
- if (wps->w.holding_zero)
- ones_count = wps->w.holding_zero = 0;
- else {
- if (wps->wvbits.bc < 8) {
- if (++(wps->wvbits.ptr) == wps->wvbits.end)
- wps->wvbits.wrap (&wps->wvbits);
-
- next8 = (wps->wvbits.sr |= *(wps->wvbits.ptr) << wps->wvbits.bc) & 0xff;
- wps->wvbits.bc += 8;
- }
- else
- next8 = wps->wvbits.sr & 0xff;
-
- if (next8 == 0xff) {
- wps->wvbits.bc -= 8;
- wps->wvbits.sr >>= 8;
-
- for (ones_count = 8; ones_count < (LIMIT_ONES + 1) && getbit (&wps->wvbits); ++ones_count);
-
- if (ones_count == (LIMIT_ONES + 1))
- return WORD_EOF;
-
- if (ones_count == LIMIT_ONES) {
- uint32_t mask;
- int cbits;
-
- for (cbits = 0; cbits < 33 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 33)
- return WORD_EOF;
-
- if (cbits < 2)
- ones_count = cbits;
- else {
- for (mask = 1, ones_count = 0; --cbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- ones_count |= mask;
-
- ones_count |= mask;
- }
-
- ones_count += LIMIT_ONES;
- }
- }
- else {
- wps->wvbits.bc -= (ones_count = ones_count_table [next8]) + 1;
- wps->wvbits.sr >>= ones_count + 1;
- }
-
- if (wps->w.holding_one) {
- wps->w.holding_one = ones_count & 1;
- ones_count = (ones_count >> 1) + 1;
- }
- else {
- wps->w.holding_one = ones_count & 1;
- ones_count >>= 1;
- }
-
- wps->w.holding_zero = ~wps->w.holding_one & 1;
- }
-
- if ((wps->wphdr.flags & HYBRID_FLAG) && !chan)
- update_error_limit (wps);
-
- if (ones_count == 0) {
- low = 0;
- high = GET_MED (0) - 1;
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (ones_count == 1) {
- high = low + GET_MED (1) - 1;
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (ones_count == 2) {
- high = low + GET_MED (2) - 1;
- DEC_MED2 ();
- }
- else {
- low += (ones_count - 2) * GET_MED (2);
- high = low + GET_MED (2) - 1;
- INC_MED2 ();
- }
- }
- }
-
- mid = (high + low + 1) >> 1;
-
- if (!wps->w.error_limit [chan])
- mid = read_code (&wps->wvbits, high - low) + low;
- else while (high - low > wps->w.error_limit [chan]) {
- if (getbit (&wps->wvbits))
- mid = (high + (low = mid) + 1) >> 1;
- else
- mid = ((high = mid - 1) + low + 1) >> 1;
- }
-
- sign = getbit (&wps->wvbits);
-
- if (bs_is_open (&wps->wvcbits) && wps->w.error_limit [chan]) {
- value = read_code (&wps->wvcbits, high - low) + low;
-
- if (correction)
- *correction = sign ? (mid - value) : (value - mid);
- }
-
- if (wps->wphdr.flags & HYBRID_BITRATE) {
- wps->w.slow_level [chan] -= (wps->w.slow_level [chan] + SLO) >> SLS;
- wps->w.slow_level [chan] += mylog2 (mid);
- }
-
- return sign ? ~mid : mid;
-}
-
-// This is an optimized version of get_word() that is used for lossless only
-// (error_limit == 0). There are two versions of an internal section; they
-// are identical from a functional standpoint, but one may be faster than the
-// other under different compilers / processors.
-
-int32_t FASTCALL get_word_lossless (WavpackStream *wps, int chan)
-{
- uint32_t ones_count, low, high;
- int next8;
-
-#ifdef DEBUG_WORDS
- ones_count = 32;
- while (ones_count--)
- low = getbit (&wps->wvbits) ? (low >> 1) | 0x80000000 : (low >> 1) & 0x7fffffff;
- return low;
-#endif
-
- if (!(wps->w.median [0] [0] & ~1) && !wps->w.holding_zero && !wps->w.holding_one && !(wps->w.median [0] [1] & ~1)) {
- uint32_t mask;
- int cbits;
-
- if (wps->w.zeros_acc) {
- if (--wps->w.zeros_acc)
- return 0;
- }
- else {
- for (cbits = 0; cbits < 33 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 33)
- return WORD_EOF;
-
- if (cbits < 2)
- wps->w.zeros_acc = cbits;
- else {
- for (mask = 1, wps->w.zeros_acc = 0; --cbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- wps->w.zeros_acc |= mask;
-
- wps->w.zeros_acc |= mask;
- }
-
- if (wps->w.zeros_acc) {
- CLEAR (wps->w.median);
- return 0;
- }
- }
- }
-
- if (wps->w.holding_zero)
- ones_count = wps->w.holding_zero = 0;
- else {
- if (wps->wvbits.bc < 8) {
- if (++(wps->wvbits.ptr) == wps->wvbits.end)
- wps->wvbits.wrap (&wps->wvbits);
-
- next8 = (wps->wvbits.sr |= *(wps->wvbits.ptr) << wps->wvbits.bc) & 0xff;
- wps->wvbits.bc += 8;
- }
- else
- next8 = wps->wvbits.sr & 0xff;
-
- if (next8 == 0xff) {
- wps->wvbits.bc -= 8;
- wps->wvbits.sr >>= 8;
-
- for (ones_count = 8; ones_count < (LIMIT_ONES + 1) && getbit (&wps->wvbits); ++ones_count);
-
- if (ones_count == (LIMIT_ONES + 1))
- return WORD_EOF;
-
- if (ones_count == LIMIT_ONES) {
- uint32_t mask;
- int cbits;
-
- for (cbits = 0; cbits < 33 && getbit (&wps->wvbits); ++cbits);
-
- if (cbits == 33)
- return WORD_EOF;
-
- if (cbits < 2)
- ones_count = cbits;
- else {
- for (mask = 1, ones_count = 0; --cbits; mask <<= 1)
- if (getbit (&wps->wvbits))
- ones_count |= mask;
-
- ones_count |= mask;
- }
-
- ones_count += LIMIT_ONES;
- }
- }
- else {
- wps->wvbits.bc -= (ones_count = ones_count_table [next8]) + 1;
- wps->wvbits.sr >>= ones_count + 1;
- }
-
- if (wps->w.holding_one) {
- wps->w.holding_one = ones_count & 1;
- ones_count = (ones_count >> 1) + 1;
- }
- else {
- wps->w.holding_one = ones_count & 1;
- ones_count >>= 1;
- }
-
- wps->w.holding_zero = ~wps->w.holding_one & 1;
- }
-
- if (ones_count == 0) {
- low = 0;
- high = GET_MED (0) - 1;
- DEC_MED0 ();
- }
- else {
- low = GET_MED (0);
- INC_MED0 ();
-
- if (ones_count == 1) {
- high = low + GET_MED (1) - 1;
- DEC_MED1 ();
- }
- else {
- low += GET_MED (1);
- INC_MED1 ();
-
- if (ones_count == 2) {
- high = low + GET_MED (2) - 1;
- DEC_MED2 ();
- }
- else {
- low += (ones_count - 2) * GET_MED (2);
- high = low + GET_MED (2) - 1;
- INC_MED2 ();
- }
- }
- }
-
- low += read_code (&wps->wvbits, high - low);
- return (getbit (&wps->wvbits)) ? ~low : low;
-}
-
-// Read a single unsigned value from the specified bitstream with a value
-// from 0 to maxcode. If there are exactly a power of two number of possible
-// codes then this will read a fixed number of bits; otherwise it reads the
-// minimum number of bits and then determines whether another bit is needed
-// to define the code.
-
-static uint32_t FASTCALL read_code (Bitstream *bs, uint32_t maxcode)
-{
- int bitcount = count_bits (maxcode);
- uint32_t extras = bitset [bitcount] - maxcode - 1, code;
-
- if (!bitcount)
- return 0;
-
- getbits (&code, bitcount - 1, bs);
- code &= bitmask [bitcount - 1];
-
- if (code >= extras) {
- code = (code << 1) - extras;
-
- if (getbit (bs))
- ++code;
- }
-
- return code;
-}
-
-#endif
-
-// The concept of a base 2 logarithm is used in many parts of WavPack. It is
-// a way of sufficiently accurately representing 32-bit signed and unsigned
-// values storing only 16 bits (actually fewer). It is also used in the hybrid
-// mode for quickly comparing the relative magnitude of large values (i.e.
-// division) and providing smooth exponentials using only addition.
-
-// These are not strict logarithms in that they become linear around zero and
-// can therefore represent both zero and negative values. They have 8 bits
-// of precision and in "roundtrip" conversions the total error never exceeds 1
-// part in 225 except for the cases of +/-115 and +/-195 (which error by 1).
-
-
-// This function returns the log2 for the specified 32-bit unsigned value.
-// The maximum value allowed is about 0xff800000 and returns 8447.
-
-static int FASTCALL mylog2 (uint32_t avalue)
-{
- int dbits;
-
- if ((avalue += avalue >> 9) < (1 << 8)) {
- dbits = nbits_table [avalue];
- return (dbits << 8) + log2_table [(avalue << (9 - dbits)) & 0xff];
- }
- else {
- if (avalue < (1L << 16))
- dbits = nbits_table [avalue >> 8] + 8;
- else if (avalue < (1L << 24))
- dbits = nbits_table [avalue >> 16] + 16;
- else
- dbits = nbits_table [avalue >> 24] + 24;
-
- return (dbits << 8) + log2_table [(avalue >> (dbits - 9)) & 0xff];
- }
-}
-
-// This function scans a buffer of longs and accumulates the total log2 value
-// of all the samples. This is useful for determining maximum compression
-// because the bitstream storage required for entropy coding is proportional
-// to the base 2 log of the samples.
-
-uint32_t log2buffer (int32_t *samples, uint32_t num_samples)
-{
- uint32_t result = 0, avalue;
- int dbits;
-
- while (num_samples--) {
- avalue = abs (*samples++);
-
- if ((avalue += avalue >> 9) < (1 << 8)) {
- dbits = nbits_table [avalue];
- result += (dbits << 8) + log2_table [(avalue << (9 - dbits)) & 0xff];
- }
- else {
- if (avalue < (1L << 16))
- dbits = nbits_table [avalue >> 8] + 8;
- else if (avalue < (1L << 24))
- dbits = nbits_table [avalue >> 16] + 16;
- else
- dbits = nbits_table [avalue >> 24] + 24;
-
- result += (dbits << 8) + log2_table [(avalue >> (dbits - 9)) & 0xff];
- }
- }
-
- return result;
-}
-
-// This function returns the log2 for the specified 32-bit signed value.
-// All input values are valid and the return values are in the range of
-// +/- 8192.
-
-int log2s (int32_t value)
-{
- return (value < 0) ? -mylog2 (-value) : mylog2 (value);
-}
-
-// This function returns the original integer represented by the supplied
-// logarithm (at least within the provided accuracy). The log is signed,
-// but since a full 32-bit value is returned this can be used for unsigned
-// conversions as well (i.e. the input range is -8192 to +8447).
-
-int32_t exp2s (int log)
-{
- uint32_t value;
-
- if (log < 0)
- return -exp2s (-log);
-
- value = exp2_table [log & 0xff] | 0x100;
-
- if ((log >>= 8) <= 9)
- return value >> (9 - log);
- else
- return value << (log - 9);
-}
-
-// These two functions convert internal weights (which are normally +/-1024)
-// to and from an 8-bit signed character version for storage in metadata. The
-// weights are clipped here in the case that they are outside that range.
-
-char store_weight (int weight)
-{
- if (weight > 1024)
- weight = 1024;
- else if (weight < -1024)
- weight = -1024;
-
- if (weight > 0)
- weight -= (weight + 64) >> 7;
-
- return (weight + 4) >> 3;
-}
-
-int restore_weight (char weight)
-{
- int result;
-
- if ((result = (int) weight << 3) > 0)
- result += (result + 64) >> 7;
-
- return result;
-}
diff --git a/lib/win32/libwavpack/wputils.c b/lib/win32/libwavpack/wputils.c
deleted file mode 100644
index 497fb75126..0000000000
--- a/lib/win32/libwavpack/wputils.c
+++ /dev/null
@@ -1,2106 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// wputils.c
-
-// This module provides a high-level interface to reading and writing WavPack
-// files. WavPack input files can be opened as standard "C" streams using a
-// provided filename. However, an alternate entry uses stream-reading
-// callbacks to make using another file I/O method easy. Note that in this
-// case the user application is responsible for finding and opening the .wvc
-// file if the use of them is desired.
-
-// For writing WavPack files there are no I/O routines used; a callback for
-// writing completed blocks is provided.
-
-#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
-#include <math.h>
-#include <sys/stat.h>
-
-#ifdef WIN32
-#include <io.h>
-#endif
-
-#include "wavpack.h"
-
-#if !defined(WIN32)
-#define stricmp(x,y) strcasecmp(x,y)
-#endif
-
-#ifdef DEBUG_ALLOC
-#define malloc malloc_db
-#define realloc realloc_db
-#define free free_db
-void *malloc_db (uint32_t size);
-void *realloc_db (void *ptr, uint32_t size);
-void free_db (void *ptr);
-int32_t dump_alloc (void);
-#endif
-
-static void free_streams (WavpackContext *wpc);
-
-///////////////////////////// local table storage ////////////////////////////
-
-const uint32_t sample_rates [] = { 6000, 8000, 9600, 11025, 12000, 16000, 22050,
- 24000, 32000, 44100, 48000, 64000, 88200, 96000, 192000 };
-
-///////////////////////////// executable code ////////////////////////////////
-
-#ifdef TAGS
-static int load_tag (WavpackContext *wpc);
-static int valid_tag (M_Tag *m_tag);
-static void free_tag (M_Tag *m_tag);
-#endif
-
-#if defined(UNPACK) || defined(INFO_ONLY)
-
-static uint32_t read_next_header (stream_reader *reader, void *id, WavpackHeader *wphdr);
-static uint32_t seek_final_index (stream_reader *reader, void *id);
-
-// This code provides an interface between the reader callback mechanism that
-// WavPack uses internally and the standard fstream C library.
-
-#ifdef USE_FSTREAMS
-
-static int32_t read_bytes (void *id, void *data, int32_t bcount)
-{
- return fread (data, 1, bcount, (FILE*) id);
-}
-
-static uint32_t get_pos (void *id)
-{
- return ftell ((FILE*) id);
-}
-
-static int set_pos_abs (void *id, uint32_t pos)
-{
- return fseek (id, pos, SEEK_SET);
-}
-
-static int set_pos_rel (void *id, int32_t delta, int mode)
-{
- return fseek (id, delta, mode);
-}
-
-static int push_back_byte (void *id, int c)
-{
- return ungetc (c, id);
-}
-
-static uint32_t get_length (void *id)
-{
- FILE *file = id;
- struct stat statbuf;
-
- if (!file || fstat (fileno (file), &statbuf) || !(statbuf.st_mode & S_IFREG))
- return 0;
-
- return statbuf.st_size;
-}
-
-static int can_seek (void *id)
-{
- FILE *file = id;
- struct stat statbuf;
- return file && !fstat (fileno (file), &statbuf) && (statbuf.st_mode & S_IFREG);
-}
-
-static stream_reader freader = {
- read_bytes, get_pos, set_pos_abs, set_pos_rel, push_back_byte, get_length, can_seek
-};
-
-// This function attempts to open the specified WavPack file for reading. If
-// this fails for any reason then an appropriate message is copied to "error"
-// and NULL is returned, otherwise a pointer to a WavpackContext structure is
-// returned (which is used to call all other functions in this module). A
-// filename beginning with "-" is assumed to be stdin. The "flags" argument
-// has the following bit mask values to specify details of the open operation:
-
-// OPEN_WVC: attempt to open/read "correction" file
-// OPEN_TAGS: attempt to read ID3v1 / APEv2 tags (requires seekable file)
-// OPEN_WRAPPER: make audio wrapper available (i.e. RIFF) to caller
-// OPEN_2CH_MAX: open only first stream of multichannel file (usually L/R)
-// OPEN_NORMALIZE: normalize floating point data to +/- 1.0 (w/ offset exp)
-// OPEN_STREAMING: blindly unpacks blocks w/o regard to header file position
-
-// Version 4.2 of the WavPack library adds the OPEN_STREAMING flag. This is
-// essentially a "raw" mode where the library will simply decode any blocks
-// fed it through the reader callback, regardless of where those blocks came
-// from in a stream. The only requirement is that complete WavPack blocks are
-// fed to the decoder (and this may require multiple blocks in multichannel
-// mode) and that complete blocks are decoded (even if all samples are not
-// actually required). All the blocks must contain the same number of channels
-// and bit resolution, and the correction data must be either present or not.
-// All other parameters may change from block to block (like lossy/lossless).
-// Obviously, in this mode any seeking must be performed by the application
-// (and again, decoding must start at the beginning of the block containing
-// the seek sample).
-
-WavpackContext *WavpackOpenFileInput (const char *infilename, char *error, int flags, int norm_offset)
-{
- FILE *wv_id, *wvc_id;
- WavpackContext *wpc;
-
- if (*infilename == '-') {
- wv_id = stdin;
-#if defined(WIN32)
- setmode (fileno (stdin), O_BINARY);
-#endif
- }
- else if ((wv_id = fopen (infilename, "rb")) == NULL) {
- strcpy (error, "can't open file");
- return NULL;
- }
-
- if (wv_id != stdin && (flags & OPEN_WVC)) {
- char *in2filename = malloc (strlen (infilename) + 10);
-
- strcpy (in2filename, infilename);
- strcat (in2filename, "c");
- wvc_id = fopen (in2filename, "rb");
- }
- else
- wvc_id = NULL;
-
- wpc = WavpackOpenFileInputEx (&freader, wv_id, wvc_id, error, flags, norm_offset);
-
- if (!wpc) {
- if (wv_id)
- fclose (wv_id);
-
- if (wvc_id)
- fclose (wvc_id);
- }
- else
- wpc->close_files = TRUE;
-
- return wpc;
-}
-
-#endif
-
-// This function is identical to WavpackOpenFileInput() except that instead
-// of providing a filename to open, the caller provides a pointer to a set of
-// reader callbacks and instances of up to two streams. The first of these
-// streams is required and contains the regular WavPack data stream; the second
-// contains the "correction" file if desired. Unlike the standard open
-// function which handles the correction file transparently, in this case it
-// is the responsibility of the caller to be aware of correction files.
-
-WavpackContext *WavpackOpenFileInputEx (stream_reader *reader, void *wv_id, void *wvc_id, char *error, int flags, int norm_offset)
-{
- WavpackContext *wpc = malloc (sizeof (WavpackContext));
- WavpackStream *wps;
- uchar first_byte;
- uint32_t bcount;
-
- if (!wpc) {
- strcpy (error, "can't allocate memory");
- return NULL;
- }
-
- CLEAR (*wpc);
- wpc->wv_in = wv_id;
- wpc->wvc_in = wvc_id;
- wpc->reader = reader;
- wpc->total_samples = (uint32_t) -1;
- wpc->norm_offset = norm_offset;
- wpc->open_flags = flags;
-
- wpc->filelen = wpc->reader->get_length (wpc->wv_in);
-
-#ifdef TAGS
- if ((flags & OPEN_TAGS) && wpc->reader->can_seek (wpc->wv_in)) {
- load_tag (wpc);
- wpc->reader->set_pos_abs (wpc->wv_in, 0);
- }
-#endif
-
-#ifdef VER3
- if (wpc->reader->read_bytes (wpc->wv_in, &first_byte, 1) != 1) {
- strcpy (error, "can't read all of WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- wpc->reader->push_back_byte (wpc->wv_in, first_byte);
-
- if (first_byte == 'R')
- return open_file3 (wpc, error);
-#endif
-
- wpc->streams [0] = wps = malloc (sizeof (WavpackStream));
- wpc->num_streams = 1;
- CLEAR (*wps);
-
- while (!wps->wphdr.block_samples) {
-
- wpc->filepos = wpc->reader->get_pos (wpc->wv_in);
- bcount = read_next_header (wpc->reader, wpc->wv_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1) {
- strcpy (error, "not compatible with this version of WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- wpc->filepos += bcount;
- wps->blockbuff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->blockbuff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wv_in, wps->blockbuff + 32, wps->wphdr.ckSize - 24) != wps->wphdr.ckSize - 24) {
- strcpy (error, "can't read all of WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- if ((wps->wphdr.flags & UNKNOWN_FLAGS) || wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) {
- strcpy (error, "not compatible with this version of WavPack file!");
- return WavpackCloseFile (wpc);
- }
-
- if (wps->wphdr.block_samples && !(flags & OPEN_STREAMING)) {
- if (wps->wphdr.total_samples == (uint32_t) -1 && wpc->reader->can_seek (wpc->wv_in)) {
- uint32_t pos_save = wpc->reader->get_pos (wpc->wv_in);
- uint32_t final_index = seek_final_index (wpc->reader, wpc->wv_in);
-
- if (final_index != (uint32_t) -1)
- wpc->total_samples = final_index - wps->wphdr.block_index;
-
- wpc->reader->set_pos_abs (wpc->wv_in, pos_save);
- }
- else
- wpc->total_samples = wps->wphdr.total_samples;
- }
-
- if (wpc->wvc_in && wps->wphdr.block_samples && (wps->wphdr.flags & HYBRID_FLAG)) {
- wpc->file2len = wpc->reader->get_length (wpc->wvc_in);
- wpc->wvc_flag = TRUE;
- }
-
- if (wpc->wvc_flag) {
- wpc->file2pos = wpc->reader->get_pos (wpc->wvc_in);
- bcount = read_next_header (wpc->reader, wpc->wvc_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1) {
- strcpy (error, "problem with correction file");
- return WavpackCloseFile (wpc);
- }
-
- wpc->file2pos += bcount;
- wps->block2buff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->block2buff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wvc_in, wps->block2buff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24) {
- strcpy (error, "can't read all of WavPack file!");
- return WavpackCloseFile (wpc);
- }
- }
-
- if (!unpack_init (wpc)) {
- strcpy (error, wpc->error_message [0] ? wpc->error_message :
- "not compatible with this version of WavPack file!");
-
- return WavpackCloseFile (wpc);
- }
- }
-
- wpc->config.flags &= ~0xff;
- wpc->config.flags |= wps->wphdr.flags & 0xff;
- wpc->config.bytes_per_sample = (wps->wphdr.flags & BYTES_STORED) + 1;
- wpc->config.float_norm_exp = wps->float_norm_exp;
-
- wpc->config.bits_per_sample = (wpc->config.bytes_per_sample * 8) -
- ((wps->wphdr.flags & SHIFT_MASK) >> SHIFT_LSB);
-
- if (!wpc->config.sample_rate) {
- if (!wps || !wps->wphdr.block_samples || (wps->wphdr.flags & SRATE_MASK) == SRATE_MASK)
- wpc->config.sample_rate = 44100;
- else
- wpc->config.sample_rate = sample_rates [(wps->wphdr.flags & SRATE_MASK) >> SRATE_LSB];
- }
-
- if (!wpc->config.num_channels) {
- wpc->config.num_channels = (wps->wphdr.flags & MONO_FLAG) ? 1 : 2;
- wpc->config.channel_mask = 0x5 - wpc->config.num_channels;
- }
-
- if ((flags & OPEN_2CH_MAX) && !(wps->wphdr.flags & FINAL_BLOCK))
- wpc->reduced_channels = (wps->wphdr.flags & MONO_FLAG) ? 1 : 2;
-
- return wpc;
-}
-
-// This function obtains general information about an open file and returns
-// a mask with the following bit values:
-
-// MODE_WVC: a .wvc file has been found and will be used for lossless
-// MODE_LOSSLESS: file is lossless (either pure or hybrid)
-// MODE_HYBRID: file is hybrid mode (either lossy or lossless)
-// MODE_FLOAT: audio data is 32-bit ieee floating point
-// MODE_VALID_TAG: file conatins a valid ID3v1 or APEv2 tag
-// MODE_HIGH: file was created in "high" mode (information only)
-// MODE_FAST: file was created in "fast" mode (information only)
-// MODE_EXTRA: file was created using "extra" mode (information only)
-// MODE_APETAG: file contains a valid APEv2 tag
-// MODE_SFX: file was created as a "self-extracting" executable
-
-int WavpackGetMode (WavpackContext *wpc)
-{
- int mode = 0;
-
- if (wpc) {
- if (wpc->config.flags & CONFIG_HYBRID_FLAG)
- mode |= MODE_HYBRID;
- else if (!(wpc->config.flags & CONFIG_LOSSY_MODE))
- mode |= MODE_LOSSLESS;
-
- if (wpc->wvc_flag)
- mode |= (MODE_LOSSLESS | MODE_WVC);
-
- if (wpc->lossy_blocks)
- mode &= ~MODE_LOSSLESS;
-
- if (wpc->config.flags & CONFIG_FLOAT_DATA)
- mode |= MODE_FLOAT;
-
- if (wpc->config.flags & CONFIG_HIGH_FLAG)
- mode |= MODE_HIGH;
-
- if (wpc->config.flags & CONFIG_FAST_FLAG)
- mode |= MODE_FAST;
-
- if (wpc->config.flags & CONFIG_EXTRA_MODE)
- mode |= MODE_EXTRA;
-
- if (wpc->config.flags & CONFIG_CREATE_EXE)
- mode |= MODE_SFX;
-
-#ifdef TAGS
- if (valid_tag (&wpc->m_tag)) {
- mode |= MODE_VALID_TAG;
-
- if (valid_tag (&wpc->m_tag) == 'A')
- mode |= MODE_APETAG;
- }
-#endif
- }
-
- return mode;
-}
-
-// This function returns the major version number of the WavPack program
-// (or library) that created the open file. Currently, this can be 1 to 4.
-// Minor versions are not recorded in WavPack files.
-
-int WavpackGetVersion (WavpackContext *wpc)
-{
- if (wpc) {
-#ifdef VER3
- if (wpc->stream3)
- return get_version3 (wpc);
-#endif
- return 4;
- }
-
- return 0;
-}
-
-#endif
-
-#ifdef UNPACK
-
-// Unpack the specified number of samples from the current file position.
-// Note that "samples" here refers to "complete" samples, which would be
-// 2 longs for stereo files or even more for multichannel files, so the
-// required memory at "buffer" is 4 * samples * num_channels bytes. The
-// audio data is returned right-justified in 32-bit longs in the endian
-// mode native to the executing processor. So, if the original data was
-// 16-bit, then the values returned would be +/-32k. Floating point data
-// can also be returned if the source was floating point data (and this
-// can be optionally normalized to +/-1.0 by using the appropriate flag
-// in the call to WavpackOpenFileInput ()). The actual number of samples
-// unpacked is returned, which should be equal to the number requested unless
-// the end of fle is encountered or an error occurs.
-
-uint32_t WavpackUnpackSamples (WavpackContext *wpc, int32_t *buffer, uint32_t samples)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream = 0];
- uint32_t bcount, samples_unpacked = 0, samples_to_unpack;
- int num_channels = wpc->config.num_channels;
-
-#ifdef VER3
- if (wpc->stream3)
- return unpack_samples3 (wpc, buffer, samples);
-#endif
-
- while (samples) {
- if (!wps->wphdr.block_samples || !(wps->wphdr.flags & INITIAL_BLOCK) ||
- wps->sample_index >= wps->wphdr.block_index + wps->wphdr.block_samples) {
- free_streams (wpc);
- wpc->filepos = wpc->reader->get_pos (wpc->wv_in);
- bcount = read_next_header (wpc->reader, wpc->wv_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1)
- break;
-
- if (wpc->open_flags & OPEN_STREAMING)
- wps->wphdr.block_index = wps->sample_index = 0;
-
- wpc->filepos += bcount;
- wps->blockbuff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->blockbuff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wv_in, wps->blockbuff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24) {
- strcpy (wpc->error_message, "can't read all of WavPack file!");
- break;
- }
-
- if (wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) {
- strcpy (wpc->error_message, "not compatible with this version of WavPack file!");
- break;
- }
-
- if (wps->wphdr.block_samples && wpc->wvc_flag) {
- wpc->file2pos = wpc->reader->get_pos (wpc->wvc_in);
- bcount = read_next_header (wpc->reader, wpc->wvc_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1)
- break;
-
- if (wpc->open_flags & OPEN_STREAMING)
- wps->wphdr.block_index = wps->sample_index = 0;
-
- wpc->file2pos += bcount;
- wps->block2buff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->block2buff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wvc_in, wps->block2buff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24)
- break;
- }
-
- if (!wps->wphdr.block_samples || wps->sample_index == wps->wphdr.block_index)
- if (!unpack_init (wpc))
- break;
- }
-
- if (!wps->wphdr.block_samples || !(wps->wphdr.flags & INITIAL_BLOCK) ||
- wps->sample_index >= wps->wphdr.block_index + wps->wphdr.block_samples)
- continue;
-
- if (wps->sample_index < wps->wphdr.block_index) {
- samples_to_unpack = wps->wphdr.block_index - wps->sample_index;
-
- if (samples_to_unpack > samples)
- samples_to_unpack = samples;
-
- wps->sample_index += samples_to_unpack;
- samples_unpacked += samples_to_unpack;
- samples -= samples_to_unpack;
-
- if (wpc->reduced_channels)
- samples_to_unpack *= wpc->reduced_channels;
- else
- samples_to_unpack *= num_channels;
-
- while (samples_to_unpack--)
- *buffer++ = 0;
-
- continue;
- }
-
- samples_to_unpack = wps->wphdr.block_index + wps->wphdr.block_samples - wps->sample_index;
-
- if (samples_to_unpack > samples)
- samples_to_unpack = samples;
-
- if (!wpc->reduced_channels && !(wps->wphdr.flags & FINAL_BLOCK)) {
- int32_t *temp_buffer = malloc (samples_to_unpack * 8), *src, *dst;
- int offset = 0;
- uint32_t samcnt;
-
- while (1) {
- if (wpc->current_stream == wpc->num_streams) {
- wps = wpc->streams [wpc->num_streams++] = malloc (sizeof (WavpackStream));
- CLEAR (*wps);
- bcount = read_next_header (wpc->reader, wpc->wv_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1)
- break;
-
- if (wpc->open_flags & OPEN_STREAMING)
- wps->wphdr.block_index = wps->sample_index = 0;
-
- wps->blockbuff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->blockbuff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wv_in, wps->blockbuff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24) {
- strcpy (wpc->error_message, "can't read all of WavPack file!");
- break;
- }
-
- if (wpc->wvc_flag) {
- bcount = read_next_header (wpc->reader, wpc->wvc_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1)
- break;
-
- if (wpc->open_flags & OPEN_STREAMING)
- wps->wphdr.block_index = wps->sample_index = 0;
-
- wps->block2buff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->block2buff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wvc_in, wps->block2buff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24)
- break;
- }
-
- if (!unpack_init (wpc))
- break;
- }
- else
- wps = wpc->streams [wpc->current_stream];
-
- unpack_samples (wpc, src = temp_buffer, samples_to_unpack);
- samcnt = samples_to_unpack;
- dst = buffer + offset;
-
- if (wps->wphdr.flags & MONO_FLAG) {
- while (samcnt--) {
- dst [0] = *src++;
- dst += num_channels;
- }
-
- offset++;
- }
- else {
- while (samcnt--) {
- dst [0] = *src++;
- dst [1] = *src++;
- dst += num_channels;
- }
-
- offset += 2;
- }
-
- if (wps->wphdr.flags & FINAL_BLOCK)
- break;
- else
- wpc->current_stream++;
- }
-
- wps = wpc->streams [wpc->current_stream = 0];
- free (temp_buffer);
- }
- else
- unpack_samples (wpc, buffer, samples_to_unpack);
-
- if (wpc->reduced_channels)
- buffer += samples_to_unpack * wpc->reduced_channels;
- else
- buffer += samples_to_unpack * num_channels;
-
- samples_unpacked += samples_to_unpack;
- samples -= samples_to_unpack;
-
- if (wps->sample_index == wps->wphdr.block_index + wps->wphdr.block_samples) {
- if (check_crc_error (wpc) && wps->blockbuff) {
-
- if (wpc->reader->can_seek (wpc->wv_in)) {
- int32_t rseek = ((WavpackHeader *) wps->blockbuff)->ckSize / 3;
- wpc->reader->set_pos_rel (wpc->wv_in, (rseek > 16384) ? -16384 : -rseek, SEEK_CUR);
- }
-
- if (wpc->wvc_flag && wps->block2buff && wpc->reader->can_seek (wpc->wvc_in)) {
- int32_t rseek = ((WavpackHeader *) wps->block2buff)->ckSize / 3;
- wpc->reader->set_pos_rel (wpc->wvc_in, (rseek > 16384) ? -16384 : -rseek, SEEK_CUR);
- }
-
- wpc->crc_errors++;
- }
- }
-
- if (wps->sample_index == wpc->total_samples)
- break;
- }
-
- return samples_unpacked;
-}
-
-#ifdef SEEKING
-
-static uint32_t find_sample (WavpackContext *wpc, void *infile, uint32_t header_pos, uint32_t sample);
-
-// Seek to the specifed sample index, returning TRUE on success. Note that
-// files generated with version 4.0 or newer will seek almost immediately.
-// Older files can take quite long if required to seek through unplayed
-// portions of the file, but will create a seek map so that reverse seeks
-// (or forward seeks to already scanned areas) will be very fast.
-
-int WavpackSeekSample (WavpackContext *wpc, uint32_t sample)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream = 0];
- uint32_t bcount, samples_to_skip;
- int32_t *buffer;
-
- if (wpc->total_samples == (uint32_t) -1 || sample >= wpc->total_samples ||
- !wpc->reader->can_seek (wpc->wv_in) || (wpc->open_flags & OPEN_STREAMING) ||
- (wpc->wvc_flag && !wpc->reader->can_seek (wpc->wvc_in)))
- return FALSE;
-
-#ifdef VER3
- if (wpc->stream3)
- return seek_sample3 (wpc, sample);
-#endif
-
- if (!wps->wphdr.block_samples || !(wps->wphdr.flags & INITIAL_BLOCK) || sample < wps->wphdr.block_index ||
- sample >= wps->wphdr.block_index + wps->wphdr.block_samples) {
-
- free_streams (wpc);
- wpc->filepos = find_sample (wpc, wpc->wv_in, wpc->filepos, sample);
-
- if (wpc->filepos == (uint32_t) -1)
- return FALSE;
-
- if (wpc->wvc_flag) {
- wpc->file2pos = find_sample (wpc, wpc->wvc_in, 0, sample);
-
- if (wpc->file2pos == (uint32_t) -1)
- return FALSE;
- }
- }
-
- if (!wps->blockbuff) {
- wpc->reader->set_pos_abs (wpc->wv_in, wpc->filepos);
- wpc->reader->read_bytes (wpc->wv_in, &wps->wphdr, sizeof (WavpackHeader));
- little_endian_to_native (&wps->wphdr, WavpackHeaderFormat);
- wps->blockbuff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->blockbuff, &wps->wphdr, sizeof (WavpackHeader));
-
- if (wpc->reader->read_bytes (wpc->wv_in, wps->blockbuff + sizeof (WavpackHeader), wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24) {
- free_streams (wpc);
- return FALSE;
- }
-
- if (wpc->wvc_flag) {
- wpc->reader->set_pos_abs (wpc->wvc_in, wpc->file2pos);
- wpc->reader->read_bytes (wpc->wvc_in, &wps->wphdr, sizeof (WavpackHeader));
- little_endian_to_native (&wps->wphdr, WavpackHeaderFormat);
- wps->block2buff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->block2buff, &wps->wphdr, sizeof (WavpackHeader));
-
- if (wpc->reader->read_bytes (wpc->wvc_in, wps->block2buff + sizeof (WavpackHeader), wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24) {
- free_streams (wpc);
- return FALSE;
- }
- }
-
- if (!unpack_init (wpc)) {
- free_streams (wpc);
- return FALSE;
- }
- }
-
- while (!wpc->reduced_channels && !(wps->wphdr.flags & FINAL_BLOCK)) {
- if (++wpc->current_stream == wpc->num_streams) {
- wps = wpc->streams [wpc->num_streams++] = malloc (sizeof (WavpackStream));
- CLEAR (*wps);
- bcount = read_next_header (wpc->reader, wpc->wv_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1)
- break;
-
- wps->blockbuff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->blockbuff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wv_in, wps->blockbuff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24) {
- strcpy (wpc->error_message, "can't read all of WavPack file!");
- break;
- }
-
- if (wpc->wvc_flag) {
- bcount = read_next_header (wpc->reader, wpc->wvc_in, &wps->wphdr);
-
- if (bcount == (uint32_t) -1)
- break;
-
- wps->block2buff = malloc (wps->wphdr.ckSize + 8);
- memcpy (wps->block2buff, &wps->wphdr, 32);
-
- if (wpc->reader->read_bytes (wpc->wvc_in, wps->block2buff + 32, wps->wphdr.ckSize - 24) !=
- wps->wphdr.ckSize - 24)
- break;
- }
-
- if (!unpack_init (wpc))
- break;
- }
- else
- wps = wpc->streams [wpc->current_stream];
- }
-
- if (sample < wps->sample_index)
- for (wpc->current_stream = 0; wpc->current_stream < wpc->num_streams; wpc->current_stream++)
- if (!unpack_init (wpc))
- return FALSE;
-
- samples_to_skip = sample - wps->sample_index;
-
- if (samples_to_skip) {
- buffer = malloc (samples_to_skip * 8);
-
- for (wpc->current_stream = 0; wpc->current_stream < wpc->num_streams; wpc->current_stream++)
- unpack_samples (wpc, buffer, samples_to_skip);
-
- free (buffer);
- }
-
- wpc->current_stream = 0;
- return TRUE;
-}
-
-#endif
-
-#ifdef TAGS
-
-// Attempt to get the specified item from the specified ID3v1 or APEv2 tag.
-// The "size" parameter specifies the amount of space available at "value",
-// if the desired item will not fit in this space then ellipses (...) will
-// be appended and the string terminated. Only text data are supported.
-
-static void tagcpy (char *dest, char *src, int tag_size);
-
-int WavpackGetTagItem (WavpackContext *wpc, const char *item, char *value, int size)
-{
- M_Tag *m_tag = &wpc->m_tag;
- char *lvalue = NULL;
-
- if (value)
- *value = 0;
-
- if (m_tag->ape_tag_hdr.ID [0] == 'A') {
- char *p = m_tag->ape_tag_data;
- char *q = p + m_tag->ape_tag_hdr.length - sizeof (APE_Tag_Hdr);
- int i;
-
- for (i = 0; i < m_tag->ape_tag_hdr.item_count; ++i) {
- int vsize, flags, isize;
-
- vsize = * (int32_t *) p; p += 4;
- flags = * (int32_t *) p; p += 4;
- isize = strlen (p);
-
- little_endian_to_native (&vsize, "L");
- little_endian_to_native (&flags, "L");
-
- if (p + isize + vsize + 1 > q)
- break;
-
- if (isize && vsize && !stricmp (item, p) && !(flags & 6)) {
-
- if ((lvalue = malloc (vsize + 1)) != NULL) {
- strncpy (lvalue, p + isize + 1, vsize);
- lvalue [vsize] = 0;
- }
-
- break;
- }
- else
- p += isize + vsize + 1;
- }
- }
- else if (m_tag->id3_tag.tag_id [0] == 'T') {
- if ((lvalue = malloc (128)) == NULL)
- return FALSE;
-
- lvalue [0] = 0;
-
- if (!stricmp (item, "title"))
- tagcpy (lvalue, m_tag->id3_tag.title, sizeof (m_tag->id3_tag.title));
- else if (!stricmp (item, "artist"))
- tagcpy (lvalue, m_tag->id3_tag.artist, sizeof (m_tag->id3_tag.artist));
- else if (!stricmp (item, "album"))
- tagcpy (lvalue, m_tag->id3_tag.album, sizeof (m_tag->id3_tag.album));
- else if (!stricmp (item, "year"))
- tagcpy (lvalue, m_tag->id3_tag.year, sizeof (m_tag->id3_tag.year));
- else if (!stricmp (item, "comment"))
- tagcpy (lvalue, m_tag->id3_tag.comment, sizeof (m_tag->id3_tag.title));
-
- if (!lvalue [0]) {
- free (lvalue);
- return FALSE;
- }
- }
- else
- return FALSE;
-
- if (lvalue) {
- if (value && size >= 4) {
- if (strlen (lvalue) >= size) {
- lvalue [size - 4] = lvalue [size - 3] = lvalue [size - 2] = '.';
- lvalue [size - 1] = 0;
- }
-
- strcpy (value, lvalue);
- }
-
- free (lvalue);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-#endif
-
-#endif
-
-#ifdef PACK
-
-// Open context for writing WavPack files. The returned context pointer is used
-// in all following calls to the library. The "blockout" function will be used
-// to store the actual completed WavPack blocks and will be called with the id
-// pointers containing user defined data (one for the wv file and one for the
-// wvc file). A return value of NULL indicates that memory could not be
-// allocated for the context.
-
-WavpackContext *WavpackOpenFileOutput (blockout_f blockout, void *wv_id, void *wvc_id)
-{
- WavpackContext *wpc = malloc (sizeof (WavpackContext));
-
- if (!wpc)
- return NULL;
-
- CLEAR (*wpc);
- wpc->blockout = blockout;
- wpc->wv_out = wv_id;
- wpc->wvc_out = wvc_id;
- return wpc;
-}
-
-// Set configuration for writing WavPack files. This must be done before
-// sending any actual samples, however it is okay to send wrapper or other
-// metadata before calling this. The "config" structure contains the following
-// required information:
-
-// config->bytes_per_sample see WavpackGetBytesPerSample() for info
-// config->bits_per_sample see WavpackGetBitsPerSample() for info
-// config->channel_mask Microsoft standard (mono = 4, stereo = 3)
-// config->num_channels self evident
-// config->sample_rate self evident
-
-// In addition, the following fields and flags may be set:
-
-// config->flags:
-// --------------
-// o CONFIG_HYBRID_FLAG select hybrid mode (must set bitrate)
-// o CONFIG_JOINT_STEREO select joint stereo (must set override also)
-// o CONFIG_JOINT_OVERRIDE override default joint stereo selection
-// o CONFIG_HYBRID_SHAPE select hybrid noise shaping (set override &
-// shaping_weight != 0.0)
-// o CONFIG_SHAPE_OVERRIDE override default hybrid noise shaping
-// (set CONFIG_HYBRID_SHAPE and shaping_weight)
-// o CONFIG_FAST_FLAG "fast" compression mode
-// o CONFIG_HIGH_FLAG "high" compression mode
-// o CONFIG_BITRATE_KBPS hybrid bitrate is kbps, not bits / sample
-// o CONFIG_CREATE_WVC create correction file
-// o CONFIG_OPTIMIZE_WVC maximize bybrid compression (-cc option)
-// o CONFIG_CALC_NOISE calc noise in hybrid mode
-// o CONFIG_EXTRA_MODE extra processing mode (slow!)
-// o CONFIG_SKIP_WVX no wvx stream for floats & large ints
-
-// config->bitrate hybrid bitrate in either bits/sample or kbps
-// config->shaping_weight hybrid noise shaping coefficient override
-// config->block_samples force samples per WavPack block (0 = use deflt)
-// config->float_norm_exp select floating-point data (127 for +/-1.0)
-// config->xmode extra mode processing value override
-
-// If the number of samples to be written is known then it should be passed
-// here. If the duration is not known then pass -1. In the case that the size
-// is not known (or the writing is terminated early) then it is suggested that
-// the application retrieve the first block written and let the library update
-// the total samples indication. A function is provided to do this update and
-// it should be done to the "correction" file also. If this cannot be done
-// (because a pipe is being used, for instance) then a valid WavPack will still
-// be created, but when applications want to access that file they will have
-// to seek all the way to the end to determine the actual duration. Also, if
-// a RIFF header has been included then it should be updated as well or the
-// WavPack file will not be directly unpackable to a valid wav file (although
-// it will still be usable by itself). A return of FALSE indicates an error.
-
-static const uint32_t xtable [] = { 123, 3, 27, 59, 123, 187, 251 };
-static const uint32_t f_xtable [] = { 251, 3, 27, 59, 123, 187, 251 };
-static const uint32_t h_xtable [] = { 91, 3, 27, 91, 123, 187, 251 };
-
-int WavpackSetConfiguration (WavpackContext *wpc, WavpackConfig *config, uint32_t total_samples)
-{
- uint32_t flags = (config->bytes_per_sample - 1), bps = 0, shift = 0;
- uint32_t chan_mask = config->channel_mask;
- int num_chans = config->num_channels;
- int i;
-
- wpc->total_samples = total_samples;
- wpc->config.sample_rate = config->sample_rate;
- wpc->config.num_channels = config->num_channels;
- wpc->config.channel_mask = config->channel_mask;
- wpc->config.bits_per_sample = config->bits_per_sample;
- wpc->config.bytes_per_sample = config->bytes_per_sample;
- wpc->config.block_samples = config->block_samples;
- wpc->config.flags = config->flags;
-
- if (config->float_norm_exp) {
- wpc->config.float_norm_exp = config->float_norm_exp;
- flags |= FLOAT_DATA;
- }
- else
- shift = (config->bytes_per_sample * 8) - config->bits_per_sample;
-
- for (i = 0; i < 15; ++i)
- if (wpc->config.sample_rate == sample_rates [i])
- break;
-
- flags |= i << SRATE_LSB;
- flags |= shift << SHIFT_LSB;
-
- if (config->flags & CONFIG_HYBRID_FLAG) {
- flags |= HYBRID_FLAG | HYBRID_BITRATE | HYBRID_BALANCE;
-
- if (!(wpc->config.flags & CONFIG_SHAPE_OVERRIDE)) {
- wpc->config.flags |= CONFIG_HYBRID_SHAPE | CONFIG_AUTO_SHAPING;
- flags |= HYBRID_SHAPE | NEW_SHAPING;
- }
- else if (wpc->config.flags & CONFIG_HYBRID_SHAPE) {
- wpc->config.shaping_weight = config->shaping_weight;
- flags |= HYBRID_SHAPE | NEW_SHAPING;
- }
-
- if (wpc->config.flags & CONFIG_OPTIMIZE_WVC)
- flags |= CROSS_DECORR;
-
- if (config->flags & CONFIG_BITRATE_KBPS) {
- bps = floor (config->bitrate * 256000.0 / config->sample_rate / config->num_channels + 0.5);
-
- if (bps > (64 << 8))
- bps = 64 << 8;
- }
- else
- bps = floor (config->bitrate * 256.0 + 0.5);
- }
- else
- flags |= CROSS_DECORR;
-
- if (!(config->flags & CONFIG_JOINT_OVERRIDE) || (config->flags & CONFIG_JOINT_STEREO))
- flags |= JOINT_STEREO;
-
- if (config->flags & CONFIG_CREATE_WVC)
- wpc->wvc_flag = TRUE;
-
- for (wpc->current_stream = 0; num_chans; wpc->current_stream++) {
- WavpackStream *wps = malloc (sizeof (WavpackStream));
- uint32_t stereo_mask, mono_mask;
- int pos, chans;
-
- wpc->streams [wpc->current_stream] = wps;
- CLEAR (*wps);
-
- for (pos = 1; pos <= 18; ++pos) {
- stereo_mask = 3 << (pos - 1);
- mono_mask = 1 << (pos - 1);
-
- if ((chan_mask & stereo_mask) == stereo_mask && (mono_mask & 0x251)) {
- chan_mask &= ~stereo_mask;
- chans = 2;
- break;
- }
- else if (chan_mask & mono_mask) {
- chan_mask &= ~mono_mask;
- chans = 1;
- break;
- }
- }
-
- if (pos == 19)
- chans = num_chans > 1 ? 2 : 1;
-
- num_chans -= chans;
-
- if (num_chans && wpc->current_stream == MAX_STREAMS - 1)
- break;
-
- memcpy (wps->wphdr.ckID, "wvpk", 4);
- wps->wphdr.ckSize = sizeof (WavpackHeader) - 8;
- wps->wphdr.total_samples = wpc->total_samples;
- wps->wphdr.version = 0x403;
- wps->wphdr.flags = flags;
- wps->bits = bps;
-
- if (!wpc->current_stream)
- wps->wphdr.flags |= INITIAL_BLOCK;
-
- if (!num_chans)
- wps->wphdr.flags |= FINAL_BLOCK;
-
- if (chans == 1) {
- wps->wphdr.flags &= ~(JOINT_STEREO | CROSS_DECORR | HYBRID_BALANCE);
- wps->wphdr.flags |= MONO_FLAG;
- }
- }
-
- wpc->num_streams = wpc->current_stream;
- wpc->current_stream = 0;
-
- if (num_chans) {
- strcpy (wpc->error_message, "too many channels!");
- return FALSE;
- }
-
- if (config->flags & CONFIG_EXTRA_MODE) {
-
- if (config->flags & CONFIG_HIGH_FLAG)
- wpc->config.extra_flags = h_xtable [config->xmode];
- else if (config->flags & CONFIG_FAST_FLAG)
- wpc->config.extra_flags = f_xtable [config->xmode];
- else
- wpc->config.extra_flags = xtable [config->xmode];
-
- if (config->flags & CONFIG_JOINT_OVERRIDE)
- wpc->config.extra_flags &= ~EXTRA_STEREO_MODES;
- }
-
- return TRUE;
-}
-
-// Prepare to actually pack samples by determining the size of the WavPack
-// blocks and allocating sample buffers and initializing each stream. Call
-// after WavpackSetConfiguration() and before WavpackPackSamples(). A return
-// of FALSE indicates an error.
-
-int WavpackPackInit (WavpackContext *wpc)
-{
- if (wpc->metabytes > 4096)
- write_metadata_block (wpc);
-
- if (wpc->config.block_samples)
- wpc->block_samples = wpc->config.block_samples;
- else {
- if (wpc->config.flags & CONFIG_HIGH_FLAG)
- wpc->block_samples = wpc->config.sample_rate;
-// else if ((wpc->config.flags & CONFIG_FAST_FLAG) && !(wpc->config.sample_rate % 4))
-// wpc->block_samples = wpc->config.sample_rate / 4;
- else if (!(wpc->config.sample_rate % 2))
- wpc->block_samples = wpc->config.sample_rate / 2;
- else
- wpc->block_samples = wpc->config.sample_rate;
-
- while (wpc->block_samples * wpc->config.num_channels > 100000)
- wpc->block_samples /= 2;
-
- while (wpc->block_samples * wpc->config.num_channels < 40000)
- wpc->block_samples *= 2;
- }
-
- wpc->max_samples = wpc->block_samples + (wpc->block_samples >> 1);
-
- for (wpc->current_stream = 0; wpc->streams [wpc->current_stream]; wpc->current_stream++) {
- WavpackStream *wps = wpc->streams [wpc->current_stream];
-
- wps->sample_buffer = malloc (wpc->max_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
- pack_init (wpc);
- }
-
- return TRUE;
-}
-
-// Pack the specified samples. Samples must be stored in longs in the native
-// endian format of the executing processor. The number of samples specified
-// indicates composite samples (sometimes called "frames"). So, the actual
-// number of data points would be this "sample_count" times the number of
-// channels. Note that samples are accumulated here until enough exist to
-// create a complete WavPack block (or several blocks for multichannel audio).
-// If an application wants to break a block at a specific sample, then it must
-// simply call WavpackFlushSamples() to force an early termination. Completed
-// WavPack blocks are send to the function provided in the initial call to
-// WavpackOpenFileOutput(). A return of FALSE indicates an error.
-
-static int pack_streams (WavpackContext *wpc, uint32_t block_samples);
-
-int WavpackPackSamples (WavpackContext *wpc, int32_t *sample_buffer, uint32_t sample_count)
-{
- int nch = wpc->config.num_channels;
-
- while (sample_count) {
- int32_t *source_pointer = sample_buffer;
- uint samples_to_copy;
-
- if (wpc->acc_samples + sample_count > wpc->max_samples)
- samples_to_copy = wpc->max_samples - wpc->acc_samples;
- else
- samples_to_copy = sample_count;
-
- for (wpc->current_stream = 0; wpc->streams [wpc->current_stream]; wpc->current_stream++) {
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- int32_t *dptr, *sptr, cnt;
-
- dptr = wps->sample_buffer + wpc->acc_samples * (wps->wphdr.flags & MONO_FLAG ? 1 : 2);
- sptr = source_pointer;
- cnt = samples_to_copy;
-
- if (wps->wphdr.flags & MONO_FLAG) {
- while (cnt--) {
- *dptr++ = *sptr;
- sptr += nch;
- }
-
- source_pointer++;
- }
- else {
- while (cnt--) {
- *dptr++ = sptr [0];
- *dptr++ = sptr [1];
- sptr += nch;
- }
-
- source_pointer += 2;
- }
- }
-
- sample_buffer += samples_to_copy * nch;
- sample_count -= samples_to_copy;
-
- if ((wpc->acc_samples += samples_to_copy) == wpc->max_samples &&
- !pack_streams (wpc, wpc->block_samples))
- return FALSE;
- }
-
- return TRUE;
-}
-
-// Flush all accumulated samples into WavPack blocks. This is normally called
-// after all samples have been sent to WavpackPackSamples(), but can also be
-// called to terminate a WavPack block at a specific sample (in other words it
-// is possible to continue after this operation). This is also called to
-// dump non-audio blocks like those holding metadata for various purposes.
-// A return of FALSE indicates an error.
-
-int WavpackFlushSamples (WavpackContext *wpc)
-{
- while (wpc->acc_samples) {
- uint32_t block_samples;
-
- if (wpc->acc_samples > wpc->block_samples)
- block_samples = wpc->acc_samples / 2;
- else
- block_samples = wpc->acc_samples;
-
- if (!pack_streams (wpc, block_samples))
- return FALSE;
- }
-
- if (wpc->metacount)
- write_metadata_block (wpc);
-
- return TRUE;
-}
-
-// Add wrapper (currently RIFF only) to WavPack blocks. This should be called
-// before sending any audio samples for the RIFF header or after all samples
-// have been sent for any RIFF trailer. WavpackFlushSamples() should be called
-// between sending the last samples and calling this for trailer data to make
-// sure that headers and trailers don't get mixed up in very short files. If
-// the exact contents of the RIFF header are not known because, for example,
-// the file duration is uncertain or trailing chunks are possible, simply write
-// a "dummy" header of the correct length. When all data has been written it
-// will be possible to read the first block written and update the header
-// directly. An example of this can be found in the Audition filter. A
-// return of FALSE indicates an error.
-
-int WavpackAddWrapper (WavpackContext *wpc, void *data, uint32_t bcount)
-{
- uint32_t index = WavpackGetSampleIndex (wpc);
-
- return add_to_metadata (wpc, data, bcount,
- (uchar)((!index || index == (uint32_t) -1) ? ID_RIFF_HEADER : ID_RIFF_TRAILER));
-}
-
-// Store computed MD5 sum in WavPack metadata. Note that the user must compute
-// the 16 byte sum; it is not done here. A return of FALSE indicates an error.
-
-int WavpackStoreMD5Sum (WavpackContext *wpc, uchar data [16])
-{
- return add_to_metadata (wpc, data, 16, ID_MD5_CHECKSUM);
-}
-
-static int pack_streams (WavpackContext *wpc, uint32_t block_samples)
-{
- uint32_t max_blocksize = block_samples * 10 + 4096, bcount;
- uchar *outbuff, *outend, *out2buff, *out2end;
- int result;
-
- out2buff = (wpc->wvc_flag) ? malloc (max_blocksize) : NULL;
- out2end = out2buff + max_blocksize;
- outbuff = malloc (max_blocksize);
- outend = outbuff + max_blocksize;
-
- for (wpc->current_stream = 0; wpc->streams [wpc->current_stream]; wpc->current_stream++) {
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t flags = wps->wphdr.flags;
-
- flags &= ~MAG_MASK;
- flags += (1 << MAG_LSB) * ((flags & BYTES_STORED) * 8 + 7);
-
- wps->wphdr.block_index = wps->sample_index;
- wps->wphdr.block_samples = block_samples;
- wps->wphdr.flags = flags;
- wps->block2buff = out2buff;
- wps->block2end = out2end;
- wps->blockbuff = outbuff;
- wps->blockend = outend;
-
- result = pack_block (wpc, wps->sample_buffer);
- wps->blockbuff = wps->block2buff = NULL;
-
- if (!result) {
- strcpy (wpc->error_message, "output buffer overflowed!");
- break;
- }
-
- bcount = ((WavpackHeader *) outbuff)->ckSize + 8;
- native_to_little_endian ((WavpackHeader *) outbuff, WavpackHeaderFormat);
- result = wpc->blockout (wpc->wv_out, outbuff, bcount);
-
- if (!result) {
- strcpy (wpc->error_message, "can't write WavPack data, disk probably full!");
- break;
- }
-
- wpc->filelen += bcount;
-
- if (out2buff) {
- bcount = ((WavpackHeader *) out2buff)->ckSize + 8;
- native_to_little_endian ((WavpackHeader *) out2buff, WavpackHeaderFormat);
- result = wpc->blockout (wpc->wvc_out, out2buff, bcount);
-
- if (!result) {
- strcpy (wpc->error_message, "can't write WavPack data, disk probably full!");
- break;
- }
-
- wpc->file2len += bcount;
- }
-
- if (wpc->acc_samples != block_samples)
- memcpy (wps->sample_buffer, wps->sample_buffer + block_samples * (flags & MONO_FLAG ? 1 : 2),
- (wpc->acc_samples - block_samples) * sizeof (int32_t) * (flags & MONO_FLAG ? 1 : 2));
- }
-
- wpc->current_stream = 0;
- wpc->acc_samples -= block_samples;
- free (outbuff);
-
- if (out2buff)
- free (out2buff);
-
- return result;
-}
-
-// Given the pointer to the first block written (to either a .wv or .wvc file),
-// update the block with the actual number of samples written. This should
-// be done if WavpackSetConfiguration() was called with an incorrect number
-// of samples (or -1). It is the responsibility of the application to read and
-// rewrite the block. An example of this can be found in the Audition filter.
-
-void WavpackUpdateNumSamples (WavpackContext *wpc, void *first_block)
-{
- little_endian_to_native (wpc, WavpackHeaderFormat);
- ((WavpackHeader *) first_block)->total_samples = WavpackGetSampleIndex (wpc);
- native_to_little_endian (wpc, WavpackHeaderFormat);
-}
-
-// Given the pointer to the first block written to a WavPack file, this
-// function returns the location of the stored RIFF header that was originally
-// written with WavpackAddWrapper(). This would normally be used to update
-// the wav header to indicate that a different number of samples was actually
-// written or if additional RIFF chunks are written at the end of the file.
-// It is the responsibility of the application to read and rewrite the block.
-// An example of this can be found in the Audition filter.
-
-void *WavpackGetWrapperLocation (void *first_block)
-{
- if (((uchar *) first_block) [32] == ID_RIFF_HEADER)
- return ((uchar *) first_block) + 34;
- else
- return NULL;
-}
-
-#ifdef TAGS
-
-// Limited functionality to append APEv2 tags to WavPack files when they are
-// created has been added for version 4.2. This function is used to append the
-// specified field to the tag being created. If no tag has been started, then
-// an empty one will be allocated first. When finished, use WavpackWriteTag()
-// to write the completed tag to the file. Note that ID3 tags are not
-// supported and that no editing of existing tags is allowed (there are several
-// fine libraries available for this).
-
-int WavpackAppendTagItem (WavpackContext *wpc, const char *item, const char *value)
-{
- M_Tag *m_tag = &wpc->m_tag;
- int vsize = strlen (value);
- int isize = strlen (item);
-
- if (!m_tag->ape_tag_hdr.ID [0]) {
- strncpy (m_tag->ape_tag_hdr.ID, "APETAGEX", sizeof (m_tag->ape_tag_hdr.ID));
- m_tag->ape_tag_hdr.version = 2000;
- m_tag->ape_tag_hdr.length = sizeof (m_tag->ape_tag_hdr);
- m_tag->ape_tag_hdr.item_count = 0;
- m_tag->ape_tag_hdr.flags = 0x80000000;
- }
-
- if (m_tag->ape_tag_hdr.ID [0] == 'A') {
- int new_item_len = vsize + isize + 9, flags = 0;
- char *p;
-
- m_tag->ape_tag_hdr.item_count++;
- m_tag->ape_tag_hdr.length += new_item_len;
- p = m_tag->ape_tag_data = realloc (m_tag->ape_tag_data, m_tag->ape_tag_hdr.length);
- p += m_tag->ape_tag_hdr.length - sizeof (APE_Tag_Hdr) - new_item_len;
- native_to_little_endian (&vsize, "L");
- native_to_little_endian (&flags, "L");
- * (int32_t *) p = vsize; p += 4;
- * (int32_t *) p = flags; p += 4;
- little_endian_to_native (&vsize, "L");
- little_endian_to_native (&flags, "L");
- strcpy (p, item);
- p += isize + 1;
- memcpy (p, value, vsize);
-
- return TRUE;
- }
- else
- return FALSE;
-}
-
-// Once a APEv2 tag has been created with WavpackAppendTag(), this function is
-// used to write the completed tag to the end of the WavPack file. Note that
-// this function uses the same "blockout" function that is used to write
-// regular WavPack blocks, although that's where the similarity ends.
-
-int WavpackWriteTag (WavpackContext *wpc)
-{
- M_Tag *m_tag = &wpc->m_tag;
- int result = TRUE;
-
- if (m_tag->ape_tag_hdr.ID [0] == 'A') {
- m_tag->ape_tag_hdr.flags |= 0x20000000;
- native_to_little_endian (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
- result = wpc->blockout (wpc->wv_out, &m_tag->ape_tag_hdr, sizeof (m_tag->ape_tag_hdr));
- little_endian_to_native (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
-
- if (m_tag->ape_tag_hdr.length > sizeof (m_tag->ape_tag_hdr))
- result = wpc->blockout (wpc->wv_out, m_tag->ape_tag_data, m_tag->ape_tag_hdr.length - sizeof (m_tag->ape_tag_hdr));
-
- m_tag->ape_tag_hdr.flags &= ~0x20000000;
- native_to_little_endian (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
- result = wpc->blockout (wpc->wv_out, &m_tag->ape_tag_hdr, sizeof (m_tag->ape_tag_hdr));
- little_endian_to_native (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
- }
- else if (m_tag->id3_tag.tag_id [0] == 'T')
- result = wpc->blockout (wpc->wv_out, &m_tag->id3_tag, sizeof (m_tag->id3_tag));
-
- if (!result)
- strcpy (wpc->error_message, "can't write WavPack data, disk probably full!");
-
- return result;
-}
-
-#endif
-
-#endif
-
-// Get total number of samples contained in the WavPack file, or -1 if unknown
-
-uint32_t WavpackGetNumSamples (WavpackContext *wpc)
-{
- return wpc ? wpc->total_samples : (uint32_t) -1;
-}
-
-// Get the current sample index position, or -1 if unknown
-
-uint32_t WavpackGetSampleIndex (WavpackContext *wpc)
-{
- if (wpc) {
-#ifdef VER3
- if (wpc->stream3)
- return get_sample_index3 (wpc);
- else if (wpc->streams [0])
- return wpc->streams [0]->sample_index;
-#else
- if (wpc->streams [0])
- return wpc->streams [0]->sample_index;
-#endif
- }
-
- return (uint32_t) -1;
-}
-
-// Get the number of errors encountered so far
-
-int WavpackGetNumErrors (WavpackContext *wpc)
-{
- return wpc ? wpc->crc_errors : 0;
-}
-
-// return TRUE if any uncorrected lossy blocks were actually written or read
-
-int WavpackLossyBlocks (WavpackContext *wpc)
-{
- return wpc ? wpc->lossy_blocks : 0;
-}
-
-// Calculate the progress through the file as a double from 0.0 (for begin)
-// to 1.0 (for done). A return value of -1.0 indicates that the progress is
-// unknown.
-
-double WavpackGetProgress (WavpackContext *wpc)
-{
- if (wpc && wpc->total_samples != (uint32_t) -1 && wpc->total_samples != 0)
- return (double) WavpackGetSampleIndex (wpc) / wpc->total_samples;
- else
- return -1.0;
-}
-
-// Return the total size of the WavPack file(s) in bytes.
-
-uint32_t WavpackGetFileSize (WavpackContext *wpc)
-{
- return wpc ? wpc->filelen + wpc->file2len : 0;
-}
-
-// Calculate the ratio of the specified WavPack file size to the size of the
-// original audio data as a double greater than 0.0 and (usually) smaller than
-// 1.0. A value greater than 1.0 represents "negative" compression and a
-// return value of 0.0 indicates that the ratio cannot be determined.
-
-double WavpackGetRatio (WavpackContext *wpc)
-{
- if (wpc && wpc->total_samples != (uint32_t) -1 && wpc->filelen) {
- double output_size = (double) wpc->total_samples * wpc->config.num_channels *
- wpc->config.bytes_per_sample;
- double input_size = (double) wpc->filelen + wpc->file2len;
-
- if (output_size >= 1.0 && input_size >= 1.0)
- return input_size / output_size;
- }
-
- return 0.0;
-}
-
-// Calculate the average bitrate of the WavPack file in bits per second. A
-// return of 0.0 indicates that the bitrate cannot be determined. An option is
-// provided to use (or not use) any attendant .wvc file.
-
-double WavpackGetAverageBitrate (WavpackContext *wpc, int count_wvc)
-{
- if (wpc && wpc->total_samples != (uint32_t) -1 && wpc->filelen) {
- double output_time = (double) wpc->total_samples / wpc->config.sample_rate;
- double input_size = (double) wpc->filelen + (count_wvc ? wpc->file2len : 0);
-
- if (output_time >= 1.0 && input_size >= 1.0)
- return input_size * 8.0 / output_time;
- }
-
- return 0.0;
-}
-
-#ifdef UNPACK
-
-// Calculate the bitrate of the current WavPack file block in bits per second.
-// This can be used for an "instant" bit display and gets updated from about
-// 1 to 4 times per second. A return of 0.0 indicates that the bitrate cannot
-// be determined.
-
-double WavpackGetInstantBitrate (WavpackContext *wpc)
-{
- if (wpc->stream3)
- return WavpackGetAverageBitrate (wpc, TRUE);
-
- if (wpc && wpc->streams [0] && wpc->streams [0]->wphdr.block_samples) {
- double output_time = (double) wpc->streams [0]->wphdr.block_samples / wpc->config.sample_rate;
- double input_size = 0;
- int si;
-
- for (si = 0; si < wpc->num_streams; ++si) {
- if (wpc->streams [si]->blockbuff)
- input_size += ((WavpackHeader *) wpc->streams [si]->blockbuff)->ckSize;
-
- if (wpc->streams [si]->block2buff)
- input_size += ((WavpackHeader *) wpc->streams [si]->block2buff)->ckSize;
- }
-
- if (output_time > 0.0 && input_size >= 1.0)
- return input_size * 8.0 / output_time;
- }
-
- return 0.0;
-}
-
-#endif
-
-// Close the specified WavPack file and release all resources used by it.
-// Returns NULL.
-
-WavpackContext *WavpackCloseFile (WavpackContext *wpc)
-{
- free_streams (wpc);
-
- if (wpc->streams [0])
- free (wpc->streams [0]);
-
-#ifdef VER3
- if (wpc->stream3)
- free_stream3 (wpc);
-#endif
-
-#if defined(UNPACK) || defined(INFO_ONLY)
- if (wpc->close_files) {
-#ifdef USE_FSTREAMS
- if (wpc->wv_in != NULL)
- fclose (wpc->wv_in);
-
- if (wpc->wvc_in != NULL)
- fclose (wpc->wvc_in);
-#endif
- }
-
- WavpackFreeWrapper (wpc);
-#endif
-
-#ifdef TAGS
- free_tag (&wpc->m_tag);
-#endif
-
- free (wpc);
-
- return NULL;
-}
-
-// Returns the sample rate of the specified WavPack file
-
-uint32_t WavpackGetSampleRate (WavpackContext *wpc)
-{
- return wpc ? wpc->config.sample_rate : 44100;
-}
-
-// Returns the number of channels of the specified WavPack file. Note that
-// this is the actual number of channels contained in the file even if the
-// OPEN_2CH_MAX flag was specified when the file was opened.
-
-int WavpackGetNumChannels (WavpackContext *wpc)
-{
- return wpc ? wpc->config.num_channels : 2;
-}
-
-int WavpackGetFloatNormExp (WavpackContext *wpc)
-{
- return wpc->config.float_norm_exp;
-}
-
-// Returns the actual number of valid bits per sample contained in the
-// original file, which may or may not be a multiple of 8. Floating data
-// always has 32 bits, integers may be from 1 to 32 bits each. When this
-// value is not a multiple of 8, then the "extra" bits are located in the
-// LSBs of the results. That is, values are right justified when unpacked
-// into ints, but are left justified in the number of bytes used by the
-// original data.
-
-int WavpackGetBitsPerSample (WavpackContext *wpc)
-{
- return wpc ? wpc->config.bits_per_sample : 16;
-}
-
-// Returns the number of bytes used for each sample (1 to 4) in the original
-// file. This is required information for the user of this module because the
-// audio data is returned in the LOWER bytes of the long buffer and must be
-// left-shifted 8, 16, or 24 bits if normalized longs are required.
-
-int WavpackGetBytesPerSample (WavpackContext *wpc)
-{
- return wpc ? wpc->config.bytes_per_sample : 2;
-}
-
-#if defined(UNPACK) || defined(INFO_ONLY)
-
-// If the OPEN_2CH_MAX flag is specified when opening the file, this function
-// will return the actual number of channels decoded from the file (which may
-// or may not be less than the actual number of channels, but will always be
-// 1 or 2). Normally, this will be the front left and right channels of a
-// multichannel file.
-
-int WavpackGetReducedChannels (WavpackContext *wpc)
-{
- if (wpc)
- return wpc->reduced_channels ? wpc->reduced_channels : wpc->config.num_channels;
- else
- return 2;
-}
-
-// These routines are used to access (and free) header and trailer data that
-// was retrieved from the Wavpack file. The header will be available before
-// the samples are decoded and the trailer will be available after all samples
-// have been read.
-
-uint32_t WavpackGetWrapperBytes (WavpackContext *wpc)
-{
- return wpc ? wpc->wrapper_bytes : 0;
-}
-
-uchar *WavpackGetWrapperData (WavpackContext *wpc)
-{
- return wpc ? wpc->wrapper_data : NULL;
-}
-
-void WavpackFreeWrapper (WavpackContext *wpc)
-{
- if (wpc && wpc->wrapper_data) {
- free (wpc->wrapper_data);
- wpc->wrapper_data = NULL;
- wpc->wrapper_bytes = 0;
- }
-}
-
-// Get any MD5 checksum stored in the metadata (should be called after reading
-// last sample or an extra seek will occur). A return value of FALSE indicates
-// that no MD5 checksum was stored.
-
-static int seek_md5 (stream_reader *reader, void *id, uchar data [16]);
-
-int WavpackGetMD5Sum (WavpackContext *wpc, uchar data [16])
-{
- if (wpc->config.flags & CONFIG_MD5_CHECKSUM) {
- if (wpc->config.md5_read) {
- memcpy (data, wpc->config.md5_checksum, 16);
- return TRUE;
- }
- else if (wpc->reader->can_seek (wpc->wv_in)) {
- uint32_t pos_save = wpc->reader->get_pos (wpc->wv_in);
-
- wpc->config.md5_read = seek_md5 (wpc->reader, wpc->wv_in, wpc->config.md5_checksum);
- wpc->reader->set_pos_abs (wpc->wv_in, pos_save);
-
- if (wpc->config.md5_read) {
- memcpy (data, wpc->config.md5_checksum, 16);
- return TRUE;
- }
- else
- return FALSE;
- }
- }
-
- return FALSE;
-}
-
-#endif
-
-// Free all memory allocated for raw WavPack blocks (for all allocated streams)
-// and free all additonal streams. This does not free the default stream ([0])
-// which is always kept around.
-
-static void free_streams (WavpackContext *wpc)
-{
- int si = wpc->num_streams;
-
- while (si--) {
- if (wpc->streams [si]->blockbuff) {
- free (wpc->streams [si]->blockbuff);
- wpc->streams [si]->blockbuff = NULL;
- }
-
- if (wpc->streams [si]->block2buff) {
- free (wpc->streams [si]->block2buff);
- wpc->streams [si]->block2buff = NULL;
- }
-
- if (wpc->streams [si]->sample_buffer) {
- free (wpc->streams [si]->sample_buffer);
- wpc->streams [si]->sample_buffer = NULL;
- }
-
- if (si) {
- wpc->num_streams--;
- free (wpc->streams [si]);
- wpc->streams [si] = NULL;
- }
- }
-
- wpc->current_stream = 0;
-}
-
-#ifdef TAGS
-
-// Return TRUE is a valid ID3v1 or APEv2 tag has been loaded.
-
-static int valid_tag (M_Tag *m_tag)
-{
- if (m_tag->ape_tag_hdr.ID [0] == 'A')
- return 'A';
- else if (m_tag->id3_tag.tag_id [0] == 'T')
- return 'T';
- else
- return 0;
-}
-
-// Free the data for any APEv2 tag that was allocated.
-
-static void free_tag (M_Tag *m_tag)
-{
- if (m_tag->ape_tag_data) {
- free (m_tag->ape_tag_data);
- m_tag->ape_tag_data = 0;
- }
-}
-
-#endif
-
-#if defined(UNPACK) || defined(INFO_ONLY)
-
-// Read from current file position until a valid 32-byte WavPack 4.0 header is
-// found and read into the specified pointer. The number of bytes skipped is
-// returned. If no WavPack header is found within 1 meg, then a -1 is returned
-// to indicate the error. No additional bytes are read past the header and it
-// is returned in the processor's native endian mode. Seeking is not required.
-
-static uint32_t read_next_header (stream_reader *reader, void *id, WavpackHeader *wphdr)
-{
- char buffer [sizeof (*wphdr)], *sp = buffer + sizeof (*wphdr), *ep = sp;
- uint32_t bytes_skipped = 0;
- int bleft;
-
- while (1) {
- if (sp < ep) {
- bleft = ep - sp;
- memcpy (buffer, sp, bleft);
- }
- else
- bleft = 0;
-
- if (reader->read_bytes (id, buffer + bleft, sizeof (*wphdr) - bleft) != sizeof (*wphdr) - bleft)
- return -1;
-
- sp = buffer;
-
- if (*sp++ == 'w' && *sp == 'v' && *++sp == 'p' && *++sp == 'k' &&
- !(*++sp & 1) && sp [2] < 16 && !sp [3] && sp [5] == 4 && sp [4] >= 2 && sp [4] <= 0xf) {
- memcpy (wphdr, buffer, sizeof (*wphdr));
- little_endian_to_native (wphdr, WavpackHeaderFormat);
- return bytes_skipped;
- }
-
- while (sp < ep && *sp != 'w')
- sp++;
-
- if ((bytes_skipped += sp - buffer) > 1024 * 1024)
- return -1;
- }
-}
-
-// This function is used to seek to end of a file to determine its actual
-// length in samples by reading the last header block containing data.
-// Currently, all WavPack files contain the sample length in the first block
-// containing samples, however this might not always be the case. Obviously,
-// this function requires a seekable file or stream and leaves the file
-// pointer undefined. A return value of -1 indicates the length could not
-// be determined.
-
-static uint32_t seek_final_index (stream_reader *reader, void *id)
-{
- uint32_t result = (uint32_t) -1, bcount;
- WavpackHeader wphdr;
-
- if (reader->get_length (id) > 1200000L)
- reader->set_pos_rel (id, -1048576L, SEEK_END);
-
- while (1) {
- bcount = read_next_header (reader, id, &wphdr);
-
- if (bcount == (uint32_t) -1)
- return result;
-
- if (wphdr.block_samples && (wphdr.flags & FINAL_BLOCK))
- result = wphdr.block_index + wphdr.block_samples;
-
- if (wphdr.ckSize > sizeof (WavpackHeader) - 8)
- reader->set_pos_rel (id, wphdr.ckSize - sizeof (WavpackHeader) + 8, SEEK_CUR);
- }
-}
-
-static int seek_md5 (stream_reader *reader, void *id, uchar data [16])
-{
- uchar meta_id, c1, c2;
- uint32_t bcount, meta_bc;
- WavpackHeader wphdr;
-
- if (reader->get_length (id) > 1200000L)
- reader->set_pos_rel (id, -1048576L, SEEK_END);
-
- while (1) {
- bcount = read_next_header (reader, id, &wphdr);
-
- if (bcount == (uint32_t) -1)
- return FALSE;
-
- bcount = wphdr.ckSize - sizeof (WavpackHeader) + 8;
-
- while (bcount >= 2) {
- if (reader->read_bytes (id, &meta_id, 1) != 1 ||
- reader->read_bytes (id, &c1, 1) != 1)
- return FALSE;
-
- meta_bc = c1 << 1;
- bcount -= 2;
-
- if (meta_id & ID_LARGE) {
- if (bcount < 2 || reader->read_bytes (id, &c1, 1) != 1 ||
- reader->read_bytes (id, &c2, 1) != 1)
- return FALSE;
-
- meta_bc += ((uint32_t) c1 << 9) + ((uint32_t) c2 << 17);
- bcount -= 2;
- }
-
- if (meta_id == ID_MD5_CHECKSUM)
- return (meta_bc == 16 && bcount >= 16 &&
- reader->read_bytes (id, data, 16) == 16);
-
- reader->set_pos_rel (id, meta_bc, SEEK_CUR);
- bcount -= meta_bc;
- }
- }
-}
-
-#ifdef SEEKING
-
-// Find a valid WavPack header, searching either from the current file position
-// (or from the specified position if not -1) and store it (endian corrected)
-// at the specified pointer. The return value is the exact file position of the
-// header, although we may have actually read past it. Because this function
-// is used for seeking to a specific audio sample, it only considers blocks
-// that contain audio samples for the initial stream to be valid.
-
-#define BUFSIZE 4096
-
-static uint32_t find_header (stream_reader *reader, void *id, uint32_t filepos, WavpackHeader *wphdr)
-{
- char *buffer = malloc (BUFSIZE), *sp = buffer, *ep = buffer;
-
- if (filepos != (uint32_t) -1 && reader->set_pos_abs (id, filepos)) {
- free (buffer);
- return -1;
- }
-
- while (1) {
- int bleft;
-
- if (sp < ep) {
- bleft = ep - sp;
- memcpy (buffer, sp, bleft);
- ep -= (sp - buffer);
- sp = buffer;
- }
- else {
- if (sp > ep)
- if (reader->set_pos_rel (id, sp - ep, SEEK_CUR)) {
- free (buffer);
- return -1;
- }
-
- sp = ep = buffer;
- bleft = 0;
- }
-
- ep += reader->read_bytes (id, ep, BUFSIZE - bleft);
-
- if (ep - sp < 32) {
- free (buffer);
- return -1;
- }
-
- while (sp + 32 <= ep)
- if (*sp++ == 'w' && *sp == 'v' && *++sp == 'p' && *++sp == 'k' &&
- !(*++sp & 1) && sp [2] < 16 && !sp [3] && sp [5] == 4 && sp [4] >= 2 && sp [4] <= 0xf) {
- memcpy (wphdr, sp - 4, sizeof (*wphdr));
- little_endian_to_native (wphdr, WavpackHeaderFormat);
-
- if (wphdr->block_samples && (wphdr->flags & INITIAL_BLOCK)) {
- free (buffer);
- return reader->get_pos (id) - (ep - sp + 4);
- }
-
- if (wphdr->ckSize > 1024)
- sp += wphdr->ckSize - 1024;
- }
- }
-}
-
-// Find the WavPack block that contains the specified sample. If "header_pos"
-// is zero, then no information is assumed except the total number of samples
-// in the file and its size in bytes. If "header_pos" is non-zero then we
-// assume that it is the file position of the valid header image contained in
-// the first stream and we can limit our search to either the portion above
-// or below that point. If a .wvc file is being used, then this must be called
-// for that file also.
-
-static uint32_t find_sample (WavpackContext *wpc, void *infile, uint32_t header_pos, uint32_t sample)
-{
- WavpackStream *wps = wpc->streams [wpc->current_stream];
- uint32_t file_pos1 = 0, file_pos2 = wpc->reader->get_length (infile);
- uint32_t sample_pos1 = 0, sample_pos2 = wpc->total_samples;
- double ratio = 0.96;
- int file_skip = 0;
-
- if (sample >= wpc->total_samples)
- return -1;
-
- if (header_pos) {
- if (wps->wphdr.block_index > sample) {
- sample_pos2 = wps->wphdr.block_index;
- file_pos2 = header_pos;
- }
- else if (wps->wphdr.block_index + wps->wphdr.block_samples <= sample) {
- sample_pos1 = wps->wphdr.block_index;
- file_pos1 = header_pos;
- }
- else
- return header_pos;
- }
-
- while (1) {
- double bytes_per_sample;
- uint32_t seek_pos;
-
- bytes_per_sample = file_pos2 - file_pos1;
- bytes_per_sample /= sample_pos2 - sample_pos1;
- seek_pos = file_pos1 + (file_skip ? 32 : 0);
- seek_pos += (uint32_t)(bytes_per_sample * (sample - sample_pos1) * ratio);
- seek_pos = find_header (wpc->reader, infile, seek_pos, &wps->wphdr);
-
- if (seek_pos == (uint32_t) -1 || seek_pos >= file_pos2) {
- if (ratio > 0.0) {
- if ((ratio -= 0.24) < 0.0)
- ratio = 0.0;
- }
- else
- return -1;
- }
- else if (wps->wphdr.block_index > sample) {
- sample_pos2 = wps->wphdr.block_index;
- file_pos2 = seek_pos;
- }
- else if (wps->wphdr.block_index + wps->wphdr.block_samples <= sample) {
-
- if (seek_pos == file_pos1)
- file_skip = 1;
- else {
- sample_pos1 = wps->wphdr.block_index;
- file_pos1 = seek_pos;
- }
- }
- else
- return seek_pos;
- }
-}
-
-#endif
-
-#ifdef TAGS
-
-// This function attempts to load an ID3v1 or APEv2 tag from the specified
-// file into the specified M_Tag structure. The ID3 tag fits in completely,
-// but an APEv2 tag is variable length and so space must be allocated here
-// to accomodate the data, and this will need to be freed later. A return
-// value of TRUE indicates a valid tag was found and loaded. Note that the
-// file pointer is undefined when this function exits.
-
-static int load_tag (WavpackContext *wpc)
-{
- M_Tag *m_tag = &wpc->m_tag;
-
- CLEAR (*m_tag);
-
- // First, attempt to find an APEv2 tag...
-
- wpc->reader->set_pos_rel (wpc->wv_in, -sizeof (APE_Tag_Hdr), SEEK_END);
-
- if (wpc->reader->read_bytes (wpc->wv_in, &m_tag->ape_tag_hdr, sizeof (APE_Tag_Hdr)) == sizeof (APE_Tag_Hdr) &&
- !strncmp (m_tag->ape_tag_hdr.ID, "APETAGEX", 8)) {
-
- little_endian_to_native (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
-
- if (m_tag->ape_tag_hdr.version == 2000 && m_tag->ape_tag_hdr.item_count &&
- m_tag->ape_tag_hdr.length > sizeof (m_tag->ape_tag_hdr) &&
- m_tag->ape_tag_hdr.length < (1024 * 1024) &&
- (m_tag->ape_tag_data = malloc (m_tag->ape_tag_hdr.length)) != NULL) {
-
- memset (m_tag->ape_tag_data, 0, m_tag->ape_tag_hdr.length);
- wpc->reader->set_pos_rel (wpc->wv_in, -m_tag->ape_tag_hdr.length, SEEK_END);
-
- if (wpc->reader->read_bytes (wpc->wv_in, m_tag->ape_tag_data, m_tag->ape_tag_hdr.length - sizeof (APE_Tag_Hdr)) !=
- m_tag->ape_tag_hdr.length - sizeof (APE_Tag_Hdr)) {
- free (m_tag->ape_tag_data);
- CLEAR (*m_tag);
- return FALSE;
- }
- else
- return TRUE;
- }
- }
-
- // ...if not, try a ID3v1 tag
-
- wpc->reader->set_pos_rel (wpc->wv_in, -sizeof (ID3_Tag), SEEK_END);
-
- if (wpc->reader->read_bytes (wpc->wv_in, &m_tag->id3_tag, sizeof (ID3_Tag)) == sizeof (ID3_Tag) &&
- !strncmp (m_tag->id3_tag.tag_id, "TAG", 3))
- return TRUE;
- else {
- CLEAR (*m_tag);
- return FALSE;
- }
-}
-
-// Copy the specified ID3v1 tag value (with specified field size) from the
-// source pointer to the destination, eliminating leading spaces and trailing
-// spaces and nulls.
-
-static void tagcpy (char *dest, char *src, int tag_size)
-{
- char *s1 = src, *s2 = src + tag_size - 1;
-
- while (s1 <= s2)
- if (*s1 == ' ')
- ++s1;
- else if (!*s2 || *s2 == ' ')
- --s2;
- else
- break;
-
- while (*s1 && s1 <= s2)
- *dest++ = *s1++;
-
- *dest = 0;
-}
-
-#endif
-
-#endif
diff --git a/lib/win32/libwavpack/wputils.h b/lib/win32/libwavpack/wputils.h
deleted file mode 100644
index 892a793eef..0000000000
--- a/lib/win32/libwavpack/wputils.h
+++ /dev/null
@@ -1,163 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// **** WAVPACK **** //
-// Hybrid Lossless Wavefile Compressor //
-// Copyright (c) 1998 - 2005 Conifer Software. //
-// All Rights Reserved. //
-// Distributed under the BSD Software License (see license.txt) //
-////////////////////////////////////////////////////////////////////////////
-
-// wputils.h
-
-#ifndef WPUTILS_H
-#define WPUTILS_H
-
-// This header file contains all the definitions required to use the
-// functions in "wputils.c" to read and write WavPack files and streams.
-
-#include <sys/types.h>
-
-#if defined(_WIN32) && !defined(__MINGW32__)
-#include <stdlib.h>
-typedef unsigned __int64 uint64_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int8 uint8_t;
-typedef __int64 int64_t;
-typedef __int32 int32_t;
-typedef __int16 int16_t;
-typedef __int8 int8_t;
-typedef float float32_t;
-#else
-#include <inttypes.h>
-#endif
-
-typedef unsigned char uchar;
-
-#if !defined(__GNUC__) || defined(WIN32)
-typedef unsigned short ushort;
-typedef unsigned int uint;
-#endif
-
-///////////////////////// WavPack Configuration ///////////////////////////////
-
-// This external structure is used during encode to provide configuration to
-// the encoding engine and during decoding to provide fle information back to
-// the higher level functions. Not all fields are used in both modes.
-
-typedef struct {
- float bitrate, shaping_weight;
- int bits_per_sample, bytes_per_sample;
- int qmode, flags, xmode, num_channels, float_norm_exp;
- int32_t block_samples, extra_flags, sample_rate, channel_mask;
- uchar md5_checksum [16], md5_read;
- int num_tag_strings;
- char **tag_strings;
-} WavpackConfig;
-
-#define CONFIG_HYBRID_FLAG 8 // hybrid mode
-#define CONFIG_JOINT_STEREO 0x10 // joint stereo
-#define CONFIG_HYBRID_SHAPE 0x40 // noise shape (hybrid mode only)
-#define CONFIG_FAST_FLAG 0x200 // fast mode
-#define CONFIG_HIGH_FLAG 0x800 // high quality mode
-#define CONFIG_BITRATE_KBPS 0x2000 // bitrate is kbps, not bits / sample
-#define CONFIG_SHAPE_OVERRIDE 0x8000 // shaping mode specified
-#define CONFIG_JOINT_OVERRIDE 0x10000 // joint-stereo mode specified
-#define CONFIG_CREATE_WVC 0x80000 // create correction file
-#define CONFIG_OPTIMIZE_WVC 0x100000 // maximize bybrid compression
-#define CONFIG_CALC_NOISE 0x800000 // calc noise in hybrid mode
-#define CONFIG_EXTRA_MODE 0x2000000 // extra processing mode
-#define CONFIG_SKIP_WVX 0x4000000 // no wvx stream w/ floats & big ints
-
-////////////// Callbacks used for reading & writing WavPack streams //////////
-
-typedef struct {
- int32_t (*read_bytes)(void *id, void *data, int32_t bcount);
- uint32_t (*get_pos)(void *id);
- int (*set_pos_abs)(void *id, uint32_t pos);
- int (*set_pos_rel)(void *id, int32_t delta, int mode);
- int (*push_back_byte)(void *id, int c);
- uint32_t (*get_length)(void *id);
- int (*can_seek)(void *id);
-} stream_reader;
-
-typedef int (*blockout)(void *id, void *data, int32_t bcount);
-
-//////////////////////// function prototypes and macros //////////////////////
-
-typedef void WavpackContext;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WavpackContext *WavpackOpenFileInputEx (stream_reader *reader, void *wv_id, void *wvc_id, char *error, int flags, int norm_offset);
-WavpackContext *WavpackOpenFileInput (const char *infilename, char *error, int flags, int norm_offset);
-
-#define OPEN_WVC 0x1 // open/read "correction" file
-#define OPEN_TAGS 0x2 // read ID3v1 / APEv2 tags (seekable file)
-#define OPEN_WRAPPER 0x4 // make audio wrapper available (i.e. RIFF)
-#define OPEN_2CH_MAX 0x8 // open multichannel as stereo (no downmix)
-#define OPEN_NORMALIZE 0x10 // normalize floating point data to +/- 1.0
-#define OPEN_STREAMING 0x20 // "streaming" mode blindly unpacks blocks
- // w/o regard to header file position info
-
-int WavpackGetMode (WavpackContext *wpc);
-
-#define MODE_WVC 0x1
-#define MODE_LOSSLESS 0x2
-#define MODE_HYBRID 0x4
-#define MODE_FLOAT 0x8
-#define MODE_VALID_TAG 0x10
-#define MODE_HIGH 0x20
-#define MODE_FAST 0x40
-#define MODE_EXTRA 0x80
-#define MODE_APETAG 0x100
-#define MODE_SFX 0x200
-
-int WavpackGetVersion (WavpackContext *wpc);
-uint32_t WavpackUnpackSamples (WavpackContext *wpc, int32_t *buffer, uint32_t samples);
-uint32_t WavpackGetNumSamples (WavpackContext *wpc);
-uint32_t WavpackGetSampleIndex (WavpackContext *wpc);
-int WavpackGetNumErrors (WavpackContext *wpc);
-int WavpackLossyBlocks (WavpackContext *wpc);
-int WavpackSeekSample (WavpackContext *wpc, uint32_t sample);
-WavpackContext *WavpackCloseFile (WavpackContext *wpc);
-uint32_t WavpackGetSampleRate (WavpackContext *wpc);
-int WavpackGetBitsPerSample (WavpackContext *wpc);
-int WavpackGetBytesPerSample (WavpackContext *wpc);
-int WavpackGetNumChannels (WavpackContext *wpc);
-int WavpackGetReducedChannels (WavpackContext *wpc);
-int WavpackGetFloatNormExp (WavpackContext *wpc);
-int WavpackGetMD5Sum (WavpackContext *wpc, uchar data [16]);
-uint32_t WavpackGetWrapperBytes (WavpackContext *wpc);
-uchar *WavpackGetWrapperData (WavpackContext *wpc);
-void WavpackFreeWrapper (WavpackContext *wpc);
-double WavpackGetProgress (WavpackContext *wpc);
-uint32_t WavpackGetFileSize (WavpackContext *wpc);
-double WavpackGetRatio (WavpackContext *wpc);
-double WavpackGetAverageBitrate (WavpackContext *wpc, int count_wvc);
-double WavpackGetInstantBitrate (WavpackContext *wpc);
-int WavpackGetTagItem (WavpackContext *wpc, const char *item, char *value, int size);
-int WavpackAppendTagItem (WavpackContext *wpc, const char *item, const char *value);
-int WavpackWriteTag (WavpackContext *wpc);
-
-
-WavpackContext *WavpackOpenFileOutput (blockout blockout, void *wv_id, void *wvc_id);
-int WavpackSetConfiguration (WavpackContext *wpc, WavpackConfig *config, uint32_t total_samples);
-int WavpackAddWrapper (WavpackContext *wpc, void *data, uint32_t bcount);
-int WavpackStoreMD5Sum (WavpackContext *wpc, uchar data [16]);
-int WavpackPackInit (WavpackContext *wpc);
-int WavpackPackSamples (WavpackContext *wpc, int32_t *sample_buffer, uint32_t sample_count);
-int WavpackFlushSamples (WavpackContext *wpc);
-void WavpackUpdateNumSamples (WavpackContext *wpc, void *first_block);
-void *WavpackGetWrapperLocation (void *first_block);
-
-// this function is not actually in wputils.c, but is generally useful
-
-void float_normalize (int32_t *values, int32_t num_values, int delta_exp);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/project/BuildDependencies/scripts/yajl_d.bat b/project/BuildDependencies/scripts/yajl_d.bat
new file mode 100644
index 0000000000..f9c2f313c3
--- /dev/null
+++ b/project/BuildDependencies/scripts/yajl_d.bat
@@ -0,0 +1,13 @@
+@ECHO OFF
+
+SET LOC_PATH=%CD%
+SET FILES=%LOC_PATH%\yajl_d.txt
+
+CALL dlextract.bat yajl %FILES%
+
+cd %TMP_PATH%
+
+xcopy include\yajl "%CUR_PATH%\include\yajl" /E /Q /I /Y
+copy lib\yajl.lib "%CUR_PATH%\lib\" /Y
+
+cd %LOC_PATH%
diff --git a/project/BuildDependencies/scripts/yajl_d.txt b/project/BuildDependencies/scripts/yajl_d.txt
new file mode 100644
index 0000000000..fe67e236fc
--- /dev/null
+++ b/project/BuildDependencies/scripts/yajl_d.txt
@@ -0,0 +1,2 @@
+; filename source of the file
+yajl_1.0.12_win32-lib.zip http://mirrors.xbmc.org/build-deps/win32/
diff --git a/project/VS2010Express/XBMC for Windows.sln b/project/VS2010Express/XBMC for Windows.sln
index efe1e185f6..ed59e9b2a3 100644
--- a/project/VS2010Express/XBMC for Windows.sln
+++ b/project/VS2010Express/XBMC for Windows.sln
@@ -52,8 +52,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "visWaveform", "..\..\xbmc\v
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squish", "..\..\lib\libsquish\vs7\squish\squish_2010.vcxproj", "{6A8518C3-D81A-4428-BD7F-C37933088AC1}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwavpack_dll", "..\..\lib\win32\libwavpack\wavpackdll.vcxproj", "{CDC43FFE-1BED-44C6-BAB9-5A7E84D6D9FE}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libStSoundLibrary_dll", "..\..\lib\stsound\StSoundLibrary\StSoundLibrary.vcxproj", "{D9885434-4B9D-41FB-B5FC-5E89D41AEFF0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmad_dll", "..\..\lib\libmad\msvc++\libmad.vcxproj", "{AF6C8945-5DDC-4F62-A48C-86B11B7ED996}"
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj
index 13ac0f7ce6..6383f120cd 100644
--- a/project/VS2010Express/XBMC.vcxproj
+++ b/project/VS2010Express/XBMC.vcxproj
@@ -102,7 +102,7 @@
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\win32\;..\..\xbmc\cores\dvdplayer;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\jsoncpp\jsoncpp\include;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\libwavpack;..\..\lib\win32\pcre;..\..\lib\jsoncpp\include;..\..\lib\win32</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\win32\;..\..\xbmc\cores\dvdplayer;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\pcre;..\..\lib\win32</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_MSVC;WIN32;NDEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;HAS_GL;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>false</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
@@ -122,7 +122,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>SDL.lib;opengl32.lib;DSound.lib;glew32.lib;glu32.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>SDL.lib;opengl32.lib;DSound.lib;glew32.lib;glu32.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;yajl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)XBMC.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\libSDL-WIN32\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;msvcrt;libci;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -146,7 +146,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores;..\..\xbmc\cores\dvdplayer;..\..\xbmc\dialogs;..\..\xbmc\FileSystem;..\..\xbmc\guilib\;..\..\xbmc\utils;..\..\xbmc\win32;..\..\xbmc\windowing;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\jsoncpp\jsoncpp\include;..\..\lib\libflac\flac-1.2.1\include;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\libwavpack;..\..\lib\win32\pcre;..\..\lib\jsoncpp\include;..\..\lib\win32</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores;..\..\xbmc\cores\dvdplayer;..\..\xbmc\dialogs;..\..\xbmc\FileSystem;..\..\xbmc\guilib\;..\..\xbmc\utils;..\..\xbmc\win32;..\..\xbmc\windowing;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\libflac\flac-1.2.1\include;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\pcre;..\..\lib\win32</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_MSVC;WIN32;_DEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;D3D_DEBUG_INFO;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<ExceptionHandling>Async</ExceptionHandling>
@@ -163,7 +163,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>SDL.lib;D3D9.lib;D3dx9.lib;DInput8.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;strmiids.lib;dxguid.lib;mfuuid.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>SDL.lib;D3D9.lib;D3dx9.lib;DInput8.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;strmiids.lib;dxguid.lib;mfuuid.lib;comctl32.lib;yajl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)XBMC.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\DSPlayer\Libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;msvcrt;libcmt;msvcrtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -192,7 +192,7 @@
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\win32\;..\..\xbmc\cores\dvdplayer;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\jsoncpp\jsoncpp\include;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\libwavpack;..\..\lib\win32\pcre;..\..\lib\jsoncpp\include;..\..\lib\win32</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\win32\;..\..\xbmc\cores\dvdplayer;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\pcre;..\..\lib\win32</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_MSVC;WIN32;NDEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>false</StringPooling>
<MinimalRebuild>true</MinimalRebuild>
@@ -211,7 +211,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>SDL.lib;D3D9.lib;D3dx9.lib;DInput8.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;strmiids.lib;mfuuid.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>SDL.lib;D3D9.lib;D3dx9.lib;DInput8.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;strmiids.lib;mfuuid.lib;comctl32.lib;yajl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)XBMC.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\libSDL-WIN32\lib;..\..\xbmc\cores\DSPlayer\Libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;msvcrt;libci;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -235,7 +235,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\win32\;..\..\xbmc\cores\dvdplayer;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\jsoncpp\jsoncpp\include;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\libwavpack;..\..\lib\win32\pcre;..\..\lib\jsoncpp\include;..\..\lib\win32</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\win32\;..\..\xbmc\cores\dvdplayer;..\..\lib;..\..\lib\ffmpeg;..\..\lib\ffmpeg\include-xbmc-win32;..\..\lib\liblame\include;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\boost;..\..\lib\win32\libmicrohttpd_win32\include;..\..\lib\win32\pcre;..\..\lib\win32</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_MSVC;WIN32;_DEBUG;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NOMINMAX;_USE_32BIT_TIME_T;HAS_GL;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<ExceptionHandling>Async</ExceptionHandling>
@@ -252,7 +252,7 @@
</ClCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /ignore:4254 %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>SDL.lib;D3D9.lib;D3DX9.lib;DInput8.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>SDL.lib;D3D9.lib;D3DX9.lib;DInput8.lib;DSound.lib;winmm.lib;ws2_32.lib;Mpr.lib;Iphlpapi.lib;PowrProf.lib;setupapi.lib;dwmapi.lib;yajl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)XBMC.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\libSDL-WIN32\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;msvcrt;libcmt;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -276,9 +276,7 @@
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="..\..\lib\jsoncpp\src\lib_json\json_reader.cpp" />
- <ClCompile Include="..\..\lib\jsoncpp\src\lib_json\json_value.cpp" />
- <ClCompile Include="..\..\lib\jsoncpp\src\lib_json\json_writer.cpp" />
+ <ClCompile Include="..\..\lib\SlingboxLib\SlingboxLib.cpp" />
<ClCompile Include="..\..\lib\tinyXML\tinystr.cpp" />
<ClCompile Include="..\..\lib\tinyXML\tinyxml.cpp" />
<ClCompile Include="..\..\lib\tinyXML\tinyxmlerror.cpp" />
@@ -341,6 +339,7 @@
<ClCompile Include="..\..\xbmc\FileSystem\iso9660.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\ISO9660Directory.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\FileUDF.cpp" />
+ <ClCompile Include="..\..\xbmc\filesystem\Slingbox.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\udf25.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\UDFDirectory.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeCountry.cpp" />
@@ -756,6 +755,8 @@
<ClCompile Include="..\..\xbmc\utils\HttpHeader.cpp" />
<ClCompile Include="..\..\xbmc\utils\InfoLoader.cpp" />
<ClCompile Include="..\..\xbmc\utils\JobManager.cpp" />
+ <ClCompile Include="..\..\xbmc\utils\JSONVariantParser.cpp" />
+ <ClCompile Include="..\..\xbmc\utils\JSONVariantWriter.cpp" />
<ClCompile Include="..\..\xbmc\utils\LabelFormatter.cpp" />
<ClCompile Include="..\..\xbmc\utils\LangCodeExpander.cpp" />
<ClCompile Include="..\..\xbmc\utils\LCD.cpp" />
@@ -916,7 +917,6 @@
<ClCompile Include="..\..\xbmc\cores\paplayer\TimidityCodec.cpp" />
<ClCompile Include="..\..\xbmc\cores\paplayer\VGMCodec.cpp" />
<ClCompile Include="..\..\xbmc\cores\paplayer\WAVcodec.cpp" />
- <ClCompile Include="..\..\xbmc\cores\paplayer\WAVPackcodec.cpp" />
<ClCompile Include="..\..\xbmc\cores\paplayer\YMCodec.cpp" />
<ClCompile Include="..\..\xbmc\cores\DllLoader\coff.cpp" />
<ClCompile Include="..\..\xbmc\cores\DllLoader\dll.cpp" />
@@ -1157,6 +1157,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\lib\ffmpeg\include-xbmc-win32\libavutil\avconfig.h" />
+ <ClInclude Include="..\..\lib\SlingboxLib\SlingboxLib.h" />
<ClInclude Include="..\..\lib\tinyXML\tinystr.h" />
<ClInclude Include="..\..\lib\tinyXML\tinyxml.h" />
<ClInclude Include="..\..\xbmc\addons\AddonDatabase.h" />
@@ -1229,6 +1230,7 @@
<ClInclude Include="..\..\xbmc\filesystem\iso9660.h" />
<ClInclude Include="..\..\xbmc\FileSystem\ISO9660Directory.h" />
<ClInclude Include="..\..\xbmc\FileSystem\FileUDF.h" />
+ <ClInclude Include="..\..\xbmc\filesystem\Slingbox.h" />
<ClInclude Include="..\..\xbmc\FileSystem\udf25.h" />
<ClInclude Include="..\..\xbmc\FileSystem\UDFDirectory.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeCountry.h" />
@@ -1583,6 +1585,8 @@
<ClInclude Include="..\..\xbmc\utils\ISerializable.h" />
<ClInclude Include="..\..\xbmc\utils\Job.h" />
<ClInclude Include="..\..\xbmc\utils\JobManager.h" />
+ <ClInclude Include="..\..\xbmc\utils\JSONVariantParser.h" />
+ <ClInclude Include="..\..\xbmc\utils\JSONVariantWriter.h" />
<ClInclude Include="..\..\xbmc\utils\LabelFormatter.h" />
<ClInclude Include="..\..\xbmc\utils\LangCodeExpander.h" />
<ClInclude Include="..\..\xbmc\utils\LCD.h" />
@@ -1772,7 +1776,6 @@
<ClInclude Include="..\..\lib\DllStSound.h" />
<ClInclude Include="..\..\lib\DllTimidity.h" />
<ClInclude Include="..\..\lib\DllVorbisfile.h" />
- <ClInclude Include="..\..\lib\DllWAVPack.h" />
<ClInclude Include="..\..\xbmc\cores\paplayer\DVDPlayerCodec.h" />
<ClInclude Include="..\..\xbmc\cores\paplayer\FLACcodec.h" />
<ClInclude Include="..\..\xbmc\cores\paplayer\ICodec.h" />
@@ -1788,7 +1791,6 @@
<ClInclude Include="..\..\xbmc\cores\paplayer\TimidityCodec.h" />
<ClInclude Include="..\..\xbmc\cores\paplayer\VGMCodec.h" />
<ClInclude Include="..\..\xbmc\cores\paplayer\WAVcodec.h" />
- <ClInclude Include="..\..\xbmc\cores\paplayer\WAVPackcodec.h" />
<ClInclude Include="..\..\xbmc\cores\paplayer\YMCodec.h" />
<ClInclude Include="..\..\xbmc\cores\DllLoader\coff.h" />
<ClInclude Include="..\..\xbmc\cores\DllLoader\coffldr.h" />
diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters
index e0494582da..ed1eb85114 100644
--- a/project/VS2010Express/XBMC.vcxproj.filters
+++ b/project/VS2010Express/XBMC.vcxproj.filters
@@ -199,9 +199,6 @@
<Filter Include="libs\sqlite">
<UniqueIdentifier>{c9d35dd5-e25d-4b76-bcbe-e8c855de58e7}</UniqueIdentifier>
</Filter>
- <Filter Include="libs\jsoncpp">
- <UniqueIdentifier>{b27f9ce9-0b2e-4456-9bce-8313af739c2d}</UniqueIdentifier>
- </Filter>
<Filter Include="libs\tinyxml">
<UniqueIdentifier>{b084bece-821c-445c-951d-0aa4ea804076}</UniqueIdentifier>
</Filter>
@@ -229,6 +226,9 @@
<Filter Include="guilib\Rendering\GL">
<UniqueIdentifier>{9592a005-d33b-48d1-8462-d95c42c383c2}</UniqueIdentifier>
</Filter>
+ <Filter Include="libs\SlingboxLib">
+ <UniqueIdentifier>{dfa70c36-927b-4540-b505-35919e64eb3d}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\xbmc\win32\pch.cpp">
@@ -513,9 +513,6 @@
<ClCompile Include="..\..\xbmc\cores\paplayer\WAVcodec.cpp">
<Filter>cores\paplayer</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\cores\paplayer\WAVPackcodec.cpp">
- <Filter>cores\paplayer</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\cores\paplayer\YMCodec.cpp">
<Filter>cores\paplayer</Filter>
</ClCompile>
@@ -2207,15 +2204,6 @@
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogCache.cpp">
<Filter>dialogs</Filter>
</ClCompile>
- <ClCompile Include="..\..\lib\jsoncpp\src\lib_json\json_reader.cpp">
- <Filter>libs\jsoncpp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\lib\jsoncpp\src\lib_json\json_value.cpp">
- <Filter>libs\jsoncpp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\lib\jsoncpp\src\lib_json\json_writer.cpp">
- <Filter>libs\jsoncpp</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\interfaces\Builtins.cpp">
<Filter>interfaces</Filter>
</ClCompile>
@@ -2429,6 +2417,12 @@
<ClCompile Include="..\..\xbmc\cores\VideoRenderers\RenderCapture.cpp">
<Filter>cores\VideoRenderers</Filter>
</ClCompile>
+ <ClCompile Include="..\..\lib\SlingboxLib\SlingboxLib.cpp">
+ <Filter>libs\SlingboxLib</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\xbmc\filesystem\Slingbox.cpp">
+ <Filter>filesystem</Filter>
+ </ClCompile>
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogPlayEject.cpp">
<Filter>dialogs</Filter>
</ClCompile>
@@ -2454,6 +2448,12 @@
<ClCompile Include="..\..\xbmc\input\XBMC_keytable.cpp">
<Filter>input</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\utils\JSONVariantParser.cpp">
+ <Filter>utils</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\xbmc\utils\JSONVariantWriter.cpp">
+ <Filter>utils</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\xbmc\win32\pch.h">
@@ -2819,9 +2819,6 @@
<ClInclude Include="..\..\lib\DllVorbisfile.h">
<Filter>cores\paplayer</Filter>
</ClInclude>
- <ClInclude Include="..\..\lib\DllWAVPack.h">
- <Filter>cores\paplayer</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\cores\paplayer\DVDPlayerCodec.h">
<Filter>cores\paplayer</Filter>
</ClInclude>
@@ -2867,9 +2864,6 @@
<ClInclude Include="..\..\xbmc\cores\paplayer\WAVcodec.h">
<Filter>cores\paplayer</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\cores\paplayer\WAVPackcodec.h">
- <Filter>cores\paplayer</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\cores\paplayer\YMCodec.h">
<Filter>cores\paplayer</Filter>
</ClInclude>
@@ -4885,6 +4879,12 @@
<ClInclude Include="..\..\xbmc\utils\GlobalsHandling.h">
<Filter>utils</Filter>
</ClInclude>
+ <ClInclude Include="..\..\lib\SlingboxLib\SlingboxLib.h">
+ <Filter>libs\SlingboxLib</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\xbmc\filesystem\Slingbox.h">
+ <Filter>filesystem</Filter>
+ </ClInclude>
<ClInclude Include="..\..\xbmc\filesystem\CacheCircular.h">
<Filter>filesystem</Filter>
</ClInclude>
@@ -4907,6 +4907,12 @@
<ClInclude Include="..\..\xbmc\input\XBMC_keytable.h">
<Filter>input</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\utils\JSONVariantParser.h">
+ <Filter>utils</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\xbmc\utils\JSONVariantWriter.h">
+ <Filter>utils</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\xbmc\win32\XBMC.ico">
diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml
index f847856ea4..6f4820de94 100644
--- a/system/keymaps/keyboard.xml
+++ b/system/keymaps/keyboard.xml
@@ -106,7 +106,7 @@
<next_track>SkipNext</next_track>
<prev_track>SkipPrevious</prev_track>
<stop>Stop</stop>
- <play_pause>Play</play_pause>
+ <play_pause>Pause</play_pause>
<launch_mail></launch_mail>
<launch_media_select>XBMC.ActivateWindow(MyMusic)</launch_media_select>
<launch_app1_pc_icon>ActivateWindow(MyPrograms)</launch_app1_pc_icon>
diff --git a/system/keymaps/mouse.xml b/system/keymaps/mouse.xml
new file mode 100644
index 0000000000..5172650f6e
--- /dev/null
+++ b/system/keymaps/mouse.xml
@@ -0,0 +1,14 @@
+<keymap>
+ <global>
+ <mouse>
+ <leftclick>leftclick</leftclick>
+ <middleclick>middleclick</middleclick>
+ <rightclick>rightclick</rightclick>
+ <doubleclick>doubleclick</doubleclick>
+ <wheeldown>wheeldown</wheeldown>
+ <wheelup>wheelup</wheelup>
+ <mousedrag>mousedrag</mousedrag>
+ <mousemove>mousemove</mousemove>
+ </mouse>
+ </global>
+</keymap>
diff --git a/tools/buildbot/darwin-depends-check b/tools/buildbot/darwin-depends-check
new file mode 100755
index 0000000000..231f67647e
--- /dev/null
+++ b/tools/buildbot/darwin-depends-check
@@ -0,0 +1,3 @@
+#!/bin/bash
+git diff-tree --quiet -r HEAD@{1}..HEAD@{0} tools/darwin/depends/
+echo $?
diff --git a/tools/darwin/depends/Makefile.in b/tools/darwin/depends/Makefile.in
index 34eded8b8a..5804b655ad 100644
--- a/tools/darwin/depends/Makefile.in
+++ b/tools/darwin/depends/Makefile.in
@@ -7,7 +7,7 @@ SUBDIRS := \
liblzo2 freetype2 fontconfig \
openssl libssh2 curl \
jpeg tiff libpng libogg \
- libvorbis libflac libmad fribidi libwavpack libmpeg2 \
+ libvorbis libflac libmad fribidi libmpeg2 \
libass libcdio libsamplerate librtmp libcrystalhd \
libGLEW libsdl libsdl_mixer libsdl_image \
libmicrohttpd libmodplug libbluray libyajl \
diff --git a/tools/darwin/depends/Makefile.include.in b/tools/darwin/depends/Makefile.include.in
index 988336925c..3c212a58a1 100644
--- a/tools/darwin/depends/Makefile.include.in
+++ b/tools/darwin/depends/Makefile.include.in
@@ -6,6 +6,7 @@ STAGING=@use_staging@
TOOLCHAIN=@use_toolchain@
TARBALLS_LOCATION=@use_staging@/tarballs
BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
+MAKE_JOBS=$(shell sysctl hw.ncpu | awk '{print $$2}')
RETRIEVE_TOOL=/usr/bin/curl
RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
diff --git a/tools/darwin/depends/afpfs-ng/Makefile b/tools/darwin/depends/afpfs-ng/Makefile
index 953bece5df..71718b752d 100644
--- a/tools/darwin/depends/afpfs-ng/Makefile
+++ b/tools/darwin/depends/afpfs-ng/Makefile
@@ -27,7 +27,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/autoconf/Makefile b/tools/darwin/depends/autoconf/Makefile
index beb0423c54..b657461314 100644
--- a/tools/darwin/depends/autoconf/Makefile
+++ b/tools/darwin/depends/autoconf/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/automake/Makefile b/tools/darwin/depends/automake/Makefile
index c88173027a..ebd458fc81 100644
--- a/tools/darwin/depends/automake/Makefile
+++ b/tools/darwin/depends/automake/Makefile
@@ -25,7 +25,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/cmake/Makefile b/tools/darwin/depends/cmake/Makefile
index 8b61082a0a..d1755b1784 100644
--- a/tools/darwin/depends/cmake/Makefile
+++ b/tools/darwin/depends/cmake/Makefile
@@ -25,7 +25,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/configure.in b/tools/darwin/depends/configure.in
index 4aece74dde..aa8d489527 100644
--- a/tools/darwin/depends/configure.in
+++ b/tools/darwin/depends/configure.in
@@ -11,7 +11,7 @@ AC_ARG_WITH([darwin],
[AS_HELP_STRING([--with-darwin],
[build depend libs for darwin osx (default) or ios.])],
[use_darwin=$withval],
- [use_darwin="osx"])
+ [use_darwin=missing])
AC_ARG_WITH([arch],
[AS_HELP_STRING([--with-arch],
@@ -32,9 +32,11 @@ case $use_darwin in
if test "$use_arch" = "armv7"; then
AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
fi
- if test "$use_sdk" != "10.4"; then
+ case $use_sdk in
+ 10.*);;
+ *)
AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
- fi
+ esac
CONFIG_SITE=" [config.site:config.site_osx.in]"
MK_CONFIG_SITE=" [config.site.mk:config.site_osx.mk.in]"
;;
@@ -50,14 +52,17 @@ case $use_darwin in
if test "$use_arch" != "armv7"; then
AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
fi
- if test "$use_sdk" != "4.2"; then
+ case $use_sdk in
+ 4.*);;
+ *)
AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
- fi
+ esac
CONFIG_SITE=" [config.site:config.site_ios.in]"
MK_CONFIG_SITE=" [config.site.mk:config.site_ios.mk.in]"
;;
*)
- AC_MSG_ERROR(error in configure of ($host))
+ AC_MSG_ERROR([error in configure, missing or incorrect --with-darwin arg])
+ ;;
esac
AC_MSG_RESULT(configuring for darwin $use_darwin-$use_sdk-$use_arch)
diff --git a/tools/darwin/depends/curl/Makefile b/tools/darwin/depends/curl/Makefile
index da6362cb2c..897669c8cb 100644
--- a/tools/darwin/depends/curl/Makefile
+++ b/tools/darwin/depends/curl/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/expat/Makefile b/tools/darwin/depends/expat/Makefile
index 9f593b53b4..cb51291d2f 100644
--- a/tools/darwin/depends/expat/Makefile
+++ b/tools/darwin/depends/expat/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/fontconfig/Makefile b/tools/darwin/depends/fontconfig/Makefile
index e16b56279a..a612300174 100644
--- a/tools/darwin/depends/fontconfig/Makefile
+++ b/tools/darwin/depends/fontconfig/Makefile
@@ -28,7 +28,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/freetype2/Makefile b/tools/darwin/depends/freetype2/Makefile
index f79eba659a..a77e534203 100644
--- a/tools/darwin/depends/freetype2/Makefile
+++ b/tools/darwin/depends/freetype2/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/fribidi/Makefile b/tools/darwin/depends/fribidi/Makefile
index 33b091415c..6a0ee921ac 100644
--- a/tools/darwin/depends/fribidi/Makefile
+++ b/tools/darwin/depends/fribidi/Makefile
@@ -24,7 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/gas-preprocessor/Makefile b/tools/darwin/depends/gas-preprocessor/Makefile
index cddbf01d21..e3a051430c 100644
--- a/tools/darwin/depends/gas-preprocessor/Makefile
+++ b/tools/darwin/depends/gas-preprocessor/Makefile
@@ -10,4 +10,4 @@ $(GASBIN):
clean:
distclean::
- rm $(GASBIN)
+ rm -f $(GASBIN)
diff --git a/tools/darwin/depends/gettext/02-gettext-tools-stpncpy.patch b/tools/darwin/depends/gettext/02-gettext-tools-stpncpy.patch
new file mode 100644
index 0000000000..cc01d2f0d4
--- /dev/null
+++ b/tools/darwin/depends/gettext/02-gettext-tools-stpncpy.patch
@@ -0,0 +1,12 @@
+diff -ur gettext-0.17.orig/gettext-tools/gnulib-lib/stpncpy.c gettext-0.17/gettext-tools/gnulib-lib/stpncpy.c
+--- gettext-0.17.orig/gettext-tools/gnulib-lib/stpncpy.c 2007-10-07 23:29:35.000000000 +0300
++++ gettext-0.17/gettext-tools/gnulib-lib/stpncpy.c 2011-03-11 23:34:40.000000000 +0200
+@@ -24,7 +24,7 @@
+ #include <string.h>
+
+ #ifndef weak_alias
+-# define __stpncpy stpncpy
++//# define __stpncpy stpncpy
+ #endif
+
+ /* Copy no more than N bytes of SRC to DST, returning a pointer past the
diff --git a/tools/darwin/depends/gettext/Makefile b/tools/darwin/depends/gettext/Makefile
index ae94295fb3..006011b31f 100644
--- a/tools/darwin/depends/gettext/Makefile
+++ b/tools/darwin/depends/gettext/Makefile
@@ -28,10 +28,13 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
echo $(SOURCE) > .gitignore
cd $(SOURCE); patch -p0 <../01-gettext-tools-Makefile.in.patch
+ if [ "$(DARWIN)" = "ios" ] && [ "$(SDK)" != "4.2" ]; then \
+ cd $(SOURCE); patch -p1 <../02-gettext-tools-stpncpy.patch; \
+ fi
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j 1 -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/help2man/Makefile b/tools/darwin/depends/help2man/Makefile
index 536d21336a..6b90b08718 100644
--- a/tools/darwin/depends/help2man/Makefile
+++ b/tools/darwin/depends/help2man/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/jpeg/Makefile b/tools/darwin/depends/jpeg/Makefile
index da4abaee82..c99a102b5c 100644
--- a/tools/darwin/depends/jpeg/Makefile
+++ b/tools/darwin/depends/jpeg/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libGLEW/Makefile b/tools/darwin/depends/libGLEW/Makefile
index a8dd0ecb93..19fc250a7c 100644
--- a/tools/darwin/depends/libGLEW/Makefile
+++ b/tools/darwin/depends/libGLEW/Makefile
@@ -28,7 +28,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); patch -p0 < ../02-Makefile.darwin.patch
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libass/Makefile b/tools/darwin/depends/libass/Makefile
index 55dfbbca9e..acd0262098 100644
--- a/tools/darwin/depends/libass/Makefile
+++ b/tools/darwin/depends/libass/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libbluray/Makefile b/tools/darwin/depends/libbluray/Makefile
index f0515fa067..ead064e231 100644
--- a/tools/darwin/depends/libbluray/Makefile
+++ b/tools/darwin/depends/libbluray/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libcdio/Makefile b/tools/darwin/depends/libcdio/Makefile
index f7f0428cf7..32455db1f6 100644
--- a/tools/darwin/depends/libcdio/Makefile
+++ b/tools/darwin/depends/libcdio/Makefile
@@ -24,7 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libflac/Makefile b/tools/darwin/depends/libflac/Makefile
index 97eed14e5a..f5b0c37674 100644
--- a/tools/darwin/depends/libflac/Makefile
+++ b/tools/darwin/depends/libflac/Makefile
@@ -29,7 +29,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
fi
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libgcrypt/Makefile b/tools/darwin/depends/libgcrypt/Makefile
index a4e23d2645..5498e52fb5 100644
--- a/tools/darwin/depends/libgcrypt/Makefile
+++ b/tools/darwin/depends/libgcrypt/Makefile
@@ -27,7 +27,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libgpg-error/Makefile b/tools/darwin/depends/libgpg-error/Makefile
index a8a319ec1c..ab033a0cac 100644
--- a/tools/darwin/depends/libgpg-error/Makefile
+++ b/tools/darwin/depends/libgpg-error/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/liblzo2/Makefile b/tools/darwin/depends/liblzo2/Makefile
index 0dc8c8bd46..e74f03c9d1 100644
--- a/tools/darwin/depends/liblzo2/Makefile
+++ b/tools/darwin/depends/liblzo2/Makefile
@@ -25,7 +25,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libmad/Makefile b/tools/darwin/depends/libmad/Makefile
index 07b3282ee8..d1d4d33504 100644
--- a/tools/darwin/depends/libmad/Makefile
+++ b/tools/darwin/depends/libmad/Makefile
@@ -28,7 +28,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libmicrohttpd/Makefile b/tools/darwin/depends/libmicrohttpd/Makefile
index 4a9894d4b6..3fa5ae559f 100644
--- a/tools/darwin/depends/libmicrohttpd/Makefile
+++ b/tools/darwin/depends/libmicrohttpd/Makefile
@@ -24,7 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libmodplug/Makefile b/tools/darwin/depends/libmodplug/Makefile
index 034ae123dd..0c24f3c9b8 100644
--- a/tools/darwin/depends/libmodplug/Makefile
+++ b/tools/darwin/depends/libmodplug/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libmpeg2/Makefile b/tools/darwin/depends/libmpeg2/Makefile
index 7b0b13944b..839fa5b5c6 100644
--- a/tools/darwin/depends/libmpeg2/Makefile
+++ b/tools/darwin/depends/libmpeg2/Makefile
@@ -29,7 +29,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libnfs/Makefile b/tools/darwin/depends/libnfs/Makefile
new file mode 100644
index 0000000000..b5e8245e50
--- /dev/null
+++ b/tools/darwin/depends/libnfs/Makefile
@@ -0,0 +1,51 @@
+include ../Makefile.include
+include ../config.site.mk
+
+# lib name, version
+LIBNAME=libnfs
+VERSION=a05b17e
+SOURCE=Memphiz-$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+BASE_URL=http://githubredir.debian.net/github/memphiz/libnfs
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+RPC_HEADERS=rpcinc/auth.h rpcinc/auth_unix.h rpcinc/clnt.h rpcinc/pmap_clnt.h rpcinc/pmap_prot.h rpcinc/pmap_rmt.h rpcinc/rpc.h rpcinc/rpc_msg.h rpcinc/svc.h rpcinc/svc_auth.h rpcinc/types.h rpcinc/xdr.h
+
+LIBDYLIB=$(SOURCE)/lib/libnfs.1.0.0.dylib
+
+CLEAN_FILES=$(ARCHIVE) $(SOURCE)
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ -rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ mkdir -p $(PREFIX)/include/rpc
+ install -c -m 644 $(RPC_HEADERS) $(PREFIX)/include/rpc/
+ patch -d $(SOURCE) -p0 < Makefile.in.patch
+ patch -d $(SOURCE) -p0 < nfs.x.patch
+ sed -i bak -e "s|EXAMPLES=|#EXAMPLES=|" $(SOURCE)/Makefile.in
+ cd $(SOURCE); ./autogen.sh
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -r .installed
+ rm -rf $(SOURCE)
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libnfs/Makefile.in.patch b/tools/darwin/depends/libnfs/Makefile.in.patch
new file mode 100644
index 0000000000..fa23a50793
--- /dev/null
+++ b/tools/darwin/depends/libnfs/Makefile.in.patch
@@ -0,0 +1,102 @@
+--- Makefile.in 2011-06-01 13:31:40.000000000 +0200
++++ Makefile.in 2011-06-01 18:39:44.000000000 +0200
+@@ -6,13 +6,14 @@
+
+ INSTALLCMD = @install@ -c
+
+-CC=gcc
+-CFLAGS=-g -O0 -fPIC -Wall -W -I. -Iinclude -Imount -Infs -Iportmap -Irquota "-D_U_=__attribute__((unused))" -D_FILE_OFFSET_BITS=64
++CC=@CC@
++CFLAGS=@CFLAGS@ -g -O0 -fPIC -Wall -W -I. -Iinclude -Imount -Infs -Iportmap -Irquota "-D_U_=__attribute__((unused))"
++LDFLAGS+=@CFLAGS@
+
+ LIBNFS_A=lib/libnfs.a
+-LIBNFS_SO_NAME=libnfs.so.1
++LIBNFS_SO_NAME=libnfs.1.dylib
+ VERSION=1.0.0
+-LIBNFS_SO=lib/libnfs.so.$(VERSION)
++LIBNFS_SO=lib/libnfs.$(VERSION).dylib
+
+ LIB_OBJS = lib/pdu.o lib/init.o lib/socket.o \
+ lib/libnfs.o lib/libnfs-sync.o
+@@ -46,7 +47,7 @@
+
+ $(LIBNFS_SO): $(LIBNFS_OBJS) $(LIB_OBJS)
+ @echo Creating shared library $@
+- $(CC) -shared -Wl,-soname=$(LIBNFS_SO_NAME) -o $@ $(LIBNFS_OBJS) $(LIB_OBJS)
++ $(CC) $(LDFLAGS) -dynamiclib -o $@ $(LIBNFS_OBJS) $(LIB_OBJS)
+
+ portmap/libnfs-raw-portmap.h: portmap/portmap.x
+ @echo Generating $@
+@@ -54,7 +54,7 @@
+
+ portmap/libnfs-raw-portmap.c: portmap/portmap.x
+ @echo Generating $@
+- rpcgen -c portmap/portmap.x | sed -e "s/#include \"portmap\/portmap.h\"/#include \"libnfs-raw-portmap.h\"/" > portmap/libnfs-raw-portmap.c
++ rpcgen -c portmap/portmap.x | sed -e "s/#include \"portmap.h\"/#include \"libnfs-raw-portmap.h\"/" > portmap/libnfs-raw-portmap.c
+
+ portmap/libnfs-raw-portmap.o: portmap/libnfs-raw-portmap.c portmap/libnfs-raw-portmap.h
+ @echo Compiling $@
+@@ -66,7 +66,7 @@
+
+ mount/libnfs-raw-mount.c: mount/mount.x
+ @echo Generating $@
+- rpcgen -c mount/mount.x | sed -e "s/#include \"mount\/mount.h\"/#include \"libnfs-raw-mount.h\"/" > mount/libnfs-raw-mount.c
++ rpcgen -c mount/mount.x | sed -e "s/#include \"mount.h\"/#include \"libnfs-raw-mount.h\"/" > mount/libnfs-raw-mount.c
+
+ mount/libnfs-raw-mount.o: mount/libnfs-raw-mount.c mount/libnfs-raw-mount.h
+ @echo Compiling $@
+@@ -78,7 +78,7 @@
+
+ nfs/libnfs-raw-nfs.c: nfs/nfs.x
+ @echo Generating $@
+- rpcgen -c nfs/nfs.x | sed -e "s/#include \"nfs\/nfs.h\"/#include \"libnfs-raw-nfs.h\"/" > nfs/libnfs-raw-nfs.c
++ rpcgen -c nfs/nfs.x | sed -e "s/#include \"nfs.h\"/#include \"libnfs-raw-nfs.h\"/" > nfs/libnfs-raw-nfs.c
+
+ nfs/libnfs-raw-nfs.o: nfs/libnfs-raw-nfs.c nfs/libnfs-raw-nfs.h
+ @echo Compiling $@
+@@ -90,7 +90,7 @@
+
+ rquota/libnfs-raw-rquota.c: rquota/rquota.x
+ @echo Generating $@
+- rpcgen -c rquota/rquota.x | sed -e "s/#include \"rquota\/rquota.h\"/#include \"libnfs-raw-rquota.h\"/" > rquota/libnfs-raw-rquota.c
++ rpcgen -c rquota/rquota.x | sed -e "s/#include \"rquota.h\"/#include \"libnfs-raw-rquota.h\"/" > rquota/libnfs-raw-rquota.c
+
+ rquota/libnfs-raw-rquota.o: rquota/libnfs-raw-rquota.c rquota/libnfs-raw-rquota.h
+ @echo Compiling $@
+@@ -98,25 +99,27 @@
+
+ install: $(LIBNFS_A) $(LIBNFS_SO)
+ ifeq ("$(LIBDIR)x","x")
++ mkdir -p $(libdir)
+ $(INSTALLCMD) -m 755 $(LIBNFS_SO) $(libdir)
+ $(INSTALLCMD) -m 755 $(LIBNFS_A) $(libdir)
+- @ldconfig@
+ else
++ mkdir -p $(LIBDIR)
+ $(INSTALLCMD) -m 755 $(LIBISCSI_SO) $(LIBDIR)
+ $(INSTALLCMD) -m 755 $(LIBNFS_A) $(LIBDIR)
+ endif
+- mkdir -p $(DESTDIR)/usr/include/nfsc
+- $(INSTALLCMD) -m 644 include/libnfs.h $(DESTDIR)/usr/include/nfsc
+- $(INSTALLCMD) -m 644 include/libnfs-private.h $(DESTDIR)/usr/include/nfsc
+- $(INSTALLCMD) -m 644 mount/libnfs-raw-mount.h $(DESTDIR)/usr/include/nfsc
+- $(INSTALLCMD) -m 644 nfs/libnfs-raw-nfs.h $(DESTDIR)/usr/include/nfsc
+- $(INSTALLCMD) -m 644 portmap/libnfs-raw-portmap.h $(DESTDIR)/usr/include/nfsc
++ mkdir -p $(prefix)/include/nfsc
++ $(INSTALLCMD) -m 644 include/libnfs.h $(prefix)/include/nfsc
++ $(INSTALLCMD) -m 644 include/libnfs-private.h $(prefix)/include/nfsc
++ $(INSTALLCMD) -m 644 mount/libnfs-raw-mount.h $(prefix)/include/nfsc
++ $(INSTALLCMD) -m 644 nfs/libnfs-raw-nfs.h $(prefix)/include/nfsc
++ $(INSTALLCMD) -m 644 portmap/libnfs-raw-portmap.h $(prefix)/include/nfsc
+
+ distclean: clean
+ rm -f config.h config.log config.status configure Makefile
+
+ clean:
+- rm -f bin/* lib/*.o lib/*.a $(LIBNFS_SO)
++ rm -r -f bin/*
++ rm -f lib/*.o lib/*.a $(LIBNFS_SO)
+ rm -f mount/*.o mount/libnfs-raw-mount.h mount/libnfs-raw-mount.c
+ rm -f nfs/*.o nfs/libnfs-raw-nfs.h nfs/libnfs-raw-nfs.c
+ rm -f portmap/*.o portmap/libnfs-raw-portmap.h portmap/libnfs-raw-portmap.c
diff --git a/tools/darwin/depends/libnfs/nfs.x.patch b/tools/darwin/depends/libnfs/nfs.x.patch
new file mode 100644
index 0000000000..dcf283d945
--- /dev/null
+++ b/tools/darwin/depends/libnfs/nfs.x.patch
@@ -0,0 +1,11 @@
+--- nfs/nfs.x 2011-06-01 13:31:40.000000000 +0200
++++ nfs/nfs.x 2011-06-01 18:45:45.000000000 +0200
+@@ -7,7 +7,7 @@
+
+ typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
+
+-typedef unsigned hyper uint64;
++typedef u_int64_t uint64;
+ typedef uint64 cookie3;
+
+ struct nfs_fh3 {
diff --git a/tools/darwin/depends/libnfs/rpcinc/auth.h b/tools/darwin/depends/libnfs/rpcinc/auth.h
new file mode 100644
index 0000000000..1f9394efe0
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/auth.h
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)auth.h 1.17 88/02/08 SMI
+ * from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC
+ * $Id: auth.h,v 1.4 2004/11/25 19:41:19 emoy Exp $
+ */
+
+/*
+ * auth.h, Authentication interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ *
+ * The data structures are completely opaque to the client. The client
+ * is required to pass a AUTH * to routines that create rpc
+ * "sessions".
+ */
+
+#ifndef _RPC_AUTH_H
+#define _RPC_AUTH_H
+#include <sys/cdefs.h>
+
+#define MAX_AUTH_BYTES 400
+#define MAXNETNAMELEN 255 /* maximum length of network user's name */
+
+/*
+ * Status returned from authentication check
+ */
+enum auth_stat {
+ AUTH_OK=0,
+ /*
+ * failed at remote end
+ */
+ AUTH_BADCRED=1, /* bogus credentials (seal broken) */
+ AUTH_REJECTEDCRED=2, /* client should begin new session */
+ AUTH_BADVERF=3, /* bogus verifier (seal broken) */
+ AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */
+ AUTH_TOOWEAK=5, /* rejected due to security reasons */
+ /*
+ * failed locally
+ */
+ AUTH_INVALIDRESP=6, /* bogus response verifier */
+ AUTH_FAILED=7 /* some unknown reason */
+};
+
+/* 32-bit unsigned integers */
+#ifdef __LP64__
+typedef unsigned int u_int32;
+#else
+typedef unsigned long u_int32;
+#endif
+
+union des_block {
+ struct {
+ u_int32 high;
+ u_int32 low;
+ } key;
+ char c[8];
+};
+typedef union des_block des_block;
+__BEGIN_DECLS
+extern bool_t xdr_des_block __P((XDR *, des_block *));
+__END_DECLS
+
+/*
+ * Authentication info. Opaque to client.
+ */
+struct opaque_auth {
+ enum_t oa_flavor; /* flavor of auth */
+ caddr_t oa_base; /* address of more auth stuff */
+ unsigned int oa_length; /* not to exceed MAX_AUTH_BYTES */
+};
+
+
+/*
+ * Auth handle, interface to client side authenticators.
+ */
+typedef struct {
+ struct opaque_auth ah_cred;
+ struct opaque_auth ah_verf;
+ union des_block ah_key;
+ struct auth_ops {
+#ifdef __cplusplus
+ void (*ah_nextverf)(...);
+ int (*ah_marshal)(...); /* nextverf & serialize */
+ int (*ah_validate)(...); /* validate varifier */
+ int (*ah_refresh)(...); /* refresh credentials */
+ void (*ah_destroy)(...); /* destroy this structure */
+#else
+ /* DO NOT REMOVE THE COMMENTED OUT ...: fixincludes needs to see them */
+ void (*ah_nextverf)(/*...*/);
+ int (*ah_marshal)(/*...*/); /* nextverf & serialize */
+ int (*ah_validate)(/*...*/); /* validate varifier */
+ int (*ah_refresh)(/*...*/); /* refresh credentials */
+ void (*ah_destroy)(/*...*/); /* destroy this structure */
+#endif
+ } *ah_ops;
+ caddr_t ah_private;
+} AUTH;
+
+
+/*
+ * Authentication ops.
+ * The ops and the auth handle provide the interface to the authenticators.
+ *
+ * AUTH *auth;
+ * XDR *xdrs;
+ * struct opaque_auth verf;
+ */
+#define AUTH_NEXTVERF(auth) \
+ ((*((auth)->ah_ops->ah_nextverf))(auth))
+#define auth_nextverf(auth) \
+ ((*((auth)->ah_ops->ah_nextverf))(auth))
+
+#define AUTH_MARSHALL(auth, xdrs) \
+ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+#define auth_marshall(auth, xdrs) \
+ ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
+
+#define AUTH_VALIDATE(auth, verfp) \
+ ((*((auth)->ah_ops->ah_validate))((auth), verfp))
+#define auth_validate(auth, verfp) \
+ ((*((auth)->ah_ops->ah_validate))((auth), verfp))
+
+#define AUTH_REFRESH(auth) \
+ ((*((auth)->ah_ops->ah_refresh))(auth))
+#define auth_refresh(auth) \
+ ((*((auth)->ah_ops->ah_refresh))(auth))
+
+#define AUTH_DESTROY(auth) \
+ ((*((auth)->ah_ops->ah_destroy))(auth))
+#define auth_destroy(auth) \
+ ((*((auth)->ah_ops->ah_destroy))(auth))
+
+
+extern struct opaque_auth _null_auth;
+
+
+/*
+ * These are the various implementations of client side authenticators.
+ */
+
+/*
+ * Unix style authentication
+ * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
+ * char *machname;
+ * int uid;
+ * int gid;
+ * int len;
+ * int *aup_gids;
+ */
+__BEGIN_DECLS
+extern AUTH *authunix_create __P((char *, int, int, int, int *));
+extern AUTH *authunix_create_default __P((void));
+extern AUTH *authnone_create __P((void));
+extern AUTH *authdes_create __P((char *, unsigned int,
+ struct sockaddr_in *,
+ des_block *));
+__END_DECLS
+
+#define AUTH_NONE 0 /* no authentication */
+#define AUTH_NULL 0 /* backward compatibility */
+#define AUTH_UNIX 1 /* unix style (uid, gids) */
+#define AUTH_SHORT 2 /* short hand unix style */
+#define AUTH_DES 3 /* des style (encrypted timestamps) */
+
+#endif /* !_RPC_AUTH_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/auth_unix.h b/tools/darwin/depends/libnfs/rpcinc/auth_unix.h
new file mode 100644
index 0000000000..496defb79a
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/auth_unix.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)auth_unix.h 1.8 88/02/08 SMI
+ * from: @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC
+ * $Id: auth_unix.h,v 1.4 2004/10/28 21:58:21 emoy Exp $
+ */
+
+/*
+ * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+/*
+ * The system is very weak. The client uses no encryption for it
+ * credentials and only sends null verifiers. The server sends backs
+ * null verifiers or optionally a verifier that suggests a new short hand
+ * for the credentials.
+ */
+
+#ifndef _RPC_AUTH_UNIX_H
+#define _RPC_AUTH_UNIX_H
+#include <sys/cdefs.h>
+
+/* The machine name is part of a credential; it may not exceed 255 bytes */
+#define MAX_MACHINE_NAME 255
+
+/*
+ * Unix style credentials.
+ */
+struct authunix_parms {
+#ifdef __LP64__
+ unsigned int aup_time;
+#else
+ unsigned long aup_time;
+#endif
+ char *aup_machname;
+ int aup_uid;
+ int aup_gid;
+ unsigned int aup_len;
+ int *aup_gids;
+};
+
+__BEGIN_DECLS
+extern bool_t xdr_authunix_parms __P((XDR *, struct authunix_parms *));
+__END_DECLS
+
+/*
+ * If a response verifier has flavor AUTH_SHORT,
+ * then the body of the response verifier encapsulates the following structure;
+ * again it is serialized in the obvious fashion.
+ */
+struct short_hand_verf {
+ struct opaque_auth new_cred;
+};
+
+#endif /* !_RPC_AUTH_UNIX_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/clnt.h b/tools/darwin/depends/libnfs/rpcinc/clnt.h
new file mode 100644
index 0000000000..4ed9b51bf3
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/clnt.h
@@ -0,0 +1,445 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)clnt.h 1.31 88/02/08 SMI
+ * from: @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC
+ * $Id: clnt.h,v 1.4 2004/10/28 21:58:22 emoy Exp $
+ */
+
+/*
+ * clnt.h - Client side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_CLNT_H_
+#define _RPC_CLNT_H_
+#include <sys/cdefs.h>
+
+/*
+ * Rpc calls return an enum clnt_stat. This should be looked at more,
+ * since each implementation is required to live with this (implementation
+ * independent) list of errors.
+ */
+
+/* Avoid collision with mach definition */
+#if defined(RPC_SUCCESS)
+#undef RPC_SUCCESS
+#endif
+
+enum clnt_stat {
+ RPC_SUCCESS=0, /* call succeeded */
+ /*
+ * local errors
+ */
+ RPC_CANTENCODEARGS=1, /* can't encode arguments */
+ RPC_CANTDECODERES=2, /* can't decode results */
+ RPC_CANTSEND=3, /* failure in sending call */
+ RPC_CANTRECV=4, /* failure in receiving result */
+ RPC_TIMEDOUT=5, /* call timed out */
+ /*
+ * remote errors
+ */
+ RPC_VERSMISMATCH=6, /* rpc versions not compatible */
+ RPC_AUTHERROR=7, /* authentication error */
+ RPC_PROGUNAVAIL=8, /* program not available */
+ RPC_PROGVERSMISMATCH=9, /* program version mismatched */
+ RPC_PROCUNAVAIL=10, /* procedure unavailable */
+ RPC_CANTDECODEARGS=11, /* decode arguments error */
+ RPC_SYSTEMERROR=12, /* generic "other problem" */
+
+ /*
+ * callrpc & clnt_create errors
+ */
+ RPC_UNKNOWNHOST=13, /* unknown host name */
+ RPC_UNKNOWNPROTO=17, /* unkown protocol */
+
+ /*
+ * _ create errors
+ */
+ RPC_PMAPFAILURE=14, /* the pmapper failed in its call */
+ RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
+ /*
+ * unspecified error
+ */
+ RPC_FAILED=16
+};
+
+
+/*
+ * Error info.
+ */
+struct rpc_err {
+ enum clnt_stat re_status;
+ union {
+ int RE_errno; /* realated system error */
+ enum auth_stat RE_why; /* why the auth error occurred */
+ struct {
+#ifdef __LP64__
+ unsigned int low; /* lowest verion supported */
+ unsigned int high; /* highest verion supported */
+#else
+ unsigned long low; /* lowest verion supported */
+ unsigned long high; /* highest verion supported */
+#endif
+ } RE_vers;
+ struct { /* maybe meaningful if RPC_FAILED */
+#ifdef __LP64__
+ int s1;
+ int s2;
+#else
+ long s1;
+ long s2;
+#endif
+ } RE_lb; /* life boot & debugging only */
+ } ru;
+#define re_errno ru.RE_errno
+#define re_why ru.RE_why
+#define re_vers ru.RE_vers
+#define re_lb ru.RE_lb
+};
+
+
+/*
+ * Client rpc handle.
+ * Created by individual implementations, see e.g. rpc_udp.c.
+ * Client is responsible for initializing auth, see e.g. auth_none.c.
+ */
+typedef struct CLIENT CLIENT;
+struct CLIENT
+{
+ AUTH *cl_auth; /* authenticator */
+ struct clnt_ops {
+#ifdef __LP64__
+ enum clnt_stat (*cl_call)(CLIENT *, unsigned int, xdrproc_t, void *, xdrproc_t, void *, struct timeval); /* call remote procedure */
+#else
+ enum clnt_stat (*cl_call)(CLIENT *, unsigned long, xdrproc_t, void *, xdrproc_t, void *, struct timeval); /* call remote procedure */
+#endif
+ void (*cl_abort)(void); /* abort a call */
+ void (*cl_geterr)(CLIENT *, struct rpc_err *); /* get specific error code */
+ bool_t (*cl_freeres)(CLIENT *, xdrproc_t, void *); /* frees results */
+ void (*cl_destroy)(CLIENT *); /* destroy this structure */
+ bool_t (*cl_control)(CLIENT *, int, char *); /* the ioctl() of rpc */
+ } *cl_ops;
+ caddr_t cl_private; /* private stuff */
+};
+
+/*
+ * client side rpc interface ops
+ *
+ * Parameter types are:
+ *
+ */
+
+/*
+ * enum clnt_stat
+ * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
+ * CLIENT *rh;
+ * u_long proc;
+ * xdrproc_t xargs;
+ * caddr_t argsp;
+ * xdrproc_t xres;
+ * caddr_t resp;
+ * struct timeval timeout;
+ */
+#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
+ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
+ ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
+
+/*
+ * void
+ * CLNT_ABORT(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
+#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
+
+/*
+ * struct rpc_err
+ * CLNT_GETERR(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
+#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
+
+
+/*
+ * bool_t
+ * CLNT_FREERES(rh, xres, resp);
+ * CLIENT *rh;
+ * xdrproc_t xres;
+ * caddr_t resp;
+ */
+#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
+
+/*
+ * bool_t
+ * CLNT_CONTROL(cl, request, info)
+ * CLIENT *cl;
+ * unsigned int request;
+ * char *info;
+ */
+#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
+
+/*
+ * control operations that apply to both udp and tcp transports
+ */
+#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
+#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
+#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
+/*
+ * udp only control operations
+ */
+#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
+#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
+
+/*
+ * void
+ * CLNT_DESTROY(rh);
+ * CLIENT *rh;
+ */
+#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
+#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
+
+
+/*
+ * RPCTEST is a test program which is accessable on every rpc
+ * transport/port. It is used for testing, performance evaluation,
+ * and network administration.
+ */
+
+#ifdef __LP64__
+#define RPCTEST_PROGRAM ((unsigned int)1)
+#define RPCTEST_VERSION ((unsigned int)1)
+#define RPCTEST_NULL_PROC ((unsigned int)2)
+#define RPCTEST_NULL_BATCH_PROC ((unsigned int)3)
+#else
+#define RPCTEST_PROGRAM ((unsigned long)1)
+#define RPCTEST_VERSION ((unsigned long)1)
+#define RPCTEST_NULL_PROC ((unsigned long)2)
+#define RPCTEST_NULL_BATCH_PROC ((unsigned long)3)
+#endif
+
+/*
+ * By convention, procedure 0 takes null arguments and returns them
+ */
+
+#ifdef __LP64__
+#define NULLPROC ((unsigned int)0)
+#else
+#define NULLPROC ((unsigned long)0)
+#endif
+
+/*
+ * Below are the client handle creation routines for the various
+ * implementations of client side rpc. They can return NULL if a
+ * creation failure occurs.
+ */
+
+/*
+ * Memory based rpc (for speed check and testing)
+ * CLIENT *
+ * clntraw_create(prog, vers)
+ * u_long prog;
+ * u_long vers;
+ */
+__BEGIN_DECLS
+#ifdef __LP64__
+extern CLIENT *clntraw_create __P((unsigned int, unsigned int));
+#else
+extern CLIENT *clntraw_create __P((unsigned long, unsigned long));
+#endif
+__END_DECLS
+
+
+/*
+ * Generic client creation routine. Supported protocols are "udp" and "tcp"
+ * CLIENT *
+ * clnt_create(host, prog, vers, prot);
+ * char *host; -- hostname
+ * u_long prog; -- program number
+ * u_long vers; -- version number
+ * char *prot; -- protocol
+ */
+__BEGIN_DECLS
+#ifdef __LP64__
+extern CLIENT *clnt_create __P((char *, unsigned int, unsigned int, char *));
+#else
+extern CLIENT *clnt_create __P((char *, unsigned long, unsigned long, char *));
+#endif
+__END_DECLS
+
+
+/*
+ * TCP based rpc
+ * CLIENT *
+ * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
+ * struct sockaddr_in *raddr;
+ * u_long prog;
+ * u_long version;
+ * register int *sockp;
+ * unsigned int sendsz;
+ * unsigned int recvsz;
+ */
+__BEGIN_DECLS
+#ifdef __LP64__
+extern CLIENT *clnttcp_create __P((struct sockaddr_in *,
+ unsigned int,
+ unsigned int,
+ int *,
+ unsigned int,
+ unsigned int));
+#else
+extern CLIENT *clnttcp_create __P((struct sockaddr_in *,
+ unsigned long,
+ unsigned long,
+ int *,
+ unsigned int,
+ unsigned int));
+#endif
+__END_DECLS
+
+
+/*
+ * UDP based rpc.
+ * CLIENT *
+ * clntudp_create(raddr, program, version, wait, sockp)
+ * struct sockaddr_in *raddr;
+ * u_long program;
+ * u_long version;
+ * struct timeval wait;
+ * int *sockp;
+ *
+ * Same as above, but you specify max packet sizes.
+ * CLIENT *
+ * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
+ * struct sockaddr_in *raddr;
+ * u_long program;
+ * u_long version;
+ * struct timeval wait;
+ * int *sockp;
+ * unsigned int sendsz;
+ * unsigned int recvsz;
+ */
+__BEGIN_DECLS
+#ifdef __LP64__
+extern CLIENT *clntudp_create __P((struct sockaddr_in *,
+ unsigned int,
+ unsigned int,
+ struct timeval,
+ int *));
+extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *,
+ unsigned int,
+ unsigned int,
+ struct timeval,
+ int *,
+ unsigned int,
+ unsigned int));
+#else
+extern CLIENT *clntudp_create __P((struct sockaddr_in *,
+ unsigned long,
+ unsigned long,
+ struct timeval,
+ int *));
+extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *,
+ unsigned long,
+ unsigned long,
+ struct timeval,
+ int *,
+ unsigned int,
+ unsigned int));
+#endif
+__END_DECLS
+
+
+/*
+ * Print why creation failed
+ */
+__BEGIN_DECLS
+extern void clnt_pcreateerror __P((char *)); /* stderr */
+extern char *clnt_spcreateerror __P((char *)); /* string */
+__END_DECLS
+
+/*
+ * Like clnt_perror(), but is more verbose in its output
+ */
+__BEGIN_DECLS
+extern void clnt_perrno __P((enum clnt_stat)); /* stderr */
+extern char *clnt_sperrno __P((enum clnt_stat)); /* string */
+__END_DECLS
+
+/*
+ * Print an English error message, given the client error code
+ */
+__BEGIN_DECLS
+extern void clnt_perror __P((CLIENT *, char *)); /* stderr */
+extern char *clnt_sperror __P((CLIENT *, char *)); /* string */
+__END_DECLS
+
+
+/*
+ * If a creation fails, the following allows the user to figure out why.
+ */
+struct rpc_createerr {
+ enum clnt_stat cf_stat;
+ struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+};
+
+extern struct rpc_createerr rpc_createerr;
+
+
+#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
+#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
+
+#endif /* !_RPC_CLNT_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h b/tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h
new file mode 100644
index 0000000000..c07a81902b
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)pmap_clnt.h 1.11 88/02/08 SMI
+ * from: @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC
+ * $Id: pmap_clnt.h,v 1.3 2004/10/28 21:58:22 emoy Exp $
+ */
+
+/*
+ * pmap_clnt.h
+ * Supplies C routines to get to portmap services.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+/*
+ * Usage:
+ * success = pmap_set(program, version, protocol, port);
+ * success = pmap_unset(program, version);
+ * port = pmap_getport(address, program, version, protocol);
+ * head = pmap_getmaps(address);
+ * clnt_stat = pmap_rmtcall(address, program, version, procedure,
+ * xdrargs, argsp, xdrres, resp, tout, port_ptr)
+ * (works for udp only.)
+ * clnt_stat = clnt_broadcast(program, version, procedure,
+ * xdrargs, argsp, xdrres, resp, eachresult)
+ * (like pmap_rmtcall, except the call is broadcasted to all
+ * locally connected nets. For each valid response received,
+ * the procedure eachresult is called. Its form is:
+ * done = eachresult(resp, raddr)
+ * bool_t done;
+ * caddr_t resp;
+ * struct sockaddr_in raddr;
+ * where resp points to the results of the call and raddr is the
+ * address if the responder to the broadcast.
+ */
+
+#ifndef _RPC_PMAPCLNT_H
+#define _RPC_PMAPCLNT_H
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+#ifdef __LP64__
+extern bool_t pmap_set __P((unsigned int, unsigned int, int, int));
+extern bool_t pmap_unset __P((unsigned int, unsigned int));
+extern enum clnt_stat pmap_rmtcall __P((struct sockaddr_in *,
+ unsigned int, unsigned int, unsigned int,
+ xdrproc_t, caddr_t,
+ xdrproc_t, caddr_t,
+ struct timeval, unsigned int *));
+extern enum clnt_stat clnt_broadcast __P((unsigned int, unsigned int, unsigned int,
+ xdrproc_t, char *,
+ xdrproc_t, char *,
+ bool_t (*)()));
+extern unsigned short pmap_getport __P((struct sockaddr_in *,
+ unsigned int, unsigned int, unsigned int));
+#else
+extern bool_t pmap_set __P((unsigned long, unsigned long, int, int));
+extern bool_t pmap_unset __P((unsigned long, unsigned long));
+extern enum clnt_stat pmap_rmtcall __P((struct sockaddr_in *,
+ unsigned long, unsigned long, unsigned long,
+ xdrproc_t, caddr_t,
+ xdrproc_t, caddr_t,
+ struct timeval, unsigned long *));
+extern enum clnt_stat clnt_broadcast __P((unsigned long, unsigned long, unsigned long,
+ xdrproc_t, char *,
+ xdrproc_t, char *,
+ bool_t (*)()));
+extern unsigned short pmap_getport __P((struct sockaddr_in *,
+ unsigned long, unsigned long, unsigned int));
+#endif
+extern struct pmaplist *pmap_getmaps __P((struct sockaddr_in *));
+extern int getrpcport __P((char *, int, int, int));
+__END_DECLS
+
+#endif /* !_RPC_PMAPCLNT_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/pmap_prot.h b/tools/darwin/depends/libnfs/rpcinc/pmap_prot.h
new file mode 100644
index 0000000000..c5dc139e41
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/pmap_prot.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)pmap_prot.h 1.14 88/02/08 SMI
+ * from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC
+ * $Id: pmap_prot.h,v 1.3 2004/10/28 21:58:22 emoy Exp $
+ */
+
+/*
+ * pmap_prot.h
+ * Protocol for the local binder service, or pmap.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ *
+ * The following procedures are supported by the protocol:
+ *
+ * PMAPPROC_NULL() returns ()
+ * takes nothing, returns nothing
+ *
+ * PMAPPROC_SET(struct pmap) returns (bool_t)
+ * TRUE is success, FALSE is failure. Registers the tuple
+ * [prog, vers, prot, port].
+ *
+ * PMAPPROC_UNSET(struct pmap) returns (bool_t)
+ * TRUE is success, FALSE is failure. Un-registers pair
+ * [prog, vers]. prot and port are ignored.
+ *
+ * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
+ * 0 is failure. Otherwise returns the port number where the pair
+ * [prog, vers] is registered. It may lie!
+ *
+ * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
+ *
+ * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
+ * RETURNS (port, string<>);
+ * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
+ * Calls the procedure on the local machine. If it is not registered,
+ * this procedure is quite; ie it does not return error information!!!
+ * This procedure only is supported on rpc/udp and calls via
+ * rpc/udp. This routine only passes null authentication parameters.
+ * This file has no interface to xdr routines for PMAPPROC_CALLIT.
+ *
+ * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
+ */
+
+#ifndef _RPC_PMAPPROT_H
+#define _RPC_PMAPPROT_H
+#include <sys/cdefs.h>
+
+#define PMAPPORT ((unsigned short)111)
+#ifdef __LP64__
+#define PMAPPROG ((unsigned int)100000)
+#define PMAPVERS ((unsigned int)2)
+#define PMAPVERS_PROTO ((unsigned int)2)
+#define PMAPVERS_ORIG ((unsigned int)1)
+#define PMAPPROC_NULL ((unsigned int)0)
+#define PMAPPROC_SET ((unsigned int)1)
+#define PMAPPROC_UNSET ((unsigned int)2)
+#define PMAPPROC_GETPORT ((unsigned int)3)
+#define PMAPPROC_DUMP ((unsigned int)4)
+#define PMAPPROC_CALLIT ((unsigned int)5)
+#else
+#define PMAPPROG ((unsigned long)100000)
+#define PMAPVERS ((unsigned long)2)
+#define PMAPVERS_PROTO ((unsigned long)2)
+#define PMAPVERS_ORIG ((unsigned long)1)
+#define PMAPPROC_NULL ((unsigned long)0)
+#define PMAPPROC_SET ((unsigned long)1)
+#define PMAPPROC_UNSET ((unsigned long)2)
+#define PMAPPROC_GETPORT ((unsigned long)3)
+#define PMAPPROC_DUMP ((unsigned long)4)
+#define PMAPPROC_CALLIT ((unsigned long)5)
+#endif
+
+struct pmap {
+#ifdef __LP64__
+ unsigned int pm_prog;
+ unsigned int pm_vers;
+ unsigned int pm_prot;
+ unsigned int pm_port;
+#else
+ long unsigned pm_prog;
+ long unsigned pm_vers;
+ long unsigned pm_prot;
+ long unsigned pm_port;
+#endif
+};
+
+struct pmaplist {
+ struct pmap pml_map;
+ struct pmaplist *pml_next;
+};
+
+__BEGIN_DECLS
+extern bool_t xdr_pmap __P((XDR *, struct pmap *));
+extern bool_t xdr_pmaplist __P((XDR *, struct pmaplist **));
+__END_DECLS
+
+#endif /* !_RPC_PMAPPROT_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h b/tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h
new file mode 100644
index 0000000000..9ffbd1cb45
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)pmap_rmt.h 1.2 88/02/08 SMI
+ * from: @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC
+ * $Id: pmap_rmt.h,v 1.3 2004/10/28 21:58:23 emoy Exp $
+ */
+
+/*
+ * Structures and XDR routines for parameters to and replies from
+ * the portmapper remote-call-service.
+ *
+ * Copyright (C) 1986, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_PMAPRMT_H
+#define _RPC_PMAPRMT_H
+#include <sys/cdefs.h>
+
+struct rmtcallargs {
+#ifdef __LP64__
+ unsigned int prog, vers, proc, arglen;
+#else
+ unsigned long prog, vers, proc, arglen;
+#endif
+ caddr_t args_ptr;
+ xdrproc_t xdr_args;
+};
+
+struct rmtcallres {
+#ifdef __LP64__
+ unsigned int *port_ptr;
+ unsigned int resultslen;
+#else
+ unsigned long *port_ptr;
+ unsigned long resultslen;
+#endif
+ caddr_t results_ptr;
+ xdrproc_t xdr_results;
+};
+
+__BEGIN_DECLS
+extern bool_t xdr_rmtcall_args __P((XDR *, struct rmtcallargs *));
+extern bool_t xdr_rmtcallres __P((XDR *, struct rmtcallres *));
+__END_DECLS
+
+#endif /* !_RPC_PMAPRMT_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/rpc.h b/tools/darwin/depends/libnfs/rpcinc/rpc.h
new file mode 100644
index 0000000000..da89dff563
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/rpc.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)rpc.h 1.9 88/02/08 SMI
+ * from: @(#)rpc.h 2.4 89/07/11 4.0 RPCSRC
+ * $Id: rpc.h,v 1.2 1999/10/14 21:56:53 wsanchez Exp $
+ */
+
+/*
+ * rpc.h, Just includes the billions of rpc header files necessary to
+ * do remote procedure calling.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+#ifndef _RPC_RPC_H
+#define _RPC_RPC_H
+
+#include <rpc/types.h> /* some typedefs */
+#include <netinet/in.h>
+
+/* external data representation interfaces */
+#include <rpc/xdr.h> /* generic (de)serializer */
+
+/* Client side only authentication */
+#include <rpc/auth.h> /* generic authenticator (client side) */
+
+/* Client side (mostly) remote procedure call */
+#include <rpc/clnt.h> /* generic rpc stuff */
+
+/* semi-private protocol headers */
+#include <rpc/rpc_msg.h> /* protocol for rpc messages */
+#include <rpc/auth_unix.h> /* protocol for unix style cred */
+/*
+ * Uncomment-out the next line if you are building the rpc library with
+ * DES Authentication (see the README file in the secure_rpc/ directory).
+ */
+/*#include <rpc/auth_des.h> protocol for des style cred */
+
+/* Server side only remote procedure callee */
+#include <rpc/svc.h> /* service manager and multiplexer */
+#include <rpc/svc_auth.h> /* service side authenticator */
+
+#include <netdb.h>
+
+#endif /* !_RPC_RPC_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/rpc_msg.h b/tools/darwin/depends/libnfs/rpcinc/rpc_msg.h
new file mode 100644
index 0000000000..ec2d929c61
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/rpc_msg.h
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)rpc_msg.h 1.7 86/07/16 SMI
+ * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
+ * $Id: rpc_msg.h,v 1.3 2004/10/28 21:58:24 emoy Exp $
+ */
+
+/*
+ * rpc_msg.h
+ * rpc message definition
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_RPCMSG_H
+#define _RPC_RPCMSG_H
+
+#ifdef __LP64__
+#define RPC_MSG_VERSION ((unsigned int) 2)
+#else
+#define RPC_MSG_VERSION ((unsigned long) 2)
+#endif
+#define RPC_SERVICE_PORT ((unsigned short) 2048)
+
+/*
+ * Bottom up definition of an rpc message.
+ * NOTE: call and reply use the same overall stuct but
+ * different parts of unions within it.
+ */
+
+enum msg_type {
+ CALL=0,
+ REPLY=1
+};
+
+enum reply_stat {
+ MSG_ACCEPTED=0,
+ MSG_DENIED=1
+};
+
+enum accept_stat {
+ SUCCESS=0,
+ PROG_UNAVAIL=1,
+ PROG_MISMATCH=2,
+ PROC_UNAVAIL=3,
+ GARBAGE_ARGS=4,
+ SYSTEM_ERR=5
+};
+
+enum reject_stat {
+ RPC_MISMATCH=0,
+ AUTH_ERROR=1
+};
+
+/*
+ * Reply part of an rpc exchange
+ */
+
+/*
+ * Reply to an rpc request that was accepted by the server.
+ * Note: there could be an error even though the request was
+ * accepted.
+ */
+struct accepted_reply {
+ struct opaque_auth ar_verf;
+ enum accept_stat ar_stat;
+ union {
+ struct {
+#ifdef __LP64__
+ unsigned int low;
+ unsigned int high;
+#else
+ unsigned long low;
+ unsigned long high;
+#endif
+ } AR_versions;
+ struct {
+ caddr_t where;
+ xdrproc_t proc;
+ } AR_results;
+ /* and many other null cases */
+ } ru;
+#define ar_results ru.AR_results
+#define ar_vers ru.AR_versions
+};
+
+/*
+ * Reply to an rpc request that was rejected by the server.
+ */
+struct rejected_reply {
+ enum reject_stat rj_stat;
+ union {
+ struct {
+#ifdef __LP64__
+ unsigned int low;
+ unsigned int high;
+#else
+ unsigned long low;
+ unsigned long high;
+#endif
+ } RJ_versions;
+ enum auth_stat RJ_why; /* why authentication did not work */
+ } ru;
+#define rj_vers ru.RJ_versions
+#define rj_why ru.RJ_why
+};
+
+/*
+ * Body of a reply to an rpc request.
+ */
+struct reply_body {
+ enum reply_stat rp_stat;
+ union {
+ struct accepted_reply RP_ar;
+ struct rejected_reply RP_dr;
+ } ru;
+#define rp_acpt ru.RP_ar
+#define rp_rjct ru.RP_dr
+};
+
+/*
+ * Body of an rpc request call.
+ */
+struct call_body {
+#ifdef __LP64__
+ unsigned int cb_rpcvers; /* must be equal to two */
+ unsigned int cb_prog;
+ unsigned int cb_vers;
+ unsigned int cb_proc;
+#else
+ unsigned long cb_rpcvers; /* must be equal to two */
+ unsigned long cb_prog;
+ unsigned long cb_vers;
+ unsigned long cb_proc;
+#endif
+ struct opaque_auth cb_cred;
+ struct opaque_auth cb_verf; /* protocol specific - provided by client */
+};
+
+/*
+ * The rpc message
+ */
+struct rpc_msg {
+#ifdef __LP64__
+ unsigned int rm_xid;
+#else
+ unsigned long rm_xid;
+#endif
+ enum msg_type rm_direction;
+ union {
+ struct call_body RM_cmb;
+ struct reply_body RM_rmb;
+ } ru;
+#define rm_call ru.RM_cmb
+#define rm_reply ru.RM_rmb
+};
+#define acpted_rply ru.RM_rmb.ru.RP_ar
+#define rjcted_rply ru.RM_rmb.ru.RP_dr
+
+__BEGIN_DECLS
+/*
+ * XDR routine to handle a rpc message.
+ * xdr_callmsg(xdrs, cmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *cmsg;
+ */
+extern bool_t xdr_callmsg __P((XDR *, struct rpc_msg *));
+
+/*
+ * XDR routine to pre-serialize the static part of a rpc message.
+ * xdr_callhdr(xdrs, cmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *cmsg;
+ */
+extern bool_t xdr_callhdr __P((XDR *, struct rpc_msg *));
+
+/*
+ * XDR routine to handle a rpc reply.
+ * xdr_replymsg(xdrs, rmsg)
+ * XDR *xdrs;
+ * struct rpc_msg *rmsg;
+ */
+extern bool_t xdr_replymsg __P((XDR *, struct rpc_msg *));
+
+/*
+ * Fills in the error part of a reply message.
+ * _seterr_reply(msg, error)
+ * struct rpc_msg *msg;
+ * struct rpc_err *error;
+ */
+extern void _seterr_reply __P((struct rpc_msg *, struct rpc_err *));
+__END_DECLS
+
+#endif /* !_RPC_RPCMSG_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/svc.h b/tools/darwin/depends/libnfs/rpcinc/svc.h
new file mode 100644
index 0000000000..d671045f17
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/svc.h
@@ -0,0 +1,360 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)svc.h 1.20 88/02/08 SMI
+ * from: @(#)svc.h 2.2 88/07/29 4.0 RPCSRC
+ * $Id: svc.h,v 1.4 2004/11/25 19:41:19 emoy Exp $
+ */
+
+/*
+ * svc.h, Server-side remote procedure call interface.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_SVC_H
+#define _RPC_SVC_H
+#include <sys/cdefs.h>
+
+/*
+ * This interface must manage two items concerning remote procedure calling:
+ *
+ * 1) An arbitrary number of transport connections upon which rpc requests
+ * are received. The two most notable transports are TCP and UDP; they are
+ * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
+ * they in turn call xprt_register and xprt_unregister.
+ *
+ * 2) An arbitrary number of locally registered services. Services are
+ * described by the following four data: program number, version number,
+ * "service dispatch" function, a transport handle, and a boolean that
+ * indicates whether or not the exported program should be registered with a
+ * local binder service; if true the program's number and version and the
+ * port number from the transport handle are registered with the binder.
+ * These data are registered with the rpc svc system via svc_register.
+ *
+ * A service's dispatch function is called whenever an rpc request comes in
+ * on a transport. The request's program and version numbers must match
+ * those of the registered service. The dispatch function is passed two
+ * parameters, struct svc_req * and SVCXPRT *, defined below.
+ */
+
+enum xprt_stat {
+ XPRT_DIED,
+ XPRT_MOREREQS,
+ XPRT_IDLE
+};
+
+/*
+ * Server side transport handle
+ */
+typedef struct {
+ int xp_sock;
+ unsigned short xp_port; /* associated port number */
+ struct xp_ops {
+#ifdef __cplusplus
+ bool_t (*xp_recv)(...); /* receive incomming requests */
+ enum xprt_stat (*xp_stat)(...); /* get transport status */
+ bool_t (*xp_getargs)(...); /* get arguments */
+ bool_t (*xp_reply)(...); /* send reply */
+ bool_t (*xp_freeargs)(...);/* free mem allocated for args */
+ void (*xp_destroy)(...); /* destroy this struct */
+#else
+ /* DO NOT REMOVE THE COMMENTED OUT ...: fixincludes needs to see them */
+ bool_t (*xp_recv)(/*...*/); /* receive incomming requests */
+ enum xprt_stat (*xp_stat)(/*...*/); /* get transport status */
+ bool_t (*xp_getargs)(/*...*/); /* get arguments */
+ bool_t (*xp_reply)(/*...*/); /* send reply */
+ bool_t (*xp_freeargs)(/*...*/);/* free mem allocated for args */
+ void (*xp_destroy)(/*...*/); /* destroy this struct */
+#endif
+ } *xp_ops;
+ int xp_addrlen; /* length of remote address */
+ struct sockaddr_in xp_raddr; /* remote address */
+ struct opaque_auth xp_verf; /* raw response verifier */
+ caddr_t xp_p1; /* private */
+ caddr_t xp_p2; /* private */
+} SVCXPRT;
+
+/*
+ * Approved way of getting address of caller
+ */
+#define svc_getcaller(x) (&(x)->xp_raddr)
+
+/*
+ * Operations defined on an SVCXPRT handle
+ *
+ * SVCXPRT *xprt;
+ * struct rpc_msg *msg;
+ * xdrproc_t xargs;
+ * caddr_t argsp;
+ */
+#define SVC_RECV(xprt, msg) \
+ (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+#define svc_recv(xprt, msg) \
+ (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
+
+#define SVC_STAT(xprt) \
+ (*(xprt)->xp_ops->xp_stat)(xprt)
+#define svc_stat(xprt) \
+ (*(xprt)->xp_ops->xp_stat)(xprt)
+
+#define SVC_GETARGS(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+#define svc_getargs(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
+
+#define SVC_REPLY(xprt, msg) \
+ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+#define svc_reply(xprt, msg) \
+ (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
+
+#define SVC_FREEARGS(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+#define svc_freeargs(xprt, xargs, argsp) \
+ (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
+
+#define SVC_DESTROY(xprt) \
+ (*(xprt)->xp_ops->xp_destroy)(xprt)
+#define svc_destroy(xprt) \
+ (*(xprt)->xp_ops->xp_destroy)(xprt)
+
+
+/*
+ * Service request
+ */
+struct svc_req {
+#ifdef __LP64__
+ unsigned int rq_prog; /* service program number */
+ unsigned int rq_vers; /* service protocol version */
+ unsigned int rq_proc; /* the desired procedure */
+#else
+ unsigned long rq_prog; /* service program number */
+ unsigned long rq_vers; /* service protocol version */
+ unsigned long rq_proc; /* the desired procedure */
+#endif
+ struct opaque_auth rq_cred; /* raw creds from the wire */
+ caddr_t rq_clntcred; /* read only cooked cred */
+ SVCXPRT *rq_xprt; /* associated transport */
+};
+
+
+/*
+ * Service registration
+ *
+ * svc_register(xprt, prog, vers, dispatch, protocol)
+ * SVCXPRT *xprt;
+ * u_long prog;
+ * u_long vers;
+ * void (*dispatch)(...); // fixincludes needs the ..., even in a comment
+ * int protocol; like TCP or UDP, zero means do not register
+ */
+__BEGIN_DECLS
+#ifdef __LP64__
+extern bool_t svc_register __P((SVCXPRT *, unsigned int, unsigned int, void (*)(), int));
+#else
+extern bool_t svc_register __P((SVCXPRT *, unsigned long, unsigned long, void (*)(), int));
+#endif
+__END_DECLS
+
+/*
+ * Service un-registration
+ *
+ * svc_unregister(prog, vers)
+ * u_long prog;
+ * u_long vers;
+ */
+__BEGIN_DECLS
+#ifdef __LP64__
+extern void svc_unregister __P((unsigned int, unsigned int));
+#else
+extern void svc_unregister __P((unsigned long, unsigned long));
+#endif
+__END_DECLS
+
+/*
+ * Transport registration.
+ *
+ * xprt_register(xprt)
+ * SVCXPRT *xprt;
+ */
+__BEGIN_DECLS
+extern void xprt_register __P((SVCXPRT *));
+__END_DECLS
+
+/*
+ * Transport un-register
+ *
+ * xprt_unregister(xprt)
+ * SVCXPRT *xprt;
+ */
+__BEGIN_DECLS
+extern void xprt_unregister __P((SVCXPRT *));
+__END_DECLS
+
+
+
+
+/*
+ * When the service routine is called, it must first check to see if it
+ * knows about the procedure; if not, it should call svcerr_noproc
+ * and return. If so, it should deserialize its arguments via
+ * SVC_GETARGS (defined above). If the deserialization does not work,
+ * svcerr_decode should be called followed by a return. Successful
+ * decoding of the arguments should be followed the execution of the
+ * procedure's code and a call to svc_sendreply.
+ *
+ * Also, if the service refuses to execute the procedure due to too-
+ * weak authentication parameters, svcerr_weakauth should be called.
+ * Note: do not confuse access-control failure with weak authentication!
+ *
+ * NB: In pure implementations of rpc, the caller always waits for a reply
+ * msg. This message is sent when svc_sendreply is called.
+ * Therefore pure service implementations should always call
+ * svc_sendreply even if the function logically returns void; use
+ * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
+ * for the abuse of pure rpc via batched calling or pipelining. In the
+ * case of a batched call, svc_sendreply should NOT be called since
+ * this would send a return message, which is what batching tries to avoid.
+ * It is the service/protocol writer's responsibility to know which calls are
+ * batched and which are not. Warning: responding to batch calls may
+ * deadlock the caller and server processes!
+ */
+
+__BEGIN_DECLS
+extern bool_t svc_sendreply __P((SVCXPRT *, xdrproc_t, char *));
+extern void svcerr_decode __P((SVCXPRT *));
+extern void svcerr_weakauth __P((SVCXPRT *));
+extern void svcerr_noproc __P((SVCXPRT *));
+#ifdef __LP64__
+extern void svcerr_progvers __P((SVCXPRT *, unsigned int, unsigned int));
+#else
+extern void svcerr_progvers __P((SVCXPRT *, unsigned long, unsigned long));
+#endif
+extern void svcerr_auth __P((SVCXPRT *, enum auth_stat));
+extern void svcerr_noprog __P((SVCXPRT *));
+extern void svcerr_systemerr __P((SVCXPRT *));
+__END_DECLS
+
+/*
+ * Lowest level dispatching -OR- who owns this process anyway.
+ * Somebody has to wait for incoming requests and then call the correct
+ * service routine. The routine svc_run does infinite waiting; i.e.,
+ * svc_run never returns.
+ * Since another (co-existant) package may wish to selectively wait for
+ * incoming calls or other events outside of the rpc architecture, the
+ * routine svc_getreq is provided. It must be passed readfds, the
+ * "in-place" results of a select system call (see select, section 2).
+ */
+
+/*
+ * Global keeper of rpc service descriptors in use
+ * dynamic; must be inspected before each call to select
+ */
+#ifdef FD_SETSIZE
+extern fd_set svc_fdset;
+#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
+#else
+extern int svc_fds;
+#endif /* def FD_SETSIZE */
+
+/*
+ * a small program implemented by the svc_rpc implementation itself;
+ * also see clnt.h for protocol numbers.
+ */
+extern void rpctest_service();
+
+__BEGIN_DECLS
+extern void svc_getreq __P((int));
+extern void svc_getreqset __P((fd_set *));
+extern void svc_run __P((void));
+__END_DECLS
+
+/*
+ * Socket to use on svcxxx_create call to get default socket
+ */
+#define RPC_ANYSOCK -1
+
+/*
+ * These are the existing service side transport implementations
+ */
+
+/*
+ * Memory based rpc for testing and timing.
+ */
+__BEGIN_DECLS
+extern SVCXPRT *svcraw_create __P((void));
+__END_DECLS
+
+
+/*
+ * Udp based rpc.
+ */
+__BEGIN_DECLS
+extern SVCXPRT *svcudp_create __P((int));
+extern SVCXPRT *svcudp_bufcreate __P((int, unsigned int, unsigned int));
+__END_DECLS
+
+
+/*
+ * Tcp based rpc.
+ */
+__BEGIN_DECLS
+extern SVCXPRT *svctcp_create __P((int, unsigned int, unsigned int));
+__END_DECLS
+
+/*
+ * Any open file descriptor based rpc.
+ */
+__BEGIN_DECLS
+extern SVCXPRT *svcfd_create __P((int, u_int, u_int));
+__END_DECLS
+
+#endif /* !_RPC_SVC_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/svc_auth.h b/tools/darwin/depends/libnfs/rpcinc/svc_auth.h
new file mode 100644
index 0000000000..3dc09591f2
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/svc_auth.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)svc_auth.h 1.6 86/07/16 SMI
+ * from: @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC
+ * $Id: svc_auth.h,v 1.2 1999/10/14 21:56:54 wsanchez Exp $
+ */
+
+/*
+ * svc_auth.h, Service side of rpc authentication.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_SVCAUTH_H
+#define _RPC_SVCAUTH_H
+
+/*
+ * Server side authenticator
+ */
+__BEGIN_DECLS
+extern enum auth_stat _authenticate __P((struct svc_req *, struct rpc_msg *));
+__END_DECLS
+
+#endif /* !_RPC_SVCAUTH_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/types.h b/tools/darwin/depends/libnfs/rpcinc/types.h
new file mode 100644
index 0000000000..0fe5adc1c0
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/types.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)types.h 1.18 87/07/24 SMI
+ * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC
+ * $Id: types.h,v 1.4 2003/10/16 22:15:15 majka Exp $
+ */
+
+/*
+ * Rpc additions to <sys/types.h>
+ */
+#ifndef _RPC_TYPES_H
+#define _RPC_TYPES_H
+
+#define bool_t int
+#define enum_t int
+#define __dontcare__ -1
+
+#ifndef FALSE
+# define FALSE (0)
+#endif
+#ifndef TRUE
+# define TRUE (1)
+#endif
+
+#ifndef NULL
+#ifdef __GNUG__
+#define NULL __null
+#else /* ! __GNUG__ */
+#ifndef __cplusplus
+#define NULL ((void *)0)
+#else /* __cplusplus */
+#define NULL 0
+#endif /* ! __cplusplus */
+#endif /* __GNUG__ */
+#endif /* ! NULL */
+
+#define mem_alloc(bsize) calloc(1, bsize)
+#define mem_free(ptr, bsize) free(ptr)
+
+#ifndef makedev /* ie, we haven't already included it */
+#include <sys/types.h>
+#endif
+#include <sys/time.h>
+
+#ifdef __LP64__
+typedef int rpc_int;
+typedef unsigned int rpc_uint;
+#else
+typedef long rpc_int;
+typedef unsigned long rpc_uint;
+#endif
+
+#endif /* !_RPC_TYPES_H */
diff --git a/tools/darwin/depends/libnfs/rpcinc/xdr.h b/tools/darwin/depends/libnfs/rpcinc/xdr.h
new file mode 100644
index 0000000000..9492ccfbbf
--- /dev/null
+++ b/tools/darwin/depends/libnfs/rpcinc/xdr.h
@@ -0,0 +1,430 @@
+/*
+ * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+ * Reserved. This file contains Original Code and/or Modifications of
+ * Original Code as defined in and that are subject to the Apple Public
+ * Source License Version 1.1 (the "License"). You may not use this file
+ * except in compliance with the License. Please obtain a copy of the
+ * License at http://www.apple.com/publicsource and read it before using
+ * this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ *
+ * from: @(#)xdr.h 1.19 87/04/22 SMI
+ * from: @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC
+ * $FreeBSD: src/include/rpc/xdr.h,v 1.23 2003/03/07 13:19:40 nectar Exp $
+ */
+
+/*
+ * xdr.h, External Data Representation Serialization Routines.
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+ */
+
+#ifndef _RPC_XDR_H
+#define _RPC_XDR_H
+#include <sys/cdefs.h>
+
+/*
+ * XDR provides a conventional way for converting between C data
+ * types and an external bit-string representation. Library supplied
+ * routines provide for the conversion on built-in C data types. These
+ * routines and utility routines defined here are used to help implement
+ * a type encode/decode routine for each user-defined type.
+ *
+ * Each data type provides a single procedure which takes two arguments:
+ *
+ * bool_t
+ * xdrproc(xdrs, argresp)
+ * XDR *xdrs;
+ * <type> *argresp;
+ *
+ * xdrs is an instance of a XDR handle, to which or from which the data
+ * type is to be converted. argresp is a pointer to the structure to be
+ * converted. The XDR handle contains an operation field which indicates
+ * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
+ *
+ * XDR_DECODE may allocate space if the pointer argresp is null. This
+ * data can be freed with the XDR_FREE operation.
+ *
+ * We write only one procedure per data type to make it easy
+ * to keep the encode and decode procedures for a data type consistent.
+ * In many cases the same code performs all operations on a user defined type,
+ * because all the hard work is done in the component type routines.
+ * decode as a series of calls on the nested data types.
+ */
+
+/*
+ * Xdr operations. XDR_ENCODE causes the type to be encoded into the
+ * stream. XDR_DECODE causes the type to be extracted from the stream.
+ * XDR_FREE can be used to release the space allocated by an XDR_DECODE
+ * request.
+ */
+enum xdr_op {
+ XDR_ENCODE=0,
+ XDR_DECODE=1,
+ XDR_FREE=2
+};
+
+/*
+ * This is the number of bytes per unit of external data.
+ */
+#define BYTES_PER_XDR_UNIT (4)
+#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
+ * BYTES_PER_XDR_UNIT)
+
+/*
+ * The XDR handle.
+ * Contains operation which is being applied to the stream,
+ * an operations vector for the particular implementation (e.g. see xdr_mem.c),
+ * and two private fields for the use of the particular implementation.
+ */
+typedef struct __rpc_xdr {
+ enum xdr_op x_op; /* operation; fast additional param */
+ const struct xdr_ops {
+#ifdef __LP64__
+ /* get an int from underlying stream */
+ bool_t (*x_getlong)(struct __rpc_xdr *, int *);
+ /* put an int to " */
+ bool_t (*x_putlong)(struct __rpc_xdr *, const int *);
+#else
+ /* get a long from underlying stream */
+ bool_t (*x_getlong)(struct __rpc_xdr *, long *);
+ /* put a long to " */
+ bool_t (*x_putlong)(struct __rpc_xdr *, const long *);
+#endif
+ /* get some bytes from " */
+ bool_t (*x_getbytes)(struct __rpc_xdr *, char *, unsigned int);
+ /* put some bytes to " */
+ bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, unsigned int);
+ /* returns bytes off from beginning */
+ unsigned int (*x_getpostn)(struct __rpc_xdr *);
+ /* lets you reposition the stream */
+ bool_t (*x_setpostn)(struct __rpc_xdr *, unsigned int);
+ /* buf quick ptr to buffered data */
+ int32_t *(*x_inline)(struct __rpc_xdr *, unsigned int);
+ /* free privates of this xdr_stream */
+ void (*x_destroy)(struct __rpc_xdr *);
+ bool_t (*x_control)(struct __rpc_xdr *, int, void *);
+ } *x_ops;
+ char * x_public; /* users' data */
+ void * x_private; /* pointer to private data */
+ char * x_base; /* private used for position info */
+ unsigned int x_handy; /* extra private word */
+} XDR;
+
+/*
+ * A xdrproc_t exists for each data type which is to be encoded or decoded.
+ *
+ * The second argument to the xdrproc_t is a pointer to an opaque pointer.
+ * The opaque pointer generally points to a structure of the data type
+ * to be decoded. If this pointer is 0, then the type routines should
+ * allocate dynamic storage of the appropriate size and return it.
+ */
+#ifdef _KERNEL
+typedef bool_t (*xdrproc_t)(XDR *, void *, unsigned int);
+#else
+/*
+ * XXX can't actually prototype it, because some take three args!!!
+ */
+typedef bool_t (*xdrproc_t)(XDR *, ...);
+#endif
+
+/*
+ * Operations defined on a XDR handle
+ *
+ * XDR *xdrs;
+ * long *longp;
+ * char * addr;
+ * unsigned int len;
+ * unsigned int pos;
+ */
+#define XDR_GETLONG(xdrs, longp) \
+ (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+#define xdr_getlong(xdrs, longp) \
+ (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
+
+#define XDR_PUTLONG(xdrs, longp) \
+ (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+#define xdr_putlong(xdrs, longp) \
+ (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
+
+
+#ifdef __LP64__
+static __inline int
+xdr_getint32(XDR *xdrs, int32_t *ip)
+{
+ int32_t l;
+
+ if (!xdr_getlong(xdrs, &l))
+ return (FALSE);
+ *ip = l;
+ return (TRUE);
+}
+
+static __inline int
+xdr_putint32(XDR *xdrs, int32_t *ip)
+{
+ int32_t l;
+
+ l = *ip;
+ return xdr_putlong(xdrs, &l);
+}
+#else
+static __inline int
+xdr_getint32(XDR *xdrs, int32_t *ip)
+{
+ int32_t l;
+
+ if (!xdr_getlong(xdrs, (long *)&l))
+ return (FALSE);
+ *ip = l;
+ return (TRUE);
+}
+
+static __inline int
+xdr_putint32(XDR *xdrs, int32_t *ip)
+{
+ int32_t l;
+
+ l = *ip;
+ return xdr_putlong(xdrs, (long *)&l);
+}
+#endif
+
+#define XDR_GETINT32(xdrs, int32p) xdr_getint32(xdrs, int32p)
+#define XDR_PUTINT32(xdrs, int32p) xdr_putint32(xdrs, int32p)
+
+#define XDR_GETBYTES(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+#define xdr_getbytes(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+
+#define XDR_PUTBYTES(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+#define xdr_putbytes(xdrs, addr, len) \
+ (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+
+#define XDR_GETPOS(xdrs) \
+ (*(xdrs)->x_ops->x_getpostn)(xdrs)
+#define xdr_getpos(xdrs) \
+ (*(xdrs)->x_ops->x_getpostn)(xdrs)
+
+#define XDR_SETPOS(xdrs, pos) \
+ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+#define xdr_setpos(xdrs, pos) \
+ (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+
+#define XDR_INLINE(xdrs, len) \
+ (*(xdrs)->x_ops->x_inline)(xdrs, len)
+#define xdr_inline(xdrs, len) \
+ (*(xdrs)->x_ops->x_inline)(xdrs, len)
+
+#define XDR_DESTROY(xdrs) \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs)
+#define xdr_destroy(xdrs) \
+ if ((xdrs)->x_ops->x_destroy) \
+ (*(xdrs)->x_ops->x_destroy)(xdrs)
+
+#define XDR_CONTROL(xdrs, req, op) \
+ if ((xdrs)->x_ops->x_control) \
+ (*(xdrs)->x_ops->x_control)(xdrs, req, op)
+#define xdr_control(xdrs, req, op) XDR_CONTROL(xdrs, req, op)
+
+/*
+ * Solaris strips the '_t' from these types -- not sure why.
+ * But, let's be compatible.
+ */
+#define xdr_rpcvers(xdrs, versp) xdr_u_int32(xdrs, versp)
+#define xdr_rpcprog(xdrs, progp) xdr_u_int32(xdrs, progp)
+#define xdr_rpcproc(xdrs, procp) xdr_u_int32(xdrs, procp)
+#define xdr_rpcprot(xdrs, protp) xdr_u_int32(xdrs, protp)
+#define xdr_rpcport(xdrs, portp) xdr_u_int32(xdrs, portp)
+
+/*
+ * Support struct for discriminated unions.
+ * You create an array of xdrdiscrim structures, terminated with
+ * an entry with a null procedure pointer. The xdr_union routine gets
+ * the discriminant value and then searches the array of structures
+ * for a matching value. If a match is found the associated xdr routine
+ * is called to handle that part of the union. If there is
+ * no match, then a default routine may be called.
+ * If there is no match and no default routine it is an error.
+ */
+#define NULL_xdrproc_t ((xdrproc_t)0)
+struct xdr_discrim {
+ int value;
+ xdrproc_t proc;
+};
+
+/*
+ * In-line routines for fast encode/decode of primitive data types.
+ * Caveat emptor: these use single memory cycles to get the
+ * data from the underlying buffer, and will fail to operate
+ * properly if the data is not aligned. The standard way to use these
+ * is to say:
+ * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
+ * return (FALSE);
+ * <<< macro calls >>>
+ * where ``count'' is the number of bytes of data occupied
+ * by the primitive data types.
+ *
+ * N.B. and frozen for all time: each data type here uses 4 bytes
+ * of external representation.
+ */
+#define IXDR_GET_INT32(buf) ((int32_t)ntohl((u_int32_t)*(buf)++))
+#define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v))
+#define IXDR_GET_U_INT32(buf) ((u_int32_t)IXDR_GET_INT32(buf))
+#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v)))
+
+#ifdef __LP64__
+#define IXDR_GET_LONG(buf) (ntohl((u_int32_t)*(buf)++))
+#define IXDR_PUT_LONG(buf, v) (*(buf)++ = htonl((u_int32_t)v))
+#else
+#define IXDR_GET_LONG(buf) ((long)ntohl((u_int32_t)*(buf)++))
+#define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v))
+#endif
+
+#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
+#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
+#ifdef __LP64__
+#define IXDR_GET_U_LONG(buf) ((unsigned int)IXDR_GET_LONG(buf))
+#else
+#define IXDR_GET_U_LONG(buf) ((unsigned long)IXDR_GET_LONG(buf))
+#endif
+#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
+#define IXDR_GET_U_SHORT(buf) ((unsigned short)IXDR_GET_LONG(buf))
+
+#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), (v))
+#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), (v))
+#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), (v))
+#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), (v))
+#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), (v))
+
+/*
+ * These are the "generic" xdr routines.
+ */
+__BEGIN_DECLS
+extern bool_t xdr_void(void);
+extern bool_t xdr_int(XDR *, int *);
+extern bool_t xdr_u_int(XDR *, unsigned int *);
+#ifdef __LP64__
+extern bool_t xdr_long(XDR *, int *);
+extern bool_t xdr_u_long(XDR *, unsigned int *);
+#else
+extern bool_t xdr_long(XDR *, long *);
+extern bool_t xdr_u_long(XDR *, unsigned long *);
+#endif
+extern bool_t xdr_short(XDR *, short *);
+extern bool_t xdr_u_short(XDR *, unsigned short *);
+extern bool_t xdr_int16_t(XDR *, int16_t *);
+extern bool_t xdr_u_int16_t(XDR *, u_int16_t *);
+extern bool_t xdr_int32_t(XDR *, int32_t *);
+extern bool_t xdr_u_int32_t(XDR *, u_int32_t *);
+extern bool_t xdr_int64_t(XDR *, int64_t *);
+extern bool_t xdr_u_int64_t(XDR *, u_int64_t *);
+extern bool_t xdr_bool(XDR *, bool_t *);
+extern bool_t xdr_enum(XDR *, enum_t *);
+extern bool_t xdr_array(XDR *, char **, unsigned int *, unsigned int, unsigned int, xdrproc_t);
+extern bool_t xdr_bytes(XDR *, char **, unsigned int *, unsigned int);
+extern bool_t xdr_opaque(XDR *, char *, unsigned int);
+extern bool_t xdr_string(XDR *, char **, unsigned int);
+extern bool_t xdr_union(XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t);
+extern bool_t xdr_char(XDR *, char *);
+extern bool_t xdr_u_char(XDR *, unsigned char *);
+extern bool_t xdr_vector(XDR *, char *, unsigned int, unsigned int, xdrproc_t);
+extern bool_t xdr_float(XDR *, float *);
+extern bool_t xdr_double(XDR *, double *);
+extern bool_t xdr_quadruple(XDR *, long double *);
+extern bool_t xdr_reference(XDR *, char **, unsigned int, xdrproc_t);
+extern bool_t xdr_pointer(XDR *, char **, unsigned int, xdrproc_t);
+extern bool_t xdr_wrapstring(XDR *, char **);
+extern void xdr_free(xdrproc_t, void *);
+extern bool_t xdr_hyper(XDR *, quad_t *);
+extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
+extern bool_t xdr_longlong_t(XDR *, quad_t *);
+extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *);
+__END_DECLS
+
+/*
+ * Common opaque bytes objects used by many rpc protocols;
+ * declared here due to commonality.
+ */
+#define MAX_NETOBJ_SZ 1024
+struct netobj {
+ unsigned int n_len;
+ char *n_bytes;
+};
+typedef struct netobj netobj;
+extern bool_t xdr_netobj(XDR *, struct netobj *);
+
+/*
+ * These are the public routines for the various implementations of
+ * xdr streams.
+ */
+__BEGIN_DECLS
+/* XDR using memory buffers */
+extern void xdrmem_create(XDR *, char *, unsigned int, enum xdr_op);
+
+/* XDR using stdio library */
+#ifdef _STDIO_H_
+extern void xdrstdio_create(XDR *, FILE *, enum xdr_op);
+#endif
+
+/* XDR pseudo records for tcp */
+extern void xdrrec_create(XDR *, unsigned int, unsigned int, void *,
+ int (*)(void *, void *, int),
+ int (*)(void *, void *, int));
+
+/* make end of xdr record */
+extern bool_t xdrrec_endofrecord(XDR *, int);
+
+/* move to beginning of next record */
+extern bool_t xdrrec_skiprecord(XDR *);
+
+/* true if no more input */
+extern bool_t xdrrec_eof(XDR *);
+extern unsigned int xdrrec_readbytes(XDR *, caddr_t, unsigned int);
+__END_DECLS
+
+#endif /* !_RPC_XDR_H */
diff --git a/tools/darwin/depends/libogg/Makefile b/tools/darwin/depends/libogg/Makefile
index 74a0bbf70a..d1da26423d 100644
--- a/tools/darwin/depends/libogg/Makefile
+++ b/tools/darwin/depends/libogg/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libpng/Makefile b/tools/darwin/depends/libpng/Makefile
index 1dddac47f0..7edef1eaf8 100644
--- a/tools/darwin/depends/libpng/Makefile
+++ b/tools/darwin/depends/libpng/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/librtmp/Makefile b/tools/darwin/depends/librtmp/Makefile
index a7ab557ebe..4439a94575 100644
--- a/tools/darwin/depends/librtmp/Makefile
+++ b/tools/darwin/depends/librtmp/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); patch -p1 < ../01-make_shared_lib_for_darwin-tag2.3.patch
$(LIBDYLIB): $(SOURCE)
- make SYS=darwin prefix=$(PREFIX) XCFLAGS="$(CFLAGS)" XLDFLAGS="$(LDFLAGS)" -C $(SOURCE)/librtmp
+ make SYS=darwin prefix=$(PREFIX) XCFLAGS="$(CFLAGS)" XLDFLAGS="$(LDFLAGS)" -j $(MAKE_JOBS) -C $(SOURCE)/librtmp
.installed:
make SYS=darwin prefix=$(PREFIX) -C $(SOURCE)/librtmp install
diff --git a/tools/darwin/depends/libsamplerate/Makefile b/tools/darwin/depends/libsamplerate/Makefile
index dcc610c55a..c78120e0df 100644
--- a/tools/darwin/depends/libsamplerate/Makefile
+++ b/tools/darwin/depends/libsamplerate/Makefile
@@ -25,7 +25,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libsdl/Makefile b/tools/darwin/depends/libsdl/Makefile
index b88f838dd1..13158d5296 100644
--- a/tools/darwin/depends/libsdl/Makefile
+++ b/tools/darwin/depends/libsdl/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libsdl_image/Makefile b/tools/darwin/depends/libsdl_image/Makefile
index 051f3c8ebf..71ad5d4a35 100644
--- a/tools/darwin/depends/libsdl_image/Makefile
+++ b/tools/darwin/depends/libsdl_image/Makefile
@@ -24,7 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libsdl_mixer/Makefile b/tools/darwin/depends/libsdl_mixer/Makefile
index aee1b0432f..55d8ad669d 100644
--- a/tools/darwin/depends/libsdl_mixer/Makefile
+++ b/tools/darwin/depends/libsdl_mixer/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install-hdrs install-lib
diff --git a/tools/darwin/depends/libssh2/Makefile b/tools/darwin/depends/libssh2/Makefile
index 925c74443c..059237eb77 100644
--- a/tools/darwin/depends/libssh2/Makefile
+++ b/tools/darwin/depends/libssh2/Makefile
@@ -27,7 +27,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libtool/Makefile b/tools/darwin/depends/libtool/Makefile
index e0806f26c9..c8ab6ce7de 100644
--- a/tools/darwin/depends/libtool/Makefile
+++ b/tools/darwin/depends/libtool/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/libvorbis/Makefile b/tools/darwin/depends/libvorbis/Makefile
index 123639e23b..93ead2412f 100644
--- a/tools/darwin/depends/libvorbis/Makefile
+++ b/tools/darwin/depends/libvorbis/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/libwavpack/Makefile b/tools/darwin/depends/libwavpack/Makefile
deleted file mode 100644
index cc8934aa71..0000000000
--- a/tools/darwin/depends/libwavpack/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-include ../Makefile.include
-
-# lib name, version
-LIBNAME=wavpack
-VERSION=4.60.1
-SOURCE=$(LIBNAME)-$(VERSION)
-ARCHIVE=$(SOURCE).tar.bz2
-
-# configuration settings
-CONFIGURE=./configure --prefix=$(PREFIX)
-
-LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
-
-all: $(LIBDYLIB) .installed
-
-$(TARBALLS_LOCATION)/$(ARCHIVE):
- $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
-
-$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
- rm -rf $(SOURCE)
- $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- echo $(SOURCE) > .gitignore
- cd $(SOURCE); $(CONFIGURE)
-
-$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
-
-.installed:
- make -C $(SOURCE) install
- touch $@
-
-clean:
- make -C $(SOURCE) clean
- rm -f .installed
-
-distclean::
- rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/mysqlclient/Makefile b/tools/darwin/depends/mysqlclient/Makefile
index 8bffdaf011..dee71afaeb 100644
--- a/tools/darwin/depends/mysqlclient/Makefile
+++ b/tools/darwin/depends/mysqlclient/Makefile
@@ -36,7 +36,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
fi
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE)/scripts install
diff --git a/tools/darwin/depends/openssl/Makefile b/tools/darwin/depends/openssl/Makefile
index 4901cd4924..7d976c3b25 100644
--- a/tools/darwin/depends/openssl/Makefile
+++ b/tools/darwin/depends/openssl/Makefile
@@ -3,7 +3,7 @@ include ../config.site.mk
# lib name, version
LIBNAME=openssl
-VERSION=1.0.0a
+VERSION=0.9.8r
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
@@ -34,7 +34,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
fi
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j 1 -C $(SOURCE)
.installed:
make -C $(SOURCE) install_sw
diff --git a/tools/darwin/depends/pcre/Makefile b/tools/darwin/depends/pcre/Makefile
index a8a771807a..bdd9928ccf 100644
--- a/tools/darwin/depends/pcre/Makefile
+++ b/tools/darwin/depends/pcre/Makefile
@@ -24,7 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/pkg-config/Makefile b/tools/darwin/depends/pkg-config/Makefile
index 2ba7ad2b6c..47fee3e6ef 100644
--- a/tools/darwin/depends/pkg-config/Makefile
+++ b/tools/darwin/depends/pkg-config/Makefile
@@ -25,7 +25,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/python26/Makefile.ios b/tools/darwin/depends/python26/Makefile.ios
index 601b6b43c8..47a6b22117 100644
--- a/tools/darwin/depends/python26/Makefile.ios
+++ b/tools/darwin/depends/python26/Makefile.ios
@@ -40,7 +40,7 @@ $(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); make distclean
cd $(SOURCE); patch -p1 <../Python-2.6.5-xcompile.patch
cd $(SOURCE); $(CONFIGURE)
- cd $(SOURCE); make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE_TARGET=yes
+ cd $(SOURCE); make -j $(MAKE_JOBS) HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE_TARGET=yes
.installed:
cd $(SOURCE); make install HOSTPYTHON=./hostpython CROSS_COMPILE_TARGET=yes
diff --git a/tools/darwin/depends/python26/Makefile.osx b/tools/darwin/depends/python26/Makefile.osx
index 217e36ad4b..8267c97174 100644
--- a/tools/darwin/depends/python26/Makefile.osx
+++ b/tools/darwin/depends/python26/Makefile.osx
@@ -27,7 +27,7 @@ $(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
# this forces python2.6 hashlib to be compatible with osx 10.4 boxes.
sed -ie "s|openssl_ver >= 0x00907000)|openssl_ver >= 0x00907000 and False)|" "$(SOURCE)/setup.py"
sed -ie "s|(openssl_ver < 0x00908000)|(True or openssl_ver < 0x00908000)|" "$(SOURCE)/setup.py"
- cd $(SOURCE); make
+ cd $(SOURCE); make -j $(MAKE_JOBS)
.installed:
cd $(SOURCE); make install
diff --git a/tools/darwin/depends/readline/Makefile b/tools/darwin/depends/readline/Makefile
index 3e537a4cad..abf141c8ca 100644
--- a/tools/darwin/depends/readline/Makefile
+++ b/tools/darwin/depends/readline/Makefile
@@ -24,7 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/samba/Makefile b/tools/darwin/depends/samba/Makefile
index 54d4c225b5..9f83b40f35 100644
--- a/tools/darwin/depends/samba/Makefile
+++ b/tools/darwin/depends/samba/Makefile
@@ -27,7 +27,7 @@ $(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
if test "$(DARWIN)" = "ios"; then \
cp -f /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(SDK).sdk/usr/include/crt_externs.h $(PREFIX)/include/; \
fi
- cd $(SOURCE)/source3; make bin/libsmbclient.dylib
+ cd $(SOURCE)/source3; make -j 1 bin/libsmbclient.dylib
.installed:
cp -f $(SOURCE)/source3/include/libsmbclient.h $(PREFIX)/include/
diff --git a/tools/darwin/depends/sqlite3/Makefile b/tools/darwin/depends/sqlite3/Makefile
index 78a7c7c54b..47c1d798b8 100644
--- a/tools/darwin/depends/sqlite3/Makefile
+++ b/tools/darwin/depends/sqlite3/Makefile
@@ -28,7 +28,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/tar/Makefile b/tools/darwin/depends/tar/Makefile
index 3172bbda26..59a224ff83 100644
--- a/tools/darwin/depends/tar/Makefile
+++ b/tools/darwin/depends/tar/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/darwin/depends/tiff/Makefile b/tools/darwin/depends/tiff/Makefile
index 2082e095e9..cd2d3acf9c 100644
--- a/tools/darwin/depends/tiff/Makefile
+++ b/tools/darwin/depends/tiff/Makefile
@@ -23,7 +23,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
make -C $(SOURCE) install
diff --git a/tools/darwin/depends/yasm/Makefile b/tools/darwin/depends/yasm/Makefile
index 7e3699501e..75efac8a45 100644
--- a/tools/darwin/depends/yasm/Makefile
+++ b/tools/darwin/depends/yasm/Makefile
@@ -26,7 +26,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(SOURCE); $(CONFIGURE)
$(APP): $(SOURCE)
- make -C $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
$(APPBIN):
make $(APP)
diff --git a/tools/osx/ios-depends/Makefile b/tools/osx/ios-depends/Makefile
index a384f29012..fcd582e152 100644
--- a/tools/osx/ios-depends/Makefile
+++ b/tools/osx/ios-depends/Makefile
@@ -7,7 +7,7 @@ SUBDIRS = \
liblzo2 freetype2 fontconfig \
openssl libssh2 curl \
jpeg tiff libpng libogg \
- libvorbis libflac libmad fribidi libwavpack libmpeg2 \
+ libvorbis libflac libmad fribidi libmpeg2 \
libass libcdio libsamplerate librtmp \
libmicrohttpd libmodplug libbluray libyajl \
samba python26 mysqlclient boost
diff --git a/tools/osx/ios-depends/libwavpack/Makefile b/tools/osx/ios-depends/libwavpack/Makefile
deleted file mode 100644
index 23ae90e6f0..0000000000
--- a/tools/osx/ios-depends/libwavpack/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-# A quick and dirty Makefile to download/build and install
-#
-# Usage:
-# make
-# sudo make install
-
-include ../config.mk
-
-# lib name, version
-LIBNAME=wavpack
-VERSION=4.60.1
-SOURCE=$(LIBNAME)-$(VERSION)
-# download location and format
-BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
-ARCHIVE=$(SOURCE).tar.bz2
-TARBALLS_LOCATION=/Users/Shared/xbmc-depends/tarballs
-RETRIEVE_TOOL=/usr/bin/curl
-RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
-ARCHIVE_TOOL=tar
-ARCHIVE_TOOL_FLAGS=xf
-
-# configuration settings
-CONFIGURE=./configure --prefix=$(PREFIX) --host=$(HOST) --enable-shared=yes
-
-LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
-
-CLEAN_FILES=$(ARCHIVE) $(SOURCE)
-
-all: $(LIBDYLIB) .installed
-
-$(TARBALLS_LOCATION)/$(ARCHIVE):
- $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
-
-$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
- -rm -rf $(SOURCE)
- $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- echo $(SOURCE) > .gitignore
- cd $(SOURCE); $(CONFIGURE)
-
-$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
-
-.installed:
- make -C $(SOURCE) install
- touch $@
-
-clean:
- make -C $(SOURCE) clean
- rm -f .installed
-
-distclean::
- rm -rf $(SOURCE) .installed
diff --git a/tools/osx/ios-depends/openssl/Makefile b/tools/osx/ios-depends/openssl/Makefile
index 5318288cf4..4c0915a8a6 100644
--- a/tools/osx/ios-depends/openssl/Makefile
+++ b/tools/osx/ios-depends/openssl/Makefile
@@ -8,7 +8,7 @@ include ../config.mk
# lib name, version
LIBNAME=openssl
-VERSION=1.0.0a
+VERSION=0.9.8r
SOURCE=$(LIBNAME)-$(VERSION)
# download location and format
BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
diff --git a/tools/osx/osx-depends/Makefile b/tools/osx/osx-depends/Makefile
index e9c2517be5..493f832676 100644
--- a/tools/osx/osx-depends/Makefile
+++ b/tools/osx/osx-depends/Makefile
@@ -6,7 +6,7 @@ SUBDIRS = \
liblzo liblzo2 freetype2 fontconfig \
openssl libssh2 curl \
jpeg tiff libpng libogg \
- libvorbis libflac libmad fribidi libwavpack libmpeg2 \
+ libvorbis libflac libmad fribidi libmpeg2 \
faad2 libass libcdio libsamplerate librtmp libcrystalhd \
libGLEW libsdl libsdl_mixer libsdl_image \
libmicrohttpd libmodplug libbluray libyajl \
diff --git a/tools/osx/osx-depends/libwavpack/Makefile b/tools/osx/osx-depends/libwavpack/Makefile
deleted file mode 100644
index 6c768ea4d7..0000000000
--- a/tools/osx/osx-depends/libwavpack/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-# A quick and dirty Makefile to download/build and install
-#
-# Usage:
-# make
-# sudo make install
-
-include ../config.mk
-
-# lib name, version
-LIBNAME=wavpack
-VERSION=4.60.1
-SOURCE=$(LIBNAME)-$(VERSION)
-# download location and format
-BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
-ARCHIVE=$(SOURCE).tar.bz2
-TARBALLS_LOCATION=/Users/Shared/xbmc-depends/tarballs
-RETRIEVE_TOOL=/usr/bin/curl
-RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
-ARCHIVE_TOOL=tar
-ARCHIVE_TOOL_FLAGS=xf
-
-# configuration settings
-CONFIGURE=./configure --prefix=$(PREFIX) --host=$(HOST) --enable-shared=yes
-
-LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
-
-CLEAN_FILES=$(ARCHIVE) $(SOURCE)
-
-all: $(LIBDYLIB) .installed
-
-$(TARBALLS_LOCATION)/$(ARCHIVE):
- $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
-
-$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
- -rm -rf $(SOURCE)
- $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- echo $(SOURCE) > .gitignore
- cd $(SOURCE); $(CONFIGURE)
-
-$(LIBDYLIB): $(SOURCE)
- make -C $(SOURCE)
-
-.installed:
- make -C $(SOURCE) install
- touch $@
-
-clean:
- make -C $(SOURCE) clean
- rm .installed
-
-distclean::
- rm -rf $(SOURCE) .installed
diff --git a/tools/osx/osx-depends/openssl/Makefile b/tools/osx/osx-depends/openssl/Makefile
index 2fb602756f..3b79faa972 100644
--- a/tools/osx/osx-depends/openssl/Makefile
+++ b/tools/osx/osx-depends/openssl/Makefile
@@ -8,7 +8,7 @@ include ../config.mk
# lib name, version
LIBNAME=openssl
-VERSION=1.0.0a
+VERSION=0.9.8r
SOURCE=$(LIBNAME)-$(VERSION)
# download location and format
BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
diff --git a/tools/osx/packaging/xbmc-startuptweeks/mkdeb-xbmc-startuptweeks.sh b/tools/osx/packaging/xbmc-startuptweeks/mkdeb-xbmc-startuptweeks.sh
deleted file mode 100755
index 1dd17e3922..0000000000
--- a/tools/osx/packaging/xbmc-startuptweeks/mkdeb-xbmc-startuptweeks.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-
-if [ -f "/usr/bin/sudo" ]; then
- SUDO="/usr/bin/sudo"
-fi
-
-PACKAGE=com.xbmc.xbmc-startuptweeks
-
-VERSION=1.0
-REVISION=0
-ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb
-
-echo Creating $PACKAGE package version $VERSION revision $REVISION
-${SUDO} rm -rf $PACKAGE
-${SUDO} rm -rf $ARCHIVE
-
-# create debian control file
-mkdir -p $PACKAGE/DEBIAN
-echo "Package: $PACKAGE" > $PACKAGE/DEBIAN/control
-echo "Priority: Extra" >> $PACKAGE/DEBIAN/control
-echo "Name: XBMC startup tweeks (seatbelt)" >> $PACKAGE/DEBIAN/control
-echo "Version: $VERSION-$REVISION" >> $PACKAGE/DEBIAN/control
-echo "Architecture: iphoneos-arm" >> $PACKAGE/DEBIAN/control
-echo "Description: XBMC startup tweeks, removes seatbelt" >> $PACKAGE/DEBIAN/control
-echo "Homepage: http://xbmc.org/" >> $PACKAGE/DEBIAN/control
-echo "Maintainer: Scott Davilla" >> $PACKAGE/DEBIAN/control
-echo "Author: TeamXBMC" >> $PACKAGE/DEBIAN/control
-echo "Section: Multimedia" >> $PACKAGE/DEBIAN/control
-
-# prerm: called on remove and upgrade - get rid of existing bits
-echo "#!/bin/sh" > $PACKAGE/DEBIAN/prerm
-echo "rm -f /usr/libexec/xbmc/startup" >> $PACKAGE/DEBIAN/prerm
-echo "rm -f /System/Library/LaunchDaemons/com.xbmc.xbmc.startup.plist" >> $PACKAGE/DEBIAN/prerm
-chmod +x $PACKAGE/DEBIAN/prerm
-
-# postinst: startup our daemon plist
-echo "#!/bin/sh" > $PACKAGE/DEBIAN/postinst
-echo "/bin/launchctl load /System/Library/LaunchDaemons/com.xbmc.xbmc.startup.plist 2&> /dev/null" >> $PACKAGE/DEBIAN/postinst
-chmod +x $PACKAGE/DEBIAN/postinst
-
-# create ios launch daemon that runs at boot
-DEST=System/Library/LaunchDaemons
-mkdir -p $PACKAGE/$DEST
-echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo "<plist version=\"1.0\">" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo "<dict>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo " <key>Label</key>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo " <string>com.xbmc.xbmc.startup</string>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo " <key>Program</key>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo " <string>/usr/libexec/xbmc/startup</string>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo " <key>RunAtLoad</key>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo " <true/>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo "</dict>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-echo "</plist>" >> $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-${SUDO} chmod 644 $PACKAGE/$DEST/com.xbmc.xbmc.startup.plist
-
-# create startup file that is run by our launch daemon
-DEST=usr/libexec/xbmc
-mkdir -p $PACKAGE/$DEST
-echo "#!/bin/sh" > $PACKAGE/$DEST/startup
-echo "#remove sandbox/seatbelt restrictions" >> $PACKAGE/$DEST/startup
-echo "if echo \`sysctl hw.machine\` | grep AppleTV2,1 > /dev/null; then" >> $PACKAGE/$DEST/startup
-echo " sysctl -w security.mac.proc_enforce=0" >> $PACKAGE/$DEST/startup
-echo "fi" >> $PACKAGE/$DEST/startup
-echo "sysctl -w security.mac.vnode_enforce=0" >> $PACKAGE/$DEST/startup
-echo "exit 0" >> $PACKAGE/$DEST/startup
-${SUDO} chmod 755 $PACKAGE/$DEST/startup
-
-# set ownership to root:root
-${SUDO} chown -R 0:0 $PACKAGE
-
-echo Packaging $PACKAGE
-# Tell tar, pax, etc. on Mac OS X 10.4+ not to archive
-# extended attributes (e.g. resource forks) to ._* archive members.
-# Also allows archiving and extracting actual ._* files.
-export COPYFILE_DISABLE=true
-export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
-../../ios-depends/build/bin/dpkg-deb -b $PACKAGE $ARCHIVE
-../../ios-depends/build/bin/dpkg-deb --info $ARCHIVE
-../../ios-depends/build/bin/dpkg-deb --contents $ARCHIVE
-
-# clean up by removing package dir
-${SUDO} rm -rf $PACKAGE
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 101b9c0eeb..c1edf30791 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -2904,13 +2904,49 @@ bool CApplication::ProcessMouse()
if (!g_Mouse.IsActive() || !m_AppFocused)
return false;
+ // Update the pointer position here so it gets updated even for ACTION_NOOP
+ m_guiPointer.SetPosition((float) g_Mouse.GetX(), (float) g_Mouse.GetY());
+
// Reset the screensaver and idle timers
m_idleTimer.StartZero();
ResetScreenSaver();
if (WakeUpScreenSaverAndDPMS())
return true;
- return OnAction(g_Mouse.GetAction());
+ // Get the mouse command ID
+ uint32_t mousecommand = g_Mouse.GetAction();
+
+ // Retrieve the corresponding action
+ int iWin;
+ CKey key(mousecommand | KEY_MOUSE, (unsigned int) 0);
+ if (g_windowManager.HasModalDialog())
+ iWin = g_windowManager.GetTopMostModalDialogID() & WINDOW_ID_MASK;
+ else
+ iWin = g_windowManager.GetActiveWindow() & WINDOW_ID_MASK;
+ CAction mouseaction = CButtonTranslator::GetInstance().GetAction(iWin, key);
+
+ // If we couldn't find an action return false to indicate we have not
+ // handled this mouse action
+ if (!mouseaction.GetID())
+ {
+ CLog::Log(LOGDEBUG, "%s: unknown mouse command %d", __FUNCTION__, mousecommand);
+ return false;
+ }
+
+ // Process the appcommand
+ CAction newmouseaction = CAction(mouseaction.GetID(),
+ g_Mouse.GetHold(MOUSE_LEFT_BUTTON),
+ (float)g_Mouse.GetX(),
+ (float)g_Mouse.GetY(),
+ (float)g_Mouse.GetDX(),
+ (float)g_Mouse.GetDY(),
+ mouseaction.GetName());
+
+ // Log mouse actions except for move and noop
+ if (newmouseaction.GetID() != ACTION_MOUSE_MOVE && newmouseaction.GetID() != ACTION_NOOP)
+ CLog::Log(LOGDEBUG, "%s: trying mouse action %s", __FUNCTION__, newmouseaction.GetName().c_str());
+
+ return OnAction(newmouseaction);
}
void CApplication::CheckForTitleChange()
@@ -3275,7 +3311,7 @@ void CApplication::Stop(int exitCode)
{
try
{
- CAnnouncementManager::Announce(System, "xbmc", "ApplicationStop");
+ CAnnouncementManager::Announce(System, "xbmc", "OnQuit");
// cancel any jobs from the jobmanager
CJobManager::GetInstance().CancelJobs();
@@ -3872,7 +3908,7 @@ void CApplication::OnPlayBackEnded()
getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackEnded;1");
#endif
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackEnded");
+ CAnnouncementManager::Announce(Player, "xbmc", "OnStop");
if (IsPlayingAudio())
{
@@ -3901,7 +3937,9 @@ void CApplication::OnPlayBackStarted()
getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackStarted;1");
#endif
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackStarted", m_itemCurrentFile);
+ CVariant param;
+ param["speed"] = 1;
+ CAnnouncementManager::Announce(Player, "xbmc", "OnPlay", m_itemCurrentFile, param);
CGUIMessage msg(GUI_MSG_PLAYBACK_STARTED, 0, 0);
g_windowManager.SendThreadMessage(msg);
@@ -3921,8 +3959,6 @@ void CApplication::OnQueueNextItem()
getApplicationMessenger().HttpApi("broadcastlevel; OnQueueNextItem;1");
#endif
- CAnnouncementManager::Announce(Player, "xbmc", "QueueNextItem");
-
if(IsPlayingAudio())
{
CLastfmScrobbler::GetInstance()->SubmitQueue();
@@ -3950,7 +3986,7 @@ void CApplication::OnPlayBackStopped()
getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackStopped;1");
#endif
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackStopped", m_itemCurrentFile);
+ CAnnouncementManager::Announce(Player, "xbmc", "OnStop", m_itemCurrentFile);
CLastfmScrobbler::GetInstance()->SubmitQueue();
CLibrefmScrobbler::GetInstance()->SubmitQueue();
@@ -3971,7 +4007,7 @@ void CApplication::OnPlayBackPaused()
getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackPaused;1");
#endif
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackPaused", m_itemCurrentFile);
+ CAnnouncementManager::Announce(Player, "xbmc", "OnPause", m_itemCurrentFile);
}
void CApplication::OnPlayBackResumed()
@@ -3986,7 +4022,9 @@ void CApplication::OnPlayBackResumed()
getApplicationMessenger().HttpApi("broadcastlevel; OnPlayBackResumed;1");
#endif
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackResumed", m_itemCurrentFile);
+ CVariant param;
+ param["speed"] = 1;
+ CAnnouncementManager::Announce(Player, "xbmc", "OnPlay", m_itemCurrentFile, param);
}
void CApplication::OnPlayBackSpeedChanged(int iSpeed)
@@ -4007,7 +4045,7 @@ void CApplication::OnPlayBackSpeedChanged(int iSpeed)
CVariant param;
param["speed"] = iSpeed;
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackSpeedChanged", m_itemCurrentFile, param);
+ CAnnouncementManager::Announce(Player, "xbmc", "OnPlay", m_itemCurrentFile, param);
}
void CApplication::OnPlayBackSeek(int iTime, int seekOffset)
@@ -4029,7 +4067,7 @@ void CApplication::OnPlayBackSeek(int iTime, int seekOffset)
CVariant param;
param["time"] = iTime;
param["seekoffset"] = seekOffset;
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackSeek", param);
+ CAnnouncementManager::Announce(Player, "xbmc", "OnSeek", param);
g_infoManager.SetDisplayAfterSeek(2500, seekOffset/1000);
}
@@ -4048,10 +4086,6 @@ void CApplication::OnPlayBackSeekChapter(int iChapter)
getApplicationMessenger().HttpApi(tmp);
}
#endif
-
- CVariant param;
- param["chapter"] = iChapter;
- CAnnouncementManager::Announce(Player, "xbmc", "PlaybackSeekChapter", param);
}
bool CApplication::IsPlaying() const
@@ -4217,6 +4251,11 @@ void CApplication::ResetScreenSaverTimer()
m_screenSaverTimer.StartZero();
}
+void CApplication::StopScreenSaverTimer()
+{
+ m_screenSaverTimer.Stop();
+}
+
bool CApplication::ToggleDPMS(bool manual)
{
if (manual || (m_dpmsIsManual == manual))
diff --git a/xbmc/Application.h b/xbmc/Application.h
index c550eae372..07e066d520 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -179,6 +179,7 @@ public:
int GetAudioDelay() const;
void SetPlaySpeed(int iSpeed);
void ResetScreenSaverTimer();
+ void StopScreenSaverTimer();
// Wakes up from the screensaver and / or DPMS. Returns true if woken up.
bool WakeUpScreenSaverAndDPMS();
bool WakeUpScreenSaver();
diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in
index d7e80126fb..25b5435c39 100644
--- a/xbmc/DllPaths_generated.h.in
+++ b/xbmc/DllPaths_generated.h.in
@@ -55,7 +55,6 @@
#define DLL_PATH_SID_CODEC "special://xbmcbin/system/players/paplayer/libsidplay2-@ARCH@.so"
#define DLL_PATH_SPC_CODEC "special://xbmcbin/system/players/paplayer/SNESAPU-@ARCH@.so"
#define DLL_PATH_VGM_CODEC "special://xbmcbin/system/players/paplayer/vgmstream-@ARCH@.so"
-#define DLL_PATH_WAVPACK_CODEC "@WAVPACK_SONAME@"
#define DLL_PATH_YM_CODEC "special://xbmcbin/system/players/paplayer/stsoundlibrary-@ARCH@.so"
#define DLL_PATH_FLAC_CODEC "@FLAC_SONAME@"
diff --git a/xbmc/DllPaths_win32.h b/xbmc/DllPaths_win32.h
index 894eb744a7..6d1aca514b 100644
--- a/xbmc/DllPaths_win32.h
+++ b/xbmc/DllPaths_win32.h
@@ -47,7 +47,6 @@
#define DLL_PATH_SID_CODEC "special://xbmcbin/system/players/paplayer/libsidplay2.dll"
#define DLL_PATH_SPC_CODEC "special://xbmcbin/system/players/paplayer/SNESAPU.dll"
#define DLL_PATH_VGM_CODEC "special://xbmcbin/system/players/paplayer/vgmstream.dll"
-#define DLL_PATH_WAVPACK_CODEC "special://xbmcbin/system/players/paplayer/wavpack.dll"
#define DLL_PATH_YM_CODEC "special://xbmcbin/system/players/paplayer/stsoundlibrary.dll"
#define DLL_PATH_MODPLUG_CODEC "special://xbmcbin/system/players/paplayer/libmodplug.dll"
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index c7ed1ae477..2330c0ea35 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -491,7 +491,7 @@ bool CFileItem::IsVideo() const
if (HasMusicInfoTag()) return false;
if (HasPictureInfoTag()) return false;
- if (IsHDHomeRun() || IsTuxBox() || URIUtils::IsDVD(m_strPath))
+ if (IsHDHomeRun() || IsTuxBox() || URIUtils::IsDVD(m_strPath) || IsSlingbox())
return true;
CStdString extension;
@@ -804,6 +804,11 @@ bool CFileItem::IsHDHomeRun() const
return URIUtils::IsHDHomeRun(m_strPath);
}
+bool CFileItem::IsSlingbox() const
+{
+ return URIUtils::IsSlingbox(m_strPath);
+}
+
bool CFileItem::IsVTP() const
{
return URIUtils::IsVTP(m_strPath);
diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h
index 506bf70009..9968603936 100644
--- a/xbmc/FileItem.h
+++ b/xbmc/FileItem.h
@@ -135,6 +135,7 @@ public:
bool IsTuxBox() const;
bool IsMythTV() const;
bool IsHDHomeRun() const;
+ bool IsSlingbox() const;
bool IsVTP() const;
bool IsLiveTV() const;
bool IsRSS() const;
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 553bbe7e0f..03d9c789c6 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -998,6 +998,8 @@ TIME_FORMAT CGUIInfoManager::TranslateTimeFormat(const CStdString &format)
else if (format.Equals("(hh:mm)")) return TIME_FORMAT_HH_MM;
else if (format.Equals("(mm:ss)")) return TIME_FORMAT_MM_SS;
else if (format.Equals("(hh:mm:ss)")) return TIME_FORMAT_HH_MM_SS;
+ else if (format.Equals("(h)")) return TIME_FORMAT_H;
+ else if (format.Equals("(h:mm:ss)")) return TIME_FORMAT_H_MM_SS;
return TIME_FORMAT_GUESS;
}
@@ -2623,7 +2625,7 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi
AddonPtr addon;
if (info.GetData2() == 0)
CAddonMgr::Get().GetAddon(const_cast<CGUIInfoManager*>(this)->GetLabel(info.GetData1(), contextWindow),addon);
- else
+ else
CAddonMgr::Get().GetAddon(m_stringParameters[info.GetData1()],addon);
if (addon && info.m_info == SYSTEM_ADDON_TITLE)
return addon->Name();
@@ -2806,9 +2808,13 @@ CStdString CGUIInfoManager::LocalizeTime(const CDateTime &time, TIME_FORMAT form
case TIME_FORMAT_HH_MM:
return time.GetAsLocalizedTime(use12hourclock ? "h:mm" : "HH:mm", false);
case TIME_FORMAT_HH_MM_XX:
- return time.GetAsLocalizedTime(use12hourclock ? "h:mm xx" : "HH:mm", false);
+ return time.GetAsLocalizedTime(use12hourclock ? "h:mm xx" : "HH:mm", false);
case TIME_FORMAT_HH_MM_SS:
return time.GetAsLocalizedTime("", true);
+ case TIME_FORMAT_H:
+ return time.GetAsLocalizedTime("h", false);
+ case TIME_FORMAT_H_MM_SS:
+ return time.GetAsLocalizedTime("h:mm:ss", true);
default:
break;
}
@@ -3055,9 +3061,9 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item) co
case MUSICPLAYER_GENRE:
if (tag.GetGenre().size()) { return tag.GetGenre(); }
break;
- case MUSICPLAYER_LYRICS:
- if (tag.GetLyrics().size()) { return tag.GetLyrics(); }
- break;
+ case MUSICPLAYER_LYRICS:
+ if (tag.GetLyrics().size()) { return tag.GetLyrics(); }
+ break;
case MUSICPLAYER_TRACK_NUMBER:
{
CStdString strTrack;
@@ -3171,7 +3177,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)
CStdString strYear;
if (m_currentFile->GetVideoInfoTag()->m_iSpecialSortEpisode > 0)
strYear.Format("S%i", m_currentFile->GetVideoInfoTag()->m_iEpisode);
- else if(m_currentFile->GetVideoInfoTag()->m_iEpisode > 0)
+ else if(m_currentFile->GetVideoInfoTag()->m_iEpisode > 0)
strYear.Format("%i", m_currentFile->GetVideoInfoTag()->m_iEpisode);
return strYear;
}
@@ -3327,6 +3333,11 @@ void CGUIInfoManager::SetCurrentSong(CFileItem &item)
}
else
m_currentFile->SetMusicThumb();
+ if (!m_currentFile->HasProperty("fanart_image"))
+ {
+ if (m_currentFile->CacheLocalFanart())
+ m_currentFile->SetProperty("fanart_image", m_currentFile->GetCachedFanart());
+ }
m_currentFile->FillInDefaultIcon();
CMusicInfoLoader::LoadAdditionalTagInfo(m_currentFile);
@@ -3934,7 +3945,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
else if (item->IsVideoDb() && item->HasVideoInfoTag())
{
if( item->m_bIsFolder )
- path = item->GetVideoInfoTag()->m_strPath;
+ path = item->GetVideoInfoTag()->m_strPath;
else
URIUtils::GetParentPath(item->GetVideoInfoTag()->m_strFileNameAndPath, path);
}
diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp
index f486aae142..f86ccf6040 100644
--- a/xbmc/Util.cpp
+++ b/xbmc/Util.cpp
@@ -186,6 +186,10 @@ CStdString CUtil::GetTitleFromPath(const CStdString& strFileNameAndPath, bool bI
else if (url.GetProtocol() == "hdhomerun" && strFilename.IsEmpty())
strFilename = "HDHomerun Devices";
+ // Slingbox Devices
+ else if (url.GetProtocol() == "sling")
+ strFilename = "Slingbox";
+
// ReplayTV Devices
else if (url.GetProtocol() == "rtv")
strFilename = "ReplayTV Devices";
@@ -1304,6 +1308,9 @@ bool CUtil::TestSplitExec()
CUtil::SplitExecFunction("SetProperty(Foo,\"\")", function, params);
if (function != "SetProperty" || params.size() != 2 || params[0] != "Foo" || params[1] != "")
return false;
+ CUtil::SplitExecFunction("SetProperty(foo,ba(\"ba black )\",sheep))", function, params);
+ if (function != "SetProperty" || params.size() != 2 || params[0] != "foo" || params[1] != "ba(\"ba black )\",sheep)")
+ return false;
return true;
}
#endif
@@ -1344,7 +1351,6 @@ void CUtil::SplitExecFunction(const CStdString &execString, CStdString &function
if (ch == '\"' && !escaped)
{ // finished a quote - no need to add the end quote to our string
inQuotes = false;
- continue;
}
}
else
@@ -1352,7 +1358,6 @@ void CUtil::SplitExecFunction(const CStdString &execString, CStdString &function
if (ch == '\"' && !escaped)
{ // start of quote - no need to add the quote to our string
inQuotes = true;
- continue;
}
if (inFunction && ch == ')')
{ // end of a function
@@ -1366,6 +1371,9 @@ void CUtil::SplitExecFunction(const CStdString &execString, CStdString &function
{ // not in a function, so a comma signfies the end of this parameter
if (whiteSpacePos)
parameter = parameter.Left(whiteSpacePos);
+ // trim off start and end quotes
+ if (parameter.GetLength() > 1 && parameter[0] == '\"' && parameter[parameter.GetLength() - 1] == '\"')
+ parameter = parameter.Mid(1,parameter.GetLength() - 2);
parameters.push_back(parameter);
parameter.Empty();
whiteSpacePos = 0;
@@ -1393,6 +1401,9 @@ void CUtil::SplitExecFunction(const CStdString &execString, CStdString &function
CLog::Log(LOGWARNING, "%s(%s) - end of string while searching for ) or \"", __FUNCTION__, execString.c_str());
if (whiteSpacePos)
parameter = parameter.Left(whiteSpacePos);
+ // trim off start and end quotes
+ if (parameter.GetLength() > 1 && parameter[0] == '\"' && parameter[parameter.GetLength() - 1] == '\"')
+ parameter = parameter.Mid(1,parameter.GetLength() - 2);
if (!parameter.IsEmpty() || parameters.size())
parameters.push_back(parameter);
}
@@ -2249,6 +2260,7 @@ void CUtil::ScanForExternalSubtitles(const CStdString& strMovie, std::vector<CSt
CFileItem item(strMovie, false);
if (item.IsInternetStream()) return ;
if (item.IsHDHomeRun()) return ;
+ if (item.IsSlingbox()) return ;
if (item.IsPlayList()) return ;
if (!item.IsVideo()) return ;
diff --git a/xbmc/XBDateTime.h b/xbmc/XBDateTime.h
index fbc67cf61e..f092c76a52 100644
--- a/xbmc/XBDateTime.h
+++ b/xbmc/XBDateTime.h
@@ -37,7 +37,9 @@ enum TIME_FORMAT { TIME_FORMAT_GUESS = 0,
TIME_FORMAT_HH_MM = 6,
TIME_FORMAT_HH_MM_SS = 7,
TIME_FORMAT_XX = 8, // AM/PM
- TIME_FORMAT_HH_MM_XX = 14};
+ TIME_FORMAT_HH_MM_XX = 14,
+ TIME_FORMAT_H = 16,
+ TIME_FORMAT_H_MM_SS = 19};
class CDateTime;
diff --git a/xbmc/cores/dvdplayer/DVDAudio.cpp b/xbmc/cores/dvdplayer/DVDAudio.cpp
index ee52772ae6..d0f8e195c4 100644
--- a/xbmc/cores/dvdplayer/DVDAudio.cpp
+++ b/xbmc/cores/dvdplayer/DVDAudio.cpp
@@ -238,7 +238,7 @@ void CDVDAudio::Finish()
if(silence > 0 && m_iBufferSize > 0)
{
CLog::Log(LOGDEBUG, "CDVDAudio::Drain - adding %d bytes of silence, buffer size: %d, chunk size: %d", silence, m_iBufferSize, m_dwPacketSize);
- m_pBuffer = (BYTE*)realloc(m_pBuffer, m_dwPacketSize);
+ m_pBuffer = (BYTE*)realloc(m_pBuffer, m_iBufferSize + silence);
memset(m_pBuffer+m_iBufferSize, 0, silence);
m_iBufferSize += silence;
}
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp
index d9cd38f4c8..e4e7065b71 100644
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.cpp
@@ -65,7 +65,8 @@ CDVDInputStream* CDVDFactoryInputStream::CreateInputStream(IDVDPlayer* pPlayer,
|| file.substr(0, 7) == "mmst://"
|| file.substr(0, 7) == "mmsh://")
return new CDVDInputStreamFFmpeg();
- else if(file.substr(0, 7) == "myth://"
+ else if(file.substr(0, 8) == "sling://"
+ || file.substr(0, 7) == "myth://"
|| file.substr(0, 8) == "cmyth://"
|| file.substr(0, 8) == "gmyth://"
|| file.substr(0, 6) == "vtp://")
diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamTV.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamTV.cpp
index cae72e999c..5ed50a960f 100644
--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamTV.cpp
+++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamTV.cpp
@@ -22,6 +22,7 @@
#include "DVDInputStreamTV.h"
#include "filesystem/MythFile.h"
#include "filesystem/VTPFile.h"
+#include "filesystem/Slingbox.h"
#include "URL.h"
using namespace XFILE;
@@ -54,6 +55,12 @@ bool CDVDInputStreamTV::Open(const char* strFile, const std::string& content)
m_pLiveTV = ((CVTPFile*)m_pFile)->GetLiveTV();
m_pRecordable = NULL;
}
+ else if (strncmp(strFile, "sling://", 8) == 0)
+ {
+ m_pFile = new CSlingboxFile();
+ m_pLiveTV = ((CSlingboxFile*)m_pFile)->GetLiveTV();
+ m_pRecordable = NULL;
+ }
else
{
m_pFile = new CMythFile();
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h b/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
index fc385f87da..4f7428afdb 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
@@ -34,6 +34,14 @@ extern "C" {
#include "DynamicDll.h"
#include "utils/log.h"
+#ifndef LIBASS_VERSION /* Legacy version. */
+typedef struct ass_library_s ASS_Library;
+typedef struct render_priv_s ASS_Renderer;
+typedef ass_image_t ASS_Image;
+typedef ass_track_t ASS_Track;
+typedef ass_event_t ASS_Event;
+#endif
+
class DllLibassInterface
{
public:
diff --git a/xbmc/cores/paplayer/CodecFactory.cpp b/xbmc/cores/paplayer/CodecFactory.cpp
index 02c12e7d7c..c87bdb1109 100644
--- a/xbmc/cores/paplayer/CodecFactory.cpp
+++ b/xbmc/cores/paplayer/CodecFactory.cpp
@@ -26,7 +26,6 @@
#include "OGGcodec.h"
#include "FLACcodec.h"
#include "WAVcodec.h"
-#include "WAVPackcodec.h"
#include "ModplugCodec.h"
#include "NSFCodec.h"
#ifdef HAS_SPC_CODEC
@@ -63,7 +62,7 @@ ICodec* CodecFactory::CreateCodec(const CStdString& strFileType)
strFileType.Equals("m4a") || strFileType.Equals("aac"))
return new DVDPlayerCodec();
else if (strFileType.Equals("wv"))
- return new WAVPackCodec();
+ return new DVDPlayerCodec();
else if (strFileType.Equals("669") || strFileType.Equals("abc") ||
strFileType.Equals("amf") || strFileType.Equals("ams") ||
strFileType.Equals("dbm") || strFileType.Equals("dmf") ||
diff --git a/xbmc/cores/paplayer/Makefile.in b/xbmc/cores/paplayer/Makefile.in
index 3a3e5595c7..8b0754d12d 100644
--- a/xbmc/cores/paplayer/Makefile.in
+++ b/xbmc/cores/paplayer/Makefile.in
@@ -21,7 +21,6 @@ SRCS=ADPCMCodec.cpp \
TimidityCodec.cpp \
VGMCodec.cpp \
WAVcodec.cpp \
- WAVPackcodec.cpp \
YMCodec.cpp \
ifeq (@USE_ASAP_CODEC@,1)
diff --git a/xbmc/cores/paplayer/WAVPackcodec.cpp b/xbmc/cores/paplayer/WAVPackcodec.cpp
deleted file mode 100644
index 3e904c88a1..0000000000
--- a/xbmc/cores/paplayer/WAVPackcodec.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "WAVPackcodec.h"
-#include "utils/log.h"
-#ifdef _LINUX
-#include "config.h"
-#endif
-
-WAVPackCodec::WAVPackCodec()
-{
- m_SampleRate = 0;
- m_Channels = 0;
- m_BitsPerSample = 0;
- m_Bitrate = 0;
- m_CodecName = "WAVPack";
-
- m_Handle=NULL;
-
- m_BufferSize=0;
- m_BufferPos = 0;
- m_Buffer=NULL;
- m_ReadBuffer=NULL;
-}
-
-WAVPackCodec::~WAVPackCodec()
-{
- DeInit();
-}
-
-bool WAVPackCodec::Init(const CStdString &strFile, unsigned int filecache)
-{
- if (!m_dll.Load())
- return false;
-
- // Open the file to play
- if (!m_file.Open(strFile, READ_CACHED))
- {
- CLog::Log(LOGERROR, "WAVPackCodec: Can't open %s", strFile.c_str());
- return false;
- }
-
- // setup i/o callbacks
- m_Callbacks.read_bytes=ReadCallback;
- m_Callbacks.get_pos=GetPosCallback;
- m_Callbacks.set_pos_abs=SetPosAbsCallback;
- m_Callbacks.set_pos_rel=SetPosRelCallback;
- m_Callbacks.push_back_byte=PushBackByteCallback;
- m_Callbacks.get_length=GetLengthCallback;
- m_Callbacks.can_seek=CanSeekCallback;
-
- // open file with decoder
- // NOTE: We restrict to 2 channel here, as otherwise xbox doesn't have the CPU
- m_Handle=m_dll.WavpackOpenFileInputEx(&m_Callbacks, this, NULL, m_errormsg, OPEN_TAGS | OPEN_2CH_MAX | OPEN_NORMALIZE, 23);
- if (!m_Handle)
- {
- CLog::Log(LOGERROR, "WAVPackCodec: Can't open decoder for %s", strFile.c_str());
- return false;
- }
-
- m_SampleRate = m_dll.WavpackGetSampleRate(m_Handle);
- m_Channels = m_dll.WavpackGetReducedChannels(m_Handle);
- m_BitsPerSample = m_dll.WavpackGetBitsPerSample(m_Handle);
- m_TotalTime = (__int64)(m_dll.WavpackGetNumSamples(m_Handle) * 1000.0 / m_SampleRate);
- m_Bitrate = (int)m_dll.WavpackGetAverageBitrate(m_Handle, TRUE);
-
- if (m_SampleRate==0 || m_Channels==0 || m_BitsPerSample==0 || m_TotalTime==0)
- {
- CLog::Log(LOGERROR, "WAVPackCodec: incomplete stream info from %s, SampleRate=%i, Channels=%i, BitsPerSample=%i, TotalTime=%llu", strFile.c_str(), m_SampleRate, m_Channels, m_BitsPerSample, m_TotalTime);
- return false;
- }
-
- m_Buffer = new BYTE[576*m_Channels*(m_BitsPerSample/8)*2];
-
- m_ReadBuffer = new BYTE[4*576*m_Channels];
-
- // Get replay gain info
- char value [32];
- if (m_dll.WavpackGetTagItem (m_Handle, "replaygain_track_gain", value, sizeof (value)))
- {
- m_replayGain.iTrackGain = (int)(atof(value) * 100 + 0.5);
- m_replayGain.iHasGainInfo |= REPLAY_GAIN_HAS_TRACK_INFO;
- }
- if (m_dll.WavpackGetTagItem (m_Handle, "replaygain_album_gain", value, sizeof (value)))
- {
- m_replayGain.iAlbumGain = (int)(atof(value) * 100 + 0.5);
- m_replayGain.iHasGainInfo |= REPLAY_GAIN_HAS_ALBUM_INFO;
- }
- if (m_dll.WavpackGetTagItem (m_Handle, "replaygain_track_peak", value, sizeof (value)))
- {
- m_replayGain.fTrackPeak = (float)atof(value);
- m_replayGain.iHasGainInfo |= REPLAY_GAIN_HAS_TRACK_PEAK;
- }
- if (m_dll.WavpackGetTagItem (m_Handle, "replaygain_album_peak", value, sizeof (value)))
- {
- m_replayGain.fAlbumPeak = (float)atof(value);
- m_replayGain.iHasGainInfo |= REPLAY_GAIN_HAS_ALBUM_PEAK;
- }
-
- return true;
-}
-
-void WAVPackCodec::DeInit()
-{
- if (m_Handle)
- m_dll.WavpackCloseFile(m_Handle);
- m_Handle = NULL;
-
- if (m_Buffer)
- delete[] m_Buffer;
- m_Buffer=NULL;
-
- if (m_ReadBuffer)
- delete[] m_ReadBuffer;
- m_ReadBuffer=NULL;
-
- m_file.Close();
-}
-
-__int64 WAVPackCodec::Seek(__int64 iSeekTime)
-{
- m_BufferSize=m_BufferPos=0;
- int SeekSample=(int)(m_SampleRate / 1000.0 * iSeekTime);
- if (m_dll.WavpackSeekSample(m_Handle, SeekSample))
- {
- return iSeekTime;
- }
- return -1;
-}
-
-int WAVPackCodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize)
-{
- *actualsize=0;
-
- bool bEof=false;
-
- // Do we have to refill our audio buffer?
- if (m_BufferSize-m_BufferPos<size)
- {
- // Move the remaining audio data to the beginning of the buffer
- memmove(m_Buffer, m_Buffer + m_BufferPos, m_BufferSize-m_BufferPos);
- m_BufferSize=m_BufferSize-m_BufferPos;
- m_BufferPos = 0;
-
- // Fill our buffer with a chunk of audio data
- int tsamples = m_dll.WavpackUnpackSamples(m_Handle, (int32_t*)m_ReadBuffer, 576) * m_Channels;
- int tbytes = tsamples * (m_BitsPerSample/8);
-
- if (!tsamples)
- bEof=true;
- else
- {
- FormatSamples(m_Buffer + m_BufferSize, m_BitsPerSample/8, (long *) m_ReadBuffer, tsamples);
- m_BufferSize+=tbytes;
- }
- }
-
- // Our buffer is empty and no data left to read
- if (m_BufferSize-m_BufferPos==0 && bEof)
- return READ_EOF;
-
- // Try to give the player the amount of audio data he wants
- if (m_BufferSize-m_BufferPos>=size)
- { // we have enough data in our buffer
- memcpy(pBuffer, m_Buffer + m_BufferPos, size);
- m_BufferPos+=size;
- *actualsize=size;
- }
- else
- { // Only a smaller amount of data left as the player wants
- memcpy(pBuffer, m_Buffer + m_BufferPos, m_BufferSize-m_BufferPos);
- *actualsize=m_BufferSize-m_BufferPos;
- m_BufferPos+=m_BufferSize-m_BufferPos;
- }
-
- return READ_SUCCESS;
-}
-
-bool WAVPackCodec::CanInit()
-{
- return m_dll.CanLoad();
-}
-
-void WAVPackCodec::FormatSamples (BYTE *dst, int bps, long *src, unsigned long samcnt)
-{
- long temp;
-
- switch (bps)
- {
- case 1:
- while (samcnt--)
- {
- temp = *src++;
- dst [0] = 0;
- dst [1] = (BYTE)(temp & 0xFF);
- dst += 2;
- }
-
- break;
-
- case 2:
- while (samcnt--)
- {
- temp = *src++;
-#ifndef WORDS_BIGENDIAN
- dst [0] = (BYTE)(temp & 0xFF);
- dst [1] = (BYTE)(temp >> 8);
-#else
- dst [1] = (BYTE)(temp & 0xFF);
- dst [0] = (BYTE)(temp >> 8);
-#endif
- dst += 2;
- }
-
- break;
-
- case 3:
- while (samcnt--)
- {
- temp = *src++;
- dst [0] = (BYTE)(temp & 0xFF);
- dst [1] = (BYTE)((temp >> 8) & 0xFF);
- dst [2] = (BYTE)((temp >> 16) & 0xFF);
- dst += 3;
- }
-
- break;
-
- case 4:
- while (samcnt--)
- {
- temp = *src++;
- dst [0] = (BYTE)temp;
- dst [1] = (BYTE)(temp >> 8);
- dst [2] = (BYTE)(temp >> 16);
- dst [3] = (BYTE)(temp >> 24);
- dst += 4;
- }
-
- break;
- }
-}
-
-int WAVPackCodec::ReadCallback(void *id, void *data, int bcount)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- return pCodec->m_file.Read(data, bcount);
-}
-
-int WAVPackCodec::SetPosAbsCallback(void *id, unsigned int pos)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- if (pCodec->m_file.Seek(pos, SEEK_SET)>=0)
- return 0;
-
- return -1;
-}
-
-int WAVPackCodec::SetPosRelCallback(void *id, int delta, int mode)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- if (pCodec->m_file.Seek(delta, mode)>=0)
- return 0;
-
- return -1;
-}
-
-unsigned int WAVPackCodec::GetPosCallback(void *id)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- return (unsigned int)pCodec->m_file.GetPosition();
-}
-
-int WAVPackCodec::CanSeekCallback(void *id)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- return 1;
-}
-
-unsigned int WAVPackCodec::GetLengthCallback(void *id)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- return (unsigned int)pCodec->m_file.GetLength();
-}
-
-int WAVPackCodec::PushBackByteCallback(void *id, int c)
-{
- WAVPackCodec* pCodec=(WAVPackCodec*)id;
- if (!pCodec)
- return 0;
-
- if (pCodec->m_file.Seek(pCodec->m_file.GetPosition()-1, SEEK_SET))
- return c;
-
- return EOF;
-}
diff --git a/xbmc/cores/paplayer/WAVPackcodec.h b/xbmc/cores/paplayer/WAVPackcodec.h
deleted file mode 100644
index b94e7eb531..0000000000
--- a/xbmc/cores/paplayer/WAVPackcodec.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#pragma once
-
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "DllWAVPack.h"
-#include "CachingCodec.h"
-
-class WAVPackCodec : public CachingCodec
-{
-public:
- WAVPackCodec();
- virtual ~WAVPackCodec();
-
- virtual bool Init(const CStdString &strFile, unsigned int filecache);
- virtual void DeInit();
- virtual __int64 Seek(__int64 iSeekTime);
- virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize);
- virtual bool CanInit();
-
-private:
- static int ReadCallback(void *id, void *data, int bcount);
- static unsigned int GetPosCallback(void *id);
- static int SetPosAbsCallback(void *id, unsigned int pos);
- static int SetPosRelCallback(void *id, int delta, int mode);
- static unsigned int GetLengthCallback(void *id);
- static int CanSeekCallback(void *id);
- static int PushBackByteCallback(void *id, int c);
-
- void FormatSamples (BYTE *dst, int bps, long *src, unsigned long samcnt);
-
- char m_errormsg[512];
- WavpackContext* m_Handle;
- #if (!defined WIN32)
- WavpackStreamReader m_Callbacks;
- #else
- stream_reader m_Callbacks;
- #endif
-
- BYTE* m_Buffer;
- int m_BufferSize;
- int m_BufferPos;
- BYTE* m_ReadBuffer;
-
- DllWavPack m_dll;
-};
-
diff --git a/xbmc/filesystem/FactoryDirectory.cpp b/xbmc/filesystem/FactoryDirectory.cpp
index cc509520ed..9a8c67a687 100644
--- a/xbmc/filesystem/FactoryDirectory.cpp
+++ b/xbmc/filesystem/FactoryDirectory.cpp
@@ -82,6 +82,7 @@
#endif
#include "DirectoryTuxBox.h"
#include "HDHomeRun.h"
+#include "Slingbox.h"
#include "MythDirectory.h"
#include "FileItem.h"
#include "URL.h"
@@ -167,6 +168,7 @@ IDirectory* CFactoryDirectory::Create(const CStdString& strPath)
if (strProtocol == "upnp") return new CUPnPDirectory();
#endif
if (strProtocol == "hdhomerun") return new CDirectoryHomeRun();
+ if (strProtocol == "sling") return new CSlingboxDirectory();
if (strProtocol == "myth") return new CMythDirectory();
if (strProtocol == "cmyth") return new CMythDirectory();
if (strProtocol == "rss") return new CRSSDirectory();
diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp
index f958fc28d8..8c47a7b39a 100644
--- a/xbmc/filesystem/FileCache.cpp
+++ b/xbmc/filesystem/FileCache.cpp
@@ -221,7 +221,6 @@ void CFileCache::Process()
while(m_writeRate)
{
- unsigned timestamp = CTimeUtils::GetTimeMS();
if(m_writePos - m_readPos < m_writeRate)
{
limiter.Reset(m_writePos);
diff --git a/xbmc/filesystem/FileFactory.cpp b/xbmc/filesystem/FileFactory.cpp
index 337f00eb01..dd2910f95e 100644
--- a/xbmc/filesystem/FileFactory.cpp
+++ b/xbmc/filesystem/FileFactory.cpp
@@ -69,6 +69,7 @@
#include "FileUDF.h"
#include "MythFile.h"
#include "HDHomeRun.h"
+#include "Slingbox.h"
#include "Application.h"
#include "URL.h"
#include "utils/log.h"
@@ -129,6 +130,7 @@ IFile* CFileFactory::CreateLoader(const CURL& url)
else if (strProtocol == "lastfm") return new CFileLastFM();
else if (strProtocol == "tuxbox") return new CFileTuxBox();
else if (strProtocol == "hdhomerun") return new CFileHomeRun();
+ else if (strProtocol == "sling") return new CSlingboxFile();
else if (strProtocol == "myth") return new CMythFile();
else if (strProtocol == "cmyth") return new CMythFile();
#ifdef HAS_FILESYSTEM_SMB
diff --git a/xbmc/filesystem/FileHD.cpp b/xbmc/filesystem/FileHD.cpp
index 1f9b4d16cc..438079722c 100644
--- a/xbmc/filesystem/FileHD.cpp
+++ b/xbmc/filesystem/FileHD.cpp
@@ -111,6 +111,7 @@ bool CFileHD::Exists(const CURL& url)
#ifdef _WIN32
CStdStringW strWFile;
+ URIUtils::RemoveSlashAtEnd(strFile);
g_charsetConverter.utf8ToW(strFile, strWFile, false);
return (_wstat64(strWFile.c_str(), &buffer)==0);
#else
diff --git a/xbmc/filesystem/FileSFTP.cpp b/xbmc/filesystem/FileSFTP.cpp
index 2be2c92509..5cf935c542 100644
--- a/xbmc/filesystem/FileSFTP.cpp
+++ b/xbmc/filesystem/FileSFTP.cpp
@@ -27,6 +27,7 @@
#include "utils/TimeUtils.h"
#include "Util.h"
#include <fcntl.h>
+#include <sstream>
#ifdef _WIN32
#pragma comment(lib, "ssh.lib")
@@ -48,11 +49,11 @@ static CStdString CorrectPath(const CStdString path)
return "/" + path;
}
-CSFTPSession::CSFTPSession(const CStdString &host, const CStdString &username, const CStdString &password)
+CSFTPSession::CSFTPSession(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password)
{
- CLog::Log(LOGINFO, "SFTPSession: Creating new session on host '%s' with user '%s'", host.c_str(), username.c_str());
+ CLog::Log(LOGINFO, "SFTPSession: Creating new session on host '%s:%d' with user '%s'", host.c_str(), port, username.c_str());
CSingleLock lock(m_critSect);
- if (!Connect(host, username, password))
+ if (!Connect(host, port, username, password))
Disconnect();
m_LastActive = CTimeUtils::GetTimeMS();
@@ -279,7 +280,7 @@ bool CSFTPSession::VerifyKnownHost(ssh_session session)
return false;
}
-bool CSFTPSession::Connect(const CStdString &host, const CStdString &username, const CStdString &password)
+bool CSFTPSession::Connect(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password)
{
m_connected = false;
m_session = NULL;
@@ -305,6 +306,12 @@ bool CSFTPSession::Connect(const CStdString &host, const CStdString &username, c
return false;
}
+ if (ssh_options_set(m_session, SSH_OPTIONS_PORT, &port) < 0)
+ {
+ CLog::Log(LOGERROR, "SFTPSession: Failed to set port '%d' for session", port);
+ return false;
+ }
+
ssh_options_set(m_session, SSH_OPTIONS_LOG_VERBOSITY, 0);
#else
@@ -322,6 +329,12 @@ bool CSFTPSession::Connect(const CStdString &host, const CStdString &username, c
return false;
}
+ if (ssh_options_set_port(options, port) < 0)
+ {
+ CLog::Log(LOGERROR, "SFTPSession: Failed to set port '%d' for session", port);
+ return false;
+ }
+
ssh_options_set_log_verbosity(options, 0);
ssh_set_options(m_session, options);
@@ -399,14 +412,29 @@ void CSFTPSession::Disconnect()
CCriticalSection CSFTPSessionManager::m_critSect;
map<CStdString, CSFTPSessionPtr> CSFTPSessionManager::sessions;
-CSFTPSessionPtr CSFTPSessionManager::CreateSession(const CStdString &host, const CStdString &username, const CStdString &password)
+CSFTPSessionPtr CSFTPSessionManager::CreateSession(const CURL &url)
+{
+ string username = url.GetUserName().c_str();
+ string password = url.GetPassWord().c_str();
+ string hostname = url.GetHostName().c_str();
+ unsigned int port = url.HasPort() ? url.GetPort() : 22;
+
+ return CSFTPSessionManager::CreateSession(hostname, port, username, password);
+}
+
+CSFTPSessionPtr CSFTPSessionManager::CreateSession(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password)
{
+ // Convert port number to string
+ stringstream itoa;
+ itoa << port;
+ CStdString portstr = itoa.str();
+
CSingleLock lock(m_critSect);
- CStdString key = username + ":" + password + "@" + host;
+ CStdString key = username + ":" + password + "@" + host + ":" + portstr;
CSFTPSessionPtr ptr = sessions[key];
if (ptr == NULL)
{
- ptr = CSFTPSessionPtr(new CSFTPSession(host, username, password));
+ ptr = CSFTPSessionPtr(new CSFTPSession(host, port, username, password));
sessions[key] = ptr;
}
@@ -443,15 +471,10 @@ CFileSFTP::~CFileSFTP()
bool CFileSFTP::Open(const CURL& url)
{
- string username = url.GetUserName().c_str();
- string password = url.GetPassWord().c_str();
- string filename = url.GetFileName().c_str();
- string hostname = url.GetHostName().c_str();
-
- m_session = CSFTPSessionManager::CreateSession(hostname, username, password);
+ m_session = CSFTPSessionManager::CreateSession(url);
if (m_session)
{
- m_file = filename.c_str();
+ m_file = url.GetFileName().c_str();
m_sftp_handle = m_session->CreateFileHande(m_file);
return (m_sftp_handle != NULL);
@@ -516,7 +539,7 @@ unsigned int CFileSFTP::Read(void* lpBuf, int64_t uiBufSize)
bool CFileSFTP::Exists(const CURL& url)
{
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url.GetHostName().c_str(), url.GetUserName().c_str(), url.GetPassWord().c_str());
+ CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
if (session)
return session->Exists(url.GetFileName().c_str());
else
@@ -528,7 +551,7 @@ bool CFileSFTP::Exists(const CURL& url)
int CFileSFTP::Stat(const CURL& url, struct __stat64* buffer)
{
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url.GetHostName().c_str(), url.GetUserName().c_str(), url.GetPassWord().c_str());
+ CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
if (session)
return session->Stat(url.GetFileName().c_str(), buffer);
else
diff --git a/xbmc/filesystem/FileSFTP.h b/xbmc/filesystem/FileSFTP.h
index 892a556086..f9f4a32c4b 100644
--- a/xbmc/filesystem/FileSFTP.h
+++ b/xbmc/filesystem/FileSFTP.h
@@ -49,7 +49,7 @@
class CSFTPSession
{
public:
- CSFTPSession(const CStdString &host, const CStdString &username, const CStdString &password);
+ CSFTPSession(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password);
virtual ~CSFTPSession();
sftp_file CreateFileHande(const CStdString &file);
@@ -63,7 +63,7 @@ public:
bool IsIdle();
private:
bool VerifyKnownHost(ssh_session session);
- bool Connect(const CStdString &host, const CStdString &username, const CStdString &password);
+ bool Connect(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password);
void Disconnect();
CCriticalSection m_critSect;
@@ -78,7 +78,8 @@ typedef boost::shared_ptr<CSFTPSession> CSFTPSessionPtr;
class CSFTPSessionManager
{
public:
- static CSFTPSessionPtr CreateSession(const CStdString &host, const CStdString &username, const CStdString &password);
+ static CSFTPSessionPtr CreateSession(const CURL &url);
+ static CSFTPSessionPtr CreateSession(const CStdString &host, unsigned int port, const CStdString &username, const CStdString &password);
static void ClearOutIdleSessions();
static void DisconnectAllSessions();
private:
diff --git a/xbmc/filesystem/HDDirectory.cpp b/xbmc/filesystem/HDDirectory.cpp
index d2d0897da6..c369368436 100644
--- a/xbmc/filesystem/HDDirectory.cpp
+++ b/xbmc/filesystem/HDDirectory.cpp
@@ -69,12 +69,9 @@ bool CHDDirectory::GetDirectory(const CStdString& strPath1, CFileItemList &items
CURL url(strPath);
memset(&wfd, 0, sizeof(wfd));
- if (!URIUtils::HasSlashAtEnd(strPath) )
-#ifndef _LINUX
- strRoot += "\\";
+ URIUtils::AddSlashAtEnd(strRoot);
+#ifdef _WIN32
strRoot.Replace("/", "\\");
-#else
- strRoot += "/";
#endif
if (URIUtils::IsDVD(strRoot) && m_isoReader.IsScanned())
{
@@ -86,7 +83,7 @@ bool CHDDirectory::GetDirectory(const CStdString& strPath1, CFileItemList &items
CIoSupport::RemapDriveLetter('D', "Cdrom0");
}
-#ifndef _LINUX
+#ifdef _WIN32
CStdStringW strSearchMask;
g_charsetConverter.utf8ToW(strRoot, strSearchMask, false);
strSearchMask += "*.*";
@@ -108,7 +105,7 @@ bool CHDDirectory::GetDirectory(const CStdString& strPath1, CFileItemList &items
if (wfd.cFileName[0] != 0)
{
CStdString strLabel;
-#ifndef _LINUX
+#ifdef _WIN32
g_charsetConverter.wToUTF8(wfd.cFileName,strLabel);
#else
strLabel = wfd.cFileName;
@@ -155,14 +152,9 @@ bool CHDDirectory::GetDirectory(const CStdString& strPath1, CFileItemList &items
bool CHDDirectory::Create(const char* strPath)
{
CStdString strPath1 = strPath;
- if (!URIUtils::HasSlashAtEnd(strPath1))
-#ifndef _LINUX
- strPath1 += '\\';
-#else
- strPath1 += '/';
-#endif
+ URIUtils::AddSlashAtEnd(strPath1);
-#ifndef _LINUX
+#ifdef _WIN32
if (strPath1.size() == 3 && strPath1[1] == ':')
return Exists(strPath); // A drive - we can't "create" a drive
CStdStringW strWPath1;
@@ -180,7 +172,7 @@ bool CHDDirectory::Create(const char* strPath)
bool CHDDirectory::Remove(const char* strPath)
{
-#ifndef _LINUX
+#ifdef _WIN32
CStdStringW strWPath;
g_charsetConverter.utf8ToW(strPath, strWPath, false);
return (::RemoveDirectoryW(strWPath) || GetLastError() == ERROR_PATH_NOT_FOUND) ? true : false;
@@ -194,11 +186,10 @@ bool CHDDirectory::Exists(const char* strPath)
if (!strPath || !*strPath)
return false;
CStdString strReplaced=strPath;
-#ifndef _LINUX
+#ifdef _WIN32
CStdStringW strWReplaced;
strReplaced.Replace("/","\\");
- if (!URIUtils::HasSlashAtEnd(strReplaced))
- strReplaced += '\\';
+ URIUtils::AddSlashAtEnd(strReplaced);
g_charsetConverter.utf8ToW(strReplaced, strWReplaced, false);
DWORD attributes = GetFileAttributesW(strWReplaced);
#else
diff --git a/xbmc/filesystem/Makefile.in b/xbmc/filesystem/Makefile.in
index 54422d7e5b..dcf77fe513 100644
--- a/xbmc/filesystem/Makefile.in
+++ b/xbmc/filesystem/Makefile.in
@@ -68,6 +68,7 @@ SRCS=AddonsDirectory.cpp \
SAPFile.cpp \
SFTPDirectory.cpp \
SIDFileDirectory.cpp \
+ Slingbox.cpp \
SmartPlaylistDirectory.cpp \
SMBDirectory.cpp \
SourcesDirectory.cpp \
diff --git a/xbmc/filesystem/SFTPDirectory.cpp b/xbmc/filesystem/SFTPDirectory.cpp
index 003d46e6c0..20fa46e615 100644
--- a/xbmc/filesystem/SFTPDirectory.cpp
+++ b/xbmc/filesystem/SFTPDirectory.cpp
@@ -37,7 +37,7 @@ bool CSFTPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &item
{
CURL url(strPath);
- CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url.GetHostName().c_str(), url.GetUserName().c_str(), url.GetPassWord().c_str());
+ CSFTPSessionPtr session = CSFTPSessionManager::CreateSession(url);
return session->GetDirectory(url.GetWithoutFilename().c_str(), url.GetFileName().c_str(), items);
}
#endif
diff --git a/xbmc/filesystem/Slingbox.cpp b/xbmc/filesystem/Slingbox.cpp
new file mode 100644
index 0000000000..58bacb1c4e
--- /dev/null
+++ b/xbmc/filesystem/Slingbox.cpp
@@ -0,0 +1,622 @@
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "FileItem.h"
+#include "Slingbox.h"
+#include "filesystem/File.h"
+#include "lib/SlingboxLib/SlingboxLib.h"
+#include "settings/Settings.h"
+#include "utils/log.h"
+#include "utils/XMLUtils.h"
+
+using namespace XFILE;
+using namespace std;
+
+CSlingboxDirectory::CSlingboxDirectory()
+{
+}
+
+CSlingboxDirectory::~CSlingboxDirectory()
+{
+}
+
+bool CSlingboxDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
+{
+ // Create generic Watch Slingbox item
+ CFileItemPtr item(new CFileItem(strPath, false));
+ item->SetLabel("Watch Slingbox");
+ item->SetLabelPreformated(true);
+ items.Add(item);
+
+ return true;
+}
+
+CSlingboxFile::CSlingboxFile()
+{
+ // Create the Slingbox object
+ m_pSlingbox = new CSlingbox();
+}
+
+CSlingboxFile::~CSlingboxFile()
+{
+ // Destroy the Slingbox object
+ delete m_pSlingbox;
+}
+
+bool CSlingboxFile::Open(const CURL& url)
+{
+ // Setup the IP/hostname and port (setup default port if none specified)
+ unsigned int uiPort;
+ if (url.HasPort())
+ uiPort = (unsigned int)url.GetPort();
+ else
+ uiPort = 5001;
+ m_pSlingbox->SetAddress(url.GetHostName(), uiPort);
+
+ // Prepare to connect to the Slingbox
+ bool bAdmin;
+ if (url.GetUserName().CompareNoCase("administrator") == 0)
+ bAdmin = true;
+ else if (url.GetUserName().CompareNoCase("viewer") == 0)
+ bAdmin = false;
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Invalid or no username specified for Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ return false;
+ }
+
+ // Connect to the Slingbox
+ if (m_pSlingbox->Connect(bAdmin, url.GetPassWord()))
+ {
+ CLog::Log(LOGDEBUG, "%s - Sucessfully connected to Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error connecting to Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ return false;
+ }
+
+ // Initialize the stream
+ if (m_pSlingbox->InitializeStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully initialized stream on Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error initializing stream on Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ return false;
+ }
+
+ // Set correct input
+ if (url.GetFileNameWithoutPath() != "")
+ {
+ if (m_pSlingbox->SetInput(atoi(url.GetFileNameWithoutPath())))
+ CLog::Log(LOGDEBUG, "%s - Successfully requested change to input %i on Slingbox: %s",
+ __FUNCTION__, atoi(url.GetFileNameWithoutPath()), url.GetHostName().c_str());
+ else
+ CLog::Log(LOGERROR, "%s - Error requesting change to input %i on Slingbox: %s",
+ __FUNCTION__, atoi(url.GetFileNameWithoutPath()), url.GetHostName().c_str());
+ }
+
+ // Load the video settings
+ LoadSettings(url.GetHostName());
+
+ // Setup video options
+ if (m_pSlingbox->StreamSettings((CSlingbox::Resolution)m_sSlingboxSettings.iVideoResolution,
+ m_sSlingboxSettings.iVideoBitrate, m_sSlingboxSettings.iVideoFramerate,
+ m_sSlingboxSettings.iVideoSmoothing, m_sSlingboxSettings.iAudioBitrate,
+ m_sSlingboxSettings.iIFrameInterval))
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully set stream options (resolution: %ix%i; "
+ "video bitrate: %i kbit/s; fps: %i; smoothing: %i%%; audio bitrate %i kbit/s; "
+ "I frame interval: %i) on Slingbox: %s", __FUNCTION__,
+ m_sSlingboxSettings.iVideoWidth, m_sSlingboxSettings.iVideoHeight,
+ m_sSlingboxSettings.iVideoBitrate, m_sSlingboxSettings.iVideoFramerate,
+ m_sSlingboxSettings.iVideoSmoothing, m_sSlingboxSettings.iAudioBitrate,
+ m_sSlingboxSettings.iIFrameInterval, url.GetHostName().c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error setting stream options on Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ }
+
+ // Start the stream
+ if (m_pSlingbox->StartStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully started stream on Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error starting stream on Slingbox: %s",
+ __FUNCTION__, url.GetHostName().c_str());
+ return false;
+ }
+
+ // Check for correct input
+ if (url.GetFileNameWithoutPath() != "")
+ {
+ if (m_pSlingbox->GetInput() == -1)
+ CLog::Log(LOGDEBUG, "%s - Unable to confirm change to input %i on Slingbox: %s",
+ __FUNCTION__, atoi(url.GetFileNameWithoutPath()), url.GetHostName().c_str());
+ else if (m_pSlingbox->GetInput() == atoi(url.GetFileNameWithoutPath()))
+ CLog::Log(LOGDEBUG, "%s - Comfirmed change to input %i on Slingbox: %s",
+ __FUNCTION__, atoi(url.GetFileNameWithoutPath()), url.GetHostName().c_str());
+ else
+ CLog::Log(LOGERROR, "%s - Error changing to input %i on Slingbox: %s",
+ __FUNCTION__, atoi(url.GetFileNameWithoutPath()), url.GetHostName().c_str());
+ }
+
+ return true;
+}
+
+unsigned int CSlingboxFile::Read(void * pBuffer, int64_t iSize)
+{
+ // Read the data and check for any errors
+ int iRead = m_pSlingbox->ReadStream(pBuffer, (unsigned int)iSize);
+ if (iRead < 0)
+ {
+ CLog::Log(LOGERROR, "%s - Error reading stream from Slingbox: %s", __FUNCTION__,
+ m_sSlingboxSettings.strHostname.c_str());
+ return 0;
+ }
+
+ return iRead;
+}
+
+void CSlingboxFile::Close()
+{
+ // Stop the stream
+ if (m_pSlingbox->StopStream())
+ CLog::Log(LOGDEBUG, "%s - Successfully stopped stream on Slingbox: %s", __FUNCTION__,
+ m_sSlingboxSettings.strHostname.c_str());
+ else
+ CLog::Log(LOGERROR, "%s - Error stopping stream on Slingbox: %s", __FUNCTION__,
+ m_sSlingboxSettings.strHostname.c_str());
+
+ // Disconnect from the Slingbox
+ if (m_pSlingbox->Disconnect())
+ CLog::Log(LOGDEBUG, "%s - Successfully disconnected from Slingbox: %s", __FUNCTION__,
+ m_sSlingboxSettings.strHostname.c_str());
+ else
+ CLog::Log(LOGERROR, "%s - Error disconnecting from Slingbox: %s", __FUNCTION__,
+ m_sSlingboxSettings.strHostname.c_str());
+}
+
+bool CSlingboxFile::SkipNext()
+{
+ return m_pSlingbox->IsConnected();
+}
+
+bool CSlingboxFile::NextChannel()
+{
+ // Prepare variables
+ bool bSuccess = true;
+ int iPrevChannel = m_pSlingbox->GetChannel();
+
+ // Stop the stream
+ if (m_pSlingbox->StopStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully stopped stream before channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error stopping stream before channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ // Figure out which method to use
+ if (m_sSlingboxSettings.uiCodeChannelUp == 0)
+ {
+ // Change the channel
+ if (m_pSlingbox->ChannelUp())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully requested channel change on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+
+ if (m_pSlingbox->GetChannel() == -1)
+ {
+ CLog::Log(LOGDEBUG, "%s - Unable to confirm channel change on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else if (m_pSlingbox->GetChannel() != iPrevChannel)
+ {
+ CLog::Log(LOGDEBUG, "%s - Confirmed change to channel %i on Slingbox: %s",
+ __FUNCTION__, m_pSlingbox->GetChannel(), m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error changing channel on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error requesting channel change on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ else
+ {
+ // Change the channel using IR command
+ if (m_pSlingbox->SendIRCommand(m_sSlingboxSettings.uiCodeChannelUp))
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully sent IR command (code: 0x%.2X) from "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.uiCodeChannelUp,
+ m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error sending IR command (code: 0x%.2X) from "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.uiCodeChannelUp,
+ m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+
+ // Start the stream again
+ if (m_pSlingbox->StartStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully started stream after channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error starting stream after channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ return bSuccess;
+}
+
+bool CSlingboxFile::PrevChannel()
+{
+ // Prepare variables
+ bool bSuccess = true;
+ int iPrevChannel = m_pSlingbox->GetChannel();
+
+ // Stop the stream
+ if (m_pSlingbox->StopStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully stopped stream before channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error stopping stream before channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ // Figure out which method to use
+ if (m_sSlingboxSettings.uiCodeChannelDown == 0)
+ {
+ // Change the channel
+ if (m_pSlingbox->ChannelDown())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully requested channel change on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+
+ if (m_pSlingbox->GetChannel() == -1)
+ {
+ CLog::Log(LOGDEBUG, "%s - Unable to confirm channel change on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else if (m_pSlingbox->GetChannel() != iPrevChannel)
+ {
+ CLog::Log(LOGDEBUG, "%s - Confirmed change to channel %i on Slingbox: %s",
+ __FUNCTION__, m_pSlingbox->GetChannel(), m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error changing channel on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error requesting channel change on Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ else
+ {
+ // Change the channel using IR command
+ if (m_pSlingbox->SendIRCommand(m_sSlingboxSettings.uiCodeChannelDown))
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully sent IR command (code: 0x%.2X) from "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.uiCodeChannelDown,
+ m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error sending IR command (code: 0x%.2X) from "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.uiCodeChannelDown,
+ m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+
+ // Start the stream again
+ if (m_pSlingbox->StartStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully started stream after channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error starting Slingbox stream after channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ return bSuccess;
+}
+
+bool CSlingboxFile::SelectChannel(unsigned int uiChannel)
+{
+ // Check if a channel change is required
+ if (m_pSlingbox->GetChannel() == uiChannel)
+ return false;
+
+ // Prepare variables
+ bool bSuccess = true;
+
+ // Stop the stream
+ if (m_pSlingbox->StopStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully stopped stream before channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error stopping stream before channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ // Figure out which method to use
+ unsigned int uiButtonsWithCode = 0;
+ for (unsigned int i = 0; i < 10; i++)
+ {
+ if (m_sSlingboxSettings.uiCodeNumber[i] != 0)
+ uiButtonsWithCode++;
+ }
+ if (uiButtonsWithCode == 0)
+ {
+ // Change the channel
+ if (m_pSlingbox->SetChannel(uiChannel))
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully requested change to channel %i on Slingbox: %s",
+ __FUNCTION__, uiChannel, m_sSlingboxSettings.strHostname.c_str());
+
+ if (m_pSlingbox->GetChannel() == -1)
+ {
+ CLog::Log(LOGDEBUG, "%s - Unable to confirm change to channel %i on Slingbox: %s",
+ __FUNCTION__, uiChannel, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else if (m_pSlingbox->GetChannel() == uiChannel)
+ {
+ CLog::Log(LOGDEBUG, "%s - Confirmed change to channel %i on Slingbox: %s",
+ __FUNCTION__, uiChannel, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error changing to channel %i on Slingbox: %s",
+ __FUNCTION__, uiChannel, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error requesting change to channel %i on Slingbox: %s",
+ __FUNCTION__, uiChannel, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ else if (uiButtonsWithCode == 10)
+ {
+ // Prepare variables
+ CStdString strDigits;
+ strDigits.Format("%u", uiChannel);
+ unsigned int uiNumberOfDigits = strDigits.GetLength();
+
+ // Change the channel using IR commands
+ for (unsigned int i = 0; i < uiNumberOfDigits; i++)
+ {
+ if (m_pSlingbox->SendIRCommand(m_sSlingboxSettings.uiCodeNumber[strDigits[i] - '0']))
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully sent IR command (code: 0x%.2X) from "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.uiCodeNumber[strDigits[i] - '0'],
+ m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "%s - Error sending IR command (code: 0x%.2X) from "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.uiCodeNumber[strDigits[i] - '0'],
+ m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+ }
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error requesting change to channel %i on Slingbox due to one or more "
+ "missing button codes from advancedsettings.xml for Slingbox: %s", __FUNCTION__, uiChannel,
+ m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ // Start the stream again
+ if (m_pSlingbox->StartStream())
+ {
+ CLog::Log(LOGDEBUG, "%s - Successfully started stream after channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "%s - Error starting stream after channel change request on "
+ "Slingbox: %s", __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ bSuccess = false;
+ }
+
+ return bSuccess;
+}
+
+void CSlingboxFile::LoadSettings(const CStdString& strHostname)
+{
+ // Load default settings
+ m_sSlingboxSettings.strHostname = strHostname;
+ m_sSlingboxSettings.iVideoWidth = 320;
+ m_sSlingboxSettings.iVideoHeight = 240;
+ m_sSlingboxSettings.iVideoResolution = (int)CSlingbox::RESOLUTION320X240;
+ m_sSlingboxSettings.iVideoBitrate = 704;
+ m_sSlingboxSettings.iVideoFramerate = 30;
+ m_sSlingboxSettings.iVideoSmoothing = 50;
+ m_sSlingboxSettings.iAudioBitrate = 64;
+ m_sSlingboxSettings.iIFrameInterval = 10;
+ m_sSlingboxSettings.uiCodeChannelUp = 0;
+ m_sSlingboxSettings.uiCodeChannelDown = 0;
+ for (unsigned int i = 0; i < 10; i++)
+ m_sSlingboxSettings.uiCodeNumber[i] = 0;
+
+ // Check if a SlingboxSettings.xml file exists
+ CStdString slingboxXMLFile = g_settings.GetUserDataItem("SlingboxSettings.xml");
+ if (!CFile::Exists(slingboxXMLFile))
+ {
+ CLog::Log(LOGNOTICE, "No SlingboxSettings.xml file (%s) found - using default settings",
+ slingboxXMLFile.c_str());
+ return;
+ }
+
+ // Load the XML file
+ TiXmlDocument slingboxXML;
+ if (!slingboxXML.LoadFile(slingboxXMLFile))
+ {
+ CLog::Log(LOGERROR, "%s - Error loading %s - line %d\n%s", __FUNCTION__,
+ slingboxXMLFile.c_str(), slingboxXML.ErrorRow(), slingboxXML.ErrorDesc());
+ return;
+ }
+
+ // Check to make sure layout is correct
+ TiXmlElement * pRootElement = slingboxXML.RootElement();
+ if (!pRootElement || strcmpi(pRootElement->Value(), "slingboxsettings") != 0)
+ {
+ CLog::Log(LOGERROR, "%s - Error loading %s - no <slingboxsettings> node found",
+ __FUNCTION__, slingboxXMLFile.c_str());
+ return;
+ }
+
+ // Success so far
+ CLog::Log(LOGNOTICE, "Loaded SlingboxSettings.xml from %s", slingboxXMLFile.c_str());
+
+ // Search for the first settings that specify no hostname or match our hostname
+ TiXmlElement *pElement;
+ for (pElement = pRootElement->FirstChildElement("slingbox"); pElement;
+ pElement = pElement->NextSiblingElement("slingbox"))
+ {
+ if (pElement->Attribute("hostname") == NULL ||
+ !m_sSlingboxSettings.strHostname.CompareNoCase(pElement->Attribute("hostname")))
+ {
+ // Load setting values
+ XMLUtils::GetInt(pElement, "width", m_sSlingboxSettings.iVideoWidth, 0, 640);
+ XMLUtils::GetInt(pElement, "height", m_sSlingboxSettings.iVideoHeight, 0, 480);
+ XMLUtils::GetInt(pElement, "videobitrate", m_sSlingboxSettings.iVideoBitrate, 50, 8000);
+ XMLUtils::GetInt(pElement, "framerate", m_sSlingboxSettings.iVideoFramerate, 1, 30);
+ XMLUtils::GetInt(pElement, "smoothing", m_sSlingboxSettings.iVideoSmoothing, 0, 100);
+ XMLUtils::GetInt(pElement, "audiobitrate", m_sSlingboxSettings.iAudioBitrate, 16, 96);
+ XMLUtils::GetInt(pElement, "iframeinterval", m_sSlingboxSettings.iIFrameInterval, 1, 30);
+
+ // Load any button code values
+ TiXmlElement * pCodes = pElement->FirstChildElement("buttons");
+ if (pCodes)
+ {
+ XMLUtils::GetHex(pCodes, "channelup", m_sSlingboxSettings.uiCodeChannelUp);
+ XMLUtils::GetHex(pCodes, "channeldown", m_sSlingboxSettings.uiCodeChannelDown);
+ XMLUtils::GetHex(pCodes, "zero", m_sSlingboxSettings.uiCodeNumber[0]);
+ XMLUtils::GetHex(pCodes, "one", m_sSlingboxSettings.uiCodeNumber[1]);
+ XMLUtils::GetHex(pCodes, "two", m_sSlingboxSettings.uiCodeNumber[2]);
+ XMLUtils::GetHex(pCodes, "three", m_sSlingboxSettings.uiCodeNumber[3]);
+ XMLUtils::GetHex(pCodes, "four", m_sSlingboxSettings.uiCodeNumber[4]);
+ XMLUtils::GetHex(pCodes, "five", m_sSlingboxSettings.uiCodeNumber[5]);
+ XMLUtils::GetHex(pCodes, "six", m_sSlingboxSettings.uiCodeNumber[6]);
+ XMLUtils::GetHex(pCodes, "seven", m_sSlingboxSettings.uiCodeNumber[7]);
+ XMLUtils::GetHex(pCodes, "eight", m_sSlingboxSettings.uiCodeNumber[8]);
+ XMLUtils::GetHex(pCodes, "nine", m_sSlingboxSettings.uiCodeNumber[9]);
+ }
+
+ break;
+ }
+ }
+
+ // Prepare our resolution enum mapping array
+ const struct
+ {
+ unsigned int uiWidth;
+ unsigned int uiHeight;
+ CSlingbox::Resolution eEnum;
+ } m_resolutionMap[11] = {
+ {0, 0, CSlingbox::NOVIDEO},
+ {128, 96, CSlingbox::RESOLUTION128X96},
+ {160, 120, CSlingbox::RESOLUTION160X120},
+ {176, 120, CSlingbox::RESOLUTION176X120},
+ {224, 176, CSlingbox::RESOLUTION224X176},
+ {256, 192, CSlingbox::RESOLUTION256X192},
+ {320, 240, CSlingbox::RESOLUTION320X240},
+ {352, 240, CSlingbox::RESOLUTION352X240},
+ {320, 480, CSlingbox::RESOLUTION320X480},
+ {640, 240, CSlingbox::RESOLUTION640X240},
+ {640, 480, CSlingbox::RESOLUTION640X480}
+ };
+
+ // See if the specified resolution matches something in our mapping array and
+ // setup things accordingly
+ for (unsigned int i = 0; i < 11; i++)
+ {
+ if (m_sSlingboxSettings.iVideoWidth == m_resolutionMap[i].uiWidth &&
+ m_sSlingboxSettings.iVideoHeight == m_resolutionMap[i].uiHeight)
+ {
+ m_sSlingboxSettings.iVideoResolution = (int)m_resolutionMap[i].eEnum;
+ return;
+ }
+ }
+
+ // If it didn't match anything setup safe defaults
+ CLog::Log(LOGERROR, "%s - Defaulting to 320x240 resolution due to invalid "
+ "resolution specified in SlingboxSettings.xml for Slingbox: %s",
+ __FUNCTION__, m_sSlingboxSettings.strHostname.c_str());
+ m_sSlingboxSettings.iVideoWidth = 320;
+ m_sSlingboxSettings.iVideoHeight = 240;
+ m_sSlingboxSettings.iVideoResolution = (int)CSlingbox::RESOLUTION320X240;
+} \ No newline at end of file
diff --git a/xbmc/filesystem/Slingbox.h b/xbmc/filesystem/Slingbox.h
new file mode 100644
index 0000000000..22ad11f466
--- /dev/null
+++ b/xbmc/filesystem/Slingbox.h
@@ -0,0 +1,91 @@
+#pragma once
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "IDirectory.h"
+#include "IFile.h"
+#include "ILiveTV.h"
+
+class CSlingbox;
+
+namespace XFILE
+{
+
+class CSlingboxDirectory
+ : public IDirectory
+{
+public:
+ CSlingboxDirectory();
+ virtual ~CSlingboxDirectory();
+
+ virtual bool IsAllowed(const CStdString &strFile) const { return true; }
+ virtual bool GetDirectory(const CStdString& strPath, CFileItemList &items);
+};
+
+class CSlingboxFile
+ : public IFile, ILiveTVInterface
+{
+public:
+ CSlingboxFile();
+ virtual ~CSlingboxFile();
+ virtual bool Open(const CURL& url);
+ virtual unsigned int Read(void * buffer, int64_t size);
+ virtual void Close();
+ virtual bool SkipNext();
+
+ virtual int GetStartTime() { return 0; }
+ virtual int GetTotalTime() { return 0; }
+ virtual int64_t GetLength() { return -1; }
+ virtual int64_t GetPosition() { return -1; }
+ virtual int64_t Seek(int64_t pos, int whence) { return -1; }
+ virtual bool UpdateItem(CFileItem& item) { return false; }
+
+ virtual bool Exists(const CURL& url) { return false; }
+ virtual int Stat(const CURL& url, struct __stat64* buffer) { return -1; }
+
+ virtual ILiveTVInterface * GetLiveTV() { return (ILiveTVInterface *)this; }
+
+ virtual bool NextChannel();
+ virtual bool PrevChannel();
+ virtual bool SelectChannel(unsigned int uiChannel);
+
+protected:
+ struct
+ {
+ CStdString strHostname;
+ int iVideoWidth;
+ int iVideoHeight;
+ int iVideoResolution;
+ int iVideoBitrate;
+ int iVideoFramerate;
+ int iVideoSmoothing;
+ int iAudioBitrate;
+ int iIFrameInterval;
+ unsigned int uiCodeChannelUp;
+ unsigned int uiCodeChannelDown;
+ unsigned int uiCodeNumber[10];
+ } m_sSlingboxSettings;
+
+ void LoadSettings(const CStdString& strSlingbox);
+ CSlingbox * m_pSlingbox;
+};
+
+}
diff --git a/xbmc/guilib/GUIDialog.cpp b/xbmc/guilib/GUIDialog.cpp
index 7c332e80fe..ba8467f436 100644
--- a/xbmc/guilib/GUIDialog.cpp
+++ b/xbmc/guilib/GUIDialog.cpp
@@ -72,7 +72,7 @@ bool CGUIDialog::OnAction(const CAction &action)
if (!action.IsMouse() && m_autoClosing)
SetAutoClose(m_showDuration);
- if (action.GetID() == ACTION_CLOSE_DIALOG || action.GetID() == ACTION_PREVIOUS_MENU)
+ if (action.GetID() == ACTION_CLOSE_DIALOG || action.GetID() == ACTION_PREVIOUS_MENU || action.GetID() == ACTION_PARENT_DIR)
{
Close();
return true;
diff --git a/xbmc/guilib/GUIInfoTypes.cpp b/xbmc/guilib/GUIInfoTypes.cpp
index 6642db0037..2a4f07f887 100644
--- a/xbmc/guilib/GUIInfoTypes.cpp
+++ b/xbmc/guilib/GUIInfoTypes.cpp
@@ -139,11 +139,7 @@ CStdString CGUIInfoLabel::GetLabel(int contextWindow, bool preferImage) const
if (infoLabel.IsEmpty())
infoLabel = g_infoManager.GetLabel(portion.m_info, contextWindow);
if (!infoLabel.IsEmpty())
- {
- label += portion.m_prefix;
- label += infoLabel;
- label += portion.m_postfix;
- }
+ label += portion.GetLabel(infoLabel);
}
else
{ // no info, so just append the prefix
@@ -170,11 +166,7 @@ CStdString CGUIInfoLabel::GetItemLabel(const CGUIListItem *item, bool preferImag
else
infoLabel = g_infoManager.GetItemLabel((const CFileItem *)item, portion.m_info);
if (!infoLabel.IsEmpty())
- {
- label += portion.m_prefix;
- label += infoLabel;
- label += portion.m_postfix;
- }
+ label += portion.GetLabel(infoLabel);
}
else
{ // no info, so just append the prefix
@@ -261,6 +253,13 @@ void CGUIInfoLabel::Parse(const CStdString &label)
work = ReplaceAddonStrings(work);
// Step 3: Find all $INFO[info,prefix,postfix] blocks
int pos1 = work.Find("$INFO[");
+ int pos2 = work.Find("$ESCINFO[");
+ bool escaped = false;
+ if (pos2 >= 0 && (pos1 < 0 || pos2 < pos1))
+ {
+ escaped = true;
+ pos1 = pos2;
+ }
while (pos1 >= 0)
{
// output the first block (contents before first $INFO)
@@ -268,11 +267,12 @@ void CGUIInfoLabel::Parse(const CStdString &label)
m_info.push_back(CInfoPortion(0, work.Left(pos1), ""));
// ok, now decipher the $INFO block
- int pos2 = StringUtils::FindEndBracket(work, '[', ']', pos1 + 6);
+ int len = escaped ? 9 : 6;
+ pos2 = StringUtils::FindEndBracket(work, '[', ']', pos1 + len);
if (pos2 > pos1)
{
// decipher the block
- CStdString block = work.Mid(pos1 + 6, pos2 - pos1 - 6);
+ CStdString block = work.Mid(pos1 + len, pos2 - pos1 - len);
CStdStringArray params;
StringUtils::SplitString(block, ",", params);
int info = g_infoManager.TranslateString(params[0]);
@@ -281,7 +281,7 @@ void CGUIInfoLabel::Parse(const CStdString &label)
prefix = params[1];
if (params.size() > 2)
postfix = params[2];
- m_info.push_back(CInfoPortion(info, prefix, postfix));
+ m_info.push_back(CInfoPortion(info, prefix, postfix, escaped));
// and delete it from our work string
work = work.Mid(pos2 + 1);
}
@@ -291,17 +291,25 @@ void CGUIInfoLabel::Parse(const CStdString &label)
return;
}
pos1 = work.Find("$INFO[");
+ pos2 = work.Find("$ESCINFO[");
+ escaped = false;
+ if (pos2 >= 0 && (pos1 < 0 || pos2 < pos1))
+ {
+ escaped = true;
+ pos1 = pos2;
+ }
}
// add any last block
if (!work.IsEmpty())
m_info.push_back(CInfoPortion(0, work, ""));
}
-CGUIInfoLabel::CInfoPortion::CInfoPortion(int info, const CStdString &prefix, const CStdString &postfix)
+CGUIInfoLabel::CInfoPortion::CInfoPortion(int info, const CStdString &prefix, const CStdString &postfix, bool escaped)
{
m_info = info;
m_prefix = prefix;
m_postfix = postfix;
+ m_escaped = escaped;
// filter our prefix and postfix for comma's
m_prefix.Replace("$COMMA", ",");
m_postfix.Replace("$COMMA", ",");
@@ -309,6 +317,17 @@ CGUIInfoLabel::CInfoPortion::CInfoPortion(int info, const CStdString &prefix, co
m_postfix.Replace("$LBRACKET", "["); m_postfix.Replace("$RBRACKET", "]");
}
+CStdString CGUIInfoLabel::CInfoPortion::GetLabel(const CStdString &info) const
+{
+ CStdString label = m_prefix + info + m_postfix;
+ if (m_escaped) // escape all quotes, then quote
+ {
+ label.Replace("\"", "\\\"");
+ return "\"" + label + "\"";
+ }
+ return label;
+}
+
CStdString CGUIInfoLabel::GetLabel(const CStdString &label, int contextWindow, bool preferImage)
{ // translate the label
CGUIInfoLabel info(label, "");
diff --git a/xbmc/guilib/GUIInfoTypes.h b/xbmc/guilib/GUIInfoTypes.h
index a2eae659c5..ec36c1159c 100644
--- a/xbmc/guilib/GUIInfoTypes.h
+++ b/xbmc/guilib/GUIInfoTypes.h
@@ -102,10 +102,13 @@ private:
class CInfoPortion
{
public:
- CInfoPortion(int info, const CStdString &prefix, const CStdString &postfix);
+ CInfoPortion(int info, const CStdString &prefix, const CStdString &postfix, bool escaped = false);
+ CStdString GetLabel(const CStdString &info) const;
int m_info;
CStdString m_prefix;
CStdString m_postfix;
+ private:
+ bool m_escaped;
};
CStdString m_fallback;
diff --git a/xbmc/guilib/Key.cpp b/xbmc/guilib/Key.cpp
index dd940586da..a20eb37c13 100644
--- a/xbmc/guilib/Key.cpp
+++ b/xbmc/guilib/Key.cpp
@@ -193,7 +193,7 @@ CAction::CAction(int actionID, float amount1 /* = 1.0f */, float amount2 /* = 0.
m_holdTime = 0;
}
-CAction::CAction(int actionID, unsigned int state, float posX, float posY, float offsetX, float offsetY)
+CAction::CAction(int actionID, unsigned int state, float posX, float posY, float offsetX, float offsetY, const CStdString &name)
{
m_id = actionID;
m_amount[0] = posX;
@@ -202,6 +202,7 @@ CAction::CAction(int actionID, unsigned int state, float posX, float posY, float
m_amount[3] = offsetY;
for (unsigned int i = 4; i < max_amounts; i++)
m_amount[i] = 0;
+ m_name = name;
m_repeat = 0;
m_buttonCode = 0;
m_unicode = 0;
diff --git a/xbmc/guilib/Key.h b/xbmc/guilib/Key.h
index a160cf5fbb..95eb3d6057 100644
--- a/xbmc/guilib/Key.h
+++ b/xbmc/guilib/Key.h
@@ -76,6 +76,9 @@
#define KEY_ASCII 0xF100 // a printable character in the range of TRUE ASCII (from 0 to 127) // FIXME make it clean and pure unicode! remove the need for KEY_ASCII
#define KEY_UNICODE 0xF200 // another printable character whose range is not included in this KEY code
+// 0xE000 -> 0xE0FF is reserved for mouse actions
+#define KEY_MOUSE 0xE000
+
// 0xD000 -> 0xD0FF is reserved for WM_APPCOMMAND messages
#define KEY_APPCOMMAND 0xD000
@@ -292,6 +295,11 @@
#define ACTION_PLAYER_PLAYPAUSE 227 // Play/pause. If playing it pauses, if paused it plays.
+// The NOOP action can be specified to disable an input event. This is
+// useful in user keyboard.xml etc to disable actions specified in the
+// system mappings.
+#define ACTION_NOOP 999
+
// Window ID defines to make the code a bit more readable
#define WINDOW_INVALID 9999
#define WINDOW_HOME 10000
@@ -422,7 +430,7 @@ class CAction
public:
CAction(int actionID, float amount1 = 1.0f, float amount2 = 0.0f, const CStdString &name = "");
CAction(int actionID, wchar_t unicode);
- CAction(int actionID, unsigned int state, float posX, float posY, float offsetX, float offsetY);
+ CAction(int actionID, unsigned int state, float posX, float posY, float offsetX, float offsetY, const CStdString &name = "");
CAction(int actionID, const CStdString &name, const CKey &key);
/*! \brief Identifier of the action
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index d18ca6ac3a..46b8666649 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -26,15 +26,11 @@
#include "pictures/DllImageLib.h"
#include "DDSImage.h"
#include "filesystem/SpecialProtocol.h"
-#ifdef __APPLE__
-#ifdef __arm__
+#if defined(__APPLE__) && defined(__arm__)
#include <ImageIO/ImageIO.h>
-#else
-#include <ApplicationServices/ApplicationServices.h>
-#endif//__arm__
#include "filesystem/File.h"
#include "osx/DarwinUtils.h"
-#endif//__APPLE__
+#endif
/************************************************************************/
/* */
@@ -174,7 +170,7 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
return false;
}
-#if defined(__APPLE__)
+#if defined(__APPLE__) && defined(__arm__)
XFILE::CFile file;
UInt8 *imageBuff = NULL;
int64_t imageBuffSize = 0;
diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp
index 4945fb7afa..90a0b4a6f0 100644
--- a/xbmc/input/ButtonTranslator.cpp
+++ b/xbmc/input/ButtonTranslator.cpp
@@ -45,7 +45,8 @@ typedef struct
} ActionMapping;
static const ActionMapping actions[] =
- {{"left" , ACTION_MOVE_LEFT },
+{
+ {"left" , ACTION_MOVE_LEFT },
{"right" , ACTION_MOVE_RIGHT},
{"up" , ACTION_MOVE_UP },
{"down" , ACTION_MOVE_DOWN },
@@ -194,7 +195,21 @@ static const ActionMapping actions[] =
{"yellow" , ACTION_TELETEXT_YELLOW},
{"blue" , ACTION_TELETEXT_BLUE},
{"increasepar" , ACTION_INCREASE_PAR},
- {"decreasepar" , ACTION_DECREASE_PAR}};
+ {"decreasepar" , ACTION_DECREASE_PAR},
+
+ // Mouse actions
+ {"leftclick" , ACTION_MOUSE_LEFT_CLICK},
+ {"rightclick" , ACTION_MOUSE_RIGHT_CLICK},
+ {"middleclick" , ACTION_MOUSE_MIDDLE_CLICK},
+ {"doubleclick" , ACTION_MOUSE_DOUBLE_CLICK},
+ {"wheelup" , ACTION_MOUSE_WHEEL_UP},
+ {"wheeldown" , ACTION_MOUSE_WHEEL_DOWN},
+ {"mousedrag" , ACTION_MOUSE_DRAG},
+ {"mousemove" , ACTION_MOUSE_MOVE},
+
+ // Do nothing action
+ { "noop" , ACTION_NOOP}
+};
static const ActionMapping windows[] =
{{"home" , WINDOW_HOME},
@@ -291,6 +306,18 @@ static const ActionMapping windows[] =
{"startwindow" , WINDOW_START},
{"startup" , WINDOW_STARTUP_ANIM}};
+static const ActionMapping mousecommands[] =
+{
+ { "leftclick", ACTION_MOUSE_LEFT_CLICK },
+ { "rightclick", ACTION_MOUSE_RIGHT_CLICK },
+ { "middleclick", ACTION_MOUSE_MIDDLE_CLICK },
+ { "doubleclick", ACTION_MOUSE_DOUBLE_CLICK },
+ { "wheelup", ACTION_MOUSE_WHEEL_UP },
+ { "wheeldown", ACTION_MOUSE_WHEEL_DOWN },
+ { "mousedrag", ACTION_MOUSE_DRAG },
+ { "mousemove", ACTION_MOUSE_MOVE }
+};
+
#ifdef WIN32
static const ActionMapping appcommands[] =
{
@@ -826,7 +853,7 @@ void CButtonTranslator::MapWindowActions(TiXmlNode *pWindow, int windowID)
}
TiXmlNode* pDevice;
- const char* types[] = {"gamepad", "remote", "universalremote", "keyboard", "appcommand", NULL};
+ const char* types[] = {"gamepad", "remote", "universalremote", "keyboard", "mouse", "appcommand", NULL};
for (int i = 0; types[i]; ++i)
{
CStdString type(types[i]);
@@ -845,6 +872,8 @@ void CButtonTranslator::MapWindowActions(TiXmlNode *pWindow, int windowID)
buttonCode = TranslateUniversalRemoteString(pButton->Value());
else if (type == "keyboard")
buttonCode = TranslateKeyboardButton(pButton);
+ else if (type == "mouse")
+ buttonCode = TranslateMouseCommand(pButton->Value());
else if (type == "appcommand")
buttonCode = TranslateAppCommand(pButton->Value());
@@ -878,9 +907,6 @@ bool CButtonTranslator::TranslateActionString(const char *szAction, int &action)
if (CBuiltins::HasCommand(strAction))
action = ACTION_BUILT_IN_FUNCTION;
- if (strAction.Equals("noop"))
- return true;
-
for (unsigned int index=0;index < sizeof(actions)/sizeof(actions[0]);++index)
{
if (strAction.Equals(actions[index].name))
@@ -1149,6 +1175,20 @@ uint32_t CButtonTranslator::TranslateAppCommand(const char *szButton)
return 0;
}
+uint32_t CButtonTranslator::TranslateMouseCommand(const char *szButton)
+{
+ CStdString strMouseCommand = szButton;
+ strMouseCommand.ToLower();
+
+ for (unsigned int i = 0; i < sizeof(mousecommands)/sizeof(mousecommands[0]); i++)
+ if (strMouseCommand.Equals(mousecommands[i].name))
+ return mousecommands[i].action | KEY_MOUSE;
+
+ CLog::Log(LOGERROR, "%s: Can't find mouse command %s", __FUNCTION__, szButton);
+
+ return 0;
+}
+
void CButtonTranslator::Clear()
{
translatorMap.clear();
diff --git a/xbmc/input/ButtonTranslator.h b/xbmc/input/ButtonTranslator.h
index 594e63a85f..a1f0e9c608 100644
--- a/xbmc/input/ButtonTranslator.h
+++ b/xbmc/input/ButtonTranslator.h
@@ -106,6 +106,8 @@ private:
static uint32_t TranslateKeyboardString(const char *szButton);
static uint32_t TranslateKeyboardButton(TiXmlElement *pButton);
+ static uint32_t TranslateMouseCommand(const char *szButton);
+
static uint32_t TranslateAppCommand(const char *szButton);
void MapWindowActions(TiXmlNode *pWindow, int wWindowID);
diff --git a/xbmc/input/MouseStat.cpp b/xbmc/input/MouseStat.cpp
index 7cde327f99..7027e066e3 100644
--- a/xbmc/input/MouseStat.cpp
+++ b/xbmc/input/MouseStat.cpp
@@ -254,9 +254,10 @@ bool CMouseStat::MovedPastThreshold() const
return (m_mouseState.dx * m_mouseState.dx + m_mouseState.dy * m_mouseState.dy >= MOUSE_MINIMUM_MOVEMENT * MOUSE_MINIMUM_MOVEMENT);
}
-CAction CMouseStat::GetAction() const
+uint32_t CMouseStat::GetAction() const
{
int actionID = ACTION_MOUSE_MOVE;
+
if (bClick[MOUSE_LEFT_BUTTON])
actionID = ACTION_MOUSE_LEFT_CLICK;
else if (bClick[MOUSE_RIGHT_BUTTON])
@@ -272,5 +273,15 @@ CAction CMouseStat::GetAction() const
else if (m_mouseState.dz < 0)
actionID = ACTION_MOUSE_WHEEL_DOWN;
- return CAction(actionID, (unsigned int)bHold[MOUSE_LEFT_BUTTON], (float)m_mouseState.x, (float)m_mouseState.y, (float)m_mouseState.dx, (float)m_mouseState.dy);
+ return actionID;
+}
+
+int CMouseStat::GetHold(int ButtonID) const
+{
+ switch (ButtonID)
+ { case MOUSE_LEFT_BUTTON:
+ return bHold[MOUSE_LEFT_BUTTON];
+ }
+ return false;
}
+
diff --git a/xbmc/input/MouseStat.h b/xbmc/input/MouseStat.h
index 656e034cce..33f6ac5403 100644
--- a/xbmc/input/MouseStat.h
+++ b/xbmc/input/MouseStat.h
@@ -76,7 +76,13 @@ public:
void SetState(MOUSE_STATE state) { m_pointerState = state; };
void SetEnabled(bool enabled = true);
MOUSE_STATE GetState() const { return m_pointerState; };
- CAction GetAction() const;
+ uint32_t GetAction() const;
+
+ int GetHold(int ButtonID) const;
+ inline int GetX(void) const { return m_mouseState.x; }
+ inline int GetY(void) const { return m_mouseState.y; }
+ inline int GetDX(void) const { return m_mouseState.dx; }
+ inline int GetDY(void) const { return m_mouseState.dy; }
private:
/*! \brief Holds information regarding a particular mouse button state
diff --git a/xbmc/interfaces/AnnouncementManager.cpp b/xbmc/interfaces/AnnouncementManager.cpp
index a6d3d28cfb..3c3efc0f64 100644
--- a/xbmc/interfaces/AnnouncementManager.cpp
+++ b/xbmc/interfaces/AnnouncementManager.cpp
@@ -70,7 +70,7 @@ void CAnnouncementManager::Announce(EAnnouncementFlag flag, const char *sender,
void CAnnouncementManager::Announce(EAnnouncementFlag flag, const char *sender, const char *message, CFileItemPtr item)
{
CVariant data;
- Announce(flag, sender, message, data);
+ Announce(flag, sender, message, item, data);
}
void CAnnouncementManager::Announce(EAnnouncementFlag flag, const char *sender, const char *message, CFileItemPtr item, CVariant &data)
@@ -83,19 +83,24 @@ void CAnnouncementManager::Announce(EAnnouncementFlag flag, const char *sender,
if (item->HasVideoInfoTag())
{
CVideoDatabase::VideoContentTypeToString((VIDEODB_CONTENT_TYPE)item->GetVideoContentType(), type);
+
id = item->GetVideoInfoTag()->m_iDbId;
}
else if (item->HasMusicInfoTag())
{
- type = "music";
+ if (item->IsAlbum())
+ type = "album";
+ else
+ type = "song";
+
id = item->GetMusicInfoTag()->GetDatabaseId();
}
+ else
+ type = "unknown";
+ object["type"] = type;
if (id > 0)
- {
- type += "id";
- object[type] = id;
- }
+ object["id"] = id;
Announce(flag, sender, message, object);
}
diff --git a/xbmc/interfaces/json-rpc/AVPlayerOperations.cpp b/xbmc/interfaces/json-rpc/AVPlayerOperations.cpp
index 6c30a76edd..ad1868a289 100644
--- a/xbmc/interfaces/json-rpc/AVPlayerOperations.cpp
+++ b/xbmc/interfaces/json-rpc/AVPlayerOperations.cpp
@@ -26,10 +26,9 @@
#include "PlayListPlayer.h"
#include "PartyModeManager.h"
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CAVPlayerOperations::State(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::State(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -41,7 +40,7 @@ JSON_STATUS CAVPlayerOperations::State(const CStdString &method, ITransportLayer
return OK;
}
-JSON_STATUS CAVPlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -52,7 +51,7 @@ JSON_STATUS CAVPlayerOperations::PlayPause(const CStdString &method, ITransportL
return OK;
}
-JSON_STATUS CAVPlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -61,7 +60,7 @@ JSON_STATUS CAVPlayerOperations::Stop(const CStdString &method, ITransportLayer
return ACK;
}
-JSON_STATUS CAVPlayerOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -70,7 +69,7 @@ JSON_STATUS CAVPlayerOperations::SkipPrevious(const CStdString &method, ITranspo
return ACK;
}
-JSON_STATUS CAVPlayerOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -79,7 +78,7 @@ JSON_STATUS CAVPlayerOperations::SkipNext(const CStdString &method, ITransportLa
return ACK;
}
-JSON_STATUS CAVPlayerOperations::BigSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::BigSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -88,7 +87,7 @@ JSON_STATUS CAVPlayerOperations::BigSkipBackward(const CStdString &method, ITran
return ACK;
}
-JSON_STATUS CAVPlayerOperations::BigSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::BigSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -97,7 +96,7 @@ JSON_STATUS CAVPlayerOperations::BigSkipForward(const CStdString &method, ITrans
return ACK;
}
-JSON_STATUS CAVPlayerOperations::SmallSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::SmallSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -106,7 +105,7 @@ JSON_STATUS CAVPlayerOperations::SmallSkipBackward(const CStdString &method, ITr
return ACK;
}
-JSON_STATUS CAVPlayerOperations::SmallSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::SmallSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -115,7 +114,7 @@ JSON_STATUS CAVPlayerOperations::SmallSkipForward(const CStdString &method, ITra
return ACK;
}
-JSON_STATUS CAVPlayerOperations::Rewind(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::Rewind(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -124,7 +123,7 @@ JSON_STATUS CAVPlayerOperations::Rewind(const CStdString &method, ITransportLaye
return ACK;
}
-JSON_STATUS CAVPlayerOperations::Forward(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlayerOperations::Forward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -133,7 +132,7 @@ JSON_STATUS CAVPlayerOperations::Forward(const CStdString &method, ITransportLay
return ACK;
}
-JSON_STATUS CAVPlayerOperations::GetTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CAVPlayerOperations::GetTime(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -145,26 +144,26 @@ JSON_STATUS CAVPlayerOperations::GetTime(const CStdString &method, ITransportLay
return OK;
}
-JSON_STATUS CAVPlayerOperations::GetPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CAVPlayerOperations::GetPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
- Value val = g_application.GetPercentage();
+ CVariant val = g_application.GetPercentage();
result.swap(val);
return OK;
}
-JSON_STATUS CAVPlayerOperations::SeekTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CAVPlayerOperations::SeekTime(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
- g_application.SeekTime(parameterObject["value"].asInt());
+ g_application.SeekTime((int)parameterObject["value"].asInteger());
return ACK;
}
-JSON_STATUS CAVPlayerOperations::SeekPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CAVPlayerOperations::SeekPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
if (!IsCorrectPlayer(method))
return FailedToExecute;
@@ -178,7 +177,7 @@ bool CAVPlayerOperations::IsCorrectPlayer(const CStdString &method)
return (method.Left(5).Equals("audio") && g_application.IsPlayingAudio()) || (method.Left(5).Equals("video") && g_application.IsPlayingVideo());
}
-void CAVPlayerOperations::CreateTime(int time, Json::Value &result)
+void CAVPlayerOperations::CreateTime(int time, CVariant &result)
{
int ms = time % 1000;
result["milliseconds"] = ms;
diff --git a/xbmc/interfaces/json-rpc/AVPlayerOperations.h b/xbmc/interfaces/json-rpc/AVPlayerOperations.h
index c771f1f717..44ae5ade72 100644
--- a/xbmc/interfaces/json-rpc/AVPlayerOperations.h
+++ b/xbmc/interfaces/json-rpc/AVPlayerOperations.h
@@ -28,26 +28,26 @@ namespace JSONRPC
class CAVPlayerOperations
{
public:
- static JSON_STATUS State(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS State(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS BigSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS BigSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SmallSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SmallSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS BigSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS BigSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SmallSkipBackward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SmallSkipForward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Rewind(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Forward(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Rewind(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Forward(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SeekTime(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SeekPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetTime(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SeekTime(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SeekPercentage(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
private:
static inline bool IsCorrectPlayer(const CStdString &method);
- static void CreateTime(int time, Json::Value &result);
+ static void CreateTime(int time, CVariant &result);
};
}
diff --git a/xbmc/interfaces/json-rpc/AVPlaylistOperations.cpp b/xbmc/interfaces/json-rpc/AVPlaylistOperations.cpp
index 7712cc4059..df770d9998 100644
--- a/xbmc/interfaces/json-rpc/AVPlaylistOperations.cpp
+++ b/xbmc/interfaces/json-rpc/AVPlaylistOperations.cpp
@@ -27,20 +27,19 @@
#include "GUIUserMessages.h"
#include "Application.h"
-using namespace Json;
using namespace JSONRPC;
using namespace PLAYLIST;
using namespace std;
-JSON_STATUS CAVPlaylistOperations::Play(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::Play(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
bool status = true;
int playlist = GetPlaylist(method);
if (g_playlistPlayer.GetCurrentPlaylist() != playlist)
g_playlistPlayer.SetCurrentPlaylist(playlist);
- int item = parameterObject["item"].asInt();
- int songId = parameterObject["songid"].asInt();
+ int item = (int)parameterObject["item"].asInteger();
+ int songId = (int)parameterObject["songid"].asInteger();
if (item >= 0)
g_application.getApplicationMessenger().PlayListPlayerPlay(item);
@@ -54,7 +53,7 @@ JSON_STATUS CAVPlaylistOperations::Play(const CStdString &method, ITransportLaye
return OK;
}
-JSON_STATUS CAVPlaylistOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (g_playlistPlayer.GetCurrentPlaylist() != GetPlaylist(method))
return FailedToExecute;
@@ -65,7 +64,7 @@ JSON_STATUS CAVPlaylistOperations::SkipPrevious(const CStdString &method, ITrans
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (g_playlistPlayer.GetCurrentPlaylist() != GetPlaylist(method))
return FailedToExecute;
@@ -76,7 +75,7 @@ JSON_STATUS CAVPlaylistOperations::SkipNext(const CStdString &method, ITransport
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CFileItemList list;
int playlist = GetPlaylist(method);
@@ -94,11 +93,11 @@ JSON_STATUS CAVPlaylistOperations::GetItems(const CStdString &method, ITransport
return OK;
}
-JSON_STATUS CAVPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
int playlist = GetPlaylist(method);
CFileItemList list;
- Value params = parameterObject;
+ CVariant params = parameterObject;
if (playlist == PLAYLIST_VIDEO)
params["item"]["media"] = "video";
else if (playlist == PLAYLIST_MUSIC)
@@ -113,11 +112,11 @@ JSON_STATUS CAVPlaylistOperations::Add(const CStdString &method, ITransportLayer
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::Insert(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::Insert(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
int playlist = GetPlaylist(method);
CFileItemList list;
- Value params = parameterObject;
+ CVariant params = parameterObject;
if (playlist == PLAYLIST_VIDEO)
params["item"]["media"] = "video";
else if (playlist == PLAYLIST_MUSIC)
@@ -126,21 +125,21 @@ JSON_STATUS CAVPlaylistOperations::Insert(const CStdString &method, ITransportLa
if (!FillFileItemList(params["item"], list))
return InvalidParams;
- g_application.getApplicationMessenger().PlayListPlayerInsert(GetPlaylist(method), list, parameterObject["index"].asInt());
+ g_application.getApplicationMessenger().PlayListPlayerInsert(GetPlaylist(method), list, (int)parameterObject["index"].asInteger());
NotifyAll();
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- g_application.getApplicationMessenger().PlayListPlayerRemove(GetPlaylist(method), parameterObject["item"].asInt());
+ g_application.getApplicationMessenger().PlayListPlayerRemove(GetPlaylist(method), (int)parameterObject["item"].asInteger());
NotifyAll();
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().PlayListPlayerClear(GetPlaylist(method));
@@ -148,7 +147,7 @@ JSON_STATUS CAVPlaylistOperations::Clear(const CStdString &method, ITransportLay
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().PlayListPlayerShuffle(GetPlaylist(method), true);
@@ -156,7 +155,7 @@ JSON_STATUS CAVPlaylistOperations::Shuffle(const CStdString &method, ITransportL
return ACK;
}
-JSON_STATUS CAVPlaylistOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAVPlaylistOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().PlayListPlayerShuffle(GetPlaylist(method), false);
diff --git a/xbmc/interfaces/json-rpc/AVPlaylistOperations.h b/xbmc/interfaces/json-rpc/AVPlaylistOperations.h
index 625c08962b..44ebf00964 100644
--- a/xbmc/interfaces/json-rpc/AVPlaylistOperations.h
+++ b/xbmc/interfaces/json-rpc/AVPlaylistOperations.h
@@ -30,17 +30,17 @@ namespace JSONRPC
class CAVPlaylistOperations : public CFileItemHandler
{
public:
- static JSON_STATUS Play(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Play(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Add(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Insert(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Insert(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
private:
static inline int GetPlaylist(const CStdString &method);
static inline void NotifyAll();
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
index 4c48b3a998..3e45740098 100644
--- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp
+++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
@@ -26,26 +26,27 @@
#include "utils/URIUtils.h"
#include "music/tags/MusicInfoTag.h"
#include "music/Song.h"
+#include "music/Artist.h"
#include "Application.h"
#include "filesystem/Directory.h"
+#include "filesystem/File.h"
using namespace MUSIC_INFO;
-using namespace Json;
using namespace JSONRPC;
using namespace XFILE;
-JSON_STATUS CAudioLibrary::GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return InternalError;
- int genreID = parameterObject["genreid"].asInt();
+ int genreID = (int)parameterObject["genreid"].asInteger();
// Add "artist" to "fields" array by default
- Value param = parameterObject;
+ CVariant param = parameterObject;
if (!param.isMember("fields"))
- param["fields"] = Value(arrayValue);
+ param["fields"] = CVariant(CVariant::VariantTypeArray);
param["fields"].append("artist");
CFileItemList items;
@@ -56,16 +57,43 @@ JSON_STATUS CAudioLibrary::GetArtists(const CStdString &method, ITransportLayer
return OK;
}
-JSON_STATUS CAudioLibrary::GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::GetArtistDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
+{
+ int artistID = (int)parameterObject["artistid"].asInteger();
+
+ CMusicDatabase musicdatabase;
+ if (!musicdatabase.Open())
+ return InternalError;
+
+ CArtist artist;
+ if (!musicdatabase.GetArtistInfo(artistID, artist))
+ {
+ musicdatabase.Close();
+ return InvalidParams;
+ }
+
+ CFileItemPtr m_artistItem(new CFileItem(artist));
+ m_artistItem->GetMusicInfoTag()->SetArtist(m_artistItem->GetLabel());
+ m_artistItem->GetMusicInfoTag()->SetDatabaseId(artistID);
+ CMusicDatabase::SetPropertiesFromArtist(*m_artistItem, artist);
+ if (CFile::Exists(m_artistItem->GetCachedArtistThumb()))
+ m_artistItem->SetThumbnailImage(m_artistItem->GetCachedArtistThumb());
+ HandleFileItem("artistid", false, "artistdetails", m_artistItem, parameterObject, parameterObject["fields"], result, false);
+
+ musicdatabase.Close();
+ return OK;
+}
+
+JSON_STATUS CAudioLibrary::GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return InternalError;
- int artistID = parameterObject["artistid"].asInt();
- int genreID = parameterObject["genreid"].asInt();
- int start = parameterObject["limits"]["start"].asInt();
- int end = parameterObject["limits"]["end"].asInt();
+ int artistID = (int)parameterObject["artistid"].asInteger();
+ int genreID = (int)parameterObject["genreid"].asInteger();
+ int start = (int)parameterObject["limits"]["start"].asInteger();
+ int end = (int)parameterObject["limits"]["end"].asInteger();
if (end == 0)
end = -1;
@@ -77,9 +105,9 @@ JSON_STATUS CAudioLibrary::GetAlbums(const CStdString &method, ITransportLayer *
return OK;
}
-JSON_STATUS CAudioLibrary::GetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::GetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int albumID = parameterObject["albumid"].asInt();
+ int albumID = (int)parameterObject["albumid"].asInteger();
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
@@ -105,15 +133,15 @@ JSON_STATUS CAudioLibrary::GetAlbumDetails(const CStdString &method, ITransportL
return OK;
}
-JSON_STATUS CAudioLibrary::GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return InternalError;
- int artistID = parameterObject["artistid"].asInt();
- int albumID = parameterObject["albumid"].asInt();
- int genreID = parameterObject["genreid"].asInt();
+ int artistID = (int)parameterObject["artistid"].asInteger();
+ int albumID = (int)parameterObject["albumid"].asInteger();
+ int genreID = (int)parameterObject["genreid"].asInteger();
CFileItemList items;
if (musicdatabase.GetSongsNav("", items, genreID, artistID, albumID))
@@ -123,9 +151,9 @@ JSON_STATUS CAudioLibrary::GetSongs(const CStdString &method, ITransportLayer *t
return OK;
}
-JSON_STATUS CAudioLibrary::GetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::GetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int idSong = parameterObject["songid"].asInt();
+ int idSong = (int)parameterObject["songid"].asInteger();
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
@@ -144,16 +172,16 @@ JSON_STATUS CAudioLibrary::GetSongDetails(const CStdString &method, ITransportLa
return OK;
}
-JSON_STATUS CAudioLibrary::GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return InternalError;
// Add "genre" to "fields" array by default
- Value param = parameterObject;
+ CVariant param = parameterObject;
if (!param.isMember("fields"))
- param["fields"] = Value(arrayValue);
+ param["fields"] = CVariant(CVariant::VariantTypeArray);
param["fields"].append("genre");
CFileItemList items;
@@ -164,7 +192,7 @@ JSON_STATUS CAudioLibrary::GetGenres(const CStdString &method, ITransportLayer *
return OK;
}
-JSON_STATUS CAudioLibrary::ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CAudioLibrary::ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().ExecBuiltIn("updatelibrary(music)");
return ACK;
@@ -189,7 +217,7 @@ bool CAudioLibrary::FillFileItem(const CStdString &strFilename, CFileItem &item)
return status;
}
-bool CAudioLibrary::FillFileItemList(const Value &parameterObject, CFileItemList &list)
+bool CAudioLibrary::FillFileItemList(const CVariant &parameterObject, CFileItemList &list)
{
CMusicDatabase musicdatabase;
bool success = false;
@@ -197,9 +225,9 @@ bool CAudioLibrary::FillFileItemList(const Value &parameterObject, CFileItemList
if (musicdatabase.Open())
{
CStdString file = parameterObject["file"].asString();
- int artistID = parameterObject["artistid"].asInt();
- int albumID = parameterObject["albumid"].asInt();
- int genreID = parameterObject["genreid"].asInt();
+ int artistID = (int)parameterObject["artistid"].asInteger();
+ int albumID = (int)parameterObject["albumid"].asInteger();
+ int genreID = (int)parameterObject["genreid"].asInteger();
CFileItem fileItem;
if (FillFileItem(file, fileItem))
@@ -211,7 +239,7 @@ bool CAudioLibrary::FillFileItemList(const Value &parameterObject, CFileItemList
if (artistID != -1 || albumID != -1 || genreID != -1)
success |= musicdatabase.GetSongsNav("", list, genreID, artistID, albumID);
- int songID = parameterObject.get("songid", -1).asInt();
+ int songID = (int)parameterObject["songid"].asInteger(-1);
if (songID != -1)
{
CSong song;
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.h b/xbmc/interfaces/json-rpc/AudioLibrary.h
index 6092fc4d0f..977aec9ac7 100644
--- a/xbmc/interfaces/json-rpc/AudioLibrary.h
+++ b/xbmc/interfaces/json-rpc/AudioLibrary.h
@@ -29,15 +29,16 @@ namespace JSONRPC
class CAudioLibrary : public CFileItemHandler
{
public:
- static JSON_STATUS GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetArtists(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetArtistDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetAlbums(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetAlbumDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetSongs(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetSongDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static bool FillFileItem(const CStdString &strFilename, CFileItem &item);
- static bool FillFileItemList(const Json::Value &parameterObject, CFileItemList &list);
+ static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
};
}
diff --git a/xbmc/interfaces/json-rpc/FileItemHandler.cpp b/xbmc/interfaces/json-rpc/FileItemHandler.cpp
index 4364171ed9..51a0dce9de 100644
--- a/xbmc/interfaces/json-rpc/FileItemHandler.cpp
+++ b/xbmc/interfaces/json-rpc/FileItemHandler.cpp
@@ -35,20 +35,16 @@
#include "filesystem/File.h"
using namespace MUSIC_INFO;
-using namespace Json;
using namespace JSONRPC;
using namespace XFILE;
-void CFileItemHandler::FillDetails(ISerializable* info, CFileItemPtr item, const Value& fields, Value &result)
+void CFileItemHandler::FillDetails(ISerializable* info, CFileItemPtr item, const CVariant& fields, CVariant &result)
{
if (info == NULL || fields.size() == 0)
return;
- CVariant data;
- info->Serialize(data);
-
- Value serialization;
- data.toJsonValue(serialization);
+ CVariant serialization;
+ info->Serialize(serialization);
for (unsigned int i = 0; i < fields.size(); i++)
{
@@ -91,11 +87,11 @@ void CFileItemHandler::FillDetails(ISerializable* info, CFileItemPtr item, const
}
}
-void CFileItemHandler::HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const Value &parameterObject, Value &result)
+void CFileItemHandler::HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const CVariant &parameterObject, CVariant &result)
{
int size = items.Size();
- int start = parameterObject["limits"]["start"].asInt();
- int end = parameterObject["limits"]["end"].asInt();
+ int start = (int)parameterObject["limits"]["start"].asInteger();
+ int end = (int)parameterObject["limits"]["end"].asInteger();
end = (end <= 0 || end > size) ? size : end;
start = start > end ? end : start;
@@ -107,15 +103,15 @@ void CFileItemHandler::HandleFileItemList(const char *ID, bool allowFile, const
for (int i = start; i < end; i++)
{
- Value object;
+ CVariant object;
CFileItemPtr item = items.Get(i);
HandleFileItem(ID, allowFile, resultname, item, parameterObject, parameterObject["fields"], result);
}
}
-void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const Json::Value &parameterObject, const Json::Value &validFields, Json::Value &result, bool append /* = true */)
+void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const CVariant &parameterObject, const CVariant &validFields, CVariant &result, bool append /* = true */)
{
- Value object;
+ CVariant object;
bool hasFileField = false;
bool hasThumbnailField = false;
@@ -195,7 +191,7 @@ void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char
}
}
-bool CFileItemHandler::FillFileItemList(const Value &parameterObject, CFileItemList &list)
+bool CFileItemHandler::FillFileItemList(const CVariant &parameterObject, CFileItemList &list)
{
CPlaylistOperations::FillFileItemList(parameterObject, list);
CAudioLibrary::FillFileItemList(parameterObject, list);
@@ -300,7 +296,7 @@ bool CFileItemHandler::ParseSortMethods(const CStdString &method, const bool &ig
return true;
}
-void CFileItemHandler::Sort(CFileItemList &items, const Value &parameterObject)
+void CFileItemHandler::Sort(CFileItemList &items, const CVariant &parameterObject)
{
CStdString method = parameterObject["method"].asString();
CStdString order = parameterObject["order"].asString();
@@ -311,6 +307,6 @@ void CFileItemHandler::Sort(CFileItemList &items, const Value &parameterObject)
SORT_METHOD sortmethod = SORT_METHOD_NONE;
SORT_ORDER sortorder = SORT_ORDER_ASC;
- if (ParseSortMethods(method, parameterObject["ignorearticle"].asBool(), order, sortmethod, sortorder))
+ if (ParseSortMethods(method, parameterObject["ignorearticle"].asBoolean(), order, sortmethod, sortorder))
items.Sort(sortmethod, sortorder);
}
diff --git a/xbmc/interfaces/json-rpc/FileItemHandler.h b/xbmc/interfaces/json-rpc/FileItemHandler.h
index c39c2b316f..2f0eb9e436 100644
--- a/xbmc/interfaces/json-rpc/FileItemHandler.h
+++ b/xbmc/interfaces/json-rpc/FileItemHandler.h
@@ -30,13 +30,13 @@ namespace JSONRPC
class CFileItemHandler : public CJSONUtils
{
protected:
- static void FillDetails(ISerializable* info, CFileItemPtr item, const Json::Value& fields, Json::Value &result);
- static void HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const Json::Value &parameterObject, Json::Value &result);
- static void HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const Json::Value &parameterObject, const Json::Value &validFields, Json::Value &result, bool append = true);
+ static void FillDetails(ISerializable* info, CFileItemPtr item, const CVariant& fields, CVariant &result);
+ static void HandleFileItemList(const char *ID, bool allowFile, const char *resultname, CFileItemList &items, const CVariant &parameterObject, CVariant &result);
+ static void HandleFileItem(const char *ID, bool allowFile, const char *resultname, CFileItemPtr item, const CVariant &parameterObject, const CVariant &validFields, CVariant &result, bool append = true);
- static bool FillFileItemList(const Json::Value &parameterObject, CFileItemList &list);
+ static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
private:
static bool ParseSortMethods(const CStdString &method, const bool &ignorethe, const CStdString &order, SORT_METHOD &sortmethod, SORT_ORDER &sortorder);
- static void Sort(CFileItemList &items, const Json::Value& parameterObject);
+ static void Sort(CFileItemList &items, const CVariant& parameterObject);
};
}
diff --git a/xbmc/interfaces/json-rpc/FileOperations.cpp b/xbmc/interfaces/json-rpc/FileOperations.cpp
index 86c040a49e..67c61b50ba 100644
--- a/xbmc/interfaces/json-rpc/FileOperations.cpp
+++ b/xbmc/interfaces/json-rpc/FileOperations.cpp
@@ -32,10 +32,9 @@
#include "URL.h"
using namespace XFILE;
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CStdString media = parameterObject["media"].asString();
media = media.ToLower();
@@ -56,8 +55,8 @@ JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITranspo
}
}
- Value param = parameterObject["fields"];
- param["fields"] = Value(arrayValue);
+ CVariant param = parameterObject["fields"];
+ param["fields"] = CVariant(CVariant::VariantTypeArray);
param["fields"].append("file");
HandleFileItemList(NULL, true, "shares", items, param, result);
@@ -66,7 +65,7 @@ JSON_STATUS CFileOperations::GetRootDirectory(const CStdString &method, ITranspo
return OK;
}
-JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CStdString media = parameterObject["media"].asString();
media = media.ToLower();
@@ -120,14 +119,14 @@ JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLa
// Check if the "fields" list exists
// and make sure it contains the "file"
// field
- Value param = parameterObject;
+ CVariant param = parameterObject;
if (!param.isMember("fields"))
- param["fields"] = Value(arrayValue);
+ param["fields"] = CVariant(CVariant::VariantTypeArray);
bool hasFileField = false;
- for (unsigned int i = 0; i < param["fields"].size(); i++)
+ for (CVariant::const_iterator_array itr = param["fields"].begin_array(); itr != param["fields"].end_array(); itr++)
{
- if (param["fields"][i].asString().compare("file") == 0)
+ if (*itr == CVariant("file"))
{
hasFileField = true;
break;
@@ -142,14 +141,14 @@ JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLa
{
result["files"][index]["filetype"] = "directory";
}
- int count = result["limits"]["total"].asInt();
+ int count = (int)result["limits"]["total"].asInteger();
HandleFileItemList("id", true, "files", filteredFiles, param, result);
for (unsigned int index = count; index < result["files"].size(); index++)
{
result["files"][index]["filetype"] = "file";
}
- count += result["limits"]["total"].asInt();
+ count += (int)result["limits"]["total"].asInteger();
result["limits"]["end"] = count;
result["limits"]["total"] = count;
@@ -160,9 +159,9 @@ JSON_STATUS CFileOperations::GetDirectory(const CStdString &method, ITransportLa
return InvalidParams;
}
-JSON_STATUS CFileOperations::Download(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CFileOperations::Download(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- return transport->Download(parameterObject["path"].asString().c_str(), &result) ? OK : InvalidParams;
+ return transport->Download(parameterObject["path"].asString(), result) ? OK : InvalidParams;
}
bool CFileOperations::FillFileItem(const CStdString &strFilename, CFileItem &item, CStdString media /* = "" */)
@@ -188,11 +187,11 @@ bool CFileOperations::FillFileItem(const CStdString &strFilename, CFileItem &ite
return status;
}
-bool CFileOperations::FillFileItemList(const Value &parameterObject, CFileItemList &list)
+bool CFileOperations::FillFileItemList(const CVariant &parameterObject, CFileItemList &list)
{
if (parameterObject.isMember("directory"))
{
- CStdString media = parameterObject.get("media", "").asString();
+ CStdString media = parameterObject["media"].asString();
media = media.ToLower();
CStdString strPath = parameterObject["directory"].asString();
@@ -240,11 +239,11 @@ bool CFileOperations::FillFileItemList(const Value &parameterObject, CFileItemLi
}
}
- if (parameterObject.isMember("recursive") && parameterObject["recursive"].isBool())
+ if (parameterObject.isMember("recursive") && parameterObject["recursive"].isBoolean())
{
for (int i = 0; i < filteredDirectories.Size(); i++)
{
- Value val = parameterObject;
+ CVariant val = parameterObject;
val["directory"] = filteredDirectories[i]->m_strPath;
FillFileItemList(val, list);
}
diff --git a/xbmc/interfaces/json-rpc/FileOperations.h b/xbmc/interfaces/json-rpc/FileOperations.h
index a873eb3dc1..f6d39a7e86 100644
--- a/xbmc/interfaces/json-rpc/FileOperations.h
+++ b/xbmc/interfaces/json-rpc/FileOperations.h
@@ -29,11 +29,11 @@ namespace JSONRPC
class CFileOperations : public CFileItemHandler
{
public:
- static JSON_STATUS GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Download(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetRootDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetDirectory(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Download(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static bool FillFileItem(const CStdString &strFilename, CFileItem &item, CStdString media = "");
- static bool FillFileItemList(const Json::Value &parameterObject, CFileItemList &list);
+ static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
};
}
diff --git a/xbmc/interfaces/json-rpc/IClient.h b/xbmc/interfaces/json-rpc/IClient.h
index 71c3ba4a88..99d9603a81 100644
--- a/xbmc/interfaces/json-rpc/IClient.h
+++ b/xbmc/interfaces/json-rpc/IClient.h
@@ -1,3 +1,25 @@
+#pragma once
+/*
+ * Copyright (C) 2005-2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
namespace JSONRPC
{
class IClient
diff --git a/xbmc/interfaces/json-rpc/ITransportLayer.h b/xbmc/interfaces/json-rpc/ITransportLayer.h
index 80ae46b620..7fd3bf7ab3 100644
--- a/xbmc/interfaces/json-rpc/ITransportLayer.h
+++ b/xbmc/interfaces/json-rpc/ITransportLayer.h
@@ -23,10 +23,7 @@
#include <string>
#include "IClient.h"
-namespace Json
-{
- class Value;
-}
+class CVariant;
namespace JSONRPC
{
@@ -43,7 +40,7 @@ namespace JSONRPC
{
public:
virtual ~ITransportLayer() { };
- virtual bool Download(const char *path, Json::Value *result) = 0;
+ virtual bool Download(const char *path, CVariant &result) = 0;
virtual int GetCapabilities() = 0;
};
}
diff --git a/xbmc/interfaces/json-rpc/InputOperations.cpp b/xbmc/interfaces/json-rpc/InputOperations.cpp
index 141c10d3cc..2f873867b4 100644
--- a/xbmc/interfaces/json-rpc/InputOperations.cpp
+++ b/xbmc/interfaces/json-rpc/InputOperations.cpp
@@ -22,46 +22,45 @@
#include "InputOperations.h"
#include "Application.h"
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CInputOperations::Left(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Left(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_MOVE_LEFT), WINDOW_INVALID, false);
return ACK;
}
-JSON_STATUS CInputOperations::Right(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Right(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_MOVE_RIGHT), WINDOW_INVALID, false);
return ACK;
}
-JSON_STATUS CInputOperations::Down(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Down(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_MOVE_DOWN), WINDOW_INVALID, false);
return ACK;
}
-JSON_STATUS CInputOperations::Up(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Up(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_MOVE_UP), WINDOW_INVALID, false);
return ACK;
}
-JSON_STATUS CInputOperations::Select(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Select(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_SELECT_ITEM), WINDOW_INVALID, false);
return ACK;
}
-JSON_STATUS CInputOperations::Back(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Back(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_PARENT_DIR), WINDOW_INVALID, false);
return ACK;
}
-JSON_STATUS CInputOperations::Home(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CInputOperations::Home(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().ActivateWindow(WINDOW_HOME, std::vector<CStdString>(), false);
return ACK;
diff --git a/xbmc/interfaces/json-rpc/InputOperations.h b/xbmc/interfaces/json-rpc/InputOperations.h
index 831aa63d7a..f96d8c6a89 100644
--- a/xbmc/interfaces/json-rpc/InputOperations.h
+++ b/xbmc/interfaces/json-rpc/InputOperations.h
@@ -28,16 +28,16 @@ namespace JSONRPC
class CInputOperations
{
public:
- static JSON_STATUS Left(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Right(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Down(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Up(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Left(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Right(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Down(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Up(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Select(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Select(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Back(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Back(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Home(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Home(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
};
}
diff --git a/xbmc/interfaces/json-rpc/JSONRPC.cpp b/xbmc/interfaces/json-rpc/JSONRPC.cpp
index 36d2aa762a..1ddbc27eed 100644
--- a/xbmc/interfaces/json-rpc/JSONRPC.cpp
+++ b/xbmc/interfaces/json-rpc/JSONRPC.cpp
@@ -41,7 +41,6 @@
using namespace ANNOUNCEMENT;
using namespace JSONRPC;
-using namespace Json;
using namespace std;
bool CJSONRPC::m_initialized = false;
@@ -158,6 +157,7 @@ JsonRpcMethodMap CJSONRPC::m_methodMaps[] = {
// Music Library
{ "AudioLibrary.GetArtists", CAudioLibrary::GetArtists },
+ { "AudioLibrary.GetArtistDetails", CAudioLibrary::GetArtistDetails },
{ "AudioLibrary.GetAlbums", CAudioLibrary::GetAlbums },
{ "AudioLibrary.GetAlbumDetails", CAudioLibrary::GetAlbumDetails },
{ "AudioLibrary.GetSongs", CAudioLibrary::GetSongs },
@@ -166,6 +166,7 @@ JsonRpcMethodMap CJSONRPC::m_methodMaps[] = {
{ "AudioLibrary.ScanForContent", CAudioLibrary::ScanForContent },
// Video Library
+ { "VideoLibrary.GetGenres", CVideoLibrary::GetGenres },
{ "VideoLibrary.GetMovies", CVideoLibrary::GetMovies },
{ "VideoLibrary.GetMovieDetails", CVideoLibrary::GetMovieDetails },
{ "VideoLibrary.GetMovieSets", CVideoLibrary::GetMovieSets },
@@ -223,25 +224,25 @@ void CJSONRPC::Initialize()
m_initialized = true;
}
-JSON_STATUS CJSONRPC::Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
- bool getDescriptions = parameterObject["getdescriptions"].asBool();
- bool getMetadata = parameterObject["getmetadata"].asBool();
- bool filterByTransport = parameterObject["filterbytransport"].asBool();
+ bool getDescriptions = parameterObject["getdescriptions"].asBoolean();
+ bool getMetadata = parameterObject["getmetadata"].asBoolean();
+ bool filterByTransport = parameterObject["filterbytransport"].asBoolean();
CJSONServiceDescription::Print(result, transport, client, getDescriptions, getMetadata, filterByTransport);
return OK;
}
-JSON_STATUS CJSONRPC::Version(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::Version(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
result["version"] = CJSONServiceDescription::GetVersion();
return OK;
}
-JSON_STATUS CJSONRPC::Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
int flags = client->GetPermissionFlags();
@@ -251,14 +252,14 @@ JSON_STATUS CJSONRPC::Permission(const CStdString &method, ITransportLayer *tran
return OK;
}
-JSON_STATUS CJSONRPC::Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
- Value temp = "pong";
+ CVariant temp = "pong";
result.swap(temp);
return OK;
}
-JSON_STATUS CJSONRPC::GetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::GetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
int flags = client->GetAnnouncementFlags();
@@ -268,21 +269,21 @@ JSON_STATUS CJSONRPC::GetNotificationFlags(const CStdString &method, ITransportL
return OK;
}
-JSON_STATUS CJSONRPC::SetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::SetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
int flags = 0;
- if (parameterObject["Player"].asBool())
+ if (parameterObject["Player"].asBoolean())
flags |= Player;
- if (parameterObject["GUI"].asBool())
+ if (parameterObject["GUI"].asBoolean())
flags |= GUI;
- if (parameterObject["System"].asBool())
+ if (parameterObject["System"].asBoolean())
flags |= System;
- if (parameterObject["VideoLibrary"].asBool())
+ if (parameterObject["VideoLibrary"].asBoolean())
flags |= VideoLibrary;
- if (parameterObject["AudioLibrary"].asBool())
+ if (parameterObject["AudioLibrary"].asBoolean())
flags |= AudioLibrary;
- if (parameterObject["Other"].asBool())
+ if (parameterObject["Other"].asBoolean())
flags |= Other;
if (client->SetAnnouncementFlags(flags))
@@ -291,16 +292,16 @@ JSON_STATUS CJSONRPC::SetNotificationFlags(const CStdString &method, ITransportL
return BadPermission;
}
-JSON_STATUS CJSONRPC::NotifyAll(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result)
+JSON_STATUS CJSONRPC::NotifyAll(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result)
{
if (parameterObject["data"].isNull())
- CAnnouncementManager::Announce(Other, parameterObject["sender"].asString().c_str(),
- parameterObject["message"].asString().c_str());
+ CAnnouncementManager::Announce(Other, parameterObject["sender"].asString(),
+ parameterObject["message"].asString());
else
{
CVariant data(parameterObject["data"].asString());
- CAnnouncementManager::Announce(Other, parameterObject["sender"].asString().c_str(),
- parameterObject["message"].asString().c_str(), data);
+ CAnnouncementManager::Announce(Other, parameterObject["sender"].asString(),
+ parameterObject["message"].asString(), data);
}
return ACK;
@@ -308,28 +309,26 @@ JSON_STATUS CJSONRPC::NotifyAll(const CStdString &method, ITransportLayer *trans
CStdString CJSONRPC::MethodCall(const CStdString &inputString, ITransportLayer *transport, IClient *client)
{
- Value inputroot, outputroot, result;
-
- Reader reader;
+ CVariant inputroot, outputroot, result;
bool hasResponse = false;
- if (reader.parse(inputString, inputroot))
+ inputroot = CJSONVariantParser::Parse((unsigned char *)inputString.c_str(), inputString.length());
+ if (!inputroot.isNull())
{
if (inputroot.isArray())
{
if (inputroot.size() <= 0)
{
CLog::Log(LOGERROR, "JSONRPC: Empty batch call\n");
- BuildResponse(inputroot, InvalidRequest, Value(), outputroot);
+ BuildResponse(inputroot, InvalidRequest, CVariant(), outputroot);
hasResponse = true;
}
else
{
- for (unsigned int i = 0; i < inputroot.size(); i++)
+ for (CVariant::const_iterator_array itr = inputroot.begin_array(); itr != inputroot.end_array(); itr++)
{
- Value request = inputroot.get(i, Value());
- Value response;
- if (HandleMethodCall(request, response, transport, client))
+ CVariant response;
+ if (HandleMethodCall(*itr, response, transport, client))
{
outputroot.append(response);
hasResponse = true;
@@ -343,40 +342,29 @@ CStdString CJSONRPC::MethodCall(const CStdString &inputString, ITransportLayer *
else
{
CLog::Log(LOGERROR, "JSONRPC: Failed to parse '%s'\n", inputString.c_str());
- BuildResponse(inputroot, ParseError, Value(), outputroot);
+ BuildResponse(inputroot, ParseError, CVariant(), outputroot);
hasResponse = true;
}
- CStdString str;
- if (hasResponse)
- {
- Writer *writer;
- if (g_advancedSettings.m_jsonOutputCompact)
- writer = new FastWriter();
- else
- writer = new StyledWriter();
-
- str = writer->write(outputroot);
- delete writer;
- }
+ CStdString str = hasResponse ? CJSONVariantWriter::Write(outputroot, g_advancedSettings.m_jsonOutputCompact) : "";
return str;
}
-bool CJSONRPC::HandleMethodCall(Value& request, Value& response, ITransportLayer *transport, IClient *client)
+bool CJSONRPC::HandleMethodCall(const CVariant& request, CVariant& response, ITransportLayer *transport, IClient *client)
{
JSON_STATUS errorCode = OK;
- Value result;
+ CVariant result;
bool isNotification = false;
if (IsProperJSONRPC(request))
{
isNotification = !request.isMember("id");
- CStdString methodName = request.get("method", "").asString();
+ CStdString methodName = request["method"].asString();
methodName = methodName.ToLower();
JSONRPC::MethodCall method;
- Json::Value params;
+ CVariant params;
if ((errorCode = CJSONServiceDescription::CheckCall(methodName, request["params"], client, isNotification, method, params)) == OK)
errorCode = method(methodName, transport, client, params, result);
@@ -385,8 +373,7 @@ bool CJSONRPC::HandleMethodCall(Value& request, Value& response, ITransportLayer
}
else
{
- StyledWriter writer;
- CLog::Log(LOGERROR, "JSONRPC: Failed to parse '%s'\n", writer.write(request).c_str());
+ CLog::Log(LOGERROR, "JSONRPC: Failed to parse '%s'\n", CJSONVariantWriter::Write(request, true).c_str());
errorCode = InvalidRequest;
}
@@ -395,15 +382,15 @@ bool CJSONRPC::HandleMethodCall(Value& request, Value& response, ITransportLayer
return !isNotification;
}
-inline bool CJSONRPC::IsProperJSONRPC(const Json::Value& inputroot)
+inline bool CJSONRPC::IsProperJSONRPC(const CVariant& inputroot)
{
- return inputroot.isObject() && inputroot.isMember("jsonrpc") && inputroot["jsonrpc"].isString() && inputroot.get("jsonrpc", "-1").asString() == "2.0" && inputroot.isMember("method") && inputroot["method"].isString() && (!inputroot.isMember("params") || inputroot["params"].isArray() || inputroot["params"].isObject());
+ return inputroot.isObject() && inputroot.isMember("jsonrpc") && inputroot["jsonrpc"].isString() && inputroot["jsonrpc"] == CVariant("2.0") && inputroot.isMember("method") && inputroot["method"].isString() && (!inputroot.isMember("params") || inputroot["params"].isArray() || inputroot["params"].isObject());
}
-inline void CJSONRPC::BuildResponse(const Value& request, JSON_STATUS code, const Value& result, Value& response)
+inline void CJSONRPC::BuildResponse(const CVariant& request, JSON_STATUS code, const CVariant& result, CVariant& response)
{
response["jsonrpc"] = "2.0";
- response["id"] = request.isObject() && request.isMember("id") ? request["id"] : Value();
+ response["id"] = request.isObject() && request.isMember("id") ? request["id"] : CVariant();
switch (code)
{
diff --git a/xbmc/interfaces/json-rpc/JSONRPC.h b/xbmc/interfaces/json-rpc/JSONRPC.h
index f42569acbc..6c0541480b 100644
--- a/xbmc/interfaces/json-rpc/JSONRPC.h
+++ b/xbmc/interfaces/json-rpc/JSONRPC.h
@@ -27,7 +27,6 @@
#include <iostream>
#include "ITransportLayer.h"
#include "interfaces/IAnnouncer.h"
-#include "jsoncpp/include/json/json.h"
#include "JSONUtils.h"
#include "JSONServiceDescription.h"
@@ -64,20 +63,20 @@ namespace JSONRPC
*/
static CStdString MethodCall(const CStdString &inputString, ITransportLayer *transport, IClient *client);
- static JSON_STATUS Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
- static JSON_STATUS Version(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
- static JSON_STATUS Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
- static JSON_STATUS Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
- static JSON_STATUS GetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
- static JSON_STATUS SetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
- static JSON_STATUS NotifyAll(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
+ static JSON_STATUS Introspect(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSON_STATUS Version(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSON_STATUS Permission(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSON_STATUS Ping(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSON_STATUS GetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSON_STATUS SetNotificationFlags(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
+ static JSON_STATUS NotifyAll(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
private:
static void setup();
- static bool HandleMethodCall(Json::Value& request, Json::Value& response, ITransportLayer *transport, IClient *client);
- static inline bool IsProperJSONRPC(const Json::Value& inputroot);
+ static bool HandleMethodCall(const CVariant& request, CVariant& response, ITransportLayer *transport, IClient *client);
+ static inline bool IsProperJSONRPC(const CVariant& inputroot);
- inline static void BuildResponse(const Json::Value& request, JSON_STATUS code, const Json::Value& result, Json::Value& response);
+ inline static void BuildResponse(const CVariant& request, JSON_STATUS code, const CVariant& result, CVariant& response);
static JsonRpcMethodMap m_methodMaps[];
static bool m_initialized;
diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
index 780d961632..c4ca199cd1 100644
--- a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
+++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp
@@ -24,6 +24,7 @@
#include "JSONServiceDescription.h"
#include "utils/log.h"
#include "utils/StdString.h"
+#include "utils/JSONVariantParser.h"
using namespace std;
using namespace JSONRPC;
@@ -60,7 +61,7 @@ unsigned int JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::size() const
return m_propertiesmap.size();
}
-Json::Value CJSONServiceDescription::m_notifications = Json::Value(Json::objectValue);
+CVariant CJSONServiceDescription::m_notifications = CVariant(CVariant::VariantTypeObject);
CJSONServiceDescription::CJsonRpcMethodMap CJSONServiceDescription::m_actionMap;
JsonRpcDescriptionHeader CJSONServiceDescription::m_header;
std::map<std::string, JSONSchemaTypeDefinition> CJSONServiceDescription::m_types = std::map<std::string, JSONSchemaTypeDefinition>();
@@ -69,16 +70,15 @@ bool CJSONServiceDescription::m_newReferenceType = false;
bool CJSONServiceDescription::Parse(JsonRpcMethodMap methodMap[], unsigned int size)
{
- Json::Value descriptionObject;
- Json::Reader reader;
-
// Read the json schema for notifications
- if (!reader.parse(JSON_NOTIFICATION_DESCRIPTION, m_notifications))
+ m_notifications = CJSONVariantParser::Parse((const unsigned char *)JSON_NOTIFICATION_DESCRIPTION, strlen(JSON_NOTIFICATION_DESCRIPTION));
+ if (m_notifications.isNull())
CLog::Log(LOGERROR, "JSONRPC: Unable to read the json schema notification description");
// Read the json schema service descriptor and check if it represents
// a json object and contains a "services" element for methods
- if (!reader.parse(JSON_SERVICE_DESCRIPTION, descriptionObject))
+ CVariant descriptionObject = CJSONVariantParser::Parse((const unsigned char *)JSON_SERVICE_DESCRIPTION, strlen(JSON_SERVICE_DESCRIPTION));
+ if (descriptionObject.isNull())
{
CLog::Log(LOGERROR, "JSONRPC: Unable to read the json schema service description");
return false;
@@ -142,24 +142,19 @@ bool CJSONServiceDescription::Parse(JsonRpcMethodMap methodMap[], unsigned int s
m_unresolvedMethods = stillUnresolvedMethods;
}
- // Get all child elements
- Json::Value::Members methodNames = descriptionObject.getMemberNames();
-
// Parse
- for (unsigned int index = 0; index < methodNames.size(); index++)
+ for (CVariant::const_iterator_map itr = descriptionObject.begin_map(); itr != descriptionObject.end_map(); itr++)
{
- std::string methodName = methodNames.at(index);
// Make sure the method actually exists and represents an object
- if (!descriptionObject.isMember(methodName) || !descriptionObject[methodName].isObject() ||
- !descriptionObject[methodName].isMember("type") || !descriptionObject[methodName]["type"].isString())
+ if (!itr->second.isObject() || !itr->second.isMember("type") || !itr->second["type"].isString())
continue;
- std::string type = GetString(descriptionObject[methodName]["type"], "");
- if (type.compare("method") != 0 && descriptionObject[methodName].isMember("id") && descriptionObject[methodName]["id"].isString())
+ std::string type = GetString(itr->second["type"], "");
+ if (type.compare("method") != 0 && itr->second.isMember("id") && itr->second["id"].isString())
{
JSONSchemaTypeDefinition globalType;
- globalType.name = methodName;
- parseTypeDefinition(descriptionObject[methodName], globalType, false);
+ globalType.name = itr->first;
+ parseTypeDefinition(itr->second, globalType, false);
}
}
@@ -176,7 +171,7 @@ int CJSONServiceDescription::GetVersion()
return m_header.version;
}
-void CJSONServiceDescription::Print(Json::Value &result, ITransportLayer *transport, IClient *client, bool printDescriptions, bool printMetadata, bool filterByTransport)
+void CJSONServiceDescription::Print(CVariant &result, ITransportLayer *transport, IClient *client, bool printDescriptions, bool printMetadata, bool filterByTransport)
{
// Print the header
result["id"] = m_header.ID;
@@ -187,7 +182,7 @@ void CJSONServiceDescription::Print(Json::Value &result, ITransportLayer *transp
std::map<std::string, JSONSchemaTypeDefinition>::const_iterator typeIteratorEnd = m_types.end();
for (typeIterator = m_types.begin(); typeIterator != typeIteratorEnd; typeIterator++)
{
- Json::Value currentType = Json::Value(Json::objectValue);
+ CVariant currentType = CVariant(CVariant::VariantTypeObject);
printType(typeIterator->second, false, true, true, printDescriptions, currentType);
result["types"][typeIterator->first] = currentType;
@@ -204,7 +199,7 @@ void CJSONServiceDescription::Print(Json::Value &result, ITransportLayer *transp
if ((clientPermissions & methodIterator->second.permission) == 0 || ((transportCapabilities & methodIterator->second.transportneed) == 0 && filterByTransport))
continue;
- Json::Value currentMethod = Json::Value(Json::objectValue);
+ CVariant currentMethod = CVariant(CVariant::VariantTypeObject);
currentMethod["type"] = "method";
if (printDescriptions && !methodIterator->second.description.empty())
@@ -214,10 +209,10 @@ void CJSONServiceDescription::Print(Json::Value &result, ITransportLayer *transp
currentMethod["permission"] = PermissionToString(methodIterator->second.permission);
}
- currentMethod["params"] = Json::Value(Json::arrayValue);
+ currentMethod["params"] = CVariant(CVariant::VariantTypeArray);
for (unsigned int paramIndex = 0; paramIndex < methodIterator->second.parameters.size(); paramIndex++)
{
- Json::Value param = Json::Value(Json::objectValue);
+ CVariant param = CVariant(CVariant::VariantTypeObject);
printType(methodIterator->second.parameters.at(paramIndex), true, false, true, printDescriptions, param);
currentMethod["params"].append(param);
}
@@ -228,23 +223,21 @@ void CJSONServiceDescription::Print(Json::Value &result, ITransportLayer *transp
}
// Print notification description
- Json::Value::Members notifications = m_notifications.getMemberNames();
- for (unsigned int notifIndex = 0; notifIndex < notifications.size(); notifIndex++)
+ for (CVariant::const_iterator_map itr = m_notifications.begin_map(); itr != m_notifications.end_map(); itr++)
{
- if (!m_notifications.isMember(notifications.at(notifIndex)) ||
- !m_notifications[notifications.at(notifIndex)].isObject() ||
- !m_notifications[notifications.at(notifIndex)].isMember("type") ||
- !m_notifications[notifications.at(notifIndex)]["type"].isString() ||
- m_notifications[notifications.at(notifIndex)]["type"].asString().compare("notification") != 0)
+ if (!itr->second.isObject() ||
+ !itr->second.isMember("type") ||
+ !itr->second["type"].isString() ||
+ itr->second["type"] == CVariant("notification"))
{
continue;
}
- result["notifications"][notifications.at(notifIndex)] = m_notifications[notifications.at(notifIndex)];
+ result["notifications"][itr->first] = itr->second;
}
}
-JSON_STATUS CJSONServiceDescription::CheckCall(const char* const method, const Json::Value &requestParameters, IClient *client, bool notification, MethodCall &methodCall, Json::Value &outputParameters)
+JSON_STATUS CJSONServiceDescription::CheckCall(const char* const method, const CVariant &requestParameters, IClient *client, bool notification, MethodCall &methodCall, CVariant &outputParameters)
{
CJsonRpcMethodMap::JsonRpcMethodIterator iter = m_actionMap.find(method);
if (iter != m_actionMap.end())
@@ -256,7 +249,7 @@ JSON_STATUS CJSONServiceDescription::CheckCall(const char* const method, const J
// Count the number of actually handled (present)
// parameters
unsigned int handled = 0;
- Json::Value errorData = Json::Value(Json::objectValue);
+ CVariant errorData = CVariant(CVariant::VariantTypeObject);
errorData["method"] = iter->second.name;
// Loop through all the parameters to check
@@ -289,7 +282,7 @@ JSON_STATUS CJSONServiceDescription::CheckCall(const char* const method, const J
return MethodNotFound;
}
-void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bool isParameter, bool isGlobal, bool printDefault, bool printDescriptions, Json::Value &output)
+void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bool isParameter, bool isGlobal, bool printDefault, bool printDescriptions, CVariant &output)
{
bool typeReference = false;
@@ -323,7 +316,7 @@ void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bo
// Printing enum field
if (type.enums.size() > 0)
{
- output["enums"] = Json::Value(Json::arrayValue);
+ output["enums"] = CVariant(CVariant::VariantTypeArray);
for (unsigned int enumIndex = 0; enumIndex < type.enums.size(); enumIndex++)
output["enums"].append(type.enums.at(enumIndex));
}
@@ -363,10 +356,10 @@ void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bo
}
else if (type.items.size() > 1)
{
- output["items"] = Json::Value(Json::arrayValue);
+ output["items"] = CVariant(CVariant::VariantTypeArray);
for (unsigned int itemIndex = 0; itemIndex < type.items.size(); itemIndex++)
{
- Json::Value item = Json::Value(Json::objectValue);
+ CVariant item = CVariant(CVariant::VariantTypeObject);
printType(type.items.at(itemIndex), false, false, false, printDescriptions, item);
output["items"].append(item);
}
@@ -383,10 +376,10 @@ void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bo
}
else if (type.additionalItems.size() > 1)
{
- output["additionalItems"] = Json::Value(Json::arrayValue);
+ output["additionalItems"] = CVariant(CVariant::VariantTypeArray);
for (unsigned int addItemIndex = 0; addItemIndex < type.additionalItems.size(); addItemIndex++)
{
- Json::Value item = Json::Value(Json::objectValue);
+ CVariant item = CVariant(CVariant::VariantTypeObject);
printType(type.additionalItems.at(addItemIndex), false, false, false, printDescriptions, item);
output["additionalItems"].append(item);
}
@@ -399,7 +392,7 @@ void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bo
// Print object fields
if (HasType(type.type, ObjectValue) && type.properties.size() > 0)
{
- output["properties"] = Json::Value(Json::objectValue);
+ output["properties"] = CVariant(CVariant::VariantTypeObject);
JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::JSONSchemaPropertiesIterator propertiesEnd = type.properties.end();
JSONSchemaTypeDefinition::CJsonSchemaPropertiesMap::JSONSchemaPropertiesIterator propertiesIterator;
@@ -411,13 +404,13 @@ void CJSONServiceDescription::printType(const JSONSchemaTypeDefinition &type, bo
}
}
-JSON_STATUS CJSONServiceDescription::checkParameter(const Json::Value &requestParameters, const JSONSchemaTypeDefinition &type, unsigned int position, Json::Value &outputParameters, unsigned int &handled, Json::Value &errorData)
+JSON_STATUS CJSONServiceDescription::checkParameter(const CVariant &requestParameters, const JSONSchemaTypeDefinition &type, unsigned int position, CVariant &outputParameters, unsigned int &handled, CVariant &errorData)
{
// Let's check if the parameter has been provided
if (ParameterExists(requestParameters, type.name, position))
{
// Get the parameter
- Json::Value parameterValue = GetParameter(requestParameters, type.name, position);
+ CVariant parameterValue = GetParameter(requestParameters, type.name, position);
// Evaluate the type of the parameter
JSON_STATUS status = checkType(parameterValue, type, outputParameters[type.name], errorData["stack"]);
@@ -443,7 +436,7 @@ JSON_STATUS CJSONServiceDescription::checkParameter(const Json::Value &requestPa
return OK;
}
-JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const JSONSchemaTypeDefinition &type, Json::Value &outputValue, Json::Value &errorData)
+JSON_STATUS CJSONServiceDescription::checkType(const CVariant &value, const JSONSchemaTypeDefinition &type, CVariant &outputValue, CVariant &errorData)
{
if (!type.name.empty())
errorData["name"] = type.name;
@@ -470,6 +463,7 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
// - check if they need to be unique ("uniqueItems")
if (HasType(type.type, ArrayValue) && value.isArray())
{
+ outputValue = CVariant(CVariant::VariantTypeArray);
// Check the number of items against minItems and maxItems
if ((type.minItems > 0 && value.size() < type.minItems) || (type.maxItems > 0 && value.size() > type.maxItems))
{
@@ -495,7 +489,9 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
// Loop through all array elements
for (unsigned int arrayIndex = 0; arrayIndex < value.size(); arrayIndex++)
{
- JSON_STATUS status = checkType(value[arrayIndex], itemType, outputValue[arrayIndex], errorData["property"]);
+ CVariant temp;
+ JSON_STATUS status = checkType(value[arrayIndex], itemType, temp, errorData["property"]);
+ outputValue.push_back(temp);
if (status != OK)
{
CLog::Log(LOGWARNING, "JSONRPC: Array element at index %u does not match in type %s", arrayIndex, type.name.c_str());
@@ -548,7 +544,7 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
bool ok = false;
for (unsigned int additionalIndex = 0; additionalIndex < type.additionalItems.size(); additionalIndex++)
{
- Json::Value dummyError;
+ CVariant dummyError;
if (checkType(value[arrayIndex], type.additionalItems.at(additionalIndex), outputValue[arrayIndex], dummyError) == OK)
{
ok = true;
@@ -575,7 +571,7 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
for (unsigned int checkedIndex = checkingIndex + 1; checkedIndex < outputValue.size(); checkedIndex++)
{
// If two elements are the same they are not unique
- if (Compare(outputValue[checkingIndex], outputValue[checkedIndex]) == 0)
+ if (outputValue[checkingIndex] == outputValue[checkedIndex])
{
CLog::Log(LOGWARNING, "JSONRPC: Not unique array element at index %u and %u in type %s", checkingIndex, checkedIndex, type.name.c_str());
errorMessage.Format("Array element at index %u is not unique (same as array element at index %u)", checkingIndex, checkedIndex);
@@ -621,7 +617,7 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
}
// Additional properties are not allowed
- if (handled < value.getMemberNames().size())
+ if (handled < value.size())
{
errorData["message"] = "Unexpected additional properties received";
return InvalidParams;
@@ -637,9 +633,9 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
if (type.enums.size() > 0)
{
bool valid = false;
- for (unsigned int enumIndex = 0; enumIndex < type.enums.size(); enumIndex++)
+ for (std::vector<CVariant>::const_iterator enumItr = type.enums.begin(); enumItr != type.enums.end(); enumItr++)
{
- if (Compare(type.enums.at(enumIndex), value) == 0)
+ if (*enumItr == value)
{
valid = true;
break;
@@ -656,7 +652,7 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
// If we have a number or an integer type, we need
// to check the minimum and maximum values
- if ((HasType(type.type, NumberValue) || HasType(type.type, IntegerValue)) && value.isNumeric())
+ if ((HasType(type.type, NumberValue) || HasType(type.type, IntegerValue)) && value.isDouble())
{
double numberValue = value.asDouble();
// Check minimum
@@ -685,14 +681,14 @@ JSON_STATUS CJSONServiceDescription::checkType(const Json::Value &value, const J
return OK;
}
-void CJSONServiceDescription::parseHeader(const Json::Value &descriptionObject)
+void CJSONServiceDescription::parseHeader(const CVariant &descriptionObject)
{
m_header.ID = GetString(descriptionObject["id"], "");
- m_header.version = descriptionObject.get("version", 0).asInt();
+ m_header.version = (int)descriptionObject["version"].asInteger(0);
m_header.description = GetString(descriptionObject["description"], "");
}
-bool CJSONServiceDescription::parseMethod(const Json::Value &value, JsonRpcMethod &method)
+bool CJSONServiceDescription::parseMethod(const CVariant &value, JsonRpcMethod &method)
{
// Parse XBMC specific information about the method
method.transportneed = StringToTransportLayer(value.isMember("transport") ? value["transport"].asString() : "");
@@ -705,7 +701,7 @@ bool CJSONServiceDescription::parseMethod(const Json::Value &value, JsonRpcMetho
// Loop through all defined parameters
for (unsigned int paramIndex = 0; paramIndex < value["params"].size(); paramIndex++)
{
- Json::Value parameter = value["params"][paramIndex];
+ CVariant parameter = value["params"][paramIndex];
// If the parameter definition does not contain a valid "name" or
// "type" element we will ignore it
if (!parameter.isMember("name") || !parameter["name"].isString() ||
@@ -733,7 +729,7 @@ bool CJSONServiceDescription::parseMethod(const Json::Value &value, JsonRpcMetho
return true;
}
-bool CJSONServiceDescription::parseParameter(Json::Value &value, JSONSchemaTypeDefinition &parameter)
+bool CJSONServiceDescription::parseParameter(CVariant &value, JSONSchemaTypeDefinition &parameter)
{
parameter.name = GetString(value["name"], "");
@@ -741,7 +737,7 @@ bool CJSONServiceDescription::parseParameter(Json::Value &value, JSONSchemaTypeD
return parseTypeDefinition(value, parameter, true);
}
-bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSONSchemaTypeDefinition &type, bool isParameter)
+bool CJSONServiceDescription::parseTypeDefinition(const CVariant &value, JSONSchemaTypeDefinition &type, bool isParameter)
{
bool isReferenceType = false;
bool hasReference = false;
@@ -773,7 +769,7 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
}
// Check if the "required" field has been defined
- type.optional = value.isMember("required") && value["required"].isBool() ? !value["required"].asBool() : true;
+ type.optional = value.isMember("required") && value["required"].isBoolean() ? !value["required"].asBoolean() : true;
// Get the "description"
if (!hasReference || (value.isMember("description") && value["description"].isString()))
@@ -791,9 +787,9 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
// sure that the default value is a valid enum value
else
{
- for (unsigned int defIndex = 0; defIndex < type.enums.size(); defIndex++)
+ for (std::vector<CVariant>::const_iterator itr = type.enums.begin(); itr != type.enums.end(); itr++)
{
- if (Compare(value["default"], type.enums.at(defIndex)) == 0)
+ if (value["default"] == *itr)
{
ok = true;
break;
@@ -842,22 +838,17 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
{
// Get all child elements of the "properties"
// object and loop through them
- Json::Value::Members properties = value["properties"].getMemberNames();
- for (unsigned int propertyIndex = 0; propertyIndex < properties.size(); propertyIndex++)
+ for (CVariant::const_iterator_map itr = value["properties"].begin_map(); itr != value["properties"].end_map(); itr++)
{
- std::string propertyName = properties.at(propertyIndex);
- if (!value["properties"].isMember(propertyName))
- continue;
-
// Create a new type definition, store the name
// of the current property into it, parse it
// recursively and add its default value
// to the current type's default value
JSONSchemaTypeDefinition propertyType;
- propertyType.name = propertyName;
- if (!parseTypeDefinition(value["properties"][propertyName], propertyType, false))
+ propertyType.name = itr->first;
+ if (!parseTypeDefinition(itr->second, propertyType, false))
return false;
- type.defaultValue[propertyName] = propertyType.defaultValue;
+ type.defaultValue[itr->first] = propertyType.defaultValue;
type.properties.add(propertyType);
}
}
@@ -870,8 +861,8 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
if (type.type == ArrayValue)
{
// Check for "uniqueItems" field
- if (value.isMember("uniqueItems") && value["uniqueItems"].isBool())
- type.uniqueItems = value["uniqueItems"].asBool();
+ if (value.isMember("uniqueItems") && value["uniqueItems"].isBoolean())
+ type.uniqueItems = value["uniqueItems"].asBoolean();
else
type.uniqueItems = false;
@@ -899,7 +890,7 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
}
// If it is not a (array of) schema and not a bool (default value is false)
// it has an invalid value
- else if (!value["additionalItems"].isBool())
+ else if (!value["additionalItems"].isBoolean())
CLog::Log(LOGWARNING, "Invalid \"additionalItems\" value for type %s", type.name.c_str());
}
@@ -919,19 +910,19 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
// parse all elements and store them
else if (value["items"].isArray())
{
- for (unsigned int itemIndex = 0; itemIndex < value["items"].size(); itemIndex++)
+ for (CVariant::const_iterator_array itemItr = value["items"].begin_array(); itemItr != value["items"].end_array(); itemItr++)
{
JSONSchemaTypeDefinition item;
- if (!parseTypeDefinition(value["items"][itemIndex], item, false))
+ if (!parseTypeDefinition(*itemItr, item, false))
return false;
type.items.push_back(item);
}
}
}
- type.minItems = value.get("minItems", 0).asInt();
- type.maxItems = value.get("maxItems", 0).asInt();
+ type.minItems = (unsigned int)value["minItems"].asUnsignedInteger(0);
+ type.maxItems = (unsigned int)value["maxItems"].asUnsignedInteger(0);
}
// The type is whether an object nor an array
else
@@ -940,18 +931,18 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
{
if ((type.type & NumberValue) == NumberValue)
{
- type.minimum = value.get("minimum", -numeric_limits<double>::max()).asDouble();
- type.maximum = value.get("maximum", numeric_limits<double>::max()).asDouble();
+ type.minimum = value["minimum"].asDouble(-numeric_limits<double>::max());
+ type.maximum = value["maximum"].asDouble(numeric_limits<double>::max());
}
else if ((type.type & IntegerValue) == IntegerValue)
{
- type.minimum = value.get("minimum", numeric_limits<int>::min()).asInt();
- type.maximum = value.get("maximum", numeric_limits<int>::max()).asInt();
+ type.minimum = (double)value["minimum"].asInteger(numeric_limits<int>::min());
+ type.maximum = (double)value["maximum"].asInteger(numeric_limits<int>::max());
}
- type.exclusiveMinimum = value.get("exclusiveMinimum", false).asBool();
- type.exclusiveMaximum = value.get("exclusiveMaximum", false).asBool();
- type.divisibleBy = value.get("divisibleBy", 0).asUInt();
+ type.exclusiveMinimum = value["exclusiveMinimum"].asBoolean(false);
+ type.exclusiveMaximum = value["exclusiveMaximum"].asBoolean(false);
+ type.divisibleBy = (unsigned int)value["divisibleBy"].asUnsignedInteger(0);
}
// If the type definition is neither an
@@ -960,13 +951,13 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
if (value.isMember("enum") && value["enum"].isArray())
{
// Loop through all elements in the "enum" array
- for (unsigned int enumIndex = 0; enumIndex < value["enum"].size(); enumIndex++)
+ for (CVariant::const_iterator_array enumItr = value["enum"].begin_array(); enumItr != value["enum"].end_array(); enumItr++)
{
// Check for duplicates and eliminate them
bool approved = true;
for (unsigned int approvedIndex = 0; approvedIndex < type.enums.size(); approvedIndex++)
{
- if (Compare(value["enum"][enumIndex], type.enums.at(approvedIndex)) == 0)
+ if (*enumItr == type.enums.at(approvedIndex))
{
approved = false;
break;
@@ -976,7 +967,7 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
// Only add the current item to the enum value
// list if it is not duplicate
if (approved)
- type.enums.push_back(value["enum"][enumIndex]);
+ type.enums.push_back(*enumItr);
}
}
}
@@ -992,9 +983,9 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
// sure that the default value is a valid enum value
else
{
- for (unsigned int defIndex = 0; defIndex < type.enums.size(); defIndex++)
+ for (std::vector<CVariant>::const_iterator itr = type.enums.begin(); itr != type.enums.end(); itr++)
{
- if (Compare(value["default"], type.enums.at(defIndex)) == 0)
+ if (value["default"] == *itr)
{
ok = true;
break;
@@ -1028,7 +1019,7 @@ bool CJSONServiceDescription::parseTypeDefinition(const Json::Value &value, JSON
return true;
}
-void CJSONServiceDescription::parseReturn(const Json::Value &value, Json::Value &returns)
+void CJSONServiceDescription::parseReturn(const CVariant &value, CVariant &returns)
{
// Only parse the "returns" definition if there is one
if (value.isMember("returns"))
diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.h b/xbmc/interfaces/json-rpc/JSONServiceDescription.h
index 2294371434..2cb4454975 100644
--- a/xbmc/interfaces/json-rpc/JSONServiceDescription.h
+++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.h
@@ -22,7 +22,6 @@
#include <string>
#include <vector>
-#include "jsoncpp/include/json/json.h"
#include "JSONUtils.h"
namespace JSONRPC
@@ -105,7 +104,7 @@ namespace JSONRPC
\brief Default value of the parameter
(only needed when it is optional)
*/
- Json::Value defaultValue;
+ CVariant defaultValue;
/*!
\brief Minimum value for Integer
@@ -140,7 +139,7 @@ namespace JSONRPC
\brief (Optional) List of allowed values
for the type
*/
- std::vector<Json::Value> enums;
+ std::vector<CVariant> enums;
/*!
\brief List of possible values in an array
@@ -238,7 +237,7 @@ namespace JSONRPC
/*!
\brief Definition of the return value
*/
- Json::Value returns;
+ CVariant returns;
} JsonRpcMethod;
/*!
@@ -302,7 +301,7 @@ namespace JSONRPC
\param printMetadata Whether to print XBMC specific data or not
\param filterByTransport Whether to filter by transport or not
*/
- static void Print(Json::Value &result, ITransportLayer *transport, IClient *client, bool printDescriptions, bool printMetadata, bool filterByTransport);
+ static void Print(CVariant &result, ITransportLayer *transport, IClient *client, bool printDescriptions, bool printMetadata, bool filterByTransport);
/*!
\brief Checks the given parameters from the request against the
@@ -320,17 +319,17 @@ namespace JSONRPC
actual C/C++ implementation of the method to the "methodCall" parameter and checks the
given parameters from the request against the json schema description for the given method.
*/
- static JSON_STATUS CheckCall(const char* const method, const Json::Value &requestParameters, IClient *client, bool notification, MethodCall &methodCall, Json::Value &outputParameters);
+ static JSON_STATUS CheckCall(const char* const method, const CVariant &requestParameters, IClient *client, bool notification, MethodCall &methodCall, CVariant &outputParameters);
private:
- static void printType(const JSONSchemaTypeDefinition &type, bool isParameter, bool isGlobal, bool printDefault, bool printDescriptions, Json::Value &output);
- static JSON_STATUS checkParameter(const Json::Value &requestParameters, const JSONSchemaTypeDefinition &type, unsigned int position, Json::Value &outputParameters, unsigned int &handled, Json::Value &errorData);
- static JSON_STATUS checkType(const Json::Value &value, const JSONSchemaTypeDefinition &type, Json::Value &outputValue, Json::Value &errorData);
- static void parseHeader(const Json::Value &descriptionObject);
- static bool parseMethod(const Json::Value &value, JsonRpcMethod &method);
- static bool parseParameter(Json::Value &value, JSONSchemaTypeDefinition &parameter);
- static bool parseTypeDefinition(const Json::Value &value, JSONSchemaTypeDefinition &type, bool isParameter);
- static void parseReturn(const Json::Value &value, Json::Value &returns);
+ static void printType(const JSONSchemaTypeDefinition &type, bool isParameter, bool isGlobal, bool printDefault, bool printDescriptions, CVariant &output);
+ static JSON_STATUS checkParameter(const CVariant &requestParameters, const JSONSchemaTypeDefinition &type, unsigned int position, CVariant &outputParameters, unsigned int &handled, CVariant &errorData);
+ static JSON_STATUS checkType(const CVariant &value, const JSONSchemaTypeDefinition &type, CVariant &outputValue, CVariant &errorData);
+ static void parseHeader(const CVariant &descriptionObject);
+ static bool parseMethod(const CVariant &value, JsonRpcMethod &method);
+ static bool parseParameter(CVariant &value, JSONSchemaTypeDefinition &parameter);
+ static bool parseTypeDefinition(const CVariant &value, JSONSchemaTypeDefinition &type, bool isParameter);
+ static void parseReturn(const CVariant &value, CVariant &returns);
static void addReferenceTypeDefinition(JSONSchemaTypeDefinition &typeDefinition);
class CJsonRpcMethodMap
@@ -348,7 +347,7 @@ namespace JSONRPC
std::map<std::string, JsonRpcMethod> m_actionmap;
};
- static Json::Value m_notifications;
+ static CVariant m_notifications;
static JsonRpcDescriptionHeader m_header;
static CJsonRpcMethodMap m_actionMap;
static std::map<std::string, JSONSchemaTypeDefinition> m_types;
diff --git a/xbmc/interfaces/json-rpc/JSONUtils.h b/xbmc/interfaces/json-rpc/JSONUtils.h
index 615a836d77..67fbd04762 100644
--- a/xbmc/interfaces/json-rpc/JSONUtils.h
+++ b/xbmc/interfaces/json-rpc/JSONUtils.h
@@ -26,8 +26,9 @@
#include "interfaces/IAnnouncer.h"
#include "interfaces/AnnouncementUtils.h"
#include "ITransportLayer.h"
-#include "jsoncpp/include/json/json.h"
#include "utils/Variant.h"
+#include "utils/JSONVariantWriter.h"
+#include "utils/JSONVariantParser.h"
namespace JSONRPC
@@ -54,7 +55,7 @@ namespace JSONRPC
/*!
\brief Function pointer for json rpc methods
*/
- typedef JSON_STATUS (*MethodCall) (const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value& parameterObject, Json::Value &result);
+ typedef JSON_STATUS (*MethodCall) (const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant& parameterObject, CVariant &result);
/*!
\ingroup jsonrpc
@@ -112,7 +113,7 @@ namespace JSONRPC
the given object is not an array) or for a parameter at the
given position (if the given object is an array).
*/
- static inline bool ParameterExists(const Json::Value &parameterObject, std::string key, unsigned int position) { return IsValueMember(parameterObject, key) || (parameterObject.isArray() && parameterObject.size() > position); }
+ static inline bool ParameterExists(const CVariant &parameterObject, std::string key, unsigned int position) { return IsValueMember(parameterObject, key) || (parameterObject.isArray() && parameterObject.size() > position); }
/*!
\brief Checks if the given object contains a value
@@ -122,7 +123,7 @@ namespace JSONRPC
\return True if the given object contains a member with
the given key otherwise false
*/
- static inline bool IsValueMember(const Json::Value &value, std::string key) { return value.isObject() && value.isMember(key); }
+ static inline bool IsValueMember(const CVariant &value, std::string key) { return value.isObject() && value.isMember(key); }
/*!
\brief Returns the json value of a parameter
@@ -136,7 +137,7 @@ namespace JSONRPC
the given object is not an array) or of the parameter at the
given position (if the given object is an array).
*/
- static inline Json::Value GetParameter(const Json::Value &parameterObject, std::string key, unsigned int position) { return IsValueMember(parameterObject, key) ? parameterObject[key] : parameterObject[position]; }
+ static inline CVariant GetParameter(const CVariant &parameterObject, std::string key, unsigned int position) { return IsValueMember(parameterObject, key) ? parameterObject[key] : parameterObject[position]; }
/*!
\brief Returns the json value of a parameter or the given
@@ -153,7 +154,7 @@ namespace JSONRPC
given position (if the given object is an array). If the
parameter does not exist the given default value is returned.
*/
- static inline Json::Value GetParameter(const Json::Value &parameterObject, std::string key, unsigned int position, Json::Value fallback) { return IsValueMember(parameterObject, key) ? parameterObject[key] : ((parameterObject.isArray() && parameterObject.size() > position) ? parameterObject[position] : fallback); }
+ static inline CVariant GetParameter(const CVariant &parameterObject, std::string key, unsigned int position, CVariant fallback) { return IsValueMember(parameterObject, key) ? parameterObject[key] : ((parameterObject.isArray() && parameterObject.size() > position) ? parameterObject[position] : fallback); }
/*!
\brief Returns the given json value as a string
@@ -162,7 +163,7 @@ namespace JSONRPC
\return String value of the given json value or the default value
if the given json value is no string
*/
- static inline std::string GetString(const Json::Value &value, const char* defaultValue)
+ static inline std::string GetString(const CVariant &value, const char* defaultValue)
{
std::string str = defaultValue;
if (value.isString())
@@ -335,9 +336,9 @@ namespace JSONRPC
\param valueTye json schema type(s)
\param jsonObject json object into which the json schema type(s) are stored
*/
- static inline void SchemaValueTypeToJson(JSONSchemaType valueType, Json::Value &jsonObject)
+ static inline void SchemaValueTypeToJson(JSONSchemaType valueType, CVariant &jsonObject)
{
- jsonObject = Json::Value(Json::arrayValue);
+ jsonObject = CVariant(CVariant::VariantTypeArray);
for (unsigned int value = 0x01; value <= (unsigned int)AnyValue; value *= 2)
{
if (HasType(valueType, (JSONSchemaType)value))
@@ -348,24 +349,25 @@ namespace JSONRPC
jsonObject = jsonObject[0];
}
- static inline const char *ValueTypeToString(Json::ValueType valueType)
+ static inline const char *ValueTypeToString(CVariant::VariantType valueType)
{
switch (valueType)
{
- case Json::stringValue:
+ case CVariant::VariantTypeString:
return "string";
- case Json::realValue:
+ case CVariant::VariantTypeDouble:
return "number";
- case Json::intValue:
- case Json::uintValue:
+ case CVariant::VariantTypeInteger:
+ case CVariant::VariantTypeUnsignedInteger:
return "integer";
- case Json::booleanValue:
+ case CVariant::VariantTypeBoolean:
return "boolean";
- case Json::arrayValue:
+ case CVariant::VariantTypeArray:
return "array";
- case Json::objectValue:
+ case CVariant::VariantTypeObject:
return "object";
- case Json::nullValue:
+ case CVariant::VariantTypeNull:
+ case CVariant::VariantTypeConstNull:
return "null";
default:
return "unknown";
@@ -381,12 +383,12 @@ namespace JSONRPC
\param valueType Expected type of the parameter
\return True if the specific parameter is of the given type otherwise false
*/
- static inline bool IsParameterType(const Json::Value &parameterObject, const char *key, unsigned int position, JSONSchemaType valueType)
+ static inline bool IsParameterType(const CVariant &parameterObject, const char *key, unsigned int position, JSONSchemaType valueType)
{
if ((valueType & AnyValue) == AnyValue)
return true;
- Json::Value parameter;
+ CVariant parameter;
if (IsValueMember(parameterObject, key))
parameter = parameterObject[key];
else if(parameterObject.isArray() && parameterObject.size() > position)
@@ -401,17 +403,17 @@ namespace JSONRPC
\param valueType Expected type of the json value
\return True if the given json value is of the given type otherwise false
*/
- static inline bool IsType(const Json::Value &value, JSONSchemaType valueType)
+ static inline bool IsType(const CVariant &value, JSONSchemaType valueType)
{
if (HasType(valueType, AnyValue))
return true;
if (HasType(valueType, StringValue) && value.isString())
return true;
- if (HasType(valueType, NumberValue) && (value.isInt() || value.isUInt() || value.isDouble()))
+ if (HasType(valueType, NumberValue) && (value.isInteger() || value.isUnsignedInteger() || value.isDouble()))
return true;
- if (HasType(valueType, IntegerValue) && (value.isInt() || value.isUInt()))
+ if (HasType(valueType, IntegerValue) && (value.isInteger() || value.isUnsignedInteger()))
return true;
- if (HasType(valueType, BooleanValue) && value.isBool())
+ if (HasType(valueType, BooleanValue) && value.isBoolean())
return true;
if (HasType(valueType, ArrayValue) && value.isArray())
return true;
@@ -427,112 +429,48 @@ namespace JSONRPC
\param value Json value to be set
\param valueType Type of the default value
*/
- static inline void SetDefaultValue(Json::Value &value, JSONSchemaType valueType)
+ static inline void SetDefaultValue(CVariant &value, JSONSchemaType valueType)
{
switch (valueType)
{
case StringValue:
- value = Json::Value("");
+ value = CVariant("");
break;
case NumberValue:
- value = Json::Value(Json::realValue);
+ value = CVariant(CVariant::VariantTypeDouble);
break;
case IntegerValue:
- value = Json::Value(Json::intValue);
+ value = CVariant(CVariant::VariantTypeInteger);
break;
case BooleanValue:
- value = Json::Value(Json::booleanValue);
+ value = CVariant(CVariant::VariantTypeBoolean);
break;
case ArrayValue:
- value = Json::Value(Json::arrayValue);
+ value = CVariant(CVariant::VariantTypeArray);
break;
case ObjectValue:
- value = Json::Value(Json::objectValue);
+ value = CVariant(CVariant::VariantTypeObject);
break;
default:
- value = Json::Value(Json::nullValue);
+ value = CVariant(CVariant::VariantTypeConstNull);
}
}
static inline bool HasType(JSONSchemaType typeObject, JSONSchemaType type) { return (typeObject & type) == type; }
- static inline int Compare(const Json::Value &value, const Json::Value &other)
- {
- if (value.type() != other.type())
- return other.type() - value.type();
-
- int result = 0;
- Json::Value::Members members, otherMembers;
-
- switch (value.type())
- {
- case Json::nullValue:
- return 0;
- case Json::intValue:
- return other.asInt() - value.asInt();
- case Json::uintValue:
- return other.asUInt() - value.asUInt();
- case Json::realValue:
- return (int)(other.asDouble() - value.asDouble());
- case Json::booleanValue:
- return other.asBool() - value.asBool();
- case Json::stringValue:
- return other.asString().compare(value.asString());
- case Json::arrayValue:
- if (other.size() != value.size())
- return other.size() - value.size();
-
- for (unsigned int i = 0; i < other.size(); i++)
- {
- if ((result = Compare(value[i], other[i])) != 0)
- return result;
- }
-
- return 0;
- case Json::objectValue:
- members = value.getMemberNames();
- otherMembers = other.getMemberNames();
-
- if (members.size() != otherMembers.size())
- return otherMembers.size() - members.size();
-
- for (unsigned int i = 0; i < members.size(); i++)
- {
- if (!other.isMember(members.at(i)))
- return -1;
-
- if ((result = Compare(value[members.at(i)], other[members.at(i)])) != 0)
- return result;
- }
-
- return 0;
- }
-
- return -1; // unreachable
- }
-
static std::string AnnouncementToJSON(ANNOUNCEMENT::EAnnouncementFlag flag, const char *sender, const char *method, const CVariant &data, bool compactOutput)
{
- Json::Value root;
+ CVariant root;
root["jsonrpc"] = "2.0";
CStdString namespaceMethod;
namespaceMethod.Format("%s.%s", ANNOUNCEMENT::CAnnouncementUtils::AnnouncementFlagToString(flag), method);
root["method"] = namespaceMethod.c_str();
- if (data.isObject())
- data.toJsonValue(root["params"]);
+ root["params"]["data"] = data;
root["params"]["sender"] = sender;
- Json::Writer *writer;
- if (compactOutput)
- writer = new Json::FastWriter();
- else
- writer = new Json::StyledWriter();
-
- std::string str = writer->write(root);
- delete writer;
- return str;
+ return CJSONVariantWriter::Write(root, compactOutput);
}
};
}
diff --git a/xbmc/interfaces/json-rpc/PicturePlayerOperations.cpp b/xbmc/interfaces/json-rpc/PicturePlayerOperations.cpp
index 7c00ededaf..0093a4c9dc 100644
--- a/xbmc/interfaces/json-rpc/PicturePlayerOperations.cpp
+++ b/xbmc/interfaces/json-rpc/PicturePlayerOperations.cpp
@@ -23,71 +23,69 @@
#include "Application.h"
#include "guilib/Key.h"
-using namespace Json;
using namespace JSONRPC;
-
-JSON_STATUS CPicturePlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_PAUSE);
}
-JSON_STATUS CPicturePlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_STOP);
}
-JSON_STATUS CPicturePlayerOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_PREV_PICTURE);
}
-JSON_STATUS CPicturePlayerOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_NEXT_PICTURE);
}
-JSON_STATUS CPicturePlayerOperations::MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_LEFT);
}
-JSON_STATUS CPicturePlayerOperations::MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_RIGHT);
}
-JSON_STATUS CPicturePlayerOperations::MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_DOWN);
}
-JSON_STATUS CPicturePlayerOperations::MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_MOVE_UP);
}
-JSON_STATUS CPicturePlayerOperations::ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_ZOOM_OUT);
}
-JSON_STATUS CPicturePlayerOperations::ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_ZOOM_IN);
}
-JSON_STATUS CPicturePlayerOperations::Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- return SendAction(ACTION_ZOOM_LEVEL_NORMAL + (parameterObject["value"].asInt() - 1));
+ return SendAction(ACTION_ZOOM_LEVEL_NORMAL + ((int)parameterObject["value"].asInteger() - 1));
}
-JSON_STATUS CPicturePlayerOperations::Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPicturePlayerOperations::Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
return SendAction(ACTION_ROTATE_PICTURE);
}
-/*JSON_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+/*JSON_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (pSlideShow) {
diff --git a/xbmc/interfaces/json-rpc/PicturePlayerOperations.h b/xbmc/interfaces/json-rpc/PicturePlayerOperations.h
index 4e8fc2ea83..b75161ac88 100644
--- a/xbmc/interfaces/json-rpc/PicturePlayerOperations.h
+++ b/xbmc/interfaces/json-rpc/PicturePlayerOperations.h
@@ -28,23 +28,23 @@ namespace JSONRPC
class CPicturePlayerOperations
{
public:
- static JSON_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS PlayPause(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Stop(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SkipPrevious(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SkipNext(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS MoveLeft(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS MoveRight(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS MoveDown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS MoveUp(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS ZoomOut(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS ZoomIn(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Zoom(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Rotate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
private:
static inline JSON_STATUS SendAction(int actionID);
-// static JSON_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+// static JSON_STATUS Move(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
};
}
diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp
index bf1407c9b7..efa12ae20c 100644
--- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp
+++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp
@@ -25,10 +25,9 @@
#include "PlayListPlayer.h"
#include "guilib/GUIWindowManager.h"
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CPlayerOperations::GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlayerOperations::GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
result["video"] = g_application.IsPlayingVideo();
result["audio"] = g_application.IsPlayingAudio();
diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.h b/xbmc/interfaces/json-rpc/PlayerOperations.h
index 1909d3c8e9..a43476736b 100644
--- a/xbmc/interfaces/json-rpc/PlayerOperations.h
+++ b/xbmc/interfaces/json-rpc/PlayerOperations.h
@@ -28,6 +28,6 @@ namespace JSONRPC
class CPlayerOperations
{
public:
- static JSON_STATUS GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetActivePlayers(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
};
}
diff --git a/xbmc/interfaces/json-rpc/PlaylistOperations.cpp b/xbmc/interfaces/json-rpc/PlaylistOperations.cpp
index 8f82254f14..13b003b8a0 100644
--- a/xbmc/interfaces/json-rpc/PlaylistOperations.cpp
+++ b/xbmc/interfaces/json-rpc/PlaylistOperations.cpp
@@ -27,7 +27,6 @@
#include "utils/StringUtils.h"
#include "threads/SingleLock.h"
-using namespace Json;
using namespace JSONRPC;
using namespace PLAYLIST;
using namespace std;
@@ -38,7 +37,7 @@ using namespace std;
map<CStdString, CPlayListPtr> CPlaylistOperations::VirtualPlaylists;
CCriticalSection CPlaylistOperations::VirtualCriticalSection;
-JSON_STATUS CPlaylistOperations::Create(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Create(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CStdString file = "";
CStdString id = "";
@@ -75,7 +74,7 @@ JSON_STATUS CPlaylistOperations::Create(const CStdString &method, ITransportLaye
return OK;
}
-JSON_STATUS CPlaylistOperations::Destroy(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Destroy(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
if (VirtualPlaylists.erase(parameterObject["playlistid"].asString()) <= 0)
@@ -84,7 +83,7 @@ JSON_STATUS CPlaylistOperations::Destroy(const CStdString &method, ITransportLay
return ACK;
}
-JSON_STATUS CPlaylistOperations::GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
@@ -107,7 +106,7 @@ JSON_STATUS CPlaylistOperations::GetItems(const CStdString &method, ITransportLa
return InvalidParams;
}
-JSON_STATUS CPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
@@ -125,15 +124,15 @@ JSON_STATUS CPlaylistOperations::Add(const CStdString &method, ITransportLayer *
return InvalidParams;
}
-JSON_STATUS CPlaylistOperations::Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
if (playlist)
{
- if (parameterObject["item"].isInt())
- playlist->Remove(parameterObject["item"].asInt());
+ if (parameterObject["item"].isInteger())
+ playlist->Remove((int)parameterObject["item"].asInteger());
else if (parameterObject["item"].isString())
playlist->Remove(parameterObject["item"].asString());
@@ -143,18 +142,18 @@ JSON_STATUS CPlaylistOperations::Remove(const CStdString &method, ITransportLaye
return InvalidParams;
}
-JSON_STATUS CPlaylistOperations::Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
- if (playlist && playlist->Swap(parameterObject["item1"].asInt(), parameterObject["item2"].asInt()))
+ if (playlist && playlist->Swap((int)parameterObject["item1"].asInteger(), (int)parameterObject["item2"].asInteger()))
return ACK;
return InvalidParams;
}
-JSON_STATUS CPlaylistOperations::Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
@@ -168,7 +167,7 @@ JSON_STATUS CPlaylistOperations::Clear(const CStdString &method, ITransportLayer
return InvalidParams;
}
-JSON_STATUS CPlaylistOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
@@ -182,7 +181,7 @@ JSON_STATUS CPlaylistOperations::Shuffle(const CStdString &method, ITransportLay
return InvalidParams;
}
-JSON_STATUS CPlaylistOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CPlaylistOperations::UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CSingleLock lock(VirtualCriticalSection);
CPlayListPtr playlist = GetPlaylist(parameterObject);
@@ -196,7 +195,7 @@ JSON_STATUS CPlaylistOperations::UnShuffle(const CStdString &method, ITransportL
return InvalidParams;
}
-bool CPlaylistOperations::FillFileItemList(const Value &parameterObject, CFileItemList &list)
+bool CPlaylistOperations::FillFileItemList(const CVariant &parameterObject, CFileItemList &list)
{
bool found = false;
@@ -230,7 +229,7 @@ bool CPlaylistOperations::FillFileItemList(const Value &parameterObject, CFileIt
return found;
}
-CPlayListPtr CPlaylistOperations::GetPlaylist(const Value &parameterObject)
+CPlayListPtr CPlaylistOperations::GetPlaylist(const CVariant &parameterObject)
{
if (parameterObject["playlist"].isMember(PLAYLIST_MEMBER_VIRTUAL) && parameterObject["playlist"][PLAYLIST_MEMBER_VIRTUAL].isString())
{
diff --git a/xbmc/interfaces/json-rpc/PlaylistOperations.h b/xbmc/interfaces/json-rpc/PlaylistOperations.h
index 8ed4df98b3..ffd095cc55 100644
--- a/xbmc/interfaces/json-rpc/PlaylistOperations.h
+++ b/xbmc/interfaces/json-rpc/PlaylistOperations.h
@@ -30,21 +30,21 @@ namespace JSONRPC
class CPlaylistOperations : public CFileItemHandler
{
public:
- static JSON_STATUS Create(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Destroy(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Create(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Destroy(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Add(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetItems(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Add(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Remove(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Swap(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Clear(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Shuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS UnShuffle(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static bool FillFileItemList(const Json::Value &parameterObject, CFileItemList &list);
+ static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
private:
static std::map<CStdString, PLAYLIST::CPlayListPtr> VirtualPlaylists;
static CCriticalSection VirtualCriticalSection;
- static PLAYLIST::CPlayListPtr GetPlaylist(const Json::Value &parameterObject);
+ static PLAYLIST::CPlayListPtr GetPlaylist(const CVariant &parameterObject);
};
}
diff --git a/xbmc/interfaces/json-rpc/ServiceDescription.h b/xbmc/interfaces/json-rpc/ServiceDescription.h
index fa91f8f5ef..44c5c822a6 100644
--- a/xbmc/interfaces/json-rpc/ServiceDescription.h
+++ b/xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -1145,7 +1145,7 @@ namespace JSONRPC
"\"permission\": \"ReadData\","
"\"params\": ["
"{ \"name\": \"genreid\", \"id\": \"Library.Id\", \"type\": \"integer\", \"default\": -1, \"minimum\": 1 },"
- "{ \"name\": \"fields\", \"type\": \"array\", \"uniqueItems\": true,"
+ "{ \"name\": \"fields\", \"type\": \"array\", \"id\": \"Library.Fields.Artist\", \"uniqueItems\": true,"
"\"items\": { \"type\": \"string\","
"\"enum\": [ \"instrument\", \"style\", \"mood\", \"born\", \"formed\","
"\"description\", \"genre\", \"died\", \"disbanded\","
@@ -1161,7 +1161,7 @@ namespace JSONRPC
"\"properties\": {"
"\"limits\": { \"$ref\": \"List.LimitsReturned\", \"required\": true },"
"\"artists\": { \"type\": \"array\","
- "\"items\": { \"type\": \"object\","
+ "\"items\": { \"type\": \"object\", \"id\": \"Audio.ArtistDetails\","
"\"properties\": {"
"\"artistid\": { \"$ref\": \"Library.Id\", \"required\": true },"
"\"label\": { \"type\": \"string\", \"required\": true },"
@@ -1185,6 +1185,21 @@ namespace JSONRPC
"}"
"}"
"},"
+ "\"AudioLibrary.GetArtistDetails\": {"
+ "\"type\": \"method\","
+ "\"description\": \"Retrieve details about a specific artist\","
+ "\"transport\": \"Response\","
+ "\"permission\": \"ReadData\","
+ "\"params\": ["
+ "{ \"name\": \"artistid\", \"$ref\": \"Library.Id\", \"required\": true },"
+ "{ \"name\": \"fields\", \"$ref\": \"Library.Fields.Artist\" }"
+ "],"
+ "\"returns\": { \"type\": \"object\","
+ "\"properties\": {"
+ "\"artistdetails\": { \"$ref\": \"Audio.ArtistDetails\" }"
+ "}"
+ "}"
+ "},"
"\"AudioLibrary.GetAlbums\": {"
"\"type\": \"method\","
"\"description\": \"Retrieve all albums from specified artist or genre\","
@@ -1646,7 +1661,7 @@ namespace JSONRPC
"\"transport\": \"Response\","
"\"permission\": \"ReadData\","
"\"params\": ["
- "{ \"name\": \"tvshowid\", \"$ref\": \"Library.Id\", \"required\": true },"
+ "{ \"name\": \"tvshowid\", \"$ref\": \"Library.Id\" },"
"{ \"name\": \"season\", \"type\": \"integer\", \"minimum\": 0, \"default\": -1 },"
"{ \"name\": \"fields\", \"type\": \"array\", \"id\": \"Library.Fields.Episode\", \"uniqueItems\": true,"
"\"items\": { \"type\": \"string\","
@@ -1831,6 +1846,33 @@ namespace JSONRPC
"}"
"}"
"},"
+ "\"VideoLibrary.GetGenres\": {"
+ "\"type\": \"method\","
+ "\"description\": \"Retrieve all genres\","
+ "\"transport\": \"Response\","
+ "\"permission\": \"ReadData\","
+ "\"params\": ["
+ "{ \"name\": \"type\", \"type\": \"string\", \"required\": true, \"enum\": [ \"movie\", \"tvshow\", \"musicvideo\"] },"
+ "{ \"name\": \"limits\", \"$ref\": \"List.Limits\" },"
+ "{ \"name\": \"sort\", \"$ref\": \"List.Sort\" }"
+ "],"
+ "\"returns\": {"
+ "\"type\": \"object\","
+ "\"properties\": {"
+ "\"limits\": { \"$ref\": \"List.LimitsReturned\", \"required\": true },"
+ "\"genres\": {\"type\": \"array\","
+ "\"items\": { \"type\": \"object\","
+ "\"properties\": {"
+ "\"genreid\": { \"$ref\": \"Library.Id\", \"required\": true },"
+ "\"genre\": { \"type\": \"string\", \"required\": true },"
+ "\"label\": { \"type\": \"string\", \"required\": true },"
+ "\"thumbnail\": { \"type\": \"string\" }"
+ "}"
+ "}"
+ "}"
+ "}"
+ "}"
+ "},"
"\"VideoLibrary.ScanForContent\": {"
"\"type\": \"method\","
"\"description\": \"Scans the video sources for new library items\","
@@ -2023,5 +2065,165 @@ namespace JSONRPC
"}";
const char* const JSON_NOTIFICATION_DESCRIPTION =
- "{ }";
+ "{"
+ "\"Player.OnPlay\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"Playback of a media item has been started or the playback speed has changed.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"speed\": { \"type\": \"integer\", \"required\": true },"
+ "\"type\": { \"type\": \"string\", \"id\": \"Notifications.Player.Type\", \"enum\": [ \"unknown\", \"movie\", \"episode\", \"musicvideo\", \"song\" ], \"required\": true },"
+ "\"id\": { \"$ref\": \"Library.Id\" }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"Player.OnPause\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"Playback of a media item has been paused.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"type\": { \"$ref\": \"Notifications.Player.Type\", \"required\": true },"
+ "\"id\": { \"$ref\": \"Library.Id\" }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"Player.OnStop\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"Playback of a media item has been stopped.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"type\": { \"$ref\": \"Notifications.Player.Type\" },"
+ "\"id\": { \"$ref\": \"Library.Id\" }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"Player.OnSeek\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The playback position has been changed.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"time\": { \"type\": \"integer\", \"required\": true },"
+ "\"seekoffset\": { \"type\": \"integer\", \"required\": true }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"AudioLibrary.OnUpdate\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"An audio item has been updated.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"id\": { \"$ref\": \"Library.Id\", \"required\": true },"
+ "\"type\": { \"type\": \"string\", \"id\": \"Notifications.Library.Audio.Type\", \"enum\": [ \"song\" ], \"required\": true }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"AudioLibrary.OnRemove\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"An audio item has been removed.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"id\": { \"$ref\": \"Library.Id\", \"required\": true },"
+ "\"type\": { \"$ref\": \"Notifications.Library.Audio.Type\", \"required\": true }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"VideoLibrary.OnUpdate\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"A video item has been updated.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"id\": { \"$ref\": \"Library.Id\", \"required\": true },"
+ "\"type\": { \"type\": \"string\", \"id\": \"Notifications.Library.Video.Type\", \"enum\": [ \"movie\", \"tvshow\", \"episode\", \"musicvideo\" ], \"required\": true },"
+ "\"playcount\": { \"type\": \"integer\", \"minimum\": 0, \"default\": -1 }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"VideoLibrary.OnRemove\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"A video item has been removed.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"id\": { \"$ref\": \"Library.Id\", \"required\": true },"
+ "\"type\": { \"$ref\": \"Notifications.Library.Video.Type\", \"required\": true }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"System.OnQuit\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"XBMC will be closed.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"null\", \"required\": true }"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"System.OnRestart\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The system will be restarted.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"null\", \"required\": true }"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"System.OnSleep\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The system will be suspended.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"null\", \"required\": true }"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"System.OnWake\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The system woke up from suspension.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"null\", \"required\": true }"
+ "],"
+ "\"returns\": null"
+ "},"
+ "\"System.OnLowBattery\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The system is on low battery.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"null\", \"required\": true }"
+ "],"
+ "\"returns\": null"
+ "}"
+ "}";
}
diff --git a/xbmc/interfaces/json-rpc/ServiceDescription.json b/xbmc/interfaces/json-rpc/ServiceDescription.json
index 8b566b805b..914b9f413d 100644
--- a/xbmc/interfaces/json-rpc/ServiceDescription.json
+++ b/xbmc/interfaces/json-rpc/ServiceDescription.json
@@ -1120,7 +1120,7 @@
"permission": "ReadData",
"params": [
{ "name": "genreid", "id": "Library.Id", "type": "integer", "default": -1, "minimum": 1 },
- { "name": "fields", "type": "array", "uniqueItems": true,
+ { "name": "fields", "type": "array", "id": "Library.Fields.Artist", "uniqueItems": true,
"items": { "type": "string",
"enum": [ "instrument", "style", "mood", "born", "formed",
"description", "genre", "died", "disbanded",
@@ -1136,7 +1136,7 @@
"properties": {
"limits": { "$ref": "List.LimitsReturned", "required": true },
"artists": { "type": "array",
- "items": { "type": "object",
+ "items": { "type": "object", "id": "Audio.ArtistDetails",
"properties": {
"artistid": { "$ref": "Library.Id", "required": true },
"label": { "type": "string", "required": true },
@@ -1160,6 +1160,21 @@
}
}
},
+ "AudioLibrary.GetArtistDetails": {
+ "type": "method",
+ "description": "Retrieve details about a specific artist",
+ "transport": "Response",
+ "permission": "ReadData",
+ "params": [
+ { "name": "artistid", "$ref": "Library.Id", "required": true },
+ { "name": "fields", "$ref": "Library.Fields.Artist" }
+ ],
+ "returns": { "type": "object",
+ "properties": {
+ "artistdetails": { "$ref": "Audio.ArtistDetails" }
+ }
+ }
+ },
"AudioLibrary.GetAlbums": {
"type": "method",
"description": "Retrieve all albums from specified artist or genre",
@@ -1621,7 +1636,7 @@
"transport": "Response",
"permission": "ReadData",
"params": [
- { "name": "tvshowid", "$ref": "Library.Id", "required": true },
+ { "name": "tvshowid", "$ref": "Library.Id" },
{ "name": "season", "type": "integer", "minimum": 0, "default": -1 },
{ "name": "fields", "type": "array", "id": "Library.Fields.Episode", "uniqueItems": true,
"items": { "type": "string",
@@ -1806,6 +1821,33 @@
}
}
},
+ "VideoLibrary.GetGenres": {
+ "type": "method",
+ "description": "Retrieve all genres",
+ "transport": "Response",
+ "permission": "ReadData",
+ "params": [
+ { "name": "type", "type": "string", "required": true, "enum": [ "movie", "tvshow", "musicvideo"] },
+ { "name": "limits", "$ref": "List.Limits" },
+ { "name": "sort", "$ref": "List.Sort" }
+ ],
+ "returns": {
+ "type": "object",
+ "properties": {
+ "limits": { "$ref": "List.LimitsReturned", "required": true },
+ "genres": {"type": "array",
+ "items": { "type": "object",
+ "properties": {
+ "genreid": { "$ref": "Library.Id", "required": true },
+ "genre": { "type": "string", "required": true },
+ "label": { "type": "string", "required": true },
+ "thumbnail": { "type": "string" }
+ }
+ }
+ }
+ }
+ }
+ },
"VideoLibrary.ScanForContent": {
"type": "method",
"description": "Scans the video sources for new library items",
diff --git a/xbmc/interfaces/json-rpc/SystemOperations.cpp b/xbmc/interfaces/json-rpc/SystemOperations.cpp
index 928bd7a16e..5fcf9eca50 100644
--- a/xbmc/interfaces/json-rpc/SystemOperations.cpp
+++ b/xbmc/interfaces/json-rpc/SystemOperations.cpp
@@ -23,10 +23,9 @@
#include "Application.h"
#include "powermanagement/PowerManager.h"
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CSystemOperations::Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CSystemOperations::Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (g_powerManager.CanPowerdown())
{
@@ -37,7 +36,7 @@ JSON_STATUS CSystemOperations::Shutdown(const CStdString &method, ITransportLaye
return FailedToExecute;
}
-JSON_STATUS CSystemOperations::Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CSystemOperations::Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (g_powerManager.CanSuspend())
{
@@ -48,7 +47,7 @@ JSON_STATUS CSystemOperations::Suspend(const CStdString &method, ITransportLayer
return FailedToExecute;
}
-JSON_STATUS CSystemOperations::Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CSystemOperations::Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (g_powerManager.CanHibernate())
{
@@ -59,7 +58,7 @@ JSON_STATUS CSystemOperations::Hibernate(const CStdString &method, ITransportLay
return FailedToExecute;
}
-JSON_STATUS CSystemOperations::Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CSystemOperations::Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
if (g_powerManager.CanReboot())
{
@@ -70,7 +69,7 @@ JSON_STATUS CSystemOperations::Reboot(const CStdString &method, ITransportLayer
return FailedToExecute;
}
-JSON_STATUS CSystemOperations::GetInfoLabels(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CSystemOperations::GetInfoLabels(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
std::vector<CStdString> info;
@@ -96,7 +95,7 @@ JSON_STATUS CSystemOperations::GetInfoLabels(const CStdString &method, ITranspor
return OK;
}
-JSON_STATUS CSystemOperations::GetInfoBooleans(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CSystemOperations::GetInfoBooleans(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
std::vector<CStdString> info;
@@ -130,7 +129,7 @@ JSON_STATUS CSystemOperations::GetInfoBooleans(const CStdString &method, ITransp
{
if (i >= infoLabels.size())
break;
- result[info[i].c_str()] = Value(infoLabels[i]);
+ result[info[i].c_str()] = CVariant(infoLabels[i]);
}
}
diff --git a/xbmc/interfaces/json-rpc/SystemOperations.h b/xbmc/interfaces/json-rpc/SystemOperations.h
index 468e9c904b..47242dd083 100644
--- a/xbmc/interfaces/json-rpc/SystemOperations.h
+++ b/xbmc/interfaces/json-rpc/SystemOperations.h
@@ -28,12 +28,12 @@ namespace JSONRPC
class CSystemOperations
{
public:
- static JSON_STATUS Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Shutdown(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Suspend(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Hibernate(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS Reboot(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetInfoLabels(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetInfoBooleans(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetInfoLabels(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetInfoBooleans(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
};
}
diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.cpp b/xbmc/interfaces/json-rpc/VideoLibrary.cpp
index 80de134e76..509ec4e68a 100644
--- a/xbmc/interfaces/json-rpc/VideoLibrary.cpp
+++ b/xbmc/interfaces/json-rpc/VideoLibrary.cpp
@@ -25,10 +25,9 @@
#include "Util.h"
#include "Application.h"
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CVideoLibrary::GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -43,9 +42,9 @@ JSON_STATUS CVideoLibrary::GetMovies(const CStdString &method, ITransportLayer *
return ret;
}
-JSON_STATUS CVideoLibrary::GetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int id = parameterObject["movieid"].asInt();
+ int id = (int)parameterObject["movieid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -65,7 +64,7 @@ JSON_STATUS CVideoLibrary::GetMovieDetails(const CStdString &method, ITransportL
return OK;
}
-JSON_STATUS CVideoLibrary::GetMovieSets(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetMovieSets(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -79,9 +78,9 @@ JSON_STATUS CVideoLibrary::GetMovieSets(const CStdString &method, ITransportLaye
return OK;
}
-JSON_STATUS CVideoLibrary::GetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int id = parameterObject["setid"].asInt();
+ int id = (int)parameterObject["setid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -110,7 +109,7 @@ JSON_STATUS CVideoLibrary::GetMovieSetDetails(const CStdString &method, ITranspo
return ret;
}
-JSON_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -120,10 +119,9 @@ JSON_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLayer
if (videodatabase.GetTvShowsNav("videodb://", items))
{
bool additionalInfo = false;
- Json::ValueConstIterator it;
- for (it = parameterObject["fields"].begin(); it != parameterObject["fields"].end(); it++)
+ for (CVariant::const_iterator_array itr = parameterObject["fields"].begin_array(); itr != parameterObject["fields"].end_array(); itr++)
{
- CStdString fieldValue = parameterObject["fields"][it.index()].asString();
+ CStdString fieldValue = itr->asString();
if (fieldValue == "cast")
additionalInfo = true;
}
@@ -142,9 +140,9 @@ JSON_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLayer
return OK;
}
-JSON_STATUS CVideoLibrary::GetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int id = parameterObject["tvshowid"].asInt();
+ int id = (int)parameterObject["tvshowid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -164,9 +162,9 @@ JSON_STATUS CVideoLibrary::GetTVShowDetails(const CStdString &method, ITransport
return OK;
}
-JSON_STATUS CVideoLibrary::GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int tvshowID = parameterObject["tvshowid"].asInt();
+ int tvshowID = (int)parameterObject["tvshowid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -180,10 +178,10 @@ JSON_STATUS CVideoLibrary::GetSeasons(const CStdString &method, ITransportLayer
return OK;
}
-JSON_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int tvshowID = parameterObject["tvshowid"].asInt();
- int season = parameterObject["season"].asInt();
+ int tvshowID = (int)parameterObject["tvshowid"].asInteger();
+ int season = (int)parameterObject["season"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -193,10 +191,9 @@ JSON_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLayer
if (videodatabase.GetEpisodesNav("videodb://", items, -1, -1, -1, -1, tvshowID, season))
{
bool additionalInfo = false;
- Json::ValueConstIterator it;
- for (it = parameterObject["fields"].begin(); it != parameterObject["fields"].end(); it++)
+ for (CVariant::const_iterator_array itr = parameterObject["fields"].begin_array(); itr != parameterObject["fields"].end_array(); itr++)
{
- CStdString fieldValue = parameterObject["fields"][it.index()].asString();
+ CStdString fieldValue = itr->asString();
if (fieldValue == "cast")
additionalInfo = true;
}
@@ -215,9 +212,9 @@ JSON_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLayer
return OK;
}
-JSON_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int id = parameterObject["episodeid"].asInt();
+ int id = (int)parameterObject["episodeid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -237,10 +234,10 @@ JSON_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITranspor
return OK;
}
-JSON_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int artistID = parameterObject["artistid"].asInt();
- int albumID = parameterObject["albumid"].asInt();
+ int artistID = (int)parameterObject["artistid"].asInteger();
+ int albumID = (int)parameterObject["albumid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -254,9 +251,9 @@ JSON_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITransportLa
return OK;
}
-JSON_STATUS CVideoLibrary::GetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- int id = parameterObject["musicvideoid"].asInt();
+ int id = (int)parameterObject["musicvideoid"].asInteger();
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -276,7 +273,7 @@ JSON_STATUS CVideoLibrary::GetMusicVideoDetails(const CStdString &method, ITrans
return OK;
}
-JSON_STATUS CVideoLibrary::GetRecentlyAddedMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetRecentlyAddedMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -286,10 +283,9 @@ JSON_STATUS CVideoLibrary::GetRecentlyAddedMovies(const CStdString &method, ITra
if (videodatabase.GetRecentlyAddedMoviesNav("videodb://", items))
{
bool additionalInfo = false;
- Json::ValueConstIterator it;
- for (it = parameterObject["fields"].begin(); it != parameterObject["fields"].end(); it++)
+ for (CVariant::const_iterator_array itr = parameterObject["fields"].begin_array(); itr != parameterObject["fields"].end_array(); itr++)
{
- CStdString fieldValue = parameterObject["fields"][it.index()].asString();
+ CStdString fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "showlink")
additionalInfo = true;
}
@@ -308,7 +304,7 @@ JSON_STATUS CVideoLibrary::GetRecentlyAddedMovies(const CStdString &method, ITra
return OK;
}
-JSON_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -318,10 +314,9 @@ JSON_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const CStdString &method, IT
if (videodatabase.GetRecentlyAddedEpisodesNav("videodb://", items))
{
bool additionalInfo = false;
- Json::ValueConstIterator it;
- for (it = parameterObject["fields"].begin(); it != parameterObject["fields"].end(); it++)
+ for (CVariant::const_iterator_array itr = parameterObject["fields"].begin_array(); itr != parameterObject["fields"].end_array(); itr++)
{
- CStdString fieldValue = parameterObject["fields"][it.index()].asString();
+ CStdString fieldValue = itr->asString();
if (fieldValue == "cast")
additionalInfo = true;
}
@@ -340,7 +335,7 @@ JSON_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const CStdString &method, IT
return OK;
}
-JSON_STATUS CVideoLibrary::GetRecentlyAddedMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetRecentlyAddedMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
@@ -354,7 +349,45 @@ JSON_STATUS CVideoLibrary::GetRecentlyAddedMusicVideos(const CStdString &method,
return OK;
}
-JSON_STATUS CVideoLibrary::ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CVideoLibrary::GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
+{
+ CVariant param = parameterObject;
+ if (!param.isMember("fields"))
+ param["fields"] = CVariant(CVariant::VariantTypeArray);
+ param["fields"].append("genre");
+ param["fields"].append("thumbnail");
+
+ CStdString media = parameterObject["type"].asString();
+ media = media.ToLower();
+ int idContent;
+
+ /* select which video content to get genres from*/
+ if (media.Equals("movie"))
+ idContent = VIDEODB_CONTENT_MOVIES;
+ else if (media.Equals("tvshow"))
+ idContent = VIDEODB_CONTENT_TVSHOWS;
+ else if (media.Equals("musicvideo"))
+ idContent = VIDEODB_CONTENT_MUSICVIDEOS;
+
+ CVideoDatabase videodatabase;
+ if (!videodatabase.Open())
+ return InternalError;
+
+ CFileItemList items;
+ if (videodatabase.GetGenresNav("", items, idContent))
+ {
+ /* need to set strGenre in each item*/
+ for (unsigned int i = 0; i < (unsigned int)items.Size(); i++)
+ items[i]->GetVideoInfoTag()->m_strGenre = items[i]->GetLabel();
+
+ HandleFileItemList("genreid", false, "genres", items, param, result);
+ }
+
+ videodatabase.Close();
+ return OK;
+}
+
+JSON_STATUS CVideoLibrary::ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().ExecBuiltIn("updatelibrary(video)");
return ACK;
@@ -379,15 +412,15 @@ bool CVideoLibrary::FillFileItem(const CStdString &strFilename, CFileItem &item)
return status;
}
-bool CVideoLibrary::FillFileItemList(const Value &parameterObject, CFileItemList &list)
+bool CVideoLibrary::FillFileItemList(const CVariant &parameterObject, CFileItemList &list)
{
CVideoDatabase videodatabase;
if (videodatabase.Open())
{
CStdString file = parameterObject["file"].asString();
- int movieID = parameterObject["movieid"].asInt();
- int episodeID = parameterObject["episodeid"].asInt();
- int musicVideoID = parameterObject["musicvideoid"].asInt();
+ int movieID = (int)parameterObject["movieid"].asInteger();
+ int episodeID = (int)parameterObject["episodeid"].asInteger();
+ int musicVideoID = (int)parameterObject["musicvideoid"].asInteger();
bool success = false;
CFileItem fileItem;
@@ -434,17 +467,16 @@ bool CVideoLibrary::FillFileItemList(const Value &parameterObject, CFileItemList
return false;
}
-JSON_STATUS CVideoLibrary::GetAdditionalMovieDetails(const Value &parameterObject, CFileItemList &items, Value &result)
+JSON_STATUS CVideoLibrary::GetAdditionalMovieDetails(const CVariant &parameterObject, CFileItemList &items, CVariant &result)
{
CVideoDatabase videodatabase;
if (!videodatabase.Open())
return InternalError;
bool additionalInfo = false;
- Json::ValueConstIterator it;
- for (it = parameterObject["fields"].begin(); it != parameterObject["fields"].end(); it++)
+ for (CVariant::const_iterator_array itr = parameterObject["fields"].begin_array(); itr != parameterObject["fields"].end_array(); itr++)
{
- CStdString fieldValue = parameterObject["fields"][it.index()].asString();
+ CStdString fieldValue = itr->asString();
if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "showlink")
additionalInfo = true;
}
diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.h b/xbmc/interfaces/json-rpc/VideoLibrary.h
index eafdfd5e8e..bd1e971ded 100644
--- a/xbmc/interfaces/json-rpc/VideoLibrary.h
+++ b/xbmc/interfaces/json-rpc/VideoLibrary.h
@@ -29,31 +29,32 @@ namespace JSONRPC
class CVideoLibrary : public CFileItemHandler
{
public:
- static JSON_STATUS GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetMovieDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetMovieSets(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetMovieSets(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetMovieSetDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetTVShows(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetTVShowDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetSeasons(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetEpisodeDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetMusicVideoDetails(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetRecentlyAddedMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetRecentlyAddedEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS GetRecentlyAddedMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+
+ static JSON_STATUS GetGenres(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS GetRecentlyAddedMovies(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetRecentlyAddedEpisodes(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS GetRecentlyAddedMusicVideos(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
-
- static JSON_STATUS ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS ScanForContent(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
static bool FillFileItem(const CStdString &strFilename, CFileItem &item);
- static bool FillFileItemList(const Json::Value &parameterObject, CFileItemList &list);
+ static bool FillFileItemList(const CVariant &parameterObject, CFileItemList &list);
private:
- static JSON_STATUS GetAdditionalMovieDetails(const Json::Value &parameterObject, CFileItemList &items, Json::Value &result);
+ static JSON_STATUS GetAdditionalMovieDetails(const CVariant &parameterObject, CFileItemList &items, CVariant &result);
};
}
diff --git a/xbmc/interfaces/json-rpc/XBMCOperations.cpp b/xbmc/interfaces/json-rpc/XBMCOperations.cpp
index cd0351d404..02a07dd25f 100644
--- a/xbmc/interfaces/json-rpc/XBMCOperations.cpp
+++ b/xbmc/interfaces/json-rpc/XBMCOperations.cpp
@@ -26,29 +26,28 @@
#include "Util.h"
#include "utils/log.h"
-using namespace Json;
using namespace JSONRPC;
-JSON_STATUS CXBMCOperations::GetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::GetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- Value val = g_application.GetVolume();
+ CVariant val = g_application.GetVolume();
result.swap(val);
return OK;
}
-JSON_STATUS CXBMCOperations::SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
- g_application.SetVolume(parameterObject["value"].asInt());
+ g_application.SetVolume((int)parameterObject["value"].asInteger());
return GetVolume(method, transport, client, parameterObject, result);
}
-JSON_STATUS CXBMCOperations::ToggleMute(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::ToggleMute(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().SendAction(CAction(ACTION_MUTE));
return GetVolume(method, transport, client, parameterObject, result);
}
-JSON_STATUS CXBMCOperations::Play(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::Play(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CFileItemList list;
if (FillFileItemList(parameterObject, list) && list.Size() > 0)
@@ -60,18 +59,18 @@ JSON_STATUS CXBMCOperations::Play(const CStdString &method, ITransportLayer *tra
return InvalidParams;
}
-JSON_STATUS CXBMCOperations::StartSlideshow(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::StartSlideshow(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CStdString exec = "slideShow(";
exec += parameterObject["directory"].asString();
- if (parameterObject["random"].asBool())
+ if (parameterObject["random"].asBoolean())
exec += ", random";
else
exec += ", notrandom";
- if (parameterObject["recursive"].asBool())
+ if (parameterObject["recursive"].asBoolean())
exec += ", recursive";
exec += ")";
@@ -81,7 +80,7 @@ JSON_STATUS CXBMCOperations::StartSlideshow(const CStdString &method, ITransport
return ACK;
}
-JSON_STATUS CXBMCOperations::Log(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::Log(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
CStdString message = parameterObject["message"].asString();
if (message.IsEmpty())
@@ -95,7 +94,7 @@ JSON_STATUS CXBMCOperations::Log(const CStdString &method, ITransportLayer *tran
return ACK;
}
-JSON_STATUS CXBMCOperations::Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const Value &parameterObject, Value &result)
+JSON_STATUS CXBMCOperations::Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
g_application.getApplicationMessenger().Quit();
return ACK;
diff --git a/xbmc/interfaces/json-rpc/XBMCOperations.h b/xbmc/interfaces/json-rpc/XBMCOperations.h
index 347007e710..f22a2d3d51 100644
--- a/xbmc/interfaces/json-rpc/XBMCOperations.h
+++ b/xbmc/interfaces/json-rpc/XBMCOperations.h
@@ -29,16 +29,16 @@ namespace JSONRPC
class CXBMCOperations : CFileItemHandler
{
public:
- static JSON_STATUS GetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS ToggleMute(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS GetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS SetVolume(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS ToggleMute(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Play(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
- static JSON_STATUS StartSlideshow(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Play(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
+ static JSON_STATUS StartSlideshow(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Log(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Log(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
- static JSON_STATUS Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const Json::Value &parameterObject, Json::Value &result);
+ static JSON_STATUS Quit(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result);
private:
inline static int ParseLogLevel(const char *level);
};
diff --git a/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp b/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp
index b1935043f7..327b708f98 100644
--- a/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp
+++ b/xbmc/interfaces/python/xbmcmodule/PythonAddon.cpp
@@ -40,7 +40,8 @@ namespace PYXBMC
// Extract a reference to the function "func_name"
// from the global dictionary
PyObject* pyid = PyDict_GetItemString(global_dict, "__xbmcaddonid__");
- id = PyString_AsString(pyid);
+ if(pyid)
+ id = PyString_AsString(pyid);
return id;
}
diff --git a/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h b/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h
index ec89f7d951..c7d4efdcfa 100644
--- a/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h
+++ b/xbmc/interfaces/python/xbmcmodule/pyjsonrpc.h
@@ -27,7 +27,7 @@
class CPythonTransport : public JSONRPC::ITransportLayer
{
public:
- virtual bool Download(const char *path, Json::Value *result) { return false; }
+ virtual bool Download(const char *path, CVariant &result) { return false; }
virtual int GetCapabilities() { return JSONRPC::Response; }
class CPythonClient : public JSONRPC::IClient
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index 4cb5ce8a3b..1ac5b2ac8d 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -4756,15 +4756,15 @@ int CMusicDatabase::GetVariousArtistsAlbumsCount()
void CMusicDatabase::AnnounceRemove(std::string content, int id)
{
CVariant data;
- data["content"] = content;
- data[content + "id"] = id;
- ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "RemoveAudio", data);
+ data["type"] = content;
+ data["id"] = id;
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "OnRemove", data);
}
void CMusicDatabase::AnnounceUpdate(std::string content, int id)
{
CVariant data;
- data["content"] = content;
- data[content + "id"] = id;
- ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "UpdateAudio", data);
+ data["type"] = content;
+ data["id"] = id;
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "OnUpdate", data);
}
diff --git a/xbmc/music/tags/MusicInfoTagLoaderWavPack.cpp b/xbmc/music/tags/MusicInfoTagLoaderWavPack.cpp
index 5726e936e4..0b91413d80 100644
--- a/xbmc/music/tags/MusicInfoTagLoaderWavPack.cpp
+++ b/xbmc/music/tags/MusicInfoTagLoaderWavPack.cpp
@@ -20,7 +20,7 @@
*/
#include "MusicInfoTagLoaderWavPack.h"
-#include "cores/paplayer/WAVPackcodec.h"
+#include "cores/paplayer/DVDPlayerCodec.h"
using namespace MUSIC_INFO;
@@ -33,7 +33,7 @@ CMusicInfoTagLoaderWAVPack::~CMusicInfoTagLoaderWAVPack()
int CMusicInfoTagLoaderWAVPack::ReadDuration(const CStdString& strFileName)
{
- WAVPackCodec codec;
+ DVDPlayerCodec codec;
if (codec.Init(strFileName, 4096))
{
return (int)((codec.m_TotalTime + 500) / 1000);
diff --git a/xbmc/network/TCPServer.cpp b/xbmc/network/TCPServer.cpp
index eb3e0ea0b4..fdb0894624 100644
--- a/xbmc/network/TCPServer.cpp
+++ b/xbmc/network/TCPServer.cpp
@@ -32,7 +32,6 @@ static const bdaddr_t bt_bdaddr_local = {{0, 0, 0, 0xff, 0xff, 0xff}};
using namespace JSONRPC;
using namespace ANNOUNCEMENT;
//using namespace std; On VS2010, bind conflicts with std::bind
-using namespace Json;
#define RECEIVEBUFFER 1024
@@ -150,7 +149,7 @@ void CTCPServer::Process()
Deinitialize();
}
-bool CTCPServer::Download(const char *path, Json::Value *result)
+bool CTCPServer::Download(const char *path, CVariant &result)
{
return false;
}
diff --git a/xbmc/network/TCPServer.h b/xbmc/network/TCPServer.h
index d58157767c..500b4bc17c 100644
--- a/xbmc/network/TCPServer.h
+++ b/xbmc/network/TCPServer.h
@@ -7,7 +7,6 @@
#include "threads/CriticalSection.h"
#include "interfaces/json-rpc/JSONUtils.h"
-class CVariant;
namespace JSONRPC
{
class CTCPServer : public ITransportLayer, public ANNOUNCEMENT::IAnnouncer, public CThread, protected CJSONUtils
@@ -16,7 +15,7 @@ namespace JSONRPC
static bool StartServer(int port, bool nonlocal);
static void StopServer(bool bWait);
- virtual bool Download(const char *path, Json::Value *result);
+ virtual bool Download(const char *path, CVariant &result);
virtual int GetCapabilities();
virtual void Announce(ANNOUNCEMENT::EAnnouncementFlag flag, const char *sender, const char *message, const CVariant &data);
diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp
index 48548d0b2a..db759c562b 100644
--- a/xbmc/network/WebServer.cpp
+++ b/xbmc/network/WebServer.cpp
@@ -28,6 +28,7 @@
#include "URL.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
+#include "utils/Variant.h"
#include "threads/SingleLock.h"
#include "XBDateTime.h"
#include "addons/AddonManager.h"
@@ -515,7 +516,7 @@ void CWebServer::SetCredentials(const CStdString &username, const CStdString &pa
m_needcredentials = !password.IsEmpty();
}
-bool CWebServer::Download(const char *path, Json::Value *result)
+bool CWebServer::Download(const char *path, CVariant &result)
{
bool exists = false;
CFile *file = new CFile();
@@ -531,7 +532,7 @@ bool CWebServer::Download(const char *path, Json::Value *result)
{
string str = "vfs/";
str += path;
- (*result)["path"] = str;
+ result["path"] = str;
}
return exists;
diff --git a/xbmc/network/WebServer.h b/xbmc/network/WebServer.h
index 4afe25e781..98805b2a78 100644
--- a/xbmc/network/WebServer.h
+++ b/xbmc/network/WebServer.h
@@ -47,7 +47,7 @@ public:
bool Stop();
bool IsStarted();
void SetCredentials(const CStdString &username, const CStdString &password);
- virtual bool Download(const char *path, Json::Value *result);
+ virtual bool Download(const char *path, CVariant &result);
virtual int GetCapabilities();
private:
enum HTTPMethod
diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp
index a50d0b6dc0..ac265855e9 100644
--- a/xbmc/powermanagement/PowerManager.cpp
+++ b/xbmc/powermanagement/PowerManager.cpp
@@ -129,41 +129,24 @@ void CPowerManager::SetDefaults()
bool CPowerManager::Powerdown()
{
-
- bool success = CanPowerdown() ? m_instance->Powerdown() : false;
- if (success)
- CAnnouncementManager::Announce(System, "xbmc", "Shutdown");
-
- return success;
+ return CanPowerdown() ? m_instance->Powerdown() : false;
}
+
bool CPowerManager::Suspend()
{
- bool success = false;
- if (CanSuspend())
- success = m_instance->Suspend();
-
- if (success)
- CAnnouncementManager::Announce(System, "xbmc", "Suspend");
-
- return success;
+ return CanSuspend() ? m_instance->Suspend() : false;
}
+
bool CPowerManager::Hibernate()
{
- bool success = false;
- if (CanHibernate())
- success = m_instance->Hibernate();
-
- if (success)
- CAnnouncementManager::Announce(System, "xbmc", "Hibernate");
-
- return success;
+ return CanHibernate() ? m_instance->Hibernate() : false;
}
bool CPowerManager::Reboot()
{
bool success = CanReboot() ? m_instance->Reboot() : false;
if (success)
- CAnnouncementManager::Announce(System, "xbmc", "Reboot");
+ CAnnouncementManager::Announce(System, "xbmc", "OnRestart");
return success;
}
@@ -192,7 +175,7 @@ void CPowerManager::ProcessEvents()
void CPowerManager::OnSleep()
{
- CAnnouncementManager::Announce(System, "xbmc", "Sleep");
+ CAnnouncementManager::Announce(System, "xbmc", "OnSleep");
CLog::Log(LOGNOTICE, "%s: Running sleep jobs", __FUNCTION__);
#ifdef HAS_LCD
@@ -207,6 +190,7 @@ void CPowerManager::OnSleep()
g_application.StopPlaying();
g_application.StopShutdownTimer();
+ g_application.StopScreenSaverTimer();
}
void CPowerManager::OnWake()
@@ -249,7 +233,7 @@ void CPowerManager::OnWake()
g_application.UpdateLibraries();
g_weatherManager.Refresh();
- CAnnouncementManager::Announce(System, "xbmc", "Wake");
+ CAnnouncementManager::Announce(System, "xbmc", "OnWake");
}
void CPowerManager::OnLowBattery()
@@ -258,5 +242,5 @@ void CPowerManager::OnLowBattery()
g_application.m_guiDialogKaiToast.QueueNotification(CGUIDialogKaiToast::Warning, g_localizeStrings.Get(13050), "");
- CAnnouncementManager::Announce(System, "xbmc", "LowBattery");
+ CAnnouncementManager::Announce(System, "xbmc", "OnLowBattery");
}
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 8d3acbaecb..b888bcb2c3 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -133,7 +133,7 @@ void CAdvancedSettings::Initialize()
m_videoCleanDateTimeRegExp = "(.*[^ _\\,\\.\\(\\)\\[\\]\\-])[ _\\.\\(\\)\\[\\]\\-]+(19[0-9][0-9]|20[0-1][0-9])([ _\\,\\.\\(\\)\\[\\]\\-]|[^0-9]$)";
- m_videoCleanStringRegExps.push_back("[ _\\,\\.\\(\\)\\[\\]\\-](ac3|dts|custom|dc|remastered|divx|divx5|dsr|dsrip|dutch|dvd|dvd5|dvd9|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|r3|r5|bd5|se|svcd|swedish|german|read.nfo|nfofix|unrated|extended|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|hrhd|hrhdtv|hddvd|bluray|x264|h264|xvid|xvidvd|xxx|www.www|cd[1-9]|\\[.*\\])([ _\\,\\.\\(\\)\\[\\]\\-]|$)");
+ m_videoCleanStringRegExps.push_back("[ _\\,\\.\\(\\)\\[\\]\\-](ac3|dts|custom|dc|remastered|divx|divx5|dsr|dsrip|dutch|dvd|dvd5|dvd9|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|r3|r5|bd5|se|svcd|swedish|german|read.nfo|nfofix|unrated|extended|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|3d|hrhd|hrhdtv|hddvd|bluray|x264|h264|xvid|xvidvd|xxx|www.www|cd[1-9]|\\[.*\\])([ _\\,\\.\\(\\)\\[\\]\\-]|$)");
m_videoCleanStringRegExps.push_back("(\\[.*\\])");
m_moviesExcludeFromScanRegExps.push_back("-trailer");
diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp
index 1dd762ad3c..c7f68366cf 100644
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -821,8 +821,7 @@ void CGUIWindowSettingsCategory::UpdateSettings()
g_guiSettings.GetString("audiooutput.audiodevice").find("wasapi:") == CStdString::npos);
}
#ifdef HAS_WEB_SERVER
- else if (strSetting.Equals("services.webserverport") ||
- strSetting.Equals("services.webserverusername") ||
+ else if (strSetting.Equals("services.webserverusername") ||
strSetting.Equals("services.webserverpassword"))
{
CGUIEditControl *pControl = (CGUIEditControl *)GetControl(pSettingControl->GetID());
diff --git a/xbmc/utils/JSONVariantParser.cpp b/xbmc/utils/JSONVariantParser.cpp
new file mode 100644
index 0000000000..0484d73efa
--- /dev/null
+++ b/xbmc/utils/JSONVariantParser.cpp
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2005-2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "JSONVariantParser.h"
+
+yajl_callbacks CJSONVariantParser::callbacks = {
+ CJSONVariantParser::ParseNull,
+ CJSONVariantParser::ParseBoolean,
+ CJSONVariantParser::ParseInteger,
+ CJSONVariantParser::ParseDouble,
+ NULL,
+ CJSONVariantParser::ParseString,
+ CJSONVariantParser::ParseMapStart,
+ CJSONVariantParser::ParseMapKey,
+ CJSONVariantParser::ParseMapEnd,
+ CJSONVariantParser::ParseArrayStart,
+ CJSONVariantParser::ParseArrayEnd
+};
+
+CJSONVariantParser::CJSONVariantParser(IParseCallback *callback)
+{
+ m_callback = callback;
+
+ yajl_parser_config cfg = { 1, 1 };
+
+ m_handler = yajl_alloc(&callbacks, &cfg, NULL, this);
+
+ m_status = ParseVariable;
+}
+
+CJSONVariantParser::~CJSONVariantParser()
+{
+ yajl_parse_complete(m_handler);
+}
+
+void CJSONVariantParser::push_buffer(const unsigned char *buffer, unsigned int length)
+{
+ yajl_parse(m_handler, buffer, length);
+}
+
+CVariant CJSONVariantParser::Parse(const unsigned char *json, unsigned int length)
+{
+ CSimpleParseCallback callback;
+ CJSONVariantParser parser(&callback);
+
+ parser.push_buffer(json, length);
+
+ return callback.GetOutput();
+}
+
+int CJSONVariantParser::ParseNull(void * ctx)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant::VariantTypeNull);
+ parser->PopObject();
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseBoolean(void * ctx, int boolean)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant(boolean != 0));
+ parser->PopObject();
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseInteger(void * ctx, long integerVal)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant((int64_t)integerVal));
+ parser->PopObject();
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseDouble(void * ctx, double doubleVal)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant((float)doubleVal));
+ parser->PopObject();
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseString(void * ctx, const unsigned char * stringVal, unsigned int stringLen)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant((const char *)stringVal, stringLen));
+ parser->PopObject();
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseMapStart(void * ctx)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant::VariantTypeObject);
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseMapKey(void * ctx, const unsigned char * stringVal, unsigned int stringLen)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->m_key = std::string((const char *)stringVal, 0, stringLen);
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseMapEnd(void * ctx)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PopObject();
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseArrayStart(void * ctx)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PushObject(CVariant::VariantTypeArray);
+
+ return 1;
+}
+
+int CJSONVariantParser::ParseArrayEnd(void * ctx)
+{
+ CJSONVariantParser *parser = (CJSONVariantParser *)ctx;
+
+ parser->PopObject();
+
+ return 1;
+}
+
+void CJSONVariantParser::PushObject(CVariant variant)
+{
+ if (m_status == ParseObject)
+ {
+ (*m_parse[m_parse.size() - 1])[m_key] = variant;
+ m_parse.push_back(&(*m_parse[m_parse.size() - 1])[m_key]);
+ }
+ else if (m_status == ParseArray)
+ {
+ CVariant *temp = m_parse[m_parse.size() - 1];
+ temp->push_back(variant);
+ m_parse.push_back(&(*temp)[temp->size() - 1]);
+ }
+ else if (m_parse.size() == 0)
+ {
+ m_parse.push_back(new CVariant(variant));
+ }
+
+ if (variant.isObject())
+ m_status = ParseObject;
+ else if (variant.isArray())
+ m_status = ParseArray;
+ else
+ m_status = ParseVariable;
+}
+
+void CJSONVariantParser::PopObject()
+{
+ CVariant *variant = m_parse[m_parse.size() - 1];
+ m_parse.pop_back();
+
+ if (m_parse.size())
+ {
+ variant = m_parse[m_parse.size() - 1];
+ if (variant->isObject())
+ m_status = ParseObject;
+ else if (variant->isArray())
+ m_status = ParseArray;
+ else
+ m_status = ParseVariable;
+ }
+ else if (m_callback)
+ {
+ m_callback->onParsed(variant);
+ delete variant;
+
+ m_parse.clear();
+ m_status = ParseVariable;
+ }
+}
diff --git a/xbmc/utils/JSONVariantParser.h b/xbmc/utils/JSONVariantParser.h
new file mode 100644
index 0000000000..f0a72dbdc1
--- /dev/null
+++ b/xbmc/utils/JSONVariantParser.h
@@ -0,0 +1,87 @@
+#pragma once
+/*
+ * Copyright (C) 2005-2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include <yajl/yajl_parse.h>
+#include <yajl/yajl_gen.h>
+
+#include "Variant.h"
+
+class IParseCallback
+{
+public:
+ virtual ~IParseCallback() { }
+
+ virtual void onParsed(CVariant *variant) = 0;
+};
+
+class CSimpleParseCallback : public IParseCallback
+{
+public:
+ virtual void onParsed(CVariant *variant) { m_parsed = *variant; }
+ CVariant &GetOutput() { return m_parsed; }
+
+private:
+ CVariant m_parsed;
+};
+
+class CJSONVariantParser
+{
+public:
+ CJSONVariantParser(IParseCallback *callback);
+ ~CJSONVariantParser();
+
+ void push_buffer(const unsigned char *buffer, unsigned int length);
+
+ static CVariant Parse(const unsigned char *json, unsigned int length);
+
+private:
+ static int ParseNull(void * ctx);
+ static int ParseBoolean(void * ctx, int boolean);
+ static int ParseInteger(void * ctx, long integerVal);
+ static int ParseDouble(void * ctx, double doubleVal);
+ static int ParseString(void * ctx, const unsigned char * stringVal, unsigned int stringLen);
+ static int ParseMapStart(void * ctx);
+ static int ParseMapKey(void * ctx, const unsigned char * stringVal, unsigned int stringLen);
+ static int ParseMapEnd(void * ctx);
+ static int ParseArrayStart(void * ctx);
+ static int ParseArrayEnd(void * ctx);
+
+ void PushObject(CVariant variant);
+ void PopObject();
+
+ static yajl_callbacks callbacks;
+
+ IParseCallback *m_callback;
+ yajl_handle m_handler;
+
+ CVariant m_parsedObject;
+ std::vector<CVariant *> m_parse;
+ std::string m_key;
+
+ enum PARSE_STATUS
+ {
+ ParseArray = 1,
+ ParseObject = 2,
+ ParseVariable = 0
+ };
+ PARSE_STATUS m_status;
+};
diff --git a/xbmc/utils/JSONVariantWriter.cpp b/xbmc/utils/JSONVariantWriter.cpp
new file mode 100644
index 0000000000..fb02dfcffe
--- /dev/null
+++ b/xbmc/utils/JSONVariantWriter.cpp
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2005-2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "JSONVariantWriter.h"
+
+using namespace std;
+
+string CJSONVariantWriter::Write(const CVariant &value, bool compact)
+{
+ string output;
+
+ yajl_gen_config conf = { compact ? 0 : 1, "\t" };
+ yajl_gen g = yajl_gen_alloc(&conf, NULL);
+
+ if (InternalWrite(g, value))
+ {
+ const unsigned char * buffer;
+ unsigned int length;
+
+ yajl_gen_get_buf(g, &buffer, &length);
+ output = string((const char *)buffer, length);
+ }
+
+ yajl_gen_clear(g);
+
+ return output;
+}
+
+bool CJSONVariantWriter::InternalWrite(yajl_gen g, const CVariant &value)
+{
+ bool success = false;
+
+ switch (value.type())
+ {
+ case CVariant::VariantTypeInteger:
+ success = yajl_gen_status_ok == yajl_gen_integer(g, (long int)value.asInteger());
+ break;
+ case CVariant::VariantTypeUnsignedInteger:
+ success = yajl_gen_status_ok == yajl_gen_integer(g, (long int)value.asUnsignedInteger());
+ break;
+ case CVariant::VariantTypeDouble:
+ success = yajl_gen_status_ok == yajl_gen_double(g, value.asDouble());
+ break;
+ case CVariant::VariantTypeBoolean:
+ success = yajl_gen_status_ok == yajl_gen_bool(g, value.asBoolean() ? 1 : 0);
+ break;
+ case CVariant::VariantTypeString:
+ success = yajl_gen_status_ok == yajl_gen_string(g, (const unsigned char*)value.c_str(), value.size());
+ break;
+ case CVariant::VariantTypeArray:
+ success = yajl_gen_status_ok == yajl_gen_array_open(g);
+
+ for (CVariant::const_iterator_array itr = value.begin_array(); itr != value.end_array() && success; itr++)
+ success &= InternalWrite(g, *itr);
+
+ if (success)
+ success = yajl_gen_status_ok == yajl_gen_array_close(g);
+
+ break;
+ case CVariant::VariantTypeObject:
+ success = yajl_gen_status_ok == yajl_gen_map_open(g);
+
+ for (CVariant::const_iterator_map itr = value.begin_map(); itr != value.end_map() && success; itr++)
+ {
+ success &= yajl_gen_status_ok == yajl_gen_string(g, (const unsigned char*)itr->first.c_str(), itr->first.length());
+ if (success)
+ success &= InternalWrite(g, itr->second);
+ }
+
+ if (success)
+ success &= yajl_gen_status_ok == yajl_gen_map_close(g);
+
+ break;
+ case CVariant::VariantTypeConstNull:
+ case CVariant::VariantTypeNull:
+ default:
+ success = yajl_gen_status_ok == yajl_gen_null(g);
+ break;
+ }
+
+ return success;
+}
diff --git a/xbmc/utils/JSONVariantWriter.h b/xbmc/utils/JSONVariantWriter.h
new file mode 100644
index 0000000000..3f3c304e07
--- /dev/null
+++ b/xbmc/utils/JSONVariantWriter.h
@@ -0,0 +1,32 @@
+#pragma once
+/*
+ * Copyright (C) 2005-2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "Variant.h"
+#include <yajl/yajl_gen.h>
+
+class CJSONVariantWriter
+{
+public:
+ static std::string Write(const CVariant &value, bool compact);
+private:
+ static bool InternalWrite(yajl_gen g, const CVariant &value);
+};
diff --git a/xbmc/utils/Makefile b/xbmc/utils/Makefile
index 8258231eec..2eb81d555b 100644
--- a/xbmc/utils/Makefile
+++ b/xbmc/utils/Makefile
@@ -22,6 +22,8 @@ SRCS=AlarmClock.cpp \
HttpHeader.cpp \
InfoLoader.cpp \
JobManager.cpp \
+ JSONVariantParser.cpp \
+ JSONVariantWriter.cpp \
LabelFormatter.cpp \
LangCodeExpander.cpp \
LCD.cpp \
diff --git a/xbmc/utils/PCMRemap.cpp b/xbmc/utils/PCMRemap.cpp
index 6d3d3cb38c..9e692c09e6 100644
--- a/xbmc/utils/PCMRemap.cpp
+++ b/xbmc/utils/PCMRemap.cpp
@@ -447,7 +447,14 @@ enum PCMChannels *CPCMRemap::SetInputFormat(unsigned int channels, enum PCMChann
m_channelLayout = (enum PCMLayout)g_guiSettings.GetInt("audiooutput.channellayout");
if (m_channelLayout >= PCM_MAX_LAYOUT) m_channelLayout = PCM_LAYOUT_2_0;
- CLog::Log(LOGINFO, "CPCMRemap: Configured speaker layout: %s\n", PCMLayoutStr(m_channelLayout).c_str());
+ //spdif only has 2 pcm channels, so don't try to use more
+ if (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_IEC958)
+ {
+ CLog::Log(LOGINFO, "CPCMRemap: Configured speaker layout: %s (iec958)\n", PCMLayoutStr(m_channelLayout).c_str());
+ m_channelLayout = PCM_LAYOUT_2_0;
+ }
+ else
+ CLog::Log(LOGINFO, "CPCMRemap: Configured speaker layout: %s\n", PCMLayoutStr(m_channelLayout).c_str());
DumpMap("I", channels, channelMap);
diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp
index d85b4e7526..f98bcd4785 100644
--- a/xbmc/utils/StringUtils.cpp
+++ b/xbmc/utils/StringUtils.cpp
@@ -247,6 +247,8 @@ CStdString StringUtils::SecondsToTimeString(long lSeconds, TIME_FORMAT format)
CStdString strHMS;
if (format & TIME_FORMAT_HH)
strHMS.AppendFormat("%02.2i", hh);
+ else if (format & TIME_FORMAT_H)
+ strHMS.AppendFormat("%i", hh);
if (format & TIME_FORMAT_MM)
strHMS.AppendFormat(strHMS.IsEmpty() ? "%02.2i" : ":%02.2i", mm);
if (format & TIME_FORMAT_SS)
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
index 33e28fa641..7de0d227f8 100644
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -646,6 +646,11 @@ bool URIUtils::IsHDHomeRun(const CStdString& strFile)
return strFile.Left(10).Equals("hdhomerun:");
}
+bool URIUtils::IsSlingbox(const CStdString& strFile)
+{
+ return strFile.Left(6).Equals("sling:");
+}
+
bool URIUtils::IsVTP(const CStdString& strFile)
{
return strFile.Left(4).Equals("vtp:");
@@ -661,6 +666,7 @@ bool URIUtils::IsLiveTV(const CStdString& strFile)
if(IsTuxBox(strFile)
|| IsVTP(strFile)
|| IsHDHomeRun(strFile)
+ || IsSlingbox(strFile)
|| IsHTSP(strFile)
|| strFile.Left(4).Equals("sap:"))
return true;
diff --git a/xbmc/utils/URIUtils.h b/xbmc/utils/URIUtils.h
index 300b144aba..e53da2cab1 100644
--- a/xbmc/utils/URIUtils.h
+++ b/xbmc/utils/URIUtils.h
@@ -56,6 +56,7 @@ public:
static bool IsFTP(const CStdString& strFile);
static bool IsHD(const CStdString& strFileName);
static bool IsHDHomeRun(const CStdString& strFile);
+ static bool IsSlingbox(const CStdString& strFile);
static bool IsHTSP(const CStdString& strFile);
static bool IsInArchive(const CStdString& strFile);
static bool IsInRAR(const CStdString& strFile);
diff --git a/xbmc/utils/Variant.cpp b/xbmc/utils/Variant.cpp
index 4cf3176b71..110e14c17d 100644
--- a/xbmc/utils/Variant.cpp
+++ b/xbmc/utils/Variant.cpp
@@ -19,9 +19,7 @@
*
*/
#include "Variant.h"
-#include "PlatformDefs.h"
#include <string.h>
-#include "jsoncpp/include/json/value.h"
using namespace std;
@@ -31,14 +29,33 @@ CVariant::CVariant(VariantType type)
{
m_type = type;
- if (isString())
- m_data.string = NULL;
- else if (isArray())
- m_data.array = new VariantArray();
- else if (isObject())
- m_data.map = new VariantMap();
- else
- memset(&m_data, 0, sizeof(m_data));
+ switch (type)
+ {
+ case VariantTypeInteger:
+ m_data.integer = 0;
+ break;
+ case VariantTypeUnsignedInteger:
+ m_data.unsignedinteger = 0;
+ break;
+ case VariantTypeBoolean:
+ m_data.boolean = false;
+ break;
+ case VariantTypeString:
+ m_data.string = NULL;
+ break;
+ case VariantTypeDouble:
+ m_data.dvalue = 0.0;
+ break;
+ case VariantTypeArray:
+ m_data.array = new VariantArray();
+ break;
+ case VariantTypeObject:
+ m_data.map = new VariantMap();
+ break;
+ default:
+ memset(&m_data, 0, sizeof(m_data));
+ break;
+ }
}
CVariant::CVariant(int integer)
@@ -65,10 +82,16 @@ CVariant::CVariant(uint64_t unsignedinteger)
m_data.unsignedinteger = unsignedinteger;
}
-CVariant::CVariant(float fFloat)
+CVariant::CVariant(double value)
+{
+ m_type = VariantTypeDouble;
+ m_data.dvalue = value;
+}
+
+CVariant::CVariant(float value)
{
- m_type = VariantTypeFloat;
- m_data.fFloat = fFloat;
+ m_type = VariantTypeDouble;
+ m_data.dvalue = (double)value;
}
CVariant::CVariant(bool boolean)
@@ -83,6 +106,12 @@ CVariant::CVariant(const char *str)
m_data.string = new string(str);
}
+CVariant::CVariant(const char *str, unsigned int length)
+{
+ m_type = VariantTypeString;
+ m_data.string = new string(str, length);
+}
+
CVariant::CVariant(const string &str)
{
m_type = VariantTypeString;
@@ -97,17 +126,17 @@ CVariant::CVariant(const CVariant &variant)
CVariant::~CVariant()
{
- if (isString() && m_data.string)
+ if (m_type == VariantTypeString && m_data.string)
{
delete m_data.string;
m_data.string = NULL;
}
- else if (isArray() && m_data.array)
+ else if (m_type == VariantTypeArray && m_data.array)
{
delete m_data.array;
m_data.array = NULL;
}
- else if (isObject() && m_data.map)
+ else if (m_type == VariantTypeObject && m_data.map)
{
delete m_data.map;
m_data.map = NULL;
@@ -129,9 +158,9 @@ bool CVariant::isBoolean() const
return m_type == VariantTypeBoolean;
}
-bool CVariant::isFloat() const
+bool CVariant::isDouble() const
{
- return m_type == VariantTypeFloat;
+ return m_type == VariantTypeDouble;
}
bool CVariant::isString() const
@@ -154,9 +183,14 @@ bool CVariant::isNull() const
return m_type == VariantTypeNull || m_type == VariantTypeConstNull;
}
+CVariant::VariantType CVariant::type() const
+{
+ return m_type;
+}
+
int64_t CVariant::asInteger(int64_t fallback) const
{
- if (isInteger())
+ if (m_type == VariantTypeInteger)
return m_data.integer;
else
return fallback;
@@ -164,23 +198,31 @@ int64_t CVariant::asInteger(int64_t fallback) const
uint64_t CVariant::asUnsignedInteger(uint64_t fallback) const
{
- if (isUnsignedInteger())
+ if (m_type == VariantTypeUnsignedInteger)
return m_data.unsignedinteger;
else
return fallback;
}
+double CVariant::asDouble(double fallback) const
+{
+ if (m_type == VariantTypeDouble)
+ return m_data.dvalue;
+ else
+ return fallback;
+}
+
float CVariant::asFloat(float fallback) const
{
- if (isFloat())
- return m_data.fFloat;
+ if (m_type == VariantTypeDouble)
+ return (float)m_data.dvalue;
else
return fallback;
}
bool CVariant::asBoolean(bool fallback) const
{
- if (isBoolean())
+ if (m_type == VariantTypeBoolean)
return m_data.boolean;
else
return fallback;
@@ -188,52 +230,12 @@ bool CVariant::asBoolean(bool fallback) const
const char *CVariant::asString(const char *fallback) const
{
- if (isString())
+ if (m_type == VariantTypeString)
return m_data.string->c_str();
else
return fallback;
}
-void CVariant::toJsonValue(Json::Value& value) const
-{
- switch (m_type)
- {
- case VariantTypeInteger:
- value = (int32_t) m_data.integer;
- break;
- case VariantTypeUnsignedInteger:
- value = (uint32_t) m_data.unsignedinteger;
- break;
- case VariantTypeBoolean:
- value = m_data.boolean;
- break;
- case VariantTypeFloat:
- value = m_data.fFloat;
- break;
- case VariantTypeString:
- value = (*m_data.string);
- break;
- case VariantTypeArray:
- for (unsigned int i = 0; i < size(); i++)
- {
- Json::Value array;
- (*m_data.array)[i].toJsonValue(array);
- value.append(array);
- }
- break;
- case VariantTypeObject:
- for (VariantMap::iterator itr = m_data.map->begin(); itr != m_data.map->end(); itr++)
- {
- Json::Value object;
- itr->second.toJsonValue(object);
- value[itr->first] = object;
- }
- break;
- default:
- break;
- }
-}
-
CVariant &CVariant::operator[](string key)
{
if (m_type == VariantTypeNull)
@@ -242,7 +244,15 @@ CVariant &CVariant::operator[](string key)
m_data.map = new VariantMap();
}
- if (isObject())
+ if (m_type == VariantTypeObject)
+ return (*m_data.map)[key];
+ else
+ return ConstNullVariant;
+}
+
+const CVariant &CVariant::operator[](std::string key) const
+{
+ if (m_type == VariantTypeObject)
return (*m_data.map)[key];
else
return ConstNullVariant;
@@ -250,7 +260,15 @@ CVariant &CVariant::operator[](string key)
CVariant &CVariant::operator[](unsigned int position)
{
- if (isArray() && size() > position)
+ if (m_type == VariantTypeArray && size() > position)
+ return (*m_data.array)[position];
+ else
+ return ConstNullVariant;
+}
+
+const CVariant &CVariant::operator[](unsigned int position) const
+{
+ if (m_type == VariantTypeArray && size() > position)
return (*m_data.array)[position];
else
return ConstNullVariant;
@@ -274,8 +292,8 @@ CVariant &CVariant::operator=(const CVariant &rhs)
case VariantTypeBoolean:
m_data.boolean = rhs.m_data.boolean;
break;
- case VariantTypeFloat:
- m_data.fFloat = rhs.m_data.fFloat;
+ case VariantTypeDouble:
+ m_data.dvalue = rhs.m_data.dvalue;
break;
case VariantTypeString:
m_data.string = new string(rhs.m_data.string->c_str());
@@ -293,6 +311,41 @@ CVariant &CVariant::operator=(const CVariant &rhs)
return *this;
}
+bool CVariant::operator==(const CVariant &rhs) const
+{
+ if (m_type == rhs.m_type)
+ {
+ switch (m_type)
+ {
+ case VariantTypeInteger:
+ return m_data.integer == rhs.m_data.integer;
+ break;
+ case VariantTypeUnsignedInteger:
+ return m_data.unsignedinteger == rhs.m_data.unsignedinteger;
+ break;
+ case VariantTypeBoolean:
+ return m_data.boolean == rhs.m_data.boolean;
+ break;
+ case VariantTypeDouble:
+ return m_data.dvalue == rhs.m_data.dvalue;
+ break;
+ case VariantTypeString:
+ return (*m_data.string) == (*rhs.m_data.string);
+ break;
+ case VariantTypeArray:
+ return (*m_data.array) == (*rhs.m_data.array);
+ break;
+ case VariantTypeObject:
+ return (*m_data.map) == (*rhs.m_data.map);
+ break;
+ default:
+ break;
+ }
+ }
+
+ return false;
+}
+
void CVariant::push_back(CVariant variant)
{
if (m_type == VariantTypeNull)
@@ -301,25 +354,116 @@ void CVariant::push_back(CVariant variant)
m_data.array = new VariantArray();
}
- if (isArray())
+ if (m_type == VariantTypeArray)
m_data.array->push_back(variant);
}
+void CVariant::append(CVariant variant)
+{
+ push_back(variant);
+}
+
+const char *CVariant::c_str() const
+{
+ if (m_type == VariantTypeString)
+ return m_data.string->c_str();
+ else
+ return NULL;
+}
+
+void CVariant::swap(CVariant &rhs)
+{
+ VariantType temp_type = m_type;
+ VariantUnion temp_data = m_data;
+
+ m_type = rhs.m_type;
+ m_data = rhs.m_data;
+
+ rhs.m_type = temp_type;
+ rhs.m_data = temp_data;
+}
+
+CVariant::iterator_array CVariant::begin_array()
+{
+ if (m_type == VariantTypeArray)
+ return m_data.array->begin();
+ else
+ return iterator_array();
+}
+
+CVariant::const_iterator_array CVariant::begin_array() const
+{
+ if (m_type == VariantTypeArray)
+ return m_data.array->begin();
+ else
+ return const_iterator_array();
+}
+
+CVariant::iterator_array CVariant::end_array()
+{
+ if (m_type == VariantTypeArray)
+ return m_data.array->end();
+ else
+ return iterator_array();
+}
+
+CVariant::const_iterator_array CVariant::end_array() const
+{
+ if (m_type == VariantTypeArray)
+ return m_data.array->end();
+ else
+ return const_iterator_array();
+}
+
+CVariant::iterator_map CVariant::begin_map()
+{
+ if (m_type == VariantTypeObject)
+ return m_data.map->begin();
+ else
+ return iterator_map();
+}
+
+CVariant::const_iterator_map CVariant::begin_map() const
+{
+ if (m_type == VariantTypeObject)
+ return m_data.map->begin();
+ else
+ return const_iterator_map();
+}
+
+CVariant::iterator_map CVariant::end_map()
+{
+ if (m_type == VariantTypeObject)
+ return m_data.map->end();
+ else
+ return iterator_map();
+}
+
+CVariant::const_iterator_map CVariant::end_map() const
+{
+ if (m_type == VariantTypeObject)
+ return m_data.map->end();
+ else
+ return const_iterator_map();
+}
+
unsigned int CVariant::size() const
{
- if (isObject())
+ if (m_type == VariantTypeObject)
return m_data.map->size();
- else if (isArray())
+ else if (m_type == VariantTypeArray)
return m_data.array->size();
+ else if (m_type == VariantTypeString)
+ return m_data.string->size();
else
return 0;
}
bool CVariant::empty() const
{
- if (isObject())
+ if (m_type == VariantTypeObject)
return m_data.map->empty();
- else if (isArray())
+ else if (m_type == VariantTypeArray)
return m_data.array->empty();
else
return true;
@@ -327,9 +471,9 @@ bool CVariant::empty() const
void CVariant::clear()
{
- if (isObject())
+ if (m_type == VariantTypeObject)
m_data.map->clear();
- else if (isArray())
+ else if (m_type == VariantTypeArray)
m_data.array->clear();
}
@@ -340,7 +484,7 @@ void CVariant::erase(std::string key)
m_type = VariantTypeObject;
m_data.map = new VariantMap();
}
- else if (isObject())
+ else if (m_type == VariantTypeObject)
m_data.map->erase(key);
}
@@ -352,58 +496,14 @@ void CVariant::erase(unsigned int position)
m_data.array = new VariantArray();
}
- if (isArray() && position < size())
+ if (m_type == VariantTypeArray && position < size())
m_data.array->erase(m_data.array->begin() + position);
}
-#include <stdio.h>
-
-void CVariant::debug()
+bool CVariant::isMember(string key) const
{
- internaldebug();
- printf("\n");
-}
+ if (m_type == VariantTypeObject)
+ return m_data.map->find(key) != m_data.map->end();
-void CVariant::internaldebug()
-{
- switch (m_type)
- {
- case VariantTypeInteger:
- printf("int: %"PRIu64"", m_data.integer);
- break;
- case VariantTypeUnsignedInteger:
- printf("uint: %"PRIu64"", m_data.unsignedinteger);
- break;
- case VariantTypeFloat:
- printf("float: %f", m_data.fFloat);
- break;
- case VariantTypeBoolean:
- printf("bool: %s", m_data.boolean ? "true" : "false");
- break;
- case VariantTypeString:
- printf("string: \"%s\"", m_data.string->c_str());
- break;
- case VariantTypeArray:
- printf("array: [");
- for (unsigned int i = 0; i < size(); i++)
- {
- (*m_data.array)[i].internaldebug();
- if (i < size() - 1)
- printf(", ");
- }
- printf("]");
- break;
- case VariantTypeObject:
- printf("map: [");
- for (VariantMap::iterator itr = m_data.map->begin(); itr != m_data.map->end(); itr++)
- {
- printf("key='%s' value='", itr->first.c_str());
- itr->second.internaldebug();
- printf("' ");
- }
- printf("]");
- break;
- default:
- break;
- }
+ return false;
}
diff --git a/xbmc/utils/Variant.h b/xbmc/utils/Variant.h
index b18ee01a91..425fe2c02d 100644
--- a/xbmc/utils/Variant.h
+++ b/xbmc/utils/Variant.h
@@ -24,11 +24,6 @@
#include <string>
#include <stdint.h>
-namespace Json
-{
- class Value;
-}
-
class CVariant
{
public:
@@ -38,7 +33,7 @@ public:
VariantTypeUnsignedInteger,
VariantTypeBoolean,
VariantTypeString,
- VariantTypeFloat,
+ VariantTypeDouble,
VariantTypeArray,
VariantTypeObject,
VariantTypeNull,
@@ -50,9 +45,11 @@ public:
CVariant(int64_t integer);
CVariant(unsigned int unsignedinteger);
CVariant(uint64_t unsignedinteger);
- CVariant(float fFloat);
+ CVariant(double value);
+ CVariant(float value);
CVariant(bool boolean);
CVariant(const char *str);
+ CVariant(const char *str, unsigned int length);
CVariant(const std::string &str);
CVariant(const CVariant &variant);
@@ -62,23 +59,55 @@ public:
bool isUnsignedInteger() const;
bool isBoolean() const;
bool isString() const;
- bool isFloat() const;
+ bool isDouble() const;
bool isArray() const;
bool isObject() const;
bool isNull() const;
+ VariantType type() const;
+
int64_t asInteger(int64_t fallback = 0) const;
uint64_t asUnsignedInteger(uint64_t fallback = 0u) const;
bool asBoolean(bool fallback = false) const;
const char *asString(const char *fallback = "") const;
+ double asDouble(double fallback = 0.0) const;
float asFloat(float fallback = 0.0f) const;
CVariant &operator[](std::string key);
+ const CVariant &operator[](std::string key) const;
CVariant &operator[](unsigned int position);
+ const CVariant &operator[](unsigned int position) const;
CVariant &operator=(const CVariant &rhs);
+ bool operator==(const CVariant &rhs) const;
void push_back(CVariant variant);
+ void append(CVariant variant);
+
+ const char *c_str() const;
+
+ void swap(CVariant &rhs);
+
+private:
+ typedef std::vector<CVariant> VariantArray;
+ typedef std::map<std::string, CVariant> VariantMap;
+
+public:
+ typedef VariantArray::iterator iterator_array;
+ typedef VariantArray::const_iterator const_iterator_array;
+
+ typedef VariantMap::iterator iterator_map;
+ typedef VariantMap::const_iterator const_iterator_map;
+
+ iterator_array begin_array();
+ const_iterator_array begin_array() const;
+ iterator_array end_array();
+ const_iterator_array end_array() const;
+
+ iterator_map begin_map();
+ const_iterator_map begin_map() const;
+ iterator_map end_map();
+ const_iterator_map end_map() const;
unsigned int size() const;
bool empty() const;
@@ -86,26 +115,22 @@ public:
void erase(std::string key);
void erase(unsigned int position);
- void debug();
- void internaldebug();
+ bool isMember(std::string key) const;
- void toJsonValue(Json::Value& value) const;
private:
- VariantType m_type;
-
- typedef std::vector<CVariant> VariantArray;
- typedef std::map<std::string, CVariant> VariantMap;
-
- union
+ union VariantUnion
{
int64_t integer;
uint64_t unsignedinteger;
bool boolean;
- float fFloat;
+ double dvalue;
std::string *string;
VariantArray *array;
VariantMap *map;
- } m_data;
+ };
+
+ VariantType m_type;
+ VariantUnion m_data;
static CVariant ConstNullVariant;
};
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index 45cca985ed..1d17adb197 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -3350,7 +3350,7 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
{
if (iVersion < 43)
{
- m_pDS->exec("ALTER table settings add VerticalShift float");
+ m_pDS->exec("ALTER TABLE settings ADD VerticalShift float");
}
if (iVersion < 44)
{
@@ -3429,10 +3429,10 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
}
if (iVersion < 45)
{
- m_pDS->exec("ALTER table movie add c22 text");
- m_pDS->exec("ALTER table episode add c22 text");
- m_pDS->exec("ALTER table musicvideo add c22 text");
- m_pDS->exec("ALTER table tvshow add c22 text");
+ m_pDS->exec("ALTER TABLE movie ADD c22 text");
+ m_pDS->exec("ALTER TABLE episode ADD c22 text");
+ m_pDS->exec("ALTER TABLE musicvideo ADD c22 text");
+ m_pDS->exec("ALTER TABLE tvshow ADD c22 text");
// Now update our tables
UpdateBasePath("movie", "idMovie", VIDEODB_ID_BASEPATH);
UpdateBasePath("musicvideo", "idMVideo", VIDEODB_ID_MUSICVIDEO_BASEPATH);
@@ -3452,7 +3452,7 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
}
if (iVersion < 50)
{
- m_pDS->exec("ALTER table settings add ScalingMethod integer");
+ m_pDS->exec("ALTER TABLE settings ADD ScalingMethod integer");
m_pDS->exec(PrepareSQL("UPDATE settings set ScalingMethod=%i", g_settings.m_defaultVideoSettings.m_ScalingMethod));
}
if (iVersion < 51)
@@ -3465,10 +3465,10 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
}
if (iVersion < 52)
{ // Add basepath link to path table for faster content retrieval, and indicies
- m_pDS->exec("ALTER table movie add c23 text");
- m_pDS->exec("ALTER table episode add c23 text");
- m_pDS->exec("ALTER table musicvideo add c23 text");
- m_pDS->exec("ALTER table tvshow add c23 text");
+ m_pDS->exec("ALTER TABLE movie ADD c23 text");
+ m_pDS->exec("ALTER TABLE episode ADD c23 text");
+ m_pDS->exec("ALTER TABLE musicvideo ADD c23 text");
+ m_pDS->exec("ALTER TABLE tvshow ADD c23 text");
m_pDS->dropIndex("movie", "ixMovieBasePath");
m_pDS->dropIndex("musicvideo", "ixMusicVideoBasePath");
m_pDS->dropIndex("episode", "ixEpisodeBasePath");
@@ -3680,9 +3680,19 @@ void CVideoDatabase::SetPlayCount(const CFileItem &item, int count, const CStdSt
m_pDS->exec(strSQL.c_str());
- CVariant data;
- data["playcount"] = count;
- ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "NewPlayCount", CFileItemPtr(new CFileItem(item)), data);
+ // We only need to announce changes to video items in the library
+ if (item.HasVideoInfoTag() && item.GetVideoInfoTag()->m_iDbId > 0)
+ {
+ // Only provide the "playcount" value if it has actually changed
+ if (item.GetVideoInfoTag()->m_playCount != count)
+ {
+ CVariant data;
+ data["playcount"] = count;
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate", CFileItemPtr(new CFileItem(item)), data);
+ }
+ else
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate", CFileItemPtr(new CFileItem(item)));
+ }
}
catch (...)
{
@@ -4960,25 +4970,33 @@ void CVideoDatabase::Stack(CFileItemList& items, VIDEODB_CONTENT_TYPE type, bool
bool CVideoDatabase::GetEpisodesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre, int idYear, int idActor, int idDirector, int idShow, int idSeason)
{
- CStdString strIn = PrepareSQL("= %i", idShow);
- GetStackedTvShowList(idShow, strIn);
- CStdString where = PrepareSQL("where idShow %s",strIn.c_str());
- if (idGenre != -1)
- where = PrepareSQL("join genrelinktvshow on genrelinktvshow.idShow=episodeview.idShow where episodeview.idShow=%i and genrelinktvshow.idGenre=%i",idShow,idGenre);
- else if (idDirector != -1)
- where = PrepareSQL("join directorlinktvshow on directorlinktvshow.idShow=episodeview.idShow where episodeview.idShow=%i and directorlinktvshow.idDirector=%i",idShow,idDirector);
- else if (idYear !=-1)
- where=PrepareSQL("where idShow=%i and premiered like '%%%i%%'",idShow,idYear);
- else if (idActor != -1)
- where = PrepareSQL("join actorlinktvshow on actorlinktvshow.idShow=episodeview.idShow where episodeview.idShow=%i and actorlinktvshow.idActor=%i",idShow,idActor);
-
- if (idSeason != -1)
+ CStdString where, strIn;
+ if (idShow != -1)
{
- if (idSeason != 0) // season = 0 indicates a special - we grab all specials here (see below)
- where += PrepareSQL(" and (c%02d=%i or (c%02d=0 and (c%02d=0 or c%02d=%i)))",VIDEODB_ID_EPISODE_SEASON,idSeason,VIDEODB_ID_EPISODE_SEASON, VIDEODB_ID_EPISODE_SORTSEASON, VIDEODB_ID_EPISODE_SORTSEASON,idSeason);
+ strIn = PrepareSQL("= %i", idShow);
+ GetStackedTvShowList(idShow, strIn);
+
+ if (idGenre != -1)
+ where = PrepareSQL("join genrelinktvshow on genrelinktvshow.idShow=episodeview.idShow where episodeview.idShow=%i and genrelinktvshow.idGenre=%i",idShow,idGenre);
+ else if (idDirector != -1)
+ where = PrepareSQL("join directorlinktvshow on directorlinktvshow.idShow=episodeview.idShow where episodeview.idShow=%i and directorlinktvshow.idDirector=%i",idShow,idDirector);
+ else if (idYear !=-1)
+ where = PrepareSQL("where idShow=%i and premiered like '%%%i%%'", idShow, idYear);
+ else if (idActor != -1)
+ where = PrepareSQL("join actorlinktvshow on actorlinktvshow.idShow=episodeview.idShow where episodeview.idShow=%i and actorlinktvshow.idActor=%i",idShow,idActor);
else
- where += PrepareSQL(" and c%02d=%i",VIDEODB_ID_EPISODE_SEASON,idSeason);
+ where = PrepareSQL("where idShow %s",strIn.c_str());
+
+ if (idSeason != -1)
+ {
+ if (idSeason == 0) // season = 0 indicates a special - we grab all specials here (see below)
+ where += PrepareSQL(" and c%02d=%i",VIDEODB_ID_EPISODE_SEASON,idSeason);
+ else
+ where += PrepareSQL(" and (c%02d=%i or (c%02d=0 and (c%02d=0 or c%02d=%i)))",VIDEODB_ID_EPISODE_SEASON,idSeason,VIDEODB_ID_EPISODE_SEASON, VIDEODB_ID_EPISODE_SORTSEASON, VIDEODB_ID_EPISODE_SORTSEASON,idSeason);
+ }
}
+ else if (idYear !=-1)
+ where=PrepareSQL("where premiered like '%%%i%%'", idYear);
// we always append show, season + episode in GetEpisodesByWhere
CStdString parent, grandParent;
@@ -4987,7 +5005,7 @@ bool CVideoDatabase::GetEpisodesNav(const CStdString& strBaseDir, CFileItemList&
bool ret = GetEpisodesByWhere(grandParent, where, items);
- if (idSeason == -1)
+ if (idSeason == -1 && idShow != -1)
{ // add any linked movies
CStdString where = PrepareSQL("join movielinktvshow on movielinktvshow.idMovie=movieview.idMovie where movielinktvshow.idShow %s", strIn.c_str());
GetMoviesByWhere("videodb://1/2/", where, "", items);
@@ -7441,9 +7459,9 @@ void CVideoDatabase::ImportFromXML(const CStdString &path)
if (XMLUtils::GetString(path,"content", content))
{ // check the scraper exists, if so store the path
AddonPtr addon;
- CStdString uuid;
- XMLUtils::GetString(path,"scraperID",uuid);
- if (CAddonMgr::Get().GetAddon(uuid, addon))
+ CStdString id;
+ XMLUtils::GetString(path,"scraperpath",id);
+ if (CAddonMgr::Get().GetAddon(id, addon))
{
SScanSettings settings;
ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addon);
@@ -7744,17 +7762,17 @@ CStdString CVideoDatabase::GetSafeFile(const CStdString &dir, const CStdString &
void CVideoDatabase::AnnounceRemove(std::string content, int id)
{
CVariant data;
- data["content"] = content;
- data[content + "id"] = id;
- ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "RemoveVideo", data);
+ data["type"] = content;
+ data["id"] = id;
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnRemove", data);
}
void CVideoDatabase::AnnounceUpdate(std::string content, int id)
{
CVariant data;
- data["content"] = content;
- data[content + "id"] = id;
- ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "UpdateVideo", data);
+ data["type"] = content;
+ data["id"] = id;
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate", data);
}
bool CVideoDatabase::GetItemForPath(const CStdString &content, const CStdString &strPath, CFileItem &item)
diff --git a/xbmc/video/VideoInfoDownloader.cpp b/xbmc/video/VideoInfoDownloader.cpp
index c35c290af3..2e6a1ff492 100644
--- a/xbmc/video/VideoInfoDownloader.cpp
+++ b/xbmc/video/VideoInfoDownloader.cpp
@@ -165,12 +165,18 @@ int CVideoInfoDownloader::InternalFindMovie(const CStdString &strMovie,
CStdString compareYear;
if (year && year->FirstChild())
compareYear = year->FirstChild()->Value();
+
+ /*
+ * Identify the best match by performing a fuzzy string compare on the search term and
+ * the result. Additionally, use the year (if available) to further refine the best match.
+ * An exact match scores 1, a match off by a year scores 0.5 (release dates can vary between
+ * countries), otherwise it scores 0.
+ */
+ double yearScore = 0;
if (!movieYear.IsEmpty() && !compareYear.IsEmpty())
- {
- matchTitle.AppendFormat(" (%s)", movieYear.c_str());
- compareTitle.AppendFormat(" (%s)", compareYear.c_str());
- }
- url.relevance = fstrcmp(matchTitle.c_str(), compareTitle.c_str(), 0);
+ yearScore = std::max(0.0, 1-0.5*abs(atoi(movieYear)-atoi(compareYear)));
+ url.relevance = fstrcmp(matchTitle.c_str(), compareTitle.c_str(), 0.0) + yearScore;
+
// reconstruct a title for the user
CStdString title = url.strTitle;
if (!compareYear.IsEmpty())
diff --git a/xbmc/windowing/WinEventsSDL.cpp b/xbmc/windowing/WinEventsSDL.cpp
index 71bb41e630..6791ca2539 100644
--- a/xbmc/windowing/WinEventsSDL.cpp
+++ b/xbmc/windowing/WinEventsSDL.cpp
@@ -182,7 +182,7 @@ static void InitEvdev(void)
// is unknown.
static uint16_t SymFromScancode(uint16_t scancode)
{
- int i;
+ unsigned int i;
// We need to initialise m_bEvdev once
if (!m_bEvdevInit)