From a6b588fcc912fa8081393d2a63d45cf5feb4e12b Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 26 Apr 2016 14:12:09 -0700 Subject: [PATCH] First pass at getting core and square to compile against VS2015. Not really working yet, and most plugins are broken. OGG playback seems to work! --- .gitignore | 15 ++ audioengine.sln | 40 ++- src/3rdparty/3rdparty.vcxproj | 160 +++++++++++ src/contrib/aacdecoder/aacdecoder.vcxproj | 204 ++++++++++++++ src/contrib/apedecoder/apedecoder.vcxproj | 106 ++++++++ src/contrib/cddadecoder/CDDAAudioSource.h | 4 +- .../cddadecoder/CDDASourceSupplier.cpp | 2 +- src/contrib/cddadecoder/CDDASourceSupplier.h | 7 +- src/contrib/cddadecoder/cddadecoder.vcxproj | 104 +++++++ .../cddadecoder/cddadecoder_plugin.cpp | 2 +- src/contrib/mp3decoder/mp3decoder.vcxproj | 119 ++++++++ src/contrib/oggdecoder/oggdecoder.vcxproj | 109 ++++++++ .../taglib_plugin/taglib_plugin.vcxproj | 237 ++++++++++++++++ src/contrib/waveout/waveout.vcxproj | 108 ++++++++ src/core/Indexer.cpp | 12 +- src/core/IndexerTrack.cpp | 7 +- src/core/Library/Base.cpp | 9 +- src/core/Library/LocalDB.cpp | 4 - src/core/Library/Remote.cpp | 5 +- src/core/PluginFactory.cpp | 2 +- src/core/Query/Base.cpp | 4 - src/core/Query/Factory.cpp | 5 +- src/core/Query/ListBase.cpp | 4 - src/core/Query/ListSelection.cpp | 4 - src/core/Query/SortTracks.cpp | 4 - src/core/Query/SortTracksWithData.cpp | 4 - src/core/Query/TrackMetadata.cpp | 4 - src/core/audio/Buffer.cpp | 5 +- src/core/audio/Player.cpp | 108 ++++---- src/core/audio/Stream.cpp | 5 +- src/core/audio/Transport.cpp | 6 +- src/core/config.h | 2 +- src/core/config_filesystem.h | 4 +- src/core/core.vcxproj | 255 ++++++++++++++++++ src/core/db/CachedStatement.cpp | 4 - src/core/db/Connection.cpp | 4 - src/core/db/ScopedTransaction.cpp | 4 - src/core/db/Statement.cpp | 6 - src/core/filestreams/Factory.cpp | 5 +- src/core/filestreams/LocalFileStream.cpp | 86 +++--- src/core/http/RequestParser.cpp | 5 - src/core/http/Responder.cpp | 4 - src/core/http/Server.cpp | 4 - src/core/http/TrackSender.cpp | 4 - src/core/pch.hpp | 19 +- src/core/server/Connection.cpp | 7 +- src/core/server/User.cpp | 7 +- src/core/server/UserSession.cpp | 5 +- src/core/tracklist/Base.cpp | 4 - src/core/tracklist/LibraryList.cpp | 4 - src/core/tracklist/MultiLibraryList.cpp | 4 - src/core/xml/Node.cpp | 4 - src/core/xml/Parser.cpp | 5 +- src/core/xml/ParserNode.cpp | 5 +- src/core/xml/Socket.cpp | 5 +- src/core/xml/Writer.cpp | 4 - src/core/xml/WriterNode.cpp | 14 +- src/square/player.vcxproj | 133 +++++++++ 58 files changed, 1712 insertions(+), 304 deletions(-) create mode 100644 .gitignore create mode 100755 src/3rdparty/3rdparty.vcxproj create mode 100755 src/contrib/aacdecoder/aacdecoder.vcxproj create mode 100755 src/contrib/apedecoder/apedecoder.vcxproj create mode 100755 src/contrib/cddadecoder/cddadecoder.vcxproj create mode 100755 src/contrib/mp3decoder/mp3decoder.vcxproj create mode 100755 src/contrib/oggdecoder/oggdecoder.vcxproj create mode 100755 src/contrib/taglib_plugin/taglib_plugin.vcxproj create mode 100755 src/contrib/waveout/waveout.vcxproj create mode 100755 src/core/core.vcxproj create mode 100755 src/square/player.vcxproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..6c5c36934 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +**/*.vcxproj.filters +**/*.vcxproj.user +**/*.VC.db +**/*.VC.opendb +**/*.suo +bin +obj +ipch +src/3rdparty/bin +src/3rdparty/obj +src/core/obj +src/square/obj +src/contrib/oggdecoder/obj +src/contrib/waveout/obj +src/contrib/taglib_plugin/obj diff --git a/audioengine.sln b/audioengine.sln index 5b9373e57..729b81138 100644 --- a/audioengine.sln +++ b/audioengine.sln @@ -1,32 +1,26 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp3decoder", "src\contrib\mp3decoder\mp3decoder.vcproj", "{293471C3-93F8-4C70-AC2B-9F9211529C3B}" +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25123.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mp3decoder", "src\contrib\mp3decoder\mp3decoder.vcxproj", "{293471C3-93F8-4C70-AC2B-9F9211529C3B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "player", "src\square\player.vcproj", "{C7102EB1-7311-4B36-A7FF-89DD7F077FF9}" - ProjectSection(ProjectDependencies) = postProject - {B2165720-B4B2-4F4B-8888-8C390C3CB4DB} = {B2165720-B4B2-4F4B-8888-8C390C3CB4DB} - {B2165720-B4B2-4F4B-9634-8C390C3CB4DB} = {B2165720-B4B2-4F4B-9634-8C390C3CB4DB} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "square", "src\square\player.vcxproj", "{C7102EB1-7311-4B36-A7FF-89DD7F077FF9}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggdecoder", "src\contrib\oggdecoder\oggdecoder.vcproj", "{292974B0-C8B7-41EF-B603-554A2B25CB90}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggdecoder", "src\contrib\oggdecoder\oggdecoder.vcxproj", "{292974B0-C8B7-41EF-B603-554A2B25CB90}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "apedecoder", "src\contrib\apedecoder\apedecoder.vcproj", "{A6923E38-7B13-4394-93E6-005CE3E80DA4}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "apedecoder", "src\contrib\apedecoder\apedecoder.vcxproj", "{A6923E38-7B13-4394-93E6-005CE3E80DA4}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacdecoder", "src\contrib\aacdecoder\aacdecoder.vcproj", "{4993E68D-E97A-4CD2-AC8E-168AE315BAC5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacdecoder", "src\contrib\aacdecoder\aacdecoder.vcxproj", "{4993E68D-E97A-4CD2-AC8E-168AE315BAC5}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cddadecoder", "src\contrib\cddadecoder\cddadecoder.vcproj", "{54764854-5A73-4329-9BAD-9AF22C72D9E2}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cddadecoder", "src\contrib\cddadecoder\cddadecoder.vcxproj", "{54764854-5A73-4329-9BAD-9AF22C72D9E2}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3rdparty", "src\3rdparty\3rdparty.vcproj", "{B2165720-B4B2-4F4B-8888-8C390C3CB4DB}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3rdparty", "src\3rdparty\3rdparty.vcxproj", "{B2165720-B4B2-4F4B-8888-8C390C3CB4DB}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "src\core\core.vcproj", "{B2165720-B4B2-4F4B-9634-8C390C3CB4DB}" - ProjectSection(ProjectDependencies) = postProject - {B2165720-B4B2-4F4B-8888-8C390C3CB4DB} = {B2165720-B4B2-4F4B-8888-8C390C3CB4DB} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "src\core\core.vcxproj", "{B2165720-B4B2-4F4B-9634-8C390C3CB4DB}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "taglib_plugin", "src\contrib\taglib_plugin\taglib_plugin.vcproj", "{7CD00EC4-D090-48BE-9388-FA4857AC332C}" - ProjectSection(ProjectDependencies) = postProject - {B2165720-B4B2-4F4B-9634-8C390C3CB4DB} = {B2165720-B4B2-4F4B-9634-8C390C3CB4DB} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "taglib_plugin", "src\contrib\taglib_plugin\taglib_plugin.vcxproj", "{7CD00EC4-D090-48BE-9388-FA4857AC332C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "waveout", "src\contrib\waveout\waveout.vcxproj", "{4F10C17A-8AF7-4FAC-A4E2-087AE6E8F9D8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -70,6 +64,10 @@ Global {7CD00EC4-D090-48BE-9388-FA4857AC332C}.Debug|Win32.Build.0 = Debug|Win32 {7CD00EC4-D090-48BE-9388-FA4857AC332C}.Release|Win32.ActiveCfg = Release|Win32 {7CD00EC4-D090-48BE-9388-FA4857AC332C}.Release|Win32.Build.0 = Release|Win32 + {4F10C17A-8AF7-4FAC-A4E2-087AE6E8F9D8}.Debug|Win32.ActiveCfg = Debug|Win32 + {4F10C17A-8AF7-4FAC-A4E2-087AE6E8F9D8}.Debug|Win32.Build.0 = Debug|Win32 + {4F10C17A-8AF7-4FAC-A4E2-087AE6E8F9D8}.Release|Win32.ActiveCfg = Release|Win32 + {4F10C17A-8AF7-4FAC-A4E2-087AE6E8F9D8}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/3rdparty/3rdparty.vcxproj b/src/3rdparty/3rdparty.vcxproj new file mode 100755 index 000000000..3000ba4f7 --- /dev/null +++ b/src/3rdparty/3rdparty.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B2165720-B4B2-4F4B-8888-8C390C3CB4DB} + doe + + + + StaticLibrary + Unicode + true + v140 + + + StaticLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + bin/$(Configuration)\ + obj/$(Configuration)\ + bin/$(Configuration)\ + obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ./include/;./include/sqlite/;./include/expat;./include/md5;./include/jpeg-6b;../../../boost_1_60_0/;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;SQLITE_THREADSAFE;COMPILED_FROM_DSP;XML_STATIC;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + pch.hpp + Level3 + EditAndContinue + + + + + MaxSpeed + Default + true + Neither + ./include/;./include/sqlite/;./include/expat;./include/md5;./include/jpeg-6b;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_DEPRECATE;SQLITE_THREADSAFE;COMPILED_FROM_DSP;XML_STATIC;%(PreprocessorDefinitions) + MultiThreaded + + + pch.hpp + + + + + Level1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/contrib/aacdecoder/aacdecoder.vcxproj b/src/contrib/aacdecoder/aacdecoder.vcxproj new file mode 100755 index 000000000..7b3a6e5b2 --- /dev/null +++ b/src/contrib/aacdecoder/aacdecoder.vcxproj @@ -0,0 +1,204 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {4993E68D-E97A-4CD2-AC8E-168AE315BAC5} + aacdecoder + Win32Proj + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ../../core/audio;../../;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;AACDECODER_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + true + + + + + ../../core/audio;../../;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;AACDECODER_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/contrib/apedecoder/apedecoder.vcxproj b/src/contrib/apedecoder/apedecoder.vcxproj new file mode 100755 index 000000000..0bd9a98c5 --- /dev/null +++ b/src/contrib/apedecoder/apedecoder.vcxproj @@ -0,0 +1,106 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {A6923E38-7B13-4394-93E6-005CE3E80DA4} + apedecoder + Win32Proj + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ../../;./ape;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;APEDECODER_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + /NODEFAULTLIB:LIBCMT %(AdditionalOptions) + MACLib.lib;%(AdditionalDependencies) + ape;../../3rdparty/lib;%(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + true + NotSet + + + + + ../../;./ape;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;APEDECODER_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + MACLib.lib;%(AdditionalDependencies) + ape;../../3rdparty/lib;%(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/contrib/cddadecoder/CDDAAudioSource.h b/src/contrib/cddadecoder/CDDAAudioSource.h index 65e9d6b23..64ec189ca 100644 --- a/src/contrib/cddadecoder/CDDAAudioSource.h +++ b/src/contrib/cddadecoder/CDDAAudioSource.h @@ -1,13 +1,13 @@ #pragma once -#include +#include #include "ntddcdrm.h" #include "devioctl.h" using namespace musik::core::audio; -class CDDAAudioSource : public IAudioSource +class CDDAAudioSource : public IDecoder { protected: LONGLONG m_llPosition, diff --git a/src/contrib/cddadecoder/CDDASourceSupplier.cpp b/src/contrib/cddadecoder/CDDASourceSupplier.cpp index e5d4ec7ae..898750555 100644 --- a/src/contrib/cddadecoder/CDDASourceSupplier.cpp +++ b/src/contrib/cddadecoder/CDDASourceSupplier.cpp @@ -48,7 +48,7 @@ void CDDASourceSupplier::Destroy() delete this; } -IAudioSource* CDDASourceSupplier::CreateAudioSource() +IDecoder* CDDASourceSupplier::CreateDecoder() { return new CDDAAudioSource(); } diff --git a/src/contrib/cddadecoder/CDDASourceSupplier.h b/src/contrib/cddadecoder/CDDASourceSupplier.h index 6a5366dce..eb1e37249 100644 --- a/src/contrib/cddadecoder/CDDASourceSupplier.h +++ b/src/contrib/cddadecoder/CDDASourceSupplier.h @@ -33,16 +33,17 @@ #pragma once -#include +#include +#include using namespace musik::core::audio; -class CDDASourceSupplier : public IAudioSourceSupplier +class CDDASourceSupplier : public IDecoderFactory { public: CDDASourceSupplier(); public: ~CDDASourceSupplier(); -public: IAudioSource* CreateAudioSource(); +public: IDecoder* CreateDecoder(); public: void Destroy(); public: bool CanHandle(const utfchar* source) const; }; diff --git a/src/contrib/cddadecoder/cddadecoder.vcxproj b/src/contrib/cddadecoder/cddadecoder.vcxproj new file mode 100755 index 000000000..fe1423cc4 --- /dev/null +++ b/src/contrib/cddadecoder/cddadecoder.vcxproj @@ -0,0 +1,104 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {54764854-5A73-4329-9BAD-9AF22C72D9E2} + cddadecoder + Win32Proj + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ../../;../../3rdparty/include;../../../../boost_1_60_0;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + shlwapi.lib;%(AdditionalDependencies) + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + true + + + + + ../../;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + shlwapi.lib;%(AdditionalDependencies) + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/contrib/cddadecoder/cddadecoder_plugin.cpp b/src/contrib/cddadecoder/cddadecoder_plugin.cpp index a1aa59998..2f3c6bdf5 100644 --- a/src/contrib/cddadecoder/cddadecoder_plugin.cpp +++ b/src/contrib/cddadecoder/cddadecoder_plugin.cpp @@ -58,7 +58,7 @@ extern "C" __declspec(dllexport) musik::core::IPlugin* GetPlugin() return new CDDADecoderPlugin(); } -extern "C" __declspec(dllexport) IAudioSourceSupplier* CreateAudioSourceSupplier() +extern "C" __declspec(dllexport) IDecoderFactory* GetDecoderFactory() { return new CDDASourceSupplier(); } diff --git a/src/contrib/mp3decoder/mp3decoder.vcxproj b/src/contrib/mp3decoder/mp3decoder.vcxproj new file mode 100755 index 000000000..c3e7192c0 --- /dev/null +++ b/src/contrib/mp3decoder/mp3decoder.vcxproj @@ -0,0 +1,119 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {293471C3-93F8-4C70-AC2B-9F9211529C3B} + mp3decoder + Win32Proj + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + $(SolutionDir)/bin/$(Configuration)/plugins\ + $(SolutionDir)/obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + .;../..;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + shlwapi.lib;%(AdditionalDependencies) + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + true + + + + + .;../..;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + shlwapi.lib;%(AdditionalDependencies) + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/contrib/oggdecoder/oggdecoder.vcxproj b/src/contrib/oggdecoder/oggdecoder.vcxproj new file mode 100755 index 000000000..feb2fb7d7 --- /dev/null +++ b/src/contrib/oggdecoder/oggdecoder.vcxproj @@ -0,0 +1,109 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {292974B0-C8B7-41EF-B603-554A2B25CB90} + oggdecoder + Win32Proj + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)/plugins\ + ./obj/$(Configuration)\ + $(SolutionDir)/bin/$(Configuration)/plugins\ + ./obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + .;../..;../../3rdparty/include;../../../../boost_1_60_0;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;OGGDECODER_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + /NODEFAULTLIB:LIBCMT + %(AdditionalOptions) + legacy_stdio_definitions.lib;libogg.lib;vorbis_static.lib;libvorbisfile.lib;%(AdditionalDependencies) + ./lib;../../3rdparty/lib;../../../../boost_1_60_0/lib32-msvc-14.0;%(AdditionalLibraryDirectories) + true + Windows + + + + + AnySuitable + true + .;../..;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;OGGDECODER_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + libogg.lib;vorbis_static.lib;libvorbisfile.lib;%(AdditionalDependencies) + ./lib;../../3rdparty/lib;%(AdditionalLibraryDirectories) + Windows + true + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/contrib/taglib_plugin/taglib_plugin.vcxproj b/src/contrib/taglib_plugin/taglib_plugin.vcxproj new file mode 100755 index 000000000..da90c8e0a --- /dev/null +++ b/src/contrib/taglib_plugin/taglib_plugin.vcxproj @@ -0,0 +1,237 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7CD00EC4-D090-48BE-9388-FA4857AC332C} + taglib_plugin + Win32Proj + + + + DynamicLibrary + Unicode + true + v140 + + + DynamicLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)/plugins\ + ./obj/$(Configuration)\ + true + $(SolutionDir)/bin/$(Configuration)/plugins\ + ./obj/$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ../../;../../3rdparty/include/;../../../../boost_1_60_0/;taglib-1.5;taglib-1.5/taglib;taglib-1.5/taglib/ape;taglib-1.5/taglib/flac;taglib-1.5/taglib/mpc;taglib-1.5/taglib/mpeg;taglib-1.5/taglib/mpeg/id3v1;taglib-1.5/taglib/mpeg/id3v2;taglib-1.5/taglib/mpeg/id3v2/frames;taglib-1.5/taglib/ogg;taglib-1.5/taglib/ogg/flac;taglib-1.5/taglib/ogg/speex;taglib-1.5/taglib/ogg/vorbis;taglib-1.5/taglib/toolkit;taglib-1.5/taglib/trueaudio;taglib-1.5/taglib/wavpack;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + + + true + TurnOffAllWarnings + EditAndContinue + + + $(OutDir)$(ProjectName).dll + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + true + true + $(TargetDir)$(TargetName).map + true + Windows + MachineX86 + + + + + AnySuitable + true + Speed + ../../;../../3rdparty/include/;taglib-1.5;taglib-1.5/taglib;taglib-1.5/taglib/ape;taglib-1.5/taglib/flac;taglib-1.5/taglib/mpc;taglib-1.5/taglib/mpeg;taglib-1.5/taglib/mpeg/id3v1;taglib-1.5/taglib/mpeg/id3v2;taglib-1.5/taglib/mpeg/id3v2/frames;taglib-1.5/taglib/ogg;taglib-1.5/taglib/ogg/flac;taglib-1.5/taglib/ogg/speex;taglib-1.5/taglib/ogg/vorbis;taglib-1.5/taglib/toolkit;taglib-1.5/taglib/trueaudio;taglib-1.5/taglib/wavpack;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreaded + + + TurnOffAllWarnings + + + + + $(OutDir)$(ProjectName).dll + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + false + Windows + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {b2165720-b4b2-4f4b-9634-8c390c3cb4db} + false + + + + + + \ No newline at end of file diff --git a/src/contrib/waveout/waveout.vcxproj b/src/contrib/waveout/waveout.vcxproj new file mode 100755 index 000000000..5ff61715c --- /dev/null +++ b/src/contrib/waveout/waveout.vcxproj @@ -0,0 +1,108 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {4F10C17A-8AF7-4FAC-A4E2-087AE6E8F9D8} + waveout + + + + DynamicLibrary + v140 + Unicode + + + DynamicLibrary + v140 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>14.0.25123.0 + + + $(SolutionDir)/bin/$(Configuration)/plugins\ + ./obj/$(Configuration)\ + true + MinimumRecommendedRules.ruleset + + + + + $(SolutionDir)/bin/$(Configuration)/plugins\ + ./obj/$(Configuration)\ + MinimumRecommendedRules.ruleset + + + + + + Disabled + ../..;../../3rdparty/include;../../../../boost_1_60_0;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + + + winmm.lib;%(AdditionalDependencies) + ../../3rdparty/lib;../../../../boost_1_60_0/lib32-msvc-14.0;%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + + + AnySuitable + true + ../..;../../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Level3 + + + + winmm.lib;%(AdditionalDependencies) + ../../3rdparty/lib;%(AdditionalLibraryDirectories) + Windows + true + true + UseLinkTimeCodeGeneration + MachineX86 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/core/Indexer.cpp b/src/core/Indexer.cpp index 1758d4600..e3fe7500a 100644 --- a/src/core/Indexer.cpp +++ b/src/core/Indexer.cpp @@ -148,7 +148,7 @@ bool Indexer::Restarted(){ ////////////////////////////////////////// void Indexer::AddPath(utfstring sPath){ boost::filesystem::utfpath oPath(sPath); - sPath = oPath.string(); // Fix pathname for slash/backslash + sPath = oPath.wstring(); // Fix pathname for slash/backslash if(sPath.substr(sPath.size()-1,1)!=UTF("/")){ sPath += UTF("/"); } @@ -316,7 +316,7 @@ void Indexer::CountFiles(utfstring &sFolder){ for(boost::filesystem::utfdirectory_iterator oFile(oPath);oFile!=oEndFile;++oFile){ if(is_directory(oFile->status())){ utfstring sDirectory; - sDirectory.assign(oFile->path().string()); + sDirectory.assign(oFile->path().wstring()); this->CountFiles(sDirectory); }else{ boost::mutex::scoped_lock lock(this->progressMutex); @@ -353,9 +353,9 @@ void Indexer::SyncDirectory(utfstring &sFolder,DBINT iParentFolderId,DBINT iPath } boost::filesystem::utfpath oPath(sFolder); - sFolder = oPath.string(); // Fix pathname for slash/backslash + sFolder = oPath.wstring(); // Fix pathname for slash/backslash - utfstring sFolderLeaf(oPath.leaf()); + utfstring sFolderLeaf(oPath.leaf().wstring()); DBINT iFolderId(0); // Get this folder ID @@ -406,7 +406,7 @@ void Indexer::SyncDirectory(utfstring &sFolder,DBINT iParentFolderId,DBINT iPath // It's a directory utfstring oDirectory; - oDirectory.assign(oFile->path().string()); + oDirectory.assign(oFile->path().wstring()); // If this is a directory, recurse down this->SyncDirectory(oDirectory,iFolderId,iPathId,syncPath); @@ -500,7 +500,7 @@ void Indexer::ThreadLoop(){ if(syncTimeout){ // Sync every "syncTimeout" second boost::xtime oWaitTime; - boost::xtime_get(&oWaitTime, boost::TIME_UTC); + boost::xtime_get(&oWaitTime, boost::TIME_UTC_); oWaitTime.sec += syncTimeout; if(!this->Restarted()){ diff --git a/src/core/IndexerTrack.cpp b/src/core/IndexerTrack.cpp index f3cca760f..a33e04c51 100644 --- a/src/core/IndexerTrack.cpp +++ b/src/core/IndexerTrack.cpp @@ -137,16 +137,15 @@ void IndexerTrack::InitMeta(){ } } - bool IndexerTrack::CompareDBAndFileInfo(const boost::filesystem::utfpath &file,db::Connection &dbConnection,DBINT currentFolderId){ try{ - this->SetValue("path",file.string().c_str()); + this->SetValue("path",file.wstring().c_str()); this->SetValue("filename",file.leaf().c_str()); - utfstring::size_type lastDot = file.leaf().find_last_of(UTF(".")); + size_t lastDot = file.leaf().wstring().find_last_of(UTF(".")); if(lastDot!=utfstring::npos){ - this->SetValue("extension",file.leaf().substr(lastDot+1).c_str()); + this->SetValue("extension",file.leaf().wstring().substr(lastDot+1).c_str()); } DBINT fileSize = (DBINT)boost::filesystem::file_size(file); diff --git a/src/core/Library/Base.cpp b/src/core/Library/Base.cpp index cb35dfc15..61da4f06d 100644 --- a/src/core/Library/Base.cpp +++ b/src/core/Library/Base.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include @@ -146,7 +143,7 @@ utfstring Library::Base::GetLibraryDirectory(){ boost::filesystem::create_directories(oFolder); } - directory = oFolder.string(); + directory = oFolder.wstring(); return directory; } @@ -325,7 +322,7 @@ bool Library::Base::AddQuery( const Query::Base &query,unsigned int options ){ // To be on the safe side, lets check every second boost::xtime waitingTime; - boost::xtime_get(&waitingTime, boost::TIME_UTC); + boost::xtime_get(&waitingTime, boost::TIME_UTC_); waitingTime.sec += 1; this->waitCondition.timed_wait(lock,waitingTime); } diff --git a/src/core/Library/LocalDB.cpp b/src/core/Library/LocalDB.cpp index 82b1280af..6e915affa 100644 --- a/src/core/Library/LocalDB.cpp +++ b/src/core/Library/LocalDB.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/Library/Remote.cpp b/src/core/Library/Remote.cpp index eaf59fa86..0ddfd8f47 100644 --- a/src/core/Library/Remote.cpp +++ b/src/core/Library/Remote.cpp @@ -34,11 +34,8 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif + #include #include #include diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index b7ad7b200..8177ea4d8 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -86,7 +86,7 @@ void PluginFactory::LoadPlugins(){ for(boost::filesystem::utfdirectory_iterator oFile(oDir);oFile!=oEndFile;++oFile){ if(boost::filesystem::is_regular(oFile->status())){ // This is a file - utfstring sFile(oFile->path().string()); + utfstring sFile(oFile->path().wstring()); #ifdef WIN32 if(sFile.substr(sFile.size()-4)==UTF(".dll")){ // And a DLL diff --git a/src/core/Query/Base.cpp b/src/core/Query/Base.cpp index 775935b01..4ca7b5862 100644 --- a/src/core/Query/Base.cpp +++ b/src/core/Query/Base.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/Query/Factory.cpp b/src/core/Query/Factory.cpp index 415796b12..39dd6a6ef 100644 --- a/src/core/Query/Factory.cpp +++ b/src/core/Query/Factory.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include diff --git a/src/core/Query/ListBase.cpp b/src/core/Query/ListBase.cpp index 70e32b807..1dafaa814 100644 --- a/src/core/Query/ListBase.cpp +++ b/src/core/Query/ListBase.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/Query/ListSelection.cpp b/src/core/Query/ListSelection.cpp index 8c8c68402..19061441e 100644 --- a/src/core/Query/ListSelection.cpp +++ b/src/core/Query/ListSelection.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/Query/SortTracks.cpp b/src/core/Query/SortTracks.cpp index 38620938f..6dfeab047 100644 --- a/src/core/Query/SortTracks.cpp +++ b/src/core/Query/SortTracks.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/Query/SortTracksWithData.cpp b/src/core/Query/SortTracksWithData.cpp index 7efb6c166..d92a9de8b 100644 --- a/src/core/Query/SortTracksWithData.cpp +++ b/src/core/Query/SortTracksWithData.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/Query/TrackMetadata.cpp b/src/core/Query/TrackMetadata.cpp index fa55fc125..6fa8dd44f 100644 --- a/src/core/Query/TrackMetadata.cpp +++ b/src/core/Query/TrackMetadata.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/audio/Buffer.cpp b/src/core/audio/Buffer.cpp index fcefcdc76..8bcdba86d 100644 --- a/src/core/audio/Buffer.cpp +++ b/src/core/audio/Buffer.cpp @@ -30,11 +30,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include diff --git a/src/core/audio/Player.cpp b/src/core/audio/Player.cpp index d9dfa1745..ed60da327 100644 --- a/src/core/audio/Player.cpp +++ b/src/core/audio/Player.cpp @@ -30,11 +30,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include @@ -144,8 +141,8 @@ int Player::State(){ void Player::ThreadLoop(){ // First start the stream - this->stream = Stream::Create(); - if(this->stream->OpenStream(this->url)){ + this->stream = Stream::Create(); + if (this->stream->OpenStream(this->url)) { { boost::mutex::scoped_lock lock(this->mutex); // Set the volume in the output @@ -153,16 +150,16 @@ void Player::ThreadLoop(){ } // If it's not started, lets precache - bool keepPrecaching(true); - while(this->State()==Precache && keepPrecaching){ - keepPrecaching = this->PreBuffer(); + bool keepPrecaching = true; + while(this->State() == Precache && keepPrecaching) { + keepPrecaching = this->PreBuffer(); boost::thread::yield(); } // Lets wait until we are not precaching anymore { boost::mutex::scoped_lock lock(this->mutex); - while(this->state==Precache){ + while (this->state==Precache) { this->waitCondition.wait(lock); } } @@ -172,14 +169,14 @@ void Player::ThreadLoop(){ // Player should be started or quit by now bool finished(false); while(!finished && !this->Exited()){ - if(this->setPosition!=-1){ + if(this->setPosition != -1) { // Set a new position this->output->ClearBuffers(); this->stream->SetPosition(this->setPosition); + { boost::mutex::scoped_lock lock(this->mutex); this->bufferQueue.clear(); -// this->lockedBuffers.clear(); this->setPosition = -1; this->totalBufferSize = 0; } @@ -190,23 +187,20 @@ void Player::ThreadLoop(){ // Get a buffer, either from the bufferQueue, or from the stream BufferPtr buffer; - if(!this->BufferQueueEmpty()){ + if (!this->BufferQueueEmpty()) { boost::mutex::scoped_lock lock(this->mutex); - buffer = this->bufferQueue.front(); - }else{ + buffer = this->bufferQueue.front(); + } + else { buffer = this->stream->NextBuffer(); - if(buffer){ + if(buffer) { boost::mutex::scoped_lock lock(this->mutex); this->bufferQueue.push_back(buffer); this->totalBufferSize += buffer->Bytes(); } - else { - - } } - if(buffer){ - + if(buffer) { { // Add the buffer to locked buffers so the output do not have time to play and // try to release the buffer before we have to add it. @@ -215,92 +209,87 @@ void Player::ThreadLoop(){ } // Try to play the buffer - if(!this->output->PlayBuffer(buffer.get(),this)){ + if(!this->output->PlayBuffer(buffer.get(),this)) { { // We didn't manage to play the buffer, remove it from the locked buffer queue boost::mutex::scoped_lock lock(this->mutex); this->lockedBuffers.pop_back(); } - if(!this->PreBuffer()){ -#ifdef _DEBUG - std::cerr << "!this->PreBuffer" << std::endl; -#endif + if(!this->PreBuffer()) { // Wait for buffersize to become smaller boost::mutex::scoped_lock lock(this->mutex); - if(this->totalBufferSize>this->maxBufferSize){ + if(this->totalBufferSize>this->maxBufferSize) { this->waitCondition.wait(lock); } - } - }else{ + } + else{ // Buffer send to output boost::mutex::scoped_lock lock(this->mutex); - if(!this->bufferQueue.empty()){ + if(!this->bufferQueue.empty()) { this->bufferQueue.pop_front(); // Set currentPosition - if(this->lockedBuffers.size()==1){ - this->currentPosition = buffer->Position(); + if(this->lockedBuffers.size() == 1){ + this->currentPosition = buffer->Position(); } } - } - }else{ + } + else{ // We have no more to decode - finished = true; + finished = true; } } - // TODO: call a signal to notify that player is almost done - if(!this->Exited()){ + if(!this->Exited()) { this->PlaybackAlmostEnded(this); } // We need to wait for all the lockedBuffers to be released bool buffersEmpty=false; - do{ + do { this->output->ReleaseBuffers(); { boost::mutex::scoped_lock lock(this->mutex); - buffersEmpty = this->lockedBuffers.empty(); - if(!buffersEmpty && this->state!=Player::Quit){ + buffersEmpty = this->lockedBuffers.empty(); + if(!buffersEmpty && this->state!=Player::Quit) { this->waitCondition.wait(lock); } } - }while(!buffersEmpty && !this->Exited()); + } while(!buffersEmpty && !this->Exited()); - }else{ + } + else { // Unable to open stream this->PlaybackError(this); } { boost::mutex::scoped_lock lock(this->mutex); - this->state = Player::Quit; + this->state = Player::Quit; } this->PlaybackEnded(this); - this->output->ReleaseBuffers(); - this->output.reset(); this->stream.reset(); - } -bool Player::BufferQueueEmpty(){ +bool Player::BufferQueueEmpty() { boost::mutex::scoped_lock lock(this->mutex); return this->bufferQueue.empty(); } bool Player::PreBuffer(){ // But not if buffer is full - if(this->totalBufferSize>this->maxBufferSize){ + if(this->totalBufferSize>this->maxBufferSize) { return false; - }else{ + } + else{ BufferPtr newBuffer = this->stream->NextBuffer(); - if(newBuffer){ + if(newBuffer) { boost::mutex::scoped_lock lock(this->mutex); this->bufferQueue.push_back(newBuffer); this->totalBufferSize += newBuffer->Bytes(); @@ -310,23 +299,23 @@ bool Player::PreBuffer(){ } } -bool Player::Exited(){ +bool Player::Exited() { boost::mutex::scoped_lock lock(this->mutex); return this->state==Player::Quit; } -void Player::ReleaseBuffer(IBuffer *buffer){ +void Player::ReleaseBuffer(IBuffer *buffer) { boost::mutex::scoped_lock lock(this->mutex); + // Remove the buffer from lockedBuffers - for(BufferList::iterator foundBuffer=this->lockedBuffers.begin();foundBuffer!=this->lockedBuffers.end();++foundBuffer){ - if(foundBuffer->get()==buffer){ -#ifdef _DEBUG - std::cerr << "Found buffer to delete in locked buffer list" << std::endl; -#endif + for (BufferList::iterator foundBuffer = this->lockedBuffers.begin(); foundBuffer != this->lockedBuffers.end(); ++foundBuffer) { + if (foundBuffer->get() == buffer) { this->totalBufferSize -= buffer->Bytes(); - if( this->stream ){ + + if(this->stream ) { this->stream->DeleteBuffer(*foundBuffer); } + this->lockedBuffers.erase(foundBuffer); // Calculate current position from front locked buffer @@ -339,11 +328,12 @@ void Player::ReleaseBuffer(IBuffer *buffer){ return; } } + // We should never reach this point //throw "Releasing nonexisting buffer"; } -void Player::Notify(){ +void Player::Notify() { this->waitCondition.notify_all(); } diff --git a/src/core/audio/Stream.cpp b/src/core/audio/Stream.cpp index e12dd2113..2d67f1179 100644 --- a/src/core/audio/Stream.cpp +++ b/src/core/audio/Stream.cpp @@ -30,11 +30,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/audio/Transport.cpp b/src/core/audio/Transport.cpp index 28bdd97c5..44cb474b2 100644 --- a/src/core/audio/Transport.cpp +++ b/src/core/audio/Transport.cpp @@ -30,12 +30,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif -#include #include diff --git a/src/core/config.h b/src/core/config.h index b70ab82b2..b8a0467b3 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -74,7 +74,7 @@ typedef unsigned int DBTIME; #include -#ifdef _MSC_VER +#if WIN32 ////////////////////////////////////////// ///\brief diff --git a/src/core/config_filesystem.h b/src/core/config_filesystem.h index f37d4d559..509a0cbe4 100644 --- a/src/core/config_filesystem.h +++ b/src/core/config_filesystem.h @@ -42,8 +42,8 @@ #ifdef UTF_WIDECHAR namespace boost{ namespace filesystem{ - typedef boost::filesystem::wpath utfpath; - typedef wdirectory_iterator utfdirectory_iterator; + typedef boost::filesystem::path utfpath; + typedef boost::filesystem::directory_iterator utfdirectory_iterator; } } #else diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj new file mode 100755 index 000000000..a84a49b4a --- /dev/null +++ b/src/core/core.vcxproj @@ -0,0 +1,255 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B2165720-B4B2-4F4B-9634-8C390C3CB4DB} + core + + + + StaticLibrary + Unicode + true + v140 + + + StaticLibrary + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)\ + obj/$(Configuration)\ + bin/$(Configuration)\ + obj/$(Configuration)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ./;../;../3rdparty/include/;../3rdparty/include/jpeg-6b;../../../boost_1_60_0;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;XML_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + pch.hpp + Level3 + EditAndContinue + + + + + MaxSpeed + Default + true + Neither + ./;../;../3rdparty/include/;../3rdparty/include/jpeg-6b;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_DEPRECATE;XML_STATIC;%(PreprocessorDefinitions) + MultiThreaded + Use + pch.hpp + + + + + Create + Create + + + + + + + + + + $(IntDir)%(Filename)2.obj + $(IntDir)%(Filename)2.xdc + $(IntDir)%(Filename)2.obj + $(IntDir)%(Filename)2.xdc + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + + + + + + + + + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {b2165720-b4b2-4f4b-8888-8c390c3cb4db} + false + + + + + + \ No newline at end of file diff --git a/src/core/db/CachedStatement.cpp b/src/core/db/CachedStatement.cpp index aa0ba38c5..20d6b274f 100644 --- a/src/core/db/CachedStatement.cpp +++ b/src/core/db/CachedStatement.cpp @@ -36,11 +36,7 @@ //#pragma once --- Unneccessary -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/db/Connection.cpp b/src/core/db/Connection.cpp index 3b14f0f81..e185c1b73 100644 --- a/src/core/db/Connection.cpp +++ b/src/core/db/Connection.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/db/ScopedTransaction.cpp b/src/core/db/ScopedTransaction.cpp index 9b28a736b..882827963 100644 --- a/src/core/db/ScopedTransaction.cpp +++ b/src/core/db/ScopedTransaction.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/db/Statement.cpp b/src/core/db/Statement.cpp index 30d91d870..f28624b6f 100644 --- a/src/core/db/Statement.cpp +++ b/src/core/db/Statement.cpp @@ -34,13 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -//#pragma once --- Unneccessary - -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/filestreams/Factory.cpp b/src/core/filestreams/Factory.cpp index 568492b8d..59aa7b68d 100644 --- a/src/core/filestreams/Factory.cpp +++ b/src/core/filestreams/Factory.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/filestreams/LocalFileStream.cpp b/src/core/filestreams/LocalFileStream.cpp index 0609d098f..8080094d0 100644 --- a/src/core/filestreams/LocalFileStream.cpp +++ b/src/core/filestreams/LocalFileStream.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include @@ -45,6 +42,7 @@ #include ////////////////////////////////////////////////////////////////////////////// + #ifdef UTF_WIDECHAR #define UTFFopen _wfopen typedef fpos_t stdioPositionType; @@ -52,103 +50,98 @@ typedef fpos_t stdioPositionType; #define UTFFopen fopen typedef fpos_t stdioPositionType; #endif -////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// using namespace musik::core::filestreams; ////////////////////////////////////////////////////////////////////////////// LocalFileStream::LocalFileStream() - :file(NULL) - ,filesize(-1) +: file(NULL) +, filesize(-1) { } -LocalFileStream::~LocalFileStream(){ +LocalFileStream::~LocalFileStream() { this->Close(); } bool LocalFileStream::Open(const utfchar *filename,unsigned int options){ - if(filename==NULL){ + if(filename == NULL) { return false; } - try{ + try { boost::filesystem::utfpath file(filename); if (!boost::filesystem::exists(file)) { std::cerr << "File not found" << std::endl; } + if (!boost::filesystem::is_regular(file)) { std::cerr << "File not a regular file" << std::endl; } + this->filesize = (long)boost::filesystem::file_size(file); - - this->extension = file.extension(); - + this->extension = file.extension().wstring(); this->file = UTFFopen(filename,UTF("rb")); - this->fd = new boost::iostreams::file_descriptor(file); - this->fileStream = new boost::iostreams::stream(*this->fd); + this->fileStream->exceptions(std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit); - this->fileStream->exceptions ( std::ios_base::eofbit | std::ios_base::failbit | std::ios_base::badbit ); return this->file!=NULL; - } - catch(...){ + catch(...) { return false; } } -bool LocalFileStream::Close(){ - if(this->file){ - if(fclose(this->file)==0){ +bool LocalFileStream::Close() { + if (this->file) { + if (fclose(this->file) == 0) { this->file = NULL; - delete this->fd; - delete this->fileStream; + delete this->fd; + delete this->fileStream; return true; } } + return false; } -void LocalFileStream::Destroy(){ +void LocalFileStream::Destroy() { delete this; } -PositionType LocalFileStream::Read(void* buffer,PositionType readBytes){ - //return (PositionType)fread(buffer,1,readBytes,this->file); +PositionType LocalFileStream::Read(void* buffer,PositionType readBytes) { try { - this->fileStream->read((char*)buffer, readBytes); + this->fileStream->read((char*) buffer, readBytes); } - catch (std::ios_base::failure) { - if(this->fileStream->eof()) { - //EOF reached - return sizeof(buffer); - } - else { - std::cerr << "Error reading from file" << std::endl; - } - return 0; + catch (std::ios_base::failure){ + if(!this->fileStream->eof()) { + std::cerr << "Error reading from file" << std::endl; + return 0; + } } - return readBytes; + + return this->fileStream->gcount(); } -bool LocalFileStream::SetPosition(PositionType position){ +bool LocalFileStream::SetPosition(PositionType position) { /*stdioPositionType newPosition = (stdioPositionType)position; return fsetpos(this->file,&newPosition)==0;*/ try { - this->fileStream->seekp(position); - this->fileStream->seekg(position); + this->fileStream->clear(); + this->fileStream->seekg(position); } - catch (std::ios_base::failure) { + catch (std::ios_base::failure ex) { return false; } + return true; } -PositionType LocalFileStream::Position(){ +PositionType LocalFileStream::Position() { /*stdioPositionType currentPosition(0); if(fgetpos(this->file,¤tPosition)==0){ return (PositionType)currentPosition; @@ -157,16 +150,15 @@ PositionType LocalFileStream::Position(){ return this->fileStream->tellg(); } -bool LocalFileStream::Eof(){ +bool LocalFileStream::Eof() { //return feof(this->file)!=0; return this->fileStream->eof(); } -long LocalFileStream::Filesize(){ +long LocalFileStream::Filesize() { return this->filesize; } -const utfchar* LocalFileStream::Type(){ +const utfchar* LocalFileStream::Type() { return this->extension.c_str(); -} - +} \ No newline at end of file diff --git a/src/core/http/RequestParser.cpp b/src/core/http/RequestParser.cpp index de4d0b54f..dbdff809f 100644 --- a/src/core/http/RequestParser.cpp +++ b/src/core/http/RequestParser.cpp @@ -34,12 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif - #include #include diff --git a/src/core/http/Responder.cpp b/src/core/http/Responder.cpp index 48c016f1f..46f432909 100644 --- a/src/core/http/Responder.cpp +++ b/src/core/http/Responder.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/http/Server.cpp b/src/core/http/Server.cpp index 849f2ccf2..a066bc340 100644 --- a/src/core/http/Server.cpp +++ b/src/core/http/Server.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/http/TrackSender.cpp b/src/core/http/TrackSender.cpp index 253a2f316..b0172a5f1 100644 --- a/src/core/http/TrackSender.cpp +++ b/src/core/http/TrackSender.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/pch.hpp b/src/core/pch.hpp index 2da1181b3..8bc82ef80 100644 --- a/src/core/pch.hpp +++ b/src/core/pch.hpp @@ -35,17 +35,18 @@ ////////////////////////////////////////////////////////////////////////////// // Precompiled headers -#pragma once +#ifdef WIN32 -//#pragma warning (disable : 4996 4018 4482) + //#pragma warning (disable : 4996 4018 4482) -#include + #include -#include -#include -#include + #include + #include + #include -#include -#include -#include + #include + #include + #include +#endif \ No newline at end of file diff --git a/src/core/server/Connection.cpp b/src/core/server/Connection.cpp index c79faa3af..5b5291430 100644 --- a/src/core/server/Connection.cpp +++ b/src/core/server/Connection.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include @@ -271,7 +268,7 @@ void Connection::WriteThread(){ { boost::mutex::scoped_lock lock(this->libraryMutex); boost::xtime waitTime; - boost::xtime_get(&waitTime, boost::TIME_UTC); + boost::xtime_get(&waitTime, boost::TIME_UTC_); waitTime.sec += 30; if(!this->userSession){ diff --git a/src/core/server/User.cpp b/src/core/server/User.cpp index 8fc9b7d7f..1ff0e4cf7 100644 --- a/src/core/server/User.cpp +++ b/src/core/server/User.cpp @@ -33,13 +33,10 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 -#include "pch.hpp" -#else -#include -#endif +#include "pch.hpp" #include + ////////////////////////////////////////////////////////////////////////////// using namespace musik::core::server; diff --git a/src/core/server/UserSession.cpp b/src/core/server/UserSession.cpp index 91d6ed66a..2755b1e1c 100644 --- a/src/core/server/UserSession.cpp +++ b/src/core/server/UserSession.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include diff --git a/src/core/tracklist/Base.cpp b/src/core/tracklist/Base.cpp index 84cf34bfc..f0107a4a9 100644 --- a/src/core/tracklist/Base.cpp +++ b/src/core/tracklist/Base.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include diff --git a/src/core/tracklist/LibraryList.cpp b/src/core/tracklist/LibraryList.cpp index 0581001b0..c2eaa1f6b 100644 --- a/src/core/tracklist/LibraryList.cpp +++ b/src/core/tracklist/LibraryList.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/tracklist/MultiLibraryList.cpp b/src/core/tracklist/MultiLibraryList.cpp index 50ba54d58..b78406474 100644 --- a/src/core/tracklist/MultiLibraryList.cpp +++ b/src/core/tracklist/MultiLibraryList.cpp @@ -34,11 +34,7 @@ // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/xml/Node.cpp b/src/core/xml/Node.cpp index e433d1396..462449308 100644 --- a/src/core/xml/Node.cpp +++ b/src/core/xml/Node.cpp @@ -33,11 +33,7 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include "Node.h" #include diff --git a/src/core/xml/Parser.cpp b/src/core/xml/Parser.cpp index dc6832a84..21aa2eebf 100644 --- a/src/core/xml/Parser.cpp +++ b/src/core/xml/Parser.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/xml/ParserNode.cpp b/src/core/xml/ParserNode.cpp index 5f03b1893..3ee735d3f 100644 --- a/src/core/xml/ParserNode.cpp +++ b/src/core/xml/ParserNode.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/xml/Socket.cpp b/src/core/xml/Socket.cpp index 4501be057..043509b41 100644 --- a/src/core/xml/Socket.cpp +++ b/src/core/xml/Socket.cpp @@ -33,11 +33,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 + #include "pch.hpp" -#else -#include -#endif #include diff --git a/src/core/xml/Writer.cpp b/src/core/xml/Writer.cpp index a920b9f1e..bfca13a91 100644 --- a/src/core/xml/Writer.cpp +++ b/src/core/xml/Writer.cpp @@ -33,11 +33,7 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 #include "pch.hpp" -#else -#include -#endif #include #include diff --git a/src/core/xml/WriterNode.cpp b/src/core/xml/WriterNode.cpp index 53a15c09c..1afc28d53 100644 --- a/src/core/xml/WriterNode.cpp +++ b/src/core/xml/WriterNode.cpp @@ -33,14 +33,14 @@ // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 -#include "pch.hpp" -#else -#include -#endif +//#ifdef WIN32 + #include "pch.hpp" +//#else +// #include +//#endif -#include -#include +#include "WriterNode.h" +#include "Writer.h" using namespace musik::core::xml; diff --git a/src/square/player.vcxproj b/src/square/player.vcxproj new file mode 100755 index 000000000..06b4cc0f6 --- /dev/null +++ b/src/square/player.vcxproj @@ -0,0 +1,133 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + square + {C7102EB1-7311-4B36-A7FF-89DD7F077FF9} + square + Win32Proj + + + + Application + Unicode + true + v140 + + + Application + false + false + Unicode + v140 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)/bin/$(Configuration)\ + obj/$(Configuration)\ + true + $(SolutionDir)/bin/$(Configuration)\ + $(SolutionDir)/obj/$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ../;../3rdparty/include;../../../boost_1_60_0;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + + + ../3rdparty/lib;../../../boost_1_60_0/lib32-msvc-14.0;%(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + true + Console + ../../bin/$(Configuration)/mC2.lib + MachineX86 + + + copy "$(SolutionDir)\src\3rdparty\vld\*.*" "$(TargetDir)" + + + + + ../;../3rdparty/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Use + Level3 + ProgramDatabase + + + ../3rdparty/lib;%(AdditionalLibraryDirectories) + %(IgnoreSpecificDefaultLibraries) + false + Console + + + + + + + MachineX86 + + + + + + + + Create + Create + + + + + + + + + + + {b2165720-b4b2-4f4b-8888-8c390c3cb4db} + false + + + {b2165720-b4b2-4f4b-9634-8c390c3cb4db} + false + + + + + + \ No newline at end of file